aboutsummaryrefslogtreecommitdiffstats
path: root/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase
diff options
context:
space:
mode:
Diffstat (limited to 'dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase')
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/bg-top-bar.pngbin0 -> 215 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/checkmark_yes.gifbin0 -> 145 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/downCaret.gifbin0 -> 2951 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/home-icon.pngbin0 -> 3483 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/cut.gifbin0 -> 532 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/door.gifbin0 -> 580 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/export.gifbin0 -> 613 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/import.gifbin0 -> 605 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_add.gifbin0 -> 163 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_copy.gifbin0 -> 361 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_delete.gifbin0 -> 568 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_edit.gifbin0 -> 576 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_paste.gifbin0 -> 607 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/trash.gifbin0 -> 617 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_0_aaaaaa_40x100.pngbin0 -> 212 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_75_ffffff_40x100.pngbin0 -> 208 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_55_fbf9ee_1x400.pngbin0 -> 335 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 207 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_dadada_1x400.pngbin0 -> 262 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_e6e6e6_1x400.pngbin0 -> 262 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_95_fef1ec_1x400.pngbin0 -> 332 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_highlight-soft_75_cccccc_1x100.pngbin0 -> 280 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_222222_256x240.pngbin0 -> 6922 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_2e83ff_256x240.pngbin0 -> 4549 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_454545_256x240.pngbin0 -> 6992 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_888888_256x240.pngbin0 -> 6999 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_cd0a0a_256x240.pngbin0 -> 4549 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/pipe.pngbin0 -> 153 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/selfArrow.pngbin0 -> 3658 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/smallPostit.pngbin0 -> 17715 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCan.gifbin0 -> 54898 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCanFull.gifbin0 -> 85500 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/triangle.pngbin0 -> 289757 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/index.html14
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/mocks/networkElements.yml95
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/BPMNconversion.js208
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/app.js55
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js356
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrows.js213
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/ase.js112
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/backend.js827
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/.bower.json35
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/CONTRIBUTING3
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/Gruntfile.js62
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/LICENSE202
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/NOTICE190
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/README.md68
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/bower.json25
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/component.json13
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg-min.js21
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg.js8170
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/dr.css144
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/main.css508
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/prism.css168
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/topcoat-desktop-light.css3700
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.eotbin0 -> 23949 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.svg242
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.ttfbin0 -> 52660 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.woffbin0 -> 27068 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.eotbin0 -> 23716 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.svg243
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.ttfbin0 -> 51876 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.woffbin0 -> 26716 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.eotbin0 -> 23970 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.svg243
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.ttfbin0 -> 52456 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.woffbin0 -> 27076 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.eotbin0 -> 23974 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.svg243
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.ttfbin0 -> 51960 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.woffbin0 -> 27048 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/stylesheet.css57
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search.svg11
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search_dark.svg16
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/js/prism.js9
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/reference.html14816
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dr.json39
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/history.md49
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/package.json24
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/template.dot157
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/test.html17
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.bower.json30
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.gitignore1
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/LICENSE22
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/README.md46
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/bower.json20
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css150
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn.css152
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.eotbin0 -> 40720 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.svg107
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.ttfbin0 -> 40568 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.woffbin0 -> 13784 bytes
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/diagram-js.css457
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js43358
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js.map1
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.min.js14
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js27371
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js.map1
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.min.js9
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js27080
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js.map1
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.min.js9
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/.bower.json28
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/ChangeLog.md147
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/LICENSE.txt37
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/README.md76
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/bower.json17
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.js221
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.min.js8
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/.bower.json31
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/LICENSE22
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/bower.json19
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.js12351
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.min.js99
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/sax/lib/sax.js1430
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/buttons.js382
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/convertToYaml.js73
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/customContextMenus.js1489
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/Blob.js211
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/base64.js143
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/interact.js5963
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/jquery-2.1.4.min.js4
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/js-yaml.js3960
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/saveSvgAsPng.js170
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dictionary.js614
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListener.js55
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js44
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dropzones.js704
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/elements_ase.js76
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootbox.js986
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootstrap.min.js7
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/contextMenu.js1692
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery-ui.min.js13
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery.tooltipster.js1327
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/nodes.js1290
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/notes.js152
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/printpdf.js519
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/resizable.js159
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/scroll.js77
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/services.js86
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/bs.css677
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/jquery-ui.css1227
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/tooltipster.css294
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/style.css1028
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/ase_view.html0
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/grid_view.html0
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/index.html159
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/sidebar_view.html0
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/topbar_view.html6
149 files changed, 168257 insertions, 0 deletions
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/bg-top-bar.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/bg-top-bar.png
new file mode 100644
index 0000000..3a0a757
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/bg-top-bar.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/checkmark_yes.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/checkmark_yes.gif
new file mode 100644
index 0000000..113cd34
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/checkmark_yes.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/downCaret.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/downCaret.gif
new file mode 100644
index 0000000..304b645
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/downCaret.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/home-icon.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/home-icon.png
new file mode 100644
index 0000000..bf09c85
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/home-icon.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/cut.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/cut.gif
new file mode 100644
index 0000000..2dcdc84
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/cut.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/door.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/door.gif
new file mode 100644
index 0000000..5705b17
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/door.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/export.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/export.gif
new file mode 100644
index 0000000..fdc232e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/export.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/import.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/import.gif
new file mode 100644
index 0000000..f730614
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/import.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_add.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_add.gif
new file mode 100644
index 0000000..c6268e7
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_add.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_copy.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_copy.gif
new file mode 100644
index 0000000..55e0d29
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_copy.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_delete.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_delete.gif
new file mode 100644
index 0000000..8db60b8
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_delete.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_edit.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_edit.gif
new file mode 100644
index 0000000..af1b38c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_edit.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_paste.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_paste.gif
new file mode 100644
index 0000000..87a9ae2
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/page_white_paste.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/trash.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/trash.gif
new file mode 100644
index 0000000..3969ca5
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/trash.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_0_aaaaaa_40x100.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100644
index 0000000..d0605e8
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_0_aaaaaa_40x100.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_75_ffffff_40x100.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_75_ffffff_40x100.png
new file mode 100644
index 0000000..e812e18
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_flat_75_ffffff_40x100.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_55_fbf9ee_1x400.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100644
index 0000000..f28febb
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_55_fbf9ee_1x400.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_65_ffffff_1x400.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644
index 0000000..d252f8a
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_65_ffffff_1x400.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_dadada_1x400.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_dadada_1x400.png
new file mode 100644
index 0000000..b83c741
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_dadada_1x400.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_e6e6e6_1x400.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100644
index 0000000..7ee6413
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_75_e6e6e6_1x400.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_95_fef1ec_1x400.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100644
index 0000000..6d22f1e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_glass_95_fef1ec_1x400.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_highlight-soft_75_cccccc_1x100.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100644
index 0000000..2a93588
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-bg_highlight-soft_75_cccccc_1x100.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_222222_256x240.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_222222_256x240.png
new file mode 100644
index 0000000..e9c8e16
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_222222_256x240.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_2e83ff_256x240.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_2e83ff_256x240.png
new file mode 100644
index 0000000..f2bf838
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_2e83ff_256x240.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_454545_256x240.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_454545_256x240.png
new file mode 100644
index 0000000..d6169e8
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_454545_256x240.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_888888_256x240.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_888888_256x240.png
new file mode 100644
index 0000000..d3e6e02
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_888888_256x240.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_cd0a0a_256x240.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_cd0a0a_256x240.png
new file mode 100644
index 0000000..4937018
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/menus/ui-icons_cd0a0a_256x240.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/pipe.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/pipe.png
new file mode 100644
index 0000000..90dea7d
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/pipe.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/selfArrow.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/selfArrow.png
new file mode 100644
index 0000000..918b8b7
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/selfArrow.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/smallPostit.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/smallPostit.png
new file mode 100644
index 0000000..46c47f0
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/smallPostit.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCan.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCan.gif
new file mode 100644
index 0000000..9fc7dbe
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCan.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCanFull.gif b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCanFull.gif
new file mode 100644
index 0000000..8cd06f1
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/trashCanFull.gif
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/triangle.png b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/triangle.png
new file mode 100644
index 0000000..f15527d
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/images/triangle.png
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/index.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/index.html
new file mode 100644
index 0000000..d1d4b11
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/index.html
@@ -0,0 +1,14 @@
+<!-- <!DOCTYPE html>
+<html>
+<head>
+<script>
+document.location="./view-models/index.html";
+</script>
+</head>
+<body>
+</body>
+</html> -->
+
+<div>
+ <iframe style="width:1500px; height:800px;" src="app/fusion/ase/view-models/index.html"></iframe>
+</div>
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/mocks/networkElements.yml b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/mocks/networkElements.yml
new file mode 100644
index 0000000..9437cfa
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/mocks/networkElements.yml
@@ -0,0 +1,95 @@
+elementsList:
+- {displayShortname: eNB, enclosingDomain: RAN, tosca_id: com.trinity.ran.enodeb}
+- {displayShortname: SIAD, enclosingDomain: RAN, tosca_id: com.trinity.ran.siad}
+- {displayShortname: NodeB, enclosingDomain: RAN, tosca_id: com.trinity.ran.nb}
+- {displayShortname: MGCF eMSC, enclosingDomain: RAN, tosca_id: com.trinity.ran.emsc}
+- {displayShortname: RNC, enclosingDomain: RAN, tosca_id: com.trinity.ran.rnc}
+- {displayShortname: MGW, enclosingDomain: RAN, tosca_id: com.trinity.ran.mgw}
+- {displayShortname: SS7 GPORT, enclosingDomain: RAN, tosca_id: com.trinity.ran.ss7_gport}
+- {displayShortname: MSN, enclosingDomain: RAN, tosca_id: com.trinity.ran.msn}
+- {displayShortname: E-SMLC, enclosingDomain: RAN, tosca_id: com.trinity.ran.e_smlc}
+- {displayShortname: SGSN-S4, enclosingDomain: EPC, tosca_id: com.trinity.epc.sgsn_s4}
+- {displayShortname: MME, enclosingDomain: EPC, tosca_id: com.trinity.epc.mme}
+- {displayShortname: P_LRF (RDF), enclosingDomain: EPC, tosca_id: com.trinity.epc.p_lrf}
+- {displayShortname: GMLC, enclosingDomain: EPC, tosca_id: com.trinity.epc.gmlc}
+- {displayShortname: PCEF, enclosingDomain: EPC, tosca_id: com.trinity.epc.pcef}
+- {displayShortname: SDG, enclosingDomain: EPC, tosca_id: com.trinity.epc.sdg}
+- {displayShortname: P-GW, enclosingDomain: EPC, tosca_id: com.trinity.epc.p_gw}
+- {displayShortname: S-GW, enclosingDomain: EPC, tosca_id: com.trinity.epc.s_gw}
+- {displayShortname: PAS, enclosingDomain: EPC, tosca_id: com.trinity.epc.pas}
+- {displayShortname: PCRF, enclosingDomain: EPC, tosca_id: com.trinity.epc.pcrf}
+- {displayShortname: MIND, enclosingDomain: EPC, tosca_id: com.trinity.epc.mind}
+- {displayShortname: APN DNS, enclosingDomain: EPC, tosca_id: com.trinity.epc.apn_dns}
+- {displayShortname: DRA EPC, enclosingDomain: EPC, tosca_id: com.trinity.epc.dra_epc}
+- {displayShortname: HSS EPC, enclosingDomain: EPC, tosca_id: com.trinity.epc.hss_epc}
+- {displayShortname: HLR, enclosingDomain: EPC, tosca_id: com.trinity.epc.hlr}
+- {displayShortname: CPM, enclosingDomain: EPC, tosca_id: com.trinity.epc.cpm}
+- {displayShortname: P-LRF/RDF, enclosingDomain: EPC, tosca_id: com.trinity.epc.p_lrf_sup}
+- {displayShortname: SBC, enclosingDomain: USP, tosca_id: com.trinity.usp.sbc}
+- {displayShortname: ATGW, enclosingDomain: USP, tosca_id: com.trinity.usp.atgw}
+- {displayShortname: IWF, enclosingDomain: USP, tosca_id: com.trinity.usp.iwf}
+- {displayShortname: ATCF, enclosingDomain: USP, tosca_id: com.trinity.usp.atcf}
+- {displayShortname: P-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.p_cscf}
+- {displayShortname: Transcoder, enclosingDomain: USP, tosca_id: com.trinity.usp.transcoder}
+- {displayShortname: I-SBC, enclosingDomain: USP, tosca_id: com.trinity.usp.i_sbc}
+- {displayShortname: SCC-AS, enclosingDomain: USP, tosca_id: com.trinity.usp.scc_as}
+- {displayShortname: EATF, enclosingDomain: USP, tosca_id: com.trinity.usp.eatf}
+- {displayShortname: TAS, enclosingDomain: USP, tosca_id: com.trinity.usp.tas_cts}
+- {displayShortname: S-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.s_cscf}
+- {displayShortname: E-CSCF (911), enclosingDomain: USP, tosca_id: com.trinity.usp.e_cscf}
+- {displayShortname: I-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.i_cscf}
+- {displayShortname: TF / BGCF, enclosingDomain: USP, tosca_id: com.trinity.usp.tf_bgcf}
+- {displayShortname: MGC-8, enclosingDomain: USP, tosca_id: com.trinity.usp.mgc8}
+- {displayShortname: MRF, enclosingDomain: USP, tosca_id: com.trinity.usp.mrf}
+- {displayShortname: USP DNS, enclosingDomain: USP, tosca_id: com.trinity.usp.dns}
+- {displayShortname: DRA IMS, enclosingDomain: USP, tosca_id: com.trinity.usp.dra_ims}
+- {displayShortname: ENUM, enclosingDomain: USP, tosca_id: com.trinity.usp.enum}
+- {displayShortname: HSS IMS, enclosingDomain: USP, tosca_id: com.trinity.usp.hss_ims}
+- {displayShortname: CCF, enclosingDomain: "", tosca_id: com.trinity."".dc1.ccf}
+- {displayShortname: BGF, enclosingDomain: "", tosca_id: com.trinity."".dc1.bgf}
+- {displayShortname: vMS, enclosingDomain: "", tosca_id: com.trinity."".dc1.ms}
+- {displayShortname: vNS, enclosingDomain: "", tosca_id: com.trinity."".dc1.ns}
+- {displayShortname: vAS, enclosingDomain: "", tosca_id: com.trinity."".dc1.as}
+- {displayShortname: vA-SBG, enclosingDomain: "", tosca_id: com.trinity."".dc1.a_sbg}
+- {displayShortname: vDBE, enclosingDomain: "", tosca_id: com.trinity."".dc1.dbe}
+- {displayShortname: vN-SBG, enclosingDomain: "", tosca_id: com.trinity."".dc1.n_sbg}
+- {displayShortname: CCF, enclosingDomain: "", tosca_id: com.trinity."".dc2.ccf}
+- {displayShortname: BGF, enclosingDomain: "", tosca_id: com.trinity."".dc2.bgf}
+- {displayShortname: vMS, enclosingDomain: "", tosca_id: com.trinity."".dc2.ms}
+- {displayShortname: vNS, enclosingDomain: "", tosca_id: com.trinity."".dc2.ns}
+- {displayShortname: vAS, enclosingDomain: "", tosca_id: com.trinity."".dc2.as}
+- {displayShortname: vA-SBG, enclosingDomain: "", tosca_id: com.trinity."".dc2.a_sbg}
+- {displayShortname: vDBE, enclosingDomain: "", tosca_id: com.trinity."".dc2.dbe}
+- {displayShortname: vN-SBG, enclosingDomain: "", tosca_id: com.trinity."".dc2.n_sbg}
+- {displayShortname: PSX SIP, enclosingDomain: VNI, tosca_id: com.trinity.vni.sip_psx}
+- {displayShortname: PSX Policy, enclosingDomain: VNI, tosca_id: com.trinity.vni.policy_psx}
+- {displayShortname: IPBE, enclosingDomain: VNI, tosca_id: com.trinity.vni.ipbe}
+- {displayShortname: GSX, enclosingDomain: VNI, tosca_id: com.trinity.vni.gsx}
+- {displayShortname: BVoIP AS, enclosingDomain: VNI, tosca_id: com.trinity.vni.bvoip_as}
+- {displayShortname: NGBE, enclosingDomain: VNI, tosca_id: com.trinity.vni.ngbe}
+- {displayShortname: VoLTE UE, enclosingDomain: RAN, tosca_id: com.trinity.ue1}
+- {displayShortname: 3G UE, enclosingDomain: RAN, tosca_id: com.trinity.ue2}
+- {displayShortname: Trinity UE-A, enclosingDomain: "", tosca_id: com.trinity.ue3}
+- {displayShortname: Trinity UE-B, enclosingDomain: "", tosca_id: com.trinity.ue4}
+- {displayShortname: VNI UE-PBX, enclosingDomain: VNI, tosca_id: com.trinity.ue5}
+- {displayShortname: PSTN, enclosingDomain: VNI, tosca_id: com.trinity.ue6}
+- {displayShortname: Intrado SBC, enclosingDomain: NotApplicable, tosca_id: com.trinity.intrado_sbc}
+- {displayShortname: FMCC, enclosingDomain: NotApplicable, tosca_id: com.trinity.fmcc}
+- {displayShortname: ESGW, enclosingDomain: NotApplicable, tosca_id: com.trinity.esgw}
+- {displayShortname: PSAP, enclosingDomain: NotApplicable, tosca_id: com.trinity.psap}
+- {displayShortname: IPFR User, enclosingDomain: NotApplicable, tosca_id: com.trinity.ipfr_user}
+- {displayShortname: PBX, enclosingDomain: NotApplicable, tosca_id: com.trinity.pbx}
+- {displayShortname: IPBE, enclosingDomain: NotApplicable, tosca_id: com.trinity.ipbe}
+- {displayShortname: MGCF/eMSC, enclosingDomain: NotApplicable, tosca_id: com.trinity.mgcf_msc}
+- {displayShortname: 3G UE, enclosingDomain: NotApplicable, tosca_id: com.trinity.2G_3G_Endpoint}
+- {displayShortname: IPBE, enclosingDomain: NotApplicable, tosca_id: com.trinity.vni.pstn_tdm}
+- {displayShortname: PSTN, enclosingDomain: NotApplicable, tosca_id: com.trinity.pstn}
+- {displayShortname: AT&T LNS Switch, enclosingDomain: NotApplicable, tosca_id: com.trinity.att_lns_switch}
+- {displayShortname: SGX, enclosingDomain: NotApplicable, tosca_id: com.trinity.sgx}
+- {displayShortname: CNAM DB, enclosingDomain: NotApplicable, tosca_id: com.trinity.cnam_db}
+- {displayShortname: LEA, enclosingDomain: VNI, tosca_id: com.trinity.ue10}
+- {displayShortname: SS8 LIG, enclosingDomain: VNI, tosca_id: com.trinity.ue9}
+- {displayShortname: PGW, enclosingDomain: NotApplicable, tosca_id: com.trinity.usp.pgw}
+- {displayShortname: SGW, enclosingDomain: NotApplicable, tosca_id: com.trinity.usp.sgw}
+- {displayShortname: PSTN-TDM Switch, enclosingDomain: VNI, tosca_id: com.trinity.ue7}
+- {displayShortname: PSAP, enclosingDomain: EPC, tosca_id: com.trinity.ue8}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/BPMNconversion.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/BPMNconversion.js
new file mode 100644
index 0000000..1dded39
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/BPMNconversion.js
@@ -0,0 +1,208 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains functions to convert diagram to BPMN and display in a #canvas div
+var xmlText=null;
+var lifelineBPMN = [];
+var nodeXVal = [];
+function convertToBPMN (m,BPMNFilename,whatToDo) {
+ if (whatToDo!='source'){
+ bootbox.hideAll();
+ }
+
+ m = decodeJSON(m);
+ n = JSON.parse(m);
+ $.each(n.diagram.elements.nodes, function(index, value) {
+ var newText = value.innerText.replace(/&/g,"&amp;")
+ .replace(/"/g,"&quot;")
+ .replace(/'/g,"&apos;")
+ .replace(/</g,"&lt;")
+ .replace(/>/g,"&gt;");
+ value.innerText = newText;
+ });
+ var elementList = n.diagram.elements; //stores all elements
+ var allNodes = n.diagram.elements.nodes;
+ var allArrows = n.diagram.elements.arrows;
+ var allNotes = n.diagram.elements.notes;
+ var loadedRows = n.diagram.rows;
+ var loadedCols = n.diagram.cols;
+ var description = n.diagram.description;
+ var transposeDown = 75;
+ xmlText = '';
+ lifelineBPMN.length=0;
+ lifelineBPMN = [];
+ nodeXVal.length=0;
+ nodeXVal = [];
+ xmlText = '<?xml version="1.0" encoding="UTF-8"?>\n';
+ xmlText += '<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">\n';
+ xmlText += ' <bpmn:process id="Process_1" isExecutable="false">\n'
+ for (var i=0; i<allNodes.length; i++){
+ getStartArrowDependants(allNodes[i].id);
+ getEndArrowDependants(allNodes[i].id);
+ xmlText += ' <bpmn:task id="'+allNodes[i].id+'" name="'+allNodes[i].innerText+'">\n'
+ for (var j=0; j<startArrowDependants.length;j++){
+ xmlText += ' <bpmn:outgoing>'+startArrowDependants[j]+'</bpmn:outgoing>\n'
+ }
+ for (var j=0; j<endArrowDependants.length;j++){
+ xmlText += ' <bpmn:incoming>'+endArrowDependants[j]+'</bpmn:incoming>\n'
+ }
+ xmlText += ' </bpmn:task>\n'
+ var tempId = guid();//
+ lifelineBPMN.push(tempId);//
+ xmlText += ' <bpmn:task id="'+tempId+'" name="" />\n'//
+ }
+ for (var i=0; i<allArrows.length; i++){
+ xmlText += ' <bpmn:sequenceFlow id="'+arrowArr[i][1]+'" name="'+arrowArr[i][2]+'" sourceRef="'+arrowArr[i][8]+'" targetRef="'+arrowArr[i][9]+'" />\n'
+ }
+ xmlText += ' </bpmn:process>\n'
+ xmlText += ' <bpmndi:BPMNDiagram id="BpmnDiagram_1">\n'
+ xmlText += ' <bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">\n'
+ var maxY = 0;
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])>maxY){
+ maxY = parseInt(arrowArr[i][4]);
+ }
+ }
+ for (var i=0; i<allNodes.length; i++){
+ xmlText += ' <bpmndi:BPMNShape id="'+allNodes[i].id+'_di" bpmnElement="'+allNodes[i].id+'">\n'
+ xmlText += ' <dc:Bounds x="'+parseInt(50+i*150)+'" y="50" width="100" height="80" />\n'
+ xmlText += ' </bpmndi:BPMNShape>\n'
+
+ xmlText += ' <bpmndi:BPMNShape id="'+lifelineBPMN[i]+'_di" bpmnElement="'+lifelineBPMN[i]+'">\n'//
+ xmlText += ' <dc:Bounds x="'+parseInt(100+i*150)+'" y="130" width="2" height="'+parseInt(maxY-25)+'" />\n'//
+ nodeXVal.push(parseInt(100+i*150));
+ xmlText += ' </bpmndi:BPMNShape>\n'//
+ }
+
+ for (var i=0; i<allArrows.length; i++){
+ var arrowIndex = recallArray(arrowArr,allArrows[i].id);
+ if (arrowArr[arrowIndex][8]!=arrowArr[arrowIndex][9]){
+ xmlText += ' <bpmndi:BPMNEdge id="'+allArrows[i].id+'_di" bpmnElement="'+allArrows[i].id+'">\n'
+ for (var j=0; j<nodeArr.length; j++){
+ if(arrowArr[arrowIndex][8]==nodeArr[j][1]){
+ var startNodeIndex = j
+ }
+ if(arrowArr[arrowIndex][9]==nodeArr[j][1]){
+ var endNodeIndex = j
+ }
+ }
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+nodeXVal[startNodeIndex]+'" y="'+(parseInt(arrowArr[arrowIndex][4])+parseInt(transposeDown))+'" />\n'
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+nodeXVal[endNodeIndex]+'" y="'+(parseInt(arrowArr[arrowIndex][4])+parseInt(transposeDown))+'" />\n'
+ xmlText += ' <bpmndi:BPMNLabel>\n'
+ var textWidth = parseInt((arrowArr[arrowIndex][2]).length) * 6
+ if (nodeXVal[startNodeIndex]<nodeXVal[endNodeIndex]){ //Points right, so place text left
+ xmlText += ' <dc:Bounds x="'+((nodeXVal[startNodeIndex]+nodeXVal[endNodeIndex])/2-(textWidth/2))+'" y="'+parseInt(parseInt(arrowArr[arrowIndex][4])+parseInt(transposeDown)-20)+'" width="'+textWidth+'" height="20" />\n'
+ }
+ else{ //Points left, so place text right
+ xmlText += ' <dc:Bounds x="'+((nodeXVal[startNodeIndex]+nodeXVal[endNodeIndex])/2-(textWidth/2))+'" y="'+parseInt(parseInt(arrowArr[arrowIndex][4])+parseInt(transposeDown)-20)+'" width="'+textWidth+'" height="20" />\n'
+ }
+ xmlText += ' </bpmndi:BPMNLabel>\n'
+ xmlText += ' </bpmndi:BPMNEdge>\n'
+ }
+ else{
+ xmlText += ' <bpmndi:BPMNEdge id="'+allArrows[i].id+'_di" bpmnElement="'+allArrows[i].id+'">\n'
+ for (var j=0; j<nodeArr.length; j++){
+ if(arrowArr[arrowIndex][8]==nodeArr[j][1]){
+ var startNodeIndex = j
+ }
+ }
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+nodeXVal[startNodeIndex]+'" y="'+(parseInt(arrowArr[arrowIndex][4])+transposeDown-10)+'" />\n'
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+(parseInt(nodeXVal[startNodeIndex])+20)+'" y="'+(parseInt(arrowArr[arrowIndex][4])+transposeDown-10)+'" />\n'
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+(parseInt(nodeXVal[startNodeIndex])+20)+'" y="'+(parseInt(arrowArr[arrowIndex][4])+transposeDown+10)+'" />\n'
+ xmlText += ' <di:waypoint xsi:type="dc:Point" x="'+nodeXVal[startNodeIndex]+'" y="'+(parseInt(arrowArr[arrowIndex][4])+transposeDown+10)+'" />\n'
+ xmlText += ' <bpmndi:BPMNLabel>\n'
+ var textWidth = parseInt((arrowArr[arrowIndex][2]).length) * 6
+ xmlText += ' <dc:Bounds x="'+parseInt(nodeXVal[startNodeIndex]+20-textWidth/36)+'" y="'+parseInt(parseInt(arrowArr[arrowIndex][4])+transposeDown-10)+'" width="'+textWidth+'" height="20" />\n'
+ xmlText += ' </bpmndi:BPMNLabel>\n'
+ xmlText += ' </bpmndi:BPMNEdge>\n'
+ }
+ }
+
+ xmlText += ' </bpmndi:BPMNPlane>\n'
+ xmlText += ' </bpmndi:BPMNDiagram>\n'
+ xmlText += '</bpmn:definitions>'
+
+ //alert(xmlText);
+
+ if (whatToDo=="save"){
+ var textToWrite = xmlText
+ var blob = new Blob([textToWrite], {type: "text/plain;charset=utf-8"});
+
+ var downloadLink = document.createElement("a");
+
+ filename = BPMNFilename + ".BPMN";
+
+ downloadLink.download = filename;
+ downloadLink.innerHTML="Download File";
+ downloadLink.href = window.webkitURL.createObjectURL(blob);
+ downloadLink.click();
+ }
+ else if (whatToDo =="show"){
+ bootbox.dialog({
+ size:'large',
+ message:'<div id="canvas" style="height:600px;"></div><div class="help" style="margin-top:25px;" id="exportButtons">Please save before exporting<br><b>Export as :<b><button class="little" style = "margin-left:15px;display:inline;color:white;" onclick="svgprint(4)">PNG low</button><button class="little" style="margin-left:15px;display:inline;color:white;" onclick="svgprint(6)">PNG med</button><button class="little" style="margin-left:15px;display:inline;color:white;" onclick="svgprint(8)">PNG high</button><button style="margin-left:15px;display:inline;color:white;" class="little" onclick="svgprint(10)">PNG super high</button></div>',
+ animate:false,
+ backdrop:true,
+ onEscape: function() {},
+ callback: function(result){
+ if (result == true){
+
+ }
+ }
+ });
+ showBPMN(xmlText);
+ }
+ else if (whatToDo =="source"){
+ return xmlText
+ }
+}
+
+function showBPMN (xmlText) {
+ var BpmnViewer = window.BpmnJS;
+
+ var viewer = new BpmnViewer({ container: '#canvas' });
+
+ viewer.importXML(xmlText, function(err) {
+ if (!err) {
+ console.log('success!');
+ viewer.get('canvas').zoom('fit-viewport');
+ } else {
+ console.log('something went wrong:', err);
+ }
+ });
+}
+
+function svgprint (quality) {
+ var setWide = $(document.querySelector('svg')).width();
+ var setHeight = $(document.querySelector('svg')).height();
+ $(document.querySelector('svg')).attr('width',setWide)
+ $(document.querySelector('svg')).attr('height',setHeight)
+ svgAsDataUri(document.querySelector('svg'), {scale:quality}, function(uri){
+ console.log(uri)
+ var img = new Image();
+ img.src = uri;
+ img.onload = function() {
+ var canvas = document.createElement('canvas');
+ canvas.width = img.width;
+ canvas.height = img.height;
+ var context = canvas.getContext('2d');
+ context.drawImage(img,0,0);
+
+ var a = document.createElement('a');
+ a.download = 'image.png';
+ a.href = canvas.toDataURL('image/png');
+ document.body.appendChild(a);
+ a.click();
+ }
+ })
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/app.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/app.js
new file mode 100644
index 0000000..7fdf912
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/app.js
@@ -0,0 +1,55 @@
+(function() {
+
+angular.module('eAse',[])
+ .controller('ETitleController',eTitleController);
+
+ function eTitleController($scope){
+ $scope.title = "My Sequence Diagram";
+ $scope.titleEdit = true;
+ $scope.editTitle = function() {
+ $scope.titleEdit = !$scope.titleEdit;
+ };
+ $scope.doneEdit = function(event) {
+ if(event.which === 13) {
+ $scope.titleEdit = !$scope.titleEdit;
+ }
+ };
+ $scope.blur = function(event) {
+ $scope.titleEdit = !$scope.titleEdit;
+ };
+ }
+})();
+
+
+
+
+
+
+
+
+
+/*
+
+app.controller('eSidebarController',function($scope){
+
+});
+app.controller('eGridController',function($scope){
+
+});
+app.controller('',function($scope){
+
+});
+app.directive('sequenceFlow', function () {
+ return {
+ restrict: 'E',
+ templateUrl: "../view-models/ase_view.html",
+ controller: 'flowController',
+ scope: '=',
+ link: function(scope, element, attrs, flowCtrl) {
+ flowCtrl.init();
+ }
+ }
+});
+
+*/
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js
new file mode 100644
index 0000000..2f041f3
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js
@@ -0,0 +1,356 @@
+
+//Contains functions to update, create and retrieve arrays. Also uses arrays to determine properties (lNode, rNode) of arrows
+
+var missingStarts = [];
+var missingEnds = [];
+
+//Stores module's properties in its array
+function storeXY (arrayType,id) {
+ 'use strict';
+ var index;
+ for ( i = 0; i<arrayType.length; i++){
+ if (arrayType[i][1] == id) {
+ index = i;
+ arrayType[i][3] = parseInt(document.getElementById(id).getAttribute('data_x'));
+ arrayType[i][4] = parseInt(document.getElementById(id).getAttribute('data_y'));
+ arrayType[i][5] = $("#"+id).width();
+ arrayType[i][6] = arrayType[i][3] + arrayType[i][5];
+ arrayType[i][7] = arrayType[i][4] + $("#"+id).height();
+ }
+ }
+ return index;
+}
+
+//Returns lifeline coordinates in the array lifelineX[]
+function getLifelines () {
+ lifelineX.length = 0;
+ lifelineX=[];
+ for (var i = 0; i<nodeArr.length; i++){
+ if (!$('#'+nodeArr[i][1]).hasClass('expanded')){
+ lifelineX.push([nodeArr[i][3] + (nodeArr[i][5])/2,nodeArr[i][1]]);
+ }
+ }
+ for (i = 0; i<lifelineX.length; i++){
+ if(lifelineX[i]===null){
+ lifelineX.splice(i,1);
+ i--;
+ }
+ }
+}
+
+//Finds a module in its array then stores user-inputed text
+function storeText (arrayType,id,text) {
+ var index;
+ for (var i = 0; i<arrayType.length; i++){
+ if (arrayType[i][1] == id) {
+ index = i;
+ arrayType[i][2] = text;
+ }
+ }
+ return index;
+}
+
+//Recalls an arrays values and returns the items index
+function recallArray (arrayType, id) {
+ var index;
+ for (var i = 0; i<arrayType.length; i++){
+ if (arrayType[i][1] == id) {
+ index = i;
+ text = arrayType[i][2];
+ lX = arrayType[i][3];
+ lY = arrayType[i][4];
+ wide = arrayType[i][5];
+ rX = arrayType[i][6];
+ rY = arrayType[i][7];
+ }
+ }
+ return index;
+}
+
+//Stores a module when given properties and a type. After storing it appends it to the DOM
+//function storeArray (arrayType, i, id, text, lX, lY, wide, direction, height,bpmn,tosca_ID,arrowDescription, messageType) {
+function storeArray (arrayType, i, id, text, lX, lY, wide, direction, height,bpmn,tosca_ID,arrowDescription, messageType, role) {
+ var tag = "";
+ var dropOffLocation;
+ if (arrayType == "nodeArr"){
+ //var nodeHeight = $('.drag-1').height(); //DOES NOT WORK
+ var nodeHeight = 36; //FIXES THE PROBLEM, DOES NOT ALLOW RESIZE
+ var nodeHeightCorrected = nodeHeight+16;
+
+ var gridHeight = document.getElementById('grid').clientHeight;
+ var gridHeightCorrected = gridHeight - 90;
+ tag = '<div class="nodeDraggable drag-drop drag-1 child can-drop placed verticallyScrollable" '+
+ 'id=' + id + ' data_x="' +lX+ '" data_y="' +lY+ '"' +
+ 'style="transform: translate(' + lX + 'px, ' + lY + 'px); -webkit-transform: translate(' + lX + 'px, ' + lY + 'px);">' +
+ '<div class="nodeText nodeEllipsis">'+ text +'</div>'+
+ '<div class="verticalLine" style="top:'+nodeHeightCorrected+'px;height:'+gridHeightCorrected+'px;"></div>'+
+ '</div>';
+ dropOffLocation = document.getElementById("nodeChildrenDroppedOffHere");
+ dropOffLocation.innerHTML += tag;
+ var index = nodeArr.push([document.getElementById(id),id,text,parseInt(lX),parseInt(lY),wide,parseInt(lX)+parseInt(wide),parseInt(lY)]);
+ if (tosca_ID !==null){
+ document.getElementById(id).setAttribute('taska_id',tosca_ID);
+ }
+ if ( text !== null ){
+ document.getElementById(id).setAttribute('sname',text);
+ }
+ // When Role is added uncomment.
+ console.log(role);
+ if ( role !== null ){
+ document.getElementById(id).setAttribute('role_id',role);
+ }
+
+ if (isOverlapped(id) === true){
+ shiftRight(document.getElementById(id),160);
+ }
+ if (isOverlapped(id) === false){
+ for (i=0;i<arrowArr.length;i++){
+ determineLRNode(arrowArr[i][1],id);
+ }
+ }
+ nodeArr[index-1][10] = bpmn;
+ if (bpmn !== '' && bpmn !== null){
+ $('#'+nodeArr[index-1][1]).addClass('bpmn');
+ }
+ }
+ if (arrayType === "arrowArr"){
+ if (direction === "right"){
+ tag = '<div class="arrowDraggable resizable child gridDropzone can-drop arrowPlaced" '+
+ 'style="margin-left: 27px; transform: translate('+ lX +'px, '+lY+'px); -webkit-transform: translate('+ lX +'px, '+lY+'px);width: '+ wide +'px;" '+
+ 'id="'+id+'" data_x="'+lX+'" data_y="'+lY+'" direction="right" message_type="'+messageType+'">'+
+ '<div class="arrow resizable" style="display:inline; width:100%;"><div class="makeEllipsis arrowText">'+text+'</div></div>'+
+ '<div class="triangle" style="display:inline;"></div>'+
+ '</div>';
+ }
+ if (direction === "left"){
+ tag = '<div class="arrowDraggable resizable child gridDropzone can-drop arrowPlaced" '+
+ 'style="margin-left: 27px; transform: translate('+ lX +'px, '+lY+'px); -webkit-transform: translate('+ lX +'px, '+lY+'px);width: '+ wide +'px;" '+
+ 'id="'+id+'" data_x="'+lX+'" data_y="'+lY+'" direction="left" message_type="'+messageType+'">'+
+ '<div class="leftTriangle" style="display:inline;"></div>'+
+ '<div class="leftArrow" style="display:inline; width:100%;"><div class="makeEllipsis arrowText">' + text + '</div></div>'+
+ '</div>';
+ }
+ if (direction === "self"){
+ tag = '<div class="arrowDraggable resizable child gridDropzone can-drop arrowPlaced" '+
+ 'style="margin-left: 27px; transform: translate('+ lX +'px, '+lY+'px); -webkit-transform: translate('+ lX +'px, '+lY+'px);width: 0px;" '+
+ 'id="'+id+'" data_x="'+lX+'" data_y="'+lY+'" direction="self" message_type="'+messageType+'">'+
+ '<div style="display:inline; width:100%"><img src="./images/selfArrow.png" style="cursor:e-resize;">'+
+ '<div class="makeEllipsisSelf arrowText" style="width:75px;font-size:12px;margin-left:3px;text-align:left;display:inline;">' + text + '</div></div>'+
+ '</div>';
+ }
+
+
+ dropOffLocation = document.getElementById("arrowChildrenDroppedOffHere");
+ dropOffLocation.innerHTML += tag;
+ arrowArr.push([document.getElementById(id),id,text,parseInt(lX),lY,parseInt(wide),parseInt(lX)+parseInt(wide),parseInt(lY),"","",arrowDescription]);
+
+ determineLRNode(id,"arrow");
+ }
+ if (arrayType == "noteArr"){
+ tag = '<div class="postit note child gridDropzone can-drop notePlaced" '+
+ 'id=' + id + ' data_x="' +lX+ '" data_y="' +lY+ '"' +
+ 'style="transform: translate(' + lX + 'px, ' + lY + 'px); -webkit-transform: translate(' + lX + 'px, ' + lY + 'px);width: '+wide+'px; height: '+height+'px;">' +
+ text +
+ '</div>';
+ dropOffLocation = document.getElementById("noteChildrenDroppedOffHere");
+ dropOffLocation.innerHTML += tag;
+ noteArr.push([document.getElementById(id),id,text,parseInt(lX),parseInt(lY),wide,parseInt(lX)+parseInt(wide),parseInt(lY)+parseInt(height)]);
+
+ }
+
+}
+
+var layers = {};
+var nodesInLayer = [];
+function determineLayers () {
+ var doAgain = true;
+ layers.length = 0;
+ var layerNumber = -1;
+ while (doAgain === true){
+ layerNumber++;
+ nodesInLayer.length = 0;
+ var classToAssign = 'layer'+layerNumber;
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][8]===null || nodeArr[i][8]===0){
+ //console.log(nodeArr[i][1]);
+ $('#'+nodeArr[i][1]).addClass(classToAssign);
+ nodesInLayer.push(nodeArr[i][1]);
+ }
+ }
+ if (nodesInLayer.length === 0){
+ doAgain = false;
+ }
+ else{
+ layers[classToAssign] = nodesInLayer;
+ }
+ doAgain = false;
+ }
+
+
+ //console.log(layers);
+}
+
+//Determines what nodes an arrow is connecting.
+//When from = "arrow" it finds the left and right nodes. When from = nodeUUID it finds the arrows attached to that node
+function determineLRNode (id, from) {
+ var connections = 0;
+ // tolerance for subtle difference between x coordinate of nodes (midpoint) and x coordinates of arrow (end points) due to zoom in/out
+ // this enables the arrows stay connected to nodes after re-scale window size.
+ var tol = 2;
+ var arrowIndex;
+ getLifelines();
+ for (var i = 0; i<arrowArr.length; i++){
+ if (arrowArr[i][1] == id) { //finds correct arrow
+ arrowIndex = i;
+ }
+ }
+
+ if (from == "arrow"){
+ arrowArr[arrowIndex][8]=null;
+ arrowArr[arrowIndex][9]=null;
+ for (var j = 0; j<lifelineX.length;j++){
+ if (Math.abs(arrowArr[arrowIndex][3] - lifelineX[j][0]) <= tol ){
+ arrowArr[arrowIndex][8] = lifelineX[j][1];
+ connections++;
+ }
+ if (Math.abs(arrowArr[arrowIndex][6] + 12 - lifelineX[j][0]) <= tol ){
+ arrowArr[arrowIndex][9] = lifelineX[j][1];
+ connections++;
+ }
+ else if ( (Math.abs(arrowArr[arrowIndex][6] - lifelineX[j][0]) <= tol ) && document.getElementById(arrowArr[arrowIndex][1]).getAttribute("direction") == "self") { //Allows for self arrow
+ arrowArr[arrowIndex][9] = lifelineX[j][1];
+ connections++;
+ }
+ }
+ changeColors();
+
+ }
+
+ else { //Handles constructor of type node uuid
+ var nodeIndex;
+ for (i=0; i<lifelineX.length;i++){
+ if (lifelineX[i][1] == from) { //Finds node index, corresponds to lifeline index
+ nodeIndex = i;
+ }
+ }
+ if (Math.abs(arrowArr[arrowIndex][3] - lifelineX[nodeIndex][0]) <= tol ){ //If the x is equal to the new node lifeline
+ arrowArr[arrowIndex][8] = nodeArr[nodeIndex][1]; //store to arrow's leftNode
+ if (arrowArr[arrowIndex][9] !== null){ //if it has a right node
+ connections = 2;
+ }
+ else {
+ connections = 1;
+ }
+ changeColors();
+ }
+ }
+ if (document.getElementById(id).getAttribute("direction") == "left"){
+ var swap = arrowArr[arrowIndex][8];
+ arrowArr[arrowIndex][8] = arrowArr[arrowIndex][9];
+ arrowArr[arrowIndex][9] = swap;
+ }
+ warning(); //Displays warning on the sidebar if an arrow lacks an endpoint
+
+ function changeColors () {
+ if (connections == 2){
+ document.getElementById(id).style.background = "rgba(0,255,0,.30)"; //Green
+ setTimeout(function (){
+ document.getElementById(id).style.background = "rgba(0,255,0,0)"; //Fade out
+ }, 500);
+ }
+ else if (connections == 1){
+ document.getElementById(id).style.background = "rgba(255,255,0,.30)"; //Yellow
+ }
+ else if (connections === 0){
+ document.getElementById(id).style.background = "rgba(255,0,0,.30)"; //Red
+ }
+ }
+}
+
+var repeater;
+function warning() {
+ var allow = testAllConnections();
+ if (allow === false) {
+ document.getElementById("warning").innerHTML = "*Link missing lifeline";
+ }
+ else {
+ document.getElementById("warning").innerHTML = "";
+ }
+ if (allow === false){
+ document.getElementById("saveButton").style.cursor = "no-drop";
+ //document.getElementById("printButton").style.cursor = "no-drop";
+ }
+ else {
+ document.getElementById("saveButton").style.cursor = "pointer";
+ //document.getElementById("printButton").style.cursor = "pointer";
+ }
+}
+
+
+function blinkMissingArrows () {
+ testAllConnections();
+ var allMissing = missingStarts.concat(missingEnds);
+ for (var i = 0; i<allMissing.length; i++){
+ for (var j = i+1; j<allMissing.length;j++){
+ if(allMissing[i]===allMissing[j])
+ allMissing.splice(j--,1);
+ }
+ }
+ var originalBG=[];
+ for (i = 0; i<allMissing.length; i++) {
+ id = allMissing[i];
+ originalBG.push(document.getElementById(id).style.background);
+ document.getElementById(id).style.background = "rgba(255,0,0,.80)";
+ }
+ setTimeout(function (){
+ for (var i = 0; i<allMissing.length; i++) {
+ id = allMissing[i];
+ document.getElementById(id).style.background = originalBG[i];
+ }}, 1000);
+}
+
+function testAllConnections () {
+ var allow = true;
+ missingStarts = [];
+ missingEnds = [];
+
+ for (var i = 0; i<arrowArr.length;i++){
+ result = determineNodeStart(arrowArr[i][1]);
+ if (result === null){
+ missingStarts.push(arrowArr[i][1]);
+ allow=false;
+ }
+ result = determineNodeEnd(arrowArr[i][1]);
+ if (result === null){
+ missingEnds.push(arrowArr[i][1]);
+ allow=false;
+ }
+ }
+ return allow;
+}
+
+function determineNodeStart (id) {
+ for (var i = 0; i<arrowArr.length; i++){
+ if (arrowArr[i][1] === id) { //finds correct arrow
+ return arrowArr[i][8];
+ }
+ }
+}
+function determineNodeEnd (id) {
+ for (var i = 0; i<arrowArr.length; i++){
+ if (arrowArr[i][1] == id) { //finds correct arrow
+ return arrowArr[i][9];
+ }
+ }
+}
+
+//Generates uuid
+function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
+ }
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrows.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrows.js
new file mode 100644
index 0000000..8979604
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrows.js
@@ -0,0 +1,213 @@
+
+
+// Contains methods to drag, copy, resize arrows
+
+var arrowArr = []; //Arrow array stored as [tag, uuid]
+
+interact('.arrowDraggable')
+
+.on('move',function (event){
+ var interaction = event.interaction;
+
+ $ ("nodeDropzone").addClass("drop-target");
+ // if the pointer was moved while being held down
+ // and an interaction hasn't started yet
+ if (interaction.pointerIsDown && !interaction.interacting() && !$(event.currentTarget).hasClass("child")) {
+ var clone;
+ var original = event.currentTarget;
+ // create a clone of the currentTarget element
+ clone = event.currentTarget.cloneNode(true);
+ window.uuid = guid();
+ clone.id = uuid;
+ // insert the clone to the page
+ var dropOffLocation = document.getElementById("arrowChildrenDroppedOffHere");
+ clone = dropOffLocation.insertBefore(clone,dropOffLocation.parentNodes);
+
+ var d = document.getElementById(uuid);
+ d.className = d.className + " child"; //Adds child class to prevent child cloning
+
+ // translate the element
+ clone.style.webkitTransform = clone.style.transform = 'translate(' + 0 + $(document).scrollLeft() + 'px, ' + 168 + $(document).scrollTop() + 'px)';
+
+ // update the position attributes
+ clone.setAttribute('data_x', 0 + $(document).scrollLeft());
+ clone.setAttribute('data_y', 168 + $(document).scrollTop());
+
+
+ arrowArr.push([clone,uuid]);
+
+ // start a drag interaction targeting the clone
+ interaction.start({ name: 'drag' },
+ event.interactable,
+ clone);
+ }
+})
+
+.draggable({
+ autoscroll:true,
+ snap: {
+ targets: [
+ interact.createSnapGrid({
+ x: 160, y: 42,
+ offset: {x:11 , y:26}
+ })
+ ],
+ range: Infinity,
+ relativePoints: [ { x: 0, y: 0 } ]
+ },
+ // enable inertial throwing
+ inertia: true,
+ // keep the element within the area of it's parent
+ restrict: {
+ //restriction: "parent",
+ endOnly: true,
+ elementRect: { top: 0, left: 0, bottom: 0, right: 0 }
+ },
+
+ // call this function on every dragmove event
+ onmove: dragMoveListenerArrow,
+ // call this function on every dragend event
+ onend: function (event) {
+
+ }
+})
+.on('dragmove', function (event) {
+
+});
+
+interact('.arrowPlaced')
+.on('doubletap',function (event){
+ var uuid = event.target.id;
+ if (uuid === ""){ //accounts for double tapping .triangle
+ uuid = event.target.parentNode.id;
+ }
+ if (uuid === ""){ //accounts for double tapping .triangle
+ uuid = event.target.parentNode.parentNode.id;
+ }
+ renameArrow(uuid);
+
+});
+
+function renameArrow(uuid){
+ var index = recallArray(arrowArr, uuid);
+ var sourceTaska,destinationTaska;
+ try{
+ sourceTaska = document.getElementById(arrowArr[index][8]).getAttribute("taska_id");
+ }
+ catch (err) {
+ sourceTaska = 'null';
+ }
+ try{
+ destinationTaska = document.getElementById(arrowArr[index][9]).getAttribute("taska_id");
+ }
+ catch (err) {
+ destinationTaska = 'null';
+ }
+ var linkText = arrowArr[index][2];
+ var descText = arrowArr[index][10];
+ var messageType = $(arrowArr[index][0]).attr('message_type');
+ var options = "";
+ if ( messageType === 'signal' ) {
+ options = '<option value="signal" selected="selected">Signal</option><option value="media">Media</option>';
+ } else {
+ options = '<option value="signal">Signal</option><option value="media" selected="selected">Media</option>';
+ }
+
+
+ bootbox.confirm({
+ closeButton:false,backdrop:true,animate:false,
+ size:'small',
+ title: "Modify Link Text",
+ onEscape: function() {},
+ message: 'Link Message: <br> <input id="arrowInnerText" style="width:100%;" type="text" placeholder="Add text here" value="'+ text +'">' +
+ '<br>Description: <br><textarea id="arrowDescription" rows="5" placeholder="Add description (optional)">' + descText + '</textarea>' +
+ '<br>Message Type: <br> <select id="arrowMessageType" style="width:100%;">'+ options +'</select>',
+ callback: function(result){
+ if (result === true) {
+ var innerText=$("#arrowInnerText").val();
+ var messageType = $("#arrowMessageType").val();
+ pushToDict(innerText, "arrow");
+ storeText(arrowArr,uuid,innerText);
+ makeArrow(uuid);
+ arrowArr[index][10] = $("#arrowDescription").val();
+ $(arrowArr[index][0]).attr("message_type",messageType);
+ }
+ }
+ });
+ $("#arrowInnerText").autocomplete({
+ source: arrowTags,
+ autoFocus: true,
+ delay: 0
+ });
+ $("#arrowMessageType").autocomplete({
+ source: messageTags,
+ autoFocus: true,
+ delay: 0
+ });
+
+ var currentInput = $("#arrowInnerText").val();
+ $("#arrowInnerText").selectRange(0,currentInput.length);
+ $("#arrowInnerText").click(function(){
+ var currentInput = $("#arrowInnerText").val();
+ $("#arrowInnerText").selectRange(0,currentInput.length);
+ });
+ $("#arrowInnerText").keyup( function(e) {
+ if (e.keyCode == 13){
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+ $("#arrowDescription").keyup( function(e) {
+ if (e.keyCode == 13){
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+}
+
+$(document).delegate('.arrowText','mouseover',function(mainEvent){
+ if(!$(this).hasClass("bound")){
+ console.log("ENTERING");
+ var hoverIndex = recallArray(arrowArr,event.target.parentNode.parentNode.id);
+ if (arrowArr[hoverIndex][10] !== null && arrowArr[hoverIndex][10] !== "") {
+ arrowDescript = arrowArr[hoverIndex][10];
+ } else {
+ arrowDescript = '--no description entered--';
+ }
+ $('#'+event.target.parentNode.parentNode.id).tooltipster({
+ maxWidth:200,
+ position:'bottom',
+ theme: 'tooltipster-shadow',
+ interactive:false,
+ delay:300,
+ multiple:false,
+ trigger:'click',
+ contentAsHTML:true,
+ content: arrowDescript
+ });
+ $(this).hover(
+ function(event){
+ var hoverIndex = recallArray(arrowArr,event.target.parentNode.parentNode.id);
+ if (arrowArr[hoverIndex][10] !== null && arrowArr[hoverIndex][10] !== "") {
+ arrowDescript = arrowArr[hoverIndex][10];
+ } else {
+ arrowDescript = '--no description entered--';
+ }
+ console.log("ENTERING"+event.target.parentNode.parentNode.id);
+ $('#'+event.target.parentNode.parentNode.id).tooltipster({
+ maxWidth:200,
+ position:'bottom',
+ theme: 'tooltipster-shadow',
+ interactive:false,
+ delay:300,
+ multiple:false,
+ trigger:'click',
+ contentAsHTML:true,
+ content: arrowDescript
+ });
+ },
+ function(event) {
+ $(this).addClass("bound");
+ console.log("LEAVING"+event.target.parentNode.parentNode.id);
+ $('#'+event.target.parentNode.parentNode.id).tooltipster('destroy');
+ });
+ }
+}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/ase.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/ase.js
new file mode 100644
index 0000000..3f3432e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/ase.js
@@ -0,0 +1,112 @@
+//window.filename = "";
+//window.name = "My_Flow_1";
+window.description = "My Sequence Diagram";
+window.arrowTip = 12;
+window.resized = false;
+window.arrowConnections = true;
+window.negativeWidth = false;
+window.gridPitchx = 160;
+window.gridPitchy = 42;
+window.clipboard = [];
+window.selection = [];
+//var networkMap();
+var step = 1;
+var sessiontoken = '';
+var uid= 'XX0000';
+var username= '';
+var toscaDetails = {
+ 'toscaID':'',
+ 'name':'',
+ 'domain':''
+};
+var ase = {
+ 'elementsFileName' : '',
+ 'description' : 'My Sequence Diagram',
+ 'name' : 'My_Flow_1',
+ 'filename' : '',
+ 'elementsFile' : '../mocks/networkElements.yml'
+};
+
+
+
+$(function() {
+
+ newProject(null,null,initialRows);
+
+ //buildTable();
+ //buildDomain();
+
+ var loadSample = false;
+ var showBpmn = false;
+
+
+ $('#sampleEx').click(function(){
+ if (! loadSample ) {
+ loadSample = loadSampleData();
+ }
+ });
+ $('#bpmnEx').click(function(){
+ convertToBPMN(makeJSON(),window.description,'show');
+ });
+ $('#popupEx').click(function(){
+ showPopup();
+ });
+
+// if ( getParameterByName("bpmn") === "1" ) {
+//
+// } else if ( getParameterByName("sample") === "1" ) {
+// $('#sampleDiv').show();
+// } else if ( getParameterByName("interact") === "1" ) {
+//
+//
+// }
+
+
+
+
+ //Allows nodes to scroll with the page and adjusts transparencies
+ $(window).scroll(function(event) {
+ scroll();
+ });
+
+ toggleDoubleLine(document.getElementById('row1'),null,"Step 1:","");
+ //buildDomain();
+ //addStep(document.getElementById('row1'),'row1',step,'');
+ buildNetworkMap();
+ $("#backHome").click(function(){ document.location = "../welcome.htm?showASE=true";});
+});
+
+function getParameterByName( name ){
+ var regexS = "[\\?&]"+name+"=([^&#]*)";
+ var regex = new RegExp( regexS );
+ var results = regex.exec( window.location.search );
+ if( results == null ){
+ return "";
+ } else {
+ return decodeURIComponent(results[1].replace(/\+/g, " "));
+ }
+}
+
+function loadSampleData() {
+ try {
+ //loadFile(0,null,preloadedJSON);
+ loadFile(0,null,trinity_3g_json);
+ } catch(err){
+ return false;
+ } finally {
+
+ }
+ return true;
+}
+
+function showPopup(){
+ bootbox.dialog({
+ backdrop:true,
+ animate:false,
+ onEscape: function() {},
+ title: '<div style="float:left">Sample Dialog</div>',
+ size: 'small',
+ message: '<div id="saveWarning"></div><h4>Sample Dialog using Bootstraps bootbox.dialog components.</h4>'+
+ '<br><hr>'
+ });
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/backend.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/backend.js
new file mode 100644
index 0000000..1c32fcc
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/backend.js
@@ -0,0 +1,827 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains functions to save/export information, load/import from files, and update the titlebar
+
+var m;
+var doc;
+var linePosition;
+var lineSpacing;
+var doubleLineNumbers = [];
+var doubleLineText=[]
+var doubleLineType=[]
+
+//Creates a JSON data structure
+function makeJSON () {
+ if (nodeArr.length>1){
+ for (var k = nodeArr.length-1; k>=0; k--){
+ for (var j = 1; j<=k; j++){
+ if (parseInt(document.getElementById(nodeArr[j-1][1]).getAttribute("data_x"))>parseInt(document.getElementById(nodeArr[j][1]).getAttribute("data_x"))) {
+ var swap = nodeArr[j-1];
+ nodeArr[j-1] = nodeArr[j];
+ nodeArr[j] = swap;
+ }
+ }
+ }
+ }
+ if (arrowArr.length>1){
+ for (var k = arrowArr.length-1; k>=0; k--){
+ for (var j = 1; j<=k; j++){
+ if (parseInt(document.getElementById(arrowArr[j-1][1]).getAttribute("data_y"))>parseInt(document.getElementById(arrowArr[j][1]).getAttribute("data_y"))) {
+ var swap = arrowArr[j-1];
+ arrowArr[j-1] = arrowArr[j];
+ arrowArr[j] = swap;
+ }
+ }
+ }
+ }
+ var now = new Date;
+ var utc_timestamp = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(), now.getUTCDate() ,
+ now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
+ var canvasWidth = $("#grid").width() - $("#sideBar").width();
+
+ doubleLineNumbers.length=0;
+ doubleLineText.length=0;
+ doubleLineType.length=0;
+ var doubleElements = document.getElementsByClassName("doubleLine");
+ $.each(doubleElements,function(index, value){
+ doubleLineNumbers.push(($(value).attr('id')).substring(3));
+ doubleLineText.push(value.children[0].innerHTML);
+ doubleLineType.push($(value).attr('messageType'))
+ });
+ m = "";
+ m += '{ "diagram": \n';
+ m += '{ "created": "' + utc_timestamp + '",\n';
+ m += '"rows": "' + rows + '",\n';
+ m += '"cols": "' + cols + '",\n';
+ m += '"gridPitchy": "' + gridPitchy + '",\n';
+ m += '"canvasHeight": "' + $("#grid").height() + '",\n';
+ m += '"canvasWidth": "' + canvasWidth + '",\n';
+ m += '"encoding": "base64",\n';
+ m += '"elements": {"nodes": [\n';
+ nodeArr.forEach(saveNodeArrayElements);
+ m += '],\n "arrows": [\n';
+ arrowArr.forEach(saveArrowArrayElements);
+ m += '],\n "notes": [\n';
+ noteArr.forEach(saveNoteArrayElements);
+ m += '],\n "separators": [\n';
+ doubleLineNumbers.forEach(saveSeparatorArrayElements);
+ m += ']}}}';
+
+ var n = JSON.parse(m);
+ return m
+
+}
+function saveNodeArrayElements(element, index, array) {
+ var myElement = document.getElementById(element[1]);
+ var roleName = '';
+ var infobox = "{\n";
+ infobox += '"id":"' + myElement.id + '",\n';
+ infobox += '"data_x": "' + myElement.getAttribute('data_x') + '",\n';
+ infobox += '"data_y": "' + myElement.getAttribute('data_y') + '",\n';
+ infobox += '"width": "' + $(myElement).width() + '",\n';
+ infobox += '"innerText": "' + Base64.encode(myElement.getAttribute('sname')) + '",\n';
+ infobox += '"bpmn": "' + Base64.encode($.trim(nodeArr[index][10])) + '",\n';
+ if (myElement.getAttribute('taska_id')==null) myElement.setAttribute('taska_id',"");
+ infobox += '"taska_id": "' + Base64.encode(myElement.getAttribute('taska_id')) + '",\n';
+ if (nodeArr[index][0].hasAttribute('role_id')) {
+ roleName = myElement.getAttribute('role_id');
+ }
+ infobox += '"role": "' + Base64.encode(roleName) + '"\n';
+
+ infobox += "}";
+ if(index<array.length-1) infobox += ",";
+ m += infobox;
+}
+
+function saveArrowArrayElements(element, index, array) {
+ var myElement = document.getElementById(element[1]);
+ var infobox = "{\n";
+ infobox += '"id": "' + myElement.id + '",\n';
+ infobox += '"data_x": "' + myElement.getAttribute('data_x') + '",\n';
+ infobox += '"data_y": "' + myElement.getAttribute('data_y') + '",\n';
+ infobox += '"width": "' + $(myElement).width() + '",\n';
+ infobox += '"fromNodeID": "' + determineNodeStart(myElement.id) + '",\n';
+ infobox += '"toNodeID": "' + determineNodeEnd(myElement.id) + '",\n';
+ infobox += '"direction": "' + myElement.getAttribute('direction') + '",\n';
+ infobox += '"innerText": "' + Base64.encode($.trim(myElement.innerText)) + '",\n';
+ if (arrowArr[index][10]==null) arrowArr[index][10] = "";
+ infobox += '"arrowDescription": "' + Base64.encode(arrowArr[index][10]) + '",\n';
+ //Added on Sep, 24, 2015: store arrow description into the
+ var MessageType='';
+ if (arrowArr[index][0].hasAttribute('message_type')) {
+ MessageType = $.trim(arrowArr[index][0].attributes.message_type.value);
+ }
+ infobox += '"messageType": "' + Base64.encode(MessageType) + '"\n'
+ infobox += "}";
+ if(index<array.length-1) infobox += ",";
+ m += infobox;
+}
+function saveNoteArrayElements(element, index, array) {
+ var myElement = document.getElementById(element[1]);
+ var infobox = "{\n";
+ infobox += '"id":"' + myElement.id + '",\n';
+ infobox += '"data_x": "' + myElement.getAttribute('data_x') + '",\n';
+ infobox += '"data_y": "' + myElement.getAttribute('data_y') + '",\n';
+ infobox += '"width": "' + $(myElement).width() + '",\n';
+ infobox += '"height": "' + $(myElement).height() + '",\n';
+ infobox += '"innerText": "' + Base64.encode($.trim(myElement.innerText)) + '"\n';
+ infobox += "}";
+ if(index<array.length-1) infobox += ",";
+ m += infobox;
+}
+function saveSeparatorArrayElements(element, index, array) {
+ var infobox = "{\n";
+ infobox += '"lineNumber":"' + element + '",\n';
+ try{
+ infobox += '"text":"' + Base64.encode(doubleLineText[index]) + '",\n';
+ }
+ catch (err){
+ infobox += '"text":""\n';
+ }
+ try{
+ infobox += '"messageType":"' + Base64.encode(doubleLineType[index]) + '"\n';
+ }
+ catch (err){
+ infobox += '"messageType":""\n';
+ }
+ infobox += "}";
+ if(index<array.length-1) infobox += ",";
+ m += infobox;
+}
+
+//SAVING///////////////////////////////////////////////////////
+
+//Prompts user for destination, filename, etc. then saves accordingly
+function saveDialog (){
+
+//make a JSON format string that can be JSON.parsed
+ makeJSON();
+ ase.description = $('#description').html();
+/*
+ if (uid==null || uid=="" || uid=='<? print trim($_REQUEST["uid"]); ?>'){
+ databaseHTML = 'Sorry, you are not authenticated to any database at this time.<p><a href="login.htm">Log In</a></p>'
+ }
+ else{
+ databaseHTML = '<p style="font-style:italic;margin-left:10%;margin-top:0;margin-bottom:0;">Description</p><input id="saveDBDescription" type="text" size=60; style="margin-left:10%;width:75%;" value="'+ase.description+'" placeholder="Add description"><button style = "display:inline;" onclick="saveDBFile($(\'#saveDBDescription\').val())">Save!</button></div>'
+ }
+*/
+ bootbox.dialog({
+ backdrop:true,
+ animate:false,
+ onEscape: function() {},
+ title: '<div style="float:left">Save/Export</div>',
+ size: 'small',
+ message: '<div id="saveWarning"></div><h4>Save locally to hard drive : </h4>'+
+// message: '<div id="saveWarning"></div>'+
+ '<p style="font-style:bold;margin-left:0%;margin-top:0;margin-bottom:0;">Call Flow Name</p>'+
+ '<input id="saveLocalDescription" type="text" size=60; style="width:70%;" value="'+ase.description+'" placeholder="Add description">'+
+ '</br></br>' +
+ '<button id="downloadButton" style="display:inline" onclick="saveLocalFile($(\'#saveLocalDescription\').val())">Save</button>' +
+ '&nbsp' +
+ '<br><hr>'
+ });
+ /*
+ * Let enter (13) submit the text
+ * Key "Enter" has the key code 13
+ */
+/*
+ $("#saveLocalFileName").keyup( function(e) {
+ if (e.keyCode == 13){
+ description = $("#saveLocalDescription").val();
+ // replace space with underscore
+ name = ase.description.trim().replace(/ /g,"_");
+ saveLocalFile(description);
+ }
+ });
+*/
+ $("#saveLocalDescription").keyup( function(e) {
+ if (e.keyCode == 13){
+ description = $("#saveLocalDescription").val();
+ // replace space with underscore
+ saveLocalFile(description);
+ }
+ });
+/*
+ $("#saveDBDescription").keyup( function(e) {
+ if (e.keyCode == 13){
+ description = $("#saveDBDescription").val();
+ saveDBFile(description);
+ }
+ });
+*/
+ /*
+ * Selects all text in text box on focus
+ * Local File Name Box is removed
+ */
+ /* $("#saveLocalFileName").click(function(){
+ var currentInput = $("#saveLocalFileName").val();
+ $("#saveLocalFileName"e).selectRange(0,currentInput.length);
+ }); */
+ $("#saveLocalDescription").click(function(){
+ var currentInput = $("#saveLocalDescription").val();
+ $("#saveLocalDescription").selectRange(0,currentInput.length);
+ });
+ $("#saveDBDescription").click(function(){
+ var currentInput = $("#saveDBDescription").val();
+ $("#saveDBDescription").selectRange(0,currentInput.length);
+ });
+
+ $("input[name=fileType]:radio").change(function () {
+ if (document.getElementById('json').checked) {
+ document.getElementById("saveWarning").innerHTML='';
+ } else {
+ document.getElementById("saveWarning").innerHTML='<i>*This file type is not reloadable. Please export a json as well as your desired filetype to enable yourself to edit this document in the future</i>';
+ }
+ })
+}
+
+function viewSource() {
+ if (document.getElementById('yaml').checked) { //YAML
+ sourceCode = convertToYaml(m)
+ if (sourceCode==false){
+ alert("Node(s) missing tosca ID")
+ } else {
+ alert(sourceCode);
+ }
+ }
+
+ if (document.getElementById('json').checked) {
+ decodeJSON(m,'show')
+ };
+}
+
+function saveLocalFile(description) {
+ var data = JSON.parse(m);
+ var name = description.trim().replace(/ /g,"_");
+
+ $.extend(data.diagram,{"description":description});
+ m=JSON.stringify(data,null,' ');
+ var textToWrite = m;
+/*
+ if (document.getElementById('yaml').checked) { //YAML
+ m = convertToYaml(textToWrite)
+ if (m==false){
+ bootbox.hideAll();
+ bootbox.alert({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***Node(s) missing taska_id***",
+ callback: function(result){
+
+ }
+ });
+ return;
+ }
+ var blob = new Blob([m], {type: "text/plain;charset=utf-8"});
+ ase.name = name
+ name = name + ".yml";
+ } else if (document.getElementById('bpmnio').checked) { //YAML
+ convertToBPMN(m,name,'save')
+ bootbox.hideAll();
+ ase.name = name
+ return;
+ }
+ if (document.getElementById('json').checked) { //JSON
+ var blob = new Blob([m], {type: "text/plain;charset=utf-8"});
+ ase.name = name
+ name = name + ".txt";
+ }
+*/
+
+ var JSON_blob = new Blob([m], {type: "text/plain;charset=utf-8"});
+ ase.name = name
+ JSON_name = name + ".txt";
+
+ YAMLString = convertToYaml(textToWrite)
+ if (YAMLString==false){
+ bootbox.hideAll();
+ bootbox.alert({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***Node(s) missing taska_id***",
+ callback: function(result){
+
+ }
+ });
+ return;
+ }
+ var YAML_blob = new Blob([YAMLString], {type: "text/plain;charset=utf-8"});
+ ase.name = name
+ YAML_name = name + ".yml";
+
+ if (navigator.appVersion.toString().indexOf('.NET') > 0) {
+ window.navigator.msSaveBlob(JSON_blob, JSON_name);
+ window.navigator.msSaveBlob(YAML_blob, YAML_name);
+ } else {
+ var downloadLink = document.createElement("a");
+ //window.description=description;
+ ase.description = description;
+ downloadLink.download = JSON_name;
+ downloadLink.innerHTML="Download File";
+ downloadLink.href = window.URL.createObjectURL(JSON_blob)||window.webkitURL.createObjectURL(JSON_blob);
+ document.body.appendChild(downloadLink);
+ downloadLink.click();
+ document.body.removeChild(downloadLink);
+
+ var downloadLink = document.createElement("a");
+ downloadLink.download = YAML_name;
+ downloadLink.innerHTML="Download File";
+ downloadLink.href = window.URL.createObjectURL(YAML_blob)||window.webkitURL.createObjectURL(YAML_blob);
+ document.body.appendChild(downloadLink);
+ downloadLink.click();
+ document.body.removeChild(downloadLink);
+ }
+ resetTitleBar();
+ bootbox.hideAll();
+
+}
+
+//Creates blob and exports to database
+function saveDBFile(description) {
+ bootbox.hideAll();
+
+ var data = JSON.parse(m);
+ $.extend(data.diagram,{"description":description});
+ m=JSON.stringify(data,null,' ');
+
+ //file name from description
+ //fileName=description.trim().replace(/ /g,"_");
+
+ // JSON
+ var textToWrite = m;
+
+ // YAML
+ var ymlTextToWrite = convertToYaml(m);
+
+ //window.description=description;
+ ase.description=description;
+
+ $.post("ase.htm?action=save",{
+ jsonString:textToWrite,
+ ymlString:ymlTextToWrite,
+ callFlowName:description,
+ uid:uid})
+ .success(function(data){
+ console.log("success");
+ bootbox.alert({
+ size:'small',
+ message:'<img src="images/checkmark_yes.gif" height=15 width=15 style="margin-right:10px"> Successfully stored! </br>The call flow is accessible in the <a class="controls" href="../welcome.htm?showASE=true"><img class="controls">Network Simulator</a>',
+ callback: function(result){
+ }
+ });
+ })
+ .error(function(jqXHR, textStatus, errorThrown){
+ //console.log(textToWrite);
+ bootbox.alert({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***Failed to save to Server***",
+ callback: function(result){
+ }
+ });
+ });
+
+
+/*
+ $.post("postjaml.htm",{
+ jamlData:textToWrite,
+ filename:description,
+ uid:uid})
+ .success(function(data){
+ console.log("success");
+ })
+ .error(function(jqXHR, textStatus, errorThrown){
+ //console.log(textToWrite);
+ bootbox.alert({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***Failed to save to database***",
+ callback: function(result){
+ }
+ });
+ });
+*/
+ resetTitleBar();
+}
+
+//LOADING///////////////////////////////////////////////////////
+
+//Prompts user to select file then loads
+function loadDialog(){
+ //load table into var
+ var message = null;
+ //$.get('loadableList.htm?sessiontoken=' + sessiontoken)
+ // .success(function(data){
+ //var message = data;
+ bootbox.dialog({
+ backdrop:true,
+ animate:false,
+ onEscape: function() {},
+ title: 'Load File',
+ size: 'small',
+ message: '<p><h4>Load locally from hard drive : </h4></p>' +
+ '<input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><button style = "display:inline;" onclick="loadFile(0);">Load</button></div>',
+ //'<input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><button style = "display:inline;" onclick="loadFile(0);">Replace!</button><button style = "display:inline;" onclick="loadFile(1);">Append!</button><button style = "margin-left:10px;display:inline;" onclick="loadFile(2);">Source</button></div>'+
+ //'<br><hr>'+
+ //'<p><h4>Load from database : </h4></p>'+message
+
+ });
+ /*
+ },"text")
+ .error(function(jqXHR, textStatus, errorThrown){ //If server not reached
+ //console.log(jqXHR+' ' +textStatus+' ' +errorThrown);
+ var message = '<i>Error: Database not detected or configured</i>';
+ bootbox.dialog({
+ backdrop:true,
+ animate:false,
+ onEscape: function() {},
+ title: 'Load File',
+ size: 'small',
+ message: '<p><h4>Load locally from hard drive : </h4></p>' +
+ '<input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><br><button style = "display:inline;" onclick="loadFile(0);">Load</button></div>',
+ //'<input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><button style = "display:inline;" onclick="loadFile(0);">Replace!</button><button style = "display:inline;" onclick="loadFile(1);">Append!</button><button style = "margin-left:10px;display:inline;" onclick="loadFile(2);">Source</button></div>'+
+ //'<br><hr>'+
+ //'<p><h4>Load from database : </h4></p>'+message
+
+ });
+ });
+ */
+}
+
+
+
+function loadFile(typeOfLoad,preloadedFile,preloadedJSON) {
+ //Case of load locally
+ if(preloadedFile==null && preloadedJSON==null){
+ var file = document.getElementById("fileToLoad").files[0];
+ var reader = new FileReader();
+ reader.onload = recievedText;
+ reader.readAsText(file);
+ }
+ //Not used, but can be useful if you load the page with a parameter of "preloadedJSON"
+ else if (preloadedFile==null && preloadedJSON!=null){
+ recievedText(preloadedJSON);
+ }
+ //Case of load from server
+ else if (preloadedFile!=null && preloadedJSON==null){
+ $.get(preloadedFile,function(data){
+ recievedText(data);
+ });
+ }
+ function recievedText (importedText) { //Called when fully loaded
+ var textFromFileLoaded ="";
+ if (preloadedFile === null && preloadedJSON === null) {
+ var textFromFileLoaded = reader.result;
+ //var path = document.getElementById("fileToLoad").value;
+ //var loadedFilename = path.replace(/^.*\\/,"");
+ } else {
+ textFromFileLoaded = importedText;
+ }
+
+ m = decodeJSON(textFromFileLoaded,null);
+ console.log("m=" + m);
+
+ var n = JSON.parse(m);
+
+ var elementList = n.diagram.elements; //stores all elements
+ var allNodes = n.diagram.elements.nodes;
+ var allArrows = n.diagram.elements.arrows;
+ var allNotes = n.diagram.elements.notes;
+ var loadedRows = n.diagram.rows;
+ var loadedCols = n.diagram.cols;
+ var description = n.diagram.description
+
+
+ //Promotes backwards compatibility to before descriptions were added
+ try {
+ var path = document.getElementById("fileToLoad").value;
+ var loadedFilename = path.replace(/^.*\\/,"");
+ }
+ catch (err){
+ var loadedFilename = description;
+ }
+
+ //Replace
+ if (typeOfLoad == 0){
+ bootbox.hideAll();
+ //window.description = n.diagram.description;
+ ase.description = n.diagram.description;
+ $('#description').text(ase.description);
+ linesToMakeDouble = []
+ doubleLineText = []
+ doubleLineType = []
+ var separators = n.diagram.elements.separators;
+ if (separators == null) separators = [] //Backwards compatibility
+ $.each(separators,function(index, value){
+ linesToMakeDouble.push(value.lineNumber);
+ doubleLineText.push(value.text);
+ // Added on Sept 24, 2015
+ // double line separator should not store message type
+ doubleLineType.push(value.messageType);
+ });
+
+ rows=loadedRows;
+ cols=loadedCols;
+ newProject(linesToMakeDouble,doubleLineText,loadedRows,doubleLineType);
+ document.getElementById('grid').style.height = 91.5 + (rows-initialRows)*6 + '%'; //Increases height by 6%
+ for (var j = 0; j<loadedCols-initialCols; j++){
+ addWidth();
+ }
+ var nodeArr = [], arrowArr = [];
+
+ if (loadedFilename.slice(-3) == "txt"){
+ loadedFilename =loadedFilename.substring(0, loadedFilename.length-4);
+ }
+ ase.name = loadedFilename;
+
+ resetTitleBar();
+ loadEverything(0,"replace");
+ adjustWidth();
+ //Append
+ } else if (typeOfLoad == 1){
+ bootbox.hideAll();
+ $("#nodeZone").addClass('drop-target');
+ $("#nodeZone").css('cursor','crosshair');
+ document.getElementById("titleBar").innerHTML = '<div class="center" style="width:25%;">Click here to append then press okay <button id="appendBtn" style="margin-left:10px;">Okay!</button></div>';
+
+ //Resets the append spot
+ document.getElementById("appendSpot").style.visibility='visible';
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + 250 + 'px, ' + 22 + 'px)';
+ document.getElementById("appendSpot").setAttribute("x",250);
+ document.getElementById("appendSpot").setAttribute("y",22);
+
+ //Need to account for user clicking on either #nodeZone or a node (with class .nodeDraggable)
+ $("#nodeZone").on('click',function(event){
+ window.tapX = event.pageX;
+ window.tapY = event.pageY;
+ var transposeX = Math.round((tapX)/160)*160-70;
+ var transposeY = 22;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x",transposeX);
+ });
+ $(".nodeDraggable").on('click',function(event){
+ window.tapX = event.pageX;
+ window.tapY = event.pageY;
+ var transpose = Math.round((tapX)/160)*160-70;
+ var transposeY = 22;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x",transposeX);
+ });
+
+ //On clicking append, transposes elements to be appended at the selected spot
+ $("#appendBtn").on("click",function(){
+ document.getElementById("appendSpot").style.visibility='hidden';
+ var transpose = document.getElementById("appendSpot").getAttribute("x");
+ if (loadedRows>rows){
+ var deltaRow = loadedRows-rows
+ for (var i = 0; i<deltaRow; i++){
+ addHeight();
+ }
+ rows=loadedRows;
+ }
+ //Cols are dealt with in storeArray()
+ $("#nodeZone").removeClass('drop-target');
+ $("#nodeZone").css('cursor','auto');
+
+ if (loadedFilename.slice(-3) == "txt"){
+ loadedFilename =loadedFilename.substring(0, loadedFilename.length-4);
+ }
+ name = name + "_&_" + loadedFilename
+ resetTitleBar();
+ loadEverything(transpose,"append");
+ adjustWidth();
+ });
+ } else {
+ decodeJSON(textFromFileLoaded,"show");
+ }
+
+ function loadEverything (transpose,typeOfLoad){
+ for (var i in allNodes ){
+ var text = allNodes[i].innerText;
+ var id = guid();
+ if (typeOfLoad == "append"){
+ var lX = parseInt(allNodes[i].data_x) - parseInt(allNodes[0].data_x) + parseInt(transpose);
+ }
+ else {
+ var lX = parseInt(allNodes[i].data_x);
+ }
+ var lY = allNodes[i].data_y;
+ var wide = allNodes[i].width;
+ var arrayType="nodeArr";
+ var roleName = '';
+ roleName = allNodes[i].role;
+ console.log('role name:')
+ console.log(roleName)
+ storeArray(arrayType, i, id, text, lX, lY, wide,null, null,allNodes[i].bpmn,allNodes[i].taska_id, null, null, roleName);
+ }
+ for (var i in allArrows ){
+ var text = allArrows[i].innerText;
+ var id = guid();
+ if (typeOfLoad == "append"){
+ var lX = parseInt(allArrows[i].data_x) - parseInt(allNodes[0].data_x) + parseInt(transpose);
+ }
+ else {
+ var lX = parseInt(allArrows[i].data_x);
+ }
+ var lY = allArrows[i].data_y;
+ var wide = allArrows[i].width;
+ var direction = allArrows[i].direction;
+ var arrayType="arrowArr";
+ var MessageTypeName = allArrows[i].messageType;
+// storeArray(arrayType, i, id, text, lX, lY, wide,direction, null,null,null,allArrows[i].arrowDescription);
+ storeArray(arrayType, i, id, text, lX, lY, wide,direction, null,null,null,allArrows[i].arrowDescription, MessageTypeName);
+ warning();
+ }
+ for (var i in allNotes ){
+ var text = allNotes[i].innerText;
+ var id = guid();
+ if (typeOfLoad == "append"){
+ var lX = parseInt(allNotes[i].data_x) - parseInt(allNodes[0].data_x) + parseInt(transpose);
+ }
+ else {
+ var lX = parseInt(allNotes[i].data_x);
+ }
+ var lY = allNotes[i].data_y;
+ var wide = allNotes[i].width;
+ var height = allNotes[i].height;
+ var arrayType="noteArr";
+ storeArray(arrayType, i, id, text, lX, lY, wide, null, height);
+ }
+ //fitToDoc(); /// Doesn't really work well.
+ }
+ }
+}
+
+function decodeJSON (m,whatToDo) {
+ data = JSON.parse(m);
+// console.log('Loaded JS Object:')
+// console.log(data)
+ if (data.diagram.encoding == "base64"){
+ $.each(data.diagram.elements.nodes, function(index, value) {
+ var newText = Base64.decode(value.innerText);
+ value.innerText = newText
+ if (value.bpmn != null && value.bpmn != ""){
+ var newXML = Base64.decode(value.bpmn);
+ value.bpmn = newXML
+ }
+ if (value.taska_id != null && value.taska_id != ""){
+ var newXML = Base64.decode(value.taska_id );
+ value.taska_id = newXML
+ }
+ //role added to each node
+ if (value.role != null && value.role != ""){
+ var newXML = Base64.decode(value.role );
+ value.role = newXML
+ }
+ });
+ $.each(data.diagram.elements.arrows, function(index, value) {
+ var newText = Base64.decode(value.innerText);
+ value.innerText = newText
+ if (value.arrowDescription != null && value.arrowDescription != ""){
+ var newXML = Base64.decode(value.arrowDescription);
+ value.arrowDescription = newXML
+ }
+ //decode messageType
+ if (value.messageType != null && value.messageType != ""){
+ var newXML = Base64.decode(value.messageType);
+ value.messageType = newXML
+ }
+
+ });
+ $.each(data.diagram.elements.notes, function(index, value) {
+ var newText = Base64.decode(value.innerText);
+ value.innerText = newText
+ });
+ $.each(data.diagram.elements.separators, function(index, value) {
+ var newText = Base64.decode(value.text);
+ value.text = newText
+ if (value.messageType!=null && value.messageType != ""){
+ var newText = Base64.decode(value.messageType);
+ value.messageType = newText;
+ }
+
+ });
+ }
+ m=JSON.stringify(data,null,' ');
+ if(whatToDo=="show") alert(m);
+// console.log('Generated JSON:')
+// console.log(m)
+ return m
+
+}
+
+function adjustWidth () {
+ var maxX = 0;
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][3]>maxX){
+ maxX = nodeArr[i][3];
+ }
+ }
+ while (maxX>$("#grid").width() - $("#sideBar").width()){
+ addWidth();
+ }
+}
+
+function resetTitleBar () {
+ //if (uid==null || uid=="" || uid==''){
+ // document.getElementById("titleBar").innerHTML = '<h3 class=titleBar>' + description + '</h3><div id = "loginArea" class="notLoggedIn" onClick="logIn();">Log In</div>';
+ //}
+ //else{
+ //document.getElementById("titleBar").innerHTML = '<h3 class=titleBar>' + description + '</h3><div id = "loginArea" class="loggedIn" onClick="showInfo();">Hello, '+username+'<img style="position:absolute;top:0;right:-20px;" src="./images/downCaret.gif" height=20 width=auto></div>';
+ $("h3 .titleBar").html(ase.description);
+ /*
+ $('.loggedIn').tooltipster({
+ minWidth:200,
+ theme: 'tooltipster-shadow',
+ interactive:true,
+ trigger:'hover',
+ contentAsHTML:true,
+ content: 'Hello '+username+' how are you'+
+ '<p>Your diagram has'+
+ '<li style="margin-left:20px;">'+nodeArr.length+' nodes</li>'+
+ '<li style="margin-left:20px;">'+arrowArr.length+' arrows</li><br>'+
+ '<a href="index.htm">Log out</a>'
+ });
+ */
+ //}
+}
+
+function logIn () {
+ open("login.htm");
+ resetTitleBar();
+}
+
+function showInfo () {
+ //Called when user clicks on their name after they are logged in
+}
+
+//Allows editing title by double clicking on the top bar
+$("#titleBar").dblclick(function(event) {
+ var presetSelectMenu=''
+ presetSelectMenu+='<form action="#"><fieldset class="selectMenu"><label class="selectMenu" for="presetSelect">Preset:</label><select name="presetSelect" id="presetSelect">'
+ for (var i=0; i<presetNames.length; i++){
+ if (window.selectedPreset!=presetNames[i]) presetSelectMenu+='<option class="selectMenu">'+presetNames[i]+'</option>'
+ else presetSelectMenu+='<option class="selectMenu" selected="selected">'+presetNames[i]+'</option>'
+ }
+ presetSelectMenu+='</select></fieldset></form>'
+ bootbox.confirm({
+ size:'small',
+ backdrop:true,
+ onEscape: function() {},
+ title: "Change file attributes",
+ message:'Filename: <br><input id="saveFileName" type="text" value="'+name+'">'+
+ '<br><br>Description: <br><textarea id="saveDescription" rows="10" placeholder="Add description">'+description+'</textarea>'+
+ '<br><div class="selectMenu">'+presetSelectMenu+'</div>',
+ callback: function(result){
+ if (result == true){
+ name = $("#saveFileName").val();
+ description = $("#saveDescription").val();
+ window.selectedPreset = document.getElementById('presetSelect-button').textContent;
+ resetTitleBar();
+ }
+ }
+ });
+ $( "#presetSelect" ).selectmenu();
+ $('#presetSelect-button').css('width','inherit');
+ $('#presetSelect-button').css('top',10);
+ $('#presetSelect-button').css('font-size','14px')
+ $('#presetSelect-button').css('margin-left',10)
+ $("#saveFileName").click(function(){
+ currentInput = $("#saveFileName").val();
+ $("#saveFileName").selectRange(0,currentInput.length);
+ });
+ $("#saveDescription").click(function(){
+ currentInput = $("#saveDescription").val();
+ $("#saveDescription").selectRange(0,currentInput.length);
+ });
+});
+
+//SELECT TEXT RANGE
+$.fn.selectRange = function(start, end) {
+ return this.each(function() {
+ if (this.setSelectionRange) {
+ this.focus();
+ this.setSelectionRange(start, end);
+ } else if (this.createTextRange) {
+ var range = this.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', end);
+ range.moveStart('character', start);
+ range.select();
+ }
+ });
+};
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/.bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/.bower.json
new file mode 100644
index 0000000..4997498
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/.bower.json
@@ -0,0 +1,35 @@
+{
+ "name": "Snap.svg",
+ "version": "0.4.1",
+ "homepage": "http://snapsvg.io",
+ "authors": [
+ "Dmitry Baranovskiy <dmitry@baranovskiy.com>"
+ ],
+ "description": "The JavaScript library for modern SVG graphics",
+ "main": "dist/snap.svg-min.js",
+ "keywords": [
+ "svg",
+ "snap",
+ "js",
+ "javascript"
+ ],
+ "license": "Apache 2",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "demos",
+ "src"
+ ],
+ "_release": "0.4.1",
+ "_resolution": {
+ "type": "version",
+ "tag": "v0.4.1",
+ "commit": "3919b7a3077dfdb4b31cc4b485d70aab4a163a44"
+ },
+ "_source": "git://github.com/adobe-webplatform/Snap.svg.git",
+ "_target": "~0.4.1",
+ "_originalSource": "Snap.svg",
+ "_direct": true
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/CONTRIBUTING b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/CONTRIBUTING
new file mode 100644
index 0000000..c02401a
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/CONTRIBUTING
@@ -0,0 +1,3 @@
+Contributions to this code are covered by the Adobe contributors
+license agreeent. Developers must sign and submit the Adobe CLA in
+order to contribute to this project. \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/Gruntfile.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/Gruntfile.js
new file mode 100644
index 0000000..415c624
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/Gruntfile.js
@@ -0,0 +1,62 @@
+module.exports = function(grunt) {
+
+ var pkg = grunt.file.readJSON("package.json");
+
+ // Project configuration.
+ grunt.initConfig({
+ // Metadata.
+ pkg: pkg,
+ banner: grunt.file.read("./src/copy.js")
+ .replace(/@VERSION/, pkg.version)
+ .replace(/@DATE/, grunt.template.today("yyyy-mm-dd")) + "\n",
+ // Task configuration.
+ uglify: {
+ options: {
+ banner: "<%= banner %>",
+ report: "min"
+ },
+ dist: {
+ src: "<%= concat.target.dest %>",
+ dest: "dist/snap.svg-min.js"
+ }
+ },
+ concat: {
+ options: {
+ banner: "<%= banner %>"
+ },
+ target: {
+ dest: "dist/snap.svg.js",
+ src: [
+ "./node_modules/eve/eve.js",
+ "./src/amd-banner.js",
+ "./src/mina.js",
+ "./src/svg.js",
+ "./src/element.js",
+ "./src/matrix.js",
+ "./src/attr.js",
+ "./src/class.js",
+ "./src/attradd.js",
+ "./src/paper.js",
+ "./src/path.js",
+ "./src/set.js",
+ "./src/equal.js",
+ "./src/mouse.js",
+ "./src/filter.js",
+ "./src/align.js",
+ "./src/amd-footer.js"
+ ]
+ }
+ },
+ exec: {
+ dr: {
+ command: "node node_modules/dr.js/dr dr.json"
+ }
+ }
+ });
+
+ grunt.loadNpmTasks("grunt-contrib-concat");
+ grunt.loadNpmTasks("grunt-contrib-uglify");
+ grunt.loadNpmTasks("grunt-exec");
+
+ grunt.registerTask("default", ["concat", "uglify", "exec"]);
+};
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/LICENSE b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/LICENSE
new file mode 100644
index 0000000..86a96fa
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2013 Adobe Systems Incorporated
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/NOTICE b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/NOTICE
new file mode 100644
index 0000000..b9fb2b2
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/NOTICE
@@ -0,0 +1,190 @@
+Snap.svg is licensed under the Apache license version 2.0, January 2004 (see LICENSE file).
+
+Snap.svg uses the following third party libraries that may have licenses
+differing from that of Snap.svg itself. You can find the libraries and their
+respective licenses below.
+
+ - eve ./node_modules/eve
+
+ https://github.com/adobe-webplatform/eve/
+
+ Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ - Mocha ./node_modules/mocha
+
+ https://github.com/visionmedia/mocha/
+
+ (The MIT License)
+
+ Copyright (c) 2011-2013 TJ Holowaychuk <tj@vision-media.ca>
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ - Expect ./node_modules/expect.js
+
+ https://github.com/LearnBoost/expect.js
+
+ (The MIT License)
+
+ Copyright (c) 2011 Guillermo Rauch <guillermo@learnboost.com>
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ - Grunt ./node_modules/grunt
+
+ http://gruntjs.com
+
+ Copyright (c) 2013 "Cowboy" Ben Alman
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+
+ - Backbone ./demos/animated-game/js/backbone.js
+
+ http://backbonejs.org/
+
+ (The MIT License)
+
+ Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ - Underscore ./demos/animated-game/js/underscore.js
+
+ http://underscorejs.org
+
+ (The MIT License)
+
+ Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ - jQuery ./demos/animated-game/js/jquery-1.9.0.min.js
+
+ http://http://jquery.com/
+
+ (The MIT License)
+
+ Copyright 2013 jQuery Foundation and other contributors
+ http://jquery.com/
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/README.md b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/README.md
new file mode 100644
index 0000000..8040710
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/README.md
@@ -0,0 +1,68 @@
+[Snap.svg](http://snapsvg.io)
+======
+
+A JavaScript SVG library for the modern web. Learn more at [snapsvg.io](http://snapsvg.io).
+
+[Follow us on Twitter.](https://twitter.com/snapsvg)
+
+### Install
+* [Bower](http://bower.io/) - `bower install snap.svg`
+* Manual Minified - https://github.com/adobe-webplatform/Snap.svg/raw/master/dist/snap.svg-min.js
+* Manual Unminified - https://raw.githubusercontent.com/adobe-webplatform/Snap.svg/master/dist/snap.svg.js
+
+
+### Learn
+
+* [About Snap.svg](http://snapsvg.io/about/)
+* [Getting Started](http://snapsvg.io/start/)
+* [API Reference](http://snapsvg.io/docs/)
+
+### Use
+
+In your HTML file, load simply by: `<script src="snap.svg-min.js"></script>`
+No other scripts are needed. Both the minified and uncompressed (for development) versions are in the `/dist` folder.
+
+### Build
+
+Snap.svg uses [Grunt](http://gruntjs.com/) to build.
+
+* Open the terminal from the Snap.svg directory:
+
+ cd Snap.svg
+
+* Install its command line interface (CLI) globally:
+
+ npm install -g grunt-cli
+
+_*You might need to use `sudo npm`, depending on your configuration._
+
+* Install dependencies with npm:
+
+ npm install
+
+_*Snap.svg uses Grunt 0.4.0. You might want to [read](http://gruntjs.com/getting-started) more on their website if you haven’t upgraded since a lot has changed._
+
+* Type `grunt` in the command line to build the files.
+* The results will be built into the release folder.
+* Alternatively type `grunt watch` to have the build run automatically when you make changes to source files.
+
+### Contribute
+
+* [Fill out the CLA](http://snapsvg.io/contributions/).
+* [Fork](https://help.github.com/articles/fork-a-repo) the repo.
+* Create a branch:
+
+ git checkout -b my_branch
+
+* Add your changes.
+* Commit your changes:
+
+ git commit -am "Added some awesome stuff"
+
+* Push your branch:
+
+ git push origin my_branch
+
+* Make a [pull request](https://help.github.com/articles/using-pull-requests) to `dev` branch.
+
+*Note:* Pull requests to other branches than `dev` or without filled CLA wouldn’t be accepted.
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/bower.json
new file mode 100644
index 0000000..2d97a8f
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/bower.json
@@ -0,0 +1,25 @@
+{
+ "name": "Snap.svg",
+ "version": "0.4.0",
+ "homepage": "http://snapsvg.io",
+ "authors": [
+ "Dmitry Baranovskiy <dmitry@baranovskiy.com>"
+ ],
+ "description": "The JavaScript library for modern SVG graphics",
+ "main": "dist/snap.svg-min.js",
+ "keywords": [
+ "svg",
+ "snap",
+ "js",
+ "javascript"
+ ],
+ "license": "Apache 2",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "demos",
+ "src"
+ ]
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/component.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/component.json
new file mode 100644
index 0000000..a9fdee3
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/component.json
@@ -0,0 +1,13 @@
+{
+ "name": "Snap.svg",
+ "repo": "adobe-webplatform/Snap.svg",
+ "description": "The JavaScript library for modern SVG graphics.",
+ "version": "0.3.0",
+ "keywords": ["svg", "snap", "js", "javascript"],
+ "dependencies": {},
+ "development": {},
+ "main": "dist/snap.svg-min.js",
+ "scripts": [
+ "dist/snap.svg-min.js"
+ ]
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg-min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg-min.js
new file mode 100644
index 0000000..6567d19
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg-min.js
@@ -0,0 +1,21 @@
+// Snap.svg 0.4.1
+//
+// Copyright (c) 2013 – 2015 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// build: 2015-04-13
+
+!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g=/\s*,\s*/,h="*",i=function(a,b){return a-b},j={n:{}},k=function(){for(var a=0,b=this.length;b>a;a++)if("undefined"!=typeof this[a])return this[a]},l=function(){for(var a=this.length;--a;)if("undefined"!=typeof this[a])return this[a]},m=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=m.listeners(a),j=0,n=[],o={},p=[],q=b;p.firstDefined=k,p.lastDefined=l,b=a,c=0;for(var r=0,s=h.length;s>r;r++)"zIndex"in h[r]&&(n.push(h[r].zIndex),h[r].zIndex<0&&(o[h[r].zIndex]=h[r]));for(n.sort(i);n[j]<0;)if(e=o[n[j++]],p.push(e.apply(d,g)),c)return c=f,p;for(r=0;s>r;r++)if(e=h[r],"zIndex"in e)if(e.zIndex==n[j]){if(p.push(e.apply(d,g)),c)break;do if(j++,e=o[n[j]],e&&p.push(e.apply(d,g)),c)break;while(e)}else o[e.zIndex]=e;else if(p.push(e.apply(d,g)),c)break;return c=f,b=q,p};m._events=j,m.listeners=function(a){var b,c,d,e,g,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,g=m.length;g>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[h]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},m.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(g),d=0,e=c.length;e>d;d++)!function(a){for(var c,d=a.split(f),e=j,g=0,h=d.length;h>g;g++)e=e.n,e=e.hasOwnProperty(d[g])&&e[d[g]]||(e[d[g]]={n:{}});for(e.f=e.f||[],g=0,h=e.f.length;h>g;g++)if(e.f[g]==b){c=!0;break}!c&&e.f.push(b)}(c[d]);return function(a){+a==+a&&(b.zIndex=+a)}},m.f=function(a){var b=[].slice.call(arguments,1);return function(){m.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},m.stop=function(){c=1},m.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},m.nts=function(){return b.split(f)},m.off=m.unbind=function(a,b){if(!a)return void(m._events=j={n:{}});var c=a.split(g);if(c.length>1)for(var d=0,i=c.length;i>d;d++)m.off(c[d],b);else{c=a.split(f);var k,l,n,d,i,o,p,q=[j];for(d=0,i=c.length;i>d;d++)for(o=0;o<q.length;o+=n.length-2){if(n=[o,1],k=q[o].n,c[d]!=h)k[c[d]]&&n.push(k[c[d]]);else for(l in k)k[e](l)&&n.push(k[l]);q.splice.apply(q,n)}for(d=0,i=q.length;i>d;d++)for(k=q[d];k.n;){if(b){if(k.f){for(o=0,p=k.f.length;p>o;o++)if(k.f[o]==b){k.f.splice(o,1);break}!k.f.length&&delete k.f}for(l in k.n)if(k.n[e](l)&&k.n[l].f){var r=k.n[l].f;for(o=0,p=r.length;p>o;o++)if(r[o]==b){r.splice(o,1);break}!r.length&&delete k.n[l].f}}else{delete k.f;for(l in k.n)k.n[e](l)&&k.n[l].f&&delete k.n[l].f}k=k.n}}},m.once=function(a,b){var c=function(){return m.unbind(a,c),b.apply(this,arguments)};return m.on(a,c)},m.version=d,m.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=m:"function"==typeof define&&define.amd?define("eve",[],function(){return m}):a.eve=m}(this),function(a,b){if("function"==typeof define&&define.amd)define(["eve"],function(c){return b(a,c)});else if("undefined"!=typeof exports){var c=require("eve");module.exports=b(a,c)}else b(a,a.eve)}(window||this,function(a,b){var c=function(b){var c={},d=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},e=Array.isArray||function(a){return a instanceof Array||"[object Array]"==Object.prototype.toString.call(a)},f=0,g="M"+(+new Date).toString(36),h=function(){return g+(f++).toString(36)},i=Date.now||function(){return+new Date},j=function(a){var b=this;if(null==a)return b.s;var c=b.s-a;b.b+=b.dur*c,b.B+=b.dur*c,b.s=a},k=function(a){var b=this;return null==a?b.spd:void(b.spd=a)},l=function(a){var b=this;return null==a?b.dur:(b.s=b.s*a/b.dur,void(b.dur=a))},m=function(){var a=this;delete c[a.id],a.update(),b("mina.stop."+a.id,a)},n=function(){var a=this;a.pdif||(delete c[a.id],a.update(),a.pdif=a.get()-a.b)},o=function(){var a=this;a.pdif&&(a.b=a.get()-a.pdif,delete a.pdif,c[a.id]=a)},p=function(){var a,b=this;if(e(b.start)){a=[];for(var c=0,d=b.start.length;d>c;c++)a[c]=+b.start[c]+(b.end[c]-b.start[c])*b.easing(b.s)}else a=+b.start+(b.end-b.start)*b.easing(b.s);b.set(a)},q=function(){var a=0;for(var e in c)if(c.hasOwnProperty(e)){var f=c[e],g=f.get();a++,f.s=(g-f.b)/(f.dur/f.spd),f.s>=1&&(delete c[e],f.s=1,a--,function(a){setTimeout(function(){b("mina.finish."+a.id,a)})}(f)),f.update()}a&&d(q)},r=function(a,b,e,f,g,i,s){var t={id:h(),start:a,end:b,b:e,s:0,dur:f-e,spd:1,get:g,set:i,easing:s||r.linear,status:j,speed:k,duration:l,stop:m,pause:n,resume:o,update:p};c[t.id]=t;var u,v=0;for(u in c)if(c.hasOwnProperty(u)&&(v++,2==v))break;return 1==v&&d(q),t};return r.time=i,r.getById=function(a){return c[a]||null},r.linear=function(a){return a},r.easeout=function(a){return Math.pow(a,1.7)},r.easein=function(a){return Math.pow(a,.48)},r.easeinout=function(a){if(1==a)return 1;if(0==a)return 0;var b=.48-a/1.04,c=Math.sqrt(.1734+b*b),d=c-b,e=Math.pow(Math.abs(d),1/3)*(0>d?-1:1),f=-c-b,g=Math.pow(Math.abs(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},r.backin=function(a){if(1==a)return 1;var b=1.70158;return a*a*((b+1)*a-b)},r.backout=function(a){if(0==a)return 0;a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},r.elastic=function(a){return a==!!a?a:Math.pow(2,-10*a)*Math.sin(2*(a-.075)*Math.PI/.3)+1},r.bounce=function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b},a.mina=r,r}("undefined"==typeof b?function(){}:b),d=function(a){function c(a,b){if(a){if(a.nodeType)return w(a);if(e(a,"array")&&c.set)return c.set.apply(c,a);if(a instanceof s)return a;if(null==b)return a=y.doc.querySelector(String(a)),w(a)}return a=null==a?"100%":a,b=null==b?"100%":b,new v(a,b)}function d(a,b){if(b){if("#text"==a&&(a=y.doc.createTextNode(b.text||b["#text"]||"")),"#comment"==a&&(a=y.doc.createComment(b.text||b["#text"]||"")),"string"==typeof a&&(a=d(a)),"string"==typeof b)return 1==a.nodeType?"xlink:"==b.substring(0,6)?a.getAttributeNS(T,b.substring(6)):"xml:"==b.substring(0,4)?a.getAttributeNS(U,b.substring(4)):a.getAttribute(b):"text"==b?a.nodeValue:null;if(1==a.nodeType){for(var c in b)if(b[z](c)){var e=A(b[c]);e?"xlink:"==c.substring(0,6)?a.setAttributeNS(T,c.substring(6),e):"xml:"==c.substring(0,4)?a.setAttributeNS(U,c.substring(4),e):a.setAttribute(c,e):a.removeAttribute(c)}}else"text"in b&&(a.nodeValue=b.text)}else a=y.doc.createElementNS(U,a);return a}function e(a,b){return b=A.prototype.toLowerCase.call(b),"finite"==b?isFinite(a):"array"==b&&(a instanceof Array||Array.isArray&&Array.isArray(a))?!0:"null"==b&&null===a||b==typeof a&&null!==a||"object"==b&&a===Object(a)||J.call(a).slice(8,-1).toLowerCase()==b}function f(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=f(a[c]));return b}function h(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function i(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),g=d.cache=d.cache||{},i=d.count=d.count||[];return g[z](f)?(h(i,f),c?c(g[f]):g[f]):(i.length>=1e3&&delete g[i.shift()],i.push(f),g[f]=a.apply(b,e),c?c(g[f]):g[f])}return d}function j(a,b,c,d,e,f){if(null==e){var g=a-c,h=b-d;return g||h?(180+180*D.atan2(-h,-g)/H+360)%360:0}return j(a,b,e,f)-j(c,d,e,f)}function k(a){return a%360*H/180}function l(a){return 180*a/H%360}function m(a){var b=[];return a=a.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(a,c,d){return d=d.split(/\s*,\s*|\s+/),"rotate"==c&&1==d.length&&d.push(0,0),"scale"==c&&(d.length>2?d=d.slice(0,2):2==d.length&&d.push(0,0),1==d.length&&d.push(d[0],0,0)),b.push("skewX"==c?["m",1,0,D.tan(k(d[0])),1,0,0]:"skewY"==c?["m",1,D.tan(k(d[0])),0,1,0,0]:[c.charAt(0)].concat(d)),a}),b}function n(a,b){var d=ab(a),e=new c.Matrix;if(d)for(var f=0,g=d.length;g>f;f++){var h,i,j,k,l,m=d[f],n=m.length,o=A(m[0]).toLowerCase(),p=m[0]!=o,q=p?e.invert():0;"t"==o&&2==n?e.translate(m[1],0):"t"==o&&3==n?p?(h=q.x(0,0),i=q.y(0,0),j=q.x(m[1],m[2]),k=q.y(m[1],m[2]),e.translate(j-h,k-i)):e.translate(m[1],m[2]):"r"==o?2==n?(l=l||b,e.rotate(m[1],l.x+l.width/2,l.y+l.height/2)):4==n&&(p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.rotate(m[1],j,k)):e.rotate(m[1],m[2],m[3])):"s"==o?2==n||3==n?(l=l||b,e.scale(m[1],m[n-1],l.x+l.width/2,l.y+l.height/2)):4==n?p?(j=q.x(m[2],m[3]),k=q.y(m[2],m[3]),e.scale(m[1],m[1],j,k)):e.scale(m[1],m[1],m[2],m[3]):5==n&&(p?(j=q.x(m[3],m[4]),k=q.y(m[3],m[4]),e.scale(m[1],m[2],j,k)):e.scale(m[1],m[2],m[3],m[4])):"m"==o&&7==n&&e.add(m[1],m[2],m[3],m[4],m[5],m[6])}return e}function o(a){var b=a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||a.node.parentNode&&w(a.node.parentNode)||c.select("svg")||c(0,0),d=b.select("defs"),e=null==d?!1:d.node;return e||(e=u("defs",b.node).node),e}function p(a){return a.node.ownerSVGElement&&w(a.node.ownerSVGElement)||c.select("svg")}function q(a,b,c){function e(a){if(null==a)return I;if(a==+a)return a;d(j,{width:a});try{return j.getBBox().width}catch(b){return 0}}function f(a){if(null==a)return I;if(a==+a)return a;d(j,{height:a});try{return j.getBBox().height}catch(b){return 0}}function g(d,e){null==b?i[d]=e(a.attr(d)||0):d==b&&(i=e(null==c?a.attr(d)||0:c))}var h=p(a).node,i={},j=h.querySelector(".svg---mgr");switch(j||(j=d("rect"),d(j,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),h.appendChild(j)),a.type){case"rect":g("rx",e),g("ry",f);case"image":g("width",e),g("height",f);case"text":g("x",e),g("y",f);break;case"circle":g("cx",e),g("cy",f),g("r",e);break;case"ellipse":g("cx",e),g("cy",f),g("rx",e),g("ry",f);break;case"line":g("x1",e),g("x2",e),g("y1",f),g("y2",f);break;case"marker":g("refX",e),g("markerWidth",e),g("refY",f),g("markerHeight",f);break;case"radialGradient":g("fx",e),g("fy",f);break;case"tspan":g("dx",e),g("dy",f);break;default:g(b,e)}return h.removeChild(j),i}function r(a){e(a,"array")||(a=Array.prototype.slice.call(arguments,0));for(var b=0,c=0,d=this.node;this[b];)delete this[b++];for(b=0;b<a.length;b++)"set"==a[b].type?a[b].forEach(function(a){d.appendChild(a.node)}):d.appendChild(a[b].node);var f=d.childNodes;for(b=0;b<f.length;b++)this[c++]=w(f[b]);return this}function s(a){if(a.snap in V)return V[a.snap];var b;try{b=a.ownerSVGElement}catch(c){}this.node=a,b&&(this.paper=new v(b)),this.type=a.tagName||a.nodeName;var d=this.id=S(this);if(this.anims={},this._={transform:[]},a.snap=d,V[d]=this,"g"==this.type&&(this.add=r),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var e in v.prototype)v.prototype[z](e)&&(this[e]=v.prototype[e])}function t(a){this.node=a}function u(a,b){var c=d(a);b.appendChild(c);var e=w(c);return e}function v(a,b){var c,e,f,g=v.prototype;if(a&&"svg"==a.tagName){if(a.snap in V)return V[a.snap];var h=a.ownerDocument;c=new s(a),e=a.getElementsByTagName("desc")[0],f=a.getElementsByTagName("defs")[0],e||(e=d("desc"),e.appendChild(h.createTextNode("Created with Snap")),c.node.appendChild(e)),f||(f=d("defs"),c.node.appendChild(f)),c.defs=f;for(var i in g)g[z](i)&&(c[i]=g[i]);c.paper=c.root=c}else c=u("svg",y.doc.body),d(c.node,{height:b,version:1.1,width:a,xmlns:U});return c}function w(a){return a?a instanceof s||a instanceof t?a:a.tagName&&"svg"==a.tagName.toLowerCase()?new v(a):a.tagName&&"object"==a.tagName.toLowerCase()&&"image/svg+xml"==a.type?new v(a.contentDocument.getElementsByTagName("svg")[0]):new s(a):a}function x(a,b){for(var c=0,d=a.length;d>c;c++){var e={type:a[c].type,attr:a[c].attr()},f=a[c].children();b.push(e),f.length&&x(f,e.childNodes=[])}}c.version="0.4.0",c.toString=function(){return"Snap v"+this.version},c._={};var y={win:a.window,doc:a.window.document};c._.glob=y;{var z="hasOwnProperty",A=String,B=parseFloat,C=parseInt,D=Math,E=D.max,F=D.min,G=D.abs,H=(D.pow,D.PI),I=(D.round,""),J=Object.prototype.toString,K=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,L=(c._.separator=/[,\s]+/,/[\s]*,[\s]*/),M={hs:1,rg:1},N=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,O=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,P=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,Q=0,R="S"+(+new Date).toString(36),S=function(a){return(a&&a.type?a.type:I)+R+(Q++).toString(36)},T="http://www.w3.org/1999/xlink",U="http://www.w3.org/2000/svg",V={};c.url=function(a){return"url('#"+a+"')"}}c._.$=d,c._.id=S,c.format=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return A(b).replace(a,function(a,b){return c(a,b,d)})}}(),c._.clone=f,c._.cacher=i,c.rad=k,c.deg=l,c.sin=function(a){return D.sin(c.rad(a))},c.tan=function(a){return D.tan(c.rad(a))},c.cos=function(a){return D.cos(c.rad(a))},c.asin=function(a){return c.deg(D.asin(a))},c.acos=function(a){return c.deg(D.acos(a))},c.atan=function(a){return c.deg(D.atan(a))},c.atan2=function(a){return c.deg(D.atan2(a))},c.angle=j,c.len=function(a,b,d,e){return Math.sqrt(c.len2(a,b,d,e))},c.len2=function(a,b,c,d){return(a-c)*(a-c)+(b-d)*(b-d)},c.closestPoint=function(a,b,c){function d(a){var d=a.x-b,e=a.y-c;return d*d+e*e}for(var e,f,g,h,i=a.node,j=i.getTotalLength(),k=j/i.pathSegList.numberOfItems*.125,l=1/0,m=0;j>=m;m+=k)(h=d(g=i.getPointAtLength(m)))<l&&(e=g,f=m,l=h);for(k*=.5;k>.5;){var n,o,p,q,r,s;(p=f-k)>=0&&(r=d(n=i.getPointAtLength(p)))<l?(e=n,f=p,l=r):(q=f+k)<=j&&(s=d(o=i.getPointAtLength(q)))<l?(e=o,f=q,l=s):k*=.5}return e={x:e.x,y:e.y,length:f,distance:Math.sqrt(l)}},c.is=e,c.snapTo=function(a,b,c){if(c=e(c,"finite")?c:10,e(a,"array")){for(var d=a.length;d--;)if(G(a[d]-b)<=c)return a[d]}else{a=+a;var f=b%a;if(c>f)return b-f;if(f>a-c)return b-f+a}return b},c.getRGB=i(function(a){if(!a||(a=A(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};if("none"==a)return{r:-1,g:-1,b:-1,hex:"none",toString:Z};if(!(M[z](a.toLowerCase().substring(0,2))||"#"==a.charAt())&&(a=W(a)),!a)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z};var b,d,f,g,h,i,j=a.match(K);return j?(j[2]&&(f=C(j[2].substring(5),16),d=C(j[2].substring(3,5),16),b=C(j[2].substring(1,3),16)),j[3]&&(f=C((h=j[3].charAt(3))+h,16),d=C((h=j[3].charAt(2))+h,16),b=C((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b*=2.55),d=B(i[1]),"%"==i[1].slice(-1)&&(d*=2.55),f=B(i[2]),"%"==i[2].slice(-1)&&(f*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100)),j[5]?(i=j[5].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsb2rgb(b,d,f,g)):j[6]?(i=j[6].split(L),b=B(i[0]),"%"==i[0].slice(-1)&&(b/=100),d=B(i[1]),"%"==i[1].slice(-1)&&(d/=100),f=B(i[2]),"%"==i[2].slice(-1)&&(f/=100),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(b/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(g=B(i[3])),i[3]&&"%"==i[3].slice(-1)&&(g/=100),c.hsl2rgb(b,d,f,g)):(b=F(D.round(b),255),d=F(D.round(d),255),f=F(D.round(f),255),g=F(E(g,0),1),j={r:b,g:d,b:f,toString:Z},j.hex="#"+(16777216|f|d<<8|b<<16).toString(16).slice(1),j.opacity=e(g,"finite")?g:1,j)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Z}},c),c.hsb=i(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=i(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=i(function(a,b,c,d){if(e(d,"finite")){var f=D.round;return"rgba("+[f(a),f(b),f(c),+d.toFixed(2)]+")"}return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)});var W=function(a){var b=y.doc.getElementsByTagName("head")[0]||y.doc.getElementsByTagName("svg")[0],c="rgb(255, 0, 0)";return(W=i(function(a){if("red"==a.toLowerCase())return c;b.style.color=c,b.style.color=a;var d=y.doc.defaultView.getComputedStyle(b,I).getPropertyValue("color");return d==c?null:d}))(a)},X=function(){return"hsb("+[this.h,this.s,this.b]+")"},Y=function(){return"hsl("+[this.h,this.s,this.l]+")"},Z=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},$=function(a,b,d){if(null==b&&e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&e(a,string)){var f=c.getRGB(a);a=f.r,b=f.g,d=f.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},_=function(a,b,d,f){a=D.round(255*a),b=D.round(255*b),d=D.round(255*d);var g={r:a,g:b,b:d,opacity:e(f,"finite")?f:1,hex:c.rgb(a,b,d),toString:Z};return e(f,"finite")&&(g.opacity=f),g};c.color=function(a){var b;return e(a,"object")&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):e(a,"object")&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.opacity=1,a.hex=b.hex):(e(a,"string")&&(a=c.getRGB(a)),e(a,"object")&&"r"in a&&"g"in a&&"b"in a&&!("error"in a)?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:"none"},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1,a.error=1)),a.toString=Z,a},c.hsb2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,d=a.o,a=a.h),a*=360;var f,g,h,i,j;return a=a%360/60,j=c*b,i=j*(1-G(a%2-1)),f=g=h=c-j,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.hsl2rgb=function(a,b,c,d){e(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var f,g,h,i,j;return a=a%360/60,j=2*b*(.5>c?c:1-c),i=j*(1-G(a%2-1)),f=g=h=c-j/2,a=~~a,f+=[j,i,0,0,i,j][a],g+=[i,j,j,i,0,0][a],h+=[0,0,i,j,j,i][a],_(f,g,h,d)},c.rgb2hsb=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=E(a,b,c),g=f-F(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:X}},c.rgb2hsl=function(a,b,c){c=$(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=E(a,b,c),h=F(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:Y}},c.parsePathString=function(a){if(!a)return null;var b=c.path(a);if(b.arr)return c.path.clone(b.arr);var d={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},f=[];return e(a,"array")&&e(a[0],"array")&&(f=c.path.clone(a)),f.length||A(a).replace(N,function(a,b,c){var e=[],g=b.toLowerCase();if(c.replace(P,function(a,b){b&&e.push(+b)}),"m"==g&&e.length>2&&(f.push([b].concat(e.splice(0,2))),g="l",b="m"==b?"l":"L"),"o"==g&&1==e.length&&f.push([b,e[0]]),"r"==g)f.push([b].concat(e));else for(;e.length>=d[g]&&(f.push([b].concat(e.splice(0,d[g]))),d[g]););}),f.toString=c.path.toString,b.arr=c.path.clone(f),f};var ab=c.parseTransformString=function(a){if(!a)return null;var b=[];return e(a,"array")&&e(a[0],"array")&&(b=c.path.clone(a)),b.length||A(a).replace(O,function(a,c,d){{var e=[];c.toLowerCase()}d.replace(P,function(a,b){b&&e.push(+b)}),b.push([c].concat(e))}),b.toString=c.path.toString,b};c._.svgTransform2string=m,c._.rgTransform=/^[a-z][\s]*-?\.?\d/i,c._.transform2matrix=n,c._unit2px=q;y.doc.contains||y.doc.compareDocumentPosition?function(a,b){var c=9==a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a==d||!(!d||1!=d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b;)if(b=b.parentNode,b==a)return!0;return!1};c._.getSomeDefs=o,c._.getSomeSVG=p,c.select=function(a){return a=A(a).replace(/([^\\]):/g,"$1\\:"),w(y.doc.querySelector(a))},c.selectAll=function(a){for(var b=y.doc.querySelectorAll(a),d=(c.set||Array)(),e=0;e<b.length;e++)d.push(w(b[e]));return d},setInterval(function(){for(var a in V)if(V[z](a)){var b=V[a],c=b.node;("svg"!=b.type&&!c.ownerSVGElement||"svg"==b.type&&(!c.parentNode||"ownerSVGElement"in c.parentNode&&!c.ownerSVGElement))&&delete V[a]}},1e4),s.prototype.attr=function(a,c){var d=this,f=d.node;if(!a){if(1!=f.nodeType)return{text:f.nodeValue};for(var g=f.attributes,h={},i=0,j=g.length;j>i;i++)h[g[i].nodeName]=g[i].nodeValue;return h}if(e(a,"string")){if(!(arguments.length>1))return b("snap.util.getattr."+a,d).firstDefined();var k={};k[a]=c,a=k}for(var l in a)a[z](l)&&b("snap.util.attr."+l,d,a[l]);return d},c.parse=function(a){var b=y.doc.createDocumentFragment(),c=!0,d=y.doc.createElement("div");if(a=A(a),a.match(/^\s*<\s*svg(?:\s|>)/)||(a="<svg>"+a+"</svg>",c=!1),d.innerHTML=a,a=d.getElementsByTagName("svg")[0])if(c)b=a;else for(;a.firstChild;)b.appendChild(a.firstChild);return new t(b)},c.fragment=function(){for(var a=Array.prototype.slice.call(arguments,0),b=y.doc.createDocumentFragment(),d=0,e=a.length;e>d;d++){var f=a[d];f.node&&f.node.nodeType&&b.appendChild(f.node),f.nodeType&&b.appendChild(f),"string"==typeof f&&b.appendChild(c.parse(f).node)}return new t(b)},c._.make=u,c._.wrap=w,v.prototype.el=function(a,b){var c=u(a,this.node);return b&&c.attr(b),c},s.prototype.children=function(){for(var a=[],b=this.node.childNodes,d=0,e=b.length;e>d;d++)a[d]=c(b[d]);return a},s.prototype.toJSON=function(){var a=[];return x([this],a),a[0]},b.on("snap.util.getattr",function(){var a=b.nt();a=a.substring(a.lastIndexOf(".")+1);var c=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});return bb[z](c)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(c):d(this.node,a)});var bb={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};b.on("snap.util.attr",function(a){var c=b.nt(),e={};c=c.substring(c.lastIndexOf(".")+1),e[c]=a;var f=c.replace(/-(\w)/gi,function(a,b){return b.toUpperCase()}),g=c.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});bb[z](g)?this.node.style[f]=null==a?I:a:d(this.node,e)}),function(){}(v.prototype),c.ajax=function(a,c,d,f){var g=new XMLHttpRequest,h=S();if(g){if(e(c,"function"))f=d,d=c,c=null;else if(e(c,"object")){var i=[];for(var j in c)c.hasOwnProperty(j)&&i.push(encodeURIComponent(j)+"="+encodeURIComponent(c[j]));c=i.join("&")}return g.open(c?"POST":"GET",a,!0),c&&(g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.setRequestHeader("Content-type","application/x-www-form-urlencoded")),d&&(b.once("snap.ajax."+h+".0",d),b.once("snap.ajax."+h+".200",d),b.once("snap.ajax."+h+".304",d)),g.onreadystatechange=function(){4==g.readyState&&b("snap.ajax."+h+"."+g.status,f,g)},4==g.readyState?g:(g.send(c),g)}},c.load=function(a,b,d){c.ajax(a,function(a){var e=c.parse(a.responseText);d?b.call(d,e):b(e)})};var cb=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,h=e.clientLeft||d.clientLeft||0,i=b.top+(g.win.pageYOffset||e.scrollTop||d.scrollTop)-f,j=b.left+(g.win.pageXOffset||e.scrollLeft||d.scrollLeft)-h;return{y:i,x:j}};return c.getElementByPoint=function(a,b){var c=this,d=(c.canvas,y.doc.elementFromPoint(a,b));if(y.win.opera&&"svg"==d.tagName){var e=cb(d),f=d.createSVGRect();f.x=a-e.x,f.y=b-e.y,f.width=f.height=1;var g=d.getIntersectionList(f,null);g.length&&(d=g[g.length-1])}return d?w(d):null},c.plugin=function(a){a(c,s,v,y,t)},y.win.Snap=c,c}(a||this);return d.plugin(function(d,e,f,g,h){function i(a,b){if(null==b){var c=!0;if(b=a.node.getAttribute("linearGradient"==a.type||"radialGradient"==a.type?"gradientTransform":"pattern"==a.type?"patternTransform":"transform"),!b)return new d.Matrix;b=d._.svgTransform2string(b)}else b=d._.rgTransform.test(b)?o(b).replace(/\.{3}|\u2026/g,a._.transform||""):d._.svgTransform2string(b),n(b,"array")&&(b=d.path?d.path.toString.call(b):o(b)),a._.transform=b;var e=d._.transform2matrix(b,a.getBBox(1));return c?e:void(a.matrix=e)}function j(a){function b(a,b){var c=q(a.node,b);c=c&&c.match(f),c=c&&c[2],c&&"#"==c.charAt()&&(c=c.substring(1),c&&(h[c]=(h[c]||[]).concat(function(c){var d={};d[b]=URL(c),q(a.node,d)})))}function c(a){var b=q(a.node,"xlink:href");b&&"#"==b.charAt()&&(b=b.substring(1),b&&(h[b]=(h[b]||[]).concat(function(b){a.attr("xlink:href","#"+b)})))}for(var d,e=a.selectAll("*"),f=/^\s*url\(("|'|)(.*)\1\)\s*$/,g=[],h={},i=0,j=e.length;j>i;i++){d=e[i],b(d,"fill"),b(d,"stroke"),b(d,"filter"),b(d,"mask"),b(d,"clip-path"),c(d);var k=q(d.node,"id");k&&(q(d.node,{id:d.id}),g.push({old:k,id:d.id}))}for(i=0,j=g.length;j>i;i++){var l=h[g[i].old];if(l)for(var m=0,n=l.length;n>m;m++)l[m](g[i].id)}}function k(a,b,c){return function(d){var e=d.slice(a,b);return 1==e.length&&(e=e[0]),c?c(e):e}}function l(a){return function(){var b=a?"<"+this.type:"",c=this.node.attributes,d=this.node.childNodes;if(a)for(var e=0,f=c.length;f>e;e++)b+=" "+c[e].name+'="'+c[e].value.replace(/"/g,'\\"')+'"';if(d.length){for(a&&(b+=">"),e=0,f=d.length;f>e;e++)3==d[e].nodeType?b+=d[e].nodeValue:1==d[e].nodeType&&(b+=u(d[e]).toString());a&&(b+="</"+this.type+">")}else a&&(b+="/>");return b}}var m=e.prototype,n=d.is,o=String,p=d._unit2px,q=d._.$,r=d._.make,s=d._.getSomeDefs,t="hasOwnProperty",u=d._.wrap;m.getBBox=function(a){if(!d.Matrix||!d.path)return this.node.getBBox();var b=this,c=new d.Matrix;if(b.removed)return d._.box();for(;"use"==b.type;)if(a||(c=c.add(b.transform().localMatrix.translate(b.attr("x")||0,b.attr("y")||0))),b.original)b=b.original;else{var e=b.attr("xlink:href");b=b.original=b.node.ownerDocument.getElementById(e.substring(e.indexOf("#")+1))}var f=b._,g=d.path.get[b.type]||d.path.get.deflt;try{return a?(f.bboxwt=g?d.path.getBBox(b.realPath=g(b)):d._.box(b.node.getBBox()),d._.box(f.bboxwt)):(b.realPath=g(b),b.matrix=b.transform().localMatrix,f.bbox=d.path.getBBox(d.path.map(b.realPath,c.add(b.matrix))),d._.box(f.bbox))}catch(h){return d._.box()}};var v=function(){return this.string};m.transform=function(a){var b=this._;if(null==a){for(var c,e=this,f=new d.Matrix(this.node.getCTM()),g=i(this),h=[g],j=new d.Matrix,k=g.toTransformString(),l=o(g)==o(this.matrix)?o(b.transform):k;"svg"!=e.type&&(e=e.parent());)h.push(i(e));for(c=h.length;c--;)j.add(h[c]);return{string:l,globalMatrix:f,totalMatrix:j,localMatrix:g,diffMatrix:f.clone().add(g.invert()),global:f.toTransformString(),total:j.toTransformString(),local:k,toString:v}}return a instanceof d.Matrix?(this.matrix=a,this._.transform=a.toTransformString()):i(this,a),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?q(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?q(this.node,{patternTransform:this.matrix}):q(this.node,{transform:this.matrix})),this},m.parent=function(){return u(this.node.parentNode)},m.append=m.add=function(a){if(a){if("set"==a.type){var b=this;return a.forEach(function(a){b.add(a)}),this}a=u(a),this.node.appendChild(a.node),a.paper=this.paper}return this},m.appendTo=function(a){return a&&(a=u(a),a.append(this)),this},m.prepend=function(a){if(a){if("set"==a.type){var b,c=this;return a.forEach(function(a){b?b.after(a):c.prepend(a),b=a}),this}a=u(a);var d=a.parent();this.node.insertBefore(a.node,this.node.firstChild),this.add&&this.add(),a.paper=this.paper,this.parent()&&this.parent().add(),d&&d.add()}return this},m.prependTo=function(a){return a=u(a),a.prepend(this),this},m.before=function(a){if("set"==a.type){var b=this;return a.forEach(function(a){var c=a.parent();b.node.parentNode.insertBefore(a.node,b.node),c&&c.add()}),this.parent().add(),this}a=u(a);var c=a.parent();return this.node.parentNode.insertBefore(a.node,this.node),this.parent()&&this.parent().add(),c&&c.add(),a.paper=this.paper,this},m.after=function(a){a=u(a);var b=a.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(a.node,this.node.nextSibling):this.node.parentNode.appendChild(a.node),this.parent()&&this.parent().add(),b&&b.add(),a.paper=this.paper,this},m.insertBefore=function(a){a=u(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},m.insertAfter=function(a){a=u(a);var b=this.parent();return a.node.parentNode.insertBefore(this.node,a.node.nextSibling),this.paper=a.paper,b&&b.add(),a.parent()&&a.parent().add(),this},m.remove=function(){var a=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,a&&a.add(),this},m.select=function(a){return u(this.node.querySelector(a))},m.selectAll=function(a){for(var b=this.node.querySelectorAll(a),c=(d.set||Array)(),e=0;e<b.length;e++)c.push(u(b[e]));return c},m.asPX=function(a,b){return null==b&&(b=this.attr(a)),+p(this,a,b)},m.use=function(){var a,b=this.node.id;return b||(b=this.id,q(this.node,{id:b})),a="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?r(this.type,this.node.parentNode):r("use",this.node.parentNode),q(a.node,{"xlink:href":"#"+b}),a.original=this,a},m.clone=function(){var a=u(this.node.cloneNode(!0));return q(a.node,"id")&&q(a.node,{id:a.id}),j(a),a.insertAfter(this),a},m.toDefs=function(){var a=s(this);return a.appendChild(this.node),this},m.pattern=m.toPattern=function(a,b,c,d){var e=r("pattern",s(this));return null==a&&(a=this.getBBox()),n(a,"object")&&"x"in a&&(b=a.y,c=a.width,d=a.height,a=a.x),q(e.node,{x:a,y:b,width:c,height:d,patternUnits:"userSpaceOnUse",id:e.id,viewBox:[a,b,c,d].join(" ")}),e.node.appendChild(this.node),e},m.marker=function(a,b,c,d,e,f){var g=r("marker",s(this));return null==a&&(a=this.getBBox()),n(a,"object")&&"x"in a&&(b=a.y,c=a.width,d=a.height,e=a.refX||a.cx,f=a.refY||a.cy,a=a.x),q(g.node,{viewBox:[a,b,c,d].join(" "),markerWidth:c,markerHeight:d,orient:"auto",refX:e||0,refY:f||0,id:g.id}),g.node.appendChild(this.node),g};var w=function(a,b,d,e){"function"!=typeof d||d.length||(e=d,d=c.linear),this.attr=a,this.dur=b,d&&(this.easing=d),e&&(this.callback=e)};d._.Animation=w,d.animation=function(a,b,c,d){return new w(a,b,c,d)},m.inAnim=function(){var a=this,b=[];for(var c in a.anims)a.anims[t](c)&&!function(a){b.push({anim:new w(a._attrs,a.dur,a.easing,a._callback),mina:a,curStatus:a.status(),status:function(b){return a.status(b)},stop:function(){a.stop()}})}(a.anims[c]);return b},d.animate=function(a,d,e,f,g,h){"function"!=typeof g||g.length||(h=g,g=c.linear);var i=c.time(),j=c(a,d,i,i+f,c.time,e,g);return h&&b.once("mina.finish."+j.id,h),j},m.stop=function(){for(var a=this.inAnim(),b=0,c=a.length;c>b;b++)a[b].stop();return this},m.animate=function(a,d,e,f){"function"!=typeof e||e.length||(f=e,e=c.linear),a instanceof w&&(f=a.callback,e=a.easing,d=a.dur,a=a.attr);var g,h,i,j,l=[],m=[],p={},q=this;for(var r in a)if(a[t](r)){q.equal?(j=q.equal(r,o(a[r])),g=j.from,h=j.to,i=j.f):(g=+q.attr(r),h=+a[r]);var s=n(g,"array")?g.length:1;p[r]=k(l.length,l.length+s,i),l=l.concat(g),m=m.concat(h)}var u=c.time(),v=c(l,m,u,u+d,c.time,function(a){var b={};for(var c in p)p[t](c)&&(b[c]=p[c](a));q.attr(b)},e);return q.anims[v.id]=v,v._attrs=a,v._callback=f,b("snap.animcreated."+q.id,v),b.once("mina.finish."+v.id,function(){delete q.anims[v.id],f&&f.call(q)}),b.once("mina.stop."+v.id,function(){delete q.anims[v.id]}),q};var x={};m.data=function(a,c){var e=x[this.id]=x[this.id]||{};if(0==arguments.length)return b("snap.data.get."+this.id,this,e,null),e;
+if(1==arguments.length){if(d.is(a,"object")){for(var f in a)a[t](f)&&this.data(f,a[f]);return this}return b("snap.data.get."+this.id,this,e[a],a),e[a]}return e[a]=c,b("snap.data.set."+this.id,this,c,a),this},m.removeData=function(a){return null==a?x[this.id]={}:x[this.id]&&delete x[this.id][a],this},m.outerSVG=m.toString=l(1),m.innerSVG=l(),m.toDataURL=function(){if(a&&a.btoa){var b=this.getBBox(),c=d.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+b.x.toFixed(3),y:+b.y.toFixed(3),width:+b.width.toFixed(3),height:+b.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(c)))}},h.prototype.select=m.select,h.prototype.selectAll=m.selectAll}),d.plugin(function(a){function b(a,b,d,e,f,g){return null==b&&"[object SVGMatrix]"==c.call(a)?(this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.e=a.e,void(this.f=a.f)):void(null!=a?(this.a=+a,this.b=+b,this.c=+d,this.d=+e,this.e=+f,this.f=+g):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var c=Object.prototype.toString,d=String,e=Math,f="";!function(c){function g(a){return a[0]*a[0]+a[1]*a[1]}function h(a){var b=e.sqrt(g(a));a[0]&&(a[0]/=b),a[1]&&(a[1]/=b)}c.add=function(a,c,d,e,f,g){var h,i,j,k,l=[[],[],[]],m=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],n=[[a,d,f],[c,e,g],[0,0,1]];for(a&&a instanceof b&&(n=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),h=0;3>h;h++)for(i=0;3>i;i++){for(k=0,j=0;3>j;j++)k+=m[h][j]*n[j][i];l[h][i]=k}return this.a=l[0][0],this.b=l[1][0],this.c=l[0][1],this.d=l[1][1],this.e=l[0][2],this.f=l[1][2],this},c.invert=function(){var a=this,c=a.a*a.d-a.b*a.c;return new b(a.d/c,-a.b/c,-a.c/c,a.a/c,(a.c*a.f-a.d*a.e)/c,(a.b*a.e-a.a*a.f)/c)},c.clone=function(){return new b(this.a,this.b,this.c,this.d,this.e,this.f)},c.translate=function(a,b){return this.add(1,0,0,1,a,b)},c.scale=function(a,b,c,d){return null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d),this},c.rotate=function(b,c,d){b=a.rad(b),c=c||0,d=d||0;var f=+e.cos(b).toFixed(9),g=+e.sin(b).toFixed(9);return this.add(f,g,-g,f,c,d),this.add(1,0,0,1,-c,-d)},c.x=function(a,b){return a*this.a+b*this.c+this.e},c.y=function(a,b){return a*this.b+b*this.d+this.f},c.get=function(a){return+this[d.fromCharCode(97+a)].toFixed(4)},c.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},c.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},c.determinant=function(){return this.a*this.d-this.b*this.c},c.split=function(){var b={};b.dx=this.e,b.dy=this.f;var c=[[this.a,this.c],[this.b,this.d]];b.scalex=e.sqrt(g(c[0])),h(c[0]),b.shear=c[0][0]*c[1][0]+c[0][1]*c[1][1],c[1]=[c[1][0]-c[0][0]*b.shear,c[1][1]-c[0][1]*b.shear],b.scaley=e.sqrt(g(c[1])),h(c[1]),b.shear/=b.scaley,this.determinant()<0&&(b.scalex=-b.scalex);var d=-c[0][1],f=c[1][1];return 0>f?(b.rotate=a.deg(e.acos(f)),0>d&&(b.rotate=360-b.rotate)):b.rotate=a.deg(e.asin(d)),b.isSimple=!(+b.shear.toFixed(9)||b.scalex.toFixed(9)!=b.scaley.toFixed(9)&&b.rotate),b.isSuperSimple=!+b.shear.toFixed(9)&&b.scalex.toFixed(9)==b.scaley.toFixed(9)&&!b.rotate,b.noRotation=!+b.shear.toFixed(9)&&!b.rotate,b},c.toTransformString=function(a){var b=a||this.split();return+b.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[+b.dx.toFixed(4),+b.dy.toFixed(4)]:f)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:f)+(b.rotate?"r"+[+b.rotate.toFixed(4),0,0]:f))}}(b.prototype),a.Matrix=b,a.matrix=function(a,c,d,e,f,g){return new b(a,c,d,e,f,g)}}),d.plugin(function(a,c,d,e,f){function g(d){return function(e){if(b.stop(),e instanceof f&&1==e.node.childNodes.length&&("radialGradient"==e.node.firstChild.tagName||"linearGradient"==e.node.firstChild.tagName||"pattern"==e.node.firstChild.tagName)&&(e=e.node.firstChild,n(this).appendChild(e),e=l(e)),e instanceof c)if("radialGradient"==e.type||"linearGradient"==e.type||"pattern"==e.type){e.node.id||p(e.node,{id:e.id});var g=q(e.node.id)}else g=e.attr(d);else if(g=a.color(e),g.error){var h=a(n(this).ownerSVGElement).gradient(e);h?(h.node.id||p(h.node,{id:h.id}),g=q(h.node.id)):g=e}else g=r(g);var i={};i[d]=g,p(this.node,i),this.node.style[d]=t}}function h(a){b.stop(),a==+a&&(a+="px"),this.node.style.fontSize=a}function i(a){for(var b=[],c=a.childNodes,d=0,e=c.length;e>d;d++){var f=c[d];3==f.nodeType&&b.push(f.nodeValue),"tspan"==f.tagName&&b.push(1==f.childNodes.length&&3==f.firstChild.nodeType?f.firstChild.nodeValue:i(f))}return b}function j(){return b.stop(),this.node.style.fontSize}var k=a._.make,l=a._.wrap,m=a.is,n=a._.getSomeDefs,o=/^url\(#?([^)]+)\)$/,p=a._.$,q=a.url,r=String,s=a._.separator,t="";b.on("snap.util.attr.mask",function(a){if(a instanceof c||a instanceof f){if(b.stop(),a instanceof f&&1==a.node.childNodes.length&&(a=a.node.firstChild,n(this).appendChild(a),a=l(a)),"mask"==a.type)var d=a;else d=k("mask",n(this)),d.node.appendChild(a.node);!d.node.id&&p(d.node,{id:d.id}),p(this.node,{mask:q(d.id)})}}),function(a){b.on("snap.util.attr.clip",a),b.on("snap.util.attr.clip-path",a),b.on("snap.util.attr.clipPath",a)}(function(a){if(a instanceof c||a instanceof f){if(b.stop(),"clipPath"==a.type)var d=a;else d=k("clipPath",n(this)),d.node.appendChild(a.node),!d.node.id&&p(d.node,{id:d.id});p(this.node,{"clip-path":q(d.node.id||d.id)})}}),b.on("snap.util.attr.fill",g("fill")),b.on("snap.util.attr.stroke",g("stroke"));var u=/^([lr])(?:\(([^)]*)\))?(.*)$/i;b.on("snap.util.grad.parse",function(a){a=r(a);var b=a.match(u);if(!b)return null;var c=b[1],d=b[2],e=b[3];return d=d.split(/\s*,\s*/).map(function(a){return+a==a?+a:a}),1==d.length&&0==d[0]&&(d=[]),e=e.split("-"),e=e.map(function(a){a=a.split(":");var b={color:a[0]};return a[1]&&(b.offset=parseFloat(a[1])),b}),{type:c,params:d,stops:e}}),b.on("snap.util.attr.d",function(c){b.stop(),m(c,"array")&&m(c[0],"array")&&(c=a.path.toString.call(c)),c=r(c),c.match(/[ruo]/i)&&(c=a.path.toAbsolute(c)),p(this.node,{d:c})})(-1),b.on("snap.util.attr.#text",function(a){b.stop(),a=r(a);for(var c=e.doc.createTextNode(a);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(c)})(-1),b.on("snap.util.attr.path",function(a){b.stop(),this.attr({d:a})})(-1),b.on("snap.util.attr.class",function(a){b.stop(),this.node.className.baseVal=a})(-1),b.on("snap.util.attr.viewBox",function(a){var c;c=m(a,"object")&&"x"in a?[a.x,a.y,a.width,a.height].join(" "):m(a,"array")?a.join(" "):a,p(this.node,{viewBox:c}),b.stop()})(-1),b.on("snap.util.attr.transform",function(a){this.transform(a),b.stop()})(-1),b.on("snap.util.attr.r",function(a){"rect"==this.type&&(b.stop(),p(this.node,{rx:a,ry:a}))})(-1),b.on("snap.util.attr.textpath",function(a){if(b.stop(),"text"==this.type){var d,e,f;if(!a&&this.textPath){for(e=this.textPath;e.node.firstChild;)this.node.appendChild(e.node.firstChild);return e.remove(),void delete this.textPath}if(m(a,"string")){var g=n(this),h=l(g.parentNode).path(a);g.appendChild(h.node),d=h.id,h.attr({id:d})}else a=l(a),a instanceof c&&(d=a.attr("id"),d||(d=a.id,a.attr({id:d})));if(d)if(e=this.textPath,f=this.node,e)e.attr({"xlink:href":"#"+d});else{for(e=p("textPath",{"xlink:href":"#"+d});f.firstChild;)e.appendChild(f.firstChild);f.appendChild(e),this.textPath=l(e)}}})(-1),b.on("snap.util.attr.text",function(a){if("text"==this.type){for(var c=this.node,d=function(a){var b=p("tspan");if(m(a,"array"))for(var c=0;c<a.length;c++)b.appendChild(d(a[c]));else b.appendChild(e.doc.createTextNode(a));return b.normalize&&b.normalize(),b};c.firstChild;)c.removeChild(c.firstChild);for(var f=d(a);f.firstChild;)c.appendChild(f.firstChild)}b.stop()})(-1),b.on("snap.util.attr.fontSize",h)(-1),b.on("snap.util.attr.font-size",h)(-1),b.on("snap.util.getattr.transform",function(){return b.stop(),this.transform()})(-1),b.on("snap.util.getattr.textpath",function(){return b.stop(),this.textPath})(-1),function(){function c(c){return function(){b.stop();var d=e.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+c);return"none"==d?d:a(e.doc.getElementById(d.match(o)[1]))}}function d(a){return function(c){b.stop();var d="marker"+a.charAt(0).toUpperCase()+a.substring(1);if(""==c||!c)return void(this.node.style[d]="none");if("marker"==c.type){var e=c.node.id;return e||p(c.node,{id:c.id}),void(this.node.style[d]=q(e))}}}b.on("snap.util.getattr.marker-end",c("end"))(-1),b.on("snap.util.getattr.markerEnd",c("end"))(-1),b.on("snap.util.getattr.marker-start",c("start"))(-1),b.on("snap.util.getattr.markerStart",c("start"))(-1),b.on("snap.util.getattr.marker-mid",c("mid"))(-1),b.on("snap.util.getattr.markerMid",c("mid"))(-1),b.on("snap.util.attr.marker-end",d("end"))(-1),b.on("snap.util.attr.markerEnd",d("end"))(-1),b.on("snap.util.attr.marker-start",d("start"))(-1),b.on("snap.util.attr.markerStart",d("start"))(-1),b.on("snap.util.attr.marker-mid",d("mid"))(-1),b.on("snap.util.attr.markerMid",d("mid"))(-1)}(),b.on("snap.util.getattr.r",function(){return"rect"==this.type&&p(this.node,"rx")==p(this.node,"ry")?(b.stop(),p(this.node,"rx")):void 0})(-1),b.on("snap.util.getattr.text",function(){if("text"==this.type||"tspan"==this.type){b.stop();var a=i(this.node);return 1==a.length?a[0]:a}})(-1),b.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),b.on("snap.util.getattr.viewBox",function(){b.stop();var c=p(this.node,"viewBox");return c?(c=c.split(s),a._.box(+c[0],+c[1],+c[2],+c[3])):void 0})(-1),b.on("snap.util.getattr.points",function(){var a=p(this.node,"points");return b.stop(),a?a.split(s):void 0})(-1),b.on("snap.util.getattr.path",function(){var a=p(this.node,"d");return b.stop(),a})(-1),b.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),b.on("snap.util.getattr.fontSize",j)(-1),b.on("snap.util.getattr.font-size",j)(-1)}),d.plugin(function(a,b){var c=/\S+/g,d=String,e=b.prototype;e.addClass=function(a){var b,e,f,g,h=d(a||"").match(c)||[],i=this.node,j=i.className.baseVal,k=j.match(c)||[];if(h.length){for(b=0;f=h[b++];)e=k.indexOf(f),~e||k.push(f);g=k.join(" "),j!=g&&(i.className.baseVal=g)}return this},e.removeClass=function(a){var b,e,f,g,h=d(a||"").match(c)||[],i=this.node,j=i.className.baseVal,k=j.match(c)||[];if(k.length){for(b=0;f=h[b++];)e=k.indexOf(f),~e&&k.splice(e,1);g=k.join(" "),j!=g&&(i.className.baseVal=g)}return this},e.hasClass=function(a){var b=this.node,d=b.className.baseVal,e=d.match(c)||[];return!!~e.indexOf(a)},e.toggleClass=function(a,b){if(null!=b)return b?this.addClass(a):this.removeClass(a);var d,e,f,g,h=(a||"").match(c)||[],i=this.node,j=i.className.baseVal,k=j.match(c)||[];for(d=0;f=h[d++];)e=k.indexOf(f),~e?k.splice(e,1):k.push(f);return g=k.join(" "),j!=g&&(i.className.baseVal=g),this}}),d.plugin(function(){function a(a){return a}function c(a){return function(b){return+b.toFixed(3)+a}}var d={"+":function(a,b){return a+b},"-":function(a,b){return a-b},"/":function(a,b){return a/b},"*":function(a,b){return a*b}},e=String,f=/[a-z]+$/i,g=/^\s*([+\-\/*])\s*=\s*([\d.eE+\-]+)\s*([^\d\s]+)?\s*$/;b.on("snap.util.attr",function(a){var c=e(a).match(g);if(c){var h=b.nt(),i=h.substring(h.lastIndexOf(".")+1),j=this.attr(i),k={};b.stop();var l=c[3]||"",m=j.match(f),n=d[c[1]];if(m&&m==l?a=n(parseFloat(j),+c[2]):(j=this.asPX(i),a=n(this.asPX(i),this.asPX(i,c[2]+l))),isNaN(j)||isNaN(a))return;k[i]=a,this.attr(k)}})(-10),b.on("snap.util.equal",function(h,i){var j=e(this.attr(h)||""),k=e(i).match(g);if(k){b.stop();var l=k[3]||"",m=j.match(f),n=d[k[1]];return m&&m==l?{from:parseFloat(j),to:n(parseFloat(j),+k[2]),f:c(m)}:(j=this.asPX(h),{from:j,to:n(j,this.asPX(h,k[2]+l)),f:a})}})(-10)}),d.plugin(function(c,d,e,f){var g=e.prototype,h=c.is;g.rect=function(a,b,c,d,e,f){var g;return null==f&&(f=e),h(a,"object")&&"[object Object]"==a?g=a:null!=a&&(g={x:a,y:b,width:c,height:d},null!=e&&(g.rx=e,g.ry=f)),this.el("rect",g)},g.circle=function(a,b,c){var d;return h(a,"object")&&"[object Object]"==a?d=a:null!=a&&(d={cx:a,cy:b,r:c}),this.el("circle",d)};var i=function(){function a(){this.parentNode.removeChild(this)}return function(b,c){var d=f.doc.createElement("img"),e=f.doc.body;d.style.cssText="position:absolute;left:-9999em;top:-9999em",d.onload=function(){c.call(d),d.onload=d.onerror=null,e.removeChild(d)},d.onerror=a,e.appendChild(d),d.src=b}}();g.image=function(a,b,d,e,f){var g=this.el("image");if(h(a,"object")&&"src"in a)g.attr(a);else if(null!=a){var j={"xlink:href":a,preserveAspectRatio:"none"};null!=b&&null!=d&&(j.x=b,j.y=d),null!=e&&null!=f?(j.width=e,j.height=f):i(a,function(){c._.$(g.node,{width:this.offsetWidth,height:this.offsetHeight})}),c._.$(g.node,j)}return g},g.ellipse=function(a,b,c,d){var e;return h(a,"object")&&"[object Object]"==a?e=a:null!=a&&(e={cx:a,cy:b,rx:c,ry:d}),this.el("ellipse",e)},g.path=function(a){var b;return h(a,"object")&&!h(a,"array")?b=a:a&&(b={d:a}),this.el("path",b)},g.group=g.g=function(a){var b=this.el("g");return 1==arguments.length&&a&&!a.type?b.attr(a):arguments.length&&b.add(Array.prototype.slice.call(arguments,0)),b},g.svg=function(a,b,c,d,e,f,g,i){var j={};return h(a,"object")&&null==b?j=a:(null!=a&&(j.x=a),null!=b&&(j.y=b),null!=c&&(j.width=c),null!=d&&(j.height=d),null!=e&&null!=f&&null!=g&&null!=i&&(j.viewBox=[e,f,g,i])),this.el("svg",j)},g.mask=function(a){var b=this.el("mask");return 1==arguments.length&&a&&!a.type?b.attr(a):arguments.length&&b.add(Array.prototype.slice.call(arguments,0)),b},g.ptrn=function(a,b,c,d,e,f,g,i){if(h(a,"object"))var j=a;else j={patternUnits:"userSpaceOnUse"},a&&(j.x=a),b&&(j.y=b),null!=c&&(j.width=c),null!=d&&(j.height=d),j.viewBox=null!=e&&null!=f&&null!=g&&null!=i?[e,f,g,i]:[a||0,b||0,c||0,d||0];return this.el("pattern",j)},g.use=function(a){return null!=a?(a instanceof d&&(a.attr("id")||a.attr({id:c._.id(a)}),a=a.attr("id")),"#"==String(a).charAt()&&(a=a.substring(1)),this.el("use",{"xlink:href":"#"+a})):d.prototype.use.call(this)},g.symbol=function(a,b,c,d){var e={};return null!=a&&null!=b&&null!=c&&null!=d&&(e.viewBox=[a,b,c,d]),this.el("symbol",e)},g.text=function(a,b,c){var d={};return h(a,"object")?d=a:null!=a&&(d={x:a,y:b,text:c||""}),this.el("text",d)},g.line=function(a,b,c,d){var e={};return h(a,"object")?e=a:null!=a&&(e={x1:a,x2:c,y1:b,y2:d}),this.el("line",e)},g.polyline=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b={};return h(a,"object")&&!h(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polyline",b)},g.polygon=function(a){arguments.length>1&&(a=Array.prototype.slice.call(arguments,0));var b={};return h(a,"object")&&!h(a,"array")?b=a:null!=a&&(b={points:a}),this.el("polygon",b)},function(){function d(){return this.selectAll("stop")}function e(a,b){var d=k("stop"),e={offset:+b+"%"};return a=c.color(a),e["stop-color"]=a.hex,a.opacity<1&&(e["stop-opacity"]=a.opacity),k(d,e),this.node.appendChild(d),this}function f(){if("linearGradient"==this.type){var a=k(this.node,"x1")||0,b=k(this.node,"x2")||1,d=k(this.node,"y1")||0,e=k(this.node,"y2")||0;return c._.box(a,d,math.abs(b-a),math.abs(e-d))}var f=this.node.cx||.5,g=this.node.cy||.5,h=this.node.r||0;return c._.box(f-h,g-h,2*h,2*h)}function h(a,c){function d(a,b){for(var c=(b-l)/(a-m),d=m;a>d;d++)g[d].offset=+(+l+c*(d-m)).toFixed(2);m=a,l=b}var e,f=b("snap.util.grad.parse",null,c).firstDefined();if(!f)return null;f.params.unshift(a),e="l"==f.type.toLowerCase()?i.apply(0,f.params):j.apply(0,f.params),f.type!=f.type.toLowerCase()&&k(e.node,{gradientUnits:"userSpaceOnUse"});var g=f.stops,h=g.length,l=0,m=0;h--;for(var n=0;h>n;n++)"offset"in g[n]&&d(n,g[n].offset);for(g[h].offset=g[h].offset||100,d(h,g[h].offset),n=0;h>=n;n++){var o=g[n];e.addStop(o.color,o.offset)}return e}function i(a,b,g,h,i){var j=c._.make("linearGradient",a);return j.stops=d,j.addStop=e,j.getBBox=f,null!=b&&k(j.node,{x1:b,y1:g,x2:h,y2:i}),j}function j(a,b,g,h,i,j){var l=c._.make("radialGradient",a);return l.stops=d,l.addStop=e,l.getBBox=f,null!=b&&k(l.node,{cx:b,cy:g,r:h}),null!=i&&null!=j&&k(l.node,{fx:i,fy:j}),l}var k=c._.$;g.gradient=function(a){return h(this.defs,a)},g.gradientLinear=function(a,b,c,d){return i(this.defs,a,b,c,d)},g.gradientRadial=function(a,b,c,d,e){return j(this.defs,a,b,c,d,e)},g.toString=function(){var a,b=this.node.ownerDocument,d=b.createDocumentFragment(),e=b.createElement("div"),f=this.node.cloneNode(!0);return d.appendChild(e),e.appendChild(f),c._.$(f,{xmlns:"http://www.w3.org/2000/svg"}),a=e.innerHTML,d.removeChild(d.firstChild),a},g.toDataURL=function(){return a&&a.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},g.clear=function(){for(var a,b=this.node.firstChild;b;)a=b.nextSibling,"defs"!=b.tagName?b.parentNode.removeChild(b):g.clear.call({node:b}),b=a}}()}),d.plugin(function(a,b){function c(a){var b=c.ps=c.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[K](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]}function d(a,b,c,d){return null==a&&(a=b=c=d=0),null==b&&(b=a.y,c=a.width,d=a.height,a=a.x),{x:a,y:b,width:c,w:c,height:d,h:d,x2:a+c,y2:b+d,cx:a+c/2,cy:b+d/2,r1:N.min(c,d)/2,r2:N.max(c,d)/2,r0:N.sqrt(c*c+d*d)/2,path:w(a,b,c,d),vb:[a,b,c,d].join(" ")}}function e(){return this.join(",").replace(L,"$1")}function f(a){var b=J(a);return b.toString=e,b}function g(a,b,c,d,e,f,g,h,j){return null==j?n(a,b,c,d,e,f,g,h):i(a,b,c,d,e,f,g,h,o(a,b,c,d,e,f,g,h,j))}function h(c,d){function e(a){return+(+a).toFixed(3)}return a._.cacher(function(a,f,h){a instanceof b&&(a=a.attr("d")),a=E(a);for(var j,k,l,m,n,o="",p={},q=0,r=0,s=a.length;s>r;r++){if(l=a[r],"M"==l[0])j=+l[1],k=+l[2];else{if(m=g(j,k,l[1],l[2],l[3],l[4],l[5],l[6]),q+m>f){if(d&&!p.start){if(n=g(j,k,l[1],l[2],l[3],l[4],l[5],l[6],f-q),o+=["C"+e(n.start.x),e(n.start.y),e(n.m.x),e(n.m.y),e(n.x),e(n.y)],h)return o;p.start=o,o=["M"+e(n.x),e(n.y)+"C"+e(n.n.x),e(n.n.y),e(n.end.x),e(n.end.y),e(l[5]),e(l[6])].join(),q+=m,j=+l[5],k=+l[6];continue}if(!c&&!d)return n=g(j,k,l[1],l[2],l[3],l[4],l[5],l[6],f-q)}q+=m,j=+l[5],k=+l[6]}o+=l.shift()+l}return p.end=o,n=c?q:d?p:i(j,k,l[0],l[1],l[2],l[3],l[4],l[5],1)},null,a._.clone)}function i(a,b,c,d,e,f,g,h,i){var j=1-i,k=R(j,3),l=R(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*N.atan2(q-s,r-t)/O;return{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}}function j(b,c,e,f,g,h,i,j){a.is(b,"array")||(b=[b,c,e,f,g,h,i,j]);var k=D.apply(null,b);return d(k.min.x,k.min.y,k.max.x-k.min.x,k.max.y-k.min.y)}function k(a,b,c){return b>=a.x&&b<=a.x+a.width&&c>=a.y&&c<=a.y+a.height}function l(a,b){return a=d(a),b=d(b),k(b,a.x,a.y)||k(b,a.x2,a.y)||k(b,a.x,a.y2)||k(b,a.x2,a.y2)||k(a,b.x,b.y)||k(a,b.x2,b.y)||k(a,b.x,b.y2)||k(a,b.x2,b.y2)||(a.x<b.x2&&a.x>b.x||b.x<a.x2&&b.x>a.x)&&(a.y<b.y2&&a.y>b.y||b.y<a.y2&&b.y>a.y)}function m(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function n(a,b,c,d,e,f,g,h,i){null==i&&(i=1),i=i>1?1:0>i?0:i;for(var j=i/2,k=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;k>p;p++){var q=j*l[p]+j,r=m(q,a,c,e,g),s=m(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return j*o}function o(a,b,c,d,e,f,g,h,i){if(!(0>i||n(a,b,c,d,e,f,g,h)<i)){var j,k=1,l=k/2,m=k-l,o=.01;for(j=n(a,b,c,d,e,f,g,h,m);S(j-i)>o;)l/=2,m+=(i>j?1:-1)*l,j=n(a,b,c,d,e,f,g,h,m);return m}}function p(a,b,c,d,e,f,g,h){if(!(Q(a,c)<P(e,g)||P(a,c)>Q(e,g)||Q(b,d)<P(f,h)||P(b,d)>Q(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+Q(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+Q(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+Q(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+Q(f,h).toFixed(2)))return{x:l,y:m}}}}function q(a,b,c){var d=j(a),e=j(b);if(!l(d,e))return c?0:[];for(var f=n.apply(0,a),g=n.apply(0,b),h=~~(f/8),k=~~(g/8),m=[],o=[],q={},r=c?0:[],s=0;h+1>s;s++){var t=i.apply(0,a.concat(s/h));m.push({x:t.x,y:t.y,t:s/h})}for(s=0;k+1>s;s++)t=i.apply(0,b.concat(s/k)),o.push({x:t.x,y:t.y,t:s/k});for(s=0;h>s;s++)for(var u=0;k>u;u++){var v=m[s],w=m[s+1],x=o[u],y=o[u+1],z=S(w.x-v.x)<.001?"y":"x",A=S(y.x-x.x)<.001?"y":"x",B=p(v.x,v.y,w.x,w.y,x.x,x.y,y.x,y.y);if(B){if(q[B.x.toFixed(4)]==B.y.toFixed(4))continue;q[B.x.toFixed(4)]=B.y.toFixed(4);var C=v.t+S((B[z]-v[z])/(w[z]-v[z]))*(w.t-v.t),D=x.t+S((B[A]-x[A])/(y[A]-x[A]))*(y.t-x.t);C>=0&&1>=C&&D>=0&&1>=D&&(c?r++:r.push({x:B.x,y:B.y,t1:C,t2:D}))}}return r}function r(a,b){return t(a,b)}function s(a,b){return t(a,b,1)}function t(a,b,c){a=E(a),b=E(b);for(var d,e,f,g,h,i,j,k,l,m,n=c?0:[],o=0,p=a.length;p>o;o++){var r=a[o];if("M"==r[0])d=h=r[1],e=i=r[2];else{"C"==r[0]?(l=[d,e].concat(r.slice(1)),d=l[6],e=l[7]):(l=[d,e,d,e,h,i,h,i],d=h,e=i);for(var s=0,t=b.length;t>s;s++){var u=b[s];if("M"==u[0])f=j=u[1],g=k=u[2];else{"C"==u[0]?(m=[f,g].concat(u.slice(1)),f=m[6],g=m[7]):(m=[f,g,f,g,j,k,j,k],f=j,g=k);var v=q(l,m,c);if(c)n+=v;else{for(var w=0,x=v.length;x>w;w++)v[w].segment1=o,v[w].segment2=s,v[w].bez1=l,v[w].bez2=m;n=n.concat(v)}}}}}return n}function u(a,b,c){var d=v(a);return k(d,b,c)&&t(a,[["M",b,c],["H",d.x2+10]],1)%2==1}function v(a){var b=c(a);if(b.bbox)return J(b.bbox);if(!a)return d();a=E(a);for(var e,f=0,g=0,h=[],i=[],j=0,k=a.length;k>j;j++)if(e=a[j],"M"==e[0])f=e[1],g=e[2],h.push(f),i.push(g);else{var l=D(f,g,e[1],e[2],e[3],e[4],e[5],e[6]);h=h.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),f=e[5],g=e[6]}var m=P.apply(0,h),n=P.apply(0,i),o=Q.apply(0,h),p=Q.apply(0,i),q=d(m,n,o-m,p-n);return b.bbox=J(q),q}function w(a,b,c,d,f){if(f)return[["M",+a+ +f,b],["l",c-2*f,0],["a",f,f,0,0,1,f,f],["l",0,d-2*f],["a",f,f,0,0,1,-f,f],["l",2*f-c,0],["a",f,f,0,0,1,-f,-f],["l",0,2*f-d],["a",f,f,0,0,1,f,-f],["z"]];var g=[["M",a,b],["l",c,0],["l",0,d],["l",-c,0],["z"]];return g.toString=e,g}function x(a,b,c,d,f){if(null==f&&null==d&&(d=c),a=+a,b=+b,c=+c,d=+d,null!=f)var g=Math.PI/180,h=a+c*Math.cos(-d*g),i=a+c*Math.cos(-f*g),j=b+c*Math.sin(-d*g),k=b+c*Math.sin(-f*g),l=[["M",h,j],["A",c,c,0,+(f-d>180),0,i,k]];else l=[["M",a,b],["m",0,-d],["a",c,d,0,1,1,0,2*d],["a",c,d,0,1,1,0,-2*d],["z"]];return l.toString=e,l}function y(b){var d=c(b),g=String.prototype.toLowerCase;if(d.rel)return f(d.rel);a.is(b,"array")&&a.is(b&&b[0],"array")||(b=a.parsePathString(b));var h=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=b[0][1],j=b[0][2],k=i,l=j,m++,h.push(["M",i,j]));for(var n=m,o=b.length;o>n;n++){var p=h[n]=[],q=b[n];if(q[0]!=g.call(q[0]))switch(p[0]=g.call(q[0]),p[0]){case"a":p[1]=q[1],p[2]=q[2],p[3]=q[3],p[4]=q[4],p[5]=q[5],p[6]=+(q[6]-i).toFixed(3),p[7]=+(q[7]-j).toFixed(3);break;case"v":p[1]=+(q[1]-j).toFixed(3);break;case"m":k=q[1],l=q[2];default:for(var r=1,s=q.length;s>r;r++)p[r]=+(q[r]-(r%2?i:j)).toFixed(3)}else{p=h[n]=[],"m"==q[0]&&(k=q[1]+i,l=q[2]+j);for(var t=0,u=q.length;u>t;t++)h[n][t]=q[t]}var v=h[n].length;switch(h[n][0]){case"z":i=k,j=l;break;case"h":i+=+h[n][v-1];break;case"v":j+=+h[n][v-1];break;default:i+=+h[n][v-2],j+=+h[n][v-1]}}return h.toString=e,d.rel=f(h),h}function z(b){var d=c(b);if(d.abs)return f(d.abs);if(I(b,"array")&&I(b&&b[0],"array")||(b=a.parsePathString(b)),!b||!b.length)return[["M",0,0]];var g,h=[],i=0,j=0,k=0,l=0,m=0;"M"==b[0][0]&&(i=+b[0][1],j=+b[0][2],k=i,l=j,m++,h[0]=["M",i,j]);for(var n,o,p=3==b.length&&"M"==b[0][0]&&"R"==b[1][0].toUpperCase()&&"Z"==b[2][0].toUpperCase(),q=m,r=b.length;r>q;q++){if(h.push(n=[]),o=b[q],g=o[0],g!=g.toUpperCase())switch(n[0]=g.toUpperCase(),n[0]){case"A":n[1]=o[1],n[2]=o[2],n[3]=o[3],n[4]=o[4],n[5]=o[5],n[6]=+o[6]+i,n[7]=+o[7]+j;break;case"V":n[1]=+o[1]+j;break;case"H":n[1]=+o[1]+i;break;case"R":for(var s=[i,j].concat(o.slice(1)),t=2,u=s.length;u>t;t++)s[t]=+s[t]+i,s[++t]=+s[t]+j;h.pop(),h=h.concat(G(s,p));break;case"O":h.pop(),s=x(i,j,o[1],o[2]),s.push(s[0]),h=h.concat(s);break;case"U":h.pop(),h=h.concat(x(i,j,o[1],o[2],o[3])),n=["U"].concat(h[h.length-1].slice(-2));break;case"M":k=+o[1]+i,l=+o[2]+j;default:for(t=1,u=o.length;u>t;t++)n[t]=+o[t]+(t%2?i:j)}else if("R"==g)s=[i,j].concat(o.slice(1)),h.pop(),h=h.concat(G(s,p)),n=["R"].concat(o.slice(-2));else if("O"==g)h.pop(),s=x(i,j,o[1],o[2]),s.push(s[0]),h=h.concat(s);else if("U"==g)h.pop(),h=h.concat(x(i,j,o[1],o[2],o[3])),n=["U"].concat(h[h.length-1].slice(-2));else for(var v=0,w=o.length;w>v;v++)n[v]=o[v];if(g=g.toUpperCase(),"O"!=g)switch(n[0]){case"Z":i=+k,j=+l;break;case"H":i=n[1];break;case"V":j=n[1];break;case"M":k=n[n.length-2],l=n[n.length-1];default:i=n[n.length-2],j=n[n.length-1]}}return h.toString=e,d.abs=f(h),h}function A(a,b,c,d){return[a,b,c,d,c,d]}function B(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function C(b,c,d,e,f,g,h,i,j,k){var l,m=120*O/180,n=O/180*(+f||0),o=[],p=a._.cacher(function(a,b,c){var d=a*N.cos(c)-b*N.sin(c),e=a*N.sin(c)+b*N.cos(c);return{x:d,y:e}});if(k)y=k[0],z=k[1],w=k[2],x=k[3];else{l=p(b,c,-n),b=l.x,c=l.y,l=p(i,j,-n),i=l.x,j=l.y;var q=(N.cos(O/180*f),N.sin(O/180*f),(b-i)/2),r=(c-j)/2,s=q*q/(d*d)+r*r/(e*e);s>1&&(s=N.sqrt(s),d=s*d,e=s*e);var t=d*d,u=e*e,v=(g==h?-1:1)*N.sqrt(S((t*u-t*r*r-u*q*q)/(t*r*r+u*q*q))),w=v*d*r/e+(b+i)/2,x=v*-e*q/d+(c+j)/2,y=N.asin(((c-x)/e).toFixed(9)),z=N.asin(((j-x)/e).toFixed(9));y=w>b?O-y:y,z=w>i?O-z:z,0>y&&(y=2*O+y),0>z&&(z=2*O+z),h&&y>z&&(y-=2*O),!h&&z>y&&(z-=2*O)}var A=z-y;if(S(A)>m){var B=z,D=i,E=j;z=y+m*(h&&z>y?1:-1),i=w+d*N.cos(z),j=x+e*N.sin(z),o=C(i,j,d,e,f,0,h,D,E,[z,B,w,x])}A=z-y;var F=N.cos(y),G=N.sin(y),H=N.cos(z),I=N.sin(z),J=N.tan(A/4),K=4/3*d*J,L=4/3*e*J,M=[b,c],P=[b+K*G,c-L*F],Q=[i+K*I,j-L*H],R=[i,j];if(P[0]=2*M[0]-P[0],P[1]=2*M[1]-P[1],k)return[P,Q,R].concat(o);o=[P,Q,R].concat(o).join().split(",");for(var T=[],U=0,V=o.length;V>U;U++)T[U]=U%2?p(o[U-1],o[U],n).y:p(o[U],o[U+1],n).x;return T}function D(a,b,c,d,e,f,g,h){for(var i,j,k,l,m,n,o,p,q=[],r=[[],[]],s=0;2>s;++s)if(0==s?(j=6*a-12*c+6*e,i=-3*a+9*c-9*e+3*g,k=3*c-3*a):(j=6*b-12*d+6*f,i=-3*b+9*d-9*f+3*h,k=3*d-3*b),S(i)<1e-12){if(S(j)<1e-12)continue;l=-k/j,l>0&&1>l&&q.push(l)}else o=j*j-4*k*i,p=N.sqrt(o),0>o||(m=(-j+p)/(2*i),m>0&&1>m&&q.push(m),n=(-j-p)/(2*i),n>0&&1>n&&q.push(n));for(var t,u=q.length,v=u;u--;)l=q[u],t=1-l,r[0][u]=t*t*t*a+3*t*t*l*c+3*t*l*l*e+l*l*l*g,r[1][u]=t*t*t*b+3*t*t*l*d+3*t*l*l*f+l*l*l*h;return r[0][v]=a,r[1][v]=b,r[0][v+1]=g,r[1][v+1]=h,r[0].length=r[1].length=v+2,{min:{x:P.apply(0,r[0]),y:P.apply(0,r[1])},max:{x:Q.apply(0,r[0]),y:Q.apply(0,r[1])}}}function E(a,b){var d=!b&&c(a);if(!b&&d.curve)return f(d.curve);for(var e=z(a),g=b&&z(b),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},j=(function(a,b,c){var d,e;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"].concat(C.apply(0,[b.x,b.y].concat(a.slice(1))));break;case"S":"C"==c||"S"==c?(d=2*b.x-b.bx,e=2*b.y-b.by):(d=b.x,e=b.y),a=["C",d,e].concat(a.slice(1));break;case"T":"Q"==c||"T"==c?(b.qx=2*b.x-b.qx,b.qy=2*b.y-b.qy):(b.qx=b.x,b.qy=b.y),a=["C"].concat(B(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"].concat(B(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"].concat(A(b.x,b.y,a[1],a[2]));break;case"H":a=["C"].concat(A(b.x,b.y,a[1],b.y));break;case"V":a=["C"].concat(A(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"].concat(A(b.x,b.y,b.X,b.Y))}return a}),k=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)m[b]="A",g&&(n[b]="A"),a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),r=Q(e.length,g&&g.length||0)}},l=function(a,b,c,d,f){a&&b&&"M"==a[f][0]&&"M"!=b[f][0]&&(b.splice(f,0,["M",d.x,d.y]),c.bx=0,c.by=0,c.x=a[f][1],c.y=a[f][2],r=Q(e.length,g&&g.length||0))},m=[],n=[],o="",p="",q=0,r=Q(e.length,g&&g.length||0);r>q;q++){e[q]&&(o=e[q][0]),"C"!=o&&(m[q]=o,q&&(p=m[q-1])),e[q]=j(e[q],h,p),"A"!=m[q]&&"C"==o&&(m[q]="C"),k(e,q),g&&(g[q]&&(o=g[q][0]),"C"!=o&&(n[q]=o,q&&(p=n[q-1])),g[q]=j(g[q],i,p),"A"!=n[q]&&"C"==o&&(n[q]="C"),k(g,q)),l(e,g,h,i,q),l(g,e,i,h,q);var s=e[q],t=g&&g[q],u=s.length,v=g&&t.length;h.x=s[u-2],h.y=s[u-1],h.bx=M(s[u-4])||h.x,h.by=M(s[u-3])||h.y,i.bx=g&&(M(t[v-4])||i.x),i.by=g&&(M(t[v-3])||i.y),i.x=g&&t[v-2],i.y=g&&t[v-1]}return g||(d.curve=f(e)),g?[e,g]:e}function F(a,b){if(!b)return a;var c,d,e,f,g,h,i;for(a=E(a),e=0,g=a.length;g>e;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a}function G(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}var H=b.prototype,I=a.is,J=a._.clone,K="hasOwnProperty",L=/,?([a-z]),?/gi,M=parseFloat,N=Math,O=N.PI,P=N.min,Q=N.max,R=N.pow,S=N.abs,T=h(1),U=h(),V=h(0,1),W=a._unit2px,X={path:function(a){return a.attr("path")},circle:function(a){var b=W(a);return x(b.cx,b.cy,b.r)},ellipse:function(a){var b=W(a);return x(b.cx||0,b.cy||0,b.rx,b.ry)},rect:function(a){var b=W(a);return w(b.x||0,b.y||0,b.width,b.height,b.rx,b.ry)},image:function(a){var b=W(a);return w(b.x||0,b.y||0,b.width,b.height)},line:function(a){return"M"+[a.attr("x1")||0,a.attr("y1")||0,a.attr("x2"),a.attr("y2")]},polyline:function(a){return"M"+a.attr("points")},polygon:function(a){return"M"+a.attr("points")+"z"},deflt:function(a){var b=a.node.getBBox();return w(b.x,b.y,b.width,b.height)}};a.path=c,a.path.getTotalLength=T,a.path.getPointAtLength=U,a.path.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return V(a,b).end;var d=V(a,c,1);return b?V(d,b).end:d},H.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},H.getPointAtLength=function(a){return U(this.attr("d"),a)},H.getSubpath=function(b,c){return a.path.getSubpath(this.attr("d"),b,c)},a._.box=d,a.path.findDotsAtSegment=i,a.path.bezierBBox=j,a.path.isPointInsideBBox=k,a.closest=function(b,c,e,f){for(var g=100,h=d(b-g/2,c-g/2,g,g),i=[],j=e[0].hasOwnProperty("x")?function(a){return{x:e[a].x,y:e[a].y}}:function(a){return{x:e[a],y:f[a]}},l=0;1e6>=g&&!l;){for(var m=0,n=e.length;n>m;m++){var o=j(m);if(k(h,o.x,o.y)){l++,i.push(o);break}}l||(g*=2,h=d(b-g/2,c-g/2,g,g))}if(1e6!=g){var p,q=1/0;for(m=0,n=i.length;n>m;m++){var r=a.len(b,c,i[m].x,i[m].y);q>r&&(q=r,i[m].len=r,p=i[m])}return p}},a.path.isBBoxIntersect=l,a.path.intersection=r,a.path.intersectionNumber=s,a.path.isPointInside=u,a.path.getBBox=v,a.path.get=X,a.path.toRelative=y,a.path.toAbsolute=z,a.path.toCubic=E,a.path.map=F,a.path.toString=e,a.path.clone=f}),d.plugin(function(a){var d=Math.max,e=Math.min,f=function(a){if(this.items=[],this.bindings={},this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)a[b]&&(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},g=f.prototype;g.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],a&&(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},g.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},g.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this},g.animate=function(d,e,f,g){"function"!=typeof f||f.length||(g=f,f=c.linear),d instanceof a._.Animation&&(g=d.callback,f=d.easing,e=f.dur,d=d.attr);var h=arguments;if(a.is(d,"array")&&a.is(h[h.length-1],"array"))var i=!0;var j,k=function(){j?this.b=j:j=this.b},l=0,m=this,n=g&&function(){++l==m.length&&g.call(this)
+};return this.forEach(function(a,c){b.once("snap.animcreated."+a.id,k),i?h[c]&&a.animate.apply(a,h[c]):a.animate(d,e,f,n)})},g.remove=function(){for(;this.length;)this.pop().remove();return this},g.bind=function(a,b,c){var d={};if("function"==typeof b)this.bindings[a]=b;else{var e=c||a;this.bindings[a]=function(a){d[e]=a,b.attr(d)}}return this},g.attr=function(a){var b={};for(var c in a)this.bindings[c]?this.bindings[c](a[c]):b[c]=a[c];for(var d=0,e=this.items.length;e>d;d++)this.items[d].attr(b);return this},g.clear=function(){for(;this.length;)this.pop()},g.splice=function(a,b){a=0>a?d(this.length+a,0):a,b=d(0,e(this.length-a,b));var c,g=[],h=[],i=[];for(c=2;c<arguments.length;c++)i.push(arguments[c]);for(c=0;b>c;c++)h.push(this[a+c]);for(;c<this.length-a;c++)g.push(this[a+c]);var j=i.length;for(c=0;c<j+g.length;c++)this.items[a+c]=this[a+c]=j>c?i[c]:g[c-j];for(c=this.items.length=this.length-=b-j;this[c];)delete this[c++];return new f(h)},g.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0;return!1},g.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},g.getBBox=function(){for(var a=[],b=[],c=[],f=[],g=this.items.length;g--;)if(!this.items[g].removed){var h=this.items[g].getBBox();a.push(h.x),b.push(h.y),c.push(h.x+h.width),f.push(h.y+h.height)}return a=e.apply(0,a),b=e.apply(0,b),c=d.apply(0,c),f=d.apply(0,f),{x:a,y:b,x2:c,y2:f,width:c-a,height:f-b,cx:a+(c-a)/2,cy:b+(f-b)/2}},g.clone=function(a){a=new f;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},g.toString=function(){return"Snap‘s set"},g.type="set",a.Set=f,a.set=function(){var a=new f;return arguments.length&&a.push.apply(a,Array.prototype.slice.call(arguments,0)),a}}),d.plugin(function(a,c){function d(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}}function e(b,c,e){c=p(c).replace(/\.{3}|\u2026/g,b),b=a.parseTransformString(b)||[],c=a.parseTransformString(c)||[];for(var f,g,h,i,l=Math.max(b.length,c.length),m=[],n=[],o=0;l>o;o++){if(h=b[o]||d(c[o]),i=c[o]||d(h),h[0]!=i[0]||"r"==h[0].toLowerCase()&&(h[2]!=i[2]||h[3]!=i[3])||"s"==h[0].toLowerCase()&&(h[3]!=i[3]||h[4]!=i[4])){b=a._.transform2matrix(b,e()),c=a._.transform2matrix(c,e()),m=[["m",b.a,b.b,b.c,b.d,b.e,b.f]],n=[["m",c.a,c.b,c.c,c.d,c.e,c.f]];break}for(m[o]=[],n[o]=[],f=0,g=Math.max(h.length,i.length);g>f;f++)f in h&&(m[o][f]=h[f]),f in i&&(n[o][f]=i[f])}return{from:k(m),to:k(n),f:j(m)}}function f(a){return a}function g(a){return function(b){return+b.toFixed(3)+a}}function h(a){return a.join(" ")}function i(b){return a.rgb(b[0],b[1],b[2])}function j(a){var b,c,d,e,f,g,h=0,i=[];for(b=0,c=a.length;c>b;b++){for(f="[",g=['"'+a[b][0]+'"'],d=1,e=a[b].length;e>d;d++)g[d]="val["+h++ +"]";f+=g+"]",i[b]=f}return Function("val","return Snap.path.toString.call(["+i+"])")}function k(a){for(var b=[],c=0,d=a.length;d>c;c++)for(var e=1,f=a[c].length;f>e;e++)b.push(a[c][e]);return b}function l(a){return isFinite(parseFloat(a))}function m(b,c){return a.is(b,"array")&&a.is(c,"array")?b.toString()==c.toString():!1}var n={},o=/[a-z]+$/i,p=String;n.stroke=n.fill="colour",c.prototype.equal=function(a,c){return b("snap.util.equal",this,a,c).firstDefined()},b.on("snap.util.equal",function(b,c){var d,q,r=p(this.attr(b)||""),s=this;if(l(r)&&l(c))return{from:parseFloat(r),to:parseFloat(c),f:f};if("colour"==n[b])return d=a.color(r),q=a.color(c),{from:[d.r,d.g,d.b,d.opacity],to:[q.r,q.g,q.b,q.opacity],f:i};if("viewBox"==b)return d=this.attr(b).vb.split(" ").map(Number),q=c.split(" ").map(Number),{from:d,to:q,f:h};if("transform"==b||"gradientTransform"==b||"patternTransform"==b)return c instanceof a.Matrix&&(c=c.toTransformString()),a._.rgTransform.test(c)||(c=a._.svgTransform2string(c)),e(r,c,function(){return s.getBBox(1)});if("d"==b||"path"==b)return d=a.path.toCubic(r,c),{from:k(d[0]),to:k(d[1]),f:j(d[0])};if("points"==b)return d=p(r).split(a._.separator),q=p(c).split(a._.separator),{from:d,to:q,f:function(a){return a}};var t=r.match(o),u=p(c).match(o);return t&&m(t,u)?{from:parseFloat(r),to:parseFloat(c),f:g(t)}:{from:this.asPX(b),to:this.asPX(b,c),f:f}})}),d.plugin(function(a,c,d,e){for(var f=c.prototype,g="hasOwnProperty",h=("createTouch"in e.doc),i=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],j={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},k=(function(a,b){var c="y"==a?"scrollTop":"scrollLeft",d=b&&b.node?b.node.ownerDocument:e.doc;return d[c in d.documentElement?"documentElement":"body"][c]}),l=function(){return this.originalEvent.preventDefault()},m=function(){return this.originalEvent.stopPropagation()},n=function(a,b,c,d){var e=h&&j[b]?j[b]:b,f=function(e){var f=k("y",d),i=k("x",d);if(h&&j[g](b))for(var n=0,o=e.targetTouches&&e.targetTouches.length;o>n;n++)if(e.targetTouches[n].target==a||a.contains(e.targetTouches[n].target)){var p=e;e=e.targetTouches[n],e.originalEvent=p,e.preventDefault=l,e.stopPropagation=m;break}var q=e.clientX+i,r=e.clientY+f;return c.call(d,e,q,r)};return b!==e&&a.addEventListener(b,f,!1),a.addEventListener(e,f,!1),function(){return b!==e&&a.removeEventListener(b,f,!1),a.removeEventListener(e,f,!1),!0}},o=[],p=function(a){for(var c,d=a.clientX,e=a.clientY,f=k("y"),g=k("x"),i=o.length;i--;){if(c=o[i],h){for(var j,l=a.touches&&a.touches.length;l--;)if(j=a.touches[l],j.identifier==c.el._drag.id||c.el.node.contains(j.target)){d=j.clientX,e=j.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();{var m=c.el.node;m.nextSibling,m.parentNode,m.style.display}d+=g,e+=f,b("snap.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},q=function(c){a.unmousemove(p).unmouseup(q);for(var d,e=o.length;e--;)d=o[e],d.el._drag={},b("snap.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,c),b.off("snap.drag.*."+d.el.id);o=[]},r=i.length;r--;)!function(b){a[b]=f[b]=function(c,d){if(a.is(c,"function"))this.events=this.events||[],this.events.push({name:b,f:c,unbind:n(this.node||document,b,c,d||this)});else for(var e=0,f=this.events.length;f>e;e++)if(this.events[e].name==b)try{this.events[e].f.call(this)}catch(g){}return this},a["un"+b]=f["un"+b]=function(a){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==b&&(c[d].f==a||!a))return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(i[r]);f.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},f.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var s=[];f.drag=function(c,d,e,f,g,h){function i(i,j,l){(i.originalEvent||i).preventDefault(),k._drag.x=j,k._drag.y=l,k._drag.id=i.identifier,!o.length&&a.mousemove(p).mouseup(q),o.push({el:k,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("snap.drag.start."+k.id,d),c&&b.on("snap.drag.move."+k.id,c),e&&b.on("snap.drag.end."+k.id,e),b("snap.drag.start."+k.id,g||f||k,j,l,i)}function j(a,c,d){b("snap.draginit."+k.id,k,a,c,d)}var k=this;if(!arguments.length){var l;return k.drag(function(a,b){this.attr({transform:l+(l?"T":"t")+[a,b]})},function(){l=this.transform().local})}return b.on("snap.draginit."+k.id,i),k._drag={},s.push({el:k,start:i,init:j}),k.mousedown(j),k},f.undrag=function(){for(var c=s.length;c--;)s[c].el==this&&(this.unmousedown(s[c].init),s.splice(c,1),b.unbind("snap.drag.*."+this.id),b.unbind("snap.draginit."+this.id));return!s.length&&a.unmousemove(p).unmouseup(q),this}}),d.plugin(function(a,c,d){var e=(c.prototype,d.prototype),f=/^\s*url\((.+)\)/,g=String,h=a._.$;a.filter={},e.filter=function(b){var d=this;"svg"!=d.type&&(d=d.paper);var e=a.parse(g(b)),f=a._.id(),i=(d.node.offsetWidth,d.node.offsetHeight,h("filter"));return h(i,{id:f,filterUnits:"userSpaceOnUse"}),i.appendChild(e.node),d.defs.appendChild(i),new c(i)},b.on("snap.util.getattr.filter",function(){b.stop();var c=h(this.node,"filter");if(c){var d=g(c).match(f);return d&&a.select(d[1])}}),b.on("snap.util.attr.filter",function(d){if(d instanceof c&&"filter"==d.type){b.stop();var e=d.node.id;e||(h(d.node,{id:d.id}),e=d.id),h(this.node,{filter:a.url(e)})}d&&"none"!=d||(b.stop(),this.node.removeAttribute("filter"))}),a.filter.blur=function(b,c){null==b&&(b=2);var d=null==c?b:[b,c];return a.format('<feGaussianBlur stdDeviation="{def}"/>',{def:d})},a.filter.blur.toString=function(){return this()},a.filter.shadow=function(b,c,d,e,f){return"string"==typeof d&&(e=d,f=e,d=4),"string"!=typeof e&&(f=e,e="#000"),e=e||"#000",null==d&&(d=4),null==f&&(f=1),null==b&&(b=0,c=2),null==c&&(c=b),e=a.color(e),a.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:e,dx:b,dy:c,blur:d,opacity:f})},a.filter.shadow.toString=function(){return this()},a.filter.grayscale=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},a.filter.grayscale.toString=function(){return this()},a.filter.sepia=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},a.filter.sepia.toString=function(){return this()},a.filter.saturate=function(b){return null==b&&(b=1),a.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-b})},a.filter.saturate.toString=function(){return this()},a.filter.hueRotate=function(b){return b=b||0,a.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:b})},a.filter.hueRotate.toString=function(){return this()},a.filter.invert=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:b,amount2:1-b})},a.filter.invert.toString=function(){return this()},a.filter.brightness=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:b})},a.filter.brightness.toString=function(){return this()},a.filter.contrast=function(b){return null==b&&(b=1),a.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:b,amount2:.5-b/2})},a.filter.contrast.toString=function(){return this()}}),d.plugin(function(a,b){var c=a._.box,d=a.is,e=/^[^a-z]*([tbmlrc])/i,f=function(){return"T"+this.dx+","+this.dy};b.prototype.getAlign=function(a,b){null==b&&d(a,"string")&&(b=a,a=null),a=a||this.paper;var g=a.getBBox?a.getBBox():c(a),h=this.getBBox(),i={};switch(b=b&&b.match(e),b=b?b[1].toLowerCase():"c"){case"t":i.dx=0,i.dy=g.y-h.y;break;case"b":i.dx=0,i.dy=g.y2-h.y2;break;case"m":i.dx=0,i.dy=g.cy-h.cy;break;case"l":i.dx=g.x-h.x,i.dy=0;break;case"r":i.dx=g.x2-h.x2,i.dy=0;break;default:i.dx=g.cx-h.cx,i.dy=0}return i.toString=f,i},b.prototype.align=function(a,b){return this.transform("..."+this.getAlign(a,b))}}),d});
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg.js
new file mode 100644
index 0000000..5475170
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dist/snap.svg.js
@@ -0,0 +1,8170 @@
+// Snap.svg 0.4.1
+//
+// Copyright (c) 2013 – 2015 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// build: 2015-04-13
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ┌────────────────────────────────────────────────────────────┐ \\
+// │ Eve 0.4.2 - JavaScript Events Library │ \\
+// ├────────────────────────────────────────────────────────────┤ \\
+// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
+// └────────────────────────────────────────────────────────────┘ \\
+
+(function (glob) {
+ var version = "0.4.2",
+ has = "hasOwnProperty",
+ separator = /[\.\/]/,
+ comaseparator = /\s*,\s*/,
+ wildcard = "*",
+ fun = function () {},
+ numsort = function (a, b) {
+ return a - b;
+ },
+ current_event,
+ stop,
+ events = {n: {}},
+ firstDefined = function () {
+ for (var i = 0, ii = this.length; i < ii; i++) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ lastDefined = function () {
+ var i = this.length;
+ while (--i) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ /*\
+ * eve
+ [ method ]
+
+ * Fires event with given `name`, given scope and other parameters.
+
+ > Arguments
+
+ - name (string) name of the *event*, dot (`.`) or slash (`/`) separated
+ - scope (object) context for the event handlers
+ - varargs (...) the rest of arguments will be sent to event handlers
+
+ = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
+ \*/
+ eve = function (name, scope) {
+ name = String(name);
+ var e = events,
+ oldstop = stop,
+ args = Array.prototype.slice.call(arguments, 2),
+ listeners = eve.listeners(name),
+ z = 0,
+ f = false,
+ l,
+ indexed = [],
+ queue = {},
+ out = [],
+ ce = current_event,
+ errors = [];
+ out.firstDefined = firstDefined;
+ out.lastDefined = lastDefined;
+ current_event = name;
+ stop = 0;
+ for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
+ indexed.push(listeners[i].zIndex);
+ if (listeners[i].zIndex < 0) {
+ queue[listeners[i].zIndex] = listeners[i];
+ }
+ }
+ indexed.sort(numsort);
+ while (indexed[z] < 0) {
+ l = queue[indexed[z++]];
+ out.push(l.apply(scope, args));
+ if (stop) {
+ stop = oldstop;
+ return out;
+ }
+ }
+ for (i = 0; i < ii; i++) {
+ l = listeners[i];
+ if ("zIndex" in l) {
+ if (l.zIndex == indexed[z]) {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ do {
+ z++;
+ l = queue[indexed[z]];
+ l && out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ } while (l)
+ } else {
+ queue[l.zIndex] = l;
+ }
+ } else {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ }
+ }
+ stop = oldstop;
+ current_event = ce;
+ return out;
+ };
+ // Undocumented. Debug only.
+ eve._events = events;
+ /*\
+ * eve.listeners
+ [ method ]
+
+ * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
+
+ > Arguments
+
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated
+
+ = (array) array of event handlers
+ \*/
+ eve.listeners = function (name) {
+ var names = name.split(separator),
+ e = events,
+ item,
+ items,
+ k,
+ i,
+ ii,
+ j,
+ jj,
+ nes,
+ es = [e],
+ out = [];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ nes = [];
+ for (j = 0, jj = es.length; j < jj; j++) {
+ e = es[j].n;
+ items = [e[names[i]], e[wildcard]];
+ k = 2;
+ while (k--) {
+ item = items[k];
+ if (item) {
+ nes.push(item);
+ out = out.concat(item.f || []);
+ }
+ }
+ }
+ es = nes;
+ }
+ return out;
+ };
+
+ /*\
+ * eve.on
+ [ method ]
+ **
+ * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
+ | eve.on("*.under.*", f);
+ | eve("mouse.under.floor"); // triggers f
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
+ > Example:
+ | eve.on("mouse", eatIt)(2);
+ | eve.on("mouse", scream);
+ | eve.on("mouse", catchIt)(1);
+ * This will ensure that `catchIt` function will be called before `eatIt`.
+ *
+ * If you want to put your handler before non-indexed handlers, specify a negative value.
+ * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
+ \*/
+ eve.on = function (name, f) {
+ name = String(name);
+ if (typeof f != "function") {
+ return function () {};
+ }
+ var names = name.split(comaseparator);
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ (function (name) {
+ var names = name.split(separator),
+ e = events,
+ exist;
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ e = e.n;
+ e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
+ }
+ e.f = e.f || [];
+ for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
+ exist = true;
+ break;
+ }
+ !exist && e.f.push(f);
+ }(names[i]));
+ }
+ return function (zIndex) {
+ if (+zIndex == +zIndex) {
+ f.zIndex = +zIndex;
+ }
+ };
+ };
+ /*\
+ * eve.f
+ [ method ]
+ **
+ * Returns function that will fire given event with optional arguments.
+ * Arguments that will be passed to the result function will be also
+ * concated to the list of final arguments.
+ | el.onclick = eve.f("click", 1, 2);
+ | eve.on("click", function (a, b, c) {
+ | console.log(a, b, c); // 1, 2, [event object]
+ | });
+ > Arguments
+ - event (string) event name
+ - varargs (…) and any other arguments
+ = (function) possible event handler function
+ \*/
+ eve.f = function (event) {
+ var attrs = [].slice.call(arguments, 1);
+ return function () {
+ eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
+ };
+ };
+ /*\
+ * eve.stop
+ [ method ]
+ **
+ * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
+ \*/
+ eve.stop = function () {
+ stop = 1;
+ };
+ /*\
+ * eve.nt
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ > Arguments
+ **
+ - subname (string) #optional subname of the event
+ **
+ = (string) name of the event, if `subname` is not specified
+ * or
+ = (boolean) `true`, if current event’s name contains `subname`
+ \*/
+ eve.nt = function (subname) {
+ if (subname) {
+ return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
+ }
+ return current_event;
+ };
+ /*\
+ * eve.nts
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ **
+ = (array) names of the event
+ \*/
+ eve.nts = function () {
+ return current_event.split(separator);
+ };
+ /*\
+ * eve.off
+ [ method ]
+ **
+ * Removes given function from the list of event listeners assigned to given name.
+ * If no arguments specified all the events will be cleared.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ \*/
+ /*\
+ * eve.unbind
+ [ method ]
+ **
+ * See @eve.off
+ \*/
+ eve.off = eve.unbind = function (name, f) {
+ if (!name) {
+ eve._events = events = {n: {}};
+ return;
+ }
+ var names = name.split(comaseparator);
+ if (names.length > 1) {
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ eve.off(names[i], f);
+ }
+ return;
+ }
+ names = name.split(separator);
+ var e,
+ key,
+ splice,
+ i, ii, j, jj,
+ cur = [events];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ for (j = 0; j < cur.length; j += splice.length - 2) {
+ splice = [j, 1];
+ e = cur[j].n;
+ if (names[i] != wildcard) {
+ if (e[names[i]]) {
+ splice.push(e[names[i]]);
+ }
+ } else {
+ for (key in e) if (e[has](key)) {
+ splice.push(e[key]);
+ }
+ }
+ cur.splice.apply(cur, splice);
+ }
+ }
+ for (i = 0, ii = cur.length; i < ii; i++) {
+ e = cur[i];
+ while (e.n) {
+ if (f) {
+ if (e.f) {
+ for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
+ e.f.splice(j, 1);
+ break;
+ }
+ !e.f.length && delete e.f;
+ }
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ var funcs = e.n[key].f;
+ for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
+ funcs.splice(j, 1);
+ break;
+ }
+ !funcs.length && delete e.n[key].f;
+ }
+ } else {
+ delete e.f;
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ delete e.n[key].f;
+ }
+ }
+ e = e.n;
+ }
+ }
+ };
+ /*\
+ * eve.once
+ [ method ]
+ **
+ * Binds given event handler with a given name to only run once then unbind itself.
+ | eve.once("login", f);
+ | eve("login"); // triggers f
+ | eve("login"); // no listeners
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) same return function as @eve.on
+ \*/
+ eve.once = function (name, f) {
+ var f2 = function () {
+ eve.unbind(name, f2);
+ return f.apply(this, arguments);
+ };
+ return eve.on(name, f2);
+ };
+ /*\
+ * eve.version
+ [ property (string) ]
+ **
+ * Current version of the library.
+ \*/
+ eve.version = version;
+ eve.toString = function () {
+ return "You are running Eve " + version;
+ };
+ (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() { return eve; })) : (glob.eve = eve));
+})(this);
+
+(function (glob, factory) {
+ // AMD support
+ if (typeof define == "function" && define.amd) {
+ // Define as an anonymous module
+ define(["eve"], function (eve) {
+ return factory(glob, eve);
+ });
+ } else if (typeof exports != 'undefined') {
+ // Next for Node.js or CommonJS
+ var eve = require('eve');
+ module.exports = factory(glob, eve);
+ } else {
+ // Browser globals (glob is window)
+ // Snap adds itself to window
+ factory(glob, glob.eve);
+ }
+}(window || this, function (window, eve) {
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+var mina = (function (eve) {
+ var animations = {},
+ requestAnimFrame = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function (callback) {
+ setTimeout(callback, 16);
+ },
+ isArray = Array.isArray || function (a) {
+ return a instanceof Array ||
+ Object.prototype.toString.call(a) == "[object Array]";
+ },
+ idgen = 0,
+ idprefix = "M" + (+new Date).toString(36),
+ ID = function () {
+ return idprefix + (idgen++).toString(36);
+ },
+ diff = function (a, b, A, B) {
+ if (isArray(a)) {
+ res = [];
+ for (var i = 0, ii = a.length; i < ii; i++) {
+ res[i] = diff(a[i], b, A[i], B);
+ }
+ return res;
+ }
+ var dif = (A - a) / (B - b);
+ return function (bb) {
+ return a + dif * (bb - b);
+ };
+ },
+ timer = Date.now || function () {
+ return +new Date;
+ },
+ sta = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.s;
+ }
+ var ds = a.s - val;
+ a.b += a.dur * ds;
+ a.B += a.dur * ds;
+ a.s = val;
+ },
+ speed = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.spd;
+ }
+ a.spd = val;
+ },
+ duration = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.dur;
+ }
+ a.s = a.s * val / a.dur;
+ a.dur = val;
+ },
+ stopit = function () {
+ var a = this;
+ delete animations[a.id];
+ a.update();
+ eve("mina.stop." + a.id, a);
+ },
+ pause = function () {
+ var a = this;
+ if (a.pdif) {
+ return;
+ }
+ delete animations[a.id];
+ a.update();
+ a.pdif = a.get() - a.b;
+ },
+ resume = function () {
+ var a = this;
+ if (!a.pdif) {
+ return;
+ }
+ a.b = a.get() - a.pdif;
+ delete a.pdif;
+ animations[a.id] = a;
+ },
+ update = function () {
+ var a = this,
+ res;
+ if (isArray(a.start)) {
+ res = [];
+ for (var j = 0, jj = a.start.length; j < jj; j++) {
+ res[j] = +a.start[j] +
+ (a.end[j] - a.start[j]) * a.easing(a.s);
+ }
+ } else {
+ res = +a.start + (a.end - a.start) * a.easing(a.s);
+ }
+ a.set(res);
+ },
+ frame = function () {
+ var len = 0;
+ for (var i in animations) if (animations.hasOwnProperty(i)) {
+ var a = animations[i],
+ b = a.get(),
+ res;
+ len++;
+ a.s = (b - a.b) / (a.dur / a.spd);
+ if (a.s >= 1) {
+ delete animations[i];
+ a.s = 1;
+ len--;
+ (function (a) {
+ setTimeout(function () {
+ eve("mina.finish." + a.id, a);
+ });
+ }(a));
+ }
+ a.update();
+ }
+ len && requestAnimFrame(frame);
+ },
+ /*\
+ * mina
+ [ method ]
+ **
+ * Generic animation of numbers
+ **
+ - a (number) start _slave_ number
+ - A (number) end _slave_ number
+ - b (number) start _master_ number (start time in general case)
+ - B (number) end _master_ number (end time in gereal case)
+ - get (function) getter of _master_ number (see @mina.time)
+ - set (function) setter of _slave_ number
+ - easing (function) #optional easing function, default is @mina.linear
+ = (object) animation descriptor
+ o {
+ o id (string) animation id,
+ o start (number) start _slave_ number,
+ o end (number) end _slave_ number,
+ o b (number) start _master_ number,
+ o s (number) animation status (0..1),
+ o dur (number) animation duration,
+ o spd (number) animation speed,
+ o get (function) getter of _master_ number (see @mina.time),
+ o set (function) setter of _slave_ number,
+ o easing (function) easing function, default is @mina.linear,
+ o status (function) status getter/setter,
+ o speed (function) speed getter/setter,
+ o duration (function) duration getter/setter,
+ o stop (function) animation stopper
+ o pause (function) pauses the animation
+ o resume (function) resumes the animation
+ o update (function) calles setter with the right value of the animation
+ o }
+ \*/
+ mina = function (a, A, b, B, get, set, easing) {
+ var anim = {
+ id: ID(),
+ start: a,
+ end: A,
+ b: b,
+ s: 0,
+ dur: B - b,
+ spd: 1,
+ get: get,
+ set: set,
+ easing: easing || mina.linear,
+ status: sta,
+ speed: speed,
+ duration: duration,
+ stop: stopit,
+ pause: pause,
+ resume: resume,
+ update: update
+ };
+ animations[anim.id] = anim;
+ var len = 0, i;
+ for (i in animations) if (animations.hasOwnProperty(i)) {
+ len++;
+ if (len == 2) {
+ break;
+ }
+ }
+ len == 1 && requestAnimFrame(frame);
+ return anim;
+ };
+ /*\
+ * mina.time
+ [ method ]
+ **
+ * Returns the current time. Equivalent to:
+ | function () {
+ | return (new Date).getTime();
+ | }
+ \*/
+ mina.time = timer;
+ /*\
+ * mina.getById
+ [ method ]
+ **
+ * Returns an animation by its id
+ - id (string) animation's id
+ = (object) See @mina
+ \*/
+ mina.getById = function (id) {
+ return animations[id] || null;
+ };
+
+ /*\
+ * mina.linear
+ [ method ]
+ **
+ * Default linear easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.linear = function (n) {
+ return n;
+ };
+ /*\
+ * mina.easeout
+ [ method ]
+ **
+ * Easeout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeout = function (n) {
+ return Math.pow(n, 1.7);
+ };
+ /*\
+ * mina.easein
+ [ method ]
+ **
+ * Easein easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easein = function (n) {
+ return Math.pow(n, .48);
+ };
+ /*\
+ * mina.easeinout
+ [ method ]
+ **
+ * Easeinout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeinout = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ if (n == 0) {
+ return 0;
+ }
+ var q = .48 - n / 1.04,
+ Q = Math.sqrt(.1734 + q * q),
+ x = Q - q,
+ X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
+ y = -Q - q,
+ Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
+ t = X + Y + .5;
+ return (1 - t) * 3 * t * t + t * t * t;
+ };
+ /*\
+ * mina.backin
+ [ method ]
+ **
+ * Backin easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backin = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ var s = 1.70158;
+ return n * n * ((s + 1) * n - s);
+ };
+ /*\
+ * mina.backout
+ [ method ]
+ **
+ * Backout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backout = function (n) {
+ if (n == 0) {
+ return 0;
+ }
+ n = n - 1;
+ var s = 1.70158;
+ return n * n * ((s + 1) * n + s) + 1;
+ };
+ /*\
+ * mina.elastic
+ [ method ]
+ **
+ * Elastic easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.elastic = function (n) {
+ if (n == !!n) {
+ return n;
+ }
+ return Math.pow(2, -10 * n) * Math.sin((n - .075) *
+ (2 * Math.PI) / .3) + 1;
+ };
+ /*\
+ * mina.bounce
+ [ method ]
+ **
+ * Bounce easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.bounce = function (n) {
+ var s = 7.5625,
+ p = 2.75,
+ l;
+ if (n < (1 / p)) {
+ l = s * n * n;
+ } else {
+ if (n < (2 / p)) {
+ n -= (1.5 / p);
+ l = s * n * n + .75;
+ } else {
+ if (n < (2.5 / p)) {
+ n -= (2.25 / p);
+ l = s * n * n + .9375;
+ } else {
+ n -= (2.625 / p);
+ l = s * n * n + .984375;
+ }
+ }
+ }
+ return l;
+ };
+ window.mina = mina;
+ return mina;
+})(typeof eve == "undefined" ? function () {} : eve);
+// Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+var Snap = (function(root) {
+Snap.version = "0.4.0";
+/*\
+ * Snap
+ [ method ]
+ **
+ * Creates a drawing surface or wraps existing SVG element.
+ **
+ - width (number|string) width of surface
+ - height (number|string) height of surface
+ * or
+ - DOM (SVGElement) element to be wrapped into Snap structure
+ * or
+ - array (array) array of elements (will return set of elements)
+ * or
+ - query (string) CSS query selector
+ = (object) @Element
+\*/
+function Snap(w, h) {
+ if (w) {
+ if (w.nodeType) {
+ return wrap(w);
+ }
+ if (is(w, "array") && Snap.set) {
+ return Snap.set.apply(Snap, w);
+ }
+ if (w instanceof Element) {
+ return w;
+ }
+ if (h == null) {
+ w = glob.doc.querySelector(String(w));
+ return wrap(w);
+ }
+ }
+ w = w == null ? "100%" : w;
+ h = h == null ? "100%" : h;
+ return new Paper(w, h);
+}
+Snap.toString = function () {
+ return "Snap v" + this.version;
+};
+Snap._ = {};
+var glob = {
+ win: root.window,
+ doc: root.window.document
+};
+Snap._.glob = glob;
+var has = "hasOwnProperty",
+ Str = String,
+ toFloat = parseFloat,
+ toInt = parseInt,
+ math = Math,
+ mmax = math.max,
+ mmin = math.min,
+ abs = math.abs,
+ pow = math.pow,
+ PI = math.PI,
+ round = math.round,
+ E = "",
+ S = " ",
+ objectToString = Object.prototype.toString,
+ ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
+ colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
+ bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ separator = Snap._.separator = /[,\s]+/,
+ whitespace = /[\s]/g,
+ commaSpaces = /[\s]*,[\s]*/,
+ hsrg = {hs: 1, rg: 1},
+ pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
+ idgen = 0,
+ idprefix = "S" + (+new Date).toString(36),
+ ID = function (el) {
+ return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
+ },
+ xlink = "http://www.w3.org/1999/xlink",
+ xmlns = "http://www.w3.org/2000/svg",
+ hub = {},
+ URL = Snap.url = function (url) {
+ return "url('#" + url + "')";
+ };
+
+function $(el, attr) {
+ if (attr) {
+ if (el == "#text") {
+ el = glob.doc.createTextNode(attr.text || attr["#text"] || "");
+ }
+ if (el == "#comment") {
+ el = glob.doc.createComment(attr.text || attr["#text"] || "");
+ }
+ if (typeof el == "string") {
+ el = $(el);
+ }
+ if (typeof attr == "string") {
+ if (el.nodeType == 1) {
+ if (attr.substring(0, 6) == "xlink:") {
+ return el.getAttributeNS(xlink, attr.substring(6));
+ }
+ if (attr.substring(0, 4) == "xml:") {
+ return el.getAttributeNS(xmlns, attr.substring(4));
+ }
+ return el.getAttribute(attr);
+ } else if (attr == "text") {
+ return el.nodeValue;
+ } else {
+ return null;
+ }
+ }
+ if (el.nodeType == 1) {
+ for (var key in attr) if (attr[has](key)) {
+ var val = Str(attr[key]);
+ if (val) {
+ if (key.substring(0, 6) == "xlink:") {
+ el.setAttributeNS(xlink, key.substring(6), val);
+ } else if (key.substring(0, 4) == "xml:") {
+ el.setAttributeNS(xmlns, key.substring(4), val);
+ } else {
+ el.setAttribute(key, val);
+ }
+ } else {
+ el.removeAttribute(key);
+ }
+ }
+ } else if ("text" in attr) {
+ el.nodeValue = attr.text;
+ }
+ } else {
+ el = glob.doc.createElementNS(xmlns, el);
+ }
+ return el;
+}
+Snap._.$ = $;
+Snap._.id = ID;
+function getAttrs(el) {
+ var attrs = el.attributes,
+ name,
+ out = {};
+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].namespaceURI == xlink) {
+ name = "xlink:";
+ } else {
+ name = "";
+ }
+ name += attrs[i].name;
+ out[name] = attrs[i].textContent;
+ }
+ return out;
+}
+function is(o, type) {
+ type = Str.prototype.toLowerCase.call(type);
+ if (type == "finite") {
+ return isFinite(o);
+ }
+ if (type == "array" &&
+ (o instanceof Array || Array.isArray && Array.isArray(o))) {
+ return true;
+ }
+ return (type == "null" && o === null) ||
+ (type == typeof o && o !== null) ||
+ (type == "object" && o === Object(o)) ||
+ objectToString.call(o).slice(8, -1).toLowerCase() == type;
+}
+/*\
+ * Snap.format
+ [ method ]
+ **
+ * Replaces construction of type `{<name>}` to the corresponding argument
+ **
+ - token (string) string to format
+ - json (object) object which properties are used as a replacement
+ = (string) formatted string
+ > Usage
+ | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+ | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
+ | x: 10,
+ | y: 20,
+ | dim: {
+ | width: 40,
+ | height: 50,
+ | "negative width": -40
+ | }
+ | }));
+\*/
+Snap.format = (function () {
+ var tokenRegex = /\{([^\}]+)\}/g,
+ objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
+ replacer = function (all, key, obj) {
+ var res = obj;
+ key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
+ name = name || quotedName;
+ if (res) {
+ if (name in res) {
+ res = res[name];
+ }
+ typeof res == "function" && isFunc && (res = res());
+ }
+ });
+ res = (res == null || res == obj ? all : res) + "";
+ return res;
+ };
+ return function (str, obj) {
+ return Str(str).replace(tokenRegex, function (all, key) {
+ return replacer(all, key, obj);
+ });
+ };
+})();
+function clone(obj) {
+ if (typeof obj == "function" || Object(obj) !== obj) {
+ return obj;
+ }
+ var res = new obj.constructor;
+ for (var key in obj) if (obj[has](key)) {
+ res[key] = clone(obj[key]);
+ }
+ return res;
+}
+Snap._.clone = clone;
+function repush(array, item) {
+ for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
+ return array.push(array.splice(i, 1)[0]);
+ }
+}
+function cacher(f, scope, postprocessor) {
+ function newf() {
+ var arg = Array.prototype.slice.call(arguments, 0),
+ args = arg.join("\u2400"),
+ cache = newf.cache = newf.cache || {},
+ count = newf.count = newf.count || [];
+ if (cache[has](args)) {
+ repush(count, args);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ count.length >= 1e3 && delete cache[count.shift()];
+ count.push(args);
+ cache[args] = f.apply(scope, arg);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ return newf;
+}
+Snap._.cacher = cacher;
+function angle(x1, y1, x2, y2, x3, y3) {
+ if (x3 == null) {
+ var x = x1 - x2,
+ y = y1 - y2;
+ if (!x && !y) {
+ return 0;
+ }
+ return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
+ } else {
+ return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
+ }
+}
+function rad(deg) {
+ return deg % 360 * PI / 180;
+}
+function deg(rad) {
+ return rad * 180 / PI % 360;
+}
+function x_y() {
+ return this.x + S + this.y;
+}
+function x_y_w_h() {
+ return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
+}
+
+/*\
+ * Snap.rad
+ [ method ]
+ **
+ * Transform angle to radians
+ - deg (number) angle in degrees
+ = (number) angle in radians
+\*/
+Snap.rad = rad;
+/*\
+ * Snap.deg
+ [ method ]
+ **
+ * Transform angle to degrees
+ - rad (number) angle in radians
+ = (number) angle in degrees
+\*/
+Snap.deg = deg;
+/*\
+ * Snap.sin
+ [ method ]
+ **
+ * Equivalent to `Math.sin()` only works with degrees, not radians.
+ - angle (number) angle in degrees
+ = (number) sin
+\*/
+Snap.sin = function (angle) {
+ return math.sin(Snap.rad(angle));
+};
+/*\
+ * Snap.tan
+ [ method ]
+ **
+ * Equivalent to `Math.tan()` only works with degrees, not radians.
+ - angle (number) angle in degrees
+ = (number) tan
+\*/
+Snap.tan = function (angle) {
+ return math.tan(Snap.rad(angle));
+};
+/*\
+ * Snap.cos
+ [ method ]
+ **
+ * Equivalent to `Math.cos()` only works with degrees, not radians.
+ - angle (number) angle in degrees
+ = (number) cos
+\*/
+Snap.cos = function (angle) {
+ return math.cos(Snap.rad(angle));
+};
+/*\
+ * Snap.asin
+ [ method ]
+ **
+ * Equivalent to `Math.asin()` only works with degrees, not radians.
+ - num (number) value
+ = (number) asin in degrees
+\*/
+Snap.asin = function (num) {
+ return Snap.deg(math.asin(num));
+};
+/*\
+ * Snap.acos
+ [ method ]
+ **
+ * Equivalent to `Math.acos()` only works with degrees, not radians.
+ - num (number) value
+ = (number) acos in degrees
+\*/
+Snap.acos = function (num) {
+ return Snap.deg(math.acos(num));
+};
+/*\
+ * Snap.atan
+ [ method ]
+ **
+ * Equivalent to `Math.atan()` only works with degrees, not radians.
+ - num (number) value
+ = (number) atan in degrees
+\*/
+Snap.atan = function (num) {
+ return Snap.deg(math.atan(num));
+};
+/*\
+ * Snap.atan2
+ [ method ]
+ **
+ * Equivalent to `Math.atan2()` only works with degrees, not radians.
+ - num (number) value
+ = (number) atan2 in degrees
+\*/
+Snap.atan2 = function (num) {
+ return Snap.deg(math.atan2(num));
+};
+/*\
+ * Snap.angle
+ [ method ]
+ **
+ * Returns an angle between two or three points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ - x3 (number) #optional x coord of third point
+ - y3 (number) #optional y coord of third point
+ = (number) angle in degrees
+\*/
+Snap.angle = angle;
+/*\
+ * Snap.len
+ [ method ]
+ **
+ * Returns distance between two points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ = (number) distance
+\*/
+Snap.len = function (x1, y1, x2, y2) {
+ return Math.sqrt(Snap.len2(x1, y1, x2, y2));
+};
+/*\
+ * Snap.len2
+ [ method ]
+ **
+ * Returns squared distance between two points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ = (number) distance
+\*/
+Snap.len2 = function (x1, y1, x2, y2) {
+ return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
+};
+/*\
+ * Snap.closestPoint
+ [ method ]
+ **
+ * Returns closest point to a given one on a given path.
+ > Parameters
+ - path (Element) path element
+ - x (number) x coord of a point
+ - y (number) y coord of a point
+ = (object) in format
+ {
+ x (number) x coord of the point on the path
+ y (number) y coord of the point on the path
+ length (number) length of the path to the point
+ distance (number) distance from the given point to the path
+ }
+\*/
+// Copied from http://bl.ocks.org/mbostock/8027637
+Snap.closestPoint = function (path, x, y) {
+ function distance2(p) {
+ var dx = p.x - x,
+ dy = p.y - y;
+ return dx * dx + dy * dy;
+ }
+ var pathNode = path.node,
+ pathLength = pathNode.getTotalLength(),
+ precision = pathLength / pathNode.pathSegList.numberOfItems * .125,
+ best,
+ bestLength,
+ bestDistance = Infinity;
+
+ // linear scan for coarse approximation
+ for (var scan, scanLength = 0, scanDistance; scanLength <= pathLength; scanLength += precision) {
+ if ((scanDistance = distance2(scan = pathNode.getPointAtLength(scanLength))) < bestDistance) {
+ best = scan, bestLength = scanLength, bestDistance = scanDistance;
+ }
+ }
+
+ // binary search for precise estimate
+ precision *= .5;
+ while (precision > .5) {
+ var before,
+ after,
+ beforeLength,
+ afterLength,
+ beforeDistance,
+ afterDistance;
+ if ((beforeLength = bestLength - precision) >= 0 && (beforeDistance = distance2(before = pathNode.getPointAtLength(beforeLength))) < bestDistance) {
+ best = before, bestLength = beforeLength, bestDistance = beforeDistance;
+ } else if ((afterLength = bestLength + precision) <= pathLength && (afterDistance = distance2(after = pathNode.getPointAtLength(afterLength))) < bestDistance) {
+ best = after, bestLength = afterLength, bestDistance = afterDistance;
+ } else {
+ precision *= .5;
+ }
+ }
+
+ best = {
+ x: best.x,
+ y: best.y,
+ length: bestLength,
+ distance: Math.sqrt(bestDistance)
+ };
+ return best;
+}
+/*\
+ * Snap.is
+ [ method ]
+ **
+ * Handy replacement for the `typeof` operator
+ - o (…) any object or primitive
+ - type (string) name of the type, e.g., `string`, `function`, `number`, etc.
+ = (boolean) `true` if given value is of given type
+\*/
+Snap.is = is;
+/*\
+ * Snap.snapTo
+ [ method ]
+ **
+ * Snaps given value to given grid
+ - values (array|number) given array of values or step of the grid
+ - value (number) value to adjust
+ - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.
+ = (number) adjusted value
+\*/
+Snap.snapTo = function (values, value, tolerance) {
+ tolerance = is(tolerance, "finite") ? tolerance : 10;
+ if (is(values, "array")) {
+ var i = values.length;
+ while (i--) if (abs(values[i] - value) <= tolerance) {
+ return values[i];
+ }
+ } else {
+ values = +values;
+ var rem = value % values;
+ if (rem < tolerance) {
+ return value - rem;
+ }
+ if (rem > values - tolerance) {
+ return value - rem + values;
+ }
+ }
+ return value;
+};
+// Colour
+/*\
+ * Snap.getRGB
+ [ method ]
+ **
+ * Parses color string as RGB object
+ - color (string) color string in one of the following formats:
+ # <ul>
+ # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
+ # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
+ # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
+ # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>
+ # <li>rgba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>
+ # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>
+ # <li>hsba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>
+ # <li>hsla(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # </ul>
+ * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) true if string can't be parsed
+ o }
+\*/
+Snap.getRGB = cacher(function (colour) {
+ if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ if (colour == "none") {
+ return {r: -1, g: -1, b: -1, hex: "none", toString: rgbtoString};
+ }
+ !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
+ if (!colour) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ var res,
+ red,
+ green,
+ blue,
+ opacity,
+ t,
+ values,
+ rgb = colour.match(colourRegExp);
+ if (rgb) {
+ if (rgb[2]) {
+ blue = toInt(rgb[2].substring(5), 16);
+ green = toInt(rgb[2].substring(3, 5), 16);
+ red = toInt(rgb[2].substring(1, 3), 16);
+ }
+ if (rgb[3]) {
+ blue = toInt((t = rgb[3].charAt(3)) + t, 16);
+ green = toInt((t = rgb[3].charAt(2)) + t, 16);
+ red = toInt((t = rgb[3].charAt(1)) + t, 16);
+ }
+ if (rgb[4]) {
+ values = rgb[4].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ }
+ if (rgb[5]) {
+ values = rgb[5].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsb2rgb(red, green, blue, opacity);
+ }
+ if (rgb[6]) {
+ values = rgb[6].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsl2rgb(red, green, blue, opacity);
+ }
+ red = mmin(math.round(red), 255);
+ green = mmin(math.round(green), 255);
+ blue = mmin(math.round(blue), 255);
+ opacity = mmin(mmax(opacity, 0), 1);
+ rgb = {r: red, g: green, b: blue, toString: rgbtoString};
+ rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
+ rgb.opacity = is(opacity, "finite") ? opacity : 1;
+ return rgb;
+ }
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+}, Snap);
+/*\
+ * Snap.hsb
+ [ method ]
+ **
+ * Converts HSB values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - b (number) value or brightness
+ = (string) hex representation of the color
+\*/
+Snap.hsb = cacher(function (h, s, b) {
+ return Snap.hsb2rgb(h, s, b).hex;
+});
+/*\
+ * Snap.hsl
+ [ method ]
+ **
+ * Converts HSL values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (string) hex representation of the color
+\*/
+Snap.hsl = cacher(function (h, s, l) {
+ return Snap.hsl2rgb(h, s, l).hex;
+});
+/*\
+ * Snap.rgb
+ [ method ]
+ **
+ * Converts RGB values to a hex representation of the color
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (string) hex representation of the color
+\*/
+Snap.rgb = cacher(function (r, g, b, o) {
+ if (is(o, "finite")) {
+ var round = math.round;
+ return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
+ }
+ return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
+});
+var toHex = function (color) {
+ var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
+ red = "rgb(255, 0, 0)";
+ toHex = cacher(function (color) {
+ if (color.toLowerCase() == "red") {
+ return red;
+ }
+ i.style.color = red;
+ i.style.color = color;
+ var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
+ return out == red ? null : out;
+ });
+ return toHex(color);
+},
+hsbtoString = function () {
+ return "hsb(" + [this.h, this.s, this.b] + ")";
+},
+hsltoString = function () {
+ return "hsl(" + [this.h, this.s, this.l] + ")";
+},
+rgbtoString = function () {
+ return this.opacity == 1 || this.opacity == null ?
+ this.hex :
+ "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
+},
+prepareRGB = function (r, g, b) {
+ if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
+ b = r.b;
+ g = r.g;
+ r = r.r;
+ }
+ if (g == null && is(r, string)) {
+ var clr = Snap.getRGB(r);
+ r = clr.r;
+ g = clr.g;
+ b = clr.b;
+ }
+ if (r > 1 || g > 1 || b > 1) {
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ }
+
+ return [r, g, b];
+},
+packageRGB = function (r, g, b, o) {
+ r = math.round(r * 255);
+ g = math.round(g * 255);
+ b = math.round(b * 255);
+ var rgb = {
+ r: r,
+ g: g,
+ b: b,
+ opacity: is(o, "finite") ? o : 1,
+ hex: Snap.rgb(r, g, b),
+ toString: rgbtoString
+ };
+ is(o, "finite") && (rgb.opacity = o);
+ return rgb;
+};
+/*\
+ * Snap.color
+ [ method ]
+ **
+ * Parses the color string and returns an object featuring the color's component values
+ - clr (string) color string in one of the supported formats (see @Snap.getRGB)
+ = (object) Combined RGB/HSB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) `true` if string can't be parsed,
+ o h (number) hue,
+ o s (number) saturation,
+ o v (number) value (brightness),
+ o l (number) lightness
+ o }
+\*/
+Snap.color = function (clr) {
+ var rgb;
+ if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
+ rgb = Snap.hsb2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
+ rgb = Snap.hsl2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else {
+ if (is(clr, "string")) {
+ clr = Snap.getRGB(clr);
+ }
+ if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
+ rgb = Snap.rgb2hsl(clr);
+ clr.h = rgb.h;
+ clr.s = rgb.s;
+ clr.l = rgb.l;
+ rgb = Snap.rgb2hsb(clr);
+ clr.v = rgb.b;
+ } else {
+ clr = {hex: "none"};
+ clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
+ clr.error = 1;
+ }
+ }
+ clr.toString = rgbtoString;
+ return clr;
+};
+/*\
+ * Snap.hsb2rgb
+ [ method ]
+ **
+ * Converts HSB values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - v (number) value or brightness
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsb2rgb = function (h, s, v, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
+ v = h.b;
+ s = h.s;
+ o = h.o;
+ h = h.h;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = v * s;
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = v - C;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.hsl2rgb
+ [ method ]
+ **
+ * Converts HSL values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsl2rgb = function (h, s, l, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
+ l = h.l;
+ s = h.s;
+ h = h.h;
+ }
+ if (h > 1 || s > 1 || l > 1) {
+ h /= 360;
+ s /= 100;
+ l /= 100;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = 2 * s * (l < .5 ? l : 1 - l);
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = l - C / 2;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.rgb2hsb
+ [ method ]
+ **
+ * Converts RGB values to an HSB object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSB object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o b (number) brightness
+ o }
+\*/
+Snap.rgb2hsb = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, V, C;
+ V = mmax(r, g, b);
+ C = V - mmin(r, g, b);
+ H = (C == 0 ? null :
+ V == r ? (g - b) / C :
+ V == g ? (b - r) / C + 2 :
+ (r - g) / C + 4
+ );
+ H = ((H + 360) % 6) * 60 / 360;
+ S = C == 0 ? 0 : C / V;
+ return {h: H, s: S, b: V, toString: hsbtoString};
+};
+/*\
+ * Snap.rgb2hsl
+ [ method ]
+ **
+ * Converts RGB values to an HSL object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSL object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o l (number) luminosity
+ o }
+\*/
+Snap.rgb2hsl = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, L, M, m, C;
+ M = mmax(r, g, b);
+ m = mmin(r, g, b);
+ C = M - m;
+ H = (C == 0 ? null :
+ M == r ? (g - b) / C :
+ M == g ? (b - r) / C + 2 :
+ (r - g) / C + 4);
+ H = ((H + 360) % 6) * 60 / 360;
+ L = (M + m) / 2;
+ S = (C == 0 ? 0 :
+ L < .5 ? C / (2 * L) :
+ C / (2 - 2 * L));
+ return {h: H, s: S, l: L, toString: hsltoString};
+};
+
+// Transformations
+/*\
+ * Snap.parsePathString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given path string into an array of arrays of path segments
+ - pathString (string|array) path string or array of segments (in the last case it is returned straight away)
+ = (array) array of segments
+\*/
+Snap.parsePathString = function (pathString) {
+ if (!pathString) {
+ return null;
+ }
+ var pth = Snap.path(pathString);
+ if (pth.arr) {
+ return Snap.path.clone(pth.arr);
+ }
+
+ var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
+ data = [];
+ if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
+ data = Snap.path.clone(pathString);
+ }
+ if (!data.length) {
+ Str(pathString).replace(pathCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ if (name == "m" && params.length > 2) {
+ data.push([b].concat(params.splice(0, 2)));
+ name = "l";
+ b = b == "m" ? "l" : "L";
+ }
+ if (name == "o" && params.length == 1) {
+ data.push([b, params[0]]);
+ }
+ if (name == "r") {
+ data.push([b].concat(params));
+ } else while (params.length >= paramCounts[name]) {
+ data.push([b].concat(params.splice(0, paramCounts[name])));
+ if (!paramCounts[name]) {
+ break;
+ }
+ }
+ });
+ }
+ data.toString = Snap.path.toString;
+ pth.arr = Snap.path.clone(data);
+ return data;
+};
+/*\
+ * Snap.parseTransformString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given transform string into an array of transformations
+ - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)
+ = (array) array of transformations
+\*/
+var parseTransformString = Snap.parseTransformString = function (TString) {
+ if (!TString) {
+ return null;
+ }
+ var paramCounts = {r: 3, s: 4, t: 2, m: 6},
+ data = [];
+ if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
+ data = Snap.path.clone(TString);
+ }
+ if (!data.length) {
+ Str(TString).replace(tCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ data.push([b].concat(params));
+ });
+ }
+ data.toString = Snap.path.toString;
+ return data;
+};
+function svgTransform2string(tstr) {
+ var res = [];
+ tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function (all, name, params) {
+ params = params.split(/\s*,\s*|\s+/);
+ if (name == "rotate" && params.length == 1) {
+ params.push(0, 0);
+ }
+ if (name == "scale") {
+ if (params.length > 2) {
+ params = params.slice(0, 2);
+ } else if (params.length == 2) {
+ params.push(0, 0);
+ }
+ if (params.length == 1) {
+ params.push(params[0], 0, 0);
+ }
+ }
+ if (name == "skewX") {
+ res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
+ } else if (name == "skewY") {
+ res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
+ } else {
+ res.push([name.charAt(0)].concat(params));
+ }
+ return all;
+ });
+ return res;
+}
+Snap._.svgTransform2string = svgTransform2string;
+Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
+function transform2matrix(tstr, bbox) {
+ var tdata = parseTransformString(tstr),
+ m = new Snap.Matrix;
+ if (tdata) {
+ for (var i = 0, ii = tdata.length; i < ii; i++) {
+ var t = tdata[i],
+ tlen = t.length,
+ command = Str(t[0]).toLowerCase(),
+ absolute = t[0] != command,
+ inver = absolute ? m.invert() : 0,
+ x1,
+ y1,
+ x2,
+ y2,
+ bb;
+ if (command == "t" && tlen == 2){
+ m.translate(t[1], 0);
+ } else if (command == "t" && tlen == 3) {
+ if (absolute) {
+ x1 = inver.x(0, 0);
+ y1 = inver.y(0, 0);
+ x2 = inver.x(t[1], t[2]);
+ y2 = inver.y(t[1], t[2]);
+ m.translate(x2 - x1, y2 - y1);
+ } else {
+ m.translate(t[1], t[2]);
+ }
+ } else if (command == "r") {
+ if (tlen == 2) {
+ bb = bb || bbox;
+ m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.rotate(t[1], x2, y2);
+ } else {
+ m.rotate(t[1], t[2], t[3]);
+ }
+ }
+ } else if (command == "s") {
+ if (tlen == 2 || tlen == 3) {
+ bb = bb || bbox;
+ m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.scale(t[1], t[1], x2, y2);
+ } else {
+ m.scale(t[1], t[1], t[2], t[3]);
+ }
+ } else if (tlen == 5) {
+ if (absolute) {
+ x2 = inver.x(t[3], t[4]);
+ y2 = inver.y(t[3], t[4]);
+ m.scale(t[1], t[2], x2, y2);
+ } else {
+ m.scale(t[1], t[2], t[3], t[4]);
+ }
+ }
+ } else if (command == "m" && tlen == 7) {
+ m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
+ }
+ }
+ }
+ return m;
+}
+Snap._.transform2matrix = transform2matrix;
+Snap._unit2px = unit2px;
+var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
+ function (a, b) {
+ var adown = a.nodeType == 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a == bup || !!(bup && bup.nodeType == 1 && (
+ adown.contains ?
+ adown.contains(bup) :
+ a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
+ ));
+ } :
+ function (a, b) {
+ if (b) {
+ while (b) {
+ b = b.parentNode;
+ if (b == a) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+function getSomeDefs(el) {
+ var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
+ (el.node.parentNode && wrap(el.node.parentNode)) ||
+ Snap.select("svg") ||
+ Snap(0, 0),
+ pdefs = p.select("defs"),
+ defs = pdefs == null ? false : pdefs.node;
+ if (!defs) {
+ defs = make("defs", p.node).node;
+ }
+ return defs;
+}
+function getSomeSVG(el) {
+ return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
+}
+Snap._.getSomeDefs = getSomeDefs;
+Snap._.getSomeSVG = getSomeSVG;
+function unit2px(el, name, value) {
+ var svg = getSomeSVG(el).node,
+ out = {},
+ mgr = svg.querySelector(".svg---mgr");
+ if (!mgr) {
+ mgr = $("rect");
+ $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, "class": "svg---mgr", fill: "none"});
+ svg.appendChild(mgr);
+ }
+ function getW(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {width: val});
+ try {
+ return mgr.getBBox().width;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function getH(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {height: val});
+ try {
+ return mgr.getBBox().height;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function set(nam, f) {
+ if (name == null) {
+ out[nam] = f(el.attr(nam) || 0);
+ } else if (nam == name) {
+ out = f(value == null ? el.attr(nam) || 0 : value);
+ }
+ }
+ switch (el.type) {
+ case "rect":
+ set("rx", getW);
+ set("ry", getH);
+ case "image":
+ set("width", getW);
+ set("height", getH);
+ case "text":
+ set("x", getW);
+ set("y", getH);
+ break;
+ case "circle":
+ set("cx", getW);
+ set("cy", getH);
+ set("r", getW);
+ break;
+ case "ellipse":
+ set("cx", getW);
+ set("cy", getH);
+ set("rx", getW);
+ set("ry", getH);
+ break;
+ case "line":
+ set("x1", getW);
+ set("x2", getW);
+ set("y1", getH);
+ set("y2", getH);
+ break;
+ case "marker":
+ set("refX", getW);
+ set("markerWidth", getW);
+ set("refY", getH);
+ set("markerHeight", getH);
+ break;
+ case "radialGradient":
+ set("fx", getW);
+ set("fy", getH);
+ break;
+ case "tspan":
+ set("dx", getW);
+ set("dy", getH);
+ break;
+ default:
+ set(name, getW);
+ }
+ svg.removeChild(mgr);
+ return out;
+}
+/*\
+ * Snap.select
+ [ method ]
+ **
+ * Wraps a DOM element specified by CSS selector as @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(glob.doc.querySelector(query));
+};
+/*\
+ * Snap.selectAll
+ [ method ]
+ **
+ * Wraps DOM elements specified by CSS selector as set or array of @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.selectAll = function (query) {
+ var nodelist = glob.doc.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+};
+
+function add2group(list) {
+ if (!is(list, "array")) {
+ list = Array.prototype.slice.call(arguments, 0);
+ }
+ var i = 0,
+ j = 0,
+ node = this.node;
+ while (this[i]) delete this[i++];
+ for (i = 0; i < list.length; i++) {
+ if (list[i].type == "set") {
+ list[i].forEach(function (el) {
+ node.appendChild(el.node);
+ });
+ } else {
+ node.appendChild(list[i].node);
+ }
+ }
+ var children = node.childNodes;
+ for (i = 0; i < children.length; i++) {
+ this[j++] = wrap(children[i]);
+ }
+ return this;
+}
+// Hub garbage collector every 10s
+setInterval(function () {
+ for (var key in hub) if (hub[has](key)) {
+ var el = hub[key],
+ node = el.node;
+ if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
+ delete hub[key];
+ }
+ }
+}, 1e4);
+function Element(el) {
+ if (el.snap in hub) {
+ return hub[el.snap];
+ }
+ var svg;
+ try {
+ svg = el.ownerSVGElement;
+ } catch(e) {}
+ /*\
+ * Element.node
+ [ property (object) ]
+ **
+ * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
+ > Usage
+ | // draw a circle at coordinate 10,10 with radius of 10
+ | var c = paper.circle(10, 10, 10);
+ | c.node.onclick = function () {
+ | c.attr("fill", "red");
+ | };
+ \*/
+ this.node = el;
+ if (svg) {
+ this.paper = new Paper(svg);
+ }
+ /*\
+ * Element.type
+ [ property (string) ]
+ **
+ * SVG tag name of the given element.
+ \*/
+ this.type = el.tagName || el.nodeName;
+ var id = this.id = ID(this);
+ this.anims = {};
+ this._ = {
+ transform: []
+ };
+ el.snap = id;
+ hub[id] = this;
+ if (this.type == "g") {
+ this.add = add2group;
+ }
+ if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
+ for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
+ this[method] = Paper.prototype[method];
+ }
+ }
+}
+ /*\
+ * Element.attr
+ [ method ]
+ **
+ * Gets or sets given attributes of the element.
+ **
+ - params (object) contains key-value pairs of attributes you want to set
+ * or
+ - param (string) name of the attribute
+ = (Element) the current element
+ * or
+ = (string) value of attribute
+ > Usage
+ | el.attr({
+ | fill: "#fc0",
+ | stroke: "#000",
+ | strokeWidth: 2, // CamelCase...
+ | "fill-opacity": 0.5, // or dash-separated names
+ | width: "*=2" // prefixed values
+ | });
+ | console.log(el.attr("fill")); // #fc0
+ * Prefixed values in format `"+=10"` supported. All four operations
+ * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`
+ * and `-`: `"+=2em"`.
+ \*/
+ Element.prototype.attr = function (params, value) {
+ var el = this,
+ node = el.node;
+ if (!params) {
+ if (node.nodeType != 1) {
+ return {
+ text: node.nodeValue
+ };
+ }
+ var attr = node.attributes,
+ out = {};
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ out[attr[i].nodeName] = attr[i].nodeValue;
+ }
+ return out;
+ }
+ if (is(params, "string")) {
+ if (arguments.length > 1) {
+ var json = {};
+ json[params] = value;
+ params = json;
+ } else {
+ return eve("snap.util.getattr." + params, el).firstDefined();
+ }
+ }
+ for (var att in params) {
+ if (params[has](att)) {
+ eve("snap.util.attr." + att, el, params[att]);
+ }
+ }
+ return el;
+ };
+/*\
+ * Snap.parse
+ [ method ]
+ **
+ * Parses SVG fragment and converts it into a @Fragment
+ **
+ - svg (string) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.parse = function (svg) {
+ var f = glob.doc.createDocumentFragment(),
+ full = true,
+ div = glob.doc.createElement("div");
+ svg = Str(svg);
+ if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
+ svg = "<svg>" + svg + "</svg>";
+ full = false;
+ }
+ div.innerHTML = svg;
+ svg = div.getElementsByTagName("svg")[0];
+ if (svg) {
+ if (full) {
+ f = svg;
+ } else {
+ while (svg.firstChild) {
+ f.appendChild(svg.firstChild);
+ }
+ }
+ }
+ return new Fragment(f);
+};
+function Fragment(frag) {
+ this.node = frag;
+}
+/*\
+ * Snap.fragment
+ [ method ]
+ **
+ * Creates a DOM fragment from a given list of elements or strings
+ **
+ - varargs (…) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.fragment = function () {
+ var args = Array.prototype.slice.call(arguments, 0),
+ f = glob.doc.createDocumentFragment();
+ for (var i = 0, ii = args.length; i < ii; i++) {
+ var item = args[i];
+ if (item.node && item.node.nodeType) {
+ f.appendChild(item.node);
+ }
+ if (item.nodeType) {
+ f.appendChild(item);
+ }
+ if (typeof item == "string") {
+ f.appendChild(Snap.parse(item).node);
+ }
+ }
+ return new Fragment(f);
+};
+
+function make(name, parent) {
+ var res = $(name);
+ parent.appendChild(res);
+ var el = wrap(res);
+ return el;
+}
+function Paper(w, h) {
+ var res,
+ desc,
+ defs,
+ proto = Paper.prototype;
+ if (w && w.tagName == "svg") {
+ if (w.snap in hub) {
+ return hub[w.snap];
+ }
+ var doc = w.ownerDocument;
+ res = new Element(w);
+ desc = w.getElementsByTagName("desc")[0];
+ defs = w.getElementsByTagName("defs")[0];
+ if (!desc) {
+ desc = $("desc");
+ desc.appendChild(doc.createTextNode("Created with Snap"));
+ res.node.appendChild(desc);
+ }
+ if (!defs) {
+ defs = $("defs");
+ res.node.appendChild(defs);
+ }
+ res.defs = defs;
+ for (var key in proto) if (proto[has](key)) {
+ res[key] = proto[key];
+ }
+ res.paper = res.root = res;
+ } else {
+ res = make("svg", glob.doc.body);
+ $(res.node, {
+ height: h,
+ version: 1.1,
+ width: w,
+ xmlns: xmlns
+ });
+ }
+ return res;
+}
+function wrap(dom) {
+ if (!dom) {
+ return dom;
+ }
+ if (dom instanceof Element || dom instanceof Fragment) {
+ return dom;
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
+ return new Paper(dom);
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
+ return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
+ }
+ return new Element(dom);
+}
+
+Snap._.make = make;
+Snap._.wrap = wrap;
+/*\
+ * Paper.el
+ [ method ]
+ **
+ * Creates an element on paper with a given name and no attributes
+ **
+ - name (string) tag name
+ - attr (object) attributes
+ = (Element) the current element
+ > Usage
+ | var c = paper.circle(10, 10, 10); // is the same as...
+ | var c = paper.el("circle").attr({
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+ | // and the same as
+ | var c = paper.el("circle", {
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+\*/
+Paper.prototype.el = function (name, attr) {
+ var el = make(name, this.node);
+ attr && el.attr(attr);
+ return el;
+};
+/*\
+ * Element.children
+ [ method ]
+ **
+ * Returns array of all the children of the element.
+ = (array) array of Elements
+\*/
+Element.prototype.children = function () {
+ var out = [],
+ ch = this.node.childNodes;
+ for (var i = 0, ii = ch.length; i < ii; i++) {
+ out[i] = Snap(ch[i]);
+ }
+ return out;
+};
+function jsonFiller(root, o) {
+ for (var i = 0, ii = root.length; i < ii; i++) {
+ var item = {
+ type: root[i].type,
+ attr: root[i].attr()
+ },
+ children = root[i].children();
+ o.push(item);
+ if (children.length) {
+ jsonFiller(children, item.childNodes = []);
+ }
+ }
+}
+/*\
+ * Element.toJSON
+ [ method ]
+ **
+ * Returns object representation of the given element and all its children.
+ = (object) in format
+ o {
+ o type (string) this.type,
+ o attr (object) attributes map,
+ o childNodes (array) optional array of children in the same format
+ o }
+\*/
+Element.prototype.toJSON = function () {
+ var out = [];
+ jsonFiller([this], out);
+ return out[0];
+};
+// default
+eve.on("snap.util.getattr", function () {
+ var att = eve.nt();
+ att = att.substring(att.lastIndexOf(".") + 1);
+ var css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
+ } else {
+ return $(this.node, att);
+ }
+});
+var cssAttr = {
+ "alignment-baseline": 0,
+ "baseline-shift": 0,
+ "clip": 0,
+ "clip-path": 0,
+ "clip-rule": 0,
+ "color": 0,
+ "color-interpolation": 0,
+ "color-interpolation-filters": 0,
+ "color-profile": 0,
+ "color-rendering": 0,
+ "cursor": 0,
+ "direction": 0,
+ "display": 0,
+ "dominant-baseline": 0,
+ "enable-background": 0,
+ "fill": 0,
+ "fill-opacity": 0,
+ "fill-rule": 0,
+ "filter": 0,
+ "flood-color": 0,
+ "flood-opacity": 0,
+ "font": 0,
+ "font-family": 0,
+ "font-size": 0,
+ "font-size-adjust": 0,
+ "font-stretch": 0,
+ "font-style": 0,
+ "font-variant": 0,
+ "font-weight": 0,
+ "glyph-orientation-horizontal": 0,
+ "glyph-orientation-vertical": 0,
+ "image-rendering": 0,
+ "kerning": 0,
+ "letter-spacing": 0,
+ "lighting-color": 0,
+ "marker": 0,
+ "marker-end": 0,
+ "marker-mid": 0,
+ "marker-start": 0,
+ "mask": 0,
+ "opacity": 0,
+ "overflow": 0,
+ "pointer-events": 0,
+ "shape-rendering": 0,
+ "stop-color": 0,
+ "stop-opacity": 0,
+ "stroke": 0,
+ "stroke-dasharray": 0,
+ "stroke-dashoffset": 0,
+ "stroke-linecap": 0,
+ "stroke-linejoin": 0,
+ "stroke-miterlimit": 0,
+ "stroke-opacity": 0,
+ "stroke-width": 0,
+ "text-anchor": 0,
+ "text-decoration": 0,
+ "text-rendering": 0,
+ "unicode-bidi": 0,
+ "visibility": 0,
+ "word-spacing": 0,
+ "writing-mode": 0
+};
+
+eve.on("snap.util.attr", function (value) {
+ var att = eve.nt(),
+ attr = {};
+ att = att.substring(att.lastIndexOf(".") + 1);
+ attr[att] = value;
+ var style = att.replace(/-(\w)/gi, function (all, letter) {
+ return letter.toUpperCase();
+ }),
+ css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ this.node.style[style] = value == null ? E : value;
+ } else {
+ $(this.node, attr);
+ }
+});
+(function (proto) {}(Paper.prototype));
+
+// simple ajax
+/*\
+ * Snap.ajax
+ [ method ]
+ **
+ * Simple implementation of Ajax
+ **
+ - url (string) URL
+ - postData (object|string) data for post request
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ * or
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ = (XMLHttpRequest) the XMLHttpRequest object, just in case
+\*/
+Snap.ajax = function (url, postData, callback, scope){
+ var req = new XMLHttpRequest,
+ id = ID();
+ if (req) {
+ if (is(postData, "function")) {
+ scope = callback;
+ callback = postData;
+ postData = null;
+ } else if (is(postData, "object")) {
+ var pd = [];
+ for (var key in postData) if (postData.hasOwnProperty(key)) {
+ pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
+ }
+ postData = pd.join("&");
+ }
+ req.open((postData ? "POST" : "GET"), url, true);
+ if (postData) {
+ req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ }
+ if (callback) {
+ eve.once("snap.ajax." + id + ".0", callback);
+ eve.once("snap.ajax." + id + ".200", callback);
+ eve.once("snap.ajax." + id + ".304", callback);
+ }
+ req.onreadystatechange = function() {
+ if (req.readyState != 4) return;
+ eve("snap.ajax." + id + "." + req.status, scope, req);
+ };
+ if (req.readyState == 4) {
+ return req;
+ }
+ req.send(postData);
+ return req;
+ }
+};
+/*\
+ * Snap.load
+ [ method ]
+ **
+ * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
+ **
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+\*/
+Snap.load = function (url, callback, scope) {
+ Snap.ajax(url, function (req) {
+ var f = Snap.parse(req.responseText);
+ scope ? callback.call(scope, f) : callback(f);
+ });
+};
+var getOffset = function (elem) {
+ var box = elem.getBoundingClientRect(),
+ doc = elem.ownerDocument,
+ body = doc.body,
+ docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return {
+ y: top,
+ x: left
+ };
+};
+/*\
+ * Snap.getElementByPoint
+ [ method ]
+ **
+ * Returns you topmost element under given point.
+ **
+ = (object) Snap element object
+ - x (number) x coordinate from the top left corner of the window
+ - y (number) y coordinate from the top left corner of the window
+ > Usage
+ | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
+\*/
+Snap.getElementByPoint = function (x, y) {
+ var paper = this,
+ svg = paper.canvas,
+ target = glob.doc.elementFromPoint(x, y);
+ if (glob.win.opera && target.tagName == "svg") {
+ var so = getOffset(target),
+ sr = target.createSVGRect();
+ sr.x = x - so.x;
+ sr.y = y - so.y;
+ sr.width = sr.height = 1;
+ var hits = target.getIntersectionList(sr, null);
+ if (hits.length) {
+ target = hits[hits.length - 1];
+ }
+ }
+ if (!target) {
+ return null;
+ }
+ return wrap(target);
+};
+/*\
+ * Snap.plugin
+ [ method ]
+ **
+ * Let you write plugins. You pass in a function with five arguments, like this:
+ | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+ | Snap.newmethod = function () {};
+ | Element.prototype.newmethod = function () {};
+ | Paper.prototype.newmethod = function () {};
+ | });
+ * Inside the function you have access to all main objects (and their
+ * prototypes). This allow you to extend anything you want.
+ **
+ - f (function) your plugin body
+\*/
+Snap.plugin = function (f) {
+ f(Snap, Element, Paper, glob, Fragment);
+};
+glob.win.Snap = Snap;
+return Snap;
+}(window || this));
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ Str = String,
+ unit2px = Snap._unit2px,
+ $ = Snap._.$,
+ make = Snap._.make,
+ getSomeDefs = Snap._.getSomeDefs,
+ has = "hasOwnProperty",
+ wrap = Snap._.wrap;
+ /*\
+ * Element.getBBox
+ [ method ]
+ **
+ * Returns the bounding box descriptor for the given element
+ **
+ = (object) bounding box descriptor:
+ o {
+ o cx: (number) x of the center,
+ o cy: (number) x of the center,
+ o h: (number) height,
+ o height: (number) height,
+ o path: (string) path command for the box,
+ o r0: (number) radius of a circle that fully encloses the box,
+ o r1: (number) radius of the smallest circle that can be enclosed,
+ o r2: (number) radius of the largest circle that can be enclosed,
+ o vb: (string) box as a viewbox command,
+ o w: (number) width,
+ o width: (number) width,
+ o x2: (number) x of the right side,
+ o x: (number) x of the left side,
+ o y2: (number) y of the bottom edge,
+ o y: (number) y of the top edge
+ o }
+ \*/
+ elproto.getBBox = function (isWithoutTransform) {
+ if (!Snap.Matrix || !Snap.path) {
+ return this.node.getBBox();
+ }
+ var el = this,
+ m = new Snap.Matrix;
+ if (el.removed) {
+ return Snap._.box();
+ }
+ while (el.type == "use") {
+ if (!isWithoutTransform) {
+ m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
+ }
+ if (el.original) {
+ el = el.original;
+ } else {
+ var href = el.attr("xlink:href");
+ el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
+ }
+ }
+ var _ = el._,
+ pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
+ try {
+ if (isWithoutTransform) {
+ _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
+ return Snap._.box(_.bboxwt);
+ } else {
+ el.realPath = pathfinder(el);
+ el.matrix = el.transform().localMatrix;
+ _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
+ return Snap._.box(_.bbox);
+ }
+ } catch (e) {
+ // Firefox doesn’t give you bbox of hidden element
+ return Snap._.box();
+ }
+ };
+ var propString = function () {
+ return this.string;
+ };
+ function extractTransform(el, tstr) {
+ if (tstr == null) {
+ var doReturn = true;
+ if (el.type == "linearGradient" || el.type == "radialGradient") {
+ tstr = el.node.getAttribute("gradientTransform");
+ } else if (el.type == "pattern") {
+ tstr = el.node.getAttribute("patternTransform");
+ } else {
+ tstr = el.node.getAttribute("transform");
+ }
+ if (!tstr) {
+ return new Snap.Matrix;
+ }
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ if (!Snap._.rgTransform.test(tstr)) {
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || "");
+ }
+ if (is(tstr, "array")) {
+ tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
+ }
+ el._.transform = tstr;
+ }
+ var m = Snap._.transform2matrix(tstr, el.getBBox(1));
+ if (doReturn) {
+ return m;
+ } else {
+ el.matrix = m;
+ }
+ }
+ /*\
+ * Element.transform
+ [ method ]
+ **
+ * Gets or sets transformation of the element
+ **
+ - tstr (string) transform string in Snap or SVG format
+ = (Element) the current element
+ * or
+ = (object) transformation descriptor:
+ o {
+ o string (string) transform string,
+ o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,
+ o localMatrix (Matrix) matrix of transformations applied only to the element,
+ o diffMatrix (Matrix) matrix of difference between global and local transformations,
+ o global (string) global transformation as string,
+ o local (string) local transformation as string,
+ o toString (function) returns `string` property
+ o }
+ \*/
+ elproto.transform = function (tstr) {
+ var _ = this._;
+ if (tstr == null) {
+ var papa = this,
+ global = new Snap.Matrix(this.node.getCTM()),
+ local = extractTransform(this),
+ ms = [local],
+ m = new Snap.Matrix,
+ i,
+ localString = local.toTransformString(),
+ string = Str(local) == Str(this.matrix) ?
+ Str(_.transform) : localString;
+ while (papa.type != "svg" && (papa = papa.parent())) {
+ ms.push(extractTransform(papa));
+ }
+ i = ms.length;
+ while (i--) {
+ m.add(ms[i]);
+ }
+ return {
+ string: string,
+ globalMatrix: global,
+ totalMatrix: m,
+ localMatrix: local,
+ diffMatrix: global.clone().add(local.invert()),
+ global: global.toTransformString(),
+ total: m.toTransformString(),
+ local: localString,
+ toString: propString
+ };
+ }
+ if (tstr instanceof Snap.Matrix) {
+ this.matrix = tstr;
+ this._.transform = tstr.toTransformString();
+ } else {
+ extractTransform(this, tstr);
+ }
+
+ if (this.node) {
+ if (this.type == "linearGradient" || this.type == "radialGradient") {
+ $(this.node, {gradientTransform: this.matrix});
+ } else if (this.type == "pattern") {
+ $(this.node, {patternTransform: this.matrix});
+ } else {
+ $(this.node, {transform: this.matrix});
+ }
+ }
+
+ return this;
+ };
+ /*\
+ * Element.parent
+ [ method ]
+ **
+ * Returns the element's parent
+ **
+ = (Element) the parent element
+ \*/
+ elproto.parent = function () {
+ return wrap(this.node.parentNode);
+ };
+ /*\
+ * Element.append
+ [ method ]
+ **
+ * Appends the given element to current one
+ **
+ - el (Element|Set) element to append
+ = (Element) the parent element
+ \*/
+ /*\
+ * Element.add
+ [ method ]
+ **
+ * See @Element.append
+ \*/
+ elproto.append = elproto.add = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ it.add(el);
+ });
+ return this;
+ }
+ el = wrap(el);
+ this.node.appendChild(el.node);
+ el.paper = this.paper;
+ }
+ return this;
+ };
+ /*\
+ * Element.appendTo
+ [ method ]
+ **
+ * Appends the current element to the given one
+ **
+ - el (Element) parent element to append to
+ = (Element) the child element
+ \*/
+ elproto.appendTo = function (el) {
+ if (el) {
+ el = wrap(el);
+ el.append(this);
+ }
+ return this;
+ };
+ /*\
+ * Element.prepend
+ [ method ]
+ **
+ * Prepends the given element to the current one
+ **
+ - el (Element) element to prepend
+ = (Element) the parent element
+ \*/
+ elproto.prepend = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this,
+ first;
+ el.forEach(function (el) {
+ if (first) {
+ first.after(el);
+ } else {
+ it.prepend(el);
+ }
+ first = el;
+ });
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.insertBefore(el.node, this.node.firstChild);
+ this.add && this.add();
+ el.paper = this.paper;
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ }
+ return this;
+ };
+ /*\
+ * Element.prependTo
+ [ method ]
+ **
+ * Prepends the current element to the given one
+ **
+ - el (Element) parent element to prepend to
+ = (Element) the child element
+ \*/
+ elproto.prependTo = function (el) {
+ el = wrap(el);
+ el.prepend(this);
+ return this;
+ };
+ /*\
+ * Element.before
+ [ method ]
+ **
+ * Inserts given element before the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.before = function (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ var parent = el.parent();
+ it.node.parentNode.insertBefore(el.node, it.node);
+ parent && parent.add();
+ });
+ this.parent().add();
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.parentNode.insertBefore(el.node, this.node);
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.after
+ [ method ]
+ **
+ * Inserts given element after the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.after = function (el) {
+ el = wrap(el);
+ var parent = el.parent();
+ if (this.node.nextSibling) {
+ this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
+ } else {
+ this.node.parentNode.appendChild(el.node);
+ }
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.insertBefore
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertBefore = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.insertAfter
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertAfter = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.remove
+ [ method ]
+ **
+ * Removes element from the DOM
+ = (Element) the detached element
+ \*/
+ elproto.remove = function () {
+ var parent = this.parent();
+ this.node.parentNode && this.node.parentNode.removeChild(this.node);
+ delete this.paper;
+ this.removed = true;
+ parent && parent.add();
+ return this;
+ };
+ /*\
+ * Element.select
+ [ method ]
+ **
+ * Gathers the nested @Element matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Element) result of query selection
+ \*/
+ elproto.select = function (query) {
+ return wrap(this.node.querySelector(query));
+ };
+ /*\
+ * Element.selectAll
+ [ method ]
+ **
+ * Gathers nested @Element objects matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Set|array) result of query selection
+ \*/
+ elproto.selectAll = function (query) {
+ var nodelist = this.node.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+ };
+ /*\
+ * Element.asPX
+ [ method ]
+ **
+ * Returns given attribute of the element as a `px` value (not %, em, etc.)
+ **
+ - attr (string) attribute name
+ - value (string) #optional attribute value
+ = (Element) result of query selection
+ \*/
+ elproto.asPX = function (attr, value) {
+ if (value == null) {
+ value = this.attr(attr);
+ }
+ return +unit2px(this, attr, value);
+ };
+ // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
+ /*\
+ * Element.use
+ [ method ]
+ **
+ * Creates a `<use>` element linked to the current element
+ **
+ = (Element) the `<use>` element
+ \*/
+ elproto.use = function () {
+ var use,
+ id = this.node.id;
+ if (!id) {
+ id = this.id;
+ $(this.node, {
+ id: id
+ });
+ }
+ if (this.type == "linearGradient" || this.type == "radialGradient" ||
+ this.type == "pattern") {
+ use = make(this.type, this.node.parentNode);
+ } else {
+ use = make("use", this.node.parentNode);
+ }
+ $(use.node, {
+ "xlink:href": "#" + id
+ });
+ use.original = this;
+ return use;
+ };
+ function fixids(el) {
+ var els = el.selectAll("*"),
+ it,
+ url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
+ ids = [],
+ uses = {};
+ function urltest(it, name) {
+ var val = $(it.node, name);
+ val = val && val.match(url);
+ val = val && val[2];
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ var attr = {};
+ attr[name] = URL(id);
+ $(it.node, attr);
+ });
+ }
+ }
+ function linktest(it) {
+ var val = $(it.node, "xlink:href");
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ it.attr("xlink:href", "#" + id);
+ });
+ }
+ }
+ for (var i = 0, ii = els.length; i < ii; i++) {
+ it = els[i];
+ urltest(it, "fill");
+ urltest(it, "stroke");
+ urltest(it, "filter");
+ urltest(it, "mask");
+ urltest(it, "clip-path");
+ linktest(it);
+ var oldid = $(it.node, "id");
+ if (oldid) {
+ $(it.node, {id: it.id});
+ ids.push({
+ old: oldid,
+ id: it.id
+ });
+ }
+ }
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ var fs = uses[ids[i].old];
+ if (fs) {
+ for (var j = 0, jj = fs.length; j < jj; j++) {
+ fs[j](ids[i].id);
+ }
+ }
+ }
+ }
+ /*\
+ * Element.clone
+ [ method ]
+ **
+ * Creates a clone of the element and inserts it after the element
+ **
+ = (Element) the clone
+ \*/
+ elproto.clone = function () {
+ var clone = wrap(this.node.cloneNode(true));
+ if ($(clone.node, "id")) {
+ $(clone.node, {id: clone.id});
+ }
+ fixids(clone);
+ clone.insertAfter(this);
+ return clone;
+ };
+ /*\
+ * Element.toDefs
+ [ method ]
+ **
+ * Moves element to the shared `<defs>` area
+ **
+ = (Element) the element
+ \*/
+ elproto.toDefs = function () {
+ var defs = getSomeDefs(this);
+ defs.appendChild(this.node);
+ return this;
+ };
+ /*\
+ * Element.toPattern
+ [ method ]
+ **
+ * Creates a `<pattern>` element from the current element
+ **
+ * To create a pattern you have to specify the pattern rect:
+ - x (string|number)
+ - y (string|number)
+ - width (string|number)
+ - height (string|number)
+ = (Element) the `<pattern>` element
+ * You can use pattern later on as an argument for `fill` attribute:
+ | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+ | fill: "none",
+ | stroke: "#bada55",
+ | strokeWidth: 5
+ | }).pattern(0, 0, 10, 10),
+ | c = paper.circle(200, 200, 100);
+ | c.attr({
+ | fill: p
+ | });
+ \*/
+ elproto.pattern = elproto.toPattern = function (x, y, width, height) {
+ var p = make("pattern", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ $(p.node, {
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ patternUnits: "userSpaceOnUse",
+ id: p.id,
+ viewBox: [x, y, width, height].join(" ")
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
+// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
+ /*\
+ * Element.marker
+ [ method ]
+ **
+ * Creates a `<marker>` element from the current element
+ **
+ * To create a marker you have to specify the bounding rect and reference point:
+ - x (number)
+ - y (number)
+ - width (number)
+ - height (number)
+ - refX (number)
+ - refY (number)
+ = (Element) the `<marker>` element
+ * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
+ \*/
+ // TODO add usage for markers
+ elproto.marker = function (x, y, width, height, refX, refY) {
+ var p = make("marker", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ refX = x.refX || x.cx;
+ refY = x.refY || x.cy;
+ x = x.x;
+ }
+ $(p.node, {
+ viewBox: [x, y, width, height].join(" "),
+ markerWidth: width,
+ markerHeight: height,
+ orient: "auto",
+ refX: refX || 0,
+ refY: refY || 0,
+ id: p.id
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+ // animation
+ function slice(from, to, f) {
+ return function (arr) {
+ var res = arr.slice(from, to);
+ if (res.length == 1) {
+ res = res[0];
+ }
+ return f ? f(res) : res;
+ };
+ }
+ var Animation = function (attr, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ this.attr = attr;
+ this.dur = ms;
+ easing && (this.easing = easing);
+ callback && (this.callback = callback);
+ };
+ Snap._.Animation = Animation;
+ /*\
+ * Snap.animation
+ [ method ]
+ **
+ * Creates an animation object
+ **
+ - attr (object) attributes of final destination
+ - duration (number) duration of the animation, in milliseconds
+ - easing (function) #optional one of easing functions of @mina or custom one
+ - callback (function) #optional callback function that fires when animation ends
+ = (object) animation object
+ \*/
+ Snap.animation = function (attr, ms, easing, callback) {
+ return new Animation(attr, ms, easing, callback);
+ };
+ /*\
+ * Element.inAnim
+ [ method ]
+ **
+ * Returns a set of animations that may be able to manipulate the current element
+ **
+ = (object) in format:
+ o {
+ o anim (object) animation object,
+ o mina (object) @mina object,
+ o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ \*/
+ elproto.inAnim = function () {
+ var el = this,
+ res = [];
+ for (var id in el.anims) if (el.anims[has](id)) {
+ (function (a) {
+ res.push({
+ anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
+ mina: a,
+ curStatus: a.status(),
+ status: function (val) {
+ return a.status(val);
+ },
+ stop: function () {
+ a.stop();
+ }
+ });
+ }(el.anims[id]));
+ }
+ return res;
+ };
+ /*\
+ * Snap.animate
+ [ method ]
+ **
+ * Runs generic animation of one number into another with a caring function
+ **
+ - from (number|array) number or array of numbers
+ - to (number|array) number or array of numbers
+ - setter (function) caring function that accepts one number argument
+ - duration (number) duration, in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function to execute when animation ends
+ = (object) animation object in @mina format
+ o {
+ o id (string) animation id, consider it read-only,
+ o duration (function) gets or sets the duration of the animation,
+ o easing (function) easing,
+ o speed (function) gets or sets the speed of the animation,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ | var rect = Snap().rect(0, 0, 10, 10);
+ | Snap.animate(0, 10, function (val) {
+ | rect.attr({
+ | x: val
+ | });
+ | }, 1000);
+ | // in given context is equivalent to
+ | rect.animate({x: 10}, 1000);
+ \*/
+ Snap.animate = function (from, to, setter, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ var now = mina.time(),
+ anim = mina(from, to, now, now + ms, mina.time, setter, easing);
+ callback && eve.once("mina.finish." + anim.id, callback);
+ return anim;
+ };
+ /*\
+ * Element.stop
+ [ method ]
+ **
+ * Stops all the animations for the current element
+ **
+ = (Element) the current element
+ \*/
+ elproto.stop = function () {
+ var anims = this.inAnim();
+ for (var i = 0, ii = anims.length; i < ii; i++) {
+ anims[i].stop();
+ }
+ return this;
+ };
+ /*\
+ * Element.animate
+ [ method ]
+ **
+ * Animates the given attributes of the element
+ **
+ - attrs (object) key-value pairs of destination attributes
+ - duration (number) duration of the animation in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function that executes when the animation ends
+ = (Element) the current element
+ \*/
+ elproto.animate = function (attrs, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ if (attrs instanceof Animation) {
+ callback = attrs.callback;
+ easing = attrs.easing;
+ ms = attrs.dur;
+ attrs = attrs.attr;
+ }
+ var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,
+ el = this;
+ for (var key in attrs) if (attrs[has](key)) {
+ if (el.equal) {
+ eq = el.equal(key, Str(attrs[key]));
+ from = eq.from;
+ to = eq.to;
+ f = eq.f;
+ } else {
+ from = +el.attr(key);
+ to = +attrs[key];
+ }
+ var len = is(from, "array") ? from.length : 1;
+ keys[key] = slice(fkeys.length, fkeys.length + len, f);
+ fkeys = fkeys.concat(from);
+ tkeys = tkeys.concat(to);
+ }
+ var now = mina.time(),
+ anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {
+ var attr = {};
+ for (var key in keys) if (keys[has](key)) {
+ attr[key] = keys[key](val);
+ }
+ el.attr(attr);
+ }, easing);
+ el.anims[anim.id] = anim;
+ anim._attrs = attrs;
+ anim._callback = callback;
+ eve("snap.animcreated." + el.id, anim);
+ eve.once("mina.finish." + anim.id, function () {
+ delete el.anims[anim.id];
+ callback && callback.call(el);
+ });
+ eve.once("mina.stop." + anim.id, function () {
+ delete el.anims[anim.id];
+ });
+ return el;
+ };
+ var eldata = {};
+ /*\
+ * Element.data
+ [ method ]
+ **
+ * Adds or retrieves given value associated with given key. (Don’t confuse
+ * with `data-` attributes)
+ *
+ * See also @Element.removeData
+ - key (string) key to store data
+ - value (any) #optional value to store
+ = (object) @Element
+ * or, if value is not specified:
+ = (any) value
+ > Usage
+ | for (var i = 0, i < 5, i++) {
+ | paper.circle(10 + 15 * i, 10, 10)
+ | .attr({fill: "#000"})
+ | .data("i", i)
+ | .click(function () {
+ | alert(this.data("i"));
+ | });
+ | }
+ \*/
+ elproto.data = function (key, value) {
+ var data = eldata[this.id] = eldata[this.id] || {};
+ if (arguments.length == 0){
+ eve("snap.data.get." + this.id, this, data, null);
+ return data;
+ }
+ if (arguments.length == 1) {
+ if (Snap.is(key, "object")) {
+ for (var i in key) if (key[has](i)) {
+ this.data(i, key[i]);
+ }
+ return this;
+ }
+ eve("snap.data.get." + this.id, this, data[key], key);
+ return data[key];
+ }
+ data[key] = value;
+ eve("snap.data.set." + this.id, this, value, key);
+ return this;
+ };
+ /*\
+ * Element.removeData
+ [ method ]
+ **
+ * Removes value associated with an element by given key.
+ * If key is not provided, removes all the data of the element.
+ - key (string) #optional key
+ = (object) @Element
+ \*/
+ elproto.removeData = function (key) {
+ if (key == null) {
+ eldata[this.id] = {};
+ } else {
+ eldata[this.id] && delete eldata[this.id][key];
+ }
+ return this;
+ };
+ /*\
+ * Element.outerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element, equivalent to HTML's `outerHTML`.
+ *
+ * See also @Element.innerSVG
+ = (string) SVG code for the element
+ \*/
+ /*\
+ * Element.toString
+ [ method ]
+ **
+ * See @Element.outerSVG
+ \*/
+ elproto.outerSVG = elproto.toString = toString(1);
+ /*\
+ * Element.innerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`
+ = (string) SVG code for the element
+ \*/
+ elproto.innerSVG = toString();
+ function toString(type) {
+ return function () {
+ var res = type ? "<" + this.type : "",
+ attr = this.node.attributes,
+ chld = this.node.childNodes;
+ if (type) {
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ res += " " + attr[i].name + '="' +
+ attr[i].value.replace(/"/g, '\\"') + '"';
+ }
+ }
+ if (chld.length) {
+ type && (res += ">");
+ for (i = 0, ii = chld.length; i < ii; i++) {
+ if (chld[i].nodeType == 3) {
+ res += chld[i].nodeValue;
+ } else if (chld[i].nodeType == 1) {
+ res += wrap(chld[i]).toString();
+ }
+ }
+ type && (res += "</" + this.type + ">");
+ } else {
+ type && (res += "/>");
+ }
+ return res;
+ };
+ }
+ elproto.toDataURL = function () {
+ if (window && window.btoa) {
+ var bb = this.getBBox(),
+ svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
+ x: +bb.x.toFixed(3),
+ y: +bb.y.toFixed(3),
+ width: +bb.width.toFixed(3),
+ height: +bb.height.toFixed(3),
+ contents: this.outerSVG()
+ });
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
+ }
+ };
+ /*\
+ * Fragment.select
+ [ method ]
+ **
+ * See @Element.select
+ \*/
+ Fragment.prototype.select = elproto.select;
+ /*\
+ * Fragment.selectAll
+ [ method ]
+ **
+ * See @Element.selectAll
+ \*/
+ Fragment.prototype.selectAll = elproto.selectAll;
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var objectToString = Object.prototype.toString,
+ Str = String,
+ math = Math,
+ E = "";
+ function Matrix(a, b, c, d, e, f) {
+ if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
+ this.a = a.a;
+ this.b = a.b;
+ this.c = a.c;
+ this.d = a.d;
+ this.e = a.e;
+ this.f = a.f;
+ return;
+ }
+ if (a != null) {
+ this.a = +a;
+ this.b = +b;
+ this.c = +c;
+ this.d = +d;
+ this.e = +e;
+ this.f = +f;
+ } else {
+ this.a = 1;
+ this.b = 0;
+ this.c = 0;
+ this.d = 1;
+ this.e = 0;
+ this.f = 0;
+ }
+ }
+ (function (matrixproto) {
+ /*\
+ * Matrix.add
+ [ method ]
+ **
+ * Adds the given matrix to existing one
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - matrix (object) @Matrix
+ \*/
+ matrixproto.add = function (a, b, c, d, e, f) {
+ var out = [[], [], []],
+ m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
+ matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
+ x, y, z, res;
+
+ if (a && a instanceof Matrix) {
+ matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
+ }
+
+ for (x = 0; x < 3; x++) {
+ for (y = 0; y < 3; y++) {
+ res = 0;
+ for (z = 0; z < 3; z++) {
+ res += m[x][z] * matrix[z][y];
+ }
+ out[x][y] = res;
+ }
+ }
+ this.a = out[0][0];
+ this.b = out[1][0];
+ this.c = out[0][1];
+ this.d = out[1][1];
+ this.e = out[0][2];
+ this.f = out[1][2];
+ return this;
+ };
+ /*\
+ * Matrix.invert
+ [ method ]
+ **
+ * Returns an inverted version of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.invert = function () {
+ var me = this,
+ x = me.a * me.d - me.b * me.c;
+ return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
+ };
+ /*\
+ * Matrix.clone
+ [ method ]
+ **
+ * Returns a copy of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.clone = function () {
+ return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
+ };
+ /*\
+ * Matrix.translate
+ [ method ]
+ **
+ * Translate the matrix
+ - x (number) horizontal offset distance
+ - y (number) vertical offset distance
+ \*/
+ matrixproto.translate = function (x, y) {
+ return this.add(1, 0, 0, 1, x, y);
+ };
+ /*\
+ * Matrix.scale
+ [ method ]
+ **
+ * Scales the matrix
+ - x (number) amount to be scaled, with `1` resulting in no change
+ - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)
+ - cx (number) #optional horizontal origin point from which to scale
+ - cy (number) #optional vertical origin point from which to scale
+ * Default cx, cy is the middle point of the element.
+ \*/
+ matrixproto.scale = function (x, y, cx, cy) {
+ y == null && (y = x);
+ (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
+ this.add(x, 0, 0, y, 0, 0);
+ (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
+ return this;
+ };
+ /*\
+ * Matrix.rotate
+ [ method ]
+ **
+ * Rotates the matrix
+ - a (number) angle of rotation, in degrees
+ - x (number) horizontal origin point from which to rotate
+ - y (number) vertical origin point from which to rotate
+ \*/
+ matrixproto.rotate = function (a, x, y) {
+ a = Snap.rad(a);
+ x = x || 0;
+ y = y || 0;
+ var cos = +math.cos(a).toFixed(9),
+ sin = +math.sin(a).toFixed(9);
+ this.add(cos, sin, -sin, cos, x, y);
+ return this.add(1, 0, 0, 1, -x, -y);
+ };
+ /*\
+ * Matrix.x
+ [ method ]
+ **
+ * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y
+ - x (number)
+ - y (number)
+ = (number) x
+ \*/
+ matrixproto.x = function (x, y) {
+ return x * this.a + y * this.c + this.e;
+ };
+ /*\
+ * Matrix.y
+ [ method ]
+ **
+ * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x
+ - x (number)
+ - y (number)
+ = (number) y
+ \*/
+ matrixproto.y = function (x, y) {
+ return x * this.b + y * this.d + this.f;
+ };
+ matrixproto.get = function (i) {
+ return +this[Str.fromCharCode(97 + i)].toFixed(4);
+ };
+ matrixproto.toString = function () {
+ return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
+ };
+ matrixproto.offset = function () {
+ return [this.e.toFixed(4), this.f.toFixed(4)];
+ };
+ function norm(a) {
+ return a[0] * a[0] + a[1] * a[1];
+ }
+ function normalize(a) {
+ var mag = math.sqrt(norm(a));
+ a[0] && (a[0] /= mag);
+ a[1] && (a[1] /= mag);
+ }
+ /*\
+ * Matrix.determinant
+ [ method ]
+ **
+ * Finds determinant of the given matrix.
+ = (number) determinant
+ \*/
+ matrixproto.determinant = function () {
+ return this.a * this.d - this.b * this.c;
+ };
+ /*\
+ * Matrix.split
+ [ method ]
+ **
+ * Splits matrix into primitive transformations
+ = (object) in format:
+ o dx (number) translation by x
+ o dy (number) translation by y
+ o scalex (number) scale by x
+ o scaley (number) scale by y
+ o shear (number) shear
+ o rotate (number) rotation in deg
+ o isSimple (boolean) could it be represented via simple transformations
+ \*/
+ matrixproto.split = function () {
+ var out = {};
+ // translation
+ out.dx = this.e;
+ out.dy = this.f;
+
+ // scale and shear
+ var row = [[this.a, this.c], [this.b, this.d]];
+ out.scalex = math.sqrt(norm(row[0]));
+ normalize(row[0]);
+
+ out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
+ row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
+
+ out.scaley = math.sqrt(norm(row[1]));
+ normalize(row[1]);
+ out.shear /= out.scaley;
+
+ if (this.determinant() < 0) {
+ out.scalex = -out.scalex;
+ }
+
+ // rotation
+ var sin = -row[0][1],
+ cos = row[1][1];
+ if (cos < 0) {
+ out.rotate = Snap.deg(math.acos(cos));
+ if (sin < 0) {
+ out.rotate = 360 - out.rotate;
+ }
+ } else {
+ out.rotate = Snap.deg(math.asin(sin));
+ }
+
+ out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
+ out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
+ out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
+ return out;
+ };
+ /*\
+ * Matrix.toTransformString
+ [ method ]
+ **
+ * Returns transform string that represents given matrix
+ = (string) transform string
+ \*/
+ matrixproto.toTransformString = function (shorter) {
+ var s = shorter || this.split();
+ if (!+s.shear.toFixed(9)) {
+ s.scalex = +s.scalex.toFixed(4);
+ s.scaley = +s.scaley.toFixed(4);
+ s.rotate = +s.rotate.toFixed(4);
+ return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
+ (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
+ (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
+ } else {
+ return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
+ }
+ };
+ })(Matrix.prototype);
+ /*\
+ * Snap.Matrix
+ [ method ]
+ **
+ * Matrix constructor, extend on your own risk.
+ * To create matrices use @Snap.matrix.
+ \*/
+ Snap.Matrix = Matrix;
+ /*\
+ * Snap.matrix
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns a matrix based on the given parameters
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - svgMatrix (SVGMatrix)
+ = (object) @Matrix
+ \*/
+ Snap.matrix = function (a, b, c, d, e, f) {
+ return new Matrix(a, b, c, d, e, f);
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var has = "hasOwnProperty",
+ make = Snap._.make,
+ wrap = Snap._.wrap,
+ is = Snap.is,
+ getSomeDefs = Snap._.getSomeDefs,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ $ = Snap._.$,
+ URL = Snap.url,
+ Str = String,
+ separator = Snap._.separator,
+ E = "";
+ // Attributes event handlers
+ eve.on("snap.util.attr.mask", function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value.type == "mask") {
+ var mask = value;
+ } else {
+ mask = make("mask", getSomeDefs(this));
+ mask.node.appendChild(value.node);
+ }
+ !mask.node.id && $(mask.node, {
+ id: mask.id
+ });
+ $(this.node, {
+ mask: URL(mask.id)
+ });
+ }
+ });
+ (function (clipIt) {
+ eve.on("snap.util.attr.clip", clipIt);
+ eve.on("snap.util.attr.clip-path", clipIt);
+ eve.on("snap.util.attr.clipPath", clipIt);
+ }(function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value.type == "clipPath") {
+ var clip = value;
+ } else {
+ clip = make("clipPath", getSomeDefs(this));
+ clip.node.appendChild(value.node);
+ !clip.node.id && $(clip.node, {
+ id: clip.id
+ });
+ }
+ $(this.node, {
+ "clip-path": URL(clip.node.id || clip.id)
+ });
+ }
+ }));
+ function fillStroke(name) {
+ return function (value) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1 &&
+ (value.node.firstChild.tagName == "radialGradient" ||
+ value.node.firstChild.tagName == "linearGradient" ||
+ value.node.firstChild.tagName == "pattern")) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value instanceof Element) {
+ if (value.type == "radialGradient" || value.type == "linearGradient"
+ || value.type == "pattern") {
+ if (!value.node.id) {
+ $(value.node, {
+ id: value.id
+ });
+ }
+ var fill = URL(value.node.id);
+ } else {
+ fill = value.attr(name);
+ }
+ } else {
+ fill = Snap.color(value);
+ if (fill.error) {
+ var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
+ if (grad) {
+ if (!grad.node.id) {
+ $(grad.node, {
+ id: grad.id
+ });
+ }
+ fill = URL(grad.node.id);
+ } else {
+ fill = value;
+ }
+ } else {
+ fill = Str(fill);
+ }
+ }
+ var attrs = {};
+ attrs[name] = fill;
+ $(this.node, attrs);
+ this.node.style[name] = E;
+ };
+ }
+ eve.on("snap.util.attr.fill", fillStroke("fill"));
+ eve.on("snap.util.attr.stroke", fillStroke("stroke"));
+ var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
+ eve.on("snap.util.grad.parse", function parseGrad(string) {
+ string = Str(string);
+ var tokens = string.match(gradrg);
+ if (!tokens) {
+ return null;
+ }
+ var type = tokens[1],
+ params = tokens[2],
+ stops = tokens[3];
+ params = params.split(/\s*,\s*/).map(function (el) {
+ return +el == el ? +el : el;
+ });
+ if (params.length == 1 && params[0] == 0) {
+ params = [];
+ }
+ stops = stops.split("-");
+ stops = stops.map(function (el) {
+ el = el.split(":");
+ var out = {
+ color: el[0]
+ };
+ if (el[1]) {
+ out.offset = parseFloat(el[1]);
+ }
+ return out;
+ });
+ return {
+ type: type,
+ params: params,
+ stops: stops
+ };
+ });
+
+ eve.on("snap.util.attr.d", function (value) {
+ eve.stop();
+ if (is(value, "array") && is(value[0], "array")) {
+ value = Snap.path.toString.call(value);
+ }
+ value = Str(value);
+ if (value.match(/[ruo]/i)) {
+ value = Snap.path.toAbsolute(value);
+ }
+ $(this.node, {d: value});
+ })(-1);
+ eve.on("snap.util.attr.#text", function (value) {
+ eve.stop();
+ value = Str(value);
+ var txt = glob.doc.createTextNode(value);
+ while (this.node.firstChild) {
+ this.node.removeChild(this.node.firstChild);
+ }
+ this.node.appendChild(txt);
+ })(-1);
+ eve.on("snap.util.attr.path", function (value) {
+ eve.stop();
+ this.attr({d: value});
+ })(-1);
+ eve.on("snap.util.attr.class", function (value) {
+ eve.stop();
+ this.node.className.baseVal = value;
+ })(-1);
+ eve.on("snap.util.attr.viewBox", function (value) {
+ var vb;
+ if (is(value, "object") && "x" in value) {
+ vb = [value.x, value.y, value.width, value.height].join(" ");
+ } else if (is(value, "array")) {
+ vb = value.join(" ");
+ } else {
+ vb = value;
+ }
+ $(this.node, {
+ viewBox: vb
+ });
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.transform", function (value) {
+ this.transform(value);
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.r", function (value) {
+ if (this.type == "rect") {
+ eve.stop();
+ $(this.node, {
+ rx: value,
+ ry: value
+ });
+ }
+ })(-1);
+ eve.on("snap.util.attr.textpath", function (value) {
+ eve.stop();
+ if (this.type == "text") {
+ var id, tp, node;
+ if (!value && this.textPath) {
+ tp = this.textPath;
+ while (tp.node.firstChild) {
+ this.node.appendChild(tp.node.firstChild);
+ }
+ tp.remove();
+ delete this.textPath;
+ return;
+ }
+ if (is(value, "string")) {
+ var defs = getSomeDefs(this),
+ path = wrap(defs.parentNode).path(value);
+ defs.appendChild(path.node);
+ id = path.id;
+ path.attr({id: id});
+ } else {
+ value = wrap(value);
+ if (value instanceof Element) {
+ id = value.attr("id");
+ if (!id) {
+ id = value.id;
+ value.attr({id: id});
+ }
+ }
+ }
+ if (id) {
+ tp = this.textPath;
+ node = this.node;
+ if (tp) {
+ tp.attr({"xlink:href": "#" + id});
+ } else {
+ tp = $("textPath", {
+ "xlink:href": "#" + id
+ });
+ while (node.firstChild) {
+ tp.appendChild(node.firstChild);
+ }
+ node.appendChild(tp);
+ this.textPath = wrap(tp);
+ }
+ }
+ }
+ })(-1);
+ eve.on("snap.util.attr.text", function (value) {
+ if (this.type == "text") {
+ var i = 0,
+ node = this.node,
+ tuner = function (chunk) {
+ var out = $("tspan");
+ if (is(chunk, "array")) {
+ for (var i = 0; i < chunk.length; i++) {
+ out.appendChild(tuner(chunk[i]));
+ }
+ } else {
+ out.appendChild(glob.doc.createTextNode(chunk));
+ }
+ out.normalize && out.normalize();
+ return out;
+ };
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ var tuned = tuner(value);
+ while (tuned.firstChild) {
+ node.appendChild(tuned.firstChild);
+ }
+ }
+ eve.stop();
+ })(-1);
+ function setFontSize(value) {
+ eve.stop();
+ if (value == +value) {
+ value += "px";
+ }
+ this.node.style.fontSize = value;
+ }
+ eve.on("snap.util.attr.fontSize", setFontSize)(-1);
+ eve.on("snap.util.attr.font-size", setFontSize)(-1);
+
+
+ eve.on("snap.util.getattr.transform", function () {
+ eve.stop();
+ return this.transform();
+ })(-1);
+ eve.on("snap.util.getattr.textpath", function () {
+ eve.stop();
+ return this.textPath;
+ })(-1);
+ // Markers
+ (function () {
+ function getter(end) {
+ return function () {
+ eve.stop();
+ var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
+ if (style == "none") {
+ return style;
+ } else {
+ return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
+ }
+ };
+ }
+ function setter(end) {
+ return function (value) {
+ eve.stop();
+ var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
+ if (value == "" || !value) {
+ this.node.style[name] = "none";
+ return;
+ }
+ if (value.type == "marker") {
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ }
+ this.node.style[name] = URL(id);
+ return;
+ }
+ };
+ }
+ eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
+ eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
+ eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
+ eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
+ eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
+ eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
+ eve.on("snap.util.attr.marker-end", setter("end"))(-1);
+ eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
+ eve.on("snap.util.attr.marker-start", setter("start"))(-1);
+ eve.on("snap.util.attr.markerStart", setter("start"))(-1);
+ eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
+ eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
+ }());
+ eve.on("snap.util.getattr.r", function () {
+ if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
+ eve.stop();
+ return $(this.node, "rx");
+ }
+ })(-1);
+ function textExtract(node) {
+ var out = [];
+ var children = node.childNodes;
+ for (var i = 0, ii = children.length; i < ii; i++) {
+ var chi = children[i];
+ if (chi.nodeType == 3) {
+ out.push(chi.nodeValue);
+ }
+ if (chi.tagName == "tspan") {
+ if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
+ out.push(chi.firstChild.nodeValue);
+ } else {
+ out.push(textExtract(chi));
+ }
+ }
+ }
+ return out;
+ }
+ eve.on("snap.util.getattr.text", function () {
+ if (this.type == "text" || this.type == "tspan") {
+ eve.stop();
+ var out = textExtract(this.node);
+ return out.length == 1 ? out[0] : out;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.#text", function () {
+ return this.node.textContent;
+ })(-1);
+ eve.on("snap.util.getattr.viewBox", function () {
+ eve.stop();
+ var vb = $(this.node, "viewBox");
+ if (vb) {
+ vb = vb.split(separator);
+ return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.points", function () {
+ var p = $(this.node, "points");
+ eve.stop();
+ if (p) {
+ return p.split(separator);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.path", function () {
+ var p = $(this.node, "d");
+ eve.stop();
+ return p;
+ })(-1);
+ eve.on("snap.util.getattr.class", function () {
+ return this.node.className.baseVal;
+ })(-1);
+ function getFontSize() {
+ eve.stop();
+ return this.node.style.fontSize;
+ }
+ eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
+ eve.on("snap.util.getattr.font-size", getFontSize)(-1);
+});
+
+// Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var rgNotSpace = /\S+/g,
+ rgBadSpace = /[\t\r\n\f]/g,
+ rgTrim = /(^\s+|\s+$)/g,
+ Str = String,
+ elproto = Element.prototype;
+ /*\
+ * Element.addClass
+ [ method ]
+ **
+ * Adds given class name or list of class names to the element.
+ - value (string) class name or space separated list of class names
+ **
+ = (Element) original element.
+ \*/
+ elproto.addClass = function (value) {
+ var classes = Str(value || "").match(rgNotSpace) || [],
+ elem = this.node,
+ className = elem.className.baseVal,
+ curClasses = className.match(rgNotSpace) || [],
+ j,
+ pos,
+ clazz,
+ finalValue;
+
+ if (classes.length) {
+ j = 0;
+ while ((clazz = classes[j++])) {
+ pos = curClasses.indexOf(clazz);
+ if (!~pos) {
+ curClasses.push(clazz);
+ }
+ }
+
+ finalValue = curClasses.join(" ");
+ if (className != finalValue) {
+ elem.className.baseVal = finalValue;
+ }
+ }
+ return this;
+ };
+ /*\
+ * Element.removeClass
+ [ method ]
+ **
+ * Removes given class name or list of class names from the element.
+ - value (string) class name or space separated list of class names
+ **
+ = (Element) original element.
+ \*/
+ elproto.removeClass = function (value) {
+ var classes = Str(value || "").match(rgNotSpace) || [],
+ elem = this.node,
+ className = elem.className.baseVal,
+ curClasses = className.match(rgNotSpace) || [],
+ j,
+ pos,
+ clazz,
+ finalValue;
+ if (curClasses.length) {
+ j = 0;
+ while ((clazz = classes[j++])) {
+ pos = curClasses.indexOf(clazz);
+ if (~pos) {
+ curClasses.splice(pos, 1);
+ }
+ }
+
+ finalValue = curClasses.join(" ");
+ if (className != finalValue) {
+ elem.className.baseVal = finalValue;
+ }
+ }
+ return this;
+ };
+ /*\
+ * Element.hasClass
+ [ method ]
+ **
+ * Checks if the element has a given class name in the list of class names applied to it.
+ - value (string) class name
+ **
+ = (boolean) `true` if the element has given class
+ \*/
+ elproto.hasClass = function (value) {
+ var elem = this.node,
+ className = elem.className.baseVal,
+ curClasses = className.match(rgNotSpace) || [];
+ return !!~curClasses.indexOf(value);
+ };
+ /*\
+ * Element.toggleClass
+ [ method ]
+ **
+ * Add or remove one or more classes from the element, depending on either
+ * the class’s presence or the value of the `flag` argument.
+ - value (string) class name or space separated list of class names
+ - flag (boolean) value to determine whether the class should be added or removed
+ **
+ = (Element) original element.
+ \*/
+ elproto.toggleClass = function (value, flag) {
+ if (flag != null) {
+ if (flag) {
+ return this.addClass(value);
+ } else {
+ return this.removeClass(value);
+ }
+ }
+ var classes = (value || "").match(rgNotSpace) || [],
+ elem = this.node,
+ className = elem.className.baseVal,
+ curClasses = className.match(rgNotSpace) || [],
+ j,
+ pos,
+ clazz,
+ finalValue;
+ j = 0;
+ while ((clazz = classes[j++])) {
+ pos = curClasses.indexOf(clazz);
+ if (~pos) {
+ curClasses.splice(pos, 1);
+ } else {
+ curClasses.push(clazz);
+ }
+ }
+
+ finalValue = curClasses.join(" ");
+ if (className != finalValue) {
+ elem.className.baseVal = finalValue;
+ }
+ return this;
+ };
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var operators = {
+ "+": function (x, y) {
+ return x + y;
+ },
+ "-": function (x, y) {
+ return x - y;
+ },
+ "/": function (x, y) {
+ return x / y;
+ },
+ "*": function (x, y) {
+ return x * y;
+ }
+ },
+ Str = String,
+ reUnit = /[a-z]+$/i,
+ reAddon = /^\s*([+\-\/*])\s*=\s*([\d.eE+\-]+)\s*([^\d\s]+)?\s*$/;
+ function getNumber(val) {
+ return val;
+ }
+ function getUnit(unit) {
+ return function (val) {
+ return +val.toFixed(3) + unit;
+ };
+ }
+ eve.on("snap.util.attr", function (val) {
+ var plus = Str(val).match(reAddon);
+ if (plus) {
+ var evnt = eve.nt(),
+ name = evnt.substring(evnt.lastIndexOf(".") + 1),
+ a = this.attr(name),
+ atr = {};
+ eve.stop();
+ var unit = plus[3] || "",
+ aUnit = a.match(reUnit),
+ op = operators[plus[1]];
+ if (aUnit && aUnit == unit) {
+ val = op(parseFloat(a), +plus[2]);
+ } else {
+ a = this.asPX(name);
+ val = op(this.asPX(name), this.asPX(name, plus[2] + unit));
+ }
+ if (isNaN(a) || isNaN(val)) {
+ return;
+ }
+ atr[name] = val;
+ this.attr(atr);
+ }
+ })(-10);
+ eve.on("snap.util.equal", function (name, b) {
+ var A, B, a = Str(this.attr(name) || ""),
+ el = this,
+ bplus = Str(b).match(reAddon);
+ if (bplus) {
+ eve.stop();
+ var unit = bplus[3] || "",
+ aUnit = a.match(reUnit),
+ op = operators[bplus[1]];
+ if (aUnit && aUnit == unit) {
+ return {
+ from: parseFloat(a),
+ to: op(parseFloat(a), +bplus[2]),
+ f: getUnit(aUnit)
+ };
+ } else {
+ a = this.asPX(name);
+ return {
+ from: a,
+ to: op(a, this.asPX(name, bplus[2] + unit)),
+ f: getNumber
+ };
+ }
+ }
+ })(-10);
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var proto = Paper.prototype,
+ is = Snap.is;
+ /*\
+ * Paper.rect
+ [ method ]
+ *
+ * Draws a rectangle
+ **
+ - x (number) x coordinate of the top left corner
+ - y (number) y coordinate of the top left corner
+ - width (number) width
+ - height (number) height
+ - rx (number) #optional horizontal radius for rounded corners, default is 0
+ - ry (number) #optional vertical radius for rounded corners, default is rx or 0
+ = (object) the `rect` element
+ **
+ > Usage
+ | // regular rectangle
+ | var c = paper.rect(10, 10, 50, 50);
+ | // rectangle with rounded corners
+ | var c = paper.rect(40, 40, 50, 50, 10);
+ \*/
+ proto.rect = function (x, y, w, h, rx, ry) {
+ var attr;
+ if (ry == null) {
+ ry = rx;
+ }
+ if (is(x, "object") && x == "[object Object]") {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ width: w,
+ height: h
+ };
+ if (rx != null) {
+ attr.rx = rx;
+ attr.ry = ry;
+ }
+ }
+ return this.el("rect", attr);
+ };
+ /*\
+ * Paper.circle
+ [ method ]
+ **
+ * Draws a circle
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - r (number) radius
+ = (object) the `circle` element
+ **
+ > Usage
+ | var c = paper.circle(50, 50, 40);
+ \*/
+ proto.circle = function (cx, cy, r) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr = {
+ cx: cx,
+ cy: cy,
+ r: r
+ };
+ }
+ return this.el("circle", attr);
+ };
+
+ var preload = (function () {
+ function onerror() {
+ this.parentNode.removeChild(this);
+ }
+ return function (src, f) {
+ var img = glob.doc.createElement("img"),
+ body = glob.doc.body;
+ img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
+ img.onload = function () {
+ f.call(img);
+ img.onload = img.onerror = null;
+ body.removeChild(img);
+ };
+ img.onerror = onerror;
+ body.appendChild(img);
+ img.src = src;
+ };
+ }());
+
+ /*\
+ * Paper.image
+ [ method ]
+ **
+ * Places an image on the surface
+ **
+ - src (string) URI of the source image
+ - x (number) x offset position
+ - y (number) y offset position
+ - width (number) width of the image
+ - height (number) height of the image
+ = (object) the `image` element
+ * or
+ = (object) Snap element object with type `image`
+ **
+ > Usage
+ | var c = paper.image("apple.png", 10, 10, 80, 80);
+ \*/
+ proto.image = function (src, x, y, width, height) {
+ var el = this.el("image");
+ if (is(src, "object") && "src" in src) {
+ el.attr(src);
+ } else if (src != null) {
+ var set = {
+ "xlink:href": src,
+ preserveAspectRatio: "none"
+ };
+ if (x != null && y != null) {
+ set.x = x;
+ set.y = y;
+ }
+ if (width != null && height != null) {
+ set.width = width;
+ set.height = height;
+ } else {
+ preload(src, function () {
+ Snap._.$(el.node, {
+ width: this.offsetWidth,
+ height: this.offsetHeight
+ });
+ });
+ }
+ Snap._.$(el.node, set);
+ }
+ return el;
+ };
+ /*\
+ * Paper.ellipse
+ [ method ]
+ **
+ * Draws an ellipse
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - rx (number) horizontal radius
+ - ry (number) vertical radius
+ = (object) the `ellipse` element
+ **
+ > Usage
+ | var c = paper.ellipse(50, 50, 40, 20);
+ \*/
+ proto.ellipse = function (cx, cy, rx, ry) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr ={
+ cx: cx,
+ cy: cy,
+ rx: rx,
+ ry: ry
+ };
+ }
+ return this.el("ellipse", attr);
+ };
+ // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
+ /*\
+ * Paper.path
+ [ method ]
+ **
+ * Creates a `<path>` element using the given string as the path's definition
+ - pathString (string) #optional path string in SVG format
+ * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
+ | "M10,20L30,40"
+ * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
+ *
+ # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
+ # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
+ # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
+ # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
+ # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
+ # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
+ # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
+ # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
+ # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
+ # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
+ # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
+ # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
+ # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
+ * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
+ * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.
+ > Usage
+ | var c = paper.path("M10 10L90 90");
+ | // draw a diagonal line:
+ | // move to 10,10, line to 90,90
+ \*/
+ proto.path = function (d) {
+ var attr;
+ if (is(d, "object") && !is(d, "array")) {
+ attr = d;
+ } else if (d) {
+ attr = {d: d};
+ }
+ return this.el("path", attr);
+ };
+ /*\
+ * Paper.g
+ [ method ]
+ **
+ * Creates a group element
+ **
+ - varargs (…) #optional elements to nest within the group
+ = (object) the `g` element
+ **
+ > Usage
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g(c2, c1); // note that the order of elements is different
+ * or
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g();
+ | g.add(c2, c1);
+ \*/
+ /*\
+ * Paper.group
+ [ method ]
+ **
+ * See @Paper.g
+ \*/
+ proto.group = proto.g = function (first) {
+ var attr,
+ el = this.el("g");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.svg
+ [ method ]
+ **
+ * Creates a nested SVG element.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `svg` element
+ **
+ \*/
+ proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {
+ var attrs = {};
+ if (is(x, "object") && y == null) {
+ attrs = x;
+ } else {
+ if (x != null) {
+ attrs.x = x;
+ }
+ if (y != null) {
+ attrs.y = y;
+ }
+ if (width != null) {
+ attrs.width = width;
+ }
+ if (height != null) {
+ attrs.height = height;
+ }
+ if (vbx != null && vby != null && vbw != null && vbh != null) {
+ attrs.viewBox = [vbx, vby, vbw, vbh];
+ }
+ }
+ return this.el("svg", attrs);
+ };
+ /*\
+ * Paper.mask
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a mask.
+ **
+ = (object) the `mask` element
+ **
+ \*/
+ proto.mask = function (first) {
+ var attr,
+ el = this.el("mask");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.ptrn
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a pattern.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `pattern` element
+ **
+ \*/
+ proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
+ if (is(x, "object")) {
+ var attr = x;
+ } else {
+ attr = {patternUnits: "userSpaceOnUse"};
+ if (x) {
+ attr.x = x;
+ }
+ if (y) {
+ attr.y = y;
+ }
+ if (width != null) {
+ attr.width = width;
+ }
+ if (height != null) {
+ attr.height = height;
+ }
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ } else {
+ attr.viewBox = [x || 0, y || 0, width || 0, height || 0];
+ }
+ }
+ return this.el("pattern", attr);
+ };
+ /*\
+ * Paper.use
+ [ method ]
+ **
+ * Creates a <use> element.
+ - id (string) @optional id of element to link
+ * or
+ - id (Element) @optional element to link
+ **
+ = (object) the `use` element
+ **
+ \*/
+ proto.use = function (id) {
+ if (id != null) {
+ if (id instanceof Element) {
+ if (!id.attr("id")) {
+ id.attr({id: Snap._.id(id)});
+ }
+ id = id.attr("id");
+ }
+ if (String(id).charAt() == "#") {
+ id = id.substring(1);
+ }
+ return this.el("use", {"xlink:href": "#" + id});
+ } else {
+ return Element.prototype.use.call(this);
+ }
+ };
+ /*\
+ * Paper.symbol
+ [ method ]
+ **
+ * Creates a <symbol> element.
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ = (object) the `symbol` element
+ **
+ \*/
+ proto.symbol = function (vx, vy, vw, vh) {
+ var attr = {};
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+
+ return this.el("symbol", attr);
+ };
+ /*\
+ * Paper.text
+ [ method ]
+ **
+ * Draws a text string
+ **
+ - x (number) x coordinate position
+ - y (number) y coordinate position
+ - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements
+ = (object) the `text` element
+ **
+ > Usage
+ | var t1 = paper.text(50, 50, "Snap");
+ | var t2 = paper.text(50, 50, ["S","n","a","p"]);
+ | // Text path usage
+ | t1.attr({textpath: "M10,10L100,100"});
+ | // or
+ | var pth = paper.path("M10,10L100,100");
+ | t1.attr({textpath: pth});
+ \*/
+ proto.text = function (x, y, text) {
+ var attr = {};
+ if (is(x, "object")) {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ text: text || ""
+ };
+ }
+ return this.el("text", attr);
+ };
+ /*\
+ * Paper.line
+ [ method ]
+ **
+ * Draws a line
+ **
+ - x1 (number) x coordinate position of the start
+ - y1 (number) y coordinate position of the start
+ - x2 (number) x coordinate position of the end
+ - y2 (number) y coordinate position of the end
+ = (object) the `line` element
+ **
+ > Usage
+ | var t1 = paper.line(50, 50, 100, 100);
+ \*/
+ proto.line = function (x1, y1, x2, y2) {
+ var attr = {};
+ if (is(x1, "object")) {
+ attr = x1;
+ } else if (x1 != null) {
+ attr = {
+ x1: x1,
+ x2: x2,
+ y1: y1,
+ y2: y2
+ };
+ }
+ return this.el("line", attr);
+ };
+ /*\
+ * Paper.polyline
+ [ method ]
+ **
+ * Draws a polyline
+ **
+ - points (array) array of points
+ * or
+ - varargs (…) points
+ = (object) the `polyline` element
+ **
+ > Usage
+ | var p1 = paper.polyline([10, 10, 100, 100]);
+ | var p2 = paper.polyline(10, 10, 100, 100);
+ \*/
+ proto.polyline = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polyline", attr);
+ };
+ /*\
+ * Paper.polygon
+ [ method ]
+ **
+ * Draws a polygon. See @Paper.polyline
+ \*/
+ proto.polygon = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polygon", attr);
+ };
+ // gradients
+ (function () {
+ var $ = Snap._.$;
+ // gradients' helpers
+ function Gstops() {
+ return this.selectAll("stop");
+ }
+ function GaddStop(color, offset) {
+ var stop = $("stop"),
+ attr = {
+ offset: +offset + "%"
+ };
+ color = Snap.color(color);
+ attr["stop-color"] = color.hex;
+ if (color.opacity < 1) {
+ attr["stop-opacity"] = color.opacity;
+ }
+ $(stop, attr);
+ this.node.appendChild(stop);
+ return this;
+ }
+ function GgetBBox() {
+ if (this.type == "linearGradient") {
+ var x1 = $(this.node, "x1") || 0,
+ x2 = $(this.node, "x2") || 1,
+ y1 = $(this.node, "y1") || 0,
+ y2 = $(this.node, "y2") || 0;
+ return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
+ } else {
+ var cx = this.node.cx || .5,
+ cy = this.node.cy || .5,
+ r = this.node.r || 0;
+ return Snap._.box(cx - r, cy - r, r * 2, r * 2);
+ }
+ }
+ function gradient(defs, str) {
+ var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
+ el;
+ if (!grad) {
+ return null;
+ }
+ grad.params.unshift(defs);
+ if (grad.type.toLowerCase() == "l") {
+ el = gradientLinear.apply(0, grad.params);
+ } else {
+ el = gradientRadial.apply(0, grad.params);
+ }
+ if (grad.type != grad.type.toLowerCase()) {
+ $(el.node, {
+ gradientUnits: "userSpaceOnUse"
+ });
+ }
+ var stops = grad.stops,
+ len = stops.length,
+ start = 0,
+ j = 0;
+ function seed(i, end) {
+ var step = (end - start) / (i - j);
+ for (var k = j; k < i; k++) {
+ stops[k].offset = +(+start + step * (k - j)).toFixed(2);
+ }
+ j = i;
+ start = end;
+ }
+ len--;
+ for (var i = 0; i < len; i++) if ("offset" in stops[i]) {
+ seed(i, stops[i].offset);
+ }
+ stops[len].offset = stops[len].offset || 100;
+ seed(len, stops[len].offset);
+ for (i = 0; i <= len; i++) {
+ var stop = stops[i];
+ el.addStop(stop.color, stop.offset);
+ }
+ return el;
+ }
+ function gradientLinear(defs, x1, y1, x2, y2) {
+ var el = Snap._.make("linearGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (x1 != null) {
+ $(el.node, {
+ x1: x1,
+ y1: y1,
+ x2: x2,
+ y2: y2
+ });
+ }
+ return el;
+ }
+ function gradientRadial(defs, cx, cy, r, fx, fy) {
+ var el = Snap._.make("radialGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (cx != null) {
+ $(el.node, {
+ cx: cx,
+ cy: cy,
+ r: r
+ });
+ }
+ if (fx != null && fy != null) {
+ $(el.node, {
+ fx: fx,
+ fy: fy
+ });
+ }
+ return el;
+ }
+ /*\
+ * Paper.gradient
+ [ method ]
+ **
+ * Creates a gradient element
+ **
+ - gradient (string) gradient descriptor
+ > Gradient Descriptor
+ * The gradient descriptor is an expression formatted as
+ * follows: `<type>(<coords>)<colors>`. The `<type>` can be
+ * either linear or radial. The uppercase `L` or `R` letters
+ * indicate absolute coordinates offset from the SVG surface.
+ * Lowercase `l` or `r` letters indicate coordinates
+ * calculated relative to the element to which the gradient is
+ * applied. Coordinates specify a linear gradient vector as
+ * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
+ * `r` and optional `fx`, `fy` specifying a focal point away
+ * from the center of the circle. Specify `<colors>` as a list
+ * of dash-separated CSS color values. Each color may be
+ * followed by a custom offset value, separated with a colon
+ * character.
+ > Examples
+ * Linear gradient, relative from top-left corner to bottom-right
+ * corner, from black through red to white:
+ | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
+ * Linear gradient, absolute from (0, 0) to (100, 100), from black
+ * through red at 25% to white:
+ | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
+ * Radial gradient, relative from the center of the element with radius
+ * half the width, from black to white:
+ | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
+ * To apply the gradient:
+ | paper.circle(50, 50, 40).attr({
+ | fill: g
+ | });
+ = (object) the `gradient` element
+ \*/
+ proto.gradient = function (str) {
+ return gradient(this.defs, str);
+ };
+ proto.gradientLinear = function (x1, y1, x2, y2) {
+ return gradientLinear(this.defs, x1, y1, x2, y2);
+ };
+ proto.gradientRadial = function (cx, cy, r, fx, fy) {
+ return gradientRadial(this.defs, cx, cy, r, fx, fy);
+ };
+ /*\
+ * Paper.toString
+ [ method ]
+ **
+ * Returns SVG code for the @Paper
+ = (string) SVG code for the @Paper
+ \*/
+ proto.toString = function () {
+ var doc = this.node.ownerDocument,
+ f = doc.createDocumentFragment(),
+ d = doc.createElement("div"),
+ svg = this.node.cloneNode(true),
+ res;
+ f.appendChild(d);
+ d.appendChild(svg);
+ Snap._.$(svg, {xmlns: "http://www.w3.org/2000/svg"});
+ res = d.innerHTML;
+ f.removeChild(f.firstChild);
+ return res;
+ };
+ /*\
+ * Paper.toDataURL
+ [ method ]
+ **
+ * Returns SVG code for the @Paper as Data URI string.
+ = (string) Data URI string
+ \*/
+ proto.toDataURL = function () {
+ if (window && window.btoa) {
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
+ }
+ };
+ /*\
+ * Paper.clear
+ [ method ]
+ **
+ * Removes all child nodes of the paper, except <defs>.
+ \*/
+ proto.clear = function () {
+ var node = this.node.firstChild,
+ next;
+ while (node) {
+ next = node.nextSibling;
+ if (node.tagName != "defs") {
+ node.parentNode.removeChild(node);
+ } else {
+ proto.clear.call({node: node});
+ }
+ node = next;
+ }
+ };
+ }());
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ clone = Snap._.clone,
+ has = "hasOwnProperty",
+ p2s = /,?([a-z]),?/gi,
+ toFloat = parseFloat,
+ math = Math,
+ PI = math.PI,
+ mmin = math.min,
+ mmax = math.max,
+ pow = math.pow,
+ abs = math.abs;
+ function paths(ps) {
+ var p = paths.ps = paths.ps || {};
+ if (p[ps]) {
+ p[ps].sleep = 100;
+ } else {
+ p[ps] = {
+ sleep: 100
+ };
+ }
+ setTimeout(function () {
+ for (var key in p) if (p[has](key) && key != ps) {
+ p[key].sleep--;
+ !p[key].sleep && delete p[key];
+ }
+ });
+ return p[ps];
+ }
+ function box(x, y, width, height) {
+ if (x == null) {
+ x = y = width = height = 0;
+ }
+ if (y == null) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ return {
+ x: x,
+ y: y,
+ width: width,
+ w: width,
+ height: height,
+ h: height,
+ x2: x + width,
+ y2: y + height,
+ cx: x + width / 2,
+ cy: y + height / 2,
+ r1: math.min(width, height) / 2,
+ r2: math.max(width, height) / 2,
+ r0: math.sqrt(width * width + height * height) / 2,
+ path: rectPath(x, y, width, height),
+ vb: [x, y, width, height].join(" ")
+ };
+ }
+ function toString() {
+ return this.join(",").replace(p2s, "$1");
+ }
+ function pathClone(pathArray) {
+ var res = clone(pathArray);
+ res.toString = toString;
+ return res;
+ }
+ function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
+ if (length == null) {
+ return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
+ } else {
+ return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
+ getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
+ }
+ }
+ function getLengthFactory(istotal, subpath) {
+ function O(val) {
+ return +(+val).toFixed(3);
+ }
+ return Snap._.cacher(function (path, length, onlystart) {
+ if (path instanceof Element) {
+ path = path.attr("d");
+ }
+ path = path2curve(path);
+ var x, y, p, l, sp = "", subpaths = {}, point,
+ len = 0;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = +p[1];
+ y = +p[2];
+ } else {
+ l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ if (len + l > length) {
+ if (subpath && !subpaths.start) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ sp += [
+ "C" + O(point.start.x),
+ O(point.start.y),
+ O(point.m.x),
+ O(point.m.y),
+ O(point.x),
+ O(point.y)
+ ];
+ if (onlystart) {return sp;}
+ subpaths.start = sp;
+ sp = [
+ "M" + O(point.x),
+ O(point.y) + "C" + O(point.n.x),
+ O(point.n.y),
+ O(point.end.x),
+ O(point.end.y),
+ O(p[5]),
+ O(p[6])
+ ].join();
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ continue;
+ }
+ if (!istotal && !subpath) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ return point;
+ }
+ }
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ }
+ sp += p.shift() + p;
+ }
+ subpaths.end = sp;
+ point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
+ return point;
+ }, null, Snap._.clone);
+ }
+ var getTotalLength = getLengthFactory(1),
+ getPointAtLength = getLengthFactory(),
+ getSubpathsAtLength = getLengthFactory(0, 1);
+ function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t,
+ t13 = pow(t1, 3),
+ t12 = pow(t1, 2),
+ t2 = t * t,
+ t3 = t2 * t,
+ x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
+ y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
+ mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
+ my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
+ nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
+ ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
+ ax = t1 * p1x + t * c1x,
+ ay = t1 * p1y + t * c1y,
+ cx = t1 * c2x + t * p2x,
+ cy = t1 * c2y + t * p2y,
+ alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
+ // (mx > nx || my < ny) && (alpha += 180);
+ return {
+ x: x,
+ y: y,
+ m: {x: mx, y: my},
+ n: {x: nx, y: ny},
+ start: {x: ax, y: ay},
+ end: {x: cx, y: cy},
+ alpha: alpha
+ };
+ }
+ function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
+ if (!Snap.is(p1x, "array")) {
+ p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
+ }
+ var bbox = curveDim.apply(null, p1x);
+ return box(
+ bbox.min.x,
+ bbox.min.y,
+ bbox.max.x - bbox.min.x,
+ bbox.max.y - bbox.min.y
+ );
+ }
+ function isPointInsideBBox(bbox, x, y) {
+ return x >= bbox.x &&
+ x <= bbox.x + bbox.width &&
+ y >= bbox.y &&
+ y <= bbox.y + bbox.height;
+ }
+ function isBBoxIntersect(bbox1, bbox2) {
+ bbox1 = box(bbox1);
+ bbox2 = box(bbox2);
+ return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)
+ || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
+ || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
+ && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y
+ || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
+ }
+ function base3(t, p1, p2, p3, p4) {
+ var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
+ t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
+ return t * t2 - 3 * p1 + 3 * p2;
+ }
+ function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
+ if (z == null) {
+ z = 1;
+ }
+ z = z > 1 ? 1 : z < 0 ? 0 : z;
+ var z2 = z / 2,
+ n = 12,
+ Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
+ Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],
+ sum = 0;
+ for (var i = 0; i < n; i++) {
+ var ct = z2 * Tvalues[i] + z2,
+ xbase = base3(ct, x1, x2, x3, x4),
+ ybase = base3(ct, y1, y2, y3, y4),
+ comb = xbase * xbase + ybase * ybase;
+ sum += Cvalues[i] * math.sqrt(comb);
+ }
+ return z2 * sum;
+ }
+ function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
+ if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
+ return;
+ }
+ var t = 1,
+ step = t / 2,
+ t2 = t - step,
+ l,
+ e = .01;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ while (abs(l - ll) > e) {
+ step /= 2;
+ t2 += (l < ll ? 1 : -1) * step;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ }
+ return t2;
+ }
+ function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
+ if (
+ mmax(x1, x2) < mmin(x3, x4) ||
+ mmin(x1, x2) > mmax(x3, x4) ||
+ mmax(y1, y2) < mmin(y3, y4) ||
+ mmin(y1, y2) > mmax(y3, y4)
+ ) {
+ return;
+ }
+ var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
+ ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
+ denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
+
+ if (!denominator) {
+ return;
+ }
+ var px = nx / denominator,
+ py = ny / denominator,
+ px2 = +px.toFixed(2),
+ py2 = +py.toFixed(2);
+ if (
+ px2 < +mmin(x1, x2).toFixed(2) ||
+ px2 > +mmax(x1, x2).toFixed(2) ||
+ px2 < +mmin(x3, x4).toFixed(2) ||
+ px2 > +mmax(x3, x4).toFixed(2) ||
+ py2 < +mmin(y1, y2).toFixed(2) ||
+ py2 > +mmax(y1, y2).toFixed(2) ||
+ py2 < +mmin(y3, y4).toFixed(2) ||
+ py2 > +mmax(y3, y4).toFixed(2)
+ ) {
+ return;
+ }
+ return {x: px, y: py};
+ }
+ function inter(bez1, bez2) {
+ return interHelper(bez1, bez2);
+ }
+ function interCount(bez1, bez2) {
+ return interHelper(bez1, bez2, 1);
+ }
+ function interHelper(bez1, bez2, justCount) {
+ var bbox1 = bezierBBox(bez1),
+ bbox2 = bezierBBox(bez2);
+ if (!isBBoxIntersect(bbox1, bbox2)) {
+ return justCount ? 0 : [];
+ }
+ var l1 = bezlen.apply(0, bez1),
+ l2 = bezlen.apply(0, bez2),
+ n1 = ~~(l1 / 8),
+ n2 = ~~(l2 / 8),
+ dots1 = [],
+ dots2 = [],
+ xy = {},
+ res = justCount ? 0 : [];
+ for (var i = 0; i < n1 + 1; i++) {
+ var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
+ dots1.push({x: p.x, y: p.y, t: i / n1});
+ }
+ for (i = 0; i < n2 + 1; i++) {
+ p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
+ dots2.push({x: p.x, y: p.y, t: i / n2});
+ }
+ for (i = 0; i < n1; i++) {
+ for (var j = 0; j < n2; j++) {
+ var di = dots1[i],
+ di1 = dots1[i + 1],
+ dj = dots2[j],
+ dj1 = dots2[j + 1],
+ ci = abs(di1.x - di.x) < .001 ? "y" : "x",
+ cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
+ is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
+ if (is) {
+ if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
+ continue;
+ }
+ xy[is.x.toFixed(4)] = is.y.toFixed(4);
+ var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
+ t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
+ if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
+ if (justCount) {
+ res++;
+ } else {
+ res.push({
+ x: is.x,
+ y: is.y,
+ t1: t1,
+ t2: t2
+ });
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function pathIntersection(path1, path2) {
+ return interPathHelper(path1, path2);
+ }
+ function pathIntersectionNumber(path1, path2) {
+ return interPathHelper(path1, path2, 1);
+ }
+ function interPathHelper(path1, path2, justCount) {
+ path1 = path2curve(path1);
+ path2 = path2curve(path2);
+ var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
+ res = justCount ? 0 : [];
+ for (var i = 0, ii = path1.length; i < ii; i++) {
+ var pi = path1[i];
+ if (pi[0] == "M") {
+ x1 = x1m = pi[1];
+ y1 = y1m = pi[2];
+ } else {
+ if (pi[0] == "C") {
+ bez1 = [x1, y1].concat(pi.slice(1));
+ x1 = bez1[6];
+ y1 = bez1[7];
+ } else {
+ bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
+ x1 = x1m;
+ y1 = y1m;
+ }
+ for (var j = 0, jj = path2.length; j < jj; j++) {
+ var pj = path2[j];
+ if (pj[0] == "M") {
+ x2 = x2m = pj[1];
+ y2 = y2m = pj[2];
+ } else {
+ if (pj[0] == "C") {
+ bez2 = [x2, y2].concat(pj.slice(1));
+ x2 = bez2[6];
+ y2 = bez2[7];
+ } else {
+ bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
+ x2 = x2m;
+ y2 = y2m;
+ }
+ var intr = interHelper(bez1, bez2, justCount);
+ if (justCount) {
+ res += intr;
+ } else {
+ for (var k = 0, kk = intr.length; k < kk; k++) {
+ intr[k].segment1 = i;
+ intr[k].segment2 = j;
+ intr[k].bez1 = bez1;
+ intr[k].bez2 = bez2;
+ }
+ res = res.concat(intr);
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function isPointInsidePath(path, x, y) {
+ var bbox = pathBBox(path);
+ return isPointInsideBBox(bbox, x, y) &&
+ interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1;
+ }
+ function pathBBox(path) {
+ var pth = paths(path);
+ if (pth.bbox) {
+ return clone(pth.bbox);
+ }
+ if (!path) {
+ return box();
+ }
+ path = path2curve(path);
+ var x = 0,
+ y = 0,
+ X = [],
+ Y = [],
+ p;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = p[1];
+ y = p[2];
+ X.push(x);
+ Y.push(y);
+ } else {
+ var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ X = X.concat(dim.min.x, dim.max.x);
+ Y = Y.concat(dim.min.y, dim.max.y);
+ x = p[5];
+ y = p[6];
+ }
+ }
+ var xmin = mmin.apply(0, X),
+ ymin = mmin.apply(0, Y),
+ xmax = mmax.apply(0, X),
+ ymax = mmax.apply(0, Y),
+ bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
+ pth.bbox = clone(bb);
+ return bb;
+ }
+ function rectPath(x, y, w, h, r) {
+ if (r) {
+ return [
+ ["M", +x + (+r), y],
+ ["l", w - r * 2, 0],
+ ["a", r, r, 0, 0, 1, r, r],
+ ["l", 0, h - r * 2],
+ ["a", r, r, 0, 0, 1, -r, r],
+ ["l", r * 2 - w, 0],
+ ["a", r, r, 0, 0, 1, -r, -r],
+ ["l", 0, r * 2 - h],
+ ["a", r, r, 0, 0, 1, r, -r],
+ ["z"]
+ ];
+ }
+ var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
+ res.toString = toString;
+ return res;
+ }
+ function ellipsePath(x, y, rx, ry, a) {
+ if (a == null && ry == null) {
+ ry = rx;
+ }
+ x = +x;
+ y = +y;
+ rx = +rx;
+ ry = +ry;
+ if (a != null) {
+ var rad = Math.PI / 180,
+ x1 = x + rx * Math.cos(-ry * rad),
+ x2 = x + rx * Math.cos(-a * rad),
+ y1 = y + rx * Math.sin(-ry * rad),
+ y2 = y + rx * Math.sin(-a * rad),
+ res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
+ } else {
+ res = [
+ ["M", x, y],
+ ["m", 0, -ry],
+ ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
+ ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
+ ["z"]
+ ];
+ }
+ res.toString = toString;
+ return res;
+ }
+ var unit2px = Snap._unit2px,
+ getPath = {
+ path: function (el) {
+ return el.attr("path");
+ },
+ circle: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx, attr.cy, attr.r);
+ },
+ ellipse: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
+ },
+ rect: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
+ },
+ image: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
+ },
+ line: function (el) {
+ return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
+ },
+ polyline: function (el) {
+ return "M" + el.attr("points");
+ },
+ polygon: function (el) {
+ return "M" + el.attr("points") + "z";
+ },
+ deflt: function (el) {
+ var bbox = el.node.getBBox();
+ return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
+ }
+ };
+ function pathToRelative(pathArray) {
+ var pth = paths(pathArray),
+ lowerCase = String.prototype.toLowerCase;
+ if (pth.rel) {
+ return pathClone(pth.rel);
+ }
+ if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = pathArray[0][1];
+ y = pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res.push(["M", x, y]);
+ }
+ for (var i = start, ii = pathArray.length; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != lowerCase.call(pa[0])) {
+ r[0] = lowerCase.call(pa[0]);
+ switch (r[0]) {
+ case "a":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] - x).toFixed(3);
+ r[7] = +(pa[7] - y).toFixed(3);
+ break;
+ case "v":
+ r[1] = +(pa[1] - y).toFixed(3);
+ break;
+ case "m":
+ mx = pa[1];
+ my = pa[2];
+ default:
+ for (var j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
+ }
+ }
+ } else {
+ r = res[i] = [];
+ if (pa[0] == "m") {
+ mx = pa[1] + x;
+ my = pa[2] + y;
+ }
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ var len = res[i].length;
+ switch (res[i][0]) {
+ case "z":
+ x = mx;
+ y = my;
+ break;
+ case "h":
+ x += +res[i][len - 1];
+ break;
+ case "v":
+ y += +res[i][len - 1];
+ break;
+ default:
+ x += +res[i][len - 2];
+ y += +res[i][len - 1];
+ }
+ }
+ res.toString = toString;
+ pth.rel = pathClone(res);
+ return res;
+ }
+ function pathToAbsolute(pathArray) {
+ var pth = paths(pathArray);
+ if (pth.abs) {
+ return pathClone(pth.abs);
+ }
+ if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough assumption
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ if (!pathArray || !pathArray.length) {
+ return [["M", 0, 0]];
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0,
+ pa0;
+ if (pathArray[0][0] == "M") {
+ x = +pathArray[0][1];
+ y = +pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[0] = ["M", x, y];
+ }
+ var crz = pathArray.length == 3 &&
+ pathArray[0][0] == "M" &&
+ pathArray[1][0].toUpperCase() == "R" &&
+ pathArray[2][0].toUpperCase() == "Z";
+ for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
+ res.push(r = []);
+ pa = pathArray[i];
+ pa0 = pa[0];
+ if (pa0 != pa0.toUpperCase()) {
+ r[0] = pa0.toUpperCase();
+ switch (r[0]) {
+ case "A":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +pa[6] + x;
+ r[7] = +pa[7] + y;
+ break;
+ case "V":
+ r[1] = +pa[1] + y;
+ break;
+ case "H":
+ r[1] = +pa[1] + x;
+ break;
+ case "R":
+ var dots = [x, y].concat(pa.slice(1));
+ for (var j = 2, jj = dots.length; j < jj; j++) {
+ dots[j] = +dots[j] + x;
+ dots[++j] = +dots[j] + y;
+ }
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ break;
+ case "O":
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ break;
+ case "U":
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ break;
+ case "M":
+ mx = +pa[1] + x;
+ my = +pa[2] + y;
+ default:
+ for (j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +pa[j] + ((j % 2) ? x : y);
+ }
+ }
+ } else if (pa0 == "R") {
+ dots = [x, y].concat(pa.slice(1));
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ r = ["R"].concat(pa.slice(-2));
+ } else if (pa0 == "O") {
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ } else if (pa0 == "U") {
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ } else {
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ r[k] = pa[k];
+ }
+ }
+ pa0 = pa0.toUpperCase();
+ if (pa0 != "O") {
+ switch (r[0]) {
+ case "Z":
+ x = +mx;
+ y = +my;
+ break;
+ case "H":
+ x = r[1];
+ break;
+ case "V":
+ y = r[1];
+ break;
+ case "M":
+ mx = r[r.length - 2];
+ my = r[r.length - 1];
+ default:
+ x = r[r.length - 2];
+ y = r[r.length - 1];
+ }
+ }
+ }
+ res.toString = toString;
+ pth.abs = pathClone(res);
+ return res;
+ }
+ function l2c(x1, y1, x2, y2) {
+ return [x1, y1, x2, y2, x2, y2];
+ }
+ function q2c(x1, y1, ax, ay, x2, y2) {
+ var _13 = 1 / 3,
+ _23 = 2 / 3;
+ return [
+ _13 * x1 + _23 * ax,
+ _13 * y1 + _23 * ay,
+ _13 * x2 + _23 * ax,
+ _13 * y2 + _23 * ay,
+ x2,
+ y2
+ ];
+ }
+ function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ var _120 = PI * 120 / 180,
+ rad = PI / 180 * (+angle || 0),
+ res = [],
+ xy,
+ rotate = Snap._.cacher(function (x, y, rad) {
+ var X = x * math.cos(rad) - y * math.sin(rad),
+ Y = x * math.sin(rad) + y * math.cos(rad);
+ return {x: X, y: Y};
+ });
+ if (!recursive) {
+ xy = rotate(x1, y1, -rad);
+ x1 = xy.x;
+ y1 = xy.y;
+ xy = rotate(x2, y2, -rad);
+ x2 = xy.x;
+ y2 = xy.y;
+ var cos = math.cos(PI / 180 * angle),
+ sin = math.sin(PI / 180 * angle),
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2;
+ var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
+ if (h > 1) {
+ h = math.sqrt(h);
+ rx = h * rx;
+ ry = h * ry;
+ }
+ var rx2 = rx * rx,
+ ry2 = ry * ry,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
+ f2 = math.asin(((y2 - cy) / ry).toFixed(9));
+
+ f1 = x1 < cx ? PI - f1 : f1;
+ f2 = x2 < cx ? PI - f2 : f2;
+ f1 < 0 && (f1 = PI * 2 + f1);
+ f2 < 0 && (f2 = PI * 2 + f2);
+ if (sweep_flag && f1 > f2) {
+ f1 = f1 - PI * 2;
+ }
+ if (!sweep_flag && f2 > f1) {
+ f2 = f2 - PI * 2;
+ }
+ } else {
+ f1 = recursive[0];
+ f2 = recursive[1];
+ cx = recursive[2];
+ cy = recursive[3];
+ }
+ var df = f2 - f1;
+ if (abs(df) > _120) {
+ var f2old = f2,
+ x2old = x2,
+ y2old = y2;
+ f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
+ x2 = cx + rx * math.cos(f2);
+ y2 = cy + ry * math.sin(f2);
+ res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
+ }
+ df = f2 - f1;
+ var c1 = math.cos(f1),
+ s1 = math.sin(f1),
+ c2 = math.cos(f2),
+ s2 = math.sin(f2),
+ t = math.tan(df / 4),
+ hx = 4 / 3 * rx * t,
+ hy = 4 / 3 * ry * t,
+ m1 = [x1, y1],
+ m2 = [x1 + hx * s1, y1 - hy * c1],
+ m3 = [x2 + hx * s2, y2 - hy * c2],
+ m4 = [x2, y2];
+ m2[0] = 2 * m1[0] - m2[0];
+ m2[1] = 2 * m1[1] - m2[1];
+ if (recursive) {
+ return [m2, m3, m4].concat(res);
+ } else {
+ res = [m2, m3, m4].concat(res).join().split(",");
+ var newres = [];
+ for (var i = 0, ii = res.length; i < ii; i++) {
+ newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
+ }
+ return newres;
+ }
+ }
+ function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t;
+ return {
+ x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
+ };
+ }
+
+ // Returns bounding box of cubic bezier curve.
+ // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
+ // Original version: NISHIO Hirokazu
+ // Modifications: https://github.com/timo22345
+ function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var tvalues = [],
+ bounds = [[], []],
+ a, b, c, t, t1, t2, b2ac, sqrtb2ac;
+ for (var i = 0; i < 2; ++i) {
+ if (i == 0) {
+ b = 6 * x0 - 12 * x1 + 6 * x2;
+ a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
+ c = 3 * x1 - 3 * x0;
+ } else {
+ b = 6 * y0 - 12 * y1 + 6 * y2;
+ a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
+ c = 3 * y1 - 3 * y0;
+ }
+ if (abs(a) < 1e-12) {
+ if (abs(b) < 1e-12) {
+ continue;
+ }
+ t = -c / b;
+ if (0 < t && t < 1) {
+ tvalues.push(t);
+ }
+ continue;
+ }
+ b2ac = b * b - 4 * c * a;
+ sqrtb2ac = math.sqrt(b2ac);
+ if (b2ac < 0) {
+ continue;
+ }
+ t1 = (-b + sqrtb2ac) / (2 * a);
+ if (0 < t1 && t1 < 1) {
+ tvalues.push(t1);
+ }
+ t2 = (-b - sqrtb2ac) / (2 * a);
+ if (0 < t2 && t2 < 1) {
+ tvalues.push(t2);
+ }
+ }
+
+ var x, y, j = tvalues.length,
+ jlen = j,
+ mt;
+ while (j--) {
+ t = tvalues[j];
+ mt = 1 - t;
+ bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
+ bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
+ }
+
+ bounds[0][jlen] = x0;
+ bounds[1][jlen] = y0;
+ bounds[0][jlen + 1] = x3;
+ bounds[1][jlen + 1] = y3;
+ bounds[0].length = bounds[1].length = jlen + 2;
+
+
+ return {
+ min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},
+ max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}
+ };
+ }
+
+ function path2curve(path, path2) {
+ var pth = !path2 && paths(path);
+ if (!path2 && pth.curve) {
+ return pathClone(pth.curve);
+ }
+ var p = pathToAbsolute(path),
+ p2 = path2 && pathToAbsolute(path2),
+ attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ processPath = function (path, d, pcom) {
+ var nx, ny;
+ if (!path) {
+ return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
+ }
+ !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);
+ switch (path[0]) {
+ case "M":
+ d.X = path[1];
+ d.Y = path[2];
+ break;
+ case "A":
+ path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
+ break;
+ case "S":
+ if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
+ nx = d.x * 2 - d.bx; // And reflect the previous
+ ny = d.y * 2 - d.by; // command's control point relative to the current point.
+ }
+ else { // or some else or nothing
+ nx = d.x;
+ ny = d.y;
+ }
+ path = ["C", nx, ny].concat(path.slice(1));
+ break;
+ case "T":
+ if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
+ d.qx = d.x * 2 - d.qx; // And make a reflection similar
+ d.qy = d.y * 2 - d.qy; // to case "S".
+ }
+ else { // or something else or nothing
+ d.qx = d.x;
+ d.qy = d.y;
+ }
+ path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
+ break;
+ case "Q":
+ d.qx = path[1];
+ d.qy = path[2];
+ path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
+ break;
+ case "L":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
+ break;
+ case "H":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
+ break;
+ case "V":
+ path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
+ break;
+ case "Z":
+ path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
+ break;
+ }
+ return path;
+ },
+ fixArc = function (pp, i) {
+ if (pp[i].length > 7) {
+ pp[i].shift();
+ var pi = pp[i];
+ while (pi.length) {
+ pcoms1[i] = "A"; // if created multiple C:s, their original seg is saved
+ p2 && (pcoms2[i] = "A"); // the same as above
+ pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
+ }
+ pp.splice(i, 1);
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ fixM = function (path1, path2, a1, a2, i) {
+ if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
+ path2.splice(i, 0, ["M", a2.x, a2.y]);
+ a1.bx = 0;
+ a1.by = 0;
+ a1.x = path1[i][1];
+ a1.y = path1[i][2];
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ pcoms1 = [], // path commands of original path p
+ pcoms2 = [], // path commands of original path p2
+ pfirst = "", // temporary holder for original path command
+ pcom = ""; // holder for previous path command of original path
+ for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
+ p[i] && (pfirst = p[i][0]); // save current path command
+
+ if (pfirst != "C") // C is not saved yet, because it may be result of conversion
+ {
+ pcoms1[i] = pfirst; // Save current path command
+ i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom
+ }
+ p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
+
+ if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
+ // which may produce multiple C:s
+ // so we have to make sure that C is also C in original path
+
+ fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
+
+ if (p2) { // the same procedures is done to p2
+ p2[i] && (pfirst = p2[i][0]);
+ if (pfirst != "C") {
+ pcoms2[i] = pfirst;
+ i && (pcom = pcoms2[i - 1]);
+ }
+ p2[i] = processPath(p2[i], attrs2, pcom);
+
+ if (pcoms2[i] != "A" && pfirst == "C") {
+ pcoms2[i] = "C";
+ }
+
+ fixArc(p2, i);
+ }
+ fixM(p, p2, attrs, attrs2, i);
+ fixM(p2, p, attrs2, attrs, i);
+ var seg = p[i],
+ seg2 = p2 && p2[i],
+ seglen = seg.length,
+ seg2len = p2 && seg2.length;
+ attrs.x = seg[seglen - 2];
+ attrs.y = seg[seglen - 1];
+ attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
+ attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
+ attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
+ attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
+ attrs2.x = p2 && seg2[seg2len - 2];
+ attrs2.y = p2 && seg2[seg2len - 1];
+ }
+ if (!p2) {
+ pth.curve = pathClone(p);
+ }
+ return p2 ? [p, p2] : p;
+ }
+ function mapPath(path, matrix) {
+ if (!matrix) {
+ return path;
+ }
+ var x, y, i, j, ii, jj, pathi;
+ path = path2curve(path);
+ for (i = 0, ii = path.length; i < ii; i++) {
+ pathi = path[i];
+ for (j = 1, jj = pathi.length; j < jj; j += 2) {
+ x = matrix.x(pathi[j], pathi[j + 1]);
+ y = matrix.y(pathi[j], pathi[j + 1]);
+ pathi[j] = x;
+ pathi[j + 1] = y;
+ }
+ }
+ return path;
+ }
+
+ // http://schepers.cc/getting-to-the-point
+ function catmullRom2bezier(crp, z) {
+ var d = [];
+ for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
+ var p = [
+ {x: +crp[i - 2], y: +crp[i - 1]},
+ {x: +crp[i], y: +crp[i + 1]},
+ {x: +crp[i + 2], y: +crp[i + 3]},
+ {x: +crp[i + 4], y: +crp[i + 5]}
+ ];
+ if (z) {
+ if (!i) {
+ p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};
+ } else if (iLen - 4 == i) {
+ p[3] = {x: +crp[0], y: +crp[1]};
+ } else if (iLen - 2 == i) {
+ p[2] = {x: +crp[0], y: +crp[1]};
+ p[3] = {x: +crp[2], y: +crp[3]};
+ }
+ } else {
+ if (iLen - 4 == i) {
+ p[3] = p[2];
+ } else if (!i) {
+ p[0] = {x: +crp[i], y: +crp[i + 1]};
+ }
+ }
+ d.push(["C",
+ (-p[0].x + 6 * p[1].x + p[2].x) / 6,
+ (-p[0].y + 6 * p[1].y + p[2].y) / 6,
+ (p[1].x + 6 * p[2].x - p[3].x) / 6,
+ (p[1].y + 6*p[2].y - p[3].y) / 6,
+ p[2].x,
+ p[2].y
+ ]);
+ }
+
+ return d;
+ }
+
+ // export
+ Snap.path = paths;
+
+ /*\
+ * Snap.path.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the given path in pixels
+ **
+ - path (string) SVG path string
+ **
+ = (number) length
+ \*/
+ Snap.path.getTotalLength = getTotalLength;
+ /*\
+ * Snap.path.getPointAtLength
+ [ method ]
+ **
+ * Returns the coordinates of the point located at the given length along the given path
+ **
+ - path (string) SVG path string
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ Snap.path.getPointAtLength = getPointAtLength;
+ /*\
+ * Snap.path.getSubpath
+ [ method ]
+ **
+ * Returns the subpath of a given path between given start and end lengths
+ **
+ - path (string) SVG path string
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ Snap.path.getSubpath = function (path, from, to) {
+ if (this.getTotalLength(path) - to < 1e-6) {
+ return getSubpathsAtLength(path, from).end;
+ }
+ var a = getSubpathsAtLength(path, to, 1);
+ return from ? getSubpathsAtLength(a, from).end : a;
+ };
+ /*\
+ * Element.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the path in pixels (only works for `path` elements)
+ = (number) length
+ \*/
+ elproto.getTotalLength = function () {
+ if (this.node.getTotalLength) {
+ return this.node.getTotalLength();
+ }
+ };
+ // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?
+ /*\
+ * Element.getPointAtLength
+ [ method ]
+ **
+ * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)
+ **
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ elproto.getPointAtLength = function (length) {
+ return getPointAtLength(this.attr("d"), length);
+ };
+ // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.
+ /*\
+ * Element.getSubpath
+ [ method ]
+ **
+ * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
+ **
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ elproto.getSubpath = function (from, to) {
+ return Snap.path.getSubpath(this.attr("d"), from, to);
+ };
+ Snap._.box = box;
+ /*\
+ * Snap.path.findDotsAtSegment
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds dot coordinates on the given cubic beziér curve at the given t
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ - t (number) position on the curve (0..1)
+ = (object) point information in format:
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o m: {
+ o x: (number) x coordinate of the left anchor,
+ o y: (number) y coordinate of the left anchor
+ o },
+ o n: {
+ o x: (number) x coordinate of the right anchor,
+ o y: (number) y coordinate of the right anchor
+ o },
+ o start: {
+ o x: (number) x coordinate of the start of the curve,
+ o y: (number) y coordinate of the start of the curve
+ o },
+ o end: {
+ o x: (number) x coordinate of the end of the curve,
+ o y: (number) y coordinate of the end of the curve
+ o },
+ o alpha: (number) angle of the curve derivative at the point
+ o }
+ \*/
+ Snap.path.findDotsAtSegment = findDotsAtSegment;
+ /*\
+ * Snap.path.bezierBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given cubic beziér curve
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ * or
+ - bez (array) array of six points for beziér curve
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.bezierBBox = bezierBBox;
+ /*\
+ * Snap.path.isPointInsideBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside bounding box
+ - bbox (string) bounding box
+ - x (string) x coordinate of the point
+ - y (string) y coordinate of the point
+ = (boolean) `true` if point is inside
+ \*/
+ Snap.path.isPointInsideBBox = isPointInsideBBox;
+ Snap.closest = function (x, y, X, Y) {
+ var r = 100,
+ b = box(x - r / 2, y - r / 2, r, r),
+ inside = [],
+ getter = X[0].hasOwnProperty("x") ? function (i) {
+ return {
+ x: X[i].x,
+ y: X[i].y
+ };
+ } : function (i) {
+ return {
+ x: X[i],
+ y: Y[i]
+ };
+ },
+ found = 0;
+ while (r <= 1e6 && !found) {
+ for (var i = 0, ii = X.length; i < ii; i++) {
+ var xy = getter(i);
+ if (isPointInsideBBox(b, xy.x, xy.y)) {
+ found++;
+ inside.push(xy);
+ break;
+ }
+ }
+ if (!found) {
+ r *= 2;
+ b = box(x - r / 2, y - r / 2, r, r)
+ }
+ }
+ if (r == 1e6) {
+ return;
+ }
+ var len = Infinity,
+ res;
+ for (i = 0, ii = inside.length; i < ii; i++) {
+ var l = Snap.len(x, y, inside[i].x, inside[i].y);
+ if (len > l) {
+ len = l;
+ inside[i].len = l;
+ res = inside[i];
+ }
+ }
+ return res;
+ };
+ /*\
+ * Snap.path.isBBoxIntersect
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if two bounding boxes intersect
+ - bbox1 (string) first bounding box
+ - bbox2 (string) second bounding box
+ = (boolean) `true` if bounding boxes intersect
+ \*/
+ Snap.path.isBBoxIntersect = isBBoxIntersect;
+ /*\
+ * Snap.path.intersection
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds intersections of two paths
+ - path1 (string) path string
+ - path2 (string) path string
+ = (array) dots of intersection
+ o [
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o t1: (number) t value for segment of path1,
+ o t2: (number) t value for segment of path2,
+ o segment1: (number) order number for segment of path1,
+ o segment2: (number) order number for segment of path2,
+ o bez1: (array) eight coordinates representing beziér curve for the segment of path1,
+ o bez2: (array) eight coordinates representing beziér curve for the segment of path2
+ o }
+ o ]
+ \*/
+ Snap.path.intersection = pathIntersection;
+ Snap.path.intersectionNumber = pathIntersectionNumber;
+ /*\
+ * Snap.path.isPointInside
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside a given closed path.
+ *
+ * Note: fill mode doesn’t affect the result of this method.
+ - path (string) path string
+ - x (number) x of the point
+ - y (number) y of the point
+ = (boolean) `true` if point is inside the path
+ \*/
+ Snap.path.isPointInside = isPointInsidePath;
+ /*\
+ * Snap.path.getBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given path
+ - path (string) path string
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.getBBox = pathBBox;
+ Snap.path.get = getPath;
+ /*\
+ * Snap.path.toRelative
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into relative values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toRelative = pathToRelative;
+ /*\
+ * Snap.path.toAbsolute
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into absolute values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toAbsolute = pathToAbsolute;
+ /*\
+ * Snap.path.toCubic
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path to a new path where all segments are cubic beziér curves
+ - pathString (string|array) path string or array of segments
+ = (array) array of segments
+ \*/
+ Snap.path.toCubic = path2curve;
+ /*\
+ * Snap.path.map
+ [ method ]
+ **
+ * Transform the path string with the given matrix
+ - path (string) path string
+ - matrix (object) see @Matrix
+ = (string) transformed path string
+ \*/
+ Snap.path.map = mapPath;
+ Snap.path.toString = toString;
+ Snap.path.clone = pathClone;
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var mmax = Math.max,
+ mmin = Math.min;
+
+ // Set
+ var Set = function (items) {
+ this.items = [];
+ this.bindings = {};
+ this.length = 0;
+ this.type = "set";
+ if (items) {
+ for (var i = 0, ii = items.length; i < ii; i++) {
+ if (items[i]) {
+ this[this.items.length] = this.items[this.items.length] = items[i];
+ this.length++;
+ }
+ }
+ }
+ },
+ setproto = Set.prototype;
+ /*\
+ * Set.push
+ [ method ]
+ **
+ * Adds each argument to the current set
+ = (object) original element
+ \*/
+ setproto.push = function () {
+ var item,
+ len;
+ for (var i = 0, ii = arguments.length; i < ii; i++) {
+ item = arguments[i];
+ if (item) {
+ len = this.items.length;
+ this[len] = this.items[len] = item;
+ this.length++;
+ }
+ }
+ return this;
+ };
+ /*\
+ * Set.pop
+ [ method ]
+ **
+ * Removes last element and returns it
+ = (object) element
+ \*/
+ setproto.pop = function () {
+ this.length && delete this[this.length--];
+ return this.items.pop();
+ };
+ /*\
+ * Set.forEach
+ [ method ]
+ **
+ * Executes given function for each element in the set
+ *
+ * If the function returns `false`, the loop stops running.
+ **
+ - callback (function) function to run
+ - thisArg (object) context object for the callback
+ = (object) Set object
+ \*/
+ setproto.forEach = function (callback, thisArg) {
+ for (var i = 0, ii = this.items.length; i < ii; i++) {
+ if (callback.call(thisArg, this.items[i], i) === false) {
+ return this;
+ }
+ }
+ return this;
+ };
+ /*\
+ * Set.animate
+ [ method ]
+ **
+ * Animates each element in set in sync.
+ *
+ **
+ - attrs (object) key-value pairs of destination attributes
+ - duration (number) duration of the animation in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function that executes when the animation ends
+ * or
+ - animation (array) array of animation parameter for each element in set in format `[attrs, duration, easing, callback]`
+ > Usage
+ | // animate all elements in set to radius 10
+ | set.animate({r: 10}, 500, mina.easein);
+ | // or
+ | // animate first element to radius 10, but second to radius 20 and in different time
+ | set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);
+ = (Element) the current element
+ \*/
+ setproto.animate = function (attrs, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ if (attrs instanceof Snap._.Animation) {
+ callback = attrs.callback;
+ easing = attrs.easing;
+ ms = easing.dur;
+ attrs = attrs.attr;
+ }
+ var args = arguments;
+ if (Snap.is(attrs, "array") && Snap.is(args[args.length - 1], "array")) {
+ var each = true;
+ }
+ var begin,
+ handler = function () {
+ if (begin) {
+ this.b = begin;
+ } else {
+ begin = this.b;
+ }
+ },
+ cb = 0,
+ set = this,
+ callbacker = callback && function () {
+ if (++cb == set.length) {
+ callback.call(this);
+ }
+ };
+ return this.forEach(function (el, i) {
+ eve.once("snap.animcreated." + el.id, handler);
+ if (each) {
+ args[i] && el.animate.apply(el, args[i]);
+ } else {
+ el.animate(attrs, ms, easing, callbacker);
+ }
+ });
+ };
+ setproto.remove = function () {
+ while (this.length) {
+ this.pop().remove();
+ }
+ return this;
+ };
+ /*\
+ * Set.bind
+ [ method ]
+ **
+ * Specifies how to handle a specific attribute when applied
+ * to a set.
+ *
+ **
+ - attr (string) attribute name
+ - callback (function) function to run
+ * or
+ - attr (string) attribute name
+ - element (Element) specific element in the set to apply the attribute to
+ * or
+ - attr (string) attribute name
+ - element (Element) specific element in the set to apply the attribute to
+ - eattr (string) attribute on the element to bind the attribute to
+ = (object) Set object
+ \*/
+ setproto.bind = function (attr, a, b) {
+ var data = {};
+ if (typeof a == "function") {
+ this.bindings[attr] = a;
+ } else {
+ var aname = b || attr;
+ this.bindings[attr] = function (v) {
+ data[aname] = v;
+ a.attr(data);
+ };
+ }
+ return this;
+ };
+ setproto.attr = function (value) {
+ var unbound = {};
+ for (var k in value) {
+ if (this.bindings[k]) {
+ this.bindings[k](value[k]);
+ } else {
+ unbound[k] = value[k];
+ }
+ }
+ for (var i = 0, ii = this.items.length; i < ii; i++) {
+ this.items[i].attr(unbound);
+ }
+ return this;
+ };
+ /*\
+ * Set.clear
+ [ method ]
+ **
+ * Removes all elements from the set
+ \*/
+ setproto.clear = function () {
+ while (this.length) {
+ this.pop();
+ }
+ };
+ /*\
+ * Set.splice
+ [ method ]
+ **
+ * Removes range of elements from the set
+ **
+ - index (number) position of the deletion
+ - count (number) number of element to remove
+ - insertion… (object) #optional elements to insert
+ = (object) set elements that were deleted
+ \*/
+ setproto.splice = function (index, count, insertion) {
+ index = index < 0 ? mmax(this.length + index, 0) : index;
+ count = mmax(0, mmin(this.length - index, count));
+ var tail = [],
+ todel = [],
+ args = [],
+ i;
+ for (i = 2; i < arguments.length; i++) {
+ args.push(arguments[i]);
+ }
+ for (i = 0; i < count; i++) {
+ todel.push(this[index + i]);
+ }
+ for (; i < this.length - index; i++) {
+ tail.push(this[index + i]);
+ }
+ var arglen = args.length;
+ for (i = 0; i < arglen + tail.length; i++) {
+ this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen];
+ }
+ i = this.items.length = this.length -= count - arglen;
+ while (this[i]) {
+ delete this[i++];
+ }
+ return new Set(todel);
+ };
+ /*\
+ * Set.exclude
+ [ method ]
+ **
+ * Removes given element from the set
+ **
+ - element (object) element to remove
+ = (boolean) `true` if object was found and removed from the set
+ \*/
+ setproto.exclude = function (el) {
+ for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) {
+ this.splice(i, 1);
+ return true;
+ }
+ return false;
+ };
+ setproto.insertAfter = function (el) {
+ var i = this.items.length;
+ while (i--) {
+ this.items[i].insertAfter(el);
+ }
+ return this;
+ };
+ setproto.getBBox = function () {
+ var x = [],
+ y = [],
+ x2 = [],
+ y2 = [];
+ for (var i = this.items.length; i--;) if (!this.items[i].removed) {
+ var box = this.items[i].getBBox();
+ x.push(box.x);
+ y.push(box.y);
+ x2.push(box.x + box.width);
+ y2.push(box.y + box.height);
+ }
+ x = mmin.apply(0, x);
+ y = mmin.apply(0, y);
+ x2 = mmax.apply(0, x2);
+ y2 = mmax.apply(0, y2);
+ return {
+ x: x,
+ y: y,
+ x2: x2,
+ y2: y2,
+ width: x2 - x,
+ height: y2 - y,
+ cx: x + (x2 - x) / 2,
+ cy: y + (y2 - y) / 2
+ };
+ };
+ setproto.clone = function (s) {
+ s = new Set;
+ for (var i = 0, ii = this.items.length; i < ii; i++) {
+ s.push(this.items[i].clone());
+ }
+ return s;
+ };
+ setproto.toString = function () {
+ return "Snap\u2018s set";
+ };
+ setproto.type = "set";
+ // export
+ Snap.Set = Set;
+ Snap.set = function () {
+ var set = new Set;
+ if (arguments.length) {
+ set.push.apply(set, Array.prototype.slice.call(arguments, 0));
+ }
+ return set;
+ };
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var names = {},
+ reUnit = /[a-z]+$/i,
+ Str = String;
+ names.stroke = names.fill = "colour";
+ function getEmpty(item) {
+ var l = item[0];
+ switch (l.toLowerCase()) {
+ case "t": return [l, 0, 0];
+ case "m": return [l, 1, 0, 0, 1, 0, 0];
+ case "r": if (item.length == 4) {
+ return [l, 0, item[2], item[3]];
+ } else {
+ return [l, 0];
+ }
+ case "s": if (item.length == 5) {
+ return [l, 1, 1, item[3], item[4]];
+ } else if (item.length == 3) {
+ return [l, 1, 1];
+ } else {
+ return [l, 1];
+ }
+ }
+ }
+ function equaliseTransform(t1, t2, getBBox) {
+ t2 = Str(t2).replace(/\.{3}|\u2026/g, t1);
+ t1 = Snap.parseTransformString(t1) || [];
+ t2 = Snap.parseTransformString(t2) || [];
+ var maxlength = Math.max(t1.length, t2.length),
+ from = [],
+ to = [],
+ i = 0, j, jj,
+ tt1, tt2;
+ for (; i < maxlength; i++) {
+ tt1 = t1[i] || getEmpty(t2[i]);
+ tt2 = t2[i] || getEmpty(tt1);
+ if ((tt1[0] != tt2[0]) ||
+ (tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) ||
+ (tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4]))
+ ) {
+ t1 = Snap._.transform2matrix(t1, getBBox());
+ t2 = Snap._.transform2matrix(t2, getBBox());
+ from = [["m", t1.a, t1.b, t1.c, t1.d, t1.e, t1.f]];
+ to = [["m", t2.a, t2.b, t2.c, t2.d, t2.e, t2.f]];
+ break;
+ }
+ from[i] = [];
+ to[i] = [];
+ for (j = 0, jj = Math.max(tt1.length, tt2.length); j < jj; j++) {
+ j in tt1 && (from[i][j] = tt1[j]);
+ j in tt2 && (to[i][j] = tt2[j]);
+ }
+ }
+ return {
+ from: path2array(from),
+ to: path2array(to),
+ f: getPath(from)
+ };
+ }
+ function getNumber(val) {
+ return val;
+ }
+ function getUnit(unit) {
+ return function (val) {
+ return +val.toFixed(3) + unit;
+ };
+ }
+ function getViewBox(val) {
+ return val.join(" ");
+ }
+ function getColour(clr) {
+ return Snap.rgb(clr[0], clr[1], clr[2]);
+ }
+ function getPath(path) {
+ var k = 0, i, ii, j, jj, out, a, b = [];
+ for (i = 0, ii = path.length; i < ii; i++) {
+ out = "[";
+ a = ['"' + path[i][0] + '"'];
+ for (j = 1, jj = path[i].length; j < jj; j++) {
+ a[j] = "val[" + (k++) + "]";
+ }
+ out += a + "]";
+ b[i] = out;
+ }
+ return Function("val", "return Snap.path.toString.call([" + b + "])");
+ }
+ function path2array(path) {
+ var out = [];
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ for (var j = 1, jj = path[i].length; j < jj; j++) {
+ out.push(path[i][j]);
+ }
+ }
+ return out;
+ }
+ function isNumeric(obj) {
+ return isFinite(parseFloat(obj));
+ }
+ function arrayEqual(arr1, arr2) {
+ if (!Snap.is(arr1, "array") || !Snap.is(arr2, "array")) {
+ return false;
+ }
+ return arr1.toString() == arr2.toString();
+ }
+ Element.prototype.equal = function (name, b) {
+ return eve("snap.util.equal", this, name, b).firstDefined();
+ };
+ eve.on("snap.util.equal", function (name, b) {
+ var A, B, a = Str(this.attr(name) || ""),
+ el = this;
+ if (isNumeric(a) && isNumeric(b)) {
+ return {
+ from: parseFloat(a),
+ to: parseFloat(b),
+ f: getNumber
+ };
+ }
+ if (names[name] == "colour") {
+ A = Snap.color(a);
+ B = Snap.color(b);
+ return {
+ from: [A.r, A.g, A.b, A.opacity],
+ to: [B.r, B.g, B.b, B.opacity],
+ f: getColour
+ };
+ }
+ if (name == "viewBox") {
+ A = this.attr(name).vb.split(" ").map(Number);
+ B = b.split(" ").map(Number);
+ return {
+ from: A,
+ to: B,
+ f: getViewBox
+ };
+ }
+ if (name == "transform" || name == "gradientTransform" || name == "patternTransform") {
+ if (b instanceof Snap.Matrix) {
+ b = b.toTransformString();
+ }
+ if (!Snap._.rgTransform.test(b)) {
+ b = Snap._.svgTransform2string(b);
+ }
+ return equaliseTransform(a, b, function () {
+ return el.getBBox(1);
+ });
+ }
+ if (name == "d" || name == "path") {
+ A = Snap.path.toCubic(a, b);
+ return {
+ from: path2array(A[0]),
+ to: path2array(A[1]),
+ f: getPath(A[0])
+ };
+ }
+ if (name == "points") {
+ A = Str(a).split(Snap._.separator);
+ B = Str(b).split(Snap._.separator);
+ return {
+ from: A,
+ to: B,
+ f: function (val) { return val; }
+ };
+ }
+ var aUnit = a.match(reUnit),
+ bUnit = Str(b).match(reUnit);
+ if (aUnit && arrayEqual(aUnit, bUnit)) {
+ return {
+ from: parseFloat(a),
+ to: parseFloat(b),
+ f: getUnit(aUnit)
+ };
+ } else {
+ return {
+ from: this.asPX(name),
+ to: this.asPX(name, b),
+ f: getNumber
+ };
+ }
+ });
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ has = "hasOwnProperty",
+ supportsTouch = "createTouch" in glob.doc,
+ events = [
+ "click", "dblclick", "mousedown", "mousemove", "mouseout",
+ "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
+ "touchcancel"
+ ],
+ touchMap = {
+ mousedown: "touchstart",
+ mousemove: "touchmove",
+ mouseup: "touchend"
+ },
+ getScroll = function (xy, el) {
+ var name = xy == "y" ? "scrollTop" : "scrollLeft",
+ doc = el && el.node ? el.node.ownerDocument : glob.doc;
+ return doc[name in doc.documentElement ? "documentElement" : "body"][name];
+ },
+ preventDefault = function () {
+ this.returnValue = false;
+ },
+ preventTouch = function () {
+ return this.originalEvent.preventDefault();
+ },
+ stopPropagation = function () {
+ this.cancelBubble = true;
+ },
+ stopTouch = function () {
+ return this.originalEvent.stopPropagation();
+ },
+ addEvent = function (obj, type, fn, element) {
+ var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
+ f = function (e) {
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element);
+ if (supportsTouch && touchMap[has](type)) {
+ for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
+ if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
+ var olde = e;
+ e = e.targetTouches[i];
+ e.originalEvent = olde;
+ e.preventDefault = preventTouch;
+ e.stopPropagation = stopTouch;
+ break;
+ }
+ }
+ }
+ var x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ return fn.call(element, e, x, y);
+ };
+
+ if (type !== realName) {
+ obj.addEventListener(type, f, false);
+ }
+
+ obj.addEventListener(realName, f, false);
+
+ return function () {
+ if (type !== realName) {
+ obj.removeEventListener(type, f, false);
+ }
+
+ obj.removeEventListener(realName, f, false);
+ return true;
+ };
+ },
+ drag = [],
+ dragMove = function (e) {
+ var x = e.clientX,
+ y = e.clientY,
+ scrollY = getScroll("y"),
+ scrollX = getScroll("x"),
+ dragi,
+ j = drag.length;
+ while (j--) {
+ dragi = drag[j];
+ if (supportsTouch) {
+ var i = e.touches && e.touches.length,
+ touch;
+ while (i--) {
+ touch = e.touches[i];
+ if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
+ x = touch.clientX;
+ y = touch.clientY;
+ (e.originalEvent ? e.originalEvent : e).preventDefault();
+ break;
+ }
+ }
+ } else {
+ e.preventDefault();
+ }
+ var node = dragi.el.node,
+ o,
+ next = node.nextSibling,
+ parent = node.parentNode,
+ display = node.style.display;
+ // glob.win.opera && parent.removeChild(node);
+ // node.style.display = "none";
+ // o = dragi.el.paper.getElementByPoint(x, y);
+ // node.style.display = display;
+ // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
+ // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
+ x += scrollX;
+ y += scrollY;
+ eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
+ }
+ },
+ dragUp = function (e) {
+ Snap.unmousemove(dragMove).unmouseup(dragUp);
+ var i = drag.length,
+ dragi;
+ while (i--) {
+ dragi = drag[i];
+ dragi.el._drag = {};
+ eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
+ eve.off("snap.drag.*." + dragi.el.id);
+ }
+ drag = [];
+ };
+ /*\
+ * Element.click
+ [ method ]
+ **
+ * Adds a click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unclick
+ [ method ]
+ **
+ * Removes a click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.dblclick
+ [ method ]
+ **
+ * Adds a double click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.undblclick
+ [ method ]
+ **
+ * Removes a double click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousedown
+ [ method ]
+ **
+ * Adds a mousedown event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousedown
+ [ method ]
+ **
+ * Removes a mousedown event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousemove
+ [ method ]
+ **
+ * Adds a mousemove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousemove
+ [ method ]
+ **
+ * Removes a mousemove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseout
+ [ method ]
+ **
+ * Adds a mouseout event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseout
+ [ method ]
+ **
+ * Removes a mouseout event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseover
+ [ method ]
+ **
+ * Adds a mouseover event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseover
+ [ method ]
+ **
+ * Removes a mouseover event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseup
+ [ method ]
+ **
+ * Adds a mouseup event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseup
+ [ method ]
+ **
+ * Removes a mouseup event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchstart
+ [ method ]
+ **
+ * Adds a touchstart event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchstart
+ [ method ]
+ **
+ * Removes a touchstart event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchmove
+ [ method ]
+ **
+ * Adds a touchmove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchmove
+ [ method ]
+ **
+ * Removes a touchmove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchend
+ [ method ]
+ **
+ * Adds a touchend event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchend
+ [ method ]
+ **
+ * Removes a touchend event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchcancel
+ [ method ]
+ **
+ * Adds a touchcancel event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchcancel
+ [ method ]
+ **
+ * Removes a touchcancel event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ for (var i = events.length; i--;) {
+ (function (eventName) {
+ Snap[eventName] = elproto[eventName] = function (fn, scope) {
+ if (Snap.is(fn, "function")) {
+ this.events = this.events || [];
+ this.events.push({
+ name: eventName,
+ f: fn,
+ unbind: addEvent(this.node || document, eventName, fn, scope || this)
+ });
+ } else {
+ for (var i = 0, ii = this.events.length; i < ii; i++) if (this.events[i].name == eventName) {
+ try {
+ this.events[i].f.call(this);
+ } catch (e) {}
+ }
+ }
+ return this;
+ };
+ Snap["un" + eventName] =
+ elproto["un" + eventName] = function (fn) {
+ var events = this.events || [],
+ l = events.length;
+ while (l--) if (events[l].name == eventName &&
+ (events[l].f == fn || !fn)) {
+ events[l].unbind();
+ events.splice(l, 1);
+ !events.length && delete this.events;
+ return this;
+ }
+ return this;
+ };
+ })(events[i]);
+ }
+ /*\
+ * Element.hover
+ [ method ]
+ **
+ * Adds hover event handlers to the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ - icontext (object) #optional context for hover in handler
+ - ocontext (object) #optional context for hover out handler
+ = (object) @Element
+ \*/
+ elproto.hover = function (f_in, f_out, scope_in, scope_out) {
+ return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
+ };
+ /*\
+ * Element.unhover
+ [ method ]
+ **
+ * Removes hover event handlers from the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ = (object) @Element
+ \*/
+ elproto.unhover = function (f_in, f_out) {
+ return this.unmouseover(f_in).unmouseout(f_out);
+ };
+ var draggable = [];
+ // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.
+ // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?
+ // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.
+ // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
+ /*\
+ * Element.drag
+ [ method ]
+ **
+ * Adds event handlers for an element's drag gesture
+ **
+ - onmove (function) handler for moving
+ - onstart (function) handler for drag start
+ - onend (function) handler for drag end
+ - mcontext (object) #optional context for moving handler
+ - scontext (object) #optional context for drag start handler
+ - econtext (object) #optional context for drag end handler
+ * Additionaly following `drag` events are triggered: `drag.start.<id>` on start,
+ * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element
+ * `drag.over.<id>` fires as well.
+ *
+ * Start event and start handler are called in specified context or in context of the element with following parameters:
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * Move event and move handler are called in specified context or in context of the element with following parameters:
+ o dx (number) shift by x from the start point
+ o dy (number) shift by y from the start point
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * End event and end handler are called in specified context or in context of the element with following parameters:
+ o event (object) DOM event object
+ = (object) @Element
+ \*/
+ elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
+ var el = this;
+ if (!arguments.length) {
+ var origTransform;
+ return el.drag(function (dx, dy) {
+ this.attr({
+ transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
+ });
+ }, function () {
+ origTransform = this.transform().local;
+ });
+ }
+ function start(e, x, y) {
+ (e.originalEvent || e).preventDefault();
+ el._drag.x = x;
+ el._drag.y = y;
+ el._drag.id = e.identifier;
+ !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
+ drag.push({el: el, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
+ onstart && eve.on("snap.drag.start." + el.id, onstart);
+ onmove && eve.on("snap.drag.move." + el.id, onmove);
+ onend && eve.on("snap.drag.end." + el.id, onend);
+ eve("snap.drag.start." + el.id, start_scope || move_scope || el, x, y, e);
+ }
+ function init(e, x, y) {
+ eve("snap.draginit." + el.id, el, e, x, y);
+ }
+ eve.on("snap.draginit." + el.id, start);
+ el._drag = {};
+ draggable.push({el: el, start: start, init: init});
+ el.mousedown(init);
+ return el;
+ };
+ /*
+ * Element.onDragOver
+ [ method ]
+ **
+ * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)
+ - f (function) handler for event, first argument would be the element you are dragging over
+ \*/
+ // elproto.onDragOver = function (f) {
+ // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over." + this.id);
+ // };
+ /*\
+ * Element.undrag
+ [ method ]
+ **
+ * Removes all drag event handlers from the given element
+ \*/
+ elproto.undrag = function () {
+ var i = draggable.length;
+ while (i--) if (draggable[i].el == this) {
+ this.unmousedown(draggable[i].init);
+ draggable.splice(i, 1);
+ eve.unbind("snap.drag.*." + this.id);
+ eve.unbind("snap.draginit." + this.id);
+ }
+ !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
+ return this;
+ };
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ pproto = Paper.prototype,
+ rgurl = /^\s*url\((.+)\)/,
+ Str = String,
+ $ = Snap._.$;
+ Snap.filter = {};
+ /*\
+ * Paper.filter
+ [ method ]
+ **
+ * Creates a `<filter>` element
+ **
+ - filstr (string) SVG fragment of filter provided as a string
+ = (object) @Element
+ * Note: It is recommended to use filters embedded into the page inside an empty SVG element.
+ > Usage
+ | var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ pproto.filter = function (filstr) {
+ var paper = this;
+ if (paper.type != "svg") {
+ paper = paper.paper;
+ }
+ var f = Snap.parse(Str(filstr)),
+ id = Snap._.id(),
+ width = paper.node.offsetWidth,
+ height = paper.node.offsetHeight,
+ filter = $("filter");
+ $(filter, {
+ id: id,
+ filterUnits: "userSpaceOnUse"
+ });
+ filter.appendChild(f.node);
+ paper.defs.appendChild(filter);
+ return new Element(filter);
+ };
+
+ eve.on("snap.util.getattr.filter", function () {
+ eve.stop();
+ var p = $(this.node, "filter");
+ if (p) {
+ var match = Str(p).match(rgurl);
+ return match && Snap.select(match[1]);
+ }
+ });
+ eve.on("snap.util.attr.filter", function (value) {
+ if (value instanceof Element && value.type == "filter") {
+ eve.stop();
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ id = value.id;
+ }
+ $(this.node, {
+ filter: Snap.url(id)
+ });
+ }
+ if (!value || value == "none") {
+ eve.stop();
+ this.node.removeAttribute("filter");
+ }
+ });
+ /*\
+ * Snap.filter.blur
+ [ method ]
+ **
+ * Returns an SVG markup string for the blur filter
+ **
+ - x (number) amount of horizontal blur, in pixels
+ - y (number) #optional amount of vertical blur, in pixels
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.blur(5, 10)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.blur = function (x, y) {
+ if (x == null) {
+ x = 2;
+ }
+ var def = y == null ? x : [x, y];
+ return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
+ def: def
+ });
+ };
+ Snap.filter.blur.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.shadow
+ [ method ]
+ **
+ * Returns an SVG markup string for the shadow filter
+ **
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - blur (number) #optional amount of blur
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * which makes blur default to `4`. Or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - opacity (number) #optional `0..1` opacity of the shadow
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
+ if (typeof blur == "string") {
+ color = blur;
+ opacity = color;
+ blur = 4;
+ }
+ if (typeof color != "string") {
+ opacity = color;
+ color = "#000";
+ }
+ color = color || "#000";
+ if (blur == null) {
+ blur = 4;
+ }
+ if (opacity == null) {
+ opacity = 1;
+ }
+ if (dx == null) {
+ dx = 0;
+ dy = 2;
+ }
+ if (dy == null) {
+ dy = dx;
+ }
+ color = Snap.color(color);
+ return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
+ color: color,
+ dx: dx,
+ dy: dy,
+ blur: blur,
+ opacity: opacity
+ });
+ };
+ Snap.filter.shadow.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.grayscale
+ [ method ]
+ **
+ * Returns an SVG markup string for the grayscale filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.grayscale = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
+ a: 0.2126 + 0.7874 * (1 - amount),
+ b: 0.7152 - 0.7152 * (1 - amount),
+ c: 0.0722 - 0.0722 * (1 - amount),
+ d: 0.2126 - 0.2126 * (1 - amount),
+ e: 0.7152 + 0.2848 * (1 - amount),
+ f: 0.0722 - 0.0722 * (1 - amount),
+ g: 0.2126 - 0.2126 * (1 - amount),
+ h: 0.0722 + 0.9278 * (1 - amount)
+ });
+ };
+ Snap.filter.grayscale.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.sepia
+ [ method ]
+ **
+ * Returns an SVG markup string for the sepia filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.sepia = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
+ a: 0.393 + 0.607 * (1 - amount),
+ b: 0.769 - 0.769 * (1 - amount),
+ c: 0.189 - 0.189 * (1 - amount),
+ d: 0.349 - 0.349 * (1 - amount),
+ e: 0.686 + 0.314 * (1 - amount),
+ f: 0.168 - 0.168 * (1 - amount),
+ g: 0.272 - 0.272 * (1 - amount),
+ h: 0.534 - 0.534 * (1 - amount),
+ i: 0.131 + 0.869 * (1 - amount)
+ });
+ };
+ Snap.filter.sepia.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.saturate
+ [ method ]
+ **
+ * Returns an SVG markup string for the saturate filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.saturate = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
+ amount: 1 - amount
+ });
+ };
+ Snap.filter.saturate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.hueRotate
+ [ method ]
+ **
+ * Returns an SVG markup string for the hue-rotate filter
+ **
+ - angle (number) angle of rotation
+ = (string) filter representation
+ \*/
+ Snap.filter.hueRotate = function (angle) {
+ angle = angle || 0;
+ return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
+ angle: angle
+ });
+ };
+ Snap.filter.hueRotate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.invert
+ [ method ]
+ **
+ * Returns an SVG markup string for the invert filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.invert = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+// <feColorMatrix type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" color-interpolation-filters="sRGB"/>
+ return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: 1 - amount
+ });
+ };
+ Snap.filter.invert.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.brightness
+ [ method ]
+ **
+ * Returns an SVG markup string for the brightness filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.brightness = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
+ amount: amount
+ });
+ };
+ Snap.filter.brightness.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.contrast
+ [ method ]
+ **
+ * Returns an SVG markup string for the contrast filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.contrast = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: .5 - amount / 2
+ });
+ };
+ Snap.filter.contrast.toString = function () {
+ return this();
+ };
+});
+
+// Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var box = Snap._.box,
+ is = Snap.is,
+ firstLetter = /^[^a-z]*([tbmlrc])/i,
+ toString = function () {
+ return "T" + this.dx + "," + this.dy;
+ };
+ /*\
+ * Element.getAlign
+ [ method ]
+ **
+ * Returns shift needed to align the element relatively to given element.
+ * If no elements specified, parent `<svg>` container will be used.
+ - el (object) @optional alignment element
+ - way (string) one of six values: `"top"`, `"middle"`, `"bottom"`, `"left"`, `"center"`, `"right"`
+ = (object|string) Object in format `{dx: , dy: }` also has a string representation as a transformation string
+ > Usage
+ | el.transform(el.getAlign(el2, "top"));
+ * or
+ | var dy = el.getAlign(el2, "top").dy;
+ \*/
+ Element.prototype.getAlign = function (el, way) {
+ if (way == null && is(el, "string")) {
+ way = el;
+ el = null;
+ }
+ el = el || this.paper;
+ var bx = el.getBBox ? el.getBBox() : box(el),
+ bb = this.getBBox(),
+ out = {};
+ way = way && way.match(firstLetter);
+ way = way ? way[1].toLowerCase() : "c";
+ switch (way) {
+ case "t":
+ out.dx = 0;
+ out.dy = bx.y - bb.y;
+ break;
+ case "b":
+ out.dx = 0;
+ out.dy = bx.y2 - bb.y2;
+ break;
+ case "m":
+ out.dx = 0;
+ out.dy = bx.cy - bb.cy;
+ break;
+ case "l":
+ out.dx = bx.x - bb.x;
+ out.dy = 0;
+ break;
+ case "r":
+ out.dx = bx.x2 - bb.x2;
+ out.dy = 0;
+ break;
+ default:
+ out.dx = bx.cx - bb.cx;
+ out.dy = 0;
+ break;
+ }
+ out.toString = toString;
+ return out;
+ };
+ /*\
+ * Element.align
+ [ method ]
+ **
+ * Aligns the element relatively to given one via transformation.
+ * If no elements specified, parent `<svg>` container will be used.
+ - el (object) @optional alignment element
+ - way (string) one of six values: `"top"`, `"middle"`, `"bottom"`, `"left"`, `"center"`, `"right"`
+ = (object) this element
+ > Usage
+ | el.align(el2, "top");
+ * or
+ | el.align("middle");
+ \*/
+ Element.prototype.align = function (el, way) {
+ return this.transform("..." + this.getAlign(el, way));
+ };
+});
+
+return Snap;
+}));
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/dr.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/dr.css
new file mode 100644
index 0000000..e85f5a8
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/dr.css
@@ -0,0 +1,144 @@
+#content section.code {
+ display: block;
+ font-weight: 400;
+ background: #181818;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+}
+#content section.code pre code {
+ font-size: 14px;
+}
+code {
+ font-family: source-code-pro, Menlo, "Arial Unicode MS", sans-serif;
+}
+a.dr-hash,
+a.dr-sourceline {
+ -webkit-transition: opacity 0.2s linear;
+ color: #333;
+ font-family: Menlo, "Arial Unicode MS", sans-serif;
+ margin: 0 0 0 .3em;
+ opacity: 0;
+ text-decoration: none;
+}
+h2:hover a.dr-hash,
+h3:hover a.dr-hash,
+h4:hover a.dr-hash,
+h5:hover a.dr-hash,
+h2:hover a.dr-sourceline,
+h3:hover a.dr-sourceline,
+h4:hover a.dr-sourceline,
+h5:hover a.dr-sourceline {
+ opacity: 1;
+}
+.dr-param {
+ float: left;
+ min-width: 8em;
+}
+.dr-type {
+ float: left;
+}
+.dr-title {
+ float: left;
+ margin: 0 8px 0 0;
+}
+.dr-type em,
+.dr-returns em,
+.dr-property em {
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ background: #ccc;
+ border-radius: 5px;
+ float: left;
+ font-size: .75em;
+ font-style: normal;
+ font-weight: 700;
+ margin: 0 8px 0 0;
+ min-width: 80px;
+ padding: 2px 5px;
+ text-align: center;
+}
+.dr-type em.amp,
+.dr-returns em.amp,
+.dr-property em.amp {
+ float: none;
+ background: none;
+ font-size: 1em;
+ font-weight: 400;
+ font-style: italic;
+ margin: 0;
+ padding: 0;
+ min-width: 0;
+}
+.dr-property em.dr-type {
+ margin: 4px 16px 0 0;
+}
+em.dr-type-string {
+ background: #e1edb1;
+ color: #3d4c00;
+}
+em.dr-type-object {
+ background: #edb1b1;
+ color: #4c0000;
+}
+em.dr-type-function {
+ background: #cfb1ed;
+ color: #26004c;
+}
+em.dr-type-number {
+ background: #b1c9ed;
+ color: #001e4c;
+}
+em.dr-type-boolean {
+ background: #b1edc9;
+ color: #004c1e;
+}
+em.dr-type-array {
+ background: #edd5b1;
+ color: #4c2d00;
+}
+.dr-optional {
+ display: none;
+}
+ol.dr-json {
+ background: #ddd;
+ list-style: none;
+ margin: 0 -30px;
+ padding: 16px 30px;
+ line-height: 1.5;
+}
+ol.dr-json .dr-json-key {
+ float: left;
+ min-width: 50px;
+ margin-right: 16px;
+}
+ol.dr-json .dr-json-description {
+ display: table;
+}
+ol.dr-json ol.dr-json {
+ margin: 0;
+ padding: 0 0 0 50px;
+}
+#pageNav li.dr-lvl1 a {
+ padding-left: 1em;
+}
+#pageNav li.dr-lvl2 a {
+ padding-left: 2em;
+}
+#pageNav li.dr-lvl3 a {
+ padding-left: 3em;
+}
+#pageNav li.dr-lvl4 a {
+ padding-left: 4em;
+}
+#pageNav li.dr-lvl5 a {
+ padding-left: 5em;
+}
+#pageNav li.dr-lvl6 a {
+ padding-left: 6em;
+}
+#pageNav ol {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/main.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/main.css
new file mode 100644
index 0000000..2d0bda3
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/main.css
@@ -0,0 +1,508 @@
+html,body{
+ margin:0;
+ padding:0;
+ height: 100%;
+}
+body {
+ font-family: source-sans-pro, sans-serif;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+}
+body.light {
+ background: #F4F4F4;
+}
+body.dark {
+ color: #F0F1F1;
+ background: #4A4D4E;
+}
+body.light {
+ color: #181919;
+}
+
+h1 {
+ font-weight: 600;
+}
+#wrapper {
+ width: 100%;
+ overflow-x: hidden;
+ background: inherit;
+ position: relative;
+}
+#site {
+ width: 100%;
+ position: relative;
+ z-index: 10;
+ background: inherit;
+ left: 0;
+ transition: all 0.2s ease-out;
+ -webkit-transition: all 0.2s ease-out;
+ transform: translate3d(0, 0, 0);
+ -webkit-transform: translate3d(0, 0, 0);
+}
+#site:before{
+ position: absolute;
+ content: '';
+ left: -4px;
+ height: 100%;
+ width: 4px;
+ background: #3B3E3E;
+}
+#site.open {
+ transform: translate3d(250px, 0, 0);
+ -webkit-transform: translate3d(250px, 0, 0);
+}
+pre {
+ font-family: source-code-pro, sans-serif;
+ font-size: 12px;
+}
+/* Main Header */
+#main-header {
+ color: #373435;
+ background: #fff;
+ height: 98px;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 10px 20px;
+ position: relative;
+}
+#main-header hgroup {
+ text-align: center;
+}
+#main-header hgroup h1 {
+ font-size: 40px;
+ margin: 5px 0 0;
+ letter-spacing: -.065em;
+ line-height: 1.1em;
+}
+#main-header hgroup a {
+ color: #464646;
+ text-decoration: none;
+}
+#main-header hgroup a:hover {
+ color: #000;
+}
+#main-header hgroup p {
+ font-size: 13px;
+ color: #999;
+ margin: 0;
+}
+#main-header nav {
+ display: none;
+}
+#slide-menu-button {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+ display: inline-block;
+ vertical-align: top;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ -webkit-background-clip: padding;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ -o-text-overflow: ellipsis;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ padding: 0 0.5rem;
+ line-height: 2rem;
+ letter-spacing: 1px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ vertical-align: baseline;
+ -webkit-box-shadow: inset 0 1px #fff;
+ box-shadow: inset 0 1px #fff;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ width: 2.6rem;
+ height: 2.6rem;
+ line-height: 2.6rem;
+ border: 1px solid transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+#slide-menu:disabled,
+#slide-menu.is-disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+#slide-menu-button:active,
+#slide-menu-button.is-active {
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ background-color: #d3d7d7;
+ border: 1px solid #a5a8a8;
+ -webkit-box-shadow: inset 0 1px rgba(0,0,0,0.12);
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+#slide-menu-button span {
+ background-repeat: no-repeat;
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCIgWw0KCTwhRU5USVRZIG5zX2V4dGVuZCAiaHR0cDovL25zLmFkb2JlLmNvbS9FeHRlbnNpYmlsaXR5LzEuMC8iPg0KCTwhRU5USVRZIG5zX2FpICJodHRwOi8vbnMuYWRvYmUuY29tL0Fkb2JlSWxsdXN0cmF0b3IvMTAuMC8iPg0KCTwhRU5USVRZIG5zX2dyYXBocyAiaHR0cDovL25zLmFkb2JlLmNvbS9HcmFwaHMvMS4wLyI+DQoJPCFFTlRJVFkgbnNfdmFycyAiaHR0cDovL25zLmFkb2JlLmNvbS9WYXJpYWJsZXMvMS4wLyI+DQoJPCFFTlRJVFkgbnNfaW1yZXAgImh0dHA6Ly9ucy5hZG9iZS5jb20vSW1hZ2VSZXBsYWNlbWVudC8xLjAvIj4NCgk8IUVOVElUWSBuc19zZncgImh0dHA6Ly9ucy5hZG9iZS5jb20vU2F2ZUZvcldlYi8xLjAvIj4NCgk8IUVOVElUWSBuc19jdXN0b20gImh0dHA6Ly9ucy5hZG9iZS5jb20vR2VuZXJpY0N1c3RvbU5hbWVzcGFjZS8xLjAvIj4NCgk8IUVOVElUWSBuc19hZG9iZV94cGF0aCAiaHR0cDovL25zLmFkb2JlLmNvbS9YUGF0aC8xLjAvIj4NCl0+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zOng9IiZuc19leHRlbmQ7IiB4bWxuczppPSImbnNfYWk7IiB4bWxuczpncmFwaD0iJm5zX2dyYXBoczsiDQoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4Ig0KCSB2aWV3Qm94PSIwIDAgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDQwIDQwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzd2l0Y2g+DQoJPGZvcmVpZ25PYmplY3QgcmVxdWlyZWRFeHRlbnNpb25zPSImbnNfYWk7IiB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj4NCgkJPGk6cGdmUmVmICB4bGluazpocmVmPSIjYWRvYmVfaWxsdXN0cmF0b3JfcGdmIj4NCgkJPC9pOnBnZlJlZj4NCgk8L2ZvcmVpZ25PYmplY3Q+DQoJPGcgaTpleHRyYW5lb3VzPSJzZWxmIj4NCgkJPGcgb3BhY2l0eT0iMC43Ij4NCgkJCTxnIG9wYWNpdHk9IjAuNzUiPg0KCQkJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGRkZGIiBkPSJNMzksMTF2LTFjMC0xLjQ3LTAuNDgtMi0yLTJIM2MtMS41MywwLTIsMC41Mi0yLDJ2MQ0KCQkJCQljMCwxLjU1LDAuNTIsMiwyLDJoMzRDMzguNSwxMywzOSwxMi41MiwzOSwxMXoiLz4NCgkJCTwvZz4NCgkJCTxnPg0KCQkJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzksMTBWOWMwLTEuNDctMC40OC0yLTItMkgzQzEuNDcsNywxLDcuNTIsMSw5djFjMCwxLjU1LDAuNTIsMiwyLDJoMzQNCgkJCQkJQzM4LjUsMTIsMzksMTEuNTIsMzksMTB6Ii8+DQoJCQk8L2c+DQoJCTwvZz4NCgkJPGcgb3BhY2l0eT0iMC43Ij4NCgkJCTxnIG9wYWNpdHk9IjAuNzUiPg0KCQkJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGRkZGIiBkPSJNMzksMjJ2LTFjMC0xLjQ3LTAuNDgtMi0yLTJIM2MtMS41MywwLTIsMC41Mi0yLDJ2MQ0KCQkJCQljMCwxLjU1LDAuNTIsMiwyLDJoMzRDMzguNSwyNCwzOSwyMy41MiwzOSwyMnoiLz4NCgkJCTwvZz4NCgkJCTxnPg0KCQkJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzksMjF2LTFjMC0xLjQ3LTAuNDgtMi0yLTJIM2MtMS41MywwLTIsMC41Mi0yLDJ2MWMwLDEuNTUsMC41MiwyLDIsMmgzNA0KCQkJCQlDMzguNSwyMywzOSwyMi41MiwzOSwyMXoiLz4NCgkJCTwvZz4NCgkJPC9nPg0KCQk8ZyBvcGFjaXR5PSIwLjciPg0KCQkJPGcgb3BhY2l0eT0iMC43NSI+DQoJCQkJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNGRkZGRkYiIGQ9Ik0zOSwzM3YtMWMwLTEuNDcxLTAuNDgtMi0yLTJIM2MtMS41MywwLTIsMC41Mi0yLDJ2MQ0KCQkJCQljMCwxLjU1LDAuNTIsMiwyLDJoMzRDMzguNSwzNSwzOSwzNC41MiwzOSwzM3oiLz4NCgkJCTwvZz4NCgkJCTxnPg0KCQkJCTxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzksMzJ2LTFjMC0xLjQ3MS0wLjQ4LTItMi0ySDNjLTEuNTMsMC0yLDAuNTItMiwydjFjMCwxLjU1LDAuNTIsMiwyLDJoMzQNCgkJCQkJQzM4LjUsMzQsMzksMzMuNTIsMzksMzJ6Ii8+DQoJCQk8L2c+DQoJCTwvZz4NCgk8L2c+DQo8L3N3aXRjaD4NCjxpOnBnZiAgaWQ9ImFkb2JlX2lsbHVzdHJhdG9yX3BnZiI+DQoJPCFbQ0RBVEFbDQoJZUp6c3ZlbVNKTG1SSnZnRTlnNitQMXFFSEprS0dnQ0RBY1lkV1pId09IbzRRM2FYa094anBXV2tKSmtWVGVaMEhpVlpXZVJ5bjM3MQorMVFWZ0xsN1pFVWVSVksySzFDVkVhNE9nNW5oVU9qeHFlTHYvbzh2Zi9QRjlkZHZmdmZ3UmJxYUQ5UGYvZDNOMjRkbjc5NjgvZm1CCjFNTXZYcjc4N3R0M2IwSDZ5YTkvZWdqcjFTeVZybjlSdjdLSy8venc5dHNYYjE3L25GOWRKZm55SGxmLzVCZmZQdnZkdzh1WEQ0ZGYKUG52OTlicy9QSHY1OFBhbmg1LzhWTDcvN1l0M0x4K2t4aCtldmZyZGQyOS8vL0QyNnRzLy92Nm5mbXRwNi9iWk8vbCsrVm44V1VpSAorUE01SHI3OEZiNSs5dnFQejc3OTlzWC8rNENicFlwN0hkOTg5L3JyRjY5L2Yzenovd2p4OEVYS2g3UWR2aWp5MVg5LzhldUhiOS96Ci9lMmI1OSs5ZW5qOTdzdTNiNTQvZlB2dHpadVhiOTUrKy9QRHpaK2Z2VDc4NnRudjVadG5oLzliM3VETm53N0hsOCtlLzhja2I1Mi8KdW4veDhrRmU4Tld6ZDRjUTBSZlh2d2p4cStOM0wxNSsvUS9mdmZyZGc3ejZ1cEdjdm1LVC8vU3R0Q1hONG0rUXkxZS9lQ1dVM3p5OApleWZQSlRkRWYvNzY3NC9qWXdpUjVTZi85dXVIMzc5ZzkwdTMvSytmV3JOdjMzeno2dG5iLzhDMWh5K1crU0QvMlIxLysvRHFtNWZTCmUzemRPRi9sd3hmOHQvOXA5ZVF0V09lTHVGYnBsYkllMGx3UEtWZjl2dmZOd3g5ZlBQenA1NGQvZVBQNlFUdmcrdTI3MytnUUxNczgKNjcvNnphKy9rekgrcDljdjNzbURyU0J0MmdPL2V2UDF3MHVwMzY2L2YvbU1MODRTK3I5YTRiZlBaRTY4azdGNzgvSzdkNXhaMWU4ZwpQZnpMWjM5K3dEQUZ2Y0UvZnZQdytyZHYvcG5QK0VVTTBrN2NyclpEWE9TTlF0eVdRNmhzUCtKUnQ3bmRNL1IvdFdrMGhHYThmY3lRCkwyV2Mvdkh0aTkrL2VQM3pMMUtWdms1eDFpSDgrN2N2dnU0akdBN1YvcGZHcitydy8rYi82OVBLaTc5NzkvRGFubDdtemMydmhua3cKWC8zcU4zTFh1OWRmMzd4NWhkNy9GaE5jSnNCcm1Sc3YzL3hldjJ0Lzh4dTUvTHR2OUEzNCtTc1pxQy9mdm5pTk5xZC80RGYxcXk5ZgpmaWRmL2YzYk45OTk4NHZYLy81bStva3U3WDkrZUM3clY4Ynk2OE0vL3U1L3l3ZFpuNXliaDkrK2ZmWmNHcERQcmM3VnN4ZmYvUFM5Cnpjbkx2WDA0NkpkeUpULzY3KysvK3ZiaDMyVlY5Y3VWZXZmNmp3OHYzM3d6Tk5zb3dsVU8vL0xzN1RmZjMvU1hMNSs5ZnZiMlFIcHIKK1pjdi9pamZQSk9lNm0xMzJoTWFsVm55alhRT0wyR1ZreHU4cDhMdzFSTnU5T3pkSDRRQlBieisrdHZXdG43Y1A3alN2cis5M3p6SApISHg3T0w3OTd0cy9ISDc3NXMzTDF1eitxOWE2a1VsRi9iK05lM3pKQzE3LzQydnRvUE03V1lYVE93bi8rWnU3aTlSKy9BN3k1ZDl5CjZ6ZlBYcjU4OGZ1M3o3NzV3NHZubDI1dzRmdDJKLzN1UXliV24xLzk3czNMRjkrKzZ2TnBvSHo1N08yN0Y4OWZQdnptejkrK2UzajEKNU1FOTNIMzlRcGpjSTh2NHZYVis4NmRuNzU3LzRaY3ZmdmYyMmRzWEQrOWRmUmlBZjMveCttdVorNy81N3NXN2g5NUJiMTU5QXlubAo4SnMvUFB2bWdhL3g3Zy8zclBtYjFtRCtTbGoveU55LytPSTlYRCtzaCtQcjRmdS9mL3ZzNnhleW9ZalE5ZmR2WG43OThQcndhN0QzCmFmZEp0cTl5T0g0OS9kczBXd2tzeStIdnZqcStuZjdiTkovK2hKTVNoNUtzTEZZeS8vZXk0djlKZm8ybHRGTG5iVmV1aDNLVWNtUGwKZGloMzgvMDAzM3ZaUGRqNEU0ZVNockxzU3RZeThWY0pxNVRDMzNVbzI2NWNoMk1yTjYwY3c2MFUvM1E3eVljN2ttN0QvVmpHcnVQRAorVThheWpLVUhGZVVTWC9GTXBRYU55bjY3L1ZRamxxbS8rdlNXRDQybW1rM25zc3dxbjFzcFV4dGVKZGhrSFZVeDlHdFV2QWJvMXAzCjQ3c05JeXovVGpiVVB0akhOc3o2RzZOOE40NjIvS3MvODhXeGp0TnVvSk9NSzM1alpESEdLMHZsS0plVEViNjJzaDliR1V2OHVtTzUKUFJsRnYybmlHUFl4UTlGQjhpSGJiTEJrZ0NZYkk0elZqWlZibGpzcjl5aStzdkF5NDFnR2p0SmlIVi9ab1VjdWtudjJUZVRMcjN5OQpqYTl5eXljTzlvUXJwNHc4d3NUNzRqNHhwYlNrTlJWUnRyWjBsSEtiN21XMHc1S1daY2xMV2VxeUxkZkxjYmxkN3BaNzZjaVlVMTd5Cm1rdmU4blUrNXB0OGwrOG5lYUFnczNSWjg3cXVkZDNXNi9XNDNxeTM2NzNNaFNEZHNKUmMxbExMVm83bHB0eVdlNWtub2NhNjFGelgKV3VwV3IrdXgzdGE3ZWkvekpVNWIycFpOMnRucXRtM0g3V2E3Mis1bDBvVHJkTDFjNSt2MXVsNXYxOWZYUnlrMzE3ZlhkNXhKVVY1ZwpPZVpqT2RiakpsOGRqemZIdStPOXpLNHdzYmZUelhLVGIrUUJicmFiNjV2anpjM043YzI5VExiQVVWaHU4KzE2S3c5M1cyKzMyK1B0CnplM2Q3ZjNkTE9PUzdwYTc5YTdjMWJ2dFR1NTFkM04zTzkzZDNkMWpSdHhMaDkzbmUzblRlM24yKzJzcGNzdDd1ZkwrNUVmR2NwYlIKYkovdmhuSTdsSnVoSEhmbGVpaWJsMG4rcVVNcFExbDNKUTlsR1VvYWlrekE2VDYyTXJLd3puem44ZEh2eHAvYlhiblJNdkhYY1NqWApROWwycFE2bERHVWRTcDd1Y2l2THJxU2h4S0dFb2N4ajBTNmZyTy9IcHg5L2JvWnkxTUtWdVJ2SC9lanR4OHhIYXo5RSsyR1JvWmlHCjBkZ1B3YjdqOTkxdDNYelN0K3pQcVhYcHZpUDN2YmZ2c1pOKzJuZk5kTklqMmh2WFZqYVdhcVZZV1ZteWxZVWxXWWtUMTU1dG1jcjYKMi9UM045TjcrYytSNWRyS3hsS3R5TnFlNUovVlNyYXlzQ1FyeW5xZDBRc0g5Ykc4NC9nZE9WNlY0NU01SUJpRW1kMSt5MjYrWnE4Vwo5dVBDZmd2c3B6dDJ6SkVkVVNlK2VlYTc0Z1ZudnRBdFgrQ2FqMXo0aEF1ZlNKNURac3VkZE9hTjhLMXI0VjlWK05ncTNHd1JyaGFGCm04K1RUS1E3NmVVYllYclh3djdxZFJGR21JVWhKdGxSZ3V5dzl6TGl0OUlkeCsxYTJHYmRpakRRTEl3MHlSWVVaRCsrbDRsd0s5MTAKRkc2NzFUb0o0MTJGQVM4MUNTc09zbkhmeXd5NWxUNDhsbXRoMWJVVVlkcFptSGNTRmg1a283K1h1WE1ySFhzVUJyOEpveS9DN3JPdwovU1RNUDZ6ekpOUDRUc2I0UmphR2E5a2dxbXdUYTg2eVlTVFpPSUxJRHZjeTNXNWxMSTZ5cVd5eXVaUmxsVzFta2UwbXlxWXp5N3kvCmsxbHhJeHZSdFd4SWRaS2RhVTFaOXFna2UxVVFXZVZlWnVpdERCOTJVV3lyMkdpemJHN1lpRU9jQTdoc0UyaXRGdXA1TGRhVEJhV2IKT3VRMzdQd2JKUU9WRkVSMjRIeDQ1SFpzaGczNDVmMWlpQjJ4TTRiN2dkVXJTOWhrVW1XWlVFRW0wNldwRkcyUDRPNkRIOTJCQXRjbApkcUhNMWVzN2tlMUYySXBrdHhFaGdQZkdmdGMydTFWbVdiMnczYVcyM1dHenU4WU5lWEdUR0pMSm9NV2xCZ29OZHhRYmdna091WWtPCjEyTzNveGNncDgzMzJxUjhvREIzeTQ5WUxicFdmRU5zdXlpLzU1dnpyWFVZcmltVjNLWGR5RklrREUzb1VRbFBCUitWNUc0b2lOOUoKMDhHRWJIMGRsNXBOU3FaYXdhYThvZDRNRzJGdjZNVVhlMElmZVJ3b0hhU2RzRUJKSWNuSUY1a0JSODZGRStuQXV5TGJCdUFjWitRNQpmYXAwdmpOeUh2SWU3ZUlMN0dqUGpiNlBGMm5YbjZ6R1QxNk14eWIrZXVtS1ROMnBPTVhVSGkxNXB4bVp0alRaSC82akF2bE9SOTJyCllMN0hOQVd0U2Zvc3gybW4yTjFRZ25hbEFMKzNrMUpQU2xjaTlhOTFjald6bGVXc3BMTVNMeFQ3bVhhYTdwbENoeFUzQ21udDkrM0YKSW54aWFwcjJqU2xqUjlYT0xwYnQwVkpkNzVzR0pWL0wrc1RTVmNvOGxtbi9zUmtiK3QvbkpUMVNPQ21tT1Q2eFhPcmdDMlY2WXNVbgovMXpTM1QvcDU3TTE2UHRpYUQycU1xcUwyYmRXVk1KeW80UWJLYXJwd203RXNKVSttZHJzeTl2TkluMzZuNjVtbDFCOTlZNEw5cWpyCjJGWDY4OVZhbWdsZ3RaS2JnYURiaHRLNFFLZnZYNW55VnpOTGRQUFV5WEwwQlhrN0RVYXQwY2gxdkxnY2p6dlQyUG1DTkdQSzZmcXMKT3l0YnQ4NjRoZWJTRW0yZnA3T1ZlYm9JenhmbGU4dDBaakM4dEZMZnQzNVBsdWMwMkNBL2VRMi9ieDMvOVpmZFoyL3drb2c2YWovbgorby9LSStmNmowc2hNM1RvTzBvYm0ybCtxOGtic1drLzk0UEVVWFlTUnh3MG9CdlJnYWdCVGFJQ1FRbFNGUWhLMEV3TlNIV2dHeHAvClZBK3FUUTlLcGdkQkU3b1JMZWhJUGFqU2xMUk1WSVVDRjhjOXRlSmIzRUd1cjZJSnFTNEViU2lxTmtSOTZOYjBvU1Axb1VwOUNCb1IKT0ZlWVRDbTZwNFlMdFVnVkk2aEdsYW9SbEtPRnlsSGdVcnFuaG5SRERRazZFclNrSW5kRlZWR0VKbEdVRXRsaG9Hbm1qdXJTcmFoTApVSmlnTWtGcGd0cFVsa3pGQ2FwVElxZWFxVDdkbTJKOTFES0ozQWJKRGJKYm9meTJvbjdDVDZEODFMazRaRm9kaXk2bHFXUldxVUNoCkxGUGoxR2RTMXlCanVTVlZmNDhNZUJTUktBOU5neEMwWTZwbmpITW51ZXg0NUk0alRqdVpCT1dFdDExa2ErK1JJTTRsaHFleGlVZloKeCtkY3g2WXRhaG5OVk9QUDNpdzNtQnIzdGpEZlZ5ZjdJKzVLMnBXOTJTMmZsSFZYeXJRejVaV2RrYTlTVWRxWDY1TnlQQzFUczNsNQp1VDByNXovMzU4WG4yRFR1MVBmaFFva1hTN3BZekpKM1h2SWpaWDIwTkZ2dXREUHNGcHFiMzFlMjd5blgwODZjZkxrY24xakkzS2VkCjVmcDk1ZlpwWmJwQXZEU0lUeTdUbzE5OTVNLzVKdnF4RFpuaFptN3FaelNQaFpiRmlwb3ozYnhackxqMWM3Tml0dEhKVEtYKzQ3eWgKTHhzZkQrZXNyaUs3Sk85V1dyWFpMaE9OUmxyV1Z0ek1XMXZackZ5M2NyekFvK1JuT21OUWwxaFROOTFmNWtZREg1b2VZVUtQY1ovSAp1TTdBYVk2MDRUek9hOTdEWTNaTXhSakw5RjZlY29HVGZCOExtZDdQTjU3QU1rNVl3elJ5aVk5bURjTjZmNHd4UEpFTm5LLzh4OWZ4Cis4dGZhQjEva0ExMVowVVZrZTFHaloxMHdrTE9Tc3N5aWFTM0RyN1lvM0FDOWNmTzVwR0ZUemJUSzF0Rm9IVFA3QzE4czdLNXFITTIKVVJTRmc3Wk1sRS9kU3dzLzdSMDl0ZXFyVFpBdTZhL0ZEM3kyMXhTQTRiZkZBbExmTGJ5M0VDenB3WjNveEsyUXRPbklQUW8zdW0zdQozRm5FUDBpUzhPa3U4bmlRa0F2RjhrMUU5R3Y2ZDIrRVg5eVpsM2UrRHBQSThaSHlQTnk5Y1BpdTE0V1Mvalk0ZnVuNmxZTHBDRUV3CjBNQ1k2QWFHSXhnQ2VhRTd1RTdIalQ1aDlRcmZrQmRoYWQvVFB6dzNsdXZNMXRtc3M5Zk9WbzJqVG8yVmRoYnFyTE16emM0ck80L3MKdkhIa2lMZFQ0NE1qLyt0OGI4L3JSaFkzc3JXQm1VMERIOXV6cmhObWRVSHlPZWRIZzB4eldXNTVqTXVjaUIxam1kN0hOYjZYVFR4eApnLy9ZZFd5RzYzK2JSbEJ4T0VUNWF6M1UrV3FSNVhJbzZVb1dTRVRWMzB4Lzk5VlRxaDYvUFcveEtrdkZQQjlxdUJJOWNIMjB1ZE42CmFPc3FyR1ZiZ253Wm9OMUdSeW5uV3VNaWY1UWM3ZXNZOHJvZFVFRWJpVmRwemt1NzJTYzN4S2VaUlRQTnE5U2FaWkd2dUU2VWExRysKMmRhMjVIa2pkbHFZNHBMbGo0amZZV2dyWGMzQ1Z2cERmYWIyOU5uV1dSZ3Eyc3Boem9YWFZXSEUycGFvaUZYYmo4SlIwWmFNVzk1MgpiZVY1M29abit6enRmZndveG5KVlU5clFVczFsKzhTaFBHM3R3a3kxSjkrMksrSG5qMDNUZlNWcDVYamJJSTZPVkx3TVh2ekh0OC8vCjhPTHJuMDcrQjREOURiSjR0YTVCOWttTVk0cWxyQVF3eXVKaTkrSnJqUHh1MmRvVkI3OUM0eERzaW9OZFljdFVIbGlVOWVHVlB1SmkKN2JDblhvaHVXdGFybERDOVArTEcrK3MvcEp0Lzh4OS9sajdHdjNMaG9oMzgzM3ovdWJkZEo5cCtrODJmV1d4M3ViWU41WFowUE50bQpzUmdXU25ZRFNrS3lGd1REZVMwVUVZRDBPbEkwdUtkVlNFV0NsY0xBTmNXQU8rNFNBSHBoMzljOS81cld2dHRUWUtPQ0dOMGpwUFp0Ck5aTmpMNTROQUtvdVhVZHcwaXZjUUhINU1hemtwWi9IMGJDajhUcWJVWVpXUWtWT0VEdlIwQk9uaHNKaUtBckZVUT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJR0pLQ3BzSTdBMVBjWkhYcnZoOGVNcUJEbm9RTkdYMnpUUkFLQmgwWXdRTWRQbkNqMHM0QUlWaWFkTE01ak9CV3h3bGlyQ0VKSWIxVwpSeEZTWmxVTVlhV2NDdmtVMG1tV2ZvQkllaU9UYmFZWW1nMHdlRnZVUDQ1dU5keEZSMTdzZ0J0bU81eWIxL09HMWtFMUJ4WXoreTNtCk1RaG1DSDh5WU9aSmFCa0ZCSFR6dHpyY28yS2JETk4wMjNCTTE0WmVjbk40TnBpU3dwTm1Da1YzT3kvNkFCUnRVRkUxbjZvL1BEV3QKSWxPeldLbGRGR29ZbGRiZ2Erb1pSeG9XYmllS2xmZFVPTHJLb2VoUGpKdnFIYXA1ZE4yRDJvZmhRUlVSQ3YwREdzZzZVUW1wVkVKYwpEYm5kcVNJbnlvanBJaGg2UjQxU0gzR05aRHBSU1RBbk5nT1MzbENxdm10dzBraUZ4RUdsbzBaeVE0M2tEZ0xwWkFwSkdoU1NZc3JJCmtjcklMWlVSQlp4MlBXUVo5QkRvSUUwTG1Xamo2R3JJdVNLU1RSR2hLdEwwa0NOMUVXb2l5b2NNY0dmNDV3R2tTRS9oK2Q5MzdlODkKMWF6bWs4R281WVA1SXUrNlY5TC9Hbjgza1BVSXFsZUR2RUdzUTdQUXA0YXc3Ny9UN3ZkaTdOZmgyTG5oN3RYNEwxeHgyaUh2SFg5Zgo3Ri8xR3VpLzZzenQvMTd2ZkF5M0J0VTIvRDJCUDNBVUQxanRqdFJPNXNKWURhdTltaTlhUFIwZFZFOC95RFRncy91UzYwc3RFUkJ6CnVzdzRZd2lja2RYLy9qMW05QkdjK2dzZTh5Nll0M0owTVlUbWxoZ2RGT2NPMFhPZjZ1SmVqbE5IN1BtbjhmZnAzeU10ZThSQUR3MVoKSHNWdVBJN3NTTHUvMHpSOFdFNWNOcU1qNTdMUHVuL2ZQTmpUbWE5SCs2NjdsSHV2OWg3dWc5QTlNRHRrNnZFQ01yVVlLTFhEVVIySQphaEJVNWZUYzRXV1BuOGdicnJuUjYxWmZhTXpJNUNmSnRuemQ5UGN1MGV2bUVpMWtWdVlXblNnRmROL29MUjlPdHozZCtIenJhNXRmCjIvNThBeVJtbEp1Z2JJT1Q3WVBqVGpqdWhTTjJkSThlM2VOSEc0SjBVc0hIUEtTbkdOTEhVS1R2d1pGT0EzVHRvOEJyUWJueU9WcDgKS044UEdPK1diN09GVHcwbmZZNlVMczJvdmtkTEQzaHBLd05jZWpwRFROL3VFTk9QejhwcS9vTjFQemVuQVMwOVlxWG5ObEh2emE2awpiNmJ0SDl1YzFWbTdjYS9qM0oxcytxN2NDdnNrVGdZSlZGNnVybHlmMEhmV1hUZURyMThudDVUSlpuaXhXYjVTV2FDSW9xeVhIRnczCkN2VUw2N1MvNDlUbjVGY014Q1VuM1dsSXhHbTU3QW1NcDhiOXM2Q0ppOEVUZXp6L1dTREZkQjVOY1FMM3Z4eFVjUjVZWVhFQTA4WG8KaW5MaXNWMVAvTG1QQjFtazZkRTRpL0NlbGZQWXVwR1ZNMTFjUE1mQm1kVFh6N2lHaHBXMHM5NWRiU0prcGt6RkdlSTdyQjdDS0NwMAo2amtJczhxMGpZZ1dYVmVvMTNtTElaZWRHVU5xZHhQZjUycVBWcCs2cmx1Z2RyK0pJRnpOa0NJZm02VkdMVnpkWnJSZWlmeFUrOU44CmRBdThmMW1Tc0Q3WXBsSVIxbS9YaGxCRTdzY2I0aSs4YWwyRVp3NHZrVmU1TkhSRDVTYzNwRGF3T3FmRWZzeHBxelQ2eVQ1YlUwKzcKVUhBOWpHdmF1OWJNZHBYelBCcFJQcjJsRHpLbmZQZnExY05iV0ZUMER4ckJ6R28xU0g0dWtJMVMxUmhHV1Jwa3o3Rit4eFlFZStlaQp1NEtBSWRHNmVKMmJERjJhcE53akdUMFVkUlNGZTlncDFiMXBpRnFzRGFYWkEwb1YwYW40enNkMXpreXRrNEx3TkVqQ3FuSnVnMFI4CnRLM3N6alZQMFQySlhqSUFLTnVoOW9rTm5YcmlSTUJUSWZ4SkZWRlhSbysrUHhwdmNnK0ZDbnZSY05lbURHZHJOZWVKMmlxaFhMUkQKVkZOWnRkZ3U1Y0ZEdVczR3piUHNJS0tHSVowYVdEMjFrbHZwUDZXVjJzcDFLOGRlcHZWbUtOM2J2bmU1akRET3NDdHBLT3k3cVN5dAo1RjA1LzZrblpidFFycWR5ZlZadUhpbTM3eW5OYlRSZDlsbFR1Zi9Rd29rODFmZzV5bmtNYm8vQ0xTME85OWhYYWRqSGsxUXV5bU9QCkpzWlNuRXdkM2NXa2NKbmREL3BsZHcxdkZnZHpPMWhxRmw4ZnNNOU10aVp1NkIyY1c3QnV0bkRkU25QYnRVM25POXBpTUlFVHpZN1oKNWlZc01VZk94RnZNUUhjTFI4Nmo3aEsrcGt2WXhvOVl5VUJ0SU5FKzVyYVhTbU12YkM4UU9HaDNtYzN1a21sMVVSZncxaHpBdDJiOQpCUU9NRk9LNjFRWGkzdGJzTHZUOVR0L2ovdTBPNEcyd3Vkd3dLaGdHenp2REVUYmY3M1RpL0YwcEczZUVqVHVCVmVMdFVKb09vZW5nCkdZN1ZkT0lFWG5kUW1lME1LTE56Q0EvSW1JYUpVVzFrRDRKeHNld1U2M0tPY1RuSDA5MU1GMUF0RjlFc285eDZqbXJwWmJvZ0dWOUUKeUQwQklMZGNSdEk5aHFKN2I2R21Ic2FZWFkvVzlTaGRqOC90c2JuK0RGM3FONUYrRU5vcG91K2piM3NjczB2V1hZcnVnYlpOUUI0RQo0bHNGUmUwRGE3dVlleDVPMjFYREU3VncxQWVuQytyZ1pSUEZtU3A0b2dlYUpqaGRVQVgzeXVCZUhkd3JoTlZNb2FWdGRubHFhbUZYCkRWMDVqQzN0eGp5b2lQZURvbmpYRklNV0ZUejVqYS83ejlaS2JhWHZYWDBienEwc3ZVeW1WM2J0TWc0NlpoaDF6VUhqN0dYVXhEaWUKMDZERDNPeks4YXhjbjVSTFAzVWlPOTJYaXpzM1RUMlBseVlHVGYzUGs3SjhjT0VPTm0zcGM1UVBqOVorZjd3MlF5U25reGpKODVqdApmYVRrUG01N2pOdzI1OXpVREhhanNlN09wbWszMU8zTWRPcXJhOTQ2OTlkZCsvZ1dHeC90MEhnU3kzRFRQRlhiU1VSRDZyWTZzOWJkCmxkdUpLLzdJNmIrWkE2dFFPSFhYcFJydXV2Tnk3Nzdza1E2RnNtMmVMTnhCdlpoeEYvSndSMzYxRDN6WUtKU1VadURMSnA2M0dJZ0oKMWo3YSsrNXRrN3VsM2UvR09NVVlFcUZCRVNvT2VXaUVCa2VvV2tFM3hOU2lKTzVOLzFEdXFVenVTR3ZodFZrTVBYQmlESjFZVFpNdwpKU1dsaWJxUGg2U0dDN0Z4ajBYSGVaekZQaUoybTB6OTJnWUI5TEdnMkY2V1N3R3lIaVo3L25NZXgvWlkrTlFGSVB4MFJycjdtUEkrCmhCWEJLSFVIaXJqOHZRRXU4bHhGdVNQbVJnVGF6UUFUR2JhSDBLMFF6ZVp3Z3ZQNGlLcy94RHJ3VDY5ZlAzdjE4UFhoOTBZNmhKOU8KbDRnZDYzSWg0MDl1dXNhUTlTYzhIcmV1NGUvM0hyMCtHUXoxRklLNkQrTGZnMC9WQjZ6KzMrc2Q1bFRVaXFrQlRyZTllNnViT0pZegpKY2tmM0lQdSsrT2Z2c0J4MGpjd284VlRzeEc4QjBrNzlmZDUrZ01mN1lGN2pvQ3h0M2Y5UFZtSGg5M2pqcHJkWThrVExnTi8wOVM3CnZ5Y08ra0VTbEh5bTlDVFg5MU5QVC9LRFpsVDU4WUgxZ1FjYmQxcEtucEdJTmhhMU9rTVhMelREWHFuaDZjSWZGeG5pWjJoS3VLT20KM3lXbE5iMmpmUm9IbmVlTFBGVEkwblRlY2RGbzREQ3M1eHZDR3hLeEJ4dlhMVGhNSWhaZ282WHpUaGFvbWwwcWw2UkNtRFFWMnZYVQpFRXlSN0svUVZuZzdKRDl6QkpNRDZudnFzMkl3ZW9Mb0hhMHlOYmpLSHFwaVFKVWRjRDZieldRUG5COHRKM2ZiL2RUTUp3cGNpYWF2CkxHWkljU2o5YWtxUHEwRmR0L0FmVTU4bXM3VW8xdjdXZ0M1ajZRRWh1NUQxbml0eFg2YW0xZldTTHBibGtaTDNaVG9ockU4cTVmRXkKUGZwVi9iZ3lmVURsQzhyZmVabWVWdTNwNWNjR0wxUm9Vb0pMWVd2aklpcDdSVW9DWlpkck1SSmRWTGpwcXpHM0MxazFYVStheTZqSgpWOWpleCt5S2lRYmIxZUJ6RnNQVFFITWRNTmRDZDZhR2xmUEluWDNjVG1NNUFNbWRSZTRvVUc1dHhscmhQNVBOeEJ0enFONVpFTWRzCmNUekIxQk9IenVVV3orUEZiUS82Y3owWlovRis3WFlPdDM1MHcwaVBFdW1HbEhCYXBqRi8wTTRxazNiYzdyemtzMEplT0EyMm45TnkKd2NmeFNPazJwVHFOSDU1VXppdzgreko5WDRVUExVOXQ4TWsvMDlPci9xZHA4REVPQXAzaXp1RHBtVnJFdGZxR1dxNngxWlFHVDlJSwovbUVxMmdTaGhCN1QyREswUWplN2I3anF2TXZPcXE0ZWg5eU9icDZMSE1SNWlFTnRMMFQvWGVRaXprY0tzZ29xTTduZWNSSTFpSi95CmtzNVBvcGxjT2xmSlpvOHMwOEJZL0tmUDBUMWYyU0ZEVGdFd3ptR21NeWJ6R0xPSmo1UVRqak05a1FGOUh6dHFaWHJmbHg5UjNzdmoKUHFyODJPQmZvTUVQaVU1NThzLzdHdHpqaHRPWldhVHM3RGhtdzVtYVZXU1hPWEVNczZIZFJzMGdMaFc1ZTNzMTB4TUJJU29ZVFJaNwpVTGxPWUhlNmI5TFJRbHZ4Nk1xK3AzU1VMSUtra0dsQXhpZGFRckVRRTUzWGluUUFLNEhkVzEya3dBb2t1cTJ6Z1IzQVp0UWpCdGVwCnNxclVmTlpaZWRGa2JPakdRcGJnVzUzTmJhM0ZGN21QcGZNcmQwdDFNQnVWcDRrYVZOZVRSa1ZvMUc3MkNzbXAwRHI4S0lMNDlrSTUKejZhaW51RDV2U1ZPTi9ISlpYbEttWjVXN1daOWFwbWVYdlUvVFlOdTFybzlTejU3bERsYjdySXNPbVJqdmJYRVhTc1RkczFNMVhXawpqV3FsZlNwWWFxNmp6REs2dG1DVWdra0s5aWc0cytESVVpZVdnc3h2bVg1TG9lWFo4MjdSVTlYU0Q5ZmkwVlJUQTVFL0pmWHdhZkxoCmxuNjRZOGNuOHpLNWg4bTlTOGtnNUtFNWxXNEhJUG4xa0YycnU1SG9RcHJNZytUdW83M3J5QjFIM1duVVhVYWp3eWgxYjlFME9vdDIKanFKVE45R3BrK2dSLzlCMDRpQjZ6RDIwY3c2OXp6TTBQZVlZdXVRVWVvSWZpTEU1VHkwM1R5blQwNm85WW9tNlVLYW5WLzFQMCtDUApIT1JIRHZJakIvbmJYWjkvK3czK3lFRis1Q0EvY3BDLzNmWDV0OTlnOTNWZlBMbnU2VVM0eWt0Y2F0am91bDYyd29RcVdlWVlLS1ZrCmRYMkhHZEZURi83Z24rc0ZyL2xuYmRVYzZNZ3NFOUloaDZ0WmVOam9Sai81eHV2TFBlV0xOVndoYnYrUWxxczE5UHhPNzZteHY3NUkKcXptdU9GTTR4YTFjdVA2MFJydStsQXMrLzVIOGlXNy9lTm50SCtIMlQrNzJiOW5FN2s2Z3liY25FT1ZIQzNlczY5dXpjdk5oUlpzNQpoU0hqNTMwK2x6UHZrRVloZDZESmJIRHgyNFlUUHo5NnFaN0gyYmd4Y1R4R3JneWdzdkhreGZIVXhaUHlOOWRNVDJKejB6TDdkVHVYCnpRVWRpdjM0N01aV0sxeENRaGdXd3ZPNnRPTnk3SlNhZGk2UHAvRG9TV2Zxa0c3R2s4MThhb1dSa2FXMUtxY3BLZU1ZYk9FOTg4SmMKYVhVSmlYblI1cnhzYzd6d3gyWHN6K2RyVXFOTDh4d0RXeE5aU1p1Rml4eFF5em1zaTZFNkRjK1poSWZXaXV2NzQzemM5WHJ2ei9JcQpuNzF2UHBFRlhtU0E4Y094bzNlR1o3eHc0bEhEalJxTWNYTFk1ZmZoSnNzWmJ2SVMyUE1FcmFwN1AwN2JmRS9ybDkvaU1vaDA5ejZUCnY5TEhRQ2kvRjk0blBOWGpCVDUzVEFMdk1IbEV3dnRhL3dCNDRyNzlGdkd3NXlwMWdPbnRlTVBwRno4NHlpOWRtdXRwTjljTlp4WlAKTXI2T1NaWjBTN2hyYVY1N2t0YzhISSttR2M2T0U3TmtNNlJ2Q09mcnFWelhsc0wxMnVMMGRON1NQYVh4eHBFcVhxYTZWd3pLczlGWgpkYlJnNGp0enlYZFlUeHJpaE9IQXF0T3F3Y0F3NFNQbTk4N2llNVBoQ1RNZFdXTWNwbWRJd3l4djJWMU84N3VNR1Y0aW5lOHpYZktlCjVXWE04eklFa0V5UFJaQzBzekU4Z0tSNkFNbm5ndE5lWG0xUGg5T2V6TzBQelpXd1h3QWZjelgzSXJsdW5wSDlJSVdRbU5CUnJ4UnUKdGRaMXpKazUzTzVETHZxMGRWWXZMclM2U3c3Wk1xQjVEclF4RzdQRFJVMnE0dUNmWlg1MitHb0hjalFJcTE1dzExQ3Y4d0FONlpmNgp4ZkxEQzNaNUJHL01FNXk0Z0k3bSswMjJVdlFPajV4RGVUbDcwRi9pZ2k2Nm9oL0cyTWpUYkRtWDh1V0VDL2x5TEZmTzFBTE1YS1B3CkVFY1BhOVFkYTFmbEF4THFXRURqN1k3VENLK1o3TGdkanpMMFdMWFlZOVgwdnYwZStlS2Q0bnRTOTdTN2RjNDJuY1RGUlp0QWMyTncKT2o2MEpFWmhEWGM4WkdqajZVTHBHS1FQYjVrM2M1V25pSEpQbkI2MDBXeVlwSWs3Sm4vTXdnSm4yZ2MzbVZSWkpsZVllUFRQVVdaYwpFZmFkWkduZU04cnRta2Y2WURMb0FaR1hKYXNubks3NS9jRWhsaFArTkNQODhwL3d2bTA1RGFrY1cxNzVob3QzL05aajdHelAwQWg0Cm4zWnBCanEyZllTdmorRDBFV1BlY04zSzVOSU9kSHNoWC81NytPWXA1MFFXcTQ3OUg0RC9sNkgvYTN2VnNvT2RLZz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJVUhISW5abDNHUno2OHozR29FOVpkTVA5NmhDTVdMd091K3Z3dXZNUWhRN05aU2JaUElLRVRuTEtFaDMweUU2UXovWUNRSC91Sm1KKwpNckUrTjhUNEpPSjZBT2U1STRSbklXQUhJQjFnY2hKeE54dmhOSURKQU4raVR6YWVmZnhwUngvclVhdlRwNXkxNmljUy8vaGtIL1ZrCmc1aTR5dFNQVlBERHZGSEJYK2Q1Z2NSM0pjc2paUVpIYVI2cjh6OTZucThxa3R1UXkvOHpONnVDNVRKSDVnVFBhd2pNUUNiZEoxMUwKcWJHbzhTUWgxWHU4OEVkcmNvMVhtNmpRdzVOKzFtYlZIUE5wOW5Gdk1seGg4LzFzWnZlVFpyVlBaeVFleFRzTFYrR0w1VENuamFNegpyMVZmbnNuOUwveHhVWkQvVEExK2twQy9YSkx4bDUzZG5HbVRrTDJuV3BMMmV5Wm9kK2FJOU96M2xwZ0g3Rm1USU9zZWVXZWJZaklsCkhOdmVOcG4rZmR2MDczRGpCNU12N1hnVnp5L2VEbFlaejFVWkRxV1NoVHp0VDZNNk9ZaHFmd2pWaUFQZkgwQTFIRVUxcGhwOC81bDUKVHl2MzA0Y2RhZlQ5NWEvZm9OcmxOQlh2UHY0Sk5qZFkydlNjZEpYeVhNSTd0a1JXaVZuaENwTWkzOWdHem1oczNjRWh6MW5TcXBaUApmTEhzYkc0NHVlRXVjVzlJMzBpVHlkTFNxUkh2T3pWemlhWkFtaTF0VmFUQkJJNXdUN3hXTGNkWmoxanFnTnJCWFhLU2pPejByRy9tCnU3cGM4c1d5VEhXNVdOYVBMZFBIWC9xWkd0U3AwYk91ZVNvNlQ3V3Y1MjE2WXNOaS8yOEQzVk0xdzhDYlBNdHpwTHRqVE1vOC9vdmYKWTVMcmVVaDNQUUxabjRSMy82aWZIeHQ4d2dWMkNNWXNxL0ZHQkhtY2hvdHpjR2VlZm52a3FiY1E5Q0tGUEloNEVQQWczaTA4em5ibQpRYmFRN0VhNWpvaVZ4OFM2UWJCcm90MnRJUyt1TFl1OG56M3J4MFdrYVRqRTIxUGo5NHo2NHltejQ0bmIyOW1VYnhraDkrZlZ2LzlVCitpY2RXdjE5eDh2LzhHUDUyUnRVVTh5Tm5RT2RhWklad1YzVjBoNW8wb09XOGVEOWg1cE03UUNQZFc5MDJsbTRqME9DSkxkd2U1S2sKMGNnZDZqeVpwZnZlOHVuZG1yMzd4bXpleHhiNzZSdEpUNWpaZjRhTW45TkozczNscktSSFNyeGNwa2UrQ0I5YnBvKy85RE0xcUZpSAo3aE1ZdlFMdUZ3aG5DQWpIUDR3SGovZmNlQ0kzeGwxYXZKNGsvU2taOGZZNThaajV5ME5YVWl0ajlNc2UrWFVTU0hQeHNNeTc2YkdvCm5EUHN5dFBLemZUOUlKY1BLMy85QmtjRDMxOWRLdjRoR255dmJqRTk4c1hsUXdmT3M2ZVBXZFNwRlUwWGp5Qll6N0pMN2pOTWhyT0YKNU12b09Oa2EybXp0ck9hTlczYkhHZGtCRnhkUzNJUVRiczhrLzJEM2lSYjVld1B6cWswK3lXNStMNDk5SkNkZmhYZkhxdnZLWDEwcQovcFFHTDZzSXl5TTZoV2tjMDVrS2NxYXNuR1JVSG1GaFhmdHBHdEhVMGtENzNxVlpwSFYzVVhsSGM4M2VHQmo2U0Myc1dDTEFoYUplCnBLQUZoTUx0UktudnhwTCtGUU5DTThXZlpmYURpVStCenpEd3didzNFOTE4STFxanluOXExVlBoN3pnMXVZOFNuOGw1a084ZzFVR00KZy9CMlRWMERjbGo2aTBmUy90amcyYzllUDdOQTQ2bDk4TE4zNG9uQ3QxY0VIUlNVMmxFK2UwMXptd1pWczU2b21tV25wRm94VmVVVApPK2JzNXkvUzRQdFZnOGVPSzdReVhUd1M2dlJNcDFHZGFWck9XUzlTSzVvTXVUa2VYbkF6NERidkcyQXJ0R1I2eVE0Rlc0ZVVlcFlEClVKUHF1UmR4OUNPK3o1TjRudEN3cHpQa1FRSmI4eHJ0ODNqZE1OTk9wR1VKU2ZsNURxR2VZdm5YbG9vL3BjRkhkSWRIaW1rYzA1a0sKY3E2czdKV1pRYys1ZEpEQTFNOE5zSEswckNMOWVJQzdJYi9JM0hLTXZDZkx5R1BlMDlGMzZtZU5iK1l4N1FmN1JUdGNYQS8wdTU1MgpwdXhvaHV4S3Y5OE43ZGVCbnI4c0R3eDd0VUpLL3VwUzhRL1I0SHQxaSttUkx4NVhZTzR1NlR4ZEk1cUdMUHk5akFwVlY3TThKMERYCnhWWnpJNVNlcG44eUphNGYxMzQwUmU4OFkvOTRZbnNIK2EzbVNqRG53ZVJZdjdQemNmVWs5blYzTnU3TjNlMEo2cXdJUndJK1ROZ1cKVHU1dHVERjM4VUhEejlsY1BhVmU0YURmUTFtdVFpNkRVKzdUbXFGcks4OXhJNDU2RG5IbGNUekNNMFBXM0k1TDJtSWdtaG40NnRHWApGOUpoS1ZmQ2x2dkRmSEpMZXZyUkI3MVNMWWU0WEpYZGMzeDBDNS9rVE11WG5HbDVoMHk5aUhzNTNhK2VuQXgyV1U0Uk1LY1ltRENjCnc0cjhUME9XV3o4bzBrOGc4bi83QVlmNzR5RzdpSlZPUDA4NzBXQTgyZkZVU0lEQUpjSldPN2ZYTVp3ZkR1RTBkZkVrSCtwMDNCOTUKM0pPcFAyWWZKQ0oxUEwvaGZqaG83ZndBaDIwNEpHMS9oTVBTam5DSTA2T25PSFFOL0hvd1QwSFlEUHU4clpFbmlNMnhsdUtuWnEyegpMS0RJdUFJZUdCOGV6ZFQ2NFJmck9WdXlKT2gybGpteHhHSlhWbzlaMkJUSGVobVcraEhYZnRwYXV3Z0R6ei9pd0gvRWdmK0lBLytzCk9QQjF1N1RTaEhvV1hSU2VFRjMwZUc1NjArZytzMG1tN1RSUG5HMVBTT0h0azdjZkYzUnI1Nno2a1VIOTBLRGFEZzFhaDhPTCtvR2gKT0JucGhQZC9NQ2ZkemNLUHVsclBTemc3UzJFMzRSNzcvcFBtVnJrb01wWDh2c2kxUjZPKzNuUHl3UTUzZkRta3JNc3U2NldwT3pUdgpGb3E4QzFoN05FNnROMWhQWXRST1R3NDRlOXJMNFdtUFQ5N0htZVZ1Q2ovT2ZaL0tmOSt6S3A3RzBwK1VKLy8weE5ZZ214SzFDNW16CkVOWkJtZGR0c3lsdWJMYk45ZE16UlUvV3lTZTM5YmtqM2Y3bER5L2VQZnpYdy9IbHMrZi9JY3RpOS9FdmNRckl1ZG5zSTg4Qm1jNFMKem5xNmFrODNPNmFhdlczSENlNXpWWHVPMlJ1Z3J1NHN2V3djOE9oN3JQemo2ZkhINVBqSGpvLy9GUGovelpEeG52ai82ZU1EQUt5MApGSkNlcVBIVTdISmlOZmtoejFjNXM2eCs5QWtyazZxcGo4d1V6OTJaN1NoS25TdzlQN0dMd0QxSHNZaStHME1BWFBpOXN3TlBuNURuCi9DUS9zVmtOMzJjeGZGcTh4ZmxoQ3g4YmNiRlBMZEFQV3poTklYRjdJVW5CazZiQ1I1eGNNMyt1czJ1bUN4TmhGNnBELzk4NEVjWXoKU1gwYURNbXEzemNWdmk5aDlUNWR0Wm1ScC9wcEFTNm5rK0oyK3ZnUWwyR0tEQk5sZXVSWWpuMDZpczhuUFpzTS9aZHI4SkpuNnRMQgoyR1hQM2FZTHpPMkNmbkV4OC9BKzc3QUZGRTJmR0ZGVU5LYW9oeFJOSHg5VFpKNkZveG9mYUhaSXQ4c2thMk9mZHVUdVF1S1JIK3JvCm9vOHgxVjA4dkdqNkVHTmR3L0k1a3M4VHQ5MzIxRzJUbVNXWXZhMGxiN3Q5VXZxMmZmSTJpMGFhUGkwY1NhTjZEYlhLZUtUcDR3T1MKaUZnRm5tRTFwQ3BBcXJLYzdrL1N3NVFMR1dSK25Bby9Ub1VmcDhLUFUrR3h0RkVma0ZUcExEL1VoMS83UTVtY2hQRFZQN3g1L2VYYgpGNi9mdlhqOSt5KytHSFR0OFl2cEg3N0JOMG0vK2ZMWnUzY1BiMStMRW43OThzL2ZmdnRNMUcvNzQ3QnRWOXVhRm5oT2wzVk5oN2dzClY3S055eDlodlpLNXRQSkpyL252di81SmZuM0hQOTNuK0s5LzVzZi9JWC8rYnlIK1NWNys4S3ZEdi8yditmQzFYdkpyK2VYMzhDWVAKcjRSNGRxUERMMGVxUDg4dmgrc3YwWFpYdjViL2YzYjk5dDN0aStmdlhyeDUvZXp0bnc4L3A4bmlaOGMzYjE3SzIvL0NldUtydTY5Zgp2SHZ6OXF2anMrZi9JYjMxMVc5ZnZIejQ2dGNQejkvOTlQQmY1WUwvVS82M1YvMHYzN0dCVzc3TlAzSTZSQndWcURiSUVETW54aUlUCm9sclNQenRBdGZwWmdjdFc1N1FkL3ZVWkc5cDFYQXJoYWs2cmpIdTlTaUxaYThmSXEwVVJ1QTU1dTFwRnBEcklpcitTcHZJaEZ4elcKS3U5Y3BYcU42WkR6VlpDMWRYaU95MnEra3NWYkR6bGVyUWdCRmNuL2FwRlZkVmkyS3hINmNYYnNlaFZrQVI2V2RDVnJMZHBsMjlVcwpYT0dRNU12Q3hvdmVMZGFySEdIUXIvTlYzamFab3VVcXdmakt5OHB5SlNxSTFGb1JtQ3QzVytVdTg3SWVVdFJuQWlIbHVoMlN2SVpJCnQzcVpFRU9vNVNERFhJT00vVnF1SUcvQ1A3NGhTbFMwSUJuT1hFQ0lxZHFycmZNVmxKTERzbDdoN0o5RGxLNEpzaFlQUzdoS290OGMKV28yVXJ4YS9LRnlKb0xxMng0NXJScTQwVFptRzVHVHJlcldFYlRtRUxFTXFnNkJYclZkYlNPc0JOd2gxNHdOSmk5SldYWEFlYms1WAp4Z1NFeWZoRjhqYnNzaS9DbGJBb2RIV3FWM091NGJCSUh3cjdFNEk4QmVaRElEdkplcDMwT1NDZWgxRHNOUlpoS1J1ZVdVWWNuU3VmCkY0VERZcnczRzdDRW1TLzlLYS9LMFVRclhCWnl6N3pLZTZaRngydkpWL0trTmw0cFhNbmZNb2RXNmRjZzd5V1hWMUVuRHVzaTQ1YmwKbGt1VW0waTdxOXhNaGxZdmt5a1hwT01PWlVXMGRtVW5DbmRlY0puc1NFS1FSWmx5a0haV21XV2h0RWtscTJSRlc0ajZQYVJaWG1pVApjYStMakxNTWsweDh6bUNaa3NMdmRjVGtzYTdXV2ZwY1ppQ2NUREtWY0RONXN5cFhaNWxUU1dZYnAzU0pPdXQ0bVF5d0tEYVJrZGRGCk9pQ2g5K1JlOHV4elR2Rnd0c3B3MWI5elFkOXl5Q3RUMmFFKzE4bXJrU2dUQy9rSU9WczJCRjNMdE1JYlJIYkEzRDdyNUpISGtxMjYKMTVHVkkwcmQwSWdSL0ZZK3U1VW9jM2RiVWN1YWtibkdGMnYzY2tLYnFYaWdYc3ZmbzdWejhtTCszaW1nSTJSWVNwSTFML1BxMVk2NAo2THhLTWl0bFA5NUFrTzFWT0lTdzJpeWoyQWc2YURMTGdxeU1YbXZSdS9aMm5HQjMwOHVjR0s5RVk1VkJhKzJFcTBWR2Y3aWJFZlF5CmY2Wld5NSs2dFhQeWJ2N1MvK1dmNUo5L2V2SUc4WXR2di9yVk05bFRiOTU4OCtldjN2dzdONHkvZi92bXUyOTBoN2g4eGE4ZnZubDQKOXU3aDY2L2tGcnVkWkR2ODVLZUhmLzJYQzN1S1RJeTh6c1FVQ1YvWjZQR2NTNUdld1c0aXJLakVQTzRtUmMvbDF0MWtxVmRseTdJeApZc0VzT25NN0Via0o0Q3FWQ1NKNnYweGxtU2hWZUt6MHN0WkFRbHdSOXRoRlFkaEtCRkVtaTE0bXF4RlJCNGVTdGZGRzJLd0dMM05pCm1EZTdMbUtYbHAwNWhOVW93dnZXdUEwVVhybllEdDdyeWNUVmVuUFZCMnVVcmVvbXp3dWRLRXlHODd5OWNRWEQydzVuM2JKZjcyRkIKZndnVHFWRzZWYmpLcXgxUjVBOXdyQ0RzY0JHaDF6bFd3RllqbzJJZjlRMlF2M2p0VmRDRlNYYWwxa1lqMkoxYVI1TVlaREFyN3VUTgp6THBNMjYzbXZtejc0N1JLL3NDdG1aUFgyazM4M1pSTGFhNExrR3F6N0E5MERzMjVoTlV5SGMvTTZWblZ6eTUvYkl2czJEcmhvdXlkCjdORzh3QUdibFZWaTVRSjBsNE9JRmNKdjR5emY1aXdNR1ZNSzIvVXNlNDNzQjNqV09SaXZuSVU3cjdLU3VWV0FXd1ZoMzlqc3RrVzIKMWlxYm42emtUVGFmd3lhN2dFZ1NlaGwyQUhtNVRaaURNUDREOXpYWmZUWVJla1M3a00vQ0I0S0lNYktIYkZ1MDdVaUlKVmZkUjRUcgpIQ0prRzlHWTBKc2l6SUVnMWF1SUc4STE1clRZWlVKYzVJME9zdWZCOXNtYnJWVkVCOWxFNndLSjZMUS9UbllXTEE3c3JYTGZQTXY5ClgrMkllRi9zeFBLZWVVbWNScGcxVVhoY1FKZmI1K2ZleDZYR1hrZjJlT1FvNlkwNHdXNmxWemxSUmxpMHYwTnJwcUJybDdYZnl3bDYKbVQxUXIrV1AzTm81ZWJIZFhBdUg2MjgrbWJVRlNJK3laVUx3a0wxZkYya2paaGtsR1Z4NThxdFFaYTdJc0ZYTVlQQVNVVlJySXlpUApFc2xZNXNCUVMzcHhGY21vdCtNRXU1dGU1c1J5QlFYODBOc1JrVG5MOFBlN0dVRXY4MmRxdGZ5cFd6c243OVo2VDNVcjl0NG5yOVVnClV5VkQzc1dVRWE3SURvU09nRTEzbGJFUmVUTUlLeGZobFk4V1NzUktGVFlqUTRTbHUyRmg2SHlRU1FaR0s0dzNZNWFMNUhzVnNaNWsKK3ErekxJeFE0VUplWXlPd0l5RHJ6MnV2Skt1R2ZEc2w1L2RHRUkxbDRPNUdGT0ZsWFdYMUJ3aVc1T2FMWFNiU1VDM1lGSVR0T25zUAowQnVLek5sQVhzUFdSWW9xM0hXeUNyU2RFbVg2TG41bG80cEVEQ01JZDUwTjR3S1dDbmZJQWExdklsWjJDcStVSFhhck12eTluanhqCnljdkNMWS9xeTBBUmpXRUwyYTUwS2htSWFGL29yTVRueDVyTkFUckJDaTgrbmovb0lQRktXWEdKYzFqMnlCWHlqUT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJak8xVldyRGJ5R3ljWlorUVVmVjlOSlRlUTNHV01STEd5dWxIaFV3K3lBVTFzRjdCcXA2dEorYXRiNXdjZll4am1JRytBcGg0aGxKUQpPQUJsa1hVZFpIdEcyQnk0Y0oyRExSLzVzS3p5Z0tLOUpqQi8yYVNrdTRUamI3UGUvM1NHbm16VDBCMDRTUU51VTB5NjZWU0loL0xXCkt6aFlVVjVBMWgyRVhTTUhTNmY0QkZuQTRZZDZVVjUvRFVOVGpXQjMxQXNiVlRvaUNUOFltaElwZEpWbE05elNLSHBsZTdSV3J6MTkKYSt2MExiMFhSRFBWM3NHTW5uTlVLUjFqV3pPWWlGTkZEeGJCZXdaRnhuL0xPMHBSTFV2SG8xR3hzbW8rREczSmVnZ1lrWDVQbytpVgo2U29LS3gvcnlTNEwrTlhRVnFQczd0bW83ZGxhVyszNVQ5K3o5WUNzRXZhTktMTFVURi90aUVEVVo2eXdwTDI4VkZYQ2crZ0dDYlBRCkNjNk1rSFdtMTFxckRtdHJweEhzYnM5dHVpa3h5UlNCbU52YWlmWkM3VzVHMFBYdHo5UnErVk43TzZmdjlyaTA5aW5tSnVpSXM1QkgKK3hMWUd4UXROeTlCSGNpQVdMcDVLU3dpZ1ltV3RUTXZRU2lWdlc5cjVpVlZHSVFMdUhrSkl1bzhMOHZPdklTMk5naHNibDRDcitUZAozTHdVYUw0UVBqR2FsOGd0d2ZQY3ZDUnZmZ1h6ZFRNdmdSRGozcm9VNHFKU25GbVh3RjFsZXcvTnVrVFdKMHJIenJwRXZpbkNZN011ClljT1FUbHVhZGFuVjZOWWxzTXhscWYycFF4UlJhS3RyTXkrRktITi8yeG1YUUNwVk9MUWJsNW9rNE9ZbHJMQ2E2cll6TDRIeDVpUjgKdXBtWFpCRnRFVlkwc3k1aFVjbnVzVE11eWRMTE0zck9iRXV5L0dYZVJqY3R5Y2UwMENqWVRVdmdCd2tIcEpobFNacElhZDNjc0NSOApXd2FxN094S0ltWXpNNTZibFRaS3lLVlpsV1Jud0p3ZGJVcmtmVnNKemFhRXJvTVE2U1lsdWZjVlhBQTdrMUtRdTNKSnVVa3B5SFROCkFDSzc5aVhjbHJOMk5Da0ZLSytsVzVTd2ZjNTFYWnBGS2RTb3MzaTBLR0dub2xqckZpVzVyMnpLOHNodVVqcGJXQ2Q3RitOdHdySXoKS1RXaVc0TXdIV29XR2RqTVJTRXk5V0FlVFVyWXJTS0VPNjhUWUxTRXVjMGJjY0pvNU9sRU13VzFadHhZMU80MW1wVGFBL1ZhL2g3ZQp6dW1MamJ4YTVLRmxaMUxxUkRNRmdTK21MVGRia2NpY0NKdmFkaFlsY0ZTRSt3eTFacjFwYjhZSmc0Mm5FODBTMU5zeFcxRy8yMkJSCmFvL1VLdmt6dDJaTzN1eHYzYUQwOGRxOUxQQll5WVhNT1BkcXBNcFNwb0d1dVJGazR3YW9WQWhCcHd2WVVNNW1PWVpLc1VScTVtbWIKNFQyUWpoWkpFWmZsWk9aSmJzVlNRN1lOZHhDWS9SL0duU3lNcEpueFJjWGdXaFIySWs4ZFF5T29CUjRDZXVtVllGa3ZJc0xYYW40RgpKMnlidHQvczd5QmlOY3dySGxJMk0rRTRHMVVFQ2lNd3hzWjFJT2pMVmRFMnVJUzlXdXU3WUNicTg5NDhNUTZVV2UyYjJBUkVDRkk3ClZLY0tVeFFaZmxFckxqMEhNWnB6QUh4eHphRlR0T2ZnaEVqcldDK3FwMkJveXlsK1R6ZGJHN1dZUzY2MUJkMkpvOWZ1NlJTOTBwK3QKMWV0djVXMmR2ZWNQSXVvMEl6L2szSFhkbHIwdkRTb0tPWGR6cHFHZWFQT2xlOU1nbSthOHVsL00zR215VTRzSWlDdmRueWJhdmV6RAo5TERaU3NDMkl2SjkzbnZVS09NbDNxRzQwTG5xM0cwK05XZ09JaGI1bWpHbkdsVGN0V0FTdVZjTjNJM1AxdHhxMkpPNmhjdjlhdGk2CkFxWjA4NnlKdkNDRG4zSjNyY0VLSUpQZGg5QThaOURHUkJ3czNia202MEJ1empYb2RXQkJXVXk0Ynl1enZZTjcyS2d5eWExR0YxdFMKMTg3T3gwYkpNeSt4T2RuZzJscmt6czNMRmloNkxIc3ZHNVZycUNITnl3YlJVM2FqT0xqWkZuU0lTUUhkenliN21MNlJPOW9DOWxFWgpyZVpxbzdraEIzZlFtYThOTDY0K0ZYZTJRVDNmSXVhM3U5dlFnZlBpN00vOWJWUnZOcnlqTzl6aW5DQmVidDNqSmt4VUpCL2JrSnJMCkxkSkZVa1AzdWZGS3ZHOXp1c0d5Mm1hUE85M1FYQzF4N1Y0MzJDbXBwRFMvbTJ4dElxaVpnYWM1M21LRVJpZzdaUE84UlhER1FLZWEKODdVdzY5emMrZDVnRXFLWTZjNDNLSmVMOVBmaGZHRSs0bjdEOTF4V3IvYlVLaHR6M0xvRERvWU12a3h6aXpYS3pnazMxRE1IMjlCVwpvOWc5ZDQ0NE1JS2E2ZnkxdHFESTBzRGI3dGtvTzEvY1VLODlmMnZyOUQzUDNIRlJ1aXBMcCszOWNUREFjTzQxNTFjTXN0R1cwRjFrClR0ZzU1SG90MjMrR2hockZicmh6eVdHRU00VGszaFRVa2hDSEd4cGg1NVBydGRxVHQ0Wk8zL0QvdDBKVVNFSE5sU0hCS0dqVEdic2gKOVRwOExkb2hkdFlaUmpxbzM5S24wR1JwYnlaRnVCOHBybWlxZzIxRnZBNGxFV0hvQzJ3dXdpbDBMc3F0MU9EbkZOV1lrbnIwZWoyNAozQ2pHZzZQa0RRelJlRmJJWUwxK3BXZzFkcVZzU0x5blhEa25tRzFnSk1WK2RQYWFKeHBRZ2o0RkcxbWUrM1k4VUlOdU5tZ0hGbWxZClliZEE1ZzRmQTh5VVRsSE5SQlpQbXRlaG5uQ2VDald2TjlVcGMyYzBuU3F2b050M2Eyc1JkaERETXR6VEtjOXRKUGxvdlpvL2ZXdnEKN0MwZmwyMCtoNThYL2h2T2daMmpGM1pjSFYvMzlNS01QOE9EMDF5OVFRUWgyQXIydmw1YWlubWx1M0hCTkhTV05Vckt3NXhxMU1YbgpsTHQ3WTNiTzZPN2VSdG01ZTNzOTkrTkdyb0EwVWxMcGs2cFRNWlI1ZFBCaUY1dXpqZEcraHg3eCtVYUl3c2pwLzJwUGhROGdydDNyCjIzWk1kOFkyd3M3ejI2dTVWN2MzMVNsMnk1MzNseHNyRmZqV0Z1UmpXdGI4bGs3WU9ZQ0hhdTNwVzFPbmIva0QrSURCcjRRdjFMMlcKMktpdUpUWnJvR3VKbUJZMHFveGFJcmlIaVBxeGFZbFFxRUlWSnVoYUlpd090QmVPV21LejQ3bVcyTXh4cmdEQ0RGM1dXSFphSW5TLwplVkFsWVNKYlpESzdrdWlmUngzUmFVMUZoSmw2aFgrdjZYNzArS1Z0M2V1SXNHS1ZCYy9XNnJXZWN4M3h2QzlQN1VpcldpeDJPbUtuCnVsNUhzd3htVmRQOThNZWFjdG5yaUxUNnBDVU85VUpWbTE5dnExRkdmVzJnbWw3WDIzTGRyOTl6MUJIN3MvVjY3YTFhVzZmdmVkbWgKL0NtbThDVWJMQVdHWnpoOVgrMnB4WlNlWlhFbjRhb2FCRmJWREptbFVkd2VUZ3ZuVUE4N09seHp2YTFHc1hzNjh6RHFabGFFMXBacwpSTUxGMXVHZVRuRmp1cmtxVzczMi9LMnQwL2Y4UWJ6TEVldVU3bG5aQ0NqZVUyb1h0V0VyaEJoRkZSeGlvaVc3ME15ZmtDb0pYTHdVCkd2NEIzZGdjMXlHVGc3NG9HTlJqVUxhcElvZDBzR2hKa1dDRkxVWjlXZHJtSE9RUTRYekVacXkyR01JZXNPQ2djbUVxUURMVkxvZkcKMkd4TndLbHNVUkU0OHJLSnV2NmFpbDVadG5XaGQ1V0dYdlNyZEpiTmFhajRDVzhsKzc3cTNmQjBWVkxnaUlZT3Z4VzFHMEtJRXYzUQp0RHRSNFdUVENIUitLNEIycHZ6SHpVOEJ1Q0ttdzl3T0tTeTRnaEhBVm1HdkZxV2JMNENkcDlMbHVHSVJWY1Y5cmh0VTJES3JmcXhhCnN6UnJHbXlBd2hjelR5YUhaNHNXY05qVFJPcE1ORHFrNUpwdnB1MS80V05WSGNsRk1RSVVDbFdIUEowREo1cGRYQlUvZ2l1V3NoaTgKdVZQZGJJQlpRME92OUVrQnNKN2FxYnJpamFKekpDa2VaNmdubTJLb2VXeXJVZXllZW1XakpvTy85cmFpYnBYRFBXUGZQSWRuYS9YYQo4N2UyVHQvekI1RUNZM1pBd0Z5NkZOaW84S3BUR1Y2Q3dlTjhDV0tZU01oWGN6UVhCeVpVWFdGbmhTMWxVUnk5eW9Telh3ZDFrZjVBClVkcWFOQVpoczFEN2dDaW81Z2JYUHFDR3VHNGNYVG5vRWlCOEw1aW92VjdaSENxNDZSMDRLeFc2c0kwU1lEbWhnaE5xWDhpc1ZIbTEKVVdUWk5BbXdVMHR5R1pPK00vaWRrVnNtY3RvckRyR09Jbkl4R0FxTWZmcXdxeitzL0tHM3JMTzlwbE9jTjVRZFZlMkYyQ0ZnTHd5MAp3SGxiMjZBOWdmdndZU0crNjJ0dU5paUFYT2lnekI0RElHd2orVDA1ditlbHFqMUlybEsrcXlKK3RQVUxOcHBpcG9tUUJrMi9VdGxJCkVjMGNGclE1V25lczJhMHIyYlhCMlBWUzJxd1dDQVR3OE5MRUhseHJCRHVsUVFES3JzNkQ4V0VYUXdOU2g2UTFyczNzYUZQMGZLNmYKc0JaTVNRRFo4REkwbmIzYVUyVnJxWXVhUE5hbDZsZ3RzRGxpYzlDdWQ0b3VCK25vQXQ3WjZ4WDFwUTV0TlVvYXpIV2RtbkhVVlRnTQpiY0VxQkl4OHY2ZFI5TXIyYksxZWUvN1cxdWw3Tm9lYlRGdDZ0ekRmdVZXOTJsTTNOV01DckVLM0dPd0htWjZNRldoSTRsMk1va2lICm9OaWRvWjZzMTVoM2JUV0szZE92TkdveEMxZHJDLzVTbURyN1BaMmlWL3F6OVhydCtWdGJwKy9aZWtBR1pzdllja1g1SXl6eDFZNksKcmJuUVhEKzd2UVFqeWIyd0VnSFJDTDdpWjdyL2U3VUZ5ZWJTMEZTaitDMzF5a2FGK0VPZm9iY0ZLRVVKL1k3MldSbUZQNWRYNmkvawo3Wnk5b3I4ODdLMlZxQytndXBNNVhBZnFBdWxYb1hvaVRLcWpnWkkxektLeHB0SXB5bnRnMG9DSjNLa0VkZkd4dksyQll2ZlVLeHMxCm1tRFgyNElmQUs2SGZrK2pQTGVudFdkcjlkcnpXMXZuNzlsNklNRzlHeFhQSklxTCtjOGFGZlkxQ09IZ2hETm1uaXczaW1vQS82WjUKQzUzeTNNUVN1dmlIZW9CQndEdlltbW9VdjZXTENFWTFxMFZ2UzFnbjBKVDlsa1pRRjRFOW1GZnFMK1R0bkwzaUQ2RFBOd3d6ZGdwNgp2SGFnYm14VkszT0pPcW9iVzlDYTRTaHlXRGRNRXFtNi9kMkIzUkQwMWF2Z3lHN2dzRFBzYkEzYUhVVVV5RnNOYlFnQUZZS2tDZG5JCnNkM29LSFZvT3JnYk5WTjJINDJCdTJrR1dkYWxvN3NwNUFCMjB1RGQ0S2RwTzRGMzQ4MElXR3I0YnRqRjdFYW5uWE82RHhrUUduOVEKLzlwQnZLSERKRlZkREZMTm5Sclkwb2E4YnBUbjN1M2c5ME05dzNBUGJUbkY3K2xxa0ZHcjltSnJTdTVFSDJpL3BWTmNFdFJINi9YYQpTM2xUcDI5NVdUMy9ISGh2ZXIyaW96MDdWVkVhRFZ5Tk9TV1RaK3NZN0VaUmM0VkJ0WWQ2aHVidVRUV0MzVkV2YkZUWnhWZkNhbHRUCnhlekEvWlpsTUJmM1IydjEydE8zdGs3ZnNuRXptRzdoN0lQYUxwekNzQmVOS2dKVW5nTWlBa1hJS21ycEMrWkRuR2NQL3dpMnNjSm0KVzVaMUhlcWwyWUNhcmFWRzhUczZVMUlxVEd4QWVmVzJNS0dXYmJ5blUxU3MweWRydGRxenQ1Yk8zdkVITVUwMFdESFdFS0hVSS9TZApzaGhOaG81OXgwTEppVjR1QTc5RHgra2hrSTUrcHljUExLREIzeUhuYkNYR2puOXZGQlZ2RkFEZnF6bTJIY0syMmNDZHNvVlIzekVxCmVTbms0UWFDcDlDbzZvaWg0TUZDbTJ6ZFlQQndscXNLNGZCMjlENGx5RTVaWVdEd0t4dFZwSms1MHFkaE1IamdlK2ltYnpENFJsSHgKeDJEd3ZaN0QyMk14cEVHbnVObkJCU2VqaGl1Q2doMEZIK25tQVVUQVVmQkE1cXp0WVIwRkR6ZUUyc2tjQlEvM1FpcHI3aWg0NkJKZAorWEFVUE56c2hFODBGRHgxamhSVHg4R2o5YVo4TkJ3OFVBZTB0emdNSGlOQXZ0cHc4TmhJa0RqSEJDUUR3a01SWCtzQWhNZEd4V2M0Cm43SW5kbUJIaVdNUUE0SXBYdTJwb29MaDZPS0dPT2M3YndNVzNnaytTWWhmNzdVTTRqNDAxQ2gyUTcyd1VWMnhhMDBCT0JWSDlIMmoKNkpYK1lMMWVlL2pXMXVsTE5rbmZJZUtBZVMzQkF4MGR2dDZvRGVLTzJVOW55VURKUThoSHA4SndCY2RmYnd1Q05tRS83WjVHMFNzTgp2ajdVTTRqNzBGYWo3TzdacU8zWldsdnQrVS9mcy9XQXc4VXhkOHJpMXV0T0ZSWkdJSXdEejBXQXZab0pyM1o4ZXFNNGF5S012ZGR6CnBIdHZxMVBzbnMrbkFSRlAzWVNHbE43V2JHL1c3MmtVWGUzdDJWcTk5dnplMXRsN1BpN3hmZzVjL0E0czVzRDRoaFZyeVBpR0ZXdlEKK0IxV3JHSGpHMWFzZ2VNYlZxejV3M1pZc1FhUGIxaXhobzl2V0xFR2tOOWh4UnBDdm1IRkdrUytZY1VjSTcrRGlqV1FmSU9LTlpoOApnNG8xLzlvT0t0Wmc4QTBxMXBEeURTclc2NHhRc2VhZWE2L1E0UElOSzlidzhnTlNyQUhtRzFLc0krWWRLOVlnOHlOV3JFSG1HMWJNCklmTU5LdFl3OHlOU3JJSG1IU2ptcVBtR0UzUGMvQTRuNXNENUJoTno1SHhEaVRsMmZnY1NjL0I4dzRnNWVyNUJ4QT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJREQ2L0E0ZzEvSHdEaURtQXZ1SERHb0oreEljMUJIM0RoelVJZlhkak80aCtodzl6RkgyRGh6VVlmWU9ITlJ6OURoN1dnUFFOSHRhUQo5QTBmZHI0V1QzMmdCam5mNGNNR3FtRzZHbmk5NGI0YXhuMkhEMnRRK0Y3UDBmSzlyVTRac0ZvRDFUQmRyYTJHKzJyMzNPSEQyck1OCjlkcnplMXRuN3preWYzcVNkdml3Z1dxd0xvZXlPL0NyNGQxSGVGaER4ZmRhaHBzZjJtbVVBYTAxVUEzVjFac3k0RmUvNFFBUGEwL1YKS3JYbmJ1MmN2dDhsOWJKN0VtRnVFeFpoOXA1R2hTV2hxSlNWeVZBS29qZk0rbElEVjZOUlZQMTNMdC9yQ1pkS1N4amJhaFM3WnpNYwpLRlZXRkZqNTBKWnQrY005QnlGZ2VEYXYxNS9mMnpwN3o3WWVQa1hCUGtuWlJLMHVMV3FjS1ZqeHIvYlVvRkUyc01VVUlDWXhXSE5TCllaZTdmYU80RWNhVXFWWXZHTkNsTjlVb2Rzdm5ackF6YXRKZzFhR3RqTDA5ai9jMGlsN3BqOWFxdGFkdlRaMitaZS9MajljdjRRbWMKaStvY0lqT2FOTnFwc0cweGVRV1E1dGloQVRDbjRKOW5VeVdkb3BxWEorcG85UmhTbDllaHJVNnhleXBIZCtvMksvUzN0eVdVc29IUgp0SHM2UmUvcHo5YnIrZlAzdGs3ZnN6R2twWnFrZ1kwSEMrWFZub3JlTmZUWmxyT2xEZ0dDT2VnNVNGdW42SHNBRDFQaldFOTJHaHBNCmUxdU5ZdmYwUGExUjYwb0luN2NGQzFvZDdxaWY5U3AvTHE4enZJKzFjdnFHbjJVUmh0TkZLQktZK3RDU2dvdGU3YWtBUlVIZGh0MlUKbnRNbFdPS0poSEF3V0NxZDB0YlNHdU5ZVHg0Z09pQkQyMm9VdTZlYmZScFZrMlMxcGhiR3Z3eDNWSUl2ZTNzd3J6VzhrYlp6K29xOQpJejlCZ0QvaFpxcStNUXJUUWhkZjdhbUFuQ1dOYjlaWWRCbldBbTgrbFhNSzRFNVJaVzFXQ0VhclZoMy8ycHJxRkx1bE8zK05LbnBWCm9KempUY0hNYWlLQTNkRW96MDNGdFNkcjlkclR0NlpPMy9JSG1aU3drTUJQTEtJL3NqS2FZOG1KaSs1UzhQSFVMWVVEbElpcU9oTTUKclgzV2R4SlpyOGo5V3AxVlhUaTlFU2ZZclZ3NVY2SXM1SVZPY0crbWFMaEV2MWNaSXJYYkF4VVBxdkJIdG5iT1hxeTdVcVBxd0JzQwpXdHlQMklqU1cvT3F6czhVNVRFMlROaWtEbFdxc1U1UXhycXBBdHRxQVk1UVZRUFFkaHJCN3FhWE9SR1RBeXlwdFlQMXMyM0QzWXpnCnJsZDlwbGJMbjlyYk9YMjNIMkw1Y1p1RnlBSjFnMTZqVjNzcTVMdlZRbVVpSEVGUVZPYW8wb1JtUm5PSzg3RTFwVFRXdzl0dmVXeXIKVWV5ZXpzZU1XaFRTUGJSVlRhem85Nnc5c2Nid2JLMWVlLzdXMXVsN2ZnNXg0cVF2WTFZak5PVnRHRWRmN2Fnd3RzQWpEQVZ0aWJPYQp6U2hmUnpldkdFRUZUcmpRbG0yb05hdTNiR2pJS1g1RHZiQlJJOS9rMEp1aUhTZlY0WTVPMFN2OXdYcTk5a3F0cmRPWC9DRmtYRERPCjFSTEdCTWVJZEdJMFVBT2N0VVFMdG5nMm9GRFcxQW1xd3FVclpPa2ZxMkdOTWF0SGE2cFI3STZ1L0JrVnJoRmlIRnRiU0Y0YTZuQkwKSStpRjdjbGFOWC80MXRMSkszNytDVWtiekd6eDFMSkFISVBjcURBMlpaVzNwQTIxQjJyd0hqeVdXMW83UmQrSytYTzNzZDVNODhYUQpsQlBzam43ZDdCTnlKZ3JVR3hLS2FORExjRU9uZVAvcmcvVjY3ZUZiVzZjditYbTJWaUI3a29hK01pengxWTVZUFNuQmF1WkR4dm9zCmFzOUZzdjVPVWVGaThVeDhyWjVJV1VncU5MVFZLSFpMdDhNb1ZmcU11ZFI2VzNIV3dKOStUNmM4dDRmVlordjE3UEY3VXljdjZWMzMKMmNLNkhnL1grbHcrUTBBamsxbDhHNW9ad0s4RnE4N0J6UEtpY3dIT3g3SE1BR1Zsc0xvUnlsd1JlMUZ6UnpJWEdyaFNCeklYakViYQp3NWhsN29zUUVEdUtHZWtiS3h3TURtSmVrWU9CcU9ZQnc0eXdyUlhENHhCbUdFcm5VanVDR1U2SVV0SWV3QXl6OCt6SUp1YmpKVVF4CmRmaHlKZ0I5RDE2V204MGNhY2N1TXp3eXJoMjd2QUl3UU4yM1k1Y0xBVnhMaHk2WFRkWXRzY3lHWEthSVRPUGdBRnlHQ1hjcnk5cVIKeTRHUVF6cFV6WWxJcE15NmJYdnNNdEF5RWJab2h5NURGbHRTQnk2ZmpmYmU0bGhoZEFZYkdtSExuV2dXYk9SZDVDZzZHQmtoM2FtRQpQV2E1d0Erd2JwMVk1TmtxRkZadnB4TUc4SEFuR3NhNHQyTXc1SDYzQWEzY244bHJ0YWUyZHM3ZTdYSC95aWVoT2VJZXBReUNBNVFoCnpqZHdjczA3V0hKaHJFaHFxR1RoejhpQzB6REp6Q01UOTRoaytEK0M1ZGtqSUJtaWN3Y1pZMmFqaVJHS0xPdDNnOTI3RVJOU3hBMzQKWWdRZG5XQ1EwMGlaTy9CNDNpT081dzQxQmc2NFlzY3lwSEdFL25HQ000WUMzVEhHMFI3RGtjTkltclN1ZTN6eHdpeDFuWWFFNmRHdwpwUVFYTDliSUNDMDJkQU0vWiszVEJpa0daSUJaT3djM09lWmZ5VXZIRTFkN0VrY1RZeDdOS2V6QnhLWGF3allzTWZwbFJCSXozK3k2Cnh4RUxDOGtobEE0amhqRjRYVHVJdUJZYnYrSHhBZ1BiNGJweUNERm5uS09IZDlOdnY3YkJjaFp6ZmpYY2NDY2ExSmM1aG9BUmNqUXcKbVBFcFpoaHpjNmtEc1FBSEgwSnZwaE1HOEc0bkdzYTN0Mk13NEhhekFTemNuOGlJL1ptdG1iTTM4eGVIQlMzbnZBY0tkNkpqZTJtWgpIdEMvQU9LWEU0eXdDSnNsYkNORVdIYlJkV3lsRVhZQVlTYzZwdGZiYWJCZnU5a09IR3dQNUxUK3hOYksyWHY1Q3lkRy9BNGczVmNqCjBiRzhXRnRrR3c3M1RjamFXOVk5S2hoV3IxQ0hTdGloNktiMFpwd3dJblE3MFlDODNvd2hmZHV0Qmpod2V4NnYwOTdDMnpoOUxYOWYKNUdJSzg3YUhBbmVpb1hmUmoyR0UvV2JHSGc2SVgyN3h3UHBUWC9SYWNFMVNxL1IyR21FQTVIYWk0WFo3T3didDdYY2JFTUQ5bWJ4VwplMnB2NS9UZC9LVmg1c25NOXptZ2Z4dlJFYnV5T0xiRVBEWUc2b1hwcWRCelBXQi9oWmt0c1F4RXVEZDVpbmhyeHdrakVMY1REYS9iCjJqRkViN3ZaZ1BwdFQrUjEybnQ0STZjdmRza1pCcWQzWk9ENUNCZnNWQWY1SWE0MExCNGFEQ0NnN0w0NHIydVBGNFRmT1pUWWlSWHAKbGJjQmQ5Z0lJM1N2RVIzaDE5cHhFR0M3MjRnVTdBL2wxUDdnM3RMNUMzNTJyZUtqazBVODhnVEw0V2UvZVAzdXdpRWorUFhzZHk4Zgo5RUYrK2ViNVYvL3o0Yy9hZHA0UFAvdjF3N05MUjVQY3ZuajExWmNQYjU4L3ZINDMxSC9zSGwrK2ZmamppNGMvZmZYck4zLzYxbDR2Cndac2t1dTFqTitDWkovLzk0Y1h2Ly9EdTBRN3hxbSsrK1VvNjh2N3RtOWZmVy9lWEQvLys3c21WOFpMU0t5OGV2djJBZDd4NTg5TGYKVWNPNzF2ZS80Nys4K1ByZEh5Nk81WjJla1hQMyttdTc3dUtaT2YvanhSOGZmanJwTCtwWHE4N1BsVEhmVURLMnFxanBXRU9hTHA2WApvd2pwRHpzMngyN2xEVGVNMHU1MlBQZW1VZHRqL2JKZmY0bTJ1L292Y1dvT1RjbXlJOHc0ZGpndU9HVUtta1VOY2RZemlhT2ZTYnpzCmtxbGt6ZFdMVklDTFp3RUhFZUlsc25jamxTVUlBUUVKY0tHck9nNEwvMXlWNEJpa2hmaHMwR0tsSlhXMnRpdHlWS2s5Q2tkYmdkZEIKcGJtWjFNQWVxZHdGUUJJWHVoY1RzamdWWkdHQVVpL2Jjb0g1SElMdzRyWXFwTUFBbEF6RXpZNUFJQ1JMQ01haGhZQWRUd2hFQ3JYTApBSHhFcHJHY0ZiMVVlQUJLTW0wUFFnQ1F5U1NrMk41TTA3d25XSzREUmFRUTRERkJSbFB1blRRZndpa2dleXBmVFBiakxVY2lsVGErClBXQ1kwSjQycGtaTlNtREdOeWhmaXdNZ1IrcXlCcjB3TFp0U01zY2pCOHVSTmRQZzFxL01sWHRTbE02aER1ckNPK3BsQzhqU2pOSm8KZlZsdDVKQWZIRkVIT1BNcGE1Z3dqVjNJTmJGcURpOHEvOGh4c2phaEUvRVFWQVNRMVduVkJLR3NGdVlrMG1wV1ZQVUt4QzhzQ3lVNQprSDlkN2ZRSmhycXV3YXlyVEdFd3cvR21ZZGg2bGdid0RzSFRicTRPZ0E2dW5hL29DcWJXZzN1bExrWlpsQUl2Uzd0eW9TMDA0RkN4CnhZelB6QlNNL0ZrODFCNzNaR1FXS05HTkhaQ1VWdGVKbzQwMkE5QkpLQ3JMemV5S3dQTVhITThUVEVhUVd5NDBCcFZWVlM1MHh4S3AKeUsyVy8ydzJXeGpuRGhDTUplbjRwbG8xbzF4ZE1LUXp6RVVLSzAzSmp2TGdZS3N4RWI2NVJlT25Tb1FVeE1Tc20wbzdoY3V5MnRJaApaZldIQlZUT3JzdXNvMWthMFhyT0NtNWxQQVVvbEVuMEtoaUNZRUxDaUZkRE9Hb3l3aG51T0xpenEybTBHeXpwVXZmR0wxeEVLOTJZCktGNFJlbWxHbnBJTmpuVUZqeEUxaUNqL1pmV0FOc2o5U0hFQ3d4YVJkck9HMUFCd1hLTTZKWm44aExoQ2d4V1F5T1M1Z0JSR2JSdlQKa29BNGpkaWJvZUx4OCtJdWF2aUFnV09Vc1Nyb1NuajRrSWR1WTlwVVRWT29pVHZ4aFkwZHN3MGtwQkNHUGNwRGxMQzRLck56V0xCSwpLcFZLc1Bja2lVaGJCUU5mWkVqUXFtSVpMRExNSXh5Z3BraUhnckNHSHM1RUhBS0lTTElubnd1ODUyaUd3RU1RbHFSWmZaMVRhSEJNCkptZE9jektJUGhLelZXWVZEblFKVjdQa2dRUG9teVZDRUtEK3pveFhxMW9IVm9scUFMUWxiVkN2UXpJWEMybEFrWlpaRnhrSU5HTEQKdkxJQmpENzdVVlpDV0wwN1pvVFV5N2NnSnJ0TWRJRmx1S3hxaGc1ditMbDF2bXpWdEFnSERDUkdkczB5VVdEZUsxa0JDclRzbDAyVgpQWDJ6b0hjcmlGaUpodXFFcmdCblJad1YwWmxnZlFNY2YvYjhqQ0RTbWdHZ0g4NGdtMjN2RW9Md1REWDVzQjBRaHF1WXZYS0ZsMVF0ClFGUkRVQ2RWaS9xck9HNEx1NDIvR0x6TWtYMnJRTmd0Z2FGdVBHbGkwZkJsT3VIaGNGa2RoRlJ3N2dOdUJUZ09RL0ZocXlzOENhdFoKaUFQU0M4SlEyeGdYaUZIbTRySnFYOU9PSFBWNE9OSFJpMEduTnhKd2NHWmo2d1ZyRVVUYVZ0ZFY4MG5pc2hLTXdMdXRnRXZIeGw4MwpwTENVM3l1Vk9SaXB6Wklyb29vNllXS0JwU3JUa0VZR2doRkdzdUNLclhkVHY2MXM5eHpZVEIvQ3V1cThLZ3c2eXJZckY1czE0WXBKCmgyREh0ZVdoVytZaTAzTUxIRUx1MHJyL2J6QVlaUjBpeS9QRzhFV01ZU0U4QjViN2xXTVdRdW9DRWF6dm9JR0Q4Zk9zSXkyclQwRlEKekdzaGhGUWNrdDJhUWk3MHF2anBLdXVObVVyMWtUZlIrZkFLb3RzdCtsN1Nvem8vbUNtNDBMcTNJR0VpWEhMWUVDRENWYVo4WHRlVwpBMTYyTFRoYVlSU2UxYVBCWEZFRjdHSFZKQzA3NlhCdjZxTUVBTVJUZ0tYYmo0OVlORFl2RW1uS25UMXVBQTBIWktQWHdHbHVHWkg1Cm9HT1RKVFFrV0hnbHVEWUpnTVVqYVJLRkpSQVlFeHZBbFQxVUFpbytUWExZREt0NktXWWVMb1VVNWJySmg1bmF1QktlbXpDZnNNQmEKTGFUY1o1TE5ESjViTlVFZ2pLNUpYanpZbHNVMWcyaXRUUmMzd2QwTWg4VldZNEg5QkxkRktFMk82Vjh0a3hBeXFabllNVmZHUHJYUApnY0Y3aTVxblhGclJTRkhJUlVWcmFXd3F6MmhSdVNjdWpHMFJucHNkZExocUFpZ0UvWWFzdWhORlJ6cXY0dkFaWndPRTNDUlZTRm9MCnBNdW81ajZjTTR2TS95SzRhbFRhd25QL3pLeWdqNWhvZ29hbExVZXpWaUVWS2dpMFdVQk13bGpncXRsVDB5UEFEU2RVTWRlTkdibDQKWHVFQ3pxblpGTWo4MHFMN29MNVhWYjh5WmpuTldSbHhYWW5aNFkyelJIV2VZaDNYMGlXM2pkdXNlbVR3RVNPQlBLRTBsNjRRZXlzMwpTM29yL0NJKzlycjVlMFFlZW9iUGVWVmNRMFpPTFJEbUpuc1huVkxJeDB1K2duRVNNUVpwK210U3ZxSkhCVmExVHQrWXhCN1FaNWxLCmtPSlhaMGhQMENMSnhCYUQ3Qyt5V2tTRHM4dG1qZFNqWXBBTVRJbUZpOUN3T0d0V1gxMzlRZTJnejkxZWdhZ0VFQXR0VDFWRGQwSEkKbVBZSlRrcnNscGl6S2JUTFpvQlRzZlhRYmdZQ1lPV0tWOWU0a0FCeHRjejZic3JHZ3ZYMnFqckVzbWlpWlRoVTY2cm52N0dMc1BpMgo1SHpNd1ByY0hDT2RRTVVlVWZSTnkxYVhjZnFnRVhndldjZ2JRazViTGNTWFluOGk5d0dEb0swUHZwbEJMT1FwUE1KSVpXaTRPTUFPCnNKMHYyYlk5NW9TS1BPMGl1V1FDWW9GUEdjU0VaR3VJZ2VlYVFseGtVQUpqN3hHSFZ1YlNMbU5LdkdXeGtRVUIxZz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJSS9aTDBDUjNqRGNGb1hvd1FWQ1pLek4zY3FZQmxUb0ZHUVJkM0ZGUHZnRXZoaExHWGhUWkVaN0ZqRk9HWm0yNkFNbTlVTnRWbTU5TQpQdDNRRzF1TWxmY0NqVXNST1JXd1BFQ29ub2t5ckhtL2ZZT0ljUVlNZUU3WmFnVVNSSWpRM0d3SURNYm42cjJJL0FMZ1o1aTUwQ2d4CnJzd2dMWE9hOGtzbklDallkOVJHcktiK01TNEFtK1ZNK1JkQld5cUI2V2Vkd0NZcXRUcW1vbENKWnk0eUovRG9Fdy8vTWlMc0VWQkkKTkZ1cE5MMUFyV01DZVp1S0N5QldwUjlic2lFMWh4RFZheWdxWVZseFVDM0VIR0JMSVRhRHdhQS9NQmp1VVpkbkJFMGtaOVhxOUlqWgpZajZZdWRxeE9BVWRWOXBWaEFtZ3FaeFVYU051QW9NUnF4RVFOdzM1cmpFcjVHaUFNQXVuN0x3YXdoWkhDU1RxUlNvSmtETXdwV1N5CldSWEJ1bVprdmI2YWJWWWg3MnMwaVJ6TGlWeUlsaGUvRjlZWTVBRllYbGEzUkZma1NDNG1nczZXa0JLWGJRNjhuemROWEFoaXBHSzYKRWIrRjlPTWJkRzljQlFzTXdzLzZhZ25ndGppMDFLM2kwSldnVFNKbjM2cjRMazFzdG5ZNUhrTk5TRklzTHBjRmxRcHhIRTNRcEtYYwpiSG5hVURJdWpEZzNhS3pZYklzbHVTTjZPTklVcFI3eEJkQU9rVm0yWlppTkdrT0VPSExXNFZnQUNMMmdWM0VSeEdHaytVN05ONTRVClRFQXBLbW5lTHoweU9xaWV4MG5PZk9LQnpFeFo4T3laQ01BanpGdkc5TzhJbWl1YTlhYXN1clBQalhzNEVkbGc2NktJLzFVVHB0dVEKTVJ5VG92b1ZqcXR2REorVENLR0lxMlZaMWJ5TnhUZ2xDSHFBbEdwVmZobWxmYzJkWWZsZ0dlcGZiTVBGM3Nma1RnV1NrMGNZVURLRApxVUoySnd0ZzVBR1ZjR3U2U0w0aStBOWhqMUQ5Zk92VWVBK2tmY3FLdEZGZEI5YkNUZkc4ekE3dkJGZHRhTG5zdFRZMWRjR1dvaDViCkl5REdLM3RZWHlQQ0pKbzFsYURzTUh4SW5Xa25JblJ6S1NOeGt5YUJTenJsTkdlN0IzU0ZsVllnaEpQektFL0MweXBQbHkvS0FaajYKczZxeXhEQjdIa3dRZzJLZWtCRlk4NmtqNHBEWitiT2RneEJydC9HQnV1YWdySDlGZjRHU0dZUWR3YkVRaDRSOG1Nd2tBTXJzUnhvdQo4RSt1eS81S1pyelhPMVM5TXVwSlRnZ0x0QVhDTy9CSUw3cXE3Q3dCUm90aDkxdXh4d0J6VEhRcldBNzJBYjVscWhhbmk0U1ZtNTQ0ClFPY2k0S0FsSVdtOGNJdEZVMWxYYllsM0JGT2gyNXh2d0JnT2c4ZVFzZ1E5OTRDSEl1SEN6WlBKQU9hQ0JVNXE1b0VKWEZuUmtvTW0KUFJkbFcycngzYlBmVWZHbXEvSjNWRXVjR1h4V0tGQUlNVTEyZWhQdEszcGxVS2xKeFlYTUNMcUVjRnV5NDhRVEJUSmtSWVY5eHR6eQpmeVl6aTJJOVlESUNSOHk4M1VoM2ptNUdWbFVhYTVGUDE4MmZpTFBUb3luQTloZkdzbTRhNlFJS2hWdUF3dFh5ek9UcmF3OTVVWE1xCnFNdHFvVEUwcGVJdDhxYXdjMEtLUUtHVzdsZFM2Z00xYjhndmlyWjRZQkl6Q0ZXTjR1UE1URHlDd1pQdDRRQ2pXVE9KeHh3dDFRNE4KM3B4anErWUYwc0FCSlBpTTdmelh0cEt3c2RCSUNHc1dQS1VCRTV6V0hNQUtvU0dGVmYwZ3o4MHNwc2Jhc0JydUI1b1JKVU9leWFmUgp4bnhXbVBCcTdOY3RtclNYWmk5V1VuQU5USFl4V3Q1SENxSlpWNExiajNSNEdZU0hidVZwa3BzeUM0TFlFSi9IblFkTFlZVWdvR2F1Cll1dUJ4d3hpR1NDUkdLTVlFTEZjR1NNY2JNV2owZGt0OXJCd01tYUduY0lnTmlna1NUZG0zWkZ4RENWRHUyYUc1dmVVaXlLQmE3MUkKT1hjek9ZcGJlc2xHNFJTR2xMNzU3Z1UvQ1RHNGNGVkE5NGw2Z2JvekNINkFrVlFHZDZWem40NXh2aWZlUGxmMVE2UjUxaXMxSC9ScwpFZzRNYXJTM1NnL1E2dGFzYkJYbmJtNDAxOEV1eUx4WUc3UFJHcUVtaG8xdnZwWm5TejZEb0JreVpiUkNDekJCWjVadGN0Rmc4N1ZOCkd6Z0YwRkpXNlFHcG9MZ1NObU13V01iVU16azJhN1ozUXdwb0pueVpaelVQWVQ0anBuSGpPWWNhU0VwbVR5U1pzemo0UWhpbEg1SHgKSzJzVXVaMGVSZTJMQkdSVVFZUitzY3d6SkJKM2dGMk5TWnV3NUMzK2ZsMDBsY3MybDZLRTBCZFR6WHBvZEt5enZoeWNGWnM1NXhqWQpnRFd6QWF4aEJoWXMxWFhORFBkUksyeWNkUVV5RGFqMUNHWmhTU3FINkpMUHFxUUJGTWk4WG9oSUxmb1p6ampHMU1OMXdwaGpQNWdLCldXZXBNU1owdzhxRVo0VFpBVHFjRnczRnA0a0JhUmFhV1RyaTNFTkNVK2VDOTRMRUNJNVF6VlRDWUppWktkZ0p1dE1oc3h6cU1GOFcKTytXYSt4a01uQ25idG9RRnpIdTUwd0tpTHhRUUVHZWVqRlBVRmtCME16OFdlRHJ3ZlV6OUlnb1loYWNNYUtML1RXWWpDTzFlUE4rQgpXWWg4ejRXcEI2dWVWbVJNdmtVejZXd01EeEk1QS9ZaWZCS0oxMC9ScVhyTVljSkprSmxWbUU4RWVTQUNSRlVRa0xkemcwSElNOUNSCldQVm9NOWdoMlF6Q2pYQW9PUUdSdUJVaXZkVWg1RGZEdDVHckpSWm02ZHJVMUVaemZxSTh3M3hBVzlJS0t2WlVOWDhqeWV2TXpNeVIKbS9oV1RRb2lSSGlqMHltN21RVEVpc1RNSUdZNFI3SmxLTjQyOVJZUkMwQm5hSEY5bGpTNCsrRkI1VjZCcHBtdWVtYWMya2JLdXRveAp2OElJL2MyQ0JaWWhXVUtraFErdVVtRjNZRG96N2dmTk1XN21pRElIR2tTNnlMQmlSSEJ4azBIZVhjbzJ6TGNFRlFQb2NUOStkcXZ0CktKM0lYQlB3U2dwdnJLeEdHQU44cjdCQWtzQXdrVUFvUVd6WDJlbWRzeHBwMlJLVFo0S1hzV3R3UjBaSGc5THVDT3VGWmpPQmZvYVYKdmJqQVFIeDUxTnphVEpXMVZiVkNxa1NYZFlyakphbkI2Q0ZTTVpxbVd6V0ZsQjBTQUVPcU0yVjR0UFVvY0lUSll2WEFaSWpnT3owRgpCZ3VJWnMyc0NTbGxoZmZ6OGJLZSs0aHpXS3VlbmFWcHYxblBLRVhUelVXRWZiUUw5UnlVZ0FRb21GNmdLT2dxS1pEdFhLeHZBais0Cjl1SUtyMldnaUE3ZkFpQVJNUWNnTU1RZ204aUdjNC9odlZnUndPazhPNmg0QnNPYmN2WkF2Q01QbUxPTHVCMkJrTmJVcmlLMEY4UmcKMndnTXMyZ2FXamsvMDAyMWRsV0ZxUWZnUTRlUkppZjFDV3E0dzZLeUZSMXdVanZ4R0dNVFEyaC9wZWtuV01UaEJ1NjN3cDVnc29XNgpyWXhBY1FENVQ4eHJxcldRdlFGOXNVTEsxZUFqQnZjai9mcnN4a3NRMGExNVZyQXJuRUdZaW5sV095M2NJMjVnODlQc1M5U3RFYUgrCk5PaVZxT1l6cTBTM0dseE5hTFRCQkpDSkRkb0hnSm0wK0RMN3JOcW9hWFpDVkN6MkN2dXNNbzZkZU9kMW1PY0dNTTFnRVMxT2dGcm4KUGRGb21QQ1dVSUI3c09nUUZGUGdyS2NPNndUdHdFUTdkcThFWVVmZUlnRmNEeE9URTNCMFc5NWFyeXNOTzNyUndDa0NTUUgyaVlxcwpwLzF4MlpxSEV6U3VidEN5T2NxWjBCUnVNNGJLZ0lBdXhqay84M0RaU2xWOE01c1Aya0ZjTmpZakluZVJ2MkhUeTdxaHVTN3FoUWVSCmJqYmtDZ3c4djdxc2tBMEw3Qmx3Y0ppcmdvWUFnSklnSVM5dUNnR2hiZ3pVS2ZRNEZRckF0TEtYNHNlcEZNcS9CejBpYzJVbDJveHoKTk1CeHNmTVFRU2d0Z2Q5bWJ0ZG8vc095cVdPTkcxTFFaeVFPQkpmTjN2bEZoWWtGY0I0SWdpMkR5YXFpSHQ2VVo5WnVDbjI1c1htNApZRElnQkZMdk5Xc3dRSXFLU0NOaFU0UDE3R0FIbU80aFZnTHZ0M3JVSVNBUnpEdFFOR2ROVXV0MDNQcEY5TXZDOGgxV0RTK2krNTFKCnZQU2pNR28yMm4xMnF5WVRTY21zUy9CSkUrbXp3UE5UdEU4NXl0QlQzZnNHNkF6U1E5RTl0Rm82R2pBcytvOFd2WnM4S1M3YjZPL3gKUjZSZ0E4OW1XdFc1UE5QS0xmMnRjQ0VMa3NRRWIyZHhnd2cyZ2ZTSmpBb0FBYUtvaHNJc1l6dVp5cUhlemR5WWNQSGxUYk4yMGVzego5K1UvR3dCbVZpdEh2dEtWeDM3RDZXK0VhU0VuTURkcEkraTZCNTlrRWtlcnRSWFZ3WkRES2xkTm9FbVZTWGFaa2p5b2tVSTNUS2ZxCkdlTm54TWtqdjFvRkQ5elV4OEF0MXAzUVc5S3NJTEJPWmp1NmsyWitaREtqcTJxemc5WVQ1WDduWnpBMzg2MW1ndmRVOHcwOGtKdUcKNUVhQXM2WDBJenVVdGhsUWtEcFE1Und1SmVpT1VQUkFTZ1dBNno2Q2ljMHNpNHI0aHBiSGhSNGRmb0dVdlp2R1E5RGE1OG9KMVF3egprT0d6bmtRQ1FZS1cyRVY5bExocWJrbEtrUU5uMDZZb3NEQXpHNjhpdStmbnhPUndNbnRyVDIzS1BRQkdGRFVxV040eDV2VW94VUJGCkdXZjZJWjR2dHplclNMR0pFS2pWY3FwU2g0SG1VSG5HQzRGbTdLRE5UNXhnSmhYVVRyb0I4cEFxb0tXaTZVdUVJa0UxNUJIcUxvSEMKOXFnbitITFdzQlk1SWV3akJDeEZneHZDWlQwbnZ4dmkxakxqTThpY296bWRSR2FqL2ZCTW9ybVpIazJ0TFdNYXFpWkt3RkhwczhhVAp0ampTTmNMSndUT2xrRFBCUXRGbE05N25TQ2dha2djWDMyeEhncE5JcitOcUdDWGE4UUpycmVDOHRNL1Y5dEcxUENKMEFJTmNGOHQ4CnpLWVRBNGMwYThKR1R5RVd1cW12UWRWK2VHY1g1cXd5SFJQUldKVFFreDI1dFl5R1Vod3FzNUMyQXFqQnBFdXpFc3lBYU9rSGw5RisKdUtpVkJpbUI0ZDlrMC9EWmd4QldKWkEza0ZDN0RaQmdNTFJOTUZiUTdIVTB6VUs4aHBjSmJoK1lwOXQ3bWN3Sk9TRkZtM3FLalNESQpBRE9CZkFsNnJyUENrWWo5Z3A5aGVPZnhZOFh5SlBESTVFMFhsRisxQXRVVHpTb1RtZTBOWjdwdUNvUWdBYndDUnNoNWRURjBNOXhECjBPVkExQnNNamN4RVVUVGRGblVvV1hmQjhRR3doOUUyU0tzbHN3QXVXZ3ZaekxkcVdTaVlNSFV3aUFLL1JkZExNcUVjK3RhcURodGQKQ0xObWN5SjJaZW5tSG1ZbjRacGNOTHRYMVJNN2RlR3pCdmhRNUVSZisyV0V6OHdHaXd4bVZFWDNMWXZkRFh3WWhPUWFGeTJDUERwRwp6WDlNdU16emUwSFE3QjF4b2ZCOTFYWUtzSjJDUXl2QkpyRHhRdEtrS29xd1NhSk9ZR1RpUTIvcXpPUldodWhpV00wd0pMQlRBUVBLCnpJTVJjRXZJSjBoblNWQlE2c1kyRU1uazBJOUVCZ0Y4dUhLR3lZNjhhZ2o5eWxSdnlPYmJRL1RwZjRocW1XQ1lQVStjVFlvSUpTRXgKcmJaMnRGOUZOekVHRml1YWFUY1pseG9Ndm9JRFkyQW5nU2RzZFZrS2x3VXlhd1VJSTgwbkRJdUlOaU40cDVobEQrdHh6aDExTjhOTQp4VVc2YXBZRldnMnh0TG1kTVN0Q1prUWNoWmwyR2JZemdLNW1WVlVJU2t6R1pFQ2dGNUlFOTB6aEZIakloUERZRWhCUVljZVR3Uk8rCkpsdUdKVU1HeW1IV2RjWVg0em5TOEYxbU5RTEJMMWF4Z3VEdGhyY2RmakVDeW9CVkMzNVVLb2haRVczcTBZUDNEQ1lwd2lJWHZZeG0KQ2RTQWdPeVhFUkVBWXJXazNCVG0xbVIrTVJBZzZSTTQ2VEpwUmhiQVRLNUxwQmloWS9BWE1TYzFVLzh0RGFIQVphN3ZWdFVwQXcyRgorb0NpNnhaRzNCUGdCSWdQdkMvQWUzZWNWcVRXc0FZREpPUHp4cytLZWxrdERuY05LcmZxUlVsZEpraEFIaFlGUFJGK1BGNG1mQ3BxCnV3M3l1REo0WDFURmpNZDJRVDlIUTNtVW9odHVKdGR5alNYb3ZmSmlBYjFBWmNKQUNLOGdnN2JYVE1WNnJicDhuOXRJYzVVQkVNeGcKLzlWMkpRQ0NpWFdEUUw0cVRxbzduUEdFVldHUnE5YWhWN0hCSkVFb0NsZk9jenZTYVRZVmZjWnkzNmpWVUVLam5ZMEtTOVUwRG5sVAoyNFFLamFwVHJXWmQxRlBqWU1OY0ZWeEpOQzRVUXpDSTFOd25XWkdyWUNQMG9PRVVKZHdkekFiVEJRUTZKRUJ3dSs4TVVLVThMMmcwCktNMW1aVWN6MVE1ald2MW1henRVYmxNUElUQmZ0TmE3alI5Mkp0ZURHVFlNRnp2ZVhUa2o1bVdnOXI0UjFLMnVESTQwYlZYY1REQ3IKOHRhZDFKRDJkTTY0M1h2Vy9HUU5JUnd0WG9OQnk5bWxscWl1eDlVUVp0anRaK0JUMXVyaUgxWlg1bHhZSGNjSElrTjVRT1ErRkZOTApCWUJRSVNVczJyRGJJSHBUT0hpQlFnQU1Ld2liNWltaUZqNEZvd21PdG9lblZVM2hhNXNoS2cvVGtWczVJU0xOVGdtcG9BTEJPWTNKClVXaURHd0pFTnA1cys4cW12WjhKZjI1WHV4QjI5Wk12bURGUFJ2Mm5oNS85NXQzYkY2OS9mL2pKOFhqOS9QbDNydz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJZnYzbTNUUFUzY1ZiMlVra2tCWUllb0JWRkZhTVYwYXRqTU1Jczh0UXhiTHVoRmxSZlJRUW1DNGFsbE1INzlCVVJyd0VxSFZSUVlJWQpWNDE1TVZ3K3BWVkd0NFFXenJBcXVnOVd4SVcyZHQ2VFVUQlFDVGN6OHFuUDBTZ3FUbmhpNGw1djArbk8zQitxTkxrakNzZVpGUmNDClZ5Z2U2b3dqMjZEYVJCYzVUbFlGcTFmRDQ2Ymh1bXVLcm00Rm5jdzhNSFpXVVl5cFRFZ0lSaUVPK2VUQ1dYZE5VSW1uSVNXdmFqVzIKSUltZ2dSdWcwQVRodXBxR00xVUZEK1BwS1h6Q0dZbFo1NThCTEFkRGNUbDNnYU8rRW8ra1dYNEpxWUZITE5zNEZzWjdsS3VtOHVyWgowSlZFNHZoQXdHRGpjN0JSWllRU3JscVczSzVLd0RreTlkNmlWeEVSQUoxK0NScmZRQTY3R1hwRzN3eWFYT0JKZzBYZkxLblJvN2pOCkdad0tIQmJiVllOeEVITTFjM0VTNk1wYTVEQlJ6WG9rSUpaanRmUWxUWXJFazRPb1V4dlltc0IyVmtyamlIeUVZUXMxZkhlanNzcTkKSVN2N0FpUU9DdVpxU1VIMHNFaDFaTkVaZStQYTYycEpYbmdjdEdYVDhCaHY5WWNHNXZsTFFLZjdWVXhVd3hRUm1MMVVjVFl5cG9WRwpBUUNqd0dIV2ViQjJKME1acjdPeFJvaDlNSUtnRmtlUi9vaUV6M1gydE1TZ3dWS0YvVzJlRnp1eE0zUDdoeVdOclVBU1hvTyttRjQxClcxOW4wMFdpaFNvV0lBTWhwRU9hWm1ZT1FJeXJPWGlBVjREd3lTMTRVNTZucHVwTndmaVJhRTdZRExlT3pzZXBHNGdQYVpXd3E2NkIKNlN6VWd3dUJCT2R6QU9UdmNremtzQXZEZ1pFOTgraU9XZ3FubWU2dHlCa1BPWmZ4WmY1aUFNbERuYTIrR2lHb2NWa1ZjMFh6UEpxTgpNZml4SFYrRlREbFlSVEJTY3c4RUFSQUJuSlNRWjIxSDB3aXRxZ2k0NTVBcDlwSDlpV1lLcE1TQTFGUm1sV3pnRXl4b0J5bldaN01SCndla21NaGJXaDd5NWVzbVdxbExDRE9nYXozRkJoRUJkMUJYTm15MUpaVWpLRWxpTndDWHprUllGbkpNQWl3ekVoSWF4V2VpcUpWSGgKUUt5MU1WRUJUZHBzZU5FMENUUXQ2R1ZaK1JyVGVLSzdnV1dEL1I2eVBGMDRUaERCa0NZWnZjeUp5WFQreFVJcmNEb0U0SStSR0d6RgpSYmY0RXNDa0tKUzFXbjcrZkNHNHRnNEVoSHU2U3VuRW10VmtIK2ttbUl1NjZ6SDdmVDdDSGJINXdiQUF3aU9lRmhZOFFyRFdXZk9pClFSUmtaQmQwQnh5NFNjM09XUSs4Y0VrSFFKY3huSENyaW1VMHI5R1ZWakxIcmNXUmNMYmpmSGEweFNxeUNEaldhOVMxUU13Z3hxeHgKSzZ6d2pUN2l4VmVWMm5CbjErY2hrbURoYmJScTM5aEFpd1FWV0FuR2pJelpGUFVpWFRGTVdhamU3NmJSZ01pejl1QVM1enNnTVhwbQpSS0ZLdW93bmluUnJ0N2pxU0tXb3Npa0Nxa2xBQWhxNHlNbTlHV0hFQ2t0Ykwram5va2V0WStMQlEwZlFsdXp6Q3Y4Q0VqMVZUWlRSCjlBVU1zd0lEWjZRaldUVVRNcVZQSE15UXNwNTB4VTBYUm1wSURNcXVOc1hjYk5WV05RQmQ2bzVHREF0Nk5qSGVWTStUYUZJUXJFb0kKQnlSVnA2TzZCK21maHA1REF1RjVjRkM3dnNiVzZxcjFvb0w3cW1xK3BQQVZrMFd5a05JQmREUnlNSW5acHNjTnAyQnlEUFlWUFpJdQpyN3FqTzRZak9kRElJQnJFblFDS3p1Zms0Q1ZHRFN2ODBJSGRQS2lJMHltbzQ0UUU5YjliaEF1dkk5QW5MRDNtbkZRT0QrelZ5NnlaCjdEY2U2QUNLOXVpc0hJK1Via1FyYW9RUGxCWTJUV1ZLVHNIOEs2b0tSUFhJV1F4RWJydXBScHJEeXNaM0FxYU51RHVBQXkwcFBUTWoKTzZHWnhHZ2M5MXF6UVJZQ0FYbkxTSUZlc05VZTFtalUxZUpWTWUwQVR3bDZXSUxLdG51NSszUEs5Z1RhODBDWnFwTlprNmtGRGZXQwpqTXM0ZHFDTUNUSkk1ZzNER1M4RXppMmFhWW5xbnNaaVlZMXB2QWlQaDZGMkE5Mnk2a25yM1BxVjBmdlpGYXNleUtLeGhKckdrSjZ1Cm1ldUdXUTJoZjJuK2c5UXUybGE2ZXZ5aW9zbi92R2tsekhUaE5FbVE5Nkx6STNxbXhhQ3dMOEFlNlE5ajRDQW5qZHJQK0dhQW0xY2UKT3FOdWMvZ2hwTW1LQ1UrRXB3Rytrcmw1ZUM4R3oyMTh4Sll4a2VkSEppN3NhSGtsNExnbTB0c0RMN0s1bzhMTUdEYW1qcU1yS3FxNwpHNFNBN2tnOWFCTDNTbkR6SlpvS1VZY29wLzZFMVZLWHpXb0U0bFhZd25oRU5mUnBUWkdta2YwZVA0ZlFGM2o2Z2JOb0VTOHczK01rCmxzMWlDb0RPd01sQ1FLZlJUb1Z6WUdnMnBybkNyMW9zRlJkcy83TW12YXpBSzh5UWl2RmVPRmNjeG0rbVUyaEJiSXRCTElEbFYzOGQKOFBBdzdzSWgyK0lWT0lteFFIcHdQcWpvU2JoQWFmZml3ZVdhRjJUbFpnZEtRUmcrOG5ndUxRUU9salBJNEYvTVYzcHVBUzN1UG84UQpSQ2kzRmNHTEFwT241ZllWZ2xES3RaaVJqY2NzV1pDYWhxVERSdGloMTNva0djOEVObE1Zb3ZXWXNpSXIrb2FFaGNjTnEvSFVMeXRRCmFLRHB1Uk9abHVxd2VpNkhhcGtuTEtWb000WnhPSXZucDRqcU1RUjhudmxBc3UxUmhlZ0d0U2N1bk9zeFdrNUxxRnF3aFFFTHFPYnUKMlk1aGpZUGRyUUp3eVVOVHpUY09WSUllbGFyUVp4S2dMc2N4WWdBZS9aWEhBeUcyU0kvOFlob1JNT3hpWjN0eGprYW1wZWdISkcvMAowRzBlSG1vcFBia3QyM0ZMeUNyaS9Qakd4b3dSTEF6aENob2hTV1JKTXNNb3Zkd3crS2JZTlY3NjFBSGVCSkZCUnZTOEp6cFg2RlpVCllNQkt3emxOQ00wNldJVUpwcWpCaFMzT083bGR0bGpLQnh4cDBHZElVR050V2kzWFY0dk5UYW90YVl3a3BEQ3pwdlBkbGszUmRqeG0KZ2FHd0NMeExCTWtraTZnbHM4WmhnL1BjczRRd3BDdDU2RGxNeE5pK2s2bG1yQUhzSmhDVHBaMzNaeG1yMDZaNFl6Yk9sSEtiNWU5QQovSzRzdUxScERvaG0zNGFFbExBRlIzMHp5a0xKWEg4TUJhL3FBaUNhU2tjdHFzZVlpejdZSWR0WWFkbGkyZ0VneE5URGtxeXpNNE5WCk5UamtqV1hBeXJJcUxDUWpoUWVHWXpHdkRXcmtHdHRsQkd1RHFORTVGbFdmMVVYR3p6QkE1S0lHQ0wwS1JneGhUSm53WVEzK1ZKQ0YKNTZGWkxDOERRbEFoaXV1WVlXWEJDYUV4S2F5RXZZbEdWdXhOYWRIbG1zdGdnNGViaFdrM2k2cThJTkJRQUFMRG5rQ0F1d1VFTjRXQgpTRUVEYlRFYUdDSElzSHVDNEhkVDdGaFJDT0Z6MndtcExpNUluVkUxU2JuT3E4cmNJZ1FjZ2w4bHk3bkFxd0x6a1NzeEdWSWYxamxtCkc5cXFmUTZNblN2TmF3VWlJaFU4b0k0RVFyYUtoNFBDMVErSFZORVZySmNWVFJDQVkrMnE1ZDZtWVk1WldSbkl1ZXFaS3d3VG5vM1AKUWNUVm1MZk1OSmR4dHMwNWVWenJxdkJyQUluY2trTEJEUlp0T0ZZM2srU1NmbGF2RlQ1elVnZDF2ZmxWUEVNQ2dYcmNITkJNcGY5MgowVTlFSXlVTGlsUFJKU2lhQ0lwRlpBeFBOZ1JRdEN4QzBjS3QzQmZtUWhuVHBqQkVwMnFjVE1vODlWcGRuMFRIenJRbURqc01zQ1E0Cnd5SzZQMmkyQS9nWWx4Y3RpTUk4dW5rZXdoMXBGV1dnbGFzMW1OUHcrMVlMV1NLU0tKb2R3OStOOHBOSVlSdDBEb3BsZElRdjVxVmgKYUhaUzNnZ0Frb3BscTA3czZObU0wV0hnc1J4TGlubFp3MW9vMExmREFqYzlhaHRTTGIxL09MR1pSNlFWZW9jMVZ4Q3owUTdDRWd5ZApWVkU2QkJ4VGRNYk90aWx1aHArWjc2anF1dk9yRnJxQUZVWFB6endCemxNL25RcmduMVc2QngvR0lvZnFuS0tmUWltekN4T0pKMkN1CjZzWGtIbHV5SjdLYURZQ2FOVXVCTXZsWjVUWFk4UmloRERNZ0pPVjEwWEJvcG5MQS9zVjBVS1duckdJWUY0aVc3NEdHWHJTZG5VRGYKV3U3cURkcW1teDhlNTNtMkF3L2dMV0F1ZUNJR2c2WnhBa1RmTVNqME5xNmFGbzN2eStNR3dURmhUNG5aY3VtcXM0MmYxUUUzTjErdgpWdHFLZFlnR2srclJMN2g1VUF1ZHUrMVV4QTYybzZBV0pqRXNkRkFHQVpCSEZCZk9FbTVTQUVEMGxnRlVzNi9EKzBlRG5OVWlBUndGCnpUaWdBWjQwS2lERjlFU2U4d2VyUkxIVUtjemJpeTJtakxsVVNsV0JwdFhDOVhDU0VaaUhTZXlFdW95WEdaRjUwNkVQVk4yK2dZZGcKNHZOcTV3TTVRV1czcXRieFZtdWIxVHlNb0J0R1NEZkMzR0ZialZnOWl5OE1vd0Q4MUdUeVZiVk1HalVPSHRxYWxFTlVwcU93dE1SYQphU21ySGxUQWNPMjZFMHVUeHRIVmFNSDUxU0JCZ0NDU3JlRm1SUzlyTm13OEVyTVhnQWhJSE1PL0VFbk1rNVpYd3djQ3hGM05EY0xwCmlDUkZLMDEwbWs5bVM1cVNOVjJwYXNjUXBVcERZNE84a0lqRmh5R2lvQXdDWE5nNEFwVU1HeW4xNEJsaW5udGZubHN5ci9GR1l4OVIKamZBSTRqTnpGbTVKc1N0b3BxVlZNakVFUGg4bVRFVzJzVVJ2VmJaZGI3UDFTdHVKSS9Rd0gydFdJNUpIaWpIcUNKTzNNR0ZVVUdOVQpOU2VYM2k2bzFhWGFoczdMQU9tQUNSMTZLd2dVQWFzRlVmdGw5QzJEQ0E4c0E4cG05blZtWEdMVUdCSm1kc3ZkU1JoaDUwSW1MNDB2ClhEU1BCM1pYWmxSZ3gvSTR2RmhVbGRWWHN4UmlvS3FDczdseUJRb01qUm9ZaDBRc01GVTRPRm9mcTI1bXdLanFKbWNlQVZJcW55SXEKREpaV2phMjV3Nkx1eVNGcUh2VkV6VkVEVXV2WVRGRTNzWTY0TzFBQlFiVGM2ZlFyY1JzMElKSzZZbzJnN3hmY0JMSnE0QUFXSVBnNQp3SEFVWWJET21DSFBLY29VaWlWbWJQWGdRb0ZLUjlHSitLQ3FhaGllc3dYY0VPeTlXREN4YXRCMDlDd2FKY3lNRTd6U0k0azd2cnIyCllHSlZJOERQNkV5RnlrWWhDTW5YR0dRYjY0QzRRYlJYc0hlazEwdlY2RTJQMEtINjNTbGhpQzNveEtnNTBvdW0rWUdEbFc5RTRITDIKQ0J4WU45aXA4R1VsbW8xTlZZRXUyUklQcWdpVExYNk5kczVTTzhySHdyMFh5eEFCdlVnVE9FS3kzelRUa3NvbnRJWDYwYzY1YUZCKwpDRXUvZzZXUnROUXJyTVB6NVlDcHlFMm5ORUFGckxtYUxtdmROTW9aa1ovY2xRbWpZdUtOZVFUWEI0WDdZL2xEaitPekJxdW1xZmVECkpqWmtoN1hEeDRMQ3BCaWFSZUVhYVU0V0U3V29wREV6Z1JvUHErTGg5RXBtZFYySC9rZDRTMUdQdDY3aWJFQksrdE5kd09ZWkJId3UKYzBVeWZSVlkzYlphMU1pcGJIVHpHUVd2Ly9KSUN1Y1BidWl2bjR6NkpOdnV4K1haUFQzUGJkWFR2OGVzdTFpcG9kU1dkRGZ5U0tyVQpjdTdDNEl0RHJzYVV1MmxUOTZLbjNNV2hvNWovbm5GMzVUa2k2NWh3RjdvMFpyRG4yNFZHS3ZkdDZYYWhRMVU5VXJCbDI0Mk1hVmxhCnNsMTh4cU42cmwxOFhqUkRiMHUxeTJ0Q2JwbDIwVzRwVzB1MEd4bXp2a3V6QzRTaXBmU2pReEYyVmxqUE5jbHVOdVRXa0dNWG1HbUsKd0paaUY0R1NNS2g0aHQzRkVGRzdCTHNqa2ZsMWwyVEpXejI5N3BMVWZMdkxycnNrUmZLMzVMckk1UDcvc2ZkdXU3NGt5WG5mRS9RNwo3QnNEdG9HaEtzK1psMUpiaG1XM1pFR3daQW1HUWRETmxrU0RQU05RbEFtL3ZkZDNpTXlzdFhvb0Nkd0NmS0VMY25yRnJxcC9IVE1qCkk3NzRCUmRSd2RhdHpuNi8wTHBNc3VVUlpOMXFoWS9CdXMzVDZNM1ZoYVJTN0ZkamRZTjF0cW02aU5qb2c3K2d1b2hhNURJT1U1ZTkKZWVZNlNGMG00MHQ1RTNXYmkwTTJVTGNWYWUwMlQ1ZUczdDQ0M1ZiTVdRaWFMbzZUNTJIcE5vdklYaWhkdE1RUnVVQWtYZWdmQzFONApCdWxpWlNhVXdzWFJaZnF6OUlQUlpjSFFPQkRkUGtQQ2RERjA0ZkVYQzVZNGQ0NGh6V2tRZERFSGkrQi9BWFE1VmZkNitMbXMzQXBVCk1UNnhxTzk2MFhPallzbjRYQlNKemNQTzVaOHV6TjNSZVhpM3ludWFuSXVPTUpwQkRjNGRsU0dpRzVzN0hLa0lhaTU2SFdDbURHZ3UKa3V3b3lMcVp1Y3VOTlFLWnV4SXpKUUhNeForY0JTNHdHblpaTldpNUsybCtNU3dYN2hOV0p6Y3JkM2JsSVFPVml5OFlxODRnNWVLOApxL2Jkb0Z5SXN4QlBDVTR1UzJMeHFRUW5sek1jSVc0M2NaalRYaDJiazh0Wno4UmJjbkl0SWlzdlRpNDFaUGpJemNtbGdpeEpDcW4xCkpBelVMODRiWHRXMU5nMU9MdTc3WTIzb293dzQ4OHNYSlhlNXkwNVFjdlVacXcwVksxQTRJeU80ZFdOeVpaeHIwdz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJYkdHZ0dyeHZ1dGFqd2UzRzVQSmRvZHphbUZ4Nkt4UmtYYnN4OG5oamNwZnB6a0hKQmJzaDZaT2dDQlg2L2FZRjEyYmtycXhmQ2tTdQpGMEFCeUYzVCtxbUxqd3NiUHFiQTR5S3FnTnJ0b09QaU5GcTUyYmpJdUROV0lqUXVYdjFIQjZYdUZXSTVDbG9QR0hlaHFxMmx6Y1hsCnkxT0Rpb3U1RWl1K2k0a0xQcW5iK3pBODI1WWNyQ0RpdGtObjJ5TlFzKzR2ZUxoZ0Z1QkhBNGZicFBpN1liaE5ZYTlBNGFLK0Y3OFMKSkZ6OHpWKzVTSHBJVUVBc0hCemNIazJPbkl1QXMxREdEY0h0YnRRVEROenV4R0FnY0JIdnhpdHpFM0JaUzl0SEFIQ2hSL0pycjFrdApLWTEzNDIrclMzbUNmZ3ZPR2ZWOWh0K0tmMWRlN050cXZFaXdiNnVyVkFKOWk3K0Jjcm5KdC9zNEJ0OHl3UUhaczhDM3Rhb1kvdWJlCkZnK09nYjFGRkxxV0h0UmIrRkR0NlMvcUxWZEVxd1QwTm5jOTkyRGVmbmJOSWh3cEVUQW01MW5leUZzVVJTQTBaZUl0YUJGTmZGc0MKYjV1N0M5NjhXOElobnJseHQ4M2xTa0c3eFQ2Wkl0dFRPSXVWaHRwRGluV0wzK25zNUM2SWJjdGFGMXlnVzZJUkxocHVOUjAzTUxmSQpVeVB5ZEZGdVVXZGVSdDJRVzFSc00zNXN4bTEwRnJzUnR3QjQ0cFV5MGJhNVdldjVrMEs1bTI4TGhIRTVkTnVXbmIwMDNCWi9zNFQ1Cll0dFc1NWNEYmN2dkUwWGRJdHZ1UHkrd2JaMUt3Z1hZOW1PaHBNSlh3MXFhS3dodXJDMXkyNkI3QnRhMnVZWWdxTGJ3UW5IWGI2Z3QKM0poZU45SVdJd21URjBiYTRwK2JPTGliYUl0VElVL09RRnNreWxBQUhEemJWaG5MdTJtMk1QR0xNczRXZitPdUI4MFd3d2ZrSGpmTQpGZzRYNGFCbTJVS01oekJMc0d5QlZXbUNxdS9KQVRsSERySWkyVUtiaU1CRWdHeEp2eXoxeGJHbGt1SGpKZ1hHdGpvWUVCUmJnR2N4Ck9OOFFXeUFWTDRSdGRVNDVDTFlnVWZKRHZnQzJoZjFFOHViWEVqejU4WG9FdmhaL3AxVmU5TnE4eEc4TGVHMVc4Qy9RdFpuUThCZTQKdHJoMXNMbTFoZW1ydkxHMWhjclEvS0xXSW1XV1ZmVEVpbUpRbUhWZVV2MTB3TUxYQzFtTEZFUStGRnNvTXJpcUMyQXRKQVZFZXI2QQp0Ui92S3g2MWdiV1k0L1NFUE5XakdyKythYlVvTFdqandHcmgrai9qc0dvZnljOWZxRnFnMXNZNHBGcmNuSXRUKzNDWXV5bTFtSmhRCml4bVVXa2dlaTlvUnFpYU43ZWhmaUZxZ1pqRXZiRVF0MGhLaXlJcFF1NFFWZWdGcWtUbDd4Z2JVb2l6bTBHbXpaWGozbElvVVpoTDkKbElJQ2JsUHlRZE11ZFVCOW9XbVJOVVloVDVCcFVkSFcxZ0hUeHQ4M2x6WnNnYVZkV3N1Yk9BditKOWJZRjVRV0ZaVm9wQnhiMFBtdgpHMG03Lzc2SXRHRUxJQzNxZlhEVXphUDFhM2JqYUJmTHhldW0wYUo4SGk1S3dHZ2ZMb0VGeTlpYXhhMHJDaG90NUIyRVdRU045cUZXCnJMeHB0UGc2S1JJSkd1M3ZtRmJDV2pSd3RBOHJac1VDM2dNT3lqOTd1V2kwOEtyd2Q2RGF1ajd6bTBVTHNpRkFRa2JSZnJ3c0hBTTMKaXBZcXgvSW0wV0tXZnRJRzBRSm5NeEcvREJBdFJnaUdRRzRRTGJ1bnozbEF0QS9vejRqTUI0a1dxMklNakRlSVZoU3RkRGkwai9seApnYUZGa0tYTUY0VVdJV05FbFFKQ0M1bk0wMG93YURIdVBDTy9FTFNZVVRycVNrMmdCVlNBWlVOUk1JTlFVU2t2L214dUd2ck5uMlZsCnM0cVhtV25IMzFQYy9aMXF3bUZLR3hzK2k1eXlRRUxXYkRhRmRpNzBMUHl3cmlKY2NwdllkMm5XRFo2RnlCQkJtSnM3RzdiQXprSWEKTW1mYTFGbmVFS0kzams0Y0FpTzhLOEdjaFJRQVkyQWdaL0h2N0E1eEVXZGhtK3k5STBsTGNSMTM4R2FSWWMvdFJadEZucDFNV2NObQp5ekxjMUt4Wk1HeGR1YnlyK0twMUlVR2F4Y2pHUllRUnNxMG9WWDl6WnVHd0kxNFhOc1R2eUtBelpUYit2aUd6MjJiR0xKcnpQa3ppCjZqMzY3TEtHUTR1QXNLbGNGMkpXRFRGRzM0alpWRjFNdFJHemtDSUloM1VJczZrNGk3c0pzOWhLdUZHTGVmQzlNT0J4QTJacFRSY2wKRmdiaFJvTXZtMWdSMk1hYkx3dnBBMHV4cnoyN2FQNmJMMHZMek9YTmw4WHhLRi9jZkZuQlFsYzVmRmxwWWNvbndDemg0c1VKREdhNApTM1plSWdDelJLZU9OTitBV1ZxRkhEVmdGdi9Cbk9ZR3pQSS9tRjY2Q2JNQ3k1WjVDTE84T2tSbk5tR1cvNVNNNU4wUXF6eGRQUmVFCldXYWYrR0lFWVphUGhwQzBtekNMQkpGU1VTYk00ajQ5ZFpaRG1OV1RaK0xySXN3eUw4WklZUkJteVRaRlZYa2daZ21pWitqeVJzemkKQjFEMnNnbXpPQi9seDRJd3kwTXkvSG9UWmlsc1lwUXhDTFBFNFdmM0xaYk1NcHY0OVNMTVNoTFZEMkNXQm5ZT0NjQXNMT0lTM1lSWgp3bG1adnd6Q0xHS1ZpdnNHWVphQlAyVVlMOElzTTJQNmtFeVlaWXhuK1Q2eGVtMDFRWFplZ0Zrd0Y2UkJGbDhXREVRQ3N3TXZpMFpWCmFwVjI0V1ZYaStwUzgyVzUxVGgwV1J4bU9lMjU0YklJMmZEQkJsdVdnU2tWVlpndGkrdWdFdW5GbGwzTFgwS2daVmNTejIrVFpaRWMKU1BYTmxVV2NVTzNEakpXZFJiaXhUWldGQWV2TkYxUjI1bWlhWnFZc0RLSUNHaW1yN0VWNUUyVlJvcTN5VVFObEdUNUQxbjREWlpuUApiMk84Z2JLODVQejBBNVRsbytOWEdFQlpjREFSbDd4NXNzdTFpTWJKSWxiRjRMOXBzdmk3OXBzbEN3dGxKVWJKNGdDUG9tc2t5UksyCitmRTkzU0RaeEt4N1Nwc2txemk1a3d3c0lNRHNKNHppUlpMbElFWVljNUJrZWRPclhoVnhHbkNqTUtyZktGa0cxSWNhR3hJbFN3T2kKYllHU3BjRUUybzJTVlE2bTVZMlNWWnBram8yU1ZmNWx6UmRLRnFkTWVWaWdaRmx1dy9yYWFQU0ljbE44SHpkTGxpME9vQ0VJbGl5RwpkbjVyWnNueW5yQlc3bUxKMG9qNHVWbXl6SXdqQWgwc1dSaVlSTGhac2pBR2daWXNXUm9RVndtV0xBMXNTM2F4WkNsNXBLYkdNRmwyCkJNSFhIekJaREI5VUhOdzBXY2tnODl3MFdXNkYyU3Rvc2lrN1ozSFRaR0ZrZWlGb3Nsc3NLWnBzSXJ4bnRCZE5Ga2I2RWtHVHBRRmgKdktESjBzRG1NQmRORnFNMktibUd5WXJvdjFMUVpObmFHd1BXelpPRmtXV3lBWlJOcElhV3VZR3lOTENLK3dMS3lvaGtoWUd5UEE0TApEZzJVaFlFczl4c295MDRJeUxZSFVGYkZFbmtGVUpaOVFQa09YMEJaMWNZQXpXcWdMTnJWY05JT29peVV6eFMyM2tSWnlxR05rU1pSCk5sV2pmVTJVNWQ5OHB5K2tMSTJRQ0FSU1ZxcnFyQXdST1Z6OE5XcVRicVNzWk5UNnJpblFZT09mcFZwQUVtVzNRdm9teXRLdGExbUQKbkFTZUlQSFRtUW1pTEVUMFQvb0VsSVV4c1JneWlMS3dlSXA2b2dkOFBYbkdqWlJOcDMyQmtiSThGbnRHQkZJV29uaXFMRjlJV1Z5agovS3hBeW5JK1ZvTFdoRGE0TitNVFVaWktKNWFYQlZFVys2bWdMWWl5dUJFaUc5eEVXVWpZVFhVM1VSWXZGaitLQU1xbTVvNlJMNkFzCnkyV29DQW1nTEx0d0tUVnJvQ3g5Y1FDU2JxQnNpb3ozQnNyS2NuQ3lYMTM0N2R4akxIMmtGTjg0V1VFUzhxYkpZbXlsTk5vMFdUMzQKbFY0NFdScmhpd1ZPRm9lbWdEbDRzakJ3VnJwNXNreVR6N0Z4c3Z3YnMxVHdaR1hvNjhXVHhZOGhqUnc0V1g0UEFralNqOExNWUJUWgpscXNodjRZU2xjREpNaStaK3ViRVloU2FiYjVnc2hqUG5GbWtyVWRyVGFGa093YVlaNzVJc3JBOVpyNU9iVUpNaVRpeVVPZk9GMFdXCm5lZytibHRBWkx0ckE3MEovc1NRY0NOa3UxdTZCa0VXMktoSFFXSEVpTkFxRnRQRHhZOGxqSFhWTUxIWGErdWJIaHQvWC9EWWJUSTcKZG5yT0RTb3NXS2tzMHJuSXNhTXBhcnkzS1FLRUJEZzIvcjY0c2R0a2JPekh1VlBuYUdyc2ZBU3R1cUN4UWNzTlp1eDhOTFFGTW5ZKwpiaGgxRVdPeGo4bXZqTTFNQzBpQ0Z6c2Z2Ym8zTG5hNEJVN1FZcGtiVTRpS3RGalFCTWpOdTJDeGhJaVd1Vm14QVJVTlZDd0MwQjhECndRMktoUW1mVW9CaThUZHlvY0dKSFNLMzNwVFlZYWxYUUdLSHU1Y0VJNVpCNnR4ZmlOaHVEeUVRc2ZqY0prdkU1Y0dONkJad0VXSUQKR3hXQVdEUzhRVFl6K0xBOUszbC80V0ZwS25uVFliRUxrWVNHd3dMNnd3em9nY09DaUZYR1JzTWltWW1Vczhpd2dHR3hIMWw5NWJkWQo3Qk5jV0NSbUtWY3hGblo0VFhoVFlkbk9sQldtZ3NKMnJYRUNDZHNOL2J1SnNEeVJ1bm13YkROOWFMQ2RZYS82Z3NHeXVBdHZvbG13CjNjVE9RTUh1UXh3UWJIZCtMeml3dzBtVFozL0Vvc0NDU29GUUJDQ3dHSlBTaFh5ZDBTYmpRc0JDeDhYVlNXeXp0RndLQUN4SlYwUzcKSHY0cmlSV29JVk1xQ1g5MjNpUFJYNmYxQ2pmOWRSbzBHL0JYcU4xWnZXVDJLMUMyS05PN3lLK0xvZDJ5d2E5WWJiTEJnd3VDNCs4TAorN3BOcHI2QzY5SkY5aHRXam5HZGNUTmZsNkV3Z1h6Rk9veWZheUJmaVRkb2FoYTFrYTh3U2xHc2lCVjFIUXdlalNoZDZacktMK0lyCmdVaEQ4VWI1RTVCYlVVdHE1Q3Uzb056MFFyNWlDdU9vSGNoWE9KUmw4MTVuMFJPL2NhOVlKcUhTUDJpdlBKdEhHNm5pRjM3Q05LSjEKMXczQVZjQ1ZCdTVWYm9JZ3VXclRsZHdwOXNhOTJsVW9HL2NLQTBlendMM1N3UExsQy9kS1A0c25idHdyOFFrWWVvTDMrc1hsK1BHSAovNks4VjRiUXdQQzVlYTgwSXNvWXZGZUYxVXJlZ0ZkR3kwaDN2NGl2RElwQWVCTEVWMkllZUhBUlgxZlZ1M0FEWDNIQlhKMEg4SFV2CkJBUDRpckFYKzN2ZXdGZTFQcFREUXVJckRUam51Z042WFk1QXZlTjVvbFFFOEZVUnRkNDI4SlUxZlNTMVg4QlhCcFllSjdNa0srb1MKa0FmeGxmRUxacXN2NU90MkRJMTg1ZnRub1lEcTR1bktJa04vSVY5dkkyUHV5Ukh3UUw0UzZkQ1VwdG5JVndyTklXSUo1R3NpYkRmbgpqWHcxdEtLOGtLOVVDRklQWU9Tcm1HQ3RiT1FySGlFWE9UZnlGZVVaV0VJRzhSVmxSVVFtcTVwMXVhbkd6WHVGSnNsUWFYck44RWt4CkNnVHVsYkdqcWk1L0cvZkthRWRYUTJQeEJ4NzM2UXpjS3cxTmxYbW45b1hHMmpmdWxjZEJoRE53ci95MVBGKzBWOGJvMkJ2WnRGY3UKQnl2ckwxalB4d2dUYVlNSDlvb3dqUHMwc3pvSXpDYXNFUVAxeXRLSlhGK2tWeFFORVJwcjBPdVk0cllGNTNXNFNPdkd2TUpXVkpGSQpWZnR3dldoQVhvZS9oaHZ5Q2wzYU10TVZRa2pSTW9Qd09yb2lPVGZnZFRSWDI1dnZPb2FLVUUxM1JZaUZyUElMN29wK0RSaFRBKzdhCmw3dGJtdTNhSFd1NzBhNWdEaUZvRkdUWHJnaGVjRjNKS0JydGhYVmw4eEJrcGtSMXhSSHdoZ1hVbGYyUXgzZ3hYYnVyTDZPTUZUMHMKc2lyWFdiT0dNOGQ2K3lhNnN2OXdMUnZveWtMcm5EZlBGYXdvT0hrM3poVXViOVk1TVZtR0xvRkZsMEdZYTNVVjRNMXl4ZHJSemV2cApZTmE1QWJBTStlTnZ1T0EzeUpVTnpVZmVIRmYyeXNsbFkxd0JJSVZ5NWFhNG92NlJMcmNocnExcG0yQzRRdG1DdGZHTmNJVU5ybndnClhLR0lhVUt2Y2pVSnhZeHBiYnQ2dkZVbEpBTGcycXJrc05jK3JDQzY4YTJvQjJmSnU1a1Y0WVFIdmhXMUpKZy9iM29yUUJQNG5ZQzMKdHJsNzBuTE1SeFVNeWJvWHV4VTJmRHFCYm0yZVhvTGNpdk1vSnNSRnJoWXljSVRhREc1RlFuRWNkUitJQUVYaTJZMXB3WlV1MXdvQQpYSXJGRGN2cHpXeWRiaVIvSTF1WFZ6ZUJiRjN1MHhQRVZtaDZpWGk3Z0swUWpMS0kwYnhXbHRDc3RYR3QwQ2NqQUhmUldpVmozcXpXCjVUQjJvRnJ4ZC94S2tGb1ptSWVySGFUV0NLRUhxQlYxUGVBZzNKeFcxT2h4N1dsTTZ6TEdMeWl0eS9IY0c5S0tuSURlakFnb3UySTcKeEtxaU9lWHhnclRTU0t5dzVWT0pHTTFjTjZTVjRXejRxamVrbFEydUVmb0xTQ3NtZHNNQnlXaE4wWjdnWXJTZUk1blJDZ01STk1GbwpwWG9mUVltYjBRb3ZKbDRJcGFuZ2dMTjN0aG10VHMydUY2T1ZuaGRiUDVqUnlnd2tacDFndEg1eDJDSlk5ZjBZcmNzdFcxNklWa1JkCktmUVBRaXVpcmxHOHdQVU1wdlJrWXV1V3N5eFN5Z3h0eFhBQmd3cEJUV2ZGYmt5ZzNIQldGaVhLcXlhYWRRVmZOUT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJaUtzS2wxMm9WcjIyOFAxWWNoaWJvV3ZUOU5xRWhmRW5yM09CV2VtR00xOGZZRll1ZHBoYURqQXJRM2l1NGR0NFZZYnhXQnRwTGl2UApDN1hTbTh0S0I1ZmtyYzg3OWlxZHZkb2NzeUptam04Ynkwb0xPN0hlV0ZidXdGb1lZMWw1MFpoTWpHWGRmOTlZVm9aeldhMXZMS3NxCmMyZmRXRmJtcjFoZGNHRlpHZnhtZzdnUnNyVkh5czdnc3RMenpRS3NucHBDZUU0NWJTd3JZdThzT2pLVmxmOWVoSURkVkZhZUVlNWMKVUZsVDlCRUlLaXZGK3hoRWJ5b3JqZnlvVFdXbGdVT0txYXdjekZBN2NGTlo2ZTNodklQS0NnT3JZNFBLQ2dQVjVqZVZsWXRLanYyaQpzbExac0JReTBxOWpkSmhLQ0cwcUt4ZVp1R3VCWmNWN0RkRitVRm1WV3l6MVJXVWxUd0pJZzZDeUtzR2QrcWF5SWpiUE1lV21zaExvCjBRUmQxVmdJeHQ0OFVGWkY5RFZlYlNvclZRd0lGQVdWbFlZaUNpc0NXTnlyS25Cekt0cWhpZUs5TnBXVlhMcWtZTjRRNGkzcEJ0MVUKVmdnZUVPb0xLQ3R6YmZNd1dhR0RZZERpWnJLQ3A4WDA5TjRLbmdPQkM0YXlJdTNCOStPR3NzTEk1cXlDc2dJR1JIY2dvS3hJenpCQwpkRU5aeVI3RGtqT2dyRERRWXdzb0t3MlFTdDlRVmdKNldNOXZLS3VJUFI5M002Q3MzSTIxTGhlVU5UVzdhUUZsUlYwcmx4VUJaVlh6CmJqQ0VENVNWYVN2V214akt5cE91OGdVSVpRVytqYUNBaThrS20zN0xUTlpFVWsydG04bEtBK0ltTjVNVlJtTEhnc25LclhqOVpyTHkKd0VtYytNMWtSZjVQbkFveldmRmtpYThLSnVzMjNFeldZelNURlFkblFDSm9xNG42NGp4ZlRGWmtUT2wwN2EyeUZqQ0JaTjEvWDBUVwpzQVdRTlJIU0JTbUNnYXo3WmJ5QnJNeDhvaTQ3Z0t3c0ZVWnlPb0NzVEdPWmdIKzZ1OE80NUo3cEMwWVNDNnVTQUxJeUdhVy9kNTBEClgvU3FtOTlVZ3Z5SUIwRkVBLzRWNjhlYngwcThWWk1QcWV4eENkWmJBRmtad3BrM2o1Vkl3Q2RMVWpQMGFhZ3FQbmlzL0ppY1BMNDYKVEZTNUJ1YXg0dStPQkY3d1dHR2dwM1B6V0dGa29ENTRyRFM0R1NsNXJEUThPazQ5MzBwV210UkVWbVpYS1hJS0lpdjBhaXlKZXhGWgo4Wmk3T2VzRVlyS0NmNmdmS0lHc2xHOFJHSElCV2FrVHlJS2c2NHZHK2xuWlhBTlo4ZGF4ODlPTHlBb3IrY0NieUVvTEhzbEdzdEpDClFkdU5aT1h4Mk9vOGtLeFV6TEVxTlpDc3NEQnVkU0ZaNldBeSsya2tLd2xXZytxaklJY2treUl2SnV1MmJTWXJKeVBxTW9QSnluczEKeXljb0s2eDZwUXhsaFlHTC9RMWw1U2JVek54UVZscjVoQUxLS3Z6WE1LWlZ1TTZzRWU4RlphV0k3akZycVd2bTdCb3FOcFNWakFLbAo4eThvS3dPMnJFOE9LQ3RySUtsVk0yNlZiejJ2KzRLeWN0R1NqbTFGTDdSQUFHN0RUV1E5Um9OMjBNSkMxQkR6V0wvNDJOL1ZqZis0CkUxV1lpWU5qVlZWNTJqUldlT3RjWVFXTUZaSGNYdDhzVmdTSldGNXJGR3VYdW5xVFdLZEsyRjhnMWcvYklERFZTRlhJSmhBc0RCQXIKVnMxbzBITnpXTEdPNi9jdUErckVEV0cxM3ZQRllFVXRJSW9FakdCRmV3MXhTRVJnUmJ5eXBmb0NzRUp5alFwNzgxY1Ira0xOYk5CTgpnWldGL09QR3I4STJpV1FWZlJWQnVtZHU5aXBVOVNpV3VkR3JVR2Vqd0NMUXEvaDdJY1J2OGlyK1JubnZUVjRsdlBialF3anlLclRuClVERHNVNFBJbHF1Umd4SmpNZ1J1c2JDclVGY1hmTzB1N1FLVmJ1RUdYZEJWS0crSWw5YUFXcGJHOTBDdWxzNlcyQmR2RlI1RXhuTEIKdUZYMlhudktwcTJDYWxlZitZYXRsaUk5d0dhdFFndmVpR1IxU1FRTUtDQjZrVlpoaEdRMFFLdUZoUHQ4T0tzRkViVlMzcGpWc3FRawpKV1VWbVZBeU5mMmlJTlhNRmdrWFk3V2FMUmVJVmNiQTF0aUVWU3pZdWE2OUFLdUlUcERuRXJHcXg5UUM0MVc3UlZZM1hSVTI2b3dNClY4VStTNWxKUlVvZjh3Y3V0R3F6eENuSXFzM3Q1d0tzMm1LcU9XQlZxRTRZU0RkWUZaSUl2S2ZHcXNJNUhPa0ZWVVVnbEFrdU0xV0gKRVRPQlZCMHM5SHNCVlpFQXo2S2xrcWM2alBZSm5DcDJBWUxncHFsQzZjTDhsMkdxbU0zQlh6WkxGVElzMWlsY0tGVmNIaWJwSUtuaQo4cGxCZFhnUzRVT0VXbStPS2dKdjBDMEdScFhaYXBFVG1hM3JLdFMvR2FyZFBQOUFxRWFKY0JCVXUrdi9iNEFxR3g2VXRmbXB1K2pUCitOVEMwdVQwb3FkV002OENuZ3JJSjlKalpxZTJzdkdSRzUxS2tFU3VtNXphM0ZZb3dLbk5Lc1dibXdwYkVRQ1ZxbHBTSlhyZTFOUlcKQkpxL3FhblZBdnVBcHNLTFl0YzBKODlRL2NTZWZoY3lsYUtEVVRZeEZhUU9mRGdHcHVJT1FFbDU4MUpoZTFiZnVGVGdGNmZFTjZTbApGcVkrMGd1V0dpaVZZS1VXbGwvblFLWGl6NHlydWtpcHVCdVBoRU1FcFJhOGVpS1pNTUZmV0psZlhwaFVWUDJ3N2t1RkZTVnIrZ2hJCkttcUt5SFc5R0ttc0FjaHRJMUpGdmxxYmtJbzhaUjh2UG1ydUtySU1QQ3IrQmpRazZLajQrNm5yQlVmTnlJTTg3YkJSUVJaU2grbkIKcHJDVkgvcE5SaVVnM1RhQVVTSGdRSTR2d0toNFdiTUFwNXVMMm9BMmVnNFdGWE1qbk1LZ29pSSs5SWlsdXFHb2l6WGo2VEJSS3lzdQpEeElWNDVaZW8wTkViY0xkYkNKcThwUnBJQ3BlaFpwZU9GUzhRWEEzZ29ZSzNTVFNGMEZEeGF6SXk3MWdxS0FrUVA4UUxGUUVFSldpCnhFU0RMSHNlbjBpb1VNKzBBMExGbWwwL1F2SUxXMitXL01hZ2ZyeFlnRTFzQ3FvRm94dUNDbDF2TFc4R0tzSVBwUjRFS3FhT2NnQ28KeUhDbS91YWZJdnE4NXNHZjRsVmwyd0RUVHo4bS9xcUt5QU0vTFhKZWduMmFQVE1IK3BSbHZYaUxMdklweEJWOWJPNHBGaEFrNFFYMgpGS1ZBVC9wRVBRVUF2bTdvS1JKbGoxd3FESjFjdWxBdGV6RlBKVlZnWTNaSlloRkRkS3RsS1VjZWxycktvZHpRVTBUVFJZczI5UlFHCm9lRU41L25pNTM1UEp4ckQ1dkQ2TktDblVBVkFjUlhNMDBBbkJmSVV1YXNwU3VrbW5tSWxEaGxrQUU5UjhneWhTUEJPU1J5bzY0VTcKeFNnRVg4RzAwMlpTWThCTzhmZVlMOVJwYzRZN1NLZklEaUx1SHFCVDBrTWc0NzA0cDYySk5oS0JZaUNTNEcwRXdCVEFEK2VuTnVWMApwcDBCcFEyTFpkNEJWUzBDVFlQVitJMDRoUTAzTWdpbnk1aDlBMDVCaHRTL2Jyd3BJdG1ZOVlKdWlpb1lCcmE4RFJKbnlDemRiTk01CjFkWXowS1lCOWd4bTZaaEtWOXhnVTRUWDRGK0VyVThKUVFOckduL2ZWTk93QmRSMGVIWU5YT25vV2tUZVRGTW9MSXZrVzdUTnBOQnEKRUUzMzN4ZlFOR3pCTXlXRGRkV05NeDFHS053MFUwaE1TVEl4ekJSQU13UjZBMlpLd0ZrZUw1YnBjQy9hUUprT2ExMENYSXBYdStUeApBcGtDQm1yOEtZVmUwelR2d0poQzZSYlV6cUNZSXI1V0ZDOWtMSUovbDBNeFpSd3h2UmltMDVDWlFKaE90OW9KZ3FrYjI5NzhVc1lzCld3MThLWE9jSWlkeHJsTU90Tjd3MHFEMkJMdDBUamVEQ1hUcDlNZjNJcGRPWmlPbDMzSlJFa3RjQWx5S3Y3UEN4WnRiU2x1YUcxc0sKMWl0RUMwRXRSWDBLZkxBYldycE94ekJXZGhFRk8xSXdTMW5sa1YvRVV1Q0JFQVVLWUNuZU9lbm16U3VOMXI4dlhPa01BR1BRU2xlcwpWZ0pXeXJLck50K3NVcE5vTjZrVTU3UDY0WlNpNklTVmVEZW1GR0ZCb3Fvejc1UEtFZ0pTdW85d0lVcG41QkJOS0oxT3NRU1BORDd0Cm0wOEsyYVBvcDhLVHpxUWJ0N0dqbzVwQWR0TkplNkJDdzRoTUMvR2JacE5TUFR6ckcwMDYzSlI2azBuSnhlamxnRW5IYytwUFE5bzcKbmxPQktyVGE0ODRlUVNYOU1LZ3U4NGFTZGtkN041TzBQMUU0NmJMYmJiaUlwTWNtSUdrM29HVURNVWRXZWMrTFIwckpTdjIyYWFRbwpLd21NRzUySzZ1cW5GNHUwcnFnTU5vcVUrdlFlSFpla0xJOFdUenRuaU94T0tvb0E2dGd6eUh1bWFsUW52bDhRMG1hOXdHYVFJcW5WCjJpYVFqcURnM2dCUzVBOGhJdy8rS0ZkRDNnaTFvU1FnbW9vV0tncVVBeFdEN2xoZVc3TlVUSnM5V3JONldyelFveFdMNndDWjRrYkQKb0pwb2swZXI1WHczZUJRTjczVFdUclpGcmlld281K2RreCsvbytQelg2bWpmeXQxbFAyWEtETEFTUG94eGtveVc1cTcwNUpxMTVQYgpNaTF0eDFjVUt3bkd5MmtJU1RDMFdYTzZ1enNodWs4Y2YycDFCYXl1RUwycmEwbW90VWh5ZVJqY2hxYldJOUs2Y3c3RDRJMzFYc1kvCnNhajBPYlFBZ1psQm84TnlDQlpxdk1TeWZvUUxVS3VxUlYrem5UMGZKR3lKQ2NmS2hDdEtrOHZUbUxJSTU3d2M1SXVyYkducVRDWlkKT3FRTVkvV1IrRTVqVklFT2lyd3UxT0xDSjlUeTBXMEZNZ3RiY1JjSUJ4NXErNnppelpiazZLQ1Q3V2x5ZjZ4WmdaelVYRUlKQyt2ZgptV2tsTkF1V2tzNmVoTWpSMnJwSXcrNWJnVFVwTGhnV3lqZ1JnWjRCNW0vdUtjMG1yMWoyc20zNzR0bGlQYzlBKzZOUmt3MWxJLy9lCnEvS3BiQTNIeW5rV01pVjEwUDJZaXh2YmhaUEppSDV5VWJ6RUh1T2RDMGpNSXl4cnFPSTNveXN4V2FQc3YwUGxPMUErc1ZCU201NXEKNjNCL0hTWmRZRUhva245WC9WMERza2pqVkVQdHhsWTUzYzIxWU9rdEd2NGdza3hMTDZjNXZBQnRrTkJTUzRWSHJqWk1qemlncVR1dgpyajBqSjhibFJkSjJEenRoUUJHYjJTRWJqZGZaamFvcjE0NlhvRTVEcGRCemdEQlVQaWFFcnRGMVFDZzFURC9FRjB5WGpPRVc4bkVyCndXQXhLRytzV2xRTlIwb1JqK1czT3YwcDBaTGliT0gxZVQ5a1B2QTNpMUo0ZkZiL3c0SUJIcFlVMkFCOHQ2eW14aFAzOGJzS3kvQlcKRkR3QlVOV25wTXpqa29wdzlRUDFORHNRNC9OU25XNm1wUzUyVkhaZktIdzJZM3F5aHBXQ0RWcEI5S05sOEJjNmtWVTB3S25PcktqWQpUUWNmbFVMRFNnaFRWaEcvRHNXd1gzN2M0MUtXcVBSZUx2Q0VWZG80RWsxTjExZUpPQzRJdXEwc1dZN2pGVS9Jb0hFODlZOUVySVF0CkJ6QXFaM1dsWm5OME1OMzNyYVVWekZGWSticnd2V0dPRGt2bXhaYmRybC9rTm8rakVHeUR6VzZPUTJFb2JpZTBQMzRoOFkxcmtqNm0KTWM4b3dnN09LSDVtM3djR0RPazdJRjZCcDFNNStBM0RWVUFMd09pZzZ5ekV1ckg3QW1vM3NLTTJtNGJBOGJIeU8xZ3FRTkV6V2RKdwpKUzU0a2p0U2t4Y0R6WVArbHRBTmY2ZTRPNCsxdG9tUVhlOG56RW5zNTZyNmZlU2YvVHdvZXVBM2hlZTdXMEhnUk9uM0xFdUQwMXpDCkxPa0NrMzhReTFzeW5BQ0hXQVF6c25URmJ4RllFSURuODV1UG4rUlhpUVp5S3o5Ky96anRRU2YySkwzZ090YkFnT09xV0xiWEpFb0kKVnVUOThKdHFQem1ZeVM2MHlNZWs1bXpGbnRuNERDaXgyR05zRllQNndheGxiNjVaQWl5WmxLelV1T1V1SEhqSmxLeGpzZDNRUUZjUQprTU00cithZ3JWOGpIcXhVUERaeXUvRzN6Z0h6Q2ZrbzNkSmZXa3BNMGFoZDVMcUdWaVRadXh1NzhVZ01FWEllaVY4c2dXM29XY215ClJKK1pYNFpieTdFbkMxWW1pQlFoVm9XM2xZaGlEajZqUzYzTzdpWHNGMENRYnRORC96alM0ay9xdlVQTUFQSVR6ZTNEYnhVNTZ1d0UKRVBYbncwTXhCRnNmbzZnZkwyWjcrUk5ZZWFCYWFEaU1DOHZIeUsvVEp6dUZmZDlXMThNa1FTSThrVFdUbnpuK0E0YkhiOEhIRGEyeQpKTDdzaGVITi9aTStISlE5dVBIVnhCMkFxNXZQbnFWaWliRXRYeVFFK1hwN2t1RWIxV0p3M2d6a1ErZ3Jza2RORlNMNTUzQXB1U3lCCmxYVXNzS1FzSi9OaitIQXowSmN6R2lGUVNYbnBWbVMxdENMRDcxY2JwUlNCZGVJbEl6QXhhMG1kcUdQdDdvS2QyRmYzOGxMVWh4ZFcKUWdwZ1lXMHNjQlYweG1DaDMxc0VkZk9lVFJoNnJaeVRlakdKRmZTeHRsNjl5STl3NXhOYjVGS0Jvekx6dFIxQ3FIeC9TelhkS3JvWgpraS9RUnJpT3pRMW9VWUgxdUxWRkk1bWNQYit5bTFSQmRRUkYyZWhSM2djVkpGOU02TXo0aEhxZ2FtNExrV0RhTStadzBocTdGR29mCkE1dXVxaWg4Z2ZOZmNyTVlxOFQ1TS8vMXN4M2RRc3dUeVBsdG1IREFxYWVaNDNsWnB0Qnc0U0lUVllHUGgxck5GZz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJSFp1eFpxNXNwVmhVMVVIV3hneVZXSGRiRWpUaVh1eWloZi9BODRXRlZLL3Vya25jTWI0aDF0dXcvV0ZSTW9lV0lzUGlDOWRkK3FlTwpyZEVqcXdWMmkzMDBLT0lNTGo4Ri9sa3RUeGRIMHVHYzZoNmROS25YakdFQmYydENRc3FTelRxenlXV0RKSys2OTlQNWt4eis2UGg5Ckx2ZDhtZXJYU1lrcUxXMnZBWVpmT3haT1BSS29VUkNNampVMVY0MU42cW5kbldENjBhc0hpa2YxYmxVMUYyR3hPQnVwY0R4a3Q4MGwKcWVmVGg1MVZKREFmdDA1YkpEaHgzWlRWSldlaHowSmliaTFwTXVvdEpJTE12dUpMUnNkVVlpaVE3R1MzbnlPMURDb1RaTWhyQzlXbQpwVW1UMGZDa0pyL1R6VllaYU9HZUxESkdKSHQvSkRYRkkraGUyWkJ1eW04RDhWZXNRR3YyUGVzSVBBVUFwamkwdzVtNDlQaVFOVVl5CkJ3VjlGVlhNMjZMc1UxWHEvbXlIVlJWblFjQjA2cU1JbHQ2ZmZybXJGb045M08vbFR3bFJKRG9TVkZlU0cwVGRwK2dzOFRrajFjUkEKR1FBcUkzaHUxVEFXSnY5SUhFcTVCM2FsN0QybHZpTzBoUUhrYWRZMFhxUktQQXZZY0VzV092emEwOTRmbENqNWNRa29heS9BTzhpcwpIWEVkSkY0THJoWjVYeW5oS21yRFU1S09UMEtBVy84bzJNZ3laYm9IZTRoRldESjhobWF3SHFzRDZEUGszSUtLMXo3NURGUnFWSGtwCm81cTdwMGdqa2J2VGJaZndqVFRyb3JSajk2QklLY0RrODFZamVNclVlUTdiZ2dhZU1mUWM2L1NpRlZGWGptS0E4M1BhaGw1U0hxRXQKZXRIRFp6dmJlWFZGcHdsNTY4dENXWWwzREdOcm9oWVRpOGNmd0tmT0JlOStYVUVxZ1JPaEo0bGdQRTZXZlhTYk9EdWRrdGhzaU5GagpVajd2Vjl2bDd5eHMwejJMZU92eTN4UjFQY1JJVGxucXhzWGdzVlU5Sk5KZWhlTnBlclJVRmRCU3U1Mi9QZHFCOUVWbm14TDJxU29CCjl3VmJwb0VpZmxVTVRFbzFlcmdoRjA2cUc5UmsrckttdXBnVUxoMVlJc0VoREVUYkhXTEI5MGdmaEtGTkJsWWgrb1lRbUJiditlRVYKNlFkempjYXNXSnB3dUs2VVpJcWpCRkFMREE4bGNOaVJzU1d5UnZaM0JjZ1JoZkpKcEdrMk1lMTJyTkxqdVA2Z3l3dE1TeXc2S0NrZQpmai9zSWliN3FSRDBONDU5MlpNNkFrTWw2dHNRTnFha0dwMXZOUElqUU0zN0NrYm5sRitnR0RGSkJWdk1qcWlQUExLVzdJcm9FZUh0Cm0wa3V5KzdVbGtmb2dHRWQxVDRmVy9JV3Z6MTBBaC81TUlyYXdZSm5wdkg4OFRCRDRWT1ZBSnoxRFA0RUN1ZWowZTFIOUQzd2JDdXAKQlJTUkluYlFteitWNWp0V0l0VXpJc2dDZ2c3Zk1sZ2Z0MWNYdTRvNnlhVEhwU1VUOGZreHZ0WUlmN0p1R29NY0FXbGRGczNzTEpzZwpNZlRxOGNOWG5EY0dEenMxa2NONm9lb1lpd2l2SGZwangza0ZOQTdOeFpScUFacHRhSGgwbjU4cUxTbm11WjNzb0NWV1pidkptcmZiCnFaUEJzUE5sZ1pSdjlmQW50eFh4WVhvK3cwZ1hWQUx5WmZ6czVNY2FJS05PdXFJNkhzSTh2Sk5xa1lYTUUzdXhkd1hBY2hERU1xWUgKek50WjMrRGlOcHlpdVd5dnhybmxZaGxJeGdjMmliMW9lazAvdmdINUFMbk1IZDJFc1l1T2dmRUluUkdnT0N2a2xLaldFb2FLQkJBTgoxWmNQSzdYb3J4M0pRT1B4ay83T1ZLM0FiUWs5TFE3UDhuYktEeEZPd051OUdETEtVZ0hqSXVCOEkwekttWVNYQ0NqVzRHYndhSGxCCkpnaGxLcGJ3azhVdHgza0sxUnBKV0lWZzRBVWdwZ0ZHTHRzWUY0UHRZRUVyRlJwMmp5K29wL0NPOFhEb1ZseTYwcENaZmhmQ3FMQ2cKSm9BWDJhd1M0Uzh5WUY2YXBnVnN4KzVVT2xmOGI1WG1FQmZMd0pGMmRHa2JubmRMRkc3QzI2WHFjMEJOakFmZkFqR3dSSXptbmtSUgo4NUtTWHNlY3ExQUtrQXFpYzFCV0tsY1h1V08vZkxORUkxaEtSZkRKTEQ3QlIrNTBSajBFdys0WUk2dFQrckFxbGd3ckF0eXdLSTZNClBpc1FLTUhBakFBSGo1WDJqblFxYzNWREVCNEtDMGRZV0hqSW4wekxCc3V2TWpXcE9NV2FsTFptSkozQmZyNWtET1VPVlVqalRyTUIKV29UODlvYzBFTDVRbkE3Z2FDTERHWjBxVWl6RE1sWWc5b3ZEMUNpN2U1Z3VLQ0xsY1RNK3kwZmR6bUhvdWU3OUdHWnZpdVp4RzRiRgpRYUJRWUsxWWgwc21SV0RTbncyUUtPcFRvRGp4MGxpeEVFNWlGSnJ2SlI3eHNKd1BjZWNlMlFVQ1J0bHFHR0UwaEZSYlJwd0kzYTE0CnFvUWVSOStCSkJJampSQkZzdjB0c1VPd2NPS0dHSWowSXZqS0pWakswQU5CazVIcGU3UGRzUjB3V056cElQa0ZoaCsvRzBJUlJjSkcKNGxuTHJDeTI3VkNxcUxEeGVKY0tLTWRJek12RXhSTXNBdnhQemRwVGl1WEhEaEVicWo1WnFSM0dEM2UwY0E3RlRCbDlWSjlYcDRBNgovSEgxb3NXckNjOXVmOCt3RHNic3B3cGxlU3dGdkRGZ1JKUGFvUjF6dkR4cys3QVl2YVNQd2J0U0krZUVjWVl2Q0hsRmVFYVBWUjg1CkcyekdwQk5DV3JnSEJLNDgwSWJ4WVQwZThnRlZXVEhXb1lzZEk5K1BPYlE1dVZVUis4NFc3VWdTR2U5U01rT0tWbkxVY1dXTG1aUEgKc0xYSFJMYk1ibmhqMkpMUHA4VysyTHhMT1MzblYzUU9VMW1yWXNUTkE1R0UyenZoNVJKSEdpVmovQ1NReldJT2ZpNlA4Ymc5YkNSSwp2bkowNHNXSGx0ek5PV01TOUxjb0MyV1UvRjRyazBOUTBVVjdBSkMxdEU1MUVVT204cmRvTzdZZjRUYU1mS0I3NHc3RlEwQU90M2hGCmJ4VW9ZUmlhVzQ3bFlPanRqOFlETmliUW80U3NudTJ5bThCUm1WRHU0ZWd0SjdyaS9CVi9jU2R5aWpHcUNtRmpkQ3pSWWhZV3FBZGgKVVIzWExLZTZFMVo1SWxQcW1FeXR0cnRvNzU4a0NZUXRzM3ZNemhCc2N4VktPU0xlVC9oYlU0K2NpNGlNU0ZIbU5VSStxOTNRTFlkOQprNk1iSnZnZk5YdllhM2hMWVdtUHR1bWhrSmQxNnBheDB3RVBOYm9zSE9Qd2U2M29GOWY1eFNyQkp4SlRLK0c5UmNpSEl4UUtDZVVmCmRIVld4TGx6RzdsS1U1Ri9waFRnem1RU0NKMEVvdTlFTnNqU2dKSWlrZ1ByTEYzakRRdW1ZRm5QZEhLUGVUVnNzNW9ubDNoekNJU0IKLzRFRkYyY2FOc2h5VnJCandRWkw3MDVQVTZtc1BhMnZoSlZkVzNCTkpIbHh4S3FrbUdVVjR5dHA1N3dqSEVLaG5xQ201aVNGT0FsOQpJNHdreUdaa1JIN2EwR1RROCs0ZkJrMmlqV3JNeXZTK3BscjJ4WUNoTVUrN2JnMCtlcElOcGFRWmdlYVJHcWVwUjRzNC9tS21LMEk0CmdYK3hHZnlBbkNHckUra1NLczN2WmltWkRhbTZoMWVFVXVVVEdzeUNTWUVMSTdvc0hLblo1NGJ1TWpsYStNVU5mczRoNDhYQVZCQUwKd1Z1MkhuaEx1U2pmblJtWXhidU04aHZYdE1EWUpoNFRmRlZVUFdRR1psSFh3ODFzR1J3R0VBc3FWb2RsYWlpeXRtdDh5MGhnbXJKOApMQi8xays5VndWNHZZTEN2ZTJuOThTcHp2WUFxcCtxVzB1d1pCd3R4VTRqcXkrbER6cDFwbTY2S1FBM1p5UTA5Ui9lY2tGaU5oTDlaCmJBMERwek51TWNiYSt6MXdZbWh0bm9XV3MvNE1CTkNnMUYwL2F4N3NTQ0VDdzkycktYR3FoQVdiZURGZC9RaThVVjJiSXFkbVNuYkkKc0hwU0lwcjEzVWpjVVVjSkIyT244ZzUrSExKWlpadGp1MUhqM3FDTkR1SWh3eFF6Q2o5cXhGMWg1YjFHSVZqMmR1SVFFeVR6eU5JaQpGTGpkZmxnNTFhb0JkeDZSQkx1Mll5NkxHYmorNkVscXoyYWlDTVRuakdBSE1CYmhOQVhGZ0tYa2ZCTVdPVkpGenMvWmJqV0RUcUQrCjREUGNGc0JyVXNEWWp2VnhGNW5sK1ozMTVUeHQ4Qks0YUE2TDdtMVJvUDVzbHQzWG9FWnQ0N1l3Y2g3NGdHT3RiSStjU1BqMW1RMDIKdVovVEFkUTJUNHBZZVU1S2pOdzZBQloyRzJDZVFpazZrdzhSU1Q0Um9obmRjeEZmN3Q2T2ZSZGhZYU1mNXU1WERrdEUwV2Mxb2FZdApkZXBoQmh3dUFLb0IwYXdJZVFuQzh4Q0VacDZHMFFpa1FoZzJhaEdjZ1dYNlpGbUx4WHcrRXpWcVUrNjNZT2xieFlOREp6am1MeGtLCmgyd0hFMUhhL1hsUkN4Zk9XMkliWHpjOVY5SVZWQSttSDBuMktqcFhkWlhBc1dwQWxJWmNGbWFveVBKbkRoVWhwdExsYU9LcStZbVQKZStncmJGSklJeUNWOVh1UGtCL01QZkEvWUZGb0ZHOUxqay9rTWJFWERHd0lFN2dkRmR1YW9CUXVwcm9WaG5MdHFBdzNyQWdOa1ZMYwpSRkNmVlBQQXdrWXg2RDEwOHB2ZGpaQnJjUWlNRFphVFV4bFVIdTBHeCtnTGtnTzlQY3dwaGRYYmVSRkh5MHdLWkdmSmx3RjlDR0pPCkVKUnBaVFlOb1cwT0dMQ3dtcnN2QTRvU0tRMDdxTFJFUEsvUzd0QlNvc0tmYit0OXFIUnViQ1NBNGJhanlEZU55SUhSeVVqM0NCSVcKWGlhVFRtN1RrclNka1JrQ2ZDSWNpV29TRGlWaDBRaGlrTzdaYmczWHhaS3loYk9BVW1adFlsVGJnNVp4K1VXWlJGckVUY0IvUE5Jcwo2Q285dGNlT1JCR0pFYy9sWlltZU10bEphTWoxT2Rkd214aXowTUtBeXdFK2twRzlhbWRmbWNubC9qR0FEQnNkeEMvcnN1cVRqVWZtCmNKaTNhQW9hRWI5OXVtdlNNS0dKTklFUTNHaGVvSEs4S0tHSVNSdGIwQlc1akNXVk8rdzR5QWVMRVFodTRBcUxVcjNZcGg1TkZEbHAKUEJ3ZEoxaThIeWNXR2pneVpKRE12TnR1UHpRaU9sTEVVbVAwSE9velNjRndBMW1DNnA1UnVFWTFla0orSHplYnkwSGVhTWFCNGRiawpwSzRLdUYzRmJidHA1SVd6VXIzSys2UGdqUllzOWFnaG8wNUxFZmF5OTFTdGRkRWJSUU5IVjhUVEtUWExGbzlTRTFCYi9PVGpma1QxCmlRNXZ6c3NoVlBsSXpQZDJzMzc4NGI4bzVKZUJTREtYMlk3VVFBaGFsYTN0RnBVeFBKbVM1VHJGb2NoNS9vNGxxb1JVa0o0K1hkRVYKSHg5cTRhYm9sZDRRc0YreXV5YlRzU3RURXRnUEIxM0JMUzJVZTlieU9STXgwT1dMblRod1VhMFAwNFdMN0laSU5iY2RJNjEyYnRvcgpSbG9WaXFMV2lKMEI4UU1VUjZBSUZ4bTNYS0xNSHBiK25GQ25SSDJzVGs1eWUxa2pnVkwyeG9XbytsTlRackgyUllaenpNNjVqQm9rCnIvM0JKK0Nna04wTU9yR3dPODM5NXRnNk5TWFJ3b3dERkN5c0w4K1A5WFRVdEpTeDkxUVpSSEVraXVKY050b2dmWGhLbktzUmhzWGwKTTF6bUZhcVRwTStHWWtZQytWRGhrSmZjZHE3OXNNME1SVVptdlFKY1pFWnJzY0lOWUJ0MTRrd3NQTTMxTW5nTU94WU1KWjRTVXRrTApDcXlKdXhOWittUWVGUTFLVnRSUDFJbWpONHlOTDk3ajdHbnhhTUZ0T0lJUnNUMVBoTXo5eGg2cllaT2p5a3dXeithZjVJQU95NGhWCkk4T2lReWZDSUNoamFvZzAwdEladVJyR1EzRFBHTkNoeWw4Nk5SWVN3eFBtb2hvM1EwS2cxYUpkbW52YWNLWkVhU0hiaDVYb05JTlcKOGl6UEttNktxMm9CU3JqeUNUMG1Ncnk2MnFwMXlyaEk5U3lhQ3RnN01ybHFqb2FZMVhkTldISDRoUUt6NnNZdWxBVW5JYXYwMEhqegpZMDhsMzFrYVFORklFNm8zTVc5U05hdUxqZ0VKa1NWTDB5MXdhckppSENwY3d1U1JuS1dxZkRqVWlhK0dLdGhZL0R5TTFMRkxBcGVPCmpxWENvbmx5Wkl0WE1Wdms4TkJnNVR6SkZ1aGVjRW1GV21zNE01SEVoV1VuRE1ld3M0ck1ZYlpJbGUxUmtPZXM1RkNoOW5GWUV2VEUKazRUb2pUbEsvQ1JYQlZnRThYTnJydnpuZjhpVHpScFYrSk93TnNzVWxRVkZxcEZCT2NwaG5kSlg3emxZU25RSWc0YURRd2JGaTltNgpUenFZbE14YU5LQzFDU1d6b2N2R2VnTWNVNnllS2ZtakNEQS8xZ3F3S0dIVUVJYVlES1Bybkc1MmlQVVYxekRxU0Y4NXJnOXEwaURFCklwWnBwR3YxMDQzeEJMS051blVZbGd4U0krRmtPSGlpQmlESGUwYytMQVRSc0xZbW9acmFzOTE3c2hlV0RyNWxydUpnSjViQWNZWHYKdFFrenQxU05ERS9yNmxrUnk2M2tYNlMra1F0M3R3Q2hINDRwaU9FUUNzU0dQdm1mL1JMb282UmNIT2ZUWTlLalhCejVhYXdldXZWdApKNVBmdTVvTkRvY3FPRkZUemJIVnNiQU02OXBUdUNCY0xpZ3FnVEd0NkxmbEpFSjIzTGplbXBEdVJkNDVIRjh2RFlmRHJoalNKYmFZClRhcGFDclc1MG9XR1BUekp4MDNnWWVUS25Ma0luZ0paV0k4VTNzenR5TEw5M21qUGhPWUFqSzA5VGxWd08rWWdPQT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJaS9nblNRQ0trWm41Vmk2UG1mYUliRWxpU0xDcUVtck5KdWtPYjRRRzJPNENVc2hCV1F6d1JNUExuaFMvNHh6RjE2N1BMUUNBMDZrMwpxdS9FQVVJd0krVEVEc2VwUWVXWW11eC9kcVpGbGFYRFNrRzRGK3dRejZjclB4UzA3NmFIbFVPakNhdXF4c1owTVFDaWlhd0x4Uyt3CnBUQmhEejc2anJ4Y3gydnFlc3hRNGRQMERaSW5oZWsvSzNLMEpPQlNNaUZxS0dDbG84NWMrWlIrZlRJa3g0YXl5ZUtwWGZNQUQ1S2kKV0dqTStRc2xKc2Z1TU1WWGJ6VGlqOThQWVV6bnBEQU12UlMzK2RYV3FVS2ZGUjdjMFBLWWxsNGRuaWYvQ0h1R3NvcHhSS2EzOHVOVwp6K3h4dVJ4MmJxN3VvUGZNNnFtMjYyUzY5SnA2NE15a0RSY3FaZDVDaDBHYmt6MjB5R2xCZVZ2dTkzYkdJTE1BVEF1N25lbERBN0FWCkxpaW9aYzJPZVNGOHBJcDZ4WlVnNWdvRlo1M3lZOGY3SGJKOXVnTGIxTFR6M0FhOTN4SEIyT1NHQmU4OUg2YzBrM1ZOdExCUkJYTGwKcXJsSnJnZEs3RHU4RjVNdW1SdFNrUE5mMVduaFVRaDFXMWcrYUxVc2RoUW9FWmt4cmwrU2RVMU1reTQvemFFNm9xSElVenhOTHExWgpSRld6OGh4ODZEQTBQMTZWd21ISDJkUGVrVDNuYUUxT2tFaUQ4UURqclY5VXc1M0graVZkWkRGSEVDNmZMckk0cERNalVvOEJqU015CnhwSlF6bEFWOThqWWxYSmRNYTBSM0NVRGk0Tmd5UDNzS0lBaUFzMTYxNWNiRWNMQ0pRRUNOTjErejU0aHViVFduRkk5eXFXaDlrYUkKVmVra01KSlFlamJkSy96SFdHMTNWYVFtcHMyeU93MGhXakpSVTZKRXRGVURDeVVNc2FNSzVORUJpYm1yN0s2dmlUUjhOcW9vSG9JUQp1TnU1Z2hJNmMxZzVqRUpVejVET2VQeHdtZFZSZEt6V1VFN0F5UEFjNWtoOEVEQU1COUVZU2VTUjZJaWpvSCsvNk9XSisxKzlQc3BSClBndFZNbUtMMU16d2hxRVU5ekZNRktJUVJXTTU1Q2NOamc3d0w1VnZJSk9rR0U5WWxFbWlTUExhREZtZG5wUjNVQjRkM2s1MmRmSDIKa3pLWjE1alJrYjVBK0JLSG1tUG9UZFJVM1F5WlNHd2VFSmVKa2dxdXcxZDh2V0NnNlNNY0ZnZWdydysxMEtzckhCdDdLcUtOK25wTwpwckFRcW9HMmdpdnJXSHBuWVhsbS9DYjhTTlpYWWQyTEgxaEtjc0hocHUrRS9LdjRIS01yOWNRN3kzS0NLVjM0aDB1c1BLUmFxUU5jCkFibGh4dUtiMVNYd0swWUVNMUN3RUlWcVRCRkRuSzR6cXlwSW9JV2hKcm9mTWRQVklqb3RyRXlNY2pQZWpLb1VBSSt0QWFvcVVLSWQKbXhzb1l5d2puQS95UTZZL1FOMUFubXdiNWxDb1NUdHVhM2Jnb2thUkRuZzdVTFRtbW81QWZwY3VRYlVrNzI5dlYyS1ZOc25CcUxjRgpWY214L04zVzFaVHR5T3hQU0tIQlVpWDNmbVdaV2lzdDB0RlZIV1NoMTVCc3JyT3V2bk84VnBWaHAzYXE2Z2FGSnBUWnorSkhvaytmCkxXSHNBRDdhYjR5bVI3bUxrL2hOektFbndnZ3pMS3MydVp5WlVoeFlxUDJFOTdwSFBCUnEwTGZ0SVVjWUNuTXpZOG1BQk55ZHpNeXcKOHdBLytpVmdFeG5OcGtsU3lnZThIR1pFK1huaEV3eEp3bDVzd1RxclZSeXFSbFRzTE1sQ1Z4dExuNUZETXJhSnBIRHJwby9IckRJcwphMGtHd1NrZEJvNzRWUm54dUVncGg1YVZtc3hvNE1HZzhEWDdFMUY5TGFLK3NZQ2h1cEFlRERJQjFJcEIvcG5zNVM5MGc4ZWd5SmtkCmJ3VTlFdzE0SzdvekRZOEVKVGtKRHdJK2xVbUlXSFVKQWVwMnQ0b2JrTUhhOU1JcVF5dTlRSkc2a0hrSENRYnkyRHRLVFFSL1RtTE4KcWFVNi9UbGVaWEYxRkxlSnB1SDBjQkd2MFdSSHQwdk53bkRaTExhaitKRktNYm9OTWZac2E3S3FocnFoVW4xcWZKTFV5OHAxM3lMLwpUTG51SEphYWNzSnhPcHdoVm82NXJMNmpMckFlbWdLdGZFNVE1bUdsZ1B1L0VDR0NSWW92Uk1Rb21zdFhUU0Yxbml4K0p5ODM2Wjg1CnFtQU9ubHFIWk9VOEtZekZpamltYUxFVEVQYmlSWDA0WlZ6MElVZzhxVXVCakl3WEhwWWQ3bnZXWmFWU1JrclhJa0xCc2VTcE1LMzIKM05idVNtdW9idEtRZGtIdjRoZFAvM3V1SmxoNUlWalIxSHZOQWtwMnFXbWlRQXZOQUI1ZW94bzlPNzBJdlRZVkN0Z214ZEl6dTRFdApXeUJBOUlVNkM5VVdwQmFsTnQzdVJQSUV3YVU1RWNGdWQ2ejZWb3JhMVVVT21nVW1ZN2dLVERmdEF4a1prcy9QZmtNOUNQYnhaWG5VClcyNkhodm1MU2c4bExiQVJucVdtajcxcmxndFpsMG9TR0JQa05TSS93bXc3TmYyUGFralY0M2tvQ293SUtNVjg2dFFjTld6VkJjZzgKLzZ5S0U0SjYxQlN2RkVOVmtCS09wcy9hc3ptSmw1MkZMaTBTZUJ0bzB0aTFtVmM0UWxpS1gyUmxGbjZIMjBpc2RzNXpXb21DTC9uWgo4UC9IM2gxRU5ta3FYRWlPQldwVVZidFp1d1VZSU1qdmVxbEtNa3ZsOFZSd2dsWmdoV3ozSnY0azJ6Z3dLZ2xXMHpnMUMwcVVwV1J5CkFDcEx1ak94OU1rWlMyVVNJQkFpMmpNME1iRFdvUWlyUXRycFVkeVEyL0F0aHdBc25mSSsrYVpJSnpMU2loOWdIQVlXNGxOcU1sME0KSzRtZHNBWFNwamdsckZRdnlwMVMzUDdxWHQybVJJM2pqU2wxNDg4SVNGT0hEY203YWk2SlJMY21jYkxhVWQremZKUytlbzY0WHArbQp6TU5DTVFjc1BOdmNGQ21PUFlXeHg5SWtNdmNLMU9jV1BKTXA4Z3E3b0tRUWZTQ3lwMmM4Z3RDU25YbEZVUm9CT1UzVEd6OVdKQXNVCkw2MzZIdkE5alNnOVoyQVB5U21GL0I5LzdoRGE3MWdpcWp1VnZFeVNKMEFyUXRvT0cvQlpQTUo2eUhKWGtVQmNRYmtMa2FwWnRaM3EKVXg5d1hPN0pkN2d3U2hSUmMrUXF1bXFvWGIxYzFPazRFYnY3cUNxWkRXVlNET2MvK2xtcTlBa2ZrZGdIMFJ1cE9nUk1rUUhEM0RXZgo1Ym5pcWN5UFp1VmNwSDl3VG9vcFdnazF1akxIZFgvUXNMSWJBR0ZjVmIrZ01xRWFnZWhoRGdvdDUvMUpEazhEQ0V6Nndha3B6MXJECnFXZ1hqN2s0cjhEclpHMGZia045RkdaalF3d21TRkg2bjF3cnJtRWY5YnoxNXU4OEtxb2lYZ0dTR1FaOHExZU4zSVFhWHNwSm84ME0KNDlKREdqWnEwM2w4MW53QlVrQU5DYXJPVzdGaGR3Vng0UXFzS1ZWZEpCMHRmclBETmMwZlRremxqYUJpVGc4ek95M1Bpc2NpL3BFKwp6QjdzQm9oRytYSjJGTkh0WWFSN2RZbTZwY1NuM3kzaVlTVlQxWDFTZmd0N3JxRGdicDRWcktyd0NvcEVkNEtSRmtaUitsQVVSWHVpCjBSVGpsNCs3QWxSM0lHVC9FR3BJYXBCS1VOU0VsWUFlWnJTd2FLNW40bmFjOHhCVWRxa3lQL0Urcm53RThwdGNKOEU2dTc5a0JqcHcKcnF5bTQ3ZHRsa2VMS0IrczlHaG9aU0Y3cVk3dm9yR1JmdEZLd1NFWjZjK2VaYldjSlVUajhXeWsxMjVhMVlONEdBZThhdndJOTBRcwpTdFdSdy9LaXBNb1MzamQxVlFzMVNuVThMSFpVdjVLbzVKUkFxY25pV21WMENtUWViK2lyMTU3RFlBeUlwZkhDUXNiS1lRcXZ4Mk92CjU0bFhuYUpkK1V2bFQ2TE1NaTIycFhyc0FOUVM1ZGZkMm4xa3B5TXV4TTRiak9qRFNnUUNZcVkyS05tWDNER1k4OXF6TDdJTGo4OXAKa3RlR1EwMlZGeks3UXpsSFNyWkVxVWxPbG9XaEtHbWs0dm1rdWdpZVpLNGN4WHlSU0F5ZlVOd2gxbjh0MVcwWHVrY3M0OUtFSzJFOQoxazk3NXNJMERKNnJLa0xiOE1UOERGZUUxaHBUdGNrZTdhcStWUk1FTGt5bXBtcTkrRmhKa0QzMWhDUk1hNHQ5bFhMYzBKRWk1ZUk1CmJBbkdvV1FXT1FORkEreDBmWUtBRzdpYlpKVDdGQWZIYXFpWmhCRnRxcDVpWm4zUHNxd3p5aUtIS0lrS09WZHpmeWRtNEZrdnpkcGgKT0tiYlQwT1lkM28ycGpxZDdueFhHVHpkRlJvbzI0Tmw2NzlDMThIeXVFZFYya3FINTRDc2ZWa1lmTmRsaCtTYVh1TVAxVzB5Q2NzMwpEUEkwbmtTdzhaQ2RNelR1Q1pWeUZabERFOFpqWHhFaHk4ZlNZWUZYMlJ1cnFPSmQweUlzbXlzQlZBbGRJVmdEZTZMMk9qaldNdjdOCldjbDZWbUQ0QlFrc0VNT3EwaHlyMUJmdG9vY3p1cUtub1VWaWlJU1l0dTNHRTlLalE5TXpqcmpvcWRmRnI0Z3NaUW9QQjRGanBkRzkKMFJweGIxemp6SUFWNVpmcjBmb2lVcDV5K3RmaitRbmI4UjFIRkxKVTdTazhCU3piMlVCVFNrN1hLNkRvU0o4cTZPanRhT0V3aEtPSApxSVIzZ0N1azZYVXRybFY1eEdua1VHS0hPRU9YRG9TSUdPalNydTNZQ3BwbFBzdFNoRzFCZE96czJhTjg3VEg3Y01wRlVHSTJLOGVyCjVYdFk1RHRPcFEzT2RnenZONlZaV3IzL2ZvNzBibHQ1dFp6WUlQT21RZ3VpUy9wMU0rZ3lLMTk1NzJCMzAxcGNkdFM5V1lLb2h3WlMKQjliTFBTNEdBeUhhM2IyZFJGd3JtV0tBbnh6ZWN3ZjFpV2dicmtBVTRTb1pwWWI0TVZFbWtJQ3lKR0E1YWNTM2xVUm1SU0pGWkFvbQo4c29TZ1BJMTVtaEZWbnBNM3l2SVlKT05WZjIyTTdxN05PYXZBRS9QSlEvOVovK2VFL0pMSVUzZVRLWlRZVEdHUzZvaTdIZ2dadUh2CnJDa0NFSzVESEQ2MndjMjZTVXBtc1ZsQmFIVVF4bThLak8xNlJsYkJzVVFwa2RXV3JJZFpUaExxSjVQRjg4ditBdmVrdm1aUjhVK0QKL00vbCt2L1lVV2w3WkJyR1Vya2dWUnRzWnV4aUs5WXM4ZGl0bjJRcis2TWdLdVNDMkNxOERVSklwSWlJY1RxSDFZNUdBbE9jMVZqUApPN3dDVzE0RnNteU9wVW1zNDJTWlVOOXFlcDBab3YxczY3SWtReUFuZzV1VlIrTWJGZEU1bWpURm5wemxZYVZPbWhaaUlkR0phWmVZCnhyRm0zTmkwSWh0ZEg1TjNsdk54TEdTbTd4Zmp4N2JvTXBOaU9pelg1bmI0VEI4RkR1VW56ZDNjeHhZTkg4TXcxYjBkWmhnRytPR0oKMGhtbjlyOHJ3NzhydlZnandIQXJWTCtQNElTUE1tNkRrQlh1cHdMNGNVdng1Nm1DMTVvR2d4K1QwMlFXV2ZxaDJuQnVFd3Nyb0lBWQpEQzJ1S3RMS24vWGJMdjQvbG53WHF4eHJrcENWV256bnczbEoxTEczWGZyVjVsWUhFUzdEcERRNVRUMGZXS2o4b3VheVNrWnQwenFxCks1TUtxa0VvV0tXSnVsclZ3OFA0bnVWNGIwOTdUMElsYUkxZkVQazFtMFRFYmRRZXFxZ0xXY3pOaXQrbllpUWRrRUVzejRjbnhWbWQKRXJlbTJxdGRrSkdNUkNXSUUyTklNemcrcy9uaEVQNUVLRklFZGtMbXcyVWpyeDMza1k0OHdGY3FCL2Rxa1hpTlFuWEFrSHBSZXo3cQpFM21lUUh2TWJSaitvcHMxc1pRb3hJREhsVjVjZ0laK1pnbUhhekpaRC9EWnovcnhPenB4LzVXai9iZHl0S1BDNElYUlJwUXNEU1d4CkdXRkVUSnZSR0VPMEVjMW14T05tYUpmbHpHc3d0RUdGWDEzbFd5eW1nTHRMdXZ4TjBFWjVKc3VlRE5DT3psT2JuNDNsR3Z2djNQanMKdkpRdzNmUnNNbU00ODBjZCt2SVljN096dVZ0U3BRcmpjamo0c0Y5Qi9FaGVLbGE3dWRuMUNiU21zZG1JRERGYkVOVHNadjNjQzVvZApmV2syTTV0RWUyYzRxYkdwMXFPOWlObkhhR0IyZGRQTXpjc0dtcEF3aVJ1WERiUlJMV0pqY3lxdVJTdTJEY3V1Vmc2OFdObE1ObVpWCkozT2dxS0dvQ2xKMmkvbjJBbVZEQml1ZXM0UGNBUkRjbUd5V0NGUVJmcU1ndncxWFl3Y2tHOFhTSEZHRGtVMHBReWx2UkhaekFkRW0KWktPM1dyWXdINTIvaXVvV2J6NDIyNitab1UwaE13NlM1NEZqTjh2M1hteHNBdUJhT1doc3hKL1VVczlrYkt6K2hrOXdZMktaQ3k3OQpjTEZaZEtiY0hCT0lmWVppN0lKaW85OU5zVHlNTXl2b3RNOVF0US9qYXBpaXlkdStpZGljeUxzdzJRUmlzeDdRNkhIaTY2SnM4SVhECmpxcTN6Y01tWlBqYmhtSHp6NlZuczRITnFDcFRBdGdvYkpHVlJZY2dDWHRVMFZCdUR2WndtR1Jqc0Q5V05FeCtiUXIyY20rL0Z3UWIKcXdWMlJBd0c5bExUd0NCZ3I2UWw0Z3VBVFVHTjlxRjdoU1B6dFF2NjlYSS80UmY4ZW5ablpZTjlEVUJFSjU3YjZPdXh4Tng2a2EvWApWRS9qRGI1bTFWbkpxaUZnZ0pjTkpVUkN2Sm5pYkROUkpTSVdKeDBKVStHckRiNkdSZG1ORzN5ZDZFS25FSld5MDBWMGlRbndOUzBTCmxNNmI3ZGE5REE3d05kYlBUMmlHa2IzQ29vY3B5QnQ3dmFyVGFvRzlSajhPYlJiWWF6YkVZT3p0NWw3TE9sWHZxZz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJaE0yVExQWWZodEE5cm5pOHVkZXdEaW5vemIxbW01RHVza2J2cDFqcHpiMWU1cmx2N0hVMEVRcnFOZW8xbXRkeUczcU4rV0o1WmMrQQpzOWRWbTNpOVpnalhMdUExakV5QkJ1OGFjWTJSODdlTnU4YlpOS24vZGlVekdqd3JiR1BXOVJvbWk0Wk9lUTBuSDI3U05kYTZUTzBFCjZIbzIxY2dHNWhwbHU0Wnlic2gxZDV1bXpiaHVTeDdiUmx5M2kzRzRoNjVtWmFZQjF3Qnk4S2VEYjkya3lIelJyWnZqY3NHMmJ0TjAKMFVCYnc3Qi9LYkt1U01kUTdoMWc2Mmo0R1Z4cjZoejFLVzJxTlhNVDFDa2FhdDBqYXhwTTZ6YjhTdDFJYXlTREZLTnlWZ1Fhc1AyRgpjSEpNVG5IZVBPc2FsVitCczY1UGFEQ2R0VWM1WkhNUng0WlpWME4zTnN5NlJnMVRzS3hoR0cxOGU2R3N6N0ZNc21iK2QraXJvdXFYCkpUS3NuRDhnYXl6cXBzVm1YRFFnbDZoaUlXT3M0YXlSZzMxanJITS9CVVNrV0dkT1pQTHhwS3Y1N0FsR0tGVmFic3o0NGl4ZkRHdlUKeDNEdEdBaHJRRkthZWRVa1dHT0daMlRoQmxpVGlQSW9qazU2U0l0aXQ4Qlh0K1k4NEUydnhpcUhTTm1BVitQWG1FOE5Kalc3K0tVMwp1WnBRa0J0d1hZTjRIZHpxNkNMN3dsWWo1YUtVcnFuVmRVVlkzTkJxSk9NWTY3eVoxWUJpODgwTFFEVk9xUm5uR0FicEdHOWdOWkRsClJZZGltU0QranBwVzVudGhVQkgrQmF1dWthY1BWald1bFpORm9LcVA0U0pWc3lLeXBrT3FidEhIUGtEVkxRcEpiazUxaTI1VndhbHUKVVVvU21Pcm1ibmczcFpvbEh6SXhFbzdWbjlJMlpsUmpBK1ZmTDBRMXpvaDNMUWpWSUV1d1NqMEExYTBxRm5uanFXSFRoMmcrTlF5YQpONHlueGlCRWljMU5weWFVaEJoZnc2a2htbVRvT2VEVUFCQ3BxdWxpVXlORnE3SGJhT3JhTEdJTk1qVSthR2JxYmpBMUZTT1BzcUtzCmRhZ09XbXdzZFlscDlxWlNJd2wvTTZsclpPY0RTVjJDVG40VHFVdG9Td0pJalFha0tsMDBqNW9kU1MwODJEanFqREtVcE4xRWNGR3IKdnMyaXprc3hvNXRFWFpqUWxEeWQza1JoWms5MU9nemVsbUp5NzRXaFJybThJdWltVU9kZFhCbHdhY0JzMHZyMllsQjM1NzNDOW5DRgptWVZ0OEpvWUdVMTNQVGdFYWk3UDJpRlE5eWpqRTMvNmNjTHVoWjkyYmVxaFR6OU9TRzM0Tk1iM21qK3hweDh4L1E1Nit2bVROM2dhCmZsVjZZNmN4QjZKbjhNWk9WelpsbFk1ZVZZOVZ1ZHViT1QwWmhHN2ZEblA2RVJicklLZVgweW92NHZSeUVqQ0kwMXkvSE53MC9od3oKdmVmeGJBMzRoazF6cTVJdjFqUzZSeHBIZlZqVGp0TnQxSFJYQ2ZraFRXL0REWnJleHVCTUw0Y21BaC9ORUdFYXg4QnpiQTYvN3EzcwpHRy9HOURFY3hQUzJCV0U2NzZyUEFFekhxM2p6cFZFTTBFZ2pGbDRhU3lXMkZ3cTY5TU5ZWktwdnVqU09rTnVZZ1pjV3BxRG1nNWZHCkI4MHV5aSs4OUVOSVl5a0hMLzA3SnQxcVQ0Y3ZEVkxCbU9aOTd4RUx6a2RuSGovdzBnWkhiTHAwRG1MMURaZkdLcHVwaW1CTEwvcXEKN1Z1d3BURVN6Zkx0alphR1o4Q0tkcE9sSC81a3Rab0JEaW5LeHovT3p6c0dXUnBlVVowenVBd2ZreUdHTHZiaTNHaHBPUVhTQW0yeQpOSW9sQVVFOFlHbmNxbVM1NHFPUGdHcnpGMVk2bTBpd3FkSm9TUDgwZ1NKSU1NQ3dKVVhSeFpTR1lLUzcxNEpHYllqcmpOVlE1Vld6ClJ1Y0dTcE0vMmkzR2xQNWJsV3liSncwRDVTQTNUaHJIS2sxdUZJVHp5TkYzcCs4bHlXMk9ZOTBzYWJpRzNiMHhpRlZoZWZqVXRiSUsKa05EWGtiKzlRTkxiR0J4cEtDSllUeHdZYWQ2aVZOOFVhV0pPeWpnUTZlS2lwTTJReGhZTStONElhUmo1VUlJZ0RTSENNK1lCU09QcwpyVTNaSlk2NEFBNU5RWTh1UzRqaURZK211bzArNVdGSDE5RG1CRG9hUlJOYy9nUVJHalFoeWlGdWNEVFdHTkVWazhiK0dCb1pzTkp0CnVLblJ4MmhvZEZ0V1h3UXorb3RUSFQ0M2hpQmo4aTVtdFByeWpINlkwZFRKc1d3dm1ORlVDRkltZnlHajhhRXlGckNSMGRoTUJPRlEKV0FGanpGalBSWXltTVYzY1o3M2NlVzFnZEdJQmFodHZZRFRlTDNJRXJoMjcrb0lZR00yL3AvbkV6OEd0RCtsUk56QWFNa2psRWdNWQpMVEZTK1VTTUp2U0JSYVZCaktha2tzSEZJRVlUNnNNYytrMk1wbFVNWVJPaitYaEdiNGNZVGVrSzgyNDNNcHBxbFZibVJrWlRxY0p3ClZDQ2p1VWt5WVB1dzR5Q3ZaN2c0a05GVXFqNnRibVEwVkRpaUZ0N0lhT3JhQlFNMk1qcVI3Y3NDQXlPajhVNktmSHNqb3lsc1pwQTAKa05Hd0VJS3dtZEZpSTVtVWZmb0ZKdlZYMnNob3FJK1VPUXhrTkhYQ2pEM2Z5R2lxeXhoaURXUTBHMll3dm1wa05BMTh6VzlrdEdScAovUkNqYWNDU2JST2pZV0hkNEFzWmpVc1MxRG1RMFJCcUsrWWR5R2pLa1pSN3ZaRFJiSzRiM3hGcnJSbTdVa2JReUdqRUpab3h0YUdXClIrQ01NZHdBUnE4bW9ldm1SYVBObnBvK0hsNzBhbEhHYkdBME54b0hGNDJqRU9oNTA2TFhqT2RxV0RRRGJvejhCaXdhbDBIUjF3c1cKaldLZ2lMS1RGWTFPN3VSckJpcWF2RjJWNGdRb0doRlJkVUUwSjNvVzRmdzJKcHJhbDZ3dzg2WkVvMCszMmo4YUVnMkRHSjFtUkdPMwphb3owUmtRallxY2laUk9pR1JTa3VpRUkwV3p5emJ6aFRZam1GZWRIU1EzbHBCNzNpTnFFYUZTOTlqcSt2UURSeTVXdG13L04xdHJPCmV4QjB5Szdmb2pkdk9EUnN4UlhOWkVQak1Bb0pDdzNOWHVDUGtKZEJoazRVSnlUakdOU0VKaWlvZ1liV1RPS09pQnNOTFE1Y2NUOVMKZGpzamIySHBXQUtMZ0pyQXNmMW1ROFBxQW1pem9XbEJzNWRnUTlNUVVPbk5ocWFWdFVuQmh1WVAxQmtrYUhqalRHaXQrZTNGaGtiQQptV0s4ellabWFZTUt1cU1BQkZYTi9HQnVPRFRMS2FoaURqZzBLaFNFN3dvNE5HK1FxaXd2T0hSUzhmdjZ0dUhRN0xmTkFIekFvVm5iCjhKZ09zK0hRckM3WldHbkFvV2xoSENqZzBMU29zK0lGaDZZU1ZTb2wwNkhaVTZpNXBsS3lEUEFpdXNzSU54NWE2bFNTMDQySDVuYmsKRXdVZUd0T1IybnZmZUdoNk5XcDFhRHowVWJFR0hocVdHcFRualllR1ZVNkg4ZEEwTURvWmVHaGExSHpxd2tNekZzZXFVTk9oMWRuRApNaUNoZXhCbTR1QjJBNks1T0tKQUpBalJpZEJmWS9ERmlXbHVoZjRpUk12S1Q5ZUVhQjVMOWFzaVJNT2diZzQzSVpvdFVpaGFDRUswCkZnRm1SbXNwWE1aaHFHOUN0SXFubW5SMVV5VTl4WE45SUtLNVlKa3UrdCtJYU1xMHhaTTNJcHBLYm4wV1JrVFRvZy9nWWtUVFN0RkYKTUtJbGxjOW1BVlF2d0V3MHVCalJFc2JyY0ZwTnd4OVpKdEVURWIwVjd5OUVOTDFDOW04T1JEUnVtUVNGZ1loV05PTVRJWm9SRGRYVwpHaEhOY0FhbnVHQkVLOERSamU4SVJuUTY3VXpNaUhaMFpCNUdOQ01xTS9BZCt6Yy9ybEorV2pDaTZRVXF1UjByVnN5dm54SFJXQXhJClNCSWNTVmJhcUFpVWlHaVMyWko3S1c5RU5BTy82dkpnUkRSZU13SW9naENkV3JUTHZRalJMSitpeWlZSTBXd05LSTJRQ2RIMDVIT3EKYjBKMDJvS0JJRVRMY3ZqUVgxY0FlMjJBMGZjSnVYL3dvWkVFWk5vdThOQ0o1SXRIb0NQNWQ4QUJrdmgyODZGcHBUVFlmR2djWDVMegpBRVRESWxuNkRZaUdWWEptODZGcFVGclFnR2habVBDNkFOSDRSYmFtQ2o0MEVwUE1Cd1FlR3BtOGdQZHRQRFR6a0N4VENqNzA2dFk3CkJ2WVpRMXdrd1RZZGVwVEl5TnJZbzhOd3NLRTdxc1Vka3Qxb2FCZ2ZzNXM1czhBZzFJN0IwSkJTVDBXd3RtdlBkcHJVV1pzSzNhUFUKTkxicTFSbXNtd25kM2Z0Nkk2Rkhjc0lxU00vb3E4MHA1Z1pDazZpODZqR3lOM2FUUHB3NDZHMjRhZERIYUJqMDlIeStJYytBT2FtQwo2MEpCaithdytONnFDSHV6U2REYmNJT2dqMUVjNk5HdFBnME1OS2dTQkx2ZEZPaU54QTRJTkVMUFRBa0ZBeG9HTmErN0VORFlMVGpPCkRCN04wTzRFQUhvK2Z0MXYvdk9JRmx1QmZ3YkVSWDBEalg4R3RVUjB5b3YrVFBTdkEzU01wMndXY0xDZlJ4SlM4U0kvdzdRc2V5TUUKQ0lZYURlSXh2UXhEbUcvczgzZ2luV3ZxODNCRHBBMTlob0Yxb1RmenVkc1AyY3huQkVCWm94SEk1eEVmN1VFK2I2UmFFSjhCWldOYQpPSURQNElSdUZuWmdpV2tzTWpJaGo5M0VBalh0K2NNZ1R1Rk5lKzVKZVYrem5oR1FaVm8vVU0rNllCbnVYS0Rxd1FMMGpIUzMrbkdaCjh6eThTbjFobnRuM2VkVkRlZTVhZVczR2N3L0k1bzE0NWluVkEzakdEV1lGalBITytMdll1MjFuSDJGK0F1N2NBNmtiYk9mcktKdnMKM0NNekdtRG5FU21rb0RqdmNlREdPZ09ZcURKZVU1MHg1cVViNFR5alYrTE5kSjdkWXZTOTFUS3lQWWpPa1BJMWs1b0Q2RXk4NWF5SAo1d3hEOTAwa3pubUdoT1RHT2MvZ1J3Zk5HWFVPVE00RnpCbkVhdmJqdkZET2k1SHNja2pPV0NvejcyV1E4Lzc3NWpnZm96SE9RTHBFCmYyRldiczFpWXQ4TmNWN0JTUXFHTTlhUyt1cUQ0WnlvYlhjenU4MXdobFVMbUlpNlVYMURrdWJPcTJONVpEanpidUVMYVJPQlZJRncKaG1Xd2ppQVl6dHlHSC9waE9HTUcxZlFRREdjMGVIZXBMdEw4V05Qd2hiajV6UitYUjY3SXhqZnpsSGgzQTkvTWd2NFp2T1ZkUkFLbgprUmNkL0daVzlFOURzTlZaTUVYWDdadmZ6R2ZKUWduem0vbEtOQU9pSlY1T1ZqTysrTTFzRXhsWG9GQTNQRDBPWlFZNGYvV0RmdnpoCnZ5akFtWEZCVXE1dWdET3RsRGdFd0ZuUndwSVBzSmxoUURXTHVCRE9ERmRSSHhRSVp6eFgvNElSenVBeDhnVzVDYzY0Y2hVWUJzSDUKckdhRDRLeHZlbW9DUFlGWmRueTFENlhNV283Nnk3WmpsdDNPU0h2RkxNVmgyUVJuR0tRYUNJSXppMGZWOGVFaU9PTXFwVTRMZ2pOZQpPMEdiQXVFTTEwNkNzcHZoZkR6WVlEano5UXlwaGdnUFpGSU1wYkEydy9teW11SE03cjBNL1FmREdSYkp3MjZHTTNFUFZCd0Z3emtSCnErMEtldlVTaDZDV3c4dk5jTVliYXpXR0djN1U1YW42MVF4blBGK1ZJOThNWjFTbmtlZ1ZDR2VVYWdtWDdnTHI1UVkvTDRBejFHWEIKbDZmSER6ZWFRMGZ3bS9HZWNIMXk4NXNaNE9Gd0hmeG1CbmpFSmZCb1FVdHpEZWlwbHFMVnJYMnA0K1N4V0NRZC9HYitaSlp3WitPYgpHYWlNWnZRcU9Yc2VSUUUzdm5uTllHd2ZlalBLYVlSWE5yeDVEcTEyTjd1WjVUVTg4d3Zkakc0d0FrR2IzQXpwSkN2MUE5dzhvdkx2CjVqYVA3dUV4c00wamlwZUQyanppNDdtb3pWallMQ09hR1JRWkp0c0dzaG5rUE03N043RjV0Q0JJR05nOGhzdWlqV3NHSW94Qm1rTnIKUnRzWURzMUJhNmFzZ2lYL2hqVjNCeDlmckdaUXVoZzNDMVJ6TDI2OVkxQXpzVjVENWRDYjA4eE9SNDl3enJ3c0hJYXZZRkNhMlgxKwpLSm04MDNJOUtvQ2p0SnBpUDBNWVdCZUpxNmlQR0FrYjBjd3U3MVdmTlFOUVNOVHhXd3BBTTZocjlFQnZQak95ZHdRakI1NFpFQUhHCnhJTE9YS1A4OUlZelF6WTFTcWp4SVBNTHJ6RFF6TVF3ckZCM1dqUU12UTlMNHdQTXpGWmZ1Und1TS9qQlZCZmRXR1pVNEdxTllDcHoKYTk0cW9NeFlGN0hFOEdZeXc4Z0ZTRENaSVYxcTVpaHoxUXh4azBpSkY1SVowd1RCOUVGa2J0V0Z0ZGR1cW1pOWVjeGNpaEhnWUc3TApYamNFanhuS0VzN1NONDRaVjhCZkN4cHptNmU3TnljVDFGV0pvSDNCbU52d2x4WXM1aGF6VjZDWWNUN0ZqTWFkQk1lc3dnS1RJREZqCktocVhxTE5OZDd1NE1jeHczclg4TjRVWnB5WkloQ0hNRURuTnRGNE01aFdMdEdBd3J4YTk5NHhnWHQycDQ0dkFEQzJ4Q21rTllGN2QKUHg3OFpVRWJ3ekMzVGxqTm5BeGZYczRGYlBZeURQRmJHNzNNUkFmWEJvRmVqbVRFSmk5RDVFWHF4dzFlbmlNNktwaTd2QUt3R2RqbApGWUh3aTdxTVJJdmVtNzRqOHNFY0NEVXoxeitVdzkvVVpWcEZFN2NNTHBHRGE4V2R2Y2RxanNsTlhZWjFzZUEvcU10a1JQbTlrQ0JpCk4wRzVvY3ZYNFF4ZGhrWG9wb0F1cCtSQ3R4ZDBXU3VmdFE1MG1mbG15azREdWl5UWdaVmxoMDhQUDVEQ3pvQXVNdz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJemNzNUxhRExYejNJQ09wOVAranljck9wRjNONUxRRVdObklaVmZPc2p3bmlNcHlIWkFUejFob2hIY09VVWZDV1lWQnBzbkhMMkkwSgpxcHUyek1MWWVsakxLNERKZ1ZCV1FQRmlMK3Q5aGtpVEphK3hHYmlQNUFZSGFmbEtuRjJrWlM0TnFJc0kwaklYWkV6aEIybVpZVTZYCmtHNWNNa09kQWs4YnRNd3pVNWU4Y2FLYVJ0dDkyck1ieXF2KzhUQ282R2RFaVVkMjZjbkZXV1k5aCtxdHpGbm1aUS9XVjVtenZDMDMKWnhrN2ltd1NuR1Y4a2FUN2I4NHl2S3FxcXBXTHN3eXIydmtHWnhrV1NuazNhSmtPT0IvUkRWcW1sNWExR1JPRW9EU296RTJZWlc3QQpSM1pqbG5saWpDUUhaam50bmlTQldXWXBDQWZkQzdOTVkzVVhCdEhVWU5Gc0pjd3lCejBXbzl5WVpUcVkyVUw5b2hWRlVzbjJ4aXpECm9qS0ZHN1BNSmJEbURHT1dFd3ZoaW5TOU9nbU1IU3hkdURITFhCUlREeDJjWmF4a1dRTVNtR1VsZFV0OVk1WVpOeUdwSXpETFhDS3AKVzRReHkyU2pWY3MrVDhROWgxWTZNTXRrbzAxdnhrZWJnd0oyWTVhcEptRjB6SmhsR29xaHlnemdjVWVobmkvTU1qS1d2di9HTEVNTwpvczVOZ1ZuR05ycGhOMmFaYU1VZVF6eFRuY3ZoOGhWc3B1VVl6QTFaSmsyTGxUVjd1OVlzdEEvS010YU5lbmx1eWpMankyUTlCbVVaClBxWWNqYUFzSTNhZ09OaE5XUmJYYUk1RFdhYjJUNStnS2N1MFVFcC9VNWFscE96elVKYkZ1Q0pNeEpSbDdxa3lxNHV5ekJCNXdMWVgKcGU3SnE1MmdMSE1oS1hqNFJWbVdmSExOUTFubTZVZlJLaW5MQ0dBSmYzRkJsbUgwTHdxeXpEQ1hUc3lRWlZvWUVMb2h5N0NLOVdmSQpNamZUdlRCa21jZE9iaXV4SWN0YzNZak5Fb3pMc295R00yVDVHRzdJOG1VMVpCay9vQ2hMd0pNWkxsSUMvNElzWTZrbzcyNXZsNzIwCkNzYnlNVnlJNVcwTXdqTFhjOHJWbTdDODM5Y1hZWm1wWnhJR2dyRE1rbmVxQm9Ld3pPUmh0TTdZZWtsYWwzMUJmZlhJSG5LMUpNSXkKYzREeFp4VFBTS251cDJHdVkzT1dMUURMM0lZcjNodXdMRUh5VElldzdDREhQSVJsUnFybUo4QXlzWjFQam5ZRnlYa2hJaDhDc015dgpMekw2VnplYmFzY2pBTXV3OUdKMWdFaW9yY3FkZWdHV0dSc2ljU0FBeTdSb0hoTmdtUVlKRFM3Q01tOC9NOWFCV0dhcW00SzFRQ3dqCkVLQkt6aHV4VExTVnV6T1FhZ3VWV1ZlM1FCT1dNZGFwdmRsTldLYXVJMGZ6Qkk0Q2NIMlVYVGRobVRHVGt2SWJzUXdybWVBYnNVd0wKSDFJd2xtbWhRUEZtTFBONFZPVUVZNW1SRTVWWHI3aE1GL2E4R010MGFMTjdTVGc0WnU3T2hpd3prZEJHOUdhSW9XZGJBN0xNR1c3MQplaURMdkdmc0xYOVRsbUhWaXhhVVpWaWtsQXJLTXJlaEJPcW1MTlBLUnhXVVpSSDJSaitVWmNvSTFjdmpLbm1qTkpMMTFFRlpobktICnc4cW1MRE03UTRmMnBpd3phczJLKzZBc3M0Q1hDc1NnSjhPZFlJdXpGMldaSzZkMEdWZW9NUUxLdVEwM1l2a1lUYUpDYnh6eGNneFkKL3VMVmY5ZUZBMi8zMHc1R0RXdUd3cHVidm0yOE1wNXdtWHJFb2l0M2R4dDd3Wlc3bWF1YnJkd2RNTjVvNVdsVXc0dXNQQjBaM0lCawoxNmtmc3ZLTWQrNEdLMDlHNHU2OXhNVGRWT1hwOHBJWFZCbEZZMVErbWFuTU42VGxRQ3BETmNKSTlVMVVEdER0QmlwRHU4VWhMVURGCjJmV3ZOMDhadG1uR3Nwb3VkUEYzQXFiTVBOSXFiNVp5ZHVYTVppbkR3SFphZ1ZLbXB0NGg4UTFESTUwYXF4aWhsTkVSWTZ4MG5lQ0sKdGU4RlVrYmhBc0d3d1ZFT1BOTEdLSmRvOUh4VGxDR2NZb2c0SU1yVUI5ZDVHTXJBSjYwWFFMbTBjQ0xOVHk3UmxEZnd5VXd3T1FHNgo2Y2xJUXlzN1pYZ3lLZ0thR2NzTTZ4WFRPbTUwTW15azhRVTV1WVRRTDhESnlFa2htdkxpSnFNVUp2cm1jbnBGcWtFWlI3OUJLRG9SCklmdUNKdGRnT1FZem1WRzlOUTR5R1hvUFpvbHZZaklTT1BTNkE1Z01DVXEzSTA5SlViZDI3b1ZMN2srUUVFMUx4bTZNakFjc0dRZG0KYU81bUpUZEwxallxdVVYUHpTQWxOODlTTDFJeVd0eEZZb0drWkdoWW1Pb3pKeG41NTZGLzM3TXBWMW1QdmlHc2ZvZEpUTUZJUmxmMQpyckQ0cnBqQXNpK0hiQXNmeXpBRmEvT1JzUmY3b2R4NFpBUmNsRUUwSFJtT0FSbnNBVWVHdms0bExSY2JHZGZhWFF0QlNDb0ZLazBCCmRRYXFJRDFnZ1BrR0k2dGlySDdiWEdScUJwem1ZZWF6QzF6eGdpTDNhQWtTVE9SZC9oNUk1RzRveG91SXpBWXFQSmFCeUtkWTJUemsKNGdMWUZ3NjVCaDR5YU1nZzlETFZHRERrVmc3b05WaklCSzF3eGFLSy9CWk56NEtFM0VLdGVvT1FZU3pFR1p1RFRQWUsxeS9HSU9PMwoySmJpeGlCWEYyTnNDaks4TkhXR2RDS1N1ZXVscGRkbUlDT0x3Ynh3SUpCQnRlRjNGZ1RrRW0zWGJ3QnkyYzM3ekQ5R2hZWkltc1lmCmsyWm1odkdtSDI4WVVjQ1B5NGlwejZrNUdBaHF2ZEhIZk8wc0RlTzhBclljNWRzQlB0Njg3NXQ3akpveTFSdTZLS2RrVDB1aUhtY2sKcEl4c3Zwb0xPVTRWekdQa1padTNVaSsvTGhibkRUek9YYXIrelR1R2dSQjk0WTV6Tk1hOGFjY2YwenlyQ3cvc3VKb01HYXpqeGdGVgpOWDRiZGN6V0NtSEVYSWo1Z1VXdVFUckdPNTJOSzk2ZzQ0Wkt0NmVlc2tJTW00T2ZrREhIaUM0OTVpTnZ5dkZpTWpSOTI1RGo2azdlCm0zRThWQUw2Umh4L1RKakxnamNoanBPbjVTQWNXMmY2NGh0UExxTnN4TFFsR1o0b3lNeVNUWUo5bmJTTGRURmdJbWxKVVUyNDhmUkMKTHVER0VTZC9vNDJsK3pwazR4R3RDZ3cyenRIaTlzVTE3cXF5T0ZoakN4TTMxWmhKQUpVcEhxZ3hreDVSbFlqRnI2R2ptMmlNdHlJWgo5TENCeGlnSlcrWTZrR2VNOTlrTEVYMGxIUHUwcHRrMDQyS3ZLV0RHT1h5QVlCbXpSdDBqYnFDTVVlL1dWVzFKVHdtTEdyNlNtMk9NCmdqT2psQytNc1NYZFFURnVEQktrQXpIbXFvcGxxamZFV0FxU1VRN0VHQkhVajNWYVB4Ump5am1mc0lUc2lWclIySTQxQkxEVTZuSXgKUHJpdi92ZjM5TzR4K281WVNKdGlYS2NiVGdiRU9GaGxtMkhjY2tocEw0UXhBZ2pGMUVsNjFjQmRVTTBUQUdNU09Lb05JWlVIOGtKTgpndXRtWUFpcUd2VGlscDNKdTlqRkxiUUZSaGNqM1VxOVo1Q0xrYU9VQnZ3Q0Y3ZG1mSTlqNTFDTDBzTXhrUmo5aHlPeEY5amltU0s1CkxCc1JzWFVjYVBGS0NpQzhtTVV3c21vaWtNVXIrbmNFc1JnZ1YyK3dYZlNWUEtjR3JoakZXQXJlZVN2OEE5TnhONng0VHJkRURsYngKcHZNR2doaG9DcnFYTjZsNFBQWm93Z2loTUhOeHdTbmVoaHRUSE1aTktSNmV3VGQ5R0NKZXJuNXZTREhFdHdyazJEaVQ0YVJDRko4LwpMMEp4R0RlZ21IRGxWUStmZUFSVzVNWVRRNHdzTXBEcHhLTTVZeDEwWWhpbWVickhLNDFlMzhFbUhxRk9DaER4YU01aDNtUmljS2NDCmFZelhld2IyUDdqRStHdzJlamV3eExQWm1RNHNNUTNsd2hJemZwM2VVT0laSkNjemlhZmJnUVdTT0ZxSDMwQmljQmlWblRhUEdKcE0KSmhxTkk0YjZrdmZ3cGhGdllGYkFpSWxjWkRyTUxPTHBEL1dGSWthcFVqSWhORXJuMU1RMFNNUXdaRWZQTjRpWVJzeEV3U0VHMDRrSwpFbU9JVjdFRGVGT0kxOTBXRVI0TFVjOGpIUWd4Uys3eUcwRU1QQmREWEVFZ1J2cGVsUm9HRUVlejlSZC9lQVpITmZERHk4dXFUUjltCmxTQnh4QWMrYk5iMFJnL2poRlkvNE9GVkpObDljWWZ4dWJGWUxyRERLMHBoZ2pwOEhXWXpoMmNrWkFNNVBKMmEybnpoR0FaZXdHR28KWFVVME5tOFk1TEErTG83d3FCNUxiOXh3RC9adkdKRzFacXc3WU1QVW5NLzZaZzBqZ2ZTNDZUQkNIZmc3R1VnOEpjQncyZlFGR2taaQpLa3FuUlVOOGxIVFltR0drdUpwNzFXMHRUM2VnZTBPR2V4U1dCV040RzI3RThER2FNTndOTjlwOFd5eHBrMm0yR3pBTUtEN3h1VjZRCm9LQXAwSXYwVktxTDhsNXdZWkNqVk5SdXRqQldQQUpXR2kyTXRWQk9iN0F3VmxPcDlNTVZ4cG9yOE1QOHlxckZCQytxY0xNb1kwT0YKZ1JscTdTQ0ZSOUN0RDFFWWdpWWlKUU1vekxXWlM5dFkxa3h5YVpsdm5EQzlzZFFPVFZncjJYNWd3bHpyanZ4bUNXTlZ2SXdtNXEyRwpRUVg5UmdsWEt6TmZKR0VBcE9LOCtYMUVIbXh6aEQ4N09qOStSeWZxLzM4WTRTOTQ0RDl5NVBydDcvMmozLy8xZldBYzZBOS94Zi81CnMvL3JMMy9SRC96MGg1Ly85SC81NWYvVnNkdno3ZS85czEvKzdDOS9ZNi8vNFM5Ky9kTi8rc3RmL2Z6TDcvLzYydjZQL2NZLy9hdGYKL3ArLytPVnYvdlNmL2VGdi9yM3B4MUczOE1kKzRILzdpNDlUK3A5KytZdC84Mi8vK28veWttUFRQL3k3UC8yNFFmL2pYLzNoOS8vUgpiWC82NVYvLzlYL3l4cmpJajd2eUY3LzgrLytNYS96eEQzKzVyeEZWM1IvRDR0OTZqZi83WC96NVgvL2IzM3lXLy9DSC8rYnYvNlB5CnAvL3c5My91L2ZCM3c5OS8ray8rOFB0Lyt2R1MvZlhIZS9hNzM4bjhEMzc1TngvWGRmM0RELy9rMytGZnB2N2xIL3pWZi9qMy96YU8KODkvK2sxLys1cHYvK0piK3V4K2ViMy8vNC8vKzVkLzg4QjkrZUlHaG4yLy84OGQvL044ZnByLzVWci85NDIvL3gvLzVmUHR6YlBuUApmdmpkQktPUS8rL1gvUWZxZ3JDUS93a1cvRUZ4N2g4emYrenkwMzJjbjM3NC9jZXgvOWNmNEZ3endmVkFmNWIxSDFoK1Fwby9vTndGCkRPaGp5ZmV4OHNKL2ZJekRuUmJHNXY3bG4rR1lrTkpYMUgweGlKVSt4aG1lSmNaM2xHb2ZNNHhWMkt1SkFNTEhEOVpQeHE1MmNELy8KOERZREZmSHhDKytqb3BqbFkreDVuNEdOT3NDUU9QNjlyWU5QNzZNZTQrc01qdms2MjNQVTY3cSszSU9mZi9qWFB3Q3N0T0JrZ2lySwpmQmpVUFFWVEsybmhINjcyUkluRXgvSVhtWEFVSUMwVWNYN2MxL1I4KzhmN0VjS1BUY1FuUDM0Rk9EdTAyd3dqWk1YUUlLcHIyY2RNCjlEWW1wVDk0YVpmNUVTWGlkZFNQNldqaEpYaWRRUmgvL3UwVCs4dVBLNDUvWVAwVEpybE1rRTRjdTl4bW53V1dySk5GRkwyblQwYnIKaC9ZWjIweVFWLy8yT21yRGVxR1ViNjh6Q09QUHYzMWlQdVAvK2dMLzhSZTR6cHBOU3B1TXBIeXN1NEd3UVRGQnhidjdNUTRRQnRpZgpnZGc2NFFFWUxEUTJBSE9ITFA2blcwdEJSV3J2VTRBb2dVdWkrMlF2NDMxaGwvbmNoT3VvNTNaZFozRGYydWpmOE41MmtxdjI2YWpICitEcURZNzdPOWh6MXVxNHY5K0R2T0RiOGpxY3lRTHo3ZEY5eDJ0QnJ2SDRmRjRnby9ldE1MK045VlpmNTNJSHJxT2RlWFdkdzMxZjgKQkZ6bjk3YkladVpQcit4bGZKM0JNVjluZTQ1NlhkZVhlL0JkWGxsMjlYcmE1L0VMZ3c0cTFsN2pWMlBZcXJ6SHI4dDRqMStYK1l4Zgo1NmpYK0hYTzREVis5U3hGOW50YmxuWitQdW94M21kd21jL1pucU5lMS9YMUh2eXNvUkp6Q0pRK24yNE81cENuZkRvSXBvdktMK1FlCjNJL3hOYmdmODdtTWM5VHJnczhadkc0T1pyeUJRT0pyVy9MKzE2ZWpIdVByOFJ6ejlTajNVZStIL3VVZStPWmN6KzJlcTY5bmZPYnEKOHpaY2MvVmx2T2ZxeTN6bTZuUFVhNjQrWi9DYXE4OHp2cmZkYjhOOTFHTzh6K0F5bjdPOTNzZHpYVi92d1pjMzUzVnpybWQ4T1RMNwpiYmdkbVdOOE9UTEhmQzdqSFBXNjRITUdyNXR6bnZHOTdYNGI3cU1lNCt2eEhQUDFLTS83ZUQzMEwvZmc1ODhlU0dNZmkvYlpBd256Cnk2dG9UTEYvY2tzdzIwaVA4VFpia1BjK0trdVgxbnYrRCtNbkQrVGVkbnNWOTFHUDhYVUd4M3lkN1RucWRWMWY3c0hmZlpvOFUrL3IKdmg1SDRmcjk0MUpjWjNvWjc2dTZ6T2NPWEVjOTkrbzZnL3UrSGtmaDNuYTdGUGRSai9GMUJzZDhuZTA1Nm5WZFgrN0JkNWtteit6Nwp1clhIVjdoTzRYZ1YxOGxleHZ2Q0x2TzVDZGRSeisyNnp1Qyt0Y2RYdUxmZFhzVjkxR044bmNFeFgyZDdqbnBkMTVkNzhIZC9aYzluCmdFOW5sQzlEUVpoZm4zZEhxWW85Z21Qc2dvRjhHZ3B3cVBxTTkxREFaaGFwdmovRU1INGFDdTV0OStkOUgvVVlYdz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJWjNETTE5bWVvMTdYOWVVZWZPZkZ5T3ZXbnUvMk9vWHpoVjhuZXhudkM3dk01eVpjUnoyMzZ6cUQrOWFlNy9iZWRuL2g5MUdQOFhVRwp4M3lkN1RucWRWMWY3c0gzWEl5ODd1djVhSy9mUDUvM2RhYVg4YjZxeTN6dXdIWFVjNit1TTdqdjYvbG83MjMzNTMwZjlSaGZaM0RNCjE5bWVvMTdYOWVVZWVHb0hXUWdKbkU5K3p4QSsvNVB6WklYNzI4MDZ4cGRMZHN6SFF6bEh2WHlaY3dZdnYrZnJpVGtjTXI2NDl6eHMKK2JUMjRRbG8yMnMxY1l5dmxjY3hIMGY4SFBWeTJjY1h6LzUxT2pqRmY2NVE2ei84L1orL0FxMy9LZkhYOG5lTHYvcU9mUXJDbmxncgozckEvWW94OWYvcHl0Qk9LL1RzSEMvSHVkcTNlcVh3cForN0lqUFdGMmZNQmlKVmVaNmYyeVlnMWVXMW43ckFaNi9kUnY3MlAycFQrCmY1K0JqWHZ1V0dOODJuWkk2ZjArNmpHK3p1Q1lyN005UjcydTY4czkrRzV6Qi83OTA2MmxOMUUrblFMOURyN1kxOGxleHZ2Q0x2TzUKQ2RkUnorMjZ6dUMrdGMwNjIvZTJVMEsxOTFHUDhYVUd4M3lkN1RucWRWMWY3c0YzbVR0WXRmSHB2dkswODZkWGxoZFlQcjJ5bC9HKwpxc3Q4N3NCMTFIT3Zyak80N3l0K292YithZHRwS2NQcnFNZjRPb05qdnM3MkhQVzZyaS8zNExzRnNsQVo1ZEd6ckJPT1lJdkFiZjZkClJ0dzhhZ3ptWlh3eW1oYTh3eEUyUHlvWWVSMlZnM2VhMzE1bkVNWWRqb0JvOGIxdGtScjJmZFJqdk0vZ01wK3pQVWU5cnV2clBiakMKRVUyZTczMXpPSmUyVHdmaHROblQrK2N1NDMxcWwvbGN4am5xZGNIbkRGNDNCelAvbk92VHRrVWxZZStqSHVQcjhSeno5U2ozVWUrSAovdVVlZkljVjkzNDVJbHQ1V1R6aHYxOUN1d2J2aDJYanA5ZmwzbmEvQXZkUmp6RjlmbGZIU1ZEdFJ4U25lRm5Pd2E1WDRmenNkY3Z1ClU3eHU3N1h0ZmhEM1VZOHhmWDVqZklyZjhjT1BYL3YwNFlmNWRZTjREYXQrTXZwNlA5M011RGV2bzM2S1Erb012c1FoOVNRL3hTSDEKME82akh1TjlCcGY1bk8wMW5KenIrbm9Qdm56NHI1dHpmYUxuSU9mUlhEOTNHZTlUdTh6bk1zNVJQOFVoZFFaZjRwQjZoejdGSWV2bgptM01aWDQvbm1LOUhlWWFUNjZGL3VRZmZZU0pQMGkxK3VxL1YzVHZmOTlYZDY5NzM5UmhmOS9XWXp4MDRSLzJVcU5ZWmZFbFV2MC9zClNsU1B2bGNYTVFYZzJDbmZacDlGbiszVEZIQ01yeW5nbU05Z2ZZNTZEZXZuREY1VHdOY1QrejdEd3ZhTXcrWDd0RG9JODh2anB5Zm8KNU1BeDJoUDh0RHFRMzdxRHpENnFQZHozR2RqNGFYVndiN3M5L3Z1b3gvZzZnMk8renZZYzlicXVML2ZnK3dTWjVSYS83dXR4NHEvZgpQKzcrZGFhWDhiNnF5M3p1d0hYVWM2K3VNN2p2NjNIaTcyMjN1MzhmOVJoZlozRE0xOW1lbzE3WDllVWVmSzhnc3ozajE2MDlmdngxCkNzZmp2MDcyTXQ0WGRwblBUYmlPZW03WGRRYjNyVDErL0wzdDl2anZveDdqNnd5TytUcmJjOVRydXI3Y2crOFRaTzRSaFpzajljOUQKUVpoZm56ZGpZUG5UVU1CNFdadWZod0ljQ28yRTNrZEZGTzc5R2NyMGFSZzQyKzBQK3o3ZU1iNSsrNWl2OHp6SHZLN295OVYvNXhEQgo2NmFlTC9ZNmhmTnRYeWQ3R2U4THU4em5KbHhIalp0MS9mNjVxZWRyUGR2dHIvbyszakcrZnZ1WXIvTTh4N3l1Nk12VmY4L2d3T3VPCm5nLzErdjN6U1Y5bmVobnZxN3JNNXc1Y1I0MDdkZjMrdWFQbkl6M2I3WS81UHQ0eHZuNzdtSy96UE1lOHJ1akwxZi84bngvOS9PZS8KLy8yZi9mckxuMzhicjhqbmYwYnNzK1lGYVMyazV2Z1BNR2wraFJXNE45U3pIL05Qbjh6dFk5SFRxOHpuR0w5dDNZZjRQYy90ZXdoVApYK2N5MUlKN256bmNRSnJseThrNGJIdjZyTGExNTJOaFFXTjZxRytYbWJXR05MTkYrK2NyOTYvOUJEK3pFdVVHTGdCNmxINmNlcDgrCkRkUzNmTHpxTkpQQUxDUDlRUDBrcWdwa0pMSkJQemhMbk1kZ1AwQnQybVAzanlGcCtkSlFSaVBqeHdyVXY4OWF2OWo5K2ZnUS9mc2YKYjVvdmVlMkRLdEl2bzI4TldSQnhGOWpTeDNjc04yL0ptbTM5UHFveGZMOHdubXJMUkxxbHpPUWk2cmJnZWZxazBKRlZScFRmK2FxZQpNSDQ0OXVmeTBSalo1Lzh4SHNlbWJYai9jd00rUFlBZjlXVHl3dzVpdEdmMGF2N1ZWcmFTcHJVcGxDL3JTUDQ1ZmVNeXJoWGI1dDYvCi9kWlI0OWZtbjlUMCtCK2VqNFdCZjI3dTE3R3JlNnFOV1FjQjdHcHVtMTREZzBGL2pQM0hpQzJmN0UzWnhVZkhaSmp4dDM0L1Rnek4KWVBTRTBXYWtGcDhZY0p5NnVLWWlVaHRSKzJmamFtRjhZc1BGK3h1YkxwOXY3M3QzRkJqS0JvVDJiLzcrZit6NXNORUt6ZXhuRUErSQp3RlZ2WGVOWlZML1BiTGd3LzdZSDlBQTNuUDJkZmJ4YU1kS2gyVW4zUzQxMXFXMTdhR0R2WEJqQjBXditKTmd5N01mWVArVnNNMG9DCjQ2RHhwZGFoczMzWURPTExkNzZFRHRQdkkxTm8yOXpuMVBmdTcvUDNoU1hVdHlYZmRiYUEvelhNVCt1WCtTZWJpYXlSK1dNMStzM0cKN2tmTTFoTzJvUkJkeGhUajQ5ZGY4MEFJTGdES1RmVVBZTjM5YW5NQ25rU0h3WXRnWTA3K0tqaDgyUWpJc0o3YzhnY0FhNHJ4TFkweAp2T25UWTNRaGM4REc5SGgwWUdvNURoQVBzK3RSeDdZamJnNGV4bTlld1hsMXh0TThtTEtUWGJ3NnJGV1Z1UTNQZXl6STJXYmdER3ljCmNjVWx4dU12eDQxSE9sV0FyWnUya3VlMlpCcTB6TlgzY3FvUzA4K3B0REEyRHpDRFk4RW40OHc5NzcxekdOdGEzMzd6NTMxZTZBUFMKdTZiMDUxRk14ZGJxTDRQUm1EQjZXbGdqNVczci9nUldxejR2ZHV2TVBmYlhKNlFXbmkxKzY5ci8rdms0cmUxcGdEQ2FQQVV2QUJwawpiQ3ZHRVJobjgzTm9WWGVMeHNldkNFSDhYNHhsZVdiODhsdCsvUWtnS2I1bkJYbWlYOFA4ekI3bXdXdWpjYVRmTU9ZUnhuai9VWFpaCnVzZlpqS1lETm83d3VQQ3AvT1lKK082d0VWb002dXlTK0t2Tk9SZWZCRWtZTXNhOGp6ZXNaaHViUHhaOGJUNHhTYTFHekVJbE52MVkKVmVUM3JQTDFCTTUzeFQ0akdoTFgzSjhWdTk3RWlOajhxYkFOaDQwbHZwK1AxN1Nlc1ROR1ZLNUlQWHBxZW53SVMyMnhxZWJjTDc5Lwo3dGo3Z24vOURXdjlqVnZ6TVhyOXE3amxvNGNaczhwUFlVWnJKcG5yRTNlSHpXTmtMSG4ra1Z1dXQyeXFiU2x2SlNlUlg4T2N3azFnCnRiMk1wTHZLT0hRZldQd2JiZ1lCS2ovK0VPWmNZdHVSWXR2Wi9HTk43OExYRTRneks1TEllSnpQZnBqczlWNUx2RkRObjJFQmd6S0YKZVNUOVhoRml6a2FOUlYrUDZ4OUV4ZmFZNjlyNlY1dkRKMmppSmRyWTloQ3A3K1hEMXNyK3RSYnpHOHg1blRQcnNTMGJHK2drMGd4agppZy9XbzZSL0MyT2dqeHUvVld1TGcyclErWHIrY1dHZ2J6emorckZmd3h4dUdLdWlaUHVZWDFaTTVuT0ZjV3lmc1V3UFhEQzNlQklzCkU3Y3hMbUZsVGE2d1BUR1FrTXo3NDIrZmxrZStpYTQyc1lDaDkvQ3J6ZWxKSHRXSEozNFlTN0ZuUmVLSmpSNDB3TGZ0OXF5bWNVSTYKYnRJUzRzTlllNDhmKzFqU2Yvdk5NN2g5dnZnNStORXh3SEM5ZHp3NUcvTzR2TFBmSGg5c0JZN0wxaGJ6ZTdncDJIL0ZvUE5IUEw0eAp0eU9adHNjNFJoaWY0NGUrVHYrOCtuUXFOUkd1dUs1b2R5TnppMitOMkM5TjhaT1VjZG02YjRHUDhKdUg5ZStoajBiekJYOThnZlpHCjBPOWlMMGNuOENRL2hmbXA0M29ZUHNLb05ZeHkrTDRjTmk0dmlZYjErZkt5ZUFOeUV6U0N3N2E5WjFJeFpVdzlKaEIrS3ZFQ2svUW0KTXhhQk5xNjhEMURpQVBtSjUwNmN3WSsvZlY3bkN5QSswUzl3S2VjTHVONXJyV0cvdnV6LzZtL2Y5blhjZi9IeGcvLzlmNkFmZ2llNAovQVRwcVB4cU0yTWtOc3Y1WEJoK2l1OStEQk5zNFJhL09CNnZ1OUVldWxhL2NzUjdhZE0wVXR5a3NjSklKaFYvS2NXeWNMSi9RYnlECm5uUUFYdW5KSHdJYlBNaEl1SitNTlc3eVhBcXY2SzE0dFBZaG1pVU93RmZGUm9TRS9aanJPWVB6SlgxNGFIRW5XdzczWWE0bkJxUDgKSkwrcDlrdDgxejErRHF2SlpRelBGWlRPMzN3NnNUdFYxL3FTUGFiU3VIek1qdzh0NzkvM2htbFB4YS9CN0ZrZU40ZldhdlFIZ0JtUwpMVUlzUThRLzdUKzBMS3M3cm1WanhNU2VHbGZQNXVNeWdtd1J1N01wbDNZSE52QW5tL3Z4bjNLT084QndudzVCTWY0bkk1c094WEZqCm1UTGtUc3Y0NGR2NldwTlgzOU5YbzZPMnZUdkRVSDRBK3ZweFVpc21BNzVNY2N6WVhjVE4rUGxZVVFONEdWZkZodHArVzNNY2dDdEMKais5eFRoOXJtSFZ0R0VjbHprbmZ3SGoyK2RkNFYrWlNGQVN0SWVIdzdjRkwrL2Y3dFh6OHJOSERjUHBPalRTbmphM0h3MmE4VUFkbwplOGdmNnM0dTQxbysxK0xRR1VoSkk4V1lXTUpabWVnc0VZZGx1RURHUEZNOGdPR0p0d3FPcnhONHdpdEF4OXhTWXJUSGZLd2JXLytrCjFVOURMWmxLeGMrZ3lBa0NRNzV1WDMrVnVDOVZuZjg4TmloSUFVNVRibkd1Y0VYOFF5M09kWnpIRFZ6TW5INWVYZE14anByaWpXOTEKeGxrOS9VbVhNUTdBVm1lK3J1bTVsQTJSNHoyeUl6ZEpieDZmWHMxOFhRR2ZzUTZicnhlK1o0M0UwKzNpUER3cUxEdXprTXIrcFlqcgpUaEQvWW5BaWNROUdFRnppVko4d3hWZUlTZDhmNFRDNU4zd3l4NFRHQ2Z1TlAzRlllcHlBaGRsUDNyRHVlU0E4eXc5ckhmc3I4ZzM0Clk4ZTBaem5VV0dIdlgrTXI2SzBYYjNzQzdsdzRlTXZWWTJJdXBlOERuQmhjckRySFdSTVp6Z3NqSnJWOUExTHlYUjJhQVgydTAyTWUKZXNpbEo4SVZjdnJIRUxIVkg1eEdZclNUV1BHdytabnBxSWlzeDB6UWNuRjhpQTN0NG8wamtSTkd0SnlJRXl0ZVlZeXFySnVudmVvNQorc05jZWpoTzRTdU84aWZka2VLNWwrTURYWGhqd3h4ZjEyQy90ZmhtS0xxaGtSQXgvNWFtVGRLQlp6eFpMRWgxZ0x5RDgwQnZhdHdICjRLbUhCeDNCWDlBQjkvRFFQbFk1K3dEaE8yQ0k3RzI3amdNZ2MyMDk4dHhtemlQMjBWSTlqdVp2KzUrRXV2ckYwZlNOUTZTMXg0N1MKdy9qRTlORkxPQkFmWmc3bEh2ODFKckt0eTlxdjR6ckdKKzc1TTN3QXRFR2Y4ZWFSOHZhVHpXY0VqVFV2eElNbEZnUGtVOGxJRXBzbgpDM1lvMEFIR2RpSStwb2djQjlnZmVzU1MwTW5RVXdpQXFSRkx3Z0hLZnFFMXJtUFRGZ3VYK002Nm1VSWVKMHJlKzNPNXBQMzdpbTE1CjZSNFVGRHpyVTExdy9JQ3pYeHkwTTZ3eFVueDhXbjd1NkNMZFl1RkNud3JHRGE5U0FGQm4yMVZsWm1PTUlLd3pDLzl3UFRNTzhPekoKVllNcWRpOWxSNEdxWGE3dUZKWEgyaWNlR0ZDdjhTTEVZTjNWZTZxRzEremR0eDlaKzdQMlVjTzUwT3BSTmhMci9FdDZCL0E3MitGYwpaZXpkQ1dDTGp6L3ZreW85bmxlTXk5MWtQRCtESEtmRmhoYTZWNGlBN3VQbUZ0UEZxaHdYZTFPSGFXN0xrVUxHbUxCdnB3Zm0wajIzCnNsdk5UemFIM3oyMVhJQVJoT1BoUmNLSHQ5bHRqRWtmdzBmeE5BSnozdDlvejluYlB2dkQ1UkFJSXpwaHJIQXh0VkNWdWZad01MencKak5LaTk1c0JldWJhazN0NHpwMkl1bmkyOWpyWStpL2M2VjZWaWUxWjVWa2U4Q00yakFPTVdJM0dSQTR1K2Q1MkpFM1BhTnkraC91NQo5MDg3YkFqZlh1NEZhKzduL2tBMW52VUh6YzlqS0NnUk1rRnZ6QkYrVjNPMjhjTTQrZ2x0K0t4Y1Z1YlpjZFo5Z0RialN5Z2Erc2oyCm0vdWo4YkJ4d216K05tSi9FcmM5dHpXUHlSQkE5cGdnbVdpRkVWVGZ4eTlNVEdQTmlRRVA2dUc0d0h4bVFyeTBQOWxjOGhPclZTeW0Kdy96c1lFN3ZXbTAxbjd3TzhXZ04yWEE2TVVhc0h1Tko2MmoyR1c2cElyMTlSMzA4cFA1T1lkcDZ1NmtSR1g5bThvWHBVb3VwOFR3aAp1K21rd2JjZUgwek16czNOVlR6NE55OVZBSUhmdHpEbVp4anovc0sxMUFTMTd3blhONVY5QjgrSE1HUFhlV0ljTTg3ejJkUHlUSEZHCllHK2YyNmxmZVhaQXg3RHREeU1BaWc1cFd2TEJlUXN3YzZUQlpQYmNTU1IrZklQaDhLQzliTjNSdlNlOGVZTEY0dz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJdUI5UElRSmJRK2hoMzM0Tnh1RHg1NUNkSkh0WDdEVVdRL0ZVYnNUbXNTTlFqZ3JVZHNVUGxpTjUwU1hBeHNqT1YxTmcrV001NnliVwphZ1MwN3pUL3J2dWlZbndIZUQ5dkI5ZnBPR3hiOTFRdzlhSVEwYi9kNjVUMi9vOUZMZmh0amZuc2JyeUhNRHdnR2JzanNYWU45VmkyCmN6alZhTnViOXIwcFdtVDVvRSs0T1FsQnB4OWoveDNWSVJCWXhxZEZzREdWRmNZMFkrVkdUeTBDY3ZQWmQzcHB2QVdyY2p2TlZCajgKN285SDlNRDhDbGVQcTBjWlc4cWZyd3NBOXUwNjdWaEpQUU91b3hhL1U3eDA3a1dHbzEwSTltK1p3RmxuSW80YVg4WU95ajlxa1BpYQpjcGlXeU8vWXFzeHhZZWQrbDdVWGxIWnliSXdCM3owVFphMGVnYVlXdDc5amp1WjhSVHdWR2J0ajJjQzlacDhBRUxKN2Vvc29QUkcrCjRmNVovRU1lYkd6WVl1SEVCdUF4T2JHM3ZIZmZBWXltbTFxc0x2TFB4MHFpM0Q3U2JCcEdQb3lNWHR1ZlV2UUFMZE42eExDSUs5Y0IKMEY0Z1hoZjY4RExXczU1VHhoOHQ5cmJNNm1PSkdQdlhLOXdWVThXSE1hMklBRVdTb1h5ODdqdHNUKzlZQjhCWHRGZHpVdzU4S1hJVgpkQUpacnhBeVdjOStnMklZNFA1N1JWb2o1MFVKNXZGSGJhekhHMjFuOTdiMnp6OG52M2FrV21VcXFTaVNmOGpnMm9yRHhzM3VFRDJzCmZkd1B6Mk03RFR2RmZQei94eTR0K3JLUGU2RWZhZXUrWXNBY3JVU0t1NjBZYjJPaHo3NkFFUkk1TDFaV2FrWFdPRmY0WXR2cDhPQlMKM0wzTXYxL1BBYzRhYWorWExOMmMzeXl0Zk5GUDU0bnh1WTRucmlEZEFTK0hrR0RjOFI5R0VuVFU0Mk1PYUpQaUFCeldYODRZT3Y3RQp1cWdVWi80VGN2ZzdZcHpxM2o4UyttN3I0VzFQeWp2dVMySkhLTnYydC9WZ3RvbmZ6d3BWb012ZEUyL1JJMmVTc3ExSXp1UWMzbWhlClhDTyt2b3g4Ui9LTDE3QXc3dFg4Y1lQUW4zUkZSS0dYV00xL21NdStMWFhya3ZLU1BNN20wTVNGbnN5OU9XUnNPdzFFYlVVSTVVYUoKUVkvaHRKOXNQbTRPeTNYQ2ZBSkp1WjF0VnppRFQ1UFVBai9uaSt0YXkzakwwbXc4amxLZWV3SEJsbFo4T3pJKzRkQWZ6YWw1SHUweQpaZ3dRSi9aUDg3ak5YNDBmRC9wZmVOc1dHWUZsalJyYlVLVklFL1FTUnJiVDFaYW9Zb3ZmWWxkVVhTM2NJQmtqYnNvK05TTU9zRU9CClIvbVd4M1pBaG54akdQc1ZzaXJkZWtkMG00Nmg4NFFqY3Q5KzRjbFU1SHVlS1UrSm81WTlTN2tkZ013blpzWEE0MDgyaC9CaDdLZzgKRy9SVW41anl6dG1kOVh5dU1TV3dCWEI0S3pVcFVZNmZ5aUUxWkVCRFc0WUdjbHdyYkpqM29pSWxUUjh3bnNCaGt5NkFYWU4zc21WRgpoamkzVzhNY0F0R0szNDJiK1AreDk3WHRiZHpHb3VmemZSNzlCL2EyYnB3bXBCZFlBTHNiSjIwc3lYYWR5ckZyNWNVOWJhcERrU3ViCk1VV3FKT1hFK2VQMzQ3a3pBd3dBdmk5bFN5SnA5c1VpaDhBQU13QUdnNW5Cd01WNFNHVTl5QTVyeGlRb0gzV0Vvc2N4VVpIRjJpSlYKTHJaVDJjY2xuWkR6ODFCRlpqc241L0VWbVpTM2VwbzVDTVJuQWgzS2hBV2ZsRDZPSTdNTzlDTUh6aFJIcUJvWDZDTFJsTWhIZWVVOApCUkpQeDF3L1k3c2NQdDBvZUxwUUxua0g5R0plT1pNVUFuM2tBRVhGV2dUQ1Iwc0V3eDRBcFdMaklybkI2amJhMUZ0SWhYZnR5Y1JtClhROHM1TmhVSmJKSm9aaFlvNVVGdXBnVGZDYlFtemhTTHpkRWlCak03TE1rRmtpaGFCWm9NZ2JxbkoxcjVOZndrWDNldWNaR1BIcUUKbEtNTEtiV01CZEliaTJGcVdRU1pmZi9hclRwN0doUE9VZWZZYVBWSWtVVnVZM3AxeVllRmVzcG9OK05vMHl6M3prempnaE9OalZOMAprOVk2cU9oVnk4eUoxQ0xqdVlSbGplRTRlcmRoUmpHc3h2dVRoWWtGZFNwQ3ZHcnVLQXVCNUZTV3lSWE95dzFBZXFMWmtoQWp3QVhCCnM5bnVnOEk5VGVFa2o0Y1Y3T0tqc0d5dW4yamVyNVQwbldXL0c0WWhXaE9EMFA3NGpJOWY4ekZKdUhnZnl4bkZiZ1NCd29mRk9zY2sKNFpPZ0diTUx4S2gwd05SSkRtZm9aTHpCSFVablprYkE0ZFBzVEVKZzdqY2dIMWlySXc5VllzKysrTTZKYngvV3RXMGZYN3VRdkZ1aQo4ZExXVjk1UmpmY1NiQndOdm5YcHdob1FhQmdyekh3NXhWazhmZk5oTjVXK01jRGx4WnppMEdDWVVTS2FuWXlBM2x0eGE1OE45ZlNHCnJRL1F3ZGRlR0J5V1E2cFVBUE0raWo1ZTYyY1NvSDhIRjZxd1J6aDhwOTQ1YS9FeFNNb0U0c29heGt1dk5GcWdOOEJ6aUQvQ0ZKK3IKM1B1d0RxMzNnN0NqUzZUV05PdGtuWnNJcWUyTGxmWVo3MWY4T3E5VFNtMVJhZk5jV1ozT0JVMUxlc1dROTBXT0twWTJ1TkFpZFpHVgpJdlp6K2ttUFQwejZRemdmb1FWS2NGYUoyWDJLUlROdnN5eHNGQWdDdGRjdGZFQzZqRHdvaVJ0dllSVm0yL3ZNS2tjaXNZNWNOMTBFCno2SWtzck56L0NXKzVaSDdaWkM0VzBTRnRSdTZrZVoxUVBIZU9WOUFLUXpIYzhFMFk2VUw5NXAvY0ZtdlNyRjVKSEZQUjduZFJuSnMKS3MxZVMxWWMyK29Wamx6N0tGaS9nMUVRVWQyRnJ1WFI1bUdyNTlZNzRCYUg1S0tzeDZIV2FsV2JKSThGdHpZQkFia2luRERVcmlnSgpDamQ5N0RZeDc3WkVjQUNoZmRuZHhNcDlzQ3Z1OTRhdlc4Z3NrTW9HYWdRTDlyOUk3YTltQkpkZnFxeHFnbGk5QjEvNWUwWDRzQXlqCjlYSDRXYlFoc2M2WlpKR3pqTjdIc1FqUXBzUENyQWozdzlDMHg5SFFIUEdReE1ZVjRaejFpRUJ5VUIvczNLbnZtSDErMHdzZDExdk4KeDAwaG1kM1NCR1U2Qy9YcHdVWGJBY054TzhSRzZUYWF0SmczdUc3R1NDOXlaS3FpS1ZNNEJCUXp5SmNjS0FHY2JjNmY0bkFxdTdPMAo4YzRLQkdxdmlBamg1N2V6c2hucmplRUpydDB4MEZnaDY0QStSTm80cDN0UzJIZDRDYWo4aFNrRU8rK1VzU1kzQjVRY2o4MHEvYXpiCkYyN2xLaVpCUzA5WFhyRDZIMkV0Y3U0QjN3L0RrcWxoWU02bkxSUW9obnRBandOWklNY2FHL3NNa0FVYWQydzJWZ2d4QXZLbldMRE8KM1BnS3diWmhaNG16UlRsWXlkaGJVN1lnV3hxTjlSc2V1UHJrc1NRd1Nnekd5dTV5ekNpWm1nRE8rWGpKZDUwQVNJRzh5dCtUc0VDVApGVzQ1cE9IeUVOcFU4b3g1YXhnQmgwWVpLK0FkMXN6ZnMvRDNFbEhZRytZWTM2MmhmWWxQMkh4RXArZkFEZk9yQ0pzVis4S01EY2x3Cm14VnJuc3JaTUxGNjdxZDk2alYxTkhaeCsvVE1tZHMvL1UwSXIzU2hHNGVCdEJueFhpdWRwZzdkY3Q1QWZBZzdaeDAxMVlwM2NPbWMKMGlZNmc1QmlrUHZCTFZnem9CeWxLcjZMc2VBK2xPU3JqdVF2dFVBT2hhRFhibGx0eTNtdzBpd29YWEFBWVFLODBtWVM3aE41c3B6YQphdGdZa3JENFJLZ3pXMmovbG8xVmtpVVB0MDBrTTZaUUc3c1pXS0RSR2ZkS2E1NFlicGJZTGpnN01LcjV6a0dFWGNnWnFFSVBOQjhPCjUxK1hZeFhSK0VBeVBGTW8xc2hGNms5TGlXZGhjT2NKcDdNcmUwdWdZSUtENHpHNmhrZE9UT2F0YyttSTNGOVE5QmM3SFRnVGZuNHIKUHB3RmtlWk1PaUlmVy9nY3VJZmdqT1ZrbGl0dWl3M2Z4bDdENUpiNGdpNnBraTFHSUpnSlh1L0w3ZHV3YnJkd0N6eW5KeE1kVWhOMQp3Ri9zby90S1J3NmNKaXdvS1pDVzBYcUpsdVRjRm5zRWpGV2dHRy9xVDR3eTk1ZmtWRmhoeXQ5OVU4YmZ2UEZlZUJHMGllaHlZdTZ0CmxzWjdzTEZiWHFnSDh3MGlVTXhGVnNnQWFEU1BMYXVwTSs3Wk9iQ0xJRGIybnR0NFdXTXRQUmFZdXhCb1krMmNiRThRZmd2aElEV1IKMitnY08rT1Vab09FczZXNjYxNWNuM0wvaDBWcWdieFRPS3NWQS8ya1Q5bXZobWFLY0QrVGRlcWk0YStHRmU3YUJGbytKTjhPTFRnQwpHODBrTEdRVGR6aEdJNHZNK2FxS2xteGtrZjQybnZSSENnQUxMN3pEdVE3QlJlYVhqTC9qelRKU0ZuYXJSSmdMUXpPUmpZVEFPZ2JQCkxEdXpaRUF3VnBhN2xlWGFuNW10OUpUQ3FpUmpITVRIRlhsSGtKcERWUW1hOHc2ZVNHOXRDOWZpNmJLZ0JXWUpLMTFTMm10ZUFHUjMKWVh6UlVlSWpodHdhNytzU1BibWVYenBueTZCSWVhTVEzak9HQnNQQzMrZDFZWWI0ckxTL3V3NHJLbk5BY3R3NEVyd0RJWTF1YUJYdQpEQXZBUEdmMWpQWTNMcGt3MEhzWHNhenhWNTU0enFUK1pJWjNZKzNxd2pjaEN6WWVKWkVabEk0amRzbzd1NTd5c1VQYTV6REFoOXo1CmJsYnVUNVpvbk0zODN1RUhCaDl5bHJ3dnBnVmpEVWZMeE4zNGxtamY4SHNFcmhoR1MrWWVaVy9lZXdlSzltdE9Xd1d4VG1icklLUlQKTGRqdWJkd2xMTHlSbndack9vVkcyT1lTdzZaNzZXK0lzZjBOamZ4K0VFTkFnRVM3VzhSRU8yUFE3dWN2ZithR2ZTSjhZMWpiZ0NQMgpLR2gvWTVFamdoQm9XSFJ6akw3RVFBYkRVd05uTHlNb25LVnFyQWVGUDVOd3BBbTZhaFJQWkZXd2xvM2VIczFya1I0VnQ4QndTWTdOCnhua3NqaEsyYVdHNkJwMTZpWjV3MlZUd0ZVYStaVGMvM3dNN1lMUS9SOHFjNzVGcGVvaVR5MFdUMEZmV25IK0JacjUzZGlVOGpUT1YKTWxIc2V0QStRUWMveG03SHhYdUt3bG5lWlhCWVVKK0RET0tjQWVqYmN6R3FtQmRDYzFxSmNNL1NuVzNucHBvd3prS2tmV0FnT2gxegpuNGNnRVp4cmdyWEFlRlR3eFhxdGZWOVRMbHV3R2t3M2QyMUJ0dnk1WkFOY1h4dSsvbGs0YXhRaVZTb2VBd3MwN2s2UXRpZEdSaEN1ClZYTllUaHFPYWJyaHRBU3NML2dlTG1rc3ZyN3pxbWtNOEdGWE1Qa1ZDT2p1VXdDTVVrTW92aGp1UGNrcDAwOWI0SkVEODdrY0pZYkgKQ2dzZ1k2QU51MFd2dGVadVNSMDg1TnJuUzZBWUFVYkxKMVh0cjFjQ01OTktNVEJMUGRCMWxwUis3emYzYzlCcFA0alRlQWE0S1l3RgppMEt4ZU9mcGl1NTQ3Zk1jT0w1STlwQWJObFZqTUlGa2ZZVGN6Tjd0SCs0UDI3V0tSWFBKbmRlS2d4RVNrekhReHlSUjNBSFhWKzVHCklyK2RiSUZ1TDhVK0dXWnFHdWFLOUs0RjkrcTdBL29iek01RU8rdkN2d1ZuT1NlWFlUOGhCa240MVdhY1RvdWhIMTZJMHJwbEJPR0kKeHZHaStFQzE1T1dldW1nMURCTGg1VXAzcmpoMGhHOWphT3NyY3ZVRmI4VSt6aWIxT29xMmxsTkdRRWNIVzFaN0JHSFQ0bHRWc3k2SAp1N0x1YUlHN1F5NTlVQXp0ZHVOTEhpK2Q4eW1DWFVHcGlzNWNwTUZidk1ydlpYaGU1ZXFxOE9mRGxIRVdMbjdIYnZ4Y20wM3k3c0JqCmdXem8xdmFoYVF1a3kyQ09yTUo0QlBSeXRwT0RCUmVWL3BLL3RwNC9Lc2pYd3BYM3BXRUlWUkRaN2hvZ0FqUFd3S1h6cGFYYVBtZHUKRVlTSUZPMVZsMmdRdFhYbVdtQWlHQ3NsUkhWck1OU1hJZWNRWDhKREJCbXJqMlM4WUREYjhJTktoQmdNVDI0T2NNQVlNSmM0UnR0bgp0VDI1eWllb2NOWTFCRW8rekxMMmhWajVXT0FOSGRnK0wwUDdxcUhqQ3lkd1VPNE1oZUZxR2VzTU1tSHRGY0ZlOGFFSXB5TUgxczYxCnJuMHdiR3E4ZVJFWngwRjRmUCtCUm9NSEVTM1VmbTVrZkZjaGpTTS82R2FGQmRKdEtHWk02b0JCZmZSbkU0UTZodzJnVFZ3Z0lzYWcKZXNXQnc5am1aNUF3UEk4eTNqZlFzczl5RC9iRm5JRWVRZUhQN1FET0ZmY3JrM3hvU3d0TzU2VHhxR2haVTNoUGJUamlBekQzaHp2cAo0eHNMNnd0MlN6SHpzWlFoSFFOTEtEeUsrbk9CaUNJc3M1eVhRdWJTZmlBQ3IvMFo1N0ZBWU1vSDdOeTc1MVRpVFZzaHA1WUtsNjl4Cjl0aHBPRCtoaE00SzFuVmRwRFpkNEdmYm1NZzFJK0RBRTJObERTTmdLV21zRk9leTNxeUVscVIvN00xRVVhY3cyVVR6dEpmT2VJSFoKQmdyMjFKS0gzRFltZkxTejl2ZTM4VUs5NWdPZU1vYXYzcy9NVTVGRzlza2s4U0hNS3RWZXNiZUdLWXhMVnB6anp0OXhSS2czbExCYgptNHI2ODRKTFVVVEpwN080Sll0QVJjbFVjdWxqb0lPeldtYzJya21GNkJzVEJSQUJtT05NUXNZcHhPb1RRSkd0eUFMWmRVdG5tOXdqClVJblhvS1JrQkR6bmpMMEtVS2U0ZE9sOHN0cWFnQzBDN1NOd3RZM0lPM0pndmlha3ZmVmJhVGEyaEF4ekNvZFordz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJNHhYTGI0VlRUZmw5eVlTeVh0U2prdktESzZ1OGM0UXNqWFVic1MrOGNRK2RJeGFvbkhLTWRtYjI5S25NTG0wM2E1VXJLbjNNQXp2MwpWZWFqeTdTMW8zUDlZUEpMM0kxMVJPQ042aXBKR0t2eGxramFqUmxCSmpsVlZPb1ViT1hDOGxWc25sUzV2MTZnYmRBQ0krRHJnZHE2ClhQamFBbnNGM1pIZG91Q0R1clkzV3kxUTVrSFdpM0FkUXBvZ2tyU3pJNm5jK3lhMERWRjNRTzltNDZ0MUNtV3FGd2dwWDFoVGhRMkEKY3R4MUlUeXFpSncrSnMwWmcwNjl3eUcxOFFrS1hWK1M5UnMrZkdDNmRpbjk2WmNka3pxSlVzQzVHenA0K0dHaG1EclJBY0RDRzFISQpZWHZncW1mZXI1bmtWaUFBa0ROQ09JbGlnZXdZMWRhV3p3aGtFYlpYd2JkYWd0NlRPWE1nQUhQRG94RHVmbUJacGtvSEFncldPL24rCmxvNlBkR1RwNStxNW5reG9xTVBWVTdyOTUyQWg4eUdwYXJhKzhMbWtjQnUyR3o0bDNPY3pyY3VWQjdEUWZlMTduM3FzMmtaWUlWRFoKNkRNcmQ0eFBjY1hDSDg5amZNa1Y4eGFiekNzY2ZCMHF6RmN0RmRlWFB1eFArS3RxbUF0TDhtQlRrSjhGY3U4TjV5UFRYbUNReW00cgpHNS8yUmR0SW1pTUhscEkzVUhkdXdJeG1pYzlJNXBSK0JFcldwRlVZVXVQRnNmYVplYlNKNW85MFNoQ1d6SVNiS0ltUG0wU3dZSjFQCjV0WUJnNWZKQkV2TjFLVzEwb1p2MHVNNVBhclBWKzIwdlczQWROSDFHTmJqY29laEVJWjc0QzZwWWJDTVR5eVhzLzFDWjlGSlVSVCsKVnA3TGoySkw4NDI0M01iMnVMS09Cem1lRi9pa21QTjFYZ1Jyemh2SmpuMmQrN0IzWktLMUZ1RmR2OEx2YU40d28xR1J5L2lvNkt6QgpKdkZpeU9XZnNzQ2N4U09wZ1ZRZmJ6RjZrVWNYNzQ4Y09KdytpUGQxdWtmSjdsRE52akVqdkJQTW5WMHNXc0hCTTdyaEwzRUdzNHd6CkpDUE03NGJLYjVKR2VGMUgrL1JRQmswbG5HK1M4MndZNFNNWXRKVjhqQ0FzVGZLSFc2S2t0ZXJhS2VPc05VYmF5NWRPNHRpNVpWTHIKV2JZTU5LeVpFWmpYcHQwT1Rlb3ZQbXViamF4dXI5eEtOa0dDdXNCTUNUZHh0UlVUUnc2Y3kzeGl2aGh0WTAwY1pRbGZVaGFLWjJ4MApxZHhFcDMxSzcxdW51OXVaNEFYcW9ueE1jTmRwdTh4cy9aQmhGMXZWWERRWEV4WUV2SlB1VFJBVXNzRDFNejhHOW9pRVY5cUQzOWdkCkdoQ1lDWC91WVhNTFhYL1A0elhBbC8yRkMyclEzdmxoQ3NwUzZHYTc0TGJZZGE5dHVnbEdtOHZDSDZCenpubVFSRVorVHErRWFSTzAKOFhZTmUwYktaSlNKa1NKV0NDK21idkNtUUZZK01NMkRadXNTQjR3QU1DUWJwY1hMQ0RJdlkwbFMySTZsTmlUYmtwRVduRlBDeXowWApRNWNwbTREYnpUaGVjVkNTZzI1MGRLY2NTa3QvK0JMYUpTRlJVVXBrWjU3S1VPVk8vVEdQRTNBb20rVEVpZFBDVGRtTVpLUGt5V1ZOCjE1bTJkeGpkZ05uOUtBUFJ6WjJsK0J5TEZrOEFpdXVuVms5Qm9HWlhxbklPL2N3RUJuZ0RYMmFpaEsycDA2S3pMSElyQ1plMUtzdDgKWWhSdGc0SXNnaXlLWUVoZHh0Y3M5eWx4dFUzMFo0RjhGZFVkWlN5Q1BOcm5OQWV5Wm5sa05jdGRMQkVCL2VHVGsySHdpYVZRSWJFTQpweFF4L3VvTUF2M0IxU2U4eU5tSGlTY0xsazFRTkZpR09JWXlLNkpvQk1xelpJRmFlMCtadit5RW1XRWttMmdwbTJMSWJPTXo1cnA0ClF3UjZ0ZHhaY3pPMEh2aTAwNFl2MldJYW5jemJocHdYRllBcVJMYTRTNXM1SHQ1OWVzU1FyeWZ4dVV1MFRlVmhnWm5rSUNCUldQRUUKd09DbUNxb09ndjJ4anpYdFBMSFhhQzFXbDNNRGdWNWtCTmJtd2tjZEI4TU1wUkZpTGtwM1ZzaEZISnRUOERrSXdkNmFXTGd6VXg0dQp3bW1iaHF4T09Zc1NyK21RRXNBSVFrTEozSXJZWFBpNFJEdzE1dHlCTkFuV3ZUeDBJSUJaelVDa0tXc1UybDNkeFpKZUxaTSt2UStWCjVXVkFKMnZYMmNJYmxKMUZHMU14OGRLa2JkcldsLzd5cnJaSE9nZFVYckYwbHhrcGxSTjNsT09yRVNpOVBvRm5sU01IOXJ1QmRyZHMKRWViRkk0c21BSEllRWxSKzJOMmFvNEJXdnF6aHNsbkJDNG50d1FBTWpwSW9KWnVNWEIwc3MvTTAwcjRveFlNRmh2eWxSSXRGZ0ZZWgp2Nk1uWEoram9aMVRZYksrRDdSQmFPWXpWNGVXQk0vQjNOMGZBeUEvRWVEeVhuTjk2YlUvc2gwNm9KOXFMdmxkNnFORVlpbElZSi8xCm5KTUtwdDR2UEk3QXUyOXlIMHVjcHo0bFJGUldScm82WjNqQkFmREdWUm5OaThLa1hrK3pkNWNRcVRmc2NUSXRHaFJtUU1oN2hYd3gKcktjSVRocVorbXhpSVNJRmdHeUlOWGJ6WXdSaEsrS1luRnpGeHFQY09wc3dvWnBQOTA5UG4xc0V5c2R6NHc1bHpRdDViR1ppZDIrTwpoaWpXVVh6TUFlYXY4MWRUcEJKY256SWhxZGh5ZzhBUURPR2pWQkJCTURlNnpSVGJ5dmtjeXlsdXFBTitaQVdibVhMalUxR0YzUUN6CjdSVXNYM25ud3J4OFJ2aStzcEtSWjFIb1lwSTVkcG1RY05pTFRBeVU5bFlpbnlZb056NWJGRTZ1akRQTm9VR2VsUlFPZE1mc3R6NWsKcitBc21GRjRoTC9YbnhmK0htWXdNQ05RcC83TW5qQ0M2QkVGdzJweFFVK3orRGxyVjBjaHJBRkVXVXVaMVFhS2NLNElrUmhGR3FsRAp1Wk10Q0N5OFI4YWR3UUNZaDRBL3pWWllCQWMzaFkvSExKVDN1cU9OS01rOU9OTWNXc1ZpRHpVcDd6TFVMdmtReldudkFHTDloZVFYCnN5c2NibmkxT1EzRVlxVm9LTGJSR0VlRThkZXFYVVNvUld2c25VWVZXOU9KZGN4d3VzeHFnU0Q0T1RiTU82SEkyR3ppWWJUOXdtd0sKYkh0M3I5RlljT0N2ZFBtSDZQcUVkOHk0b05JaTg5ZjF0RFZXSHpnRVJaWk02QXFZbmNjYnJsMk9Uc3cySVRsckFCMUxiWDJYQmNXcApGVzUrNUQ2aGl1R2NRcHlWMFZJbzJDZzNMMlYvbW5LR0JYNkxoakxyV0lxZEU2L0lRbUt1M0R1ajZVNlJ6OE9ZUlp4U0lSY1FaMHFtCnkwS2M1SVB5aEFlMityektxWTAvUVF3NVh3dmttdzUwcWNXbjB4UjhjNVd2cDlteTdzMkJ6TDg0RStYa3hRdGdmSW1kOWdhZUJibFAKMmVXenlaTVE0T1JIV1NKNElvSVU1cWJjL1JZc3FUZ1RRT0ZqMFFzWFFPNEl0eFlGUkJDeVdXWitkcHB3b1paVFY1QVAxRi93VnpuWApWNFZQNE9RT3VXVHQ5d2thL2MwcG1qdDhiNGZNZUE3b2N6VFFWUW9MVEhOT29oVTg0cVErZXdRdUJvYzJBbjRveFVzdTdZTXMzWXpnCmRhLzlGWEM2cE9qa2hyK09xMTAwZlRILzdRcWZTNXoxMkVJMWZBSlpUaElCc0pBQ2k2NHJIRGpCVldTY0Y0WHZpaGNxem1mcER2UUkKZEJsZzNMTnRYazRhbndEVk9TUlFKQ3UrVWxpd25FWWxKRXhPUGg4Z1dETUZWZ2tycEw5eEdsSVRJVEF0L0pwaEpiSUlJYVdaVjhJSwoxRmo1cWgyY0U1UURxcHdUUmxORU9TTlF2RzdKdEdoaDRRWS8rNDBMWVUrbGJwbjVJUlRldmg1eXJTQ0N6TThCdTMvVDVzWEpta1RtCkpRU0FDNTlvMWFXcktVU2M1MVZuRFBUWk5LbFRYRDljZGN5ZERST0JCVjlMejl6UkZZRDhva2h1azEwd2duQi96eWtnQUl1U1VMa1kKcWdJOXJueTFOZHlKS1pJb01RM2QySEJsQmFmbzVFd1NtQWZjTUsvOVUxdEZlT1lxOTJrWXB0T0wvMlB2YkUvVURwM2lHaVN5d2czeQpmQWJZOElrbUJ1YXpnRjZaazlFTmJBNnZHTXVPUzIrcTFlT3prOHZnM09MNm5yNm9xQXJKS3p6T0NRSmM2bms2S2ZLVllweEdqakswCjFQSUZaT1VQb0J4NWt6VmNBalE4RmFjc0pCUnJBWFNBOWhja25VaWtvdjd1c2JzMGhEaDk3bXE2VWVZUkpEeWJwZFBsaEErMnhUdVAKR2RlZjZEN1RsZHBKUUFLTFRLTThZa1hCYm5GMmVDQlFlL3UxTXczSXlENUhPZEVQcHVwek5wbzg5UmZldFQzTjF2bXM1RjB6bkFpVwp3TjVqVlBnekdDZlFEdFpqQXZJWmxqYWpDSUdjYnN5N2dVUkFPczRCWk0yZnZ0OUwzSnllT21PZU05aUg2ZWFhVWFYQk51dkNSeENvCnh1SnkvQkV0dkdsUzhCbVhuN0h6MFQ3elQzalN2NmpHbmg4NjR2cUQ2N0lqcWpUZUlzT3pKQ1FlZENlT21mU0haOW9tN2xnc2VVY3YKOWZmSTNEVVpCRXAyNFpJZVVGOTh5V0xtSFltUWZvVURCOGFCbkpwbnhwV1FNMmU0RHVsZ0tkWGp1UWZQU0VVc295ZllDbmF4VCtNNAo4bSt3VGVTTzREZlkwb0szWE9tQ3BNZHlSMUNpZFFmVUxLYkkyblhBQ0xSUDJzSzN0RXg0R3BMdllNeEtYc0hQc2sya1B1Qm4yYlJYCk1WS2ZVQlBBSVJrWDU2ZENvRTlBUkM2S21YaTV3ZFRlR0ozWUhCRHNjM2R4Vm5vQyt1eE1ibnJPVDNNUVV2aWxMbUNjRVBpVUFESFEKNXpOZ1BXRzZYMGZoNWFLeHZHejhjQkZmR1VhdzVyeHVRWkhtQ0V6MG9mbnNWeG1JbUphckh4SW9zQjBvRFJkZFFyNy9HWG5oN01LYgp5dnQwN3NEK1lqMWZMcE9adjdxUk5WekVrc3lpYS9uQlhJSFZNMVpPcFl0N3dLYUt4QVBkdmFDcDlxUG5aOXlwT0xjaHMrSGxKZW5CCkNiK2NGTXJ5YXhiemt5R3l1eVAzQVpzSWpFdldaNzlUTTdOYlIvNXB6cEE2bFk3Ri9EUW5CemI0WFZWbTNpU1grU3VuOHpsWkdNNlYKeFR1NHpDUEZrNU41VEhlQTN5Y2lOWXdQc2tiNHQyUHp3ajgyNHRPZ0U5Z1hkdStTRUpCbk5SK0ZreXpLZEJFZUg1aHFMVHhoTzFIYwpkOE1uMTZVem5lK0dUMnFnWE5aT0JHWWgzWWd4ODdyQkRZYUUxM1NUYUVtRG1UOHArL2VXTXA5NHlyOEdONFUxdkFMRjkwZHc1WXZ3CjhpZm5PblZKc3Z6empab2xxUmFDVTM4WTVWOEZkamxCcC9HeUNFeHNXaVA3QTZwKzV3NmNwUDZwME55L1laZjdqSytjMUIweGUxSkMKdXRMNVBRN1puL2o1QXhFbmx1ZUhnS1k3eGoyV0RjbUdaSm53VzZ4Q2VEZVQyN2c1RFVBUkxJWjgzUnZUc0hDZ1dlS3lEU0lDeFc4bwpKb2tJdC9qVGNJT04zL1FVM2lRVll2dW0raFUyR1JPaXgvaE5XN3h6WDdEN2g1MXRWSlNOLzduMk1CL1BRUWxOZUl2SWZEUWxSNTRnCnNQQldlbmNVbTJxZlpYWnExN2RpNitJNVF3VjcwQ2djNzhpQjB4RGVKMU8rM3loOVVBajNkd290TjZkdDFLamQ2WXgvMnhkVHhiR0cKRVI2ZVFMRGdrNzcwcjM5TUkyRzVhYUlRQXUySk1UNjd0YlladFRucG5uZXhrU0ovTkJQRmtYL2pMbWliZEgyQW4vZ0tGOWpDeFExTQovNXNHejdUZ21HS0tjN2VvMDR5QkUzaDV6eXA4dm1wbjVqOTM0RlJ6bUFiN25URzRVZm43SjRYbTRFWmp2SldlRFZCWU5IaDkrYlhBCndsc0JkY2hyUE5VQjFrdVR5TjFDRjRiT0hUZzhSb3ZCcHh6L0VSNEpwY2pnbzlrNGp1Z3grYUoyOTlQYXl4L0hQczE3WUY0ajhPVGIKZnUvNW9OTWJkWHF2Nm5VTHBuZm40eC8ydnIzQVgwUmlmenIrNGZHalRoZlE3TjN6SDJ0ZjdOMTcrZlRvMjM2N3hJK0huZGFvMCs4MQpCKzhXL1hDL2R2Zlg4MjRQZnFwRHR3YWQwOHRST2Z5MDl2bmV2UWVEUVhPaVJPdDFwOXNlbEQzOFhkYnVQZW1Od20vNHoramRSWW0vCjNRVk41TTZudFh2Zjl6b3RBQjhEM3Q2cjhhSnZtOTFMVy9hWFRudjBlbkhoWHZPY3lrSlhYT25QMTVtaTEyWG4xZXRSWlpLNCtJM1QKMUQvOXVXeU45dnVYdlRiMGI3Ly9hMVVDejJpK1FkSFJzREtWWTNWdW5OUUhUMDRlZEM5ZU4wOUVWUm83YlNpNWhDWXNjK09rVkorSAo3eW9QenJ1MXBtUEp2SXpvK0pYL0x1N3V1b2pKMGVYZzlMSmI5bHBsVlZiWXFoVzV3ZTNjOU1EQ0VhOHFQYWZOWWZsb1VQN25FcGhRCmZicE8xTHB4Q21WVjhucVg1ODlhbytiYnNycWNqS3ZjT0dHOS92R29NMm90Mlk0RGZVTXEvVjJudXdLQlkzVnVuRUpjY2xXcEc1VEQKeTI3MWZaeUxWNUZBYzdvdUZuUjk5bTRVYmNybGR4WEZTZWp6QXZhdjhiaDBla3NXWUx4Rlk5a2JuMldkWGxWYStoZmxvRG5xRHlvVApGQ3JjT0ZYSC9jdEJxM3c4YUY2ODdyU3FEOVlLWTNXTGkrZWdmMzdSSDNaR0s2eWQ2K2dIYWNsVnUzRHZzRHlyM2Q4ZEFkZVBvdDBSCmNBYVZhM0lFVkxzajRBeENka2ZBV3hHVFo0TW1hUHZkYi91ZDRaWWRBaXRiV2piekRGaFppdXpPZ0xzejRPNE11QT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJT3dQdXpvQzdNK0RIZGdaVVczY0dYSUdpVFRrRHdzRm92M3hiZG85Zk45djlYN2JBUTFhWDIzSkFXb1dTclQwaVZkYTBoNlAyWWZtMgowOFFPcmFDS3hwVnVmSVJQdTVkTFJQMEgwRVZ2UlVjZ1k4dTJhUWlQbTVmRFlhZloyMTg2Yk91b1lGZGVTZTNxWXJHOTFvZnZkbldwCjJQNzFGZ2pwbjUwTnk5SHkyYlI1UW1BVndiWXBxLzhaamRibXJmc3VhcFlZWGRqcWQvdURMMzU1dmZTSUUyK3E3N3JWclkydTlJM1AKdHNvQko4UEx3Vm16VlI2M21xdFFOVmJweG9rYlhwU3RaNWRMNXQxT1FveEppQnYzRFZhZWdEQ1lsOTNtNE9HdkYvMWUyYXMrVHRNVgpiNTdLVllrODZQZUdvK1lWaUF3Vk4rbWtBc2MxK0U5Vkp2MVdtU3UvM2NiUlU2eEN5NW9mby9VS3BIendjL1MxcUNMUCs1M2U2R2dWCkE5UDEyQ3JMWTdkaWo1eU9zWG5hMFpXT3F6dnZ3MjE0SDdaVUUxcVJyRTA1TGwzQm5iSXVNcUh5YnZGbWlVNFVqUVVXdmZrNGpNcUUKTExHcHhJU29kZFk5MzZUVkNVblhtcERxZTh5YjI5aGlWcFphNjc1bk5nZWQwZXZ6Y2xUZHNiMUplMmUzTTNyZTdDdzdpMjNlNXJtTApTS2k0aFc3T09YcDFxL2ltak9mVGN2Q3FSRTV1bmtxMHF2elk0aUc1dm43c0FvOCtqSTRsZG9GSDZ4OTQ5SEZkUGpubzk3djdnN0w4CnJiTHJiWDBEckZhWWpPdHVHYTVNeU5iR1Y3VTczV1oxZi9BbUhYa3EyM00zNjZ4enZaRlY2enBHSkEwckVuSWJRbEUwS3FlRkdEVGIKbmN2cVd4Y1h2ejBWdVQrNGVOM3Y5bDlWRnVicmMyelpYdWwyL1hlWTFsWVVyTGxNcTM2TGFTZlRkakx0S3ZyM3RnVHlubGIyaG15SwpFRnZoQnVPYUM3SFZMZ0t0SXNWdWFjbHZhdmp1OXVZSXFMeTdiR2FPZ01wUnlic2NBZE1FM202T2dOUHFpcyttYkV6VjVmbTY3MHlWCngyWlRkcVpOenRxd0pOd21FZ0tyM2JtNHBjc1dLMHl1dFE5b09hMDhOanNodHI1anMrNUdnZ2VWWFVFSHI1dTlYdGs5THJ0bGF4VWoKMjNURkd5ZnlSV1UzMFZXSm5LNTRhOXZSWVdkNDBXMjJ5dk95TjNyYXZOaThQZW04Q2FncXU1TTM0cXhVNC8vV3BqNktzWTlWcWFaUAoxZFZ4TG43emdyS3lzV3RqTnJIcW9uL2RON0hWY21sdWdDWitnRGVrbjFZUUgrc285cXJmejl6RVRDbVZyU2tiSXdlcXI1NTFsd09WCngrWWE1TUM2ckw2emxZSzd6anJkN2lyQmE5M2JVRHFXcUFlUmZSWWZwYXB1bDdXbGIvN0dTbVd4RnlqenpYOUwvYTlJNFVTdFd6RFEKOWlyUHhHYXJkWGwrdVR4S0lpWXZxbkx6VnZYS3M3SmRQVW1UTFh2anRBeEtPbWhWSHFwMnV6UHF2RjFob0h5RjliM25kamJvbjFlWApoRlI0ZlQwNW8zNzFrMlQvRmdocGRuOXB2cXU4Z0VBMUdqVUhLNmxTdHZ3dDNHN3JsYzNLMTRWYXpXN3JhYi82bFkrb3dpMmRUSnE5Cnp2a0tFdnFhN3Foc2R2cTdlcjR0WVRPdFhkak11aDZGcWcvTnBwaEVkbUV6OHpidzJ3cWIyZmIzRmF0blU5c0Z6c3l5MDkxbTRFeHIKNndKblZwRG82NzQzN1FKbjFtaC9xcXlOYmtiZ3pBcVRhKzBEWjFwYkZ6aXpSVUpzRnppekM1elpCYzdzQW1ldUdEZ2pQcGJBbWRiVwpCYzZzSVByWGZSUGJCYzZzazlqYjZzQ1oxdFlGenF5d2V0WmREdHhtNE13bXVJZzJKL3huaGFGY2RWTGUwbEJ1Y0xMQ0ZRTFNkb094CnVYazlObWNzcnE4ZnQ5dUhyVWtaK2VESnlTR2xDanBaemI2MFpVR3MyNXN1NldieVJLL3I1ZHVQSVQzUFRyNVZrbTltSjk5MjhtMUQKNUZ2bHVicVRienY1OW5BQWdJOWJmU3VSQlR2cHRpSFNiYWU5N2FUYml0THRvMWJlZHRKdGs2VGJUbmZiU2JmSzBpMTJHNTJzNWh6ZgpNaUZYbWZnUDRvdmVLQy9oYmhHdHNJaXlqM2tSVlNaK3Q0aDJpeWkrNTUzVWRPVkFRRXYyaXhWaUFhTWFONjZPZlZ5dmJUM3YvRnAyCm4zZWI3MDVXdTQrNVpYSndVSjczbDZXTDJPV2t3WTdjVms2YWlrSmtsNUJtTVhtM21aQkdWSitUdTR3MHQ1aVJabHR6bnd3dk1QdEoKVmJyZUsvZkpEVlBXNmJYTHMwNXY2ZnZYOGFoZGxNM1I0UXJMTEtweDg1S2pKdTdMcENZMC9KdlU0UC8zNFRQOHZROC8xSzc5UHNxdApIRnRXVG1TekxxclV6UjRwYnpwZWRvVzMxamZsbHNBV1BwYTV5akI5cEJjR05zTnpzKzRYNEpjdGhNMTBzN1g2NXhmOUlXZ1R6eTZYCnlLL05rM1lyaVlZTmliTS80UEhhUExsUTJZajRab2w5S2hvTExIcno5cGJLaEN4eFhNV0VxTnZRdFNzVHNpUXNKeVlrWFd0Q3F1OHkKYjI1ams3bVNncmJ1TzJkejBCbTlQaTlIMWJXQlRkMUJ0eTRINVZYVWc0OXhLOTBjOThlVnB1dW1ET251RnVMTy83enpQeThpZEMzOAp6NnZsWE56NW4zZis1NTMvK2NPVHVmTS9VOUdkLzNubmYvN2dkTjNnMnhzNy8vT0hWemZSQXkyVCt5dXBuanVmODg3bi9MN0U3WHpPClZ6TTNyUEV3N1h6T2ErVUFhSGZPemk2SDVVRy9CNnBCci9yeW1hcDM0NVB1WGRudDluK3BTbWUzOCtyMUNINnZ0ekFKYVdVeUo2dmQKL1BaYldieGZEczVBS1Q1ZTdTR0FzVXJyNjZheXdubzEyc2JxM0RocGJuMXMyK1oxclNFRTZ6MUVXL3dzOGM0RXQrNG11RlcycjUwZApibzN0Y0x1WGlYZDJ1SjBkYm1lSHUrSng1LzZyUVZuMjdvTWFWdDRIaWp1dit2ZmZkdnJkY25SL1VMYnY5d2ZOM2pJLys4NUFkOU01CmJpcGJUTXN1ZkZuSlBCZlZ1UG10TEs5TVdQTzN6dm5sYU1tTGxySGc1L0szWnYwNTdKQlo0d2pWcmx1T25UbTB4NVFqcHdGdTNnSUEKeWJUdFZocXgxV2FhNFVYWkFvVjVzTHNTc2RiMmpCVW1vUnZRaDc5ZXdGbHJCYXZ2ZE1WYmlHUllsY3FWYmR2VEZYZkduSjB4WjJmTQoyUmx6ZHNhY25URm5aOHpaR1hNK0FIMW91ckhHSEdmWkladk96cGl6M21mWm5USG5mWXc1dDZGbmJWdGMwaHBacG83ZE9XbHpUVk5iCmViMTRPeE56YkxFUjZncWtiY29GMUExT3oxRTloOEl1UGNlNkViTG02VG1xRTdMbTZUbFdEYUZiKzcxenUxTnpkRHVqNTgzT01rdjQKNW0yZ04vTTJ6bTRMdlQ0NXQ5dEMxMDJwV2ZNdGRHc3lYRjFKK2Q5dG8rdXdqVzVkZHF0VjlZT1BjUXZkbkVDQWxhZnBwZ3puTHF2Vgo5bVcxK3JoU1B4Mi9icmI3djN6Yzd3NVZUbnExUzF5d0h0ckJUU1F1dUtVZFpiTXYrMWQrRHJSZCtUVmFLbnJqTTZ3NklVdTJoNWlRClgyK0JrUDdaMmJBYzRXd2FsTzJWVnN5bUNJTnR6Q1gvakVidG96b2pYSDJpYnNxZ1h1R3dzQzZEczlWbTdkMGhidnNPY1VJbGQ2ck8KMDE4NjdSV0N5RnpwbXpjenA5VXBlbDJ1RXBQbGk5Kzhjdkl4SHJXdkljWHlEZE5TRjdyeVZLeXU1OStHbXI4S0pkVVYvVjgzeS94aApkdWFQelRyeDdNd2YvZlZVay9OdE1YOVVKMlJuL3RpWlAzYm1qNTM1WTJmKytJakdaV2YrV0hQengwZDJzQjQxVjRqdjJrWVA5dG1nCjJSbzF1OS8yTzlWRDRHM2xpbVBNTGQxMHRHdWpjaWFaMCthd2ZEUW8vM05aOWxyVnRldUpXamR2MWFzY3o5dTdQSDhHWS94MmhhdlYKY1pVYnA2elhQeDUxUnEwbGh0WFl1SUNsdit0MFZ5QndyTTZOVTlpcWJNbmJsTE5FNi9vQzlOWjJiSGJKdERjby85SUtRbjZYcm1neAplYmVacm1pWHJXaUZnYnE5YkVVcmFGOW5nLzU1ZGVGQmhXK0JuTW92VkkzNjFUWGovaTJRc3NzalJadjhMby9VL0R4U3QySk5Xam1iCjByVllrcjY3SEp4ZWRrRkYyRmhUNHk0UHpBWmN2bHZoakxFaHB1QXIzRTdibVdFWFduZTJMZ3B0QllwMlVXZ3pxTHgxWTNuWUhFK1cKWEt6ZmdFaTA2cE54dmVQUXF0T3h0VkZvbzRwSzI2WTVNSkl0OTJCVURoWGFPVENtQ2J4ZEJ3WXV1V3QzWWR5U0tyczdBKzdPZ0d1MgpoSGFud0pYNnNUc0Y3azZCTjBqVFIzc0tyS3lmN2s2QmEwUEgxcDRDdHplUXJYSkdpYzA4QmxZbWIzY00zQjBEZDhmQTNURndLUzI3ClkrRHVHTGhWeDBDOWRjZkFGU2phSFFOblVIbnJ4OEFmKy8zMnEwR3p1bEJlMnpOZ1hXekxLWEFWU3JiMkhGajVPTEhMU2JFZVYwZHUKNW9yc0dnL1VwcnphdDlrWk5uWUpSaGNSc3N1d2NldFNZTTBsV3I5Q1pvM05rMmtmTEYvSVRWdTd1NkIvMTF2OWJuL3d4V20zMlhwegp2MlpCL1l0bXF6TjY5OFVLWnVQaDZGMjN1aG5jbGI3NW1HbWtkZHNFeEVwRWJjcWFlb1FUY2ZPVzFQdmswZG5aVG0vRGRycjlDc1JxCjhtSE5OWWdoWlRFOTJFYVJ0OEh2RzFaTzNPRGVTVDNvOStqeDl1cG5pOGw2Tno3eGZubTl3dVhKcm5zSXZsNWg3VVZVVGxhN2NTSXIKQitNTUx3ZG56Vlo1M0dxdW92V05WYnA1ZjhGcWduMDEyc2JxM0RocEt6NC92Q2s3MXpZZGZWZDlJWHA3ODhLWXlrbW55aTU4V2NtMApIdFc0ZWZtU1ZoYWZ6ZDg2NTVjcnVGaDkrUnNuaXJhazI4eG1kQzJxMW1HSDFJaWpWWnpDMTVRdDROREtoU08zOVcrZTdyZFRqRFpkCk1ickN5OHM3RGVJVzlwZksreVlQNk1OZkwvcTljb1ZqMW5URjlkWFN1YThybnlXbksrNjBwNTMyZEgzYTAwNTV1amJsNmRndDVjM1YKbm5aUjFodmpLZGhpTmVrS3BHMXhIUG02eUliS3F0Q2JKU1dqc2NDaU4zLzlyREloUytJTllrTFVXaE95SkxsUlRFaTYxb1JVMzJ2ZQozTVpXczZwWmRlMzN6dWFnTTNwOVhxN3dvc1FtN2FIZHp1aDVzN1Bzc0xaNUcraFdQOUd6d1Z0b2RUbTMyMExYVGFsWjh5MjBPaUZyCnZvVmVTZm5mYmFPN2JmVDI2Zm9ZZDlETk1WWHZIcFZjWTgxb1c1ZmFocjRudVM3VFlsc3pJRzE5SXR6ZFUzNmJtd0twYXBxZ3pWUG8KcnVUZTJveU5acE56TzUwM0FWWGwzQ0tiSU45RkxYSC9uZlhKUTZxU1RKK3Fpdzh1ZnVOa1A0YXF3K1d4WnBzbk9GWVhpWnNpTitqdQowdE1LQzNBZEJjZFdKMGJaNWt1QVc3d1JiM1pLa1hybGM4bTY1eFNwYjAxU2tXZGJmeWQ0bTQxeW01cU80K3F6YnYzZE1kc1pFWWhtCmZSeXY3MjRpaGZHNm55dzJSVHhzY0RTRHFQNGk5aWJxMy9GeXFuemxjRlBXMDFWa3hhWXNxYzNXd0hGa1hwNlZnMGVkd2RhWlVkWkIKaXEvTE9JK2FwOVg1c0FrMlQxbXI3UE1oMm45WXphZzVWdWYyRW9GZDlsb3ZOaytvYk4xa2EyUzFwUFp4VExmSHUrbDIrOU5OZkN6QwpiZitXQTFYb1BJU1h2YjhiTkh2RHMrcXZYYXpQN0w5aTlQM09hSEpiUmhNN1lOdW9jRi9sTUxFcHg3d050cHhRTk42RGJ2ZmFwOXZtCkhJZXV0ZzQzWmE1dWFCam9kZlRoS2s5WTNYbndSQ1FuRDN0dC81UVZnalJDVHI3dDk1NERDc3JIVkxmZy9mSlZweGYvc1BmdEJlRlEKOXFmamQrZW4vZTdlM1FmdGR1MVI4MjEvZ0VKa0w2azlnUCsvL0dYdkV2NmIxSjd0SlExVFpIQ3FiUWlWcTh6RzdEU0VTYkpjd1FlVApKVHJQNFVPZUc1bnAyc3ZtWG9qeGVma092bndESDM0RzBDODFrZFNlMXY3NVUxSnJZd3N2OXVwSlF5a2o4NkltUlNQWFN0Zk85K3JDCk5FU1JLQ2pjRUZxb1dsMnFoaTdTdklhbHBjaWhqYnJVV0RHdDFZdUdFYmt3dFlPOUFCT3lZZklrcXgzdFlkVk1GMUJWSm8wa1VRVjkKa0Zyamg3U1I1QWJRaTZ5Ukdwa1NKRFdGcUxXb0R6cHpNSWRVTjNKcHBJVkFWd2tpbE5JQmd2V1NScEZMRlpVcUdsS1pCTnVURFNscQpkVUNUNU5pK3lCdENxQlI3N3JsUUY2SUJ6UnJvdW1vVXd1aFE3R2d2YjZTSTBPS0JocElpU1VORFFnRmRjY3V0UFFBVktiYnB5MmdZCnJWd0dxb0JNWlFvWmt5NEsrSVRNWnY3QTM5eGtXV0FoRG9kT1plRHp3WjRIOFhBY0VVZ1ZORUxhQ0MycFdxb05BUklGTXdZQkVzZW0KZ000ZzB3aFBrZVRZVmlOTnRDRThSYU1vbElsQktjNjFGRkRqNE9aWlVVdEZJODBLb0QwRHBoaVRJNEQ3azBvcHNZc2VCTDB1OGxSWgpQREI1TGNzSWhHeVJCQ2pzTU1EVUVCb0hENHFtS1l3YThBZG1weWdNZ1ZRS0k0VFRRSnZNQXNaR2dnR3RQZWhYWWxJZFFDbndRbVRZClVvYWpxbXZSSElBQk5pS2xpYUdnUHlyblVraGZrU1JwRWZDRVNSZ2F3OGxMREk1S1FRZUV5RUtuY1ZvbE1Lc2l3Zz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJY0sya1F1cEFmUjE1WnFRT0RLcW5NcXd4Z2tBblBZeVpEZXNPYWhwZ2dXakl4Q1FXZ1lHeFF0NklBbm5qeWVVK3d1QkRZYTJ6bXN5aApycW1waGxFNVRDQnBZTVVBd3cwc0NLVjFEWlo1a2lvSkZUd0VhRWhTYkJmNkM0c2lqU0N3SGtWUlNJbWdYQUE2WFA0UzBjS2NTZU9PCnNBUTYyRHZiKzM2UGhGZDd6OVR1ZmxwNytlUGVuWk5ab2dxZ1Z4UldVSE9HdUVMbzFRU1c3Y2xWUkJiV3ZJclFpamtTaWEwN0o5T0MKNjg3SnlxTHJ6c21WaEJkVXU0cjR1bk15UTRCWjRNb2lqS3BOQ2pFQVRvdXhPeWRYRW1SUWJWcVVFYTdWaFJudzZ5cmk3TTdKRlFVYQpUSm9yaVRRN3ZhOGcxT3lLdW9wWWc1b3pCQnRDcnlEYVlQeFhGVzUzVHFiRkd3elhsSUM3YzNJVkVYZm5wQWZhNjkwSHZYNnZWa2hECk1zNHBlMUM5S05JQ1dDMThzRGJvZElRTW1BYnp4ZVFGU2orR3dKQVdLcVhWRDNJQVZwU1lCZUo2UjZST3dtUkpaNEZ3a1Jja05MamUKTklSNGxwRnU0SG93RFFtMWFCQnhlS1lnb2ZsSjJvNW1id0hUTEFpd2lHSVlwV2syQkdCb0JJZHVpaFVSTUhRNTFKNEZDK1NIL3N5Qwp4WFduMlJKZ2NXZW1XUk5OSGVMTDl3Q0JRK05vN0d4TWdnWFdURkZUTU9FTlNFT2xZZlZSZTFKSmU0aTQ5NkpzZG0zSU5WUUFsRTlFCitoeE9vK1dnVnh4M096YnpLcHhhSGc4NjdiK1ZGRHQ1NTBTN00xZFUrQVdjWllhakFjVkhmT2VPWDhERzJyMzlmcjg3VnZKaEQrM0wKank4N2JYdllCZnFtMFdHV3pjRW9JSUpqMThsZXdiUEFuOERzMlduR2FXci9jalRxOTA3NmIrRjRGeCttL25RSmZEdDBpMnpPQVVtTgpuNCtTMnFzOWtCaEpJbkNQeFRXWDB3YzgyZmhQSUdhay9iMXVkd3FaNUxnbjRaZk1LbWcxcTVUSkd2MkkyR3dsM1BrTGxOQXdNQUpWCk1QcDd4RzNTWnl3SnV3Wjg1dnE2UmhoQnA2WVdqdmE0MlFKT2g2NDRkaWZxT1NwVkNSQ2ZDcWg0am45Z1dtall6VUVvRzQyYmVjTEYKNFpQdFNPTElkQit3WUlZOWdCNG5FcVU0NFRDNDZSQmFwRlRZRHRFSC9GWExyT2FyZ3FKVHMzeHpUZFFKdGU5bVlvOGIxQi84eGtpdwpDWXY1d0JKd3RMZC9pbXZnK3g2ZTBOdTFWNE5tdTFQQ05Fby9wVUd0RnpqQUlycnRJbXI3ci9DY2wrQi9VS21CM2hnOE5CTUFtc3NGClNQTmNBRWRlbm84VjFETUxTdEJiOWxzVk1lNVh3UWpuZWNTSXc3Uy92L2VuNzJIR3czYWl3elNOMkhRZU04OTlxTS84RkhOK2JFeVkKbjNYSDBMSGhuQnByT3dzT3duU1kvc3R6cDdzWFRha3d6OXdNNFFrU0QyMDg1QkdSclhtRExDc1BNaFFDVFcrTTB6a09pWmdjNUhSbQpRZFRlSmdaNVBzYjlLaGlGRWRFZ3o1SGNxZ1pUUVlEdWVRTkNXdHlXa0Q0WWxPM09xSGJRSExUbkN1bHJNM3RKUStzVlJzeDlza3RGCkZuVHdrMVowQ3diUUYrTUVPUjYxVWxMNTdUZjRBcnFhKzBybkZ2cmdrYmtQaUJUYWtxaFoycjhrNnZpM3FJcEZZMlY3d0Q3V3N1dVEKKzhCWW92NDdxbGpvZ3hZQXhjL3Bid1pyRGRRTjZmNktBZ3ZEdndmRUMvaUFyQWcvMXFNNmRZc0hTeFp4MzZhK1VkL09YREhiNlhQMwp6VmhXMCtIQkllVVAxSnFodjhTak9uVW0vam11NTdBZDdFV05ISTAxaVYwQU1UcFhQUUxOcUFhYXZCRGJyQXNkTmtmbG8wN1piVStyClEzYUphV0VVTFRLVkNnWDZaZlFoeWJRQzdSYktKSEJDbmZXQjFoeXN3R3FyTGlQVm8yN3NmZ01EakpNaDR6OFpEUmdneTNScWNJRnIKYVpUMmQxVkJNMDV4bjB3YVdacEpQYjNlNFF5SDJMTWFUYkhNYmpPRy85Z1pDZHJkSHU2K3RodlVNUDVGclZyN1AyYStlcUVYN2p6dwpBKzVjdWhhMkFSRDRDcVIrbHVHR2srQjVSTTh1a2NQQkVuZUdoVGoyRitPQTAwYllXNGllYzA4ZS9sV1dQaFdvdlpJV3RhQ0xaaW1aCnlWSXl6Vkl5ZFVUbUpWR0dtbmtkTFJKSUthcWpqbUwrSytiVGFvcEFySnBKYkk1VEF2K0tMTVhtbFNNU1ZhcjRoMXc1eXFZcjdNK3MKWU9MeGdsK2twVUphSWhMYmQvZEhMcWFnanROblpTSWlmVVdrRThSa2k0aFpVSEdTS0cySjBwWW9OeUR1ejRJcFNFU2w3MGVTR1M5UQpKRlZKTW90SVN0MTBFMjY2Q1RmTjB2RDNRMDIzSko1dTJUZzhGOVBVSlBGc215Zy9TWVMwTkVoTFFtSjc3djU4d01tV3pGc3h5WndWCms4eGJNYk9Jc081S083bEV6YkhmL2ZsZ2t5dFp0bDZTT2VzbFdiWmVwa2hLN055U2RncEpPNk1TLytjRHpTdVR4WU9pSnVENUZDRmMKZm45VytZbitTK28rYWJjMG14TDM3NGViVXVPOXo4YmhNMWJGZU8remhiMG5xeXJOSEZtelBMZi9mcWk1Tk43M2FIYmJ6azh2aC9ITwpUMVlZNnozSm4vTTlKMzYwLzBNV1Yvdm5ROHdkTllmN2FnNzMxUnp1cStuKzQ5elJORk0welpyVS9mc0I1NDZhTS9QVm5KbXY1c3o4CkdiM1gxSHVyUTFxZTIzOC8yTnk1TnM1Lzd3OFUvdkNkTkFvcGhmQXVDUFNzQ0kxbmNGQzdCVVdPS0s5MnhTdkZxMkRDcXZPQWpYYVoKYzk1WGVKY1IvRWZ5UVUzVUhseFEwNnJtbFhvOFFyaElsWXoxKzFpeGQrcitIUDVtaS9YMUNha3NzbkZkTTdWellsS3BJTFYwUnRGQwpXZFcyR3RaSmpXTWVWcU9YMjR0U3FDd1MvaWR0V0p2aHRoNW9CLzJMZHYrWEdlWjlzaDBsT0lsV3NQSUx0dktUcVZPamQwaVRsL3A4CkNuTGtJWFhUVVBRaEF1WGt0VlZrN3RRWnVhaVZxKzVLTU9CZ0Q3M0xOcmFnOElpOE5kVERNQ3dBaXVtQU8wQk13TVd3ME0xRklJK0sKbXl0Y0dkOG5CbEI0QnpWU2VEUk1IRU9ZZXNZNnlUSTBRTTJjc25kUmFHZEpWcGhQUTV6ZS92NkRWdXZ5L0VWLzVHL2FRdVc0WnUzZQp0LzNSaTdMVkg3UmhuZHQ1U0hvNC9ERXBuS0ZOYW5BUnBVVmlwaGJBd1lNbmo1MWsrTzZzUHpqblhFTTBDMkdPdHZ1bjVjbURKOFVKCmRQZDQ5SzVibm9TbW83bUtMYjVzbzhpUlZ6ZzZ3eXBtZnliSlJ1WjY3cWNkam5haUMrTkJNQ0ZzbWF4aDZBY1BDR3oyb0docUJoaFcKcENHM2lPR0RtMkYrSHVaK1Bwa3dvUmtSMXBOMkhpbzMzQVhYUjhUNTVMSTQyTXVuMWc1RG1BaEd5bFFhUDVVOFRaTzhxV2F2V0RBagpyTlFYTkV1RHFQVWZKSm5walNBUFJDNjBYWWkwQVdDRUM0Yk16S3VVQWxraXlhTmF1Qk9zMnRKK2haWnlNZDZJMnhwMnEyek9LdnZUCm5FMXp4NXNmcHp5TWs2djJmRzlxYVllRjdCZi9oSENZRWlEeGZoZUV5a3pZdElTYWxHRlRjbTZKN0l1MndBVWdMMW1uWk8ra0RKb3AKbGlabFZ4Q1pESm1XZnBNYlpSVmY1M0xSbHMwVE9GYWpsRTdnbUNRU2JXS3V3S0ZLS21IUnhyVkl0SzNZMG42Rmx2Smt2SkdQVXJRdApkbTZQTGQ5d2JrTlBxY3JSaTJOU2dUNVJBNmMxc3AzclBEVUNmd2ovbjNhVTBuR09GNUZ3aStoOEwrV1ZMUHk2U3ZCNFFlVzZNNm9jCnpWZjMzRkFueTBhTE9EVFBMOTdJc3d6RC9OeWZCUDFCN3M4V2U4b2ZkYnJuRXdjZGY5aFpjTWFaOUw3aElVZWtHUHdLekVNbGcxekMKY0VadHlCeGozUnpvS0lEd0EwWERIdm1LTTBDaDRoa2R2RENFTXlseVVsT2xrZVR5WXhDS1BTV290bWprR0VJOURlRnFjN1U5NVZhSQptcmxDWk43QStBQ01PaFUyK01nMHNqU25HQ1ZvQUlPSDRRQU8vUkVKbXRBSzNBSmtnWkpRWVNjeFVEblZqVlFxT2JPcVRGRFlwN0tXClM0bEIxWVpzZGhnSW5hTXpYamVVelBTY1ZnM00zRUpyYkRWdEpLbWt3S0Nza1JsUjBPYWxSWnJrczZ2cUhCRkxNalRqRm9JMUsvVlgKYUJBR1Jsc1BZMUlBZjZHN2ozeU1VUkFoYzliY3ZhZk40UnY2NUUvOFQzcHc4aDZWN1FsRHdFRzNjM0hSd2JkbXg4Q0huU0d1RVZmNgo1VmZ3enlYOG42NUh3Y3d1ditBdk5PZGZOSWQwcCtvRU9nVlM4akhKNy9KdGgyNHh2NnU5L0JZQS8vVERYU2U3Ty8zekU4Wk5wR2h6CmZ2bDZmaGtFMlhMMmYzazBmMVNON0U3WW5UdlVsOFBtcVBrRkxDT1o3YjE4OG4vKzY3My84Ly8rZCs1Ly9oLytQdi9uLy8zZm0vbDkKVHNkM3YrOSsvNjkxbUorTGYxKzJ2dDd2UHlnV1lKdEdvWUJ5N0s4c3RnRG1oZGEzYzBLTmd1WlExQjVkL3ZiYnV4cEsxVWdidUhPQwo0dGZyQkNjdlA3TUt6R0Ewb1hzY2RYcHZXSmJlSjRRbkU2aXNNSk1vUFpmcEEyUFI5ZDlQYWhJVHNmY290UDkwU1gxNWNFRUMvaG45Cit3cEJVMm9GM2hlWlVpd2lZS1JIaE9vemdYSDFNMEl4cFY1RXdLQk8yT2o4Y1JVandJS1NjZWNFMUF5a2FsVkZBM1M5SzZzYW9NdGUKWGRuQWl5bFhWamZ3NXRCVkZZNkt2WjZwY3R3NWVVVFRoYzV6WkpPWnAzRHc5WGZRQVI0OHFUMjRIUFZyZG9GMWZpdkQ2V0hxelBYcwpkRmdPM3BidEU5RHNUMnloWWJRc3dsMmJ3dDIxQ2U2Q3hNZWJKbW1HQnhyNElIV1NtK2dEZXNRVWhrSlAvbDNwdHJYQUF4cmVUSU1QClVoWTJmQ0dDSlJnRENYL3p4RTd3WE9VVUZ5M3NMd3c0c0JwMWtxb0FPeUtZRkVyRkZXVURCaWVQY0VjQTZvQkY1V0N5SVhEZ2pzWmgKYVVhdUIwWU9IN1RLTEM3YkJZWWdMdUhiSVpEMVBGaHlRa1ZQc1VjZVFhZ0xCek40WlE4WXpyMVR6ekJPMGFoUTVYd2NaaEhqM0JVNgpianhyNUhRWkxlbzBMT1BDNVBsWXIzR3RtandtdDJpSUxNdlNDSGtNNFY0SG1PLzFHTXlObzBQdUI4cDNJUnBpN21rMHdwNGNYekdRCjdIREhBQjdoS1Y1UmRLNkMzNVVSWXh5TVlaWklCZUpYNlRSaWhFSjVvTEl4RnVxR3pvdVlYVWQ3ZEdjMXlTSzJBcVRJa25qY0l3QXoKMElNQy95SVFrZWdSZXk3NDVpUDIrVzVHL1BQRStKcUJZSWM4QmpEL3BqaEYvTU9wanZjT1kvN0ZNRGUxR3lMbmxlU21QM1FpVitQcgpCcGNiYkl4ai9KTjRqem1McGlwQU1ySlBCZXd4aERrWVlJR0ZNWXpJOU1nOUozd1hZaW5EWFkybERCTVVwSXdubXFWTUJQQlNacEpiCnlFTVpNY2V4TUFZUmpiaC81anBpZy9CM29UMy9RTVRBYmpRdWVOQnNtWTd4RkdPSVpacEhTM2dNNHZnWHdUei94bUJJWWtET1hBaGQKQ1B6elBRM3M4OVF3S05Cck1jZmZIZSttdUlTc2d3MjRNT09zaTBGRW5nWU1PdWFVaGlhVUdaTitDamE5UkdZeDUxSWdKVWtqeHFVTgpvMENGQ29oamdHTmJBSG11eFNBa3plTmwybjNiZ1dXK2g0RmxuZ29HQlRvdDN2aTdZOWtVZDVCbE9VZ0VxY2UyakJoRWxPV1JxQ1RhCmMwQXBUQjZ6TEd2SU5FdGpqbVdnSjJUeFZtZ2FPV2hyT3VDTkFZNWpBZVE1Rm9PUU1vK1hTZWVtQThOOC93TERQQTBNQ2xSYXRQRjMKeDdBcDN0QnVLK3psNkloaE1ZZ0lFeUpzM1haNUN0QWM4N0h0UWVENlVXTWN3NWJUV0FoaTEraEN1MGNjQVJ6SEFzaHpMQVloYVI0dgowKzdianBZbDl6Q3d6RlBocTNrNkhkN291MlBaRkhmc3J1RFVGc3BIa1dleGhsZUF5cGc3UFlCVW9xSUJla0VlRkR6K0h1bDNESXJVCnUxRExLV2tCcndOdzI1RnlSd2NrazhXNm5aQjg3SEtJNGEvSzNJWkRqVE1nS0hZTWlmUzZVSXNwOTNnRGdObyttT1lPc1l6Vms0aGwKRFBLa3NlYmppWGZhVWNReTFxRWlsckdpNVd1eEt1YnhNaUJpbVFjRmxrVWdTeG9qOXNSejR4SExYQThqbGpFUnZwYW5uUEZHQUdiWgpKSGZHZExlSVpRenlwTEd5NDRsbmpTamlHU3RPRWM5WXUvTFZuUHJsOGJydkVjY1lFaGdXSUpZdVJ1b3A1NFlqZm5IM0lvWXhDYjZhCnA1c1JSd0JtMkNSdnhwUzFlRms2VUZnK2JwOE5DOHlwUHhIRFdFdUtHTWFxbEsvR3lwWkh6SUNJWlI0VWVCYUJMRzJNMkZQUGpjZnIKMG5VeFhwaU9qTEF3bVhhL01BUEFMOHdKL3NUYVdlQ1o5Qnl5bExFMnc2U3p3aE1ZNXRXaXdEQ3ZPekhJYTFlTTFnTUN3d0xJTXl3RwpFVjBlTVZQdUd3OE00eDRHZmpFTkRKR0JmWVExK3U2WU5jbVhXQjBMdkdJSUU4VnFERlBObWs3Z0ZhdERnVldzTVRHRU5Tckd5ZDhECm56ekVzeW1DRUQyTWsrbmxWZ09QdUdlQlI5eDNobmhxSGM3b3UrUFJKRDlpL1N2d2lDRk1UKzdGdnFXWGxadkFJdz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJcHdBRkZyR0t4QkJXb1JnbGZ3OHM4aERQb2doQzVEQk9KdGMxR2pqRS9Rb2N5b1BnSm9pbjFhR012anNPVFhJalZyZ0NoeGpDNUxDaQo0bGVjMDJVQ2gxamhDU3hpbmNqWGNUcVR4K20rQnhaNWlHZFJCTEZtV1llVDZlVldvNVhtZWhaNHhIMzNkWmhheGhtK094NU44bVB4CmxkN3I4bFVtMXVMOXdWeVdwa2IvL0lSM21OTmt0c3ZTbDBHUUxXZi9yZUN5aERGOVg0K2w4NnJ3Ly80M2ZIL2ZILzlyL0gvOGFmZWYKM1gvOGYyYk1vZi82TUxOdi9vOVgvYy9IN2hja24rQXN4OFlFdExKcnczbnpKcHdiRm5vRjk0YXRPT25nbUlDdTRPTEFtbE5PRGt2cgpWZHdjczNoblUzemh2c00rcTl3eDIvbGUwUUVDRldlNFFDYWcxWjBnVUhHR0d3U2dWM1NFVU0wcFY4Z0V0TG96aE9pYWRJY1E4Q29PCmtWbThtOC8wV1k2U0NlZ0tyaEtvT2NOWlF0QXJ1RXVvM3FURFpCeFkzV1ZDUkUwNVRRaDZGYmZKTE00dDRQSU1kOG9FZEFXSENxYWQKbkhhcEVQUktUaFdxT2VWV21ZQldkNndRWVZPdUZZSmV4Ymt5aTN2ek9UM0Q2VElPck94MndWU0owNDRYU3FCNEpkY0wxcHgydmt4QQpxN3RmTUZ2bmxBTUdTVjNkQlRPRGEvTVpQTU0xTXc2czdKekJtT2NwOXd4ZStMeUNnd2FyVGJsb3hvRlZuVFJJelpTYkJvR3JPMnBtCmNHcytZMmM0Y01hQmxWMDRHQVl6NmNTaHBMcXJ1M0V3SEdmS2tUTU9yT2pLUVZxbW5Ea0lYTjJkTTROWEM3U0thVGZQT0xDeW93ZXEKVGJ0NkNMaTZzNGVxVGJwN3hvRlZIVDVFemFUTGg0QXJPMzFtY0d2Um5qYmxESXFBSzdpRElwMDRtSFVpbFhnVmwxQ2srZ2J6emppdwpzbHNvS01QQnloUHB3bUlGMTlBTWJpMWc3TFRMS0FLdTREU0sxTjR4eGw3RmNSUXB0Mk9NdllyektPaTdZNHk5aWdOcEJyY3E2THBqCmpMMktheW5TYzhjNHU3cDdLYWl6WTJ5OWdvc3BVbkRIMkhvVk45TU1YbFZRYnNjRndSVWNVSkZpTzhiV3F6aWhJdlYxakxOWGNVUkYKR3UyNEtMaUNNMm9HdjVacnN6Rm5WM2RUUlpwc3pOWXJ1YW9pZlRWbTY1WGNWVUdGamJtNnVzdHFtay9MMWRlWW82czdzNExxR2pOMApkWWRXMEZCalpxN3UxQW82YTh6SjFSMWIwL3hacnEvR25GemQ1ZVYxMVppUnE3dTlna29hTTNKbDExZFFVbU0rcnU3K211Yk9jZ1UxCjV1UHFqckdnbk1hTVhOMDVGblRRbUpHck84aUNWaHB6Y25VbjJUUi81bk55WGphRWE0KzZ6eGRkTWx6MVJ1eGYrK2ZsWk5Mb2lVaisKNjhvY25hcEdsdEtEUEtrb0tLK3hCTW1hNGhzeTlHQ09wcEFDQnVIN01pckZyTWdpblEvQ1YwRVNROG14NkpxMHZXRUJ3RFNsZ0E3YgpKdG4vVWlta0RRNHVHaExJcUZFcG0zOWFnc0lqcmRhUW9HSVN3d2diWG9FaFFKRlBBNmhXUXBlNENYZUVlWkptaWcxSmJEVjg1b0xZCndLa1VIT0JvTCtSVzhEM01YVHI1R1NCZnJVNlk4M1FHQkJXdVJORTFkTThtQVdlM3JLQkUwYTVIb2RSRUg1ZmtnOFkzblVBYWFWcFgKb3FheVJxWXhzWUxHNTVTS2JVNnA5YnpaSzdzbkI5MytzTFJQWnp5YlRxMjE2dXNaUHErV29hRkNrd1pNRWpUVTEyeEszc0lGeE5rbgpzd3I2SDM2bGQ0SHdkaEtGNHRsa3pwU2d3LzdDTmFnRUphbXEyUXdjdGhVYmpHdkxnblpTQzU4UlgyR1RPMGN0UlMxR0hlVzg2VG1sCm5NdWhsS0JEQS81Vm1NMEQ0RG4yRC84UUdReXZoOEwxbk5xMEdmbU82Qy8rSk8yYlM3YUMvYkdlRXgzMW5EcnZmNGtxNUpZZithSmsKZDVXZnZoQTJSL3hZcWpsS1lacE12b29nWmhhVWlaak1jemNmNDM0VmpBS0UzOVRURjFtWVlzUWJtOHQ2ak45MVluaGdxMk5UM2ZJcAovUEZERWczVTJBakcvNFl5b2FJZFNvdlBqV2ZVYnRRZE41anYrM0FGWmlDV3lUaWZNSnRLVmt5bUl5eG1GeXp5eVNHYWozRy9Fa2FUCnpzd1lhWk0ydm5mNkVkbkk2VjRveUc1VUpGMDhxNUpvQytYZktFUXlsNFdvMmQvb2VRRCtCTCtrTUZZVXp6ZU9hbUZTa2l6WHNCRlYKU2twU1o0VGN3TGx2YWtaL1p2UTZGSnBDdGFDUEV1OTlpa0s5WCtJVWpmZG8zVC9xZlJKRWl0dmR6YTZmd0EzWXJ2c1gzMThzZU9OcQoxUlNZUGp0TVN0bW8wRVpEMlg5c1RsSlNwTkx3VWZxUDlhaEVQYzBibVgxcHFxNHdDMm5kUDNSbHY5ckliUHhJc2M3MEtUeVVSWlhwCi9TeEVTYzlWOGFjajN5MzdCWXJpQTFqd1pReUhRMzJ3eDgwZDdVWDlRSVhYVmNRdXhvVHlYbzhNcUtjRllUbDNuOXhUVnZReFBKeUUKeVM3OWswcVdCZlNjbFhRZkhaUHNBMHlXak1TeGlDcFNQY1Nacy9MaG1zV3UrQjc0RXZoMkV1WFh0QThxTVRNU3o2T0VSeWg4c3QzdwpuVHVLaGpheFRCVCtqUzFQSFhhRnlUN2dqbnlZbDdaeS80d0Q3dEpDNWcwOTc2MnRtVVZudjdZMUYrdjBlMXV6aTg1NmNTdFNPMkttCm5jZmNqSGdjR0I4R0l4cWp3R3RtTlE4cEQzbVlhQk1qRVk5UjFKSDNWeTd3RGF1SkhWNFdsblZqNzJKaCtubDZoR05tWWRqaHAvSWQKTDhTOFh4WHorQnRaWVltZDcwMnN2WWwxNmFkdTNjL2R5WFVXcjBBM1hBZlJhbzJXY0QwYTdqa01GKy94REpreU14Z3U3TXVvY3dwTApkSjR1ZjQ0c1lONnZpbm1jNGUrbHpOSENxbU82YnpmQU9LK0ZuYjBTbjRiTEdYcm04MzA3bnVGLzNYdENNa0tvL09qUFhIWDBlL2hrCmZ6NExJMG12cFBwcVlteWtKOGY4Ykg2QzdTSlRwZ2FuRkdDSTJ1WmNjODlCd3h3dFZpaXV6N1NHWXFHUmFIeWMrWHpQcGpjeEF0OHQKQnJtUUpvSk9YRm1DRDdQaTYyRDhtUjZ0TnlZTGtDTVBRYU1wZWxnaUNLcmVNSWt4elM2KzMwdHZkS09keDAwVFkrM2RCenh0UUd2SQpETnFPOGtaU2FHdVhLMHhtRFc1VVpBckFPSTVzTXQreFZ1cVQvYWhQZHZWZ3J6NU5UejBtMkZyL3hobFNqOWxWanpuWnN1L1V3VWxECjB4RVluNWZUalRSVHRYL1lsK3B5KzNxeXg0bFpPaWtLenZESEEwZVorOHFFQnNKbmZmV0ZBeDZ5TE1adFJNMkhidG1YNzdpL01TbHYKbmFvR0RNNDB4Zk9BY3BlYWxDNFNKWXBpcVJ6a3lFTmtabTNqUjlQVjdMMHRYNHg2Zis0aE5JejJjbkRtaHpYNkhnM0hIQURqUEpwcQpoY1FmbGduTjFzZStNdzZCV1U2RmIzVGlhNHdPSCs4enhFQW44dHczTnh3WlZuU200MW5mZmVsNlFFUmZHbHFsQlVQcWFCZEdneWk5CktwNkZJYU12RFMyVkVpamxKNzlvN2txb1BvRTV0SHBRNGRrK0JZUnJZWkhsNlZZYloxOGNINC9KWTdkclhxY2d4cWZYWUwyUllhdEkKYzVjWXhvSmd1U3JjQzBIWVpLa21QMWxPUGdtMGhoV0NYTGtXMEtJbkRaUXdvVWpodkxRZUNRTzRvZGFlQndGKysvYTdRNElkeUlVSQo3VENndGVmNzRzdHdiejJTU1lwYTh3d3U5MTQrUGZyK3lXSHRpOXJkVm1mUTZwWW42Y21uTmJwU0FTTUY1ZUhIc1ZzVk1Cb2duM0pCCkxsMlRxWlRlT2trYUtlaGdxZkV3OHUwb1NiSXV3NmZvRTNLNXFBUjFWMHpVSlZFR3B6Q1k2RnBPYVZBVjBvYS9KWGgrZ0xKSjZ2aU0KVDVvRE9sRW9HMUZvTlA2VTRQclJRdHBMN0JhR3dqTXp4anFEb0M4aUo0dGFnWkVHTmZ5YlpXZzhNN1E3VFJKeU1FVWFTcG9DSDduUApaVVF1TEZ3WVVCMlZBbGxwaWdRblltNW90T3FZYWR3R1JzTnZtVWtwRHNvb2RKalZjZUVMbmJ0K1d4ak9BMGtaMmdRSVQ1UFM5TWs0CjZNRHVuZkJMU205aWozZm9ZS3FMQzNRN2dWbU8wNXFDM1N0REk1MUFucEFocVNoMHZzMlM1YmhzRGxxdloyUVd2bWJwQWxzWExuRmsKc1JJdWJWSU9lMnRCenZGQ3A0YjBMbkxpWVF3aUJUckQ1cXFFOVg0TG9hMXdFVW9sR09xY0ZETExNQ0YxQnZNWW94QndvdU1Mc0RDeApDcE1VQ0xDMkg5eHpNUGNkckMvWVJrbEd3VWNCNnhMVDFtTzRHS0tCNnRBTGxFcEt1dldTcFFtNkFWeVRXS2xBeHoyY1ptQm1rcElGClBjMEtQUFJubU9HUXVvUEpEclY5UHpkTGhNMXZXR1JBSHI1aGF5alNHeVBQSkFHQUl4YlBCSGU2TkhXbkxtVVYwZldzR1prYTdiWFYKWnphRWFiV0J4T2lycVJGQzRPcGpSTkdWazZOa3d4aFhIU2VvTlQxU0ZLdTIrbGpaWU5lSjBYTEpLVmNkcnhuY1FseTR1M3hQWTBDRApjK2NrRE05N0RBdVFBRUlON1FDWjhqR3ZlTUFRTlR3OUZOcGZja20xZFV6WmtFaE92V25TcEVDTkc1UlI1WURqS09mQnp1aE15aFI4Ckg4VjFaQzZiNHArdVcyem9oaUJIUDdJYlJqcWxiVWZyUkVZZzBBcFRlaVZDWU41TWVybElGclIxNEFOYm9JL2lsWEk4aVNsN0FOTVkKZlFSSGtqU2g0MVZTb09NZmtHRXdCbXhZV2ttVjJ5clN3SGFwOE9WcEc3Mk9FeW1qd0FDODFRQVRML3ArUUdrYmNNOWxpR3lBcGx2ZwplQmlhaXJCdlpUaFkwRzBwaFV1aGd0RStDdHJBeFVXdlp4VGFuaGxncWtsQmk4THUwaGd1ckFHUHpYVUNyQ1NER0V4VmpWT1VJdGNUCmlzQjNYSm5pM01IZUl6ck9oeDlTRzJ0OERuc3Q5TThFQ0xRTzJBci8rRGllZHh2S0dEcDZHbVZjdmhVWVdMcGtadDhBQjRnUXVhSGEKN2hZVExIK0Z2OEFjVURtdUlFbzVVdVM0VXVHb29QSFpYL2lScWtsWTlpUllwRlBXOEoyQnRDQ25BTXdscmRHM2x5clkrdUd2SUFFQwo2cDBRTXZWRHdkOVJFMGh5bUJRZWdyUGFHQnlTSkpYb2RFZ3hISWVDWnV4N1dERGNDblVRTkpuaDZjbytOYUFLVkZkTlErblVwclFGClFXUjFVNHBNZ1Vya3A3T3gvTnFHaTlrNjJHQkNsemFBOVlJZWhiT0JYSmdCUW9CaTdKTGgyZ0FnSENHaExNaFlZWWVDUm9RUm1ScTAKZytseFhCenBnbjVQR0NpQm1WQXIrQlFWdmNBM3NmM01WcVZBM1VhdEMwNW5hUUVEcXpCRVc5dUR2ZFJiL2N6NjhlcytKWlNvSFRRSApNK3huMTI0NkV3MGJZb2ltWG1kTFNJUjlqaTJSYkUxSVJIVHNsNWtOS2hObzFrM0l0WVlkS3hCaXp4VVlJb1lQU0tLYlBLRkllb1RrClpBUWpPenJPZXcvQ2JjWG1yQUZJUnRFRzBCYU12aXpjZDl4UFFCZUhobE9xZ1FDWDdNeDJqaUZIRWNUWVorc2NTRkNXNVFJUEJOYlkKVTJocGJkdnVxbVhhOE1adXJJYStBR0tOaDZCbEg1WldqZ1kxaG1FMlk0bnhHNEM1U0FraEEraVZHMUkzUFFoNmhBSWtvRUhEczBWagptK0x2MXBKbnlWQytkUWRDUzQ3N2FxOGVLYjZPQ3BLSk5obURCNUdVcUVTYWFFc3JMTWN6elYrQjNhNGJEdUM2Q1VzT3pqM0dmMDJwCjBkWWVmNGZXOFFhS3IyeG56dGcwT3JBWm9BcVprdHhPckNxQlVUaHdFc1ZBMWdiTVYyM0R1U3lFaGlpbnQzKzUzalRFWTBJaFpkeFoKbHN1ZG8vRE44a0pFTlFNRTFNczhzV2tTWFRWNm1naDBuUmptSzZKTnJHSHZiSUo4VmJpM0EvN2NZWU50TmNzb0t0Q0RRbWU1M2pTRQpNWEd1UDlxR1F2YzlDSmNWWUkzbXNxUWd4bmd4QnZSVG1Kd0VyK2R1ZFpJR3lrK3AyQVl5WnpmVytQaE9EVlpiWm1pL2NkOFZMU1U4ClVEaEF6aTA0QkRUN1NkR3dUYmp2WkhMSU1EYzZGeENvL0dLSXBzZkFnTkFHUTdnWERnVjNjb0lNdEw1QTVVeEhoRUhWSWsxOEZWU3EKWVhRWUlYL2xGdm03NnhKWGRsMTJ1RDFGNkhWQ3M2a0RwSUthNE1yOGxYSHpkOWMwVjNZZEcrOTNhNEZoQVVwSVVKZzBLRUVaR3FkZwpiOWNKMlN3em5jaHQzZzIvYTU3dU53ZjFVZk4wT2tCbGxhQVVjdDJqaS9MY2ZpU1hPR21sS1lXQm9rbEkyMWdBL0VCT0c1TFg5SlY4CmU3Ujc4RmVzcFhQN0ZjYlJGbVdrSG1Bc0t2Y1ZWcVlUM1ZMUGcxQ1Y2R3R1TjB4RUtXM01DWWFpK043UXQ2aXo5QjMzQWhsOWhxckMKZlNYdkQrT2tMN2FMZFN1NS9jNmlKNzY1YnMxeFgrdnFFUnpDZFZ3N0FvTWJQd2RsMVQwc2k5bis5V1JBQnowUmxpK3BLUk5ONjNMQwp0NzFDcS90WGFIWEdTM01UOFI5ak0rSjhiM3JHak0ybmVLNU56VVEvUjYxVE1KNjhZL05haDdFZG0yalRrMUdOVGIzM0QxRmdacWN6CldLWThzNVBwSVNaK1prdHF3aUZtMWhDdjBPcitGVnFkTWNRdVhoVWxzQ0NsdXpCMHJRKzBiMG1SeVVXQ2xpazNCdz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJYkRoQ1VrelBDUjZKOHhuckxyeVh6S1duSWFIR21XMGpuVzZEYTUxUFlNVnYrUlRHYVVpb3NTQ3lBWFJ6MnB2b0w5bys4RFU5dWZXUAo2bjFYL2pwNk1DaWJKMmY5MXVWd1lvY2lEOXNMUEsvbHhnZzZwT1Y0b2NhZTJDZzBCclFiUlRjMmM1bnF0UGJ5d2V4TkRlWlRJVktRCkVWTjdXNFlPWEtYdDVoYStITGt2ZGZkdCtvdjdQS1JwWTBLVEtDNXptTHEvN0dVWVpLUGN2aG0rSExrdmRmZHQrb3Y3UEp5cjBxRHIKRmhRWWN1SFdDano2SlpRWUprOXV3Z2Q3WTVPRnNyZWRmTnZ2VVRnTTlMZGUzd3NKSCtNZjlyNjl3Rjl5Kzh2ejdpWDgrK3owNTdJMQoyck8zNUdyN2c4dmg2OXJUWnEvNXFoelVuZzNhcUE4dC9LMW1menhvZHJzZGtPUVhyenN0Vi9JN29QNWVMYTFkakJxMUYvM0xYdnZlCmRObFBhL1c5dStNVlJMS3d4bmhoWGJzZ0ZGRGhVYmM1NHZJd0daNzFnSjJ2eHdvZnZHNE9XdjFtdDFhdlBTOTdyVTZYaXhPS3RpMDYKVnFFNSttUUluM3V2TGtzdTZ3WnBFajJod0Nya2hoM2UrN1RXc0t5R3NSbGo5QWNlc0tsZXc1REUzWWF2bUhrVDl5VDcveFQzRHp3MwpZeEJNN2NHVGsvMEJUTjV1U1JpT09xZXdlazRPanFHa09VR09uaEJoei9zWWFIVkRKTTBaYktBa25ocjRGZWNLL2MvK1B5Z015YUsrClhxbnBkS0psT0lpTnRadGNVN3VhMnNXUm9HYmhnRVlORmZTL0NvMSt5SUdadGFwd3VrMHVLNENCV0t1eGZwZmRxL0YvY1h6dTFWejQKWk5pQ2hQK1VvQko0TTlUTVdjaEVrVjNFam81dnkxKzRjRTJNZjAybnZ1Si9jWm1wRkZRU1dqdTQzalI4a1JnRUFkcGhXa2pMZzJRdQpEejdzaUJiMkYzN21lYmgzNzIrOS9pODkrZ0liNWQwSDNYZkRZZlBrOGZHbnRYdmZ3b2pCcG5QdkFleWtiMHN1Y3UrZ2YzNkJVLzlSCnB3dUVZaVVZOUU2dlpndFlxRlhlNzdraW40UHVldStIenJBRCt4MGluTVp3UEdxMjNxeUFZYjg1N0xUaTZvUCttN0o2ZlVrL2RKOE4KWEVYQXVPaXA3WHUybU9OQXJiSnQyL2tlN2gyV1o3WDd0YjNhM1FnUGJ1ZjNhOVJzN2Y1ZTdkN3o1bUEwZzdLRGZxOTkyUmxWSVdvQgpGaVIyQmU0dTVBWGlDcHg0eGxQbTArbUpXL3VuUUR1VS9ZRSttU1RQUWVYQ3hGVmE2NElTTnZ4VXUxamxKV2d4emxIZkcrU250eHA5ClB5d2Z2aTE3ejlydGlteStUZ2JoTnB2a2lzTFg0Y1JXME9QeE9oUDJhVDZqOGVZdWFPTndqcVpuKy9KQ0NWQlJWL0doZkNpdUxHRFEKZnJmc3RUOFVod2paeXFzcGtCZnF6eVZrNzk3RFg4dldKZmFCZnFDNlU4S3VoKzdDZFpaejc5K0hpWEcwMjUwVGU4L096b2JsNkZNYQpnRG4xWFlVbjNlNGxuV3I2ZzBiekF0VHNlM1lud3B6eWpuMTN4NURXam9DVnRZZG5aN0JSUWVudk9xT3JDTjY3enk1SFF6Z2ZSZDdlCnc4N3dvdHQ4Wjc5K2VvM0MyUzhiQzdka1Blblo3bFFTS3B1MlpqNzBKdlRCSisrMVNta3llS1JGbmtlYTJHMEk0YTJaUlZ0RVUrWGQKcEphYWRMMTNsSjNtdkRhYTgwcTIvQThpaGNTSFVBV3RSbkE0NkYvVWpsODMyLzFmRmlzUVdOQ1dhelE3c3pXSE1WeGVWMWpJVEUvSgpSYk16Y0tTaEJiZDJGMS9OK1hTT2hQZG5GUEYrVEIyMnV0Um9sbkNyN2ViZ2paUHpGdkM2UC9pTkFHaGZjN0QrUmJNMU5neVh3L0w1CjhkRis5M0l3VnZjMEFNZ2UzQm9PV3ZIMzAyNlB4ZzJPRU01Z1RFTml0YTNhdzE4dm1pQmQ5OHV6L3FDcy9WQU9oaTRxN3BZM216RUgKNVMySTVrS2E5UmJOTzJWL3ArenZsUDJiMlhtdks1eDFkd3JZblFMYzVaTHIyMnBtaW5seVI5VU8rb01lN1BnZlNzeFBJSzJvbXpVRQpCclk2WlFZRGVpNkg4NmI1N2tDek5RZWFxM0ppWjZ4ZVJiRGs2NjNEN2xiam1xeEdWSEtTTk1NZ092Z2dkVUxPSmY2QUZnYUY5MnNtCi82NloyOG51VlBFRGs0djJOU3BuanlGemJRMlB5dWJvTmZLNTJsNkdVWmc2NTczc3hjSzk3Q09TUXNWT0N1MmswRWJwQkdzZ1NYSzgKZUx1VEpFNlM3SGN2eTlxMzVicDc0RzlabEdBb2R5b1QrOGFPeUdSV3VHajdFTWVkYVludnlZVElrWW1BYmdIREtpaWcyK2pwWUc3eAova0xvTm5paUU1TmhtSDlEWmpJM05pKzdTQXFLNWNicjY4TG1mNlRJTzJSTldraGg1ckpHYkJOcmpESDRTZ2ZNRzYwemtidnBrZ0pMCk1sUUJOWnU1c2dJL3plVUpKcGZjRnBaa3VhRzUwVkNTbmg1eEJqKzZBWUVzUVhzZnpxSE1vTVZ2TGtzd3ljclc4Q1RQMGpRWEZJK2EKRkJuZkV3SVd1WUEwV0Y1UzY3bThVQitHRVIvY0dIWXJLeTQxT3FWd2VwM1NnNzU0d2NzSzZrWnFweFJtRkRBcUl6R05VYjl5TG1PdgpaNFpkcjJNdnVnRjJEUTZLclpnajJxUjVnZk1nVFZKTWp1MFdtOTJYTUJtQXdGdHNxQ1NtbU1ocDN1d3dHemc3cE41TmoyWFRRNms4Cnh3MUs0bzBBT3pjMDc5Z0dVeVBpMU5EV1JETm5hbVNiT0RXdWRXYnNEc3M3QTNvNGNCNjhIdlRobVBuWHpxdlhYZmovYUtQT25ldmkKbFY5OFJXMmhUY1ZXb3RKWWVLNWRaUnI1MVdOSzdqMStkdnJ6QzVnTlg5VGkyM08xWlhUY2l5OWFZUTVkMTQ4UWcvV2c5NnBidmlnQgpHOHljNy9yNGs0L3pPdXdBS2NUWmlmS0g1UVhNNWVHejNsaTRGemxaZStXUXpFR0ZCMU9Oc1lJRSthRTU2UGhFWjJORTNmdSsxMm4xCjIyWDE2SmtYMVdNUTU5NFNUNlFTQmEzZzFmYWVaSkpiWTRReDJ6eHZsckJ1Wm1YR1BGYjMxdmM4bDVyM2hqYTkyOUYxdFV6b3VKMFYKQlQwWHJXQ1dpWlFDYnREbWdQcU9zOHhNZnBnLzBUQXIxZXJUN0VZT25WYWF1R0E0dkVMNm9lSXZ4bEJXc3pNclhodm4zYzQ1Y2dCegpKbUtxYmc1Q1BSdFNmQ3duRy9pNU43cW91QzUyd24rKzhKZWJLUHpkTW5NUjBYTlhYbXBrYm5ZaXZwcUlsMlNBM3F3VDcvV2RhUlprClRKc1RUckIvQ210cFJqNm9KRm1ZRVlwU0pHMVEyS1c4cG5qNGozMld1TGZrdG1lUzZCdU4vdDZBTVU3ejZ4L2lqODAyTW40RGEzUE0KSXJ2SW50dGF6dXRqckZ6UCs0alo4dnVJTjNIOWsyOHE2cW1iaXRsNzNGVFVremNWeGNSTlJiSFJOeFZ2VFF4L0ErSjJsM3RwSjRJcgo1MTdDQ1RNejh4Sm1YTUkzTStuZnBKYnFOR3VrR0JZa2lpSTFqVlFrK2lOSXZBUlN0S0JRcUtTUU5rU2pLQXkrdTBCME4zSmpNQlA2CjdlVDUrTmhrMjdOTDdQcmpidjhYVE5TNVdkNjNuWXpicVpuT3h1OW44WHRybVRHcWFrcm03YXFRNzZNZnlwMCtlQldaK1UrQU5pKzcKbzU4aWFYbmNPYi9vZW1rNUo3SEorenQyWnhFbzNOUjREdUo0RlBXYThvbys3TFZEVnRHbHFVbWZON3ZsYUZSUzM1K2ZWdTd0M1gvRworYlYvK3BTb2Z2bmIzaVI4NzNscm1pMTNmM3pkR1pYMnQrb0xCd1lUOWc3R09ETkgyTjBYai9kckw4cTJRNTBZZXNHVlNoc3RWTzdWCk15NzdqN0tMeTk0V056SXo1REFJdGl3dTkzaFFsajFYVEl1c3NJbnRHMExxMUlhNmU5S3c5TUc3SmhmTzg5UlFPR0ZtQ21HaWhMcSsKTUY2L2NJV2xLZXdWUUh6WjBtWHpGMk9GbnpaZmxiMVIwNVVIcFFvb1JPcXl2TWhJcTVLWnBMc0lpY21VdTVSZ2NncUZGWHc3UWRqNApWMEw1bFNqUzJ1T3YwcUsyLzVYU3pMWUVxaHFiZDE1SlJmaFRTYzhGSjBsU1VBTE5BcEZSNG9ZRVgrQWpoekpGeVZtMEVoajArQ3VaCkE5clUrQ0hMb0doS0kydnl6TjZIVEJKaHg1cWpuVlBmelRGOEFIcjhWWkZFK0xBdThKYWl4aE44bHhtUTVOcG9kNmx5S3RwWEVOMGUKSC9aUHdMK0FNQWtJcFZBVW9vOVBEdUk0WkNLMVVlcUFXNlgwbzRGcFdSaUtFQlFwTU4waDFOaEI3UEQrVjdwZ2hFcUwxUFVuRlhtdQpIQ1lYN1Y2aytCK2FSc1JNeGlTUmRTbnhMdVdSeGljSmM4dXdsS0pYWVdLbk5yQTU1OFNsR1haeENwMmdrWUJoak5CcHZLSWg3RjJOCjFFNmNJa2x6TzZtMXU0ZWFNZWVBV1lrdWVNS29CQWt0c0h1RzhXWEtDR3NlQjBRWlRRZDhTUU1qS0J2U3h0SGlBM0J1cGtqTFFZdFAKMDBEa0F0QmxpaGVOU2ZGVk1KeXFHcTlJVUU5VElOamVLdEdaMURSN3BNMFBZaEZSdHhUeTN6RC9nUTVhSG1tcThCVTVaQnFsd1lXRgpsaGh0eHhYRElCUnlRTnE4cnhHeUJIbW1lVlZrc05TMDdRRE0zU3kzekJjOGhwNDZPNUV0bWxSNTRvVHdpSEtsNko1TWtlVFVLNlV6ClRjRVpPQUV6MnkxL3FjaE1kY3ZnWWhVNlk2bTFXZ0lWd0tMc1ZNVmVTY21yS2M5MFNyelIwaWp2Nm9qQ1F2Z2FRdWlJU0xFamVjN2MKTG1DeDJOV3RGVFdmcEtwUU5neWZIaXJ4bWJZVGZNbE42Q3dNcHV1WkFieUs2Rk8yWXlTdVlieGdmZEdhVTFvU1JzRTNSUktlOWFuRgo2R1k5VFhvVUYraXU1RW1xSlhVQ3hJUndpNm13VTFWS2l2bFZRVHBpN0l5OWdtSm5mWUtMRWdZRWU4WURxUXF0cVE5QWVVRkJOYmlhCkVrdXd2UU1WaVIrV2ErN2FENittak1XdlVMeWFRUHdnT2lJcWt3bE5BNEZ2cU52NDlNSWtGTGhFRDZZblBEWHc3ZlBIWHlIRmhSY2EKQW1hYVphQXFwSDNmSnM4a3pZZlVyZnZBUHRzL0ZocVMrVmNrWWNmTjZPR2NCRjlXNWFVUTlnRXJYakhDQ0tkUHZBMmtOQTVTOEM0bgpjMXg3c0hxVkpQbU43OXJhWFRyajZXRndwMEQrZWZLQW16aHBjNXI3bmxNZ2xSVXRPc0NaMnRrTGROQzhNTG05YVc4c2xBU0d3a25qCmVhOXg2eE9wb3RXWmVkR1kyb0VERHRIR0RkeTJLd3prV0VGeTIyOVZMTWpUZUt2Q1o2dGhxOEloelQzU1RKTWlBc2lVSUtUQS9aeHcKd1Fhc0NKbVhhVzVBcE9ZOEFJQTB4NjdTaWpYYXM5RmtWcnJsOUZJcTNYNnhHbFFpQkYwbzhoTGNYMnBRTWhvZEZPTEFBRzFvbWJEUQpUSVV1eUVLakNwRmJ3WjNDN2tYVHA4Z0xDaWZqWE5uS2loWHNQYUR4VzRUQlpTeG95OGtsb3pVeXRmTS9Vd21oelZVQ24ybUhNSUlHCm0zZWVsUGRhdDNmRU93OXRQRjc0cGZaeFpMeGdLQkppQXJBVEh4Q25TM2ZFQkRmbXVPMjRPU1hHaHd1bktPM2JYck9BTWJJM3NnQzMKWlMxTWZhdFhBVlB3eFdkY21idzd1Z1VKU3ltd3RrQU9XTVl5WDFXV1dXR1l3VzVrN0NMTUJDMUxBMnViMkNpNXI0S1hWZUtDOFFncgo4VFVscVdzWGszWE1ramI5ZWMycXg1R3VQY3NoTzE0NDREaCs4MjVwVlN3VGFqd2J0RjUzMmtzcnVXS3VIcXUvKzYrcDBjdnpjejRlCkxtclhGcHVKNG5HLzJ5NTd0UmNVVzdVRVQxd1drYzAzMmtZSTBEaHJDMUtWUlRuMkp5cTVvbllYdS90NDBIeEgyYUNldjFycDBHUDMKV3BTZ2ZoK1QyaTVtZkMrVGtHallmbWk5dzduQkJuZWlnaVZtZkhCaUdlZVJ4Tm5wdDM5VEtDdWdVbnRmRjlZekxYa041eGVhaU9ILwpUbTlESlVLalJOSXMySTFPTTlwVU5DajZ0S0hDSGtwQnBpQ1liTWRTN3Mva0I0czBvN1dJU25ubVJTY0lYMUltdEVCaGdCK1NMQ05rCkVyWmIyczJVLzMrOFcrTy9LTmhZQXNHbXIwaVFvM0FwZFB3aHliVGI5TGxia3g4Y1lra1NrODQxOEMrdmJBbVNsOGhVV1c3Rklld2UKMm02NFJVNXFqdkgvSDl0OGREcStuOEd4alFTcmhIT1hzUW9QakxVOU4yVGNwY2tQRG1ObWQwalNKVEtXT3JDOUdPcWJRQTBzb3c4NgpkY2ZYM1AvZnpZdEUwYmFQZ2h2KzVWTk1yblJoSDAwUUtjMHpVSjR6NDg0MTNKZkpENndBSkhTWXdma3J3MEhyU3VsdzZOaEdlb25DCmdZVi9lVzM5V0o3V0R2cmQvZ0RPNmYzTEM3L0szR1FHQ2EzNDZoc2ZaaUlOdTRnVk1wTjZGVnQ2UlE4a2ZwS3hHWUhXQmVrNWJxUE8KV0EyUUZpTlBGYXRDMFo2ZGVSMEt5RXhwL3dBZW1kUVpHK1lkVXJXZU9xVGFQdGlSTEhCRXBVTWg4REViMGhUakE0aEZJWkdjTkhRQwpGbU5tdlRHcHpQQm1tOVVSN1ROMGZNMXRyQStTNW1uR1MwbkNTdGMwcTJTR3pNTG1UV2FjRXNmWDVTSkYwL0VrTDhMOEVoYlo4MzF2Cm8ySlQxQ3J2NWh4MWhxUFlQRGNlTXpEdDdJalRYY3k0aVJROHYvRUxQRk4yTldyMUtxLytpQ1IrUWhEUi9CZjA2QT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJY2pUcTk5d3p0OU1QMzA2OU0zajNlZi9pKzR2eFdrZzFVT3kvUDIvMnl1N0pRYmMvTEczQlo2NWNjMVErNnBUZE5oZDgxT21ldzU4WAp4MGp5Y2RtRTdSb1pNeWpiblJHK1JJOFBhMDI4VEgvM3I4QTBlb0N1WFh2VWZOc2ZrREh2THBINjZlUmJlSmJHK2J4eTQza0lwSjJYCnZSSDByNGtQQi9MMzJoZjBMYklSMjBlSnJWVjd2MXVXN2FQeWJQUkRFNjFvdGNrWC9wTGFXUmRmZ2VyQkhMZ1lsTU55OExhc0llRVgKMklmaDRncXRidWVpMXVxamtmZlgyZ0E2MmUrNUdsbjAzR0JjWTlBY3dteXJ2eTFiSTVCRnA4MXVzOWR5dmJyN3o2ZkEwY3Z6Mm90eQoyTzllT3FPcHo2OExpRVROMDN4Y2ppNHZLSnpjNG4yT1hSL1YwUERzdWh5aVNJQ0R0YWZsOEhYdEJUWGUrWTBNcjFFenRrYWFqTldBClpYRnhPVnBTSndsVVRuWHVxTmw3ZGRsOFZkWmdMbDVlMlBMZTJRRExEWWgvVVY1Y2RvY3h0bWpRWHVCeWkwWnQvTmZ2K2hmUmIvZGUKUGozNnR0OHVaODZGKzdXN3Y1NTNlL0J6SGRnMTZKekNnbmZEZE8vQkFKUXVXK3VhVVh3QS9GRXAwSmk3N1VIcEdNY3VHLzRWL3huNQpkeWp2L3JFM1BIbmJIQXp2UjlNcEx2bzJNSkxnd3pubGVuNTJ1WjRNeDc1dEtIZDYvVjVaZ1RIZGZ1dE4yYTdDR1M3NWdTYm1WZWs2CjdmVGEwRkZSZ1RhWUhMQm1yZkJZVGw5YytnTU4vM3R5UWl6a1JDWDZPL2pBYTVXSnYzUlVOMm1oZi9HMjhsTEhvcmM4bzVFOFVHOUcKL2ZQYmxXVFhOdysvR0RaUm1VQVZCNVpZMWVsNDdldmlHQjhqV0p1dWJNTXFIWjc5c3NhNzhTMHZneUcrNGIzaG8xeUhjN014ckxMTwpvL1NYVHB0dUN5OGRYMWZ3ZGdWd05acGVseTVqeDFLaXVPVHRVaVhSNDdHTXFIZFY2SGwzMjZUa3VwRExLUG0xa2ppNWJVcjhpWHNlCkdhZjlFZWdCZUxCL051aTg2dlNxVURWZFp3MzJmQkoyeC8zTFFhdmN4MERZVzkvMFlXdTY3UzZjbDZObUczU2c5KzFIOFo3OStIM2IKbVRTcXpLNm84T2V6dHFLeHVYUmNkdi9hSEIzMlcwZjlWck9MWjZraC9UNXIzdm15UUVzNWVISVlsNHgvL2c3MUkyelY5VjZvUnRKSQpvcTYvZWZEazBXVzN5M1lhRjdRSnY5b0t5bHRubnNNdkZ5V0ZlajhlZE5vbnVHUWVOVnVsejNTQVEreGVjWHZlNy9SR3lNMnBXc2RBCldiRGQwRUJNRnZtKzEzRzkxWGt5cjNVeUJEMzhkZVJadTZBczlqUXVxblNPd24xbTQ0KzYvZjdBaHUxUldkemRza1ZsOS8zTVdGcjAKQlJzQUZwVWt3cUlPNkxsa0VjNW5GODFXWi9SdU1VY0paK2lvTkJpdk5yc284aXB1UFM5eXNhQm9RS3JtOC8rSFR2a0x6TFhEem5BVQpMSnRHNjNRQllzK3JISk1UVVVES3NwazFJbk1rRlZqR09oTDNFNXhieEdUMzlCck44YmtMNHFEc2RnOUFXcnVDNlZ5Y1dQQzQ4eHVQCnh2eHUvclUvNlB6VzcvMDFVb21RYlhyUk1Idkd5VG1sdnZPeWJuN0RoR21TUWQ3YWJTTGJkYk0zNnRTYTNVNXpPRjB1dG5IM0wwZmQKVHErc2pjcGZlUlY2TTNIQk5tc1VTSCsvQkd5amQ3V2o4bTNaSGQ4NUFLVThPYjdvajhocDk3VGZYbUs2NXphSGRLdGl1RXlnRWRFVApFaTJwMVRXYndPZFBQYzRrUTVQbGgyYXZNM3dOcEVRemtWeCtlU3JNVWt6WWgrZmRacS9FU1JJTHJZVnJtMnBRY0h3SG1ZZExvWXlXClQxWXNYejRCejNmOWk3anJWZGRmUUxCUEtsV013MlNBQXhGVndUR0xnVm1ocXpFUVYvWnEvTHZzbGdPcitqM3B0Y3Rmajh0V3Y5ZGUKcmM2anptQzRwQm1hR3ZPSGFWNDFUODc3RGE1SGM4V3g5ZlduaGpiTFJMV2h0ZTYyNlpGbHlnOEcvUXYwVnRyTFpOT21pUW5OS1JjMApwYktwZHFPeEdXL0FKVlI2NnE1UGd5NzBZREE2N1RjSDdacVlUcjhVT2MyOHZIand3b2tRa0FvcUZncXcvci9ydjdDTld1TDd3NDdmCmpDVDNvM29WTVNIWW5neTVyODVqL2UyMHRzc2xZcFZ4Z21tcFA2ZGZOTnZ0Q1lGOVRvOXFqSUdHSUdzblFDQ2MyWnZKRzB6N290TVkKRittdGZuZmdWZEVIVDJvUExrZDk3elFzSnpDU201RFY1TnFiWHIvMUJnUjM3WlVOeVZoUXREUHNnOWd0YTZkNFdjY2x5Um9yWE5RdQptaGV3RHd3NzU1ZmRabkJReW1qbkdRMmF2ZUZGRTA0SHJYZlFacWNOcGJtTFdpcVpSMldiUEY5YUZEUWlvZVhJZXp5bldFVlVyeUtkCmExblpBVy94c1RJd282U0lPcmkwYU5TQnBXVjlCNFJKODlTWDVEUEVRYlAzdGprTUdvNFlHNy9uN0ZESCtJVGF3M1puMUxTQ2JVSVQKSTQrdWxUZVJVL2MrL3V3dmVrMU04Y2w3WUJNZWJ5RnJNQmtmY3g0YXZLcG1YZUNMbk42MjBoSHFFYkRDcUJKMWZMTFNlRXVpOXZENQo4Y3BOMlZyTDIxclZ3ODZ6OC9pSHg0LzZ2VkhRQU5Qd0F3eExxelBtZG5jUDZ2N3dHUHZ3ckdkekdFNys5ckk1dVVpcHd2bEYxKzlTCkU2M2o0VFppVzFUdCthdXpjZm9BZHZqZDRYUkJsQ2QvS3djVHl4bCtlTmdER2U1RlFkVHd3L1BUc20wbDBMaW9ndDhvTk9lN2FTdlQKMUFHak4wWHJWSkhYL1YvKzJtbFBFSDRFN2JKMGZ1TElXUjdZUWZOdVFUREh1RWFPVWhaVjhRZW9pc2NjOEdVSTN3RUdweHk0NEpRWApjWERLVk5GblRucytqclhuWkY2cDc3eGVIMGU1VUJITDlucy8yUENXL1RpOFJVd1VmVFlSWTFNbC9BV1hUR1UyWWVFbGZMSVlxekhLCmxsM0txZkZpczFsbHkxVGpsY00zUHlDcHFQWDZJV0NwMXVsUlFCSnFHS3haTFJHYnJxMTd3Zmg1NytmK2FZUFFOYnRkM2hHR2swYXoKcVFvZ2lXQ0hmVFZCd3p5OGkwc04zM1F1VG9FamI4YWx4R1N4QVp3Y0I4TVNxUmtzTGduN1dSQlRkNmVWd01ueVRIWkUwWDIvcXlHagp2K21mUHVtZDlXdkI0TGFFMGZONmR0b1puVGN4OUd4Uzd0dTlJaTUrOGVyOFRlTVVOOHYrMlZuRG1yUGRQajYzK0Rrb3djUEo0clBZClBvNzhjbGpDYmtNYnMxK2dUaUd0L1ZpZTN2c0JSRi8vM3RNKzdPZmxUNHZaaWF3dmlUTmptdlpVQjRhamJxTnRtNkJKd2tPNlpMU3cKbWlzZjdMRlY2bHkweitIbmJxOXlweTdhbFpIYk1BVmZZOWJZWDF3TVhMRUZZd0psWE90dW5JV2NPZEpRTG5JUlpzWGNVckhQVGVUegpTblhPWVRFM3VuQ09xMVp5MU9jQXYwSXRMamtJeldkNmJpOXQyWGpHM29YSkJ4SzFYVHQ5VnpzY2RON1NZMzRMQmdHeDlPS2RZYnFoCjFnVFg1aGVLbWJZQVZUK3lIUzVBTmxGc2F0Q3BGQjFXRm91MGRqbnN2T3JOT096TUZMbW56cm0wQ0NNVjdKOTFKczMyczJYNDBFcXUKeWlKMWJEaW1xZTRPR3VmZXpqZXZSS3Zmd3lSdGVGcGRRQXVXOUZ2aXFiMzBaTSt4TTBzUDJvMytBSlgzNXJUZVBWbndESlFGenNKRwo4YXd6UzEyNEUvNml1VUN0dm1vc25IeXVqQXU5RXNuY1VrUDB0VEN1cGVYZUxxWngyTHJvdHQ3TmwwcTJUS3MzYVFpYkxET0NzMTUwClZwOURINHhUdDNteG5BK3UzSUsrMHc1Vzl0QU50a2p1WXFraEoveFlPbk9wdUpYVFlXRlVxUU5UZm9TWllseFA4R21sZVhzMGlIaFUKRjhkbDBZSU5la21aMXFCL3NhUUlLbXNkVUYrV0ZCdEVtVHFXTllvR2c5UG1ZTGhnSE1kVmpMQzlWQ2c4aWtoYVZqYmFZeXJvUmFFYgpGUXI3YmxRb0czVmoxaW82NjQwYTdlNWlrV2ZMWEF6TytyMUY4ZzZMRFM5UGVUMm1zOFpvQ0lSNk44dk1VUnlDS29ySzY4SWl2ZkpWCk0xaHQ1eFRDRXdnb3RNUEZzd2JMd1hiVFc0eXJLeEJiMDN2YVpvLy9zREY4M1lSRFFMbUFTMWlvSEtIUGlIUDRSeGJmaVlManBiSloKY3Y3WGk4YlkvUTNxMnF4U2cwbmRudXhIczBxK21uRUttRlhPN1lMQndUWnJmb1Z5MWltMnVHUzNzMEJrUUFGMC9qWEhEdEp6Q3ZZdgpXZ3VrQ2hVWUxoaHhLdEMrWEdnVFdDQjVvZnBpTlFOT2RNUGxld1NWT3J2c3RSYk1FbHZHV1NONHBpelpHS2hPczlkalcvdnMwelNWClduWTBhSjFINnRMZDd4dkhqWnE5NUFpbjNIYnRYM2VQZjN6Mi9GK2YxdDdLSlllemM5RG1JcFZ2bGc0SlpmQjQ1ZjA0YzdyRDE2ZGEKNSs4V0hOdWpnbjM3SnZmMDJmb0JGNDlPMTdFdFJnZEw2UFBPcjJYM2VUbkFwR1JUMXBqajV0dnlLWnlkT2hmZDhzRzRIZU1LaC9WTwo3MDEzT0lKRjVmMyszT3NudlRjMXZNVTIzbDF2Vko4dzIxN2d4VHMzYmphbjJ2UERSODZhaFZwRC8ySmtUVkRqSnNKditxZTFaL2FuCnlPYVZaZU5HdUxoVU1NdmYyKzh3cFErT0Q1NDh5ZlZoaVRNQ2YxUi9lZmJIZjM3MjVZOWZmWEsvK2ZMemI5SS9QcXZ2ZnoxNGZQNzYKaTFlOTMzM3o2SGVmMy8za29OTnNEUDlndnYvclEvUDdMNzcrL3ZHZm42cS9mSEgwcjArZWZqMjRiR1dQSHNxbitSMmgxTytUWkhqNAo4K0dyejVNL2ZIMy8zNDAvZmYzbDV4ZkRyNGQvay9mMjdueDkvK2gzQXk3MHpXai8xVi8vZnZUMWw2bzhQdWg4OWVmV1lhUHh5YXVwCnBvN2EvNEQyc3NOSGQ3N0kvdnZ4NlBEbm4vYlZmOWMvZjNEZVB4ckM0STVlZi9abjgvdkxSNGZxRHovdS85ejk1TWU5TzRkbnlUZW4KTTVIOUlTdk9zaC8rL3M5L1BmanVvUEhEL0ViamNsLzg5UFdYYng3OTlQVVh3OGI1WjRlZjM3bDhkUGR4KzJ6dkRqSHIwZitjUExzOApQUHZweDJ5LyszWDM1UmRuKzY5SEI2K3oveFpqN1BpZlB4NjJ4TkYvdnY3eUw1LzhhUEZBbDRjSC8zNzE3ejU4K3VOL0RwKzBuL3h1CnY1Ny8vSWNIeC9YZjkyd2ZYamJibDN0M2lwL3ZmdFo2Mk5KL3YzdndXcDNjLy9MQm5mU1BuKzEvKy9uL2ZQYjF3U2ZmUHpvb0wvLzAKNXgrKytmM3IrNjFXOHcxKzZuejI4T3pvdFcxWkpQZWEyYUR6aC8vNW92UHZiOXI3M1R0LythUSsrT3hmbHcrT2p2LzRIK3ovcDEvZgovK1oxdW5mSDNQL2hwNjhmOUZxZm5ILzIxZFA3OTdMemYzM1Z5Yko3dzdQMHdhRDFSSHoyNWd2aE1iWU92eG4rQUd6TFBpbXpIOU9rCi9VWG40RjRUeGxjOC9lcHUvZk55djVzOVA3Y1UvT1BvenRjSFQ3NzgvWThQUHkvMEVNYmx5VC9ONy8rY0hmVC8vZG1YUDdULytZVTgKL2YxUGhQYlB2VHRBMEovTm4zNlBRL0pQODZQNWV3LzU5T2Y5TjUrYXVwdWFQN1NQRXZIVDc1OGUzbXQrK2NkSHYvdnN2d2ZZaXNFZgovazFZcU1qZW5lVDAvejVSOVBtelB6LzYwbjM2OHNlSGY3UEZEejUvK0Q4V21meUhmQUpUOTJYeTJaLy8vUEJ6ZWZpWFYxODVQRDkrCjllWDk5cy9mL3B0RzBuY1k4RDNiMTY0VktMVC9qZS9BVDZFRDR1NVhMN0JRcVFpbWY3ZC9lRUtzUGl5SGYxSG12ODNQclFmZkhmNzgKMmVIWnZiLzk1Mkd6K2NrZjlzM3A5Mzh2bnQ5NStmMkRad2Y3encvUGpqdi8rZm8vUDMzeGF1L08vMi92eTdmVFozSUZuNEIzQ1BzTwp0dG1Yc0dNZ1FCSUlFQ0FKTzRFRXdrNzM5UHh4bjMycXlydnhDbngzenAwejV6djlhNEtOVktXU1ZKSktLdVdDdmRhUUltWS9QT3NYCmg3aTdrd3Qyc3k5azRmZDltUC81RGZzVDMzL1dCWm4vZHVHQWdLbFJKTktjYlRsODBiZjlYelg3VW5OVnlZSnpWcVZvd3hDYTRuMncKK3FlZHIrRk9kOFo3YWtLcGNIU2NTYlJPcG16cjZYUytuSnFJc2p3Nk1BdlJQUmdaVUc5QWNsN3lKNE8xMko5WkY4UW9tUzVnNUdjbQpnRmdnT1VxU0JjQWRMbzg3dDQwTnhHc2xwQ3gvWVptRm9EZ252VHllRVpYQVhQaDBlcXFWc3NNbkhIRk0wcjFMakVqSGQ5V1h4Wkt0ClB1RzBESkxVUUlUa0NKK2JzVG5wc08yYytXVzR1U3E2YXo2UzQxUWdBTDB0MURCdnhSbmswQXdRcWo4Ym1KclptVjhzaThkSVl0cHUKWmlOOTRsMjhCcS9sZFVjQTIxUXFlajJUbU5TU3hGYnphdDVnemJicU16ZlFNS2xZSVZmcnJhUkdpOTdrdlZmcVJiNkIwQlFKakNnRgo2NWVjYzNvbG5hL3JCRmtJOVFsM3FqVHlHcXpjdk1Dc3B0OWtzUkNLNU1MZWx3NVNPRDY4M1BFZ3BBWC9hT2ZLL1o1bWY3bjFwclBOCnRwWmRDd0JSZGJNQWRrWFA5cGtnYmQ3SVI3YjV2YlNEbjMzWmNtRjNiVWxwUzJmaDIxNE9nOUZ1bDVRV0xIYTZaUT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJUm9VREJOV3ZWb0RNTEI2N1VNR1BDcFBnOGozYnRrNlB3dmRzMldicll4MzlYWHVUU0tOeEd3SEF3ajNmUG1ISjNNcXgreUdUSmR6QgowKzM5cG12TXB3bllTM2pLR3NjbTU2TGpjZi9PN1RTaXA0Q1RIYWZJQWd4di9uYnhQRHB5SnlySGI2Q3hwK1pRRGordlA3SnZvNmM4Ci9UU1dIV1dTNWJ3UHZETHFBQzFRcytYdy9ubVlmVHUzZ3R4VDlETFFZK0NMdjh4aEdyZFJxOFdYVDM4dm1YN0pieUxONzRVRG53emEKMllETmFDbENuczdqcFh3dEF6K2xzS2NTL29qTkovRTA3bkhrMCt4M0tlNFhCaXYzSnZvVy9wbURxakNQZm9qK0RML1ZpQVo4K2tqOQpta0dRaDkvbEtHRFpwSmVNaEx5RkpqSHM3NHJ3bFNSNkdmNVpNRmpaNGVYZ1M4OGNIQW9MeENjRWtXRUhuMkova1VDdndORzhvaUd4CjA4MmlnUmlzYUpyVWhPR2dJcS9sZWd0K2wwREFPQ3dJaEpoRXpKREZTTkdmTEx3M0dndjdhL1NiQkh5T3BwSG1TSWxlUjhPanFMaFoKSkJvc0NkNFFQVmtzU2RIU2dkVVhMcFRFMGw2eEVLSmxvTEZRdjRIRTRtQ2phU0E2Q2NueGlHYkYvWW1Bc1poTEVtUElTTTRscGI0awoxSkRSSnhZaWhWVDRKOFVXUVBQTE1ZWXNXOENYYSt5c09GYVJKQlo2QURqNWtsaVAxRnlSNUREa2VPVG1ERjkra1NLcVNGSlpBajVTCkZCTk5FOUVrTGdTUkZvNG16MkttZUZxRUZMM01TUjNnWkc2MUJLdWE0cmdXdlE0cGtaVVFsUVE3d2xkV2VWQk1paDdRc28vQTZpZTEKTXI4Z2tpTXFJc2cwajBrcFFEUTFWalQxc1NHMUpLd01VZG9TamJFWmp1TE9GL1NKSWorY0JobzgvS2N2TlAxYzJWYW51aUV6OW5rTApXUHJmQkgvRGlHVTNZSzljMU1oUnZSY25qUzRmMk1YZ3ZLTE1idSsxQU11bHNNcThtOXVML005Z21DbE9WM3NidFpYeHpJblE2VlhlCm5lR2JIZTUzNU00QVgwem8wS0NCRmhaZVo1b3kvVjRyems5dWp4TjRXNWc1MDdFN1l2bmx1ZGt2Vkt2N0hIOUN1ZUU4Mjl3VVhqSnYKZzhNRVdMRHJ6Qjh1eE9KR3ZrUDhHVnNQazk0UnVSVS85WnVjSDhBSjdleUtVMC9Mbnd0N0NDL1BiOFJ6azBWaDdpcVdPZHNLV2twUAo1eGhIR05vSys0eSs4RnczdmhFQlhGUG8yOGJXNVBhYk1zOHVBSFNENEdmZXJiL2UvTXpDY1FGTENWanJvZjR0em9rRzF3UmFTamM2Ckp4cGNFOXJxWXpuVUM2ZEd1Y3dDMzNldzRqeVU2TnAzS05OcjBMYXVhUHVvKzVSRFppeEhKdzdVLzF1ZUJYS2tHWCtxL0ZtbzVzSjIKZ01BNXlUVXlINjVjdy9wMVF1WXdWQlVSQ1RyeGZSSEU5cWx3MVZlby9FYkdITm1BWndFSlI1TS91eWxIT3V0YUsvdlNyZ0oyQjlKSgpNU2MzRURtbmdxSm5LaHgyc1FKUXlxM0RpdzlrL1J1c25QMS9PZEQ1UzZHMHNzNkJlRFdTTUtneEJaODhwOUxPTkluRjNJbmdzeEJzClRjWkpTZG9wRFZQS3ZxMHpidkRyeFI2Zk50TXZSS1p0ak5HZWFzczFCOFJhQlZXY2ZxSy9NdWVYbjhZNEdQQnd5S3orbHc5TTF3ZGsKUDdlcXU0RWo4dm9kWkFVa0RoMkRRVzVGUEJxNUJ5eXpZL0haM3hxRHkvUWs4SkhET1RKWi9QU3hVQ0xrNE10bEpvdWJNNUJLd2hyNwppMUtjNWJINFA2S1JhZTBwMTNqTmdOMmk5L2RNRC9UY3MyWWJ6MjhkNkdzekQ5NS9BelNOdHpZc3NqcFBYckhhenJjdUhWL21CeEZtCldpcEZ1TytOMldCbFdaTE1IQTdMZGpCZWYwOGpCQWtzblJoQjd5NlBmY2Z5RlI3c2wxMnVuQXVlY3hqdWFSK05nalg0R0dSamlhcVgKZmRBSzduMC9XZVNMRlQyWmcrbXBUTHFjbmlCUVYrL0F2L0hNTm1CM2FwTGswR2xjd3BrR01zbkpZSk41YjdodDhhWDc3UWRzZnJGZgp4T2M4N1h3UndDaDdDMDhIMTRqaXNVdU9NUlpUMUp1cy9BcUFhWk5lSXB5MW9SMFF4bUhVNURmQUJSMlZwWmMzRUNpOXdCWGNmdWQvCmpqOWhHRlh3ZmpTeHArSStMNEtvd2N2bmdXMFl3YzdOU0c4QW1DL1ZOWG9samtlTndPWW5uYjNYVTdiYXcyZlVNajVXbjJlRjJWL00Kd3pDZnd3VDg5RFJXeUpmTjFHYmszUnBUUGlvUVFFWFAzaDlEOGZuSU5xZnBWSDcxNTlhK0pnNkF2bTJRMldHd1VoaWYyOUd2NG5CZwovUUNEWHhneis5ekF3ZTVZUzVidmdOWU5XNnlBRXJFSzNITVd4WW0vL3lPMFlaREcva0MrTzcxZjF4YkFVb3E4MTNkdndyMmJlak9TCkRCVG54Y0hMWkFoc2t3UlVPTi9PNHRTTmZXYURqbGdEcUwvM0tHVUwwT2dENWt3eTNiWVZLbjgvSDdsUXArdkxObHl2aTJ5ejVRYWUKUmNsYStvcmtWdmpzd0RkVnFBM2wwVitvZk5SYzBOaG9vbGVBZGs2K1NRMCsyckpaM3NpaDJkWXJmQU42NWRaUmk2Znc1SEE2a0hIRAp5ajZ5SkJiV0ZlQ0ptQ254YlhsYlNpQU5nazIwZVN5NlhlRnYvdllHMTJvM3pBMHlIY3ZweEdLdWdTVmVHTU9uR3RrRW5CeHErYnlDClIzWWpWdmtvSldrUTdQNktJclQxMysvditJKzlVUWNtblNkTEZucGxsOVRVQk8rRjNBWnI0bXY3OGFuMFVzY1ZlWjRtWGtTdkpPWUQKNXdyRjBlTFBpOFJQMGJQdDQwQXpodkRzVzRqOEt2MmRYSGI0M2krallTNjR5SHdFZTBsOVNSa3k2WEMzbEgvT2Q5SWkzcUJQTHc3RwpEMkEyNzV0Z2tUTjdublZJZzhKOGdMenZPNE1WSFlCSXJJRVB5R2MxSEg0azkrVmtZVjBMY1VZd3ZZZ0RzN0h3L1RiYTVuOU1saEJnCjdPQkxkcE9xYktWNENLNExaTHFYN1hRWHEzLzc4ZXhMdkZqTkpISTd2dVZOanl6cHlCeThzVFBVeVpsczVHdjJYUGlPamZ6Ri92eGsKRTlFejludXd0OEMrUCtobHQ4c1hGNkNZa0ZsWWN3bjkrY2tOSGd3cVhlRnhTZW94SEpCaWtOZ3FXMnhsSTdFbU1odUhoZS9HRWV6SQpsS3FnUjFzMmsvbnMxNExNWnhiTnN1VVJyMlJqL2xWVytwV3M2emZUYVZYR1pMSnc0bzBHYUdLektSTi9ueTh5MGQxaGlPS1NsMWlBClErZENhd1c0NkhXcGRhYVVtU2VFa2l5dDYzL3VWS1JVQnZ2THZwL29zUXNWQUlxeWVJUmgrZ2Jnamw5YnB2UGRPdk5ncDhKUDU0S3YKT2ZObTRzKy9LNTV4RHY1cGhVM2tKazhmdmJEaXVzOUM3elgzQjNZL0FmbnRhLzl5UGhneHBKNEgrZVFvdjV3TDVjSHhXUEJNeUdMUwphYkcyQVMvMjlybS9sMVRva2w4YUpyQjlyZnJRVWtyZ0RxRG5nbFpncXJYOGhlL1dBVGg3MlBjZlR3SXJ4NjlSeVVvYXE1bURlWEFxCmZHOFBQZ21HallGZGMrR0VaenRkTXYrZERuRGlRL3N2MERpSXdFQXNaV0tSbHU3dkQwYUVWc3RDS1dXZEF4TWpGcVppc05OTy84aUMKVFpDT3l1d2RPcGVmVUVkMEMvUGtBTG9LWnpmbkFES25QQUdYd3hrTkhSTHZ3Q29xL1daZjhGd0F1Tm5wVlNhWjJwbjVzc2lZUWVEVAp6TStqSW5iMDlNT3BkckNZRFhtckRhZ284RXNzNkNVMDBBRkp0Q1QzSkJOWjJ4U25vUTNBN1BVNUpZaGx6MGJlNmlSWWc5NXJkcHY5CmRraGpBWlN2UnVWQU9JRDFoQzNpZFhjQTdLUXRtMUdUcEFyWW5sb1hPY1puZysvWUNRaHhhNVBGaURUWkFFdzF3b3JUM2lGVXlKUjMKZStabHp4WWFkR0dLa1VxOXpCb2RITkxXaGZ2eHFmL0VvdzdZZGI1eTYwakdnbHdKK2lBekRBOFhJcTR6MUJmTnVQYzdlV0JueWc5QgoxTXRPTExkZTcwWWlCNTdqTWQ2MlBTbE9zS1NkYjhIVEVNUFVnK3g2UEllbkVtWjRXSU5sbTl2YXFlQjUyYzhZUzJsMVprZk4zMThRCkZsdHhhZ3AvQVUvR2VDQ0wwV1paYkd6c3k4MGFjcFFUMzM4MkczRGJmOE9jTFNSaEFkU0J4aTc2MEdJRExBbzJSZUs5Nkg2eHV3RUIKQjE2bDkxSjFJSVpWQzhCTStxUXdHNndzN3ZkTWNrMDYrVGE0R05pYnZOeEJFZDdubjR1eEVkcFEzS2xqUDhZcFI2QXQ0WlFlSFExbgpEM29vei80ZmN6eEpHN1RNUytSdzdROERIUmxlWnlMZFJURWJMUjFQOE9qYlN6cWV2SjA4M3Y0N0p1WngyeCtZYzlQSng1emEveUVyCkV1cms5SFF1MUpibmJIU3lXL0MyQktSdys0MXhHZGg2V3l6eGZaNGZ4S3AzNnlyNGViOWdENFlSMHhpczRUMGVld1AyOWh0SlpoYUEKeWQvT3JaazYvNGFSMDR2b0FQMkFPbUNmZHdMWUk4bDY5czJUQWV1eWNHMzRXQkJ6RnFkbjB6QWI5ZnBNMENBTWk5Z0xiRWViZVM2NAptczNDbmZaWEp4cEo1OHY1NWNmTUJEMHNVeWJaQ0F3SzFXclN4QjRXaTM4RzdERnliQ3RtRWw5dFlIWkdHbTZNOE95blFNdjNWMkRQCi9kNWxtK3ZRdTBBSmo3dVpvN05yS2xTZkFvRHR6Ym1kbEVKbFR1MWYrNUhXOEx3eFdNR2IrY2ZDSWhRMkpUM256NTl3YXU4cUFpL0kKdFNlVDVKVG1SbFkvc2FxSjBVbTBIanZTVHNXcnpmMllpWmdLS0hjQURPUXJIM21iYlpQQUd0OVpCbDR1dUJtZnphYXRPREYydmViVwpYcnhWNnZhN0c3QXVweHdYemFOZWVSNU16dVRvNjd5RTJSWjI1QnQ1TjU1V0VDMEVmN0V4ZUxNMHRScmZmdTg3V1BpMkk3dVpMSTZzCmJoTkFIQkIvYUEvazVWZ0l3SGFBOFRvNEF3TDJyRUN0TmM3Y1U0ckgzck90ZHFURjBTNjJ5dnpXd016LzNnVWhTMGpsMFR2WW9uYlkKTVlzbG4zZThtQ2dpVnM2ZWJCVmNQLzVwMHRPcjVySlJUd1hDcy8yQXVTQlpaUTBpT2NvemkwTmJlRVZnVE9XbTJaZHFHUjZYTG5xUQpEb1JnU0EwVDJCem1ING54Ky9ZWGVLLys0cStWTE1hMlA4VkJkOWtHQ3NmYmszaDlGRzYvZlB6U0dxWkdmc3JDSnAybnhMWTREVHRECnViclQrUlBaVkJwdTZJbUxvOUVOc08vWFNUdGdaMHUvNk8xRkY3bmdlOERMVy8yZmdXZVJiUldPcnZDK09rNC9BdC9ZQVp5ckpDN0UKeDBKeFBRSjVtY1JYajRXdm41Nlp4MmdzSE9UV2d6M25UdzVFb0pGZlptYmVRbVdkZnhkdCtSalIrRFNUam1vdUN0Ymx0ZS9aOHVZdgppSU9IV2Mzd0EvM1BVSEhTS29ZNHpTakEzSWVHUTNtR0F0Wk1oS1FmUXpFVjZDTUhzSmt3NWhJdmprZS9udXdtYlh3bFI0NHZBZ3JEClorSEorSTF4dzJOZ0R3ZUp5a3U1R1k1MzJ4TXdsemxKbTRpQTFXaHQ4WVF0d09vRE04OEpFSHp5WS9YaHVQbExVMnBSS0RaMEYrdnUKR0pBNnR3ZklVT3RZbktiS0FGVGJ0clBFMnNVUFMyenhEbnhrTUxJeWpNdjdCdG5XY25xQ1kveXZGSnVDSjh4N0s2Q3J3elJrK1RrKwpLdXYxR1NXNGJ3OFB2QWFlT3F2WlpMS1NOVitqTHAwUURGTUxYd3ZrRUYyQlU5aitlME5kRGl2K3NXUnlzdlpyNTZXU09Sbk1UUDArCmowcXdpQi9RSkQvZVVhWDhQL09qSWh5Q2dvTXlUQ3ViS1lDRExyNVkveWdWbUdpNTNFY3lBWjhaT0hXTEUzblkvbVVQcDM5dkQ2dWMKU3ZFajgwUFlneWZQWmEvVE54VEpaN015djJzZGZ2N2dkU01LNmVjc1VjZUxlWVZmZWlFL0RlYW1lNjJ2OG1lcE5JVG1mTUVickJJOQpHRm9BTW1vZFJKTXJlM0MwbG9DQkhzYUgrY05wT1grZ0t4a2Z3TkpBSGpvKy9IczUzendjeC8rQ1FqYmVQUENGRWZMTHcvZ0l2K1p5ClpKbjdRSHdQN1NNQ0NmNFZBdnZQOXZ5d0E5ejlBS1JzVHJFcVFrMkJXOERlNUQ4Q1JKNEhnSXo5NlFhTS8rRzBoU0NtODRjZlZFNDkKZmxpUC93T3ZLUm52ZG9CdEtRaytucWRMT0x6S3BvQ3E4RGd3RkxZTklORVpqRzc3emFIL09UNmNOeXZZTk5pbnJHSVlzUUdncDRlZgpuWEk1QUVON0VvajQrM3dDTDJCVFgxYXFLOFlQVTE2dDlDcGJlcTQrQktTb2N2d1NJRm1OMERvQWFySlhpMGkvR0VRMG9JdVF0WEpmCmphdFpWVUQvZGhwdlpyQnppVUxsQmdPMnZ0MXNwNmdMakx3T1ZzSkY3UURnTVdCY1doSENuVU9ERGhUbzRPejBzSjJNVDdYeGYrWU0KZ1lPYVJzMVRaOVVmNXJvcmdwRFpOVmd0eUUyMkFvdHhzNVB0dnpUc0dJZ0Y1QlNvUHBYTjF5UGE1SVdpZEg2N21hSGl5OG9NVVB6bgorNGVwTWRDdzA4ZzNkRkhlb29VRUUzTkhXQWZCdUNYU1gvekNxZ0wyaWoycXFFQ3lLNHpZVU5IUUlVWjE0VGtTY05NSUtoSU9zcWs4CnA4a1ZUWXAzM2ZmNXJieWlMc1pBR1lQZGhMNTNraE5kamVoNHYzN1dla2tCODF1NlhmcC91Qi9xRXlSdEtwRm1SQT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJV0RBbU50RVVyUm5xNWdXNEN0eTlPakkvVUxwTVVrbEdSRVlaeDF1S2xoeEVNejdOVzh2ejMyUXovbGxyTU0xb3dXbnhMZ3BUMzhxQQpLWUtJME9KVk94TWh0Zm1BdCtlOGE3TVVkNkMzOHdTdTZIWnpha0lPMG1iRlNzbWlWR0VvMzlJRDBFWDNjMmsxemJsU1JPV3BJeTRUCnpWM24zc3ZUa0hwRS9XSUQxcklSaXJTYVdEL3BrMFBXa0FjK0szaUIwczE1MXAwVVZhL0J1NitnNFl2dWh0Nk54ZTRhZmNNV3hSb24KbHZFU2wwNXVndTFOSit5Z0JzZEpkVmFEdHhReHp3eG8vUHh2Skl2RzNLblFLT0pPZHlaK3pPK3VlOTNwNVNrQVB4SEJaQ01lWUI4MAoyRS9vUVNLUWJwMXloZTlZYVZVMk54L0g4T3dxeFQ0bDNJL044TkxvREpRZmpWNi92V213R3QycFZkTG9mTzdIako3bEQzZzArdllaCjNlZjRtOUZUN3hhTVhxeE9ZUDdIbmdPaER4bnp6a2J3U0J6cllIQ0ZWVEQ5TWtvRmN0RkFOTndQLy9WUjRnWUtpSEJQc2ZKd25qZFkKRDRmVTR5VHIyVDAvWmFxeFl5cGFUcjc3eUcwLzJDa2VQdnRZb1UvMld1Umo5bkdLdTdLUkRZMGxZR200ODE1WEUrQ3JoZVdtUzAzSQpGNmpGTElCaUZ5L1Zqb2RENHRnQ1NEd1Z6Qjk4bzZiQmpld1lKVThkWXJCZDJiQ1pEVWVZWHppd2h5L3NtQVN3bzJkM3FtUzBvWW1qCmRTbXNmUDVqdEJTTTdoTy80TS9TR3Z5NlZ4QWkvVHg4MVQ4YjBraExrVUVvWGhuNEpKRU9MTTgxZzFXRWxrTWEvcW1Xck5KSWswYkgKNFloYkQ5SklYL0hQb0ltSXV6aWtCaXVIOW1qMzFMMHlTRU5MeDlqZUswb2pEVG8vM1VsaUlUMVRFemtJR3F6bTltNWRrNW9yUnVhcQpHUm1rWWJObGMzQSt5aUR0RFREeSsvbU5RNHFLTEZtMEpXUFNoajhOVzVKSVMyV2lKVXRlb3A5cWpSQlN3SXVUb25CTjN3RW5mNTVUCk5ZaldlYm1xamw3Z1k0MDdBZExnOW9LVmFsaU9SdnBxdDR1UWhrSi93eDJIbE9Oa0N1M3c4TFhjdEdTUVpzYmhDR25CSlpFTzBxT20KSE5LeXdXb0pPQktmMG5OTkdyK081dVc4S1kyMGtYZW05cGEvbWhSU2QySWRUM0ZJd2JvSVdjbVY3bWRlcEpFR2V6Mk1qR0hQa2toTgo1Q0ppYWY0UkwxSklEVmFNL1BvaVplWWFObHRYbTNwZUR1a1lLM2xHSFdta0pTeHJuenNpUFlUVVlCVVQrR1QycEdta1BhOURST0QwCmMvQ1JKbS94YzBVS2tQYVRXQzNpeFNGU2x3aXB3WG8wbGVmYmNIUHNKUURheUU3TXY3V1AvbGdHYWRnY1djM0lnUnpTQWxaM2ZjVVEKVXNoam9ybFc5dkhNNytHNUtZbjBMV0VQeUNLdHp0OENtQlJTcVBtREgxN3NiZWcwU2MzMWFLcVc1ODhmZmFkREVtbkh2bG5JSW4xYgpOa1lUaE5SZ3ZaenJSd25yVkhkSmFhUzFnTFZOWnBLUDBraDNUeVlwcEVBblE3U2RZY2wwa2lId3h3djJucTRXcEpIV1U4WGhvUEgxCkpZbjA2MlZWUVVqaC9uSTUxOTllYUViS0lQMk1ZbC9IdFZjYTZmUHY3dThsRmcySWtNSlVBb2gyV1BGdVpBbDhzTDY1alRKSWUyMnMKK1BQM0pJazArdXcxR1ROZlhxREhBTnI0WGl3MDUyRmtTQ09kQkp3aW9YSDJhMk1YUWtyWVU0NnljS1kxYk9TS1p5RlNENGNVWUlGbwpBZGpmUGFQMEh3OWlwTWV0N1pGR2VrcTdSVE0xZm80L25CVFNYQSt2Q0JXaDUzQnNwNHdBQzBEcnU5UktGUythSzBDYVAxMm93cklwClRDRk40MVd2U0JGNmRzRm5hcWNKV09MNUtrSUtzZEJvTFlmRGVMS0JTREVSMHNNaE85OHkvUHRrRkNFOWhuN2o5RTZUampkOEl2S2EKdHZOUnkwRGJEL1B4TUN3Y1ZMbHRHMnpqc2s5N0RmeXZJL2QwaVpWSDFqUDM5RUx6QTlWYnNNbjhHcXlCeloxbnh2VTdqNGllaHFQNApzRVUvUGE2aUYxSVozaXhOWGFubmxGSjhyY1EvWlo5R0NWZHpKUDkwT1I3WVdZcGRQczhTdHY1VTltbk52VWtUOGs4bkw5OEo3cW1JClltSHppMms2S2N2OE9scTJsWlB0SS9YMDI3NlBpWDdiZHY4d3h1azNib3BmVUt3OWVYcmJTRDJudEZ6QnZUcklQbjIzVHZ4RythZWYKaGZnalF6R0o1eVBySUdLUmZmcDdldDJWWlordU9rU3V3VDI5b05qZmlrd041SDROaHRSSWhHU2ZQaEhCVkZlZVl0YnBadkpXay91MQp6V2lyZkxwa254YXo5Y2xjOXVrVGtUYmg4aFRMR2dtTE15N3pORlRHaW84dVpzNXhSMEwwMU4xcUhOUDAwN3d2S1piS2NtdFVjbVc1CjU4RmowTk1VZW1CNWJHYi95TlA2WjJSZHc2YzcyaDBsaHlGSzllUzJ4MmZxazBDUEVTY0w5RER6UnU5VHJBYzh6TjhXL01jSHZ5T04KbmtJekQvOTVSLzRiNjcxUk9vTEdOMjdtR00xM01CSDJ4MWN2cmMrQm55T3d4MUxtZ0IzODhPa1B5UWIwZEhnUzRhOUhOM2JneDNiUApRTFdhYkFEZmQ1TEZaL2IvUEU2Y1FEdVppb2Z6eU9jVnFOdUR5V0RsMENKUFJ3WnAyQXo5bkE5cHBNRmVYeFlwMkVSK2NaRTl4cDhyCjhuUmtrY0l0YnlxSGRNWkhHbndEUGpJUGJmUTU5OFpET3JQWnpCeFNaUDJ6U0FNaThrTHJuNTFwYVMxQTZ1d2g3NVdQVmtEZ1IwSVcKS2JMK1paQUNmeEJZL3dNT0taaUxZSzVmc2tnQmdZOUJlYVRRK3BkRmFyQkMrMzhwUGRlazBhZUV0R2FYUllwc0NnNHBsSDBCV21oVAp0QVNyT284eDZORW5laUdjK2Y3c1Q4dDdnL1BmaGkvN01tK0d6ZnRCc2Z1aStsNW9TZk1kclMxeVlNNmZXVnBiWG9qdXlQRUhxZFBrCkJXaFM1UGxBS3hmYlcwWWs4VEMxMGNQOWs5bzVaaTNhV1ljNmlmTDNVenRuY3NkQ2RDQVFxVmpaOG90R2tZcVZQZ3BBY1kyTEVIT0EKVTAwMCtsVFJTdi9qcVc5cEJNZ0VaaEN3dGlVWUQ1amM0NDU2U1JSOUFtb3Y1MS9PQzFiMm55YmZZcVpqWmkvc3l3V0lwY1NmN3VncApUY2VVd0pEYnIrQUxHelJvenk2R09wVGRUcXRqM2d4ZWJVSUNzaEUzTUdEc0tXUzFvbjhnUTc0THZTU3BRYTFpRmRHZytFTWFudTJBCmRlc2V3cDdHZUhFMFVUZ1FrUnhveTY5enJxcEdkUGdQUFhqS21aZVluOTBvT3orRGxac2gra2QyQlpuMWV6T3ByNStablorTDVqR3AKR1VManRhMUFMTzNydDBYOFNYa1dHb21sQUF4MzVYNUpXVkFHTGV6T0VDdmgxY1ZaSEY4SmRtU0tzMHFmZS8yVWw2UTdNRzc2TkNmZgpUSGtpMTQ4OUtkUGRJRThzb2VweFhxcWVRVkdvZWdLeXFzZWd4cnJGejhxQlQwQjJ5QUlDMmlqVkkwMjdBYnlLaGlHd3pIZzhSUS8xCkQwMDdmQ05OdTU3WEtLdTI1YVFTeGVNa3A5WXo2WjhhZnhkRGt3dWtPNjI2R3FsTFZSdDltaUE1a0lKYk5DditMc2FiMWZ6Vlo2TlgKLzBLTkZnR1d6bGJYaEtRMERPQWQ0TTUxZWJSbHhaRFA1eU9uRFF5dVc1QlpKczhPSDF2c1pUUUdLczUvSldFdytWMTZ1WFUvTXB6RAo0MlFVMUpFR2htc0ZKZ1VLMFoxM3l1TzZsTHN4cVZYdWxLVU83SlZqVS9lc3VKWm0zTlBHUGZDZkR6ZnZrT0tDTFlCbWRCU3JVc3NKCktNWmZVUGdQV0ZBdUVIM0pHMkIrckJhODVJMlhCanNrM3JqUVhFNGx5WkdsU3BPajNDUXoyUHpVOWw5WVlaZEx3bmw4ZGZmbGtzeEsKYWxhWVZ0V3ppaDROVnRtTlNZUE55TDBNckptUGsreTJaTERxV2Q4U3BFbFp2L1VrSmZ1emtsQlBTeENydnVVMlhvVWhuZEpQc252bApTNU1lanhhVERneEozcUJqbHM1ZzFiYUN3TXRYTkN6VWJIN0JDbTZzaW9hRmp2VXJ2ZjV4b0NoT3ZnSFkyMGJEdU9CVloxcUFDVGNVCnZlTmlUbmhwWUQxbEowYlBKUGxXM2MwVUd4N3VTREdoUnRNNXJwMHdEak9LSEM0YzExUHFlS1YxTERoL0FlTXBTem1EY2dhdDVBWk4KNUxwTG80b2U0eG5ZMGxKNVNwdnVKcFc1N3Q2aXoxR216bU12VnJJTWoweHFIRzJnSjY2Zk9qMlRUYXZ6d2RxV1l1cWtqdXkyckJwRwprRFlNeXlLbElDa3Y2c3VVT2lxN2VLS0IwSng4T1JRVkxhQnBJQ0xiOGpxYXFJZzlieUNVait5VzJhSVdaUmk2L3REaGsxT0hrc0lrCkl6YTNoL2c2VG55OGdEYjRWSUU4WDlTQlFDYW9BU3hCbzRJTkk2aytaQVNrb214MkdLeDZCbVcrVWdFSXRTVVV1YStUVlhsYjFxb0EKS3B3QzBPcnZ5OC9Qcm9Ia0JtMUVGOWdLNnZFTXNTWFB4ZnArSy9CUTcvMGVURlU0NGNXdlk0blRESUpjT0VuSFI4WW5CN3kvREdqbApUL3JFU29sWTJrVmMxdTFCWGhJZ2xrNFJGeENMRlhIMGk0QWx0dklMQmZ3SnprVW80cEpldDNwMENYQ3RTVnVFUkNtVzhDUU95WXBICm94U1NGVVZJL3A2RUZyeU1VNndla2dWVDR3a1N2ZnE2d3lSUE1DK2hyalc4d1hwSjRxRThuWVhiOGhYaERjQUhld0pOQ0dXcVhLeVcKOXJVUzdha3ljUitEVlNsSzkvY0VEM2Q3TjhWOUlGblVZMzBpVlNBVHI0SFVDV3ZpWko3ZUZFUWFkZ0pUT25NV205S0FEK1NEaWJSTwoxbUJNUXlwWHhhYTBIdHBSOWhnYWoxVjVQRnJqQzRGME8ySVhjUVRQRjlPMUVWWkZsdkIxOGhKdk9KV25wczduVlc3elkvZVhLNkxSCnU2cDQzNU9ia01HcXdPbUFkNFNiM2pVS0lOMjJoZ3dxYTY2Tk1FT1ZJTDFCdE5YSjJiS0FPcUtOVG0wZjR0dXkxRng0V3gwOHJMTHoKOHpmZ3JNQjNXcGhCVnVwNG5Kd0g0L0hwaTNsZnpybjdKclhiQ1U5Rk5SOUJBbUJ5OFZhcGFDdmxXY2pGV3lFd0hjSW43UzhCb1RGWQpiejZrUUt1bXZPVVpOTU1ST3BMNlJrT2ZpVk53YnBWQUNncnJUWEpRR0oyc0I0NytmWS8xOXlXQUNVNEk5VzJpd3ZOQk83SXVQQTZoCnhabEhhYXAzT1dISW8rUlRnMVZkRERWc054QVk0ZE45eGlkalJNQmNUcGNtVXZMTXovaGVzSXVKTmRweDVielFhTWVWK0FCUGcwYVQKakpEa0FXRXkrMXMxV3B2VGFJejNxc2VDRndOVDEyZ0dqU2RJRU5qMUdvMlZ5bEpuZXdlTkJsWk5TcVBwbG4wQVI3OUd1NGhkVUhCdQoxMmdReXUxbnJ3aU93bW1RSitkZ1QzSDhCcXVVTlNEWWhEcGJKUSthZjNRb2JhTUVQVTFodmlYd2VTNWk0L0M3V3c5Z21mM2wyNzZYClYwTWFMYk04a1BPWGs1UXdVeEY0ZldvV0FPc1lkU2xaZzFWV3pWNlovU0FVNWc3eXBRV2UrRFVHQ2xnMVVWS1RuSVpSaDZQTnRKZUYKZ3VJd0FNN3RLUkFJaW94RExUcDVWNGNqUEhUWEdGNldPRTFBd080UnE2YjJRakEvTjdRdWhMc2grTlo3aTMzUFk5S3hxWG04MmVQcgp2bXVOWnZGaUY3Szc0YnN1KzE0NUJndUIzVzdmZis2bDlrSzl1eGhjTmYwaHJjdGRETUs1eGI3blFXSDN3dXQzTVFSSHdyNlhnc0o2CnJ6Snd0TzZHeW5zaDBqQ2YrNXQzUThGZU9CU2ZFeU1zNE51N3BDTkIvU09aaDBYdmxZTGtLUzROUTlZV0dCNFVsb1JQU28rRzA3ZHUKOTVaWXRTak9ENERkS3QyOGNVbkl0bkt1dFFMRk5KbTd6RXBDTEhJZUVWaExueVk1VnpnOXpRTjZkdndLa1NzTjZYU2lJY2x5Qk1ydApVUlV2OGNhVTkza3Z0cVc4ejYvSnI5U3dNUkc1N2t3MlBVOCtjMDNHM3djakk3U1JVb053VFk3M3k3WUZ3R1RQYnRob2o5YUVlZ0FzCllFbFVhL2VJa0FDS1JmU1pHREk1aUhBbGh6NU5NVmdLbUl5dzl4U1RieW1PTUREeGUwMkQwc2dSRjhKRjc4aVU2SEw3V1NwVTMwaDYKRnZRYW9HcTU0OExvM1RTR1JrOW5VRFI2czRFQnJKc3JTbFhRVVRlMzNGNUR4OS9GTGl2b1JCVkRWOWZRS1ZmUUlaMThoeG82V2FTbwpnazYyV2xCbkRaMXlCUjIvV3ZDV0dqcmxDanFCMVhkRERaMXlCWjJnV3ZDR0dqcmxDanFGYWtGZE5YVEtGWFNvV3ZBT05YVEs3OUcxCjFUZlgwRjBJcnFDQ2p2VXNicXloVTY2Z1EvYVllZzJkSUNGWm9jTHMxVTVLV2R2eU9mRHlsVUNpWkJjTlE1S005QmJVRTdkZDJ1cWwKU0pHUGZIVXliRUZzL1VvRUI3UkdlajhLd3QxZTM5THh6dmdLNG9TTnErbVVjQW5ZVlZncnl1N3hEaTNGWVBQZmVVY3RpQ0k4NDFNQwpwcHlIcFcxK0tOYW5Wam1uZVg2aXlOV2x2R2dudWwvL2tHUXFIMVVpVjBwRGtpcVpnM1BSVlRTblNkY1VSYWtnWEc2UHZnS3FrNjVVCkVDcC9URElaUkgvWVdDNW9qRzRHdXpsZTFmT2FsYWRtMEZqc0pzeUUxQnNZUkp3TTF2eldpREZWN0NaM2JDUDBrZz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJMUlyZDVQMVQ1UU1IbnJZc0tpYURDRnhUTlRla0tLcG1FRlFLYXdNbVRNSENMMDlzSnNSZXJmSlJtODRhazdxY1hpU1ZjbTd2SkNDZgpRcW1yeEJUVnZ0VTFWaDJxKy9hQVdGSm4yYXc5ZGhrNlV3c2NycUk3VVpnRS9MWXRtVFI3eFlsVlNkYnNrcTBDNDFsSzRqb3dWYk5MCmN4M2ZXUzBIWGtjZDMwU3Qvc1VzQ0ZySmw2YkpGOEVvbTlLWE9mRDJ4NlZaYmxBWnFSSk4rZlZUellIWG5FVXdLd2tqbUpMcnA3V08KTDNwUXE0bFJZZ1poZGpvRWRyY0swUU4zOGlGWG1hSUhtRHJIYTZlWU1NQjZJOFZVeTBTMVQ1TFRhRmRSVEJqNEpYTGRubGVZNkZRVwpKZFpMVkhKcHMyVXZZcjZYYmhZcjZrM3B1S1Z5dlp3SWhBeUFsVW00STB1QUdCRURIUDR6VXBUdXNnWm5qL1g0Vkp5OVJWbXpzeWNIClFKeWplQVVJdGF0UndEcXp0MnBvSzVXN2FvV0dtUHIrd3BnMDBtSUJTOXpVZ3d3R3haQTByRXFUY2VJdTJGNnBSczZnVXVhczRjZ1QKVFVqNXloUERoWHVsWUVmR2p4ZXAvSTdDU1FQSmVTY2pjcHo4VzlFWDNwRndsU2hMU2FWQTdrTHJ5RmRFblNSMzh5dnNzWXBXaWVmawpYZFllKzYzb0MrL0lsOW1KTTRpdXB0TlNKZEpnRUxrUzhpeWdNeUlqR0pLZ0hoa01pdEFUL2xBWWtsQ1kxWGN4QlRvRnRRNUpPVHRkCnZTaE9hVWppdXp0OG92Z3ZWWkowajRqTUU0ckkzSmlsQml4aGk0YUlESDNHcDFLZVk0bjdiTGRFWkhqKy90UHRFUmtBd0tHUTNhR2oKRE8yYWlNeEZ0ZUR0RVJsWWhpYUt5TWhWcEtyVjV3VjFSV1FrNC94UEdzcHp0Qlhud0JJOUlIRHFuS3d0ZlErMjZzQ0V4bktWTTVibAo4OGExR011QmROdHQxc0FNeWpXSnUrcDlNaG5ndXNRYjl2c0VkY0RVNGc2Vm5GNHRaV2hYSnJEejl4ZFlRQ1lmWGRKUlBuYVJ1aUJaCkxhaFdWNmM3YWZZeVF4WFYxV25NMTFPc3ErT1ZqaXBVQ3FzSFFhdUtsMVR4cEpkbld5cW02cjFlM2tVS3Y5TzQwVEUxNzNLSlNmZXAKaDROWTdwRlRwMXdQcC8vK3NXdnE0YVN5b0YvLzdsMFBkME9kaFk1Nk9LVU0xZnZWdzhHbzlZMFNxS0VlVHVKR1VOa2lydXZyNFFUWgpVTXh2N1BldWh4UGZPMHBWeE4yN0hrNzFsb0M3MU1NSlRxdzBwRnBlVnc4bjlzWGtqblZnSmR2dGxmVndnN3RiVGlRQUpjeUpsTE10CnRlUkVkcmFhY2lMVlpQKzRDdHhxQnVSUmdzVHQxZWdJamtkdDlUWEMwVkpISWd1RnNzY1FuRHRVY2wxa01pamt3S3RyTkZoY0p4OFEKdTh4MzV2V3lrY2w0dHU5ZEZ4blA5cjNLUW9pRVVEYmEwKzNjSW9aYzhSRXZxbkNyR0FKZ2l0ZktTT2t4V1RIczdiU0tvWUkxRHVtdAp6MStVWkxUNzNBYU00T2dUSDVsNlpBRG5Mb1dRQmIrMlhVd1ZqdnlWd0RLM2FjbWxXVjllQ2F4Nkc1b3dLaTI2cmRIcHVZeGh3ZUl6CjVZdWRWQjFxdGlJVk4xMmJJTUticzl6RndsZFZwSTVOUXcxRnBCb3JVc2VtaVphUWdVcXAzMTBxVWovMzk2bEloWER1VVpFSzY4VnUKcjBpRlVPNVJrUXJoYUxzR1d1UVNTK1gxSVFHUnZ6UlZkNUtSMDB1dnZsQU11emVMb2FnVVRscVAzYnNVRHVYeksyYjAzS01VVG5KZAo3bDRLZDMzY1VrZ3haZDlkaDE5NVF5a2MvdzRpVkF6M2o1VENTVVFWL29GU09PbjRtRWIvcktka0dQSlZBZi8rWktYQ3A2VnNycXFXCkcrR0Y5bGplcCtJV2FVMzBncUJDbWlLS0dnTElFSmo4elhZNmJaaUxTNGIxSGk3d3F0RjdHbzl3bEc3bkJhcGNhc3Zqc0tnWE40dnIKNmo1bHI4TVJidzVNZEZSaWUrRGtGM2FOODBqaG85Y0F0YmhNdlN4TDY4NTRXRERQemtVeVpza015RmJxdFpqeG4reEE4NU90ZEtTSAoyb1lYK3NWREpsc090NTd5T2Q4MG44LzVxN0FKd2R1TzJZNnNhK0dRNllpVHNCWkxxdW9NZWtsMGpkS0hmTjFadEJGLzViT1hzTmd0Ck1YMnA4NFBQUEtTaHBjdWFORzdsS3V5Q3ZhNVNzZHZNTDRzVUkxczVwUW83Njh0UGZTeUhkS1NBdE9TTjhaQ0thN0hpN2lNdkNpY3UKZGd0Mmx6VzJNNkdvQk16a1VDcDJ3MzBpcE1KK2ZJay91UXE3c05tOEQ1OC81WXJkUHBTcXp2NlVLK3kyclpZc1VsdHR2cHpKSVowcgo5K05yZE9XUkZwOC9TckxrdFd3Q2lhRWMwb2F3d2c2dEtoQllldGJvRTgzbmNZM3ZKYVRlbzZJS2dqZURuelZORUlQT1YrbzlldXVzCmhTVU0wV2ZHUzBxUjU3VjRRMVdLSFd0SXVSVmFzTzROTlJmQkdkR3JiWHVmMGg3MURGVngxRVMrajlWZXc1QjQ1MklLZzFKTFRsWEwKODZDODEzdDJrcE5xT3lKeHA0cUc2SkpTSnpsZFViaVBndVlVU1pWcVNIUW5wSTY4UHJVbWNvcDVmZHI1U2FXSm5PejhwUHErcVRVYgowVG8vOVY0RG1vbXUxbWRFZEpmYURmM2p0TXRMYVM3ZmlFZzIzVlZyQXpybFNPODExWFRYeFdIMFZ0TkorUUZNTDg3N1ZkTnB2Qi9tCnhtbzZxWmlnV0Y1dXI2YVRxcVc3dHZKUnZwcE9LaFl2bldsL1N6V2RnQ3kwekVyZVAzWlROWjBVS0pVYlFxNm9wcnR5UjlaWlRTZDEKVHNQdWxYZXJwcE9xcGVQNysvZXBwcE9xcGRPWTI2T2ptazRxMXM1MFlMOWZOWjNVNnFKSTcxMnI2YVNNRzM3dTZIMnE2YVJxNldSdQptNytobXU1eVNFdXp2S1YwYlRXZGxIRnFzTjY3bWs1cS9TU3lvVzZzcGhPRFV1MHBmRlUxblp4dGVkOXFPdTBVdTZXYVRnUktmQ1orCnAycTZxeWltdTVwT3NjYnFidFYwMHJYVjk2Nm1rd0lBc055NW1rN3F0RVNVQTMrSGFqb3A5U0QwWHU5UlRhZHlNbktuYWpyMS9lVWUKMVhSU3hPQ3M4WHRWMDZsVmN0Mm5tazZxbGs2Mkg5L3REcUNYY3dBRi9jVjBYZDBrMzhYcnNrbWx1RGVIeHNLbnZZcXdDNGdmM01yMQpzcm0rWDkzRmtFN3dsT2ZlL2Vya3JRdHRkRHE1N2Jyb3hGRkprQWtKYXpKVkRRdU5MQ0FvVUpDcGVwWWJsR2hJV2xXQmh1NXl3b09wCnE0WUVLUVlHcGF2dHN0S1FwQk1wWkRXTUFwMFUyaTdMcUV5NGl3azlvalQrZEJSNVJBRkxiS2ZTMkZ3NU1zZDJ5MUpxZEhkem16dmUKUFZjYVRmSnIydHpKZHBlcmFxcFYwdGptVHE2U1Mxc2huYVlFQ2VYOFpLN1IzVzFyVmVydHRIU1pVWXhTYVdwenB4cFJoSVM1dWMwZApiY01vTjdxN3VjMGRWZnVtMHVoTzIrSFJybnFIZTY0QzZUYXV2SWphNnl5cWQwdFIybFU1ay92cVdoNHd0VWVuVnY2VVBlV0JEZXBVCmN3L1YrQk9XMFVIbldURUNyNm1RVGt0R3MwRzl3bEEraVVOemZTSEFvcEIycUNPSkRGSkhOdlFuNUdSdEhiWUFack5kWEU4RUwwMlYKbmJQVTNWQnk1ejJsMTc4ckM3c0UyVkNBcVZUeXdUVm5Rd0ZRcXZsam1yT2hBREJ0R2QzS2ljMUk5OTJsOHZIMm94RFlVVkRoT25CNgo5VFhDMGRUYlZRb0tMN1ByN1I0U2lLQmNWTEpMVmdxcjE3SWpZSm9LYStWNlFJZ0xhOTgybDRXMWI1djczUW9JZ2QybGtUSGlNVEJhCkxjcU12M2ZKa3JJbFJVclZmcTlLT2RTdXl5TmRXSWwzbVVHdDZJbkw1VkRQajZ1N1ZLYXdOeC9ydHlRdVFkWE85K3BnQ0I2OHloOFIKYTViOXRxNUcxWEtuYjdEeDJzM21CQVZGS2F0VEI1dzczQkpBd2JtMVd6VUZoUkZDcVJzTzllV3F0alVVTXVnNjRYVzZKY1N3bzZHUQpRVk1FL3VZT2QweDlwVnlQdXl2RVVDSzU0dHErMWZvNjNDbFZQdDRnaGd5ajBSM3U3dElwVDdXZVNGdW52RnZyaWRoT2ViZUxvVUtICk8yRmRrcGI2a0dzNjNDbjFlNFU5N3ZSM3VOTjZxem1zZnJxOXNQWnp6NWs1Y3Q2cjVzSmFBRXpkekRGb01YU28zblRYRmRhS0t4OUQKdDhhUFlIMWhYYkljV3Q4OVZ3ak9GWHJ6NG80SUNPY3U5WngxVEpzdnBncEh2aFpXVk1Sa1VMdG1BclhMMDFQZkxsWEV4RDhWaFFyQwpjeUdHY1lmS1FtaUlhekY5M3pTV01Xa3BZckkvRHNTZUtHOFgwMUxHSkp5a1N1eVVBOFd1aTJ3WlU5eWhxVUpkMFcxbnBUTHUwQ0tWCldvcVk3SThic2ZGOXJWL1oxVlhFSkpkQkJIc25LdXkwK2d6RExsM0RlOE90L0NMRFVPS3l4RzZQNmdGeGp4clh2RS8rVmpIb3YranQKU0tlcjNTTWlwYnc5MXJ2ZjFWUTlkUHAycHhyWG51elZWUHB0bU1sUlY3dEhsVTU1L2l0clhIbnl5YVpoYUtoNlZxOXhCVVBTWFBXcwpWT05LUjREZ1F0UWkwdmdZMHc5V3ZKVWZXNFVWbnMvNW45NEw1dm5UbThGYVNMdmZXby9ia1RzTVBwVmVVWFVmMmYwa1o0UTlaU3BRCkd3OEs3ZkppeC9RblFSSGVjN3JKUnlxb2h6TllqK1pPNzVVZnFoTDJZWXZuUDNveTlYQk8rU0s4dzNrVXg0VTZXVlNHaDdua2F2L0MKWmt1azZmeVNLOEw3bEVVSzVtSWlkd0hadVdJbGM3OHRpOVJlbWZnV2NuM1luQnhTdHBLTEkvQnJpT0FoRlphbUhlMFJHOWRITUNDcQpjblE2MGg5ckthUUdLeVN3dU9lY29BeHZMSzc5NDVPM21ueVZRUm8yVzRQUGhSRVhneFZYeEEwVmtKWXNZWG1rcFlhNUw0VVU5WDJMCmxnV2xsV0trVGFVK2d0V09QTkppc1UwS01yc0FXZ3Q4N21FLzBVV1laOWVqWDdqNk11OEY4cGpzZS96NlNtemtpbWMxUUhUSHQ2Y2kKdDAyQ09mZUNZcU9UUGF5aG96M0N6VE92RUNkbU56cU5hWk9BcUNFbk9nMFNkREZUVDV6VXNEY0QySS9pd2liVkNJbDhTZEpsYXBYcwprQ0FueXc4cXI2VzBTYjJ3Nlhpdnppd29vS3ZTbVVWckpLbWduRm9sdTNRWG5Wa0FnamM5S1doS1ZYZWlteWR2cUVwVHlkQ2txR1RRCnhrK2lReSs5ODJPajFyRHVUbmVYUlpraFhXUnBpZVZGTTlGMVpXa1pyRXFEa284VDZ4c1MwSmJ5ZVZyMGVDNXlZMFhxcXZpWmNna1AKcjR1WFBWT3VjeVVBN0lxR3E2OVZZckNENHIwdWIreDVqZHB1T05SUWphUVlYdFo2eWpNbzNuSVRMVmVUZUhGbDNGWEZidEpIMXJydQp0UjRVcjR3c0MyL1JoRldBdDE1Q0szVlhuR3k5bUpyWGNubFhuSUlESkIwZkV5YU5TQnl4amtsZC9RN2tOUXg1Tng5NVRJbzF6TFduCjNsVEJuWndjb3hNcjlmWjFncEdKNC96cUlUdlVqMDgycWhMY1h5UVFyS0lIL2ZhSVRPOG4rMk5YL25CUVh5SFpSVCtMRzlxeUtWY3kKNmFxeGl1bTY1NEEzSkZIOXk2eWtGRHRXdGNZRlErS2w2dE9uMVR5cDFWa0t1TEpvS09YazMzT2xVQXFvMXRKWVpmMjRrL2RaU2IxUQpSek16aVBvYVMzYVowUUZNcll1T1hWeGRxd0JNdEt2Y1JqSFZXaDd0a3hTZVhONUlNZFYrT3Jvb1ZndCt5Z0M3S0JlV3NnNXBpbDFaCkJhaTFCbER6UFNSeUJXS2FhZ0FWc3RNMVZBRnFyUUc4akNmcnFRTFVXZ1BJditGUWZ4V2cxaHBBRkxXK3VncFF3Q29LSHFZNEQxWmYKRmFEV0drQklzZXVyQURsNkt1c05ZWTJWM2lwQXJUV0FySTk4VlJXZ3pKQXVhZ0Q1NTVYVWVDNW5kWHRUUHUwZDJXNXB5c2VieXovWQpsTzhpcXZDUE5PVlQ2OGgybjZaOFZNMklzb0Z5ZTFNK2cxWENLcng3VTc3TC9zai9SRk0rK2Y3STkyektwNmwvNVMxTitmaFJCVGlvCnNPeWdhQktwbFFiTGQvVzcvVzZvcDN2Y0RhV3hyNSttdTZGdTd1dkhtOW9kN29hUzYrdW5MMC9wMnI1K3lsMzlycm9iU3FLdm4zSlUKU05vVDE5L1hUNXI1Rk8rR3VxS3Zuem9uMzZPdm4zSm1DQnU1dXJHdm4xb2wxNTBDdW9wZC9ReFdYUUZkMmI1K3lsTVR4UzZ1N3VzbgpHTWhGVjc4ck9vQkk5dlZUbnBCVWh1bzFmZjBreXhHVmJqWFhUaGpObGJLU2QwRmYwZGRQK2VZdjlrejh4cjUraWh0ZEh1MWlkK2pyCnB4d1cxblVEbFVKZlAyVlhWeklMK29xK2ZsSmxrcHpvM2RhUDd3NDE3N3I2K2lsRGdYSCtlL1QxVXo1UU1XaUdjMHZodTdnaTlkcSsKZmhLbUpxK3JINzg3QTNaRFh6K1JHR0xDcm42Q083dDBsNmRnYkY4LzFiclh1L1QxVSs3cXgzTHlqWDM5bEJPdWVSV3BOL1gxNCtxMwpwSGhSZE0vVjFYMzlsQW1JTE5nNzlQVlRrTFhqS25DbmZud3VaU2lhKy9HcHRKUFQzSS92cHI1K0xCUko4ZEZielhIUjEwK2g3a0UxCjIzYXV0Nitmc2lVUGJ6eTRSMTgvdVQyOGMzbVNlRjM5bGdaem5qbEpWQk5EdGI1K3l1Zk53aXlDNi92NkNha3Q5Zz09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJRnEvdHg2Y3ZTVU8rSDk4ZHhJZnQ2bmQ3UHo0dFJVeHF0emRjNW1yb2E4VW5ya2k5cmErZklMQjkwZFdQcWhpNnZhOGZXeXFsMUZmMAo1cjUreW1hT0RJL3A3dXVuM05YdjVsdWI2TDUrTjhiNk5QYjEwMUQzZW9lK2ZzcGQvWFQzNDd1cUNsZWtMUy83K2wxZkRNL3I2c2ZECmNsTmZ2OHRRTXIrcm45d3RaM3I3K2ltbmQ0bDJzYXY3K2lrbk9vbGlTbGYzOVpOWUYxNVhQK1Y3NGJUMzlicytiaW1rbVA2YUp4bS8KOG9hK2ZwemlrdXJxZDNYMm9LaXZueUpIOERxQTNOYlhUOWt3cEx6WDIvdjZLUmZFMGp2eXpYMzloSk1VZC9XN3NNYzAzMlFsN09zbgpid1JSTm96S1RWWWErL3Bwc21GdTd1dkhYOG5MQXh5RjZsb1orWlR1NjZlOE9TaFdjZDZ0SUpiYTkvMFMyME5meVVaN2FVdG5mSWp2CmxWcFNOeXFLOWtyd3JYeG9Wem54WGxTMktPQW1oc2U0MDV2VTQ0NWZCMC9GcG1oVURzRU82ZHR5aE1IOEwvTXdTODluZ1NkYU84TGEKTitLNE5JSnQ1Y25vL25pMllQN3VLa0s5Qk91cGpKWjZxdUxESEJ1amYvcXhDd1lPeXljeXRmNktOZG91aC9mUGFjL3RjMWg1OFp3MQo3OCs1c1BGelBBdUFUNk9NTlJSTmxHMzFsMzB6dEYvMVBneldTTWdYbkViclpOZFg5UjJNb1ZvcE9NbzFWKzMwN0swZWZsKzI1cytoCmZjY3gvN2E4WjUzQndxK3AxYXl1NHV0a2R6dFBPemI3WVdSdlBXUTI0V2ZqKzNQYWJnazRTbUhyOTBlbDRqd3Z6Ui9CN2VjOFRzcysKcXUxTXRWdHZIYVBQUGNnWWljVys0MDRHN0JtTXpGVnpHUGs5ZmNKS1lWdnpjQmpGSElkajlMMXlOQS9DazJObzh2SEtWbHEyM0k5Kwo3N3N2VUl1Wm1MSzNYLy9oK0xtRnplWmlacXEyK2xLSENPcExFLzNhTUphZE5uYlFvV1piUU1KK2t1Y1JiblZsTTdVbktXSWhZb0RwCm5teHdYUUlXbyt4Y1VVV2pZMnlmdjVvNy9WYktzam40U1JzUlhKek42NWx4Qml0Sm41amlVT1Bac3dzK3czeTErZ2JWSkJxelpLdGwKeFN6ekdmTDNYN2RDazMwbkVoOHd0ZGM4cjJpT2k3ZnlwZ2JVbWhRZFVtRnIvbXl3RnZya3ZJc2FhT2EvU3MxdStEay9NMlg4cCtSVAp4bitjSmNpWWVmVmFmTThFQm9Cc20xUnAzZWwrWnN0aDR3VEE2ZXdac0ZUN1RBZnVYa1ZnS1dOdmtFblVqQWMwcSt6ZkZuSnl0dnIrClBuUVhPOTB5L0FRbS9McjJ3YUpkRCtYV3AwSzlBL0tjTVAvSkFiTVJoaWRLRS90RFBqdnpDWGVnMkRHZ1NHUUQvb3k0VU5VdlVEaVYKSGZqejBZTTBqTmtPZHJHUEEvZ2k3Mk4rU1BySklsR1BBckJsekYzd1dNK2tvMXlwNEI3NzhxODRYZTFqbUQ4VmNhS0J3c0Y5NGE0OApuc2ovalAwNGVQRG81ajBZVy9LUEJpdnpLTy9sSGhHNWZqdk5QS2l3K0twOGZGNUxaY2tRNXRrSlZNWjJoWmRxcGpIN25adDcyV0RGClN3UGZsSDNrNWNFcDdlSVkvTTVQMjBlaFp3eFdHZjNoNVhDTmdIOFNGT3pKd01yQ2JyaXBWeVk3SEZyb0RTOHZCbXNoN0NrSFRMZHEKK0tpWHB1RThoTlBBWUhMWUFaK1dYOUNmTk5ocC93T24xNnBIdXYzMXQxVUFQRzE1MEZQQ0dZN1BHS1F0SDRNRmMxcWlHTEYrc3hZOQpNU2ZnRHF4ajRmdjdJd2Q5TEVjeHcwWDhpQTc1QUloK2l0a2w0QW56eHJWRHhIZ1FjYi81bUhTM0U0ZHdxaDE4emthK1pnNG9kVG5DCjJYOHpJbGFCRk90OUVPekNqd0tXWkhKRURwMGZWY0o1bnEyWXFiOTd1QVVqQ3VWSHlOUHZQb3BFaFg0Rmh4dTVoU2hNWDBMMHAzV2IKb0QrZFB3YTBiVWtVbmVNaC9ZbFloQ0NJRUFWaTJNOUFpSDBmck5mWUVzTjFEYU4rUFR3M2FkZ2paNWZsdGo3Qkc4MG9NZnRGRHhERgora0ZXS2llOHVZemVqWG00MHlSZ21rSXp0L1l0WE5uWDZYZXRVSzBZM3poRndoN201Tm5nZ0kwWGMrQk9Fbk1CNjdreVo4Yno1VWZUCkNOaUlkaENOTm1CTGZJVG9UNFh4RC90ZWdINnY4NWNWaitZbDMvb2lDMnZUTk50c2Zkb04xdUxFbTNtSG0zVVM1YlBSc24vYWhTbFoKRkpvT3drTmdtMEJ2c21ydFVtOHl1eGpVbkNLOUdmOTYyVHFLNzduNlU4NjVQc0JMQ3NMbFhCSHp0UzcxcHJqdHNCMU5IS2kxS0xxaQoxc21lOFFIMVQwK2p1M0pUcTVyckRvNllmMlh5K1g5TXI3YUFKZlozd2pDSDcwanJNYUF0VVNJNGlyZUNQNE5PVk9hTUZ6OHo4TSs0Ckd3YzdSd29xUXVnak13di9DWDdUZ1NxbDdFTjJIVXk5OGFGSUJGUkNNTkpROXN2RWxNcVl4T3JEQjFVSHpIM2R3em9MYkROaUZyVHEKb25TSUoyK2RzTjk1Nk8vYU9PVHBLdUNOU0tlY0g2MnlNNEZXcldGWWFGS0ZDMUhGK2Rvd3R3OGpPM254QW5VZlFORGJvcTBGVHYwegpDNy9ER2ZPc0ZxRXBVU0s5NkJYZ3lUWDM0TSthbjRFTmRTa2NEZENsbkxLbU5CK1lDMUNwWHMyc1JGbDRGeWNNZEhSRjNLQVdOYlIrCjlQL1NjWDdFYU5qY0ZQSnpaaVg2RHQ1YTBNQm0xazBCdkg1dzg4MGNCQ0taZnVNQnFIeDZmRUlBeTFSNzZLTHkrcG9uYUdDMkJSZEoKMUk3d096UDRMbnFtckV4Ym4zamltZHFVMlpWOEtiSUFHcGNBemhRQU1CY0tSTmxXNWx1OWdPZmQ4RVlFdEFiQUVIOG1ZSGtyMkpnOApaVGY4NUdPLzg3UGZnWFh4dk8yaGZYQ2dtQjJ3ZlorM2k5azQyd3YyekI0eEp0WWp3VmhYd0NpYldKcWZ3R0FJbHNROW8ra05BMDZJCnVtNGladVI2UjhOZTVFYnFKb29lc2pQcHZ0M3I5alBmQndGYko3MHVPV2ZWemR4dFVmN3ltWDdiWUFadUVpRDFlWkZZWDE1NlFWZjQKTWhRTFJGNVd0TlZMbkhITzRFWE53cUhiWUdKR3c3c0R4TVVqd2NjaE1PRmRRY0tTd0pudnp3YW93ZzRSd2VjVkVBRVYxMUZFR1BDSgpRQ3dhaUFqd1FaOVBBbEhyY2lEeEhBbTRmdUpDSW95VHp4d1JBaDlyUE1wclp2VjFuUGo0U0duRC8wdVdCT0srMVQ2Tys3dkdyYjlJCkVlR1E2MzFvNHdOME5UOWk3TE9SSTRIQmFnd2VQMndzRWJvS2ZBQXZMR1dvK0NuRlNySUF1RHlsM2s2Wkc5VjRFVWFKNWNZQTVVWEwKTklhSEs2ZkJSRWhRT09LMmFTd2xWNE5iQzBvcWxhYngrcm03amFkZmgzdFdXNHBBYUtNRUFERS9LazhEQUhCWkVDY3pJTkw1L1ZZQQpZbXRVSDRPaWRqcVlFQUJFc2Q0ZkJ3SXIxM3RUL3B1OVQ1Wi9lN3lGeDhpdnNqRG04dnAzTTQraDY4QnY0N0g1NlJZUUFNRGFlRE9QCmRUWTM4bGh2Szhkam1rRk1EdW9NMGhmdzJNVTBsamVTOG5WMTVuanNPaEM5b1FaeDdUTFJIbWtRRTNuZHAyME1jeDRwS1lycFhZM2UKVWwzaStXTUFjN2tZeGVyRzFlaHR6aUpTTWhUVFBvMkRpbXhJalVGUW01RHFuVTIzTVhiZmJGYmZrWW5qSndmQ2FPOHMzL2dnSnBOcgo5d0IyUjU3TTkycVVVQm5EVWtZK3dSaDQybEtKRXBQVjhWWnRPZG1jTk94RUN2dlFaSDlXSG9PNnRweWNqZncvcDJhVDRFK2JtWWwwCmxpa2ZFaDdMeFhoaGI4ZUhLd2hXM3pPY2RZMmUvYTVtOU5TN0w1UVJDSDdEUmNxNjBPTUw4MXd6bEU4eFAyV2l5QzVsWXpnRG5qYzUKdHZ4OVVoRVErMk12Uk5XOVFxOTc2SUcraXBlSlZuNGU0WjlzQUs1c1p6ODVLTWR1Zmx4QmE3eE0rYnZ3NE4rRHZHNzZ6N3pQUjduYgpURTR2OUxCWmR6eVE3dXh5ak5zYmRMREJSQ2MvZUJrN3NjRzlxcHYvb09abXc0WlZyeUNpNkJsRTJCQk1sY1AzRmJBa0Zsa0czd3ZPCkVZWU9VWlFlWGR4My9PaG9LZS9oUFJCRVIwc1ZId3dPdVFEdFB0MlVyLzExL0FXOFUycmk2TTlBdW0wRWY3NW1PTmhET216eFNpSnEKdTRDL01NOGh0d0NlMDBBdm9SWUZWdnZMQWNyTDY0c2Z4alk4QU1IZUF2NXNJN0F1S2lUaWYvMElzSkZKdHp0bFRwcmhVemRBNEFORwpTNi9HaFc1SERKWVJvSEc0N3kzNHgwbGJmTEd4dHcxV01sa00vdkxDNjFUd3ZkUnQ4SS9mbVRONDlyUW9Cc2E0eVV0QmxJSkg1U21wClFHUnV1a1FRblUvUlJpeGFJalAyZWF0UW1UMGFhYSs2MThVWlZtbnhBMzdPOVJEc2xYU0VxRGNPc2xNZkF5eW5HTDFna3hjVUV2SFEKNGZWSjIwOEhlU2RkREovVUtrN3c2UU9uNDFHVEFaR0tWUWl3VnBOeGdQazBDMUlSZUErOXRLc21ndWhGUitUZ3p5NFRsRnQ5WU15bgpBY2R0RThLZXJxWG8wYXhtQWQ2RGdURXdwT09TOWIyVm5jdnFMNHk4dGtBdUdvZ201Z1BuZDM0WkpsOXk2Nmc1S2hWcG9TYkUvVU5sCmJIT2htbFBYeHlLZG9vdzd5Q3luQVlhWDhJd0RmQnJqektjWkZ3S2Uwa0drMDIvd1lqU2hVNGQwT1ZPSlNNZHJxcE9qdWpWR0JVTnQKdzJNRWV5cTVRMGoydjhLMExIWXhNM0pTbGVPRCtxT0RMTVYweEFmMVJ3ZWw3dXRUaXcvcWp3NUNpdW1ORCtxUERsS2NyQzgreUk4TwpadjhyWllqaUVmd0IvZU52bnRmenc4dmhaL0d6ZWZBWUVnWi90b0xqN2Mxc1N4N204OWI4ZjUwSzIrbjViNzQ1UGNRZi9ObTNmS1VTCkRSWG0wKzFzL29DU21VS2pDS3MydkRTMzB2ek5QOUlXaEJoUnNEeFgrSTZWVm1WejgzRmMrTVo2S1o1WVVGYktyclUzZXBhL1piQ2gKdXFjK3RLdCtHRDBFK1daMGxJOGUrR2VQMnVVcElra2VyQ0t0NURJWDVvZmN1ZWl1MTk1RnB3UW9HQk1idFVwZ2V5aSs1K2JOalArNApTUHJMMlg2MTBDYzdieG4vQ2RzeUFVRjRuaW5JSHVDZGVrc2NrZ05ENW1Rek9wUFBRYVBYYisvQXcvSUNtSXVsRVBVYlBjNU1Cbjc3ClpIUTNUTTl3ZnMvd1Fkcm96UVptMEdvb0cxMTdNekRMeHZzb1gxWFlDRGN0Y3R4V1J3Nkh6SEsvYnBHYU5WRG54N2huc1VpaFl3TmEKWDBMeFF5Y1pqUGo1MFo4d3BkRkJmL3FkSStQQVNWc0Q5ajFzSVZOMjAzL0dIVjdLa0tHQ3p2Q0dHQnJFZHp0K1lpUzVnbkduajN3OQpydU1va3p2SU5GaGxqeks1QnplYkNkUXg4SUNQK3g4d0UxQmFIbTBvL0hObWdzR3F2SzNmeDB5Z1F0dWFJVjVwSmdCRGh6VVUvamt6CkFSbzZqS0h3ejVrSllDNnNvZkRQbVFrOGVabitjMmFDd2NvWkNtSXpRVGtqaE01Q3JNWGxOZ2RhL2J1K3lETjBwWmEvd0pYcURJcEEKS2I1M2pjN252b1BXbStmNEsxU3BaYUJMMHkyajgyZWRNbm8zalUrb1MyTndYN0NJM1N0cXdSNTdsS29EUXBOMUlJSGpEalhmZHZSTAo0NzJYU2Z3SU9yakVEelpYdzA1NWYwQmJ1bWx0Q1U5WWVOcVMzc3J0aEQxai9FTExEclZsM3VkQnQwOFRYK2RreGYvVFBma293K1BICkUzZWp0QzJneDRwUFVrWG53Tzk2cm9wV0h6NW9BeXlSQTZkYUtUMzJSWXVBU0sraWJCU2dVdUhJSFBBNFk1VmJtemFrMFBuQ09CdUcKNyt5VjRrN0lHM1ZrakNBRE5FcWQ1dU9sdGlQS1dqRzBTVlJhQkNIRm5uMjBSV0xKK0F0UHlTMEc0THhnbFBMa2FleFNtMEFMQWY1eAo4NnA2MkRSVzdpUVNLSE51OTBXTWVGR2d3WjcvaTFxcVVtbHB4VUZJZERqSXBlVlI1NHRlL3ZuaU5Gb1ZuUzhhalNjSEd6ODd2bDZjCkx3WmRKVit3bkdXTzJ4NjNUT3Ntd1VHb3Q4NGRCUkdPV0M4Z09BZ05tNDNXbktYQWdKamFMazVTYzM0ZUFKenNsbkIwNEVzbk5OQmkKRHpnZG1leituMVM3aUl3RHlHZ3B4T2ZNZDUwOTgxM3Y0UDk1MmJpNVJBdkVjZ0p6bnc2dENNT09Xa04rU0lYQkNkSG5udlQxK3E3TQp1MnZNSEVFaU81bytmVE5ZeFllUTZGYjA2NDhnblZLbmJ6QWtwUG44RGI4NVZMZUs3aGdpWkFJOElxQlRZWm9JUVQ5SEJEaWFGZThJCkV0MmtKMGNDSm9TYWpxODJEQkZjb2lOSTc0MUgwWThuN25oZWU5aVZ4d2ZwK090SncxRTBuV0lvZFJoTkZ4WlRWRVRueDFLc3BIQ2EKVFpkRUFnQmc5VFZ5NHdVSTFOUk4yeGlvMUp4TEVLZ2gxUzNUUUFuOGpFanhqclIxVEtNZDkrdEtETGlVU2svczVMcUZwNkZMN1JZQgpvQ21tbFJMUUEvZXFUZVB5YUo5ZkpJTjdkbmxNY2hvYVNRbFRLSEVFNEdncWxYTnV0cFdId1FvVEh2YThONEhiNzZUZkpIOXh0MFRUCkQ1clB4MFA3alR3R0RCVEhiVHhXQy9vNEFMSThwZ2hpa01GdTVUSDcwbkViajJFYnB3eVBhUVpSYzN0VUdZUVBBQT09DQoJXV0+DQoJPCFbQ0RBVEFbDQoJVFVMSVk0T0k3NWJWQVA3OG8xOEtBT0F4clNCS05aTzZ1RW9Eb05OWW9jR25XZmRKajJIZ2t5WWxIQU82bEZ4MU5ZQ0JxU3J4U21PQQpTY3k3K0cyckFhMWFaVktpL1VWcEdtVXZxVTgyTHNZUXJ1SFFHcjlCTnNycEpxRXloa1BLai9OMjVITHc1R3NuZVNBbUErdHRlOEJrCjRYWXpPN0xpS0JUR3NNUGxtVW8wQmxyMnhhT1lXaUxlbXpoaTZuMzAzWlprQmhQY0pVVmNkZ3lzdGtRSm55SGNnWXhFcnY4WVFoLzEKR3FmQlF0bzk3QmJPNDFJdC8vVVVNOU1oZzFDR2lTUlJJZjZuUDJHZU9sVTZZYkJLRlUvY3UzUUNZcmtzbnRCZE9zR0dRNldQSmRHNgphRHFZRkI5TDhoN3M4Z3YyZ1NpbUR3T296ekNxd1B1MjdXQ1BEWjQ5L0FlTElGdVRBTDFsNENWQnZVS2x6RVAxQURrWm5RTnNrYVRDClB4c3V3ZEVwa0IxSTJ3YnRlZ01tanRQZWhxZU96c2R6a0M4aEt6WDhkQkZGdWdMSjFxREJUaHR0QkRiQWl6S1dod2Y2Z05ucERWTFcKZU12TFA3aExaeEs2ay9BdkRtRllMNTV3bHNrazVTWGREV0tqOXNpZE5ZUk9yNVo1NmFzZlhSaXMyYmV6NWFmWW43M0NrNk1XenZFdgo4WFVlWk9pWVJHOFFZRU9SUVg3QlJEckNzc3E3bDY2YWFPU2hYbm4zTTJ6L2pxR0VoaS9vY3I3alRIVHBIWjBTd05PRTl3RDdLVWlCCktDYit3dURQUGcxeE9FVUwzMmVQOGZzWSt3bm5yejY4VTV5dFNlZ0grTFVVaFpXRmlUTCtocGk1OU1PeVZTcHV1Um9WQTMzQkNWZXYKd3E5UytmSnhTQU0yNXdzazZoZjRwL2NPb3c5Zk9QdUo0TDlYWHdUaGQwRnVORUQybWZFMHlGR25seSs0bzA2U0xOWTdVU2E0K1JmQwo1cE40R0hLb2o0MVQ5S2txeVA4ZjYvc2ZHK3ZiL2xmS2tBQ1RxZUQ0c0xpWjhjOGNEVllyK09adGZqcnY0QXVoWVc2KytOblV4ditaCkh3ejRBL1VmQnY2RC8wWmlEemdSZlNCQ0lmQkhDSDVibXhnYzZOMEgzUGxRQTd2TDBKODluQW8vMDlQUGRqTSsvT2NoRHIvcTFtdnQKU3VFaC9rQzlPd1R2Smg0Y1lEVFlFTHdOSGpuaFFlY1FqSEJvd0I2eTRIL2RmeHZPNEQvczRjV0FQV0QwQU9CLzNiRUJvMGNFM3ZvUAorT01KZlBnRlgvMzdBY2NlNmc4Zlg5akRESXk4MnpRRVlnOWVISC80b3o1Z0QydjBJZW9MRVRFd2t3RDRnTWRDNEl1SFFBVCtPelVFCjRQK3REYmd2R01FSUhQNkJVKzlqR0FFL0FoaFRBNDZBcnRIL0U3NVFNQWJlb2wveDRvR0hBUG9Yd0lxZ0R3QW5BRUE5aVZHL0lCN28KZ1UwTjM0WTJuSjh2QWdrS1VhQVpnYUdqMmMwTTRRZUg4Nkg3emxBQ3ZBZkhoZm5Da1ZnNEdrQWZNSUlnd0ljWWhvZURERmxFTk9LSQpnZEhFaU5HMGlJaHBFVUcwaUZDMGlQQnBFWUVFaUhDMGlOR2t3R2hTNEdKU0VJZ1VCRU1LZ2lNRlF3Q1dGQmhOaWhnOTNiWTBIOUg4CkFjakFYLzlMYWxtSDdHU3BqM0M2MUNlRkNZTVhxQ2xiaDRxVEJvL3BhVk9mRkNZT1FESlRCeDhWSm04ZHlvbE85bkFZVXgrQnZEeGsKejZmdFEzTjhQTTBQUC85Nzduend2NTBPUDVzRkpUMUFvbWJieVh5WXJjU0dMNVBqL1BDditXeFluZjluU0wxMDVBa1pEdDdkYkRjUApnWENBNWk4dHNzYnlFZUE0aW84SW5HWWtQQVlKRytYb2lzY1FZZkVZeFVwNGpNOUw0QytjL2czOFFPQVVMeEVFeFV0RVFFUlNJZ2hKCkN2NmxlQWw4WUhnSlBvbFJ2NEJvNmNIOXR3c1d3V2daZ3RFeWVGUk1FRXJONExTZXdRV0tCa2VhQnYwR0VZVFdNd1N0WndpeG5pR1EKbmlFWVBVTndlb1lJMEVUZ0VRVC9KOFFMVFpuK2lMSHlwVGh0SkdGbzRqd1JrNW82RWl3MGVlcVR3dlFwRVVNRVlFUk1qZ1QvdzRRcwpFS0I1S2tEUVBCWEFJSEVESEhFREdDSnVBS040S29EeGVTb0F3YUxmd0hkeEJBZHhWU0JBY1ZVZ0tDSnJJQVRKQ3Y2bHVBcDhZTGdxClFKRVIvb0loYVNEdzN5OW1BVWJ2QkJpOVE4UkVKQ0VvdlVQUWVvY1E2QjBDNlIzNEc0WWt0T1lKMEpvbklOWThBYVI1QW96bUNYQ2EKSnhDa3ljQWpDZkZQQ0JxYU5QMFJad1ZOY2VKSTBJaVlVTkNrSjQ4RUxFQXdvcVpFQUVyVUVBa1lVWk1qd3Y5dFVhdmxLRnNXV0xiSQo0dlFDLzlyNk9sN01XNGZ4enhwWXRvdmorRi96aC9GbXN6Mk5UL01kZVBLd09NeVBwKzFoL25CY2J2OE52d0UvWVY0SE52SUxhZmcvCndrbmVyZz09DQoJXV0+DQo8L2k6cGdmPg0KPC9zdmc+DQo=);
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ background-size: cover;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ overflow: hidden;
+ vertical-align: middle;
+ width: 1.3rem;
+ height: 1.3rem;
+}
+#download-btn {
+ display: none;
+}
+/* Content */
+#content {
+ width: 100%;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 20px;
+}
+/* Code */
+#content section.code {
+ display: none;
+ background: #FFF;
+ border: 1px solid #E0E0E0;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 15px;
+ font-size: 12px;
+ -moz-border-radius: 1px;
+ -webkit-border-radius: 1px;
+ border-radius: 1px;
+ font-weight: 400;
+}
+article.component {
+ padding: 0 0 10px;
+}
+#content section.code h3 {
+ margin: 0;
+ font-size: 12px;
+ color: #000;
+ font-weight: 400;
+}
+#content header h2 {
+ font-weight: 300;
+ margin: 10px 0 25px;
+ font-size: 20px;
+ position: relative;
+ display: inline-block;
+ padding-right: 10px;
+}
+body.light #content header h2 {
+ background: #F4F4F4;
+}
+body.dark #content header h2 {
+ background: #4A4D4E;
+}
+#content header{
+ position: relative;
+}
+#content header:before {
+ content: '';
+ width: 100%;
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 23px;
+}
+body.light #content header:before {
+ border-bottom: 1px solid #E0E0E0;
+}
+body.dark #content header:before {
+ border-bottom: 1px solid #58595A;
+}
+#content pre {
+ padding: 0;
+ margin: 2px 0 10px;
+}
+.showcode {
+ margin: 10px 0;
+}
+.showcode a, section.examples a {
+ color: #288edf;
+ text-decoration: none;
+}
+.showcode a:hover, section.examples a:hover {
+ text-decoration: underline;
+}
+section.examples ul {
+ margin: 0 0 20px;
+ padding: 0 0 0 20px;
+}
+section.examples h4 {
+ margin-bottom: 5px;
+}
+section.examples li {
+ color: #58595A;
+}
+/* Side Nav */
+#sideNav {
+ background: #4A4D4E;
+ position: absolute;
+ width: 100%;
+ z-index: 1;
+ height: 100%;
+ left: 0;
+}
+#sideNav ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+#sideNav li a {
+ color: #F0F1F1;
+ display: block;
+ height: 46px;
+ font-size: 16px;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 12px 0 0 20px;
+ text-decoration: none;
+}
+#sideNav nav.site, #sideNav .combo {
+ border-bottom: 1px solid #58595A;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 10px;
+ display: block;
+}
+#pageNav li {
+ border-bottom: 1px solid #58595A;
+}
+
+select.docNav {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ background: #595B5B;
+ background-image: none;
+ box-shadow: 0 0 0 1px #303233;
+ border: none;
+ border-top: 2px solid #666767;
+ color: #FFF;
+ text-shadow: 0 -1px 0 #000;
+ overflow: hidden;
+ font-size: 14px;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 20px;
+ -webkit-appearance: none;
+ -moz-appearance: button;
+}
+@media screen and (min-width: 650px) {
+ #site.open {
+ transform: translate3d(0, 0, 0);
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+ #main-header nav {
+ display: inline-block;
+ position: absolute;
+ right: 0;
+ top: 40px;
+ }
+ #main-header ul {
+ list-style: none;
+ }
+ #main-header nav li {
+ display: inline-block;
+ margin: 0 18px;
+ }
+ #main-header nav li#download-btn {
+ display: none;
+ }
+ #main-header nav li a {
+ text-decoration: none;
+ font-size: 20px;
+ color: #7F7F7F;
+ }
+ #main-header nav li.selected a {
+ color: #373435;
+ }
+ #slide-menu-button{
+ display: none;
+ }
+ #main-header hgroup {
+ text-align: left;
+ position: absolute;
+ display: inline-block;
+ top: 24px;
+ }
+ #main-header hgroup h1 {
+ font-size: 60px;
+ }
+ #main-header hgroup p {
+ font-size: 15px;
+ }
+ #main-header {
+ color: #373435;
+ background: #fff;
+ height: 148px;
+ }
+ #content {
+ padding-left: 240px;
+ }
+ /* Side Nav */
+ #sideNav {
+ background: transparent;
+ width: 220px;
+ z-index: 20;
+ left: 10px;
+ top: 150px;
+ height: auto;
+ }
+ #sideNav nav.site {
+ display: none;
+ }
+ #sideNav .combo {
+ border-bottom: none;
+ padding: 36px 0;
+ }
+ #sideNav li a {
+ padding: 12px 0 0 10px;
+ }
+ body.light #sideNav li a {
+ color: #797B7B;
+ }
+ body.light #pageNav li {
+ border-bottom: 1px solid #E0E0E0;
+ }
+ select.docNav {
+ background: #595B5B;
+ box-shadow: 0 0 0 1px #303233;
+ border: none;
+ border-top: 2px solid #666767;
+ color: #FFF;
+ text-shadow: 0 -1px 0 #000;
+ padding: 3px 20px 4px 8px;
+ -webkit-appearance: none;
+ }
+ body.light select.docNav {
+ box-shadow: 0 0 0 1px #949696;
+ background: #DDE1E1;
+ border-top: 1px solid #FFF;
+ color: #454545;
+ text-shadow: 0 -1px 0 #FFF;
+ width: 192px;
+ }
+}
+@media screen and (min-width: 880px) {
+ #content {
+ padding-left: 300px;
+ }
+ #sideNav li a {
+ display: block;
+ height: 60px;
+ padding: 22px 0 0 10px;
+ text-decoration: none;
+ }
+ #content header h2 {
+ font-size: 28px;
+ }
+ #content header:before {
+ top: 30px;
+ }
+ section.code div {
+ display: inline-block;
+ width: 48%;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ }
+ section.code div:first-child {
+ padding-right: 5px;
+ }
+ section.code div:last-child {
+ padding-left: 5px;
+ }
+ .max-width {
+ max-width: 1180px;
+ position: relative;
+ margin: 0 auto;
+ }
+ header#main-header .max-width {
+ top: -10px;
+ }
+ #main-header nav li a {
+ font-size: 22px;
+ }
+ #main-header nav {
+ display: inline-block;
+ }
+
+ #main-header nav li {
+ margin: 0 25px;
+ }
+ #main-header nav li:last-child {
+ margin-right: 0;
+ }
+}
+@media screen and (min-width: 940px) {
+ #main-header nav li#download-btn {
+ display: inline-block;
+ }
+ #main-header nav li a#download-btn{
+ position:relative;
+ top: -15px;
+ display:inline-block;
+ box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ background-clip:padding-box;
+ font:inherit;
+ background:transparent;
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ user-select:none;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ overflow:hidden;
+ font-size:16px;
+ line-height:3rem;
+ letter-spacing:1px;
+ color:#454545;
+ text-shadow:0 1px #fff;
+ vertical-align:top;
+ background-color:#e5e9e8;
+ box-shadow:inset 0 1px #fff;
+ border:1px solid #a5a8a8;
+ border-radius:6px;
+ margin:0;
+ padding:0 1.25rem;
+ }
+ #main-header nav li a#download-btn, #main-header nav li a#download-btn:hover {
+ border:1px solid #143250;
+ background-color:#288edf;
+ box-shadow:inset 0 1px rgba(255,255,255,0.36);
+ color:#fff;
+ font-weight:500;
+ text-shadow:0 -1px rgba(0,0,0,0.36);
+ }
+ #main-header nav li a#download-btn:hover {
+ background-color:#2f9cf3;
+ }
+ #main-header nav li a#download-btn:active, #main-header nav li a#download-btn.is-active {
+ background-color:#0380e8;
+ box-shadow:inset 0 1px rgba(0,0,0,0.12);
+ }
+ #main-header nav li a#download-btn:disabled, #main-header nav li a#download-btn.is-disabled {
+ opacity:.3;
+ cursor:default;
+ pointer-events:none;
+ }
+}
+
+
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/prism.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/prism.css
new file mode 100644
index 0000000..b508b61
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/prism.css
@@ -0,0 +1,168 @@
+/**
+ * prism.js Twilight theme
+ * Based (more or less) on the Twilight theme originally of Textmate fame.
+ * @author Remy Bach
+ */
+code[class*="language-"],
+pre[class*="language-"] {
+ color: white;
+ direction: ltr;
+ font-family: source-code-pro, Consolas, Monaco, 'Andale Mono', monospace;
+ text-align: left;
+ text-shadow: 0 -.1em .2em black;
+ white-space: pre;
+ word-spacing: normal;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+pre[class*="language-"],
+:not(pre) > code[class*="language-"] {
+ background:#181818;
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ margin: .5em 0;
+ overflow: auto;
+}
+pre[class*="language-"]::selection { /* Safari */
+ background:hsl(200, 4%, 16%); /* #282A2B */
+}
+pre[class*="language-"]::selection { /* Firefox */
+ background:hsl(200, 4%, 16%); /* #282A2B */
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ border-radius: .3em;
+ border: .13em solid hsl(0,0%,33%); /* #545454 */
+ box-shadow: 1px 1px .3em -.1em black inset;
+ padding: .15em .2em .05em;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: hsl(0, 0%, 47%); /* #777777 */
+}
+
+.token.punctuation {
+ opacity: .7;
+}
+
+.namespace {
+ opacity: .7;
+}
+
+.token.tag,
+.token.boolean,
+.token.number {
+ color: hsl(14, 58%, 55%); /* #CF6A4C */
+}
+
+.token.keyword,
+.token.property,
+.token.selector {
+ color:hsl(53, 89%, 79%); /* #F9EE98 */
+}
+.token.attr-name,
+.token.attr-value,
+.token.string,
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+ color:hsl(76, 21%, 52%); /* #8F9D6A */
+}
+
+.token.atrule {
+ color:hsl(218, 22%, 55%); /* #7587A6 */
+}
+
+.token.regex,
+.token.important {
+ color: hsl(42, 75%, 65%); /* #E9C062 */
+}
+
+.token.important {
+ font-weight: bold;
+}
+
+.token.entity {
+ cursor: help;
+}
+pre[data-line] {
+ padding: 1em 0 1em 3em;
+ position: relative;
+}
+
+/* Markup */
+.language-markup .token.tag,
+.language-markup .token.attr-name,
+.language-markup .token.punctuation {
+ color: hsl(33, 33%, 52%); /* #AC885B */
+}
+
+/* Text Selection colour */
+::selection {
+ background: hsla(0,0%,93%,0.15); /* #EDEDED */
+}
+::-moz-selection {
+ background: hsla(0,0%,93%,0.15); /* #EDEDED */
+}
+
+/* Make the tokens sit above the line highlight so the colours don't look faded. */
+.token {
+ position:relative;
+ z-index:1;
+}
+.line-highlight {
+ background: -moz-linear-gradient(left, hsla(0, 0%, 33%,.1) 70%, hsla(0, 0%, 33%,0)); /* #545454 */
+ background: -o-linear-gradient(left, hsla(0, 0%, 33%,.1) 70%, hsla(0, 0%, 33%,0)); /* #545454 */
+ background: -webkit-linear-gradient(left, hsla(0, 0%, 33%,.1) 70%, hsla(0, 0%, 33%,0)); /* #545454 */
+ background: hsla(0, 0%, 33%, 0.25); /* #545454 */
+ background: linear-gradient(left, hsla(0, 0%, 33%,.1) 70%, hsla(0, 0%, 33%,0)); /* #545454 */
+ border-bottom:1px dashed hsl(0, 0%, 33%); /* #545454 */
+ border-top:1px dashed hsl(0, 0%, 33%); /* #545454 */
+ left: 0;
+ line-height: inherit;
+ margin-top: 0.75em; /* Same as .prism’s padding-top */
+ padding: inherit 0;
+ pointer-events: none;
+ position: absolute;
+ right: 0;
+ white-space: pre;
+ z-index:0;
+}
+.line-highlight:before,
+.line-highlight[data-end]:after {
+ background-color: hsl(215, 15%, 59%); /* #8794A6 */
+ border-radius: 999px;
+ box-shadow: 0 1px white;
+ color: hsl(24, 20%, 95%); /* #F5F2F0 */
+ content: attr(data-start);
+ font: bold 65%/1.5 sans-serif;
+ left: .6em;
+ min-width: 1em;
+ padding: 0 .5em;
+ position: absolute;
+ text-align: center;
+ text-shadow: none;
+ top: .4em;
+ vertical-align: .3em;
+}
+.line-highlight[data-end]:after {
+ bottom: .4em;
+ content: attr(data-end);
+ top: auto;
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/topcoat-desktop-light.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/topcoat-desktop-light.css
new file mode 100644
index 0000000..6735055
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/css/topcoat-desktop-light.css
@@ -0,0 +1,3700 @@
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button-bar {
+ display: table;
+ table-layout: fixed;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+.button-bar__item {
+ display: table-cell;
+ width: auto;
+ border-radius: 0;
+}
+
+.button-bar__item > input {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.button-bar__button {
+ border-radius: inherit;
+}
+
+.button-bar__item:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button,
+.topcoat-button,
+.topcoat-button--quiet,
+.topcoat-button--large,
+.topcoat-button--large--quiet,
+.topcoat-button--cta,
+.topcoat-button--large--cta,
+.topcoat-button-bar__button,
+.topcoat-button-bar__button--large {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.button--disabled,
+.topcoat-button:disabled,
+.topcoat-button--quiet:disabled,
+.topcoat-button--large:disabled,
+.topcoat-button--large--quiet:disabled,
+.topcoat-button--cta:disabled,
+.topcoat-button--large--cta:disabled,
+.topcoat-button-bar__button:disabled,
+.topcoat-button-bar__button--large:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+.topcoat-button,
+.topcoat-button--quiet,
+.topcoat-button--large,
+.topcoat-button--large--quiet,
+.topcoat-button--cta,
+.topcoat-button--large--cta,
+.topcoat-button-bar__button,
+.topcoat-button-bar__button--large {
+ padding: 0 1.25rem;
+ font-size: 16px;
+ line-height: 3rem;
+ letter-spacing: 1px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ vertical-align: top;
+ background-color: #e5e9e8;
+ box-shadow: inset 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+}
+
+.topcoat-button:hover,
+.topcoat-button--quiet:hover,
+.topcoat-button--large:hover,
+.topcoat-button--large--quiet:hover,
+.topcoat-button-bar__button:hover,
+.topcoat-button-bar__button--large:hover {
+ background-color: #edf1f1;
+}
+
+.topcoat-button:active,
+.topcoat-button--large:active,
+.topcoat-button-bar__button:active,
+.topcoat-button-bar__button--large:active,
+:checked + .topcoat-button-bar__button {
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+.topcoat-button:focus,
+.topcoat-button--quiet:focus,
+.topcoat-button--large:focus,
+.topcoat-button--large--quiet:focus,
+.topcoat-button--cta:focus,
+.topcoat-button--large--cta:focus,
+.topcoat-button-bar__button:focus,
+.topcoat-button-bar__button--large:focus {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+ outline: 0;
+}
+
+.topcoat-button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.topcoat-button--quiet:hover,
+.topcoat-button--large--quiet:hover {
+ text-shadow: 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-button--quiet:active,
+.topcoat-button--large--quiet:active {
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ background-color: #d3d7d7;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+.topcoat-button--large,
+.topcoat-button--large--quiet,
+.topcoat-button-bar__button--large {
+ font-size: 1.3rem;
+ font-weight: 400;
+ line-height: 4.375rem;
+ padding: 0 1.25rem;
+}
+
+.topcoat-button--large--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.topcoat-button--cta,
+.topcoat-button--large--cta {
+ border: 1px solid #143250;
+ background-color: #288edf;
+ box-shadow: inset 0 1px rgba(255,255,255,0.36);
+ color: #fff;
+ font-weight: 500;
+ text-shadow: 0 -1px rgba(0,0,0,0.36);
+}
+
+.topcoat-button--cta:hover,
+.topcoat-button--large--cta:hover {
+ background-color: #509bef;
+}
+
+.topcoat-button--cta:active,
+.topcoat-button--large--cta:active {
+ background-color: #0380e8;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+.topcoat-button--large--cta {
+ font-size: 1.3rem;
+ font-weight: 400;
+ line-height: 4.375rem;
+ padding: 0 1.25rem;
+}
+
+.button-bar,
+.topcoat-button-bar {
+ display: table;
+ table-layout: fixed;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+.button-bar__item,
+.topcoat-button-bar__item {
+ display: table-cell;
+ width: auto;
+ border-radius: 0;
+}
+
+.button-bar__item > input,
+.topcoat-button-bar__item > input {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.button-bar__button {
+ border-radius: inherit;
+}
+
+.button-bar__item:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Button Bar
+ description: Component of grouped buttons
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <div class="topcoat-button-bar">
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button">One</button>
+ </div>
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button">Two</button>
+ </div>
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button">Three</button>
+ </div>
+ </div>
+ examples:
+ mobile button bar: http://codepen.io/Topcoat/pen/kdKyg
+ tags:
+ - desktop
+ - light
+ - dark
+ - mobile
+ - button
+ - group
+ - bar
+*/
+
+.topcoat-button-bar > .topcoat-button-bar__item:first-child {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+}
+
+.topcoat-button-bar > .topcoat-button-bar__item:last-child {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+}
+
+.topcoat-button-bar__item:first-child > .topcoat-button-bar__button,
+.topcoat-button-bar__item:first-child > .topcoat-button-bar__button--large {
+ border-right: none;
+}
+
+.topcoat-button-bar__item:last-child > .topcoat-button-bar__button,
+.topcoat-button-bar__item:last-child > .topcoat-button-bar__button--large {
+ border-left: none;
+}
+
+.topcoat-button-bar__button {
+ border-radius: inherit;
+}
+
+.topcoat-button-bar__button:focus,
+.topcoat-button-bar__button--large:focus {
+ z-index: 1;
+}
+
+/* topdoc
+ name: Large Button Bar
+ description: A button bar, only larger
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <div class="topcoat-button-bar">
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button--large">One</button>
+ </div>
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button--large">Two</button>
+ </div>
+ <div class="topcoat-button-bar__item">
+ <button class="topcoat-button-bar__button--large">Three</button>
+ </div>
+ </div>
+ tags:
+ - desktop
+ - light
+ - dark
+ - mobile
+ - button
+ - group
+ - bar
+ - large
+*/
+
+.topcoat-button-bar__button--large {
+ border-radius: inherit;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.button--disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button,
+.topcoat-button,
+.topcoat-button--quiet,
+.topcoat-button--large,
+.topcoat-button--large--quiet,
+.topcoat-button--cta,
+.topcoat-button--large--cta {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.button--disabled,
+.topcoat-button:disabled,
+.topcoat-button--quiet:disabled,
+.topcoat-button--large:disabled,
+.topcoat-button--large--quiet:disabled,
+.topcoat-button--cta:disabled,
+.topcoat-button--large--cta:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Button
+ description: A simple button
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button">Button</button>
+ <button class="topcoat-button" disabled>Button</button>
+ examples:
+ mobile button: http://codepen.io/Topcoat/pen/DpKtf
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+*/
+
+.topcoat-button,
+.topcoat-button--quiet,
+.topcoat-button--large,
+.topcoat-button--large--quiet,
+.topcoat-button--cta,
+.topcoat-button--large--cta {
+ padding: 0 1.25rem;
+ font-size: 16px;
+ line-height: 3rem;
+ letter-spacing: 1px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ vertical-align: top;
+ background-color: #e5e9e8;
+ box-shadow: inset 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+}
+
+.topcoat-button:hover,
+.topcoat-button--quiet:hover,
+.topcoat-button--large:hover,
+.topcoat-button--large--quiet:hover {
+ background-color: #edf1f1;
+}
+
+.topcoat-button:active,
+.topcoat-button--large:active {
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+.topcoat-button:focus,
+.topcoat-button--quiet:focus,
+.topcoat-button--large:focus,
+.topcoat-button--large--quiet:focus,
+.topcoat-button--cta:focus,
+.topcoat-button--large--cta:focus {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+ outline: 0;
+}
+
+/* topdoc
+ name: Quiet Button
+ description: A simple, yet quiet button
+ modifiers:
+ :active: Quiet button active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button--quiet">Button</button>
+ <button class="topcoat-button--quiet" disabled>Button</button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - quiet
+*/
+
+.topcoat-button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.topcoat-button--quiet:hover,
+.topcoat-button--large--quiet:hover {
+ text-shadow: 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-button--quiet:active,
+.topcoat-button--large--quiet:active {
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ background-color: #d3d7d7;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+/* topdoc
+ name: Large Button
+ description: A big ol button
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button--large" >Button</button>
+ <button class="topcoat-button--large" disabled>Button</button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - large
+*/
+
+.topcoat-button--large,
+.topcoat-button--large--quiet {
+ font-size: 1.3rem;
+ font-weight: 400;
+ line-height: 4.375rem;
+ padding: 0 1.25rem;
+}
+
+/* topdoc
+ name: Large Quiet Button
+ description: A large, yet quiet button
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button--large--quiet" >Button</button>
+ <button class="topcoat-button--large--quiet" disabled>Button</button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - large
+ - quiet
+*/
+
+.topcoat-button--large--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+/* topdoc
+ name: Call To Action Button
+ description: A CALL TO ARMS, er, ACTION!
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button--cta" >Button</button>
+ <button class="topcoat-button--cta" disabled>Button</button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - call to action
+*/
+
+.topcoat-button--cta,
+.topcoat-button--large--cta {
+ border: 1px solid #143250;
+ background-color: #288edf;
+ box-shadow: inset 0 1px rgba(255,255,255,0.36);
+ color: #fff;
+ font-weight: 500;
+ text-shadow: 0 -1px rgba(0,0,0,0.36);
+}
+
+.topcoat-button--cta:hover,
+.topcoat-button--large--cta:hover {
+ background-color: #509bef;
+}
+
+.topcoat-button--cta:active,
+.topcoat-button--large--cta:active {
+ background-color: #0380e8;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+/* topdoc
+ name: Large Call To Action Button
+ description: Like call to action, but bigger
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-button--large--cta" >Button</button>
+ <button class="topcoat-button--large--cta" disabled>Button</button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - large
+ - call to action
+*/
+
+.topcoat-button--large--cta {
+ font-size: 1.3rem;
+ font-weight: 400;
+ line-height: 4.375rem;
+ padding: 0 1.25rem;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+input[type="checkbox"] {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.checkbox {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.checkbox__label {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.checkbox--disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+.checkbox:before,
+.checkbox:after {
+ content: '';
+ position: absolute;
+}
+
+.checkbox:before {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+input[type="checkbox"] {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.checkbox,
+.topcoat-checkbox__checkmark {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.checkbox__label,
+.topcoat-checkbox {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.checkbox--disabled,
+input[type="checkbox"]:disabled + .topcoat-checkbox__checkmark {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+.checkbox:before,
+.checkbox:after,
+.topcoat-checkbox__checkmark:before,
+.topcoat-checkbox__checkmark:after {
+ content: '';
+ position: absolute;
+}
+
+.checkbox:before,
+.topcoat-checkbox__checkmark:before {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+/* topdoc
+ name: Checkbox
+ description: Default skin for Topcoat checkbox
+ modifiers:
+ :focus: Focus state
+ :disabled: Disabled state
+ markup:
+ <label class="topcoat-checkbox">
+ <input type="checkbox">
+ <div class="topcoat-checkbox__checkmark"></div>
+ Default
+ </label>
+ <br>
+ <br>
+ <label class="topcoat-checkbox">
+ <input type="checkbox" disabled>
+ <div class="topcoat-checkbox__checkmark"></div>
+ Disabled
+ </label>
+ examples:
+ mobile checkbox: http://codepen.io/Topcoat/pen/piHcs
+ tags:
+ - desktop
+ - light
+ - mobile
+ - checkbox
+*/
+
+.topcoat-checkbox__checkmark {
+ height: 2rem;
+}
+
+input[type="checkbox"] {
+ height: 2rem;
+ width: 2rem;
+ margin-top: 0;
+ margin-right: -2rem;
+ margin-bottom: -2rem;
+ margin-left: 0;
+}
+
+input[type="checkbox"]:checked + .topcoat-checkbox__checkmark:after {
+ opacity: 1;
+}
+
+.topcoat-checkbox {
+ line-height: 2rem;
+}
+
+.topcoat-checkbox__checkmark:before {
+ width: 2rem;
+ height: 2rem;
+ background: #e5e9e8;
+ border: 1px solid #a5a8a8;
+ border-radius: 3px;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-checkbox__checkmark {
+ width: 2rem;
+ height: 2rem;
+}
+
+.topcoat-checkbox__checkmark:after {
+ top: 1px;
+ left: 2px;
+ opacity: 0;
+ width: 28px;
+ height: 11px;
+ background: transparent;
+ border: 7px solid #666;
+ border-width: 7px;
+ border-top: none;
+ border-right: none;
+ border-radius: 2px;
+ -webkit-transform: rotate(-50deg);
+ -ms-transform: rotate(-50deg);
+ transform: rotate(-50deg);
+}
+
+input[type="checkbox"]:focus + .topcoat-checkbox__checkmark:before {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button,
+.topcoat-icon-button,
+.topcoat-icon-button--quiet,
+.topcoat-icon-button--large,
+.topcoat-icon-button--large--quiet {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.button--disabled,
+.topcoat-icon-button:disabled,
+.topcoat-icon-button--quiet:disabled,
+.topcoat-icon-button--large:disabled,
+.topcoat-icon-button--large--quiet:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Icon Button
+ description: Like button, but it has an icon.
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-icon-button">
+ <span class="topcoat-icon" style="background-color:#A5A7A7;"></span>
+ </button>
+ <button class="topcoat-icon-button" disabled>
+ <span class="topcoat-icon" style="background-color:#A5A7A7;"></span>
+ </button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - icon
+*/
+
+.topcoat-icon-button,
+.topcoat-icon-button--quiet,
+.topcoat-icon-button--large,
+.topcoat-icon-button--large--quiet {
+ padding: 0 0.75rem;
+ line-height: 3rem;
+ letter-spacing: 1px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ vertical-align: baseline;
+ background-color: #e5e9e8;
+ box-shadow: inset 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+}
+
+.topcoat-icon-button:hover,
+.topcoat-icon-button--quiet:hover,
+.topcoat-icon-button--large:hover,
+.topcoat-icon-button--large--quiet:hover {
+ background-color: #edf1f1;
+}
+
+.topcoat-icon-button:active {
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+.topcoat-icon-button:focus,
+.topcoat-icon-button--quiet:focus,
+.topcoat-icon-button--quiet:hover:focus,
+.topcoat-icon-button--large:focus,
+.topcoat-icon-button--large--quiet:focus,
+.topcoat-icon-button--large--quiet:hover:focus {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+ outline: 0;
+}
+
+/* topdoc
+ name: Quiet Icon Button
+ description: Like quiet button, but it has an icon.
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-icon-button--quiet">
+ <span class="topcoat-icon" style="background-color:#A5A7A7;"></span>
+ </button>
+ <button class="topcoat-icon-button--quiet" disabled>
+ <span class="topcoat-icon" style="background-color:#A5A7A7;"></span>
+ </button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - icon
+ - quiet
+*/
+
+.topcoat-icon-button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.topcoat-icon-button--quiet:hover,
+.topcoat-icon-button--large--quiet:hover {
+ text-shadow: 0 1px #fff;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-icon-button--quiet:active,
+.topcoat-icon-button--large--quiet:active {
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ background-color: #d3d7d7;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+/* topdoc
+ name: Large Icon Button
+ description: Like large button, but it has an icon.
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <button class="topcoat-icon-button--large">
+ <span class="topcoat-icon--large" style="background-color:#A5A7A7;"></span>
+ </button>
+ <button class="topcoat-icon-button--large" disabled>
+ <span class="topcoat-icon--large" style="background-color:#A5A7A7;"></span>
+ </button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - icon
+ - large
+*/
+
+.topcoat-icon-button--large,
+.topcoat-icon-button--large--quiet {
+ width: 4.375rem;
+ height: 4.375rem;
+ line-height: 4.375rem;
+}
+
+.topcoat-icon-button--large:active {
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+}
+
+/* topdoc
+ name: Large Quiet Icon Button
+ description: Like large button, but it has an icon and this one is quiet.
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ markup:
+ <button class="topcoat-icon-button--large--quiet">
+ <span class="topcoat-icon--large" style="background-color:#A5A7A7;"></span>
+ </button>
+ <button class="topcoat-icon-button--large--quiet" disabled>
+ <span class="topcoat-icon--large" style="background-color:#A5A7A7;"></span>
+ </button>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - button
+ - icon
+ - large
+ - quiet
+*/
+
+.topcoat-icon-button--large--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.topcoat-icon,
+.topcoat-icon--large {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ overflow: hidden;
+ width: 1.62rem;
+ height: 1.62rem;
+ vertical-align: middle;
+ top: -1px;
+}
+
+.topcoat-icon--large {
+ width: 2.499999998125rem;
+ height: 2.499999998125rem;
+ top: -2px;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.input {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+}
+
+.input:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.list {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.list__header {
+ margin: 0;
+}
+
+.list__container {
+ padding: 0;
+ margin: 0;
+ list-style-type: none;
+}
+
+.list__item {
+ margin: 0;
+ padding: 0;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.list,
+.topcoat-list {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+}
+
+.list__header,
+.topcoat-list__header {
+ margin: 0;
+}
+
+.list__container,
+.topcoat-list__container {
+ padding: 0;
+ margin: 0;
+ list-style-type: none;
+}
+
+.list__item,
+.topcoat-list__item {
+ margin: 0;
+ padding: 0;
+}
+
+/* topdoc
+ name: List
+ description: Topcoat default list skin
+ markup:
+ <div class="topcoat-list">
+ <h3 class="topcoat-list__header">Category</h3>
+ <ul class="topcoat-list__container">
+ <li class="topcoat-list__item">
+ Item
+ </li>
+ <li class="topcoat-list__item">
+ Item
+ </li>
+ <li class="topcoat-list__item">
+ Item
+ </li>
+ </ul>
+ </div>
+ tags:
+ - mobile
+ - list
+*/
+
+.topcoat-list {
+ border-top: 1px solid #bcbfbf;
+ border-bottom: 1px solid #eff1f1;
+ background-color: #dfe2e2;
+}
+
+.topcoat-list__header {
+ padding: 4px 20px;
+ font-size: 0.9em;
+ font-weight: 400;
+ background-color: #cccfcf;
+ color: #656565;
+ text-shadow: 0 1px 0 rgba(255,255,255,0.5);
+ border-top: 1px solid rgba(255,255,255,0.5);
+ border-bottom: 1px solid rgba(255,255,255,0.23);
+}
+
+.topcoat-list__container {
+ border-top: 1px solid #bcbfbf;
+ color: #454545;
+}
+
+.topcoat-list__item {
+ padding: 1.25rem;
+ border-top: 1px solid #eff1f1;
+ border-bottom: 1px solid #bcbfbf;
+}
+
+.topcoat-list__item:first-child {
+ border-top: 1px solid rgba(0,0,0,0.05);
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.navigation-bar {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ white-space: nowrap;
+ overflow: hidden;
+ word-spacing: 0;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.navigation-bar__item {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+}
+
+.navigation-bar__title {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.navigation-bar,
+.topcoat-navigation-bar {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ white-space: nowrap;
+ overflow: hidden;
+ word-spacing: 0;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.navigation-bar__item,
+.topcoat-navigation-bar__item {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+}
+
+.navigation-bar__title,
+.topcoat-navigation-bar__title {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+/* topdoc
+ name: Navigation Bar
+ description: A place where navigation goes to drink
+ markup:
+ <div class="topcoat-navigation-bar">
+ <div class="topcoat-navigation-bar__item center full">
+ <h1 class="topcoat-navigation-bar__title">Header</h1>
+ </div>
+ </div>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - navigation
+ - bar
+*/
+
+.topcoat-navigation-bar {
+ height: 4.375rem;
+ padding-left: 1rem;
+ padding-right: 1rem;
+ background: #e5e9e8;
+ color: #000;
+ box-shadow: inset 0 -1px #b9bcbc, 0 1px #d4d6d6;
+}
+
+.topcoat-navigation-bar__item {
+ margin: 0;
+ line-height: 4.375rem;
+ vertical-align: top;
+}
+
+.topcoat-navigation-bar__title {
+ font-size: 1.3rem;
+ font-weight: 400;
+ color: #000;
+}
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.notification {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.notification,
+.topcoat-notification {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+/* topdoc
+ name: Notification
+ description: Notification badge
+ markup:
+ <span class="topcoat-notification">1</span>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - notification
+*/
+
+.topcoat-notification {
+ padding: 0.15em 0.5em 0.2em;
+ border-radius: 2px;
+ background-color: #ec514e;
+ color: #fff;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+input[type="radio"] {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.radio-button {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.radio-button__label {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.radio-button:before,
+.radio-button:after {
+ content: '';
+ position: absolute;
+ border-radius: 100%;
+}
+
+.radio-button:after {
+ top: 50%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ -ms-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+}
+
+.radio-button:before {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.radio-button--disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+input[type="radio"] {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.radio-button,
+.topcoat-radio-button__checkmark {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.radio-button__label,
+.topcoat-radio-button {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.radio-button:before,
+.radio-button:after,
+.topcoat-radio-button__checkmark:before,
+.topcoat-radio-button__checkmark:after {
+ content: '';
+ position: absolute;
+ border-radius: 100%;
+}
+
+.radio-button:after,
+.topcoat-radio-button__checkmark:after {
+ top: 50%;
+ left: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ -ms-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+}
+
+.radio-button:before,
+.topcoat-radio-button__checkmark:before {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.radio-button--disabled,
+input[type="radio"]:disabled + .topcoat-radio-button__checkmark {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Radio Button
+ description: A button that can play music, but usually just plays ads.
+ modifiers:
+ markup:
+ <!-- NO LABEL -->
+ <label class="topcoat-radio-button">
+ <input type="radio" name="topcoat">
+ <div class="topcoat-radio-button__checkmark"></div>
+ </label>
+ <br>
+ <br>
+ <!-- LEFT LABEL -->
+ <label class="topcoat-radio-button">
+ Left label
+ <input type="radio" name="topcoat">
+ <div class="topcoat-radio-button__checkmark"></div>
+ </label>
+ <br>
+ <br>
+ <!-- RIGHT LABEL -->
+ <label class="topcoat-radio-button">
+ <input type="radio" name="topcoat">
+ <div class="topcoat-radio-button__checkmark"></div>
+ Right label
+ </label>
+ <br>
+ <br>
+ <!-- DISABLED -->
+ <label class="topcoat-radio-button">
+ <input type="radio" name="topcoat" Disabled>
+ <div class="topcoat-radio-button__checkmark"></div>
+ Disabled
+ </label>
+ examples:
+ Mobile Radio Button: http://codepen.io/Topcoat/pen/HDcJj
+ tags:
+ - desktop
+ - light
+ - mobile
+ - Radio
+*/
+
+input[type="radio"] {
+ height: 1.875rem;
+ width: 1.875rem;
+ margin-top: 0;
+ margin-right: -1.875rem;
+ margin-bottom: -1.875rem;
+ margin-left: 0;
+}
+
+input[type="radio"]:checked + .topcoat-radio-button__checkmark:after {
+ opacity: 1;
+}
+
+.topcoat-radio-button {
+ color: #454545;
+ line-height: 1.875rem;
+}
+
+.topcoat-radio-button__checkmark:before {
+ width: 1.875rem;
+ height: 1.875rem;
+ background: #e5e9e8;
+ border: 1px solid #a5a8a8;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-radio-button__checkmark {
+ position: relative;
+ width: 1.875rem;
+ height: 1.875rem;
+}
+
+.topcoat-radio-button__checkmark:after {
+ opacity: 0;
+ width: 0.875rem;
+ height: 0.875rem;
+ background: #666;
+ border: 1px solid rgba(0,0,0,0.1);
+ box-shadow: 0 1px rgba(255,255,255,0.5);
+ -webkit-transform: none;
+ -ms-transform: none;
+ transform: none;
+ top: 7px;
+ left: 7px;
+}
+
+input[type="radio"]:focus + .topcoat-radio-button__checkmark:before {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+.range {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+ -webkit-appearance: none;
+}
+
+.range__thumb {
+ cursor: pointer;
+}
+
+.range__thumb--webkit {
+ cursor: pointer;
+ -webkit-appearance: none;
+}
+
+.range:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Copyright 2012 Adobe Systems Inc.;
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+.range,
+.topcoat-range {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+ -webkit-appearance: none;
+}
+
+.range__thumb,
+.topcoat-range::-moz-range-thumb {
+ cursor: pointer;
+}
+
+.range__thumb--webkit,
+.topcoat-range::-webkit-slider-thumb {
+ cursor: pointer;
+ -webkit-appearance: none;
+}
+
+.range:disabled,
+.topcoat-range:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Range
+ description: Range input
+ modifiers:
+ :active: Active state
+ :disabled: Disabled state
+ :hover: Hover state
+ :focus: Focused
+ markup:
+ <input type="range" class="topcoat-range">
+ <input type="range" class="topcoat-range" disabled>
+ examples:
+ mobile range: http://codepen.io/Topcoat/pen/BskEn
+ tags:
+ - desktop
+ - mobile
+ - range
+*/
+
+.topcoat-range {
+ border-radius: 6px;
+ border: 1px solid #a5a8a8;
+ background-color: #d3d7d7;
+ height: 1rem;
+ border-radius: 30px;
+}
+
+.topcoat-range::-moz-range-track {
+ border-radius: 6px;
+ border: 1px solid #a5a8a8;
+ background-color: #d3d7d7;
+ height: 1rem;
+ border-radius: 30px;
+}
+
+.topcoat-range::-webkit-slider-thumb {
+ height: 3rem;
+ width: 2rem;
+ background-color: #e5e9e8;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-range::-moz-range-thumb {
+ height: 3rem;
+ width: 2rem;
+ background-color: #e5e9e8;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+ box-shadow: inset 0 1px #fff;
+}
+
+.topcoat-range:focus::-webkit-slider-thumb {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+.topcoat-range:focus::-moz-range-thumb {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.search-input {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+ -webkit-appearance: none;
+}
+
+input[type="search"]::-webkit-search-cancel-button {
+ -webkit-appearance: none;
+}
+
+.search-input:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.search-input,
+.topcoat-search-input,
+.topcoat-search-input--large {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+ -webkit-appearance: none;
+}
+
+input[type="search"]::-webkit-search-cancel-button {
+ -webkit-appearance: none;
+}
+
+.search-input:disabled,
+.topcoat-search-input:disabled,
+.topcoat-search-input--large:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Search Input
+ description: A text input designed for searching.
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <input type="search" value="" placeholder="search" class="topcoat-search-input">
+ <input type="search" value="" placeholder="search" class="topcoat-search-input" disabled>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - text
+ - input
+ - search
+ - form
+*/
+
+.topcoat-search-input,
+.topcoat-search-input--large {
+ line-height: 3rem;
+ font-size: 16px;
+ border: 1px solid #a5a8a8;
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+ color: #454545;
+ padding: 0 0 0 2rem;
+ border-radius: 30px;
+ background-image: url("../img/search.svg");
+ background-position: 1em center;
+ background-repeat: no-repeat;
+ background-size: 16px;
+}
+
+.topcoat-search-input:focus,
+.topcoat-search-input--large:focus {
+ background-image: url("../img/search_dark.svg");
+ background-color: #edf1f1;
+ color: #000;
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+.topcoat-search-input::-webkit-search-cancel-button,
+.topcoat-search-input::-webkit-search-decoration,
+.topcoat-search-input--large::-webkit-search-cancel-button,
+.topcoat-search-input--large::-webkit-search-decoration {
+ margin-right: 5px;
+}
+
+.topcoat-search-input:focus::-webkit-input-placeholder,
+.topcoat-search-input:focus::-webkit-input-placeholder {
+ color: #c6c8c8;
+}
+
+.topcoat-search-input:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-search-input:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-search-input:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+/* topdoc
+ name: Large Search Input
+ description: A large text input designed for searching.
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <input type="search" value="" placeholder="search" class="topcoat-search-input--large">
+ <input type="search" value="" placeholder="search" class="topcoat-search-input--large" disabled>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - text
+ - input
+ - search
+ - form
+ - large
+*/
+
+.topcoat-search-input--large {
+ line-height: 4.375rem;
+ font-size: 1.3rem;
+ font-weight: 200;
+ padding: 0 0 0 2.9rem;
+ border-radius: 40px;
+ background-position: 1.2em center;
+ background-size: 1.3rem;
+}
+
+.topcoat-search-input--large:disabled {
+ color: #000;
+}
+
+.topcoat-search-input--large:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-search-input--large:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-search-input--large:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.switch {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.switch__input {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.switch__toggle {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.switch__toggle:before,
+.switch__toggle:after {
+ content: '';
+ position: absolute;
+ z-index: -1;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.switch--disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.switch,
+.topcoat-switch {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.switch__input,
+.topcoat-switch__input {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.switch__toggle,
+.topcoat-switch__toggle {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.switch__toggle:before,
+.switch__toggle:after,
+.topcoat-switch__toggle:before,
+.topcoat-switch__toggle:after {
+ content: '';
+ position: absolute;
+ z-index: -1;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+}
+
+.switch--disabled,
+.topcoat-switch__input:disabled + .topcoat-switch__toggle {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Switch
+ description: Default skin for Topcoat switch
+ modifiers:
+ :focus: Focus state
+ :disabled: Disabled state
+ markup:
+ <label class="topcoat-switch">
+ <input type="checkbox" class="topcoat-switch__input">
+ <div class="topcoat-switch__toggle"></div>
+ </label>
+ <br>
+ <br>
+ <label class="topcoat-switch">
+ <input type="checkbox" class="topcoat-switch__input" checked>
+ <div class="topcoat-switch__toggle"></div>
+ </label>
+ <br>
+ <br>
+ <label class="topcoat-switch">
+ <input type="checkbox" class="topcoat-switch__input" disabled>
+ <div class="topcoat-switch__toggle"></div>
+ </label>
+ examples:
+ mobile switch: http://codepen.io/Topcoat/pen/upxds
+ tags:
+ - desktop
+ - light
+ - mobile
+ - switch
+*/
+
+.topcoat-switch {
+ font-size: 16px;
+ padding: 0 1.25rem;
+ border-radius: 6px;
+ border: 1px solid #a5a8a8;
+ overflow: hidden;
+ width: 6rem;
+}
+
+.topcoat-switch__toggle:before,
+.topcoat-switch__toggle:after {
+ top: -1px;
+ width: 5rem;
+}
+
+.topcoat-switch__toggle:before {
+ content: 'ON';
+ color: #0083e8;
+ background-color: #e0f0fa;
+ right: 1rem;
+ padding-left: 1.5rem;
+}
+
+.topcoat-switch__toggle {
+ line-height: 3rem;
+ height: 3rem;
+ width: 2rem;
+ border-radius: 6px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ background-color: #e5e9e8;
+ border: 1px solid #a5a8a8;
+ margin-left: -1.3rem;
+ margin-bottom: -1px;
+ margin-top: -1px;
+ box-shadow: inset 0 1px #fff;
+ -webkit-transition: margin-left 0.05s ease-in-out;
+ transition: margin-left 0.05s ease-in-out;
+}
+
+.topcoat-switch__toggle:after {
+ content: 'OFF';
+ background-color: #d3d7d7;
+ left: 1rem;
+ padding-left: 2rem;
+}
+
+.topcoat-switch__input:checked + .topcoat-switch__toggle {
+ margin-left: 2.7rem;
+}
+
+.topcoat-switch__input:focus + .topcoat-switch__toggle {
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+.topcoat-switch__input:disabled + .topcoat-switch__toggle:after,
+.topcoat-switch__input:disabled + .topcoat-switch__toggle:before {
+ background: transparent;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.button,
+.topcoat-tab-bar__button {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ text-decoration: none;
+}
+
+.button--quiet {
+ background: transparent;
+ border: 1px solid transparent;
+ box-shadow: none;
+}
+
+.button--disabled,
+.topcoat-tab-bar__button:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+.button-bar,
+.topcoat-tab-bar {
+ display: table;
+ table-layout: fixed;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+.button-bar__item,
+.topcoat-tab-bar__item {
+ display: table-cell;
+ width: auto;
+ border-radius: 0;
+}
+
+.button-bar__item > input,
+.topcoat-tab-bar__item > input {
+ position: absolute;
+ overflow: hidden;
+ padding: 0;
+ border: 0;
+ opacity: 0.001;
+ z-index: 1;
+ vertical-align: top;
+ outline: none;
+}
+
+.button-bar__button {
+ border-radius: inherit;
+}
+
+.button-bar__item:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Tab Bar
+ description: Component of tab buttons
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <div class="topcoat-tab-bar">
+ <label class="topcoat-tab-bar__item">
+ <input type="radio" name="tab-bar">
+ <button class="topcoat-tab-bar__button">One</button>
+ </label>
+ <label class="topcoat-tab-bar__item">
+ <input type="radio" name="tab-bar">
+ <button class="topcoat-tab-bar__button">Two</button>
+ </label>
+ <label class="topcoat-tab-bar__item">
+ <input type="radio" name="tab-bar">
+ <button class="topcoat-tab-bar__button">Three</button>
+ </label>
+ </div>
+ examples:
+ mobile tab bar: http://codepen.io/Topcoat/pen/rJICF
+ tags:
+ - desktop
+ - light
+ - dark
+ - mobile
+ - tab
+ - group
+ - bar
+*/
+
+.topcoat-tab-bar__button {
+ padding: 0 1.25rem;
+ height: 3rem;
+ line-height: 3rem;
+ letter-spacing: 1px;
+ color: #454545;
+ text-shadow: 0 1px #fff;
+ vertical-align: top;
+ background-color: #e5e9e8;
+ box-shadow: inset 0 1px #fff;
+ border-top: 1px solid #a5a8a8;
+}
+
+.topcoat-tab-bar__button:active,
+.topcoat-tab-bar__button--large:active,
+:checked + .topcoat-tab-bar__button {
+ color: #0083e8;
+ background-color: #e0f0fa;
+ box-shadow: inset 0 0 2px #c0ced8;
+}
+
+.topcoat-tab-bar__button:focus,
+.topcoat-tab-bar__button--large:focus {
+ z-index: 1;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.input,
+.topcoat-text-input,
+.topcoat-text-input--large {
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ vertical-align: top;
+ outline: none;
+}
+
+.input:disabled,
+.topcoat-text-input:disabled,
+.topcoat-text-input--large:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Text input
+ description: Topdoc text input
+ modifiers:
+ :disabled: Disabled state
+ :focus: Focused
+ :invalid: Hover state
+ markup:
+ <input type="text" class="topcoat-text-input" placeholder="text" value="">
+ <br>
+ <br>
+ <input type="text" class="topcoat-text-input" placeholder="text" value="" disabled>
+ <br>
+ <br>
+ <input type="text" class="topcoat-text-input" placeholder="text" value="fail" pattern="not-fail">
+ tags:
+ - desktop
+ - mobile
+ - text
+ - input
+*/
+
+.topcoat-text-input,
+.topcoat-text-input--large {
+ line-height: 3rem;
+ font-size: 16px;
+ letter-spacing: 1px;
+ padding: 0 1.25rem;
+ border: 1px solid #a5a8a8;
+ border-radius: 6px;
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+ color: #454545;
+ vertical-align: top;
+}
+
+.topcoat-text-input:focus,
+.topcoat-text-input--large:focus {
+ background-color: #edf1f1;
+ color: #000;
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+.topcoat-text-input:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input:invalid {
+ border: 1px solid #d83b75;
+}
+
+/* topdoc
+ name: Large Text Input
+ description: A bigger input, still for text.
+ modifiers:
+ :disabled: Disabled state
+ :focus: Focused
+ :invalid: Hover state
+ markup:
+ <input type="text" class="topcoat-text-input--large" value="" placeholder="text">
+ <br>
+ <br>
+ <input type="text" class="topcoat-text-input--large" value="" placeholder="text" disabled>
+ <br>
+ <br>
+ <input type="text" class="topcoat-text-input--large" placeholder="text" value="fail" pattern="not-fail">
+ tags:
+ - desktop
+ - light
+ - mobile
+ - form
+ - input
+ - large
+*/
+
+.topcoat-text-input--large {
+ line-height: 4.375rem;
+ font-size: 1.3rem;
+}
+
+.topcoat-text-input--large:disabled {
+ color: #000;
+}
+
+.topcoat-text-input--large:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input--large:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input--large:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+.topcoat-text-input--large:invalid {
+ border: 1px solid #d83b75;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.textarea {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ vertical-align: top;
+ resize: none;
+ outline: none;
+}
+
+.textarea:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+/**
+*
+* Copyright 2012 Adobe Systems Inc.;
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+.textarea,
+.topcoat-textarea,
+.topcoat-textarea--large {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ vertical-align: top;
+ resize: none;
+ outline: none;
+}
+
+.textarea:disabled,
+.topcoat-textarea:disabled,
+.topcoat-textarea--large:disabled {
+ opacity: 0.3;
+ cursor: default;
+ pointer-events: none;
+}
+
+/* topdoc
+ name: Textarea
+ description: A whole area, just for text.
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <textarea class="topcoat-textarea" rows="6" cols="36" placeholder="Textarea"></textarea>
+ <br>
+ <br>
+ <textarea class="topcoat-textarea" rows="6" cols="36" placeholder="Textarea" disabled></textarea>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - form
+ - input
+ - textarea
+*/
+
+.topcoat-textarea,
+.topcoat-textarea--large {
+ padding: 2rem;
+ font-size: 2.5rem;
+ font-weight: 200;
+ border-radius: 6px;
+ line-height: 3rem;
+ border: 1px solid #a5a8a8;
+ background-color: #d3d7d7;
+ box-shadow: inset 0 1px rgba(0,0,0,0.12);
+ color: #454545;
+ letter-spacing: 1px;
+}
+
+.topcoat-textarea:focus,
+.topcoat-textarea--large:focus {
+ background-color: #edf1f1;
+ color: #000;
+ border: 1px solid #0940fd;
+ box-shadow: 0 0 0 2px #6fb5f1;
+}
+
+.topcoat-textarea:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-textarea:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-textarea:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+/* topdoc
+ name: Large Textarea
+ description: A whole area, just for text; now available in large.
+ modifiers:
+ :disabled: Disabled state
+ markup:
+ <textarea class="topcoat-textarea--large" rows="6" cols="36" placeholder="Textarea"></textarea>
+ <br>
+ <br>
+ <textarea class="topcoat-textarea--large" rows="6" cols="36" placeholder="Textarea" disabled></textarea>
+ tags:
+ - desktop
+ - light
+ - mobile
+ - form
+ - input
+ - textarea
+*/
+
+.topcoat-textarea--large {
+ font-size: 3rem;
+ line-height: 4.375rem;
+}
+
+.topcoat-textarea--large:disabled {
+ color: #000;
+}
+
+.topcoat-textarea--large:disabled::-webkit-input-placeholder {
+ color: #000;
+}
+
+.topcoat-textarea--large:disabled::-moz-placeholder {
+ color: #000;
+}
+
+.topcoat-textarea--large:disabled:-ms-input-placeholder {
+ color: #000;
+}
+
+@font-face {
+ font-family: "Source Sans";
+ src: url("../font/SourceSansPro-Regular.otf");
+}
+
+@font-face {
+ font-family: "Source Sans";
+ src: url("../font/SourceSansPro-Light.otf");
+ font-weight: 200;
+}
+
+@font-face {
+ font-family: "Source Sans";
+ src: url("../font/SourceSansPro-Semibold.otf");
+ font-weight: 600;
+}
+
+body {
+ margin: 0;
+ padding: 0;
+ background: #dfe2e2;
+ color: #000;
+ font: 16px "Source Sans", helvetica, arial, sans-serif;
+ font-weight: 200;
+}
+
+:focus {
+ outline-color: transparent;
+ outline-style: none;
+}
+
+.topcoat-icon--menu-stack {
+ background: url("../img/hamburger_dark.svg") no-repeat;
+ background-size: cover;
+}
+
+.quarter {
+ width: 25%;
+}
+
+.half {
+ width: 50%;
+}
+
+.three-quarters {
+ width: 75%;
+}
+
+.third {
+ width: 33.333%;
+}
+
+.two-thirds {
+ width: 66.666%;
+}
+
+.full {
+ width: 100%;
+}
+
+.left {
+ text-align: left;
+}
+
+.center {
+ text-align: center;
+}
+
+.right {
+ text-align: right;
+}
+
+.reset-ui {
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background-clip: padding-box;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+ font: inherit;
+ color: inherit;
+ background: transparent;
+ border: none;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+/* This file should include color and image variables corresponding to the dark theme */
+
+/* Call To Action */
+
+/* Icons */
+
+/* Navigation Bar */
+
+/* Text Input */
+
+/* Search Input */
+
+/* List */
+
+/* Checkbox */
+
+/* Overlay */
+
+/* Progress bar */
+
+/* Checkbox */
+
+/* Radio Button */
+
+/* Tab bar */
+
+/* Switch */
+
+/* Icon Button */
+
+/* Navigation bar */
+
+/* List */
+
+/* Search Input */
+
+/* Textarea */
+
+/* Checkbox */
+
+/* Radio */
+
+/* Range input */
+
+/* Search Input */
+
+/* Switch */
+
+/* This file should include color and image variables corresponding to the light theme */
+
+/* Call To Action */
+
+/* Icons */
+
+/* Navigation Bar */
+
+/* Text Input */
+
+/* List */
+
+/* Overlay */
+
+/* Progress bar */
+
+/* Checkbox */
+
+/* Range input */
+
+/* Radio Button */
+
+/* Tab bar */
+
+/* Switch */
+
+/* Containers */
+
+/* Icon Button */
+
+/* Navigation bar */
+
+/* List */
+
+/* Search Input */
+
+/* Text Area */
+
+/* Checkbox */
+
+/* Radio */
+
+/* Range input */
+
+/* Search Input */
+
+/* Switch */
+
+/* Text Input */
+
+/* Radio input */
+
+/* Overlay */
+
+/* Textarea */
+
+/* Progress bar container */
+
+/* Progress bar progress */
+
+/* Search input */
+
+/* Switch */
+
+/* Notification */ \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.eot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.eot
new file mode 100644
index 0000000..9e9e4de
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.eot
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.svg
new file mode 100644
index 0000000..f4a1739
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.svg
@@ -0,0 +1,242 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="source_code_proregular" horiz-adv-x="1228" >
+<font-face units-per-em="2048" ascent="1536" descent="-512" />
+<missing-glyph horiz-adv-x="500" />
+<glyph />
+<glyph />
+<glyph unicode="&#xd;" />
+<glyph unicode=" " />
+<glyph unicode="!" d="M465 135q0 70 43 113t106 43t106.5 -43t43.5 -113q0 -72 -43.5 -116t-106.5 -44t-106 44t-43 116zM532 1372h164l-4 -192l-20 -705h-115l-20 705z" />
+<glyph unicode="&#x22;" d="M266 1407h226l-3 -225l-53 -461h-114l-52 461zM737 1407h226l-5 -225l-51 -461h-114l-54 461z" />
+<glyph unicode="#" d="M178 418v117h176l39 303h-174v118h187l49 375h108l-47 -375h270l50 375h108l-47 -375h166v-118h-178l-39 -303h176v-117h-191l-49 -418h-110l51 418h-272l-50 -418h-110l49 418h-162zM465 535h270l39 303h-272z" />
+<glyph unicode="$" d="M174 231l80 117q192 -139 381 -139q118 0 183 49t65 129q0 45 -28 82.5t-73.5 63t-104 51.5t-119.5 47.5t-119.5 52.5t-104 65.5t-73.5 86.5t-28 116q0 128 90.5 211.5t241.5 98.5v270h123v-268q104 -8 180 -48t146 -108l-90 -98q-78 61 -142 88.5t-159 27.5 q-103 0 -164.5 -46t-61.5 -124q0 -45 36 -81.5t93.5 -62.5t127 -51t139 -56.5t127 -70t93.5 -99t36 -136.5q0 -131 -99.5 -219.5t-261.5 -105.5v-299h-123v297q-110 9 -213.5 52.5t-177.5 106.5z" />
+<glyph unicode="%" d="M53 997q0 156 79.5 245t207.5 89q126 0 205.5 -89t79.5 -245q0 -157 -79.5 -248.5t-205.5 -91.5q-127 0 -207 91.5t-80 248.5zM59 158l375 385l66 -62l-342 -415zM180 997q0 -116 44.5 -177.5t115.5 -61.5q69 0 113.5 62t44.5 177q0 117 -43.5 174.5t-114.5 57.5 q-72 0 -116 -57.5t-44 -174.5zM604 317q0 155 79.5 243.5t205.5 88.5q128 0 207.5 -88.5t79.5 -243.5q0 -158 -80 -250t-207 -92q-126 0 -205.5 92t-79.5 250zM729 862l344 416l98 -92l-374 -385zM731 317q0 -116 44 -177.5t114 -61.5q71 0 115.5 61t44.5 178q0 116 -44 174 t-116 58q-70 0 -114 -58t-44 -174z" />
+<glyph unicode="&#x26;" d="M86 348q0 63 20 119.5t58 104.5t78 84t96 77q-90 175 -90 318q0 136 82 226.5t213 90.5q122 0 191 -72.5t69 -193.5q0 -36 -9.5 -71t-22 -62.5t-39 -60t-44.5 -52.5t-56 -52t-56.5 -47t-61.5 -48q129 -206 328 -377q111 159 170 393h155q-78 -282 -217 -481 q122 -94 232 -129l-47 -140q-136 42 -281 154q-161 -154 -367 -154q-178 0 -289.5 104.5t-111.5 268.5zM250 358q0 -110 74 -178.5t184 -68.5q123 0 235 106q-202 180 -342 401q-73 -64 -112 -126t-39 -134zM393 1053q0 -106 62 -236q67 48 108 84.5t72 89.5t31 109 q0 64 -30 105.5t-93 41.5q-69 0 -109.5 -54.5t-40.5 -139.5z" />
+<glyph unicode="'" d="M502 1407h225l-4 -225l-51 -461h-115l-51 461z" />
+<glyph unicode="(" d="M426 569q0 289 120.5 524t340.5 406l92 -86q-205 -173 -303 -379.5t-98 -464.5t98 -464t303 -379l-92 -86q-220 171 -340.5 405.5t-120.5 523.5z" />
+<glyph unicode=")" d="M250 -274q205 173 303 379t98 464t-98 464.5t-303 379.5l92 86q220 -171 340.5 -406t120.5 -524t-120.5 -523.5t-340.5 -405.5z" />
+<glyph unicode="*" d="M213 1124l33 95l297 -84l22 323h99l22 -321l297 82l33 -95l-283 -127l178 -290l-86 -60l-211 268l-211 -268l-86 60l179 290z" />
+<glyph unicode="+" d="M174 571v127h373v400h135v-400h373v-127h-373v-399h-135v399h-373z" />
+<glyph unicode="," d="M403 -330q128 58 191.5 140t67.5 202q-24 -4 -39 -4q-69 0 -114.5 40t-45.5 114q0 72 47.5 113.5t116.5 41.5q89 0 136.5 -70t47.5 -192q0 -177 -94 -302t-266 -189z" />
+<glyph unicode="-" d="M274 526v148h680v-148h-680z" />
+<glyph unicode="." d="M449 147q0 77 47.5 126t117.5 49t118 -49t48 -126q0 -75 -48 -123.5t-118 -48.5t-117.5 48.5t-47.5 123.5z" />
+<glyph unicode="/" d="M203 -328l671 1782h152l-672 -1782h-151z" />
+<glyph unicode="0" d="M145 657q0 325 124 499.5t345 174.5t345 -174.5t124 -499.5q0 -324 -124.5 -503t-344.5 -179t-344.5 179t-124.5 503zM303 657q0 -271 84 -408.5t227 -137.5t227.5 137.5t84.5 408.5q0 272 -84.5 405.5t-227.5 133.5t-227 -133.5t-84 -405.5zM487 672q0 61 37 98t90 37 t90 -37t37 -98q0 -62 -37 -99.5t-90 -37.5t-90 37.5t-37 99.5z" />
+<glyph unicode="1" d="M201 0v139h370v963h-278v108q187 27 321 97h125v-1168h342v-139h-880z" />
+<glyph unicode="2" d="M141 1133q95 97 197.5 147.5t232.5 50.5q195 0 310.5 -105.5t115.5 -279.5q0 -60 -18.5 -121.5t-59.5 -127.5t-88 -127t-123 -138.5t-143.5 -141.5t-169.5 -157q160 12 244 12h430v-145h-919v100q127 112 206 184t166.5 157t137.5 144.5t94.5 124t63 119.5t18.5 109 q0 117 -72.5 186.5t-212.5 69.5q-162 0 -313 -158z" />
+<glyph unicode="3" d="M117 160l86 110q163 -155 375 -155q136 0 224.5 66t88.5 173q0 260 -475 260v129q220 0 324 67t104 177q0 95 -72.5 151t-193.5 56q-175 0 -322 -133l-90 106q190 164 418 164q190 0 311 -89t121 -243q0 -113 -75 -191t-204 -120v-8q140 -30 232 -117t92 -215 q0 -112 -64.5 -198t-171 -130.5t-237.5 -44.5q-286 0 -471 185z" />
+<glyph unicode="4" d="M80 360v113l653 834h180v-811h203v-136h-203v-360h-159v360h-674zM266 496h488v405q3 104 10 232h-10q-23 -36 -70.5 -102t-62.5 -89z" />
+<glyph unicode="5" d="M115 154l84 110q77 -70 162.5 -109.5t205.5 -39.5q141 0 236.5 82.5t95.5 216.5t-86.5 210t-234.5 76q-76 0 -133.5 -18.5t-133.5 -60.5l-90 57l43 629h740v-146h-590l-35 -387q122 53 242 53q96 0 176 -24.5t141.5 -73.5t96 -128.5t34.5 -182.5q0 -136 -69.5 -239 t-177.5 -153.5t-236 -50.5q-159 0 -270 49t-201 130z" />
+<glyph unicode="6" d="M158 604q0 153 29.5 276.5t80.5 206.5t121.5 138.5t149 80.5t166.5 25q215 0 364 -139l-94 -105q-111 103 -260 103q-82 0 -150.5 -29.5t-125 -92.5t-89.5 -175t-35 -264q79 79 176.5 124.5t194.5 45.5q187 0 297.5 -104t110.5 -300q0 -121 -60.5 -218.5t-160 -149.5 t-216.5 -52q-223 0 -361 162.5t-138 466.5zM322 496q19 -188 105.5 -287.5t229.5 -99.5q119 0 198 79.5t79 206.5q0 134 -72 205.5t-207 71.5q-179 0 -333 -176z" />
+<glyph unicode="7" d="M143 1161v146h947v-105q-172 -196 -267.5 -377.5t-135 -368.5t-48.5 -456h-176q17 372 113.5 628.5t320.5 532.5h-754z" />
+<glyph unicode="8" d="M139 334q0 215 281 348v8q-199 124 -199 305q0 149 114 242.5t290 93.5q189 0 297 -96.5t108 -251.5q0 -87 -55.5 -168.5t-143.5 -142.5v-8q60 -30 101 -58t79 -68t57 -93.5t19 -120.5q0 -151 -125.5 -250t-343.5 -99t-348.5 100.5t-130.5 258.5zM293 350 q0 -110 90.5 -180t239.5 -70q143 0 223 63t80 167q0 49 -20.5 88.5t-44 64.5t-81.5 53t-92.5 40.5t-118.5 40.5q-35 12 -53 18q-106 -59 -164.5 -126.5t-58.5 -158.5zM375 995q0 -56 25 -100t76.5 -77.5t106.5 -56t138 -48.5q164 121 164 262q0 101 -69.5 166t-194.5 65 q-109 0 -177.5 -58t-68.5 -153z" />
+<glyph unicode="9" d="M137 911q0 121 60.5 218.5t159 149.5t214.5 52q108 0 199 -40t159 -116.5t106 -197.5t38 -275q0 -189 -45 -333t-123 -228t-173.5 -125t-205.5 -41q-212 0 -364 138l94 106q109 -104 260 -104q64 0 120 18t106.5 59.5t87 105t59 160t24.5 218.5q-81 -80 -176.5 -124 t-193.5 -44q-187 0 -296.5 103.5t-109.5 299.5zM297 911q0 -134 71 -205t207 -71q80 0 166.5 42.5t167.5 131.5q-20 191 -105.5 290t-230.5 99q-119 0 -197.5 -80t-78.5 -207z" />
+<glyph unicode=":" d="M449 147q0 77 47.5 126t117.5 49t118 -49t48 -126q0 -75 -48 -123.5t-118 -48.5t-117.5 48.5t-47.5 123.5zM449 883q0 75 47.5 123.5t117.5 48.5t118 -48.5t48 -123.5q0 -77 -48 -125.5t-118 -48.5t-117.5 48.5t-47.5 125.5z" />
+<glyph unicode=";" d="M403 -330q128 58 191.5 140t67.5 202q-24 -4 -39 -4q-69 0 -114.5 40t-45.5 114q0 72 47.5 113.5t116.5 41.5q89 0 136.5 -70t47.5 -192q0 -177 -94 -302t-266 -189zM449 883q0 75 47.5 123.5t117.5 48.5t118 -48.5t48 -123.5q0 -77 -48 -125.5t-118 -48.5t-117.5 48.5 t-47.5 125.5z" />
+<glyph unicode="&#x3c;" d="M246 575v127l764 519v-162l-617 -416v-8l617 -416v-162z" />
+<glyph unicode="=" d="M174 352v127h881v-127h-881zM174 791v127h881v-127h-881z" />
+<glyph unicode="&#x3e;" d="M219 57v162l617 416v8l-617 416v162l764 -519v-127z" />
+<glyph unicode="?" d="M223 1231q159 166 377 166q171 0 276 -87.5t105 -232.5q0 -54 -20.5 -103t-52.5 -87.5t-70.5 -75t-75.5 -73t-66.5 -74.5t-44 -86.5t-6.5 -102.5h-149q-10 60 2 113.5t39.5 94.5t63 78.5t73.5 72.5t69.5 68.5t51.5 74t20 82.5q0 88 -58 143t-167 55q-148 0 -266 -118z M436 135q0 70 43.5 113t106.5 43t106 -43t43 -113q0 -72 -43 -116t-106 -44t-106.5 44t-43.5 116z" />
+<glyph unicode="@" d="M100 512q0 191 46.5 342.5t128 248t190.5 147t237 50.5q137 0 232.5 -65t139.5 -173t44 -249v-608h-102l-15 119h-8q-47 -61 -120.5 -102.5t-149.5 -41.5q-112 0 -188 74t-76 195q0 152 134.5 234.5t405.5 115.5v28q0 103 -30.5 182t-101 129t-173.5 50q-94 0 -177 -43.5 t-147.5 -126.5t-102.5 -215t-38 -297q0 -161 36.5 -292t100.5 -217t150 -132.5t186 -46.5q164 0 289 92l58 -92q-162 -113 -351 -113q-123 0 -230.5 53t-190 152.5t-130 254.5t-47.5 347zM594 453q0 -72 44.5 -113t119.5 -41q113 0 229 131v258q-210 -29 -301.5 -84.5 t-91.5 -150.5z" />
+<glyph unicode="A" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="B" d="M211 0v1343h369q105 0 187.5 -18t144.5 -56.5t95 -102t33 -150.5q0 -104 -60.5 -183.5t-174.5 -109.5v-8q150 -24 230.5 -105t80.5 -217q0 -192 -137 -292.5t-369 -100.5h-399zM383 135h203q175 0 268.5 66t93.5 200q0 242 -362 242h-203v-508zM383 770h168 q168 0 244.5 58t76.5 173q0 107 -77.5 157t-235.5 50h-176v-438z" />
+<glyph unicode="C" d="M135 672q0 319 166.5 507.5t433.5 188.5q113 0 207.5 -46t159.5 -118l-96 -108q-116 123 -271 123q-194 0 -309 -146.5t-115 -396.5q0 -253 115 -402t309 -149q168 0 301 149l99 -104q-168 -195 -410 -195q-127 0 -235 48t-187 136t-123.5 220t-44.5 293z" />
+<glyph unicode="D" d="M174 0v1343h328q303 0 462.5 -172t159.5 -493q0 -323 -159 -500.5t-455 -177.5h-336zM344 139h148q226 0 341 140t115 399q0 256 -114.5 391t-341.5 135h-148v-1065z" />
+<glyph unicode="E" d="M236 0v1343h829v-143h-657v-422h555v-145h-555v-488h677v-145h-849z" />
+<glyph unicode="F" d="M276 0v1343h822v-143h-652v-455h551v-143h-551v-602h-170z" />
+<glyph unicode="G" d="M109 672q0 321 165.5 508.5t430.5 187.5q214 0 370 -164l-96 -108q-56 59 -120 91t-154 32q-190 0 -304 -147t-114 -396q0 -256 108.5 -403.5t304.5 -147.5q70 0 133 21.5t101 58.5v350h-268v141h426v-565q-69 -69 -173.5 -112.5t-228.5 -43.5q-258 0 -419.5 187 t-161.5 510z" />
+<glyph unicode="H" d="M162 0v1343h172v-563h561v563h172v-1343h-172v633h-561v-633h-172z" />
+<glyph unicode="I" d="M195 0v145h333v1055h-333v143h839v-143h-334v-1055h334v-145h-839z" />
+<glyph unicode="J" d="M166 199l110 102q57 -87 131 -131.5t154 -44.5q145 0 212 76.5t67 242.5v758h-564v144h734v-916q0 -78 -14 -143.5t-47 -124t-83 -99.5t-126.5 -64.5t-174.5 -23.5q-120 0 -226.5 56t-172.5 168z" />
+<glyph unicode="K" d="M201 0v1343h172v-673h6l565 673h193l-424 -512l473 -831h-191l-389 698l-233 -272v-426h-172z" />
+<glyph unicode="L" d="M274 0v1343h168v-1198h666v-145h-834z" />
+<glyph unicode="M" d="M166 0v1343h188l191 -571l67 -217h9l65 217l188 571h189v-1343h-145v756q0 141 20 413h-6l-88 -286l-185 -518h-92l-184 518l-90 286h-6q22 -300 22 -413v-756h-143z" />
+<glyph unicode="N" d="M170 0v1343h174l436 -847l135 -275h5q-1 32 -12 188t-11 238v696h162v-1343h-174l-436 848l-136 274h-4q2 -40 12.5 -190t10.5 -230v-702h-162z" />
+<glyph unicode="O" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395z" />
+<glyph unicode="P" d="M209 0v1343h412q115 0 203 -20.5t155 -66t102 -123t35 -185.5q0 -206 -133 -311t-362 -105h-242v-532h-170zM379 672h219q178 0 263 67t85 209t-83.5 200t-264.5 58h-219v-534z" />
+<glyph unicode="Q" d="M100 678q0 319 140.5 505.5t371.5 186.5q230 0 370 -187t140 -505q0 -284 -111.5 -468.5t-299.5 -223.5q33 -85 108.5 -129.5t181.5 -44.5q51 0 101 20l31 -137q-78 -29 -152 -29q-170 0 -284.5 86.5t-168.5 231.5q-195 34 -311.5 219.5t-116.5 474.5zM274 678 q0 -252 91.5 -403.5t246.5 -151.5q153 0 244.5 152t91.5 403q0 250 -91 397.5t-245 147.5q-155 0 -246.5 -147.5t-91.5 -397.5z" />
+<glyph unicode="R" d="M205 0v1343h418q469 0 469 -376q0 -152 -80 -248t-221 -133l342 -586h-195l-324 567h-239v-567h-170zM375 707h223q158 0 241 65.5t83 194.5q0 128 -80.5 183.5t-243.5 55.5h-223v-499z" />
+<glyph unicode="S" d="M137 174l103 119q77 -77 178.5 -122.5t208.5 -45.5q141 0 220 59.5t79 159.5q0 29 -7 53.5t-16.5 43t-29.5 37t-35.5 30t-46.5 26.5t-50 23.5t-57 24.5l-192 84q-291 114 -291 346q0 154 124 255t316 101q122 0 230 -45t184 -121l-90 -110q-143 127 -324 127 q-122 0 -194 -53t-72 -144q0 -27 8.5 -51t18 -41t32.5 -35.5t36.5 -28t47 -25.5t46 -21t50.5 -21l189 -82q68 -28 117.5 -57.5t92.5 -72t65 -100t22 -129.5q0 -164 -129.5 -273.5t-345.5 -109.5q-144 0 -269 52.5t-219 146.5z" />
+<glyph unicode="T" d="M86 1200v143h1057v-143h-443v-1200h-172v1200h-442z" />
+<glyph unicode="U" d="M162 508v835h172v-839q0 -199 75.5 -289t206.5 -90t208 90.5t77 288.5v839h166v-835q0 -275 -121 -404t-330 -129q-102 0 -183 29.5t-142.5 92t-95 166.5t-33.5 245z" />
+<glyph unicode="V" d="M88 1343h180l217 -725q14 -46 57.5 -199.5t71.5 -244.5h9q44 143 129 444l215 725h174l-426 -1343h-199z" />
+<glyph unicode="W" d="M20 1346h170l109 -844q3 -62 14.5 -174t14.5 -158h6q76 291 86 332l141 495h121l141 -495q20 -86 84 -332h8q4 56 14.5 166.5t14.5 165.5l103 844h161l-198 -1346h-189l-153 563q-34 153 -50 242h-6q-30 -150 -53 -242l-147 -563h-185z" />
+<glyph unicode="X" d="M111 0l401 694l-375 649h189l188 -344q52 -91 109 -194h8q64 134 96 194l184 344h181l-375 -657l401 -686h-188l-203 362q-22 39 -119 216h-8q-57 -120 -108 -216l-201 -362h-180z" />
+<glyph unicode="Y" d="M78 1343h180l203 -399q23 -47 73.5 -151t79.5 -162h9q28 58 81 163t76 152l195 397h176l-451 -864v-479h-172v479z" />
+<glyph unicode="Z" d="M133 0v102l752 1100h-686v144h895v-103l-754 -1098h764v-145h-971z" />
+<glyph unicode="[" d="M463 -311v1761h565v-98h-432v-1565h432v-98h-565z" />
+<glyph unicode="\" d="M203 1454h151l672 -1782h-152z" />
+<glyph unicode="]" d="M203 -213h430v1565h-430v98h565v-1761h-565v98z" />
+<glyph unicode="^" d="M227 582l314 790h147l313 -790h-147l-135 360l-101 272h-8l-100 -272l-135 -360h-148z" />
+<glyph unicode="_" d="M123 -141h983v-146h-983v146z" />
+<glyph unicode="`" d="M379 1477h184l185 -303h-130z" />
+<glyph unicode="a" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5z" />
+<glyph unicode="b" d="M190 0v1458h168v-397l-4 -193q72 70 161.5 111t176.5 41q198 0 306 -136t108 -370q0 -124 -37 -227t-99.5 -170.5t-143.5 -104.5t-171 -37q-72 0 -155.5 36.5t-153.5 99.5h-6l-14 -111h-136zM358 233q66 -59 138.5 -87.5t132.5 -28.5q133 0 218 107t85 288 q0 172 -68.5 269.5t-212.5 97.5q-143 0 -293 -150v-496z" />
+<glyph unicode="c" d="M164 496q0 122 44.5 222.5t120.5 165.5t176.5 100.5t213.5 35.5q212 0 362 -146l-84 -108q-131 115 -272 115q-172 0 -279.5 -106.5t-107.5 -278.5q0 -170 105.5 -275.5t277.5 -105.5q159 0 309 125l74 -109q-174 -156 -395 -156q-156 0 -279 60.5t-194.5 180 t-71.5 280.5z" />
+<glyph unicode="d" d="M123 496q0 118 37.5 218t100 166t144 103t170.5 37q86 0 157 -32.5t145 -96.5l-7 184v383h168v-1458h-139l-14 131h-6q-67 -68 -152 -112t-172 -44q-198 0 -315 137.5t-117 383.5zM297 498q0 -179 77.5 -280t215.5 -101q146 0 280 149v496q-125 117 -262 117 q-131 0 -221 -107t-90 -274z" />
+<glyph unicode="e" d="M141 496q0 118 42.5 218.5t113.5 166.5t162 102.5t188 36.5q212 0 332.5 -127t120.5 -340q0 -55 -6 -92h-779q9 -160 113 -255t268 -95q155 0 303 92l60 -111q-182 -117 -383 -117q-111 0 -208 36t-170 101.5t-115 165t-42 218.5zM313 571h631q0 151 -78 233.5t-217 82.5 q-126 0 -222 -85t-114 -231z" />
+<glyph unicode="f" d="M211 858v127l285 10v84q0 189 100.5 296.5t300.5 107.5q147 0 287 -58l-39 -127q-106 48 -232 48q-251 0 -251 -261v-90h417v-137h-417v-858h-166v858h-285z" />
+<glyph unicode="g" d="M147 -182q0 60 42.5 118t121.5 103v8q-102 56 -102 164q0 48 31.5 98t87.5 88v9q-55 41 -89 107t-34 151q0 158 114 257t277 99q80 0 147 -25h412v-129h-266q92 -96 92 -209q0 -156 -109.5 -249t-275.5 -93q-87 0 -168 37q-78 -49 -78 -114q0 -115 207 -115h223 q195 0 287 -55t92 -179q0 -144 -153.5 -246t-399.5 -102q-218 0 -338.5 72.5t-120.5 204.5zM293 -166q0 -80 84.5 -128t240.5 -48q166 0 270.5 62t104.5 143q0 68 -54 94.5t-173 26.5h-195q-94 0 -151 16q-127 -69 -127 -166zM367 664q0 -105 66.5 -170.5t162.5 -65.5 q97 0 163 65.5t66 170.5q0 103 -66 168t-163 65q-96 0 -162.5 -65.5t-66.5 -167.5z" />
+<glyph unicode="h" d="M190 0v1458h168v-397l-8 -236q89 93 178.5 144t198.5 51q344 0 344 -402v-618h-168v596q0 143 -54 210.5t-175 67.5q-85 0 -153.5 -41.5t-162.5 -138.5v-694h-168z" />
+<glyph unicode="i" d="M184 858v137h631v-995h-168v858h-463zM578 1329q0 59 38 95t97 36q58 0 96.5 -36t38.5 -95q0 -58 -38.5 -93.5t-96.5 -35.5q-59 0 -97 35.5t-38 93.5z" />
+<glyph unicode="j" d="M113 -377l55 125q113 -55 227 -55q142 0 197 67t55 203v895h-463v137h631v-1020q0 -97 -20.5 -170t-67 -131t-129.5 -88t-201 -30q-147 0 -284 67zM578 1329q0 59 38 95t97 36q58 0 96.5 -36t38.5 -95q0 -58 -38.5 -93.5t-96.5 -35.5q-59 0 -97 35.5t-38 93.5z" />
+<glyph unicode="k" d="M217 0v1458h168v-987l6 2l539 522h192l-397 -395l451 -600h-189l-366 492l-236 -226v-266h-168z" />
+<glyph unicode="l" d="M166 1321v137h508v-1136q0 -106 51 -156.5t143 -50.5q84 0 189 47l43 -127q-61 -22 -89 -31.5t-78.5 -19t-101.5 -9.5q-159 0 -242 91.5t-83 267.5v987h-340z" />
+<glyph unicode="m" d="M123 0v995h131l14 -131h6q40 76 92.5 116t131.5 40q151 0 188 -172q48 85 103 128.5t133 43.5q103 0 160 -79.5t57 -227.5v-713h-162v698q0 176 -109 176q-52 0 -91 -36.5t-79 -116.5v-721h-135v698q0 176 -112 176q-51 0 -88.5 -36.5t-77.5 -116.5v-721h-162z" />
+<glyph unicode="n" d="M190 0v995h140l14 -170h8q87 93 176.5 144t198.5 51q344 0 344 -402v-618h-168v596q0 143 -54 210.5t-175 67.5q-85 0 -153.5 -41.5t-162.5 -138.5v-694h-168z" />
+<glyph unicode="o" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5z" />
+<glyph unicode="p" d="M190 -420v1415h140l14 -127h6q72 68 163.5 110t180.5 42q198 0 305 -136t107 -372q0 -123 -37 -226t-99.5 -170t-144.5 -104t-172 -37q-70 0 -151.5 34.5t-147.5 94.5l4 -188v-336h-168zM358 233q66 -59 138 -87.5t129 -28.5q136 0 221.5 106.5t85.5 288.5 q0 172 -68.5 269.5t-212.5 97.5q-143 0 -293 -150v-496z" />
+<glyph unicode="q" d="M123 496q0 118 37.5 218t100 166t144 103t170.5 37q88 0 161.5 -33.5t146.5 -101.5h6l14 110h135v-1415h-168v367l9 180q-159 -152 -324 -152q-198 0 -315 137.5t-117 383.5zM297 498q0 -179 77.5 -280t215.5 -101q146 0 280 149v496q-125 117 -262 117q-131 0 -221 -107 t-90 -274z" />
+<glyph unicode="r" d="M299 0v995h139l15 -235h6q80 123 194.5 191.5t249.5 68.5q114 0 195 -41l-35 -145q-55 20 -92.5 27t-93.5 7q-247 0 -410 -284v-584h-168z" />
+<glyph unicode="s" d="M147 131l82 111q90 -66 188 -101t224 -35q128 0 197 44t69 112q0 60 -72.5 105t-250.5 88q-109 27 -190.5 64t-135 94t-53.5 124q0 125 109.5 204t308.5 79q107 0 213.5 -36t185.5 -91l-82 -109q-151 105 -317 105q-130 0 -188 -39.5t-58 -104.5q0 -30 21 -55.5t63.5 -47 t94.5 -38.5t124 -35q209 -53 303 -120t94 -177q0 -127 -118 -212t-324 -85q-263 0 -488 156z" />
+<glyph unicode="t" d="M141 858v127l287 10l23 279h139v-279h487v-137h-487v-473q0 -140 56 -206t196 -66q122 0 239 45l35 -123q-160 -60 -311 -60q-106 0 -181.5 29t-119 85t-63 129t-19.5 169v471h-281z" />
+<glyph unicode="u" d="M158 377v618h170v-596q0 -144 53.5 -211t175.5 -67q84 0 154 42.5t155 141.5v690h168v-995h-137l-14 174h-9q-170 -199 -370 -199q-346 0 -346 402z" />
+<glyph unicode="v" d="M104 995h170l230 -565q32 -77 112 -293h9q6 15 45 124.5t63 168.5l230 565h161l-411 -995h-189z" />
+<glyph unicode="w" d="M16 995h170l123 -575q33 -174 49 -277h9q37 189 59 277l123 516h139l127 -516q56 -263 59 -277h9q14 73 49 277l121 575h159l-215 -995h-204l-119 504q-28 145 -56 289h-8q-49 -264 -55 -291l-115 -502h-200z" />
+<glyph unicode="x" d="M131 0l379 516l-350 479h186l158 -219q64 -97 117 -168h8q47 70 112 172l150 215h178l-354 -493l381 -502h-185l-174 229q-114 158 -131 181h-8q-82 -118 -123 -181l-164 -229h-180z" />
+<glyph unicode="y" d="M100 995h170l244 -551q17 -39 37.5 -87t46 -108.5t39.5 -92.5h8q92 247 107 288l217 551h159l-438 -1077q-130 -346 -422 -346q-73 0 -131 20l35 134q51 -15 90 -15q188 0 273 213l30 74z" />
+<glyph unicode="z" d="M145 0v90l682 768h-606v137h848v-90l-684 -768h705v-137h-945z" />
+<glyph unicode="{" d="M246 516v107q297 2 297 159q0 63 -9.5 193.5t-9.5 202.5q0 153 89 212.5t290 59.5h125v-98h-106q-104 0 -159 -19.5t-75 -57.5t-20 -108q0 -57 6 -181t6 -189q0 -102 -41 -154t-145 -70v-8q104 -18 145 -69.5t41 -153.5q0 -71 -6 -190.5t-6 -180.5q0 -104 51 -144 t203 -40h106v-98h-125q-201 0 -290 59.5t-89 212.5q0 77 9.5 202.5t9.5 192.5q0 158 -297 160z" />
+<glyph unicode="|" d="M555 -512v2048h119v-2048h-119z" />
+<glyph unicode="}" d="M203 -213h104q104 0 159.5 19t76 57t20.5 108q0 61 -6 180.5t-6 190.5q0 102 40.5 153.5t143.5 69.5v8q-103 18 -143.5 69.5t-40.5 154.5q0 65 6 189t6 181q0 104 -52 144.5t-204 40.5h-104v98h125q199 0 288 -59.5t89 -212.5q0 -72 -9.5 -202.5t-9.5 -193.5 q0 -157 297 -159v-107q-297 -2 -297 -160q0 -67 9.5 -192.5t9.5 -202.5q0 -153 -89 -212.5t-288 -59.5h-125v98z" />
+<glyph unicode="~" d="M156 528q96 256 278 256q54 0 108.5 -27t91 -59t81.5 -59t84 -27q52 0 92.5 38t73.5 138l108 -49q-96 -254 -278 -254q-54 0 -108.5 27t-91 59t-81.5 59t-84 27q-52 0 -92.5 -38.5t-73.5 -137.5z" />
+<glyph unicode="&#xa0;" />
+<glyph unicode="&#xa1;" d="M465 862q0 70 43 114t106 44t106.5 -44t43.5 -114q0 -71 -43 -114t-107 -43t-106.5 42.5t-42.5 114.5zM532 -377l5 193l20 704h115l20 -704l4 -193h-164z" />
+<glyph unicode="&#xa2;" d="M231 635q0 205 115.5 333t296.5 152v217h105v-211q150 -8 268 -118l-82 -107q-87 81 -186 86v-704q112 8 215 96l73 -107q-134 -117 -288 -129v-211h-105v213q-187 21 -299.5 149.5t-112.5 340.5zM397 635q0 -136 65 -227t181 -117v686q-115 -26 -180.5 -117t-65.5 -225z " />
+<glyph unicode="&#xa3;" d="M158 584v106l202 8q-2 6 -11.5 31.5t-12 33.5t-10 30.5t-10.5 33.5t-8 30.5t-7 33t-4 30.5t-2 33q0 173 117 275t313 102q221 0 360 -153l-98 -97q-109 109 -254 109q-131 0 -203.5 -66t-72.5 -174q0 -40 10.5 -88t19.5 -76t31 -88h387v-114h-354q12 -55 12 -115 q0 -104 -37 -177t-116 -138v-9h677v-145h-927v102q124 56 189 153t65 216q0 50 -17 113h-239z" />
+<glyph unicode="&#xa4;" d="M119 262l172 174q-74 99 -74 238q0 138 72 239l-170 177l90 92l178 -185q98 76 227 76q126 0 228 -76l178 185l90 -92l-172 -177q74 -99 74 -239q0 -134 -74 -238l172 -174l-90 -92l-180 182q-96 -78 -226 -78q-126 0 -227 78l-178 -182zM373 674q0 -121 69.5 -198 t171.5 -77t172 77t70 198t-70 197.5t-172 76.5t-171.5 -76.5t-69.5 -197.5z" />
+<glyph unicode="&#xa5;" d="M109 1307h174l188 -351q20 -39 66.5 -131.5t74.5 -144.5h9q109 214 143 276l188 351h168l-381 -656h332v-96h-375v-133h375v-98h-375v-324h-168v324h-370v98h370v133h-370v96h329z" />
+<glyph unicode="&#xa6;" d="M555 438h119v-950h-119v950zM555 596v940h119v-940h-119z" />
+<glyph unicode="&#xa7;" d="M186 702q0 169 187 267q-64 71 -64 166q0 112 81 189t228 77q178 0 330 -117l-82 -108q-124 94 -239 94q-82 0 -123 -36.5t-41 -92.5q0 -39 25 -72t65.5 -55.5t92.5 -47t106.5 -46.5t106.5 -54t92.5 -68.5t65.5 -92.5t25 -123q0 -93 -47 -156t-137 -111q60 -70 60 -165 q0 -122 -92.5 -201.5t-237.5 -79.5q-111 0 -206.5 38.5t-160.5 106.5l103 92q58 -53 120 -79.5t144 -26.5q81 0 128.5 40.5t47.5 100.5q0 47 -32 84t-83 63.5t-112.5 51.5t-123 56t-112.5 69.5t-83 99t-32 137.5zM332 713q0 -51 26.5 -91.5t75.5 -70.5t99 -52.5t117 -51.5 t110 -54q70 31 103.5 70.5t33.5 105.5q0 52 -26 93.5t-75 72t-98.5 53t-117 52t-109.5 53.5q-139 -71 -139 -180z" />
+<glyph unicode="&#xa8;" d="M307 1317q0 48 31 80.5t80 32.5q47 0 78.5 -32.5t31.5 -80.5t-31.5 -80.5t-78.5 -32.5q-49 0 -80 32.5t-31 80.5zM700 1317q0 47 32 80t79 33q49 0 80 -32.5t31 -80.5t-31 -80.5t-80 -32.5q-47 0 -79 33t-32 80z" />
+<glyph unicode="&#xa9;" d="M61 662q0 154 42.5 281.5t116.5 213.5t175.5 133t218.5 47t218.5 -47t175.5 -133t116.5 -213.5t42.5 -281.5q0 -308 -157 -496.5t-396 -188.5t-396 188.5t-157 496.5zM156 662q0 -269 126.5 -434t331.5 -165q206 0 332.5 165.5t126.5 433.5t-126.5 429.5t-332.5 161.5 t-332 -161.5t-126 -429.5zM299 662q0 173 99.5 280t238.5 107q120 0 213 -97l-70 -80q-71 64 -137 64q-93 0 -151 -76.5t-58 -197.5q0 -134 55 -213.5t146 -79.5q83 0 166 69l61 -86q-106 -96 -231 -96q-142 0 -237 110.5t-95 295.5z" />
+<glyph unicode="&#xaa;" d="M342 707q0 106 104 163.5t328 81.5q-4 152 -143 152q-93 0 -211 -70l-51 88q147 86 282 86q127 0 190.5 -72t63.5 -204v-400h-106l-11 76h-4q-119 -92 -231 -92q-90 0 -150.5 52.5t-60.5 138.5zM471 715q0 -48 33.5 -72.5t87.5 -24.5q84 0 182 82v168 q-162 -18 -232.5 -55.5t-70.5 -97.5z" />
+<glyph unicode="&#xab;" d="M168 434v164l313 328l80 -72l-260 -338l260 -340l-80 -70zM639 434v164l311 328l82 -72l-260 -338l260 -340l-82 -70z" />
+<glyph unicode="&#xac;" d="M174 571v127h881v-526h-135v399h-746z" />
+<glyph unicode="&#xad;" d="M274 526v148h680v-148h-680z" />
+<glyph unicode="&#xae;" d="M229 1057q0 177 111 290t274 113q162 0 273.5 -113t111.5 -290t-112 -290.5t-273 -113.5q-163 0 -274 113.5t-111 290.5zM309 1057q0 -145 87 -236.5t218 -91.5t217.5 91.5t86.5 236.5q0 144 -87 236.5t-217 92.5t-217.5 -93t-87.5 -236zM465 854v416h156q71 0 116 -32 t45 -101q0 -37 -21.5 -69t-55.5 -44l94 -170h-94l-72 143h-84v-143h-84zM549 1063h53q42 0 66 18.5t24 51.5q0 67 -86 67h-57v-137z" />
+<glyph unicode="&#xaf;" d="M362 1231v117h504v-117h-504z" />
+<glyph unicode="&#xb0;" d="M358 1139q0 118 75 191t181 73q107 0 182.5 -73t75.5 -191q0 -115 -76 -187.5t-182 -72.5t-181 72.5t-75 187.5zM461 1139q0 -72 43 -119t110 -47q69 0 112.5 47t43.5 119q0 75 -43.5 122.5t-112.5 47.5q-68 0 -110.5 -47.5t-42.5 -122.5z" />
+<glyph unicode="&#xb1;" d="M174 0v127h881v-127h-881zM174 596v127h373v375h135v-375h373v-127h-373v-363h-135v363h-373z" />
+<glyph unicode="&#xb2;" d="M354 1425q106 125 244 125q111 0 173.5 -55t62.5 -156q0 -38 -16.5 -76t-52.5 -79t-71 -75t-92 -85q-11 -9 -16 -14h278v-109h-487v74q92 70 143.5 112t99.5 87.5t67.5 80.5t19.5 68q0 56 -33 88.5t-92 32.5q-80 0 -146 -86z" />
+<glyph unicode="&#xb3;" d="M352 987l66 80q32 -38 82 -63t104 -25q59 0 93 23.5t34 72.5q0 105 -196 105v77q82 0 123.5 28t41.5 77q0 88 -112 88q-36 0 -77.5 -19.5t-72.5 -50.5l-61 78q39 42 102 67t133 25q97 0 157 -46t60 -126q0 -59 -27 -95t-87 -58q68 -15 106.5 -55.5t38.5 -102.5 q0 -88 -70 -139t-178 -51q-71 0 -140 29t-120 81z" />
+<glyph unicode="&#xb4;" d="M481 1174l185 303h184l-240 -303h-129z" />
+<glyph unicode="&#xb5;" d="M172 -410v1405h168v-608q0 -140 52 -203t169 -63q82 0 147 39.5t146 132.5v702h168v-995h-139l-15 162h-8q-131 -178 -309 -178q-77 0 -129.5 20.5t-91.5 75.5l10 -193v-297h-168z" />
+<glyph unicode="&#xb6;" d="M147 907q0 117 36 203t102.5 136t151.5 73.5t192 23.5h88v-880h-66q-111 0 -201.5 26.5t-159 79.5t-106 139t-37.5 199zM827 -164v1507h166v-1507h-166z" />
+<glyph unicode="&#xb7;" d="M449 711q0 76 47.5 125t117.5 49t118 -49t48 -125q0 -75 -48 -123.5t-118 -48.5t-117.5 48.5t-47.5 123.5z" />
+<glyph unicode="&#xb8;" d="M455 -352q180 24 180 98q0 38 -31.5 61t-97.5 39l82 160h110l-53 -108q121 -41 121 -146q0 -83 -83.5 -129.5t-211.5 -58.5z" />
+<glyph unicode="&#xb9;" d="M426 1372v86q106 16 195 68h102v-625h-129v471h-168z" />
+<glyph unicode="&#xba;" d="M291 862q0 158 94 252t229 94q136 0 230 -93.5t94 -252.5t-94 -252.5t-230 -93.5q-135 0 -229 94t-94 252zM426 862q0 -108 50.5 -173.5t137.5 -65.5t138 65.5t51 173.5q0 107 -51 173.5t-138 66.5t-137.5 -66.5t-50.5 -173.5z" />
+<glyph unicode="&#xbb;" d="M197 176l260 340l-260 338l82 72l311 -328v-164l-311 -328zM668 176l260 340l-260 338l80 72l313 -328v-164l-313 -328z" />
+<glyph unicode="&#xbc;" d="M57 158l375 385l68 -62l-342 -415zM152 1153v86q65 10 107 25.5t85 42.5h105v-625h-130v471h-167zM627 150v63l303 412h145v-387h103v-88h-103v-150h-117v150h-331zM729 862l342 416l100 -92l-374 -385zM758 238h200v114l11 168h-8l-93 -133z" />
+<glyph unicode="&#xbd;" d="M57 158l375 385l68 -62l-342 -415zM152 1153v86q65 10 107 25.5t85 42.5h105v-625h-130v471h-167zM631 524q102 125 241 125q111 0 174.5 -55.5t63.5 -155.5q0 -49 -35 -104.5t-70.5 -91t-117.5 -110.5l-8 -8t-8 -7t-9 -8h279v-109h-490v74q92 70 143.5 112t99.5 87.5 t67.5 80.5t19.5 68q0 56 -33 88.5t-92 32.5q-79 0 -145 -86zM729 862l342 416l100 -92l-374 -385z" />
+<glyph unicode="&#xbe;" d="M78 768l63 80q34 -39 84.5 -64.5t102.5 -25.5q58 0 92.5 24t34.5 72q0 107 -195 107v77q82 0 124 28t42 75q0 41 -28 64.5t-85 23.5q-37 0 -78.5 -18.5t-72.5 -49.5l-62 78q40 42 103.5 67t134.5 25q95 0 156 -47t61 -125q0 -58 -27.5 -94.5t-87.5 -58.5 q68 -15 106 -55.5t38 -102.5q0 -88 -69.5 -139.5t-176.5 -51.5q-71 0 -140 29.5t-120 81.5zM111 158l374 385l66 -62l-342 -415zM627 150v63l305 412h145v-387h103v-88h-103v-150h-119v150h-331zM760 238h198v114l11 168h-8l-91 -133zM780 862l344 416l99 -92l-375 -385z " />
+<glyph unicode="&#xbf;" d="M252 -82q0 54 20.5 103t52.5 87.5t70 75t75 73t66 74.5t43.5 86.5t6.5 102.5h149q10 -60 -2 -113.5t-39.5 -94.5t-63 -78.5t-73.5 -72t-69.5 -68t-51.5 -74t-20 -82.5q0 -88 59 -142.5t168 -54.5q149 0 266 117l99 -93q-155 -165 -377 -165q-171 0 -275 86.5t-104 232.5z M496 862q0 70 43 114t106 44t107.5 -44t44.5 -114q0 -71 -44 -114t-108 -43q-63 0 -106 42.5t-43 114.5z" />
+<glyph unicode="&#xc0;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM346 1675h193l180 -229h-141zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc1;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452zM510 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xc2;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM336 1446l196 229h164l197 -229h-137l-138 139h-8l-137 -139h-137zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc3;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM317 1456q9 98 56 159.5t119 61.5q37 0 73.5 -16.5t60.5 -36.5t54 -36.5t55 -16.5q30 0 52.5 28t29.5 78h94q-9 -97 -56 -159t-118 -62q-46 0 -91 27t-83 53.5t-69 26.5q-30 0 -52.5 -28t-29.5 -79h-95z M412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc4;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM338 1565q0 44 28 72t72 28q43 0 72 -28t29 -72q0 -43 -29 -72t-72 -29q-44 0 -72 29t-28 72zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452zM690 1565q0 44 29 72t72 28q44 0 72 -28 t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72z" />
+<glyph unicode="&#xc5;" d="M66 0l452 1343h193l452 -1343h-180l-127 410h-487l-129 -410h-174zM412 547h401l-63 205q-78 250 -134 452h-8q-63 -229 -133 -452zM424 1612q0 81 53 130.5t137 49.5q83 0 137 -49.5t54 -130.5q0 -82 -54 -131t-137 -49q-84 0 -137 49t-53 131zM516 1612 q0 -50 27.5 -78.5t70.5 -28.5q40 0 68.5 29t28.5 78q0 46 -28.5 75t-68.5 29q-42 0 -70 -29t-28 -75z" />
+<glyph unicode="&#xc6;" d="M-2 0l532 1343h662v-143h-387v-420h301v-145h-301v-490h405v-145h-561v391h-323l-150 -391h-178zM379 528h270v680h-6q-29 -78 -87 -223.5t-83 -212.5z" />
+<glyph unicode="&#xc7;" d="M135 672q0 319 166.5 507.5t433.5 188.5q113 0 207.5 -46t159.5 -118l-96 -108q-116 123 -271 123q-194 0 -309 -146.5t-115 -396.5q0 -253 115 -402t309 -149q168 0 301 149l99 -104q-160 -184 -379 -195l-39 -77q123 -42 123 -146q0 -83 -84 -129.5t-213 -58.5l-17 84 q183 24 183 98q0 38 -32.5 61t-98.5 39l69 134q-230 30 -371 213t-141 479z" />
+<glyph unicode="&#xc8;" d="M236 0v1343h829v-143h-657v-422h555v-145h-555v-488h677v-145h-849zM410 1675h192l180 -229h-141z" />
+<glyph unicode="&#xc9;" d="M236 0v1343h829v-143h-657v-422h555v-145h-555v-488h677v-145h-849zM573 1446l181 229h192l-231 -229h-142z" />
+<glyph unicode="&#xca;" d="M236 0v1343h829v-143h-657v-422h555v-145h-555v-488h677v-145h-849zM399 1446l197 229h162l196 -229h-135l-137 139h-8l-137 -139h-138z" />
+<glyph unicode="&#xcb;" d="M236 0v1343h829v-143h-657v-422h555v-145h-555v-488h677v-145h-849zM399 1565q0 44 29 72t72 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72zM754 1565q0 44 28.5 72t71.5 28t71.5 -28t28.5 -72q0 -43 -28.5 -72t-71.5 -29t-71.5 29t-28.5 72z" />
+<glyph unicode="&#xcc;" d="M195 0v145h333v1055h-333v143h839v-143h-334v-1055h334v-145h-839zM346 1675h193l180 -229h-141z" />
+<glyph unicode="&#xcd;" d="M195 0v145h333v1055h-333v143h839v-143h-334v-1055h334v-145h-839zM510 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xce;" d="M195 0v145h333v1055h-333v143h839v-143h-334v-1055h334v-145h-839zM336 1446l196 229h164l197 -229h-137l-138 139h-8l-137 -139h-137z" />
+<glyph unicode="&#xcf;" d="M195 0v145h333v1055h-333v143h839v-143h-334v-1055h334v-145h-839zM338 1565q0 44 28 72t72 28q43 0 72 -28t29 -72q0 -43 -29 -72t-72 -29q-44 0 -72 29t-28 72zM690 1565q0 44 29 72t72 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72z" />
+<glyph unicode="&#xd0;" d="M33 657v86l153 11v589h330q300 0 460.5 -172.5t160.5 -492.5q0 -322 -160 -500t-455 -178h-336v657h-153zM356 139h148q226 0 341.5 140t115.5 399q0 256 -115 391t-342 135h-148v-450h293v-97h-293v-518z" />
+<glyph unicode="&#xd1;" d="M170 0v1343h174l436 -847l135 -275h5q-1 32 -12 188t-11 238v696h162v-1343h-174l-436 848l-136 274h-4q2 -40 12.5 -190t10.5 -230v-702h-162zM330 1456q9 98 55.5 159.5t118.5 61.5q46 0 91 -26.5t83.5 -53t69.5 -26.5q30 0 52 28t29 78h95q-9 -97 -56 -159t-118 -62 q-37 0 -73.5 16.5t-61 37t-54.5 37t-55 16.5q-30 0 -52.5 -28t-29.5 -79h-94z" />
+<glyph unicode="&#xd2;" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395zM346 1675h193l180 -229h-141z" />
+<glyph unicode="&#xd3;" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395zM510 1446l180 229h193l-232 -229h-141z " />
+<glyph unicode="&#xd4;" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395zM336 1446l196 229h164l197 -229h-137 l-138 139h-8l-137 -139h-137z" />
+<glyph unicode="&#xd5;" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395zM317 1456q9 98 56 159.5t119 61.5 q37 0 73.5 -16.5t60.5 -36.5t54 -36.5t55 -16.5q30 0 52.5 28t29.5 78h94q-9 -97 -56 -159t-118 -62q-46 0 -91 27t-83 53.5t-69 26.5q-30 0 -52.5 -28t-29.5 -79h-95z" />
+<glyph unicode="&#xd6;" d="M98 678q0 318 142.5 504t373.5 186q230 0 373 -186.5t143 -503.5q0 -321 -143 -512t-373 -191t-373 191t-143 512zM274 678q0 -252 93 -402.5t247 -150.5t247 150.5t93 402.5q0 249 -92.5 395t-247.5 146t-247.5 -146t-92.5 -395zM338 1565q0 44 28 72t72 28q43 0 72 -28 t29 -72q0 -43 -29 -72t-72 -29q-44 0 -72 29t-28 72zM690 1565q0 44 29 72t72 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72z" />
+<glyph unicode="&#xd7;" d="M209 309l315 326l-315 323l90 93l315 -326l316 326l90 -93l-315 -323l315 -326l-90 -92l-316 328l-315 -328z" />
+<glyph unicode="&#xd8;" d="M92 4l129 191q-123 191 -123 483q0 318 142.5 504t373.5 186q190 0 318 -125l110 162l97 -66l-129 -190q120 -180 120 -471q0 -321 -143 -512t-373 -191q-184 0 -315 125l-109 -161zM274 678q0 -193 56 -326l510 754q-89 113 -226 113q-155 0 -247.5 -146t-92.5 -395z M393 238q89 -113 221 -113q154 0 247 150.5t93 402.5q0 183 -51 313z" />
+<glyph unicode="&#xd9;" d="M162 508v835h172v-839q0 -199 75.5 -289t206.5 -90t208 90.5t77 288.5v839h166v-835q0 -275 -121 -404t-330 -129q-102 0 -183 29.5t-142.5 92t-95 166.5t-33.5 245zM346 1675h193l180 -229h-141z" />
+<glyph unicode="&#xda;" d="M162 508v835h172v-839q0 -199 75.5 -289t206.5 -90t208 90.5t77 288.5v839h166v-835q0 -275 -121 -404t-330 -129q-102 0 -183 29.5t-142.5 92t-95 166.5t-33.5 245zM510 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xdb;" d="M162 508v835h172v-839q0 -199 75.5 -289t206.5 -90t208 90.5t77 288.5v839h166v-835q0 -275 -121 -404t-330 -129q-102 0 -183 29.5t-142.5 92t-95 166.5t-33.5 245zM336 1446l196 229h164l197 -229h-137l-138 139h-8l-137 -139h-137z" />
+<glyph unicode="&#xdc;" d="M162 508v835h172v-839q0 -199 75.5 -289t206.5 -90t208 90.5t77 288.5v839h166v-835q0 -275 -121 -404t-330 -129q-102 0 -183 29.5t-142.5 92t-95 166.5t-33.5 245zM338 1565q0 44 28 72t72 28q43 0 72 -28t29 -72q0 -43 -29 -72t-72 -29q-44 0 -72 29t-28 72zM690 1565 q0 44 29 72t72 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72z" />
+<glyph unicode="&#xdd;" d="M78 1343h180l203 -399q23 -47 73.5 -151t79.5 -162h9q28 58 81 163t76 152l195 397h176l-451 -864v-479h-172v479zM510 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xde;" d="M207 0v1343h172v-225h242q115 0 203 -21t155 -66.5t102 -123t35 -184.5q0 -207 -133 -311.5t-362 -104.5h-242v-307h-172zM379 446h219q178 0 263 66.5t85 210.5q0 140 -84 198t-264 58h-219v-533z" />
+<glyph unicode="&#xdf;" d="M180 0v1063q0 191 111 305.5t301 114.5q156 0 246 -87.5t90 -215.5q0 -57 -19 -107.5t-46 -87t-54.5 -70.5t-46.5 -72.5t-19 -76.5q0 -40 22.5 -72t59 -55t80.5 -45t88 -49t80.5 -60.5t59 -85.5t22.5 -118q0 -132 -92 -219t-242 -87q-155 0 -295 93l68 118 q115 -80 223 -80q83 0 130.5 46.5t47.5 113.5q0 48 -23 86t-59 63.5t-80.5 48.5t-88.5 48t-80 54.5t-59 75t-23 103.5q0 62 29 120t63 96.5t63 94t29 113.5q0 78 -47 127.5t-129 49.5q-114 0 -178 -79t-64 -229v-1038h-168z" />
+<glyph unicode="&#xe0;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM408 1477h182l186 -303h-129z" />
+<glyph unicode="&#xe1;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM508 1174l186 303h183l-238 -303h-131z" />
+<glyph unicode="&#xe2;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM371 1174l198 303h146l198 -303h-129l-137 202h-8l-137 -202h-131z" />
+<glyph unicode="&#xe3;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM352 1186q9 102 54.5 162.5t125.5 60.5q33 0 66.5 -17.5t56.5 -38t50 -38t49 -17.5q64 0 82 111h96q-10 -101 -55 -162t-123 -61q-34 0 -67.5 17.5t-56.5 38.5t-50.5 38.5t-49.5 17.5q-33 0 -52.5 -27 t-28.5 -85h-97z" />
+<glyph unicode="&#xe4;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM334 1317q0 48 31.5 80.5t78.5 32.5q49 0 80 -32.5t31 -80.5t-31 -80.5t-80 -32.5q-47 0 -78.5 32.5t-31.5 80.5zM729 1317q0 48 31 80.5t80 32.5t79.5 -32.5t30.5 -80.5t-30.5 -80.5t-79.5 -32.5t-80 32.5 t-31 80.5z" />
+<glyph unicode="&#xe5;" d="M166 258q0 168 168 255t553 118q-3 112 -66 181t-198 69q-157 0 -349 -119l-65 115q89 59 206 101t236 42q199 0 301.5 -109.5t102.5 -300.5v-610h-137l-15 135h-6q-207 -160 -393 -160q-144 0 -241 76.5t-97 206.5zM330 270q0 -80 62.5 -119.5t156.5 -39.5 q161 0 338 147v262q-208 -17 -333 -52t-174.5 -82.5t-49.5 -115.5zM451 1300q0 84 53.5 136.5t138.5 52.5q84 0 137.5 -52.5t53.5 -136.5q0 -85 -53.5 -137.5t-137.5 -52.5q-85 0 -138.5 52t-53.5 138zM543 1300q0 -51 29 -82.5t71 -31.5q41 0 69.5 31.5t28.5 82.5 q0 50 -28.5 81.5t-69.5 31.5q-42 0 -71 -31.5t-29 -81.5z" />
+<glyph unicode="&#xe6;" d="M35 264q0 148 127 238t381 129q-3 252 -178 252q-51 0 -117.5 -25t-116.5 -59l-63 114q166 107 317 107q93 0 156 -55t92 -146q104 201 289 201q98 0 167.5 -64t101.5 -164.5t32 -226.5q0 -29 -9 -108h-528q6 -160 69.5 -253t180.5 -93q94 0 197 63l59 -111 q-127 -88 -262 -88q-200 0 -305 187q-172 -187 -324 -187q-122 0 -194 78t-72 211zM190 272q0 -78 40.5 -119.5t111.5 -41.5q54 0 117 38t116 107q-29 85 -32 213l-2 51q-185 -32 -268 -91.5t-83 -156.5zM684 569h397q0 67 -9 122t-28 100.5t-54 70.5t-83 25 q-95 0 -154.5 -84.5t-68.5 -233.5z" />
+<glyph unicode="&#xe7;" d="M164 496q0 122 44.5 222.5t120.5 165.5t176.5 100.5t213.5 35.5q212 0 362 -146l-84 -108q-131 115 -272 115q-172 0 -279.5 -106.5t-107.5 -278.5q0 -170 105.5 -275.5t277.5 -105.5q159 0 309 125l74 -109q-152 -139 -348 -154l-37 -79q121 -42 121 -146 q0 -83 -84 -129.5t-213 -58.5l-17 84q183 24 183 98q0 38 -32.5 61t-98.5 39l67 131q-215 19 -348 156.5t-133 362.5z" />
+<glyph unicode="&#xe8;" d="M141 496q0 118 42.5 218.5t113.5 166.5t162 102.5t188 36.5q212 0 332.5 -127t120.5 -340q0 -55 -6 -92h-779q9 -160 113 -255t268 -95q155 0 303 92l60 -111q-182 -117 -383 -117q-111 0 -208 36t-170 101.5t-115 165t-42 218.5zM313 571h631q0 151 -78 233.5t-217 82.5 q-126 0 -222 -85t-114 -231zM410 1477h182l186 -303h-131z" />
+<glyph unicode="&#xe9;" d="M141 496q0 118 42.5 218.5t113.5 166.5t162 102.5t188 36.5q212 0 332.5 -127t120.5 -340q0 -55 -6 -92h-779q9 -160 113 -255t268 -95q155 0 303 92l60 -111q-182 -117 -383 -117q-111 0 -208 36t-170 101.5t-115 165t-42 218.5zM313 571h631q0 151 -78 233.5t-217 82.5 q-126 0 -222 -85t-114 -231zM510 1174l186 303h183l-238 -303h-131z" />
+<glyph unicode="&#xea;" d="M141 496q0 118 42.5 218.5t113.5 166.5t162 102.5t188 36.5q212 0 332.5 -127t120.5 -340q0 -55 -6 -92h-779q9 -160 113 -255t268 -95q155 0 303 92l60 -111q-182 -117 -383 -117q-111 0 -208 36t-170 101.5t-115 165t-42 218.5zM313 571h631q0 151 -78 233.5t-217 82.5 q-126 0 -222 -85t-114 -231zM373 1174l198 303h146l198 -303h-131l-135 202h-8l-137 -202h-131z" />
+<glyph unicode="&#xeb;" d="M141 496q0 118 42.5 218.5t113.5 166.5t162 102.5t188 36.5q212 0 332.5 -127t120.5 -340q0 -55 -6 -92h-779q9 -160 113 -255t268 -95q155 0 303 92l60 -111q-182 -117 -383 -117q-111 0 -208 36t-170 101.5t-115 165t-42 218.5zM313 571h631q0 151 -78 233.5t-217 82.5 q-126 0 -222 -85t-114 -231zM338 1317q0 48 30.5 80.5t77.5 32.5q49 0 80 -32.5t31 -80.5t-31 -80.5t-80 -32.5q-47 0 -77.5 32.5t-30.5 80.5zM731 1317q0 48 31 80.5t80 32.5t79.5 -32.5t30.5 -80.5t-30.5 -80.5t-79.5 -32.5t-80 32.5t-31 80.5z" />
+<glyph unicode="&#xec;" d="M184 858v137h631v-995h-168v858h-463zM477 1477h185l184 -303h-129z" />
+<glyph unicode="&#xed;" d="M184 858v137h631v-995h-168v858h-463zM580 1174l184 303h182l-237 -303h-129z" />
+<glyph unicode="&#xee;" d="M184 858v137h631v-995h-168v858h-463zM442 1174l197 303h145l199 -303h-129l-137 202h-8l-138 -202h-129z" />
+<glyph unicode="&#xef;" d="M184 858v137h631v-995h-168v858h-463zM406 1317q0 48 30.5 80.5t77.5 32.5q49 0 80 -32.5t31 -80.5t-31 -80.5t-80 -32.5q-47 0 -77.5 32.5t-30.5 80.5zM799 1317q0 48 30.5 80.5t79.5 32.5t80 -32.5t31 -80.5t-31 -80.5t-80 -32.5t-79.5 32.5t-30.5 80.5z" />
+<glyph unicode="&#xf0;" d="M123 455q0 207 131 333.5t336 126.5q95 0 181.5 -43.5t143.5 -119.5q-52 260 -247 430l-308 -158l-47 84l271 139q-99 70 -246 142l78 106q179 -84 303 -178l276 141l47 -84l-243 -125q299 -276 299 -723q0 -248 -132.5 -399.5t-355.5 -151.5q-130 0 -240 57t-178.5 168 t-68.5 255zM281 455q0 -150 96.5 -245t236.5 -95q158 0 240 110t82 295q0 61 -2 90q-132 174 -320 174q-159 0 -246 -91.5t-87 -237.5z" />
+<glyph unicode="&#xf1;" d="M190 0v995h140l14 -170h8q87 93 176.5 144t198.5 51q344 0 344 -402v-618h-168v596q0 143 -54 210.5t-175 67.5q-85 0 -153.5 -41.5t-162.5 -138.5v-694h-168zM360 1186q11 102 56.5 162.5t124.5 60.5q33 0 67 -17.5t57 -38t49.5 -38t47.5 -17.5q63 0 84 111h94 q-10 -101 -55 -162t-123 -61q-34 0 -67.5 17.5t-56 38.5t-50 38.5t-49.5 17.5q-64 0 -82 -112h-97z" />
+<glyph unicode="&#xf2;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5zM379 1477h184l185 -303h-130z" />
+<glyph unicode="&#xf3;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5zM481 1174l185 303h184l-240 -303h-129z" />
+<glyph unicode="&#xf4;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5zM344 1174l199 303h143l199 -303h-129l-138 202h-8l-137 -202h-129z" />
+<glyph unicode="&#xf5;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5zM324 1186q11 102 56.5 162.5t123.5 60.5q33 0 67 -17.5t57 -38t50 -38t49 -17.5q64 0 82 111h96q-11 -101 -56.5 -162t-123.5 -61q-34 0 -67.5 17.5t-56 38.5t-50 38.5t-49.5 17.5q-64 0 -82 -112h-96z " />
+<glyph unicode="&#xf6;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5t187.5 -35.5t156.5 -100.5t108 -165.5t40 -222.5q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5t-187.5 35.5t-156 100.5t-107.5 165t-40 220zM297 496q0 -170 87.5 -275.5t229.5 -105.5t230 105.5 t88 275.5q0 172 -88 278.5t-230 106.5t-229.5 -106.5t-87.5 -278.5zM307 1317q0 48 31 80.5t80 32.5q47 0 78.5 -32.5t31.5 -80.5t-31.5 -80.5t-78.5 -32.5q-49 0 -80 32.5t-31 80.5zM700 1317q0 47 32 80t79 33q49 0 80 -32.5t31 -80.5t-31 -80.5t-80 -32.5q-47 0 -79 33 t-32 80z" />
+<glyph unicode="&#xf7;" d="M174 571v127h881v-127h-881zM504 266q0 47 31.5 78t78.5 31t79 -31t32 -78q0 -49 -31.5 -79.5t-79.5 -30.5t-79 30.5t-31 79.5zM504 1004q0 47 31.5 77.5t78.5 30.5q48 0 79.5 -30.5t31.5 -77.5q0 -49 -31.5 -80t-79.5 -31t-79 31t-31 80z" />
+<glyph unicode="&#xf8;" d="M123 496q0 122 40 222.5t107.5 165.5t156 100.5t187.5 35.5q168 0 299 -98l105 120l76 -59l-109 -127q121 -144 121 -360q0 -120 -40 -220t-108 -165t-156.5 -100.5t-187.5 -35.5q-167 0 -299 99l-104 -121l-76 59l109 127q-121 144 -121 357zM297 496q0 -134 55 -230 l463 541q-81 78 -201 78q-142 0 -229.5 -108.5t-87.5 -280.5zM412 188q83 -77 202 -77q142 0 230 107t88 278q0 134 -55 233z" />
+<glyph unicode="&#xf9;" d="M158 377v618h170v-596q0 -144 53.5 -211t175.5 -67q84 0 154 42.5t155 141.5v690h168v-995h-137l-14 174h-9q-170 -199 -370 -199q-346 0 -346 402zM369 1477h182l186 -303h-129z" />
+<glyph unicode="&#xfa;" d="M158 377v618h170v-596q0 -144 53.5 -211t175.5 -67q84 0 154 42.5t155 141.5v690h168v-995h-137l-14 174h-9q-170 -199 -370 -199q-346 0 -346 402zM469 1174l186 303h183l-238 -303h-131z" />
+<glyph unicode="&#xfb;" d="M158 377v618h170v-596q0 -144 53.5 -211t175.5 -67q84 0 154 42.5t155 141.5v690h168v-995h-137l-14 174h-9q-170 -199 -370 -199q-346 0 -346 402zM332 1174l198 303h146l198 -303h-129l-137 202h-8l-137 -202h-131z" />
+<glyph unicode="&#xfc;" d="M158 377v618h170v-596q0 -144 53.5 -211t175.5 -67q84 0 154 42.5t155 141.5v690h168v-995h-137l-14 174h-9q-170 -199 -370 -199q-346 0 -346 402zM297 1317q0 48 31 80.5t78 32.5q49 0 79.5 -32.5t30.5 -80.5t-30.5 -80.5t-79.5 -32.5q-47 0 -78 32.5t-31 80.5z M690 1317q0 48 31 80.5t80 32.5t79.5 -32.5t30.5 -80.5t-30.5 -80.5t-79.5 -32.5t-80 32.5t-31 80.5z" />
+<glyph unicode="&#xfd;" d="M100 995h170l244 -551q17 -39 37.5 -87t46 -108.5t39.5 -92.5h8q92 247 107 288l217 551h159l-438 -1077q-130 -346 -422 -346q-73 0 -131 20l35 134q51 -15 90 -15q188 0 273 213l30 74zM489 1174l185 303h184l-240 -303h-129z" />
+<glyph unicode="&#xfe;" d="M190 -420v1878h168v-411l-4 -179q74 71 162 111.5t174 40.5q198 0 307 -136.5t109 -371.5q0 -123 -37.5 -226t-100.5 -170t-144.5 -104t-170.5 -37q-72 0 -150 34.5t-147 94.5l2 -188v-336h-168zM358 233q66 -59 137.5 -87.5t129.5 -28.5q134 0 220.5 107t86.5 288 q0 172 -69.5 269.5t-213.5 97.5q-141 0 -291 -150v-496z" />
+<glyph unicode="&#xff;" d="M100 995h170l244 -551q17 -39 37.5 -87t46 -108.5t39.5 -92.5h8q92 247 107 288l217 551h159l-438 -1077q-130 -346 -422 -346q-73 0 -131 20l35 134q51 -15 90 -15q188 0 273 213l30 74zM315 1317q0 48 31 80.5t80 32.5t80 -32.5t31 -80.5t-31 -80.5t-80 -32.5t-80 32.5 t-31 80.5zM711 1317q0 48 30.5 80.5t79.5 32.5q47 0 78 -32.5t31 -80.5t-31 -80.5t-78 -32.5q-49 0 -79.5 32.5t-30.5 80.5z" />
+<glyph unicode="&#x152;" d="M68 678q0 319 143.5 493.5t400.5 174.5h578v-144h-397v-424h303v-145h-303v-488h417v-145h-604q-253 0 -395.5 179t-142.5 499zM244 678q0 -260 87.5 -399.5t260.5 -139.5h43v1065h-43q-174 0 -261 -134t-87 -392z" />
+<glyph unicode="&#x153;" d="M23 498q0 242 101.5 382t258.5 140q95 0 167 -62.5t112 -177.5q88 240 272 240q135 0 211 -130.5t76 -324.5q0 -58 -7 -108h-493q8 -160 68.5 -253t168.5 -93q81 0 175 63l59 -111q-118 -88 -240 -88q-97 0 -171.5 59t-118.5 171q-87 -230 -279 -230q-158 0 -259 140 t-101 383zM180 498q0 -175 54.5 -280t156.5 -105q92 0 147.5 107t55.5 278t-55.5 277t-147.5 106q-102 0 -156.5 -104t-54.5 -279zM719 569h362q0 66 -8 121t-26 100.5t-49.5 71t-75.5 25.5q-88 0 -139.5 -83.5t-63.5 -234.5z" />
+<glyph unicode="&#x178;" d="M78 1343h180l203 -399q23 -47 73.5 -151t79.5 -162h9q28 58 81 163t76 152l195 397h176l-451 -864v-479h-172v479zM338 1565q0 44 28 72t72 28q43 0 72 -28t29 -72q0 -43 -29 -72t-72 -29q-44 0 -72 29t-28 72zM690 1565q0 44 29 72t72 28q44 0 72 -28t28 -72 q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72z" />
+<glyph unicode="&#x2c6;" d="M344 1174l199 303h143l199 -303h-129l-138 202h-8l-137 -202h-129z" />
+<glyph unicode="&#x2dc;" d="M324 1186q11 102 56.5 162.5t123.5 60.5q33 0 67 -17.5t57 -38t50 -38t49 -17.5q64 0 82 111h96q-11 -101 -56.5 -162t-123.5 -61q-34 0 -67.5 17.5t-56 38.5t-50 38.5t-49.5 17.5q-64 0 -82 -112h-96z" />
+<glyph unicode="&#x2000;" horiz-adv-x="896" />
+<glyph unicode="&#x2001;" horiz-adv-x="1792" />
+<glyph unicode="&#x2002;" horiz-adv-x="896" />
+<glyph unicode="&#x2003;" horiz-adv-x="1792" />
+<glyph unicode="&#x2004;" horiz-adv-x="597" />
+<glyph unicode="&#x2005;" horiz-adv-x="448" />
+<glyph unicode="&#x2006;" horiz-adv-x="298" />
+<glyph unicode="&#x2007;" horiz-adv-x="298" />
+<glyph unicode="&#x2008;" horiz-adv-x="224" />
+<glyph unicode="&#x2009;" horiz-adv-x="358" />
+<glyph unicode="&#x200a;" horiz-adv-x="99" />
+<glyph unicode="&#x2010;" d="M274 526v148h680v-148h-680z" />
+<glyph unicode="&#x2011;" d="M274 526v148h680v-148h-680z" />
+<glyph unicode="&#x2012;" d="M274 526v148h680v-148h-680z" />
+<glyph unicode="&#x2013;" d="M164 526v148h901v-148h-901z" />
+<glyph unicode="&#x2014;" d="M41 526v148h1147v-148h-1147z" />
+<glyph unicode="&#x2018;" d="M428 963q0 153 78 275.5t217 193.5l55 -99q-199 -116 -211 -323q24 12 54 12q63 0 103 -41.5t40 -106.5q0 -70 -42.5 -113.5t-109.5 -43.5q-81 0 -132.5 66.5t-51.5 179.5z" />
+<glyph unicode="&#x2019;" d="M444 815q201 112 213 324q-26 -13 -53 -13q-64 0 -104.5 40.5t-40.5 105.5q0 70 42.5 115t108.5 45q83 0 134 -66.5t51 -181.5q0 -152 -77.5 -274t-215.5 -193z" />
+<glyph unicode="&#x201a;" d="M444 -365q201 112 213 324q-24 -12 -53 -12q-65 0 -105 40.5t-40 106.5q0 69 42.5 113.5t108.5 44.5q83 0 134 -66.5t51 -181.5q0 -152 -77.5 -274t-215.5 -193z" />
+<glyph unicode="&#x201c;" d="M195 963q0 153 76.5 275.5t215.5 193.5l56 -99q-198 -116 -213 -323q27 12 55 12q63 0 103 -41.5t40 -106.5q0 -70 -41.5 -113.5t-107.5 -43.5q-83 0 -133.5 66t-50.5 180zM664 963q0 153 77.5 275.5t216.5 193.5l56 -99q-200 -115 -215 -323q27 12 55 12 q64 0 104.5 -41.5t40.5 -106.5q0 -70 -42.5 -113.5t-108.5 -43.5q-81 0 -132.5 66.5t-51.5 179.5z" />
+<glyph unicode="&#x201d;" d="M211 815q199 113 211 324q-26 -13 -53 -13q-63 0 -103.5 41t-40.5 105q0 70 42 115t108 45q83 0 133.5 -66.5t50.5 -181.5q0 -153 -77 -274.5t-216 -192.5zM680 815q199 115 211 322q-29 -11 -51 -11q-64 0 -105 41t-41 105q0 70 43 115t109 45q81 0 132.5 -66.5 t51.5 -181.5q0 -152 -78 -274t-217 -193z" />
+<glyph unicode="&#x201e;" d="M211 -365q199 113 211 324q-24 -12 -53 -12q-63 0 -103.5 40.5t-40.5 106.5q0 69 42 113.5t108 44.5q83 0 133.5 -66.5t50.5 -181.5q0 -153 -77 -274.5t-216 -192.5zM680 -365q199 115 211 322q-27 -10 -51 -10q-65 0 -105.5 40.5t-40.5 106.5q0 69 43 113.5t109 44.5 q81 0 132.5 -66.5t51.5 -181.5q0 -152 -78 -274t-217 -193z" />
+<glyph unicode="&#x2022;" d="M309 621q0 132 90 216.5t215 84.5t215.5 -85t90.5 -216q0 -130 -90.5 -216t-215.5 -86t-215 85.5t-90 216.5z" />
+<glyph unicode="&#x2026;" d="M66 129q0 68 41 111t102 43q60 0 100.5 -43t40.5 -111q0 -67 -41 -110.5t-100 -43.5q-61 0 -102 43.5t-41 110.5zM471 129q0 68 41 111t102 43t102.5 -43t41.5 -111q0 -67 -41.5 -110.5t-102.5 -43.5t-102 43.5t-41 110.5zM879 129q0 68 40.5 111t100.5 43q61 0 102 -43 t41 -111q0 -67 -41 -110.5t-102 -43.5q-59 0 -100 43.5t-41 110.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="358" />
+<glyph unicode="&#x2039;" d="M403 434v164l314 328l80 -72l-260 -338l260 -340l-80 -70z" />
+<glyph unicode="&#x203a;" d="M432 176l260 340l-260 338l80 72l313 -328v-164l-313 -328z" />
+<glyph unicode="&#x205f;" horiz-adv-x="448" />
+<glyph unicode="&#x20ac;" d="M119 481v88l121 9q-2 25 -2 73q0 46 2 66h-121v90l131 10q38 241 183 377.5t362 136.5q100 0 190.5 -44t155.5 -116l-101 -96q-118 121 -252 121q-149 0 -242.5 -99.5t-121.5 -279.5h602v-100h-612q-2 -18 -2 -60q0 -52 2 -77h530v-99h-518q30 -175 120.5 -272.5 t229.5 -97.5q85 0 152 36t131 109l100 -90q-164 -191 -393 -191q-201 0 -339.5 134t-176.5 372h-131z" />
+<glyph unicode="&#x2122;" d="M-10 1274v110h516v-110h-197v-524h-123v524h-196zM598 750v634h145l93 -233l55 -164h8l53 164l90 233h146v-634h-113v280l15 215h-9l-145 -383h-86l-148 383h-8l15 -215v-280h-111z" />
+<glyph unicode="&#xe000;" horiz-adv-x="993" d="M0 0v993h993v-993h-993z" />
+<glyph unicode="&#xfb01;" d="M106 858v127l136 10v158q0 157 72 243.5t218 86.5q83 0 166 -33l-34 -129q-61 25 -113 25q-141 0 -141 -193v-158h211v-137h-211v-858h-168v858h-136zM793 1331q0 58 40 94.5t99 36.5t98 -36.5t39 -94.5t-39 -94.5t-98 -36.5t-99 36.5t-40 94.5zM848 0v995h168v-995h-168 z" />
+<glyph unicode="&#xfb02;" d="M117 858v127l135 10v158q0 157 72.5 243.5t218.5 86.5q83 0 166 -33l-37 -129q-58 25 -113 25q-139 0 -139 -193v-158h211v-137h-211v-858h-168v858h-135zM821 201v1257h168v-1270q0 -37 13 -55t34 -18q19 0 37 4l23 -127q-42 -17 -97 -17q-93 0 -135.5 57t-42.5 169z " />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.ttf b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.ttf
new file mode 100644
index 0000000..6eb48e7
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.ttf
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.woff b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.woff
new file mode 100644
index 0000000..2383f47
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.woff
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.eot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.eot
new file mode 100644
index 0000000..bda2005
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.eot
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.svg
new file mode 100644
index 0000000..e031390
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.svg
@@ -0,0 +1,243 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="source_sans_prolight" horiz-adv-x="980" >
+<font-face units-per-em="2048" ascent="1536" descent="-512" />
+<missing-glyph horiz-adv-x="407" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="2048" />
+<glyph unicode=" " horiz-adv-x="407" />
+<glyph unicode="&#x09;" horiz-adv-x="407" />
+<glyph unicode="&#xa0;" horiz-adv-x="407" />
+<glyph unicode="!" horiz-adv-x="530" d="M178 68q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -67t-60.5 -26t-61.5 26t-26.5 67zM219 1227v145h94l-2 -145l-12 -860h-68z" />
+<glyph unicode="&#x22;" horiz-adv-x="737" d="M170 1419h104v-141l-18 -301h-68l-16 301zM459 1419h106l-2 -141l-18 -301h-66l-18 301z" />
+<glyph unicode="#" d="M74 438v74h178l43 348h-180v74h188l51 397h72l-51 -397h305l53 397h70l-51 -397h168v-74h-175l-43 -348h177v-74h-187l-51 -438h-72l52 438h-306l-53 -438h-72l54 438h-170zM324 512h307l43 348h-307z" />
+<glyph unicode="$" d="M121 135l49 64q160 -144 330 -144q127 0 196.5 68.5t69.5 183.5q0 64 -20.5 116t-54.5 88t-78.5 65.5t-93.5 54.5t-98 49.5t-93.5 55t-78.5 67.5t-54.5 91t-20.5 120q0 128 81 215.5t208 101.5v203h80v-203q91 -5 155 -41.5t125 -101.5l-53 -58q-67 65 -122.5 94 t-143.5 29q-105 0 -171.5 -66.5t-66.5 -168.5q0 -57 20.5 -102.5t54.5 -77t78.5 -58t93.5 -50t98 -48.5t93.5 -58.5t78.5 -74.5t54.5 -101t20.5 -135q0 -143 -87.5 -233.5t-227.5 -102.5v-202h-80v202q-99 7 -187 51t-155 107z" />
+<glyph unicode="%" horiz-adv-x="1648" d="M82 952q0 201 77 311.5t212 110.5t211.5 -110.5t76.5 -311.5q0 -204 -76.5 -315t-211.5 -111t-212 111.5t-77 314.5zM162 952q0 -169 56.5 -263.5t152.5 -94.5t152.5 94.5t56.5 263.5q0 168 -56.5 261.5t-152.5 93.5t-152.5 -93.5t-56.5 -261.5zM406 -25l753 1399h78 l-754 -1399h-77zM989 401q0 201 77 311.5t212 110.5t212 -110.5t77 -311.5q0 -203 -77 -314.5t-212 -111.5t-212 111.5t-77 314.5zM1069 401q0 -169 56.5 -263.5t152.5 -94.5t152.5 94.5t56.5 263.5q0 168 -56.5 261.5t-152.5 93.5t-152.5 -93.5t-56.5 -261.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1177" d="M74 342q0 52 16 100.5t39.5 86t63 77.5t74 68.5t83.5 64.5q-90 188 -90 334q0 131 78 216t201 85q106 0 165.5 -68.5t59.5 -177.5q0 -28 -6.5 -56t-14.5 -51t-26.5 -50t-31 -44.5t-40.5 -44t-42.5 -40t-49 -41t-48.5 -37.5t-52 -39q69 -125 167.5 -246.5t206.5 -216.5 q139 176 213 445h88q-88 -307 -239 -496q134 -108 262 -156l-31 -80q-137 49 -289 170q-167 -170 -368 -170q-165 0 -277 101.5t-112 265.5zM166 348q0 -131 88.5 -213t216.5 -82q156 0 299 146q-112 103 -213 226t-170 249q-106 -82 -163.5 -158.5t-57.5 -167.5zM344 1077 q0 -128 76 -286q50 36 81 59.5t69.5 59t60 66t36.5 69.5t15 79q0 74 -35.5 125t-111.5 51q-87 0 -139 -64t-52 -159z" />
+<glyph unicode="'" horiz-adv-x="448" d="M170 1419h104v-141l-18 -301h-68l-16 301z" />
+<glyph unicode="(" horiz-adv-x="571" d="M180 569q0 489 271 928l55 -33q-121 -192 -183.5 -421.5t-62.5 -473.5t62.5 -473.5t183.5 -421.5l-55 -32q-271 439 -271 927z" />
+<glyph unicode=")" horiz-adv-x="571" d="M66 -326q121 192 183 421t62 474t-62 474t-183 421l55 33q270 -437 270 -928q0 -490 -270 -927z" />
+<glyph unicode="*" horiz-adv-x="808" d="M143 1241l19 62l194 -54l15 209h65l15 -207l194 52l21 -62l-185 -74l111 -180l-55 -41l-131 170l-136 -170l-55 41l113 180z" />
+<glyph unicode="+" d="M70 637v78h379v411h83v-411h379v-78h-379v-412h-83v412h-379z" />
+<glyph unicode="," horiz-adv-x="448" d="M98 -256q72 38 114.5 102t43.5 146q-8 -2 -25 -2q-37 0 -61.5 23t-24.5 63q0 39 26 62.5t62 23.5q46 0 75.5 -39.5t29.5 -106.5q0 -109 -57.5 -195t-153.5 -138z" />
+<glyph unicode="-" horiz-adv-x="612" d="M82 471v80h450v-80h-450z" />
+<glyph unicode="." horiz-adv-x="448" d="M137 68q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -67t-60.5 -26t-61.5 26t-26.5 67z" />
+<glyph unicode="/" horiz-adv-x="731" d="M18 -328l625 1782h78l-623 -1782h-80z" />
+<glyph unicode="0" d="M98 659q0 325 101.5 499.5t289.5 174.5t290 -174.5t102 -499.5q0 -327 -102.5 -505.5t-289.5 -178.5t-289 178.5t-102 505.5zM190 659q0 -293 80.5 -449.5t218.5 -156.5q139 0 219 156t80 450q0 293 -79.5 444.5t-219.5 151.5q-139 0 -219 -152t-80 -444z" />
+<glyph unicode="1" d="M172 0v80h307v1085h-233v62q155 26 252 82h73v-1229h285v-80h-684z" />
+<glyph unicode="2" d="M80 1141q82 91 171.5 141.5t201.5 50.5q173 0 270.5 -99t97.5 -267q0 -63 -15.5 -124.5t-61.5 -138t-80.5 -129.5t-123.5 -154t-136.5 -153t-169.5 -182q-9 -9 -13 -14q180 10 219 10h447v-82h-803v57q142 144 233.5 241.5t177.5 199.5t132.5 177t74 149t27.5 141 q0 130 -71.5 210t-213.5 80q-165 0 -305 -172z" />
+<glyph unicode="3" d="M59 160l54 63q70 -77 154.5 -122.5t207.5 -45.5q133 0 219 80t86 209q0 142 -110.5 222.5t-345.5 80.5v80q214 0 311.5 78t97.5 207q0 110 -72 176.5t-192 66.5q-165 0 -301 -143l-53 62q163 159 354 159q157 0 257.5 -84t100.5 -231q0 -123 -67.5 -204t-181.5 -120v-8 q128 -28 212 -118t84 -222q0 -167 -113.5 -269t-285.5 -102q-75 0 -140 15.5t-116 44.5t-87.5 58t-72.5 67z" />
+<glyph unicode="4" d="M33 391v53l608 865h82v-840h195v-78h-195v-391h-88v391h-602zM143 469h492v479q0 108 8 226h-8q-18 -30 -54.5 -84t-52.5 -80z" />
+<glyph unicode="5" d="M53 152l51 63q46 -47 89 -78.5t114.5 -56.5t155.5 -25q134 0 229.5 99.5t95.5 253.5q0 157 -86 247t-233 90q-69 0 -123.5 -21.5t-120.5 -66.5l-63 39l47 613h604v-80h-522l-41 -473q114 69 233 69q85 0 156 -24.5t126.5 -73.5t86.5 -129.5t31 -185.5 q0 -101 -35.5 -185.5t-94.5 -138.5t-133.5 -83.5t-154.5 -29.5q-75 0 -139.5 15t-115 43t-85.5 55t-72 64z" />
+<glyph unicode="6" d="M106 594q0 160 26 287t70.5 210.5t107 139t131.5 79t147 23.5q162 0 276 -127l-55 -61q-86 108 -221 108q-81 0 -148 -34t-122 -107t-86.5 -201.5t-32.5 -302.5q69 85 154.5 134t174.5 49q173 0 269 -105t96 -301q0 -176 -104.5 -293t-253.5 -117q-199 0 -314 162.5 t-115 456.5zM201 516q12 -215 96.5 -339t239.5 -124q113 0 188.5 96t75.5 236q0 149 -70 238.5t-213 89.5q-75 0 -158.5 -48t-158.5 -149z" />
+<glyph unicode="7" d="M90 1229v80h805v-54q-117 -155 -193.5 -297.5t-122.5 -296t-67 -306t-29 -355.5h-98q15 393 105 671.5t290 557.5h-690z" />
+<glyph unicode="8" d="M82 336q0 63 23 122t62.5 104.5t83 80.5t93.5 62v8q-188 123 -188 301q0 139 98.5 229t243.5 90q164 0 259 -95.5t95 -246.5q0 -97 -57.5 -186t-128.5 -146v-8q50 -31 84.5 -58t71 -67.5t55 -93t18.5 -115.5q0 -145 -111 -243.5t-286 -98.5q-180 0 -298 103t-118 258z M172 340q0 -122 93 -205.5t233 -83.5q136 0 220.5 76.5t84.5 191.5q0 56 -21 102.5t-55.5 80t-84.5 62.5t-102.5 51.5t-114.5 46.5q-15 5 -22 8q-231 -135 -231 -330zM246 1014q0 -39 11 -73.5t27 -61t45.5 -51.5t54.5 -42.5t66.5 -37.5t69.5 -32t74 -30q172 139 172 303 q0 113 -72.5 190.5t-195.5 77.5q-109 0 -180.5 -68.5t-71.5 -174.5z" />
+<glyph unicode="9" d="M88 926q0 176 104.5 291.5t253.5 115.5q198 0 312 -161t114 -455q0 -160 -26 -287.5t-70 -211.5t-106 -139.5t-131 -79.5t-148 -24q-166 0 -276 127l55 62q86 -109 223 -109q81 0 148 34t122 107t86.5 201.5t32.5 302.5q-69 -84 -155 -132t-176 -48q-172 0 -267.5 105 t-95.5 301zM178 926q0 -151 70.5 -240.5t214.5 -89.5q74 0 158 49.5t159 149.5q-12 214 -97.5 337t-240.5 123q-112 0 -188 -94.5t-76 -234.5z" />
+<glyph unicode=":" horiz-adv-x="448" d="M137 68q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -67t-60.5 -26t-61.5 26t-26.5 67zM137 850q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -66.5t-60.5 -25.5t-61.5 25.5t-26.5 66.5z" />
+<glyph unicode=";" horiz-adv-x="448" d="M98 -256q72 38 114.5 102t43.5 146q-8 -2 -25 -2q-37 0 -61.5 23t-24.5 63q0 39 26 62.5t62 23.5q46 0 75.5 -39.5t29.5 -106.5q0 -109 -57.5 -195t-153.5 -138zM137 850q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -66.5t-60.5 -25.5t-61.5 25.5 t-26.5 66.5z" />
+<glyph unicode="&#x3c;" d="M70 635v90l841 336v-88l-475 -185l-272 -104v-8l272 -105l475 -184v-88z" />
+<glyph unicode="=" d="M70 428v78h841v-78h-841zM70 846v78h841v-78h-841z" />
+<glyph unicode="&#x3e;" d="M70 299v88l475 184l272 105v8l-272 104l-475 185v88l841 -336v-90z" />
+<glyph unicode="?" horiz-adv-x="823" d="M76 1237q142 160 325 160q147 0 233.5 -88.5t86.5 -225.5q0 -56 -19 -110.5t-48.5 -99.5t-65 -90t-69 -91t-60 -94.5t-39 -107.5t-4.5 -123h-82q-9 69 2 132.5t36.5 113.5t58 96.5t67 90t63.5 85.5t47.5 91.5t18.5 100.5q0 103 -59 171.5t-173 68.5q-75 0 -144 -34 t-120 -97zM295 68q0 43 25.5 68.5t60.5 25.5q36 0 62 -26t26 -68q0 -41 -26.5 -67t-61.5 -26t-60.5 26t-25.5 67z" />
+<glyph unicode="@" horiz-adv-x="1667" d="M106 414q0 195 66.5 362.5t178.5 280t259.5 176t309.5 63.5q295 0 469 -178t174 -471q0 -125 -34.5 -229t-90.5 -168.5t-121.5 -99.5t-130.5 -35q-85 0 -138.5 39t-60.5 116h-4q-129 -143 -250 -143q-100 0 -166.5 73t-66.5 206q0 60 16 124t48.5 124t77.5 107.5t107 76 t132 28.5q109 0 170 -98h4l18 82h70l-74 -387q-70 -277 123 -277q50 0 101 31t94.5 87t70.5 144.5t27 192.5q0 266 -154 425t-418 159q-112 0 -219.5 -36.5t-199.5 -107t-161.5 -167t-109 -224.5t-39.5 -270q0 -297 169.5 -471t447.5 -174q181 0 344 98l33 -61 q-176 -111 -383 -111q-148 0 -274 48.5t-218.5 138.5t-144.5 225t-52 301zM582 412q0 -111 44 -161t119 -50q102 0 222 137l63 354q-36 56 -70.5 78.5t-80.5 22.5q-87 0 -157 -60t-105 -146t-35 -175z" />
+<glyph unicode="A" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467z" />
+<glyph unicode="B" horiz-adv-x="1169" d="M193 0v1350h364q209 0 326.5 -82t117.5 -246q0 -109 -61 -187t-178 -108v-8q152 -22 237.5 -105.5t85.5 -220.5q0 -191 -133.5 -292t-367.5 -101h-391zM287 78h272q207 0 319.5 78t112.5 237q0 143 -111.5 215t-320.5 72h-272v-602zM287 756h231q205 0 297 66t92 202 q0 128 -94 188t-283 60h-243v-516z" />
+<glyph unicode="C" horiz-adv-x="1140" d="M104 678q0 319 159 507.5t419 188.5q110 0 200 -46t150 -116l-55 -61q-124 137 -295 137q-221 0 -350 -164.5t-129 -445.5q0 -282 127.5 -449.5t343.5 -167.5q103 0 185 40.5t157 125.5l55 -59q-165 -193 -401 -193q-252 0 -409 192t-157 511z" />
+<glyph unicode="D" horiz-adv-x="1226" d="M193 0v1350h311q304 0 459 -177.5t155 -492.5q0 -317 -155 -498.5t-457 -181.5h-313zM287 80h207q135 0 236.5 44t164.5 124.5t94 189t31 242.5q0 274 -130.5 432t-395.5 158h-207v-1190z" />
+<glyph unicode="E" horiz-adv-x="1038" d="M193 0v1350h737v-82h-643v-510h540v-82h-540v-594h663v-82h-757z" />
+<glyph unicode="F" horiz-adv-x="960" d="M193 0v1350h735v-82h-641v-537h540v-82h-540v-649h-94z" />
+<glyph unicode="G" horiz-adv-x="1222" d="M104 678q0 319 164.5 507.5t433.5 188.5q214 0 367 -162l-55 -61q-126 137 -312 137q-231 0 -365 -164t-134 -446q0 -284 130.5 -450.5t358.5 -166.5q92 0 172 27t129 76v420h-321v80h411v-535q-66 -71 -169 -112.5t-230 -41.5q-261 0 -420.5 191t-159.5 512z" />
+<glyph unicode="H" horiz-adv-x="1294" d="M193 0v1350h94v-592h721v592h94v-1350h-94v676h-721v-676h-94z" />
+<glyph unicode="I" horiz-adv-x="477" d="M193 0v1350h94v-1350h-94z" />
+<glyph unicode="J" horiz-adv-x="931" d="M76 174l71 47q50 -85 112.5 -122.5t148.5 -37.5q124 0 183.5 76.5t59.5 239.5v973h94v-983q0 -84 -18.5 -153t-57 -123.5t-104.5 -85t-155 -30.5q-224 0 -334 199z" />
+<glyph unicode="K" horiz-adv-x="1128" d="M193 0v1350h94v-750h4l653 750h111l-430 -500l489 -850h-108l-445 778l-274 -313v-465h-94z" />
+<glyph unicode="L" horiz-adv-x="942" d="M193 0v1350h94v-1268h620v-82h-714z" />
+<glyph unicode="M" horiz-adv-x="1431" d="M193 0v1350h131l282 -793l107 -299h8l104 299l281 793h133v-1350h-92v887q0 138 12 364h-8l-104 -297l-291 -807h-82l-291 807l-107 297h-8q11 -311 11 -364v-887h-86z" />
+<glyph unicode="N" horiz-adv-x="1288" d="M193 0v1350h98l567 -953l154 -268h8q-12 262 -12 393v828h88v-1350h-99l-567 952l-154 269h-8q13 -280 13 -383v-838h-88z" />
+<glyph unicode="O" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443z" />
+<glyph unicode="P" horiz-adv-x="1128" d="M193 0v1350h368q236 0 357.5 -87.5t121.5 -289.5q0 -195 -125 -294t-354 -99h-274v-580h-94zM287 659h250q209 0 308 75t99 239q0 165 -97 231t-310 66h-250v-611z" />
+<glyph unicode="Q" horiz-adv-x="1320" d="M104 680q0 316 154.5 505t400.5 189q247 0 402.5 -189t155.5 -505q0 -301 -139.5 -491t-366.5 -212q46 -101 136 -154.5t216 -53.5q74 0 137 18l21 -82q-77 -22 -166 -22q-164 0 -280 80.5t-169 213.5q-224 22 -363 213t-139 490zM203 680q0 -281 125 -450t331 -169 t331.5 169t125.5 450q0 278 -125 443t-332 165t-331.5 -165t-124.5 -443z" />
+<glyph unicode="R" horiz-adv-x="1132" d="M193 0v1350h385q444 0 444 -357q0 -158 -91.5 -251t-254.5 -115l371 -627h-109l-365 621h-286v-621h-94zM287 698h266q182 0 276.5 73.5t94.5 221.5t-92.5 212.5t-278.5 64.5h-266v-572z" />
+<glyph unicode="S" horiz-adv-x="1052" d="M88 178l59 66q75 -85 178.5 -134t219.5 -49q153 0 244.5 75t91.5 196q0 49 -13.5 88.5t-33 66t-55.5 51.5t-64.5 39.5t-77.5 36.5l-205 93q-42 18 -74 35t-71.5 47t-65 63t-43.5 82.5t-18 107.5q0 145 111.5 238.5t279.5 93.5q116 0 213 -45t164 -117l-56 -63 q-129 139 -321 139q-134 0 -215.5 -65.5t-81.5 -175.5q0 -32 8.5 -61.5t20 -50.5t33.5 -42.5t37.5 -34t45 -28.5t44 -23t44.5 -21l205 -90q51 -23 87.5 -43.5t76 -52t63.5 -66.5t40 -85.5t16 -110.5q0 -158 -119 -260.5t-313 -102.5q-274 0 -455 203z" />
+<glyph unicode="T" horiz-adv-x="1058" d="M53 1268v82h953v-82h-428v-1268h-95v1268h-430z" />
+<glyph unicode="U" horiz-adv-x="1284" d="M186 518v832h95v-822q0 -129 29 -223t80.5 -145.5t113.5 -75t137 -23.5q61 0 113 14t100 47.5t81.5 86t53 134t19.5 185.5v822h90v-832q0 -123 -25.5 -218.5t-68.5 -155.5t-103 -99t-123.5 -54.5t-136.5 -15.5q-74 0 -137.5 15.5t-123 54.5t-101.5 99t-67.5 155.5 t-25.5 218.5z" />
+<glyph unicode="V" horiz-adv-x="991" d="M2 1350h100l250 -789q122 -393 142 -452h8q34 100 143 452l250 789h94l-440 -1350h-103z" />
+<glyph unicode="W" horiz-adv-x="1562" d="M49 1350h101l167 -795q20 -87 95 -440h8q24 114 102 440l213 795h94l213 -795q18 -73 54 -219.5t53 -220.5h8q15 73 44.5 219.5t45.5 220.5l168 795h94l-303 -1350h-104l-246 926q-12 53 -36 152.5t-36 152.5h-8q-13 -60 -39 -164t-35 -141l-241 -926h-105z" />
+<glyph unicode="X" horiz-adv-x="972" d="M29 0l403 698l-377 652h103l223 -398q65 -113 108 -184h9q63 119 100 184l221 398h96l-376 -656l405 -694h-102l-236 414q-4 8 -123 215h-8q-19 -36 -39 -73t-43 -78.5t-35 -63.5l-233 -414h-96z" />
+<glyph unicode="Y" horiz-adv-x="901" d="M-2 1350h100l205 -422q99 -207 143 -291h9q114 218 147 291l205 422h96l-405 -803v-547h-95v547z" />
+<glyph unicode="Z" horiz-adv-x="1087" d="M94 0v55l778 1213h-708v82h825v-56l-776 -1212h784v-82h-903z" />
+<glyph unicode="[" horiz-adv-x="571" d="M201 -311v1761h327v-64h-256v-1638h256v-59h-327z" />
+<glyph unicode="\" horiz-adv-x="731" d="M10 1454h78l627 -1782h-82z" />
+<glyph unicode="]" horiz-adv-x="571" d="M43 -252h256v1638h-256v64h328v-1761h-328v59z" />
+<glyph unicode="^" d="M135 594l307 778h95l309 -778h-88l-158 416l-106 272h-9l-104 -272l-158 -416h-88z" />
+<glyph unicode="_" horiz-adv-x="1024" d="M25 -162h974v-78h-974v78z" />
+<glyph unicode="`" horiz-adv-x="1095" d="M367 1450h106l189 -279h-78z" />
+<glyph unicode="a" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5v21q0 49 -8 91q-10 52 -33.5 99t-72 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192z" />
+<glyph unicode="b" horiz-adv-x="1114" d="M188 0v1473h91v-426l-5 -193q183 154 340 154q192 0 293 -134t101 -368q0 -122 -35.5 -223.5t-95.5 -168t-138.5 -103t-165.5 -36.5q-70 0 -147 31t-147 86h-5l-10 -92h-76zM279 182q150 -127 290 -127q150 0 246 126t96 325q0 93 -17.5 168t-53.5 133t-97 89.5 t-143 31.5q-139 0 -321 -162v-584z" />
+<glyph unicode="c" horiz-adv-x="919" d="M106 489q0 120 36.5 219.5t98.5 164t142.5 100t171.5 35.5q158 0 289 -121l-53 -64q-112 105 -234 105q-152 0 -254 -123t-102 -316q0 -194 97.5 -314t258.5 -120q136 0 262 113l47 -62q-145 -131 -313 -131q-196 0 -321.5 137.5t-125.5 376.5z" />
+<glyph unicode="d" horiz-adv-x="1114" d="M106 489q0 116 35.5 214.5t95.5 164.5t139.5 103t166.5 37q84 0 150 -29t147 -92l-4 180v406h90v-1473h-78l-8 127h-6q-152 -152 -320 -152q-189 0 -298.5 134.5t-109.5 379.5zM203 489q0 -199 84.5 -316.5t238.5 -117.5q148 0 310 162v584q-77 68 -145 97.5t-142 29.5 q-147 0 -246.5 -126.5t-99.5 -312.5z" />
+<glyph unicode="e" horiz-adv-x="989" d="M106 489q0 117 36 216.5t96.5 164.5t137.5 101.5t159 36.5q176 0 276 -120t100 -335q0 -49 -4 -74h-708q3 -188 104.5 -307t265.5 -119q142 0 265 88l36 -69q-50 -30 -84.5 -47.5t-96 -33.5t-128.5 -16q-195 0 -325 139.5t-130 374.5zM199 549h626q0 186 -76.5 283.5 t-211.5 97.5q-130 0 -226.5 -104.5t-111.5 -276.5z" />
+<glyph unicode="f" horiz-adv-x="538" d="M68 905v70l135 8v219q0 145 62.5 220t180.5 75q70 0 144 -33l-25 -73q-57 28 -119 28q-153 0 -153 -223v-213h227v-78h-227v-905h-90v905h-135z" />
+<glyph unicode="g" horiz-adv-x="997" d="M106 -201q0 64 38.5 126t107.5 112v8q-86 51 -86 158q0 104 106 180v8q-51 44 -86.5 116t-35.5 155q0 151 99.5 248.5t246.5 97.5q64 0 129 -25h333v-76h-229q49 -43 79 -108t30 -140q0 -150 -98 -248t-244 -98q-96 0 -164 41q-38 -31 -59 -63.5t-21 -77.5 q0 -129 188 -129h211q166 0 245 -54t79 -171q0 -133 -130 -232.5t-335 -99.5q-186 0 -295 73.5t-109 198.5zM193 -193q0 -94 86.5 -150t240.5 -56q159 0 261 75t102 172q0 79 -57 114.5t-171 35.5h-211q-54 0 -122 16q-129 -87 -129 -207zM240 662q0 -121 75 -199t181 -78 q104 0 179 78t75 199q0 122 -73.5 197t-180.5 75q-108 0 -182 -74.5t-74 -197.5z" />
+<glyph unicode="h" horiz-adv-x="1081" d="M188 0v1473h91v-426v-218q87 87 166 133t173 46q152 0 224.5 -93t72.5 -284v-631h-90v618q0 159 -53 233.5t-172 74.5q-83 0 -153 -43t-168 -142v-741h-91z" />
+<glyph unicode="i" horiz-adv-x="468" d="M154 1300q0 37 23.5 59.5t58.5 22.5t58 -22.5t23 -59.5q0 -35 -23.5 -57t-57.5 -22t-58 22t-24 57zM188 0v983h91v-983h-91z" />
+<glyph unicode="j" horiz-adv-x="468" d="M-68 -444l23 73q63 -20 102 -20q77 0 104 54.5t27 160.5v1159h93v-1165q0 -145 -54.5 -216t-167.5 -71q-62 0 -127 25zM154 1300q0 37 24 59.5t58 22.5q35 0 59 -22.5t24 -59.5q0 -35 -24 -57t-59 -22q-33 0 -57.5 22.5t-24.5 56.5z" />
+<glyph unicode="k" horiz-adv-x="950" d="M188 0v1473h91v-1086h4l485 596h104l-319 -389l373 -594h-101l-325 526l-221 -258v-268h-91z" />
+<glyph unicode="l" horiz-adv-x="485" d="M188 131v1342h91v-1354q0 -31 12 -47.5t31 -16.5q16 0 36 4l17 -73q-33 -11 -66 -11q-121 0 -121 156z" />
+<glyph unicode="m" horiz-adv-x="1662" d="M188 0v983h78l8 -152h7q70 80 150.5 128.5t158.5 48.5q214 0 272 -201q185 201 334 201q295 0 295 -377v-631h-92v618q0 157 -53.5 232.5t-165.5 75.5q-131 0 -295 -185v-741h-90v618q0 157 -54 232.5t-168 75.5q-130 0 -294 -185v-741h-91z" />
+<glyph unicode="n" horiz-adv-x="1089" d="M188 0v983h78l8 -152h7q86 86 165 131.5t172 45.5q152 0 224.5 -93t72.5 -284v-631h-90v618q0 159 -53 233.5t-172 74.5q-83 0 -153 -43t-168 -142v-741h-91z" />
+<glyph unicode="o" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5z" />
+<glyph unicode="p" horiz-adv-x="1114" d="M188 -444v1427h78l8 -123h7q187 148 333 148q192 0 293 -134t101 -368q0 -122 -35.5 -223.5t-95.5 -168t-138.5 -103t-165.5 -36.5q-132 0 -294 121v-182v-358h-91zM279 182q156 -127 290 -127q150 0 246 126t96 325q0 93 -17.5 168t-53.5 133t-97 89.5t-143 31.5 q-136 0 -321 -162v-584z" />
+<glyph unicode="q" horiz-adv-x="1099" d="M106 489q0 116 35.5 214.5t95.5 164.5t139.5 103t166.5 37q84 0 151 -28t142 -87h4l10 90h76v-1427h-90v378l4 191q-165 -150 -326 -150q-189 0 -298.5 134.5t-109.5 379.5zM203 489q0 -199 84.5 -316.5t238.5 -117.5q148 0 310 162v584q-77 68 -145 97.5t-142 29.5 q-147 0 -246.5 -126.5t-99.5 -312.5z" />
+<glyph unicode="r" horiz-adv-x="649" d="M188 0v983h78l8 -182h7q52 96 123 151.5t155 55.5q55 0 98 -21l-20 -82q-47 17 -90 17q-72 0 -143 -61t-125 -191v-670h-91z" />
+<glyph unicode="s" horiz-adv-x="829" d="M66 111l53 67q73 -61 144.5 -93t168.5 -32q111 0 172.5 56t61.5 139q0 44 -20 79t-59.5 61t-73.5 42t-87 35q-42 15 -65.5 23.5t-61.5 25.5t-60 31t-49 36t-41.5 44.5t-25 53.5t-10.5 66q0 112 84.5 187.5t232.5 75.5q75 0 150 -28.5t131 -74.5l-49 -63q-57 42 -112 65 t-124 23q-107 0 -164 -52t-57 -126q0 -39 18 -70t55.5 -55t70.5 -39t87 -35l24 -9q137 -50 191 -88q107 -75 107 -204q0 -116 -89.5 -196.5t-242.5 -80.5q-198 0 -360 136z" />
+<glyph unicode="t" horiz-adv-x="638" d="M57 905v70l156 8l12 285h78v-285h285v-78h-285v-641q0 -103 35.5 -156t130.5 -53q55 0 123 31l24 -74q-105 -37 -159 -37q-135 0 -190.5 77t-55.5 220v633h-154z" />
+<glyph unicode="u" horiz-adv-x="1083" d="M174 352v631h90v-618q0 -159 53 -233.5t170 -74.5q85 0 157 46.5t161 154.5v725h90v-983h-76l-10 164h-4q-78 -92 -158 -140.5t-176 -48.5q-152 0 -224.5 93t-72.5 284z" />
+<glyph unicode="v" horiz-adv-x="888" d="M25 983h98l221 -616q18 -55 55 -160.5t43 -122.5h9q15 42 100 283l221 616h92l-364 -983h-107z" />
+<glyph unicode="w" horiz-adv-x="1402" d="M49 983h98l177 -637q41 -148 67 -262h8q12 47 72 262l178 637h109l178 -637q19 -68 74 -262h8q8 29 32 120t37 142l175 637h92l-283 -983h-119l-172 610q-15 48 -38 141t-37 140h-9q-42 -177 -78 -285l-169 -606h-109z" />
+<glyph unicode="x" horiz-adv-x="833" d="M29 0l333 514l-307 469h101l159 -250q67 -107 105 -162h8q18 27 50.5 81.5t49.5 80.5l154 250h94l-305 -477l334 -506h-100l-175 268q-76 126 -116 181h-8q-22 -32 -60.5 -96t-52.5 -85l-168 -268h-96z" />
+<glyph unicode="y" horiz-adv-x="892" d="M25 983h98l237 -618q82 -217 107 -275h8q18 51 53 159.5t37 115.5l211 618h92l-389 -1106q-109 -326 -329 -326q-54 0 -101 21l21 80q42 -17 80 -17q86 0 149 70.5t102 190.5l27 86z" />
+<glyph unicode="z" horiz-adv-x="827" d="M55 0v49l582 856h-518v78h635v-47l-580 -856h600v-80h-719z" />
+<glyph unicode="{" horiz-adv-x="571" d="M72 537v65q176 0 176 162q0 64 -8.5 209t-8.5 215q0 146 54 204t170 58h73v-64h-67q-88 0 -121 -47.5t-33 -158.5q0 -62 6 -195.5t6 -198.5q0 -95 -22.5 -145t-81.5 -68v-8q59 -18 81.5 -69t22.5 -144q0 -75 -6 -201.5t-6 -191.5q0 -112 33 -161.5t121 -49.5h67v-59h-73 q-116 0 -170 56.5t-54 205.5q0 77 8.5 214t8.5 206q0 166 -176 166z" />
+<glyph unicode="|" horiz-adv-x="462" d="M195 -512v2048h73v-2048h-73z" />
+<glyph unicode="}" horiz-adv-x="571" d="M43 -252h63q90 0 124 49.5t34 161.5q0 65 -6 191.5t-6 201.5q0 92 23 143.5t81 69.5v8q-58 18 -81 68.5t-23 144.5q0 65 6 198.5t6 195.5q0 111 -33.5 158.5t-124.5 47.5h-63v64h70q119 0 173 -57.5t54 -204.5q0 -70 -8 -214.5t-8 -209.5q0 -162 176 -162v-65 q-176 0 -176 -166q0 -69 8 -206t8 -214q0 -149 -53.5 -205.5t-173.5 -56.5h-70v59z" />
+<glyph unicode="~" d="M82 637q43 83 103 126.5t122 43.5q44 0 87 -19t78 -46t68.5 -54t69 -46t68.5 -19q96 0 162 129l57 -41q-41 -81 -101 -123.5t-122 -42.5q-44 0 -87 19t-78 46t-68.5 54t-69 46t-68.5 19q-96 0 -162 -129z" />
+<glyph unicode="&#xa1;" horiz-adv-x="530" d="M178 918q0 40 26.5 65t61.5 25t60.5 -25t25.5 -65q0 -44 -25.5 -70.5t-60.5 -26.5q-36 0 -62 26.5t-26 70.5zM219 -244l12 860h68l12 -860l2 -145h-94v145z" />
+<glyph unicode="&#xa2;" d="M127 637q0 204 111.5 328.5t283.5 142.5v227h70v-223q154 -5 276 -123l-49 -57q-105 95 -227 100v-788q135 5 252 110l47 -59q-136 -126 -299 -131v-221h-70v223q-178 18 -286.5 141.5t-108.5 329.5zM219 637q0 -160 81.5 -264.5t221.5 -124.5v780q-135 -22 -219 -127.5 t-84 -263.5z" />
+<glyph unicode="&#xa3;" d="M111 600v68l135 6h49q-4 16 -17 59.5t-19 65.5t-14.5 58t-12 67t-3.5 61q0 161 94 254.5t255 93.5q181 0 294 -145l-59 -55q-48 57 -103.5 88.5t-131.5 31.5q-122 0 -189 -75.5t-67 -192.5q0 -38 7 -83t13.5 -70.5t23 -83t21.5 -74.5h338v-74h-322q17 -80 17 -147 q0 -122 -37 -207t-111 -156v-8h605v-82h-760v55q109 62 163 167.5t54 230.5q0 58 -19 147h-204z" />
+<glyph unicode="&#xa4;" d="M61 291l136 137q-78 105 -78 244q0 145 78 250l-136 139l56 57l135 -141q99 90 237 90q139 0 238 -90l137 141l54 -57l-136 -139q78 -105 78 -250q0 -137 -76 -244l134 -137l-54 -58l-137 140q-98 -92 -238 -92q-134 0 -237 92l-135 -140zM209 672q0 -137 82 -226.5 t198 -89.5q118 0 199.5 89.5t81.5 226.5q0 139 -81.5 229t-199.5 90q-116 0 -198 -90.5t-82 -228.5z" />
+<glyph unicode="&#xa5;" d="M61 1309h99l192 -396q86 -180 135 -280h9q24 47 68 140t69 140l192 396h95l-357 -688h316v-68h-344v-145h344v-70h-344v-338h-93v338h-340v70h340v145h-340v68h312z" />
+<glyph unicode="&#xa6;" horiz-adv-x="462" d="M195 451h73v-963h-73v963zM195 571v965h73v-965h-73z" />
+<glyph unicode="&#xa7;" d="M102 721q0 169 183 268q-68 68 -68 166q0 96 72.5 168t204.5 72q150 0 286 -109l-49 -63q-57 46 -111 70t-124 24q-96 0 -144.5 -45.5t-48.5 -110.5q0 -54 32 -96t82.5 -70t112 -54.5t123 -56.5t112 -67.5t82.5 -97.5t32 -137q0 -94 -46 -154.5t-133 -108.5 q70 -70 70 -172q0 -108 -86 -180.5t-207 -72.5q-194 0 -330 129l62 57q58 -55 119.5 -83t148.5 -28q91 0 148 50.5t57 123.5q0 50 -25 90t-65.5 65.5t-93 51.5t-106.5 46.5t-106.5 51t-93 65t-65.5 88t-25 120.5zM188 727q0 -61 29 -107.5t81.5 -79t106.5 -56.5t122.5 -54.5 t111.5 -58.5q80 37 117 81.5t37 122.5q0 53 -22 96.5t-56 72t-83.5 55.5t-95 46t-100.5 45t-92 50q-78 -45 -117 -93t-39 -120z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1095" d="M311 1300q0 31 22 52.5t54 21.5q31 0 52.5 -21.5t21.5 -52.5q0 -32 -21.5 -53.5t-52.5 -21.5q-32 0 -54 21.5t-22 53.5zM635 1300q0 31 21 52.5t53 21.5t53.5 -21.5t21.5 -52.5q0 -32 -21.5 -53.5t-53.5 -21.5t-53 21.5t-21 53.5z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1517" d="M104 659q0 151 53 279t142.5 214t209 134.5t251.5 48.5t250.5 -48.5t208 -134.5t142 -214t52.5 -279t-52.5 -280.5t-142 -217t-208 -137t-250.5 -49.5t-251.5 49.5t-209 137t-142.5 217t-53 280.5zM176 659q0 -136 47 -253t126.5 -196.5t186 -125t224.5 -45.5 q117 0 223 45.5t185 125t126 196.5t47 253q0 135 -47 251t-126 195t-185 124t-223 45q-118 0 -224.5 -45t-186 -124t-126.5 -195t-47 -251zM412 659q0 173 108 278t260 105q76 0 133.5 -28.5t112.5 -83.5l-47 -53q-50 47 -96 68.5t-105 21.5q-122 0 -200 -85.5t-78 -222.5 q0 -152 74.5 -240.5t199.5 -88.5q123 0 236 102l41 -57q-66 -59 -129 -90t-152 -31q-152 0 -255 109.5t-103 295.5z" />
+<glyph unicode="&#xaa;" horiz-adv-x="690" d="M86 702q0 107 100.5 164.5t321.5 77.5q-2 88 -33.5 138.5t-109.5 50.5q-56 0 -117 -23.5t-103 -52.5l-30 55q126 88 258 88q113 0 162 -67t49 -191v-410h-62l-12 80h-8q-112 -96 -217 -96q-89 0 -144 50t-55 136zM166 709q0 -127 137 -127q96 0 205 100v209 q-184 -20 -263 -65t-79 -117z" />
+<glyph unicode="&#xab;" horiz-adv-x="817" d="M88 477v78l281 330l51 -43l-252 -326l252 -330l-51 -39zM375 477v78l282 330l50 -43l-250 -326l250 -330l-50 -39z" />
+<glyph unicode="&#xac;" d="M70 637v78h841v-490h-84v412h-757z" />
+<glyph unicode="&#xad;" horiz-adv-x="612" d="M82 471v80h450v-80h-450z" />
+<glyph unicode="&#xae;" horiz-adv-x="821" d="M37 1059q0 176 108.5 287.5t264.5 111.5q157 0 264.5 -111t107.5 -288q0 -175 -107.5 -285t-264.5 -110q-156 0 -264.5 110t-108.5 285zM100 1059q0 -145 90 -240.5t220 -95.5t219.5 95.5t89.5 240.5q0 147 -89.5 244.5t-219.5 97.5t-220 -98t-90 -244zM270 856v422h142 q69 0 113 -30t44 -101q0 -38 -23.5 -71.5t-58.5 -43.5l101 -176h-76l-80 156h-96v-156h-66zM336 1067h59q48 0 76.5 19t28.5 57q0 78 -99 78h-65v-154z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1095" d="M315 1241v74h465v-74h-465z" />
+<glyph unicode="&#xb0;" horiz-adv-x="636" d="M86 1157q0 111 68.5 177.5t164.5 66.5t165 -66.5t69 -177.5q0 -109 -69.5 -175.5t-164.5 -66.5t-164 66t-69 176zM156 1157q0 -76 46 -126t117 -50q72 0 118 50t46 126q0 78 -46 129t-118 51t-117.5 -51t-45.5 -129z" />
+<glyph unicode="&#xb1;" d="M70 0v76h841v-76h-841zM70 635v76h379v415h83v-415h379v-76h-379v-412h-83v412h-379z" />
+<glyph unicode="&#xb2;" horiz-adv-x="741" d="M96 1575q38 64 105.5 106.5t140.5 42.5q114 0 181 -64t67 -187q0 -58 -21.5 -113.5t-68 -115t-97 -113t-130.5 -132.5q-5 -4 -7.5 -6.5t-6.5 -7t-8 -8t-7 -6.5h393v-70h-522v51q227 210 311 313.5t84 198.5q0 87 -48 139t-128 52q-53 0 -102 -35.5t-85 -91.5z" />
+<glyph unicode="&#xb3;" horiz-adv-x="741" d="M82 1030l59 45q38 -60 97 -95.5t127 -35.5q79 0 132.5 45.5t53.5 124.5q0 77 -75.5 120.5t-207.5 43.5v57q116 0 183 50t67 122q0 67 -46.5 108.5t-123.5 41.5q-46 0 -94.5 -29t-87.5 -78l-51 45q99 129 241 129q103 0 172.5 -57t69.5 -154q0 -72 -42 -123t-112 -79 q78 -15 132.5 -67t54.5 -132q0 -107 -76.5 -171t-192.5 -64q-89 0 -162 43.5t-118 109.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1095" d="M434 1171l187 279h108l-219 -279h-76z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1099" d="M188 -410v1393h91v-618q0 -158 54 -233t171 -75q85 0 155.5 46.5t161.5 154.5v725h90v-983h-77l-9 164h-6q-152 -187 -321 -187q-80 0 -133 24.5t-91 88.5l5 -184v-316h-91z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1054" d="M86 924q0 220 127 323t350 103h90v-850h-57q-116 0 -207.5 24t-160 73.5t-105.5 132t-37 194.5zM764 -164v1514h94v-1514h-94z" />
+<glyph unicode="&#xb7;" horiz-adv-x="448" d="M137 659q0 43 26.5 69t61.5 26t60.5 -26t25.5 -69q0 -41 -25.5 -66.5t-60.5 -25.5t-61.5 25.5t-26.5 66.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="1095" d="M414 -365q190 27 190 105q0 43 -35 67t-102 41l82 156h72l-60 -115q58 -20 90.5 -52t32.5 -89q0 -74 -73 -117.5t-183 -56.5z" />
+<glyph unicode="&#xb9;" horiz-adv-x="741" d="M193 1565v55q108 22 178 80h67v-799h-78v664h-167z" />
+<glyph unicode="&#xba;" horiz-adv-x="737" d="M68 858q0 158 85 250t214 92t214 -92t85 -250q0 -157 -85 -249.5t-214 -92.5t-214 92.5t-85 249.5zM147 858q0 -122 61 -198t159 -76t158.5 76t60.5 198q0 123 -60.5 199t-158.5 76t-159 -76t-61 -199z" />
+<glyph unicode="&#xbb;" horiz-adv-x="817" d="M111 186l249 330l-249 326l49 43l282 -330v-78l-282 -330zM399 186l250 330l-250 326l50 43l280 -330v-78l-280 -330z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1564" d="M147 1214v56q107 22 181 80h67v-799h-78v663h-170zM362 -25l754 1399h78l-752 -1399h-80zM920 233v43l362 523h72v-500h119v-66h-119v-233h-74v233h-360zM1016 299h264v178l8 213h-8l-115 -170z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1609" d="M147 1214v56q107 22 181 80h67v-799h-78v663h-170zM315 -25l754 1399h78l-752 -1399h-80zM965 674q40 64 106.5 106.5t138.5 42.5q114 0 182 -65t68 -187q0 -33 -9 -67t-18.5 -60t-37 -64.5t-43 -59.5t-59.5 -68t-62.5 -66t-75.5 -75l-41 -41h391v-70h-520v51 q118 110 179 170.5t117.5 127.5t77.5 115.5t21 98.5q0 87 -48.5 139t-127.5 52q-54 0 -103 -35t-85 -92z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1603" d="M82 680l59 45q38 -60 96.5 -95.5t124.5 -35.5q80 0 133.5 45.5t53.5 124.5q0 77 -75.5 120.5t-205.5 43.5v57q114 0 182 50t68 122q0 66 -47.5 108t-124.5 42q-93 0 -180 -107l-51 45q99 129 239 129q104 0 174 -57t70 -154q0 -71 -42.5 -122.5t-113.5 -79.5 q79 -15 134 -67t55 -132q0 -108 -76.5 -172t-192.5 -64q-88 0 -161.5 43.5t-118.5 110.5zM459 -25l753 1399h78l-753 -1399h-78zM956 233v43l363 523h74v-500h118v-66h-118v-233h-74v233h-363zM1053 299h266v178l8 213h-8l-115 -170z" />
+<glyph unicode="&#xbf;" horiz-adv-x="823" d="M104 -100q0 76 35 150t83.5 134.5t95 123.5t74 142.5t16.5 165.5h84q9 -69 -2.5 -132.5t-37 -113.5t-58.5 -96.5t-67.5 -90t-63.5 -85.5t-47.5 -91.5t-18.5 -100.5q0 -102 59 -171t174 -69q73 0 142 34.5t120 96.5l58 -51q-145 -160 -326 -160q-147 0 -233.5 88.5 t-86.5 225.5zM356 918q0 40 25.5 65t60.5 25t60.5 -25t25.5 -65q0 -44 -25.5 -70.5t-60.5 -26.5t-60.5 26.5t-25.5 70.5z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467zM299 1669h119l188 -217h-82z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467zM455 1452l188 217h119l-223 -217h-84z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467zM291 1452l196 217h86l197 -217h-82l-153 147h-9l-153 -147h-82z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM266 1466q5 76 43 132.5t103 56.5q36 0 70.5 -18t58 -39.5t54 -39.5t58.5 -18q32 0 55 31.5t29 83.5h60q-5 -75 -43.5 -132t-102.5 -57q-36 0 -71 18.5t-58.5 40t-54 40t-57.5 18.5q-33 0 -56.5 -32 t-29.5 -85h-58zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467zM295 1559q0 34 21 54.5t53 20.5q33 0 54 -20t21 -55q0 -33 -21 -53.5t-54 -20.5q-31 0 -52.5 20.5t-21.5 53.5zM616 1559q0 34 21.5 54.5 t54.5 20.5t54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5t-54.5 20.5t-21.5 53.5z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1062" d="M8 0l477 1350h95l475 -1350h-101l-157 463h-535l-158 -463h-96zM291 543h479l-86 252q-115 349 -149 467h-9q-54 -190 -149 -467zM362 1602q0 74 47.5 120.5t120.5 46.5q71 0 119.5 -46.5t48.5 -120.5q0 -75 -48.5 -121.5t-119.5 -46.5q-73 0 -120.5 46.5t-47.5 121.5z M424 1602q0 -55 30 -85t76 -30q45 0 75 30t30 85q0 52 -30.5 83t-74.5 31q-46 0 -76 -30.5t-30 -83.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1642" d="M37 0l745 1350h752v-82h-606v-510h502v-82h-502v-594h626v-82h-720v444h-459l-244 -444h-94zM418 522h416v746h-9q-32 -59 -121 -220.5t-137 -252.5z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1140" d="M104 678q0 319 159 507.5t419 188.5q110 0 200 -46t150 -116l-55 -61q-124 137 -295 137q-221 0 -350 -164.5t-129 -445.5q0 -282 127.5 -449.5t343.5 -167.5q103 0 185 40.5t157 125.5l55 -59q-147 -169 -340 -191l-47 -88q57 -20 90 -52.5t33 -88.5q0 -74 -73.5 -117.5 t-184.5 -56.5l-12 61q188 27 188 105q0 42 -34.5 66.5t-100.5 41.5l67 127q-247 5 -400 196.5t-153 506.5z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1038" d="M193 0v1350h737v-82h-643v-510h540v-82h-540v-594h663v-82h-757zM338 1669h119l190 -217h-84z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1038" d="M193 0v1350h737v-82h-643v-510h540v-82h-540v-594h663v-82h-757zM494 1452l188 217h119l-223 -217h-84z" />
+<glyph unicode="&#xca;" horiz-adv-x="1038" d="M193 0v1350h737v-82h-643v-510h540v-82h-540v-594h663v-82h-757zM330 1452l196 217h86l197 -217h-82l-154 147h-8l-153 -147h-82z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1038" d="M193 0v1350h737v-82h-643v-510h540v-82h-540v-594h663v-82h-757zM334 1559q0 34 21 54.5t53 20.5q33 0 54 -20t21 -55q0 -33 -21 -53.5t-54 -20.5q-31 0 -52.5 20.5t-21.5 53.5zM655 1559q0 34 21.5 54.5t54.5 20.5t54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5 t-54.5 20.5t-21.5 53.5z" />
+<glyph unicode="&#xcc;" horiz-adv-x="477" d="M8 1669h117l190 -217h-84zM193 0v1350h94v-1350h-94z" />
+<glyph unicode="&#xcd;" horiz-adv-x="477" d="M162 1452l190 217h117l-223 -217h-84zM193 0v1350h94v-1350h-94z" />
+<glyph unicode="&#xce;" horiz-adv-x="477" d="M0 1452l197 217h86l196 -217h-82l-153 147h-8l-154 -147h-82zM193 0v1350h94v-1350h-94z" />
+<glyph unicode="&#xcf;" horiz-adv-x="477" d="M2 1559q0 34 21.5 54.5t54.5 20.5t53.5 -20t20.5 -55q0 -33 -20.5 -53.5t-53.5 -20.5t-54.5 20.5t-21.5 53.5zM193 0v1350h94v-1350h-94zM326 1559q0 34 20.5 54.5t52.5 20.5q33 0 54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5q-31 0 -52 20.5t-21 53.5z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1261" d="M68 680v63l159 5v602h312q304 0 459 -177.5t155 -492.5q0 -317 -155 -498.5t-457 -181.5h-314v680h-159zM322 80h206q135 0 237 44t165 124.5t94 189t31 242.5t-31 240.5t-94 185.5t-165 121.5t-237 42.5h-206v-522h340v-68h-340v-600z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1288" d="M193 0v1350h98l567 -953l154 -268h8q-12 262 -12 393v828h88v-1350h-99l-567 952l-154 269h-8q13 -280 13 -383v-838h-88zM387 1466q5 76 43 132.5t102 56.5q37 0 72.5 -18t59 -39.5t54 -39.5t58.5 -18q32 0 55 31.5t29 83.5h60q-5 -75 -43.5 -132t-102.5 -57 q-37 0 -72.5 18.5t-59 40t-54 40t-58.5 18.5q-32 0 -55 -32t-29 -85h-59z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443zM430 1669h117l190 -217h-84z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443zM584 1452l190 217h117l-223 -217h-84z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443zM422 1452l196 217h87l196 -217h-82l-153 147h-9l-153 -147h-82z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443zM395 1466q5 76 43 132.5t103 56.5q36 0 71 -18t58.5 -39.5t54 -39.5t57.5 -18q33 0 55.5 31t30.5 84h58q-5 -75 -43.5 -132t-102.5 -57q-36 0 -70.5 18.5t-58 40t-54 40t-58.5 18.5q-32 0 -55 -32t-31 -85h-58z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q246 0 400.5 -189t154.5 -505q0 -318 -155 -511.5t-400 -193.5q-247 0 -402.5 193.5t-155.5 511.5zM203 680q0 -280 126.5 -449.5t332.5 -169.5q205 0 330.5 169.5t125.5 449.5q0 278 -125.5 443t-330.5 165q-207 0 -333 -165 t-126 -443zM424 1559q0 34 21.5 54.5t54.5 20.5t53 -20t20 -55q0 -33 -20.5 -53.5t-52.5 -20.5q-33 0 -54.5 20.5t-21.5 53.5zM748 1559q0 34 20.5 54.5t52.5 20.5q33 0 54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5q-31 0 -52 20.5t-21 53.5z" />
+<glyph unicode="&#xd7;" d="M104 334l332 342l-332 342l56 57l329 -346l332 346l53 -57l-329 -342l329 -342l-53 -58l-332 345l-329 -345z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1320" d="M104 680q0 316 155.5 505t402.5 189q214 0 364 -147l127 170l57 -45l-137 -183q144 -190 144 -489q0 -318 -155 -511.5t-400 -193.5q-219 0 -365 152l-131 -174l-60 45l140 188q-142 195 -142 494zM203 680q0 -255 102 -416l664 887q-121 137 -307 137q-207 0 -333 -165 t-126 -443zM352 203q123 -142 310 -142q205 0 330.5 169.5t125.5 449.5q0 252 -102 410z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1284" d="M186 518v832h95v-822q0 -129 29 -223t80.5 -145.5t113.5 -75t137 -23.5q61 0 113 14t100 47.5t81.5 86t53 134t19.5 185.5v822h90v-832q0 -123 -25.5 -218.5t-68.5 -155.5t-103 -99t-123.5 -54.5t-136.5 -15.5q-74 0 -137.5 15.5t-123 54.5t-101.5 99t-67.5 155.5 t-25.5 218.5zM412 1669h116l191 -217h-84z" />
+<glyph unicode="&#xda;" horiz-adv-x="1284" d="M186 518v832h95v-822q0 -129 29 -223t80.5 -145.5t113.5 -75t137 -23.5q61 0 113 14t100 47.5t81.5 86t53 134t19.5 185.5v822h90v-832q0 -123 -25.5 -218.5t-68.5 -155.5t-103 -99t-123.5 -54.5t-136.5 -15.5q-74 0 -137.5 15.5t-123 54.5t-101.5 99t-67.5 155.5 t-25.5 218.5zM565 1452l191 217h116l-223 -217h-84z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1284" d="M186 518v832h95v-822q0 -129 29 -223t80.5 -145.5t113.5 -75t137 -23.5q61 0 113 14t100 47.5t81.5 86t53 134t19.5 185.5v822h90v-832q0 -123 -25.5 -218.5t-68.5 -155.5t-103 -99t-123.5 -54.5t-136.5 -15.5q-74 0 -137.5 15.5t-123 54.5t-101.5 99t-67.5 155.5 t-25.5 218.5zM401 1452l197 217h88l197 -217h-84l-152 147h-8l-154 -147h-84z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1284" d="M186 518v832h95v-822q0 -129 29 -223t80.5 -145.5t113.5 -75t137 -23.5q61 0 113 14t100 47.5t81.5 86t53 134t19.5 185.5v822h90v-832q0 -123 -25.5 -218.5t-68.5 -155.5t-103 -99t-123.5 -54.5t-136.5 -15.5q-74 0 -137.5 15.5t-123 54.5t-101.5 99t-67.5 155.5 t-25.5 218.5zM406 1559q0 35 21 55t54 20t53.5 -20t20.5 -55q0 -33 -20.5 -53.5t-53.5 -20.5t-54 20.5t-21 53.5zM729 1559q0 34 21 54.5t53 20.5q33 0 54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5q-31 0 -52.5 20.5t-21.5 53.5z" />
+<glyph unicode="&#xdd;" horiz-adv-x="901" d="M-2 1350h100l205 -422q99 -207 143 -291h9q114 218 147 291l205 422h96l-405 -803v-547h-95v547zM375 1452l188 217h119l-225 -217h-82z" />
+<glyph unicode="&#xde;" horiz-adv-x="1150" d="M193 0v1350h94v-240h274q236 0 358.5 -88.5t122.5 -288.5q0 -195 -125.5 -294t-355.5 -99h-274v-340h-94zM287 420h250q209 0 308 74.5t99 238.5t-96.5 230.5t-310.5 66.5h-250v-610z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1110" d="M188 0v1090q0 188 95 295.5t256 107.5q130 0 207 -77.5t77 -196.5q0 -58 -21 -110.5t-50.5 -91.5t-59 -76.5t-50.5 -80.5t-21 -88q0 -48 23.5 -84.5t61.5 -60.5t84 -46.5t92 -49.5t84 -60t61.5 -87t23.5 -124q0 -122 -84.5 -203.5t-214.5 -81.5q-149 0 -279 105l45 67 q116 -94 234 -94q97 0 151.5 59.5t54.5 143.5q0 58 -23.5 102t-61.5 72t-83.5 52t-91 48.5t-83.5 53.5t-61.5 74.5t-23.5 105.5q0 55 20.5 104t50 87t59.5 75t50.5 83t20.5 97q0 92 -50 148.5t-144 56.5q-121 0 -189.5 -89t-68.5 -267v-1059h-91z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM356 1450h109l186 -279h-78z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM424 1171l186 279h109l-217 -279h-78z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM305 1171l193 279h80l192 -279h-76l-151 203h-8l-154 -203h-76z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM285 1190q5 76 39 129t102 53q33 0 66.5 -17.5t56.5 -38.5t51.5 -38.5t52.5 -17.5q63 0 76 112h62q-5 -75 -39.5 -128.5t-100.5 -53.5q-34 0 -67.5 17.5t-56 39t-51 39 t-52.5 17.5q-65 0 -78 -113h-61z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM301 1300q0 31 22 52.5t54 21.5t53 -21.5t21 -52.5q0 -32 -21 -53.5t-53 -21.5t-54 21.5t-22 53.5zM625 1300q0 31 21 52.5t52 21.5q32 0 54 -21.5t22 -52.5 q0 -32 -22 -53.5t-54 -21.5q-31 0 -52 21.5t-21 53.5z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1021" d="M133 246q0 160 151.5 246.5t483.5 123.5q2 61 -7.5 112.5t-33.5 98.5t-72.5 74t-117.5 27q-159 0 -314 -115l-41 68q181 127 365 127q85 0 146.5 -29t96.5 -82t51.5 -119t16.5 -149v-629h-76l-10 127h-4q-190 -152 -348 -152q-125 0 -206 69t-81 202zM227 250 q0 -100 57.5 -148.5t149.5 -48.5q82 0 160.5 39t173.5 121v334q-294 -34 -417.5 -105t-123.5 -192zM369 1280q0 79 48.5 128.5t121.5 49.5q72 0 120 -50t48 -128q0 -77 -48.5 -126.5t-119.5 -49.5q-73 0 -121.5 49.5t-48.5 126.5zM430 1280q0 -55 31 -89t78 -34 q45 0 75.5 34t30.5 89q0 56 -30.5 90.5t-75.5 34.5q-47 0 -78 -34.5t-31 -90.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1605" d="M133 244q0 161 150.5 248t474.5 124q4 312 -232 312q-148 0 -303 -115l-41 68q181 127 353 127q117 0 188.5 -65t97.5 -181q55 114 145 180t197 66q172 0 268.5 -119.5t96.5 -335.5q0 -49 -4 -74h-680q0 -185 100 -304.5t250 -119.5q133 0 256 88l39 -71q-53 -32 -84 -48 t-91.5 -32.5t-127.5 -16.5q-209 0 -352 203q-96 -93 -208.5 -148t-205.5 -55q-125 0 -206 68.5t-81 200.5zM227 250q0 -100 57.5 -148.5t149.5 -48.5q82 0 183 51.5t184 139.5q-43 87 -43 248l-2 55q-282 -35 -405.5 -106.5t-123.5 -190.5zM844 549h600q0 186 -74.5 283.5 t-208.5 97.5q-122 0 -212 -106.5t-105 -274.5z" />
+<glyph unicode="&#xe7;" horiz-adv-x="919" d="M106 489q0 120 36.5 219.5t98.5 164t142.5 100t171.5 35.5q158 0 289 -121l-53 -64q-112 105 -234 105q-152 0 -254 -123t-102 -316q0 -194 97.5 -314t258.5 -120q136 0 262 113l47 -62q-132 -118 -282 -129l-45 -88q58 -20 90.5 -52t32.5 -89q0 -74 -73 -117.5 t-183 -56.5l-15 61q191 27 191 105q0 43 -35.5 67t-102.5 41l68 129q-180 14 -293 150.5t-113 361.5z" />
+<glyph unicode="&#xe8;" horiz-adv-x="989" d="M106 489q0 117 36 216.5t96.5 164.5t137.5 101.5t159 36.5q176 0 276 -120t100 -335q0 -49 -4 -74h-708q3 -188 104.5 -307t265.5 -119q142 0 265 88l36 -69q-50 -30 -84.5 -47.5t-96 -33.5t-128.5 -16q-195 0 -325 139.5t-130 374.5zM199 549h626q0 186 -76.5 283.5 t-211.5 97.5q-130 0 -226.5 -104.5t-111.5 -276.5zM354 1450h107l188 -279h-78z" />
+<glyph unicode="&#xe9;" horiz-adv-x="989" d="M106 489q0 117 36 216.5t96.5 164.5t137.5 101.5t159 36.5q176 0 276 -120t100 -335q0 -49 -4 -74h-708q3 -188 104.5 -307t265.5 -119q142 0 265 88l36 -69q-50 -30 -84.5 -47.5t-96 -33.5t-128.5 -16q-195 0 -325 139.5t-130 374.5zM199 549h626q0 186 -76.5 283.5 t-211.5 97.5q-130 0 -226.5 -104.5t-111.5 -276.5zM422 1171l186 279h109l-219 -279h-76z" />
+<glyph unicode="&#xea;" horiz-adv-x="989" d="M106 489q0 117 36 216.5t96.5 164.5t137.5 101.5t159 36.5q176 0 276 -120t100 -335q0 -49 -4 -74h-708q3 -188 104.5 -307t265.5 -119q142 0 265 88l36 -69q-50 -30 -84.5 -47.5t-96 -33.5t-128.5 -16q-195 0 -325 139.5t-130 374.5zM199 549h626q0 186 -76.5 283.5 t-211.5 97.5q-130 0 -226.5 -104.5t-111.5 -276.5zM303 1171l193 279h79l193 -279h-76l-153 203h-9l-153 -203h-74z" />
+<glyph unicode="&#xeb;" horiz-adv-x="989" d="M106 489q0 117 36 216.5t96.5 164.5t137.5 101.5t159 36.5q176 0 276 -120t100 -335q0 -49 -4 -74h-708q3 -188 104.5 -307t265.5 -119q142 0 265 88l36 -69q-50 -30 -84.5 -47.5t-96 -33.5t-128.5 -16q-195 0 -325 139.5t-130 374.5zM199 549h626q0 186 -76.5 283.5 t-211.5 97.5q-130 0 -226.5 -104.5t-111.5 -276.5zM299 1300q0 31 21.5 52.5t52.5 21.5q32 0 54 -21.5t22 -52.5q0 -32 -22 -53.5t-54 -21.5q-31 0 -52.5 21.5t-21.5 53.5zM621 1300q0 31 21.5 52.5t53.5 21.5t54 -21.5t22 -52.5q0 -32 -22 -53.5t-54 -21.5t-53.5 21.5 t-21.5 53.5z" />
+<glyph unicode="&#xec;" horiz-adv-x="468" d="M53 1450h107l188 -279h-78zM188 0v983h91v-983h-91z" />
+<glyph unicode="&#xed;" horiz-adv-x="468" d="M121 1171l186 279h109l-219 -279h-76zM188 0v983h91v-983h-91z" />
+<glyph unicode="&#xee;" horiz-adv-x="468" d="M2 1171l193 279h79l193 -279h-76l-153 203h-9l-153 -203h-74zM188 0v983h91v-983h-91z" />
+<glyph unicode="&#xef;" horiz-adv-x="468" d="M-2 1300q0 31 22 52.5t54 21.5q31 0 52 -21.5t21 -52.5q0 -32 -21 -53.5t-52 -21.5q-32 0 -54 21.5t-22 53.5zM188 0v983h91v-983h-91zM322 1300q0 31 20.5 52.5t52.5 21.5t54 -21.5t22 -52.5q0 -32 -22 -53.5t-54 -21.5t-52.5 21.5t-20.5 53.5z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1095" d="M123 449q0 203 117.5 329.5t306.5 126.5q184 0 303 -155q-49 269 -238 454l-290 -151l-31 57l270 139q-97 84 -252 172l45 62q164 -87 283 -195l291 152l30 -56l-272 -141q277 -284 277 -727q0 -245 -115 -393t-301 -148q-82 0 -158.5 33t-135.5 92.5t-94.5 150.5 t-35.5 198zM213 449q0 -170 97.5 -282t236.5 -112q108 0 182 62.5t107.5 163.5t33.5 233q0 66 -6 127q-72 106 -148.5 146t-164.5 40q-159 0 -248.5 -109t-89.5 -269z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1089" d="M188 0v983h78l8 -152h7q86 86 165 131.5t172 45.5q152 0 224.5 -93t72.5 -284v-631h-90v618q0 159 -53 233.5t-172 74.5q-83 0 -153 -43t-168 -142v-741h-91zM326 1190q5 76 39 129t102 53q33 0 66.5 -17.5t56.5 -38.5t51.5 -38.5t52.5 -17.5q63 0 76 112h61 q-5 -75 -39 -128.5t-100 -53.5q-34 0 -67.5 17.5t-56 39t-51 39t-52.5 17.5q-65 0 -78 -113h-61z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5zM367 1450h106l189 -279h-78z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5zM434 1171l187 279h108l-219 -279h-76z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5zM315 1171l193 279h80l192 -279h-75l-154 203h-8l-154 -203h-74z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5zM295 1190q5 76 39 129t100 53q34 0 68 -17.5t57.5 -38.5t51.5 -38.5t51 -17.5q64 0 77 112h62q-5 -75 -40 -128.5t-102 -53.5q-33 0 -66 17.5t-55.5 39t-51.5 39t-54 17.5 q-63 0 -76 -113h-61z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1095" d="M106 489q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q90 0 169.5 -35t140.5 -100t96.5 -164.5t35.5 -219.5q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-89 0 -168.5 35t-140.5 99t-96.5 162.5t-35.5 217.5zM201 489q0 -192 98 -313t248 -121 q151 0 249.5 121t98.5 313q0 193 -98.5 316t-249.5 123q-150 0 -248 -122.5t-98 -316.5zM311 1300q0 31 22 52.5t54 21.5q31 0 52.5 -21.5t21.5 -52.5q0 -32 -21.5 -53.5t-52.5 -21.5q-32 0 -54 21.5t-22 53.5zM635 1300q0 31 21 52.5t53 21.5t53.5 -21.5t21.5 -52.5 q0 -32 -21.5 -53.5t-53.5 -21.5t-53 21.5t-21 53.5z" />
+<glyph unicode="&#xf7;" d="M70 637v78h841v-78h-841zM412 307q0 35 22 57.5t55 22.5q34 0 56 -22.5t22 -57.5q0 -38 -22 -61t-56 -23q-33 0 -55 23t-22 61zM412 1044q0 35 22 57.5t55 22.5q34 0 56 -22.5t22 -57.5q0 -38 -22 -60.5t-56 -22.5q-33 0 -55 23t-22 60z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1095" d="M94 -2l119 143q-107 139 -107 348q0 120 35.5 219.5t96.5 164t140.5 100t168.5 35.5q170 0 291 -115l110 133l53 -43l-118 -141q106 -141 106 -353q0 -119 -35.5 -217.5t-96.5 -162.5t-140.5 -99t-169.5 -35q-168 0 -289 115l-111 -135zM199 492q0 -166 73 -281l510 614 q-94 105 -235 105q-150 0 -249 -123t-99 -315zM313 156q95 -103 234 -103q151 0 250.5 121t99.5 313q0 166 -74 283z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1083" d="M174 352v631h90v-618q0 -159 53 -233.5t170 -74.5q85 0 157 46.5t161 154.5v725h90v-983h-76l-10 164h-4q-78 -92 -158 -140.5t-176 -48.5q-152 0 -224.5 93t-72.5 284zM360 1450h109l186 -279h-75z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1083" d="M174 352v631h90v-618q0 -159 53 -233.5t170 -74.5q85 0 157 46.5t161 154.5v725h90v-983h-76l-10 164h-4q-78 -92 -158 -140.5t-176 -48.5q-152 0 -224.5 93t-72.5 284zM428 1171l188 279h107l-217 -279h-78z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1083" d="M174 352v631h90v-618q0 -159 53 -233.5t170 -74.5q85 0 157 46.5t161 154.5v725h90v-983h-76l-10 164h-4q-78 -92 -158 -140.5t-176 -48.5q-152 0 -224.5 93t-72.5 284zM309 1171l193 279h80l192 -279h-74l-153 203h-8l-154 -203h-76z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1083" d="M174 352v631h90v-618q0 -159 53 -233.5t170 -74.5q85 0 157 46.5t161 154.5v725h90v-983h-76l-10 164h-4q-78 -92 -158 -140.5t-176 -48.5q-152 0 -224.5 93t-72.5 284zM305 1300q0 31 22 52.5t54 21.5t54 -21.5t22 -52.5q0 -32 -22 -53.5t-54 -21.5t-54 21.5t-22 53.5z M629 1300q0 31 22 52.5t54 21.5q31 0 52 -21.5t21 -52.5q0 -32 -21 -53.5t-52 -21.5q-32 0 -54 21.5t-22 53.5z" />
+<glyph unicode="&#xfd;" horiz-adv-x="892" d="M25 983h98l237 -618q82 -217 107 -275h8q18 51 53 159.5t37 115.5l211 618h92l-389 -1106q-109 -326 -329 -326q-54 0 -101 21l21 80q42 -17 80 -17q86 0 149 70.5t102 190.5l27 86zM356 1171l187 279h108l-219 -279h-76z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1114" d="M188 -444v1917h91v-424v-187q188 146 333 146q194 0 295 -134t101 -368q0 -122 -35.5 -223.5t-95.5 -168t-138.5 -103t-165.5 -36.5q-134 0 -294 119v-180v-358h-91zM279 182q156 -127 290 -127q150 0 246 126t96 325q0 93 -17.5 168t-53.5 133t-97 89.5t-143 31.5 q-136 0 -321 -162v-584z" />
+<glyph unicode="&#xff;" horiz-adv-x="892" d="M25 983h98l237 -618q82 -217 107 -275h8q18 51 53 159.5t37 115.5l211 618h92l-389 -1106q-109 -326 -329 -326q-54 0 -101 21l21 80q42 -17 80 -17q86 0 149 70.5t102 190.5l27 86zM233 1300q0 31 21.5 52.5t52.5 21.5q32 0 54 -21.5t22 -52.5q0 -32 -22 -53.5 t-54 -21.5q-31 0 -52.5 21.5t-21.5 53.5zM555 1300q0 31 22 52.5t54 21.5t54 -21.5t22 -52.5q0 -32 -22 -53.5t-54 -21.5t-54 21.5t-22 53.5z" />
+<glyph unicode="&#x152;" horiz-adv-x="1691" d="M104 680q0 313 164 491.5t477 178.5h838v-82h-606v-510h502v-82h-502v-594h627v-82h-861q-311 0 -475 182.5t-164 497.5zM203 680q0 -134 34 -242.5t101 -189t173.5 -124.5t244.5 -44h127v1190h-127q-274 0 -413.5 -158t-139.5 -432z" />
+<glyph unicode="&#x153;" horiz-adv-x="1736" d="M106 489q0 120 35.5 219.5t95.5 164t138 100t164 35.5q123 0 226.5 -75.5t154.5 -215.5q55 135 152 213t214 78q175 0 275 -120t100 -335q0 -37 -6 -74h-690q0 -184 101.5 -304t252.5 -120q139 0 262 88l39 -71q-50 -30 -84.5 -47.5t-96.5 -33.5t-130 -16q-128 0 -231 78 t-156 211q-57 -142 -155 -215.5t-228 -73.5q-86 0 -164 35t-138 99t-95.5 162.5t-35.5 217.5zM201 489q0 -192 96 -313t242 -121q148 0 243 120.5t95 313.5q0 194 -95 316.5t-243 122.5q-146 0 -242 -123t-96 -316zM965 549h610q0 185 -77.5 283t-211.5 98q-124 0 -215 -107 t-106 -274z" />
+<glyph unicode="&#x178;" horiz-adv-x="901" d="M-2 1350h100l205 -422q99 -207 143 -291h9q114 218 147 291l205 422h96l-405 -803v-547h-95v547zM213 1559q0 34 21.5 54.5t54.5 20.5t54.5 -20.5t21.5 -54.5q0 -33 -21.5 -53.5t-54.5 -20.5t-54.5 20.5t-21.5 53.5zM537 1559q0 35 21 55t54 20q32 0 53 -20.5t21 -54.5 q0 -33 -21.5 -53.5t-52.5 -20.5q-33 0 -54 20.5t-21 53.5z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1095" d="M315 1171l193 279h80l192 -279h-75l-154 203h-8l-154 -203h-74z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1095" d="M295 1190q5 76 39 129t100 53q34 0 68 -17.5t57.5 -38.5t51.5 -38.5t51 -17.5q64 0 77 112h62q-5 -75 -40 -128.5t-102 -53.5q-33 0 -66 17.5t-55.5 39t-51.5 39t-54 17.5q-63 0 -76 -113h-61z" />
+<glyph unicode="&#x2000;" horiz-adv-x="884" />
+<glyph unicode="&#x2001;" horiz-adv-x="1769" />
+<glyph unicode="&#x2002;" horiz-adv-x="884" />
+<glyph unicode="&#x2003;" horiz-adv-x="1769" />
+<glyph unicode="&#x2004;" horiz-adv-x="589" />
+<glyph unicode="&#x2005;" horiz-adv-x="442" />
+<glyph unicode="&#x2006;" horiz-adv-x="294" />
+<glyph unicode="&#x2007;" horiz-adv-x="294" />
+<glyph unicode="&#x2008;" horiz-adv-x="221" />
+<glyph unicode="&#x2009;" horiz-adv-x="353" />
+<glyph unicode="&#x200a;" horiz-adv-x="98" />
+<glyph unicode="&#x2010;" horiz-adv-x="612" d="M82 471v80h450v-80h-450z" />
+<glyph unicode="&#x2011;" horiz-adv-x="612" d="M82 471v80h450v-80h-450z" />
+<glyph unicode="&#x2012;" horiz-adv-x="612" d="M82 471v80h450v-80h-450z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M82 475v74h819v-74h-819z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1638" d="M82 475v74h1474v-74h-1474z" />
+<glyph unicode="&#x2018;" horiz-adv-x="448" d="M119 1120q0 205 174 320l37 -47q-72 -60 -104.5 -115.5t-32.5 -138.5q4 2 16 2q33 0 57.5 -20t24.5 -56q0 -38 -23 -60t-59 -22q-41 0 -65.5 36t-24.5 101z" />
+<glyph unicode="&#x2019;" horiz-adv-x="448" d="M119 1024q72 60 104.5 115.5t32.5 138.5q-4 -2 -16 -2q-32 0 -56 20t-24 56q0 38 22 60t58 22q42 0 67 -36.5t25 -101.5q0 -205 -176 -319z" />
+<glyph unicode="&#x201a;" horiz-adv-x="448" d="M119 -221q72 60 104.5 115.5t32.5 138.5q-4 -2 -16 -2q-32 0 -56 19.5t-24 55.5q0 38 22 60t58 22q42 0 67 -36t25 -101q0 -205 -176 -319z" />
+<glyph unicode="&#x201c;" horiz-adv-x="737" d="M119 1120q0 205 174 320l37 -47q-72 -60 -104.5 -115.5t-32.5 -138.5q4 2 16 2q33 0 57.5 -20t24.5 -56q0 -38 -23 -60t-59 -22q-41 0 -65.5 36t-24.5 101zM408 1120q0 206 176 320l37 -47q-74 -59 -107 -115.5t-33 -138.5q6 2 19 2q32 0 56 -20t24 -56q0 -38 -22 -60 t-58 -22q-42 0 -67 36t-25 101z" />
+<glyph unicode="&#x201d;" horiz-adv-x="737" d="M119 1024q72 60 104.5 115.5t32.5 138.5q-4 -2 -16 -2q-32 0 -56 20t-24 56q0 38 22 60t58 22q42 0 67 -36.5t25 -101.5q0 -205 -176 -319zM408 1024q72 60 104.5 115.5t32.5 138.5q-4 -2 -17 -2q-32 0 -55.5 20t-23.5 56q0 38 21.5 60t57.5 22q42 0 67.5 -36.5 t25.5 -101.5q0 -204 -177 -319z" />
+<glyph unicode="&#x201e;" horiz-adv-x="737" d="M119 -221q72 60 104.5 115.5t32.5 138.5q-4 -2 -16 -2q-32 0 -56 19.5t-24 55.5q0 38 22 60t58 22q42 0 67 -36t25 -101q0 -205 -176 -319zM408 -221q72 60 104.5 115.5t32.5 138.5q-4 -2 -17 -2q-32 0 -55.5 19.5t-23.5 55.5q0 38 21.5 60t57.5 22q42 0 67.5 -36 t25.5 -101q0 -204 -177 -319z" />
+<glyph unicode="&#x2022;" horiz-adv-x="575" d="M82 541q0 99 61.5 162t143.5 63q83 0 145 -63t62 -162q0 -100 -62 -163t-145 -63q-82 0 -143.5 63t-61.5 163z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1906" d="M213 68q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -67t-60.5 -26t-61.5 26t-26.5 67zM903 68q0 42 26 68t62 26q35 0 60.5 -25.5t25.5 -68.5q0 -41 -25.5 -67t-60.5 -26t-61.5 26t-26.5 67zM1595 68q0 43 25.5 68.5t60.5 25.5t60.5 -25.5t25.5 -68.5 q0 -41 -25.5 -67t-60.5 -26t-60.5 26t-25.5 67z" />
+<glyph unicode="&#x202f;" horiz-adv-x="353" />
+<glyph unicode="&#x2039;" horiz-adv-x="530" d="M88 477v78l281 330l51 -43l-252 -326l252 -330l-51 -39z" />
+<glyph unicode="&#x203a;" horiz-adv-x="530" d="M111 186l249 330l-249 326l49 43l282 -330v-78l-282 -330z" />
+<glyph unicode="&#x205f;" horiz-adv-x="442" />
+<glyph unicode="&#x20ac;" d="M49 504v59l127 8q-2 29 -2 86q0 49 2 72h-127v59l133 9q28 251 155 393.5t325 142.5q88 0 164.5 -45t123.5 -114l-59 -56q-99 137 -229 137q-161 0 -260 -121t-123 -337h569v-68h-576q-2 -23 -2 -70q0 -59 2 -88h494v-67h-487q27 -211 120 -331t238 -120q83 0 148 40.5 t126 125.5l60 -51q-68 -95 -149.5 -144t-190.5 -49q-179 0 -298.5 141.5t-150.5 387.5h-133z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1249" d="M4 1313v71h518v-71h-221v-557h-78v557h-219zM629 756v628h106l107 -256l63 -176h8l64 176l102 256h107v-628h-78v329l10 201h-8l-168 -432h-70l-167 432h-9l11 -201v-329h-78z" />
+<glyph unicode="&#xe000;" horiz-adv-x="983" d="M0 0v983h983v-983h-983z" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1042" d="M68 905v70l135 8v219q0 145 62.5 220t180.5 75q70 0 144 -33l-25 -73q-57 28 -119 28q-153 0 -153 -223v-213h227v-78h-227v-905h-90v905h-135zM729 1300q0 37 23.5 59.5t58.5 22.5t58.5 -22.5t23.5 -59.5q0 -35 -24 -57t-58 -22t-58 22t-24 57zM764 0v983h90v-983h-90z " />
+<glyph unicode="&#xfb02;" horiz-adv-x="1024" d="M68 905v70l135 8v219q0 145 62.5 220t180.5 75q70 0 144 -33l-25 -73q-57 28 -119 28q-153 0 -153 -223v-213h227v-78h-227v-905h-90v905h-135zM727 131v1342h90v-1354q0 -31 12 -47.5t31 -16.5q17 0 37 4l14 -73q-33 -11 -63 -11q-121 0 -121 156z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.ttf b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.ttf
new file mode 100644
index 0000000..0959ece
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.ttf
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.woff b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.woff
new file mode 100644
index 0000000..522d5ab
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-light-webfont.woff
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.eot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.eot
new file mode 100644
index 0000000..2b75abb
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.eot
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.svg
new file mode 100644
index 0000000..581a849
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.svg
@@ -0,0 +1,243 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="source_sans_proregular" horiz-adv-x="1017" >
+<font-face units-per-em="2048" ascent="1536" descent="-512" />
+<missing-glyph horiz-adv-x="413" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="2048" />
+<glyph unicode=" " horiz-adv-x="413" />
+<glyph unicode="&#x09;" horiz-adv-x="413" />
+<glyph unicode="&#xa0;" horiz-adv-x="413" />
+<glyph unicode="!" horiz-adv-x="591" d="M174 102q0 58 35.5 94.5t87.5 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87.5 36t-35.5 91zM211 1372h170l-4 -192l-23 -774h-116l-23 774z" />
+<glyph unicode="&#x22;" horiz-adv-x="872" d="M164 1413h180l-6 -188l-33 -342h-102l-33 342zM526 1413h179l-5 -188l-32 -342h-105l-33 342z" />
+<glyph unicode="#" d="M72 418v117h178l37 303h-174v118h188l47 375h109l-47 -375h272l49 375h109l-49 -375h165v-118h-178l-37 -303h174v-117h-188l-51 -418h-109l49 418h-270l-51 -418h-111l52 418h-164zM360 535h271l37 303h-271z" />
+<glyph unicode="$" d="M106 135l78 117q159 -137 318 -137q111 0 169 56.5t58 154.5q0 67 -31.5 119.5t-82 87t-111 66t-121.5 65t-111.5 74t-82 103.5t-31.5 144q0 135 81 227.5t216 114.5v205h123v-203q91 -10 159 -49.5t131 -105.5l-90 -101q-63 61 -117.5 89t-132.5 28q-93 0 -148.5 -53.5 t-55.5 -143.5q0 -60 31.5 -106t82 -77t111.5 -60t121.5 -63.5t111 -77.5t82 -112.5t31.5 -158.5q0 -146 -85 -241t-232 -115v-207h-123v202q-95 9 -188.5 52.5t-160.5 105.5z" />
+<glyph unicode="%" horiz-adv-x="1687" d="M72 946q0 200 82.5 311t222.5 111q139 0 222 -111.5t83 -310.5q0 -200 -83 -313t-222 -113q-140 0 -222.5 113t-82.5 313zM199 946q0 -156 48 -238.5t130 -82.5q80 0 128 82.5t48 238.5t-47.5 237t-128.5 81q-82 0 -130 -80.5t-48 -237.5zM416 -25l741 1393h113 l-742 -1393h-112zM1008 401q0 199 82.5 310.5t222.5 111.5q139 0 222 -112t83 -310q0 -201 -83 -313.5t-222 -112.5q-140 0 -222.5 112.5t-82.5 313.5zM1135 401q0 -155 48.5 -238t129.5 -83q80 0 128 82.5t48 238.5q0 155 -47.5 236.5t-128.5 81.5t-129.5 -81.5 t-48.5 -236.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1247" d="M66 348q0 65 21 122t61 105t82 84t100 76q-88 178 -88 316q0 136 86.5 226.5t224.5 90.5q123 0 193.5 -73t70.5 -193q0 -43 -11 -82t-35.5 -76t-47.5 -65t-65 -63t-68.5 -55t-75.5 -56q129 -201 340 -377q129 174 188 397h158q-85 -281 -235 -481q147 -101 252 -129 l-46 -140q-150 43 -309 154q-171 -154 -387 -154q-182 0 -295.5 104.5t-113.5 268.5zM229 358q0 -110 76 -178.5t189 -68.5q132 0 256 108q-214 188 -353 399q-81 -65 -124.5 -126.5t-43.5 -133.5zM387 1053q0 -101 64 -236q54 36 89 63.5t70.5 63t52.5 74.5t17 82 q0 64 -31.5 105.5t-95.5 41.5q-74 0 -120 -55t-46 -139z" />
+<glyph unicode="'" horiz-adv-x="509" d="M164 1413h180l-6 -188l-33 -342h-102l-33 342z" />
+<glyph unicode="(" horiz-adv-x="620" d="M168 569q0 495 270 930l105 -49q-117 -192 -176.5 -418t-59.5 -463t59.5 -462.5t176.5 -417.5l-105 -49q-270 435 -270 929z" />
+<glyph unicode=")" horiz-adv-x="620" d="M78 -311q235 387 235 880q0 237 -59 463t-176 418l104 49q271 -437 271 -930q0 -261 -69 -488t-202 -441z" />
+<glyph unicode="*" horiz-adv-x="856" d="M119 1194l31 94l208 -51l19 221h100l19 -219l211 49l30 -94l-198 -82l114 -192l-80 -60l-145 176l-145 -176l-82 60l116 192z" />
+<glyph unicode="+" d="M70 612v127h372v400h133v-400h373v-127h-373v-399h-133v399h-372z" />
+<glyph unicode="," horiz-adv-x="509" d="M96 -250q88 39 136.5 103.5t48.5 146.5q-6 -2 -21 -2q-52 0 -86.5 31t-34.5 86q0 54 36 86t89 32q66 0 104 -53t38 -145q0 -130 -71.5 -230t-197.5 -153z" />
+<glyph unicode="-" horiz-adv-x="636" d="M84 449v129h471v-129h-471z" />
+<glyph unicode="." horiz-adv-x="509" d="M133 102q0 58 35.5 94.5t87.5 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87.5 36t-35.5 91z" />
+<glyph unicode="/" horiz-adv-x="716" d="M20 -328l547 1782h123l-545 -1782h-125z" />
+<glyph unicode="0" d="M90 657q0 325 110.5 499.5t309.5 174.5q197 0 307.5 -174.5t110.5 -499.5q0 -326 -110.5 -504t-307.5 -178q-198 0 -309 178t-111 504zM254 657q0 -277 68 -411.5t188 -134.5q119 0 186.5 134.5t67.5 411.5q0 276 -67 407.5t-187 131.5q-121 0 -188.5 -131t-67.5 -408z " />
+<glyph unicode="1" d="M162 0v139h299v963h-238v108q159 27 277 97h129v-1168h270v-139h-737z" />
+<glyph unicode="2" d="M74 1133q89 97 182 147.5t213 50.5q180 0 285.5 -105t105.5 -280q0 -52 -14.5 -106.5t-36 -104.5t-62.5 -111.5t-78.5 -111t-101 -121t-112 -123.5t-127.5 -135q144 12 219 12h379v-145h-844v100q135 134 217 219t167 182t129.5 165.5t72.5 139t28 132.5q0 117 -63 186.5 t-184 69.5q-143 0 -279 -158z" />
+<glyph unicode="3" d="M53 160l86 110q147 -155 334 -155q120 0 195 65.5t75 173.5q0 125 -97.5 192.5t-319.5 67.5v129q370 0 370 244q0 95 -60.5 151t-164.5 56q-145 0 -278 -133l-91 106q174 164 375 164q174 0 282.5 -88.5t108.5 -243.5q0 -114 -63 -191.5t-174 -119.5v-8 q125 -29 203.5 -115.5t78.5 -216.5q0 -169 -122.5 -271t-307.5 -102q-260 0 -430 185z" />
+<glyph unicode="4" d="M35 360v111l559 836h188v-811h179v-136h-179v-360h-159v360h-588zM213 496h410v378q0 77 10 252h-8q-9 -17 -107 -184z" />
+<glyph unicode="5" d="M51 154l82 110q69 -69 147 -109t183 -40q123 0 205 82.5t82 216.5t-76 210t-203 76q-63 0 -110.5 -18.5t-112.5 -60.5l-90 57l43 629h653v-146h-506l-35 -387q98 53 201 53q178 0 292 -103.5t114 -305.5q0 -103 -37 -188t-98.5 -140t-140.5 -85t-165 -30q-249 0 -428 179 z" />
+<glyph unicode="6" d="M98 604q0 153 27 276.5t73.5 206.5t110.5 138.5t135.5 80.5t151.5 25q186 0 315 -139l-94 -105q-40 48 -97 75.5t-118 27.5q-71 0 -130 -29.5t-107 -92t-76 -173t-31 -260.5q62 75 144 119.5t161 44.5q173 0 273 -103.5t100 -300.5q0 -184 -112.5 -302t-274.5 -118 q-200 0 -325.5 162.5t-125.5 466.5zM262 500q15 -190 88.5 -290.5t198.5 -100.5q98 0 162.5 79.5t64.5 206.5q0 131 -61 204t-180 73q-66 0 -138.5 -42.5t-134.5 -129.5z" />
+<glyph unicode="7" d="M90 1161v146h842v-105q-115 -147 -188.5 -280t-116.5 -280.5t-62 -291.5t-28 -350h-175q17 372 102 633t277 528h-651z" />
+<glyph unicode="8" d="M84 334q0 118 70 206.5t176 145.5v8q-183 130 -183 301q0 149 105.5 242.5t265.5 93.5q168 0 268.5 -97t100.5 -251q0 -93 -54 -176.5t-126 -138.5v-9q49 -29 85.5 -57.5t71 -68.5t52.5 -93t18 -116q0 -149 -117.5 -249t-304.5 -100q-185 0 -306.5 102t-121.5 257z M236 350q0 -108 80 -179t200 -71q114 0 185 64t71 166q0 47 -20.5 87.5t-42.5 65.5t-79.5 56.5t-85 43.5t-107.5 44q-13 5 -19 8q-182 -123 -182 -285zM303 995q0 -38 10.5 -70.5t33 -59t47 -47t63 -40.5t70 -33.5t77.5 -31.5q137 121 137 262q0 100 -61.5 165.5 t-165.5 65.5q-92 0 -151.5 -58.5t-59.5 -152.5z" />
+<glyph unicode="9" d="M82 911q0 184 112.5 302t272.5 118q202 0 326.5 -162.5t124.5 -466.5q0 -153 -27 -276.5t-73.5 -206.5t-110.5 -138.5t-135.5 -80.5t-151.5 -25q-189 0 -316 138l95 106q40 -48 97 -76t118 -28q72 0 131.5 29.5t108 93t76.5 175t30 263.5q-62 -78 -143.5 -123t-163.5 -45 q-173 0 -272 103t-99 300zM240 911q0 -130 61 -203t180 -73q68 0 140.5 42.5t134.5 131.5q-17 191 -91 290t-198 99q-97 0 -162 -80t-65 -207z" />
+<glyph unicode=":" horiz-adv-x="509" d="M133 102q0 58 35.5 94.5t87.5 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87.5 36t-35.5 91zM133 842q0 57 35.5 93t87.5 36q51 0 86 -36t35 -93q0 -56 -35 -91.5t-86 -35.5q-52 0 -87.5 35.5t-35.5 91.5z" />
+<glyph unicode=";" horiz-adv-x="509" d="M96 -250q88 39 136.5 103.5t48.5 146.5q-6 -2 -21 -2q-52 0 -86.5 31t-34.5 86q0 54 36 86t89 32q66 0 104 -53t38 -145q0 -130 -71.5 -230t-197.5 -153zM133 842q0 57 35.5 93t87.5 36q51 0 86 -36t35 -93q0 -56 -35 -91.5t-86 -35.5q-52 0 -87.5 35.5t-35.5 91.5z" />
+<glyph unicode="&#x3c;" d="M70 612v136l878 344v-146l-432 -160l-274 -102v-8l274 -103l432 -159v-146z" />
+<glyph unicode="=" d="M70 393v127h878v-127h-878zM70 831v127h878v-127h-878z" />
+<glyph unicode="&#x3e;" d="M70 268v146l432 159l274 103v8l-274 102l-432 160v146l878 -344v-136z" />
+<glyph unicode="?" horiz-adv-x="870" d="M78 1227q149 170 344 170q159 0 254.5 -88.5t95.5 -239.5q0 -73 -34 -142.5t-80.5 -125.5t-92 -113.5t-72.5 -130t-18 -151.5h-147q-9 65 1.5 125t34.5 106.5t55.5 90.5t64.5 84t60.5 78t45.5 81.5t18 87.5q0 86 -52 142t-146 56q-136 0 -236 -118zM285 102 q0 58 34.5 94.5t86.5 36.5t87 -36.5t35 -94.5q0 -55 -35 -91t-87 -36q-51 0 -86 36t-35 91z" />
+<glyph unicode="@" horiz-adv-x="1734" d="M104 416q0 201 69 372.5t186 287.5t272 181.5t327 65.5q308 0 490 -186.5t182 -491.5q0 -129 -37.5 -235.5t-97.5 -172t-131 -101.5t-143 -36q-86 0 -143.5 40.5t-67.5 115.5h-4q-53 -63 -119 -101t-131 -38q-108 0 -177 76.5t-69 212.5q0 83 28 167t77.5 152.5t125 112 t162.5 43.5q110 0 164 -99h4l23 82h112l-80 -409q-61 -240 111 -240q49 0 97.5 29.5t88 82t64 134.5t24.5 178q0 167 -63 294.5t-192.5 202t-311.5 74.5q-137 0 -266 -56.5t-229.5 -157t-161 -250.5t-60.5 -324q0 -195 80.5 -338.5t218 -216t312.5 -72.5q171 0 331 92 l45 -100q-172 -104 -389 -104q-121 0 -229 30t-198 91t-155.5 147.5t-102 205.5t-36.5 259zM645 416q0 -94 39 -139.5t104 -45.5q88 0 189 121l59 326q-29 47 -59 66.5t-72 19.5q-58 0 -108.5 -32.5t-82.5 -84t-50.5 -112t-18.5 -119.5z" />
+<glyph unicode="A" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="B" horiz-adv-x="1193" d="M178 0v1343h400q216 0 339 -79t123 -248q0 -105 -60 -184t-175 -109v-8q150 -24 230.5 -105t80.5 -217q0 -192 -138 -292.5t-370 -100.5h-430zM350 135h234q176 0 270 66t94 200q0 242 -364 242h-234v-508zM350 770h199q167 0 245 58t78 173q0 107 -78.5 157t-236.5 50 h-207v-438z" />
+<glyph unicode="C" horiz-adv-x="1159" d="M100 672q0 211 78.5 370.5t214 242.5t307.5 83q112 0 206.5 -46.5t160.5 -119.5l-96 -108q-118 125 -269 125q-193 0 -309.5 -147t-116.5 -396q0 -253 113 -402t305 -149q174 0 307 149l97 -104q-165 -195 -408 -195q-127 0 -235 48t-187 136t-123.5 220t-44.5 293z" />
+<glyph unicode="D" horiz-adv-x="1253" d="M178 0v1343h336q309 0 472 -172t163 -493q0 -323 -162 -500.5t-465 -177.5h-344zM350 139h152q233 0 352 140t119 399q0 256 -118.5 391t-352.5 135h-152v-1065z" />
+<glyph unicode="E" horiz-adv-x="1069" d="M178 0v1343h774v-143h-602v-422h508v-145h-508v-488h623v-145h-795z" />
+<glyph unicode="F" horiz-adv-x="1001" d="M178 0v1343h776v-143h-604v-455h512v-143h-512v-602h-172z" />
+<glyph unicode="G" horiz-adv-x="1253" d="M100 672q0 212 80.5 371t220.5 242t320 83q223 0 385 -166l-98 -108q-118 125 -285 125q-205 0 -326 -146.5t-121 -396.5q0 -256 117 -403.5t330 -147.5q72 0 138 21.5t106 58.5v350h-285v141h440v-565q-71 -69 -180 -112.5t-237 -43.5q-176 0 -312.5 82t-214.5 241 t-78 374z" />
+<glyph unicode="H" horiz-adv-x="1325" d="M178 0v1343h172v-563h625v563h170v-1343h-170v633h-625v-633h-172z" />
+<glyph unicode="I" horiz-adv-x="528" d="M178 0v1343h172v-1343h-172z" />
+<glyph unicode="J" horiz-adv-x="970" d="M59 190l121 86q87 -151 234 -151q109 0 162 68t53 219v931h170v-948q0 -89 -21.5 -163.5t-64.5 -133t-116 -91t-169 -32.5q-250 0 -369 215z" />
+<glyph unicode="K" horiz-adv-x="1175" d="M178 0v1343h172v-673h4l559 673h195l-422 -512l485 -831h-190l-401 698l-230 -272v-426h-172z" />
+<glyph unicode="L" horiz-adv-x="985" d="M178 0v1343h172v-1198h586v-145h-758z" />
+<glyph unicode="M" horiz-adv-x="1478" d="M178 0v1343h203l260 -720l96 -275h8l95 275l258 720h200v-1343h-161v739q0 71 22 398h-8l-107 -299l-258 -703h-98l-258 703l-106 299h-9q21 -312 21 -398v-739h-158z" />
+<glyph unicode="N" horiz-adv-x="1314" d="M178 0v1343h176l488 -843l145 -279h8q-2 30 -8.5 128.5t-10 167.5t-3.5 132v694h162v-1343h-177l-485 846l-145 276h-9q2 -25 8.5 -125t9.5 -165.5t3 -129.5v-702h-162z" />
+<glyph unicode="O" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395z" />
+<glyph unicode="P" horiz-adv-x="1169" d="M178 0v1343h414q115 0 203 -20.5t155 -66t102 -123t35 -185.5q0 -206 -133.5 -311t-361.5 -105h-242v-532h-172zM350 672h219q178 0 263.5 67t85.5 209t-84.5 200t-264.5 58h-219v-534z" />
+<glyph unicode="Q" horiz-adv-x="1349" d="M98 678q0 318 158.5 504t415.5 186t416 -186.5t159 -503.5q0 -287 -129 -472t-346 -222q45 -87 131.5 -132t198.5 -45q63 0 141 21l33 -133q-91 -31 -193 -31q-179 0 -306.5 86.5t-188.5 231.5q-223 31 -356.5 217t-133.5 479zM274 678q0 -252 109 -402.5t289 -150.5 t288.5 150.5t108.5 402.5q0 249 -108 395t-289 146t-289.5 -146t-108.5 -395z" />
+<glyph unicode="R" horiz-adv-x="1179" d="M178 0v1343h422q469 0 469 -376q0 -152 -80 -248t-221 -133l342 -586h-195l-323 567h-242v-567h-172zM350 707h225q158 0 241 65.5t83 194.5q0 128 -80.5 183.5t-243.5 55.5h-225v-499z" />
+<glyph unicode="S" horiz-adv-x="1083" d="M82 174l102 119q74 -77 171 -122.5t200 -45.5q131 0 206 60t75 159q0 29 -6.5 53.5t-15.5 43t-28 37t-33 30t-43.5 27t-46.5 23.5t-53 24l-192 84q-273 116 -273 346q0 154 120.5 255t303.5 101q116 0 219.5 -45t176.5 -121l-91 -110q-134 127 -305 127 q-115 0 -183.5 -53.5t-68.5 -143.5q0 -31 8 -57.5t28 -48.5t35.5 -36.5t49 -32t49.5 -24.5t54 -24l192 -82q64 -28 110 -57.5t86 -72t60.5 -100t20.5 -129.5q0 -164 -126 -273.5t-333 -109.5q-137 0 -258 53t-211 146z" />
+<glyph unicode="T" horiz-adv-x="1087" d="M51 1200v143h985v-143h-407v-1200h-170v1200h-408z" />
+<glyph unicode="U" horiz-adv-x="1310" d="M172 555v788h172v-792q0 -426 311 -426q320 0 320 426v792h164v-788q0 -157 -36.5 -272t-103.5 -181t-152 -96.5t-192 -30.5t-192 30.5t-151.5 96.5t-103 181t-36.5 272z" />
+<glyph unicode="V" horiz-adv-x="1044" d="M-4 1343h180l217 -725q14 -46 57.5 -199.5t71.5 -244.5h8q44 143 129 444l215 725h175l-426 -1343h-199z" />
+<glyph unicode="W" horiz-adv-x="1599" d="M41 1343h176l141 -731q14 -73 40.5 -217t39.5 -217h8q34 167 95 434l186 731h156l186 -731q79 -359 96 -434h9q16 85 42.5 241.5t32.5 192.5l142 731h165l-278 -1343h-207l-203 809q-47 212 -63 305h-8q-11 -52 -34 -152.5t-34 -152.5l-201 -809h-202z" />
+<glyph unicode="X" horiz-adv-x="1040" d="M27 0l391 694l-367 649h189l184 -344q10 -19 44.5 -84t59.5 -110h9q78 164 94 194l178 344h180l-364 -657l391 -686h-189l-198 362q-10 19 -50 93.5t-65 122.5h-8q-66 -138 -107 -216l-194 -362h-178z" />
+<glyph unicode="Y" horiz-adv-x="964" d="M-8 1343h184l172 -378q94 -215 131 -293h8q13 30 61.5 133t72.5 160l174 378h176l-404 -823v-520h-170v520z" />
+<glyph unicode="Z" horiz-adv-x="1093" d="M86 0v102l709 1098h-645v143h856v-100l-709 -1098h715v-145h-926z" />
+<glyph unicode="[" horiz-adv-x="620" d="M193 -311v1761h366v-98h-240v-1567h240v-96h-366z" />
+<glyph unicode="\" horiz-adv-x="716" d="M29 1454h121l546 -1782h-123z" />
+<glyph unicode="]" horiz-adv-x="620" d="M63 -215h238v1567h-238v98h365v-1761h-365v96z" />
+<glyph unicode="^" d="M123 582l311 790h150l311 -790h-147l-134 360l-100 272h-8l-103 -272l-133 -360h-147z" />
+<glyph unicode="_" horiz-adv-x="1024" d="M25 -145h974v-113h-974v113z" />
+<glyph unicode="`" horiz-adv-x="1110" d="M328 1462h176l184 -288h-129z" />
+<glyph unicode="a" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5 t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5z" />
+<glyph unicode="b" horiz-adv-x="1136" d="M168 0v1458h168v-397l-4 -180q156 139 311 139q190 0 292.5 -135.5t102.5 -370.5q0 -124 -35 -227t-95 -170.5t-137 -104.5t-163 -37q-145 0 -284 123h-7l-14 -98h-135zM336 221q120 -104 244 -104q125 0 204.5 107t79.5 288q0 173 -63.5 270t-198.5 97q-121 0 -266 -136 v-522z" />
+<glyph unicode="c" horiz-adv-x="933" d="M94 496q0 122 38.5 222.5t105 165.5t152.5 100.5t183 35.5q163 0 291 -119l-84 -108q-102 88 -200 88q-136 0 -224 -107t-88 -278q0 -170 85 -275.5t222 -105.5q123 0 234 100l76 -111q-145 -129 -324 -129q-204 0 -335.5 140t-131.5 381z" />
+<glyph unicode="d" horiz-adv-x="1136" d="M96 496q0 118 35.5 218t95.5 166t138 103t163 37q81 0 144 -28t135 -87l-8 170v383h170v-1458h-140l-14 117h-6q-146 -142 -301 -142q-190 0 -301 137.5t-111 383.5zM270 498q0 -179 72.5 -280t202.5 -101q132 0 254 137v520q-116 105 -242 105q-122 0 -204.5 -106.5 t-82.5 -274.5z" />
+<glyph unicode="e" horiz-adv-x="1015" d="M94 496q0 118 38 218.5t100.5 166.5t142.5 102.5t166 36.5q188 0 292.5 -125.5t104.5 -341.5q0 -55 -6 -92h-672q9 -161 99 -255.5t233 -94.5q127 0 248 77l59 -110q-161 -103 -328 -103q-205 0 -341 141.5t-136 379.5zM258 571h533q0 152 -64.5 234t-181.5 82 q-109 0 -190.5 -85t-96.5 -231z" />
+<glyph unicode="f" horiz-adv-x="598" d="M61 858v127l136 10v158q0 157 72 243.5t218 86.5q83 0 166 -33l-37 -129q-58 25 -112 25q-139 0 -139 -193v-158h210v-137h-210v-858h-168v858h-136z" />
+<glyph unicode="g" horiz-adv-x="1032" d="M92 -190q0 62 38.5 120t107.5 105v8q-88 56 -88 162q0 58 31.5 105.5t76.5 78.5v8q-55 44 -92 115t-37 154q0 158 109 256t266 98q75 0 141 -25h346v-129h-205q37 -35 59.5 -89t22.5 -115q0 -156 -104 -251.5t-260 -95.5q-82 0 -150 35q-63 -56 -63 -119q0 -108 176 -108 h192q176 0 262.5 -57.5t86.5 -180.5q0 -143 -139.5 -243.5t-364.5 -100.5q-187 0 -299.5 71t-112.5 198zM240 -168q0 -80 77 -127t211 -47q138 0 227 61t89 142q0 67 -50 95t-151 28h-172q-72 0 -129 16q-102 -72 -102 -168zM293 666q0 -106 61 -172t150 -66t150 66t61 172 t-60 168.5t-151 62.5t-151 -62.5t-60 -168.5z" />
+<glyph unicode="h" horiz-adv-x="1114" d="M168 0v1458h168v-397l-6 -205q82 78 160 121t172 43q303 0 303 -389v-631h-168v608q0 139 -45.5 202.5t-143.5 63.5q-72 0 -131 -35.5t-141 -117.5v-721h-168z" />
+<glyph unicode="i" horiz-adv-x="503" d="M137 1309q0 49 33.5 78.5t83.5 29.5t83.5 -29.5t33.5 -78.5q0 -47 -33.5 -78t-83.5 -31t-83.5 31t-33.5 78zM168 0v995h168v-995h-168z" />
+<glyph unicode="j" horiz-adv-x="505" d="M-82 -418l35 127q50 -16 94 -16q70 0 96.5 48t26.5 146v1108h168v-1108q0 -160 -64.5 -245.5t-207.5 -85.5q-83 0 -148 26zM139 1309q0 49 33.5 78.5t83.5 29.5q49 0 82 -30t33 -78q0 -47 -33.5 -78t-81.5 -31q-50 0 -83.5 31t-33.5 78z" />
+<glyph unicode="k" horiz-adv-x="1013" d="M168 0v1458h166v-987h6l424 524h186l-334 -399l379 -596h-184l-291 479l-186 -217v-262h-166z" />
+<glyph unicode="l" horiz-adv-x="522" d="M168 201v1257h168v-1270q0 -37 13 -55t34 -18q19 0 37 4l22 -127q-39 -17 -96 -17q-93 0 -135.5 57t-42.5 169z" />
+<glyph unicode="m" horiz-adv-x="1697" d="M168 0v995h139l15 -143h6q154 168 309 168q208 0 274 -191q85 93 164 142t164 49q303 0 303 -389v-631h-168v608q0 138 -45 202t-139 64q-112 0 -250 -153v-721h-168v608q0 139 -45 202.5t-141 63.5q-112 0 -250 -153v-721h-168z" />
+<glyph unicode="n" horiz-adv-x="1120" d="M168 0v995h139l15 -143h6q80 80 159.5 124t174.5 44q303 0 303 -389v-631h-168v608q0 139 -45.5 202.5t-143.5 63.5q-72 0 -131 -35.5t-141 -117.5v-721h-168z" />
+<glyph unicode="o" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5z" />
+<glyph unicode="p" horiz-adv-x="1136" d="M168 -420v1415h139l15 -114h6q165 139 317 139q189 0 291 -136t102 -372q0 -123 -35 -226t-94.5 -170t-137 -104t-163.5 -37q-129 0 -276 115l4 -174v-336h-168zM336 221q123 -104 244 -104q125 0 204.5 107t79.5 288q0 173 -63.5 270t-198.5 97q-115 0 -266 -136v-522z " />
+<glyph unicode="q" horiz-adv-x="1126" d="M96 496q0 118 35.5 218t95.5 166t138 103t163 37q83 0 148.5 -28.5t136.5 -90.5h4l17 94h135v-1415h-170v354l8 177q-147 -136 -299 -136q-190 0 -301 137.5t-111 383.5zM270 498q0 -179 72.5 -280t202.5 -101q132 0 254 137v520q-116 105 -242 105q-122 0 -204.5 -106.5 t-82.5 -274.5z" />
+<glyph unicode="r" horiz-adv-x="710" d="M168 0v995h139l15 -180h6q52 96 125.5 150.5t156.5 54.5q58 0 107 -21l-33 -147q-53 16 -96 16q-69 0 -136.5 -55.5t-115.5 -173.5v-639h-168z" />
+<glyph unicode="s" horiz-adv-x="858" d="M57 113l84 112q71 -58 140.5 -88.5t152.5 -30.5q94 0 145.5 44t51.5 112q0 29 -14.5 55t-33 43.5t-54 36t-59.5 28.5t-67 26q-51 18 -86 33t-78.5 41t-69.5 53.5t-44.5 69t-18.5 89.5q0 123 92.5 203t250.5 80q168 0 309 -113l-80 -106q-117 88 -227 88q-89 0 -136 -41.5 t-47 -102.5q0 -32 16 -57t48.5 -44.5t63.5 -33.5t79 -32q3 -1 5 -1.5t4.5 -1.5t4.5 -2q41 -15 62.5 -23.5t59 -26t59 -32t48.5 -38.5t41 -49t24 -59t10 -73q0 -127 -97 -212t-268 -85q-101 0 -199 38t-172 100z" />
+<glyph unicode="t" horiz-adv-x="692" d="M49 858v127l156 10l20 279h142v-279h268v-137h-268v-553q0 -97 35 -144.5t118 -47.5q42 0 113 26l33 -127q-113 -37 -185 -37q-152 0 -218 87t-66 245v551h-148z" />
+<glyph unicode="u" horiz-adv-x="1114" d="M154 365v630h170v-608q0 -140 44 -203t142 -63q75 0 135.5 39t132.5 129v706h168v-995h-139l-14 156h-7q-75 -89 -152.5 -135t-174.5 -46q-305 0 -305 390z" />
+<glyph unicode="v" horiz-adv-x="956" d="M25 995h174l188 -565q40 -137 92 -293h8q7 22 40.5 129t50.5 164l188 565h166l-352 -995h-197z" />
+<glyph unicode="w" horiz-adv-x="1470" d="M49 995h172l148 -575q24 -98 59 -277h8q6 25 29.5 124.5t38.5 152.5l153 575h164l156 -575q12 -47 70 -277h8q14 55 61 277l146 575h159l-266 -995h-205l-143 535q-14 51 -35.5 147.5t-32.5 138.5h-8q-56 -245 -69 -289l-140 -532h-196z" />
+<glyph unicode="x" horiz-adv-x="913" d="M29 0l325 520l-301 475h183l133 -219q87 -148 98 -166h8q65 123 90 166l121 219h176l-301 -493l324 -502h-183l-145 231q-87 147 -108 179h-9q-27 -43 -100 -179l-135 -231h-176z" />
+<glyph unicode="y" horiz-adv-x="956" d="M25 995h174l202 -551q41 -113 97 -280h8q16 51 45 150t39 130l178 551h164l-375 -1077q-28 -79 -60 -138t-76.5 -108t-104 -74.5t-132.5 -25.5q-61 0 -116 20l32 134q50 -15 76 -15q154 0 225 213l23 74z" />
+<glyph unicode="z" horiz-adv-x="870" d="M63 0v90l525 768h-467v137h680v-90l-525 -768h541v-137h-754z" />
+<glyph unicode="{" horiz-adv-x="620" d="M70 516v107q50 1 86 14t54.5 36t27 49.5t8.5 57.5q0 63 -9.5 194.5t-9.5 203.5q0 152 56.5 212t181.5 60h94v-98h-57q-80 0 -108.5 -41t-28.5 -144q0 -59 6 -183t6 -187q0 -100 -28.5 -152.5t-94.5 -71.5v-8q66 -19 94.5 -71.5t28.5 -151.5q0 -71 -6 -190.5t-6 -180.5 q0 -103 28.5 -144.5t108.5 -41.5h57v-96h-94q-125 0 -181.5 59.5t-56.5 212.5q0 77 9.5 202.5t9.5 192.5q0 157 -176 160z" />
+<glyph unicode="|" horiz-adv-x="493" d="M188 -512v2048h119v-2048h-119z" />
+<glyph unicode="}" horiz-adv-x="620" d="M63 -215h54q81 0 110 41.5t29 144.5q0 61 -5 180.5t-5 190.5q0 99 28 151.5t93 71.5v8q-65 19 -93 71t-28 153q0 63 5 187t5 183q0 103 -29 144t-110 41h-54v98h91q127 0 183 -60t56 -212q0 -72 -9 -203.5t-9 -194.5q0 -67 40.5 -111.5t135.5 -45.5v-107q-65 -1 -106 -25 t-55.5 -57.5t-14.5 -77.5q0 -67 9 -192.5t9 -202.5q0 -154 -56 -213t-183 -59h-91v96z" />
+<glyph unicode="~" d="M74 641q53 94 119.5 139t136.5 45q45 0 88 -17.5t77 -43t66 -51t66 -43t65 -17.5q91 0 158 125l94 -69q-53 -93 -119.5 -138t-136.5 -45q-45 0 -88 17.5t-77 43t-66 51t-66 43t-65 17.5q-91 0 -158 -125z" />
+<glyph unicode="&#xa1;" horiz-adv-x="591" d="M174 893q0 55 35.5 91t87.5 36q50 0 85.5 -36t35.5 -91q0 -57 -35 -94t-86 -37q-52 0 -87.5 36.5t-35.5 94.5zM211 -377l4 193l23 774h116l23 -774l4 -193h-170z" />
+<glyph unicode="&#xa2;" d="M125 635q0 205 115.5 332t296.5 153v217h106v-211q150 -8 268 -118l-82 -107q-91 81 -186 86v-704q114 8 213 96l74 -107q-130 -117 -287 -129v-211h-106v213q-188 22 -300 150t-112 340zM293 635q0 -137 64.5 -227.5t179.5 -116.5v686q-113 -26 -178.5 -117t-65.5 -225z " />
+<glyph unicode="&#xa3;" d="M109 584v106l137 8h37q-1 4 -8.5 28t-9.5 30t-8.5 27t-8.5 29.5t-6.5 27t-6 29.5t-4 27t-3.5 30t-1 28q0 172 105 274.5t276 102.5q193 0 318 -153l-99 -97q-88 109 -206 109q-108 0 -168 -66t-60 -174q0 -40 8 -88t16 -76.5t25 -87.5h326v-114h-299q10 -62 10 -115 q0 -103 -31 -176t-96 -139v-9h576v-145h-817v102q103 56 160 154t57 215q0 44 -15 113h-204z" />
+<glyph unicode="&#xa4;" d="M53 303l131 133q-73 98 -73 238q0 141 73 239l-131 136l90 92l140 -144q98 76 227 76q127 0 225 -76l139 144l91 -92l-134 -136q76 -102 76 -239q0 -136 -76 -238l134 -133l-91 -92l-139 141q-96 -78 -225 -78q-131 0 -227 78l-140 -141zM266 674q0 -121 71 -198t173 -77 q101 0 171.5 77.5t70.5 197.5t-70.5 197t-171.5 77q-102 0 -173 -77t-71 -197z" />
+<glyph unicode="&#xa5;" d="M47 1307h176l160 -351q23 -51 65.5 -147t57.5 -129h8q26 56 70 154.5t55 121.5l160 351h172l-336 -656h291v-96h-334v-133h334v-98h-334v-324h-168v324h-332v98h332v133h-332v96h289z" />
+<glyph unicode="&#xa6;" horiz-adv-x="493" d="M188 438h119v-950h-119v950zM188 596v940h119v-940h-119z" />
+<glyph unicode="&#xa7;" d="M92 702q0 85 47.5 152.5t128.5 112.5q-65 68 -65 168q0 112 82 189t229 77q170 0 315 -117l-81 -108q-117 94 -228 94q-82 0 -122 -36t-40 -93q0 -44 31.5 -80t81.5 -62t110.5 -51.5t121 -57t110.5 -70.5t81.5 -100t31.5 -138q0 -91 -45 -154t-129 -111q61 -70 61 -167 q0 -122 -93 -201.5t-237 -79.5q-107 0 -198.5 38t-155.5 107l102 92q109 -106 252 -106q80 0 127 40.5t47 100.5q0 47 -31 84t-81 63.5t-110.5 51.5t-120.5 56t-110 69.5t-81 99t-31 137.5zM240 713q0 -51 25.5 -91.5t73 -70.5t95.5 -52t114 -51t107 -53q63 29 93 69t30 105 q0 44 -19.5 81t-49 62t-74.5 50t-86.5 42.5t-94.5 41.5t-89 45q-62 -34 -93.5 -76t-31.5 -102z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1110" d="M279 1305q0 43 28.5 71.5t71.5 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29t-71.5 29t-28.5 72zM633 1305q0 43 27.5 71.5t70.5 28.5q44 0 72 -28.5t28 -71.5t-28 -72t-72 -29q-42 0 -70 29t-28 72z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1523" d="M100 662q0 152 53.5 280.5t144 214t211 133t253.5 47.5t253 -47.5t211 -133t144 -214t53 -280.5q0 -153 -53.5 -283t-143.5 -217t-210.5 -136t-253.5 -49t-253.5 49t-211 136t-144 217t-53.5 283zM197 662q0 -131 45 -244t121.5 -190t180 -121t218.5 -44t218.5 44 t180 121t121.5 190t45 244q0 130 -45 242t-121.5 187.5t-180 118.5t-218.5 43t-218.5 -43t-180 -118.5t-121.5 -187.5t-45 -242zM406 662q0 173 111.5 280t266.5 107q80 0 140 -30.5t116 -86.5l-71 -80q-87 84 -178 84q-112 0 -181 -76.5t-69 -197.5q0 -135 66 -214t177 -79 q105 0 209 90l62 -86q-66 -57 -129 -87t-148 -30q-160 0 -266 110t-106 296z" />
+<glyph unicode="&#xaa;" horiz-adv-x="706" d="M76 709q0 107 97 165t310 78q-3 152 -127 152q-89 0 -206 -70l-48 86q139 88 273 88q235 0 235 -274v-402h-102l-14 76h-9q-103 -92 -206 -92q-91 0 -147 53.5t-56 139.5zM201 719q0 -101 114 -101q80 0 168 82v172q-152 -17 -217 -55t-65 -98z" />
+<glyph unicode="&#xab;" horiz-adv-x="878" d="M92 453v127l279 317l73 -61l-241 -320l241 -323l-73 -58zM416 453v127l280 317l72 -61l-242 -320l242 -323l-72 -58z" />
+<glyph unicode="&#xac;" d="M70 612v127h878v-526h-135v399h-743z" />
+<glyph unicode="&#xad;" horiz-adv-x="636" d="M84 449v129h471v-129h-471z" />
+<glyph unicode="&#xae;" horiz-adv-x="866" d="M47 1057q0 177 111.5 290t273.5 113q163 0 275 -113t112 -290t-112 -290.5t-275 -113.5q-161 0 -273 113.5t-112 290.5zM129 1057q0 -145 86.5 -236.5t216.5 -91.5q131 0 218 91.5t87 236.5q0 143 -87.5 236t-217.5 93t-216.5 -92.5t-86.5 -236.5zM285 854v416h155 q71 0 115.5 -32t44.5 -101q0 -37 -21.5 -69t-54.5 -44l94 -170h-94l-71 143h-84v-143h-84zM369 1063h53q42 0 65 18t23 52q0 67 -84 67h-57v-137z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1110" d="M305 1231v117h502v-117h-502z" />
+<glyph unicode="&#xb0;" horiz-adv-x="677" d="M84 1139q0 118 75 191t181 73t181 -73t75 -191q0 -115 -75 -187.5t-181 -72.5t-181 72.5t-75 187.5zM186 1139q0 -72 43.5 -119t110.5 -47t110.5 47t43.5 119q0 75 -43 122.5t-111 47.5t-111 -47.5t-43 -122.5z" />
+<glyph unicode="&#xb1;" d="M70 0v127h878v-127h-878zM70 623v127h372v389h133v-389h373v-127h-373v-363h-133v363h-372z" />
+<glyph unicode="&#xb2;" horiz-adv-x="751" d="M82 1569q47 71 116.5 113t149.5 42q122 0 194 -67t72 -191q0 -54 -16.5 -102.5t-67 -113t-79.5 -96.5t-116 -121q-12 -13 -18 -19h338v-113h-549v76q108 97 166 152.5t113.5 117.5t77.5 108.5t22 90.5q0 78 -41 123t-112 45q-92 0 -172 -117z" />
+<glyph unicode="&#xb3;" horiz-adv-x="751" d="M72 1032l88 68q79 -119 202 -119q68 0 114 38.5t46 104.5q0 69 -65 105.5t-183 36.5v84q101 0 159.5 40t58.5 103q0 57 -40 92t-106 35q-83 0 -162 -96l-80 69q115 131 263 131q107 0 180.5 -58.5t73.5 -156.5q0 -129 -140 -196q73 -19 122.5 -70.5t49.5 -126.5 q0 -108 -82 -173.5t-202 -65.5q-94 0 -171.5 42.5t-125.5 112.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1110" d="M422 1174l184 288h176l-231 -288h-129z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1126" d="M168 -410v1405h168v-608q0 -139 45 -202.5t143 -63.5q75 0 134.5 39t132.5 129v706h167v-995h-139l-14 156h-4q-127 -172 -287 -172q-66 0 -110.5 18.5t-77.5 69.5l10 -185v-297h-168z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1146" d="M84 907q0 118 36.5 203.5t105 135.5t155.5 73.5t197 23.5h90v-880h-68q-153 0 -266.5 45.5t-181.5 147t-68 251.5zM778 -164v1507h172v-1507h-172z" />
+<glyph unicode="&#xb7;" horiz-adv-x="509" d="M133 657q0 58 35.5 94.5t87.5 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87.5 36t-35.5 91z" />
+<glyph unicode="&#xb8;" horiz-adv-x="1110" d="M395 -352q183 24 183 98q0 38 -32.5 61t-99.5 39l82 160h111l-53 -108q121 -41 121 -146q0 -83 -83.5 -129.5t-211.5 -58.5z" />
+<glyph unicode="&#xb9;" horiz-adv-x="751" d="M178 1532v86q117 21 199 82h106v-799h-131v631h-174z" />
+<glyph unicode="&#xba;" horiz-adv-x="747" d="M61 862q0 159 89.5 252.5t222.5 93.5q131 0 221 -93.5t90 -252.5q0 -158 -90 -252t-221 -94q-132 0 -222 94t-90 252zM190 862q0 -108 49.5 -174.5t133.5 -66.5t132 66t48 175q0 110 -48 176t-132 66t-133.5 -66t-49.5 -176z" />
+<glyph unicode="&#xbb;" horiz-adv-x="878" d="M111 193l241 323l-241 320l71 61l281 -317v-127l-281 -318zM434 193l242 323l-242 320l74 61l278 -317v-127l-278 -318z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1599" d="M129 1176v86q116 21 197 81h108v-798h-131v631h-174zM369 -25l741 1393h115l-742 -1393h-114zM934 213v68l334 518h147v-492h119v-94h-119v-213h-119v213h-362zM1069 307h227v144l11 223h-9l-102 -166z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1654" d="M129 1176v86q116 21 197 81h108v-798h-131v631h-174zM328 -25l741 1393h115l-742 -1393h-114zM985 668q47 71 116.5 113t149.5 42q123 0 195 -67t72 -191q0 -54 -16.5 -102.5t-67 -113t-79.5 -96.5t-116 -121q-12 -13 -18 -19h338v-113h-549v76q108 97 166 152.5 t113.5 117.5t77.5 108.5t22 90.5q0 78 -41.5 123t-112.5 45q-92 0 -172 -117z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1630" d="M70 678l86 65q78 -118 202 -118q68 0 114 38.5t46 104.5q0 69 -64.5 105t-183.5 36v84q100 0 158.5 40.5t58.5 103.5q0 59 -38.5 93t-104.5 34q-84 0 -164 -97l-78 70q111 131 260 131q108 0 182 -58.5t74 -156.5q0 -132 -139 -195q73 -20 121.5 -71.5t48.5 -126.5 q0 -108 -81 -174t-201 -66q-94 0 -171.5 43.5t-125.5 114.5zM446 -25l742 1393h112l-741 -1393h-113zM963 213v68l335 518h148v-492h119v-94h-119v-213h-119v213h-364zM1100 307h227v144l10 223h-8l-102 -166z" />
+<glyph unicode="&#xbf;" horiz-adv-x="870" d="M98 -74q0 62 24 122t60 105.5t76.5 97.5t73.5 99t51 110t10 130h150q9 -65 -1.5 -125t-34.5 -106.5t-55.5 -90.5t-65 -84t-61 -78t-45.5 -81.5t-18 -87.5q0 -86 51.5 -141.5t147.5 -55.5q133 0 233 117l99 -88q-152 -170 -344 -170q-160 0 -255.5 88t-95.5 239zM342 893 q0 55 35.5 91t87.5 36q50 0 85.5 -36t35.5 -91q0 -57 -35 -94t-86 -37q-52 0 -87.5 36.5t-35.5 94.5z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM281 1675h192l180 -229h-141zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452zM444 1446l181 229h192l-231 -229h-142z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM270 1446l197 229h164l196 -229h-137l-137 139h-8l-137 -139h-138zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM252 1456q9 98 55.5 159.5t118.5 61.5q45 0 89.5 -26.5t83 -53t69.5 -26.5t53 27.5t31 78.5h92q-8 -97 -54 -159t-118 -62q-37 0 -73.5 16.5t-61 37t-54.5 37t-55 16.5q-31 0 -53 -27.5t-29 -79.5h-94z M346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM272 1565q0 44 28 72t71 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -71 29t-28 72zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452zM625 1565q0 44 28.5 72t71.5 28t71.5 -28 t28.5 -72q0 -43 -28.5 -72t-71.5 -29t-71.5 29t-28.5 72z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1101" d="M0 0l455 1343h192l455 -1343h-180l-129 410h-490l-129 -410h-174zM346 547h404l-64 205q-70 223 -133 452h-8q-63 -229 -133 -452zM356 1612q0 81 54 130.5t139 49.5q83 0 136.5 -49.5t53.5 -130.5q0 -82 -53.5 -131t-136.5 -49q-86 0 -139.5 49t-53.5 131zM451 1612 q0 -50 27.5 -78.5t70.5 -28.5q40 0 68 29t28 78q0 46 -28 75t-68 29q-42 0 -70 -29t-28 -75z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1673" d="M12 0l705 1343h842v-143h-572v-422h477v-145h-477v-488h592v-145h-762v391h-426l-203 -391h-176zM463 528h354v680h-8q-36 -72 -110.5 -219t-110.5 -219z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1159" d="M100 672q0 211 78.5 370.5t214 242.5t307.5 83q112 0 206.5 -46.5t160.5 -119.5l-96 -108q-118 125 -269 125q-193 0 -309.5 -147t-116.5 -396q0 -253 113 -402t305 -149q174 0 307 149l97 -104q-142 -167 -342 -190l-41 -82q123 -42 123 -146q0 -83 -84 -129.5 t-213 -58.5l-17 84q183 24 183 98q0 38 -32.5 61t-99.5 39l68 131q-241 18 -392 203.5t-151 491.5z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1069" d="M178 0v1343h774v-143h-602v-422h508v-145h-508v-488h623v-145h-795zM309 1675h193l180 -229h-141z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1069" d="M178 0v1343h774v-143h-602v-422h508v-145h-508v-488h623v-145h-795zM473 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xca;" horiz-adv-x="1069" d="M178 0v1343h774v-143h-602v-422h508v-145h-508v-488h623v-145h-795zM299 1446l197 229h163l197 -229h-137l-137 139h-9l-137 -139h-137z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1069" d="M178 0v1343h774v-143h-602v-422h508v-145h-508v-488h623v-145h-795zM301 1565q0 44 27.5 72t70.5 28q44 0 72.5 -28t28.5 -72q0 -43 -28.5 -72t-72.5 -29q-42 0 -70 29t-28 72zM653 1565q0 44 29 72t72 28t71.5 -28t28.5 -72q0 -43 -28.5 -72t-71.5 -29t-72 29t-29 72z " />
+<glyph unicode="&#xcc;" horiz-adv-x="528" d="M-4 1675h192l181 -229h-142zM178 0v1343h172v-1343h-172z" />
+<glyph unicode="&#xcd;" horiz-adv-x="528" d="M160 1446l180 229h192l-231 -229h-141zM178 0v1343h172v-1343h-172z" />
+<glyph unicode="&#xce;" horiz-adv-x="528" d="M-14 1446l196 229h164l197 -229h-137l-138 139h-8l-137 -139h-137zM178 0v1343h172v-1343h-172z" />
+<glyph unicode="&#xcf;" horiz-adv-x="528" d="M-12 1565q0 44 28 72t72 28q43 0 71.5 -28t28.5 -72q0 -43 -28.5 -72t-71.5 -29q-44 0 -72 29t-28 72zM178 0v1343h172v-1343h-172zM340 1565q0 44 28.5 72t71.5 28q44 0 72.5 -28t28.5 -72q0 -43 -28.5 -72t-72.5 -29q-43 0 -71.5 29t-28.5 72z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1292" d="M61 657v88l158 9v589h336q309 0 472 -172t163 -493q0 -323 -162 -500.5t-465 -177.5h-344v657h-158zM389 139h154q232 0 351.5 140.5t119.5 398.5q0 256 -119 391t-352 135h-154v-450h311v-97h-311v-518z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1314" d="M178 0v1343h176l488 -843l145 -279h8q-2 30 -8.5 128.5t-10 167.5t-3.5 132v694h162v-1343h-177l-485 846l-145 276h-9q2 -25 8.5 -125t9.5 -165.5t3 -129.5v-702h-162zM367 1456q9 98 55.5 159.5t118.5 61.5q37 0 73.5 -16.5t60.5 -36.5t54 -36.5t55 -16.5q30 0 52.5 28 t29.5 78h95q-9 -97 -56 -159t-119 -62q-46 0 -91 27t-83 53.5t-69 26.5q-30 0 -52.5 -28t-29.5 -79h-94z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395zM408 1675h192 l180 -229h-141z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395zM569 1446 l183 229h192l-233 -229h-142z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395zM397 1446 l197 229h162l196 -229h-135l-137 139h-8l-137 -139h-138z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395zM379 1456 q9 98 55.5 159.5t116.5 61.5q46 0 91 -26.5t83.5 -53t69.5 -26.5t53 27.5t31 78.5h92q-9 -97 -55.5 -159t-116.5 -62q-37 0 -73.5 16.5t-61 37t-54.5 37t-55 16.5q-31 0 -53 -27.5t-29 -79.5h-94z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1349" d="M100 678q0 318 159.5 504t416.5 186q256 0 414.5 -186.5t158.5 -503.5q0 -321 -159 -512t-414 -191q-256 0 -416 191t-160 512zM276 678q0 -252 109 -402.5t291 -150.5q180 0 288.5 150.5t108.5 402.5q0 249 -108 395t-289 146q-182 0 -291 -146t-109 -395zM397 1565 q0 44 29 72t72 28q44 0 72 -28t28 -72q0 -43 -28 -72t-72 -29q-43 0 -72 29t-29 72zM752 1565q0 44 28.5 72t71.5 28t71.5 -28t28.5 -72q0 -43 -28.5 -72t-71.5 -29t-71.5 29t-28.5 72z" />
+<glyph unicode="&#xd7;" d="M102 350l318 326l-318 323l91 93l317 -326l315 326l90 -93l-317 -323l317 -326l-90 -92l-315 328l-317 -328z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1349" d="M96 12l142 185q-138 187 -138 481q0 318 159.5 504t416.5 186q214 0 362 -133l129 170l97 -72l-146 -188q131 -182 131 -467q0 -321 -159 -512t-414 -191q-210 0 -357 129l-126 -165zM276 678q0 -202 72 -340l590 768q-104 113 -262 113q-182 0 -291 -146t-109 -395z M420 233q102 -108 256 -108q180 0 288.5 150.5t108.5 402.5q0 193 -65 323z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1310" d="M172 555v788h172v-792q0 -426 311 -426q320 0 320 426v792h164v-788q0 -157 -36.5 -272t-103.5 -181t-152 -96.5t-192 -30.5t-192 30.5t-151.5 96.5t-103 181t-36.5 272zM387 1675h193l180 -229h-142z" />
+<glyph unicode="&#xda;" horiz-adv-x="1310" d="M172 555v788h172v-792q0 -426 311 -426q320 0 320 426v792h164v-788q0 -157 -36.5 -272t-103.5 -181t-152 -96.5t-192 -30.5t-192 30.5t-151.5 96.5t-103 181t-36.5 272zM551 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1310" d="M172 555v788h172v-792q0 -426 311 -426q320 0 320 426v792h164v-788q0 -157 -36.5 -272t-103.5 -181t-152 -96.5t-192 -30.5t-192 30.5t-151.5 96.5t-103 181t-36.5 272zM377 1446l196 229h164l197 -229h-137l-138 139h-8l-137 -139h-137z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1310" d="M172 555v788h172v-792q0 -426 311 -426q320 0 320 426v792h164v-788q0 -157 -36.5 -272t-103.5 -181t-152 -96.5t-192 -30.5t-192 30.5t-151.5 96.5t-103 181t-36.5 272zM379 1565q0 44 28.5 72t71.5 28t72 -28t29 -72q0 -43 -29 -72t-72 -29t-71.5 29t-28.5 72z M733 1565q0 44 28.5 72t72.5 28q43 0 70.5 -28t27.5 -72q0 -43 -28 -72t-70 -29q-44 0 -72.5 29t-28.5 72z" />
+<glyph unicode="&#xdd;" horiz-adv-x="964" d="M-8 1343h184l172 -378q94 -215 131 -293h8q13 30 61.5 133t72.5 160l174 378h176l-404 -823v-520h-170v520zM377 1446l180 229h193l-232 -229h-141z" />
+<glyph unicode="&#xde;" horiz-adv-x="1193" d="M182 0v1343h170v-225h242q115 0 203.5 -21t155.5 -66.5t102 -123t35 -184.5q0 -207 -133 -311.5t-363 -104.5h-242v-307h-170zM352 446h221q176 0 261.5 67t85.5 210q0 141 -84 198.5t-263 57.5h-221v-533z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1179" d="M168 0v1055q0 195 105.5 309.5t295.5 114.5q155 0 244.5 -86t89.5 -213q0 -57 -19 -107.5t-46.5 -87t-55 -70.5t-46.5 -72.5t-19 -76.5q0 -40 22 -71.5t58 -54t78.5 -44t85.5 -48.5t79 -60t58 -86.5t22 -120.5q0 -132 -89 -219t-238 -87q-150 0 -289 101l67 119 q109 -89 217 -89q81 0 127 48t46 116q0 48 -22.5 86t-58 63t-78.5 47.5t-86 47t-78.5 54t-58 74.5t-22.5 103q0 51 18.5 97t45 81.5t53 70.5t45 78.5t18.5 90.5q0 80 -44 129t-126 49q-110 0 -170.5 -80.5t-60.5 -236.5v-1024h-168z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5 t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5zM324 1462h176l184 -288h-129z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5 t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5zM418 1174l184 288h176l-231 -288h-129z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5 t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5zM289 1174l192 288h140l194 -288h-123l-137 186h-8l-137 -186h-121z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM266 1186q10 98 52.5 157.5t115.5 59.5 q34 0 69.5 -16.5t60 -36t52.5 -36t50 -16.5q57 0 75 105h97q-9 -97 -52.5 -157t-115.5 -60q-34 0 -69.5 16t-59.5 36t-53 36t-52 16q-59 0 -74 -104h-96zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM274 1305q0 43 29 71.5t72 28.5t71.5 -28.5 t28.5 -71.5t-28.5 -72t-71.5 -29t-72 29t-29 72zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5zM629 1305q0 43 28 71.5t72 28.5q43 0 70.5 -28.5t27.5 -71.5t-28 -72t-70 -29q-44 0 -72 29t-28 72z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1048" d="M119 258q0 162 146 250t466 123q0 51 -9.5 93t-31.5 79t-64 57.5t-100 20.5q-140 0 -297 -107l-67 117q201 129 391 129q177 0 261.5 -108t84.5 -302v-610h-139l-15 119h-4q-177 -144 -329 -144q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q69 0 132.5 32.5 t139.5 100.5v276q-242 -30 -344 -90.5t-102 -159.5zM360 1300q0 84 53.5 136.5t137.5 52.5q85 0 138.5 -52.5t53.5 -136.5q0 -86 -53.5 -138t-138.5 -52q-84 0 -137.5 52.5t-53.5 137.5zM453 1300q0 -51 28.5 -82.5t69.5 -31.5q42 0 70 31.5t28 82.5q0 50 -28 81.5t-70 31.5 q-41 0 -69.5 -31.5t-28.5 -81.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1607" d="M119 258q0 161 144.5 249t457.5 124q0 250 -203 250q-132 0 -289 -107l-67 117q201 129 377 129q108 0 180 -56t104 -155q60 99 144.5 155t183.5 56q181 0 280 -126t99 -343q0 -57 -6 -94h-645q6 -154 93 -249t216 -95q113 0 242 82l61 -117q-161 -103 -324 -103 q-205 0 -350 187q-209 -187 -405 -187q-129 0 -211 76t-82 207zM285 270q0 -81 48 -120t126 -39q71 0 153 40.5t148 112.5q-36 79 -39 205v51q-231 -30 -333.5 -91t-102.5 -159zM879 569h503q0 154 -60.5 236t-174.5 82q-104 0 -179.5 -87t-88.5 -231z" />
+<glyph unicode="&#xe7;" horiz-adv-x="933" d="M94 496q0 122 38.5 222.5t105 165.5t152.5 100.5t183 35.5q163 0 291 -119l-84 -108q-102 88 -200 88q-136 0 -224 -107t-88 -278q0 -170 85 -275.5t222 -105.5q123 0 234 100l76 -111q-122 -109 -271 -124l-39 -82q121 -42 121 -146q0 -83 -84 -129.5t-213 -58.5l-16 84 q182 24 182 98q0 38 -32.5 61t-98.5 39l68 134q-181 21 -294.5 157.5t-113.5 358.5z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1015" d="M94 496q0 118 38 218.5t100.5 166.5t142.5 102.5t166 36.5q188 0 292.5 -125.5t104.5 -341.5q0 -55 -6 -92h-672q9 -161 99 -255.5t233 -94.5q127 0 248 77l59 -110q-161 -103 -328 -103q-205 0 -341 141.5t-136 379.5zM258 571h533q0 152 -64.5 234t-181.5 82 q-109 0 -190.5 -85t-96.5 -231zM315 1462h174l187 -288h-131z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1015" d="M94 496q0 118 38 218.5t100.5 166.5t142.5 102.5t166 36.5q188 0 292.5 -125.5t104.5 -341.5q0 -55 -6 -92h-672q9 -161 99 -255.5t233 -94.5q127 0 248 77l59 -110q-161 -103 -328 -103q-205 0 -341 141.5t-136 379.5zM258 571h533q0 152 -64.5 234t-181.5 82 q-109 0 -190.5 -85t-96.5 -231zM408 1174l186 288h174l-231 -288h-129z" />
+<glyph unicode="&#xea;" horiz-adv-x="1015" d="M94 496q0 118 38 218.5t100.5 166.5t142.5 102.5t166 36.5q188 0 292.5 -125.5t104.5 -341.5q0 -55 -6 -92h-672q9 -161 99 -255.5t233 -94.5q127 0 248 77l59 -110q-161 -103 -328 -103q-205 0 -341 141.5t-136 379.5zM258 571h533q0 152 -64.5 234t-181.5 82 q-109 0 -190.5 -85t-96.5 -231zM279 1174l194 288h137l195 -288h-123l-137 186h-8l-138 -186h-120z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1015" d="M94 496q0 118 38 218.5t100.5 166.5t142.5 102.5t166 36.5q188 0 292.5 -125.5t104.5 -341.5q0 -55 -6 -92h-672q9 -161 99 -255.5t233 -94.5q127 0 248 77l59 -110q-161 -103 -328 -103q-205 0 -341 141.5t-136 379.5zM258 571h533q0 152 -64.5 234t-181.5 82 q-109 0 -190.5 -85t-96.5 -231zM264 1305q0 43 29 71.5t72 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29t-72 29t-29 72zM618 1305q0 43 28.5 71.5t72.5 28.5q43 0 71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29q-44 0 -72.5 29t-28.5 72z" />
+<glyph unicode="&#xec;" horiz-adv-x="503" d="M25 1462h176l184 -288h-129zM168 0v995h168v-995h-168z" />
+<glyph unicode="&#xed;" horiz-adv-x="503" d="M119 1174l184 288h176l-231 -288h-129zM168 0v995h168v-995h-168z" />
+<glyph unicode="&#xee;" horiz-adv-x="503" d="M-10 1174l192 288h140l194 -288h-123l-137 186h-8l-137 -186h-121zM168 0v995h168v-995h-168z" />
+<glyph unicode="&#xef;" horiz-adv-x="503" d="M-25 1305q0 43 29 71.5t72 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29t-72 29t-29 72zM168 0v995h168v-995h-168zM330 1305q0 43 27.5 71.5t70.5 28.5q44 0 72 -28.5t28 -71.5t-28 -72t-72 -29q-42 0 -70 29t-28 72z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1116" d="M109 455q0 206 119.5 333t301.5 127q172 0 275 -135q-50 229 -219 394l-289 -150l-49 84l260 133q-114 87 -229 148l77 106q173 -94 283 -186l291 149l49 -84l-264 -135q278 -281 278 -713q0 -247 -121.5 -399t-320.5 -152q-87 0 -166.5 34t-141 94.5t-98 152 t-36.5 199.5zM268 455q0 -150 83.5 -245t203.5 -95q134 0 205 109.5t71 295.5q0 43 -4 113q-63 85 -129 118t-143 33q-133 0 -210 -92t-77 -237z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1120" d="M168 0v995h139l15 -143h6q80 80 159.5 124t174.5 44q303 0 303 -389v-631h-168v608q0 139 -45.5 202.5t-143.5 63.5q-72 0 -131 -35.5t-141 -117.5v-721h-168zM313 1186q8 97 51 157t115 60q43 0 87.5 -26.5t82 -52.5t64.5 -26q58 0 73 105h97q-8 -97 -51 -157t-115 -60 q-35 0 -70.5 16t-59.5 36t-52.5 36t-51.5 16q-30 0 -48 -25.5t-27 -78.5h-95z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5zM328 1462h176l184 -288h-129z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5zM422 1174l184 288h176l-231 -288h-129z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5zM293 1174l192 288h140l194 -288h-123l-137 186h-8l-137 -186h-121z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5zM270 1186q8 97 51 157t115 60q35 0 71 -16.5t60.5 -36t52.5 -36t50 -16.5q57 0 75 105h95q-8 -97 -51 -157t-115 -60q-34 0 -69.5 16t-59.5 36t-53 36t-52 16q-58 0 -73 -104h-97z " />
+<glyph unicode="&#xf6;" horiz-adv-x="1110" d="M94 496q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5t175 -35.5t147 -100.5t101.5 -165.5t37.5 -222.5q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5t-175 35.5t-147 100.5t-101.5 165t-37.5 220zM268 496q0 -170 79.5 -275.5t207.5 -105.5 q129 0 208 105.5t79 275.5q0 172 -79 278.5t-208 106.5q-128 0 -207.5 -106.5t-79.5 -278.5zM279 1305q0 43 28.5 71.5t71.5 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29t-71.5 29t-28.5 72zM633 1305q0 43 27.5 71.5t70.5 28.5q44 0 72 -28.5t28 -71.5t-28 -72 t-72 -29q-42 0 -70 29t-28 72z" />
+<glyph unicode="&#xf7;" d="M70 612v127h878v-127h-878zM397 307q0 47 32.5 78t80.5 31q46 0 78.5 -31t32.5 -78q0 -49 -32 -79.5t-79 -30.5q-48 0 -80.5 30.5t-32.5 79.5zM397 1044q0 47 32.5 78t80.5 31q46 0 78.5 -31t32.5 -78q0 -49 -32 -79.5t-79 -30.5q-48 0 -80.5 30.5t-32.5 79.5z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1110" d="M94 12l111 133q-111 144 -111 351q0 122 37.5 222.5t101.5 165.5t147 100.5t175 35.5q165 0 285 -102l102 124l74 -59l-111 -133q111 -144 111 -354q0 -120 -37.5 -220t-101.5 -165t-147 -100.5t-175 -35.5q-163 0 -285 101l-100 -123zM260 504q0 -140 47 -232l438 531 q-76 82 -190 82q-128 0 -211.5 -106.5t-83.5 -274.5zM365 190q79 -79 190 -79q130 0 212.5 105t82.5 273q0 140 -49 234z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1114" d="M154 365v630h170v-608q0 -140 44 -203t142 -63q75 0 135.5 39t132.5 129v706h168v-995h-139l-14 156h-7q-75 -89 -152.5 -135t-174.5 -46q-305 0 -305 390zM330 1462h176l186 -288h-131z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1114" d="M154 365v630h170v-608q0 -140 44 -203t142 -63q75 0 135.5 39t132.5 129v706h168v-995h-139l-14 156h-7q-75 -89 -152.5 -135t-174.5 -46q-305 0 -305 390zM424 1174l186 288h174l-231 -288h-129z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1114" d="M154 365v630h170v-608q0 -140 44 -203t142 -63q75 0 135.5 39t132.5 129v706h168v-995h-139l-14 156h-7q-75 -89 -152.5 -135t-174.5 -46q-305 0 -305 390zM295 1174l192 288h140l194 -288h-123l-137 186h-8l-137 -186h-121z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1114" d="M154 365v630h170v-608q0 -140 44 -203t142 -63q75 0 135.5 39t132.5 129v706h168v-995h-139l-14 156h-7q-75 -89 -152.5 -135t-174.5 -46q-305 0 -305 390zM281 1305q0 43 28.5 71.5t71.5 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72t-71.5 -29t-71.5 29t-28.5 72zM635 1305 q0 43 28 71.5t72 28.5q43 0 72 -28.5t29 -71.5t-29 -72t-72 -29q-44 0 -72 29t-28 72z" />
+<glyph unicode="&#xfd;" horiz-adv-x="956" d="M25 995h174l202 -551q41 -113 97 -280h8q16 51 45 150t39 130l178 551h164l-375 -1077q-28 -79 -60 -138t-76.5 -108t-104 -74.5t-132.5 -25.5q-61 0 -116 20l32 134q50 -15 76 -15q154 0 225 213l23 74zM365 1174l184 288h176l-231 -288h-129z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1136" d="M168 -420v1878h168v-397l-2 -170q162 129 303 129q193 0 297 -136t104 -372q0 -123 -35 -226t-94.5 -170t-137 -104t-163.5 -37q-131 0 -274 111l2 -170v-336h-168zM336 221q123 -104 244 -104q125 0 204.5 107t79.5 288q0 173 -63.5 270t-198.5 97q-115 0 -266 -136 v-522z" />
+<glyph unicode="&#xff;" horiz-adv-x="956" d="M25 995h174l202 -551q41 -113 97 -280h8q16 51 45 150t39 130l178 551h164l-375 -1077q-28 -79 -60 -138t-76.5 -108t-104 -74.5t-132.5 -25.5q-61 0 -116 20l32 134q50 -15 76 -15q154 0 225 213l23 74zM221 1305q0 43 29 71.5t72 28.5t71.5 -28.5t28.5 -71.5t-28.5 -72 t-71.5 -29t-72 29t-29 72zM575 1305q0 43 28 71.5t71 28.5q44 0 72 -28.5t28 -71.5t-28 -72t-72 -29q-43 0 -71 29t-28 72z" />
+<glyph unicode="&#x152;" horiz-adv-x="1724" d="M100 678q0 318 172.5 491.5t485.5 173.5h852v-143h-570v-422h476v-145h-476v-488h590v-145h-880q-306 0 -478 178.5t-172 499.5zM276 678q0 -259 126.5 -399t367.5 -140h98v1065h-98q-242 0 -368 -135t-126 -391z" />
+<glyph unicode="&#x153;" horiz-adv-x="1718" d="M94 496q0 122 36.5 222.5t98.5 165.5t143.5 100.5t172.5 35.5q116 0 211.5 -65t148.5 -185q57 118 149.5 184t200.5 66q182 0 283.5 -126.5t101.5 -342.5q0 -57 -6 -94h-653q6 -153 95 -248.5t218 -95.5q117 0 246 82l62 -117q-161 -103 -328 -103q-116 0 -213 66 t-154 182q-118 -248 -366 -248q-90 0 -171 35.5t-142.5 100.5t-97.5 165t-36 220zM266 496q0 -170 78 -275.5t201 -105.5t200.5 105.5t77.5 275.5q0 171 -77.5 278t-200.5 107t-201 -107t-78 -278zM981 569h512q0 153 -63.5 235.5t-178.5 82.5q-105 0 -181 -87t-89 -231z " />
+<glyph unicode="&#x178;" horiz-adv-x="964" d="M-8 1343h184l172 -378q94 -215 131 -293h8q13 30 61.5 133t72.5 160l174 378h176l-404 -823v-520h-170v520zM205 1565q0 44 28.5 72t71.5 28t72 -28t29 -72q0 -43 -29 -72t-72 -29t-71.5 29t-28.5 72zM559 1565q0 44 28 72t72 28q43 0 72 -28t29 -72q0 -43 -29 -72 t-72 -29q-44 0 -72 29t-28 72z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1110" d="M293 1174l192 288h140l194 -288h-123l-137 186h-8l-137 -186h-121z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1110" d="M270 1186q8 97 51 157t115 60q35 0 71 -16.5t60.5 -36t52.5 -36t50 -16.5q57 0 75 105h95q-8 -97 -51 -157t-115 -60q-34 0 -69.5 16t-59.5 36t-53 36t-52 16q-58 0 -73 -104h-97z" />
+<glyph unicode="&#x2000;" horiz-adv-x="896" />
+<glyph unicode="&#x2001;" horiz-adv-x="1792" />
+<glyph unicode="&#x2002;" horiz-adv-x="896" />
+<glyph unicode="&#x2003;" horiz-adv-x="1792" />
+<glyph unicode="&#x2004;" horiz-adv-x="597" />
+<glyph unicode="&#x2005;" horiz-adv-x="448" />
+<glyph unicode="&#x2006;" horiz-adv-x="298" />
+<glyph unicode="&#x2007;" horiz-adv-x="298" />
+<glyph unicode="&#x2008;" horiz-adv-x="224" />
+<glyph unicode="&#x2009;" horiz-adv-x="358" />
+<glyph unicode="&#x200a;" horiz-adv-x="99" />
+<glyph unicode="&#x2010;" horiz-adv-x="636" d="M84 449v129h471v-129h-471z" />
+<glyph unicode="&#x2011;" horiz-adv-x="636" d="M84 449v129h471v-129h-471z" />
+<glyph unicode="&#x2012;" horiz-adv-x="636" d="M84 449v129h471v-129h-471z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M84 457v116h815v-116h-815z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1638" d="M84 457v116h1470v-116h-1470z" />
+<glyph unicode="&#x2018;" horiz-adv-x="509" d="M117 1061q0 238 217 364l49 -79q-81 -53 -118.5 -111t-37.5 -143q6 2 19 2q44 0 76 -28t32 -77q0 -52 -30 -82t-78 -30q-62 0 -95.5 47.5t-33.5 136.5z" />
+<glyph unicode="&#x2019;" horiz-adv-x="509" d="M129 961q80 53 117 111.5t37 144.5q-9 -3 -17 -3q-45 0 -76.5 27.5t-31.5 75.5q0 53 30 84t78 31q60 0 94.5 -49t34.5 -138q0 -235 -219 -362z" />
+<glyph unicode="&#x201a;" horiz-adv-x="509" d="M129 -219q81 55 117.5 112.5t36.5 143.5q-6 -2 -17 -2q-45 0 -76.5 27.5t-31.5 74.5q0 53 30 84t78 31q60 0 94.5 -48.5t34.5 -137.5q0 -236 -219 -363z" />
+<glyph unicode="&#x201c;" horiz-adv-x="872" d="M117 1061q0 238 217 364l49 -79q-81 -53 -118.5 -111t-37.5 -143q6 2 19 2q44 0 76 -28t32 -77q0 -52 -30 -82t-78 -30q-62 0 -95.5 47.5t-33.5 136.5zM477 1061q0 238 219 364l47 -79q-80 -54 -117.5 -112t-37.5 -142q6 2 18 2q45 0 77 -28t32 -77q0 -52 -30.5 -82 t-78.5 -30q-62 0 -95.5 47.5t-33.5 136.5z" />
+<glyph unicode="&#x201d;" horiz-adv-x="872" d="M129 961q80 53 117 111.5t37 144.5q-9 -3 -17 -3q-45 0 -76.5 27.5t-31.5 75.5q0 53 30 84t78 31q60 0 94.5 -49t34.5 -138q0 -235 -219 -362zM489 961q81 54 118.5 112t37.5 144q-9 -3 -18 -3q-45 0 -77 28t-32 75q0 53 30.5 84t78.5 31q62 0 95.5 -49t33.5 -138 q0 -236 -217 -362z" />
+<glyph unicode="&#x201e;" horiz-adv-x="872" d="M129 -219q81 55 117.5 112.5t36.5 143.5q-6 -2 -17 -2q-45 0 -76.5 27.5t-31.5 74.5q0 53 30 84t78 31q60 0 94.5 -48.5t34.5 -137.5q0 -236 -219 -363zM489 -219q81 56 118.5 113.5t37.5 142.5q-6 -2 -18 -2q-45 0 -77 27.5t-32 74.5q0 53 30.5 84t78.5 31 q62 0 95.5 -48.5t33.5 -137.5q0 -237 -217 -363z" />
+<glyph unicode="&#x2022;" horiz-adv-x="622" d="M82 539q0 108 67 177.5t162 69.5t162.5 -69.5t67.5 -177.5t-67.5 -177t-162.5 -69t-162 69t-67 177z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1941" d="M193 102q0 58 35 94.5t87 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87 36t-35 91zM879 102q0 58 35 94.5t87 36.5q51 0 86 -37t35 -94q0 -55 -35.5 -91t-85.5 -36q-52 0 -87 36t-35 91zM1565 102q0 58 35.5 94.5t87.5 36.5q50 0 85 -37t35 -94 q0 -55 -35 -91t-85 -36q-52 0 -87.5 36t-35.5 91z" />
+<glyph unicode="&#x202f;" horiz-adv-x="358" />
+<glyph unicode="&#x2039;" horiz-adv-x="555" d="M92 453v127l279 317l73 -61l-241 -320l241 -323l-73 -58z" />
+<glyph unicode="&#x203a;" horiz-adv-x="555" d="M111 193l241 323l-241 320l71 61l281 -317v-127l-281 -318z" />
+<glyph unicode="&#x205f;" horiz-adv-x="448" />
+<glyph unicode="&#x20ac;" d="M47 481v88l121 9q-2 25 -2 73q0 46 2 66h-121v90l131 10q35 241 169 377.5t335 136.5q88 0 168 -44t137 -116l-100 -96q-96 121 -211 121q-133 0 -217 -99.5t-109 -279.5h520v-100h-528q-2 -18 -2 -60q0 -52 2 -77h446v-99h-436q27 -175 107 -272.5t205 -97.5 q72 0 129 35.5t112 109.5l101 -90q-144 -191 -353 -191q-186 0 -313 134t-162 372h-131z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1304" d="M6 1274v110h531v-110h-205v-524h-123v524h-203zM635 750v634h153l95 -229l55 -162h8l55 162l93 229h151v-634h-117v280l13 215h-8l-146 -397h-92l-147 397h-9l15 -215v-280h-119z" />
+<glyph unicode="&#xe000;" horiz-adv-x="993" d="M0 0v993h993v-993h-993z" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1138" d="M61 858v127l136 10v158q0 157 72 243.5t218 86.5q83 0 166 -33l-37 -129q-58 25 -112 25q-139 0 -139 -193v-158h210v-137h-210v-858h-168v858h-136zM772 1309q0 49 33.5 78.5t83.5 29.5t82.5 -29.5t32.5 -78.5q0 -47 -32.5 -78t-82.5 -31t-83.5 31t-33.5 78zM803 0v995 h168v-995h-168z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1120" d="M61 858v127l136 10v158q0 157 72 243.5t218 86.5q83 0 166 -33l-37 -129q-58 25 -112 25q-139 0 -139 -193v-158h210v-137h-210v-858h-168v858h-136zM766 201v1257h168v-1270q0 -37 13 -55t34 -18q19 0 37 4l22 -127q-42 -17 -96 -17q-93 0 -135.5 57t-42.5 169z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.ttf b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.ttf
new file mode 100644
index 0000000..e166286
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.ttf
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.woff b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.woff
new file mode 100644
index 0000000..315c98a
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.woff
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.eot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.eot
new file mode 100644
index 0000000..ddf5d11
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.eot
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.svg
new file mode 100644
index 0000000..317e536
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.svg
@@ -0,0 +1,243 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="source_sans_prosemibold" horiz-adv-x="1050" >
+<font-face units-per-em="2048" ascent="1536" descent="-512" />
+<missing-glyph horiz-adv-x="419" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="2048" />
+<glyph unicode=" " horiz-adv-x="419" />
+<glyph unicode="&#x09;" horiz-adv-x="419" />
+<glyph unicode="&#xa0;" horiz-adv-x="419" />
+<glyph unicode="!" horiz-adv-x="645" d="M170 135q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5zM205 1372h237l-8 -233l-33 -699h-157l-33 699z" />
+<glyph unicode="&#x22;" horiz-adv-x="987" d="M160 1409h241l-6 -231l-47 -375h-135l-45 375zM584 1409h243l-8 -231l-47 -375h-133l-47 375z" />
+<glyph unicode="#" d="M72 399v156h174l33 264h-166v156h186l45 356h141l-43 -356h240l47 356h139l-43 -356h164v-156h-182l-33 -264h174v-156h-192l-47 -399h-144l47 399h-239l-49 -399h-144l49 399h-157zM389 555h242l33 264h-242z" />
+<glyph unicode="$" d="M92 135l107 160q160 -127 303 -127q98 0 148 45.5t50 130.5q0 54 -30.5 98t-80 75.5t-109 61t-118.5 63.5t-108.5 75t-80 103.5t-30.5 140.5q0 141 82 237t221 121v209h164v-205q164 -20 297 -160l-121 -137q-62 57 -115 83t-122 26q-84 0 -131 -42.5t-47 -121.5 q0 -49 30.5 -89t80 -68t109 -56t118.5 -62t108.5 -76.5t80 -109t30.5 -150.5q0 -147 -83.5 -246.5t-234.5 -127.5v-211h-164v205q-95 9 -190.5 50.5t-163.5 104.5z" />
+<glyph unicode="%" horiz-adv-x="1722" d="M61 942q0 197 88 309.5t232 112.5t231.5 -112t87.5 -310q0 -199 -87.5 -312.5t-231.5 -113.5t-232 113.5t-88 312.5zM231 942q0 -145 41 -217t109 -72t108.5 72t40.5 217q0 144 -40.5 214.5t-108.5 70.5t-109 -70.5t-41 -214.5zM424 -25l731 1389h143l-731 -1389h-143z M1022 401q0 198 87.5 310t231.5 112t232 -112.5t88 -309.5q0 -199 -88 -312.5t-232 -113.5t-231.5 113.5t-87.5 312.5zM1192 401q0 -145 40.5 -216.5t108.5 -71.5t109 72t41 216t-41 214.5t-109 70.5t-108.5 -70.5t-40.5 -214.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1308" d="M57 352q0 66 20 123.5t58.5 104.5t79.5 82t98 73q-86 159 -86 295q0 141 93.5 237.5t244.5 96.5q135 0 215 -78t80 -207q0 -51 -17.5 -99t-42 -84t-67.5 -76.5t-77 -66.5t-87 -63q125 -169 305 -307q116 154 170 356h218q-75 -258 -230 -465q145 -87 242 -106l-60 -193 q-166 41 -325 144q-173 -144 -404 -144q-195 0 -311.5 107.5t-116.5 269.5zM283 367q0 -93 65 -151t166 -58q104 0 215 80q-192 162 -317 337q-129 -104 -129 -208zM424 1032q0 -84 53 -196q99 62 149 116t50 125q0 58 -26.5 92.5t-82.5 34.5q-63 0 -103 -48t-40 -124z" />
+<glyph unicode="'" horiz-adv-x="563" d="M160 1409h241l-6 -231l-47 -375h-135l-45 375z" />
+<glyph unicode="(" horiz-adv-x="663" d="M158 569q0 261 68.5 488.5t201.5 445.5l147 -65q-225 -383 -225 -869q0 -485 225 -868l-147 -66q-133 218 -201.5 445.5t-68.5 488.5z" />
+<glyph unicode=")" horiz-adv-x="663" d="M88 -299q225 383 225 868q0 486 -225 869l148 65q133 -218 201.5 -445.5t68.5 -488.5t-68.5 -488.5t-201.5 -445.5z" />
+<glyph unicode="*" horiz-adv-x="897" d="M98 1155l39 123l223 -51l23 231h129l23 -231l225 51l39 -123l-211 -92l119 -201l-105 -76l-153 179l-156 -179l-105 76l119 201z" />
+<glyph unicode="+" d="M70 590v172h366v387h178v-387h367v-172h-367v-387h-178v387h-366z" />
+<glyph unicode="," horiz-adv-x="563" d="M96 -244q98 38 152.5 104t54.5 144h-18q-63 0 -107.5 40t-44.5 106q0 64 46 104.5t112 40.5q83 0 129.5 -64t46.5 -178q0 -151 -84 -262t-236 -164z" />
+<glyph unicode="-" horiz-adv-x="659" d="M86 430v172h487v-172h-487z" />
+<glyph unicode="." horiz-adv-x="563" d="M129 135q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5z" />
+<glyph unicode="/" horiz-adv-x="704" d="M25 -328l477 1782h160l-478 -1782h-159z" />
+<glyph unicode="0" d="M82 657q0 324 118 497t324 173t324.5 -173.5t118.5 -496.5q0 -326 -119 -504t-324 -178t-323.5 178t-118.5 504zM307 657q0 -497 217 -497t217 497q0 135 -15.5 231t-45.5 151t-68 79.5t-88 24.5q-217 0 -217 -486z" />
+<glyph unicode="1" d="M152 0v193h290v856h-239v147q180 35 301 107h176v-1110h256v-193h-784z" />
+<glyph unicode="2" d="M68 1126q95 102 191.5 151.5t223.5 49.5q187 0 299.5 -108.5t112.5 -290.5q0 -56 -16 -114.5t-50.5 -121.5t-72 -118.5t-98.5 -127t-110.5 -125.5t-125.5 -135q170 15 217 15h319v-201h-880v137q107 104 171 167t141.5 144t120 136t83 117t57.5 113.5t17 100.5 q0 104 -56 165t-159 61q-123 0 -254 -146z" />
+<glyph unicode="3" d="M49 160l113 151q139 -143 309 -143q107 0 173.5 53t66.5 144q0 53 -18.5 92t-61 69t-118.5 45t-185 15v172q340 0 340 209q0 81 -51.5 127.5t-141.5 46.5q-129 0 -262 -123l-121 145q186 164 391 164q191 0 306.5 -90.5t115.5 -253.5q0 -210 -227 -299v-8 q121 -32 195.5 -116t74.5 -208q0 -173 -131 -275t-325 -102q-276 0 -443 185z" />
+<glyph unicode="4" d="M37 336v160l516 807h281v-785h163v-182h-163v-336h-222v336h-575zM270 518h342v295q0 61 11 270h-9q-9 -18 -106 -202z" />
+<glyph unicode="5" d="M49 156l109 151q147 -139 305 -139q111 0 181.5 67t70.5 183q0 115 -65.5 179.5t-174.5 64.5q-60 0 -103 -16.5t-106 -57.5l-112 71l39 644h696v-199h-492l-26 -316q88 43 172 43q85 0 158 -24.5t130 -73t89 -128t32 -181.5q0 -104 -37.5 -190t-101.5 -142t-146 -86.5 t-173 -30.5q-264 0 -445 181z" />
+<glyph unicode="6" d="M90 612q0 147 28 268t75.5 203t113.5 137.5t139.5 81t155.5 25.5q208 0 348 -147l-127 -144q-36 44 -93 71.5t-114 27.5q-51 0 -94 -15.5t-81.5 -51t-66.5 -90t-45 -137.5t-20 -188q56 71 133.5 112.5t149.5 41.5q175 0 278 -103t103 -301q0 -190 -119 -309t-291 -119 q-78 0 -147.5 24t-129.5 74.5t-103.5 124.5t-68 180t-24.5 234zM315 485q18 -168 81.5 -248.5t162.5 -80.5q85 0 140 65.5t55 181.5q0 114 -53.5 173t-151.5 59q-132 0 -234 -150z" />
+<glyph unicode="7" d="M90 1104v199h875v-144q-91 -113 -154.5 -219t-104.5 -205t-66 -218.5t-37 -235.5t-19 -281h-240q18 353 97.5 599t265.5 505h-617z" />
+<glyph unicode="8" d="M84 334q0 208 235 334v8q-180 130 -180 305q0 156 111 251t282 95q174 0 278.5 -96.5t104.5 -255.5q0 -89 -51 -168t-123 -131v-8q105 -59 165.5 -138.5t60.5 -199.5q0 -153 -122.5 -254t-318.5 -101q-192 0 -317 101t-125 258zM291 358q0 -95 68.5 -155t170.5 -60 q95 0 155 53t60 142q0 40 -15.5 73t-40 56.5t-64.5 46.5t-80 40.5t-95 40.5q-12 5 -18 7q-65 -47 -103 -109.5t-38 -134.5zM350 981q0 -47 19 -84.5t59 -67t80.5 -49.5t103.5 -45q109 109 109 226q0 88 -52 143t-141 55q-77 0 -127.5 -48t-50.5 -130z" />
+<glyph unicode="9" d="M76 901q0 190 118.5 308t290.5 118q97 0 181 -38.5t149.5 -114t103 -199.5t37.5 -283q0 -183 -42 -324.5t-114 -225t-162 -125.5t-194 -42q-207 0 -348 148l127 143q38 -44 94 -71t115 -27q64 0 116 25t94.5 79.5t67.5 150t29 226.5q-56 -69 -134 -110t-150 -41 q-173 0 -276 102.5t-103 300.5zM293 901q0 -114 54 -173.5t153 -59.5q60 0 121 37t112 114q-18 166 -82.5 247t-163.5 81q-83 0 -138.5 -66t-55.5 -180z" />
+<glyph unicode=":" horiz-adv-x="563" d="M129 135q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5zM129 836q0 68 44.5 113.5t109.5 45.5t108 -45t43 -114t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5z" />
+<glyph unicode=";" horiz-adv-x="563" d="M96 -244q98 38 152.5 104t54.5 144h-18q-63 0 -107.5 40t-44.5 106q0 64 46 104.5t112 40.5q83 0 129.5 -64t46.5 -178q0 -151 -84 -262t-236 -164zM129 836q0 68 44.5 113.5t109.5 45.5t108 -45t43 -114t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5z" />
+<glyph unicode="&#x3c;" d="M70 594v172l911 354v-198l-395 -140l-277 -98v-8l277 -98l395 -140v-198z" />
+<glyph unicode="=" d="M70 360v172h911v-172h-911zM70 819v172h911v-172h-911z" />
+<glyph unicode="&#x3e;" d="M70 240v198l395 140l276 98v8l-276 98l-395 140v198l911 -354v-172z" />
+<glyph unicode="?" horiz-adv-x="909" d="M82 1219q151 178 358 178q171 0 275 -88.5t104 -251.5q0 -71 -33 -137t-78 -118t-89.5 -104.5t-71.5 -118.5t-19 -139h-206q-12 83 11 158t65 130.5t85 105.5t75 103t32 103q0 74 -44.5 119t-121.5 45q-116 0 -211 -106zM274 135q0 69 43.5 114.5t108.5 45.5t109.5 -45.5 t44.5 -114.5t-44.5 -114.5t-109.5 -45.5t-108.5 45.5t-43.5 114.5z" />
+<glyph unicode="@" horiz-adv-x="1792" d="M102 418q0 205 71.5 381t192.5 295t283 186.5t342 67.5q318 0 509.5 -195t191.5 -510q0 -106 -26.5 -198t-70.5 -156t-101 -109.5t-118.5 -67.5t-122.5 -22q-90 0 -151 40.5t-74 115.5h-4q-46 -62 -114.5 -101t-133.5 -39q-114 0 -186 81.5t-72 218.5q0 87 30 174.5 t82 157.5t129 113.5t163 43.5q106 0 159 -100h4l27 84h150l-88 -433q-52 -206 102 -206q101 0 180.5 110t79.5 285q0 119 -34 220t-101.5 179t-177 122t-250.5 44q-134 0 -261.5 -56t-226.5 -154.5t-159 -246t-60 -317.5q0 -147 47 -265t130 -193t191.5 -114.5t235.5 -39.5 q168 0 322 84l55 -131q-181 -103 -395 -103q-154 0 -288.5 48.5t-238 140t-163.5 237.5t-60 328zM700 420q0 -81 33 -120.5t92 -39.5q76 0 162 107l53 301q-45 71 -112 71t-121 -52t-80.5 -124t-26.5 -143z" />
+<glyph unicode="A" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442z" />
+<glyph unicode="B" horiz-adv-x="1216" d="M168 0v1339h428q477 0 477 -329q0 -102 -58 -182t-171 -109v-8q147 -25 224 -105t77 -213q0 -130 -68 -220t-181.5 -131.5t-264.5 -41.5h-463zM406 184h200q305 0 305 226q0 204 -305 204h-200v-430zM406 784h167q267 0 267 197q0 91 -64 132.5t-196 41.5h-174v-371z" />
+<glyph unicode="C" horiz-adv-x="1173" d="M96 666q0 160 48.5 293t132 221t196.5 136t242 48q115 0 213 -47.5t168 -122.5l-131 -147q-113 110 -248 110q-167 0 -272 -131.5t-105 -353.5q0 -227 100.5 -358.5t268.5 -131.5q162 0 282 133l131 -145q-170 -195 -417 -195q-128 0 -238.5 46t-193.5 132t-130 218 t-47 295z" />
+<glyph unicode="D" horiz-adv-x="1275" d="M168 0v1339h356q312 0 483 -168t171 -495q0 -328 -169.5 -502t-471.5 -174h-369zM406 193h102q206 0 316 120t110 363q0 471 -426 471h-102v-954z" />
+<glyph unicode="E" horiz-adv-x="1093" d="M168 0v1339h805v-200h-567v-342h481v-201h-481v-395h587v-201h-825z" />
+<glyph unicode="F" horiz-adv-x="1036" d="M168 0v1339h809v-200h-571v-379h485v-201h-485v-559h-238z" />
+<glyph unicode="G" horiz-adv-x="1277" d="M96 666q0 161 49 293.5t135.5 220.5t203 136t251.5 48q234 0 400 -170l-131 -147q-56 54 -117.5 82t-149.5 28q-180 0 -288.5 -130.5t-108.5 -354.5q0 -231 106.5 -360.5t305.5 -129.5q124 0 190 60v288h-252v195h465v-590q-74 -69 -188.5 -114.5t-243.5 -45.5 q-134 0 -248 46t-198.5 132.5t-132.5 218t-48 294.5z" />
+<glyph unicode="H" horiz-adv-x="1351" d="M168 0v1339h238v-538h540v538h238v-1339h-238v594h-540v-594h-238z" />
+<glyph unicode="I" horiz-adv-x="571" d="M168 0v1339h238v-1339h-238z" />
+<glyph unicode="J" horiz-adv-x="1005" d="M45 203l164 121q80 -142 209 -142q97 0 143.5 59.5t46.5 198.5v899h238v-919q0 -94 -24 -173t-71 -140.5t-125 -96.5t-180 -35q-270 0 -401 228z" />
+<glyph unicode="K" horiz-adv-x="1216" d="M168 0v1339h238v-608h6l477 608h262l-412 -522l482 -817h-263l-360 631l-192 -240v-391h-238z" />
+<glyph unicode="L" horiz-adv-x="1021" d="M168 0v1339h238v-1138h555v-201h-793z" />
+<glyph unicode="M" horiz-adv-x="1519" d="M168 0v1339h260l242 -659l88 -254h8l88 254l236 659h262v-1339h-224v612q0 108 31 426h-8l-109 -305l-231 -608h-109l-231 608l-106 305h-9q2 -27 8.5 -98.5t10 -116.5t7 -106t3.5 -105v-612h-217z" />
+<glyph unicode="N" horiz-adv-x="1337" d="M168 0v1339h244l415 -753l140 -285h8q-1 17 -9 103t-11.5 126t-7 107.5t-3.5 120.5v581h225v-1339h-243l-416 754l-139 284h-9q3 -30 10 -105.5t10.5 -120t7 -109t3.5 -117.5v-586h-225z" />
+<glyph unicode="O" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z" />
+<glyph unicode="P" horiz-adv-x="1204" d="M168 0v1339h450q508 0 508 -413q0 -144 -68 -243.5t-180.5 -145t-259.5 -45.5h-212v-492h-238zM406 682h192q150 0 222.5 60.5t72.5 183.5q0 122 -71.5 172.5t-223.5 50.5h-192v-467z" />
+<glyph unicode="Q" horiz-adv-x="1374" d="M92 676q0 319 162.5 503.5t427.5 184.5q266 0 429 -184t163 -504q0 -276 -122 -457t-329 -227q44 -76 126.5 -113t185.5 -37q70 0 145 23l43 -178q-83 -37 -215 -37q-193 0 -331.5 91t-205.5 245q-220 39 -349.5 221.5t-129.5 468.5zM336 676q0 -226 94 -360t252 -134 t252 134t94 360q0 223 -93.5 352t-252.5 129t-252.5 -129t-93.5 -352z" />
+<glyph unicode="R" horiz-adv-x="1220" d="M168 0v1339h450q494 0 494 -397q0 -149 -70.5 -244.5t-197.5 -138.5l319 -559h-266l-289 524h-202v-524h-238zM406 713h188q139 0 211 58t72 171q0 112 -70 159.5t-213 47.5h-188v-436z" />
+<glyph unicode="S" horiz-adv-x="1110" d="M76 172l137 162q74 -70 166.5 -111t183.5 -41q111 0 172.5 46.5t61.5 125.5q0 23 -6 43.5t-13.5 35t-25 29.5t-30 24.5t-40 23t-43.5 20t-51 21.5l-182 80q-271 112 -271 356q0 161 127.5 269t321.5 108q117 0 225.5 -45.5t187.5 -124.5l-123 -152q-134 115 -290 115 q-96 0 -152.5 -42.5t-56.5 -115.5q0 -22 7 -41.5t15 -33.5t28 -29t32 -23.5t41.5 -22t42 -19t47.5 -19.5l180 -76q131 -56 200.5 -140t69.5 -222q0 -169 -131 -283.5t-350 -114.5q-135 0 -260.5 51.5t-220.5 145.5z" />
+<glyph unicode="T" horiz-adv-x="1112" d="M51 1139v200h1010v-200h-385v-1139h-238v1139h-387z" />
+<glyph unicode="U" horiz-adv-x="1335" d="M160 588v751h237v-770q0 -207 71.5 -297t201.5 -90q132 0 204 90t72 297v770h230v-751q0 -613 -506 -613q-510 0 -510 613z" />
+<glyph unicode="V" horiz-adv-x="1091" d="M-10 1339h252l188 -673q19 -69 56 -212t61 -225h8q24 84 62 227.5t57 209.5l186 673h242l-414 -1339h-282z" />
+<glyph unicode="W" horiz-adv-x="1632" d="M33 1339h246l114 -675q10 -60 32.5 -205.5t35.5 -222.5h8q27 143 86 428l166 675h205l166 -675q43 -206 88 -428h8q11 69 32 212t33 216l115 675h229l-258 -1339h-295l-165 705q-27 122 -60 309h-8q-37 -209 -59 -309l-162 -705h-291z" />
+<glyph unicode="X" horiz-adv-x="1101" d="M25 0l378 690l-356 649h264l150 -297q14 -27 46 -94t54 -110h8q46 111 90 204l142 297h252l-357 -659l381 -680h-264l-164 315q-28 56 -106 220h-8q-26 -61 -101 -220l-158 -315h-251z" />
+<glyph unicode="Y" horiz-adv-x="1019" d="M-12 1339h254l145 -342q23 -59 66.5 -165.5t52.5 -129.5h8q7 17 54.5 126.5t70.5 168.5l145 342h248l-403 -841v-498h-238v498z" />
+<glyph unicode="Z" horiz-adv-x="1099" d="M78 0v143l649 996h-588v200h881v-143l-647 -995h653v-201h-948z" />
+<glyph unicode="[" horiz-adv-x="663" d="M184 -311v1761h402v-131h-224v-1501h224v-129h-402z" />
+<glyph unicode="\" horiz-adv-x="704" d="M43 1454h160l479 -1782h-162z" />
+<glyph unicode="]" horiz-adv-x="663" d="M78 -182h223v1501h-223v131h401v-1761h-401v129z" />
+<glyph unicode="^" d="M113 571l313 801h197l315 -801h-199l-112 310l-99 276h-8l-96 -276l-113 -310h-198z" />
+<glyph unicode="_" horiz-adv-x="1024" d="M25 -131h974v-141h-974v141z" />
+<glyph unicode="`" horiz-adv-x="1124" d="M295 1473h233l185 -299h-176z" />
+<glyph unicode="a" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27 t110 83v226q-196 -25 -279 -76.5t-83 -130.5z" />
+<glyph unicode="b" horiz-adv-x="1155" d="M150 0v1446h235v-373l-6 -168q142 125 291 125q187 0 292 -138t105 -372q0 -126 -35.5 -230.5t-96 -172.5t-137.5 -105t-161 -37q-145 0 -275 127h-6l-20 -102h-186zM385 254q99 -84 203 -84t169.5 90.5t65.5 255.5q0 320 -217 320q-105 0 -221 -113v-469z" />
+<glyph unicode="c" horiz-adv-x="946" d="M84 502q0 122 41 223.5t110.5 167t160.5 101.5t192 36q174 0 295 -117l-113 -149q-83 74 -170 74q-122 0 -198 -92.5t-76 -243.5q0 -150 74.5 -242t193.5 -92q102 0 207 86l98 -150q-70 -62 -156.5 -95.5t-173.5 -33.5q-212 0 -348.5 141.5t-136.5 385.5z" />
+<glyph unicode="d" horiz-adv-x="1155" d="M88 502q0 119 35.5 220t95 167.5t136.5 103.5t159 37q81 0 140.5 -27t123.5 -83l-8 161v365h236v-1446h-195l-16 109h-9q-134 -134 -284 -134q-191 0 -302.5 140t-111.5 387zM332 504q0 -162 59 -248t168 -86q112 0 211 113v469q-96 84 -205 84q-100 0 -166.5 -89 t-66.5 -243z" />
+<glyph unicode="e" horiz-adv-x="1038" d="M84 502q0 119 39 220t104 167.5t148 103.5t172 37q199 0 307.5 -130.5t108.5 -346.5q0 -65 -11 -111h-639q15 -135 94.5 -209.5t202.5 -74.5q119 0 234 73l80 -147q-166 -109 -344 -109q-215 0 -355.5 142t-140.5 385zM311 592h447q0 122 -52 189t-153 67q-93 0 -160 -67 t-82 -189z" />
+<glyph unicode="f" horiz-adv-x="649" d="M55 819v176l135 11v104q0 166 81.5 263t252.5 97q100 0 185 -34l-45 -176q-55 24 -111 24q-127 0 -127 -170v-108h197v-187h-197v-819h-236v819h-135z" />
+<glyph unicode="g" horiz-adv-x="1064" d="M82 -182q0 126 143 215v8q-90 58 -90 168q0 55 31.5 103.5t79.5 82.5v8q-56 42 -93.5 112.5t-37.5 154.5q0 166 115.5 263t281.5 97q77 0 147 -24h361v-175h-184q57 -67 57 -169q0 -162 -107.5 -252.5t-273.5 -90.5q-70 0 -137 27q-25 -22 -37 -43t-12 -53 q0 -45 37.5 -68.5t125.5 -23.5h179q185 0 276.5 -60t91.5 -188q0 -152 -147.5 -253t-388.5 -101q-122 0 -215 28t-148 88t-55 146zM279 -147q0 -67 69 -105.5t189 -38.5q119 0 195.5 48t76.5 114q0 56 -43.5 78t-134.5 22h-137q-80 0 -138 15q-77 -60 -77 -133zM336 670 q0 -94 50 -148.5t126 -54.5q75 0 124.5 54.5t49.5 148.5q0 91 -49 144.5t-125 53.5t-126 -53t-50 -145z" />
+<glyph unicode="h" horiz-adv-x="1142" d="M150 0v1446h235v-373l-8 -194q74 70 150.5 110.5t170.5 40.5q310 0 310 -399v-631h-236v600q0 123 -37 175t-121 52q-62 0 -111 -29t-118 -96v-702h-235z" />
+<glyph unicode="i" horiz-adv-x="536" d="M123 1315q0 60 41 97.5t104 37.5t104.5 -37.5t41.5 -97.5q0 -58 -41.5 -95.5t-104.5 -37.5t-104 37.5t-41 95.5zM150 0v1006h235v-1006h-235z" />
+<glyph unicode="j" horiz-adv-x="538" d="M-94 -395l45 176q57 -17 86 -17q65 0 90 44t25 137v1061h237v-1057q0 -371 -319 -371q-89 0 -164 27zM125 1315q0 59 41.5 97t103.5 38q64 0 106 -38t42 -97q0 -58 -42.5 -95.5t-105.5 -37.5q-62 0 -103.5 37.5t-41.5 95.5z" />
+<glyph unicode="k" horiz-adv-x="1069" d="M150 0v1446h231v-903h6l373 463h258l-344 -410l379 -596h-256l-258 436l-158 -180v-256h-231z" />
+<glyph unicode="l" horiz-adv-x="555" d="M150 258v1188h235v-1200q0 -40 15 -59t36 -19q19 0 37 4l31 -176q-51 -21 -125 -21q-121 0 -175 73t-54 210z" />
+<glyph unicode="m" horiz-adv-x="1726" d="M150 0v1006h194l16 -138h9q151 162 307 162q203 0 278 -180q81 86 158.5 133t165.5 47q157 0 234 -102.5t77 -296.5v-631h-237v600q0 122 -37 174.5t-117 52.5q-95 0 -211 -125v-702h-235v600q0 122 -37.5 174.5t-118.5 52.5q-95 0 -211 -125v-702h-235z" />
+<glyph unicode="n" horiz-adv-x="1146" d="M150 0v1006h194l16 -136h9q77 76 155.5 118t173.5 42q310 0 310 -399v-631h-236v600q0 123 -37 175t-121 52q-62 0 -111 -29t-118 -96v-702h-235z" />
+<glyph unicode="o" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM326 502q0 -152 63 -243t172 -91q110 0 174 91t64 243 q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245z" />
+<glyph unicode="p" horiz-adv-x="1155" d="M150 -397v1403h194l16 -107h9q153 131 303 131q186 0 290.5 -138t104.5 -374q0 -101 -23 -188.5t-64 -151.5t-95.5 -110.5t-117.5 -69.5t-130 -23q-128 0 -258 111l6 -168v-315h-235zM385 254q102 -84 203 -84q104 0 169.5 90.5t65.5 255.5q0 320 -217 320 q-105 0 -221 -113v-469z" />
+<glyph unicode="q" horiz-adv-x="1148" d="M88 502q0 119 35.5 220t95 167.5t136.5 103.5t159 37q83 0 149 -29t130 -92h6l20 97h187v-1403h-236v329l8 166q-59 -56 -131 -89.5t-145 -33.5q-191 0 -302.5 140t-111.5 387zM332 504q0 -162 59 -248t168 -86q112 0 211 113v469q-96 84 -205 84q-100 0 -166.5 -89 t-66.5 -243z" />
+<glyph unicode="r" horiz-adv-x="763" d="M150 0v1006h194l16 -179h9q53 97 128.5 150t155.5 53q71 0 115 -20l-41 -205q-56 16 -104 16q-67 0 -131 -50.5t-107 -156.5v-614h-235z" />
+<glyph unicode="s" horiz-adv-x="882" d="M49 115l111 151q144 -112 278 -112q79 0 119.5 32.5t40.5 87.5q0 37 -33.5 68.5t-63.5 45.5t-101 41q-11 5 -17 7q-46 17 -81.5 33.5t-75 42.5t-65.5 55.5t-43.5 71.5t-17.5 90q0 134 100 217.5t267 83.5q177 0 334 -121l-109 -143q-118 86 -221 86q-72 0 -109.5 -30.5 t-37.5 -80.5q0 -35 32 -64t61.5 -41.5t101.5 -38.5l3 -1.5t3 -1t3.5 -1t3.5 -1.5q51 -19 84 -33.5t76 -41.5t68 -56.5t43 -74.5t18 -99q0 -135 -103.5 -223.5t-287.5 -88.5q-100 0 -202.5 39t-178.5 101z" />
+<glyph unicode="t" horiz-adv-x="739" d="M41 819v176l156 11l28 274h197v-274h256v-187h-256v-479q0 -176 141 -176q52 0 105 22l41 -174q-113 -37 -205 -37q-320 0 -320 365v479h-143z" />
+<glyph unicode="u" horiz-adv-x="1138" d="M139 375v631h236v-600q0 -123 36 -175.5t119 -52.5q65 0 115.5 32t108.5 107v689h235v-1006h-192l-19 147h-6q-71 -84 -148.5 -128t-174.5 -44q-310 0 -310 400z" />
+<glyph unicode="v" horiz-adv-x="1013" d="M25 1006h239l160 -523q6 -22 37 -132.5t47 -170.5h8q10 35 27 96.5t31.5 112.5t27.5 94l160 523h227l-342 -1006h-272z" />
+<glyph unicode="w" horiz-adv-x="1531" d="M49 1006h238l121 -523q1 -4 53 -288h8q30 165 63 288l132 523h215l133 -523q15 -57 39 -164t28 -124h8q8 44 17 92t20 106t17 90l121 523h221l-256 -1006h-281l-117 469q-13 53 -33 154t-28 139h-8q-28 -163 -60 -295l-114 -467h-271z" />
+<glyph unicode="x" horiz-adv-x="985" d="M29 0l319 524l-299 482h254l113 -191q55 -105 92 -170h8q12 27 38.5 84.5t39.5 85.5l96 191h244l-297 -508l319 -498h-254l-122 199q-64 115 -103 178h-8q-51 -101 -88 -178l-107 -199h-245z" />
+<glyph unicode="y" horiz-adv-x="1013" d="M25 1006h239l174 -494q14 -43 43 -139t45 -144h9q11 40 36 137t39 146l152 494h227l-364 -1051q-68 -185 -160.5 -277t-247.5 -92q-66 0 -131 21l43 184q42 -14 72 -14q143 0 200 172l19 63z" />
+<glyph unicode="z" horiz-adv-x="907" d="M70 0v127l475 692h-422v187h717v-125l-473 -693h489v-188h-786z" />
+<glyph unicode="{" horiz-adv-x="663" d="M66 498v143q94 1 135 45.5t41 108.5q0 63 -9.5 181.5t-9.5 190.5q0 157 59 220t191 63h113v-131h-49q-71 0 -97 -34.5t-26 -127.5q0 -57 5 -173.5t5 -178.5q0 -107 -32 -160t-105 -72v-8q73 -19 105 -72t32 -159q0 -67 -5 -181t-5 -171q0 -93 26 -128.5t97 -35.5h49v-129 h-113q-132 0 -191 62t-59 220q0 75 9.5 190.5t9.5 180.5q0 66 -41 110.5t-135 45.5z" />
+<glyph unicode="|" horiz-adv-x="522" d="M182 -512v2048h158v-2048h-158z" />
+<glyph unicode="}" horiz-adv-x="663" d="M78 -182h47q73 0 99 35.5t26 128.5q0 57 -5 171t-5 181q0 106 32 159t105 72v8q-73 19 -105 72t-32 160q0 62 5 178.5t5 173.5q0 93 -26 127.5t-99 34.5h-47v131h110q133 0 192.5 -63t59.5 -220q0 -72 -9 -190.5t-9 -181.5q0 -64 41 -108.5t135 -45.5v-143 q-94 -1 -135 -45.5t-41 -110.5q0 -65 9 -180.5t9 -190.5q0 -158 -59.5 -220t-192.5 -62h-110v129z" />
+<glyph unicode="~" d="M66 645q124 199 282 199q46 0 89.5 -17t76.5 -41t64 -48t64.5 -41t64.5 -17q85 0 151 121l125 -96q-122 -197 -281 -197q-46 0 -89 17t-76.5 41t-64 48t-64 41t-64.5 17q-85 0 -151 -121z" />
+<glyph unicode="&#xa1;" horiz-adv-x="645" d="M170 872q0 67 44.5 112.5t109.5 45.5t108 -45.5t43 -112.5q0 -70 -43 -115.5t-108 -45.5t-109.5 45.5t-44.5 115.5zM205 -367l6 234l33 698h157l33 -698l8 -234h-237z" />
+<glyph unicode="&#xa2;" d="M125 631q0 209 118 340.5t308 161.5v206h135v-200q153 -8 262 -117l-110 -145q-71 62 -152 71v-631q89 8 180 84l99 -149q-119 -107 -279 -127v-201h-135v203q-196 25 -311 156.5t-115 347.5zM354 631q0 -114 51.5 -192.5t145.5 -106.5v600q-94 -31 -145.5 -109 t-51.5 -192z" />
+<glyph unicode="&#xa3;" d="M104 0v145q100 51 159 140.5t59 199.5q0 19 -9 84h-204v142l137 10h24q-43 135 -43 209q0 182 113 289.5t297 107.5q202 0 336 -160l-131 -129q-84 97 -185 97q-95 0 -148.5 -57t-53.5 -160q0 -72 34 -197h316v-152h-281q6 -43 6 -86q0 -89 -25.5 -151.5t-82.5 -122.5v-8 h553v-201h-871z" />
+<glyph unicode="&#xa4;" d="M47 313l127 129q-72 101 -72 232q0 132 72 233l-127 129l121 123l139 -143q97 63 217 63t217 -63l142 143l121 -123l-130 -129q72 -101 72 -233q0 -131 -72 -232l130 -129l-121 -123l-142 144q-94 -64 -217 -64q-121 0 -215 64l-141 -144zM315 674q0 -104 60.5 -170 t148.5 -66q89 0 149 66t60 170q0 105 -60 171t-149 66q-88 0 -148.5 -66t-60.5 -171z" />
+<glyph unicode="&#xa5;" d="M37 1303h244l131 -310q110 -267 112 -272h8q39 92 113 272l131 310h238l-318 -627h271v-121h-324v-121h324v-123h-324v-311h-237v311h-322v123h322v121h-322v121h268z" />
+<glyph unicode="&#xa6;" horiz-adv-x="522" d="M182 428h158v-940h-158v940zM182 618v918h158v-918h-158z" />
+<glyph unicode="&#xa7;" d="M84 684q0 81 45.5 149.5t124.5 114.5q-61 67 -61 168q0 128 88.5 209.5t246.5 81.5q181 0 344 -125l-110 -149q-110 96 -221 96q-68 0 -101.5 -28t-33.5 -75q0 -37 31 -68t80.5 -55.5t109 -50t119.5 -58.5t109.5 -73t80.5 -101.5t31 -137.5q0 -168 -170 -269 q53 -69 53 -163q0 -132 -98.5 -217t-264.5 -85q-112 0 -211.5 41.5t-164.5 118.5l139 123q106 -106 237 -106q70 0 109 31.5t39 82.5q0 40 -30.5 72t-79 56t-107 48.5t-117.5 56.5t-107.5 71.5t-79 101.5t-30.5 139zM287 700q0 -43 22.5 -78t66 -62t87.5 -47t106 -47.5 t101 -49.5q48 25 71 59.5t23 87.5q0 37 -17.5 68.5t-44 54t-67.5 45.5t-78.5 39t-88 38.5t-85.5 41.5q-96 -58 -96 -150z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1124" d="M250 1309q0 51 35 86t88 35q52 0 86.5 -35t34.5 -86q0 -53 -34.5 -88t-86.5 -35q-54 0 -88.5 35t-34.5 88zM631 1309q0 52 34 86.5t87 34.5t87.5 -34.5t34.5 -86.5q0 -53 -34 -88t-88 -35q-53 0 -87 35t-34 88z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1529" d="M96 664q0 153 54 282t146 214t213.5 132t256.5 47q134 0 255 -47t213 -132t146 -214t54 -282t-54 -283t-145.5 -217t-213 -135.5t-255.5 -48.5q-135 0 -256.5 48.5t-213.5 135.5t-146 217t-54 283zM215 664q0 -127 43 -236t117 -183.5t175.5 -116.5t215.5 -42t214.5 42 t174.5 116.5t117 183.5t43 236t-43 234.5t-117 181t-174.5 114.5t-214.5 41q-115 0 -216 -41t-175 -114.5t-117 -181t-43 -234.5zM401 662q0 174 114.5 282.5t272.5 108.5q84 0 146.5 -31.5t118.5 -87.5l-92 -103q-79 76 -160 76q-102 0 -162.5 -68.5t-60.5 -176.5 q0 -118 58.5 -188.5t156.5 -70.5q54 0 96 20t90 60l80 -114q-134 -111 -273 -111q-168 0 -276.5 110t-108.5 294z" />
+<glyph unicode="&#xaa;" horiz-adv-x="720" d="M68 715q0 108 94.5 166t300.5 77q-3 59 -29.5 90t-85.5 31q-81 0 -194 -65l-62 112q145 91 285 91q126 0 191 -74t65 -217v-394h-137l-17 72h-8q-95 -88 -199 -88q-92 0 -148 56.5t-56 142.5zM233 729q0 -82 95 -82q61 0 135 68v143q-230 -24 -230 -129z" />
+<glyph unicode="&#xab;" horiz-adv-x="931" d="M96 430v172l277 305l94 -76l-236 -315l236 -317l-94 -74zM451 430v172l278 305l92 -76l-233 -315l233 -317l-92 -74z" />
+<glyph unicode="&#xac;" d="M70 590v172h911v-559h-178v387h-733z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M86 430v172h487v-172h-487z" />
+<glyph unicode="&#xae;" horiz-adv-x="907" d="M57 1053q0 178 115 293.5t281 115.5q167 0 281 -115t114 -294q0 -178 -114 -293t-281 -115q-166 0 -281 115.5t-115 292.5zM154 1053q0 -141 84.5 -230.5t214.5 -89.5t214.5 89.5t84.5 230.5q0 143 -84.5 233t-214.5 90t-214.5 -90t-84.5 -233zM295 854v408h170 q73 0 118.5 -33t45.5 -101q0 -36 -20 -66.5t-56 -45.5l90 -162h-108l-68 133h-70v-133h-102zM397 1061h47q35 0 55.5 16.5t20.5 44.5t-18.5 45t-55.5 17h-49v-123z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1124" d="M295 1221v155h534v-155h-534z" />
+<glyph unicode="&#xb0;" horiz-adv-x="712" d="M82 1124q0 122 80 200.5t196 78.5t196.5 -78.5t80.5 -200.5t-80.5 -200t-196.5 -78t-196 78t-80 200zM213 1124q0 -69 40.5 -113t104.5 -44t105 44t41 113q0 71 -41 115.5t-105 44.5t-104.5 -44.5t-40.5 -115.5z" />
+<glyph unicode="&#xb1;" d="M70 0v170h911v-170h-911zM70 612v170h366v367h178v-367h367v-170h-367v-319h-178v319h-366z" />
+<glyph unicode="&#xb2;" horiz-adv-x="761" d="M68 1565q114 159 286 159q128 0 204.5 -69.5t76.5 -194.5q0 -41 -14.5 -84t-32 -75.5t-59 -83t-66 -78t-82.5 -88.5h289v-150h-572v98q99 85 155.5 136.5t110 109.5t76.5 102t23 85q0 68 -36 106.5t-99 38.5q-82 0 -158 -107z" />
+<glyph unicode="&#xb3;" horiz-adv-x="761" d="M63 1036l111 86q74 -108 186 -108q59 0 98.5 32t39.5 87q0 60 -56.5 91t-162.5 31v105q88 0 138 33t50 90q0 47 -33 75.5t-88 28.5q-76 0 -147 -88l-103 90q61 69 127 102t152 33q112 0 189 -60t77 -159q0 -123 -127 -190q69 -23 113.5 -73.5t44.5 -121.5 q0 -107 -86.5 -175t-210.5 -68q-100 0 -181 42t-131 117z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1124" d="M412 1174l182 299h235l-243 -299h-174z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1150" d="M150 -410v1416h235v-600q0 -123 37.5 -175.5t120.5 -52.5q64 0 113.5 31.5t109.5 107.5v689h235v-1006h-194l-16 147h-9q-98 -159 -254 -159q-54 0 -90.5 14t-64.5 51l12 -184v-279h-235z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1226" d="M82 893q0 121 38.5 209t109.5 139t160 74.5t200 23.5h90v-905h-76q-112 0 -205.5 28.5t-165 84t-111.5 144t-40 202.5zM793 -164v1503h237v-1503h-237z" />
+<glyph unicode="&#xb7;" horiz-adv-x="563" d="M129 657q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114t-108 -45t-109.5 45.5t-44.5 113.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="1124" d="M377 -342q176 21 176 94q0 32 -29.5 54.5t-95.5 39.5l82 160h143l-47 -100q121 -43 121 -150q0 -62 -47.5 -106t-119 -66t-163.5 -28z" />
+<glyph unicode="&#xb9;" horiz-adv-x="761" d="M168 1503v111q72 12 118.5 31t94.5 55h141v-799h-178v602h-176z" />
+<glyph unicode="&#xba;" horiz-adv-x="755" d="M55 864q0 161 93.5 257t228.5 96t228 -96t93 -257q0 -159 -93.5 -253.5t-227.5 -94.5q-135 0 -228.5 94.5t-93.5 253.5zM229 864q0 -96 38.5 -153.5t109.5 -57.5q70 0 108.5 57.5t38.5 153.5q0 99 -38 157t-109 58t-109.5 -58t-38.5 -157z" />
+<glyph unicode="&#xbb;" horiz-adv-x="931" d="M111 199l233 317l-233 315l92 76l278 -305v-172l-278 -305zM467 199l233 317l-233 315l92 76l277 -305v-172l-277 -305z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1628" d="M111 1143v110q73 11 118.5 30.5t96.5 55.5h141v-798h-178v602h-178zM375 -25l731 1389h143l-729 -1389h-145zM946 195v90l311 514h211v-484h119v-120h-119v-195h-157v195h-365zM1116 315h195v113l10 231h-8l-92 -161z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1693" d="M111 1143v110q73 11 118.5 30.5t96.5 55.5h141v-798h-178v602h-178zM338 -25l731 1389h143l-729 -1389h-145zM999 664q118 159 287 159q129 0 206 -69.5t77 -194.5q0 -49 -17 -96.5t-54.5 -99t-72 -91.5t-93.5 -104q-11 -12 -17 -18h287v-150h-570v98q199 172 282 264 t83 168q0 67 -36.5 106.5t-98.5 39.5q-84 0 -160 -107z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1652" d="M59 676l111 86q74 -109 184 -109q59 0 98.5 32t39.5 87q0 60 -56 91.5t-162 31.5v104q88 0 138.5 33t50.5 90q0 47 -34 76t-89 29q-74 0 -145 -88l-103 90q61 68 126.5 101.5t150.5 33.5q112 0 190 -60t78 -159q0 -123 -129 -191q70 -24 115 -73.5t45 -120.5 q0 -108 -87 -176t-210 -68q-99 0 -180.5 42.5t-131.5 117.5zM436 -25l731 1389h144l-731 -1389h-144zM969 195v90l311 514h213v-484h119v-120h-119v-195h-158v195h-366zM1139 315h196v113l11 231h-9l-92 -161z" />
+<glyph unicode="&#xbf;" horiz-adv-x="909" d="M92 -51q0 60 23.5 117.5t58 99.5t74 89.5t71.5 90t50.5 100t11.5 119.5h209q11 -83 -12.5 -158t-65.5 -130.5t-85.5 -105.5t-75.5 -103t-32 -103q0 -73 45 -118.5t123 -45.5q109 0 209 107l133 -121q-157 -178 -358 -178q-171 0 -275 88.5t-104 251.5zM332 872 q0 67 43 112.5t108 45.5t108.5 -45.5t43.5 -112.5q0 -70 -43.5 -115.5t-108.5 -45.5t-108 45.5t-43 115.5z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM262 1679h258l172 -237h-190zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442zM434 1442l172 237h258l-237 -237h-193z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM252 1442l197 237h229l196 -237h-184l-123 131h-8l-123 -131h-184zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM242 1448q12 117 65 183.5t131 66.5q46 0 92.5 -25t85 -49.5t66.5 -24.5q29 0 50 25t30 74h125q-12 -116 -66 -183t-131 -67q-37 0 -74.5 15.5t-63 34.5t-55 34.5t-51.5 15.5q-63 0 -81 -100h-123z M393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM252 1571q0 54 34 88.5t87 34.5q54 0 88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34q-53 0 -87 34t-34 87zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442zM631 1571q0 54 34.5 88.5 t88.5 34.5t88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34t-88.5 34t-34.5 87z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1136" d="M-8 0l438 1339h279l436 -1339h-252l-105 362h-448l-104 -362h-244zM352 1620q0 86 58.5 138t152.5 52q93 0 152 -52t59 -138q0 -87 -58.5 -138.5t-152.5 -51.5q-95 0 -153 51.5t-58 138.5zM393 549h342l-47 164q-43 147 -121 442h-8q-67 -271 -119 -442zM473 1620 q0 -44 26 -70t64 -26t64 26t26 70q0 43 -26 69.5t-64 26.5t-64 -26.5t-26 -69.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1701" d="M-8 0l667 1339h922v-200h-541v-342h453v-201h-453v-395h562v-201h-799v348h-395l-170 -348h-246zM498 535h305v622h-8q-60 -130 -193 -407z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1173" d="M96 666q0 160 48.5 293t132 221t196.5 136t242 48q115 0 213 -47.5t168 -122.5l-131 -147q-113 110 -248 110q-167 0 -272 -131.5t-105 -353.5q0 -227 100.5 -358.5t268.5 -131.5q162 0 282 133l131 -145q-142 -163 -344 -190l-35 -74q121 -44 121 -150q0 -62 -47.5 -106 t-119.5 -66t-165 -28l-18 102q174 20 174 94q0 32 -29 54.5t-94 39.5l68 134q-238 26 -387.5 206t-149.5 480z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1093" d="M168 0v1339h805v-200h-567v-342h481v-201h-481v-395h587v-201h-825zM283 1679h258l172 -237h-193z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1093" d="M168 0v1339h805v-200h-567v-342h481v-201h-481v-395h587v-201h-825zM455 1442l172 237h258l-240 -237h-190z" />
+<glyph unicode="&#xca;" horiz-adv-x="1093" d="M168 0v1339h805v-200h-567v-342h481v-201h-481v-395h587v-201h-825zM272 1442l197 237h229l197 -237h-184l-123 131h-8l-123 -131h-185z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1093" d="M168 0v1339h805v-200h-567v-342h481v-201h-481v-395h587v-201h-825zM270 1571q0 54 34.5 88.5t88.5 34.5t88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34t-88.5 34t-34.5 87zM651 1571q0 54 34.5 88.5t88.5 34.5q53 0 87 -34.5t34 -88.5q0 -53 -34.5 -87t-86.5 -34 q-54 0 -88.5 34t-34.5 87z" />
+<glyph unicode="&#xcc;" horiz-adv-x="571" d="M-14 1679h256l174 -237h-193zM168 0v1339h238v-1339h-238z" />
+<glyph unicode="&#xcd;" horiz-adv-x="571" d="M156 1442l174 237h256l-238 -237h-192zM168 0v1339h238v-1339h-238z" />
+<glyph unicode="&#xce;" horiz-adv-x="571" d="M-25 1442l197 237h229l197 -237h-184l-123 131h-8l-123 -131h-185zM168 0v1339h238v-1339h-238z" />
+<glyph unicode="&#xcf;" horiz-adv-x="571" d="M-27 1571q0 54 34.5 88.5t88.5 34.5t87.5 -34.5t33.5 -88.5q0 -53 -33.5 -87t-87.5 -34t-88.5 34t-34.5 87zM168 0v1339h238v-1339h-238zM354 1571q0 54 34 88.5t87 34.5q54 0 88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34q-53 0 -87 34t-34 87z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1320" d="M57 637v113l156 8v581h356q312 0 483 -168t171 -495q0 -328 -169.5 -502t-471.5 -174h-369v637h-156zM451 193h102q206 0 316 120t110 363q0 471 -426 471h-102v-389h282v-121h-282v-444z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1337" d="M168 0v1339h244l415 -753l140 -285h8q-1 17 -9 103t-11.5 126t-7 107.5t-3.5 120.5v581h225v-1339h-243l-416 754l-139 284h-9q3 -30 10 -105.5t10.5 -120t7 -109t3.5 -117.5v-586h-225zM350 1448q12 117 65.5 183.5t131.5 66.5q46 0 92.5 -25t85 -49.5t66.5 -24.5 q61 0 81 99h123q-12 -116 -65.5 -183t-130.5 -67q-37 0 -74.5 15.5t-63 34.5t-55 34.5t-51.5 15.5q-61 0 -82 -100h-123z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z M387 1679h256l174 -237h-192z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z M557 1442l174 237h256l-237 -237h-193z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z M377 1442l196 237h230l196 -237h-184l-123 131h-8l-123 -131h-184z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z M365 1448q12 117 65 183.5t131 66.5q47 0 93.5 -25t85 -49.5t65.5 -24.5q62 0 82 99h123q-12 -116 -66 -183t-131 -67q-37 0 -74.5 15.5t-62.5 34.5t-54.5 34.5t-52.5 15.5q-61 0 -82 -100h-122z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1374" d="M96 676q0 320 163 504t429 184q265 0 427.5 -184.5t162.5 -503.5q0 -322 -163 -511.5t-427 -189.5q-265 0 -428.5 189.5t-163.5 511.5zM340 676q0 -225 95 -359.5t253 -134.5q157 0 251.5 134.5t94.5 359.5q0 223 -94 352t-252 129q-159 0 -253.5 -129t-94.5 -352z M375 1571q0 54 34.5 88.5t88.5 34.5t87 -34.5t33 -88.5q0 -53 -33 -87t-87 -34t-88.5 34t-34.5 87zM756 1571q0 54 34 88.5t87 34.5q54 0 88 -34.5t34 -88.5q0 -53 -34 -87t-88 -34q-53 0 -87 34t-34 87z" />
+<glyph unicode="&#xd7;" d="M100 367l303 307l-303 309l121 123l303 -311l305 311l121 -123l-305 -309l305 -307l-121 -123l-305 309l-303 -309z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1374" d="M88 25l141 178q-133 188 -133 473q0 320 163 504t429 184q215 0 361 -119l133 168l125 -98l-150 -191q121 -175 121 -448q0 -322 -163 -511.5t-427 -189.5q-201 0 -346 111l-127 -160zM340 676q0 -158 47 -273l520 662q-89 92 -219 92q-159 0 -253.5 -129t-94.5 -352z M481 264q85 -82 207 -82q157 0 251.5 134.5t94.5 359.5q0 138 -39 244z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1335" d="M160 588v751h237v-770q0 -207 71.5 -297t201.5 -90q132 0 204 90t72 297v770h230v-751q0 -613 -506 -613q-510 0 -510 613zM367 1679h258l172 -237h-191z" />
+<glyph unicode="&#xda;" horiz-adv-x="1335" d="M160 588v751h237v-770q0 -207 71.5 -297t201.5 -90q132 0 204 90t72 297v770h230v-751q0 -613 -506 -613q-510 0 -510 613zM539 1442l172 237h258l-240 -237h-190z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1335" d="M160 588v751h237v-770q0 -207 71.5 -297t201.5 -90q132 0 204 90t72 297v770h230v-751q0 -613 -506 -613q-510 0 -510 613zM356 1442l197 237h229l197 -237h-184l-123 131h-8l-123 -131h-185z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1335" d="M160 588v751h237v-770q0 -207 71.5 -297t201.5 -90q132 0 204 90t72 297v770h230v-751q0 -613 -506 -613q-510 0 -510 613zM356 1571q0 54 33.5 88.5t87.5 34.5t88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34t-87.5 34t-33.5 87zM735 1571q0 54 34.5 88.5t88.5 34.5 t87.5 -34.5t33.5 -88.5q0 -53 -33.5 -87t-87.5 -34t-88.5 34t-34.5 87z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1019" d="M-12 1339h254l145 -342q23 -59 66.5 -165.5t52.5 -129.5h8q7 17 54.5 126.5t70.5 168.5l145 342h248l-403 -841v-498h-238v498zM381 1442l172 237h258l-240 -237h-190z" />
+<glyph unicode="&#xde;" horiz-adv-x="1232" d="M172 0v1339h238v-213h213q510 0 510 -413q0 -88 -25.5 -160t-71 -122.5t-109.5 -85t-140 -50.5t-164 -16h-213v-279h-238zM410 469h192q150 0 222.5 60.5t72.5 183.5q0 121 -71.5 172t-223.5 51h-192v-467z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1236" d="M150 0v1026q0 201 115 320.5t329 119.5q178 0 277.5 -92.5t99.5 -226.5q0 -56 -17.5 -105t-43 -83.5t-51 -66t-43 -65.5t-17.5 -67t21 -60.5t55 -48t74.5 -41.5t81.5 -48.5t75 -61.5t55 -86.5t21 -118.5q0 -138 -95.5 -229t-259.5 -91q-148 0 -299 97l86 161 q103 -79 207 -79q65 0 103.5 37.5t38.5 93.5q0 39 -21 71t-54.5 55t-74.5 44.5t-81.5 46t-74 54t-54.5 74.5t-21 101q0 47 16.5 89.5t40 75.5t47.5 65.5t40.5 73t16.5 85.5q0 71 -39 115.5t-110 44.5q-101 0 -156 -75t-55 -214v-991h-233z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM297 1473h233l185 -299h-176zM336 289q0 -65 38.5 -97 t104.5 -32q58 0 109 27t110 83v226q-196 -25 -279 -76.5t-83 -130.5z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27 t110 83v226q-196 -25 -279 -76.5t-83 -130.5zM412 1174l184 299h233l-241 -299h-176z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM272 1174l197 299h188l197 -299h-164l-123 174h-8 l-123 -174h-164zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27t110 83v226q-196 -25 -279 -76.5t-83 -130.5z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM250 1182q12 117 62 182.5t128 65.5q45 0 91.5 -25 t84 -49.5t62.5 -24.5q54 0 74 99h125q-12 -117 -62.5 -182.5t-128.5 -65.5q-36 0 -72.5 15.5t-61 33.5t-53 33.5t-50.5 15.5q-54 0 -74 -98h-125zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27t110 83v226q-196 -25 -279 -76.5t-83 -130.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM252 1309q0 52 34 86.5t87 34.5t88 -35t35 -86 q0 -53 -34.5 -88t-88.5 -35q-53 0 -87 35t-34 88zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27t110 83v226q-196 -25 -279 -76.5t-83 -130.5zM631 1309q0 51 34.5 86t88.5 35q53 0 86.5 -34.5t33.5 -86.5q0 -53 -33.5 -88t-86.5 -35q-54 0 -88.5 35t-34.5 88z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1071" d="M106 270q0 161 141.5 250t450.5 123q-2 88 -44.5 142.5t-137.5 54.5q-119 0 -283 -99l-86 158q208 131 412 131q187 0 281 -110.5t94 -323.5v-596h-193l-18 111h-6q-161 -136 -311 -136q-133 0 -216.5 82t-83.5 213zM336 289q0 -65 38.5 -97t104.5 -32q58 0 109 27 t110 83v226q-196 -25 -279 -76.5t-83 -130.5zM352 1315q0 90 58.5 145.5t152.5 55.5t152.5 -55.5t58.5 -145.5q0 -89 -58.5 -144t-152.5 -55t-152.5 55t-58.5 144zM473 1315q0 -45 26 -75t64 -30t64 30t26 75q0 47 -25.5 76.5t-64.5 29.5t-64.5 -29.5t-25.5 -76.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1607" d="M106 270q0 162 140.5 251.5t445.5 121.5q-7 197 -180 197q-115 0 -279 -99l-86 158q208 131 396 131q101 0 173 -47.5t111 -134.5q130 182 314 182q187 0 289 -132t102 -349q0 -69 -10 -111h-615q12 -128 89 -201t188 -73q104 0 227 78l84 -158q-166 -109 -342 -109 q-207 0 -350 172q-201 -172 -397 -172q-133 0 -216.5 82t-83.5 213zM336 289q0 -65 38.5 -97t104.5 -32q60 0 125 31.5t121 87.5q-30 70 -33 170l-4 47q-186 -25 -269 -76.5t-83 -130.5zM907 588h422q0 124 -49.5 192t-146.5 68q-88 0 -150.5 -69t-75.5 -191z" />
+<glyph unicode="&#xe7;" horiz-adv-x="946" d="M84 502q0 122 41 223.5t110.5 167t160.5 101.5t192 36q174 0 295 -117l-113 -149q-83 74 -170 74q-122 0 -198 -92.5t-76 -243.5q0 -150 74.5 -242t193.5 -92q102 0 207 86l98 -150q-111 -99 -260 -122l-35 -76q121 -43 121 -150q0 -62 -47.5 -106t-119 -66t-163.5 -28 l-20 102q176 21 176 94q0 32 -29.5 54.5t-95.5 39.5l70 134q-184 26 -298 163.5t-114 358.5z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1038" d="M84 502q0 119 39 220t104 167.5t148 103.5t172 37q199 0 307.5 -130.5t108.5 -346.5q0 -65 -11 -111h-639q15 -135 94.5 -209.5t202.5 -74.5q119 0 234 73l80 -147q-166 -109 -344 -109q-215 0 -355.5 142t-140.5 385zM281 1473h233l184 -299h-176zM311 592h447 q0 122 -52 189t-153 67q-93 0 -160 -67t-82 -189z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1038" d="M84 502q0 119 39 220t104 167.5t148 103.5t172 37q199 0 307.5 -130.5t108.5 -346.5q0 -65 -11 -111h-639q15 -135 94.5 -209.5t202.5 -74.5q119 0 234 73l80 -147q-166 -109 -344 -109q-215 0 -355.5 142t-140.5 385zM311 592h447q0 122 -52 189t-153 67q-93 0 -160 -67 t-82 -189zM397 1174l183 299h235l-244 -299h-174z" />
+<glyph unicode="&#xea;" horiz-adv-x="1038" d="M84 502q0 119 39 220t104 167.5t148 103.5t172 37q199 0 307.5 -130.5t108.5 -346.5q0 -65 -11 -111h-639q15 -135 94.5 -209.5t202.5 -74.5q119 0 234 73l80 -147q-166 -109 -344 -109q-215 0 -355.5 142t-140.5 385zM258 1174l195 299h190l195 -299h-164l-123 174h-8 l-123 -174h-162zM311 592h447q0 122 -52 189t-153 67q-93 0 -160 -67t-82 -189z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1038" d="M84 502q0 119 39 220t104 167.5t148 103.5t172 37q199 0 307.5 -130.5t108.5 -346.5q0 -65 -11 -111h-639q15 -135 94.5 -209.5t202.5 -74.5q119 0 234 73l80 -147q-166 -109 -344 -109q-215 0 -355.5 142t-140.5 385zM236 1309q0 51 34 86t86 35q54 0 88.5 -35t34.5 -86 q0 -53 -34.5 -88t-88.5 -35q-52 0 -86 35t-34 88zM311 592h447q0 122 -52 189t-153 67q-93 0 -160 -67t-82 -189zM614 1309q0 51 35 86t88 35t88 -35t35 -86q0 -53 -34.5 -88t-88.5 -35t-88.5 35t-34.5 88z" />
+<glyph unicode="&#xec;" horiz-adv-x="536" d="M0 1473h236l182 -299h-174zM150 0v1006h235v-1006h-235z" />
+<glyph unicode="&#xed;" horiz-adv-x="536" d="M117 1174l184 299h234l-242 -299h-176zM150 0v1006h235v-1006h-235z" />
+<glyph unicode="&#xee;" horiz-adv-x="536" d="M-23 1174l195 299h190l195 -299h-162l-123 174h-8l-123 -174h-164zM150 0v1006h235v-1006h-235z" />
+<glyph unicode="&#xef;" horiz-adv-x="536" d="M-45 1309q0 51 34.5 86t88.5 35t88.5 -35t34.5 -86q0 -53 -34.5 -88t-88.5 -35t-88.5 35t-34.5 88zM150 0v1006h235v-1006h-235zM336 1309q0 51 35 86t88 35q52 0 86.5 -35t34.5 -86q0 -53 -34.5 -88t-86.5 -35q-54 0 -88.5 35t-34.5 88z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1130" d="M98 461q0 139 58 246t152.5 162t207.5 55q156 0 246 -111q-51 189 -197 332l-291 -148l-63 109l250 127q-77 57 -207 127l104 145q173 -90 283 -180l293 150l63 -111l-254 -129q277 -280 277 -698q0 -250 -126.5 -406t-338.5 -156q-91 0 -174 34.5t-146 96t-100 154 t-37 201.5zM315 461q0 -132 71.5 -212.5t174.5 -80.5q112 0 174 93.5t62 262.5q0 37 -4 103q-95 118 -234 118q-113 0 -178.5 -76t-65.5 -208z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1146" d="M150 0v1006h194l16 -136h9q77 76 155.5 118t173.5 42q310 0 310 -399v-631h-236v600q0 123 -37 175t-121 52q-62 0 -111 -29t-118 -96v-702h-235zM301 1182q12 117 62.5 182.5t128.5 65.5q45 0 91 -25t83.5 -49.5t62.5 -24.5q54 0 74 99h125q-12 -117 -62.5 -182.5 t-128.5 -65.5q-36 0 -72.5 15.5t-61 33.5t-53 33.5t-50.5 15.5q-54 0 -74 -98h-125z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM295 1473h233l185 -299h-176zM326 502q0 -152 63 -243 t172 -91q110 0 174 91t64 243q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM326 502q0 -152 63 -243t172 -91q110 0 174 91t64 243 q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245zM412 1174l182 299h235l-243 -299h-174z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM272 1174l195 299h190l195 -299h-164l-123 174h-8l-123 -174 h-162zM326 502q0 -152 63 -243t172 -91q110 0 174 91t64 243q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM250 1182q12 117 61 182.5t127 65.5q45 0 91.5 -25 t84.5 -49.5t62 -24.5q57 0 74 99h124q-12 -118 -61.5 -183t-128.5 -65q-44 0 -89.5 24.5t-84 49t-64.5 24.5q-54 0 -71 -98h-125zM326 502q0 -152 63 -243t172 -91q110 0 174 91t64 243q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q95 0 181 -36t152.5 -101.5t106 -167t39.5 -223.5t-39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-94 0 -180 36t-152 101.5t-105.5 166.5t-39.5 223zM250 1309q0 51 35 86t88 35q52 0 86.5 -35t34.5 -86 q0 -53 -34.5 -88t-86.5 -35q-54 0 -88.5 35t-34.5 88zM326 502q0 -152 63 -243t172 -91q110 0 174 91t64 243q0 153 -64 244.5t-174 91.5q-109 0 -172 -91t-63 -245zM631 1309q0 52 34 86.5t87 34.5t87.5 -34.5t34.5 -86.5q0 -53 -34 -88t-88 -35q-53 0 -87 35t-34 88z" />
+<glyph unicode="&#xf7;" d="M70 590v172h911v-172h-911zM385 307q0 58 40 95.5t99 37.5q60 0 100 -37.5t40 -95.5q0 -60 -39.5 -97.5t-100.5 -37.5q-59 0 -99 38t-40 97zM385 1044q0 58 40 96t99 38q60 0 100 -38t40 -96q0 -60 -39.5 -97.5t-100.5 -37.5q-59 0 -99 38t-40 97z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1124" d="M84 502q0 122 39.5 223.5t105.5 167t152 101.5t180 36q157 0 279 -90l96 117l94 -74l-102 -127q112 -141 112 -354q0 -122 -39.5 -223t-106 -166.5t-152.5 -101.5t-181 -36q-155 0 -278 91l-95 -115l-94 74l103 125q-113 142 -113 352zM313 514q0 -104 29 -186l373 458 q-63 60 -154 60q-110 0 -179 -92t-69 -240zM408 221q61 -61 153 -61q111 0 180.5 91t69.5 238q0 107 -29 189z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1138" d="M139 375v631h236v-600q0 -123 36 -175.5t119 -52.5q65 0 115.5 32t108.5 107v689h235v-1006h-192l-19 147h-6q-71 -84 -148.5 -128t-174.5 -44q-310 0 -310 400zM303 1473h236l182 -299h-174z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1138" d="M139 375v631h236v-600q0 -123 36 -175.5t119 -52.5q65 0 115.5 32t108.5 107v689h235v-1006h-192l-19 147h-6q-71 -84 -148.5 -128t-174.5 -44q-310 0 -310 400zM420 1174l184 299h234l-242 -299h-176z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1138" d="M139 375v631h236v-600q0 -123 36 -175.5t119 -52.5q65 0 115.5 32t108.5 107v689h235v-1006h-192l-19 147h-6q-71 -84 -148.5 -128t-174.5 -44q-310 0 -310 400zM281 1174l194 299h191l194 -299h-162l-123 174h-8l-123 -174h-163z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1138" d="M139 375v631h236v-600q0 -123 36 -175.5t119 -52.5q65 0 115.5 32t108.5 107v689h235v-1006h-192l-19 147h-6q-71 -84 -148.5 -128t-174.5 -44q-310 0 -310 400zM258 1309q0 51 35 86t88 35t88 -35t35 -86q0 -53 -34.5 -88t-88.5 -35t-88.5 35t-34.5 88zM639 1309 q0 51 34.5 86t88.5 35q52 0 86.5 -35t34.5 -86q0 -53 -34.5 -88t-86.5 -35q-54 0 -88.5 35t-34.5 88z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1013" d="M25 1006h239l174 -494q14 -43 43 -139t45 -144h9q11 40 36 137t39 146l152 494h227l-364 -1051q-68 -185 -160.5 -277t-247.5 -92q-66 0 -131 21l43 184q42 -14 72 -14q143 0 200 172l19 63zM373 1174l182 299h236l-244 -299h-174z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1155" d="M150 -397v1843h235v-373l-4 -158q139 115 278 115q192 0 300 -138t108 -374q0 -101 -23 -188.5t-64 -151.5t-95.5 -110.5t-117.5 -69.5t-130 -23q-131 0 -256 103l4 -160v-315h-235zM385 254q102 -84 203 -84q104 0 169.5 90.5t65.5 255.5q0 320 -217 320 q-105 0 -221 -113v-469z" />
+<glyph unicode="&#xff;" horiz-adv-x="1013" d="M25 1006h239l174 -494q14 -43 43 -139t45 -144h9q11 40 36 137t39 146l152 494h227l-364 -1051q-68 -185 -160.5 -277t-247.5 -92q-66 0 -131 21l43 184q42 -14 72 -14q143 0 200 172l19 63zM211 1309q0 51 34.5 86t86.5 35q54 0 88.5 -35t34.5 -86q0 -53 -34.5 -88 t-88.5 -35q-52 0 -86.5 35t-34.5 88zM590 1309q0 51 35 86t88 35t88 -35t35 -86q0 -53 -34.5 -88t-88.5 -35t-88.5 35t-34.5 88z" />
+<glyph unicode="&#x152;" horiz-adv-x="1753" d="M96 676q0 324 180 493.5t492 169.5h864v-200h-538v-342h450v-201h-450v-395h559v-201h-897q-198 0 -345.5 75.5t-231 229t-83.5 371.5zM340 676q0 -244 115 -363.5t329 -119.5h72v954h-72q-444 0 -444 -471z" />
+<glyph unicode="&#x153;" horiz-adv-x="1699" d="M84 502q0 123 37.5 224t101.5 166.5t148 101.5t178 36q110 0 199 -55.5t145 -157.5q60 100 148.5 156.5t187.5 56.5q189 0 293 -132t104 -349q0 -49 -10 -111h-621q12 -128 89 -201t190 -73q106 0 229 78l84 -158q-166 -109 -346 -109q-103 0 -194 56.5t-150 156.5 q-126 -213 -352 -213q-94 0 -177.5 36t-146.5 102t-100 166.5t-37 222.5zM324 502q0 -151 62 -242.5t163 -91.5q103 0 165 91.5t62 242.5q0 152 -62 244t-165 92q-101 0 -163 -92t-62 -244zM995 588h426q0 123 -51 191.5t-147 68.5q-90 0 -152.5 -69t-75.5 -191z" />
+<glyph unicode="&#x178;" horiz-adv-x="1019" d="M-12 1339h254l145 -342q23 -59 66.5 -165.5t52.5 -129.5h8q7 17 54.5 126.5t70.5 168.5l145 342h248l-403 -841v-498h-238v498zM197 1571q0 54 34 88.5t88 34.5t88.5 -34.5t34.5 -88.5q0 -53 -34.5 -87t-88.5 -34t-88 34t-34 87zM578 1571q0 54 34 88.5t88 34.5 q53 0 87 -34.5t34 -88.5q0 -53 -34.5 -87t-86.5 -34q-54 0 -88 34t-34 87z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1124" d="M272 1174l195 299h190l195 -299h-164l-123 174h-8l-123 -174h-162z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1124" d="M250 1182q12 117 61 182.5t127 65.5q45 0 91.5 -25t84.5 -49.5t62 -24.5q57 0 74 99h124q-12 -118 -61.5 -183t-128.5 -65q-44 0 -89.5 24.5t-84 49t-64.5 24.5q-54 0 -71 -98h-125z" />
+<glyph unicode="&#x2000;" horiz-adv-x="905" />
+<glyph unicode="&#x2001;" horiz-adv-x="1810" />
+<glyph unicode="&#x2002;" horiz-adv-x="905" />
+<glyph unicode="&#x2003;" horiz-adv-x="1810" />
+<glyph unicode="&#x2004;" horiz-adv-x="603" />
+<glyph unicode="&#x2005;" horiz-adv-x="452" />
+<glyph unicode="&#x2006;" horiz-adv-x="301" />
+<glyph unicode="&#x2007;" horiz-adv-x="301" />
+<glyph unicode="&#x2008;" horiz-adv-x="226" />
+<glyph unicode="&#x2009;" horiz-adv-x="362" />
+<glyph unicode="&#x200a;" horiz-adv-x="100" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M86 430v172h487v-172h-487z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M86 430v172h487v-172h-487z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M86 430v172h487v-172h-487z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M86 438v156h811v-156h-811z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1638" d="M86 438v156h1466v-156h-1466z" />
+<glyph unicode="&#x2018;" horiz-adv-x="563" d="M115 1010q0 268 254 401l57 -104q-88 -51 -129 -110.5t-41 -147.5q6 2 18 2q58 0 97 -34.5t39 -92.5q0 -64 -38.5 -103t-97.5 -39q-76 0 -117.5 60t-41.5 168z" />
+<glyph unicode="&#x2019;" horiz-adv-x="563" d="M137 905q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 103t96 39q78 0 120 -60t42 -168q0 -268 -256 -401z" />
+<glyph unicode="&#x201a;" horiz-adv-x="563" d="M137 -217q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 102.5t96 38.5q78 0 120 -59.5t42 -167.5q0 -269 -256 -402z" />
+<glyph unicode="&#x201c;" horiz-adv-x="987" d="M115 1010q0 268 254 401l57 -104q-88 -51 -129 -110.5t-41 -147.5q6 2 18 2q58 0 97 -34.5t39 -92.5q0 -64 -38.5 -103t-97.5 -39q-76 0 -117.5 60t-41.5 168zM539 1010q0 268 256 401l57 -104q-89 -51 -130.5 -110.5t-41.5 -147.5q6 2 20 2q56 0 95 -34.5t39 -92.5 q0 -64 -37.5 -103t-96.5 -39q-77 0 -119 60t-42 168z" />
+<glyph unicode="&#x201d;" horiz-adv-x="987" d="M137 905q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 103t96 39q78 0 120 -60t42 -168q0 -268 -256 -401zM561 905q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 103t96 39q77 0 119 -60t42 -168 q0 -268 -256 -401z" />
+<glyph unicode="&#x201e;" horiz-adv-x="987" d="M137 -217q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 102.5t96 38.5q78 0 120 -59.5t42 -167.5q0 -269 -256 -402zM561 -217q88 51 129 110.5t41 147.5q-6 -2 -18 -2q-56 0 -94.5 34.5t-38.5 92.5q0 64 37 102.5t96 38.5 q78 0 119.5 -59.5t41.5 -167.5q0 -269 -256 -402z" />
+<glyph unicode="&#x2022;" horiz-adv-x="665" d="M82 539q0 114 73 190t177 76q105 0 178.5 -76t73.5 -190q0 -115 -73 -191t-179 -76q-104 0 -177 76t-73 191z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1974" d="M174 135q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5zM856 135q0 69 44.5 114.5t109.5 45.5t108 -45.5t43 -114.5t-43 -114.5t-108 -45.5t-109.5 45.5t-44.5 114.5zM1540 135q0 69 43.5 114.5t108.5 45.5t108 -45.5 t43 -114.5t-43 -114.5t-108 -45.5t-108.5 45.5t-43.5 114.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="362" />
+<glyph unicode="&#x2039;" horiz-adv-x="577" d="M96 430v172l277 305l94 -76l-236 -315l236 -317l-94 -74z" />
+<glyph unicode="&#x203a;" horiz-adv-x="577" d="M111 199l233 317l-233 315l92 76l278 -305v-172l-278 -305z" />
+<glyph unicode="&#x205f;" horiz-adv-x="452" />
+<glyph unicode="&#x20ac;" d="M45 461v114l117 9q-2 20 -2 63q0 42 2 60h-117v114l129 8q41 235 180 366.5t342 131.5q91 0 176 -43t144 -117l-133 -129q-91 105 -193 105q-109 0 -181 -81.5t-97 -230.5h479v-124h-492q-2 -16 -2 -52q0 -46 2 -69h410v-125h-395q28 -144 98.5 -222.5t173.5 -78.5 q121 0 215 129l133 -123q-148 -191 -362 -191q-192 0 -324.5 127t-173.5 359h-129z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1351" d="M6 1239v145h543v-145h-193v-494h-159v494h-191zM641 745v639h190l87 -206l49 -150h8l49 150l84 206h190v-639h-155v238l18 225h-8l-127 -366h-113l-127 366h-8l19 -225v-238h-156z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1003" d="M0 0v1004h1004v-1004h-1004z" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1220" d="M55 819v176l135 11v104q0 166 81.5 263t252.5 97q100 0 185 -34l-45 -176q-55 24 -111 24q-127 0 -127 -170v-108h197v-187h-197v-819h-236v819h-135zM809 1315q0 60 41 97.5t104 37.5t104.5 -37.5t41.5 -97.5q0 -58 -41.5 -95.5t-104.5 -37.5t-104 37.5t-41 95.5zM836 0 v1006h235v-1006h-235z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1204" d="M55 819v176l135 11v104q0 166 81.5 263t252.5 97q100 0 185 -34l-45 -176q-55 24 -111 24q-127 0 -127 -170v-108h197v-187h-197v-819h-236v819h-135zM799 258v1188h235v-1200q0 -40 15 -59t36 -19q19 0 37 4l29 -176q-51 -21 -123 -21q-121 0 -175 73t-54 210z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.ttf b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.ttf
new file mode 100644
index 0000000..6d97e7b
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.ttf
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.woff b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.woff
new file mode 100644
index 0000000..d844315
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.woff
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/stylesheet.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/stylesheet.css
new file mode 100644
index 0000000..2d66502
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/fonts/stylesheet.css
@@ -0,0 +1,57 @@
+
+@font-face {
+ font-family: 'source-sans-pro';
+ src: url('sourcesanspro-light-webfont.eot');
+ src: url('sourcesanspro-light-webfont.eot?#iefix') format('embedded-opentype'),
+ url('sourcesanspro-light-webfont.woff') format('woff'),
+ url('sourcesanspro-light-webfont.ttf') format('truetype'),
+ url('sourcesanspro-light-webfont.svg#source_sans_prolight') format('svg');
+ font-weight: 300;
+ font-style: normal;
+
+}
+
+
+
+
+@font-face {
+ font-family: 'source-sans-pro';
+ src: url('sourcesanspro-regular-webfont.eot');
+ src: url('sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'),
+ url('sourcesanspro-regular-webfont.woff') format('woff'),
+ url('sourcesanspro-regular-webfont.ttf') format('truetype'),
+ url('sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg');
+ font-weight: 400;
+ font-style: normal;
+
+}
+
+
+
+
+@font-face {
+ font-family: 'source-sans-pro';
+ src: url('sourcesanspro-semibold-webfont.eot');
+ src: url('sourcesanspro-semibold-webfont.eot?#iefix') format('embedded-opentype'),
+ url('sourcesanspro-semibold-webfont.woff') format('woff'),
+ url('sourcesanspro-semibold-webfont.ttf') format('truetype'),
+ url('sourcesanspro-semibold-webfont.svg#source_sans_prosemibold') format('svg');
+ font-weight: 600;
+ font-style: normal;
+
+}
+
+
+
+
+@font-face {
+ font-family: 'source-code-pro';
+ src: url('sourcecodepro-regular-webfont.eot');
+ src: url('sourcecodepro-regular-webfont.eot?#iefix') format('embedded-opentype'),
+ url('sourcecodepro-regular-webfont.woff') format('woff'),
+ url('sourcecodepro-regular-webfont.ttf') format('truetype'),
+ url('sourcecodepro-regular-webfont.svg#source_code_proregular') format('svg');
+ font-weight: normal;
+ font-style: normal;
+
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search.svg
new file mode 100644
index 0000000..d18a4fa
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="41px" height="40px" viewBox="0 0 41 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+ <title>Slice 1</title>
+ <description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
+ <defs></defs>
+ <g id="Page 1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="search" fill="#C6C8C8">
+ <path d="M0.504,16.338 C0.504,25.085 7.635,32.165 16.444,32.165 C25.24,32.165 32.382,25.085 32.382,16.338 C32.382,7.591 25.24,0.5 16.444,0.5 C7.635,0.5 0.504,7.591 0.504,16.338 L0.504,16.338 Z M5.555,16.338 C5.555,10.359 10.423,5.521 16.445,5.521 C22.455,5.521 27.333,10.36 27.333,16.338 C27.333,22.317 22.455,27.156 16.445,27.156 C10.423,27.156 5.555,22.316 5.555,16.338 L5.555,16.338 Z M27.666,30.861 L34.521,38.67 C35.625,39.772 36.338,39.781 37.46,38.67 L39.661,36.489 C40.743,35.408 40.811,34.711 39.661,33.568 L31.765,26.793 L27.666,30.861 L27.666,30.861 Z M27.666,30.861" id="Shape"></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search_dark.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search_dark.svg
new file mode 100644
index 0000000..cbfae91
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/img/search_dark.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd" [
+ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
+ <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
+ <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
+ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
+]>
+<svg version="1.1" baseProfile="tiny" id="search" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ x="0px" y="0px" width="42px" height="42px" viewBox="0 0 42 42" xml:space="preserve">
+<path d="M1.504,17.338c0,8.747,7.131,15.827,15.94,15.827c8.796,0,15.938-7.08,15.938-15.827S26.24,1.5,17.444,1.5
+ C8.635,1.5,1.504,8.591,1.504,17.338z M6.555,17.338c0-5.979,4.868-10.817,10.89-10.817c6.01,0,10.888,4.839,10.888,10.817
+ c0,5.979-4.878,10.818-10.888,10.818C11.423,28.156,6.555,23.316,6.555,17.338z M28.666,31.861l6.855,7.809
+ c1.104,1.102,1.817,1.111,2.939,0l2.201-2.181c1.082-1.081,1.15-1.778,0-2.921l-7.896-6.775L28.666,31.861z"/>
+</svg>
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/js/prism.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/js/prism.js
new file mode 100644
index 0000000..8f1a555
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/js/prism.js
@@ -0,0 +1,9 @@
+/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
+Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};
+;
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|throw|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});
+; \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/reference.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/reference.html
new file mode 100644
index 0000000..eed4bdd
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/doc/reference.html
@@ -0,0 +1,14816 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <base href="http://snapsvg.io/docs/">
+ <title>Snap.svg API Reference</title>
+ <link rel="shortcut icon" href="/assets/favicon.ico?v=1">
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <link rel="stylesheet" href="/assets/docs/fonts/stylesheet.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/topcoat-desktop-light.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/main.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/dr.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/prism.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/style/docs-header.css?v=201311041519">
+ <script>
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-44948757-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ function trackOutboundLink(link, category, action) {
+ try {
+ _gaq.push(['_trackEvent', category , action]);
+ } catch(err){}
+
+ setTimeout(function() {
+ document.location.href = link.href;
+ }, 100);
+ }
+ </script>
+ </head>
+ <body class="light">
+
+ <header id="header">
+ <div class="wrap">
+ <a href="/" class="logo">
+ <img src="/assets/images/logo.svg" alt=""/>
+ <span class="header">Snap.svg</span>
+ </a>
+ <nav>
+ <a href="/">Home</a>
+ <a href="/about/">Why Snap</a>
+ <a href="/start/" class="mobile-hide">Getting Started</a>
+ <a href="/docs/" class="mobile-hide selected">Docs</a>
+ <a href="/support/">Support</a>
+ <a href="/demos/" class="mobile-hide">Demos</a>
+ <a class="bt" href="/assets/downloads/Snap.svg-0.1.0.zip" onclick="trackOutboundLink(this, 'Download', '0.1');return false;">Download</a>
+ </nav>
+ </div>
+ </header>
+
+<!--[if lt IE 9]>
+<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
+
+ <div id="wrapper">
+ <div class="max-width">
+ <div id="sideNav">
+ <div class="combo">
+ <input type="search" id="dr-filter" value="" placeholder="search" class="topcoat-search-input">
+ </div>
+ <div id="pageNav">
+ <ol id="dr-toc">
+
+ <li class="dr-lvl0">
+ <a href="#Element" class="undefined"><span>Element</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.add" class="dr-method"><span>Element.add()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.addClass" class="dr-method"><span>Element.addClass()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.after" class="dr-method"><span>Element.after()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.animate" class="dr-method"><span>Element.animate()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.append" class="dr-method"><span>Element.append()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.appendTo" class="dr-method"><span>Element.appendTo()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.asPX" class="dr-method"><span>Element.asPX()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.attr" class="dr-method"><span>Element.attr()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.before" class="dr-method"><span>Element.before()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.children" class="dr-method"><span>Element.children()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.click" class="dr-method"><span>Element.click()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.clone" class="dr-method"><span>Element.clone()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.data" class="dr-method"><span>Element.data()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.dblclick" class="dr-method"><span>Element.dblclick()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.drag" class="dr-method"><span>Element.drag()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.getBBox" class="dr-method"><span>Element.getBBox()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.getPointAtLength" class="dr-method"><span>Element.getPointAtLength()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.getSubpath" class="dr-method"><span>Element.getSubpath()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.getTotalLength" class="dr-method"><span>Element.getTotalLength()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.hasClass" class="dr-method"><span>Element.hasClass()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.hover" class="dr-method"><span>Element.hover()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.inAnim" class="dr-method"><span>Element.inAnim()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.innerSVG" class="dr-method"><span>Element.innerSVG()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.insertAfter" class="dr-method"><span>Element.insertAfter()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.insertBefore" class="dr-method"><span>Element.insertBefore()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.marker" class="dr-method"><span>Element.marker()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.mousedown" class="dr-method"><span>Element.mousedown()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.mousemove" class="dr-method"><span>Element.mousemove()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.mouseout" class="dr-method"><span>Element.mouseout()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.mouseover" class="dr-method"><span>Element.mouseover()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.mouseup" class="dr-method"><span>Element.mouseup()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.node" class="dr-property"><span>Element.node</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.outerSVG" class="dr-method"><span>Element.outerSVG()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.parent" class="dr-method"><span>Element.parent()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.prepend" class="dr-method"><span>Element.prepend()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.prependTo" class="dr-method"><span>Element.prependTo()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.remove" class="dr-method"><span>Element.remove()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.removeClass" class="dr-method"><span>Element.removeClass()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.removeData" class="dr-method"><span>Element.removeData()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.select" class="dr-method"><span>Element.select()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.selectAll" class="dr-method"><span>Element.selectAll()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.stop" class="dr-method"><span>Element.stop()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.toDefs" class="dr-method"><span>Element.toDefs()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.toJSON" class="dr-method"><span>Element.toJSON()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.toPattern" class="dr-method"><span>Element.toPattern()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.toString" class="dr-method"><span>Element.toString()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.toggleClass" class="dr-method"><span>Element.toggleClass()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.touchcancel" class="dr-method"><span>Element.touchcancel()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.touchend" class="dr-method"><span>Element.touchend()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.touchmove" class="dr-method"><span>Element.touchmove()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.touchstart" class="dr-method"><span>Element.touchstart()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.transform" class="dr-method"><span>Element.transform()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.type" class="dr-property"><span>Element.type</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unclick" class="dr-method"><span>Element.unclick()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.undblclick" class="dr-method"><span>Element.undblclick()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.undrag" class="dr-method"><span>Element.undrag()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unhover" class="dr-method"><span>Element.unhover()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unmousedown" class="dr-method"><span>Element.unmousedown()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unmousemove" class="dr-method"><span>Element.unmousemove()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unmouseout" class="dr-method"><span>Element.unmouseout()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unmouseover" class="dr-method"><span>Element.unmouseover()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.unmouseup" class="dr-method"><span>Element.unmouseup()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.untouchcancel" class="dr-method"><span>Element.untouchcancel()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.untouchend" class="dr-method"><span>Element.untouchend()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.untouchmove" class="dr-method"><span>Element.untouchmove()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.untouchstart" class="dr-method"><span>Element.untouchstart()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Element.use" class="dr-method"><span>Element.use()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#Fragment" class="undefined"><span>Fragment</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Fragment.select" class="dr-method"><span>Fragment.select()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Fragment.selectAll" class="dr-method"><span>Fragment.selectAll()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#Matrix" class="undefined"><span>Matrix</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.add" class="dr-method"><span>Matrix.add()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.clone" class="dr-method"><span>Matrix.clone()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.determinant" class="dr-method"><span>Matrix.determinant()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.invert" class="dr-method"><span>Matrix.invert()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.rotate" class="dr-method"><span>Matrix.rotate()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.scale" class="dr-method"><span>Matrix.scale()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.split" class="dr-method"><span>Matrix.split()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.toTransformString" class="dr-method"><span>Matrix.toTransformString()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.translate" class="dr-method"><span>Matrix.translate()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.x" class="dr-method"><span>Matrix.x()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Matrix.y" class="dr-method"><span>Matrix.y()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#Paper" class="undefined"><span>Paper</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.circle" class="dr-method"><span>Paper.circle()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.clear" class="dr-method"><span>Paper.clear()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.el" class="dr-method"><span>Paper.el()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.ellipse" class="dr-method"><span>Paper.ellipse()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.filter" class="dr-method"><span>Paper.filter()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.g" class="dr-method"><span>Paper.g()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.gradient" class="dr-method"><span>Paper.gradient()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.group" class="dr-method"><span>Paper.group()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.image" class="dr-method"><span>Paper.image()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.line" class="dr-method"><span>Paper.line()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.mask" class="dr-method"><span>Paper.mask()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.path" class="dr-method"><span>Paper.path()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.polygon" class="dr-method"><span>Paper.polygon()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.polyline" class="dr-method"><span>Paper.polyline()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.ptrn" class="dr-method"><span>Paper.ptrn()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.rect" class="dr-method"><span>Paper.rect()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.svg" class="dr-method"><span>Paper.svg()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.symbol" class="dr-method"><span>Paper.symbol()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.text" class="dr-method"><span>Paper.text()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.toDataURL" class="dr-method"><span>Paper.toDataURL()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.toString" class="dr-method"><span>Paper.toString()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Paper.use" class="dr-method"><span>Paper.use()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#Set" class="undefined"><span>Set</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.animate" class="dr-method"><span>Set.animate()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.bind" class="dr-method"><span>Set.bind()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.clear" class="dr-method"><span>Set.clear()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.exclude" class="dr-method"><span>Set.exclude()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.forEach" class="dr-method"><span>Set.forEach()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.pop" class="dr-method"><span>Set.pop()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.push" class="dr-method"><span>Set.push()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Set.splice" class="dr-method"><span>Set.splice()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#Snap" class="undefined"><span>Snap</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.Matrix" class="dr-method"><span>Snap.Matrix()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.acos" class="dr-method"><span>Snap.acos()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.ajax" class="dr-method"><span>Snap.ajax()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.angle" class="dr-method"><span>Snap.angle()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.animate" class="dr-method"><span>Snap.animate()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.animation" class="dr-method"><span>Snap.animation()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.asin" class="dr-method"><span>Snap.asin()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.atan" class="dr-method"><span>Snap.atan()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.atan2" class="dr-method"><span>Snap.atan2()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.closestPoint" class="dr-method"><span>Snap.closestPoint()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.color" class="dr-method"><span>Snap.color()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.cos" class="dr-method"><span>Snap.cos()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.deg" class="dr-method"><span>Snap.deg()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.filter" class="undefined"><span>Snap.filter</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.blur" class="dr-method"><span>Snap.filter.blur()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.brightness" class="dr-method"><span>Snap.filter.brightness()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.contrast" class="dr-method"><span>Snap.filter.contrast()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.grayscale" class="dr-method"><span>Snap.filter.grayscale()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.hueRotate" class="dr-method"><span>Snap.filter.hueRotate()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.invert" class="dr-method"><span>Snap.filter.invert()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.saturate" class="dr-method"><span>Snap.filter.saturate()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.sepia" class="dr-method"><span>Snap.filter.sepia()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.filter.shadow" class="dr-method"><span>Snap.filter.shadow()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.format" class="dr-method"><span>Snap.format()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.fragment" class="dr-method"><span>Snap.fragment()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.getElementByPoint" class="dr-method"><span>Snap.getElementByPoint()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.getRGB" class="dr-method"><span>Snap.getRGB()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.hsb" class="dr-method"><span>Snap.hsb()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.hsb2rgb" class="dr-method"><span>Snap.hsb2rgb()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.hsl" class="dr-method"><span>Snap.hsl()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.hsl2rgb" class="dr-method"><span>Snap.hsl2rgb()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.is" class="dr-method"><span>Snap.is()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.len" class="dr-method"><span>Snap.len()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.len2" class="dr-method"><span>Snap.len2()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.load" class="dr-method"><span>Snap.load()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.matrix" class="dr-method"><span>Snap.matrix()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.parse" class="dr-method"><span>Snap.parse()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.parsePathString" class="dr-method"><span>Snap.parsePathString()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.parseTransformString" class="dr-method"><span>Snap.parseTransformString()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.path" class="undefined"><span>Snap.path</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.bezierBBox" class="dr-method"><span>Snap.path.bezierBBox()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.findDotsAtSegment" class="dr-method"><span>Snap.path.findDotsAtSegment()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.getBBox" class="dr-method"><span>Snap.path.getBBox()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.getPointAtLength" class="dr-method"><span>Snap.path.getPointAtLength()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.getSubpath" class="dr-method"><span>Snap.path.getSubpath()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.getTotalLength" class="dr-method"><span>Snap.path.getTotalLength()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.intersection" class="dr-method"><span>Snap.path.intersection()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.isBBoxIntersect" class="dr-method"><span>Snap.path.isBBoxIntersect()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.isPointInside" class="dr-method"><span>Snap.path.isPointInside()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.isPointInsideBBox" class="dr-method"><span>Snap.path.isPointInsideBBox()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.map" class="dr-method"><span>Snap.path.map()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.toAbsolute" class="dr-method"><span>Snap.path.toAbsolute()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.toCubic" class="dr-method"><span>Snap.path.toCubic()</span></a>
+ </li>
+
+ <li class="dr-lvl2">
+ <a href="#Snap.path.toRelative" class="dr-method"><span>Snap.path.toRelative()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.plugin" class="dr-method"><span>Snap.plugin()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.rad" class="dr-method"><span>Snap.rad()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.rgb" class="dr-method"><span>Snap.rgb()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.rgb2hsb" class="dr-method"><span>Snap.rgb2hsb()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.rgb2hsl" class="dr-method"><span>Snap.rgb2hsl()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.select" class="dr-method"><span>Snap.select()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.selectAll" class="dr-method"><span>Snap.selectAll()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.sin" class="dr-method"><span>Snap.sin()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.snapTo" class="dr-method"><span>Snap.snapTo()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#Snap.tan" class="dr-method"><span>Snap.tan()</span></a>
+ </li>
+
+ <li class="dr-lvl0">
+ <a href="#mina" class="dr-method"><span>mina()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.backin" class="dr-method"><span>mina.backin()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.backout" class="dr-method"><span>mina.backout()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.bounce" class="dr-method"><span>mina.bounce()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.easein" class="dr-method"><span>mina.easein()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.easeinout" class="dr-method"><span>mina.easeinout()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.easeout" class="dr-method"><span>mina.easeout()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.elastic" class="dr-method"><span>mina.elastic()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.getById" class="dr-method"><span>mina.getById()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.linear" class="dr-method"><span>mina.linear()</span></a>
+ </li>
+
+ <li class="dr-lvl1">
+ <a href="#mina.time" class="dr-method"><span>mina.time()</span></a>
+ </li>
+
+ </ol>
+ </div>
+ </div>
+ </div>
+ <div id="site">
+ <div id="content" class="max-width">
+
+ <article id="Snap">
+ <header>
+ <h3 class="dr-method">Snap(…)<a href="#Snap" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 33 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L33">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a drawing surface or wraps existing SVG element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> <em class="dr-type-string">string</em> </span>
+ <span class="dr-description">width of surface</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> <em class="dr-type-string">string</em> </span>
+ <span class="dr-description">height of surface</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">DOM</span>
+ <span class="dr-type"><em class="dr-type-SVGElement">SVGElement</em> </span>
+ <span class="dr-description">element to be wrapped into Snap structure</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">array</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-description">array of elements (will return set of elements)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">query</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">CSS query selector</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.format">
+ <header>
+ <h3 class="dr-method">Snap.format(token, json)<a href="#Snap.format" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 200 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L200">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.format-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Replaces construction of type <code>{&lt;name&gt;}</code> to the corresponding argument
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">token</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">string to format</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">json</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">object which properties are used as a replacement</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">formatted string</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">// this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
+ x: 10,
+ y: 20,
+ dim: {
+ width: 40,
+ height: 50,
+ "negative width": -40
+ }
+}));</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.rad">
+ <header>
+ <h3 class="dr-method">Snap.rad(deg)<a href="#Snap.rad" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 290 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L290">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.rad-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Transform angle to radians
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">deg</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle in degrees</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">angle in radians</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.deg">
+ <header>
+ <h3 class="dr-method">Snap.deg(rad)<a href="#Snap.deg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 299 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L299">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.deg-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Transform angle to degrees
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">rad</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle in radians</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">angle in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.sin">
+ <header>
+ <h3 class="dr-method">Snap.sin(angle)<a href="#Snap.sin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 308 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L308">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.sin-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.sin()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">angle</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle in degrees</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">sin</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.tan">
+ <header>
+ <h3 class="dr-method">Snap.tan(angle)<a href="#Snap.tan" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 319 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L319">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.tan-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.tan()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">angle</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle in degrees</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">tan</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.cos">
+ <header>
+ <h3 class="dr-method">Snap.cos(angle)<a href="#Snap.cos" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 330 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L330">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.cos-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.cos()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">angle</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle in degrees</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">cos</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.asin">
+ <header>
+ <h3 class="dr-method">Snap.asin(num)<a href="#Snap.asin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 341 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L341">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.asin-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.asin()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">num</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">asin in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.acos">
+ <header>
+ <h3 class="dr-method">Snap.acos(num)<a href="#Snap.acos" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 352 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L352">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.acos-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.acos()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">num</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">acos in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.atan">
+ <header>
+ <h3 class="dr-method">Snap.atan(num)<a href="#Snap.atan" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 363 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L363">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.atan-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.atan()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">num</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">atan in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.atan2">
+ <header>
+ <h3 class="dr-method">Snap.atan2(num)<a href="#Snap.atan2" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 374 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L374">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.atan2-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent to <code>Math.atan2()</code> only works with degrees, not radians.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">num</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">atan2 in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.angle">
+ <header>
+ <h3 class="dr-method">Snap.angle(x1, y1, x2, y2, [x3], [y3])<a href="#Snap.angle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 391 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L391">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.angle-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an angle between two or three points
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Parameters</h3>
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of second point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of second point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x3</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of third point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y3</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of third point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">angle in degrees</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.len">
+ <header>
+ <h3 class="dr-method">Snap.len(x1, y1, x2, y2)<a href="#Snap.len" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 404 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L404">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.len-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns distance between two points
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Parameters</h3>
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of second point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of second point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">distance</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.len2">
+ <header>
+ <h3 class="dr-method">Snap.len2(x1, y1, x2, y2)<a href="#Snap.len2" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 419 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L419">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.len2-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns squared distance between two points
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Parameters</h3>
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of first point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of second point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of second point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">distance</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.closestPoint">
+ <header>
+ <h3 class="dr-method">Snap.closestPoint(path, x, y)<a href="#Snap.closestPoint" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 439 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L439">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.closestPoint-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns closest point to a given one on a given path.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Parameters</h3>
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">path element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coord of a point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coord of a point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">in format</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.is">
+ <header>
+ <h3 class="dr-method">Snap.is(o, type)<a href="#Snap.is" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 495 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L495">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.is-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Handy replacement for the <code>typeof</code> operator
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">o</span>
+ <span class="dr-type"><em class="dr-type-…">…</em> </span>
+ <span class="dr-description">any object or primitive</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">type</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">name of the type, e.g., <code>string</code>, <code>function</code>, <code>number</code>, etc.</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if given value is of given type</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.snapTo">
+ <header>
+ <h3 class="dr-method">Snap.snapTo(values, value, [tolerance])<a href="#Snap.snapTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 506 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L506">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.snapTo-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Snaps given value to given grid
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">values</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> <em class="dr-type-number">number</em> </span>
+ <span class="dr-description">given array of values or step of the grid</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value to adjust</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">tolerance</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">maximum distance to the target value that would trigger the snap. Default is <code>10</code>.</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">adjusted value</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.getRGB">
+ <header>
+ <h3 class="dr-method">Snap.getRGB(color)<a href="#Snap.getRGB" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 559 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L559">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.getRGB-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Parses color string as RGB object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">color</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">color string in one of the following formats:</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+ <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>rgba(•••, •••, •••, •••) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsba(•••, •••, •••, •••) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsla(•••, •••, •••, •••) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
+
+
+
+
+
+
+
+
+
+
+
+ <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+
+
+
+
+
+
+
+
+
+ <p>Note that <code>%</code> can be used any time: <code>rgb(20%, 255, 50%)</code>.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">RGB object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">red,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">green,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">blue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">hex</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">color in HTML/CSS format: #••••••,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">error</span>
+ <span class="dr-type"><em class="dr-type-boolean">boolean</em> </span>
+ <span class="dr-json-description">true if string can&#39;t be parsed</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.hsb">
+ <header>
+ <h3 class="dr-method">Snap.hsb(h, s, b)<a href="#Snap.hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 647 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L647">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.hsb-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts HSB values to a hex representation of the color
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">hue</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">saturation</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value or brightness</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">hex representation of the color</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.hsl">
+ <header>
+ <h3 class="dr-method">Snap.hsl(h, s, l)<a href="#Snap.hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 660 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L660">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.hsl-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts HSL values to a hex representation of the color
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">hue</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">saturation</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">l</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">luminosity</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">hex representation of the color</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.rgb">
+ <header>
+ <h3 class="dr-method">Snap.rgb(r, g, b)<a href="#Snap.rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 673 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L673">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.rgb-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts RGB values to a hex representation of the color
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">red</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">green</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">blue</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">hex representation of the color</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.color">
+ <header>
+ <h3 class="dr-method">Snap.color(clr)<a href="#Snap.color" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 759 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L759">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.color-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Parses the color string and returns an object featuring the color&#39;s component values
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">clr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">color string in one of the supported formats (see <a href="#Snap.getRGB" class="dr-link">Snap.getRGB</a>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">Combined RGB/HSB object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">red,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">green,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">blue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">hex</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">color in HTML/CSS format: #••••••,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">error</span>
+ <span class="dr-type"><em class="dr-type-boolean">boolean</em> </span>
+ <span class="dr-json-description"><code>true</code> if string can&#39;t be parsed,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">hue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">saturation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">v</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">value (brightness),</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">l</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">lightness</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.hsb2rgb">
+ <header>
+ <h3 class="dr-method">Snap.hsb2rgb(h, s, v)<a href="#Snap.hsb2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 811 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L811">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.hsb2rgb-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts HSB values to an RGB object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">hue</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">saturation</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">v</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">value or brightness</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">RGB object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">red,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">green,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">blue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">hex</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">color in HTML/CSS format: #••••••</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.hsl2rgb">
+ <header>
+ <h3 class="dr-method">Snap.hsl2rgb(h, s, l)<a href="#Snap.hsl2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 847 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L847">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.hsl2rgb-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts HSL values to an RGB object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">hue</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">saturation</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">l</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">luminosity</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">RGB object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">red,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">green,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">blue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">hex</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">color in HTML/CSS format: #••••••</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.rgb2hsb">
+ <header>
+ <h3 class="dr-method">Snap.rgb2hsb(r, g, b)<a href="#Snap.rgb2hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 886 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L886">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.rgb2hsb-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts RGB values to an HSB object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">red</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">green</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">blue</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">HSB object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">hue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">saturation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">brightness</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.rgb2hsl">
+ <header>
+ <h3 class="dr-method">Snap.rgb2hsl(r, g, b)<a href="#Snap.rgb2hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 919 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L919">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.rgb2hsl-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Converts RGB values to an HSL object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">red</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">g</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">green</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">blue</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">HSL object in the following format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">h</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">hue,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">saturation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">l</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">luminosity</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.parsePathString">
+ <header>
+ <h3 class="dr-method">Snap.parsePathString(pathString)<a href="#Snap.parsePathString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 952 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L952">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.parsePathString-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Parses given path string into an array of arrays of path segments
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">pathString</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">path string or array of segments (in the last case it is returned straight away)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">array of segments</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.parseTransformString">
+ <header>
+ <h3 class="dr-method">Snap.parseTransformString(TString)<a href="#Snap.parseTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1005 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1005">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.parseTransformString-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Parses given transform string into an array of transformations
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">TString</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">transform string or array of transformations (in the last case it is returned straight away)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">array of transformations</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.select">
+ <header>
+ <h3 class="dr-method">Snap.select(query)<a href="#Snap.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1265 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1265">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.select-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Wraps a DOM element specified by CSS selector as <a href="#Element" class="dr-link">Element</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">query</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">CSS selector of the element</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.selectAll">
+ <header>
+ <h3 class="dr-method">Snap.selectAll(query)<a href="#Snap.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1277 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1277">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.selectAll-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Wraps DOM elements specified by CSS selector as set or array of <a href="#Element" class="dr-link">Element</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">query</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">CSS selector of the element</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.node">
+ <header>
+ <h3 class="dr-property">Element.node()<a href="#Element.node" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1339 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1339">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.node-extra"></div>
+ <div class="dr-property">
+
+
+
+
+ <p>Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">// draw a circle at coordinate 10,10 with radius of 10
+var c = paper.circle(10, 10, 10);
+c.node.onclick = function () {
+ c.attr("fill", "red");
+};</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.type">
+ <header>
+ <h3 class="dr-property">Element.type()<a href="#Element.type" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1349 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1349">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.type-extra"></div>
+ <div class="dr-property">
+
+
+
+
+ <p>SVG tag name of the given element.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.attr">
+ <header>
+ <h3 class="dr-method">Element.attr(…)<a href="#Element.attr" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1391 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1391">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.attr-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Gets or sets given attributes of the element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">params</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">contains key-value pairs of attributes you want to set</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">param</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">name of the attribute</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">value of attribute</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">el.attr({
+ fill: "#fc0",
+ stroke: "#000",
+ strokeWidth: 2, // CamelCase...
+ "fill-opacity": 0.5, // or dash-separated names
+ width: "*=2" // prefixed values
+});
+console.log(el.attr("fill")); // #fc0</code></pre></section>
+
+
+
+
+
+
+ <p>Prefixed values in format <code>&quot;+=10&quot;</code> supported. All four operations
+(<code>+</code>, <code>-</code>, <code>*</code> and <code>/</code>) could be used. Optionally you can use units for <code>+</code>
+and <code>-</code>: <code>&quot;+=2em&quot;</code>.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.parse">
+ <header>
+ <h3 class="dr-method">Snap.parse(svg)<a href="#Snap.parse" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1432 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1432">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.parse-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Parses SVG fragment and converts it into a <a href="#Fragment" class="dr-link">Fragment</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">svg</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">SVG string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Fragment">Fragment</em>
+
+ <span class="dr-description">the <a href="#Fragment" class="dr-link">Fragment</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.fragment">
+ <header>
+ <h3 class="dr-method">Snap.fragment(varargs)<a href="#Snap.fragment" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1466 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1466">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.fragment-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a DOM fragment from a given list of elements or strings
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">varargs</span>
+ <span class="dr-type"><em class="dr-type-…">…</em> </span>
+ <span class="dr-description">SVG string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Fragment">Fragment</em>
+
+ <span class="dr-description">the <a href="#Fragment" class="dr-link">Fragment</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.el">
+ <header>
+ <h3 class="dr-method">Paper.el(name, attr)<a href="#Paper.el" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1569 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1569">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.el-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates an element on paper with a given name and no attributes
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">name</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">tag name</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">attributes</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c = paper.circle(10, 10, 10); // is the same as...
+var c = paper.el("circle").attr({
+ cx: 10,
+ cy: 10,
+ r: 10
+});
+// and the same as
+var c = paper.el("circle", {
+ cx: 10,
+ cy: 10,
+ r: 10
+});</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.children">
+ <header>
+ <h3 class="dr-method">Element.children()<a href="#Element.children" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1581 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1581">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.children-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns array of all the children of the element.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">array of Elements</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.toJSON">
+ <header>
+ <h3 class="dr-method">Element.toJSON()<a href="#Element.toJSON" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1614 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1614">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.toJSON-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns object representation of the given element and all its children.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">in format</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">type</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">this.type,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">attr</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description">attributes map,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">childNodes</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-json-description">optional array of children in the same format</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.ajax">
+ <header>
+ <h3 class="dr-method">Snap.ajax(…)<a href="#Snap.ajax" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1732 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1732">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.ajax-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Simple implementation of Ajax
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">url</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">URL</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">postData</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> <em class="dr-type-string">string</em> </span>
+ <span class="dr-description">data for post request</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">scope</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">scope of callback</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">url</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">URL</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">scope</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">scope of callback</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-XMLHttpRequest">XMLHttpRequest</em>
+
+ <span class="dr-description">the XMLHttpRequest object, just in case</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.load">
+ <header>
+ <h3 class="dr-method">Snap.load(url, callback, [scope])<a href="#Snap.load" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1778 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1778">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.load-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Loads external SVG file as a <a href="#Fragment" class="dr-link">Fragment</a> (see <a href="#Snap.ajax" class="dr-link">Snap.ajax</a> for more advanced AJAX)
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">url</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">URL</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">scope</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">scope of callback</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.getElementByPoint">
+ <header>
+ <h3 class="dr-method">Snap.getElementByPoint(x, y)<a href="#Snap.getElementByPoint" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1809 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1809">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.getElementByPoint-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns you topmost element under given point.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">Snap element object</span>
+ </p>
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate from the top left corner of the window</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate from the top left corner of the window</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.plugin">
+ <header>
+ <h3 class="dr-method">Snap.plugin(f)<a href="#Snap.plugin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1844 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1844">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.plugin-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Let you write plugins. You pass in a function with five arguments, like this:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+ Snap.newmethod = function () {};
+ Element.prototype.newmethod = function () {};
+ Paper.prototype.newmethod = function () {};
+});</code></pre></section>
+
+
+
+
+
+
+ <p>Inside the function you have access to all main objects (and their
+prototypes). This allow you to extend anything you want.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">f</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">your plugin body</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.getBBox">
+ <header>
+ <h3 class="dr-method">Element.getBBox()<a href="#Element.getBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 49 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L49">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.getBBox-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the bounding box descriptor for the given element
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">bounding box descriptor:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">cx:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x of the center,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">cy:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x of the center,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">h:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">height,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">height:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">height,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">path:</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">path command for the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">r0:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">radius of a circle that fully encloses the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">r1:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">radius of the smallest circle that can be enclosed,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">r2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">radius of the largest circle that can be enclosed,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">vb:</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">box as a viewbox command,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">w:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">width,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">width:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">width,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">x2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x of the right side,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x of the left side,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y of the bottom edge,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y of the top edge</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.transform">
+ <header>
+ <h3 class="dr-method">Element.transform(tstr)<a href="#Element.transform" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 141 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L141">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.transform-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Gets or sets transformation of the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">tstr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">transform string in Snap or SVG format</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">transformation descriptor:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">string</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">transform string,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">globalMatrix</span>
+ <span class="dr-type"><em class="dr-type-Matrix">Matrix</em> </span>
+ <span class="dr-json-description">matrix of all transformations applied to element or its parents,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">localMatrix</span>
+ <span class="dr-type"><em class="dr-type-Matrix">Matrix</em> </span>
+ <span class="dr-json-description">matrix of transformations applied only to the element,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">diffMatrix</span>
+ <span class="dr-type"><em class="dr-type-Matrix">Matrix</em> </span>
+ <span class="dr-json-description">matrix of difference between global and local transformations,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">global</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">global transformation as string,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">local</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">local transformation as string,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">toString</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">returns <code>string</code> property</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.parent">
+ <header>
+ <h3 class="dr-method">Element.parent()<a href="#Element.parent" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 199 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L199">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.parent-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the element&#39;s parent
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.append">
+ <header>
+ <h3 class="dr-method">Element.append(el)<a href="#Element.append" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 211 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L211">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.append-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Appends the given element to current one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> <em class="dr-type-Set">Set</em> </span>
+ <span class="dr-description">element to append</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.add">
+ <header>
+ <h3 class="dr-method">Element.add()<a href="#Element.add" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 217 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L217">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.add-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>See <a href="#Element.append" class="dr-link">Element.append</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.appendTo">
+ <header>
+ <h3 class="dr-method">Element.appendTo(el)<a href="#Element.appendTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 241 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L241">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.appendTo-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Appends the current element to the given one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">parent element to append to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the child element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.prepend">
+ <header>
+ <h3 class="dr-method">Element.prepend(el)<a href="#Element.prepend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 257 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L257">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.prepend-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Prepends the given element to the current one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">element to prepend</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.prependTo">
+ <header>
+ <h3 class="dr-method">Element.prependTo(el)<a href="#Element.prependTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 291 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L291">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.prependTo-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Prepends the current element to the given one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">parent element to prepend to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the child element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.before">
+ <header>
+ <h3 class="dr-method">Element.before(el)<a href="#Element.before" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 305 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L305">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.before-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Inserts given element before the current one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">element to insert</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.after">
+ <header>
+ <h3 class="dr-method">Element.after(el)<a href="#Element.after" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 333 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L333">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.after-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Inserts given element after the current one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">element to insert</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.insertBefore">
+ <header>
+ <h3 class="dr-method">Element.insertBefore(el)<a href="#Element.insertBefore" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 355 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L355">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.insertBefore-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Inserts the element after the given one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">element next to whom insert to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.insertAfter">
+ <header>
+ <h3 class="dr-method">Element.insertAfter(el)<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 373 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L373">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.insertAfter-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Inserts the element after the given one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">el</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">element next to whom insert to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the parent element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.remove">
+ <header>
+ <h3 class="dr-method">Element.remove()<a href="#Element.remove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 389 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L389">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.remove-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes element from the DOM
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the detached element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.select">
+ <header>
+ <h3 class="dr-method">Element.select(query)<a href="#Element.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 406 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L406">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.select-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Gathers the nested <a href="#Element" class="dr-link">Element</a> matching the given set of CSS selectors
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">query</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">CSS selector</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">result of query selection</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.selectAll">
+ <header>
+ <h3 class="dr-method">Element.selectAll(query)<a href="#Element.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 418 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L418">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.selectAll-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Gathers nested <a href="#Element" class="dr-link">Element</a> objects matching the given set of CSS selectors
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">query</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">CSS selector</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Set">Set</em>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">result of query selection</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.asPX">
+ <header>
+ <h3 class="dr-method">Element.asPX(attr, [value])<a href="#Element.asPX" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 436 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L436">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.asPX-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns given attribute of the element as a <code>px</code> value (not %, em, etc.)
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute name</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute value</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">result of query selection</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.use">
+ <header>
+ <h3 class="dr-method">Element.use()<a href="#Element.use" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 451 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L451">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.use-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a <code>&lt;use&gt;</code> element linked to the current element
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the <code>&lt;use&gt;</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.clone">
+ <header>
+ <h3 class="dr-method">Element.clone()<a href="#Element.clone" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 542 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L542">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.clone-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a clone of the element and inserts it after the element
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the clone</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.toDefs">
+ <header>
+ <h3 class="dr-method">Element.toDefs()<a href="#Element.toDefs" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 559 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L559">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.toDefs-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Moves element to the shared <code>&lt;defs&gt;</code> area
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.toPattern">
+ <header>
+ <h3 class="dr-method">Element.toPattern(x, y, width, height)<a href="#Element.toPattern" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 587 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L587">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.toPattern-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a <code>&lt;pattern&gt;</code> element from the current element
+To create a pattern you have to specify the pattern rect:
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the <code>&lt;pattern&gt;</code> element</span>
+ </p>
+
+
+
+
+
+ <p>You can use pattern later on as an argument for <code>fill</code> attribute:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+ fill: "none",
+ stroke: "#bada55",
+ strokeWidth: 5
+ }).pattern(0, 0, 10, 10),
+ c = paper.circle(200, 200, 100);
+c.attr({
+ fill: p
+});</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.marker">
+ <header>
+ <h3 class="dr-method">Element.marker(x, y, width, height, refX, refY)<a href="#Element.marker" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 628 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L628">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.marker-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a <code>&lt;marker&gt;</code> element from the current element
+To create a marker you have to specify the bounding rect and reference point:
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">refX</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">refY</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the <code>&lt;marker&gt;</code> element</span>
+ </p>
+
+
+
+
+
+ <p>You can specify the marker later as an argument for <code>marker-start</code>, <code>marker-end</code>, <code>marker-mid</code>, and <code>marker</code> attributes. The <code>marker</code> attribute places the marker at every point along the path, and <code>marker-mid</code> places them at every point except the start and end.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.animation">
+ <header>
+ <h3 class="dr-method">Snap.animation(attr, duration, [easing], [callback])<a href="#Snap.animation" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 687 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L687">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.animation-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates an animation object
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">attributes of final destination</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">duration</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">duration of the animation, in milliseconds</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">one of easing functions of <a href="#mina" class="dr-link">mina</a> or custom one</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback function that fires when animation ends</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">animation object</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.inAnim">
+ <header>
+ <h3 class="dr-method">Element.inAnim()<a href="#Element.inAnim" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 705 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L705">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.inAnim-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns a set of animations that may be able to manipulate the current element
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">in format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">anim</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description">animation object,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">mina</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description"><a href="#mina" class="dr-link">mina</a> object,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">curStatus</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">0..1 — status of the animation: 0 — just started, 1 — just finished,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">status</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">gets or sets the status of the animation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">stop</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">stops the animation</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.animate">
+ <header>
+ <h3 class="dr-method">Snap.animate(from, to, setter, duration, [easing], [callback])<a href="#Snap.animate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 755 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L755">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.animate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Runs generic animation of one number into another with a caring function
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">from</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">number or array of numbers</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">to</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">number or array of numbers</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">setter</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">caring function that accepts one number argument</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">duration</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">duration, in milliseconds</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">easing function from <a href="#mina" class="dr-link">mina</a> or custom</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback function to execute when animation ends</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">animation object in <a href="#mina" class="dr-link">mina</a> format</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">id</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">animation id, consider it read-only,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">duration</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">gets or sets the duration of the animation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">easing,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">speed</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">gets or sets the speed of the animation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">status</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">gets or sets the status of the animation,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">stop</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">stops the animation</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var rect = Snap().rect(0, 0, 10, 10);
+Snap.animate(0, 10, function (val) {
+ rect.attr({
+ x: val
+ });
+}, 1000);
+// in given context is equivalent to
+rect.animate({x: 10}, 1000);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.stop">
+ <header>
+ <h3 class="dr-method">Element.stop()<a href="#Element.stop" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 773 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L773">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.stop-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Stops all the animations for the current element
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.animate">
+ <header>
+ <h3 class="dr-method">Element.animate(attrs, duration, [easing], [callback])<a href="#Element.animate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 792 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L792">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.animate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Animates the given attributes of the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attrs</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">key-value pairs of destination attributes</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">duration</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">duration of the animation in milliseconds</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">easing function from <a href="#mina" class="dr-link">mina</a> or custom</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback function that executes when the animation ends</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.data">
+ <header>
+ <h3 class="dr-method">Element.data(key, [value])<a href="#Element.data" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 865 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L865">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.data-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds or retrieves given value associated with given key. (Don’t confuse
+with <code>data-</code> attributes)
+</p><p>See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">key</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">key to store data</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-any">any</em> </span>
+ <span class="dr-description">value to store</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+
+ <p>or, if value is not specified:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-any">any</em>
+
+ <span class="dr-description">value</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">for (var i = 0, i < 5, i++) {
+ paper.circle(10 + 15 * i, 10, 10)
+ .attr({fill: "#000"})
+ .data("i", i)
+ .click(function () {
+ alert(this.data("i"));
+ });
+}</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.removeData">
+ <header>
+ <h3 class="dr-method">Element.removeData([key])<a href="#Element.removeData" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 894 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L894">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.removeData-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes value associated with an element by given key.
+If key is not provided, removes all the data of the element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">key</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">key</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.outerSVG">
+ <header>
+ <h3 class="dr-method">Element.outerSVG()<a href="#Element.outerSVG" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 911 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L911">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.outerSVG-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns SVG code for the element, equivalent to HTML&#39;s <code>outerHTML</code>.
+</p><p>See also <a href="#Element.innerSVG" class="dr-link">Element.innerSVG</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">SVG code for the element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.toString">
+ <header>
+ <h3 class="dr-method">Element.toString()<a href="#Element.toString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 917 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L917">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.toString-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>See <a href="#Element.outerSVG" class="dr-link">Element.outerSVG</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.innerSVG">
+ <header>
+ <h3 class="dr-method">Element.innerSVG()<a href="#Element.innerSVG" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 925 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L925">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.innerSVG-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns SVG code for the element&#39;s contents, equivalent to HTML&#39;s <code>innerHTML</code>
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">SVG code for the element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Fragment.select">
+ <header>
+ <h3 class="dr-method">Fragment.select()<a href="#Fragment.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 972 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L972">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Fragment.select-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>See <a href="#Element.select" class="dr-link">Element.select</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Fragment.selectAll">
+ <header>
+ <h3 class="dr-method">Fragment.selectAll()<a href="#Fragment.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 979 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L979">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Fragment.selectAll-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>See <a href="#Element.selectAll" class="dr-link">Element.selectAll</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.add">
+ <header>
+ <h3 class="dr-method">Matrix.add(…)<a href="#Matrix.add" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 60 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L60">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.add-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds the given matrix to existing one
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">a</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">d</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">e</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">f</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">matrix</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.invert">
+ <header>
+ <h3 class="dr-method">Matrix.invert()<a href="#Matrix.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 94 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L94">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.invert-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an inverted version of the matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.clone">
+ <header>
+ <h3 class="dr-method">Matrix.clone()<a href="#Matrix.clone" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 106 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L106">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.clone-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns a copy of the matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.translate">
+ <header>
+ <h3 class="dr-method">Matrix.translate(x, y)<a href="#Matrix.translate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 117 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L117">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.translate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Translate the matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal offset distance</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical offset distance</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.scale">
+ <header>
+ <h3 class="dr-method">Matrix.scale(x, [y], [cx], [cy])<a href="#Matrix.scale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 131 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L131">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.scale-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Scales the matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount to be scaled, with <code>1</code> resulting in no change</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount to scale along the vertical axis. (Otherwise <code>x</code> applies to both axes.)</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">cx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal origin point from which to scale</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">cy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical origin point from which to scale</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>Default cx, cy is the middle point of the element.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.rotate">
+ <header>
+ <h3 class="dr-method">Matrix.rotate(a, x, y)<a href="#Matrix.rotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 147 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L147">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.rotate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Rotates the matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">a</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle of rotation, in degrees</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal origin point from which to rotate</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical origin point from which to rotate</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.x">
+ <header>
+ <h3 class="dr-method">Matrix.x(x, y)<a href="#Matrix.x" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 165 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L165">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.x-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns x coordinate for given point after transformation described by the matrix. See also <a href="#Matrix.y" class="dr-link">Matrix.y</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">x</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.y">
+ <header>
+ <h3 class="dr-method">Matrix.y(x, y)<a href="#Matrix.y" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 177 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L177">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.y-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns y coordinate for given point after transformation described by the matrix. See also <a href="#Matrix.x" class="dr-link">Matrix.x</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">y</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.determinant">
+ <header>
+ <h3 class="dr-method">Matrix.determinant()<a href="#Matrix.determinant" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 204 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L204">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.determinant-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Finds determinant of the given matrix.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">determinant</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.split">
+ <header>
+ <h3 class="dr-method">Matrix.split()<a href="#Matrix.split" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 221 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L221">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.split-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Splits matrix into primitive transformations
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">in format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>
+ <span class="dr-json-key">dx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">translation by x</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">dy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">translation by y</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">scalex</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">scale by x</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">scaley</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">scale by y</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">shear</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">shear</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">rotate</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">rotation in deg</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">isSimple</span>
+ <span class="dr-type"><em class="dr-type-boolean">boolean</em> </span>
+ <span class="dr-json-description">could it be represented via simple transformations</span>
+ </li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Matrix.toTransformString">
+ <header>
+ <h3 class="dr-method">Matrix.toTransformString()<a href="#Matrix.toTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 267 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L267">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Matrix.toTransformString-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns transform string that represents given matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">transform string</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.Matrix">
+ <header>
+ <h3 class="dr-method">Snap.Matrix()<a href="#Snap.Matrix" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 288 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L288">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.Matrix-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Matrix constructor, extend on your own risk.
+To create matrices use <a href="#Snap.matrix" class="dr-link">Snap.matrix</a>.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.matrix">
+ <header>
+ <h3 class="dr-method">Snap.matrix(…)<a href="#Snap.matrix" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 306 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L306">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.matrix-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns a matrix based on the given parameters
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">a</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">d</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">e</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+ <li class="topcoat-list__item"><span class="dr-param">f</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">svgMatrix</span>
+ <span class="dr-type"><em class="dr-type-SVGMatrix">SVGMatrix</em> </span>
+ <span class="dr-description"></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Matrix" class="dr-link">Matrix</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.rect">
+ <header>
+ <h3 class="dr-method">Paper.rect(x, y, width, height, [rx], [ry])<a href="#Paper.rect" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 37 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L37">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.rect-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p></p><p>Draws a rectangle
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate of the top left corner</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate of the top left corner</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">width</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">height</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">rx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal radius for rounded corners, default is 0</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">ry</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical radius for rounded corners, default is rx or 0</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>rect</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">// regular rectangle
+var c = paper.rect(10, 10, 50, 50);
+// rectangle with rounded corners
+var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.circle">
+ <header>
+ <h3 class="dr-method">Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 72 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L72">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.circle-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws a circle
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate of the centre</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate of the centre</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">r</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">radius</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>circle</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c = paper.circle(50, 50, 40);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.image">
+ <header>
+ <h3 class="dr-method">Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 123 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L123">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.image-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Places an image on the surface
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">src</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">URI of the source image</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x offset position</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y offset position</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">width of the image</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">height of the image</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>image</code> element</span>
+ </p>
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">Snap element object with type <code>image</code></span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c = paper.image("apple.png", 10, 10, 80, 80);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.ellipse">
+ <header>
+ <h3 class="dr-method">Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 166 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L166">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.ellipse-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws an ellipse
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate of the centre</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate of the centre</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">rx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal radius</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">ry</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical radius</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>ellipse</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c = paper.ellipse(50, 50, 40, 20);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.path">
+ <header>
+ <h3 class="dr-method">Paper.path([pathString])<a href="#Paper.path" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 211 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L211">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.path-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a <code>&lt;path&gt;</code> element using the given string as the path&#39;s definition
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">pathString</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string in SVG format</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">"M10,20L30,40"</code></pre></section>
+
+
+
+
+
+
+ <p>This example features two commands: <code>M</code>, with arguments <code>(10, 20)</code> and <code>L</code> with arguments <code>(30, 40)</code>. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
+</p><p></p>
+
+
+
+
+
+
+
+
+
+
+
+ <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
+
+
+
+
+
+
+
+
+
+
+
+ <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
+
+
+
+
+
+
+
+
+
+
+
+ <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
+
+
+
+
+
+
+
+
+
+ <p><li><em>Catmull-Rom curveto</em> is a not standard SVG command and added to make life easier.</li>
+Note: there is a special case when a path consists of only three commands: <code>M10,10R…z</code>. In this case the path connects back to its starting point.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c = paper.path("M10 10L90 90");
+// draw a diagonal line:
+// move to 10,10, line to 90,90</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.g">
+ <header>
+ <h3 class="dr-method">Paper.g([varargs])<a href="#Paper.g" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 239 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L239">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.g-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a group element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">varargs</span>
+ <span class="dr-type"><em class="dr-type-…">…</em> </span>
+ <span class="dr-description">elements to nest within the group</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>g</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c1 = paper.circle(),
+ c2 = paper.rect(),
+ g = paper.g(c2, c1); // note that the order of elements is different</code></pre></section>
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var c1 = paper.circle(),
+ c2 = paper.rect(),
+ g = paper.g();
+g.add(c2, c1);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.group">
+ <header>
+ <h3 class="dr-method">Paper.group()<a href="#Paper.group" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 245 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L245">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.group-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>See <a href="#Paper.g" class="dr-link">Paper.g</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.svg">
+ <header>
+ <h3 class="dr-method">Paper.svg(x, y, width, height, vbx, vby, vbw, vbh)<a href="#Paper.svg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 272 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L272">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.svg-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a nested SVG element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> X of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> Y of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> width of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> height of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox X</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vby</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox Y</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbw</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox width</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbh</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox height</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>svg</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.mask">
+ <header>
+ <h3 class="dr-method">Paper.mask()<a href="#Paper.mask" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 304 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L304">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.mask-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent in behaviour to <a href="#Paper.g" class="dr-link">Paper.g</a>, except it’s a mask.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>mask</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.ptrn">
+ <header>
+ <h3 class="dr-method">Paper.ptrn(x, y, width, height, vbx, vby, vbw, vbh)<a href="#Paper.ptrn" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 331 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L331">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.ptrn-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Equivalent in behaviour to <a href="#Paper.g" class="dr-link">Paper.g</a>, except it’s a pattern.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> X of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> Y of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">width</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> width of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">height</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> height of the element</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox X</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vby</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox Y</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbw</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox width</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbh</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox height</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>pattern</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.use">
+ <header>
+ <h3 class="dr-method">Paper.use(…)<a href="#Paper.use" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 368 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L368">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.use-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a &lt;use&gt; element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">id</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> id of element to link</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">id</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> element to link</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>use</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.symbol">
+ <header>
+ <h3 class="dr-method">Paper.symbol(vbx, vby, vbw, vbh)<a href="#Paper.symbol" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 396 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L396">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.symbol-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a &lt;symbol&gt; element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">vbx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox X</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vby</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox Y</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbw</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox width</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">vbh</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><a href="#optional" class="dr-link">optional</a> viewbox height</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>symbol</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.text">
+ <header>
+ <h3 class="dr-method">Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 424 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L424">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.text-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws a text string
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate position</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate position</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">text</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">The text string to draw or array of strings to nest within separate <code>&lt;tspan&gt;</code> elements</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>text</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var t1 = paper.text(50, 50, "Snap");
+var t2 = paper.text(50, 50, ["S","n","a","p"]);
+// Text path usage
+t1.attr({textpath: "M10,10L100,100"});
+// or
+var pth = paper.path("M10,10L100,100");
+t1.attr({textpath: pth});</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.line">
+ <header>
+ <h3 class="dr-method">Paper.line(x1, y1, x2, y2)<a href="#Paper.line" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 452 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L452">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.line-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws a line
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate position of the start</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y1</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate position of the start</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x coordinate position of the end</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y2</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y coordinate position of the end</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>line</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var t1 = paper.line(50, 50, 100, 100);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.polyline">
+ <header>
+ <h3 class="dr-method">Paper.polyline(…)<a href="#Paper.polyline" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 481 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L481">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.polyline-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws a polyline
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">points</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-description">array of points</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">varargs</span>
+ <span class="dr-type"><em class="dr-type-…">…</em> </span>
+ <span class="dr-description">points</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>polyline</code> element</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var p1 = paper.polyline([10, 10, 100, 100]);
+var p2 = paper.polyline(10, 10, 100, 100);</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.polygon">
+ <header>
+ <h3 class="dr-method">Paper.polygon()<a href="#Paper.polygon" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 499 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L499">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.polygon-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Draws a polygon. See <a href="#Paper.polyline" class="dr-link">Paper.polyline</a>
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.gradient">
+ <header>
+ <h3 class="dr-method">Paper.gradient(gradient)<a href="#Paper.gradient" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 659 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L659">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.gradient-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a gradient element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">gradient</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">gradient descriptor</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Gradient Descriptor</h3>
+
+
+
+
+
+
+
+ <p>The gradient descriptor is an expression formatted as
+follows: <code>&lt;type&gt;(&lt;coords&gt;)&lt;colors&gt;</code>. The <code>&lt;type&gt;</code> can be
+either linear or radial. The uppercase <code>L</code> or <code>R</code> letters
+indicate absolute coordinates offset from the SVG surface.
+Lowercase <code>l</code> or <code>r</code> letters indicate coordinates
+calculated relative to the element to which the gradient is
+applied. Coordinates specify a linear gradient vector as
+<code>x1</code>, <code>y1</code>, <code>x2</code>, <code>y2</code>, or a radial gradient as <code>cx</code>, <code>cy</code>,
+<code>r</code> and optional <code>fx</code>, <code>fy</code> specifying a focal point away
+from the center of the circle. Specify <code>&lt;colors&gt;</code> as a list
+of dash-separated CSS color values. Each color may be
+followed by a custom offset value, separated with a colon
+character.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Examples</h3>
+
+
+
+
+
+
+
+ <p>Linear gradient, relative from top-left corner to bottom-right
+corner, from black through red to white:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");</code></pre></section>
+
+
+
+
+
+
+ <p>Linear gradient, absolute from (0, 0) to (100, 100), from black
+through red at 25% to white:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");</code></pre></section>
+
+
+
+
+
+
+ <p>Radial gradient, relative from the center of the element with radius
+half the width, from black to white:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");</code></pre></section>
+
+
+
+
+
+
+ <p>To apply the gradient:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">paper.circle(50, 50, 40).attr({
+ fill: g
+});</code></pre></section>
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">the <code>gradient</code> element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.toString">
+ <header>
+ <h3 class="dr-method">Paper.toString()<a href="#Paper.toString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 675 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L675">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.toString-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns SVG code for the <a href="#Paper" class="dr-link">Paper</a>
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">SVG code for the <a href="#Paper" class="dr-link">Paper</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.toDataURL">
+ <header>
+ <h3 class="dr-method">Paper.toDataURL()<a href="#Paper.toDataURL" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 695 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L695">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.toDataURL-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns SVG code for the <a href="#Paper" class="dr-link">Paper</a> as Data URI string.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">Data URI string</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.clear">
+ <header>
+ <h3 class="dr-method">Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 706 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L706">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.clear-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes all child nodes of the paper, except &lt;defs&gt;.
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.addClass">
+ <header>
+ <h3 class="dr-method">Element.addClass(value)<a href="#Element.addClass" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 29 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L29">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.addClass-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds given class name or list of class names to the element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">class name or space separated list of class names</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">original element.</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.removeClass">
+ <header>
+ <h3 class="dr-method">Element.removeClass(value)<a href="#Element.removeClass" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 64 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L64">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.removeClass-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes given class name or list of class names from the element.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">class name or space separated list of class names</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">original element.</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.hasClass">
+ <header>
+ <h3 class="dr-method">Element.hasClass(value)<a href="#Element.hasClass" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 98 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L98">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.hasClass-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Checks if the element has a given class name in the list of class names applied to it.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">class name</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if the element has given class</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.toggleClass">
+ <header>
+ <h3 class="dr-method">Element.toggleClass(value, flag)<a href="#Element.toggleClass" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 115 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L115">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.toggleClass-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Add or remove one or more classes from the element, depending on either
+the class’s presence or the value of the <code>flag</code> argument.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">value</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">class name or space separated list of class names</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">flag</span>
+ <span class="dr-type"><em class="dr-type-boolean">boolean</em> </span>
+ <span class="dr-description">value to determine whether the class should be added or removed</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">original element.</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina">
+ <header>
+ <h3 class="dr-method">mina(a, A, b, B, get, set, [easing])<a href="#mina" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 168 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L168">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Generic animation of numbers
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">a</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">start <em>slave</em> number</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">A</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">end <em>slave</em> number</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">start <em>master</em> number (start time in general case)</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">B</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">end <em>master</em> number (end time in gereal case)</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">get</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">getter of <em>master</em> number (see <a href="#mina.time" class="dr-link">mina.time</a>)</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">set</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">setter of <em>slave</em> number</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">easing function, default is <a href="#mina.linear" class="dr-link">mina.linear</a></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">animation descriptor</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">id</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-json-description">animation id,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">start</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">start <em>slave</em> number,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">end</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">end <em>slave</em> number,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">b</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">start <em>master</em> number,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">s</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">animation status (0..1),</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">dur</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">animation duration,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">spd</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">animation speed,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">get</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">getter of <em>master</em> number (see <a href="#mina.time" class="dr-link">mina.time</a>),</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">set</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">setter of <em>slave</em> number,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">easing function, default is <a href="#mina.linear" class="dr-link">mina.linear</a>,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">status</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">status getter/setter,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">speed</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">speed getter/setter,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">duration</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">duration getter/setter,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">stop</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">animation stopper</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">pause</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">pauses the animation</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">resume</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">resumes the animation</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">update</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-json-description">calles setter with the right value of the animation</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.time">
+ <header>
+ <h3 class="dr-method">mina.time()<a href="#mina.time" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 208 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L208">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.time-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the current time. Equivalent to:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">function () {
+ return (new Date).getTime();
+}</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.getById">
+ <header>
+ <h3 class="dr-method">mina.getById(id)<a href="#mina.getById" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 217 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L217">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.getById-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an animation by its id
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">id</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">animation&#39;s id</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">See <a href="#mina" class="dr-link">mina</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.linear">
+ <header>
+ <h3 class="dr-method">mina.linear(n)<a href="#mina.linear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 229 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L229">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.linear-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Default linear easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.easeout">
+ <header>
+ <h3 class="dr-method">mina.easeout(n)<a href="#mina.easeout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 240 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L240">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.easeout-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Easeout easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.easein">
+ <header>
+ <h3 class="dr-method">mina.easein(n)<a href="#mina.easein" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 251 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L251">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.easein-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Easein easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.easeinout">
+ <header>
+ <h3 class="dr-method">mina.easeinout(n)<a href="#mina.easeinout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 262 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L262">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.easeinout-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Easeinout easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.backin">
+ <header>
+ <h3 class="dr-method">mina.backin(n)<a href="#mina.backin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 286 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L286">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.backin-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Backin easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.backout">
+ <header>
+ <h3 class="dr-method">mina.backout(n)<a href="#mina.backout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 301 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L301">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.backout-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Backout easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.elastic">
+ <header>
+ <h3 class="dr-method">mina.elastic(n)<a href="#mina.elastic" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 317 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L317">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.elastic-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Elastic easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="mina.bounce">
+ <header>
+ <h3 class="dr-method">mina.bounce(n)<a href="#mina.bounce" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 332 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L332">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="mina.bounce-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Bounce easing
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">n</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">input 0..1</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">output 0..1</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Paper.filter">
+ <header>
+ <h3 class="dr-method">Paper.filter(filstr)<a href="#Paper.filter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 36 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L36">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Paper.filter-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Creates a <code>&lt;filter&gt;</code> element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">filstr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">SVG fragment of filter provided as a string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+
+ <p>Note: It is recommended to use filters embedded into the page inside an empty SVG element.
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
+ c = paper.circle(10, 10, 10).attr({
+ filter: f
+ });</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.blur">
+ <header>
+ <h3 class="dr-method">Snap.filter.blur(x, [y])<a href="#Snap.filter.blur" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 95 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L95">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.blur-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the blur filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of horizontal blur, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of vertical blur, in pixels</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.blur(5, 10)),
+ c = paper.circle(10, 10, 10).attr({
+ filter: f
+ });</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.shadow">
+ <header>
+ <h3 class="dr-method">Snap.filter.shadow(…)<a href="#Snap.filter.shadow" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 134 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L134">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.shadow-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the shadow filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">dx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">dy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">blur</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of blur</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">color</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">color of the shadow</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">opacity</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><code>0..1</code> opacity of the shadow</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">dx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">dy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">color</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">color of the shadow</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">opacity</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><code>0..1</code> opacity of the shadow</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>which makes blur default to <code>4</code>. Or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">dx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">horizontal shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">dy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">vertical shift of the shadow, in pixels</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">opacity</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description"><code>0..1</code> opacity of the shadow</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
+ c = paper.circle(10, 10, 10).attr({
+ filter: f
+ });</code></pre></section>
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.grayscale">
+ <header>
+ <h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 179 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L179">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.grayscale-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the grayscale filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.sepia">
+ <header>
+ <h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 206 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L206">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.sepia-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the sepia filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.saturate">
+ <header>
+ <h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 234 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L234">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.saturate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the saturate filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.hueRotate">
+ <header>
+ <h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 254 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L254">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.hueRotate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the hue-rotate filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">angle</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">angle of rotation</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.invert">
+ <header>
+ <h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 272 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L272">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.invert-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the invert filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.brightness">
+ <header>
+ <h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 294 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L294">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.brightness-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the brightness filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.filter.contrast">
+ <header>
+ <h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 314 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L314">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.filter.contrast-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns an SVG markup string for the contrast filter
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">amount</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">amount of filter (<code>0..1</code>)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">filter representation</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.click">
+ <header>
+ <h3 class="dr-method">Element.click(handler)<a href="#Element.click" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 143 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L143">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.click-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a click event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unclick">
+ <header>
+ <h3 class="dr-method">Element.unclick(handler)<a href="#Element.unclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 151 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L151">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unclick-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a click event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.dblclick">
+ <header>
+ <h3 class="dr-method">Element.dblclick(handler)<a href="#Element.dblclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 160 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L160">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.dblclick-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a double click event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.undblclick">
+ <header>
+ <h3 class="dr-method">Element.undblclick(handler)<a href="#Element.undblclick" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 168 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L168">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.undblclick-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a double click event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.mousedown">
+ <header>
+ <h3 class="dr-method">Element.mousedown(handler)<a href="#Element.mousedown" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 177 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L177">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.mousedown-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a mousedown event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unmousedown">
+ <header>
+ <h3 class="dr-method">Element.unmousedown(handler)<a href="#Element.unmousedown" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 185 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L185">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unmousedown-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a mousedown event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.mousemove">
+ <header>
+ <h3 class="dr-method">Element.mousemove(handler)<a href="#Element.mousemove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 194 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L194">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.mousemove-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a mousemove event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unmousemove">
+ <header>
+ <h3 class="dr-method">Element.unmousemove(handler)<a href="#Element.unmousemove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 202 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L202">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unmousemove-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a mousemove event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.mouseout">
+ <header>
+ <h3 class="dr-method">Element.mouseout(handler)<a href="#Element.mouseout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 211 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L211">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.mouseout-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a mouseout event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unmouseout">
+ <header>
+ <h3 class="dr-method">Element.unmouseout(handler)<a href="#Element.unmouseout" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 219 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L219">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unmouseout-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a mouseout event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.mouseover">
+ <header>
+ <h3 class="dr-method">Element.mouseover(handler)<a href="#Element.mouseover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 228 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L228">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.mouseover-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a mouseover event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unmouseover">
+ <header>
+ <h3 class="dr-method">Element.unmouseover(handler)<a href="#Element.unmouseover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 236 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L236">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unmouseover-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a mouseover event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.mouseup">
+ <header>
+ <h3 class="dr-method">Element.mouseup(handler)<a href="#Element.mouseup" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 245 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L245">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.mouseup-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a mouseup event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unmouseup">
+ <header>
+ <h3 class="dr-method">Element.unmouseup(handler)<a href="#Element.unmouseup" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 253 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L253">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unmouseup-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a mouseup event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.touchstart">
+ <header>
+ <h3 class="dr-method">Element.touchstart(handler)<a href="#Element.touchstart" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 262 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L262">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.touchstart-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a touchstart event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.untouchstart">
+ <header>
+ <h3 class="dr-method">Element.untouchstart(handler)<a href="#Element.untouchstart" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 270 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L270">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.untouchstart-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a touchstart event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.touchmove">
+ <header>
+ <h3 class="dr-method">Element.touchmove(handler)<a href="#Element.touchmove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 279 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L279">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.touchmove-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a touchmove event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.untouchmove">
+ <header>
+ <h3 class="dr-method">Element.untouchmove(handler)<a href="#Element.untouchmove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 287 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L287">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.untouchmove-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a touchmove event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.touchend">
+ <header>
+ <h3 class="dr-method">Element.touchend(handler)<a href="#Element.touchend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 296 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L296">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.touchend-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a touchend event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.untouchend">
+ <header>
+ <h3 class="dr-method">Element.untouchend(handler)<a href="#Element.untouchend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 304 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L304">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.untouchend-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a touchend event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.touchcancel">
+ <header>
+ <h3 class="dr-method">Element.touchcancel(handler)<a href="#Element.touchcancel" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 313 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L313">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.touchcancel-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds a touchcancel event handler to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.untouchcancel">
+ <header>
+ <h3 class="dr-method">Element.untouchcancel(handler)<a href="#Element.untouchcancel" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 321 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L321">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.untouchcancel-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes a touchcancel event handler from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">handler</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for the event</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.hover">
+ <header>
+ <h3 class="dr-method">Element.hover(f_in, f_out, [icontext], [ocontext])<a href="#Element.hover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 366 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L366">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.hover-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds hover event handlers to the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">f_in</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for hover in</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">f_out</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for hover out</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">icontext</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context for hover in handler</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">ocontext</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context for hover out handler</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.unhover">
+ <header>
+ <h3 class="dr-method">Element.unhover(f_in, f_out)<a href="#Element.unhover" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 378 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L378">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.unhover-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes hover event handlers from the element
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">f_in</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for hover in</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">f_out</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for hover out</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.drag">
+ <header>
+ <h3 class="dr-method">Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])<a href="#Element.drag" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 416 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L416">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.drag-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds event handlers for an element&#39;s drag gesture
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">onmove</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for moving</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">onstart</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for drag start</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">onend</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">handler for drag end</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">mcontext</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context for moving handler</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">scontext</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context for drag start handler</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">econtext</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context for drag end handler</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>Additionaly following <code>drag</code> events are triggered: <code>drag.start.&lt;id&gt;</code> on start,
+<code>drag.end.&lt;id&gt;</code> on end and <code>drag.move.&lt;id&gt;</code> on every move. When element is dragged over another element
+<code>drag.over.&lt;id&gt;</code> fires as well.
+</p><p>Start event and start handler are called in specified context or in context of the element with following parameters:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>
+ <span class="dr-json-key">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x position of the mouse</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y position of the mouse</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">event</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description">DOM event object</span>
+ </li>
+
+
+ </ol>
+
+
+
+ <p>Move event and move handler are called in specified context or in context of the element with following parameters:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>
+ <span class="dr-json-key">dx</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">shift by x from the start point</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">dy</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">shift by y from the start point</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x position of the mouse</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y position of the mouse</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">event</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description">DOM event object</span>
+ </li>
+
+
+ </ol>
+
+
+
+ <p>End event and end handler are called in specified context or in context of the element with following parameters:
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>
+ <span class="dr-json-key">event</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-json-description">DOM event object</span>
+ </li>
+
+
+ </ol>
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.undrag">
+ <header>
+ <h3 class="dr-method">Element.undrag()<a href="#Element.undrag" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 465 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L465">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.undrag-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes all drag event handlers from the given element
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.getTotalLength">
+ <header>
+ <h3 class="dr-method">Snap.path.getTotalLength(path)<a href="#Snap.path.getTotalLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1127 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1127">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.getTotalLength-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the length of the given path in pixels
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">SVG path string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">length</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.getPointAtLength">
+ <header>
+ <h3 class="dr-method">Snap.path.getPointAtLength(path, length)<a href="#Snap.path.getPointAtLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1144 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1144">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.getPointAtLength-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the coordinates of the point located at the given length along the given path
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">SVG path string</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">length</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path, excluding non-rendering jumps</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">representation of the point:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">alpha:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">angle of derivative</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.getSubpath">
+ <header>
+ <h3 class="dr-method">Snap.path.getSubpath(path, from, to)<a href="#Snap.path.getSubpath" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1157 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1157">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.getSubpath-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the subpath of a given path between given start and end lengths
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">SVG path string</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">from</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path to the start of the segment</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">to</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path to the end of the segment</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">path string definition for the segment</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.getTotalLength">
+ <header>
+ <h3 class="dr-method">Element.getTotalLength()<a href="#Element.getTotalLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1171 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1171">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.getTotalLength-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns the length of the path in pixels (only works for <code>path</code> elements)
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-number">number</em>
+
+ <span class="dr-description">length</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.getPointAtLength">
+ <header>
+ <h3 class="dr-method">Element.getPointAtLength(length)<a href="#Element.getPointAtLength" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1192 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1192">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.getPointAtLength-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns coordinates of the point located at the given length on the given path (only works for <code>path</code> elements)
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">length</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path, excluding non-rendering jumps</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">representation of the point:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">alpha:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">angle of derivative</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Element.getSubpath">
+ <header>
+ <h3 class="dr-method">Element.getSubpath(from, to)<a href="#Element.getSubpath" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1207 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1207">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Element.getSubpath-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Returns subpath of a given element from given start and end lengths (only works for <code>path</code> elements)
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">from</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path to the start of the segment</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">to</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">length, in pixels, from the start of the path to the end of the segment</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">path string definition for the segment</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.findDotsAtSegment">
+ <header>
+ <h3 class="dr-method">Snap.path.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)<a href="#Snap.path.findDotsAtSegment" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1250 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1250">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.findDotsAtSegment-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Finds dot coordinates on the given cubic beziér curve at the given t
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">p1x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the first point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p1y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the first point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c1x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the first anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c1y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the first anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c2x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the second anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c2y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the second anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p2x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the second point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p2y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the second point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">t</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">position on the curve (0..1)</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">point information in format:</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the point,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the point,</span>
+ </li>
+
+
+
+ <li> m: {<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the left anchor,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the left anchor</span>
+ </li>
+
+
+
+ </ol></li><li> },</li>
+
+
+
+ <li> n: {<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the right anchor,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the right anchor</span>
+ </li>
+
+
+
+ </ol></li><li> },</li>
+
+
+
+ <li> start: {<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the start of the curve,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the start of the curve</span>
+ </li>
+
+
+
+ </ol></li><li> },</li>
+
+
+
+ <li> end: {<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the end of the curve,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the end of the curve</span>
+ </li>
+
+
+
+ </ol></li><li> },</li>
+
+
+
+ <li>
+ <span class="dr-json-key">alpha:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">angle of the curve derivative at the point</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.bezierBBox">
+ <header>
+ <h3 class="dr-method">Snap.path.bezierBBox(…)<a href="#Snap.path.bezierBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1278 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1278">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.bezierBBox-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns the bounding box of a given cubic beziér curve
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">p1x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the first point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p1y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the first point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c1x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the first anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c1y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the first anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c2x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the second anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">c2y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the second anchor of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p2x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the second point of the curve</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">p2y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the second point of the curve</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">bez</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-description">array of six points for beziér curve</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">bounding box</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the left top point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the left top point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">x2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the right bottom point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the right bottom point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">width:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">width of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">height:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">height of the box</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.isPointInsideBBox">
+ <header>
+ <h3 class="dr-method">Snap.path.isPointInsideBBox(bbox, x, y)<a href="#Snap.path.isPointInsideBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1291 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1291">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.isPointInsideBBox-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns <code>true</code> if given point is inside bounding box
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">bbox</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">bounding box</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">x coordinate of the point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">y coordinate of the point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if point is inside</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.isBBoxIntersect">
+ <header>
+ <h3 class="dr-method">Snap.path.isBBoxIntersect(bbox1, bbox2)<a href="#Snap.path.isBBoxIntersect" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1348 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1348">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.isBBoxIntersect-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns <code>true</code> if two bounding boxes intersect
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">bbox1</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">first bounding box</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">bbox2</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">second bounding box</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if bounding boxes intersect</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.intersection">
+ <header>
+ <h3 class="dr-method">Snap.path.intersection(path1, path2)<a href="#Snap.path.intersection" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1372 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1372">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.intersection-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Finds intersections of two paths
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path1</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">path2</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">dots of intersection</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>[</li>
+
+
+
+ <li> {<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the point,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the point,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">t1:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">t value for segment of path1,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">t2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">t value for segment of path2,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">segment1:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">order number for segment of path1,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">segment2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">order number for segment of path2,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">bez1:</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-json-description">eight coordinates representing beziér curve for the segment of path1,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">bez2:</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-json-description">eight coordinates representing beziér curve for the segment of path2</span>
+ </li>
+
+
+
+ </ol></li><li> }</li>
+
+
+
+ <li>]</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.isPointInside">
+ <header>
+ <h3 class="dr-method">Snap.path.isPointInside(path, x, y)<a href="#Snap.path.isPointInside" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1388 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1388">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.isPointInside-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns <code>true</code> if given point is inside a given closed path.
+</p><p>Note: fill mode doesn’t affect the result of this method.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">x</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">x of the point</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">y</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">y of the point</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if point is inside the path</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.getBBox">
+ <header>
+ <h3 class="dr-method">Snap.path.getBBox(path)<a href="#Snap.path.getBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1407 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1407">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.getBBox-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Returns the bounding box of a given path
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">bounding box</span>
+ </p>
+
+
+
+
+
+
+
+
+
+
+
+ <ol class="dr-json">
+
+
+ <li>{<ol class="dr-json">
+
+
+
+ <li>
+ <span class="dr-json-key">x:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the left top point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the left top point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">x2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">x coordinate of the right bottom point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">y2:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">y coordinate of the right bottom point of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">width:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">width of the box,</span>
+ </li>
+
+
+
+ <li>
+ <span class="dr-json-key">height:</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-json-description">height of the box</span>
+ </li>
+
+
+
+ </ol></li><li>}</li>
+
+
+ </ol>
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.toRelative">
+ <header>
+ <h3 class="dr-method">Snap.path.toRelative(path)<a href="#Snap.path.toRelative" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1419 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1419">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.toRelative-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Converts path coordinates into relative values
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">path string</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.toAbsolute">
+ <header>
+ <h3 class="dr-method">Snap.path.toAbsolute(path)<a href="#Snap.path.toAbsolute" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1430 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1430">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.toAbsolute-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Converts path coordinates into absolute values
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">path string</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.toCubic">
+ <header>
+ <h3 class="dr-method">Snap.path.toCubic(pathString)<a href="#Snap.path.toCubic" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1441 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1441">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.toCubic-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Utility method
+Converts path to a new path where all segments are cubic beziér curves
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">pathString</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> <em class="dr-type-array">array</em> </span>
+ <span class="dr-description">path string or array of segments</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-array">array</em>
+
+ <span class="dr-description">array of segments</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Snap.path.map">
+ <header>
+ <h3 class="dr-method">Snap.path.map(path, matrix)<a href="#Snap.path.map" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1451 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1451">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Snap.path.map-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Transform the path string with the given matrix
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">path</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">path string</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">matrix</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">see <a href="#Matrix" class="dr-link">Matrix</a></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-string">string</em>
+
+ <span class="dr-description">transformed path string</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.push">
+ <header>
+ <h3 class="dr-method">Set.push()<a href="#Set.push" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 41 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L41">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.push-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Adds each argument to the current set
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">original element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.pop">
+ <header>
+ <h3 class="dr-method">Set.pop()<a href="#Set.pop" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 61 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L61">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.pop-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes last element and returns it
+</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.forEach">
+ <header>
+ <h3 class="dr-method">Set.forEach(callback, thisArg)<a href="#Set.forEach" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 77 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L77">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.forEach-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Executes given function for each element in the set
+</p><p>If the function returns <code>false</code>, the loop stops running.
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">function to run</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">thisArg</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">context object for the callback</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">Set object</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.animate">
+ <header>
+ <h3 class="dr-method">Set.animate(…)<a href="#Set.animate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 106 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L106">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.animate-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Animates each element in set in sync.
+</p><p></p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attrs</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">key-value pairs of destination attributes</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">duration</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">duration of the animation in milliseconds</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">easing</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">easing function from <a href="#mina" class="dr-link">mina</a> or custom</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">callback function that executes when the animation ends</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">animation</span>
+ <span class="dr-type"><em class="dr-type-array">array</em> </span>
+ <span class="dr-description">array of animation parameter for each element in set in format <code>[attrs, duration, easing, callback]</code></span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+ <h3>Usage</h3>
+
+
+
+
+
+
+
+
+
+
+
+ <section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">// animate all elements in set to radius 10
+set.animate({r: 10}, 500, mina.easein);
+// or
+// animate first element to radius 10, but second to radius 20 and in different time
+set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);</code></pre></section>
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-Element">Element</em>
+
+ <span class="dr-description">the current element</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.bind">
+ <header>
+ <h3 class="dr-method">Set.bind(…)<a href="#Set.bind" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 170 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L170">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.bind-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Specifies how to handle a specific attribute when applied
+to a set.
+</p><p></p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute name</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">callback</span>
+ <span class="dr-type"><em class="dr-type-function">function</em> </span>
+ <span class="dr-description">function to run</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute name</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">element</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">specific element in the set to apply the attribute to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+ <p>or
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">attr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute name</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">element</span>
+ <span class="dr-type"><em class="dr-type-Element">Element</em> </span>
+ <span class="dr-description">specific element in the set to apply the attribute to</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">eattr</span>
+ <span class="dr-type"><em class="dr-type-string">string</em> </span>
+ <span class="dr-description">attribute on the element to bind the attribute to</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">Set object</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.clear">
+ <header>
+ <h3 class="dr-method">Set.clear()<a href="#Set.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 203 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L203">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.clear-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes all elements from the set
+</p>
+
+
+
+
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.splice">
+ <header>
+ <h3 class="dr-method">Set.splice(index, count, [insertion…])<a href="#Set.splice" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 219 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L219">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.splice-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes range of elements from the set
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">index</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">position of the deletion</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">count</span>
+ <span class="dr-type"><em class="dr-type-number">number</em> </span>
+ <span class="dr-description">number of element to remove</span></li>
+ <li class="topcoat-list__item"><span class="dr-param">insertion…</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">elements to insert</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-object">object</em>
+
+ <span class="dr-description">set elements that were deleted</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ <article id="Set.exclude">
+ <header>
+ <h3 class="dr-method">Set.exclude(element)<a href="#Set.exclude" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 254 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L254">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="Set.exclude-extra"></div>
+ <div class="dr-method">
+
+
+
+
+ <p>Removes given element from the set
+</p>
+
+
+
+
+
+
+
+
+
+
+ <div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ <li class="topcoat-list__item"><span class="dr-param">element</span>
+ <span class="dr-type"><em class="dr-type-object">object</em> </span>
+ <span class="dr-description">element to remove</span></li>
+
+ </ol>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+
+ <em class="dr-type-boolean">boolean</em>
+
+ <span class="dr-description"><code>true</code> if object was found and removed from the set</span>
+ </p>
+
+
+
+
+ </div>
+ </section>
+ </article>
+
+ </div>
+ <footer></footer>
+ </div>
+ </div>
+ <!-- <script src="//use.edgefonts.net/source-sans-pro:n3,n4,n6;source-code-pro:n3.js"></script> -->
+ <script src="/assets/docs/js/prism.js"></script>
+<script>!function(e){if(e){for(var t=function(e,t){var n=t.toUpperCase().split(""),r=n.shift(),a=RegExp("^["+r.toLowerCase()+r+"][a-z]*"+n.join("[a-z]*")+"[a-z]*$")
+return!!(e+"").match(a)},n=function(e,n){e+="",n+=""
+var r,a=0
+if(e==n)return 1
+if(!e||!n)return 0
+if(t(e,n))return.9
+a=0,r=e.toLowerCase()
+for(var i,o=0,l=n.length;l>o;o++)i=r.indexOf(n.charAt(o)),~i&&(r=r.substring(i+1),a+=1/(i+1))
+return a=Math.max(a/l-Math.abs(e.length-l)/e.length/2,0)},r=e.getElementsByTagName("span"),a=[],i=/[^\.\(]*(?=(\(\))?$)/,o=0,l=r.length;l>o;o++)a[o]={li:r[o].parentNode.parentNode,text:r[o].innerHTML.match(i)[0]}
+var h=document.getElementById("dr-filter"),f=function(e,t){return t.weight-e.weight}
+h.onclick=h.onchange=h.onkeydown=h.onkeyup=function(){var t=h.value,r=[]
+if(t.length>1){for(var i=0,o=a.length;o>i;i++)r[i]={li:a[i].li,weight:n(a[i].text,t)}
+r.sort(f)}else r=a
+for(i=0,o=r.length;o>i;i++)e.appendChild(r[i].li)}}}(document.getElementById("dr-toc"))</script>
+</body></html>
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dr.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dr.json
new file mode 100644
index 0000000..da75abb
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/dr.json
@@ -0,0 +1,39 @@
+{
+ "title": "Snap.svg",
+ "output": "doc/reference.html",
+ "template": "template.dot",
+ "files": [{
+ "url": "src/svg.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js"
+ }, {
+ "url": "src/element.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/element.js"
+ }, {
+ "url": "src/matrix.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/matrix.js"
+ }, {
+ "url": "src/paper.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/paper.js"
+ }, {
+ "url": "src/class.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/class.js"
+ }, {
+ "url": "src/equal.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/equal.js"
+ }, {
+ "url": "src/mina.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/mina.js"
+ }, {
+ "url": "src/filter.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/filter.js"
+ }, {
+ "url": "src/mouse.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/mouse.js"
+ }, {
+ "url": "src/path.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js"
+ }, {
+ "url": "src/set.js",
+ "link": "https://github.com/adobe-webplatform/Snap.svg/blob/master/src/set.js"
+ }]
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/history.md b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/history.md
new file mode 100644
index 0000000..51c18ea
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/history.md
@@ -0,0 +1,49 @@
+#0.4.1
+
+* Bug fixes.
+
+#0.4.0
+
+* Moved class and element related code into separate plugins
+* Added `Element.align()` and `Element.getAlign()` methods
+* Added animation support for `viewBox`
+* Added support for `<symbol>`
+* Added method `Paper.toDataURL()`
+* Added method `Snap.closest()`
+* Added methods to work with degrees instead of radians: `Snap.sin()`, `Snap.cos()`, `Snap.tan()`, `Snap.asin()`, `Snap.acos()`, `Snap.atan()` and `Snap.atan2()`
+* Added methods `Snap.len()`, `Snap.len2()` and `Snap.closestPoint()`
+* Added methods `Element.children()` and `Element.toJSON()`
+* Various bug fixes
+
+#0.3.0
+
+* Added `.addClass()`, `.removeClass()`, `.toggleClass()` and `.hasClass()` APIs
+* Added `Paper.mask()`, `Paper.ptrn()`, `Paper.use()`, `Paper.svg()`
+* Mask & pattern elements are sharing paper methods (just like group)
+* Added `Set.bind()` method
+* Added syncronisation for `Set.animate()`
+* Added opacity to the shadow filter
+* Added ability to specify attributes as `"+=10"` or `"-=1em"` or `"*=2"`
+* Fix negative scale
+* Fix for `path2curve`
+* Fixed shared `<defs>` issue
+* Various bug fixes
+
+#0.2.0
+
+* Added support for text path
+* Added `getBBox` method to the paper object
+* Added `Element.appendTo()` and `Element.prependTo()`
+* Added `getElementByPoint()`
+* Added `Set.remove()` method
+* Get rid of internal SVG parser in favor of the browser
+* Fix for `xlink:href` setting for images
+* Fix `Element.animate()`
+* Fix for animate and stroke-dashoffset
+* Absolute transforms fix
+* Fix for animation of SVG transformations, matrices and polygon points
+* Various bug fixes
+
+#0.1.0
+
+* Initial release \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/package.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/package.json
new file mode 100644
index 0000000..d3794c4
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "snapsvg",
+ "version": "0.4.1",
+ "description": "JavaScript Vector Library",
+ "main": "./dist/snap.svg.js",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:adobe-webplatform/Snap.svg.git"
+ },
+ "author": "Dmitry Baranovskiy",
+ "license": "Apache License v2",
+ "dependencies": {
+ "eve": "~0.4.2"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.1",
+ "grunt-contrib-uglify": "~0.2.0",
+ "grunt-contrib-concat": "~0.3.0",
+ "grunt-exec": "~0.4.2",
+ "mocha": "*",
+ "expect.js": "*",
+ "dr.js": "~0.1.0"
+ }
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/template.dot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/template.dot
new file mode 100644
index 0000000..f92c011
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/template.dot
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <base href="http://snapsvg.io/docs/">
+ <title>Snap.svg API Reference</title>
+ <link rel="shortcut icon" href="/assets/favicon.ico?v=1">
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <link rel="stylesheet" href="/assets/docs/fonts/stylesheet.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/topcoat-desktop-light.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/main.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/dr.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/docs/css/prism.css?v=201311041519">
+ <link rel="stylesheet" href="/assets/style/docs-header.css?v=201311041519">
+ <script>
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-44948757-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ function trackOutboundLink(link, category, action) {
+ try {
+ _gaq.push(['_trackEvent', category , action]);
+ } catch(err){}
+
+ setTimeout(function() {
+ document.location.href = link.href;
+ }, 100);
+ }
+ </script>
+ </head>
+ <body class="light">
+
+ <header id="header">
+ <div class="wrap">
+ <a href="/" class="logo">
+ <img src="/assets/images/logo.svg" alt=""/>
+ <span class="header">Snap.svg</span>
+ </a>
+ <nav>
+ <a href="/">Home</a>
+ <a href="/about/">Why Snap</a>
+ <a href="/start/" class="mobile-hide">Getting Started</a>
+ <a href="/docs/" class="mobile-hide selected">Docs</a>
+ <a href="/support/">Support</a>
+ <a href="/demos/" class="mobile-hide">Demos</a>
+ <a class="bt" href="/assets/downloads/Snap.svg-0.1.0.zip" onclick="trackOutboundLink(this, 'Download', '0.1');return false;">Download</a>
+ </nav>
+ </div>
+ </header>
+
+<!--[if lt IE 9]>
+<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
+
+ <div id="wrapper">
+ <div class="max-width">
+ <div id="sideNav">
+ <div class="combo">
+ <input type="search" id="dr-filter" value="" placeholder="search" class="topcoat-search-input">
+ </div>
+ <div id="pageNav">
+ <ol id="dr-toc">
+ {{ for (var i = 0; i < it.toc.length; i++) { }}
+ <li class="dr-lvl{{=it.toc[i].indent}}">
+ <a href="#{{=it.toc[i].name}}" class="{{=it.toc[i].clas}}"><span>{{=it.toc[i].name}}{{=it.toc[i].brackets}}</span></a>
+ </li>
+ {{ } }}
+ </ol>
+ </div>
+ </div>
+ </div>
+ <div id="site">
+ <div id="content" class="max-width">
+ {{~it.out :item:index}}
+ <article id="{{=item[0].title}}">
+ <header>
+ <h3 class="{{=item[0].clas}}">{{=item[0].name}}<a href="#{{=item[0].title}}" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line {{=item[0].line}} in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L{{=item[0].line}}">&#x27ad;</a></h3>
+ </header>
+ <section>
+ <div class="extra" id="{{=item[0].title}}-extra"></div>
+ <div class="{{=item[0].clas}}">
+ {{~item :line:i}}
+ {{ if (i > 0) { }}
+ {{ if (line.text) { }}<p>{{=line.text.join("</p><p>")}}</p>{{ } }}
+ {{ if (line.attr) { }}<div class="topcoat-list__container">
+ <h3 class="topcoat-list__header">Parameters</h3>
+ <ol class="topcoat-list">
+ {{~line.attr :attr:j}}<li class="topcoat-list__item"><span class="dr-param">{{=attr.name}}</span>
+ <span class="dr-type">{{~attr.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
+ <span class="dr-description">{{=attr.desc}}</span></li>
+ {{~}}
+ </ol>
+ </div>{{ } }}
+ {{ if (line.html) { }}{{=line.html}}
+ {{ } }}
+ {{ if (line.head) { }}<h3>{{=line.head}}</h3>
+ {{ } }}
+ {{ if (line.code) { }}<section class="code"><pre class="javascript code"><code data-language="javascript" class="language-javascript">{{=line.code.join("\n")}}</code></pre></section>
+ {{ } }}
+ {{ if (line.rtrn) { }}<p class="dr-returns">
+ <strong class="dr-title">Returns:</strong>
+ {{~line.rtrn.type :type:k}}
+ <em class="dr-type-{{=type}}">{{=type}}</em>
+ {{~}}
+ <span class="dr-description">{{=line.rtrn.desc}}</span>
+ </p>
+ {{ } }}
+ {{ if (line.json) { }}<ol class="dr-json">
+ {{~line.json :a:j}}
+ {{ if (a.key) { }}
+ <li>
+ <span class="dr-json-key">{{=a.key}}</span>
+ <span class="dr-type">{{~a.type :type:k}}<em class="dr-type-{{=type}}">{{=type}}</em> {{~}}</span>
+ <span class="dr-json-description">{{=a.desc}}</span>
+ </li>
+ {{ } else if (a.start) { }}
+ <li>{{=a.start}}<ol class="dr-json">
+ {{ } else if (a.end) { }}
+ </ol></li><li>{{=a.end}}</li>
+ {{ } else { }}
+ <li>{{=a}}</li>
+ {{ } }}
+ {{~}}
+ </ol>{{ } }}
+ {{ } }}
+ {{~}}
+ </div>
+ </section>
+ </article>
+ {{~}}
+ </div>
+ <footer></footer>
+ </div>
+ </div>
+ <!-- <script src="//use.edgefonts.net/source-sans-pro:n3,n4,n6;source-code-pro:n3.js"></script> -->
+ <script src="/assets/docs/js/prism.js"></script>
+<script>!function(e){if(e){for(var t=function(e,t){var n=t.toUpperCase().split(""),r=n.shift(),a=RegExp("^["+r.toLowerCase()+r+"][a-z]*"+n.join("[a-z]*")+"[a-z]*$")
+return!!(e+"").match(a)},n=function(e,n){e+="",n+=""
+var r,a=0
+if(e==n)return 1
+if(!e||!n)return 0
+if(t(e,n))return.9
+a=0,r=e.toLowerCase()
+for(var i,o=0,l=n.length;l>o;o++)i=r.indexOf(n.charAt(o)),~i&&(r=r.substring(i+1),a+=1/(i+1))
+return a=Math.max(a/l-Math.abs(e.length-l)/e.length/2,0)},r=e.getElementsByTagName("span"),a=[],i=/[^\.\(]*(?=(\(\))?$)/,o=0,l=r.length;l>o;o++)a[o]={li:r[o].parentNode.parentNode,text:r[o].innerHTML.match(i)[0]}
+var h=document.getElementById("dr-filter"),f=function(e,t){return t.weight-e.weight}
+h.onclick=h.onchange=h.onkeydown=h.onkeyup=function(){var t=h.value,r=[]
+if(t.length>1){for(var i=0,o=a.length;o>i;i++)r[i]={li:a[i].li,weight:n(a[i].text,t)}
+r.sort(f)}else r=a
+for(i=0,o=r.length;o>i;i++)e.appendChild(r[i].li)}}}(document.getElementById("dr-toc"))</script>
+</body></html> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/test.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/test.html
new file mode 100644
index 0000000..a7a5f21
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/Snap.svg/test.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Test</title>
+ <script src="dist/snap.svg.js"></script>
+ </head>
+ <body>
+ <script>
+ var s = Snap();
+ Snap.load("inkscape.svg", function (f) {
+ console.log(f.select('path[sodipodi:nodetypes="cc"]'));
+ });
+ </script>
+
+</body>
+</html>
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.bower.json
new file mode 100644
index 0000000..d9fc38c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "bpmn-js",
+ "version": "0.10.3",
+ "authors": [
+ "bpmn.io"
+ ],
+ "description": "A BPMN 2.0 renderer and web modeler",
+ "main": "dist/bpmn-viewer.js",
+ "keywords": [
+ "models",
+ "diagram",
+ "renderer",
+ "modeler",
+ "bpmn"
+ ],
+ "ignore": [
+ "test/*"
+ ],
+ "homepage": "http://bpmn.io",
+ "_release": "0.10.3",
+ "_resolution": {
+ "type": "version",
+ "tag": "v0.10.3",
+ "commit": "8417ce12aa78ada7577338b33a9364fd35a126b2"
+ },
+ "_source": "git://github.com/bpmn-io/bower-bpmn-js.git",
+ "_target": "~0.10.3",
+ "_originalSource": "bpmn-js",
+ "_direct": true
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.gitignore b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.gitignore
new file mode 100644
index 0000000..7559d42
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/.gitignore
@@ -0,0 +1 @@
+bower_components/ \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/LICENSE b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/LICENSE
new file mode 100644
index 0000000..38500c2
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2014 camunda services GmbH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The source code responsible for displaying the bpmn.io logo (two green cogwheels in
+a box) that links back to http://bpmn.io as part of rendered diagrams MUST NOT be
+removed or changed.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/README.md b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/README.md
new file mode 100644
index 0000000..a767a20
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/README.md
@@ -0,0 +1,46 @@
+# bpmn-js Bower Package
+
+This is a packaged version of [bpmn-js](https://github.com/bpmn-io/bpmn-js) for usage via [bower](http://bower.io).
+
+
+## Usage
+
+Install the dependency via
+
+```
+bower install bpmn-js
+```
+
+Include the file into your project
+
+```html
+<!-- dependencies ... -->
+
+<!-- bpmn-js -->
+<script src="bower_components/bpmn-js/dist/bpmn-viewer.js"></script>
+
+<script>
+ // require is part of bundle file
+ var BpmnViewer = window.BpmnJS;
+
+ var xml; // ADD BPMN 2.0 XML HERE
+ var viewer = new BpmnViewer({ container: 'body' });
+
+ viewer.importXML(xml, function(err) {
+
+ if (err) {
+ console.log('error rendering', err);
+ } else {
+ console.log('rendered');
+ }
+ });
+</script>
+```
+
+
+Checkout the [examples repository](https://github.com/bpmn-io/bpmn-js-examples) for a complete example of [how to use bpmn-js with bower](https://github.com/bpmn-io/bpmn-js-examples/tree/master/simple-bower).
+
+
+## License
+
+Use under the terms of the [bpmn-js license](http://bpmn.io/license). \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/bower.json
new file mode 100644
index 0000000..bccfc96
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/bower.json
@@ -0,0 +1,20 @@
+{
+ "name": "bpmn-js",
+ "version": "0.10.3",
+ "authors": [
+ "bpmn.io"
+ ],
+ "description": "A BPMN 2.0 renderer and web modeler",
+ "main": "dist/bpmn-viewer.js",
+ "keywords": [
+ "models",
+ "diagram",
+ "renderer",
+ "modeler",
+ "bpmn"
+ ],
+ "ignore": [
+ "test/*"
+ ],
+ "homepage": "http://bpmn.io"
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css
new file mode 100644
index 0000000..11e91f4
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css
@@ -0,0 +1,150 @@
+@font-face {
+ font-family: 'bpmn';
+ src: url('../font/bpmn.eot?5069274');
+ src: url('../font/bpmn.eot?5069274#iefix') format('embedded-opentype'),
+ url('../font/bpmn.svg?5069274#bpmn') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+@font-face {
+ font-family: 'bpmn';
+ src: url('data:application/octet-stream;base64,d09GRgABAAAAADXYAAoAAAAAnngAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAEQAAABWPgtJqmNtYXAAAAE4AAAARQAAAVq5NgKZZ2x5ZgAAAYAAAC5lAACNnHbOYsRoZWFkAAAv6AAAADEAAAA2BeU9I2hoZWEAADAcAAAAHgAAACQHggO0aG10eAAAMDwAAAARAAABhHroAABsb2NhAAAwUAAAAMQAAADEEJsyAG1heHAAADEUAAAAHwAAACABfwRubmFtZQAAMTQAAAFSAAACPXo4dZVwb3N0AAAyiAAAA08AAAl47YJ7bXicY2BkfsE4gYGVgYOpimkPAwNDD4RmfMBgyMjEwMDEwMrMgBUEpLmmMDi8YHiRxBz0P4shilmZoRIozAiSAwAREQwzeJxjYGBgZoBgGQZGBhAIAfIYwXwWBgsgzcXAwcAEhAwvYl4kvEj6/x+k6AXDi3gIW4JR/L/4P6heKGBkYxjxAACHqQ6BAAAAeJzsfAucHFWVd517693V766qeXX3dFc/5j3T3dPdM3nMEBLIY/KAhIQQQYEE5ZkECAGBhNeQfCAIouIuRBNBBBXYFdhdl5eAigjBdXF9rKKwqDxEWViz3+dqprPn3uqemTxIJ0z287e/X6amqm5V3b733HPPPed/zz1VAhGEPbvpo+QpISQ0CQIkfSQSI4UhKCvZYegBDWTLxjPZ1TEyvbV1+kjH8edan90w9PnY4sovKgWtkIFvNafIU/jkJMwAS45tW3RlR6tT+W3l28kRCUr2kCBhHU/RQfIm1uEIbUJZmMNqkqOgyBE7UervhWIp0wlSUjbDMSgk8qVyuJRxElI70EQ46fjAxvtDkKU9kE7KCpVjwLPAAx3R+/1+st7nu48098ytvObx5sGrw/d0LzkGvEbltcoYUKDTK2eOADH8pIsEGww8esGnsyuvHcSjn7yhdmkDkk2gQSrrXepOv2fsR5rX0EmH4c9VFPhbCBmVpwwvDRkwrHvB66k8bYSo14BjjJAgCBTbeAf9Bk0KASEiHMvapwC2Dqx8GUr9WcgoGkn3OX5qsj1OC2wfpkW291IHd9jlMypn6Dps98Q8ePBUzvD4YUvl8srlcAUhIoVnRDwAFcVn2MES97tFk+xHMc/kYoZ4AVt+M57JlA5SFDZFkLEtN9MXsS0+ISp0CdOFE4TTsUWyqKAwWKlSiGSyGaWEaVmRU9lMqDwENvYLe1oqlzLZHlBiYPuwfzFjCZ8qsmLLimWX7VI5k2W7rGSy7FqxFUzzW/CHr+4RrMCWa66E4PfnrvrR1qD9+beCxq3XXlPZvWSRsnJw+xm3vqSI26++7BcDxa5Tc5fPvurvCfz1xnVPOvGRD6dOPL6za/1AqaNr7YWd3YMDLFUuDwwODqztX3dh8cLSQP8AXtIk+bev3DI2a0byG6ACuUcnOfjBnTf+tq97yboLIXDOnMWdz9163T9F7bMvuODdEzv7+uCRqzY+7Dc2nnf2i2XTWtfdiSV1daxd39U5OFAud3WUBgasgcF1/WuxjjLWURocQB4GkYd3c3mgyE+PsFj4srAbhuEz8B6ZQTaTZ6hET6Vfof8pDiNng4mgVFDKZqJoB3OOgpuJu18x42KhPL7Z49uwVOyVnKxTxD1rO34p3jgsMjHKFnFzegH/8ZwtVlOYZpcsjXfcLJLjJyZWAiY74+aH6gVPsLR7j5hxqTDcWOwVEznHlV5xH3riMieJOL0ao4hRhiUTXgYrC4vnrcICqWPyWvA2KzaK8t9LJWyBxYrFViDRKjuITrUBrE1I+HiTCDYUiZdMh5PNjrZZwJ1tcY2VgXmy41t5fOsVJUa+YvMf8jarfBjK+HBYwUOB58u6NdBqmVgqqyJO3DGLxXvGC+dFSqwkP7JpmBSHoYi8KQ6TwrBeLONjbBphhTA2kUIcqpSyFN5j5QIWzUpnLGzB4lRHGd/8IuN+TQKGPewAvJIiI4QVzzJgGbwCLAqLZZwc7xQr4fjxDl6ojHZeUJGXwZsiQhbuqDz964u2VZ7b5pE9kiFJckbWVZGggiCyqImdkibhny7FcGcJsUFDHSKKAHhUMpIs4Q/lXZIo4U1CVGIoqoKPcMOB7ycaoUG80DTUMCIQStw9BJooo/pB/ayyA26qiKWKKoj62HuSqEp4IYoG7ioFXp6ogZ/9nEoEK6cspYqapEhSQCYy8WN9bj4Fi1IwJ6GsuJBXlxQZL1RVxEoyWB4WquCpiaqKQrE9nDYkGChLi9jujMhuS94HRFXG20iCiVRQtIkGaBrlzcDaAZvME5KoYSZU1KS6Ub7zP5k6hDMHWwWjErYXC5LpeFbFAiwI76CiR0IkzaUHSwa+4RlQX2GPELyr1FgoU6SDimPfwmKxMJaV/xFQWYqyVmJZlBUl0fGHjHCNvIM/kt172Ge8ZIt1qYG/kLGDdaK6VSs8D9Kj7r5XQg6y3yCzsTqkmOhYOJVrJBMI1ShWeNlIrETeReawh3gPr5gMGPgz4kqQqKmSQrFbZYm1UK79XnN7bwz5jzxF1smGjKzHHma9gL2GO5MafMxlRGQUoFygzFCTirrSiE2o8h85xRmtwjakBBS9xaOERA+KAJMCMcBrAM56Q/IitZIqZXiBXCK5dKIU4h3C2S5KlTmYSyauMGIWrwZeECWWZGOlEXkTkXG0eHRNqso9SmVYYlnwPx1DqjWDekmIjRuIMDZYXfwh7s2iLPJuYs2iOMDwrhwBPgKZoIhSi5cdaU3E/1R5DgZyq4YefXQT/Afju8IgA2eKhG3Xan0vwbisUso7dhnreUXTdNAmjR4lInpFsZUJFZduDUf5pJpVPjJVcBnjjk4GEHCsie6QNiaPaLZ7bbcADdtgiFWeSIoRY1yNTNIYuEu8M/kAkJg40pqcogARSlyuq5KmMj1QExeWJVuVLz9jjGZowISfiQv1KNjGmtYyqCiPj04yMQxFarG2asiG6Zz7XskzkUt3qEIV0efBExtuOMCIqKJIVAVFcrkBNMB1GgUdqpUz3mjAyvgKFzLW99gFXrFZ8mqsrSAmRYk9qnUoPp4knzHceVJ0R1k3sCJEsaqRNSmLMqPpYh75qjKplNXJIijXdLQlI8uoGMDnqiYH8S5q/ATuki77MXujpIMo1xqmQrsrrZqUrNkAW0K1SgY5/xUkqIl6PLzLIn4UJ5UNHFdmcGiayHVQAtXRyVWqhKoP6d/BlDcaBI0PaEOWWLuZcKB+5KpO5IqgqqtQHLh+wx6WaYDK490lu32jLMB8VDZwIHIdx8t2NSIXGq2mRqGqSFnpqOAYsaiw0QIyBcZtAGpJ7ChZqylYOqEGXWODvcZ0t1gVOwig3aGSRnVWtB+TshGpPkIVKWsityy0VjcqZpS9yRaQmxtXRyNuZHOlrfSbiBv9QkzICB1CL+JDHwlZIsLoKrbOjyNvwpA3YmvEjUo2YmbTERNx9K4bXjun71Egm6/5kqrccFnvR/u3/iSTPOmc9ZX3zv3YcKHve+eec/Y/P/98wy1wytx5NAm3/1fl/z4z1NXz8g1b35xpN+TuvvaK90aWeFasAHrF+i17Fiz4zC23QNstp685C7ePFvJIp4Z03oX4thWxrS0sFR6DOfBFeJPkyReQXgRlBbOAaApxICbwEqFqsRDuhCoK5KBlmO4FbBG5sLmQWEW1ftmM6whiGDKKezlWYQCwV3Y4GPRwlKs4LlSUGFAVTfyvgUwGOd3rKqglDNAx9Gf6dZMh62EON4czbOqFBE2Awr03jsKHkVpwkRfHTzWkOHnLVuFYFd65oIxvLswTWRO8NdyIddouDXQC4hfdHcFjuVDkzOD4jjJUx9hAeMIFeYUqomQgshBXWB3IatsFdVUU3qs7mMapAjy4adNNmzZd8uFNm/C/oHhlr1fJen0uMsCRJTLjaqOGwL92dpClOJpCNpRlquMMTfYqbzGdTZkYMyTFEIKKkqniFdPTTKIpg4VUR4OjufqbIMCr4iHEGCCxO6jSmRYH174rtIoHEUhIY3+QFCAT2phlIMx8sEr58CHs92z4MivAxxxTGlUTwPSnj4EF9ngCO/FSqhAH8xAOWlizUJMwhSHKqkQeQu1dNTJc7eATiQ1UmQ172cWuXC8ydhGQAO3beHZmVtTdX+b4l+fh2kx3m85pYQbWZQjeUUQX5DC0A6iCyNe5mdZFP+pqPzP2qJIRkkjchHs1WY5IEJIVCdytBTx4wn8P09lcdTICxn7JVA3vCdFb01/UgyoHFWONFawD2YYmlXpplFCvSL0aoh23EGbLIySIgDhIUCujyicIuCXCnwYZvEowQbppk42CtPk0+DRqOWCN4harCllFlzESGj0sCNsnMlW+ZAKPstYjhiKqD62k7PYzt/3MroZ0lXUy6lod8Z2hurZDREtCGcTHbmEygxqaSRFxFSvqbYPjcFdGeDfzQl2jUpMxppIZeqOEwQaOEVjv1kA6oA1Q+RkJxdZzsFSF8vgLSowaSmDcQ/FBCZQJ099oyESoPItVcnILSJ5MquXKHGxjSwHBhCTrCueAC6vwKY40kBR/BsvDhlGx+q9QH+1CgMPkJexitmZZCSvesIyjN+6tyQLbGL7ixWmaisXJAQ8z7bLUi2kc1gqb+lQeYpM5kc3n0FyxNhjAWa4xRMCkRq5iZOqXOWYRFYNBOYZLOfxmmEDk9gyBTXU8IsqU2Dxj3L6C2/8acMaLaLl5EwBhHeMESxGGRl1z7wWCtoQ7nWiO7BCyzNaBEkH7Zit2uWhmi4rNTF4RbZ/rUULLgukegF1bH6b5zvbyE+S5tJ7MZzv66APXXfcAxaMk4TP6MNlBH7r+2As72xsSiNzgOYk8amc61g5fcz+l91+DRx2fX/8Qt7k/pP9C3kKbGxemCx8SNgpCGOsKYpUJrC3YA1kpgRdBvJnAiyBaXccHpksS/puJIt7G/yHAhFKyY1C2zAhiKpvnSWbwyTDPgU3B1uFdZhNx709GwSmypzHIl36ydB0h65aSacvWErJ22dizZNq0hQALp409y8/foW29YHqV1pCVIHAqOHYkoXqD0HeM12jpkyGEoJ02+En/CUUSbMT+9VkgJW/TNCsBg9JPpTKJmx46sLRM3iJrl1bWLmXVLIXb8DwDRqZV1k4bATzDbdNG1kBfOtxqEK9uxM2rrgrFDY+fGvFwui+PbfagYIRaPdiPqpro7kyq2OXUaA2pcuQyNBwx/+WrVq0iZNXloZhHdrq6XWyD/Xw1GRVEQRUM7ikVwo3AnF+mU06YCaV6Pps27P79E088QxaOPfJM9UxGKz+r/JyMPDM6Oir9+c9/5j5XPJTI45hSEIcI4WBhfHvo2qtwI4+PzZnYx3HL49wvpwqWkBR6hBnCAmGFsJp5OJUEtexEiXW+VbJLll3KKBmb+TVtq8R6T+L9zaDYEAJUCydMEebfxEeSzHvVymSZwALPZ3PIlnCfIHbL9KLcnn46XP3UyMLKSwuXpJaHAsfHYjOi8Xlx4532otUdb/VajUNtY+9l+u2I3Wm3t4Sz5La4rnhai6Idlol395cSBlUts7vJgzNtgzyYntse7UgMfqxLN8Z+mC40JxdkE50tC2fIJH//A5DZunUr3EdpIm4xE5hsILAk0B/OTw+VzPZ5jXpwVsJaILUeFw10V35sHB+dNSOpx/IXlFQ15Jnb4syJ0QUtM4dVT+XhcK8B2YheSBvNoX5vuEUOZ4hVoJN9nV6hSWgXzheegVY4Dx5EbbuM3E7eoXPoFvqCaItn8BUGiCFs5S7kfAxZLvdUUSzyyypNR3DHnMGdcMiuRr94yI5G53A9jRyAHb6jUZIO6hR0DtMrGJUO4BQsvq9T0KEu0D4cJ/IH8SET6bBdyA4cqgMWeSQekgPWCbv8OIgP1JYO6gJ1YNes83P2yiumDy2WZw925WZ8JNqV67/sZG+icfGaaNQnGqpfOeWU5qg+W/RNxZX4dQSZR9KVKMEon14eQV+iNvbdw/cliuTmD+7gk8YedIHrkfHw+eCeOh6+4CE5+MR7ET1NwR/+70fSHa6O7Tpi7nCR/M1hO35FnN2IH8DzK37miDhJvaTpCDhJRdI//9IrPxQzrXOvvaDFzM6/6PxY3HfyFf3pzlyxRJsUSWssFOR/P3yvIw6PI+R2nMFH2hF3O5KvHRG/I1w6RcffF5l+O3KOP7poap4/8v2/nKscJ49H1Fde+c4UncLI+Kl5hXGOOXU/quthmqondf8YhnnC8inGMEQmuzXzk/yaUw1cCG/ffvn27Wek0tu3z9+xY4oRCqctXnzltm1Xbmv4/ILPf34BmyIp+/FitjBXWDg1buzvdZ4iE5r28klPiQV37++x3js+Z/aB43PKfQit4yh7cXGYxMmw2EuGSa/oJwg0DxKdswuVgp9F09xwAzv6UQjFG25g4nqAuwcJ0Xmg3m8n7tb8JnteobeQ32O/8r60eIwN4Ky1TG/xVv71ip6uX/wyGIDHuruPWUB+r3x2WmfPq68G/PBUV89Vn+Q8uZnupA5fayi4vpeqPLC5bqa20HCwIB54+yt/jvhvvPZyMHYu6Oz62SfC2qaHZXrThWu/256dtzp1wgGjcmhS+vW9t4wNT3MeAema0a9q8MkHNl30d1b43HPO/ek001p7oDAbJss60vxZ+l3sx6CQEPLYk/NQkk8QThJWCqeyXnVYG9zVkmobCmxWzsTaXS1xc0yS6/EMtWaaPBwn6IRxrCuTdvgDkG3/kYmd9iqEN154Ydj6h+tLMyXp1l80W+svvqyy6/HY8eVH1kvS9c+GfNdsXP+befPVpYWbT6B04wNe/arzz32hv9C7qv3MNdBT+W2l0vS8+0eT9Onbr6/suUufP/8PW7Y+n/TlyGOfvObt4eH274L/kpUf6xAfGr3yx11tc04/688fmXZsL/3iJesfi0dXnHHWL49rTXzcqNwKVzZUHoFsY+OChoblDQ2LGhpQymtzcrY+s0p4CMfRCOyAMTKP3Ei+T4P0bPp3aGFGDrJaczQS6Wgk0v/XSKS9Fql6jwYjHQ1GOhqM9L8xGGmfNcLPHg1HOhqOdDQc6X9jOJKgjs+bGI5sEVqFlNCGc8g+d7YQ40tc45NDvgBqvy9+3vXUHkna85R7vP9Xovir+/nR3BcRj2d6ak9XLRMe//nAWFcfj0Vy15/WCC/CCngY/kTmkL895BUnejQ46S8VnHTIqy/DRwOXjgYufdDApUPy/cOCowFNRwOaphbQ5MalLCU7xuNSzEQRqvvtE+EoZMe111b2uDv7CeG/W0dGheXC17iHchAQBsl48oE5CBHLHoBcDApWeRDypWKOvTRZLOSZIwttTWII+jNKoljIDUFxENPMoCWzTrKvXykNkyHI5jJZJW9b9iBYMi+bcA9vwUKNnstbEbkTKWRnJ2Em8AavGNOFvGXypJwdZKFMg9ADxVw/1ssCYXIl2OnxdJ60sTOkojD7F097+echC+zQE7vDjVRubKpAT4NpW5WXXrMaGqw1F3047PHgYNJ7Ah6q6T4UbI+uovLVG2ydCajXE/7BmogZMd+AghkOWZUXgTaYEjVDlT3PhIIQDP785cERP/ahGmp37u3wkFG1ZdqJ8YHoUNRMm8PDAKZlh0xfsDkKYWjstdmxwW5i6lHWe4KBlC/AQJfPSPhl3bY9iLywo60uOxrutKMNjQFP3G9GQgAzZ5opMzrUXI7ZG1oUoda3l2EfhQRTaMa+7UvmZDMYKSTyxWB/FjsoISWktFRIBxMXA592k0q88gZ5r7K1cg1sJrB5jJBRIGOPomAdjwr516+98cbY09V3SH9BLyGv8PgoFhvFkVQimIAgdkiwEEwUE8GLKRlTyTtjIVhdeRMa2qCh8iZ5RRrDivSxELm78mZb9T4jVRyPJw8gdusSBvaLJnfsmn/UDScvKO/jD4R3t766T1i5ev1L6clx5ZcfP9mDQ5Pk9j/uHVlO77raDS1fDuIV67f8YPI8cRKtbux7d73Id0lWsrRUtqlll5WsUj/uHbKFwtUbZs3acsPMmbHolfm6se8vnX3OlytfXXbSHSAvXjh7w6cWHfj92GH+RvPUVlPcyLOprqJ0TESXTXERZXU1eOxA7Z0tjEy5vZN6Tlam2uyf7NWvTQ1TbPvGfbo9kxWq43NivSRTd72ktkRWd4nEXfqqtyZyV21Vqzau36VfIzuRFkfICv0HiVh1UIs4btRqGJVJOQoTA/ynx55MyMnHksFZ7Dxr7LtksHsGwIzuDZUHL+6ZDjD9KYhUfnfxokU9ixaRnZilstLNCvfhuQ9zVlayX/RXdmIa7uueUbmj8rvf26Ue9pP96Ow8DDqRxJ+4dZFpVfKeJdPGydvQPU5e+oVDJu3te3t7XVs7Tle8frTv+9Ix9iyn4mDVu1V/MPnhg6Su/NSkv54EXVIT6wON6TnCoimOaUwj+2z2Xn/Wx0K2p6zMkgPJ1hmtm4ZnJpNzgrlQbKov769+fnXiuMTW5y65YO2C4DSleB5fG997PXGpcLqw7sisJNo+UnM8oJUlNcdDYR/PwxFaV+w95ty+SbNocfqpE9Po7vJe8+gprjmeAfMmT6Vg/oUHnEvtjT+YzGddv9FB32bbX4rqmvXL95eTOnb9hf0lYV9ak+7bCHXevKta7fokTrbLdYj75rjldWM3Jt5NqPneDqbta+8nRA8QV1/v7QIL/lhJ3HTTPZCovHJP9Vz/RYG5Tz4JV47Onj278brrrnPxESo7CTFyA46oacKxwgIcVQILiI+JOKFhJJd6xNIwSAlkJt5T3Fs0y062HLELpf6s8j5nuIacNA96ZvapAyNh2JrtD8S0/MwumLMsVLkKVs5tTRP2sLSwcl9rly/uyc/oAvAHkwlZflGW/1GSHpekTbL8A1m+V5LwiGC8sGLhrBnThuZ363ZHJDt35oyZs08seIyubCe/P687kg7y28lA2mwvAs4GNbgYdMD/DXtdTczj2ByBsP4L42yA4fj1MAqju/9I1cqVZPTHPz6nEoVfPV3NP6mP6/bsG6dcRshlp5Am9zz2OmnqGgAY6Bp7nZ+xwzaurNy4ciPBM2zE81ood1Ru7CgDnmFjR7n6numEXzeDEjX7IB7dQ9Rj7+ffve9wNNP7+H7/8dB1zt7v0DpCR32to0RwfiXlC9jiTDnCvsNSf0gvY9/NuOii2MxY8aeV57bVHdb/b9s2GMhFpimdvtNOe3STq29cG8zo7BZmHAARTBiUUFU5RvYywMokAwzvfqUybm27u1+63vJu+7VPv/26q/YsXqSunHbPklt2SndfvfFfy8Wu0wpXFa9+COhfb+DG9iOZZWgT/u2+mm29dvOXPSRHfnTnjW92t59wwYUQPOf4Rd3SC7deu7PJPPv8te+e2N2TE//h6g0PVo2rZf3PzBPcmLsyGgPlSETanfraa/fcUCh89JVXpgglNuTzT6751uUzZn68dP3+c4NsfWxXM3N1wd04CKobM1WzabUxcD/9e9o8/qZVA4v0CSaKTrBQBMUu+2FiJ/dA8NVXK18YmTHyQ9xfWsj3hbS5cffXc1TKVzbPGJnRNWNketf0hfzM23s/fRDL9whzhWVYoY+hJNayGEDOVrJlOYsHtOP8WMaDWSonmG6zmTvKdvjXn7JWnChFnCixj34F5ezkUkbLtw2WaGkAjwBPm8vbaXdf2/IIZJoWObOJosxxFgXMynENceiHbJdnlUG72mYe0wNN2iKyCDU5nI2PItB64/x5Ay3sOGgVaf/AbQNlUizfBh9a5MwBTcNSoDkdWd5GunvblodFKwytDZVPZlgxsFBr6B1G/Nepr/Ji6cXWRngispkVdwMv9P/UMM5EbOG5Lno8wNe/cn5q9hIWYVj9BJgbaFj9EJgbb1gYJix6yQ07xJTSNwh9B/sy2CZRJLCaeTW9bHFy9U3c20+oeNNqdvYyz/pqIKIY2j8jWzjcJ9snDhKf+OwhFrtv/eKZmLFp/9r79uNdE7N/B+QdSmminLUV52CBmLBF+cFS0Jf+5LF5r887SENelT43NrZ568svu7bXrd8vhNH27lVxUtHo9L1rwvI+A1tYdXDZPoV7KnNdMvaXCeZ5O3C73sfiHrSRp1xKyKWnuMcl5xJy7hJ+PEiDXxrPf8qlZi0/HvfVWx2HorfYu618SlRfdW3Y2pr66RkfUVfFFtTTXifCN9avHTlm9m/mNzTtp0+ThzJXTtSnh4HweoScef8DVUx2O58Xsvrd2kO2JdbmgntP9ODdbbvS0TPXrwP/by4OW0/emG/f8DW/cck5Z39/YLDjtI6z0Lh++6+27BFOWKzdsmvLJ74f93yS3HnR2sdTiYUfOev1ea2JyTaEvUfZglh/cpsJc93v511KMNTltvqaK1irT/7ZJ1pYm29e77bZObHjvPNxSHS0ncfafd8tu7HdD4MM4te0mx/YdPEj481esXjx2FWbF9dkd4L3jtBePzKYhRxLDEPVd3ZtWrH8pBWV6+GO79XriTuOw7/Wm26C0N2H7zupAoe65DBEUI+Qi7mxP0Ac/TFo+6boNTkA8pwixrl7X1w6JaBz576o1cUW++K8I/IuwZF5heBIvTxw+OsRtSHJ0KqTPRSvQG1wnn/ah9FkfbjuHOJhd5T2zZ7z8stzhNo79eQd8iXUGWHBQjrTbN0oksMZZ1+umMxli1LCLAQTYDtZ1/HLzCjD0n+CXfDlyjdg9r0VC+Z94QufW79+5bKFC9evJ18iMHYpvE7uItLdlQTZfEdRLpw8uGblypNzi6r6YWK+epbwjUPwRuSqi5k5WXH4YqZs97GlzEQuXy4Vc/3ZTLaAqXKuxFMl5K2DD9xlTJx6umuXuRJfu2RronIckPc5d93SUUw7z763wD4PkcvbbOVSdthyZiEGfOlSSeT2XrjMsT7M13OIvObRWsqL4wYL/lL0wXZo9Xs0nVLba3ioZFBJC5lgBaKKbgb/xRMME1VlkZAiBakhqLEwMpG8oauqvuMlQ5aNlx7ysoVtKnq+vtWD+fTKq6lOnYXZehqtdS34rK6zZY4cShXMTKQt1NDS1q15/EEdK1O9phepSkZANoJByxOwWgyDRECR/AoSokgsgkG1VEiCrBsKOBLxqjQFVEcykinD9obSgdaAf36Q8ncs0BhFyRacvW0WPie8J/yn8Ee4kxRImUzHMRDlS9KykmWvgziMxexjHWaZfSXBZEk8FYql8iCUynY5WyoXik6GdWA5i4KXYRFSfTlMZ7J8fdGKA/sMrGP28E8m5CxM4pwhy37SCyioxdIw4PSBS8cwYEfb5mQCWD72yJ4OplJAGnJYYt4tlF2wkHw/kz2cbWAFfmDLmVgy1lHoZbqq38n2Iy1YYbEPx4tSLJQn1VgulC3Tsc2sknRyfYMkmXPMJJt25/oiDJznTPwfAKTHzA1QN2mZuT4zx46YIYL7IETsHObDI3seQTGO5Gw3g2XafZEcW9uP5FxohS3CijJOrj+X7eP/LN0JmUFI4qOc05d1cGT3dbKC8Q6S1JdTcoW+6ZDH8nAEYLqQ67N5wi7kc7Z7n9VWMHGAYCE4/vAJXiChTInlUBsj/dkByLA6e7BlGRwrfXhARcKozswEvBgATlWxP4vJmTBAcYyWWckDBLORQeAhAYVcf0HJmVnsgSzcFAj4fZliJqQUi6JXy5bSCcNDJF+qlIkmRoJ+vy/LHvYXqSLr6VKq1dCVYKqUirbOPZYko8TpTUGxYSTTnQx5m5Lp3gxoLOC6v18JQ7o3RXyBYIC0RvOBoD/gzRTTIUWL+4KJDvOyQY2F3epBLwvkSGExuiKL/QXE4ZDpyRBvIkhmEScKmd4U5dGVPMSThT8V+1mmdE/aLf14QgYD7GVTKRSKpsSJ2HWg1gkdXclgMMlCk9yQLlp9gYBFLInVuCV+wXYZ3Ggsfr81gGS2LTJptTgek5VsCQbhq1JYlHWyheZEWdHSxXS0daG/FVuX8oNEdSOBIwN5Viqxx5lSGhkZwNani6mASK04/iAs90sF5FCqJwWJVssfOak7Hiql3Bb5CeMstg9ZwmLYj2lu1Dn3i+mWRDDZeUJY9TU3IEdkjXGuJ0W8QT8yCwhq9nRvGjQfhWJRDWERDiGyLPN3AYDFcgCWx/st5ZYuosL0aloeVG9fjLGFBd1WucdZovCwOBbYnm4JRJZ3ZUI1bhAedVVjDR6DKSQt0JxSWIiOSKuF8HLwSsH5ZUuvocKnCWnXNKjFa3jIKM4h5qCt4l7oGvzgX+4pWOVEsd/9akv18z35fT/f407K3O/39JdrH/Cx3E/44K+TCqZ4MEypzKdz8DvpGFTZSdubjznNRgDORBK/F/C2pFpLXrMZFn0sEulZqEMLDjwp00RXzDpmBW1uR7Nmp1BRl9/y+4MJowlWqZW7FTiZNBrxoKaLp8w69hQyCrBoZrQQESPBUJM3GtgJsNPXbDSFQ7YUyUdnLj5Rt0OKrEbzIYkQv1GaB3B8yesnRArno6qitn5T0XTL02h/+9Zbb5WkW7/d0mBYmiyW5wLMr+K7CfteEMrC0CFY+GQuyeJgLPb59mKwP4MqSZqOSta2hiFYd+UhBZKiSrBLUhSpMv3F555/5w1FfqOSrm8Qj8Uf3Cmp+OOzJKVxw3mjlI5WnhBqsTocG/lwDm7vi4sSdg0YuUgIoWQNCu2PgGp++olYmrpxNIcSL3OwEBkX8R0Qb0812mTc+XikFmiP1MLsAX3IC6Y+u5iMyqfa5v0w+5SafvLeiJ69t7mDPobtV4UgonnGgfnCSuGjwiXCqPBp4S7hb4QnhZ3Cz90Z8N4rpWE+Jy6X7DyiaGQKl0j+2aqM+90q9pTLa5lzrFzin7XKKHs/lPb+ZY25zDHbzx9aspuXffVqUt4yvzTHS8JL7i3idUwiwf0qVvVZ1aGyD32wa98l3WB8ZjTkN89YHVFC+RciejA70/Q6UsP8Hjq2K2Abrbmg6HgjQ22a578CCVVq8GcWOhF/4Lg3gnFfU7dfQpA7lPJ44ONh3d+S8Xgd0dublMe+EzQYfPakiRdP5K2AQaHRlhxvtFkk3t13B7x43ehNSrbNvrb1u4ChJiycw0QzMnjH7guqRmxBZ8QbWFKWYXuwNdhUagqpkd5VbYZeKYdUf8fqYkQN5z6UlUlDoNHXOi8d9JqlNR26QTL7LULDKM4yjJTYaGU0Y1laj450+oORwooE0Yntic1rwwb1LGk1moH6AxGRev1iyohnxYge6WsxAwGnHDFapiWN6PGZYMDsPrFV/Gqzr31ZNmhE2pa1677uRl9hdXck4C99fEjVkZz+Nd3+UKT7zLzqGWj0pWZFI5FAekWv5ttBWj1Ov5+kPPFZ8iIxJGkK1dIAjQ1GLEOSerJXh4zq6WqllFqK2awhAz19KaP5f8Q/UHPmHIHVnyOy7iPgbLv2zok4aYVlmfA4HAd3wVs4V9rurrcc8E2Yo++a/MXeNTlt73eNzjj6RsnRN0o+6BslLQd8H410H32F5OgrJFP8Jq64j183+v5eXdc27uvN/dTFFy/ffxqTL59UPqP2XufEHK8kLBROEk4V1gjnH4ov1weRGMXJcWEIeBiXUqiGcTklHthlJyPTId/vKO9zrjcZ/FR/e3O6RU52e97qcaRYqgnac57XX+wIW9CSikqJ7hfTgbAcSzdCW5jSK0RxrSiuE8UFonilKK7GI/Zd3XnjqnihO5tyUl3NcktPZyqVbuuLyUqz1cTvdjY3RGx+tzemKMfV/vfxffMYwXr8ikOZxX8p9VrtvP12pQN+/HZ90k+99tqRysuQuqT2Td1BcofgCP/d3rXFxnGV4XOZM7Mzs97duc+svffs7MaO7Zm9+FKrdlDSNKFxiLAqlcZ2JUIacquhIhSUooqKp1IVHloVUJo0dQUSgjyAWqnq5SUvRDxweQBkIlReKkV5AKQKIYRHnHNmbW/sNClysVTL65nd2XPOnMvvMzvn+893vhkHnwMnwIX4KW6SxT2TWh43JtEo6zXxNoSlRh45KVweQjUuYzs6Qmwnjxrce2HFEdbdQrQ4BH44sTA7LorjswtfX5i9j7CDiYmFYyOEjByjQY+OEjI6mHugWotuymaOp8qZMh7rRH7cMPQjxcxZnz0UvWPlTVk28xbcf+gQtHKmQmiMpucMRTFyupZTRHoRPZJW0iyAfty/EpW8e1h0Xe+zZNnq07k+8Kv4XVzi+KsABsFeatV5cA48c0fEVe5AIYZj1kMueoVwVGN3Fkq1fPjR4GlVM3gVA5VigJTv+BdYgg2oyCp+Jq+lzeBLgSUZw9dNWatPOJliwjuwhyz/I520ewf0hJh1hVKoeqgH/ZzCG+x6FN4UshLTEqbwBvU6FEjF8OYqgygPVvW0OXK8n+kJUwSza2ZPT0GWtFT/0TK5I2p5loKWqpBEDBIkj1LYMj2Qso3w4SJWsWplJ0vJXiOTmmqpekZORb/q5SBES49emEok9GyqSUGIZg4ebzCVYWwnrD5FreJkSNEERRr53UlC0ikHKpU+krjz+pu94MAmZ2G7JrA3CTK657c3N/PaNf3d5RcQaat7wW4wRtv8MDgOngTfBt8Hl8HPwNvgOvgTtYNf4w4PkXk7Rm28bZwC6Ndnzv6R+V6Su3Z9cHB+bm5u2/kE4GtHjlxcfub8wrkb+/fto1hyG7gDuvou01y36J2qwX9V5+ho4wJ4DvwQ/Bi8Aa6B369TYN8evbZb8P2hbddh1zTmf7ot+ur/hdvCaVqbdTufPbPC4/ok/M0rWorxWEcA6h1GOxuYSVs82qndTmQStnysA/99O/kJ/n1LBzrxc1HOIJs/mZnNVTJL2TH/crTN7cdMBQ/cd8r3Z5rjp5v9jw63H6vqQ+6umfqDz08jG35ldnH/N1OJmeHaHlGYfehqfcwbymZHvqGux4AnwQ/AVQpAX0VDH2t1kRRuYIAw8oXV7BBAat0UkCnYZis7YwIII1pUVvkfTsz/WKF/jMM1/sc4XEcA6bA/1oqOuR8jTtMqoKBhhk5gMt9fO+Z+0LyYymFFup38UeuQP2ptv9aqjKNWpeYzXUoasFZQAZY5b6MchBXGahClkHE+xiDne4Sc88EPaZqGxcM7zA+WOnDoB62NHZj2ODQbZhA6LHyN3xHW6Ik+L8IPK60Ky6FGy2oHlbBD8qAbjazEhA/2HvM8GrTAsBmwzeHvzTFO+wibDU74sFkA/c6SOXRrOkFzjeLBqzcEKRYst8PAH4OtIGT1aTGSB2L0DxrVovViKdkh435w5Mgy5fgvDBq8zPBeiPZxPSE7viOTUhklBNc3nSTEguF7GT0kiizLkud7Ki6VYII4NcMhIsSiWXMy+p6yYOqC5RrlzKCTc5JSMm26DnPWIFgs0ivQdm0hobialpN1WXJ9V8VYSyiGlzxSllMq86WIhmfTMwiEhQIUVOS4jpAwFaEsWJrguIZERMy1t4q+uJqjhXUEcVI13RWPJkq3emkNFKfjR+todnH3DoIdz1oXXYG/DFkxXXewZ9WJamqqzNxB98T2LdJH60wblDZGZC1BjUYEkbiG7zLVszzzK9PIjA7bsi45vkEwFEXb4FZWWDux7RppTZF7RvJptUKthmVZleNW0zZSi0i7Mym0UohqeIFK5ELsj4SCYLg2PUNhdjJ1TI2GSQLBUhFSGzGrQSnB/KBIKGO4mqVIPEgzMZFISOxwjlkbtOJqz2jOS64Ygq2S6xxY2UCVMxbu0Ddi2zJBP6T1SQL8n9fF3as33tv2q/oeE2gaSPT+2EN/d4lD2kQjNW0QalX4r+hNQofl+6J3leh36Mnot2j6b8KtmzfhX27+ITp44wbdu3wIDKv1gX5wPzgMjoHT4OmN6GxLb6kbENQXtv6eejvC2beFd9SNY7upzat2fCKCHZuX6mDd1lzVfO6ekzwGfglleBhegRE6hL6LfoN1fAq/KSDh8N1mKHfEn3fEn7dU/HndxOyJHfnnHfnnHfnnT6X880fMiw+zf8GODvSODvSODjTvNJ8mHegYF72FXlh71mpJk5hgFx08DuPnwuUvPj8/j15Y/h76arB8C1nLt/hc+UV8DRf5OSlg0fFm5+msUHKY/FiVjlgYr+8J/5ofHX399bk5NDM/v4iL/3kaf4ft0V8XFxdOPXEWnl5Y5PN+l/CLOE+PZIrNNJqjxxEapH9V4tTWyRrgF6PH90ZZD34wCXF04uWXpryplye9yUvs0/d8nD/3WPSWDw/OknPvPzJQ7R/u9wfaA9WBIFvNxs+K/Qn+BS0vbnNcXgFU+YpYOkgmTESN7g6XUyOdnesn8qMKi2nD4ZPRlaUrf372Qn35Wyfhh/X6U5eXL11+6v3P4/zS0j9P0le+fv6VLy8tXZ6efu9r9Yvwlfr58/X6fwEAfP1sAAAAeJxjYGRgYADio9r3f8Tz23xl4GZ+ARRhuFjx5xSC/t/OfIVZGcjlYGACiQIAmCUOCgAAAHicY2BkYGAO+p/FEMX8ggEImK8wMDKggkQAZVcEPgAAeJxjfsHAwDyKBxQDANn1WQwAAAAAAAAAADIApAEKAawGyAccCkIKggs2C14LeAwiEWwR8hJ0Et4S/hNYE+wZEBliHKocxh2YHcYd8B5GHpofEh+WH9wgMCB8ILYg/CGAIjAihiLQIyojqiPCI/wkaiS+JSYlpCXsJhwmoidAJ4AnrCgAKEwojCjGKQopVCmWKhoqjirgKxosCi5wLwovbi+WL9IwSDDIMioynDXMNfw2mDbgN4g4WjjUOjI7iDv+PM48/j9OP4g/qkB2QOZGFEYuRlZGjkbOeJxjYGRgYEhkSWIQYQABJiDmAkIGhv9gPgMAHksB8gB4nF2PvU7DMBSFT9q0QCsxgEBi84AQAin9YUD0AZrOrdQ9P07aKrGjxK3Up2HkCRgZeQokFl6Ek9R0IJbj7373XEcBcIFvODg8V9wHduCyOnALJ7ix3KYXll2uW8sd9HFvuUv/ZLmHRzxb7uMSIW9w3DNWD9hadnCKV8stnOPNcpv+3bJL/rDcwTU+LXfpvyz3sMSP5T7unJcoyLcqDsRClrt1JCvh5+EsLHI1l+k2C8oa672UZbXWSoy8YV36UskyMDIW4V5Uu3RsTCKSUudiqpWRWaZFUeqNjIy3MqaYDAaJ9V6kc0QIkPPnFGKSwAISJXZYsyNR0fjsh5hxFySFOX3KiYz58mj/zmUzX3FesxIYwcPw2PXZVU0igOEZMxFiz3fFb6YY0xokrBNmNGcEps1NdTrj0jRF09vQRPQeVs1UgQkGXMm/vMcUb/oFZv1ifgAAeJyVVfl7EzcQ9aMhaWyHGDsEShuOhEChXe6e9D44erdA70tezxerkaWtpE3Cf1+tJHs3xOvP9Q/7eTWamTdv3sw2jjXCr9mY/mONBo7hBSzgOBaxhBexjCZaaGMFJ7CKDk6iix7WcArrOI0zeAln8TJewQbO4Twu4CI2sYVL2MZlXMGruIpreA2vI8F13MBN3MJt3MFdvIE38Rbexjt4F/fwHt7HB/gQH+FjfIJP8Rk+x308wEM8whf4El/ha3yDb/EdvscPeIwneIof8RN+xi/4Fb/hd/yBP/EX/gZrm1TTfrKvSabD41YzM+zsMEv77FmSMc2EIHGeS0t6RAPuDAntkbRJymw6dE+ZkrhVa5dKJt6o88xyuZOMyBi2Q2eMZdqOr6pRRtIwy5W8XjUc8R4DSka5sDwT1BJKZcmI6V3Sy7khnVhmdlf6ueHSZUp0LqhbevF4dWtmFsN3JBM35i/K8hHpa7X3j6DeruezQkVr3IYDpZupkpLS4rhDcjDxKdjfnBFNDnjhc2/+Wo6APXW4VTHi5kwGPSFnDf2bOzNnFeaTXZVxWhwxmTOxpCklvkddk/eTTKu0aFm4t1GNfwTTyarVpVW6XqKhm+dq7d59vUJqpQVrDtgYV6qEYJmhQa9ySAcZkwMaLBSyWy2D+KBb9TlNyoTPUI/Lc7h+qNCJV7d6HArsHtK8H4NFN9o8swvG4VpxriJhTkF73D47xJ9P1KuexCE9PQWbazVt1GIWXO6uVViYAF61dGATJqWy/n2pn42cZtTqWOMF64IOuuN3H6DPHN3t8VGRujl+UbpX5inQcOksldkIrJwoDwr3bvk6kVLlKJRd8SnquVBbbbw/bZrtUKv956RUJTgmbw6YZW50sty2wkj4xi25RbbHU1ooNlo7Dom3tLyD6v/jdkHnuRGkaXoLQMpGXKyvJmK6O/+uKMNOk0RIXVB4eeaymOyUWFxuCzqCdn3Ry4WA/b/Al7FK05WZMUtk09oXkMX23f4fH69I0c35XYIMp7EeQcSQl2aWE6GusEEyVGlcke2oksBR8fAq6FVVF69uz44eMUzboQFlqOLO/GWXPXW72/KUuzVpmyZjBVylRKf8noX0TcGMUd7WaPwHzaxe+gA=') format('woff'),
+ url('data:application/octet-stream;base64,AAEAAAAKAIAAAwAgT1MvMj4LSaoAAAEoAAAAVmNtYXC5NgKZAAADBAAAAVpnbHlmds5ixAAABSQAAI2caGVhZAXlPSMAAADQAAAANmhoZWEHggO0AAAArAAAACRobXR4eugAAAAAAYAAAAGEbG9jYRCbMgAAAARgAAAAxG1heHABfwRuAAABCAAAACBuYW1lejh1lQAAksAAAAI9cG9zdO2Ce20AAJUAAAAJeAABAAADUv9qAFoD6AAAAAAD1AABAAAAAAAAAAAAAAAAAAAAYQABAAAAAQAAxSvf+F8PPPUACwPoAAAAANF4/MoAAAAA0Xj8ygAA/4cD1AMjAAAACAACAAAAAAAAAAEAAABhBGIAFAAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQPoAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6ADoYgNS/2oAWgMjAHkAAAABAAAAAAAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAAAAAMAAAADAAAAHAABAAAAAABUAAMAAQAAABwABAA4AAAACgAIAAIAAgAA6FzoYOhi//8AAAAA6ADoX+hi//8AABgBF/8X/gABAAAAAAAAAAAAAAAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgCkAQoBrAbIBxwKQgqCCzYLXgt4DCIRbBHyEnQS3hL+E1gT7BkQGWIcqhzGHZgdxh3wHkYemh8SH5Yf3CAwIHwgtiD8IYAiMCKGItAjKiOqI8Ij/CRqJL4lJiWkJewmHCaiJ0AngCesKAAoTCiMKMYpCilUKZYqGiqOKuArGiwKLnAvCi9uL5Yv0jBIMMgyKjKcNcw1/DaYNuA3iDhaONQ6MjuIO/48zjz+P04/iD+qQHZA5kYURi5GVkaORs4AAgAA//wDugLAABIAGgAAASIOAhQeAjM+ATcHJz8BLgEJAQYWFwEuAQL0Kks7ICA7SypGahaVdD6dHk7+3f4zCTMmAcMbJALAIDtLVEs7IAFPQihNfCogI/7q/sQiSwUBNhc+AAUAAP/AAzkC6AASACMAKAA3AEQAAAEiBh0BBwYUFyE2NC8BNTYmKwEFIgYVEx4BMyEyNjcTNiYjIQUpAQMhEyIjDgEXEx4BPgEnAy4BJSIGBwMGHgE2NxM2JgGtKh2sDw8CcA4OqAIbLkf+4gsNMgENCgHJCg0CQAENDP7i/v0BAwEDO/5iSwECDA8CLAIRGAwCLAINAQ4KDwIsAg0XEQIsAg8C5wgsCTgFFwIBGAU3CiwIzA8L/dUJDQwKAioMDzH+BwGwARIM/sAMDQMSDAE/Cg0BDQv+wQwSAw0MAUAMEgAAAAMAAP+aA7gDIgAQABQAQgAAASIHAQYUFwEWMjcBNjQnASYHCQIlMCMPAxUjDwMVHwMzFR8DMz8DNTM/AzUvAyM1LwMB9A4M/mEKCgGfCx4LAZ8LC/5hCw8Bhv56/noBewICBAMBwgQEAwEBAwQEwgEDBAQWBAQDAcIEBAMBAQMEBMIBAwQEAyIL/mELHgv+YQoKAZ8LHgsBnws+/nr+egGG5QEDBATCAQMEBBUFBAMBwgQEAwEBAwQEwgEDBAQWBAQDAcIEBAMBAAAAAAYAAP+NA80DIgAOAB0ALAA7AFAAYAAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BBwYHFwYHFhc3FzY3Jic2NyYnBgcmJxYXNxcHFwcnBgcnNjcmJwHzqv8AFhCGgXwBEc5HWtWHERed6REMkIKB/vxPTQdYOZ9hkNIHBJ+AeN04NSxcMXpDf7YCAZl2b74jH0teJFFGKyxwODYqLG5xKy05ODg2Kiw3Nzg5OThuNG9xNXE2ODQ4Nzg5AyIC4amP/UE8IrgBCAECpQoCMQHQm4rqMC1Pb3EBEGlETivIkIPPHRdobW3wUSswMAG0f3azDwx2a2jNNxUWby0rcTY4LCpucCwrOTg3NywqNjg4Fjg5bzRucTVxNzg0ODY5OAAAABEAAP+jA7gDIgADAAYACwBOAKYA/AE/AZQB8QI8An4CwgMFA1wDqQP1BD8AAAERIREFMwc3FSE1FxExIwcjByMVIwcjDwcVHwQzNzM3MzczNzM3MxczFzMXMxczFzM/BTUvBSMnIzUjJyMnFyMPBR8ZPwQ1LwMjJzUnNScjLwEjLwE1JyMnNS8BIy8BNSc1JyM1JyMnIy8BNS8BIyc1JyMvAQUjDwIVByMPARUPAhUHFQcVDwEjDwEVDwIVDwEjDwEjDwEVBxUPASMPAhUfBTM/GTUvBCExIxUjDwMVHwQzNzM3MxczFzMXMxczFzMfBjM/BTUvAiMvCSMnIycjJyM1ByMPAiMPARUHIw8BIwcVByMHIwcjBxUPAyMVDwEVDwIjDwEfBTM/HTM/Ay8DBQ8FHxYVHwQzPwQ1JzUvCDUnNS8EIycjJzUvASMnNSc1LwE1Iy8BNScjJzUvAjUvAwUjDwUVIxUHFQcVIxUHFRcVMxUXFRcVFxUfCTM/BDUvAjUnNSc1JzUnNSc1NzU3NTc1NzU3NS8EBSMPAxUHFxUHFQcVBxUHFQ8IFR8DMz8GNTc1Pwc1NzUzNTc1NzUnNS8DBSMPAxUXFRcVFxUXFR8HFRcVHwIzFR8DMz8ENS8LNSc1JzUnNSc1LwQFIw8FFQcVDw8VHwU/AjU/ATU3Mzc1PwIzPwo1Ny8EBQ8FHwIVFxUXMxczHwIzHwEzFRcVFxUXMx8BMxczFxUXFR8BFR8CFR8CMz8FNS8cBSMPCCMHIwcjByMHIwcjDwQVHwUzNzM3MzczNzM/CzM3Mz8BNT8BNTc1PwQ1LwQFDwUVHwUzHwEVFzMXMx8BFR8BMxcVHwQzFzMfBjM/BTUvFiEjDxcVHwYzPwgzPwQ1NzM3Mzc1PwE1PwEzPwQ1LwQBJwGa/sHkcpz+yJwLBgsFDAUFBiYGCggEAgMBAQIGBAkEKwUJBQUFBQoFHgUKBQUFBQoEGAkFBAMEBAEBBAMEByYFBgULBgsG9AUEBQMEBAICCAIMBwgHBAMEAwQDBwYHDwIJAgMRBAMECQkEBAMEAQIDAgECAwIBAhIBCQQGAQMEAwEDCAQDAQMBAwEIBAQEAQQIAQQK/fEFBAgFBAEEBAQMBAQECAMBAwQDBAMECQEPAgECAwMFAgEEAwMBAgMDCAQJBQcFBRAGAgYCDwcGBwMEAwQDBAcIBAQHAgECAgMECAEEEg0KBQcGAgIDCAgEAQgEJgQIAwQEBAcECAMaAwgHBwMJBQQEBAMEAQQDBwEDBQQEBAQECQQmBAkFBAQFDa0ECAYHAQMIAwEVAwEDAwEJAQwBCQkDAwIBAgMDCAQBBAICAgMDCAQFBAkDCAMCBAMCAwIDAgMCAwMDAgMDAwMDAwMDBgMjAgMEBAICBQQIAYQFCAQDAwMBBgMDAgMCAwIDAgMHFgEEAQQBBgMCAgQEAwQFCQQEBAMEAQICAgECAQIBAgICAQEBCAEBAQICBAECBwMCAQIDAgECBgMJAwMDBP3DBQQIAwMCAgECAQEBAQEBAgEIAgEBAQMDBAQEBQkEAwMEAQIFAwIBAQEBAQECAQECAwMJAu4FBAgGAgEBAQEBAggCAQICBAEWAQEEAwwFCQQGBQQDCgIIAQIBAgICBwEBAQEBBAMECPynBQgIBAIBAQECBgICAgEEAQYCCgMEAQMGBAUJBAQEAwQCARIBAgECAQICAgcCAQEBAQIHAwUC8AQFBAQDBAICBwIDBQIEAQIDDAoDBAIEAQEEAwQECQgFBwMPAgEGBQgBAQEGAQIBAgECAgIJAQICAwQI/a0ECAQDAgICBQYMBgEMAQYHAwEDAwEHBwMBBwcBAwEDBAgEBAwEBAQECQQEBAUCAQEEBAMVAwQKBxkDCgIDAwMDAwMDAgYDAgMCAwIIAZwFBAQBBwocCwcSBAsEBwQEBwQIBBAIBAMCAgEEBAMEBQwFDQQFBAUIBSYECQQEBAQEBAEEAwEDAQMEBAgECQQCAgECBgMEBf5EBAUEBgICAQIDAwUEAQQNCQENAQQFBQQBBAUFCgUZAQQBFAYFBQULCgkFBAQDBAECAwMEBxMFBAUFBAUFBCUeCAQECQwDDQISBQQFAwEUBAQJCBYsBQUEBQUFBAUbBAYEAQECAwMEBAQJAwYFCwUFBQYUAR4FCgUFBAEEAQQFHA0EAQQFAwIBAgIDBAgB+v7IATgxWj66un0B8gEBAQEHAgIEAwQEBAkEBQYDAgkCAQEBAQEBAgUBAgMDCAQFBAkDAwMHAQEBAVMBAgIEBwkJCgEJBwYHAwQDBAMEBwgHFAQNBAQgAwMCAgICAwMICQUGBQUEAQQBBAUcDQQBCAQBBAQECAEDAQMBAwQIAwEDBAMBBgQHCAEEBAEDBAMBAwwDAQMBAwEIBAQEAQQEBAEEDRcFBQQBBAEJBQoFDAQFBAQDBAECBQcMHggECQQUBwgHBAMEAwQDBwYEAwcFBAQJBAQDBAECAgUMBQkEAwYCAQEBAQECAgcCAgMCAgIBAgMDCAUJCAMFAgECAQIBAgICCQIBAQEnAgMFAgQBAg8DAgECCQwJAQkEAwMBAwMBAwsHBwkJBAMEBAEBBAMMAwQGAwMCAwMDAwMDAgMDAgMCAwIDAgMEAxYDAwgJCQcDBDsBAgMDBA0FCwIDAwMDAwMCAwMKIwMHAwcEDgsDBwMIAwMCAQEDAgQICQQCBAkEBAQEBAUDAQMBAwQBAxAEAwEDCAMBCgEDAwEDAwEDAwEGBAkBAwIDA6kBBAQDBAgEBAkFBAkNBBsFDQkEBAkEAQQiBAUBBAQDAwIBAgIDBAgJBQQSBAsEBwQEBwQIBB4ECAQHBAQHBAQJBAQEAwQtAQQIBAQEBB4FCgUFBQUJBScFBAUJCgQyBAUECAQGAgIGCAoFGQEEARQGBQUFCwYmBQYFCwYLBhYGCQgDAwQQAgYICAkGEQUGBQYLBSEGCwUFCgYPAQQBGQUKAQQGAgEBAwIECAkIASkEBQUEBQUJBSIFCQUFBQUKBRcFBAcCAjkBAgMDCAcEBwQaAwsLBwYEAwcUDwMHAQgFBAUIAwMCAgICBwEDFQEDCwEHEAQEDAQEBAQEBAkEJgUFCAQEAwSgAQQDAwQJCQkGAQwBBgwGBQMDAgEEAQQBAgUEAgIBAQEEAQEBBgEBAQIBAQIDBwUEBQQIAwMJAgEGAxADBgMCAwIDAgMCAwYCAwMDAwMHSgECAQMGDAMDBQMCAQEBBAMDBAkFBAgDAwIBAQEBAgkCAgIBAgECAQEBAgICAQEBBAEBAQUEAwUEBQgIAwIBJwEBAwYECQUEBAQCBQMECQEGCQMCAQIDAgECAwQDCgIIAQIBAgIDAQIDAwgFBAkEAwMDBAIBAgECAQIBEBAGAgMFCQMKAQICAg8CAwUGDBQBAgECAQIBAgYCBgkEBQQEBAMDAgEBAQICAgECAQgMAwQDAgECAwIBAhIBCQQDBQQEBAUJBAMDBAAAAAUAAP+HA78DIgAPAB4AJgAqAC8AAAEOAhIWBDc+ATc2JicuAQcyFhcWBgcGJCcmAjc+ARcGBxc1FxEHJxQVJyUUFSYnAfSJ4mkwugECfoGkCAeJeC9mNIfXJiJUaXD+8WpnPzMwyWppaNHKyhiPAVlHSAMiAZb5/vbCPiwu3ImH6D0XGDGjgnvxS08LVlYBA3twhv9KSpSPjwEoj2BkZWRlZGYzMgAAAAkAAP+iA7gDIAALABcAUgC7AUQBoQHoAjICngAAARUjFTMVMzUzNSM1BzMVMxUjFSM1IzUzEysBByMHIwcVDwUVHwUzPwMzNzM3MzczFzMXMxczHwEzPwM1LwQjNSMnIycXDwYVHwozHwYVHwIzHw0zPwQ1LwE1JyMvBiMvATUjLwsjLwEjLwcjNSc1LwQjBQ8BIw8EFQ8EFQcjBxUPAyMVBxUHIxUPBBUHIw8BFQ8CFQ8CIw8DFQ8DFQcVDwoVBxUfBD8EMz8ENT8mNS8DAQ8FFRcVBxUHFQcVBxUHFQcVBxUHFQcVBxUHFQ8HFR8EPwUzPwEzPwE1PwEzNzM3NTc1MzU3NTc1NzU3NTc1NzU3NTc1JzUvBAUPBRUXFRcVFzMfBTMfARUXFRcVFxUzFxUXFR8EPwQ1Lw01JzUnNSc1LwMBDxcfBD8EMz8DMzczNzM3MzczNzU3Mzc1NzM/AjM3MzU/AzUvBAUPBRUfAxUfATMfAjMfAhUfATMfARUfATMXMxczFzMfAjMXMxcVMx8HMxcVFzMVMxczPwQ1LwQjJyMnIycjLwojLwQjLwUjAa59fYx9fXVefX1efX0zBw0GDQ0HJw0OBAMDBAECAwMJBAUGDAYXBgsGBgYGKQYGBgYGBR8EBQwDAwICBgMKJwYHBg0H6QUEBAMDAQICAgYCAgMGBQQDCAEOAggCBgIEAQICAQIDAgMFBAMEAwoFBgMJBAkEBAMEAgQGAQQDAgMCAwIBAggBBQMEAgQCAgUCBwICAQIJAQICAwcDAgMCAQIDAgYCCgX98wUHAQIDAgMCAwIDAgMEAQICAwIEAQQEAQICAgICAgECAgIEAgIEAQEBAgMCAgoBAgICAQQBAgECAQIBAgIBBAQDDgQIBAMBAQIDAQICAgECAQIBAgECAgMCAQIIAgECAgIBBAIEAQYCCgIGAwoDBgMFAwIBBAYIBQKyBAUDBgIBAQEBAQEBAQIBAwUDBQMEAwIGAwECAwYECQkEBAMCAQEDAgECAwMCAQUBDAMBAgEBAQEBAQEBBAMEBAj8pgQFAwQEAQEDAgEDAgEEAQoBBAMCAwIBAgMBAgQHCQkEBAMEAgQCAwIHBAEGAQIBAggBAQEBBQgIArEEBAkEBQoEDwUFCw8GBQsFIQYLEAgEBQICBAMEDQkGBhQFARIGBwUBBQEFAQUBHAELBQEFBQEFCw8BBAEDAwIBBAMEBAj93gQEBAMCAgECAwQNAgECAwIBAgMDCwIBCAMDBQECAQIBAgECAwMBAgECAQIEAwYDDQMdAgMNBAMNCQUIBQIBBAMEBAMECAMUAhEDCQURAgYFAwUFBQIBDwIFAgIBBAMEEQQEBQIhfYx9fYx9F31efX5dAZMBAgYBAgQCAwQICQUEBAMEAQICAgQCAQEBAQEFAQYEAwkFCAgCBAYBAQFPAQEDAwQEBAUJBAYBAgEGAwQCCA4DCAMGAwQBAgIDBAMEAwcHAwgDEgoIAgQCAgMDCAoHBwEMCAQEBAQEBAQLAQcDBgIGAgMFAwcDAgMJAwICBwICAgIBAQECAgQCBQwBBAICAgICAQICAgICAQQCAQICAwQBBAEEAQIDAgMCAQIDAgECBgIBAgYDAwIFAgECDwMCAQIBAgMGAwMDAwMDAwMBBAkFCAMDAwEEAwMEBgUDAgUBAgMCAwIDAgMDAgUCAwIMAgMCAwIDBAMEAwYDCgMGAgoBBgIFBAQECQkGBAH+xgECAggEBAQEMwMJAwYCBgMDAwMDAwYCAwMJAg4DCAENBQsFBgoHBAUJBAYCAgICAwMDAwYGBgUBBQcPJgMKAwMHAwMEAwMEAwMEAwcDDgMsBQkIBAIDAhMBAgMDCAQbBgcTBw0TBgcNBh8NBQEFAQUBBQEFAQUBAQQEBAICAgMDCQkIBgYFBhALBhEFBgYFLwYFBgYMBgcFBwYC/rIBAgYEBAYECQQDBQkCAwQDDAEEAwQDBwkJCAMDAwICAQYCBgMCAwIDAw8GAQMDAQMEBwwEAQMEBAQJCAQDAgICAQMCBAQJBAUEBAMBCgICAgICAgEBBwIFAQEBAwICAQIBAgEBAQEBAgICBAIJAQEEAQQBBAcFBAkIBAIDAQMHBgMDBgICAwEDAgMCCQIDAgEEAQQNAQIAAAABAAAAAAMxAqAAJwAAAQ4BBxQWFxYXBxc3NRUnNQcXJicuATU+ATceARcOAQcjFTM+ATcuAQH0h7MDMispN70CyCUKIjInKjADrYODrQMDrYMFBYezAwOzAqADsoVCcSspGCEKIwMByAUCuhcmKm4/gawDA6yBgawDCgOyhYWyAAUAAP/TA9QC6QAPAB8AOwBbAHYAABMOAQcRHgEXIT4BNxEuAScFIR4BFxEOAQchLgEnET4BFyMOARUeARcOAQcOAQcVITUuAScuASc+ATUuAQc2Fx4BNxYVFAYPARceARcOASImJz4BPwEnLgEnNT4BFxYXHgEXFSM1IxUjNTQiHQEjNT4BPwEeATI211JvAgJvUgI6U24CAm5T/cYCOjpMAQFMOv3GOkwBAUzFAygvARUNByASFiECAVwBIxcUIQgNEQEwQA0MHDAGARINBAQDGA8CNFA1AhEZAwQDDhYBBSKSCQkWIQE5BdgFNwIfFQsDOFI3AukCblL+blJuAgJuUgGSUm4CPAFLOv5uOksBAUs6AZI6S2QBMCUTIAwCDQoMHxV/fxIfDAsPAwwfEyUwMgEHDgsEBAQSIAsDAgEICCEtKyIICQEBAwwgEggGFHgEBQweD3paWloCAlp6Eh4LBiMsLQAAAAUAAAAAA4AChAAEAAgADAAQABQAABMZASERBTMVIzchFSEHMxUjNyEVIWgDGPztvb3CAkz9tMK9vcICTP20AoT+2v7bAkvChISEBfv7+wAAAwAAAAADNgK8AAMABwALAAATETMRMxEzETMRMxGygn+Cf4ICvP1EArz9RAK8/UQCvAAAAAkAAP+iA7wDIgADAAgAFgAiAC4APABKAFYAYwAAAQYHIQMWFyE2Ew4BBxY2FzYWFzYmByYXBhYXFhcWNicuAScFDgEHDgE3PgE3PgEBBhYHBgcUNjc+AScuAQUGFhceARcWJicmJy4BAQ4BBw4BFz4BNzYmIQYWFx4BFzYmJyYvAQH0YGABgMBLTP7STE8kVRIQRh4ePB0fSB8M7ik1Fi0fIA0WGT4o/fEmNBcUFysXKRwTJwKSHwoHCyA1BBcTBgIN/KQhDAMIFhUtGgsSAQIMAq4lRykdKiE5ZywKDP3TJTMbIkonISscTDwGAjKsrQEmh4eHAagDAyEfFgECCAIiGAIBTxA0EzI7EjYVKUgZChFBIRZKBSBFHRAt/tYMRh1BPCIKHjJtNggIEgtHHCNEHgNKHD0/CAv+sxMvDAEnFAozJQwbEjQNExwGEyYCFjMDAAARAAD/owO4AyIADQAaACkAbADCASABawGuAgYCUwKWAu4DRAOGA8sEFwRhAAABIg4BHgI3PgImJyYHMh4BBgcGLgI3PgEXBgcOARcWNjsBNSM2NyYnKwEVIw8DFR8EMzczNzMXMxczFzMXMxczHwYzPwU1LwIjLwkjJyMnIycjNQ8EIw8BFQcjDwEjBxUHIwcjByMHFQ8DIxUPARUPAiMPAR8FMz8dMz8DLwMjBQ8FHxYVHwQzPwQ1JzUvCDUnNS8EIycjJzUvASMnNSc1LwE1Iy8BNScjJzUvAjUvBAUPBRUjFQcVBxUjFQcVFxUzFRcVFxUXFR8JMz8ENS8CNSc1JzUnNSc1JzU3NTc1NzU3NTc1LwUFDwUVBxUPDxUfBT8CNT8BNTczNzU/AjM/CjU3LwQjBQ8FHwIVFxUXMxczHwIzHwEzFRcVFxUXMx8BMxczFxUXFR8BFR8CFR8CMz8FNS8dBQ8IIwcjByMHIwcjByMPBBUfBTM1MzczNzM3Mz8LMzczPwE1PwE1NzU/BDUvBCMDKwEHIwcjFSMHIw8HFR8EMzczNzM3MzczNzMXMxczFzMXMxczPwU1LwUjJyM1IycjJxcPBR8ZPwQ1LwMjJzUnNScjLwEjLwE1JyMnNS8BIy8BNSc1JyM1JyMnIy8BNS8BIyc1JyMvAgUPAhUHIw8BFQ8CFQcVBxUPASMPARUPAhUPASMPASMPARUHFQ8BIw8CFR8FMz8ZNS8EIwEPAxUHFxUHFQcVBxUHFQ8IFR8DMz8GNTc1Pwc1NzUzNTc1NzUnNS8DIwUPBBUXFRcVFxUXFR8HFRcVHwIzFR8DMz8ENS8LNSc1JzUnNSc1LwQjEw8EFR8FMx8BFRczFzMfARUfATMXFR8EMxczHwYzPwU1LxcFDxcVHwYzPwgzPwQ1NzM3Mzc1PwE1PwEzPwQ1LwQjAfRBbDEXWHs7Pk4GQzksMTxfHSwxNHhXDSEZTmQdHQ4EDAgPB1lZGx0KQwQODQoFBwYCAgMICAQBCAQmBAgDBAQEBwQIAxoDCAcHAwkFBAQEAwQBBAMHAQMFBAQEBAQJBCYECQUEBAUNsQUDBgcBAwgDARUDAQMDAQkBDAEJCQMDAgECAwMIBAEEAgICAwMIBAUECQMIAwIEAwIDAgMCAwIDAwMCAwMDAwMDAwMGAyMCAwQEAgIFBAgFAYQEBAQDAwMBBgMDAgMCAwIDAgMHFgEEAQQBBgMCAgQEAwQFCQQEBAMEAQICAgECAQIBAgICAQEBCAEBAQICBAECBwMCAQIDAgECBgMJAwMDBAn9xwQIAwMCAgECAQEBAQEBAgEIAgEBAQMDBAQEBQkEAwMEAQIFAwIBAQEBAQECAQECAwMJBAKNBQQEAwQCAgcCAwUCBAECAwwKAwQCBAEBBAMEBAkIBQcDDwIBBgUIAQEBBgECAQIBAgICCQECAgMECAX9rgQEBAMCAgIFBgwGAQwBBgcDAQMDAQcHAwEHBwEDAQMECAQEDAQEBAQJBAQEBQIBAQQEAxUDBAoHGQMKAgMDAwMDAwMCBgMCAwIDAggOAaUEBAEHChwLBxIECwQHBAQHBAgEEAgEAwICAQQEAwQFEQ0EBQQFCAUmBAkEBAQEBAQBBAMBAwEDBAQIBAkEAgIBAgYDBAUEpwUGBgsFDAUFBiYGCggEAgMBAQIGBAkEKwUJBQUFBQoFHgUKBQUFBQoEGAkFBAMEBAEBBAMEByYFBgULBgsG7wQFAwQEAgIIAgwHCAcEAwQDBAMHBgcPAgkCAxEEAwQJCQQEAwQBAgMCAQIDAgECEgEJBAYBAwQDAQMIBAMBAwEDAQgEBAQBBAgBBAoI/fQECAUEAQQEBAwEBAQIAwEDBAMEAwQJAQ8CAQIDAwUCAQQDAwECAwMIBAkFBwUFEAYCBgIPBwYHAwQDBAMEBwgEBAcCAQICAwQIBAKvBAgGAgEBAQEBAggCAQICBAEWAQEEAwwFCQQGBQQDCgIIAQIBAgICBwEBAQEBBAMECAT8pgQECAQCAQEBAgYCAgIBBAEGAgoDBAEDBgQFCQQEBAMEAgESAQIBAgECAgIHAgEBAQECBwMFBJQFBAYCAgECAwMFBAEEDQkBDQEEBQUEAQQFBQoFGQEEARQGBQUFCwoJBQQEAwQBAgMDBAcTBQQFBQQFBQQlHggEBAkMAw0NAhoEBQMBFAQECQgWLAUFBAUFBQQFGwQGBAEBAgMDBAQECQMGBQsFBQUGFAEeBQoFBQQBBAEEBRwNBAEEBQMCAQICAwQIBAI0SXd8Wx4VFmqCbRwVJ0lybB4fDld7NCUrMTU2AxoHBQkZMzMG7wECAgUMBQkEAwYCAQEBAQECAgcCAgMCAgIBAgMDCAUJCAMFAgECAQIBAgICCQIBAQEnAQEDBQIEAQIPAwIBAgkMCQEJBAMDAQMDAQMLBwcJCQQDBAQBAQQDDAMEBgMDAgMDAwMDAwIDAwIDAgMCAwIDBAMWAwMICQkHAwQ8AQEDAwQNBQsCAwMDAwMDAgMDCiMDBwMHBA4LAwcDCAMDAgEBAwIECAkEAgQJBAQEBAQFAwEDAQMEAQMQBAMBAwgDAQoBAwMBAwMBAwMBBgQJAQMCAwMCqwEEBAMECAQECQUECQ0EGwUNCQQECQQBBCIEBQEEBAMDAgECAgMECAkFBBIECwQHBAQHBAgEHgQIBAcEBAcEBAkEBAQDBAF3AQIDAwgHBAcEGgMLCwcGBAMHFA8DBwEIBQQFCAMDAgICAgcBAxUBAwsBBxAEBAwEBAQEBAQJBCYFBQgEBAMEoQICAwMECQkJBgEMAQYMBgUDAwIBBAEEAQIFBAICAQEBBAEBAQYBAQECAQECAwcFBAUECAMDCQIBBgMQAwYDAgMCAwIDAgMGAgMDAwMDBwNNAQIBAwYMAwMFAwIBAQEEAwMECQUECAMDAgEBAQECCQICAgECAQIBAQECAgIBAQEEAQEBBQQDBQQFCAgDAgECzgEBAQEHAgIEAwQEBAkEBQYDAgkCAQEBAQEBAgUBAgMDCAQFBAkDAwMHAQEBAVMBAgIEBwkJCgEJBwYHAwQDBAMEBwgHFAQNBAQgAwMCAgICAwMICQUGBQUEAQQBBAUcDQQBCAQBBAQECAEDAQMBAwQIAwEDBAMBBgQHAgoBBAQBAwQDAQMMAwEDAQMBCAQEBAEEBAQBBA0XBQUEAQQBCQUKBQwEBQQEAwQBAgUHDB4IBAkEFAcIBwQDBAMEAwcGBAMHBQQECQQEAwT+xQEECAQEBAQeBQoFBQUFCQUnBQQFCQoEMgQFBAgEBgICBggKBRkBBAEUBgUFBQsGJgUGBQsGCwYWBgkIAwMEEAEBBggICQYRBQYFBgsFIQYLBQUKBg8BBAEZBQoBBAYCAQEDAgQICQgBKQQFBQQFBQkFIgUJBQUFBQoFFwUEBwIC/rIBAwYECQUEBAQCBQMECQEGCQMCAQIDAgECAwQDCgIIAQIBAgIDAQIDAwgFBAkEAwMDBAIBAgECAQIBEBAGAgMFCQMKAwMBAgICDwIDBQYMFAECAQIBAgECBgIGCQQFBAQEAwMCAQEBAgICAQIBCAwDBAMCAQIDAgECEgEJBAMFBAQEBQkEAwMEAAYAAP+NA80DIgAOAB0ALAA7AEgAVQAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BBxQVIxUzFTM1MzUjNQcyMxUzFSMVIzUjNTMB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRE5+fep+fYSQln59JoKADIgLhqY/9QTwiuAEIAQKlCgIxAdCbiuowLU9vcQEQaUROK8iQg88dF2htbfBRKzAwAbR/drMPDHZraM03FRZdTk58nJx8nBidSp2dSgAAAAAHAAD/jQPNAyIADgAdACwAOwBDAEcATAAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BFwYHFzUXEQcnFBUnJRQVJicB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRGmlo0crKGI8BWUdIAyIC4amP/UE8IrgBCAECpQoCMQHQm4rqMC1Pb3EBEGlETivIkIPPHRdobW3wUSswMAG0f3azDwx2a2jNNxUWo0pKlI+PASiPYGRlZGVkZjMyAAMAAP+aA7gDIgAQABQAQwAAASIHAQYUFwEWMjcBNjQnASYHCQI3MCMPBB8CDwIfBD8CHwI/BC8CPwIvBA8CJzUnAfQODP5hCgoBnwseCwGfCwv+YQsPAYb+ev569AICBA8DAQEDiYkDAQEDDwQEBQSJiQQFBAQPAwEBA4mJAwEBAw8EBAUEiYkEAyIL/mELHgv+YQoKAZ8LHgsBnws+/nr+egGGrQEDDwQEBQSJiQQFBAQPAwEBA4mJAwEBAw8EBAUEiYkEBQQEDwMBAQOJiQECAAAAAQAA/98DjwLtAA4AAAEGBAcWFwYHFhcBFhc2NwOPDf7Zey4s3d4REAG7LS1ASgLtB5U6Ky7g4BAPAcAsLn+OAAMAAP+NA8wDIwAPAB4AMwAAAQ4BBwYWFxYkNhInLgEnJgcyFhcWBgcGJicmNjc+AQcGBxcGBxYXNxc2NyYnNjcmJwYHJgHrqfsUD4qCegEMzEorLNqLEwl9swYDjHFuxyknSGMkUEYrLHA4NiosbnErLTk4ODYqLDc3OAMiBeSnj/0/OiO0AQWBhKoJAY6tfXK1FhNqaWrYOhUWbi0rcTY4LCpucCwrOTg3NywqNjg4AAAAAAoAAP+VA8cDIgARACEAMgBDAEgATABQAFQAWABcAAABIiMOAQcGEhYENz4BJy4BJyYHMjMeARcWBgcGJCYCNz4BFyIjDgEHBhYXFjY3NiYnLgEHMjMeARcWBgcGJicmNjc+AQcVESERBTMRIxMVMzUHFTM1BxUzNQcVMzUB8wECnPImHl3gARN2cXETFreFNj0FBZDdGxZwc3j+9LweRje0cAUFhcYSDoF2cOVISQhSM41QAwN2rQ0Kf2xqyzQzL1opYmQBLv7q/v4aysrKysrKygMiA8GWhf7/ogpJSfOGh8oiDjECu46B6z8/KccBD3VYZyoEsoR81iwoRGBl+186Qi8DoXVwux8dVmFl3kUgIXkM/pABfBj+tAEnGRlKGBhVGBhNGBgAEAAA/6MDuAMiAAsAFwBaALIBCAFLAaAB/QJIAooCzgMRA2gDtQQBBEsAAAEVIxUzFTM1MzUjNQczFTMVIxUjNSM1MxMxIwcjByMVIwcjDwcVHwQzNzM3MzczNzM3MxczFzMXMxczFzM/BTUvBSMnIzUjJyMnFyMPBR8ZPwQ1LwMjJzUnNScjLwEjLwE1JyMnNS8BIy8BNSc1JyM1JyMnIy8BNS8BIyc1JyMvAQUjDwIVByMPARUPAhUHFQcVDwEjDwEVDwIVDwEjDwEjDwEVBxUPASMPAhUfBTM/GTUvBCExIxUjDwMVHwQzNzM3MxczFzMXMxczFzMfBjM/BTUvAiMvCSMnIycjJyM1ByMPAiMPARUHIw8BIwcVByMHIwcjBxUPAyMVDwEVDwIjDwEfBTM/HTM/Ay8DBQ8FHxYVHwQzPwQ1JzUvCDUnNS8EIycjJzUvASMnNSc1LwE1Iy8BNScjJzUvAjUvAwUjDwUVIxUHFQcVIxUHFRcVMxUXFRcVFxUfCTM/BDUvAjUnNSc1JzUnNSc1NzU3NTc1NzU3NS8EBSMPAxUHFxUHFQcVBxUHFQ8IFR8DMz8GNTc1Pwc1NzUzNTc1NzUnNS8DBSMPAxUXFRcVFxUXFR8HFRcVHwIzFR8DMz8ENS8LNSc1JzUnNSc1LwQFIw8FFQcVDw8VHwU/AjU/ATU3Mzc1PwIzPwo1Ny8EBQ8FHwIVFxUXMxczHwIzHwEzFRcVFxUXMx8BMxczFxUXFR8BFR8CFR8CMz8FNS8cBSMPCCMHIwcjByMHIwcjDwQVHwUzNzM3MzczNzM/CzM3Mz8BNT8BNTc1PwQ1LwQFDwUVHwUzHwEVFzMXMx8BFR8BMxcVHwQzFzMfBjM/BTUvFiEjDxcVHwYzPwgzPwQ1NzM3Mzc1PwE1PwEzPwQ1LwQBrn19jH19dV59fV59fS8LBgsFDAUFBiYGCggEAgMBAQIGBAkEKwUJBQUFBQoFHgUKBQUFBQoEGAkFBAMEBAEBBAMEByYFBgULBgsG9AUEBQMEBAICCAIMBwgHBAMEAwQDBwYHDwIJAgMRBAMECQkEBAMEAQIDAgECAwIBAhIBCQQGAQMEAwEDCAQDAQMBAwEIBAQEAQQIAQQK/fEFBAgFBAEEBAQMBAQECAMBAwQDBAMECQEPAgECAwMFAgEEAwMBAgMDCAQJBQcFBRAGAgYCDwcGBwMEAwQDBAcIBAQHAgECAgMECAEEEg0KBQcGAgIDCAgEAQgEJgQIAwQEBAcECAMaAwgHBwMJBQQEBAMEAQQDBwEDBQQEBAQECQQmBAkFBAQFDa0ECAYHAQMIAwEVAwEDAwEJAQwBCQkDAwIBAgMDCAQBBAICAgMDCAQFBAkDCAMCBAMCAwIDAgMCAwMDAgMDAwMDAwMDBgMjAgMEBAICBQQIAYQFCAQDAwMBBgMDAgMCAwIDAgMHFgEEAQQBBgMCAgQEAwQFCQQEBAMEAQICAgECAQIBAgICAQEBCAEBAQICBAECBwMCAQIDAgECBgMJAwMDBP3DBQQIAwMCAgECAQEBAQEBAgEIAgEBAQMDBAQEBQkEAwMEAQIFAwIBAQEBAQECAQECAwMJAu4FBAgGAgEBAQEBAggCAQICBAEWAQEEAwwFCQQGBQQDCgIIAQIBAgICBwEBAQEBBAMECPynBQgIBAIBAQECBgICAgEEAQYCCgMEAQMGBAUJBAQEAwQCARIBAgECAQICAgcCAQEBAQIHAwUC8AQFBAQDBAICBwIDBQIEAQIDDAoDBAIEAQEEAwQECQgFBwMPAgEGBQgBAQEGAQIBAgECAgIJAQICAwQI/a0ECAQDAgICBQYMBgEMAQYHAwEDAwEHBwMBBwcBAwEDBAgEBAwEBAQECQQEBAUCAQEEBAMVAwQKBxkDCgIDAwMDAwMDAgYDAgMCAwIIAZwFBAQBBwocCwcSBAsEBwQEBwQIBBAIBAMCAgEEBAMEBQwFDQQFBAUIBSYECQQEBAQEBAEEAwEDAQMEBAgECQQCAgECBgMEBf5EBAUEBgICAQIDAwUEAQQNCQENAQQFBQQBBAUFCgUZAQQBFAYFBQULCgkFBAQDBAECAwMEBxMFBAUFBAUFBCUeCAQECQwDDQISBQQFAwEUBAQJCBYsBQUEBQUFBAUbBAYEAQECAwMEBAQJAwYFCwUFBQYUAR4FCgUFBAEEAQQFHA0EAQQFAwIBAgIDBAgCIX2MfX2MfRd9Xn1+XQGVAQEBAQcCAgQDBAQECQQFBgMCCQIBAQEBAQECBQECAwMIBAUECQMDAwcBAQEBUwECAgQHCQkKAQkHBgcDBAMEAwQHCAcUBA0EBCADAwICAgIDAwgJBQYFBQQBBAEEBRwNBAEIBAEEBAQIAQMBAwEDBAgDAQMEAwEGBAcIAQQEAQMEAwEDDAMBAwEDAQgEBAQBBAQEAQQNFwUFBAEEAQkFCgUMBAUEBAMEAQIFBwweCAQJBBQHCAcEAwQDBAMHBgQDBwUEBAkEBAMEAQICBQwFCQQDBgIBAQEBAQICBwICAwICAgECAwMIBQkIAwUCAQIBAgECAgIJAgEBAScCAwUCBAECDwMCAQIJDAkBCQQDAwEDAwEDCwcHCQkEAwQEAQEEAwwDBAYDAwIDAwMDAwMCAwMCAwIDAgMCAwQDFgMDCAkJBwMEOwECAwMEDQULAgMDAwMDAwIDAwojAwcDBwQOCwMHAwgDAwIBAQMCBAgJBAIECQQEBAQEBQMBAwEDBAEDEAQDAQMIAwEKAQMDAQMDAQMDAQYECQEDAgMDqQEEBAMECAQECQUECQ0EGwUNCQQECQQBBCIEBQEEBAMDAgECAgMECAkFBBIECwQHBAQHBAgEHgQIBAcEBAcEBAkEBAQDBC0BBAgEBAQEHgUKBQUFBQkFJwUEBQkKBDIEBQQIBAYCAgYICgUZAQQBFAYFBQULBiYFBgULBgsGFgYJCAMDBBACBggICQYRBQYFBgsFIQYLBQUKBg8BBAEZBQoBBAYCAQEDAgQICQgBKQQFBQQFBQkFIgUJBQUFBQoFFwUEBwICOQECAwMIBwQHBBoDCwsHBgQDBxQPAwcBCAUEBQgDAwICAgIHAQMVAQMLAQcQBAQMBAQEBAQECQQmBQUIBAQDBKABBAMDBAkJCQYBDAEGDAYFAwMCAQQBBAECBQQCAgEBAQQBAQEGAQEBAgEBAgMHBQQFBAgDAwkCAQYDEAMGAwIDAgMCAwIDBgIDAwMDAwdKAQIBAwYMAwMFAwIBAQEEAwMECQUECAMDAgEBAQECCQICAgECAQIBAQECAgIBAQEEAQEBBQQDBQQFCAgDAgEnAQEDBgQJBQQEBAIFAwQJAQYJAwIBAgMCAQIDBAMKAggBAgECAgMBAgMDCAUECQQDAwMEAgECAQIBAgEQEAYCAwUJAwoBAgICDwIDBQYMFAECAQIBAgECBgIGCQQFBAQEAwMCAQEBAgICAQIBCAwDBAMCAQIDAgECEgEJBAMFBAQEBQkEAwMEAAAAAAgAAP+aA7gDIgALABcAHAAgACQAKAAsADAAAAEOAQceARc+ATcuAQceARcOAQcuASc+ARcVESERBTMRIxMVMzUHFTM1BxUzNQcVMzUB9MD/BQX/wMD/BQX/wKzjBATjrKzjBATjFQEu/ur+/hrKysrKysrKAyIF/8DA/wUF/8DA/ywE46ys4wQE46ys49EM/pABfBj+tAEnGRlKGBhVGBhNGBgACgAA/6IDuAMgAA0AGgApAGQAzQFWAbMB+gJEArAAAAEiDgEeAjc+AiYnJgcyHgEGBwYuAjc+ARcGBw4BFxY2OwE1IzY3JgMrAQcjByMHFQ8FFR8FMz8DMzczNzM3MxczFzMXMx8BMz8DNS8EIzUjJyMnFw8GFR8KMx8GFR8CMx8NMz8ENS8BNScjLwYjLwE1Iy8LIy8BIy8HIzUnNS8EIwUPASMPBBUPBBUHIwcVDwMjFQcVByMVDwQVByMPARUPAhUPAiMPAxUPAxUHFQ8KFQcVHwQ/BDM/BDU/JjUvAwEPBRUXFQcVBxUHFQcVBxUHFQcVBxUHFQcVBxUPBxUfBD8FMz8BMz8BNT8BMzczNzU3NTM1NzU3NTc1NzU3NTc1NzU3NSc1LwQFDwUVFxUXFRczHwUzHwEVFxUXFRcVMxcVFxUfBD8ENS8NNSc1JzUnNS8DAQ8XHwQ/BDM/AzM3MzczNzM3Mzc1NzM3NTczPwIzNzM1PwM1LwQFDwUVHwMVHwEzHwIzHwIVHwEzHwEVHwEzFzMXMxczHwIzFzMXFTMfBzMXFRczFTMXMz8ENS8EIycjJyMnIy8KIy8EIy8FIwH0QWwxF1h7Oz5OBkM5LDE8Xx0sMTR4Vw0hGU5kHR0OBAwIDwdZWRsdCj8HDQYNDQcnDQ4EAwMEAQIDAwkEBQYMBhcGCwYGBgYpBgYGBgYFHwQFDAMDAgIGAwonBgcGDQfpBQQEAwMBAgICBgICAwYFBAMIAQ4CCAIGAgQBAgIBAgMCAwUEAwQDCgUGAwkECQQEAwQCBAYBBAMCAwIDAgECCAEFAwQCBAICBQIHAgIBAgkBAgIDBwMCAwIBAgMCBgIKBf3zBQcBAgMCAwIDAgMCAwQBAgIDAgQBBAQBAgICAgICAQICAgQCAgQBAQECAwICCgECAgIBBAECAQIBAgECAgEEBAMOBAgEAwEBAgMBAgICAQIBAgECAQICAwIBAggCAQICAgEEAgQBBgIKAgYDCgMGAwUDAgEEBggFArIEBQMGAgEBAQEBAQEBAgEDBQMFAwQDAgYDAQIDBgQJCQQEAwIBAQMCAQIDAwIBBQEMAwECAQEBAQEBAQEEAwQECPymBAUDBAQBAQMCAQMCAQQBCgEEAwIDAgECAwECBAcJCQQEAwQCBAIDAgcEAQYBAgECCAEBAQEFCAgCsQQECQQFCgQPBQULDwYFCwUhBgsQCAQFAgIEAwQNCQYGFAUBEgYHBQEFAQUBBQEcAQsFAQUFAQULDwEEAQMDAgEEAwQECP3eBAQEAwICAQIDBA0CAQIDAgECAwMLAgEIAwMFAQIBAgECAQIDAwECAQIBAgQDBgMNAx0CAw0EAw0JBQgFAgEEAwQEAwQIAxQCEQMJBRECBgUDBQUFAgEPAgUCAgEEAwQRBAQFAjRJd3xbHhUWaoJtHBUnSXJsHh8OV3s0JSsxNTYDGgcFCRkzMwYBSgECBgECBAIDBAgJBQQEAwQBAgICBAIBAQEBAQUBBgQDCQUICAIEBgEBAU8BAQMDBAQEBQkEBgECAQYDBAIIDgMIAwYDBAECAgMEAwQDBwcDCAMSCggCBAICAwMICgcHAQwIBAQEBAQEBAsBBwMGAgYCAwUDBwMCAwkDAgIHAgICAgEBAQICBAIFDAEEAgICAgIBAgICAgIBBAIBAgIDBAEEAQQBAgMCAwIBAgMCAQIGAgECBgMDAgUCAQIPAwIBAgECAwYDAwMDAwMDAwEECQUIAwMDAQQDAwQGBQMCBQECAwIDAgMCAwMCBQIDAgwCAwIDAgMEAwQDBgMKAwYCCgEGAgUEBAQJCQYEAf7GAQICCAQEBAQzAwkDBgIGAwMDAwMDBgIDAwkCDgMIAQ0FCwUGCgcEBQkEBgICAgIDAwMDBgYGBQEFBw8mAwoDAwcDAwQDAwQDAwQDBwMOAywFCQgEAgMCEwECAwMIBBsGBxMHDRMGBw0GHw0FAQUBBQEFAQUBBQEBBAQEAgICAwMJCQgGBgUGEAsGEQUGBgUvBgUGBgwGBwUHBgL+sgECBgQEBgQJBAMFCQIDBAMMAQQDBAMHCQkIAwMDAgIBBgIGAwIDAgMDDwYBAwMBAwQHDAQBAwQEBAkIBAMCAgIBAwIEBAkEBQQEAwEKAgICAgICAQEHAgUBAQEDAgIBAgECAQEBAQECAgIEAgkBAQQBBAEEBwUECQgEAgMBAwcGAwMGAgIDAQMCAwIJAgMCAQQBBA0BAgAAAwAAAAADUgKgAAMABwALAAATFSE1ARUhNQEVITWWArz9RAK8/UQCvAKggoL+/4KC/v+CggAAAAACAAAAAANvAoQAVQCrAAABIgc5AQYPAQYHOQEOARU5ARQWFzgBMR4BMxY3OQEyNjUxNiYrATUzMjY3NiYHIzUhPgE0JgchNTMxPgE1OQE0JisBByMiJyMiMDQHNj8CPgEnMSYnBzIXFhc5ARYGBzkBBg8CBgcGFhczFjM3MzEyFhQGKwEVITIWFAYjIRUhMTIWBzkBDgEjIRUzMhYVOQEOASMGJzkBIiYnOQEuATUxNDY3Njc+ATcxNgHMCwsrVHYrEggCAwUPTjrc2xIWARcSvfwTGQMGGRr+AS4YFRcW/tLiFhgYFmRyXhMLCwEBBQouEAsDCQoOBAIBCwoIAwoFChgXCgUBAgMNCxPQZBQVFBXnATMVExIW/s0BAxgVBQMVEv7/whIRARER29w5Sw8EAwIIEikjpyoLAoQIHDpRHzgdPh0VJRU/PwEBFRYXEhUOERsdARMBGS8XARMBGRgXGgEBAgEGCi4RECQOEAEEAQEODCEPBgoXFwsFBAUBAQEWLBcdEysXHRgZEAsfDxUUEgEBPT0VJBUdPhs3Hhd0HAcAAAADAAAAAAN4AoQAEgAVABsAABMwIjEGFREUMyEyNRE0JzgBMSEFIQUlBTMlESFzAQIDAwMCAv4f/ucC8f6H/oEBfgIBfv0CAoQBAv26AgICRgIBBeTi5+f9wQAAAAMAAP/dA3UC3wAEAAgAFAAAExURIREFIREhAREhFSERMxEhNSERcwMC/QgC7v0SAWP+6AEYKAEY/ugC3wX9AwMCCv0SAqP+6Cj+6AEYKAEYAAAAAAQAAP+HA78DIgAQACAALAA4AAABDgISFgQ3PgE3NiYnLgEjFx4BFxYGBwYkJyYCNz4BMwcVIxUzFTM1MzUjNQczFTMVIxUjNSM1MwHwh+BpMLoBAn6BpAgHiXgvZjQIhdIlIlRpcP7xamc/MzDJekZ9fYx9fXVefX1efX0DIgKW+P72wj4sLtyJh+g9FxgxA6KAe/FLTwtWVQEEe3CG0H2MfX2MfRd9Xn1+XQAEAAD/hwO/AyIADwAeACYALQAAAQ4CEhYENz4BNzYmJy4BBzIWFxYGBwYkJyYCNz4BBQYHJwM2NxcDFhc3BycHAfSJ4mkwugECfoGkCAeJeC9mNIfXJiJUaXD+8WpnPzMwyQEnMzOAdEFBhok9PR4dfDIDIgGW+f72wj4sLtyJh+g9Fxgxo4J78UtPC1ZWAQN7cIbSaGmm/qpTVJoBBk5MQ3SRTQAAAAAGAAD/jQPNAyIADgAdACwAOwA/AEQAAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcGByEDFhchNgHzqv8AFhCGgXwBEc5HWtWHERed6REMkIKB/vxPTQdYOZ9hkNIHBJ+AeN04NSxcMXpDf7YCAZl2b74jH0teJFEqYGABgMBLTP7STAMiAuGpj/1BPCK4AQgBAqUKAjEB0JuK6jAtT29xARBpRE4ryJCDzx0XaG1t8FErMDABtH92sw8MdmtozTcVFmOsrQEmh4eHAAAGAAD/jQPNAyIADgAdACwAOwBDAEsAAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcGBycDNjcXAxYXNwcnBgcB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRR1zMzgHRBQYaJPT0eHXwaGAMiAuGpj/1BPCK4AQgBAqUKAjEB0JuK6jAtT29xARBpRE4ryJCDzx0XaG1t8FErMDABtH92sw8MdmtozTcVFnZoaab+qlNUmgEGTkxDdJEmJwAAAAADAAD/jQPMAyMADwAeACYAAAEOAQcGFhcWJDYSJy4BJyYHMhYXFgYHBiYnJjY3PgEXBgcXNRcRBwHrqfsUD4qCegEMzEorLNqLEwl9swYDjHFuxyknSGMkUBppaNHKygMiBeSnj/0/OiO0AQWBhKoJAY6tfXK1FhNqaWrYOhUWokpKlI+PASiPAAAAAAQAAP/wA6sCzAAPACMAJwA0AAATDgEHER4BFyE+ATcRLgEnBSEeARcRDgEHIxEhESMuAScRPgETIREhNx0BIxUzFTM1MzUjNdhCVwICV0ICOUFXAgJXQf3HAjktPAEBPC10/q5zLjsBATvAART+7HNNTS5NTQLMAldB/lhBVwICV0EBqEFXAjABPC3+WC08AQE0/swBPC0BqC08/pr+7O0XNi5NTS5NAAQAAP/wA6sCzAAPACMAJwArAAATDgEHER4BFyE+ATcRLgEnBSEeARcRDgEHIxEhESMuAScRPgETIREhNxUzNddBVwICV0ECOkFXAgJXQf3GAjotPAEBPC10/q50LTsBATvAART+7CXLAswCV0H+WEFXAgJXQQGoQVcCMAE8Lf5YLTwBATT+zAE8LQGoLTz+mv7rpy8vAAAAAgAA//ADqwLMAA8AHwAAEw4BBxEeARchPgE3ES4BJwUhHgEXEQ4BByEuAScRPgHXQVcCAldBAjpBVwICV0H9xgI6LTwBATwt/cYtOwEBOwLMAldB/lhBVwICV0EBqEFXAjABPC3+WC08AQE8LQGoLTwAAAADAAD/jQPMAyMADwAeACYAAAEOAQcGFhcWJDYSJy4BJyYHMhYXFgYHBiYnJjY3PgEXBgcnAzY3FwHrqfsUD4qCegEMzEorLNqLEwl9swYDjHFuxyknSGMkUNczM4B0QUGGAyIF5KeP/T86I7QBBYGEqgkBjq19crUWE2ppatg6FRZ1aGmm/qpTVJoAAAYAAP+NA80DIgAOAB0ALAA7AEQATQAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BFw4BBz4BNxcmJxYXJw4BNT4BAfOq/wAWEIaBfAERzkda1YcRF53pEQyQgoH+/E9NB1g5n2GQ0gcEn4B43Tg1LFwxekN/tgIBmXZvviMfS14kUSoiOCIgPCB9Pz0iIkQRMRIeAyIC4amP/UE8IrgBCAECpQoCMQHQm4rqMC1Pb3EBEGlETivIkIPPHRdobW3wUSswMAG0f3azDwx2a2jNNxUWb2PKYyFFIYfIdW1uShE6BzVrAAcAAP+VA8cDIgARACEAMgBDAFIAYABvAAABIiMOAQcGEhYENz4BJy4BJyYHMjMeARcWBgcGJCYCNz4BFyIjDgEHBhYXFjY3NiYnLgEHMjMeARcWBgcGJicmNjc+ARcOAh4CNz4CJicmIxceAgYHBi4CNz4BMxcGBw4BFxY2OwE1IzY3JgHzAQKc8iYeXeABE3ZxcRMWt4U2PQUFkN0bFnBzeP70vB5GN7RwBQWFxhIOgXZw5UhJCFIzjVADA3atDQp/bGrLNDMvWiliL0BqMBdYezs+TgZDOSwxBDtcHSwxNHhXDSEZTi03HR0OBAwIDwdZWRsdCgMiA8GWhf7/ogpJSfOGh8oiDjECu46B6z8/KccBD3VYZyoEsoR81iwoRGBl+186Qi8DoXVwux8dVmFl3kUgIWEBSHd8Wx4VFmqCbRwVJwFJcWweHw5XezQlKzE1NgMaBwUJGTMzBgAAAAAEAAD/hwO/AyIADwAeACcAMAAAAQ4CEhYENz4BNzYmJy4BBzIWFxYGBwYkJyYCNz4BFw4BBz4BNxcmJxYXJw4BNT4BAfSJ4mkwugECfoGkCAeJeC9mNIfXJiJUaXD+8WpnPzMwyXoiOCIgPCB9Pz0iIkQRMRIeAyIBlvn+9sI+LC7ciYfoPRcYMaOCe/FLTwtWVgEDe3CGy2PKYyFFIYfIdW1uShE6BzVrAAAABAAA/4cDvwMiAA8AHgAiACcAAAEOAhIWBDc+ATc2JicuAQcyFhcWBgcGJCcmAjc+ARcGByEDFhchNgH0ieJpMLoBAn6BpAgHiXgvZjSH1yYiVGlw/vFqZz8zMMl6YGABgMBLTP7STAMiAZb5/vbCPiwu3ImH6D0XGDGjgnvxS08LVlYBA3twhr+srQEmh4eHAAAAAAcAAP/TA9QC6QAPAB8AJAAoACwAMAA0AAATDgEHER4BFyE+ATcRLgEnBSEeARcRDgEHIS4BJxE+ARcdASERBTMVIzchFSEHMxUjNyEVIddSbwICb1ICOlNuAgJuU/3GAjo6TAEBTDr9xjpMAQFMFgH4/iGMjKUBIf7fpYyMpQEh/t8C6QJuUv5uUm4CAm5SAZJSbgI8AUs6/m46SwEBSzoBkjpLR76+AXyEQ0NDGYODgwAAAAYAAAAAAwUChAAYADIAOgBCAEoAUgAAAQcOAR4EBg8BIT4BNzYuBDY/AQUhBgcGHgQGByE+ATc2LgMnPgE3NhcGFBczNjQnBwYUFzM2NCcHBhQXMzY0JwcGFBczNjQnAYECVEgBLj0wCDhLEwGHJzQQHgkyPSwBRFMS/n8BWEcgJQIuPTAINkz+qCAsDh8LMjwsAQEPESIhBgbNBga5BQW8BQV9BgbQBganBQXQBgYChAEzVkxBPDo+SS0KFyoUJ0c9PD1DUTMLDCwnK0xBPDo+SC0UJREnRz08PSIQJRUpNQEJAQEJAXMBCgEBCgF0AQkBAQkBcwEKAQEKAQAAAAACAAAAAAN4AoQAAgAHAAATBSUFESERBXABhAGE/PgDCP58AoTW1mn+HQHjwQAAAAACAAD/0wPUAukADwAfAAATDgEHER4BFyE+ATcRLgEnBSEeARcRDgEHIS4BJxE+AedZeAICeFkCGll4AgJ4Wf3mAhosOAEBOCz95iw4AQE4AukCdlj+ilh2AgJ2WAF2WHYCbgE3Kv6KKjcBATcqAXYqNwAAAAUAAP+aA7gDIgALABcAJgA0AEMAAAEOAQceARc+ATcuAQceARcOAQcuASc+ARcOAh4CNz4CJicmIxceAgYHBi4CNz4BMxcGBw4BFxY2OwE1IzY3JgH0wP8FBf/AwP8FBf/ArOMEBOOsrOMEBOOoQGowF1h7Oz5OBkM5LDEEO1wdLDE0eFcNIRlOLTcdHQ4EDAgPB1lZGx0KAyIF/8DA/wUF/8DA/ywE46ys4wQE46ys47kBSHd8Wx4VFmqCbRwVJwFJcWweHw5XezQlKzE1NgMaBwUJGTMzBgAAAAAFAAD/hwO/AyIADwAeACMAKgAwAAABDgISFgQ3PgE3NiYnLgEHMhYXFgYHBiQnJgI3PgEHFBUhEQUyMw4BByY3FBUhNRcB9IniaTC6AQJ+gaQIB4l4L2Y0h9cmIlRpcP7xamc/MzDJUwGa/sFych49HjXY/sicAyIBlvn+9sI+LC7ciYfoPRcYMaOCe/FLTwtWVgEDe3CG95ycATgxFDoHKw5dXbp9AAAEAAD/jQPNAyIADwAeAC0APAAAAQ4BBwYWFxYkNhInLgEnJgceARcWBgcGJicmEjc+ARcOAQcUFhcWNjc2JicuAQceAQcOAQcGJicmNjc+AQHwqf4WEIaBfAERzkctLdKFFg2c5A4KloN//05NCFg6pU+PzAWjgHbZNzUsXTN/NYCyAQOZdG++Ix9LXyZTAyID4aiP/UE8IrgBCIJ+pgsCMQLVm4roLSlQbXEBEWlGTS0Fy5CCzBoVaGxu8FEtLjEEt4B0rg8MdmtozTcWFgAABgAA/40DzQMiAA4AHQAsADsAQwBLAAABBgQHBhYXFiQ2EgImJyYHNhYXFgYHBiQnJhI3PgEXIgYHBhYXFjY3NiYnLgEHHgEXDgEHBiYnJjY3PgEXFBUjFTMVNycWFwc1IzUzAfOq/wAWEIaBfAERzkda1YcRF53pEQyQgoH+/E9NB1g5n2GQ0gcEn4B43Tg1LFwxekN/tgIBmXZvviMfS14kUVzi4qWJMzNm398DIgLhqY/9QTwiuAEIAQKlCgIxAdCbiuowLU9vcQEQaUROK8iQg88dF2htbfBRKzAwAbR/drMPDHZraM03FRZ0MjK+ZMN6PD15NoUAAAAAAwAA/40DzAMjAA8AHgAnAAABDgEHBhYXFiQ2EicuAScmBzIWFxYGBwYmJyY2Nz4BFw4BBz4BNxcmAeup+xQPioJ6AQzMSiss2osTCX2zBgOMcW7HKSdIYyRQKiI4IiA8IH0/AyIF5KeP/T86I7QBBYGEqgkBjq19crUWE2ppatg6FRZuY8pjIUUhh8gAAAAABQAA/6wDtgMbAAgADAAQABQAGAAAARURITUjETM1AQcXNw8BFzcPARc3DwEXNwKlARHg4P6eSzxL00s8S9JMPEvSTDxMAxsZ/LExAwUy/n48SzwsPEs7LDtMPCw8SzsAAwAA/6wDrgMbAAsARwBTAAAFDgEnLgE3PgEXHgEBMRcHJzcGJwcnNxcmJwcnNxcmNyc3FxU2NyEOAQcRFwc2PwIXIxYXNxcHJxYfAgc1BgcXITI2NxEGJw4BJy4BNz4BFx4BAYQ3kjk2AzY4kjk2AQHBFVUpAy0wKFUUASYaTSNDAgcHRCNNEBX+RRgfATQBJywLWgwDLCg9QC4BGglNAk0KFyoBaBgfARQBIIpJSDgcIIpJSDkWNQM0OJI4NwI1N5IBW00jRAEJCUQjTQEbJRRVKAItLyhVEwQWEwEgGP6OJgEaCU0BTAkYLz8+AScrCloNAywoNSAZAb0Ufkg4HCCJSUg4HCCIAAAAAAQAAP+aA7gDIgAQABQAagBvAAABIgcBBhQXARYyNwE2NCcBJgcJAiUxDwMVLwIPBB8CIw8DFR8DMw8CHwQ/AhUfAzM/AzUfAj8ELwIzPwI1LwIjPwIvBA8CNS8CBzA5ATAB9A4M/mEKCgGfCx4LAZ8LC/5hCw8Bhv56/noBfQQEAgFjAwQEBA0CAQECY4wEAwIBAQIDBIxjAgEBAg0EBAQDYwECBAQSBAQCAWMDBAQEDQIBAQJjjAQDAwMDBIxjAgEBAg0EBAQDYwECBIsDIgv+YQseC/5hCgoBnwseCwGfCz7+ev56AYbGAQIDBIxjAgEBAg0EBAQDYwECBAQSBAQCAWMDBAQEDQIBAQJjjAQDAgEBAgMEjGMCAQECDQQEBARiAQIEGgQCAWMDBAQEDQIBAQJjjAQDAzAAAAAEAAD/mgO4AyIAEAAUABoAHwAAASIHAQYUFwEWMjcBNjQnASYHCQIlDwEXITcnFwcjJwH0Dgz+YQoKAZ8LHgsBnwsL/mELDwGG/nr+egGGB9BSAQpS17tI5kgDIgv+YQseC/5hCgoBnwseCwGfCz7+ev56AYbgBZf9/X6H3NwAAAIAAP+aA7gDIgAPABMAABMGFBcBFjI3ATY0JwEmIgcJAzsKCgGfCx4LAZ8LC/5hCx4L/pQBhgGG/noBeAseC/5hCgoBnwseCwGfCwv+RwGG/nr+egAAAAAEAAD/mgO4AyIAEAAUACAALAAAASIHAQYUFwEWMjcBNjQnASYHCQIlDgEHHgEXPgE3LgEHHgEXDgEHLgEnPgEB9A4M/mEKCgGfCx4LAZ8LC/5hCw8Bhv56/noBhll3AgJ3WVl3AgJ3WU9qAgJqT09qAgJqAyIL/mELHgv+YQoKAZ8LHgsBnws+/nr+egGG0gJ3WVl3AgJ3WVl3FQJqT09qAgJqT09qAAADAAD/jQPMAyMADwAeACoAAAEOAQcGFhcWJDYSJy4BJyYHMhYXFgYHBiYnJjY3PgEXDgEXHgE3PgEnLgEB66n7FA+KgnoBDMxKKyzaixMJfbMGA4xxbscpJ0hjJFAqdIcgJNhhXwhaHkoDIgXkp4/9PzojtAEFgYSqCQGOrX1ytRYTamlq2DoVFlEBuHBuS0BD5UkYGgAAAAMAAP+NA8wDIwAPAB4AIgAAAQ4BBwYWFxYkNhInLgEnJgcyFhcWBgcGJicmNjc+ARcGByEB66n7FA+KgnoBDMxKKyzaixMJfbMGA4xxbscpJ0hjJFAqYGABgAMiBeSnj/0/OiO0AQWBhKoJAY6tfXK1FhNqaWrYOhUWYqytAAAAAgAA/5YDxwMiAA8AHgAAAQ4BBwYSFxYEPgEnLgEnJgceARcWBgcGJicmNjc+AQHwnPQlHWJwbwEP5XMTFr6KMil0qw8MdWlozjg5Kl0qZQMiA8SYhv8AUE4Jj/SGi84fC44Cm3JuvCQhTF9l5kggIQAAAAADAAD/jQPMAyIADQAcACQAAAEOAQcGFhcWJDYSAiYnBzIWFxYGBwYmJyY2Nz4BFwYHFyE2NyYB66n7FA+KgXsBDMxKV9qLHH2zBgONcG7HKSdIYyNRKmtsUgEKKihrAyIF5KiP/D86I7MBBgEEqwmNrX1ztBYTamlq2DoVFlZOTv1/fk4AAAAABAAA/40DzAMjAA8AHgAjACkAAAEOAQcGFhcWJDYSJy4BJyYHMhYXFgYHBiYnJjY3PgEHFhc2NwUUFSERBwHrqfsUD4qCegEMzEorLNqLEwl9swYDjHFuxyknSGMkUH1WVVRW/oUBmskDIgXkp4/9PzojtAEFgYSqCQGOrX1ytRYTamlq2DoVFppFRUVFIIyMARKjAAMAAP+NA8wDIwAPAB4AJgAAAQ4BBwYWFxYkNhInLgEnJgcyFhcWBgcGJicmNjc+ARcUFSMVMxU3Aeup+xQPioJ6AQzMSiss2osTCX2zBgOMcW7HKSdIYyRQXOLipQMiBeSnj/0/OiO0AQWBhKoJAY6tfXK1FhNqaWrYOhUWczIyvmTDAAcAAP+NA80DIgAOAB0ALAA7AEAARwBNAAABBgQHBhYXFiQ2EgImJyYHNhYXFgYHBiQnJhI3PgEXIgYHBhYXFjY3NiYnLgEHHgEXDgEHBiYnJjY3PgEHFBUhEQUyMw4BByY3FBUhNRcB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRowGa/sFych49HjXY/sicAyIC4amP/UE8IrgBCAECpQoCMQHQm4rqMC1Pb3EBEGlETivIkIPPHRdobW3wUSswMAG0f3azDwx2a2jNNxUWm5ycATgxFDoHKw5dXbp9AAAAAAUAAP+NA80DIgAOAB0ALAA7AEMAAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcGBxc1FxEHAfOq/wAWEIaBfAERzkda1YcRF53pEQyQgoH+/E9NB1g5n2GQ0gcEn4B43Tg1LFwxekN/tgIBmXZvviMfS14kURppaNHKygMiAuGpj/1BPCK4AQgBAqUKAjEB0JuK6jAtT29xARBpRE4ryJCDzx0XaG1t8FErMDABtH92sw8MdmtozTcVFqNKSpSPjwEojwAEAAD/hwO/AyIADwAeACYALQAAAQ4CEhYENz4BNzYmJy4BBzIWFxYGBwYkJyYCNz4BFwYHFyE2NyYnFhcHIyc2AfSJ4mkwugECfoGkCAeJeC9mNIfXJiJUaXD+8WpnPzMwyXprbFIBCiooa2xdXkjmSF4DIgGW+f72wj4sLtyJh+g9Fxgxo4J78UtPC1ZWAQN7cIazTk79f35OMENE3NxEAAAAAAUAAAAAAu4CpAANABMAFgAeACUAABMVFDERIREwMTUiMSc1BSEVMxEhARcjJx0BIxUzFTcnFwc1IzUz+gH0Aab+uAFDp/4WAUienpdwcFhTTExwcAKkAgH9dwHmAqICBaP+IQJ+mjUGM1c5ZFhYVzFNAAAABAAA/9MD1ALpAA8AHwBlALgAABMOAQcRHgEXIT4BNxEuAScFIR4BFxEOAQchLgEnET4BFzEiBzkBBg8BMQYHIw4BFTkBBhcwMR4BMyExMjc2NTE0JyYnMzI3NjcxNicmJzMyNi4BByM3NjU5ATQmKwE3PgInMSYnBzIxNhc5ARYGDwEGBwYfARYXFjEzMTIWFAYjBxUXMhYVFAYHIxUzMTIXFgc5AQYjBisBFTMeARU5AQ4BByExIiYnOQEuATUxNDY3NjcxPgE3NjLXUm8CAm9SAjpTbgICblP9xgI6OkwBAUw6/cY6TAEBTOILCRw3Th8MAQYBAQcKOSkBIA8LCQoDAxcNDAsDBQwDBQkSFQEWEB0HChUR1AsREwIICA0EAQQEAwEFGBEJBQMDAgQC5woICAqg0gwGBgzSsg0EBAICAwQLsYcLBAEECv7gJCsKAwICBAsZFm8cBAQC6QJuUv5uUm4CAm5SAZJSbgI8AUs6/m46SwEBSzoBkjpLRAYSJDMVJhQoEhgcKC0JCw8RCgMBBQgNFQ0DAxciFAEGDBERFgsQFhwMDAIUAQcFDwcYEQkHBQQCAQEIFggBIgEGCgwHASMFAg0IAyQBAwoLBAEiJAwXDRIlECAQD0kRAwAACgAAAAADHQKGAEsAfgCXAPEA9QD4AZsCMwI3AjsAAAEdAQYHOQEGBycHFwYHIxUzHgEXBxc3FTcWFxYXFRcHFzcWFxUzNTY3OQE2Nxc3JzY3MzUjJicxJic3Jwc1IyYvATUjMDE3JwcmJzUHMxUzFh8BNxcHFyMVLgEHDgEXMRYXIxUHJzcnJicxJi8BIzUzNTY/ASc3Fzc2NzE2PwEXMhYXFQYHOQEGBycHFwYHIyYnMSY2NzE2FzsBFQczFxYXMRYfATIfATcXBxcWFzEWFxUzFQ8BBg8BFwcnBw4BDwEVIzUjJi8BByc3My8CJicmNCMnNCYnNScmJzUwMSc1BzUzNzY/ASc3Fzc2NzE2NzM3FhUjFxUnByIjMTA5AiIxIxUiBw4BBzEwFDA5ATAxFTAxFTgBOQEGFTE4AzEVOAE5ARYVMTAVMRYVMTA5ATAUOQEwOQEUFzEwMRUUFzE4ATkBFBc5ARQxFxYVMTA5ARYVFzAUMRYXOAEUMR4BNz4BJyYnMTA5AiYjMTQxJzAxJzAxJyYjMTQrASY5ASInMTAxIzAnIyIxJzArATA5ASInMSIxIzAxBzEzMDsBMjkBFjMxMjEzMDMxMBcxMjEzMBczMjEXMjkBFjMxMDkBFjMVMTIXMTAxFzAxFzMyFTEyFTEWFxYGBzEGJic4AzEnOAEmMDEnMC4BMDEmNTE0MCY1MTAxNTgBOQEmPQEmNTE4ATQxJzAxNTQnMTgBPQE4AzkBNDcxMDkBOAIxNTgCOQE+ATcxNjMxNDMHMRUnFxYXJwGMEBAPDiY1JhIHNTUEDQknNiUhDAsCBQ4kNiYdIUsRDw8OJzUmEgc0NQMHBgolNiQgDAoHESQ2JB0gR0ICIh0CIy8kATUYSyYtIhINGiIlLyYBCQcHAwE0NAcTASUvJAIOEBEQAiAdMhARDxANJjUlEgcJHw4RISoVeDkJAQIJDAoRDQEBAQEkLyQBCgcGBDQzAQYUASYuJgINIRECQQIjHQEmLyQDAQIDBAMBAQIBAQEEAwI1NAEGFAElLiUCDhAREAJGAgI5EE0BAgEFEhIdJAQBAQEBAQECAQECAQMWUCosIhERIgECBAMEAQIBAgEDBAMBAwEDAQMBAgEEAwMBAgECAQEDAQIBAwECAQYBAgEBAwIBAwMBAgEgEBEhKihNFQMBAQEBAgEBAQEBAQQiHBERAaoFEwQGCgKGAzEEBgcJJTUlHSBMDyANJjUkDwEFAwoMIQEjNSYSBzY2BAYHCSY2JR0hSxAPEA0lNSQQBAMWHyU1JRMGNAUzBxMBJC4kASEgFg8UVC0fEjYkLiUCDhARDwJCAiIdASUuJAEKBgcDAUAbGQoDBwYKJTUlHCERIitQEwgOGxgCAwQGCQEBASQuJAINEQ8RAkEBAiEeASUvJQEJDgMBNTUIEgElLiMCAgYGBgICBAECAQIBCwoBBwMBQgIiHQIkLiQBCgYHBAoDAw0JCTIBCA0wHgEDAQMFCAQEAQECAQECAQEDAQIBBwEBAQIDAQQDASUcEBRVLCYSAQEBAgEBAQECAQEBBQEBAQIBAQEBAQIBAREkK1ATEBskBwEDAgIEAwECAQECAQECAQEDAQQDAQcEBAQcLwwIAZMCAikJCQEAAAMAAAAAAwsChAAiAEQAZQAAAQcOAQceARcOAQcGBw4BBxUzFjchNTQmJyYnLgEnPgE1LgEHMhceATcWFRQGDwEXHgEXDgEHLgEnPgE/AScuASc0Nz4BFxYXHgEXFhcVIzUjFSE1NCIHFSM1Njc+ATc2Nx4BFz4BAewFQEsBASIXDTIeIxsMEAFiAgEByRANHCQgNg0VGwFNZxQULkwKARwWBgcFJhoDVkFAVgMbKQYHBhckAQEIN+kPDxEhDBoBWgj+owcBVwIZDB8RCQoEWUFCWQKEAQFNPR0zFAQUERIaDR0QzAEBzA4bDBoTEhcFFDIdPU5RChcSBwYIHTISBQICDww2SAEBRjYNDwICBRMyHQgHCCC/BwkKFgsZF8SQkJAFBZDEHBgMFgkGBDdHAQFJAAAABQAA/9MD1ALpAA8AHwAzADcAPgAAEw4BBxEeARchPgE3ES4BJwUhHgEXEQ4BByEuAScRPgEXIjEiBhURFBYzITI2NRE0JiMwMQU7AQcnFxY/AREh11JvAgJvUgI6U24CAm5T/cYCOjpMAQFMOv3GOkwBAUwkAQUHCAUB9AUHBwX+O83Iyu7nBwbn/iUC6QJuUv5uUm4CAm5SAZJSbgI8AUs6/m46SwEBSzoBkjpLQgcF/psFCAgFAWUFBxl0a4QDA4T+vQAAAAADAAAAAALuAqQADgAUABcAABMVFDERIREwMTUiMSc1IRchFTMRIQEXI/oB9AGm/rYCAUOn/hYBSJ6eAqQCAf13AeYCogIFo/4hAn6aAAAAAAIAAP+HA78DIgAQACAAAAEOAhIWBDc+ATc2JicuASMXHgEXFgYHBiQnJgI3PgEzAfCH4GkwugECfoGkCAeJeC9mNAiF0iUiVGlw/vFqZz8zMMl6AyIClvj+9sI+LC7ciYfoPRcYMQOigHvxS08LVlYBA3twhgAAAAUAAP+NA80DIgAOAB0ALAA7AEQAAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcOAQc+ATcXJgHzqv8AFhCGgXwBEc5HWtWHERed6REMkIKB/vxPTQdYOZ9hkNIHBJ+AeN04NSxcMXpDf7YCAZl2b74jH0teJFEqIjgiIDwgfT8DIgLhqY/9QTwiuAEIAQKlCgIxAdCbiuowLU9vcQEQaUROK8iQg88dF2htbfBRKzAwAbR/drMPDHZraM03FRZvY8pjIUUhh8gABgAA/40DzQMiAA4AHQAsADsAQwBKAAABBgQHBhYXFiQ2EgImJyYHNhYXFgYHBiQnJhI3PgEXIgYHBhYXFjY3NiYnLgEHHgEXDgEHBiYnJjY3PgEXBgcXITY3JicWFwcjJzYB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRKmtsUgEKKihrbF1eSOZIXgMiAuGpj/1BPCK4AQgBAqUKAjEB0JuK6jAtT29xARBpRE4ryJCDzx0XaG1t8FErMDABtH92sw8MdmtozTcVFldOTv1/fk4wQ0Tc3EQAABAAAP+gA7sDIgAIABEAHgAsADsASQBYAGYAdQCEAJMAogCvAL4AzADbAAABDgEHPgE3FyYnFhcnDgE1PgETDgEHBhY3NhcyNicmFyIGFx4BFxY2Jy4BJyYFDgEHDgEHBhY3PgE3NiY3IgYHBhY3NhYXFjYnJgcOAQcOAQcGFjc+ATc2JgUiBhceARcWNicuAScmBSIGBwYWFxY2Jy4BNzQmBSIGFxYGBwYWNz4BJy4BBSIGFx4BFxY2Jy4BNy4BBSIGFQ4BBwYWNz4BNy4BBQ4BFx4BFxY2JyYnJgUOAQcOAQcGFhc+ATc2JgUOARceARc+AScuAScmBQ4BBw4BBwYWNz4BNzYmAfQiOCIgPCB9Pz0iIkQRMRIeER89HRIPFWFjFAcSMssUChEnPRUNIwUYSS4D/fQQFwwgMREEIw0UPigJC/kQIQgFGA8mTCMUDxBF5xEfDhotDwUkDBc+JAsLAXkTCg8cJgsNIwQNLyIG/cURDAEFCA0LJQINBQgNAukQDAMBGRcFIw0dGwQCDfyjEA0DARkZDSIFFxcBAgwC7BAMCCEWByMOHSYGAQ39qBEIDB5KKxQNEE83BgGfESARGjYaEggUL1ooDAr+NxIIDypjNRQIEzFbJwYCGBAZDiBIJRENFTZkKgoMAiZjymMhRSGHyHVtbkoROgc1awGEAQcKDCQEGRYmCQxTJQodSysPERQzViECCgIXCx5IKBQPEC5PIAwbAQMPEBQEAw0PBCQMHycEFAoUMBwVEBAjNxQMHDoiDB1GJhEQFS1RIASqGw4pUycRDBQoUykKDi0ZDjNjLRQQDzZ5PggKEBkONGQtDxIULWIyCAs4GQ4kQR0UFBAlVi8JDqACIAsjNA8CJAsfQQZNBBIFCQcDCSUBARkYDB4mAiIKIi8KASYICywgAwMDFgcVGwkLJQILMCQMGwAAAAUAAP+NA80DIgAOAB0ALAA7AEMAAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcUFSMVMxU3AfOq/wAWEIaBfAERzkda1YcRF53pEQyQgoH+/E9NB1g5n2GQ0gcEn4B43Tg1LFwxekN/tgIBmXZvviMfS14kUVzi4qUDIgLhqY/9QTwiuAEIAQKlCgIxAdCbiuowLU9vcQEQaUROK8iQg88dF2htbfBRKzAwAbR/drMPDHZraM03FRZ0MjK+ZMMAAA0AAP+iA7gDIAAEAAgADAAQABQAGABTALwBRQGiAekCMwKfAAABFREhEQUzESMTFTM1BxUzNQcVMzUHFTM1AysBByMHIwcVDwUVHwUzPwMzNzM3MzczFzMXMxczHwEzPwM1LwQjNSMnIycXDwYVHwozHwYVHwIzHw0zPwQ1LwE1JyMvBiMvATUjLwsjLwEjLwcjNSc1LwQjBQ8BIw8EFQ8EFQcjBxUPAyMVBxUHIxUPBBUHIw8BFQ8CFQ8CIw8DFQ8DFQcVDwoVBxUfBD8EMz8ENT8mNS8DAQ8FFRcVBxUHFQcVBxUHFQcVBxUHFQcVBxUHFQ8HFR8EPwUzPwEzPwE1PwEzNzM3NTc1MzU3NTc1NzU3NTc1NzU3NTc1JzUvBAUPBRUXFRcVFzMfBTMfARUXFRcVFxUzFxUXFR8EPwQ1Lw01JzUnNSc1LwMBDxcfBD8EMz8DMzczNzM3MzczNzU3Mzc1NzM/AjM3MzU/AzUvBAUPBRUfAxUfATMfAjMfAhUfATMfARUfATMXMxczFzMfAjMXMxcVMx8HMxcVFzMVMxczPwQ1LwQjJyMnIycjLwojLwQjLwUjAV0BLv7q/v4aysrKysrKymEHDQYNDQcnDQ4EAwMEAQIDAwkEBQYMBhcGCwYGBgYpBgYGBgYFHwQFDAMDAgIGAwonBgcGDQfpBQQEAwMBAgICBgICAwYFBAMIAQ4CCAIGAgQBAgIBAgMCAwUEAwQDCgUGAwkECQQEAwQCBAYBBAMCAwIDAgECCAEFAwQCBAICBQIHAgIBAgkBAgIDBwMCAwIBAgMCBgIKBf3zBQcBAgMCAwIDAgMCAwQBAgIDAgQBBAQBAgICAgICAQICAgQCAgQBAQECAwICCgECAgIBBAECAQIBAgECAgEEBAMOBAgEAwEBAgMBAgICAQIBAgECAQICAwIBAggCAQICAgEEAgQBBgIKAgYDCgMGAwUDAgEEBggFArIEBQMGAgEBAQEBAQEBAgEDBQMFAwQDAgYDAQIDBgQJCQQEAwIBAQMCAQIDAwIBBQEMAwECAQEBAQEBAQEEAwQECPymBAUDBAQBAQMCAQMCAQQBCgEEAwIDAgECAwECBAcJCQQEAwQCBAIDAgcEAQYBAgECCAEBAQEFCAgCsQQECQQFCgQPBQULDwYFCwUhBgsQCAQFAgIEAwQNCQYGFAUBEgYHBQEFAQUBBQEcAQsFAQUFAQULDwEEAQMDAgEEAwQECP3eBAQEAwICAQIDBA0CAQIDAgECAwMLAgEIAwMFAQIBAgECAQIDAwECAQIBAgQDBgMNAx0CAw0EAw0JBQgFAgEEAwQEAwQIAxQCEQMJBRECBgUDBQUFAgEPAgUCAgEEAwQRBAQFAhwM/pABfBj+tAEnGRlKGBhVGBhNGBgCLQECBgECBAIDBAgJBQQEAwQBAgICBAIBAQEBAQUBBgQDCQUICAIEBgEBAU8BAQMDBAQEBQkEBgECAQYDBAIIDgMIAwYDBAECAgMEAwQDBwcDCAMSCggCBAICAwMICgcHAQwIBAQEBAQEBAsBBwMGAgYCAwUDBwMCAwkDAgIHAgICAgEBAQICBAIFDAEEAgICAgIBAgICAgIBBAIBAgIDBAEEAQQBAgMCAwIBAgMCAQIGAgECBgMDAgUCAQIPAwIBAgECAwYDAwMDAwMDAwEECQUIAwMDAQQDAwQGBQMCBQECAwIDAgMCAwMCBQIDAgwCAwIDAgMEAwQDBgMKAwYCCgEGAgUEBAQJCQYEAf7GAQICCAQEBAQzAwkDBgIGAwMDAwMDBgIDAwkCDgMIAQ0FCwUGCgcEBQkEBgICAgIDAwMDBgYGBQEFBw8mAwoDAwcDAwQDAwQDAwQDBwMOAywFCQgEAgMCEwECAwMIBBsGBxMHDRMGBw0GHw0FAQUBBQEFAQUBBQEBBAQEAgICAwMJCQgGBgUGEAsGEQUGBgUvBgUGBgwGBwUHBgL+sgECBgQEBgQJBAMFCQIDBAMMAQQDBAMHCQkIAwMDAgIBBgIGAwIDAgMDDwYBAwMBAwQHDAQBAwQEBAkIBAMCAgIBAwIEBAkEBQQEAwEKAgICAgICAQEHAgUBAQEDAgIBAgECAQEBAQECAgIEAgkBAQQBBAEEBwUECQgEAgMBAwcGAwMGAgIDAQMCAwIJAgMCAQQBBA0BAgAAAAQAAAAAAu4CpAANABMAFgAdAAATFRQxESERMDE1IjEnNQUhFTMRIQEXIycVIxUzFTf6AfQBpv64AUOn/hYBSJ6ekXNzVQKkAgH9dwHmAqICBaP+IQJ+mjI3VDdhAAAAAAgAAP/TA9QC6QAPAB8ANgBMAFQAXABkAGwAABMOAQcRHgEXIT4BNxEuAScFIR4BFxEOAQchLgEnET4BFzEOARQeAwYPATM+AS4ENj8BBzMGBwYeBAYHIzY3Ni4ENhciFDsBMjQjByIUOwEyNCMHIhQ7ATI0IwciFDsBMjQj11JvAgJvUgI6U24CAm5T/cYCOjpMAQFMOv3GOkwBAUyRNCkbJRwGIi0L6S4jBR4kGgEpMQvmzSoTFgEcJB0FIS3NJRATBh4lGQEoEwMDewQEbgQEbwQESgQEfAQEYwQEfAMDAukCblL+blJuAgJuUgGSUm4CPAFLOv5uOksBAUs6AZI6S1ofMy0nJCMkLBsGHC4rJCQlKDAeBgcbFhotJyQjJCsbGBQXKyQkJSgvHgcHRQcHRQcHRQcHAAQAAP/TA9QC6QAPAB8AIgAnAAATDgEHER4BFyE+ATcRLgEnBSEeARcRDgEHIS4BJxE+AR8BNwURIREH11JvAgJvUgI6U24CAm5T/cYCOjpMAQFMOv3GOkwBAUwj6+v+KgHW6wLpAm5S/m5SbgICblIBklJuAjwBSzr+bjpLAQFLOgGSOktcgoJL/twBJHUAAAUAAAAAAzkCmgAjADkATwBlAHsAAAEiDgIHFTAxFTAxER4DMj4CNxEwMTUwMTUwMTUuAwcyHgIXDgMiLgInPgE3PgE3NgUWFx4CMj4BNzY3FQ4DIi4CJxUWFx4CMj4BNzY3FQ4DIi4CJxUWFx4CMj4BNzY3EQ4DIi4CJwH0O29cOQYGOVxvdm9cOgUGOVxvOztvWzYFBTZbb3ZvWjcFBTctHUUlJ/7pCRQdXG92b1wdFAkDOFtvdm9aNwUJFB1cb3ZvXB0UCQM4W292b1o3BQkUHVxvdm9cHRQJAzhbb3ZvWjcFApoKFB0VSkn+vBUeFAkJFB4VAURJSQEVHRQKBQoUHRESHRMKChMdEhEdCgYJAgNYDwoPEwoKEw8KDz0SHRMKChMdEgwPCg8TCgoTDwoPPRIdEwoKEx0SDA8KDxMKChMPCg/+yRIcFQkJFRwSAAkAAP+gA70DIQAIABEAHwAtAEAATwBeAG0AfwAAAQ4BBz4BNxcmJxYXJw4BNT4BEyIGBwYWNz4BFz4BJyYXIgYXHgEXFjYnLgEnJgUGDwEOAQcOARY2NzY3PgE3NCYBIgYXFgYHBhY3PgEnLgEFIgYXHgEXFjYnLgEnLgEBDgEHDgEHBhY3PgE3NiYhDgEXHgEXHgE3NiYnLgEnLgEB9CI4IiA8IH0/PSIiRBExEh4VIEEeEQ8UMGQwFQcTL8kUCREoOxcQIAgZRiwF/fEPDBYbKxIIBhoYBCExCxkCDQKtEAwDAxgZBSMNHxoHAg38pBANAwIbFw0jBRcXAQIMAq4QGQ4gRyUSDxQ2YyoKDP3TEggPJFMsDR8JBxEOKlAiBQwCJmPKYyFFIYfIdW1uShE6BzVrAYIHCgwlBAwCCgEmCAxQJQodTSsOFhMxVSADCwMLFRo+IQwbExAOPzQLEhAJDv7IGw4zYy0UEQ83ez8ICBIaDjNkLQ8RFC1jMggL/rMDFggVHAoLJQMMMSQMGwIiCh4pDAUFDw4XAQojHAUIAAAAAAYAAP+NA80DIgAOAB0ALAA7AEAARgAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BBxYXNjcFFBUhEQcB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRfVZVVFb+hQGayQMiAuGpj/1BPCK4AQgBAqUKAjEB0JuK6jAtT29xARBpRE4ryJCDzx0XaG1t8FErMDABtH92sw8MdmtozTcVFptFRUVFIIyMARKjAAAQAAD/oAO7AyIABgAOABsAKQA4AEYAVQBjAHIAgQCQAJ8ArAC7AMkA2AAAASYnBxchNjcGByMnNjcWAw4BBwYWNzYXMjYnJhciBhceARcWNicuAScmBQ4BBw4BBwYWNz4BNzYmNyIGBwYWNzYWFxY2JyYHDgEHDgEHBhY3PgE3NiYFIgYXHgEXFjYnLgEnJgUiBgcGFhcWNicuATc0JgUiBhcWBgcGFjc+AScuAQUiBhceARcWNicuATcuAQUiBhUOAQcGFjc+ATcuAQUOARceARcWNicmJyYFDgEHDgEHBhYXPgE3NiYFDgEXHgEXPgEnLgEnJgUOAQcOAQcGFjc+ATc2JgLLa2zXUgEKKgwkJOZIXl1dXR89HRIPFWFjFAcSMssUChEnPRUNIwUYSS4D/fQQFwwgMREEIw0UPigJC/kQIQgFGA8mTCMUDxBF5xEfDhotDwUkDBc+JAsLAXkTCg8cJgsNIwQNLyIG/cURDAEFCA0LJQINBQgNAukQDAMBGRcFIw0dGwQCDfyjEA0DARkZDSIFFxcBAgwC7BAMCCEWByMOHSYGAQ39qBEIDB5KKxQNEE83BgGfESARGjYaEggUL1ooDAr+NxIIDypjNRQIEzFbJwYCGBAZDiBIJRENFTZkKgoMAaJOTpz9f3VvbdxEQ0MBRQEHCgwkBBkWJgkMUyUKHUsrDxEUM1YhAgoCFwseSCgUDxAuTyAMGwEDDxAUBAMNDwQkDB8nBBQKFDAcFRAQIzcUDBw6IgwdRiYREBUtUSAEqhsOKVMnEQwUKFMpCg4tGQ4zYy0UEA82eT4IChAZDjRkLQ8SFC1iMggLOBkOJEEdFBQQJVYvCQ6gAiALIzQPAiQLH0EGTQQSBQkHAwklAQEZGAweJgIiCiIvCgEmCAssIAMDAxYHFRsJCyUCCzAkDBsAAAAAEAAA/6ADuwMiAAMACAAVACMAMgBAAE8AXQBsAHsAigCZAKYAtQDDANIAAAEGByEDFhchNhMOAQcGFjc2FzI2JyYXIgYXHgEXFjYnLgEnJgUOAQcOAQcGFjc+ATc2JjciBgcGFjc2FhcWNicmBw4BBw4BBwYWNz4BNzYmBSIGFx4BFxY2Jy4BJyYFIgYHBhYXFjYnLgE3NCYFIgYXFgYHBhY3PgEnLgEFIgYXHgEXFjYnLgE3LgEFIgYVDgEHBhY3PgE3LgEFDgEXHgEXFjYnJicmBQ4BBw4BBwYWFz4BNzYmBQ4BFx4BFz4BJy4BJyYFDgEHDgEHBhY3PgE3NiYB9GBgAYDAS0z+0kxLHz0dEg8VYWMUBxIyyxQKESc9FQ0jBRhJLgP99BAXDCAxEQQjDRQ+KAkL+RAhCAUYDyZMIxQPEEXnER8OGi0PBSQMFz4kCwsBeRMKDxwmCw0jBA0vIgb9xREMAQUIDQslAg0FCA0C6RAMAwEZFwUjDR0bBAIN/KMQDQMBGRkNIgUXFwECDALsEAwIIRYHIw4dJgYBDf2oEQgMHkorFA0QTzcGAZ8RIBEaNhoSCBQvWigMCv43EggPKmM1FAgTMVsnBgIYEBkOIEglEQ0VNmQqCgwCMqytASaHh4cBqgEHCgwkBBkWJgkMUyUKHUsrDxEUM1YhAgoCFwseSCgUDxAuTyAMGwEDDxAUBAMNDwQkDB8nBBQKFDAcFRAQIzcUDBw6IgwdRiYREBUtUSAEqhsOKVMnEQwUKFMpCg4tGQ4zYy0UEA82eT4IChAZDjRkLQ8SFC1iMggLOBkOJEEdFBQQJVYvCQ6gAiALIzQPAiQLH0EGTQQSBQkHAwklAQEZGAweJgIiCiIvCgEmCAssIAMDAxYHFRsJCyUCCzAkDBsAAAAABQAA/40DzQMiAA4AHQAsADsAQwAAAQYEBwYWFxYkNhICJicmBzYWFxYGBwYkJyYSNz4BFyIGBwYWFxY2NzYmJy4BBx4BFw4BBwYmJyY2Nz4BFwYHFyE2NyYB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRKmxrUgEKKihrAyIC4amP/UE8IrgBCAECpQoCMQHQm4rqMC1Pb3EBEGlETivIkIPPHRdobW3wUSswMAG0f3azDwx2a2jNNxUWV05O/X9+TgAAAAAKAAD/oAO9AyEABAALABEAHwAtAEAATwBeAG0AfwAAARQVIREFMjMOAQcmNxQVITUXEyIGBwYWNz4BFz4BJyYXIgYXHgEXFjYnLgEnJgUGDwEOAQcOARY2NzY3PgE3NCYBIgYXFgYHBhY3PgEnLgEFIgYXHgEXFjYnLgEnLgEBDgEHDgEHBhY3PgE3NiYhDgEXHgEXHgE3NiYnLgEnLgEBJwGa/sFych49HjXY/sicBCBBHhEPFDBkMBUHEy/JFAkRKDsXECAIGUYsBf3xDwwWGysSCAYaGAQhMQsZAg0CrRAMAwMYGQUjDR8aBwIN/KQQDQMCGxcNIwUXFwECDAKuEBkOIEclEg8UNmMqCgz90xIIDyRTLA0fCQcRDipQIgUMAfqcnAE4MRQ6BysOXV26fQHwBwoMJQQMAgoBJggMUCUKHU0rDhYTMVUgAwsDCxUaPiEMGxMQDj80CxIQCQ7+yBsOM2MtFBEPN3s/CAgSGg4zZC0PERQtYzIIC/6zAxYIFRwKCyUDDDEkDBsCIgoeKQwFBQ8OFwEKIxwFCAAAAAEAAAAAA2sCFgAaAAABDgEHFT4BNzYWFx4BNz4BNzUOAQcOAScuAScBRjppJiZTMzlqMypaLzVfJRIuGCRTKEeMTQIWAXBco0R5DghTLycsBgRcS64oOBkuGho2eAsAAAgAAP/TA9QC6QAPAB8AZwCYAK4BBAGgAi4AABMOAQcRHgEXIT4BNxEuAScFIR4BFxEOAQchLgEnET4BFx0BBzEGBycHFwYHIxUzHgEXBxc3FTMXFhcVMwcXNxYXFTMnMzU2NzkBNjcXNyc2PwE1Iy4BJzcnBzUjJicmJzUjNycHJic1BzMVFxYfATcXByMVLgEHDgEXOQEWFyMVByc3JyYnOQEmLwEjNTM1Nj8BJzcXNzY/ARcyFhcVBzEGBycHFwYHIyYnMSY2NzYXMxUfAjAyFDEXMBQzFTMXNTcXBxcWFzkBFh8BMxUjBwYPARcHJwcOAQ8BFSM1JyYvAQcnNzMnNSYnNCM5AjQjJyY1JyM1Myc1Nj8BJzcXNzY/AR8BIjkBMDkBIjAxIzgCOQEGBzEOAQcxOAExFTAxFTEwMRU4ATEVMDEVMDkBMhUxOAExFTgBOQEWFTE4AjkBMBcxOAIxFzAWMBQWOQEUMhQwMRc4AjkBHgE3PgEnJicxMDEnMDkBJjkBMDkBJjEjNCMxOAExJzAxIzUwIzEiJzEwMSMwMSMwOQEmIzEwMSMwJzEwMSMiMSMwMQcyOQEyMTMwMTMwMRcwMTMwMTM4ATI5ARYxMzIXMTIxMxYxMzgBOQEWOQEyMRcyMRczFzAzMRYXFgYHMQYmJzE4AjkBLgExNTAiNTEwJjgBNDAxJicxMDQwMTU4AjEnOAExNTA0OQEwJzE4AjE1MDQxNTgBMTUwMTU4ATkBPgE3NjcxMDIxMzgBMjHXUm8CAm9SAjpTbgICblP9xgI6OkwBAUw6/cY6TAEBTGYSCAkXJhcJBSEiAggEGCYUFwwBAwQTJhkQEjEFCgkJCQcZJhkLAyEhAQgFFycTFwUGAQMGFCcXEBIsIgQUEgQVGBMiEC0XHRcMBwwPFBgXAgYEBAIBICAEDAIWGBYECAoYEREdCRIJBxgmGAsDAxEIChMZDE4iCQ4LAgMCAQYTGRYCBgQFAQEfHwEECwIXGBcECBQKBCIEFREEFxgTBwUGAwEBBAEBICYGBAwCFhgWBAgKFQMSAgEDDAsUGAIBAQEBAQEBAg80Gx0XDAoXAgICAQICAgECAgIBAQEDAgIBAgIBAQICAgICAQEBAgEBAQECAQEBAQEBAQETCQoUGBgtDQEBAQEBAQEBAhQRCwkBAgEC6QJuUv5uUm4CAm5SAZJSbgI8AUs6/m46SwEBSzoBkjpLNAUcBgQFGCYYDxM2CREIGCYUBQQGBRgTJhgJBSIFHgIDBQQYJhgQEgE1CRIHFyYTBQMBBgYWEyYXCQUhCh8BBAsDFhgTDxEKCQ02Hg8LIxQYFwMJCQsJBCIEFREEFhgWAgYEBykQDgIGBAUYJhgPEwsTGTALBQkfAgQGAQEBAQQEExgWAwkJCgoEIgQUEgMXGBcDBQgCASEgAQQMAhcYEwcBBwgCAQ8CAgQiAwEVEQQWGBYCBgQGBRkBBQkfFAIGBQUBAgMBAgIFAQEBAgEFGBMLDTcdGQwBAQEBAQEBAQEKAQEBAQEBAQEKFRowCwkQFQMBAQIBAQMBAQICAgECBAEEBQIRHAcEAQAAAgAA/9MD1ALpAA8AHwAAEw4BBxEeARchPgE3ES4BJwUhHgEXEQ4BByEuAScRPgHXUm8CAm9SAjpTbgICblP9xgI6OkwBAUw6/cY6TAEBTALpAm5S/m5SbgICblIBklJuAjwBSzr+bjpLAQFLOgGSOksAAAADAAAAAAM7Ak0ABwAKAA0AAAEFFwU1BREFJxEtARElAfj+tgUBRQFD/r0K/tECcv7QAk3vBOvp6QHe6db+SNzc/kjcAAkAAP+gA70DIQAGAA4AHAAqAD0ATABbAGoAfAAAASYnBxchNjcGByMnNjcWAyIGBwYWNz4BFz4BJyYXIgYXHgEXFjYnLgEnJgUGDwEOAQcOARY2NzY3PgE3NCYBIgYXFgYHBhY3PgEnLgEFIgYXHgEXFjYnLgEnLgEBDgEHDgEHBhY3PgE3NiYhDgEXHgEXHgE3NiYnLgEnLgECy2ts11IBCioMJCTmSF5dXVkgQR4RDxQwZDAVBxMvyRQJESg7FxAgCBlGLAX98Q8MFhsrEggGGhgEITELGQINAq0QDAMDGBkFIw0fGgcCDfykEA0DAhsXDSMFFxcBAgwCrhAZDiBHJRIPFDZjKgoM/dMSCA8kUywNHwkHEQ4qUCIFDAGiTk6c/X91b23cRENDAUMHCgwlBAwCCgEmCAxQJQodTSsOFhMxVSADCwMLFRo+IQwbExAOPzQLEhAJDv7IGw4zYy0UEQ83ez8ICBIaDjNkLQ8RFC1jMggL/rMDFggVHAoLJQMMMSQMGwIiCh4pDAUFDw4XAQojHAUIAAUAAP+NA80DIgAOAB0ALAA7AD8AAAEGBAcGFhcWJDYSAiYnJgc2FhcWBgcGJCcmEjc+ARciBgcGFhcWNjc2JicuAQceARcOAQcGJicmNjc+ARcGByEB86r/ABYQhoF8ARHOR1rVhxEXnekRDJCCgf78T00HWDmfYZDSBwSfgHjdODUsXDF6Q3+2AgGZdm++Ix9LXiRRKmBgAYADIgLhqY/9QTwiuAEIAQKlCgIxAdCbiuowLU9vcQEQaUROK8iQg88dF2htbfBRKzAwAbR/drMPDHZraM03FRZjrK0AAAAAFAAA/6MDuAMiAAQACAAMABAAFAAYAFsAswEJAUwBoQH+AkkCiwLPAxIDaQO2BAIETAAAARURIREFMxEjExUzNQcVMzUHFTM1BxUzNQMxIwcjByMVIwcjDwcVHwQzNzM3MzczNzM3MxczFzMXMxczFzM/BTUvBSMnIzUjJyMnFyMPBR8ZPwQ1LwMjJzUnNScjLwEjLwE1JyMnNS8BIy8BNSc1JyM1JyMnIy8BNS8BIyc1JyMvAQUjDwIVByMPARUPAhUHFQcVDwEjDwEVDwIVDwEjDwEjDwEVBxUPASMPAhUfBTM/GTUvBCExIxUjDwMVHwQzNzM3MxczFzMXMxczFzMfBjM/BTUvAiMvCSMnIycjJyM1ByMPAiMPARUHIw8BIwcVByMHIwcjBxUPAyMVDwEVDwIjDwEfBTM/HTM/Ay8DBQ8FHxYVHwQzPwQ1JzUvCDUnNS8EIycjJzUvASMnNSc1LwE1Iy8BNScjJzUvAjUvAwUjDwUVIxUHFQcVIxUHFRcVMxUXFRcVFxUfCTM/BDUvAjUnNSc1JzUnNSc1NzU3NTc1NzU3NS8EBSMPAxUHFxUHFQcVBxUHFQ8IFR8DMz8GNTc1Pwc1NzUzNTc1NzUnNS8DBSMPAxUXFRcVFxUXFR8HFRcVHwIzFR8DMz8ENS8LNSc1JzUnNSc1LwQFIw8FFQcVDw8VHwU/AjU/ATU3Mzc1PwIzPwo1Ny8EBQ8FHwIVFxUXMxczHwIzHwEzFRcVFxUXMx8BMxczFxUXFR8BFR8CFR8CMz8FNS8cBSMPCCMHIwcjByMHIwcjDwQVHwUzNzM3MzczNzM/CzM3Mz8BNT8BNTc1PwQ1LwQFDwUVHwUzHwEVFzMXMx8BFR8BMxcVHwQzFzMfBjM/BTUvFiEjDxcVHwYzPwgzPwQ1NzM3Mzc1PwE1PwEzPwQ1LwQBXQEu/ur+/hrKysrKysrKZQsGCwUMBQUGJgYKCAQCAwEBAgYECQQrBQkFBQUFCgUeBQoFBQUFCgQYCQUEAwQEAQEEAwQHJgUGBQsGCwb0BQQFAwQEAgIIAgwHCAcEAwQDBAMHBgcPAgkCAxEEAwQJCQQEAwQBAgMCAQIDAgECEgEJBAYBAwQDAQMIBAMBAwEDAQgEBAQBBAgBBAr98QUECAUEAQQEBAwEBAQIAwEDBAMEAwQJAQ8CAQIDAwUCAQQDAwECAwMIBAkFBwUFEAYCBgIPBwYHAwQDBAMEBwgEBAcCAQICAwQIAQQSDQoFBwYCAgMICAQBCAQmBAgDBAQEBwQIAxoDCAcHAwkFBAQEAwQBBAMHAQMFBAQEBAQJBCYECQUEBAUNrQQIBgcBAwgDARUDAQMDAQkBDAEJCQMDAgECAwMIBAEEAgICAwMIBAUECQMIAwIEAwIDAgMCAwIDAwMCAwMDAwMDAwMGAyMCAwQEAgIFBAgBhAUIBAMDAwEGAwMCAwIDAgMCAwcWAQQBBAEGAwICBAQDBAUJBAQEAwQBAgICAQIBAgECAgIBAQEIAQEBAgIEAQIHAwIBAgMCAQIGAwkDAwME/cMFBAgDAwICAQIBAQEBAQECAQgCAQEBAwMEBAQFCQQDAwQBAgUDAgEBAQEBAQIBAQIDAwkC7gUECAYCAQEBAQECCAIBAgIEARYBAQQDDAUJBAYFBAMKAggBAgECAgIHAQEBAQEEAwQI/KcFCAgEAgEBAQIGAgICAQQBBgIKAwQBAwYEBQkEBAQDBAIBEgECAQIBAgICBwIBAQEBAgcDBQLwBAUEBAMEAgIHAgMFAgQBAgMMCgMEAgQBAQQDBAQJCAUHAw8CAQYFCAEBAQYBAgECAQICAgkBAgIDBAj9rQQIBAMCAgIFBgwGAQwBBgcDAQMDAQcHAwEHBwEDAQMECAQEDAQEBAQJBAQEBQIBAQQEAxUDBAoHGQMKAgMDAwMDAwMCBgMCAwIDAggBnAUEBAEHChwLBxIECwQHBAQHBAgEEAgEAwICAQQEAwQFDAUNBAUEBQgFJgQJBAQEBAQEAQQDAQMBAwQECAQJBAICAQIGAwQF/kQEBQQGAgIBAgMDBQQBBA0JAQ0BBAUFBAEEBQUKBRkBBAEUBgUFBQsKCQUEBAMEAQIDAwQHEwUEBQUEBQUEJR4IBAQJDAMNAhIFBAUDARQEBAkIFiwFBQQFBQUEBRsEBgQBAQIDAwQEBAkDBgULBQUFBhQBHgUKBQUEAQQBBAUcDQQBBAUDAgECAgMECAIcDP6QAXwY/rQBJxkZShgYVRgYTRgYAi8BAQEBBwICBAMEBAQJBAUGAwIJAgEBAQEBAQIFAQIDAwgEBQQJAwMDBwEBAQFTAQICBAcJCQoBCQcGBwMEAwQDBAcIBxQEDQQEIAMDAgICAgMDCAkFBgUFBAEEAQQFHA0EAQgEAQQEBAgBAwEDAQMECAMBAwQDAQYEBwgBBAQBAwQDAQMMAwEDAQMBCAQEBAEEBAQBBA0XBQUEAQQBCQUKBQwEBQQEAwQBAgUHDB4IBAkEFAcIBwQDBAMEAwcGBAMHBQQECQQEAwQBAgIFDAUJBAMGAgEBAQEBAgIHAgIDAgICAQIDAwgFCQgDBQIBAgECAQICAgkCAQEBJwIDBQIEAQIPAwIBAgkMCQEJBAMDAQMDAQMLBwcJCQQDBAQBAQQDDAMEBgMDAgMDAwMDAwIDAwIDAgMCAwIDBAMWAwMICQkHAwQ7AQIDAwQNBQsCAwMDAwMDAgMDCiMDBwMHBA4LAwcDCAMDAgEBAwIECAkEAgQJBAQEBAQFAwEDAQMEAQMQBAMBAwgDAQoBAwMBAwMBAwMBBgQJAQMCAwOpAQQEAwQIBAQJBQQJDQQbBQ0JBAQJBAEEIgQFAQQEAwMCAQICAwQICQUEEgQLBAcEBAcECAQeBAgEBwQEBwQECQQEBAMELQEECAQEBAQeBQoFBQUFCQUnBQQFCQoEMgQFBAgEBgICBggKBRkBBAEUBgUFBQsGJgUGBQsGCwYWBgkIAwMEEAIGCAgJBhEFBgUGCwUhBgsFBQoGDwEEARkFCgEEBgIBAQMCBAgJCAEpBAUFBAUFCQUiBQkFBQUFCgUXBQQHAgI5AQIDAwgHBAcEGgMLCwcGBAMHFA8DBwEIBQQFCAMDAgICAgcBAxUBAwsBBxAEBAwEBAQEBAQJBCYFBQgEBAMEoAEEAwMECQkJBgEMAQYMBgUDAwIBBAEEAQIFBAICAQEBBAEBAQYBAQECAQECAwcFBAUECAMDCQIBBgMQAwYDAgMCAwIDAgMGAgMDAwMDB0oBAgEDBgwDAwUDAgEBAQQDAwQJBQQIAwMCAQEBAQIJAgICAQIBAgEBAQICAgEBAQQBAQEFBAMFBAUICAMCAScBAQMGBAkFBAQEAgUDBAkBBgkDAgECAwIBAgMEAwoCCAECAQICAwECAwMIBQQJBAMDAwQCAQIBAgECARAQBgIDBQkDCgECAgIPAgMFBgwUAQIBAgECAQIGAgYJBAUEBAQDAwIBAQECAgIBAgEIDAMEAwIBAgMCAQISAQkEAwUEBAQFCQQDAwQAAAAAAwAAAAADuQKOAAMABwALAAATESERBxEhESMzESMvA4ox/WKMXl4Cjv2PAnEw/esCFf3rAAQAAP+cA8MDIAADAAcADgAVAAABETMRMxEzEQEHFzUzNSMlFQcVMxU3AW4mwyb+UKSkXV0CU15eowMg/HwDhPx8A4T+4aOjb2lubAFqb6MABgAA/54DlAMeAAYACQANABEAFQAZAAABBRcBFwEXJQUXJwcXNw8BFzcPARc3DwEXNwOU/mZA/hoZAeY+AQP+ZZeVPxk/lz4ZPp4/GT+XJhkmAx5tX/65JgFIXAVt4FgrJSovKiYrNSslKzAaJRoAAAkAAP+nA7IDHgADAAcACwARABUAGQAfACUAKQAAARUzNQUVMzUzFTM1FxUzFTM1BRUzNQUVMzUHFSMVMzUFFTM1IzUXFTM1AS9n/qHaoduCeyj9fWcB9Cgod5/9np934FIDHtra9mdnZ2ceKHWdaNran01NvnQonAGdKHV1KCgAAAASAN4AAQAAAAAAAAAVAAAAAQAAAAAAAQAEABUAAQAAAAAAAgAHABkAAQAAAAAAAwAEACAAAQAAAAAABAAEACQAAQAAAAAABQALACgAAQAAAAAABgAEADMAAQAAAAAACgArADcAAQAAAAAACwATAGIAAwABBAkAAAAqAHUAAwABBAkAAQAIAJ8AAwABBAkAAgAOAKcAAwABBAkAAwAIALUAAwABBAkABAAIAL0AAwABBAkABQAWAMUAAwABBAkABgAIANsAAwABBAkACgBWAOMAAwABBAkACwAmATljYW11bmRhIFNlcnZpY2VzIEdtYkhicG1uUmVndWxhcmJwbW5icG1uVmVyc2lvbiAxLjBicG1uR2VuZXJhdGVkIGJ5IHN2ZzJ0dGYgZnJvbSBGb250ZWxsbyBwcm9qZWN0Lmh0dHA6Ly9mb250ZWxsby5jb20AYwBhAG0AdQBuAGQAYQAgAFMAZQByAHYAaQBjAGUAcwAgAEcAbQBiAEgAYgBwAG0AbgBSAGUAZwB1AGwAYQByAGIAcABtAG4AYgBwAG0AbgBWAGUAcgBzAGkAbwBuACAAMQAuADAAYgBwAG0AbgBHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAGgAdAB0AHAAOgAvAC8AZgBvAG4AdABlAGwAbABvAC4AYwBvAG0AAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABhAAABAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAEhASIBIwEkASUBJgEnASgBKQEqASsBLAEtAS4BLwEwATEBMgEzATQBNQE2ATcBOAE5AToBOwE8AT0BPgE/AUABQQFCAUMBRAFFAUYBRwFIAUkBSgFLAUwBTQFOAU8BUAFRAVIBUwFUAVUBVgFXAVgBWQFaAVsBXAFdAV4BXwFgAWEMc2NyZXctd3JlbmNoBXRyYXNoEGdhdGV3YXktcGFyYWxsZWwfaW50ZXJtZWRpYXRlLWV2ZW50LWNhdGNoLWNhbmNlbDFpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy1tZXNzYWdlGHN0YXJ0LWV2ZW50LWNvbXBlbnNhdGlvbi5zdGFydC1ldmVudC1ub24taW50ZXJydXB0aW5nLXBhcmFsbGVsLW11bHRpcGxlC2xvb3AtbWFya2VyCXVzZXItdGFzaw1idXNpbmVzcy1ydWxlEnBhcmFsbGVsLW1pLW1hcmtlciNzdGFydC1ldmVudC1ub24taW50ZXJydXB0aW5nLXNpZ25hbC9pbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy10aW1lcippbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtcGFyYWxsZWwtbXVsdGlwbGUlaW50ZXJtZWRpYXRlLWV2ZW50LWNhdGNoLWNvbXBlbnNhdGlvbgtnYXRld2F5LXhvcgpjb25uZWN0aW9uEGVuZC1ldmVudC1jYW5jZWwiaW50ZXJtZWRpYXRlLWV2ZW50LWNhdGNoLWNvbmRpdGlvbjtpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy1wYXJhbGxlbC1tdWx0aXBsZRVzdGFydC1ldmVudC1jb25kaXRpb24ic3RhcnQtZXZlbnQtbm9uLWludGVycnVwdGluZy10aW1lchpzZXF1ZW50aWFsLW1pLW1hcmtlci1rb3BpZQZtYW51YWwHcmVjZWl2ZRJzdWItcHJvY2Vzcy1tYXJrZXIdc3RhcnQtZXZlbnQtcGFyYWxsZWwtbXVsdGlwbGURc3RhcnQtZXZlbnQtZXJyb3IfaW50ZXJtZWRpYXRlLWV2ZW50LWNhdGNoLXNpZ25hbB5pbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtZXJyb3IWZW5kLWV2ZW50LWNvbXBlbnNhdGlvbhRzdWJwcm9jZXNzLWNvbGxhcHNlZBNzdWJwcm9jZXNzLWV4cGFuZGVkBHRhc2sPZW5kLWV2ZW50LWVycm9yI2ludGVybWVkaWF0ZS1ldmVudC1jYXRjaC1lc2NhbGF0aW9uHmludGVybWVkaWF0ZS1ldmVudC1jYXRjaC10aW1lchZzdGFydC1ldmVudC1lc2NhbGF0aW9uEnN0YXJ0LWV2ZW50LXNpZ25hbBJidXNpbmVzcy1ydWxlLXRhc2sGc2NyaXB0BHNlbmQNY2FsbC1hY3Rpdml0eRFzdGFydC1ldmVudC10aW1lchNzdGFydC1ldmVudC1tZXNzYWdlF2ludGVybWVkaWF0ZS1ldmVudC1ub25lHWludGVybWVkaWF0ZS1ldmVudC1jYXRjaC1saW5rFGVuZC1ldmVudC1lc2NhbGF0aW9uD3RleHQtYW5ub3RhdGlvbgdicG1uLWlvD2dhdGV3YXktY29tcGxleBJnYXRld2F5LWV2ZW50YmFzZWQMZ2F0ZXdheS1ub25lCmdhdGV3YXktb3ITZW5kLWV2ZW50LXRlcm1pbmF0ZRBlbmQtZXZlbnQtc2lnbmFsDmVuZC1ldmVudC1ub25lEmVuZC1ldmVudC1tdWx0aXBsZRFlbmQtZXZlbnQtbWVzc2FnZQ5lbmQtZXZlbnQtbGluayBpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbWVzc2FnZSVpbnRlcm1lZGlhdGUtZXZlbnQtdGhyb3ctY29tcGVuc2F0aW9uFHN0YXJ0LWV2ZW50LW11bHRpcGxlCmRhdGEtaW5wdXQLbWFudWFsLXRhc2sHc2VydmljZQR1c2VyDHJlY2VpdmUtdGFzawtkYXRhLW9iamVjdBBzdGFydC1ldmVudC1ub25lI2ludGVybWVkaWF0ZS1ldmVudC10aHJvdy1lc2NhbGF0aW9uIWludGVybWVkaWF0ZS1ldmVudC1jYXRjaC1tdWx0aXBsZTRpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy1lc2NhbGF0aW9uHWludGVybWVkaWF0ZS1ldmVudC10aHJvdy1saW5rJnN0YXJ0LWV2ZW50LW5vbi1pbnRlcnJ1cHRpbmctY29uZGl0aW9uC2RhdGEtb3V0cHV0C3NjcmlwdC10YXNrCXNlbmQtdGFzawpkYXRhLXN0b3JlJ3N0YXJ0LWV2ZW50LW5vbi1pbnRlcnJ1cHRpbmctZXNjYWxhdGlvbiBpbnRlcm1lZGlhdGUtZXZlbnQtdGhyb3ctbWVzc2FnZTJpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy1tdWx0aXBsZTBpbnRlcm1lZGlhdGUtZXZlbnQtY2F0Y2gtbm9uLWludGVycnVwdGluZy1zaWduYWwhaW50ZXJtZWRpYXRlLWV2ZW50LXRocm93LW11bHRpcGxlJHN0YXJ0LWV2ZW50LW5vbi1pbnRlcnJ1cHRpbmctbWVzc2FnZQ1hZC1ob2MtbWFya2VyDHNlcnZpY2UtdGFzawl0YXNrLW5vbmUTY29tcGVuc2F0aW9uLW1hcmtlciVzdGFydC1ldmVudC1ub24taW50ZXJydXB0aW5nLW11bHRpcGxlH2ludGVybWVkaWF0ZS1ldmVudC10aHJvdy1zaWduYWwzaW50ZXJtZWRpYXRlLWV2ZW50LWNhdGNoLW5vbi1pbnRlcnJ1cHRpbmctY29uZGl0aW9uC3BhcnRpY2lwYW50CnNwYWNlLXRvb2wQY29ubmVjdGlvbi1tdWx0aQpsYXNzby10b29sAAA=') format('truetype');
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'bpmn';
+ src: url('../font/bpmn.svg?5069274#bpmn') format('svg');
+ }
+}
+*/
+
+ [class^="icon-"]:before, [class*=" icon-"]:before {
+ font-family: "bpmn";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+.icon-screw-wrench:before { content: '\e800'; } /* '' */
+.icon-trash:before { content: '\e801'; } /* '' */
+.icon-gateway-parallel:before { content: '\e802'; } /* '' */
+.icon-intermediate-event-catch-cancel:before { content: '\e803'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-message:before { content: '\e804'; } /* '' */
+.icon-start-event-compensation:before { content: '\e805'; } /* '' */
+.icon-start-event-non-interrupting-parallel-multiple:before { content: '\e806'; } /* '' */
+.icon-loop-marker:before { content: '\e807'; } /* '' */
+.icon-user-task:before { content: '\e808'; } /* '' */
+.icon-business-rule:before { content: '\e809'; } /* '' */
+.icon-parallel-mi-marker:before { content: '\e80a'; } /* '' */
+.icon-start-event-non-interrupting-signal:before { content: '\e80b'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-timer:before { content: '\e80c'; } /* '' */
+.icon-intermediate-event-catch-parallel-multiple:before { content: '\e80d'; } /* '' */
+.icon-intermediate-event-catch-compensation:before { content: '\e80e'; } /* '' */
+.icon-gateway-xor:before { content: '\e80f'; } /* '' */
+.icon-connection:before { content: '\e810'; } /* '' */
+.icon-end-event-cancel:before { content: '\e811'; } /* '' */
+.icon-intermediate-event-catch-condition:before { content: '\e812'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-parallel-multiple:before { content: '\e813'; } /* '' */
+.icon-start-event-condition:before { content: '\e814'; } /* '' */
+.icon-start-event-non-interrupting-timer:before { content: '\e815'; } /* '' */
+.icon-sequential-mi-marker-kopie:before { content: '\e816'; } /* '' */
+.icon-manual:before { content: '\e817'; } /* '' */
+.icon-receive:before { content: '\e818'; } /* '' */
+.icon-sub-process-marker:before { content: '\e819'; } /* '' */
+.icon-start-event-parallel-multiple:before { content: '\e81a'; } /* '' */
+.icon-start-event-error:before { content: '\e81b'; } /* '' */
+.icon-intermediate-event-catch-signal:before { content: '\e81c'; } /* '' */
+.icon-intermediate-event-catch-error:before { content: '\e81d'; } /* '' */
+.icon-end-event-compensation:before { content: '\e81e'; } /* '' */
+.icon-subprocess-collapsed:before { content: '\e81f'; } /* '' */
+.icon-subprocess-expanded:before { content: '\e820'; } /* '' */
+.icon-task:before { content: '\e821'; } /* '' */
+.icon-end-event-error:before { content: '\e822'; } /* '' */
+.icon-intermediate-event-catch-escalation:before { content: '\e823'; } /* '' */
+.icon-intermediate-event-catch-timer:before { content: '\e824'; } /* '' */
+.icon-start-event-escalation:before { content: '\e825'; } /* '' */
+.icon-start-event-signal:before { content: '\e826'; } /* '' */
+.icon-business-rule-task:before { content: '\e827'; } /* '' */
+.icon-script:before { content: '\e828'; } /* '' */
+.icon-send:before { content: '\e829'; } /* '' */
+.icon-call-activity:before { content: '\e82a'; } /* '' */
+.icon-start-event-timer:before { content: '\e82b'; } /* '' */
+.icon-start-event-message:before { content: '\e82c'; } /* '' */
+.icon-intermediate-event-none:before { content: '\e82d'; } /* '' */
+.icon-intermediate-event-catch-link:before { content: '\e82e'; } /* '' */
+.icon-end-event-escalation:before { content: '\e82f'; } /* '' */
+.icon-text-annotation:before { content: '\e830'; } /* '' */
+.icon-bpmn-io:before { content: '\e831'; } /* '' */
+.icon-gateway-complex:before { content: '\e832'; } /* '' */
+.icon-gateway-eventbased:before { content: '\e833'; } /* '' */
+.icon-gateway-none:before { content: '\e834'; } /* '' */
+.icon-gateway-or:before { content: '\e835'; } /* '' */
+.icon-end-event-terminate:before { content: '\e836'; } /* '' */
+.icon-end-event-signal:before { content: '\e837'; } /* '' */
+.icon-end-event-none:before { content: '\e838'; } /* '' */
+.icon-end-event-multiple:before { content: '\e839'; } /* '' */
+.icon-end-event-message:before { content: '\e83a'; } /* '' */
+.icon-end-event-link:before { content: '\e83b'; } /* '' */
+.icon-intermediate-event-catch-message:before { content: '\e83c'; } /* '' */
+.icon-intermediate-event-throw-compensation:before { content: '\e83d'; } /* '' */
+.icon-start-event-multiple:before { content: '\e83e'; } /* '' */
+.icon-data-input:before { content: '\e83f'; } /* '' */
+.icon-manual-task:before { content: '\e840'; } /* '' */
+.icon-service:before { content: '\e841'; } /* '' */
+.icon-user:before { content: '\e842'; } /* '' */
+.icon-receive-task:before { content: '\e843'; } /* '' */
+.icon-data-object:before { content: '\e844'; } /* '' */
+.icon-start-event-none:before { content: '\e845'; } /* '' */
+.icon-intermediate-event-throw-escalation:before { content: '\e846'; } /* '' */
+.icon-intermediate-event-catch-multiple:before { content: '\e847'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-escalation:before { content: '\e848'; } /* '' */
+.icon-intermediate-event-throw-link:before { content: '\e849'; } /* '' */
+.icon-start-event-non-interrupting-condition:before { content: '\e84a'; } /* '' */
+.icon-data-output:before { content: '\e84b'; } /* '' */
+.icon-script-task:before { content: '\e84c'; } /* '' */
+.icon-send-task:before { content: '\e84d'; } /* '' */
+.icon-data-store:before { content: '\e84e'; } /* '' */
+.icon-start-event-non-interrupting-escalation:before { content: '\e84f'; } /* '' */
+.icon-intermediate-event-throw-message:before { content: '\e850'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-multiple:before { content: '\e851'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-signal:before { content: '\e852'; } /* '' */
+.icon-intermediate-event-throw-multiple:before { content: '\e853'; } /* '' */
+.icon-start-event-non-interrupting-message:before { content: '\e854'; } /* '' */
+.icon-ad-hoc-marker:before { content: '\e855'; } /* '' */
+.icon-service-task:before { content: '\e856'; } /* '' */
+.icon-task-none:before { content: '\e857'; } /* '' */
+.icon-compensation-marker:before { content: '\e858'; } /* '' */
+.icon-start-event-non-interrupting-multiple:before { content: '\e859'; } /* '' */
+.icon-intermediate-event-throw-signal:before { content: '\e85a'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-condition:before { content: '\e85b'; } /* '' */
+.icon-participant:before { content: '\e85c'; } /* '' */
+.icon-space-tool:before { content: '\e85f'; } /* '' */
+.icon-connection-multi:before { content: '\e860'; } /* '' */
+.icon-lasso-tool:before { content: '\e862'; } /* '' */ \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn.css
new file mode 100644
index 0000000..bbce9f2
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/css/bpmn.css
@@ -0,0 +1,152 @@
+@font-face {
+ font-family: 'bpmn';
+ src: url('../font/bpmn.eot?8685581');
+ src: url('../font/bpmn.eot?8685581#iefix') format('embedded-opentype'),
+ url('../font/bpmn.woff?8685581') format('woff'),
+ url('../font/bpmn.ttf?8685581') format('truetype'),
+ url('../font/bpmn.svg?8685581#bpmn') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
+/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
+/*
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: 'bpmn';
+ src: url('../font/bpmn.svg?8685581#bpmn') format('svg');
+ }
+}
+*/
+
+ [class^="icon-"]:before, [class*=" icon-"]:before {
+ font-family: "bpmn";
+ font-style: normal;
+ font-weight: normal;
+ speak: none;
+
+ display: inline-block;
+ text-decoration: inherit;
+ width: 1em;
+ margin-right: .2em;
+ text-align: center;
+ /* opacity: .8; */
+
+ /* For safety - reset parent styles, that can break glyph codes*/
+ font-variant: normal;
+ text-transform: none;
+
+ /* fix buttons height, for twitter bootstrap */
+ line-height: 1em;
+
+ /* Animation center compensation - margins should be symmetric */
+ /* remove if not needed */
+ margin-left: .2em;
+
+ /* you can be more comfortable with increased icons size */
+ /* font-size: 120%; */
+
+ /* Font smoothing. That was taken from TWBS */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Uncomment for 3D effect */
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
+}
+
+.icon-screw-wrench:before { content: '\e800'; } /* '' */
+.icon-trash:before { content: '\e801'; } /* '' */
+.icon-gateway-parallel:before { content: '\e802'; } /* '' */
+.icon-intermediate-event-catch-cancel:before { content: '\e803'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-message:before { content: '\e804'; } /* '' */
+.icon-start-event-compensation:before { content: '\e805'; } /* '' */
+.icon-start-event-non-interrupting-parallel-multiple:before { content: '\e806'; } /* '' */
+.icon-loop-marker:before { content: '\e807'; } /* '' */
+.icon-user-task:before { content: '\e808'; } /* '' */
+.icon-business-rule:before { content: '\e809'; } /* '' */
+.icon-parallel-mi-marker:before { content: '\e80a'; } /* '' */
+.icon-start-event-non-interrupting-signal:before { content: '\e80b'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-timer:before { content: '\e80c'; } /* '' */
+.icon-intermediate-event-catch-parallel-multiple:before { content: '\e80d'; } /* '' */
+.icon-intermediate-event-catch-compensation:before { content: '\e80e'; } /* '' */
+.icon-gateway-xor:before { content: '\e80f'; } /* '' */
+.icon-connection:before { content: '\e810'; } /* '' */
+.icon-end-event-cancel:before { content: '\e811'; } /* '' */
+.icon-intermediate-event-catch-condition:before { content: '\e812'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-parallel-multiple:before { content: '\e813'; } /* '' */
+.icon-start-event-condition:before { content: '\e814'; } /* '' */
+.icon-start-event-non-interrupting-timer:before { content: '\e815'; } /* '' */
+.icon-sequential-mi-marker-kopie:before { content: '\e816'; } /* '' */
+.icon-manual:before { content: '\e817'; } /* '' */
+.icon-receive:before { content: '\e818'; } /* '' */
+.icon-sub-process-marker:before { content: '\e819'; } /* '' */
+.icon-start-event-parallel-multiple:before { content: '\e81a'; } /* '' */
+.icon-start-event-error:before { content: '\e81b'; } /* '' */
+.icon-intermediate-event-catch-signal:before { content: '\e81c'; } /* '' */
+.icon-intermediate-event-catch-error:before { content: '\e81d'; } /* '' */
+.icon-end-event-compensation:before { content: '\e81e'; } /* '' */
+.icon-subprocess-collapsed:before { content: '\e81f'; } /* '' */
+.icon-subprocess-expanded:before { content: '\e820'; } /* '' */
+.icon-task:before { content: '\e821'; } /* '' */
+.icon-end-event-error:before { content: '\e822'; } /* '' */
+.icon-intermediate-event-catch-escalation:before { content: '\e823'; } /* '' */
+.icon-intermediate-event-catch-timer:before { content: '\e824'; } /* '' */
+.icon-start-event-escalation:before { content: '\e825'; } /* '' */
+.icon-start-event-signal:before { content: '\e826'; } /* '' */
+.icon-business-rule-task:before { content: '\e827'; } /* '' */
+.icon-script:before { content: '\e828'; } /* '' */
+.icon-send:before { content: '\e829'; } /* '' */
+.icon-call-activity:before { content: '\e82a'; } /* '' */
+.icon-start-event-timer:before { content: '\e82b'; } /* '' */
+.icon-start-event-message:before { content: '\e82c'; } /* '' */
+.icon-intermediate-event-none:before { content: '\e82d'; } /* '' */
+.icon-intermediate-event-catch-link:before { content: '\e82e'; } /* '' */
+.icon-end-event-escalation:before { content: '\e82f'; } /* '' */
+.icon-text-annotation:before { content: '\e830'; } /* '' */
+.icon-bpmn-io:before { content: '\e831'; } /* '' */
+.icon-gateway-complex:before { content: '\e832'; } /* '' */
+.icon-gateway-eventbased:before { content: '\e833'; } /* '' */
+.icon-gateway-none:before { content: '\e834'; } /* '' */
+.icon-gateway-or:before { content: '\e835'; } /* '' */
+.icon-end-event-terminate:before { content: '\e836'; } /* '' */
+.icon-end-event-signal:before { content: '\e837'; } /* '' */
+.icon-end-event-none:before { content: '\e838'; } /* '' */
+.icon-end-event-multiple:before { content: '\e839'; } /* '' */
+.icon-end-event-message:before { content: '\e83a'; } /* '' */
+.icon-end-event-link:before { content: '\e83b'; } /* '' */
+.icon-intermediate-event-catch-message:before { content: '\e83c'; } /* '' */
+.icon-intermediate-event-throw-compensation:before { content: '\e83d'; } /* '' */
+.icon-start-event-multiple:before { content: '\e83e'; } /* '' */
+.icon-data-input:before { content: '\e83f'; } /* '' */
+.icon-manual-task:before { content: '\e840'; } /* '' */
+.icon-service:before { content: '\e841'; } /* '' */
+.icon-user:before { content: '\e842'; } /* '' */
+.icon-receive-task:before { content: '\e843'; } /* '' */
+.icon-data-object:before { content: '\e844'; } /* '' */
+.icon-start-event-none:before { content: '\e845'; } /* '' */
+.icon-intermediate-event-throw-escalation:before { content: '\e846'; } /* '' */
+.icon-intermediate-event-catch-multiple:before { content: '\e847'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-escalation:before { content: '\e848'; } /* '' */
+.icon-intermediate-event-throw-link:before { content: '\e849'; } /* '' */
+.icon-start-event-non-interrupting-condition:before { content: '\e84a'; } /* '' */
+.icon-data-output:before { content: '\e84b'; } /* '' */
+.icon-script-task:before { content: '\e84c'; } /* '' */
+.icon-send-task:before { content: '\e84d'; } /* '' */
+.icon-data-store:before { content: '\e84e'; } /* '' */
+.icon-start-event-non-interrupting-escalation:before { content: '\e84f'; } /* '' */
+.icon-intermediate-event-throw-message:before { content: '\e850'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-multiple:before { content: '\e851'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-signal:before { content: '\e852'; } /* '' */
+.icon-intermediate-event-throw-multiple:before { content: '\e853'; } /* '' */
+.icon-start-event-non-interrupting-message:before { content: '\e854'; } /* '' */
+.icon-ad-hoc-marker:before { content: '\e855'; } /* '' */
+.icon-service-task:before { content: '\e856'; } /* '' */
+.icon-task-none:before { content: '\e857'; } /* '' */
+.icon-compensation-marker:before { content: '\e858'; } /* '' */
+.icon-start-event-non-interrupting-multiple:before { content: '\e859'; } /* '' */
+.icon-intermediate-event-throw-signal:before { content: '\e85a'; } /* '' */
+.icon-intermediate-event-catch-non-interrupting-condition:before { content: '\e85b'; } /* '' */
+.icon-participant:before { content: '\e85c'; } /* '' */
+.icon-space-tool:before { content: '\e85f'; } /* '' */
+.icon-connection-multi:before { content: '\e860'; } /* '' */
+.icon-lasso-tool:before { content: '\e862'; } /* '' */ \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.eot b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.eot
new file mode 100644
index 0000000..4339c7f
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.eot
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.svg b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.svg
new file mode 100644
index 0000000..367205c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>camunda Services GmbH</metadata>
+<defs>
+<font id="bpmn" horiz-adv-x="1000" >
+<font-face font-family="bpmn" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
+<missing-glyph horiz-adv-x="1000" />
+<glyph glyph-name="screw-wrench" unicode="&#xe800;" d="m756 704c-55 0-108-22-147-61-39-39-61-92-61-147 0-55 22-108 61-147 39-39 92-61 147-61 91 0 171 59 198 146l-149-40-116 77 62 124 79 21 78 21c-39 42-94 67-152 67z m-247-278l-461-316c-14-42 32-111 80-114l451 310c-36 31-61 73-70 120z" horiz-adv-x="1000" />
+<glyph glyph-name="trash" unicode="&#xe801;" d="m429 743c-58-4-70 11-71-52l0-9-172-56c-20-5-20-29 0-30l624 0c19 0 19 25 0 30l-168 55 0 10c0 62-7 48-71 52l-71 0z m-215-204c-14 0-25-12-24-26l50-555c1-12 11-22 24-22l457 0c13 0 23 9 25 22l64 554c2 15-9 27-24 27l-143 0-143 0z m27-49l259 0 259 0-59-505-414 0z m120-73c-1 0-2 0-3 0-16-1-28-15-25-31l44-320c2-15 16-26 31-24 15 2 25 17 22 32l-44 319c-2 13-12 23-25 24z m280 0c-13 0-25-10-27-24l-44-319c-3-15 7-30 22-32 16-2 29 9 31 24l44 320c3 16-9 30-26 31z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-parallel" unicode="&#xe802;" d="m500 802c-9 0-19-4-26-11l-415-415c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-7 7-17 11-26 11z m0-62l390-390-390-390-390 390 390 390z m-11-161c0 0-4-1-4-1 0 0-4-3-4-3 0 0-3-4-3-4 0 0-1-4-1-4l0-194-194 0 0 0c0 0-4-1-4-1 0 0-4-3-4-3l0 0c0 0-3-4-3-4 0 0-1-4-1-4l0-21c0 0 1-5 1-5 0 0 3-4 3-4 0 0 4-3 4-3 0 0 4-1 4-1l194 0 0-194 0 0c0 0 1-4 1-4 0 0 3-4 3-4 0 0 4-3 4-3 0 0 4-1 4-1l22 0c0 0 4 1 4 1 0 0 4 3 4 3 0 0 3 4 3 4 0 0 1 4 1 4l0 194 194 0c0 0 4 1 4 1 0 0 4 3 4 3 0 0 3 4 3 4 0 0 1 4 1 4l0 22c0 0-1 4-1 4 0 0-3 4-3 4 0 0-4 3-4 3 0 0-4 1-4 1l-194 0 0 194c0 0-1 4-1 4 0 0-3 4-3 4 0 0-4 3-4 3 0 0-4 1-4 1l-22 0z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-cancel" unicode="&#xe803;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-112-111c-29-30-58-59-87-88 37-38 75-75 112-113-37-36-74-73-110-110 28-29 57-58 86-86 37 37 73 73 110 110 38-37 75-75 113-112 29 29 58 58 88 87-38 38-76 75-113 113 37 37 74 73 110 110-28 29-57 58-86 86-37-36-73-73-110-110-38 37-75 75-113 113z m0-35c38-38 75-75 113-113 37 37 73 74 110 111 17-17 35-35 52-52-37-37-74-73-111-110 38-38 75-75 113-113-18-18-35-35-53-53-38 38-75 75-113 113-36-37-73-74-110-111-17 17-35 35-52 52 37 37 74 74 111 110-38 38-75 76-113 113 18 18 35 35 53 53z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-message" unicode="&#xe804;" d="m295 506l0-312 410 0 0 312-410 0z m91-49l228 0c-38-30-76-60-114-90-38 30-76 60-114 90z m270-28l0-186-312 0 0 186c52-42 104-83 156-125 52 42 104 83 156 125z m-156 373l0 0-5 0-1 0 0 0-5 0 0 0 0 0-6-1 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 0-5-1 0 0-1 0-5 0 0 0 0 0-5 0-1 0 0-1-5 0 0 0 0 0-5-1-1 0 0 0-5 0 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1 0 0-1 0-5-1 0 0 0 0-5-1 0 0 0 0-6-2 0 0 0 0-5-1 0 0 0 0-5-1-4-2-4-2-4-3-2-4-3-4-1-4 0-5 0-4 1-4 2-5 3-3 3-3 4-3 4-1 5-1 4 0 4 1 5 1 5 1 4 1 5 1 5 1 5 1 5 1 5 1 5 0 4 1 5 1 5 0 5 1 5 0 5 1 5 0 5 0 5 1 5 0 5 0 5 0 5 0 5 0 5 0 5-1 5 0 5 0 5-1 5 0 5-1 5 0 5-1 5-1 4 0 5-1 5-1 5-1 5-1 4-1 5 0 4 0 5 1 4 2 3 3 4 3 2 4 2 4 1 4 0 5-1 4-2 5-2 4-3 3-4 3-4 2-3 1-5 1 0 0 0 0-5 1 0 0-1 0-5 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 1 0 0-6 0 0 0 0 0-5 0 0 0-1 0-5 1 0 0 0 0-5 0-1 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 0 0 0z m255-83l-5 0-4-1-5-2-3-2-4-4-2-3-2-4-1-5-1-4 1-5 1-4 3-4 3-4 2-2 2-1 4-3 4-3 4-3 3-3 4-4 4-3 4-3 3-3 4-4 4-3 3-4 4-3 3-4 4-3 3-4 4-4 3-3 3-4 3-4 4-4 3-3 3-4 3-4 3-4 3-4 3-4 2-4 3-4 3-5 3-4 2-4 3-4 2-4 3-5 2-4 2-4 3-5 2-4 1-2 2-4 4-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 4-1 5-1 3-1 3 0 0 0 0-3 5 0 0 0 0-2 5 0 0-1 0-2 4 0 1 0 0-3 4 0 0 0 1-2 4-1 0 0 0-2 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0-1 0-3 4 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-4 4 0 1 0 0-3 4 0 0 0 0-3 4-1 0 0 0-3 4 0 1 0 0-4 4 0 0 0 0-3 4 0 0-1 0-3 4 0 0 0 0-4 4 0 0 0 0-4 4 0 0 0 1-4 3 0 0 0 1-3 3-1 0 0 1-3 3-1 0 0 0-3 4-1 0 0 0-4 4 0 0 0 0-4 4 0 0 0 0-4 3 0 1 0 0-4 3 0 0 0 0-4 4 0 0-1 0-4 3 0 0 0 1-4 3 0 0 0 0-4 3 0 0-1 0-4 4 0 0 0 0-4 3 0 0 0 0-2 1-4 3-4 1-4 1z m-519-10l-5 0-4-1-4-2-4-2-1-1 0 0 0 0-4-3 0-1 0 0-4-3 0 0-1 0-4-4 0 0 0 0-4-3 0 0 0-1-4-3 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0-1 0-3-4 0 0 0 0-4-4 0 0 0-1-3-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0 0-1-4-4 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-4 0 0-1 0-3-5 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-5 0 0 0 0-3-4 0 0 0 0-2-5-1 0 0 0-2-5 0 0 0 0-3-4 0-1 0 0-3-4 0 0 0-1-2-4 0 0 0 0-3-5 0 0 0 0-2-5 0 0-1 0-2-5 0 0 0 0-2-5 0 0 0 0-3-5 0 0 0 0-1-3-1-4-1-5 0-4 1-5 2-4 3-4 3-3 4-2 4-2 4-1 5 0 4 0 5 2 3 2 4 3 3 4 2 3 1 3 2 4 2 5 2 4 2 4 3 5 2 4 2 4 3 5 2 4 3 4 3 4 2 4 3 5 3 4 2 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 3 4 3 3 4 4 3 4 4 3 3 4 4 3 3 4 4 3 4 4 3 3 4 3 4 3 4 4 4 3 1 1 3 3 3 3 2 5 1 4 0 4-1 5-1 4-2 4-3 4-4 3-4 2-4 2-4 0z m264 0l0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 0-5 0 0-1 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 0 0 0 0 0-4-1 0 0-1 0-1 0-4-1-5-2-3-2-4-3-2-4-2-4-2-4 0-5 1-4 1-5 2-4 3-3 4-3 4-3 4-1 4-1 4 0 1 1 4 0 4 0 4 1 4 0 3 0 4 0 4 0 4 0 4 0 4 0 4 0 3 0 4 0 4-1 4 0 4 0 3-1 4 0 4-1 4 0 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4-1 3-1 4-1 4-1 3-1 4-1 3-2 4-1 4-1 3-1 4-2 3-1 4-1 3-2 0 0 0 0 4-1 5-1 5 0 4 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4 0 5-2 4-2 4-3 3-4 3-3 2 0 0-1 0 0 0-3 2-1 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0-1 0-3 1-1 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0-1 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-5 0 0 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 1 0 0 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0 1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0z m-155-39l-4 0-5-1-3-1-2-1 0 0 0 0-4-2 0 0 0 0-3-2-1-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-2 0 0 0 0-4-2 0-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0-1-1-3-2 0 0 0 0-3-3 0 0-1 0-3-2 0-1 0 0-3-2 0 0-1 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0-1 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-4 0 0 0 0-3-3 0 0 0 0-2-3-1 0 0-1-2-3 0 0 0 0-3-3 0 0 0-1-3-3 0 0 0 0-2-3 0 0-1-1-2-3 0 0 0 0-2-3-1-1 0 0-2-3 0 0 0 0-2-4-1 0 0 0-2-3-2-4-1-4-1-5 1-4 1-5 2-4 3-3 3-4 4-2 4-2 4-1 5 0 4 1 5 2 4 2 3 3 2 3 2 3 2 3 2 3 3 3 2 4 2 3 2 3 3 3 2 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 2 3 3 2 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 2 3 2 3 2 3 2 3 2 4 2 3 2 3 2 3 2 4 2 3 2 2 0 3 3 4 3 2 4 2 4 1 4 1 5-1 4-1 5-3 4-2 3-4 3-4 2-4 2-5 0z m393-59l-5-1-4-1-4-1-4-3-3-3-3-4-1-4-1-5-1-4 1-5 2-4 2-4 2-3 3-2 3-3 2-3 3-3 2-3 3-3 2-3 3-2 2-3 3-3 2-3 2-3 3-4 2-3 2-3 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-4 2-3 1-3 2-4 2-3 1-3 2-4 2-3 1-4 1-3 2-4 1-3 2-4 1-3 1-4 1-4 2-3 1-4 1-3 0-3 2-4 2-4 4-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 4 0 2 0 0 0 0-2 4 0 0 0 1-1 3 0 1 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-1 3 0 0-1 1-1 3 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0-1 0-1 4-1 0 0 0-2 3 0 1 0 0-2 3 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 3 0 0 0 1-2 3 0 0 0 0-3 4 0 0 0 0-2 3 0 0 0 1-3 3 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 3 0 1 0 0-2 3-1 0 0 0-2 3 0 1 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 4 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 1-3 3 0 0 0 0-3 2-3 3-4 3-5 1-4 1z m-564-171l-5 0-4-1-4-2-4-2-3-4-3-3-2-4-1-4-1-4 0 0 0 0 0-4 0 0-1 0 0-4 0-1 0 0-1-4 0 0 0 0-1-4 0 0 0 0 0-5 0 0 0 0-1-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0-1 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0-1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 1-5 0 0 0 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 1-4 0 0 0 0 0-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 0-4 1-1 0 0 0-4 0 0 0 0 1-4 0 0 0 0 1-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0-1 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0 0 2-4 0 0 0 0 1-4 0-1 0 0 1-1 1-4 3-4 3-3 4-3 4-2 4-1 5 0 4 1 5 1 4 2 3 3 3 4 2 4 2 4 0 5 0 4-1 4 0 1-2 4-1 4-1 3-1 4-1 3-1 4 0 4-1 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4 0 4 0 3-1 4 0 4 0 4-1 4 0 4 0 3 0 4 0 4 0 4 0 4 0 4 0 3 1 4 0 4 0 4 1 4 0 3 0 4 1 4 0 4 1 4 1 3 0 4 1 4 0 4 0 5-1 4-2 4-3 4-3 3-4 2-5 2-4 1z m754-46l-5 0-4-1-4-2-4-2-3-4-3-4-2-4 0-4-1-4 1-4 0-5 0-5 0-5 0-5 0-5 0-5-1-5 0-5 0-5-1-5 0-5-1-5 0-5-1-5-1-4 0-5-1-5-1-5-1-5-1-5-1-5-1-4-1-5-1-5-2-5-1-4-2-5-1-5-1-4-2-5-2-5-1-4-2-5-2-4-2-5-2-5-2-4-2-5-2-4-2-4-2-5-2-4-2-5-1-4 0-5 1-4 2-4 2-4 3-4 4-2 4-2 4-2 5 0 4 1 5 1 4 2 3 3 3 3 2 3 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 2 4 0 1 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 1 5 0 0 0 0 2 5 0 0 0 0 1 5 0 0 0 0 2 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 0 2 6 0 0 0 0 1 5 0 0 0 0 1 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 0 5 0 0 0 1 1 5 0 0 0 0 0 5 1 0 0 1 0 5 0 0 0 0 0 5 0 1 0 0 1 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0 1 6 0 0 0 0 0 5 0 0 0 1 0 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0-1 6 0 0 0 0 0 4 0 5-2 4-2 4-3 3-4 3-4 2-4 2-4 0z m-853-16l-5 0-4-1-4-1-4-3-4-3-2-4-2-4-1-4-1-4 0-4 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 0-6 0 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 1-5 0 0 0-1 0-5 0 0 0 0 1-5 0-1 0 0 0-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 1-5 0 0 0-1 1-5 0 0 0 0 1-5 0 0 0 0 2-6 0 0 0 0 1-5 0 0 0 0 1-5 0 0 0-1 2-5 0 0 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0-1 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0-1 2-4 0-1 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 3-5 0 0 0 0 2-5 0 0 0 0 2-5 1 0 0 0 0-1 3-4 3-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 5-1 3-1 1-2 5-2 4-2 4-2 5-2 4-2 5-2 5-2 4-2 5-1 4-2 5-1 5-2 4-1 5-2 5-1 4-1 5-2 5-1 5-1 4-1 5-1 5-1 5-1 5-1 5 0 5-1 4-1 5 0 5-1 5 0 5-1 5 0 5 0 5-1 5 0 5 0 5 0 5 0 4 0 4-1 5-2 4-3 3-4 4-3 2-5 2-4 0z m756-57l-4 0-5-1-4-2-4-3-3-3-2-4-2-4-1-3 0 0 0 0 0 0 0 0-1-4 0-4-1-4-1-3 0-4-1-4-1-4-1-3-1-4-1-3-1-4-1-4-2-3-1-4-1-3-1-4-2-4-1-3-2-4-1-3-1-4-2-3-2-3-1-4-2-3-2-4-1-3-2-3-2-4-2-3-2-3-2-3-2-4-2-3-2-3-2-3-2-3-2-3-3-3-2-3-2-4-2-1-2-4-2-4-1-5 0-4 1-5 2-4 2-4 3-3 4-3 4-2 4-1 5-1 4 1 4 1 5 2 3 3 3 3 1 1 0 1 0 0 3 3 0 0 0 0 2 3 1 1 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 0 2 4 0 0 0 0 2 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 1 2 3 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 1 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 1 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 0 4 0 0 0 0 0 0 1 5-1 4-1 4-2 4-3 4-4 3-4 2-4 2-5 0z m-590-160l-4-1-4-2-4-2-4-3-3-3-2-4-1-5-1-4 1-5 1-4 2-4 2-3 1-2 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-2 1-1 0 0 3-2 0 0 0 0 3-3 1 0 0 0 3-3 0 0 0 0 3-2 1 0 0-1 3-2 0 0 0 0 4-2 0-1 0 0 3-2 0 0 0 0 4-2 0-1 0 0 3-2 1 0 0 0 3-2 0 0 0 0 4-3 0 0 0 0 4-2 0 0 0 0 3-2 1 0 0 0 3-2 0 0 1 0 3-2 0 0 0-1 4-1 0-1 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 4-1 4 0 5 0 4 1 4 2 4 3 3 4 2 3 2 5 1 4 0 5-1 4-2 4-2 4-4 3-3 3-4 2-3 1-4 2-3 1-4 2-3 1-3 2-4 1-3 2-4 2-3 2-3 1-4 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-3 2-3 3-3 2-4 2-3 2-2 3-3 2-3 3-3 2-3 3-3 2-3 3-3 2-2 3-3 3-3 3-3 2-2 3-3 3-2 3-3 3-2 3-1 1-4 3-3 3-5 1-4 1-5 1z m426-77l-5 0-4-1-4-2-1-1-4-2-3-1-3-2-4-2-3-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-1-4-1-3-1-4-2-3-1-4-1-4-1-3-1-4-1-4 0-3-1-4-1-4-1-4 0-3-1-4-1-4 0-4-1-3 0-4 0-4-1-4 0-4 0-4-1-3 0-4 0-4 0-5 0-4-2-4-2-4-3-3-3-2-4-1-4-1-5 0-5 1-4 2-4 2-4 4-3 3-3 4-2 5-1 4 0 4 0 0 0 0 0 4 0 0 0 1 0 4 1 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 4 0 0 0 0 0 4 1 1 0 0 0 4 0 0 0 0 0 4 1 0 0 0 0 5 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 1 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 2 0 0 1 0 3 1 1 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 1 1 3 1 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 1 0 0 0 1 4 1 0 0 0 0 4 2 0 0 0 0 4 2 0 0 0 1 4 1 0 1 0 0 4 2 0 0 0 0 2 1 3 2 4 4 2 3 2 5 1 4 0 5-1 4-1 4-3 4-3 4-3 3-4 2-5 1-4 0z m-440-39l-4-1-5-1-4-3-3-3-3-3-2-4-1-5-1-4 0-5 1-4 2-4 3-4 3-2 1-1 0 0 0 0 4-4 0 0 0 0 4-3 0 0 1 0 4-4 0 0 0 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0-1 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-2 0 0 0-1 5-2 0 0 0 0 4-3 1 0 0 0 4-2 0 0 0-1 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 4-2 1 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 5-1 0 0 0 0 5-2 0 0 0 0 5-1 0 0 0 0 5-2 1 0 0 0 5-1 0 0 0 0 5-1 0 0 0 0 6-2 0 0 0 0 4-1 5 0 4 0 5 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4-1 5-1 4-3 4-3 3-4 3-4 2-3 1-5 1-4 1-5 1-5 1-5 2-4 1-5 2-5 1-4 2-5 1-5 2-4 1-5 2-5 2-4 2-5 2-4 2-5 2-4 2-5 2-4 2-4 2-5 3-4 2-4 2-5 3-4 2-4 3-4 3-4 2-4 3-5 3-4 2-4 3-4 3-4 3-3 3-4 3-4 3-1 1-4 3-4 1-4 1-5 1z m543-3l-5 0-4-1-5-2-3-2-1-2-4-3-4-3-4-3-4-3-4-3-4-2-4-3-5-3-4-2-4-3-4-3-4-2-5-3-4-2-4-2-5-3-4-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-1-5-2-4-1-5-2-5-1-5-2-4-1-5-2-5-1-5-1-4-1-5-1-3-1-5-1-4-2-3-3-3-3-2-4-2-5-1-4 0-5 1-4 2-4 3-4 3-3 4-3 4-2 4-1 5 0 4 0 3 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 2 0 0 1 0 5 1 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 1 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 1 0 0 4 2 1 0 0 0 4 3 0 0 1 0 4 2 0 1 0 0 5 2 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 1 4 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 4 4 1 0 0 0 4 3 0 0 0 0 2 2 3 3 3 4 2 4 1 4 0 5-1 4-1 5-2 4-3 3-4 3-4 2-4 2-4 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-compensation" unicode="&#xe805;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m-16-255c-70-49-140-99-209-148 70-49 139-99 209-148 0 48 0 95 0 143 67-48 135-95 202-143 0 99 0 197 0 296-67-48-135-95-202-143 0 48 0 95 0 143z m-24-47c0-67 0-134 0-201-48 33-95 67-143 100 48 34 95 67 143 101z m202 0c0-67 0-134 0-202-48 34-95 68-143 101 48 34 95 67 143 101z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-parallel-multiple" unicode="&#xe806;" d="m430 545l0-125-125 0 0-140 125 0 0-125 140 0 0 125 125 0 0 140-125 0 0 125z m23-23l94 0 0-125 125 0 0-94-125 0 0-125-94 0 0 126-125 0 0 93 125 0z m51 278l-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 0-6-1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6 0 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0-1 0 0-6-1 0 0-1 0-6-1 0 0 0 0-6-2 0 0 0 0-4-1-4-1-4-2-3-3-3-4-2-4-2-4 0-5 0-4 1-5 2-4 3-4 3-3 4-2 5-2 4-1 5 0 3 1 3 1 6 1 6 1 6 2 5 1 6 1 6 1 6 1 6 0 6 1 5 1 6 0 6 1 6 0 6 1 6 0 6 0 6 0 6 0 6 0 5 0 6 0 6-1 6 0 6-1 6 0 6-1 5 0 6-1 6-1 6-1 6-1 5-1 2 0 4-1 5 0 4 2 4 2 4 2 3 4 3 3 1 5 1 4 0 5-1 4-1 4-3 4-3 4-3 2-5 2-3 1-2 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0 0 0-7 1 0 0 0 0-6 0 0 1-1 0-6 0 0 0 0 0-6 1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6 1 0 0 0 0-6 0-1 0 0 0-6 0 0 0z m246-79l-5-1-4-1-4-3-3-3-3-4-1-4-2-4 0-5 1-4 1-5 2-4 3-3 3-3 2-1 0 0 2-2 0 0 3-1 0 0 2-2 0 0 2-2 2-2 0 0 3-2 0 0 2-1 2-2 0 0 2-2 3-2 0 0 2-2 2-2 0 0 2-2 2-2 1 0 2-2 2-2 2-2 0 0 2-2 0 0 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 2-2 0 0 2-3 2-2 2-2 0-1 1-2 0 0 2-2 0 0 2-3 0 0 1 0 2-4 3-3 2-4 3-3 2-3 3-4 2-3 2-4 0 0 3-3 2-4 2-4 3-3 2-4 2-3 2-4 2-4 2-3 2-4 2-4 1-2 3-4 3-4 3-2 4-2 5-2 4 0 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 5-1 4-1 3-2 3 0 0 0 0-2 4 0 0 0 1-2 4 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0-1 0-2 4 0 0 0 0-3 4 0 0 0 0-3 4 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 4 0 0 0 0-3 3-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2-1 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 2 0 0-1 0-2 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2-1 0 0 1-2 1 0 1 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-2 1-4 2-4 2-5 0z m-521-12l-5-1-4-2-3-2 0 0 0 0-1 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0-1-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0-1 0 0-2-2 0 0 0 0-2-2 0 0-1 0-2-2 0 0 0-1-2-2 0 0 0 0-3-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2-1 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0-1 0-1-3 0 0 0 0-2-2-1-2 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0-1-2-2 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0 0-1-2-4 0-5 0-4 1-5 2-4 2-4 4-3 3-3 5-1 4-1 5-1 4 1 4 2 4 2 4 3 3 3 1 4 1 0 1 3 1 3 0 0 1 2 0 0 2 3 1 3 0 0 2 2 0 0 1 3 1 2 0 1 2 2 1 3 0 0 2 2 0 0 1 3 2 2 0 0 1 3 2 2 1 3 0 0 2 3 0 0 2 2 0 0 1 2 2 3 2 2 0 0 1 3 2 2 2 3 1 1 0 0 2 3 1 2 0 0 2 3 2 2 0 0 1 3 2 2 0 0 2 3 0 0 2 2 1 3 2 2 0 0 2 2 2 3 2 2 0 0 2 2 1 3 2 2 0 0 2 2 2 2 0 0 2 3 0 0 2 2 0 0 2 2 0 0 2 2 2 2 0 0 2 2 0 0 2 3 0 0 2 2 2 2 0 0 2 2 3 2 0 0 2 2 2 2 0 0 2 2 0 0 2 2 0 0 2 2 0 0 3 1 0 0 2 2 0 0 2 2 0 0 2 2 3 2 0 0 2 2 0 0 0 0 3 3 3 4 2 4 1 4 0 5 0 4-2 5-2 4-3 3-3 3-4 2-4 2-5 1z m694-313l-4-1-5-2-3-2-3-4-3-4-2-4-1-4 0-4 1-4 0-4 0-4 0-5 0-4 0 0 0-1 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0-3 0-3 0-3-1-3 0-3 0 0 0-3 0 0 0-3-1-3 0-3 0-3-1-2 0-1 0-3 0 0 0-2-1-3 0-3 0 0-1-3 0-3-1-3 0 0 0-3-1-3-1-3 0 0 0-2-1-3 0 0 0-3-1-3 0 0-1-3-1-3 0 0 0-2 0 0-1-3 0 0-1-3 0 0-1-3 0 0-1-3-1-2 0 0 0-3-1-3 0 0-1-3 0 0-1-2 0-1-1-2 0 0-1-3 0 0-1-3-1-2 0 0-1-3-3-5-2-6-2-5-3-5-2-6-3-5-3-5-1-3-2-4-1-4 0-5 1-4 1-5 3-4 3-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 3 1 3 1 0 0 0 3 6 0 0 0 0 2 6 1 0 0 0 2 6 0 0 0 0 3 5 0 1 0 0 3 5 0 1 0 0 2 6 0 0 1 0 2 6 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 1 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 1 0 0 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 4 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 3 0 1 0 0 0 3 0 4 0 0 0 0 0 4 0 0 0 1 0 4 0 0 0 0-1 5 0 0 0 0 0 4 0 5-2 4-2 4-3 4-4 2-4 3-4 1-4 1z m-853-18l-4-1-5-2-3-3-4-3-2-4-2-4-1-4 0-4 0-3 0 0 0 0 0-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 1 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0 0 2-6 0-1 0 0 1-6 0 0 0 0 2-6 0 0 0-1 2-6 0 0 0 0 1-6 0 0 0 0 2-6 0 0 0 0 2-6 0-1 0 0 2-6 0 0 0 0 2-6 0 0 0 0 2-6 1 0 0 0 2-6 0 0 0 0 2-6 0 0 0-1 3-5 0-1 0 0 2-5 0-1 0 0 3-5 0-1 0 0 2-5 0-1 1 0 2-5 0-1 0 0 3-5 0 0 0-1 1-1 2-4 4-4 3-2 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 5 0 4 0 5-1 4-1 4-1 1-3 5-2 6-3 5-2 6-2 5-2 5-3 6-2 6-2 5-1 6-2 5-2 6-2 6-1 5-2 6-1 6-2 5-1 6-1 6-1 6-1 6-1 5-1 6-1 6-1 6 0 6-1 5 0 6-1 6 0 6 0 6-1 6 0 3 0 4-1 5-3 4-2 3-4 3-4 3-4 1-4 1z m694-334l-4-1-4-2-4-3 0 0-5-3-4-4-5-4-5-3-5-3-4-4-5-3-5-3-5-3-5-4-5-3-6-3-5-2-5-3-5-3-5-3-6-2-5-3-5-2-6-2-5-3-6-2-5-2-6-2-5-2-6-2-5-2-6-1-5-2-6-2-6-1-5-1-5-1-4-2-4-2-4-3-2-3-3-4-1-5-1-4 1-5 1-4 2-4 2-4 3-3 4-3 4-1 5-1 4-1 4 1 5 1 0 0 0 0 6 2 0 0 0 0 6 1 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 1 0 5 2 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 3 0 0 0 0 6 2 0 0 1 0 5 3 0 0 1 0 5 2 0 0 1 0 5 3 0 0 1 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 1 0 0 5 3 0 0 1 0 5 3 0 0 0 1 5 3 0 0 1 0 5 4 0 0 0 0 5 3 0 0 0 0 6 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 1 0 4 4 1 0 0 0 0 1 3 3 3 4 2 4 1 4 0 5 0 4-2 4-2 4-3 4-4 3-4 2-4 1-4 1z m-541-2l-4-1-4-3-4-2-3-4-2-4-1-4-1-5 0-4 1-5 2-4 3-4 3-2 1-1 0-1 0 0 5-4 0 0 0 0 5-4 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 3-1 0-1 0 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 2-2 0 0 1 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0-1 3-1 0 0 0 0 3-2 0 0 0 0 2-1 1 0 0 0 2-2 1 0 0 0 2-2 0 0 1 0 2-1 0 0 1 0 2-2 0 0 0 0 3-1 0 0 0 0 3-2 0 0 1 0 2-1 0 0 1 0 2-1 0-1 1 0 2-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 2 0 0 0 0 0 3-1 0 0 0-1 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 4 0 0-1 0 0 3 0 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 0 0 5 0 4 0 5 1 4 2 4 2 3 4 2 3 2 5 1 4 0 5 0 4-2 4-2 4-3 4-4 2-4 3-3 1 0 0-1 0-3 0-2 1 0 0-3 1 0 0-3 1 0 0-3 0 0 0-3 1-3 1-3 1 0 0-3 1-2 1-3 1-3 1-1 0-1 0-3 1-3 1-3 1 0 0-2 1-3 1-3 1-3 0-3 1 0 0-3 1-3 1-2 1 0 0-3 2-3 1 0 0-3 1 0 0-2 1-3 1 0 0-3 1-3 1-2 2-3 1 0 0-3 1-2 1-3 2-3 1-2 1 0 0-3 2-2 1 0 0-3 1 0 0-3 2 0 0-2 1-2 2-1 0-2 1 0 0-3 2-2 1 0 0-3 2-2 1 0 0-3 2 0 0-2 2 0 0-2 1-3 2 0 0-2 2-2 1-1 0-2 2 0 0-2 2-3 1 0 0-2 2 0 0-2 2 0 0-3 2-4 3-5 4-1 1-4 3-4 1-4 2-5 0z" horiz-adv-x="1000" />
+<glyph glyph-name="loop-marker" unicode="&#xe807;" d="m500 672c-175 0-317-141-317-314 0-87 36-165 93-222 27-27 60-49 96-65l-184-32-5-1 2-10 5 1 190 33 5 1 0 3 0-1-37 200 0 5-10-2 1-4 33-182c-33 15-63 36-89 61-56 55-90 131-90 215 0 168 137 304 307 304 170 0 307-136 307-304 0-168-137-304-307-304l-5 0 0-10 5 0c175 0 317 141 317 314 0 173-142 314-317 314z" horiz-adv-x="1000" />
+<glyph glyph-name="user-task" unicode="&#xe808;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m139-101l-3 0c-53 0-87-38-87-86 0-25 18-47 35-63-9-3-33-12-57-25-14-8-28-17-38-28-11-10-18-22-19-36l0 0 0-127 61 0c1 0 1 0 2 0l285 0 0 127c0 12-8 23-19 33-11 11-25 20-40 28-26 15-51 25-61 29 17 16 30 37 30 62 0 48-36 86-89 86z m-24-51c8 0 17-1 25-6 36-19 75-27 82-21 1-3 1-5 1-8 0-24-14-46-31-61l-4-3 4-2c4-1 22-7 42-17-1-43-42-79-94-79-52 0-94 34-95 78 22 10 41 17 45 18l4 1-3 3c-18 16-37 38-37 62 0 3 0 6 0 8 6 6 32 27 61 27z m124-121c6-2 12-6 18-9 14-8 28-17 39-27 10-10 17-20 17-30l0-122-57 0 0 90-5 0 0-90-216 0 0 90c0 3-6 3-5 0l0-90-55 0 0 122c1 12 7 23 17 33 10 10 24 19 37 26 4 2 7 4 11 6 2-45 46-80 100-80 53 0 97 36 99 81z" horiz-adv-x="1000" />
+<glyph glyph-name="business-rule" unicode="&#xe809;" d="m104 644l0-294 0-32 0-5 0-256 194 0 5 0 593 0 0 293 0 294-792 0z m5-194l189 0 0-132-189 0 0 32 0 100z m194 0l588 0 0-100 0-32-588 0 0 132z m-194-137l189 0 0-251-189 0 0 251z m194 0l588 0 0-251-588 0 0 251z" horiz-adv-x="1000" />
+<glyph glyph-name="parallel-mi-marker" unicode="&#xe80a;" d="m178 700l0-700 130 0 0 700-130 0z m257 0l0-700 130 0 0 700-130 0z m257 0l0-700 130 0 0 700-130 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-signal" unicode="&#xe80b;" d="m500 562c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z m0-51c50-90 100-180 151-270-101 0-201 0-302 0 51 90 101 180 151 270z m4 289c-45-7-119 8-139-39 18-48 78-2 116-10 40 3 80-6 119-8 49 46-38 58-72 56-8 1-16 1-24 1z m250-79c-62-19 12-63 34-87 30-33 55-70 76-109 42-29 52 35 23 57-33 54-74 105-127 138l-6 1 0 0z m-521-11c-51-21-82-73-113-115-22-23-63-104 0-91 32 41 53 93 92 130 19 20 77 57 21 76z m695-313c-47-13-14-76-28-111-7-43-22-86-43-125-6-47 57-33 57 6 31 66 44 141 36 213-3 10-13 16-22 17z m-853-19c-48-11-18-76-18-110 11-46 23-94 51-133 67-9 16 67 8 99-12 40-19 82-19 124-2 11-12 19-22 20z m694-334c-50-24-94-64-149-78-33 0-87-36-38-60 75 13 146 49 204 98 14 14 2 40-17 40z m-542-1c-56-22 12-68 41-83 45-25 95-46 147-53 50 23-6 59-38 59-50 15-97 39-136 73l-6 3-8 1 0 0z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-timer" unicode="&#xe80c;" d="m500 564c-85 2-167-54-198-133-33-76-15-170 43-229 56-60 149-82 226-54 81 28 141 108 143 194 5 83-46 166-121 201-29 14-61 21-93 21z m0-39c78 2 152-55 170-131 20-73-14-156-79-194-67-42-160-31-215 26-58 56-68 152-24 219 32 49 89 81 148 80z m55-49c-19-36-39-71-58-107-18-2-23-29-6-36 11-8 20 5 30 4 30 0 59 0 89 0 0 8 0 17 0 25-30 0-60 0-89 0 18 34 37 68 56 102-7 4-14 8-22 12z m-55 233l-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 0-5 0 0-1 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 0 0 0 0 0-4-1 0 0-1 0-1 0-4-1-5-2-3-2-4-3-2-4-2-4-2-4 0-5 1-4 1-5 2-4 3-3 4-3 4-3 4-1 4-1 4 0 1 1 4 0 4 0 4 1 4 0 3 0 4 0 4 0 4 0 4 0 4 0 4 0 3 0 4 0 4-1 4 0 4 0 3-1 4 0 4-1 4 0 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4-1 3-1 4-1 4-1 3-1 4-1 3-2 4-1 4-1 3-1 4-2 3-1 4-1 3-2 0 0 0 0 4-1 5-1 5 0 4 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4 0 5-2 4-2 4-3 3-4 3-3 2 0 0-1 0 0 0-3 2-1 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0-1 0-3 1-1 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0-1 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-5 0 0 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 1 0 0 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0 1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0z m-159-39l-5-1-3-1-2-1 0 0 0 0-4-2 0 0 0 0-3-2-1-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-2 0 0 0 0-4-2 0-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0-1-1-3-2 0 0 0 0-3-3 0 0-1 0-3-2 0-1 0 0-3-2 0 0-1 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0-1 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-4 0 0 0 0-3-3 0 0 0 0-2-3-1 0 0-1-2-3 0 0 0 0-3-3 0 0 0-1-3-3 0 0 0 0-2-3 0 0-1-1-2-3 0 0 0 0-2-3-1-1 0 0-2-3 0 0 0 0-2-4-1 0 0 0-2-3-2-4-1-4-1-5 1-4 1-5 2-4 3-3 3-4 4-2 4-2 4-1 5 0 4 1 5 2 4 2 3 3 2 3 2 3 2 3 2 3 3 3 2 4 2 3 2 3 3 3 2 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 2 3 3 2 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 2 3 2 3 2 3 2 3 2 4 2 3 2 3 2 3 2 4 2 3 2 2 0 3 3 4 3 2 4 2 4 1 4 1 5-1 4-1 5-3 4-2 3-4 3-4 2-4 2-5 0z m392-60l-4-1-4-1-4-3-3-3-3-4-1-4-1-5-1-4 1-5 2-4 2-4 2-3 3-2 3-3 2-3 3-3 2-3 3-3 2-3 3-2 2-3 3-3 2-3 2-3 3-4 2-3 2-3 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-4 2-3 1-3 2-4 2-3 1-3 2-4 2-3 1-4 1-3 2-4 1-3 2-4 1-3 1-4 1-4 2-3 1-4 1-3 0-3 2-4 2-4 4-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 4 0 2 0 0 0 0-2 4 0 0 0 1-1 3 0 1 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-1 3 0 0-1 1-1 3 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0-1 0-1 4-1 0 0 0-2 3 0 1 0 0-2 3 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 3 0 0 0 1-2 3 0 0 0 0-3 4 0 0 0 0-2 3 0 0 0 1-3 3 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 3 0 1 0 0-2 3-1 0 0 0-2 3 0 1 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 4 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 1-3 3 0 0 0 0-3 2-3 3-4 3-5 1-4 1z m-564-170l-4-1-4-2-4-2-3-4-3-3-2-4-1-4-1-4 0 0 0 0 0-4 0 0-1 0 0-4 0-1 0 0-1-4 0 0 0 0-1-4 0 0 0 0 0-5 0 0 0 0-1-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0-1 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0-1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 1-5 0 0 0 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 1-4 0 0 0 0 0-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 0-4 1-1 0 0 0-4 0 0 0 0 1-4 0 0 0 0 1-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0-1 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0 0 2-4 0 0 0 0 1-4 0-1 0 0 1-1 1-4 3-4 3-3 4-3 4-2 4-1 5 0 4 1 5 1 4 2 3 3 3 4 2 4 2 4 0 5 0 4-1 4 0 1-2 4-1 4-1 3-1 4-1 3-1 4 0 4-1 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4 0 4 0 3-1 4 0 4 0 4-1 4 0 4 0 3 0 4 0 4 0 4 0 4 0 4 0 3 1 4 0 4 0 4 1 4 0 3 0 4 1 4 0 4 1 4 1 3 0 4 1 4 0 4 0 5-1 4-2 4-3 4-3 3-4 2-5 2-4 1z m658-119l-5-1-4-2-4-3-3-3-2-4-2-4-1-3 0 0 0 0 0 0 0 0-1-4 0-4-1-4-1-3 0-4-1-4-1-4-1-3-1-4-1-3-1-4-1-4-2-3-1-4-1-3-1-4-2-4-1-3-2-4-1-3-1-4-2-3-2-3-1-4-2-3-2-4-1-3-2-3-2-4-2-3-2-3-2-3-2-4-2-3-2-3-2-3-2-3-2-3-3-3-2-3-2-4-2-1-2-4-2-4-1-5 0-4 1-5 2-4 2-4 3-3 4-3 4-2 4-1 5-1 4 1 4 1 5 2 3 3 3 3 1 1 0 1 0 0 3 3 0 0 0 0 2 3 1 1 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 0 2 4 0 0 0 0 2 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 1 2 3 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 1 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 1 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 0 4 0 0 0 0 0 0 1 5-1 4-1 4-2 4-3 4-4 3-4 2-4 2-5 0z m-590-161l-4-2-4-2-4-3-3-3-2-4-1-5-1-4 1-5 1-4 2-4 2-3 1-2 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-2 1-1 0 0 3-2 0 0 0 0 3-3 1 0 0 0 3-3 0 0 0 0 3-2 1 0 0-1 3-2 0 0 0 0 4-2 0-1 0 0 3-2 0 0 0 0 4-2 0-1 0 0 3-2 1 0 0 0 3-2 0 0 0 0 4-3 0 0 0 0 4-2 0 0 0 0 3-2 1 0 0 0 3-2 0 0 1 0 3-2 0 0 0-1 4-1 0-1 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 4-1 4 0 5 0 4 1 4 2 4 3 3 4 2 3 2 5 1 4 0 5-1 4-2 4-2 4-4 3-3 3-4 2-3 1-4 2-3 1-4 2-3 1-3 2-4 1-3 2-4 2-3 2-3 1-4 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-3 2-3 3-3 2-4 2-3 2-2 3-3 2-3 3-3 2-3 3-3 2-3 3-3 2-2 3-3 3-3 3-3 2-2 3-3 3-2 3-3 3-2 3-1 1-4 3-3 3-5 1-4 1-5 1z m425-76l-4-1-4-2-1-1-4-2-3-1-3-2-4-2-3-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-1-4-1-3-1-4-2-3-1-4-1-4-1-3-1-4-1-4 0-3-1-4-1-4-1-4 0-3-1-4-1-4 0-4-1-3 0-4 0-4-1-4 0-4 0-4-1-3 0-4 0-4 0-5 0-4-2-4-2-4-3-3-3-2-4-1-4-1-5 0-5 1-4 2-4 2-4 4-3 3-3 4-2 5-1 4 0 4 0 0 0 0 0 4 0 0 0 1 0 4 0 0 1 0 0 4 0 0 0 0 0 5 0 0 0 0 0 4 0 0 0 0 0 4 1 1 0 0 0 4 0 0 0 0 0 4 1 0 0 0 0 5 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 1 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 2 0 0 1 0 3 1 1 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 1 1 3 1 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 1 0 0 0 1 4 1 0 0 0 0 4 2 0 0 0 0 4 2 0 0 0 1 4 1 0 1 0 0 4 2 0 0 0 0 2 1 3 2 4 4 2 3 2 5 1 4 0 5-1 4-1 4-3 4-3 4-3 3-4 2-5 1-4 0z m-162 718l-5 0-1 0 0 0-5 0 0 0 0 0-6-1 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 0-5-1 0 0-1 0-5 0 0 0 0 0-5 0-1 0 0-1-5 0 0 0 0 0-5-1-1 0 0 0-5 0 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1 0 0-1 0-5-1 0 0 0 0-5-1 0 0 0 0-6-2 0 0 0 0-5-1 0 0 0 0-5-1-4-2-4-2-4-3-2-4-3-4-1-4 0-5 0-4 1-4 2-5 3-3 3-3 4-3 4-1 5-1 4 0 4 1 5 1 5 1 4 1 5 1 5 1 5 1 5 1 5 1 5 0 4 1 5 1 5 0 5 1 5 0 5 1 5 0 5 0 5 1 5 0 5 0 5 0 5 0 5 0 5 0 5-1 5 0 5 0 5-1 5 0 5-1 5 0 5-1 5-1 4 0 5-1 5-1 5-1 5-1 4-1 5 0 4 0 5 1 4 2 3 3 4 3 2 4 2 4 1 4 0 5-1 4-2 5-2 4-3 3-4 3-4 2-3 1-5 1 0 0 0 0-5 1 0 0-1 0-5 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 1 0 0-6 0 0 0 0 0-5 0 0 0-1 0-5 1 0 0 0 0-5 0-1 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 0 0 0z m250-83l-4-1-5-2-3-2-4-4-2-3-2-4-1-5-1-4 1-5 1-4 3-4 3-4 2-2 2-1 4-3 4-3 4-3 3-3 4-4 4-3 4-3 3-3 4-4 4-3 3-4 4-3 3-4 4-3 3-4 4-4 3-3 3-4 3-4 4-4 3-3 3-4 3-4 3-4 3-4 3-4 2-4 3-4 3-5 3-4 2-4 3-4 2-4 3-5 2-4 2-4 3-5 2-4 1-2 2-4 4-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 4-1 5-1 3-1 3 0 0 0 0-3 5 0 0 0 0-2 5 0 0-1 0-2 4 0 1 0 0-3 4 0 0 0 1-2 4-1 0 0 0-2 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0-1 0-3 4 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-4 4 0 1 0 0-3 4 0 0 0 0-3 4-1 0 0 0-3 4 0 1 0 0-4 4 0 0 0 0-3 4 0 0-1 0-3 4 0 0 0 0-4 4 0 0 0 0-4 4 0 0 0 1-4 3 0 0 0 1-3 3-1 0 0 1-3 3-1 0 0 0-3 4-1 0 0 0-4 4 0 0 0 0-4 4 0 0 0 0-4 3 0 1 0 0-4 3 0 0 0 0-4 4 0 0-1 0-4 3 0 0 0 1-4 3 0 0 0 0-4 3 0 0-1 0-4 4 0 0 0 0-4 3 0 0 0 0-2 1-4 3-4 1-4 1z m-519-10l-4-1-4-2-4-2-1-1 0 0 0 0-4-3 0-1 0 0-4-3 0 0-1 0-4-4 0 0 0 0-4-3 0 0 0-1-4-3 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0-1 0-3-4 0 0 0 0-4-4 0 0 0-1-3-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0 0-1-4-4 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-4 0 0-1 0-3-5 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-5 0 0 0 0-3-4 0 0 0 0-2-5-1 0 0 0-2-5 0 0 0 0-3-4 0-1 0 0-3-4 0 0 0-1-2-4 0 0 0 0-3-5 0 0 0 0-2-5 0 0-1 0-2-5 0 0 0 0-2-5 0 0 0 0-3-5 0 0 0 0-1-3-1-4-1-5 0-4 1-5 2-4 3-4 3-3 4-2 4-2 4-1 5 0 4 0 5 2 3 2 4 3 3 4 2 3 1 3 2 4 2 5 2 4 2 4 3 5 2 4 2 4 3 5 2 4 3 4 3 4 2 4 3 5 3 4 2 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 3 4 3 3 4 4 3 4 4 3 3 4 4 3 3 4 4 3 4 4 3 3 4 3 4 3 4 4 4 3 1 1 3 3 3 3 2 5 1 4 0 4-1 5-1 4-2 4-3 4-4 3-4 2-4 2-4 0z m692-315l-4-1-4-2-4-2-3-4-3-4-2-4 0-4-1-4 1-4 0-5 0-5 0-5 0-5 0-5 0-5-1-5 0-5 0-5-1-5 0-5-1-5 0-5-1-5-1-4 0-5-1-5-1-5-1-5-1-5-1-5-1-4-1-5-1-5-2-5-1-4-2-5-1-5-1-4-2-5-2-5-1-4-2-5-2-4-2-5-2-5-2-4-2-5-2-4-2-4-2-5-2-4-2-5-1-4 0-5 1-4 2-4 2-4 3-4 4-2 4-2 4-2 5 0 4 1 5 1 4 2 3 3 3 3 2 3 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 2 4 0 1 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 1 5 0 0 0 0 2 5 0 0 0 0 1 5 0 0 0 0 2 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 0 2 6 0 0 0 0 1 5 0 0 0 0 1 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 0 5 0 0 0 1 1 5 0 0 0 0 0 5 1 0 0 1 0 5 0 0 0 0 0 5 0 1 0 0 1 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0 1 6 0 0 0 0 0 5 0 0 0 1 0 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0-1 6 0 0 0 0 0 4 0 5-2 4-2 4-3 3-4 3-4 2-4 2-4 0z m-853-16l-4-1-4-1-4-3-4-3-2-4-2-4-1-4-1-4 0-4 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 0-6 0 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 1-5 0 0 0-1 0-5 0 0 0 0 1-5 0-1 0 0 0-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 1-5 0 0 0-1 1-5 0 0 0 0 1-5 0 0 0 0 2-6 0 0 0 0 1-5 0 0 0 0 1-5 0 0 0-1 2-5 0 0 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0-1 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0-1 2-4 0-1 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 3-5 0 0 0 0 2-5 0 0 0 0 2-5 1 0 0 0 0-1 3-4 3-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 5-1 3-1 1-2 5-2 4-2 4-2 5-2 4-2 5-2 5-2 4-2 5-1 4-2 5-1 5-2 4-1 5-2 5-1 4-1 5-2 5-1 5-1 4-1 5-1 5-1 5-1 5-1 5 0 5-1 4-1 5 0 5-1 5 0 5-1 5 0 5 0 5-1 5 0 5 0 5 0 5 0 4 0 4-1 5-2 4-3 3-4 4-3 2-5 2-4 0z m153-334l-5-1-4-3-3-3-3-3-2-4-1-5-1-4 0-5 1-4 2-4 3-4 3-2 1-1 0 0 0 0 4-4 0 0 0 0 4-3 0 0 1 0 4-4 0 0 0 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0-1 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-2 0 0 0-1 5-2 0 0 0 0 4-3 1 0 0 0 4-2 0 0 0-1 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 4-2 1 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 5-1 0 0 0 0 5-2 0 0 0 0 5-1 0 0 0 0 5-2 1 0 0 0 5-1 0 0 0 0 5-1 0 0 0 0 6-2 0 0 0 0 4-1 5 0 4 0 5 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4-1 5-1 4-3 4-3 3-4 3-4 2-3 1-5 1-4 1-5 1-5 1-5 2-4 1-5 2-5 1-4 2-5 1-5 2-4 1-5 2-5 2-4 2-5 2-4 2-5 2-4 2-5 2-4 2-4 2-5 3-4 2-4 2-5 3-4 2-4 3-4 3-4 2-4 3-5 3-4 2-4 3-4 3-4 3-3 3-4 3-4 3-1 1-4 3-4 1-4 1-5 1z m542-2l-4-1-5-2-3-2-1-2-4-3-4-3-4-3-4-3-4-3-4-2-4-3-5-3-4-2-4-3-4-3-4-2-5-3-4-2-4-2-5-3-4-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-1-5-2-4-1-5-2-5-1-5-2-4-1-5-2-5-1-5-1-4-1-5-1-3-1-5-1-4-2-3-3-3-3-2-4-2-5-1-4 0-5 1-4 2-4 3-4 3-3 4-3 4-2 4-1 5 0 4 0 3 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 2 0 0 1 0 5 1 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 1 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 1 0 0 4 2 1 0 0 0 4 3 0 0 1 0 4 2 0 1 0 0 5 2 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 1 4 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 4 4 1 0 0 0 4 3 0 0 0 0 2 2 3 3 3 4 2 4 1 4 0 5-1 4-1 5-2 4-3 3-4 3-4 2-4 2-4 0z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-parallel-multiple" unicode="&#xe80d;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-61-93c0-52 0-104 0-156-53 0-106 0-159 0 0-41 0-83 0-124 53 0 106 0 159 0 0-52 0-104 0-156 41 0 81 0 122 0 0 52 0 104 0 156 53 0 106 0 159 0 0 41 0 83 0 124-53 0-106 0-159 0 0 52 0 104 0 156-41 0-81 0-122 0z m25-24c24 0 48 0 73 0 0-52 0-104 0-157 53 0 106 0 159 0 0-24 0-49 0-74-53 0-106 0-159 0 0-53 0-105 0-157-25 0-49 0-73 0 0 52 0 104 0 157-54 0-107 0-160 0 0 25 0 50 0 74 53 0 106 0 160 0 0 53 0 105 0 157z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-compensation" unicode="&#xe80e;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-16-163c-70-49-140-99-209-148 70-49 139-99 209-148 0 48 0 95 0 143 67-48 135-95 202-143 0 99 0 197 0 296-67-48-135-95-202-143 0 48 0 95 0 143z m-24-47c0-67 0-134 0-201-48 33-95 67-143 100 48 34 95 67 143 101z m202 0c0-67 0-134 0-202-48 34-95 68-143 101 48 34 95 67 143 101z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-xor" unicode="&#xe80f;" d="m500 802c-9 0-19-4-26-11l-415-415c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-7 7-17 11-26 11z m0-62l390-390-390-390-390 390 390 390z m-146-217c0 0-4-1-4-1 0 0-4-3-4-3l-15-15c0 0-3-4-3-4 0 0-1-4-1-4 0 0 1-5 1-5 0 0 3-4 3-4l137-137-137-137 0 0c0 0-3-4-3-4 0 0-1-5-1-5 0 0 1-4 1-4 0 0 3-4 3-4l15-15c0 0 4-3 4-3 0 0 4-1 4-1 0 0 5 1 5 1 0 0 4 3 4 3l137 137 137-137c0 0 4-3 4-3 0 0 5-1 5-1 0 0 4 1 4 1 0 0 4 3 4 3l15 15c0 0 3 4 3 4 0 0 1 4 1 4 0 0-1 5-1 5 0 0-3 4-3 4l-137 137 137 137c0 0 3 4 3 4 0 0 1 5 1 5 0 0-1 4-1 4 0 0-3 4-3 4l-15 15c0 0-4 3-4 3 0 0-4 1-4 1 0 0-5-1-5-1 0 0-4-3-4-3l-137-137-137 137 0 1c0 0-4 2-4 2 0 0-5 1-5 1l0 0z" horiz-adv-x="1000" />
+<glyph glyph-name="connection" unicode="&#xe810;" d="m911 749c0 0-285-146-431-214 31-28 60-59 90-89-147-149-295-299-443-448 11-11 22-21 33-31 148 149 295 299 443 448 30-29 60-60 90-90 77 153 218 424 218 424z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-cancel" unicode="&#xe811;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m-112-110c-29-30-58-59-87-88 37-38 75-75 112-113-37-36-74-73-110-110 28-29 57-58 86-86 37 37 73 73 110 110 38-37 75-75 113-112 29 29 58 58 88 87-38 38-76 75-113 113 37 37 74 73 110 110-28 29-57 58-86 86-37-36-73-73-110-110-38 37-75 75-113 113z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-condition" unicode="&#xe812;" d="m499 802c-1 0-2 0-3 0-202 1-391-150-436-346-42-173 28-368 174-471 145-107 354-116 506-18 149 93 235 276 207 450-26 176-164 330-338 371-36 9-73 14-110 14z m-5-49c3 0 7 0 10 0 187 2 362-146 392-331 32-167-54-348-205-427-154-85-363-54-483 77-124 127-147 338-53 488 71 116 203 192 339 193z m8-44c-3 0-7 0-10 0-172 0-330-143-349-314-22-161 79-328 233-382 145-55 322-3 413 124 98 129 92 326-17 447-67 77-167 125-270 125z m-2-48c2 0 4 0 6 0 153 0 292-129 304-281 16-145-84-293-225-330-137-40-296 27-361 154-69 129-33 305 86 392 54 42 122 65 190 65z m-151-121l0-12 0-368 50 0 202 0 50 0 0 380-302 0z m24-24l254 0 0-332-26 0-202 0-26 0 0 332z m26-37l0-25 202 0 0 25-202 0z m0-74l0-24 202 0 0 24-202 0z m0-85l0-24 202 0 0 24-202 0z m0-77l0-24 202 0 0 24-202 0z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-parallel-multiple" unicode="&#xe813;" d="m430 545l0-125-125 0 0-140 125 0 0-125 140 0 0 125 125 0 0 140-125 0 0 125z m23-23l94 0 0-125 125 0 0-94-125 0 0-125-94 0 0 126-125 0 0 93 125 0z m47 280l0 0-5 0-1 0 0 0-5 0 0 0 0 0-6-1 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 0-5-1 0 0-1 0-5 0 0 0 0 0-5 0-1 0 0-1-5 0 0 0 0 0-5-1-1 0 0 0-5 0 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1 0 0-1 0-5-1 0 0 0 0-5-1 0 0 0 0-6-2 0 0 0 0-5-1 0 0 0 0-5-1-4-2-4-2-4-3-2-4-3-4-1-4 0-5 0-4 1-4 2-5 3-3 3-3 4-3 4-1 5-1 4 0 4 1 5 1 5 1 4 1 5 1 5 1 5 1 5 1 5 1 5 0 4 1 5 1 5 0 5 1 5 0 5 1 5 0 5 0 5 1 5 0 5 0 5 0 5 0 5 0 5 0 5-1 5 0 5 0 5-1 5 0 5-1 5 0 5-1 5-1 4 0 5-1 5-1 5-1 5-1 4-1 5 0 4 0 5 1 4 2 3 3 4 3 2 4 2 4 1 4 0 5-1 4-2 5-2 4-3 3-4 3-4 2-3 1-5 1 0 0 0 0-5 1 0 0-1 0-5 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 1 0 0-6 0 0 0 0 0-5 0 0 0-1 0-5 1 0 0 0 0-5 0-1 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 0 0 0z m255-83l-5 0-4-1-5-2-3-2-4-4-2-3-2-4-1-5-1-4 1-5 1-4 3-4 3-4 2-2 2-1 4-3 4-3 4-3 3-3 4-4 4-3 4-3 3-3 4-4 4-3 3-4 4-3 3-4 4-3 3-4 4-4 3-3 3-4 3-4 4-4 3-3 3-4 3-4 3-4 3-4 3-4 2-4 3-4 3-5 3-4 2-4 3-4 2-4 3-5 2-4 2-4 3-5 2-4 1-2 2-4 4-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 4-1 5-1 3-1 3 0 0 0 0-3 5 0 0 0 0-2 5 0 0-1 0-2 4 0 1 0 0-3 4 0 0 0 1-2 4-1 0 0 0-2 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0-1 0-3 4 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-4 4 0 1 0 0-3 4 0 0 0 0-3 4-1 0 0 0-3 4 0 1 0 0-4 4 0 0 0 0-3 4 0 0-1 0-3 4 0 0 0 0-4 4 0 0 0 0-4 4 0 0 0 1-4 3 0 0 0 1-3 3-1 0 0 1-3 3-1 0 0 0-3 4-1 0 0 0-4 4 0 0 0 0-4 4 0 0 0 0-4 3 0 1 0 0-4 3 0 0 0 0-4 4 0 0-1 0-4 3 0 0 0 1-4 3 0 0 0 0-4 3 0 0-1 0-4 4 0 0 0 0-4 3 0 0 0 0-2 1-4 3-4 1-4 1z m-519-10l-5 0-4-1-4-2-4-2-1-1 0 0 0 0-4-3 0-1 0 0-4-3 0 0-1 0-4-4 0 0 0 0-4-3 0 0 0-1-4-3 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0-1 0-3-4 0 0 0 0-4-4 0 0 0-1-3-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0 0-1-4-4 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-4 0 0-1 0-3-5 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-5 0 0 0 0-3-4 0 0 0 0-2-5-1 0 0 0-2-5 0 0 0 0-3-4 0-1 0 0-3-4 0 0 0-1-2-4 0 0 0 0-3-5 0 0 0 0-2-5 0 0-1 0-2-5 0 0 0 0-2-5 0 0 0 0-3-5 0 0 0 0-1-3-1-4-1-5 0-4 1-5 2-4 3-4 3-3 4-2 4-2 4-1 5 0 4 0 5 2 3 2 4 3 3 4 2 3 1 3 2 4 2 5 2 4 2 4 3 5 2 4 2 4 3 5 2 4 3 4 3 4 2 4 3 5 3 4 2 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 3 4 3 3 4 4 3 4 4 3 3 4 4 3 3 4 4 3 4 4 3 3 4 3 4 3 4 4 4 3 1 1 3 3 3 3 2 5 1 4 0 4-1 5-1 4-2 4-3 4-4 3-4 2-4 2-4 0z m264 0l0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 0-5 0 0-1 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 0 0 0 0 0-4-1 0 0-1 0-1 0-4-1-5-2-3-2-4-3-2-4-2-4-2-4 0-5 1-4 1-5 2-4 3-3 4-3 4-3 4-1 4-1 4 0 1 1 4 0 4 0 4 1 4 0 3 0 4 0 4 0 4 0 4 0 4 0 4 0 3 0 4 0 4-1 4 0 4 0 3-1 4 0 4-1 4 0 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4-1 3-1 4-1 4-1 3-1 4-1 3-2 4-1 4-1 3-1 4-2 3-1 4-1 3-2 0 0 0 0 4-1 5-1 5 0 4 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4 0 5-2 4-2 4-3 3-4 3-3 2 0 0-1 0 0 0-3 2-1 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0-1 0-3 1-1 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0-1 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-5 0 0 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 1 0 0 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0 1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0z m-155-39l-4 0-5-1-3-1-2-1 0 0 0 0-4-2 0 0 0 0-3-2-1-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-2 0 0 0 0-4-2 0-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0-1-1-3-2 0 0 0 0-3-3 0 0-1 0-3-2 0-1 0 0-3-2 0 0-1 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0-1 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-4 0 0 0 0-3-3 0 0 0 0-2-3-1 0 0-1-2-3 0 0 0 0-3-3 0 0 0-1-3-3 0 0 0 0-2-3 0 0-1-1-2-3 0 0 0 0-2-3-1-1 0 0-2-3 0 0 0 0-2-4-1 0 0 0-2-3-2-4-1-4-1-5 1-4 1-5 2-4 3-3 3-4 4-2 4-2 4-1 5 0 4 1 5 2 4 2 3 3 2 3 2 3 2 3 2 3 3 3 2 4 2 3 2 3 3 3 2 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 2 3 3 2 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 2 3 2 3 2 3 2 3 2 4 2 3 2 3 2 3 2 4 2 3 2 2 0 3 3 4 3 2 4 2 4 1 4 1 5-1 4-1 5-3 4-2 3-4 3-4 2-4 2-5 0z m393-59l-5-1-4-1-4-1-4-3-3-3-3-4-1-4-1-5-1-4 1-5 2-4 2-4 2-3 3-2 3-3 2-3 3-3 2-3 3-3 2-3 3-2 2-3 3-3 2-3 2-3 3-4 2-3 2-3 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-4 2-3 1-3 2-4 2-3 1-3 2-4 2-3 1-4 1-3 2-4 1-3 2-4 1-3 1-4 1-4 2-3 1-4 1-3 0-3 2-4 2-4 4-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 4 0 2 0 0 0 0-2 4 0 0 0 1-1 3 0 1 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-1 3 0 0-1 1-1 3 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0-1 0-1 4-1 0 0 0-2 3 0 1 0 0-2 3 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 3 0 0 0 1-2 3 0 0 0 0-3 4 0 0 0 0-2 3 0 0 0 1-3 3 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 3 0 1 0 0-2 3-1 0 0 0-2 3 0 1 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 4 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 1-3 3 0 0 0 0-3 2-3 3-4 3-5 1-4 1z m-564-171l-5 0-4-1-4-2-4-2-3-4-3-3-2-4-1-4-1-4 0 0 0 0 0-4 0 0-1 0 0-4 0-1 0 0-1-4 0 0 0 0-1-4 0 0 0 0 0-5 0 0 0 0-1-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0-1 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0-1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 1-5 0 0 0 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 1-4 0 0 0 0 0-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 0-4 1-1 0 0 0-4 0 0 0 0 1-4 0 0 0 0 1-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0-1 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0 0 2-4 0 0 0 0 1-4 0-1 0 0 1-1 1-4 3-4 3-3 4-3 4-2 4-1 5 0 4 1 5 1 4 2 3 3 3 4 2 4 2 4 0 5 0 4-1 4 0 1-2 4-1 4-1 3-1 4-1 3-1 4 0 4-1 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4 0 4 0 3-1 4 0 4 0 4-1 4 0 4 0 3 0 4 0 4 0 4 0 4 0 4 0 3 1 4 0 4 0 4 1 4 0 3 0 4 1 4 0 4 1 4 1 3 0 4 1 4 0 4 0 5-1 4-2 4-3 4-3 3-4 2-5 2-4 1z m754-46l-5 0-4-1-4-2-4-2-3-4-3-4-2-4 0-4-1-4 1-4 0-5 0-5 0-5 0-5 0-5 0-5-1-5 0-5 0-5-1-5 0-5-1-5 0-5-1-5-1-4 0-5-1-5-1-5-1-5-1-5-1-5-1-4-1-5-1-5-2-5-1-4-2-5-1-5-1-4-2-5-2-5-1-4-2-5-2-4-2-5-2-5-2-4-2-5-2-4-2-4-2-5-2-4-2-5-1-4 0-5 1-4 2-4 2-4 3-4 4-2 4-2 4-2 5 0 4 1 5 1 4 2 3 3 3 3 2 3 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 2 4 0 1 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 1 5 0 0 0 0 2 5 0 0 0 0 1 5 0 0 0 0 2 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 0 2 6 0 0 0 0 1 5 0 0 0 0 1 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 0 5 0 0 0 1 1 5 0 0 0 0 0 5 1 0 0 1 0 5 0 0 0 0 0 5 0 1 0 0 1 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0 1 6 0 0 0 0 0 5 0 0 0 1 0 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0-1 6 0 0 0 0 0 4 0 5-2 4-2 4-3 3-4 3-4 2-4 2-4 0z m-853-16l-5 0-4-1-4-1-4-3-4-3-2-4-2-4-1-4-1-4 0-4 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 0-6 0 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 1-5 0 0 0-1 0-5 0 0 0 0 1-5 0-1 0 0 0-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 1-5 0 0 0-1 1-5 0 0 0 0 1-5 0 0 0 0 2-6 0 0 0 0 1-5 0 0 0 0 1-5 0 0 0-1 2-5 0 0 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0-1 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0-1 2-4 0-1 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 3-5 0 0 0 0 2-5 0 0 0 0 2-5 1 0 0 0 0-1 3-4 3-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 5-1 3-1 1-2 5-2 4-2 4-2 5-2 4-2 5-2 5-2 4-2 5-1 4-2 5-1 5-2 4-1 5-2 5-1 4-1 5-2 5-1 5-1 4-1 5-1 5-1 5-1 5-1 5 0 5-1 4-1 5 0 5-1 5 0 5-1 5 0 5 0 5-1 5 0 5 0 5 0 5 0 4 0 4-1 5-2 4-3 3-4 4-3 2-5 2-4 0z m756-57l-4 0-5-1-4-2-4-3-3-3-2-4-2-4-1-3 0 0 0 0 0 0 0 0-1-4 0-4-1-4-1-3 0-4-1-4-1-4-1-3-1-4-1-3-1-4-1-4-2-3-1-4-1-3-1-4-2-4-1-3-2-4-1-3-1-4-2-3-2-3-1-4-2-3-2-4-1-3-2-3-2-4-2-3-2-3-2-3-2-4-2-3-2-3-2-3-2-3-2-3-3-3-2-3-2-4-2-1-2-4-2-4-1-5 0-4 1-5 2-4 2-4 3-3 4-3 4-2 4-1 5-1 4 1 4 1 5 2 3 3 3 3 1 1 0 1 0 0 3 3 0 0 0 0 2 3 1 1 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 0 2 4 0 0 0 0 2 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 1 2 3 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 1 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 1 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 0 4 0 0 0 0 0 0 1 5-1 4-1 4-2 4-3 4-4 3-4 2-4 2-5 0z m-590-160l-4-1-4-2-4-2-4-3-3-3-2-4-1-5-1-4 1-5 1-4 2-4 2-3 1-2 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-2 1-1 0 0 3-2 0 0 0 0 3-3 1 0 0 0 3-3 0 0 0 0 3-2 1 0 0-1 3-2 0 0 0 0 4-2 0-1 0 0 3-2 0 0 0 0 4-2 0-1 0 0 3-2 1 0 0 0 3-2 0 0 0 0 4-3 0 0 0 0 4-2 0 0 0 0 3-2 1 0 0 0 3-2 0 0 1 0 3-2 0 0 0-1 4-1 0-1 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 4-1 4 0 5 0 4 1 4 2 4 3 3 4 2 3 2 5 1 4 0 5-1 4-2 4-2 4-4 3-3 3-4 2-3 1-4 2-3 1-4 2-3 1-3 2-4 1-3 2-4 2-3 2-3 1-4 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-3 2-3 3-3 2-4 2-3 2-2 3-3 2-3 3-3 2-3 3-3 2-3 3-3 2-2 3-3 3-3 3-3 2-2 3-3 3-2 3-3 3-2 3-1 1-4 3-3 3-5 1-4 1-5 1z m426-77l-5 0-4-1-4-2-1-1-4-2-3-1-3-2-4-2-3-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-1-4-1-3-1-4-2-3-1-4-1-4-1-3-1-4-1-4 0-3-1-4-1-4-1-4 0-3-1-4-1-4 0-4-1-3 0-4 0-4-1-4 0-4 0-4-1-3 0-4 0-4 0-5 0-4-2-4-2-4-3-3-3-2-4-1-4-1-5 0-5 1-4 2-4 2-4 4-3 3-3 4-2 5-1 4 0 4 0 0 0 0 0 4 0 0 0 1 0 4 1 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 4 0 0 0 0 0 4 1 1 0 0 0 4 0 0 0 0 0 4 1 0 0 0 0 5 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 1 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 2 0 0 1 0 3 1 1 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 1 1 3 1 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 1 0 0 0 1 4 1 0 0 0 0 4 2 0 0 0 0 4 2 0 0 0 1 4 1 0 1 0 0 4 2 0 0 0 0 2 1 3 2 4 4 2 3 2 5 1 4 0 5-1 4-1 4-3 4-3 4-3 3-4 2-5 1-4 0z m-440-39l-4-1-5-1-4-3-3-3-3-3-2-4-1-5-1-4 0-5 1-4 2-4 3-4 3-2 1-1 0 0 0 0 4-4 0 0 0 0 4-3 0 0 1 0 4-4 0 0 0 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0-1 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-2 0 0 0-1 5-2 0 0 0 0 4-3 1 0 0 0 4-2 0 0 0-1 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 4-2 1 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 5-1 0 0 0 0 5-2 0 0 0 0 5-1 0 0 0 0 5-2 1 0 0 0 5-1 0 0 0 0 5-1 0 0 0 0 6-2 0 0 0 0 4-1 5 0 4 0 5 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4-1 5-1 4-3 4-3 3-4 3-4 2-3 1-5 1-4 1-5 1-5 1-5 2-4 1-5 2-5 1-4 2-5 1-5 2-4 1-5 2-5 2-4 2-5 2-4 2-5 2-4 2-5 2-4 2-4 2-5 3-4 2-4 2-5 3-4 2-4 3-4 3-4 2-4 3-5 3-4 2-4 3-4 3-4 3-3 3-4 3-4 3-1 1-4 3-4 1-4 1-5 1z m543-3l-5 0-4-1-5-2-3-2-1-2-4-3-4-3-4-3-4-3-4-3-4-2-4-3-5-3-4-2-4-3-4-3-4-2-5-3-4-2-4-2-5-3-4-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-1-5-2-4-1-5-2-5-1-5-2-4-1-5-2-5-1-5-1-4-1-5-1-3-1-5-1-4-2-3-3-3-3-2-4-2-5-1-4 0-5 1-4 2-4 3-4 3-3 4-3 4-2 4-1 5 0 4 0 3 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 2 0 0 1 0 5 1 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 1 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 1 0 0 4 2 1 0 0 0 4 3 0 0 1 0 4 2 0 1 0 0 5 2 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 1 4 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 4 4 1 0 0 0 4 3 0 0 0 0 2 2 3 3 3 4 2 4 1 4 0 5-1 4-1 5-2 4-3 3-4 3-4 2-4 2-4 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-condition" unicode="&#xe814;" d="m500 802c-249 0-452-203-452-452 0-249 203-452 452-452 249 0 452 203 452 452 0 249-203 452-452 452z m0-49c223 0 403-180 403-403 0-223-180-403-403-403-223 0-403 180-403 403 0 223 180 403 403 403z m-151-213l0-12 0-368 50 0 202 0 50 0 0 380-302 0z m24-24l254 0 0-332-26 0-202 0-26 0 0 332z m26-37l0-25 202 0 0 25-202 0z m0-74l0-24 202 0 0 24-202 0z m0-85l0-24 202 0 0 24-202 0z m0-77l0-24 202 0 0 24-202 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-timer" unicode="&#xe815;" d="m500 564c-85 2-167-54-198-133-33-76-15-170 43-229 56-60 149-82 226-54 81 28 141 108 143 194 5 83-46 166-121 201-29 14-61 21-93 21z m0-39c78 2 152-55 170-131 20-73-14-156-79-194-67-42-160-31-215 26-58 56-68 152-24 219 32 49 89 81 148 80z m55-49c-19-36-39-71-58-107-18-2-23-29-6-36 11-8 20 5 30 4 30 0 59 0 89 0 0 8 0 17 0 25-30 0-60 0-89 0 18 34 37 68 56 102-7 4-14 8-22 12z m-51 324l-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 0-6-1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6 0 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0-1 0 0-6-1 0 0-1 0-6-1 0 0 0 0-6-2 0 0 0 0-4-1-4-1-4-2-3-3-3-4-2-4-2-4 0-5 0-4 1-5 2-4 3-4 3-3 4-2 5-2 4-1 5 0 3 1 3 1 6 1 6 1 6 2 5 1 6 1 6 1 6 1 6 0 6 1 5 1 6 0 6 1 6 0 6 1 6 0 6 0 6 0 6 0 6 0 5 0 6 0 6-1 6 0 6-1 6 0 6-1 5 0 6-1 6-1 6-1 6-1 5-1 2 0 4-1 5 0 4 2 4 2 4 2 3 4 3 3 1 5 1 4 0 5-1 4-1 4-3 4-3 4-3 2-5 2-3 1-2 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0 0 0-7 1 0 0 0 0-6 0 0 1-1 0-6 0 0 0 0 0-6 1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6 1 0 0 0 0-6 0-1 0 0 0-6 0 0 0z m246-79l-5-1-4-1-4-3-3-3-3-4-1-4-2-4 0-5 1-4 1-5 2-4 3-3 3-3 2-1 0 0 2-2 0 0 3-1 0 0 2-2 0 0 2-2 2-2 0 0 3-2 0 0 2-1 2-2 0 0 2-2 3-2 0 0 2-2 2-2 0 0 2-2 2-2 1 0 2-2 2-2 2-2 0 0 2-2 0 0 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 2-2 0 0 2-3 2-2 2-2 0-1 1-2 0 0 2-2 0 0 2-3 0 0 1 0 2-4 3-3 2-4 3-3 2-3 3-4 2-3 2-4 0 0 3-3 2-4 2-4 3-3 2-4 2-3 2-4 2-4 2-3 2-4 2-4 1-2 3-4 3-4 3-2 4-2 5-2 4 0 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 5-1 4-1 3-2 3 0 0 0 0-2 4 0 0 0 1-2 4 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0-1 0-2 4 0 0 0 0-3 4 0 0 0 0-3 4 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 4 0 0 0 0-3 3-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2-1 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 2 0 0-1 0-2 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2-1 0 0 1-2 1 0 1 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-2 1-4 2-4 2-5 0z m-521-12l-5-1-4-2-3-2 0 0 0 0-1 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0-1-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0-1 0 0-2-2 0 0 0 0-2-2 0 0-1 0-2-2 0 0 0-1-2-2 0 0 0 0-3-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2-1 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0-1 0-1-3 0 0 0 0-2-2-1-2 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0-1-2-2 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0 0-1-2-4 0-5 0-4 1-5 2-4 2-4 4-3 3-3 5-1 4-1 5-1 4 1 4 2 4 2 4 3 3 3 1 4 1 0 1 3 1 3 0 0 1 2 0 0 2 3 1 3 0 0 2 2 0 0 1 3 1 2 0 1 2 2 1 3 0 0 2 2 0 0 1 3 2 2 0 0 1 3 2 2 1 3 0 0 2 3 0 0 2 2 0 0 1 2 2 3 2 2 0 0 1 3 2 2 2 3 1 1 0 0 2 3 1 2 0 0 2 3 2 2 0 0 1 3 2 2 0 0 2 3 0 0 2 2 1 3 2 2 0 0 2 2 2 3 2 2 0 0 2 2 1 3 2 2 0 0 2 2 2 2 0 0 2 3 0 0 2 2 0 0 2 2 0 0 2 2 2 2 0 0 2 2 0 0 2 3 0 0 2 2 2 2 0 0 2 2 3 2 0 0 2 2 2 2 0 0 2 2 0 0 2 2 0 0 2 2 0 0 3 1 0 0 2 2 0 0 2 2 0 0 2 2 3 2 0 0 2 2 0 0 0 0 3 3 3 4 2 4 1 4 0 5 0 4-2 5-2 4-3 3-3 3-4 2-4 2-5 1z m694-313l-4-1-5-2-3-2-3-4-3-4-2-4-1-4 0-4 1-4 0-4 0-4 0-5 0-4 0 0 0-1 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0-3 0-3 0-3-1-3 0-3 0 0 0-3 0 0 0-3-1-3 0-3 0-3-1-2 0-1 0-3 0 0 0-2-1-3 0-3 0 0-1-3 0-3-1-3 0 0 0-3-1-3-1-3 0 0 0-2-1-3 0 0 0-3-1-3 0 0-1-3-1-3 0 0 0-2 0 0-1-3 0 0-1-3 0 0-1-3 0 0-1-3-1-2 0 0 0-3-1-3 0 0-1-3 0 0-1-2 0-1-1-2 0 0-1-3 0 0-1-3-1-2 0 0-1-3-3-5-2-6-2-5-3-5-2-6-3-5-3-5-1-3-2-4-1-4 0-5 1-4 1-5 3-4 3-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 3 1 3 1 0 0 0 3 6 0 0 0 0 2 6 1 0 0 0 2 6 0 0 0 0 3 5 0 1 0 0 3 5 0 1 0 0 2 6 0 0 1 0 2 6 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 1 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 1 0 0 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 4 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 3 0 1 0 0 0 3 0 4 0 0 0 0 0 4 0 0 0 1 0 4 0 0 0 0-1 5 0 0 0 0 0 4 0 5-2 4-2 4-3 4-4 2-4 3-4 1-4 1z m-853-18l-4-1-5-2-3-3-4-3-2-4-2-4-1-4 0-4 0-3 0 0 0 0 0-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 1 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0 0 2-6 0-1 0 0 1-6 0 0 0 0 2-6 0 0 0-1 2-6 0 0 0 0 1-6 0 0 0 0 2-6 0 0 0 0 2-6 0-1 0 0 2-6 0 0 0 0 2-6 0 0 0 0 2-6 1 0 0 0 2-6 0 0 0 0 2-6 0 0 0-1 3-5 0-1 0 0 2-5 0-1 0 0 3-5 0-1 0 0 2-5 0-1 1 0 2-5 0-1 0 0 3-5 0 0 0-1 1-1 2-4 4-4 3-2 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 5 0 4 0 5-1 4-1 4-1 1-3 5-2 6-3 5-2 6-2 5-2 5-3 6-2 6-2 5-1 6-2 5-2 6-2 6-1 5-2 6-1 6-2 5-1 6-1 6-1 6-1 6-1 5-1 6-1 6-1 6 0 6-1 5 0 6-1 6 0 6 0 6-1 6 0 3 0 4-1 5-3 4-2 3-4 3-4 3-4 1-4 1z m694-334l-4-1-4-2-4-3 0 0-5-3-4-4-5-4-5-3-5-3-4-4-5-3-5-3-5-3-5-4-5-3-6-3-5-2-5-3-5-3-5-3-6-2-5-3-5-2-6-2-5-3-6-2-5-2-6-2-5-2-6-2-5-2-6-1-5-2-6-2-6-1-5-1-5-1-4-2-4-2-4-3-2-3-3-4-1-5-1-4 1-5 1-4 2-4 2-4 3-3 4-3 4-1 5-1 4-1 4 1 5 1 0 0 0 0 6 2 0 0 0 0 6 1 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 1 0 5 2 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 3 0 0 0 0 6 2 0 0 1 0 5 3 0 0 1 0 5 2 0 0 1 0 5 3 0 0 1 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 1 0 0 5 3 0 0 1 0 5 3 0 0 0 1 5 3 0 0 1 0 5 4 0 0 0 0 5 3 0 0 0 0 6 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 1 0 4 4 1 0 0 0 0 1 3 3 3 4 2 4 1 4 0 5 0 4-2 4-2 4-3 4-4 3-4 2-4 1-4 1z m-541-2l-4-1-4-3-4-2-3-4-2-4-1-4-1-5 0-4 1-5 2-4 3-4 3-2 1-1 0-1 0 0 5-4 0 0 0 0 5-4 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 3-1 0-1 0 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 2-2 0 0 1 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0-1 3-1 0 0 0 0 3-2 0 0 0 0 2-1 1 0 0 0 2-2 1 0 0 0 2-2 0 0 1 0 2-1 0 0 1 0 2-2 0 0 0 0 3-1 0 0 0 0 3-2 0 0 1 0 2-1 0 0 1 0 2-1 0-1 1 0 2-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 2 0 0 0 0 0 3-1 0 0 0-1 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 4 0 0-1 0 0 3 0 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 0 0 5 0 4 0 5 1 4 2 4 2 3 4 2 3 2 5 1 4 0 5 0 4-2 4-2 4-3 4-4 2-4 3-3 1 0 0-1 0-3 0-2 1 0 0-3 1 0 0-3 1 0 0-3 0 0 0-3 1-3 1-3 1 0 0-3 1-2 1-3 1-3 1-1 0-1 0-3 1-3 1-3 1 0 0-2 1-3 1-3 1-3 0-3 1 0 0-3 1-3 1-2 1 0 0-3 2-3 1 0 0-3 1 0 0-2 1-3 1 0 0-3 1-3 1-2 2-3 1 0 0-3 1-2 1-3 2-3 1-2 1 0 0-3 2-2 1 0 0-3 1 0 0-3 2 0 0-2 1-2 2-1 0-2 1 0 0-3 2-2 1 0 0-3 2-2 1 0 0-3 2 0 0-2 2 0 0-2 1-3 2 0 0-2 2-2 1-1 0-2 2 0 0-2 2-3 1 0 0-2 2 0 0-2 2 0 0-3 2-4 3-5 4-1 1-4 3-4 1-4 2-5 0z" horiz-adv-x="1000" />
+<glyph glyph-name="sequential-mi-marker-kopie" unicode="&#xe816;" d="m150 672l0-130 700 0 0 130-700 0z m0-257l0-130 700 0 0 130-700 0z m0-257l0-130 700 0 0 130-700 0z" horiz-adv-x="1000" />
+<glyph glyph-name="manual" unicode="&#xe817;" d="m460 644c-7 0-15-3-22-8l0 0 0 0c-47-30-209-143-245-167-29-20-49-50-61-87l0 0 0 0c-12-38-10-82-10-120l0 0 0 0c0-28 1-51 8-79 0 0 0 0 0 0 0 0 0 0 0 0 10-42 28-73 54-94 25-21 59-32 97-32 147-1 293-1 439 0l0 0 0 0c12 0 22 3 29 10 7 7 11 18 11 33l0 0c0 15-3 26-11 32-7 6-17 9-29 9l0 0c-55 0-184 0-189 0l0 21 252 0c13 0 23 2 31 6 8 5 14 14 16 25 4 18 1 32-7 41-8 10-21 14-38 14l0 0c-77 0-249 0-254 0l0 19c5 0 271 0 302 0 16 0 28 5 35 13 7 9 10 21 10 37 0 15-4 27-11 34-8 8-20 11-34 11l0 0c-93 0-298 0-302 0l0 19c5 0 159 0 226 0l0 0 0 0c15 0 26 5 34 13 8 9 12 21 12 37l0 0 0 0c0 15-4 27-12 36-8 8-20 13-34 13l0 0c-55 0-141 0-214-1-36 0-70 0-94 0-13 0-23 0-30 1-4 0-7 0-9 0-1 0-2 0-2 0-1 0-1 0-1 0 0 0 0 0-1 1 0 0 1 1 0 0 6 7 22 23 38 39 16 16 32 32 39 40l0 0c15 20 17 48 5 66l0 0c-7 11-15 16-24 17-1 0-2 1-4 1z m0-5c1 0 2-1 3-1 7-1 14-5 21-15l0 0 0 0c10-16 9-41-5-60l0 0 0 0c-6-7-22-23-39-39-16-17-32-32-38-39-1-2-1-5 0-6 1-2 2-3 4-4 0 0 1 0 2 0 0 0 1 0 2 0 2 0 5 0 9 0 7-1 17-1 30-1 24 0 58 0 94 0 73 1 159 1 214 1l0 0 0 0c13 0 23-4 30-12 7-7 11-18 11-33 0-14-4-25-11-33-6-7-16-11-30-11-68 0-228 0-228 0l-3 0 0-29 3 0c0 0 210 0 304 0 14 0 24-3 30-9 7-7 10-17 10-31 0-15-3-26-9-34-6-7-16-11-31-11-31 0-304 0-304 0l-3 0 0-29 3 0c0 0 178 0 256 0l0 0 0 0c16 0 27-4 34-12 7-8 10-20 6-37l0 0 0 0c-2-11-6-17-13-21-7-4-17-6-29-6l-257 0 0-3 0-28 3 0c0 0 135 0 191 0l0 0c12 0 20-3 26-8 6-5 9-14 9-28l0 0 0 0c0-14-4-23-9-29-6-6-15-9-26-9-146-1-292-1-439 0l0 0 0 0c-38 0-69 10-94 31-25 20-43 50-53 91l0 0 0 0c-6 28-7 50-7 78l0 0c0 38-1 82 10 118 12 36 31 65 59 85 36 24 198 137 244 167l0 0c7 4 14 7 20 7z" horiz-adv-x="1000" />
+<glyph glyph-name="receive" unicode="&#xe818;" d="m115 644c0 0 0 0-1 0 0 0 0 0 0 0-1-1-2-2-2-3l0-582c0-1 1-2 3-2l771 0c1 0 2 1 2 2l0 582c0 1-1 2-2 3 0 0 0 0 0 0 0 0 0 0 0 0l-481 0z m9-5l753 0-377-228z m-7-2l382-231c1 0 2 0 2 0l382 231 0-575-766 0z" horiz-adv-x="1000" />
+<glyph glyph-name="sub-process-marker" unicode="&#xe819;" d="m115 735l0-5 0-765 770 0 0 770-770 0z m10-10l750 0 0-750-750 0 0 750z m355-75l0-280-280 0 0-40 280 0 0-280 40 0 0 280 280 0 0 40-280 0 0 280-40 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-parallel-multiple" unicode="&#xe81a;" d="m496 802c-176 0-345-113-412-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47-1 0-3 0-4 0z m12-49c173-1 335-126 380-293 47-159-17-344-155-439-143-105-354-97-489 18-136 108-185 309-115 468 60 147 212 248 371 246 3 0 6 0 8 0z m-78-208l0-125-125 0 0-140 125 0 0-125 140 0 0 125 125 0 0 140-125 0 0 125-140 0z m23-23l94 0 0-125 125 0 0-94-125 0 0-125-94 0 0 126-125 0 0 93 125 0 0 125z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-error" unicode="&#xe81b;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m173-210c-34-70-68-139-102-209-43 56-86 111-128 166-39-114-77-228-116-342 43 55 87 111 130 167 45-51 89-103 134-154 27 124 55 248 82 372z m-219-110c41-52 81-103 122-154 10 22 20 45 30 67-10-39-19-78-29-116-41 48-83 97-124 145-17-26-34-52-50-77 17 45 34 90 51 135z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-signal" unicode="&#xe81c;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-99c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z m0-51c50-90 100-180 151-270-101 0-201 0-302 0 51 90 101 180 151 270z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-error" unicode="&#xe81d;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m173-118c-34-70-68-139-102-209-43 56-86 111-128 166-39-114-77-228-116-342 43 55 87 111 130 167 45-51 89-103 134-154 27 124 55 248 82 372z m-219-110c41-52 81-103 122-154 10 22 20 45 30 67-10-39-19-78-29-116-41 48-83 97-124 145-17-26-34-51-50-77 17 45 34 90 51 135z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-compensation" unicode="&#xe81e;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m-16-162c-70-49-140-99-209-148 70-49 139-99 209-148 0 48 0 95 0 143 67-48 135-95 202-143 0 99 0 197 0 296-67-48-135-95-202-143 0 48 0 95 0 143z" horiz-adv-x="1000" />
+<glyph glyph-name="subprocess-collapsed" unicode="&#xe81f;" d="m216 716c-86 0-155-69-155-154l0-424c0-85 69-154 155-154l569 0c85 0 154 69 154 154l0 424c0 85-69 154-154 154l-569 0z m0-48l569 0c59 0 106-47 106-106l0-424c0-59-47-106-106-106l-116 0 0 308-338 0 0-15 0-293-115 0c-60 0-106 47-106 106l0 424c0 59 46 106 106 106z m146-359l276 0 0-276-276 0 0 276z m115-39l0-23 0-54-54 0-23 0 0-46 23 0 54 0 0-54 0-23 46 0 0 23 0 54 54 0 23 0 0 46-23 0-54 0 0 54 0 23-46 0z" horiz-adv-x="1000" />
+<glyph glyph-name="subprocess-expanded" unicode="&#xe820;" d="m215 716c-85 0-154-69-154-154l0-424c0-85 69-154 154-154l570 0c85 0 154 69 154 154l0 424c0 85-69 154-154 154l-570 0z m0-48l570 0c59 0 106-47 106-106l0-424c0-59-47-106-106-106l-116 0 0 292 0 16-15 0-308 0-15 0 0-16 0-292-116 0c-59 0-105 47-105 106l0 424c0 59 46 106 105 106z m147-359l276 0 0-277-276 0 0 277z m37-110l0-47 203 0 0 47-203 0z" horiz-adv-x="1000" />
+<glyph glyph-name="task" unicode="&#xe821;" d="m215 716c-85 0-154-69-154-154l0-424c0-85 69-154 154-154l570 0c85 0 154 69 154 154l0 424c0 85-69 154-154 154l-570 0z m0-48l570 0c59 0 106-47 106-106l0-424c0-59-47-106-106-106l-570 0c-59 0-105 47-105 106l0 424c0 59 46 106 105 106z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-error" unicode="&#xe822;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m173-117c-34-70-68-139-102-209-43 56-86 111-128 166-39-114-77-228-116-342 43 55 87 111 130 167 45-51 89-103 134-154 27 124 55 248 82 372z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-escalation" unicode="&#xe823;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-111c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z m1-83c23-73 45-146 68-219-22 24-45 49-68 74-19-17-69-82-66-68 24 70 41 143 66 213z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-timer" unicode="&#xe824;" d="m499 802c-1 0-2 0-3 0-202 1-391-150-436-346-42-173 28-368 174-471 145-107 354-116 506-18 149 93 235 276 207 450-26 176-164 330-338 371-36 9-73 14-110 14z m-5-49c3 0 7 0 10 0 187 2 362-146 392-331 32-167-54-348-205-427-154-85-363-54-483 77-124 127-147 338-53 488 71 116 203 192 339 193z m8-44c-3 0-7 0-10 0-172 0-330-143-349-314-22-161 79-328 233-382 145-55 322-3 413 124 98 129 92 326-17 447-67 77-167 125-270 125z m-2-48c2 0 4 0 6 0 153 0 292-129 304-281 16-145-84-293-225-330-137-40-296 27-361 154-69 129-33 305 86 392 54 42 122 65 190 65z m-4-97c-84 0-164-55-194-133-33-76-15-170 43-229 56-60 149-82 226-54 81 28 141 108 143 194 5 83-46 166-121 201-29 14-61 21-93 21-1 0-3 0-4 0z m8-39c76 0 148-57 166-131 20-73-14-156-79-194-67-42-160-31-215 26-58 56-68 152-24 219 32 49 89 81 148 80 1 0 2 0 4 0z m51-49c-19-36-39-71-58-107-18-2-23-29-6-36 11-8 20 5 30 4l89 0 0 25-89 0c18 34 37 68 56 102-7 4-14 8-22 12z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-escalation" unicode="&#xe825;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m0-203c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z m1-83c23-73 45-146 68-219-22 24-45 49-68 74-19-17-69-82-66-68 24 70 41 143 66 213z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-signal" unicode="&#xe826;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m0-191c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z m0-51c50-90 100-180 151-270-101 0-201 0-302 0 51 90 101 180 151 270z" horiz-adv-x="1000" />
+<glyph glyph-name="business-rule-task" unicode="&#xe827;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m-36-72l0-190 0-9 0-25 0-156 165 0 25 0 314 0 0 190 0 190-504 0z m25-132l140 0 0-67-140 0 0 9 0 58z m165 0l289 0 0-58 0-9-289 0 0 67z m-165-92l140 0 0-131-140 0 0 131z m165 0l289 0 0-131-289 0 0 131z" horiz-adv-x="1000" />
+<glyph glyph-name="script" unicode="&#xe828;" d="m385 644l-2-1c-57-34-96-65-121-94-24-29-35-56-35-81-1-51 39-93 78-133 39-40 78-78 82-119 2-21-4-43-23-67-20-25-53-52-104-82l-19-10 389 0 2 0c52 31 86 58 107 85 21 26 28 51 26 75-5 47-47 86-86 126-39 40-75 80-74 125 0 22 9 46 32 74 24 27 62 57 118 91l18 11-388 0z m3-12l344 0c-48-30-81-57-103-83-25-29-36-56-36-81-1-51 39-93 78-133 39-40 78-78 82-119 2-21-4-43-23-67-19-24-52-51-103-81l-344 0c43 26 71 51 90 74 21 26 28 51 25 75-5 47-46 86-85 126-39 40-75 80-75 125 1 22 10 46 33 74 23 27 61 57 117 90z m-50-102c-8 0-8-11 0-11l205 0c8 0 8 11 0 11l-46 0-159 0z m20-115c-7 0-7-12 0-12l188 0c7 0 7 12 0 12l-188 0z m63-116c-8 0-8-11 0-11l208 0c8 0 8 11 0 11l-208 0z m41-115c-7 0-7-12 0-12l208 0c8 0 8 12 0 12l-208 0z" horiz-adv-x="1000" />
+<glyph glyph-name="send" unicode="&#xe829;" d="m112 644l388-214 388 214-776 0z m0-105l0-483 776 0 0 483-388-193-388 193z" horiz-adv-x="1000" />
+<glyph glyph-name="call-activity" unicode="&#xe82a;" d="m231 745c-116 0-211-93-211-208l0-374c0-115 95-208 211-208l538 0c116 0 211 93 211 208l0 374c0 115-95 208-211 208l-538 0z m0-110l538 0c58 0 101-43 101-98l0-374c0-55-43-98-101-98l-538 0c-58 0-101 43-101 98l0 374c0 55 43 98 101 98z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-timer" unicode="&#xe82b;" d="m500 802c-249 0-452-203-452-452 0-249 203-452 452-452 249 0 452 203 452 452 0 249-203 452-452 452z m0-49c223 0 403-180 403-403 0-223-180-403-403-403-223 0-403 180-403 403 0 223 180 403 403 403z m-4-189c-84 0-164-55-194-133-33-76-15-170 43-229 56-60 149-82 226-54 81 28 141 108 143 194 5 83-46 166-121 201-29 14-61 21-93 21-1 0-3 0-4 0z m8-39c76 0 148-57 166-131 20-73-14-156-79-194-67-42-160-31-215 26-58 56-68 152-24 219 32 49 89 81 148 80 1 0 2 0 4 0z m51-49c-19-36-39-71-58-107-18-2-23-29-6-36 11-8 20 5 30 4l89 0 0 25-89 0c18 34 37 68 56 102-7 4-14 8-22 12z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-message" unicode="&#xe82c;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m-205-247c0-104 0-208 0-312 137 0 273 0 410 0 0 104 0 208 0 312-137 0-273 0-410 0z m91-49c76 0 152 0 228 0-40-24-81-79-121-85-36 29-71 57-107 85z m270-28c0-62 0-124 0-186-104 0-208 0-312 0 0 62 0 124 0 186 52-42 104-83 156-125 52 42 104 83 156 125z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-none" unicode="&#xe82d;" d="m496 802c-219 2-422-178-445-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 165-214 291-388 303-15 1-29 2-43 2z m8-49c201 3 386-169 398-370 16-178-100-360-271-415-164-56-362 4-460 148-103 144-99 357 19 491 76 92 194 149 314 146z m-12-44c-185 0-352-166-352-352-4-168 124-331 291-360 153-30 322 49 390 191 71 141 39 329-84 431-67 59-156 92-245 90z m14-48c165 1 312-150 305-315 0-150-121-290-272-305-143-19-295 73-336 213-43 134 14 296 139 364 50 29 107 44 164 43z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-link" unicode="&#xe82e;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m50-116c0-33 0-67 0-100-75 0-150 0-226 0 0-63 0-127 0-190 76 0 151 0 226 0 0-33 0-67 0-100 55 65 110 130 165 195-55 65-110 130-165 195z m28-73c34-40 68-81 102-121-34-40-68-81-102-121 0 18 0 36 0 54-75 0-149 0-223 0 0 44 0 89 0 133 74 0 148 0 223 0 0 18 0 37 0 55z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-escalation" unicode="&#xe82f;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m0-110c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z" horiz-adv-x="1000" />
+<glyph glyph-name="text-annotation" unicode="&#xe830;" d="m677 795l0-25 0-411 0-412 0-24 24 0 224 0 25 0 0 49-25 0-199 0 0 387 0 386 199 0 25 0 0 50-25 0-224 0-24 0z m-81-386l-75-60 60-75 75 60-60 75z m-151-119l-75-60 60-75 75 59-60 76z m-150-120l-76-59 60-76 75 60-59 75z m-151-119l-76-60 60-75 76 59-60 76z" horiz-adv-x="1000" />
+<glyph glyph-name="bpmn-io" unicode="&#xe831;" d="m388-22c-70-71-186-74-258-4-72 71-75 187-3 258 71 73 187 74 259 4 72-70 73-185 2-258z m502 404l0 0 21-77-85-35-41 68 3 1c-30-5-61-7-93 0l-40-68-85 35 20 77 1-1c-25 18-47 39-64 64l0 0-77-20-35 85 67 40 2-2c-5 30-5 61 0 92l-68 40 35 85 77-19 0-4c11 15 22 28 37 41l-443 0c-31 0-56-26-56-57l0-370 52-38-1-1c26 17 53 29 83 35l0 0 11 77 90 1 12-76-3 0c29-6 58-17 84-33l61 47 64-63-46-62-1 1c17-26 29-53 35-82l0 0 77-10 2-90-77-13 0 3c-7-29-17-58-33-84l42-53 360 0c31 0 56 24 56 57l0 445c-14-13-28-26-44-36z m23 142c-39-95-149-139-243-100-95 39-139 148-100 242 39 95 149 139 243 100 95-39 140-147 100-242z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-complex" unicode="&#xe832;" d="m500 802c-9 0-19-4-26-11l-415-415c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-7 7-17 11-26 11z m0-62l390-390-390-390-390 390 390 390z m-9-192l0 0c0 0-4-1-4-1 0 0-4-2-4-2 0 0-2-3-2-3 0 0-1-4-1-4l0-140-99 99 0 0c0 0-3 2-3 2 0 0-4 1-4 1 0 0-4-1-4-1 0 0-4-2-4-2l-13-13c0 0-2-4-2-4 0 0-1-4-1-4 0 0 1-4 1-4 0 0 2-3 2-3l99-99-140 0 0 0c0 0-4-1-4-1 0 0-3-2-3-2l0 0c0 0-2-4-2-4 0 0-1-4-1-4l0-18c0 0 1-4 1-4 0 0 2-4 2-4 0 0 3-2 3-2 0 0 4-1 4-1l140 0-99-99 0 0c0 0-2-3-2-3 0 0-1-4-1-4 0 0 1-4 1-4 0 0 2-4 2-4l13-13c0 0 4-2 4-2 0 0 4-1 4-1 0 0 4 1 4 1 0 0 3 2 3 2l99 99 0-140 0 0c0 0 1-4 1-4 0 0 2-3 2-3 0 0 4-2 4-2 0 0 4-1 4-1l18 0c0 0 4 1 4 1 0 0 4 2 4 2 0 0 2 3 2 3 0 0 1 4 1 4l0 140 99-99c0 0 3-2 3-2 0 0 4-1 4-1 0 0 4 1 4 1 0 0 4 2 4 2l13 13c0 0 2 4 2 4 0 0 1 4 1 4 0 0-1 4-1 4 0 0-2 4-2 4l-99 98 140 0c0 0 4 1 4 1 0 0 3 2 3 2 0 0 3 4 3 4 0 0 0 4 0 4l0 18c0 0 0 4 0 4 0 0-3 4-3 4 0 0-3 2-3 2 0 0-4 1-4 1l-140 0 99 99c0 0 2 3 2 3 0 0 1 4 1 4 0 0-1 4-1 4 0 0-2 4-2 4l-13 13c0 0-4 2-4 2 0 0-4 1-4 1 0 0-4-1-4-1 0 0-3-2-3-2l-99-99 0 140c0 0-1 4-1 4 0 0-2 3-2 3 0 0-4 3-4 3 0 0-4 0-4 0l-18 0z m-117-48c0 0 0 0 0 0l0 0c0 0 0 0 0 0z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-eventbased" unicode="&#xe833;" d="m500 802c-9 0-19-4-26-11l-415-415c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-7 7-17 11-26 11z m0-62l390-390-390-390-390 390 390 390z m0-166l-7-5-208-151 82-253 266 0 82 253-215 156z m0-30l187-135-72-220-230 0-72 220 187 135z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-none" unicode="&#xe834;" d="m59 376c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-14 14-38 14-52 0l-415-415z m51-26l390 390 390-390-390-390-390 390z" horiz-adv-x="1000" />
+<glyph glyph-name="gateway-or" unicode="&#xe835;" d="m500 802c-9 0-19-4-26-11l-415-415c-14-14-14-38 0-52l415-415c14-14 38-14 52 0l415 415c14 14 14 38 0 52l-415 415c-7 7-17 11-26 11z m0-62l390-390-390-390-390 390 390 390z m0-180c-116 0-210-94-210-210 0-116 94-210 210-210 116 0 210 94 210 210 0 116-94 210-210 210z m0-23c103 0 187-84 187-187 0-103-84-187-187-187-103 0-187 84-187 187 0 103 84 187 187 187z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-terminate" unicode="&#xe836;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m0-81c-149 6-268-156-219-297 38-143 229-210 349-121 126 79 133 281 13 369-40 32-92 50-143 49z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-signal" unicode="&#xe837;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m0-98c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-none" unicode="&#xe838;" d="m496 802c-203 1-394-153-437-351-41-174 33-368 181-470 143-103 348-111 497-15 150 91 238 275 210 449-26 181-170 339-350 376-33 7-67 11-101 11z m10-142c150 1 287-123 302-271 19-142-72-291-210-334-134-45-296 13-366 138-77 129-45 313 78 403 56 43 126 66 196 64z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-multiple" unicode="&#xe839;" d="m491 802c-219-1-420-183-440-401-22-185 82-379 252-458 159-77 362-53 493 66 134 116 192 313 133 481-55 171-220 303-401 311-13 0-25 1-37 1z m9-142c161 5 308-137 310-298 7-148-104-292-250-317-142-28-300 54-350 192-53 136 1 308 132 380 47 28 102 43 158 43z m0-86c-72-52-143-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253-71 52-143 104-215 156z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-message" unicode="&#xe83a;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m-167-154c57-46 114-92 171-138 56 46 113 92 170 138-114 0-227 0-341 0z m-38-32c0-93 0-187 0-280 137 0 273 0 410 0 0 91 0 183 0 274-67-54-134-109-201-163-70 56-139 113-209 169z" horiz-adv-x="1000" />
+<glyph glyph-name="end-event-link" unicode="&#xe83b;" d="m491 802c-219 0-420-183-440-400-22-186 82-380 253-459 158-77 361-53 492 67 134 115 192 312 133 480-55 172-220 303-401 311-13 1-25 1-37 1z m9-142c161 5 308-137 310-298 7-147-103-292-250-317-142-28-300 54-350 192-53 136 2 309 132 380 47 28 103 43 158 43z m50-115c0-33 0-67 0-100-75 0-150 0-226 0 0-63 0-127 0-190 76 0 151 0 226 0 0-33 0-67 0-100 55 65 110 130 165 195-55 65-110 130-165 195z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-message" unicode="&#xe83c;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-205-155c0-104 0-208 0-312 137 0 273 0 410 0 0 104 0 208 0 312-137 0-273 0-410 0z m91-49c76 0 152 0 228 0-40-24-81-79-121-85-36 29-71 57-107 85z m270-28c0-62 0-124 0-186-104 0-208 0-312 0 0 62 0 124 0 186 52-42 104-83 156-125 52 42 104 83 156 125z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-compensation" unicode="&#xe83d;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-16-163c-70-49-140-99-209-148 70-49 139-99 209-148 0 48 0 95 0 143 67-48 135-95 202-143 0 99 0 197 0 296-67-48-135-95-202-143 0 48 0 95 0 143z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-multiple" unicode="&#xe83e;" d="m500 802c-178 2-349-112-416-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47z m0-49c175 3 342-123 388-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246z m0-179c-72-52-143-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253-71 52-143 104-215 156z m0-30c62-45 124-90 187-135-24-74-48-147-72-220-77 0-153 0-230 0-24 73-48 146-72 220 63 45 125 90 187 135z" horiz-adv-x="1000" />
+<glyph glyph-name="data-input" unicode="&#xe83f;" d="m250 676l0-2c0-1 0-1 0-1l0-649 500 0 0 486c0 0 0 0 0 0l0 1 0 1c-1 0-1 0-1 0l-166 162 0 2-2 0-189 0-139 0-3 0z m5-5l323 0 0-163 167 0 0-479-490 0 0 642z m328-4l158-154-158 0 0 154z m-151-101l0-6 0-51-112 0 0-87 112 0 0-57 88 100-88 101z m5-13l76-88-76-87 0 49-112 0 0 77 112 0 0 49z" horiz-adv-x="1000" />
+<glyph glyph-name="manual-task" unicode="&#xe840;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m168-69l0 0c-7 0-14-2-20-6l0 0 0 0c-31-19-138-90-161-105l0 0 0 0c-21-14-35-34-43-59l0 0-1 0c-8-26-7-54-7-78l0 0 0 0c0-17 1-33 6-52 0 0 0 0 0 0 6-27 20-48 38-63 19-15 43-22 70-22 96 0 192 0 288 0l0 0 0 0c10 0 19 3 26 9 6 7 9 16 9 26l0 0c0 11-3 21-10 27-2 2-4 3-6 4l23 0c9 0 17 1 25 5 7 5 12 12 14 21l0 0c3 13 1 26-7 34-2 2-5 4-8 6 2 0 8 0 9 0 12 0 22 3 29 11 7 8 9 18 9 29 0 11-3 21-10 27-8 7-17 9-28 9l0 0 0 0c-9 0-18 0-29 0 2 2 5 4 7 6 7 8 10 18 10 29l0 0 0 0c0 11-3 21-10 29-7 7-17 10-28 10-17 0-37 0-59 0-27 0-56 0-82 0-24 0-46 0-62 0-4 0-6 0-9 0 4 4 7 7 11 11 11 10 21 20 27 26 12 15 14 36 3 52l0 0c-5 8-13 13-21 14-1 0-2 0-3 0z m-1-20c1 0 1 0 1 0 3 0 5-1 8-6l0 0 0 0c4-6 4-18-3-27l0 0 0 0c-3-3-14-14-24-24-11-11-21-20-26-26-4-5-3-9-2-12 2-3 3-6 9-7 1-1 2-1 2-1 1 0 1 0 2 0 2 0 4 0 6 0 5 0 12 0 20 0 16 0 38 0 62 0 48 0 105 0 141 0l0 0 0 0c7 0 11-1 14-4 2-3 4-8 4-15 0-8-2-12-4-15-3-3-7-4-14-4-45 0-151-1-151-1l-9 0 0-34 10 0c0 0 138-1 200-1 8 0 12-1 14-3 2-2 4-6 4-13 0-9-2-13-4-16-2-2-6-4-14-4-20 0-200 0-200 0l-10 0 0-35 10 0c0 0 117 0 168 0l0 0 0 0c9 0 14-2 17-5 2-2 4-6 2-15l0 0 0 0c-2-6-3-7-5-8-3-2-8-3-15-3l-177 0 0-10 0-26 10 0c0 0 88 0 125 0 7-1 11-2 12-3 2-1 3-4 3-11l0 0 0 0c0-8-2-11-3-13-2-1-5-3-12-3-96 0-192 0-288 0l0 0 0 0c-24 0-43 6-58 18-14 11-25 28-31 52l0 0 0 0c-4 17-5 30-5 48l0 0c0 24 0 50 6 71 8 21 19 37 36 48l0 0c23 16 131 87 161 105 3 2 5 3 7 3 1 0 1 0 1 0z" horiz-adv-x="1000" />
+<glyph glyph-name="service" unicode="&#xe841;" d="m396 646l0-3 0-49c-11-3-21-6-32-10l0 0 0 0c-10-5-20-10-29-16l-38 37-53-53 38-37c-12-19-21-40-25-61l-53 0 0-76 53 0c2-10 6-21 10-31 4-11 10-20 16-29l-39-38 54-53 37 36 0-15 33 1c8-3 15-6 23-8 1-7 4-14 7-22l0-33 2 0c4 0 8-1 12-1l-36-35 54-53 38 38c19-12 40-20 62-25l0-54 2 0c24 0 71 0 71 0l0 0 2 0 0 2 0 52c11 3 22 6 32 10l0 0 0 0c10 5 20 10 29 16l39-38 53 54-38 37c12 19 20 40 25 62l52 0 0 75-53 0c-2 10-5 21-10 31l0 0c-4 11-10 20-16 29l37 37-54 53-36-36 0 16-3 0-29 0c-8 3-15 5-22 7-2 7-5 14-7 22l0 31-17 0c0 0 0 0 0 0l36 37-54 53-36-37c-19 12-40 21-61 25l0 52-76 0z m5-5l66 0 0-51 2 0c22-5 44-13 63-26l2-1 35 36 47-46-36-36 1-1-53 0 0 0 0-33c-31 42-87 60-137 39-59-24-86-91-61-149l0 0c8-21 22-37 39-49l-34 0 0 0 0-54-37-36-47 46 38 37-1 2c-6 9-12 19-16 30l0 0c-5 11-8 22-10 32l-1 2-52 0 0 66 52 0 0 2c5 22 13 44 26 63l1 1-37 37 47 46 36-36 2 1c9 6 19 12 30 16l0 0c11 5 22 8 33 10l2 1 0 51z m32-115c38 0 74-19 95-52l0-10c-11-2-22-6-32-10l0 0 0 0c-11-4-20-10-29-16l-38 37-53-53 37-37c-12-19-20-39-25-61l-9 0c-20 11-36 29-45 51l0 0c-23 55 3 119 58 142l0 0c14 6 28 8 41 9z m100-15l57 0 9 0 0-27 0 0-1-24 2 0c3-1 6-1 8-2l1 0c8-2 15-4 22-7l0 0c11-4 21-9 30-15l1-1c1 0 1 0 2-1l1-1 36 36 47-46-36-36 1-2c7-9 12-19 17-30l0 0c4-10 7-21 10-32l0-2 52 0 0-65-51-1-1-2c-4-22-13-43-26-63l-1-1 38-37-46-47-38 37-2-1c-9-6-19-12-30-16-11-5-22-8-33-10l-2-1 0-53c-4 0-43 0-65 0l0 53-2 0c-23 5-45 14-64 26l-1 1-38-37-47 46 36 35 3 0-1 2 0 0-1 1-1 1c-1 2-2 4-3 6-3 4-5 8-7 12-1 1-1 2-1 2 0 1-1 2-1 2 0 1-1 1-1 2 0 1-1 1-1 2 0 1 0 1-1 2 0 1 0 1-1 2l0 0 0 0c0 1 0 1 0 2l-1 1 0 0c-3 7-5 14-7 21l0 1 0 0c0 0 0 0 0 0-1 3-1 5-2 7l0 3 0 0 0 0-2 0-12 0-10 0-29-1 0 9 0 57 52 0 1 2c4 22 13 44 26 63l1 2-37 36 46 46 37-36 2 1c9 6 19 12 30 16l0 0c11 5 22 8 33 11l2 0 0 6 0 2 0 43z m70-41c1-2 2-4 2-6 0 0-1 0-2 0l0 0 0 6z m57-19l0-9c-5 3-11 6-16 9l16 0z m-93-50c-1 0-2 0-3 0l0 0c0 0 0 0 0 0l0 0 0 0c-1 0-1 0-1 0l0 0c-2 0-3 0-5 0l0 0c0 0 0-1 0-1l0 0c-12 0-24-3-36-8-39-16-64-52-69-91l0 0c0 0 0 0 0 0 0-1 0-1 0-1 0 0 0 0 0 0l0 0c0 0 0 0 0 0l0 0c0-1 0-2 0-3l0 0c0 0 0 0 0 0 0 0 0-1 0-1 0 0 0 0 0 0 0 0 0 0 0 0l0 0c-1-2-1-5-1-8l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-3 0-5 0-8l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c1-3 1-5 1-8l0 0c0 0 0 0 0-1l0 0c1-1 1-2 1-3l0 0c0 0 0 0 0 0l0 0c0 0 0 0 0 0 0-1 0-1 0-1l0 0c0 0 0 0 0 0l0 0c0-1 0-2 1-3l0 0c0 0 0 0 0 0 0 0 0-1 0-1l0 0c0-1 0-2 1-4l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-1 0-2 1-3l0 0 0 0c0-1 0-1 0-1l0 0c1-3 1-5 2-7 1-1 1-1 1-2l0 0c0 0 0 0 0 0l0 0c1-1 1-2 1-3l0 0c1-1 1-2 2-3 0 0 0 0 0 0 0-1 0-1 0-1 1-3 2-5 4-7 0 0 0 0 0 0 0 0 0 0 0-1 0 0 0 0 0 0 28-49 90-71 144-49 58 25 85 92 61 149-11 25-29 44-51 56l0 0c0 0 0 0 0 0l0 0 0 0c-1 1-2 1-3 1l0 0c0 1 0 1 0 1l0 0c-2 0-3 1-4 1l0 0c0 0 0 0 0 0l0 0c-1 1-2 1-3 2l0 0c0 0 0 0 0 0l0 0 0 0c-1 0-2 1-3 1l0 0c0 0-1 0-1 0l0 0c-1 1-2 1-3 1l0 0c0 1 0 1-1 1l0 0c-1 0-1 0-2 0l0 0c-1 1-1 1-1 1l0 0c-2 0-5 1-7 2l0 0c0 0 0 0 0 0l0 0 0 0c-1 0-2 0-3 0l0 0c0 0-1 0-1 1l0 0c-1 0-2 0-3 0l0 0c-1 0-1 0-1 0l0 0 0 0c-1 0-2 1-3 1l0 0c0 0 0 0-1 0l0 0c-1 0-2 0-3 0l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-3 1l0 0c-1 0-1 0-1 0l0 0c-1 0-3 0-4 0 0 0 0 0 0 0l0 0 0 0c-1 0-2 0-3 0z m0-5l0 0c1 0 2 0 3 0l0 0c0 0 0 0 1 0l0 0c1 0 1 0 2 0l0 0c1 0 1 0 1 0l0 0c1-1 2-1 3-1l0 0c1 0 1 0 1 0l0 0c1 0 2 0 3 0l0 0c0 0 0 0 1 0l0 0c0 0 1-1 2-1l0 0c1 0 1 0 1 0l0 0c1 0 2 0 3 0l0 0c0 0 0 0 1-1l0 0c1 0 2 0 2 0l0 0c1 0 1 0 1 0l0 0c2-1 4-1 6-2l0 0c1 0 1 0 1 0l0 0c1-1 2-1 3-1l0 0c0 0 0 0 0 0l0 0c1-1 2-1 4-1l0 0c0 0 0-1 0-1l0 0 0 0c1 0 2 0 3-1l0 0c0 0 0 0 0 0l0 0c1 0 2-1 3-1l0 0c0 0 0 0 0 0l0 0c1-1 2-1 3-2l0 0c0 0 1 0 1 0l0 0c1 0 2-1 2-1l0 0c1 0 1-1 1-1l0 0c21-11 38-29 48-53 23-55-3-119-58-142l0 0c-52-22-111-1-138 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c-1 2-2 5-3 7 0 0 0 0 0 0 0 0 0 0 0 0-1 0-1 1-1 1 0 0 0 0 0 0 0 1-1 2-1 3 0 0 0 0 0 0-1 1-1 2-1 3-1 0-1 1-1 1 0 0 0 0 0 0-1 3-2 5-2 7l0 0c0 1 0 1 0 1 0 0 0 0 0 0-1 1-1 2-1 3l0 0c0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0l0 0c-1 1-1 2-1 3l0 0c0 0 0 1 0 1-1 1-1 2-1 3l0 0c0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0l0 0c0 1-1 2-1 3l0 0c0 0 0 0 0 0 0 0 0 1 0 1l0 0c0 2 0 5-1 7l0 0c0 0 0 0 0 0 0 0 0 0 0 1l0 0c0 2 0 5 0 7l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 3 0 5 1 8l0 0c0 0 0 0 0 0l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 1 0 3 0 4l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c5 37 29 72 66 87l0 0c11 5 23 8 34 8l0 0c0 1 0 1 1 1l0 0c1 0 2 0 4 0l0 0c0 0 1 0 1 0l0 0c1 0 2 0 3 0z m-178-147l0 0c0-1 0-1 0-2-2 1-3 1-5 2l5 0z m14-41c3-6 6-12 10-18-4 0-7 1-10 1l0 17z" horiz-adv-x="1000" />
+<glyph glyph-name="user" unicode="&#xe842;" d="m492 644l-5-1c-84 0-140-60-140-139 0-39 29-74 58-100-16-5-54-19-93-41-23-12-45-27-62-44-16-17-28-37-29-58l0 0 0-204 98 0c1-1 2-1 3 0l457 0 0 204c0 19-12 37-29 53-18 17-41 32-64 45-42 24-83 40-99 46 28 26 48 60 48 99 0 79-58 140-143 140z m-38-82c13 0 27-3 40-10 59-31 121-43 132-34 1-4 1-9 1-14 0-38-21-73-50-97l-6-5 7-2c6-2 35-13 69-29-2-70-70-127-154-127-84 0-151 55-153 125 35 17 67 28 74 30l7 2-6 5c-29 25-60 60-60 98 0 5 0 10 1 15 10 8 52 42 98 43z m198-194c10-5 20-10 30-16 23-13 46-28 62-43 17-16 27-33 27-48l0-196-90 0 0 144-8 0 0-144-349 0 0 144c0 6-8 6-8 0l0-144-87 0 0 196c1 18 11 36 27 52 16 16 38 31 60 43 6 4 12 7 19 10 3-72 73-127 158-127 86 0 156 57 159 129z" horiz-adv-x="1000" />
+<glyph glyph-name="receive-task" unicode="&#xe843;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m-22-67c-1 0-1 0-1 0-7 0-12-6-12-12l0-357c0-7 6-13 13-13l500 0c6 0 12 6 12 13l0 357c0 6-5 12-12 12 0 0 0 0 0 0l-248 0-176 0-76 0z m47-25l205 0 200 0-202-116-203 116z m-35-9l231-132c4-2 9-2 13 0l231 132 0-323-475 0 0 323z" horiz-adv-x="1000" />
+<glyph glyph-name="data-object" unicode="&#xe844;" d="m250 676l0-2c0-1 0-1 0-1l0-649 500 0 0 486c0 0 0 0 0 0l0 1 0 1c-1 0-1 0-1 0l-166 162 0 2-2 0-236 0-92 0z m5-5l323 0 0-163 167 0 0-479-490 0z m328-4l158-154-158 0z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-none" unicode="&#xe845;" d="m496 802c-176 0-345-113-412-276-70-161-34-362 89-487 119-128 314-175 477-115 169 58 294 224 301 403 12 176-92 351-250 428-62 31-132 47-201 47-1 0-3 0-4 0z m12-49c173-1 335-126 380-293 47-159-17-344-155-439-143-105-354-97-489 18-136 109-185 309-115 468 60 147 212 248 371 246 3 0 6 0 8 0z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-escalation" unicode="&#xe846;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-111c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-multiple" unicode="&#xe847;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-87c-72-52-143-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253-71 52-143 104-215 156z m0-30c62-45 124-90 187-135-24-74-48-147-72-220-77 0-153 0-230 0-24 73-48 146-72 220 63 45 125 90 187 135z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-escalation" unicode="&#xe848;" d="m500 550c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z m1-83c23-73 45-146 68-219-22 24-45 49-68 74-19-17-69-82-66-68 24 70 41 143 66 213z m-1 335c-41-1-83-5-121-18-25-13-8-53 18-44 64 17 131 17 196 3 26-3 34 38 9 47-33 8-68 12-102 12z m255-83c-26 3-36-36-13-47 52-38 93-90 121-147 15-22 52-3 43 22-32 67-82 127-143 170-2 1-5 2-8 2z m-519-10c-22-2-35-23-51-36-42-40-76-89-98-142-8-26 30-42 44-19 27 61 69 115 122 157 13 14 2 40-17 40z m264 0c-20-2-48 4-57-18-8-21 15-38 34-32 51 4 103-5 149-25 26-8 42 31 19 44-45 21-95 31-145 31z m-155-39c-23-4-43-21-62-34-34-27-66-58-86-96-10-26 30-44 43-21 30 47 74 83 121 110 16 14 5 41-16 41z m393-59c-25 2-35-33-14-46 37-38 62-87 77-137 14-24 53-6 44 20-17 60-49 115-94 158-4 3-8 4-13 5z m-564-171c-23 2-28-24-30-41-7-55-2-112 16-163 12-24 51-11 46 15-17 53-20 110-10 164 1 13-10 24-22 25z m754-46c-21 1-29-22-25-39 1-68-16-135-47-195-9-25 29-43 43-21 39 72 57 155 52 237-3 10-13 18-23 18z m-853-16c-22 2-30-22-26-39 1-69 18-137 51-197 15-22 52-2 42 23-30 59-46 126-45 193-2 11-11 19-22 20z m756-57c-22 2-27-22-28-39-10-48-34-91-63-130-12-25 26-47 42-24 38 49 65 108 73 170-1 12-11 23-24 23z m-590-160c-22-1-30-32-13-45 40-46 90-82 147-102 26-6 40 33 17 45-52 20-98 53-134 96-4 4-10 6-17 6z m426-77c-23-5-43-21-66-27-34-13-71-15-106-19-25-9-16-49 10-47 62 1 124 18 177 50 17 14 7 44-15 43z m-440-39c-23-1-31-35-11-46 56-45 123-78 194-91 26-2 35 39 9 47-65 14-127 44-179 87-4 2-8 3-13 3z m543-3c-22-2-36-24-55-32-43-29-92-45-141-57-24-12-10-52 17-46 71 15 140 47 196 95 14 15 2 40-17 40z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-link" unicode="&#xe849;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m50-116c0-33 0-67 0-100-75 0-150 0-226 0 0-63 0-127 0-190 76 0 151 0 226 0 0-33 0-67 0-100 55 65 110 130 165 195-55 65-110 130-165 195z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-condition" unicode="&#xe84a;" d="m349 540l0-12 0-368 50 0 202 0 50 0 0 380-302 0z m24-24l254 0 0-332-26 0-202 0-26 0 0 332z m26-37l0-25 202 0 0 25-202 0z m0-74l0-24 202 0 0 24-202 0z m0-85l0-24 202 0 0 24-202 0z m0-77l0-24 202 0 0 24-202 0z m105 557l-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 0-6-1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6 0 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0 0 0 0-6-1-1 0 0 0-6-1 0-1 0 0-6-1 0 0-1 0-6-1 0 0 0 0-6-2 0 0 0 0-4-1-4-1-4-2-3-3-3-4-2-4-2-4 0-5 0-4 1-5 2-4 3-4 3-3 4-2 5-2 4-1 5 0 3 1 3 1 6 1 6 1 6 2 5 1 6 1 6 1 6 1 6 0 6 1 5 1 6 0 6 1 6 0 6 1 6 0 6 0 6 0 6 0 6 0 5 0 6 0 6-1 6 0 6-1 6 0 6-1 5 0 6-1 6-1 6-1 6-1 5-1 2 0 4-1 5 0 4 2 4 2 4 2 3 4 3 3 1 5 1 4 0 5-1 4-1 4-3 4-3 4-3 2-5 2-3 1-2 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0-1 0-6 1 0 0 0 0-6 1 0 0 0 0-7 1 0 0 0 0-6 0 0 1-1 0-6 0 0 0 0 0-6 1 0 0-1 0-6 0 0 0 0 0-6 0-1 0 0 0-6 1 0 0 0 0-6 0-1 0 0 0-6 0 0 0z m246-79l-5-1-4-1-4-3-3-3-3-4-1-4-2-4 0-5 1-4 1-5 2-4 3-3 3-3 2-1 0 0 2-2 0 0 3-1 0 0 2-2 0 0 2-2 2-2 0 0 3-2 0 0 2-1 2-2 0 0 2-2 3-2 0 0 2-2 2-2 0 0 2-2 2-2 1 0 2-2 2-2 2-2 0 0 2-2 0 0 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 0 0 2-2 2-2 0 0 2-3 0 0 2-2 2-2 2-2 0 0 2-3 2-2 2-2 0-1 1-2 0 0 2-2 0 0 2-3 0 0 1 0 2-4 3-3 2-4 3-3 2-3 3-4 2-3 2-4 0 0 3-3 2-4 2-4 3-3 2-4 2-3 2-4 2-4 2-3 2-4 2-4 1-2 3-4 3-4 3-2 4-2 5-2 4 0 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 5-1 4-1 3-2 3 0 0 0 0-2 4 0 0 0 1-2 4 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0 0 0-3 4 0 0 0 0-2 4 0 0-1 0-2 4 0 0 0 0-3 4 0 0 0 0-3 4 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 4 0 0 0 0-3 3-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 3 0 0 0 0-2 2-1 0 0 0-2 3 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-2 2 0 0-1 0-2 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 3 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-2 2-1 0 0 1-2 1 0 1 0 0-3 2 0 0 0 0-2 2 0 0 0 0-3 2 0 0 0 0-3 2 0 0 0 0-2 2 0 0 0 0-2 1-4 2-4 2-5 0z m-521-12l-5-1-4-2-3-2 0 0 0 0-1 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0-1-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0 0 0 0-2-2 0 0 0 0-3-2 0-1 0 0-2-2 0 0 0 0-2-2 0 0-1 0-2-2 0 0 0-1-2-2 0 0 0 0-3-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-2-1 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2-1 0 0 0-2-3 0 0 0 0-2-2 0 0 0-1-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0-1 0-1-3 0 0 0 0-2-2-1-2 0 0 0 0-2-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-2 0-1 0 0-2-2 0 0 0-1-2-2 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0-1-3 0 0 0 0-2-3 0 0 0 0 0-1-2-4 0-5 0-4 1-5 2-4 2-4 4-3 3-3 5-1 4-1 5-1 4 1 4 2 4 2 4 3 3 3 1 4 1 0 1 3 1 3 0 0 1 2 0 0 2 3 1 3 0 0 2 2 0 0 1 3 1 2 0 1 2 2 1 3 0 0 2 2 0 0 1 3 2 2 0 0 1 3 2 2 1 3 0 0 2 3 0 0 2 2 0 0 1 2 2 3 2 2 0 0 1 3 2 2 2 3 1 1 0 0 2 3 1 2 0 0 2 3 2 2 0 0 1 3 2 2 0 0 2 3 0 0 2 2 1 3 2 2 0 0 2 2 2 3 2 2 0 0 2 2 1 3 2 2 0 0 2 2 2 2 0 0 2 3 0 0 2 2 0 0 2 2 0 0 2 2 2 2 0 0 2 2 0 0 2 3 0 0 2 2 2 2 0 0 2 2 3 2 0 0 2 2 2 2 0 0 2 2 0 0 2 2 0 0 2 2 0 0 3 1 0 0 2 2 0 0 2 2 0 0 2 2 3 2 0 0 2 2 0 0 0 0 3 3 3 4 2 4 1 4 0 5 0 4-2 5-2 4-3 3-3 3-4 2-4 2-5 1z m694-313l-4-1-5-2-3-2-3-4-3-4-2-4-1-4 0-4 1-4 0-4 0-4 0-5 0-4 0 0 0-1 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0 0 0-3 0 0 0-3 0-3 0-3 0-3 0-3-1-3 0-3 0 0 0-3 0 0 0-3-1-3 0-3 0-3-1-2 0-1 0-3 0 0 0-2-1-3 0-3 0 0-1-3 0-3-1-3 0 0 0-3-1-3-1-3 0 0 0-2-1-3 0 0 0-3-1-3 0 0-1-3-1-3 0 0 0-2 0 0-1-3 0 0-1-3 0 0-1-3 0 0-1-3-1-2 0 0 0-3-1-3 0 0-1-3 0 0-1-2 0-1-1-2 0 0-1-3 0 0-1-3-1-2 0 0-1-3-3-5-2-6-2-5-3-5-2-6-3-5-3-5-1-3-2-4-1-4 0-5 1-4 1-5 3-4 3-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 3 1 3 1 0 0 0 3 6 0 0 0 0 2 6 1 0 0 0 2 6 0 0 0 0 3 5 0 1 0 0 3 5 0 1 0 0 2 6 0 0 1 0 2 6 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 1 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 0 1 3 0 0 0 1 1 3 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 1 0 0 3 0 0 0 0 1 3 0 1 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 1 4 0 0 0 0 0 3 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 1 3 0 0 0 0 0 3 0 0 0 1 0 3 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 3 0 0 0 0 0 3 0 1 0 0 0 3 0 4 0 0 0 0 0 4 0 0 0 1 0 4 0 0 0 0-1 5 0 0 0 0 0 4 0 5-2 4-2 4-3 4-4 2-4 3-4 1-4 1z m-853-18l-4-1-5-2-3-3-4-3-2-4-2-4-1-4 0-4 0-3 0 0 0 0 0-7 0 0 0 0 0-6 0 0 0 0 0-7 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0-1 0-6 0 0 0 0 1-6 0 0 0-1 1-6 1 0 0 0 1-6 0 0 0-1 1-6 0 0 0 0 1-6 0 0 0 0 2-6 0-1 0 0 1-6 0 0 0 0 2-6 0 0 0-1 2-6 0 0 0 0 1-6 0 0 0 0 2-6 0 0 0 0 2-6 0-1 0 0 2-6 0 0 0 0 2-6 0 0 0 0 2-6 1 0 0 0 2-6 0 0 0 0 2-6 0 0 0-1 3-5 0-1 0 0 2-5 0-1 0 0 3-5 0-1 0 0 2-5 0-1 1 0 2-5 0-1 0 0 3-5 0 0 0-1 1-1 2-4 4-4 3-2 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 5 0 4 0 5-1 4-1 4-1 1-3 5-2 6-3 5-2 6-2 5-2 5-3 6-2 6-2 5-1 6-2 5-2 6-2 6-1 5-2 6-1 6-2 5-1 6-1 6-1 6-1 6-1 5-1 6-1 6-1 6 0 6-1 5 0 6-1 6 0 6 0 6-1 6 0 3 0 4-1 5-3 4-2 3-4 3-4 3-4 1-4 1z m694-334l-4-1-4-2-4-3 0 0-5-3-4-4-5-4-5-3-5-3-4-4-5-3-5-3-5-3-5-4-5-3-6-3-5-2-5-3-5-3-5-3-6-2-5-3-5-2-6-2-5-3-6-2-5-2-6-2-5-2-6-2-5-2-6-1-5-2-6-2-6-1-5-1-5-1-4-2-4-2-4-3-2-3-3-4-1-5-1-4 1-5 1-4 2-4 2-4 3-3 4-3 4-1 5-1 4-1 4 1 5 1 0 0 0 0 6 2 0 0 0 0 6 1 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 1 0 5 2 1 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 2 0 0 0 0 6 3 0 0 0 0 6 2 0 0 1 0 5 3 0 0 1 0 5 2 0 0 1 0 5 3 0 0 1 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 6 3 0 0 0 0 5 3 0 0 1 0 5 3 0 0 0 0 6 3 0 1 0 0 5 3 0 0 1 0 5 3 0 0 0 1 5 3 0 0 1 0 5 4 0 0 0 0 5 3 0 0 0 0 6 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 0 0 5 4 0 0 1 0 4 4 1 0 0 0 0 1 3 3 3 4 2 4 1 4 0 5 0 4-2 4-2 4-3 4-4 3-4 2-4 1-4 1z m-541-2l-4-1-4-3-4-2-3-4-2-4-1-4-1-5 0-4 1-5 2-4 3-4 3-2 1-1 0-1 0 0 5-4 0 0 0 0 5-4 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 2-2 1 0 0 0 2-2 0 0 0 0 3-2 0 0 0 0 3-1 0-1 0 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 2-2 0 0 1 0 2-1 0 0 0 0 3-2 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0-1 3-1 0 0 0 0 3-2 0 0 0 0 2-1 1 0 0 0 2-2 1 0 0 0 2-2 0 0 1 0 2-1 0 0 1 0 2-2 0 0 0 0 3-1 0 0 0 0 3-2 0 0 1 0 2-1 0 0 1 0 2-1 0-1 1 0 2-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-2 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 1 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 2 0 0 0 0 0 3-1 0 0 0-1 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 4 0 0-1 0 0 3 0 0 0 0 0 3-1 0 0 0 0 3-1 1 0 0 0 3-1 0 0 0 0 3-1 0 0 0 0 0 0 5 0 4 0 5 1 4 2 4 2 3 4 2 3 2 5 1 4 0 5 0 4-2 4-2 4-3 4-4 2-4 3-3 1 0 0-1 0-3 0-2 1 0 0-3 1 0 0-3 1 0 0-3 0 0 0-3 1-3 1-3 1 0 0-3 1-2 1-3 1-3 1-1 0-1 0-3 1-3 1-3 1 0 0-2 1-3 1-3 1-3 0-3 1 0 0-3 1-3 1-2 1 0 0-3 2-3 1 0 0-3 1 0 0-2 1-3 1 0 0-3 1-3 1-2 2-3 1 0 0-3 1-2 1-3 2-3 1-2 1 0 0-3 2-2 1 0 0-3 1 0 0-3 2 0 0-2 1-2 2-1 0-2 1 0 0-3 2-2 1 0 0-3 2-2 1 0 0-3 2 0 0-2 2 0 0-2 1-3 2 0 0-2 2-2 1-1 0-2 2 0 0-2 2-3 1 0 0-2 2 0 0-2 2 0 0-3 2-4 3-5 4-1 1-4 3-4 1-4 2-5 0z" horiz-adv-x="1000" />
+<glyph glyph-name="data-output" unicode="&#xe84b;" d="m250 676l0-2c0-1 0-1 0-1l0-649 500 0 0 486c0 0 0 0 0 0l0 1 0 1c-1 0-1 0-1 0l-166 162 0 2-2 0-213 0-115 0-3 0z m5-5l323 0 0-163 167 0 0-479-490 0 0 642z m328-4l158-154-158 0 0 154z m-145-104l0-55-115 0 0-84 115 0 0-55 85 97-85 97z" horiz-adv-x="1000" />
+<glyph glyph-name="script-task" unicode="&#xe84c;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m87-91l0 0c-35-21-58-39-72-56-15-17-21-34-22-49 0-30 23-55 47-79 23-24 46-47 49-71 1-12-2-25-14-40-12-15-31-31-62-49l-11-6 232 0 1 0c31 19 51 35 64 51 12 15 16 30 15 45-3 28-28 51-51 75-23 24-45 48-44 74 0 14 5 28 19 44 14 17 37 35 70 55l11 6-232 0z m2-7l205 0c-28-18-48-34-61-49-15-17-21-34-21-49-1-30 23-55 46-79 23-24 47-47 49-71 1-12-2-25-14-40-11-14-31-30-61-48l-205 0c25 16 42 30 53 44 13 15 17 30 16 45-3 28-28 51-51 75-24 24-45 48-45 74 0 14 6 28 20 44 14 16 36 34 69 54z m-30-60c-4 0-4-7 0-7l123 0c5 0 5 7 0 7l-27 0-96 0z m13-69c-5 0-5-7 0-7l111 0c5 0 5 7 0 7l-111 0z m37-69c-5 0-5-7 0-7l124 0c5 0 5 7 0 7l-124 0z m25-69c-5 0-5-7 0-7l124 0c4 0 4 7 0 7l-124 0z" horiz-adv-x="1000" />
+<glyph glyph-name="send-task" unicode="&#xe84d;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m-23-93l235-130 235 130-470 0z m0-75l0-292 470 0 0 292-235-117-235 117z" horiz-adv-x="1000" />
+<glyph glyph-name="data-store" unicode="&#xe84e;" d="m500 666c-78 0-156-7-216-20-30-7-56-15-75-25-18-10-31-21-34-35 0 0 0-1 0-1l0 0 0 0 0-73c0 0 0 0 0 0l0-73c0 0 0 0 0 0l0-324 0 0c3-14 16-26 34-36 19-10 45-18 75-25 60-13 138-19 216-19 78 0 156 6 216 19 30 7 56 15 75 25 19 10 31 22 34 36l0 0 0 324c0 0 0 0 0 0l0 73c0 0 0 0 0 0l0 73c0 0 0 0 0 0l0 0 0 0c0 0 0 1 0 1-3 14-16 25-34 35-19 10-45 18-75 25-60 13-138 20-216 20z m0-5c78 0 156-7 215-20 30-6 55-15 73-24 18-10 29-21 32-32-3-12-14-23-32-32-18-10-43-18-73-24-59-13-137-20-215-20-78 0-156 7-215 20-30 6-55 14-73 24-18 9-29 20-32 32 3 11 14 22 32 32 18 9 43 18 73 24 39 8 86 14 135 17 26 2 53 3 80 3z m-320-88c6-10 16-18 29-25 19-10 45-18 75-24 60-13 138-20 216-20 78 0 156 7 216 20 30 6 56 14 75 24 13 7 23 15 29 25l0-61c-2-12-13-23-32-32-18-10-43-18-73-24-59-13-137-20-215-20-78 0-156 7-215 20-30 6-55 14-73 24-18 9-29 20-32 32z m0-73c6-10 16-18 29-25 19-10 45-18 75-24 60-13 138-20 216-20 78 0 156 7 216 20 30 6 56 14 75 24 13 7 23 15 29 25l0-61c-2-12-13-23-32-32-18-10-43-18-73-25-59-12-137-19-215-19-78 0-156 7-215 19-30 7-55 15-73 25-18 9-29 20-32 32z m0-73c6-10 16-18 29-25 19-10 45-18 75-24 60-14 138-20 216-20 78 0 156 6 216 20 30 6 56 14 75 24 13 7 23 15 29 25l0-311c-2-12-13-23-32-33-18-9-43-17-73-24-59-13-137-19-215-19-78 0-156 6-215 19-30 7-55 15-73 24-18 10-29 21-32 33z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-escalation" unicode="&#xe84f;" d="m500 550c-47-131-77-268-124-400 43 43 81 91 124 135 42-45 83-90 125-135-43 133-83 267-125 400z m1-83c23-73 45-146 68-219-22 24-45 49-68 74-19-17-69-82-66-68 24 70 41 143 66 213z m3 333c-43-1-87-4-127-17-24-13-8-53 18-45 64 16 132 17 196 4 27-2 35 39 9 47-31 8-64 11-96 11z m250-79c-26 3-35-36-12-47 53-38 91-93 122-149 18-21 53 4 40 27-34 65-80 124-139 166-3 2-7 3-11 3z m-521-11c-21-3-34-22-49-35-36-35-64-77-88-121-9-15-20-37-1-49 17-13 36 3 41 21 22 41 49 81 82 115 13 15 37 23 38 45 0 12-10 23-23 24z m695-313c-22 1-29-24-25-41 4-68-13-136-46-195-9-25 28-44 43-22 41 72 59 158 50 241-3 10-13 16-22 17z m-853-19c-22 1-30-22-26-40 3-68 21-136 52-196 15-22 52-3 43 22-30 60-46 127-47 194-2 11-12 19-22 20z m694-334c-22-3-36-24-55-33-42-28-91-46-140-59-25-12-9-52 17-45 72 16 139 49 195 97 14 15 2 40-17 40z m-542-1c-24 0-31-35-11-46 47-40 104-67 163-83 17-5 42-16 53 5 10 18-6 37-24 38-56 14-111 36-156 73-7 6-14 14-25 13z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-message" unicode="&#xe850;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m-167-155c57-46 114-92 171-138 56 46 113 92 170 138-114 0-227 0-341 0z m-38-32c0-93 0-187 0-280 137 0 273 0 410 0 0 91 0 183 0 274-67-54-134-109-201-163-70 56-139 113-209 169z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-multiple" unicode="&#xe851;" d="m715 418c-71 52-143 104-215 156-72-52-143-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253z m-28-9c-24-74-48-147-72-220-77 0-153 0-230 0-24 73-48 146-72 220 63 45 125 90 187 135 62-45 124-90 187-135z m-187 393c-41-1-83-5-121-18-25-13-8-53 18-44 64 17 131 17 196 3 26-3 34 38 9 47-33 8-68 12-102 12z m255-83c-26 3-36-36-13-47 52-38 93-90 121-147 15-22 52-3 43 22-32 67-82 127-143 170-2 1-5 2-8 2z m-519-10c-22-2-35-23-51-36-42-40-76-89-98-142-8-26 30-42 44-19 27 61 69 115 122 157 13 14 2 40-17 40z m264 0c-20-2-48 4-57-18-8-21 15-38 34-32 51 4 103-5 149-25 26-8 42 31 19 44-45 21-95 31-145 31z m-155-39c-23-4-43-21-62-34-34-27-66-58-86-96-10-26 30-44 43-21 30 47 74 83 121 110 16 14 5 41-16 41z m393-59c-25 2-35-33-14-46 37-38 62-87 77-137 14-24 53-6 44 20-17 60-49 115-94 158-4 3-8 4-13 5z m-564-171c-23 2-28-24-30-41-7-55-2-112 16-163 12-24 51-11 46 15-17 53-20 110-10 164 1 13-10 24-22 25z m754-46c-21 1-29-22-25-39 1-68-16-135-47-195-9-25 29-43 43-21 39 72 57 155 52 237-3 10-13 18-23 18z m-853-16c-22 2-30-22-26-39 1-69 18-137 51-197 15-22 52-2 42 23-30 59-46 126-45 193-2 11-11 19-22 20z m756-57c-22 2-27-22-28-39-10-48-34-91-63-130-12-25 26-47 42-24 38 49 65 108 73 170-1 12-11 23-24 23z m-590-160c-22-1-30-32-13-45 40-46 90-82 147-102 26-6 40 33 17 45-52 20-98 53-134 96-4 4-10 6-17 6z m426-77c-23-5-43-21-66-27-34-13-71-15-106-19-25-9-16-49 10-47 62 1 124 18 177 50 17 14 7 44-15 43z m-440-39c-23-1-31-35-11-46 56-45 123-78 194-91 26-2 35 39 9 47-65 14-127 44-179 87-4 2-8 3-13 3z m543-3c-22-2-36-24-55-32-43-29-92-45-141-57-24-12-10-52 17-46 71 15 140 47 196 95 14 15 2 40-17 40z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-signal" unicode="&#xe852;" d="m500 562c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z m0-51c50-90 100-180 151-270-101 0-201 0-302 0 51 90 101 180 151 270z m0 291c-41-1-83-5-121-18-25-13-8-53 18-44 64 17 131 17 196 3 26-3 34 38 9 47-33 8-68 12-102 12z m255-83c-26 3-36-36-13-47 52-38 93-90 121-147 15-22 52-3 43 22-32 67-82 127-143 170-2 1-5 2-8 2z m-519-10c-22-2-35-23-51-36-42-40-76-89-98-142-8-26 30-42 44-19 27 61 69 115 122 157 13 14 2 40-17 40z m264 0c-20-2-48 4-57-18-8-21 15-38 34-32 51 4 103-5 149-25 26-8 42 31 19 44-45 21-95 31-145 31z m-155-39c-23-4-43-21-62-34-34-27-66-58-86-96-10-26 30-44 43-21 30 47 74 83 121 110 16 14 5 41-16 41z m393-59c-25 2-35-33-14-46 37-38 62-87 77-137 14-24 53-6 44 20-17 60-49 115-94 158-4 3-8 4-13 5z m-564-171c-23 2-28-24-30-41-7-55-2-112 16-163 12-24 51-11 46 15-17 53-20 110-10 164 1 13-10 24-22 25z m754-46c-21 1-29-22-25-39 1-68-16-135-47-195-9-25 29-43 43-21 39 72 57 155 52 237-3 10-13 18-23 18z m-853-16c-22 2-30-22-26-39 1-69 18-137 51-197 15-22 52-2 42 23-30 59-46 126-45 193-2 11-11 19-22 20z m756-57c-22 2-27-22-28-39-10-48-34-91-63-130-12-25 26-47 42-24 38 49 65 108 73 170-1 12-11 23-24 23z m-590-160c-22-1-30-32-13-45 40-46 90-82 147-102 26-6 40 33 17 45-52 20-98 53-134 96-4 4-10 6-17 6z m426-77c-23-5-43-21-66-27-34-13-71-15-106-19-25-9-16-49 10-47 62 1 124 18 177 50 17 14 7 44-15 43z m-440-39c-23-1-31-35-11-46 56-45 123-78 194-91 26-2 35 39 9 47-65 14-127 44-179 87-4 2-8 3-13 3z m543-3c-22-2-36-24-55-32-43-29-92-45-141-57-24-12-10-52 17-46 71 15 140 47 196 95 14 15 2 40-17 40z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-multiple" unicode="&#xe853;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-87c-72-52-144-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253-71 52-143 104-215 156z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-message" unicode="&#xe854;" d="m295 506c0-104 0-208 0-312 137 0 273 0 410 0 0 104 0 208 0 312-137 0-273 0-410 0z m91-49c76 0 152 0 228 0-40-24-81-79-121-85-36 29-71 57-107 85z m270-28c0-62 0-124 0-186-104 0-208 0-312 0 0 62 0 124 0 186 52-42 104-83 156-125 52 42 104 83 156 125z m-152 371c-43-1-87-4-127-17-24-13-8-53 18-45 64 16 132 17 196 4 27-2 35 39 9 47-31 8-64 11-96 11z m250-79c-26 3-35-36-12-47 53-38 91-93 122-149 18-21 53 4 40 27-34 65-80 124-139 166-3 2-7 3-11 3z m-521-11c-21-3-34-22-49-35-36-35-64-77-88-121-9-15-20-37-1-49 17-13 36 3 41 21 22 41 49 81 82 115 13 15 37 23 38 45 0 12-10 23-23 24z m695-313c-22 1-29-24-25-41 4-68-13-136-46-195-9-25 28-44 43-22 41 72 59 158 50 241-3 10-13 16-22 17z m-853-19c-22 1-30-22-26-40 3-68 21-136 52-196 15-22 52-3 43 22-30 60-46 127-47 194-2 11-12 19-22 20z m694-334c-22-3-36-24-55-33-42-28-91-46-140-59-25-12-9-52 17-45 72 16 139 49 195 97 14 15 2 40-17 40z m-542-1c-24 0-31-35-11-46 47-40 104-67 163-83 17-5 42-16 53 5 10 18-6 37-24 38-56 14-111 36-156 73-7 6-14 14-25 13z" horiz-adv-x="1000" />
+<glyph glyph-name="ad-hoc-marker" unicode="&#xe855;" d="m326 534c-77 0-151-84-201-205l0-163c51 86 103 188 172 203 76 16 146-64 214-122 56-51 117-86 179-77 70 4 136 72 185 171l0 174c-24-55-57-87-88-121-47-60-106-81-159-46-95 66-185 177-288 185-5 0-9 1-14 1z" horiz-adv-x="1000" />
+<glyph glyph-name="service-task" unicode="&#xe856;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z m44-53l0-5 0-28c-6-2-12-4-18-6l0 0 0 0c-6-3-11-5-17-9l-23 24-38-38 23-24c-6-10-11-22-14-34l-33 0 0-54 34 0c1-6 3-12 5-17 3-6 6-12 9-17l-24-24 38-38 20 20 0-5 23 0c4-1 8-3 12-4 1-4 2-8 4-11l0-24 4 0-19-19 38-38 25 24c10-6 22-11 34-14l0-34 5 0c15 0 44 0 44 0l-5 5 10 0 0 5 0 25c6 1 12 3 18 5l0 0 0 0c6 3 11 6 16 9l25-24 38 38-25 24c7 11 12 22 14 34l33 1 0 53-33 0c-1 6-3 12-6 18-2 6-5 11-8 16l23 23-39 38-19-19 0 5-5 0-18 0c-3 2-7 3-11 4-1 4-2 8-4 12l0 22-6 0 20 19-39 38-23-23c-11 6-22 11-34 14l0 33-54 0z m10-10l34 0 0-31 4-1c13-3 26-8 38-15l4-3 21 22 24-24-19-19-34 0 0-15c-21 22-54 31-84 18-38-16-56-59-40-97l0 0 0 0c5-10 11-19 19-26l-15 0 0-35-20-20-24 24 23 23-2 3c-4 6-8 12-10 18l0 0 0 0c-3 7-5 14-6 20l-1 4-32 0 0 34 32 0 0 4c3 14 8 27 16 38l2 4-22 22 24 24 22-22 4 2c5 4 11 7 18 10l0 0c6 2 13 4 20 6l4 1 0 31z m17-72c22 0 43-11 55-30l0-2c-6-2-12-4-18-6l0 0 0 0c-6-3-11-5-16-9l-24 24-38-38 24-24c-7-10-12-22-14-34l-3 0c-11 7-20 17-25 30l0 0c-14 32 1 70 34 84 8 3 16 5 25 5z m65-9l34 0 0-31 4-1c2 0 3-1 5-1l0 0c5-1 9-3 14-4l0 0c4-2 7-4 11-6 0 0 0 0 0 0 1 0 2 0 2-1 0 0 0 0 0 0 1 0 2-1 3-1 0 0 0 0 0 0 0-1 1-1 2-1l0-1c0 0 1 0 1 0l4-3 0 0 2-1 0 4 19 19 25-24-22-22 2-3c4-6 7-12 10-18l0 0 0 0c3-7 5-13 6-20l1-4 31 0 0-34-31 0-1-4c-2-13-8-26-15-38l-2-3 23-23-24-24-23 23-4-3c-5-3-12-7-18-9-7-3-13-5-20-6l-4-1 0-33c-5 0-21 0-34 0l0 32-4 1c-14 3-27 8-38 16l-4 2-23-23-24 24 19 19 7 0-3 4 0 0-2 3 0 1c-4 4-7 10-9 15 0 1-1 2-1 2l0 0 0 0 0 0c0 1 0 1-1 1l0 0c-1 5-3 9-4 14l0 1c-1 1-1 3-1 4l-1 4 0 0-4 0-14 0 0 0-14 0 0 34 32 0 0 0 6 0-6 3 0 1c3 14 8 27 16 38l2 4-22 22 24 24 22-22 4 2c5 4 11 7 18 10l0 0c6 2 13 4 20 6l1 0 3-5 0 6 0 31z m18-62c-1 0-2 0-2 0l0 0c0 0 0 0 0 0l0 0c-1 0-1 0-1 0 0 0 0 0 0 0l0 0c-1 0-2 0-3 0l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c-8-1-16-3-23-6l0 0c-26-11-43-34-46-60l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-1 0-1 0-2l0 0c0 0 0 0 0 0l0 0c0-2 0-4 0-6l0 0 0 0c0 0 0 0 0 0l0 0c0-1 0-3 0-5l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-2 0-4 0-5l0 0c0 0 0 0 0 0 0 0 0-1 0-1 0 0 0 0 0 0l0 0c1 0 1-1 1-2l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-1 0-2 0-3l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c1-1 1-2 1-3l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 0 0-1 1-2l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-2 1-4 1-5 0 0 0 0 0 0 1-1 1-1 1-1 0 0 0 0 0-1 0 0 0-1 1-1 0 0 0 0 0 0l0 0c0-1 0-2 1-2 0 0 0 0 0 0 0-1 0-1 0-1 0 0 0 0 0 0l0 0c1-2 1-3 2-5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c19-32 59-47 94-32 38 16 56 60 40 97-6 17-18 29-33 37l0 0c0 0 0 0 0 0l0 0c-1 0-1 1-2 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 1-2 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 1-2 1l0 0c0 0-1 0-1 0l0 0c0 0-1 1-2 1l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c-1 0-1 1-2 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-2 0l0 1c0 0 0 0-1 0l0 0c-1 0-3 0-4 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-2 0l0 0c0 0 0 0 0 0 0 0-1 0-1 0 0 0 0 0 0 0l0 0c-1 1-1 1-2 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-2 0l0 0c0 0-1 0-1 0l0 0c0 0-1 0-2 1l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-2 0l0 0c-1 0-1 0-1 0l0 0c0 0-1 0-2 0l0 0c0 0 0 0 0 0l0 0c-1 0-2 0-2 0z m0-10c0 0 1 0 1 0l0 0c1 0 1 0 1 0l0 0c1 0 1 0 2 0l0 0c0 0 0 0 0 0l0 0c1 0 1 0 2 0l0 0c0 0 0 0 0 0l0 0c1 0 1-1 2-1l0 0c0 0 0 0 0 0l0 0c1 0 2 0 2 0l0 0c0 0 0 0 0 0l0 0c1 0 2 0 2 0l0 0c0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0l0 0c0-1 1-1 1-1l0 0c0 0 1 0 1 0l0 0c1 0 2 0 3-1l0 0c1 0 1 0 1 0l0 0c0 0 1 0 1 0l0 0c1-1 1-1 1-1l0 0c0 0 1 0 2 0l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0-1 1-1 1-1l0 0c1 0 1 0 1 0l0 0c0 0 1-1 1-1l0 0c1 0 1 0 1 0l0 0c0 0 1-1 1-1l0 0c0 0 1 0 1 0l0 0c0 0 1-1 1-1l0 0c0 0 0 0 1 0l0 0c12-7 22-17 28-31 14-33-2-71-34-85l0 0c-31-12-66 0-82 28l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c-1 2-1 3-2 4 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0-1 0-1 1-1 2l0 0c0 0 0 0-1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0-1 2-1 3-2 4l0 0c0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0l0 0c0 0 0 1 0 2l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 1-1 1-1 2l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 1 0 2 0 2l0 0c0 0 0 0 0 0 0 1 0 1 0 1l0 0c0 0-1 1-1 2l0 0c0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 2 0 3 0 4l0 0c0 0 0 0 0 0 0 1 0 1 0 1l0 0c0 1 0 3 0 4l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c0 2 0 3 0 5l0 0c0 0 0 0 0 0l0 0c0 1 0 1 0 2l0 0c0 0 0 0 0 0 0 0 0 0 0 0l0 0c3 22 17 43 39 52 7 3 14 4 20 5l0 0c0 0 0 0 0 0 1 0 1 0 1 0l0 0 0 0c1 0 2 0 2 0l0 0c0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0l0 0c0 0 1 0 2 0z" horiz-adv-x="1000" />
+<glyph glyph-name="task-none" unicode="&#xe857;" d="m215 745c-107 0-195-87-195-194l0-402c0-107 88-194 195-194l570 0c108 0 195 87 195 194l0 402c0 107-87 194-195 194l-570 0z m0-60l570 0c75 0 135-59 135-134l0-402c0-75-60-134-135-134l-570 0c-75 0-135 59-135 134l0 402c0 75 60 134 135 134z" horiz-adv-x="1000" />
+<glyph glyph-name="compensation-marker" unicode="&#xe858;" d="m504 589l-330-239 5-4 325-235 0 233 323-233 0 478-323-233 0 233z m-10-19l0-440-303 220 303 220z m323 0l0-440-304 220 304 220z" horiz-adv-x="1000" />
+<glyph glyph-name="start-event-non-interrupting-multiple" unicode="&#xe859;" d="m715 418c-71 52-143 104-215 156-72-52-143-104-215-156 27-84 55-169 82-253 89 0 177 0 266 0 28 84 55 169 82 253z m-28-9c-24-74-48-147-72-220-77 0-153 0-230 0-24 73-48 146-72 220 63 45 125 90 187 135 62-45 124-90 187-135z m-183 391c-43-1-87-4-127-17-24-13-8-53 18-45 64 16 132 17 196 4 27-2 35 39 9 47-31 8-64 11-96 11z m250-79c-26 3-35-36-12-47 53-38 91-93 122-149 18-21 53 4 40 27-34 65-80 124-139 166-3 2-7 3-11 3z m-521-11c-21-3-34-22-49-35-36-35-64-77-88-121-9-15-20-37-1-49 17-13 36 3 41 21 22 41 49 81 82 115 13 15 37 23 38 45 0 12-10 23-23 24z m695-313c-22 1-29-24-25-41 4-68-13-136-46-195-9-25 28-44 43-22 41 72 59 158 50 241-3 10-13 16-22 17z m-853-19c-22 1-30-22-26-40 3-68 21-136 52-196 15-22 52-3 43 22-30 60-46 127-47 194-2 11-12 19-22 20z m694-334c-22-3-36-24-55-33-42-28-91-46-140-59-25-12-9-52 17-45 72 16 139 49 195 97 14 15 2 40-17 40z m-542-1c-24 0-31-35-11-46 47-40 104-67 163-83 17-5 42-16 53 5 10 18-6 37-24 38-56 14-111 36-156 73-7 6-14 14-25 13z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-throw-signal" unicode="&#xe85a;" d="m499 802c-220 4-425-177-448-396-24-185 78-380 247-461 160-80 368-56 501 66 134 118 190 318 128 486-57 167-217 293-393 303-12 1-23 2-35 2z m-5-49c202 7 391-161 407-362 19-178-92-361-262-420-166-61-368-2-468 145-103 144-99 356 18 490 74 90 188 146 305 147z m8-44c-186 6-358-158-361-344-9-169 116-334 283-367 155-33 328 46 397 190 71 140 39 327-83 430-64 57-150 91-236 91z m-2-48c164 4 314-144 311-308 3-152-119-297-272-312-143-19-295 73-336 213-43 134 14 295 138 364 48 28 103 43 159 43z m0-99c-64-115-128-230-192-345 128 0 256 0 384 0-64 115-128 230-192 345z" horiz-adv-x="1000" />
+<glyph glyph-name="intermediate-event-catch-non-interrupting-condition" unicode="&#xe85b;" d="m349 540l0-12 0-368 50 0 202 0 50 0 0 380-302 0z m24-24l254 0 0-332-26 0-202 0-26 0 0 332z m26-37l0-25 202 0 0 25-202 0z m0-74l0-24 202 0 0 24-202 0z m0-85l0-24 202 0 0 24-202 0z m0-77l0-24 202 0 0 24-202 0z m101 559l0 0-5 0-1 0 0 0-5 0 0 0 0 0-6-1 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 0-5-1 0 0-1 0-5 0 0 0 0 0-5 0-1 0 0-1-5 0 0 0 0 0-5-1-1 0 0 0-5 0 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1-1 0 0 0-5-1 0 0 0 0-5-1 0 0-1 0-5-1 0 0 0 0-5-1 0 0 0 0-6-2 0 0 0 0-5-1 0 0 0 0-5-1-4-2-4-2-4-3-2-4-3-4-1-4 0-5 0-4 1-4 2-5 3-3 3-3 4-3 4-1 5-1 4 0 4 1 5 1 5 1 4 1 5 1 5 1 5 1 5 1 5 1 5 0 4 1 5 1 5 0 5 1 5 0 5 1 5 0 5 0 5 1 5 0 5 0 5 0 5 0 5 0 5 0 5-1 5 0 5 0 5-1 5 0 5-1 5 0 5-1 5-1 4 0 5-1 5-1 5-1 5-1 4-1 5 0 4 0 5 1 4 2 3 3 4 3 2 4 2 4 1 4 0 5-1 4-2 5-2 4-3 3-4 3-4 2-3 1-5 1 0 0 0 0-5 1 0 0-1 0-5 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 1 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 1 0 0-6 0 0 0 0 0-5 0 0 0-1 0-5 1 0 0 0 0-5 0-1 0 0 0-5 0 0 0 0 0-6 1 0 0 0 0-5 0 0 0 0 0-6 0 0 0z m255-83l-5 0-4-1-5-2-3-2-4-4-2-3-2-4-1-5-1-4 1-5 1-4 3-4 3-4 2-2 2-1 4-3 4-3 4-3 3-3 4-4 4-3 4-3 3-3 4-4 4-3 3-4 4-3 3-4 4-3 3-4 4-4 3-3 3-4 3-4 4-4 3-3 3-4 3-4 3-4 3-4 3-4 2-4 3-4 3-5 3-4 2-4 3-4 2-4 3-5 2-4 2-4 3-5 2-4 1-2 2-4 4-3 3-3 4-2 5-1 4-1 5 1 4 1 4 2 4 3 3 3 2 4 2 4 0 5 0 4-1 5-1 3-1 3 0 0 0 0-3 5 0 0 0 0-2 5 0 0-1 0-2 4 0 1 0 0-3 4 0 0 0 1-2 4-1 0 0 0-2 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-3 5 0 0-1 0-3 4 0 0 0 0-3 5 0 0 0 0-3 4 0 0 0 0-4 4 0 1 0 0-3 4 0 0 0 0-3 4-1 0 0 0-3 4 0 1 0 0-4 4 0 0 0 0-3 4 0 0-1 0-3 4 0 0 0 0-4 4 0 0 0 0-4 4 0 0 0 1-4 3 0 0 0 1-3 3-1 0 0 1-3 3-1 0 0 0-3 4-1 0 0 0-4 4 0 0 0 0-4 4 0 0 0 0-4 3 0 1 0 0-4 3 0 0 0 0-4 4 0 0-1 0-4 3 0 0 0 1-4 3 0 0 0 0-4 3 0 0-1 0-4 4 0 0 0 0-4 3 0 0 0 0-2 1-4 3-4 1-4 1z m-519-10l-5 0-4-1-4-2-4-2-1-1 0 0 0 0-4-3 0-1 0 0-4-3 0 0-1 0-4-4 0 0 0 0-4-3 0 0 0-1-4-3 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-4 0 0 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-3 0-1 0 0-4-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0-1 0-3-4 0 0 0 0-4-4 0 0 0-1-3-4 0 0 0 0-4-4 0 0 0 0-3-4 0 0 0-1-4-4 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-4 0 0-1 0-3-5 0 0 0 0-3-4 0 0 0 0-3-5 0 0 0 0-3-5 0 0 0 0-3-4 0 0 0 0-2-5-1 0 0 0-2-5 0 0 0 0-3-4 0-1 0 0-3-4 0 0 0-1-2-4 0 0 0 0-3-5 0 0 0 0-2-5 0 0-1 0-2-5 0 0 0 0-2-5 0 0 0 0-3-5 0 0 0 0-1-3-1-4-1-5 0-4 1-5 2-4 3-4 3-3 4-2 4-2 4-1 5 0 4 0 5 2 3 2 4 3 3 4 2 3 1 3 2 4 2 5 2 4 2 4 3 5 2 4 2 4 3 5 2 4 3 4 3 4 2 4 3 5 3 4 2 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 3 4 3 3 4 4 3 4 4 3 3 4 4 3 3 4 4 3 4 4 3 3 4 3 4 3 4 4 4 3 1 1 3 3 3 3 2 5 1 4 0 4-1 5-1 4-2 4-3 4-4 3-4 2-4 2-4 0z m264 0l0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 0-5 0 0-1 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 0 0 0 0 0-4-1 0 0-1 0-1 0-4-1-5-2-3-2-4-3-2-4-2-4-2-4 0-5 1-4 1-5 2-4 3-3 4-3 4-3 4-1 4-1 4 0 1 1 4 0 4 0 4 1 4 0 3 0 4 0 4 0 4 0 4 0 4 0 4 0 3 0 4 0 4-1 4 0 4 0 3-1 4 0 4-1 4 0 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4-1 3-1 4-1 4-1 3-1 4-1 3-2 4-1 4-1 3-1 4-2 3-1 4-1 3-2 0 0 0 0 4-1 5-1 5 0 4 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4 0 5-2 4-2 4-3 3-4 3-3 2 0 0-1 0 0 0-3 2-1 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 2 0 0 0 0-4 1 0 0-1 0-3 1-1 0 0 0-4 2 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0-1 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 1-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 1 0 0 0 0-5 0 0 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 1 0 0 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0 1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0z m-155-39l-4 0-5-1-3-1-2-1 0 0 0 0-4-2 0 0 0 0-3-2-1-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-2 0 0 0 0-4-2 0-1 0 0-3-2 0 0-1 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0 0 0-4-3 0 0 0 0-3-2 0 0-1-1-3-2 0 0 0 0-3-3 0 0-1 0-3-2 0-1 0 0-3-2 0 0-1 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3-1 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0-1 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-3 0 0 0 0-3-4 0 0 0 0-3-3 0 0 0 0-2-3-1 0 0-1-2-3 0 0 0 0-3-3 0 0 0-1-3-3 0 0 0 0-2-3 0 0-1-1-2-3 0 0 0 0-2-3-1-1 0 0-2-3 0 0 0 0-2-4-1 0 0 0-2-3-2-4-1-4-1-5 1-4 1-5 2-4 3-3 3-4 4-2 4-2 4-1 5 0 4 1 5 2 4 2 3 3 2 3 2 3 2 3 2 3 3 3 2 4 2 3 2 3 3 3 2 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 2 3 3 2 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 2 3 2 3 2 3 2 3 2 4 2 3 2 3 2 3 2 4 2 3 2 2 0 3 3 4 3 2 4 2 4 1 4 1 5-1 4-1 5-3 4-2 3-4 3-4 2-4 2-5 0z m393-59l-5-1-4-1-4-1-4-3-3-3-3-4-1-4-1-5-1-4 1-5 2-4 2-4 2-3 3-2 3-3 2-3 3-3 2-3 3-3 2-3 3-2 2-3 3-3 2-3 2-3 3-4 2-3 2-3 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-4 2-3 1-3 2-4 2-3 1-3 2-4 2-3 1-4 1-3 2-4 1-3 2-4 1-3 1-4 1-4 2-3 1-4 1-3 0-3 2-4 2-4 4-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 4 0 2 0 0 0 0-2 4 0 0 0 1-1 3 0 1 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 0-2 4 0 0 0 0-1 4 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-2 3 0 0 0 1-1 3 0 0-1 1-1 3 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0 0 0-2 4 0 0-1 0-1 4-1 0 0 0-2 3 0 1 0 0-2 3 0 0 0 0-2 4 0 0 0 0-2 4-1 0 0 0-2 3 0 0 0 1-2 3 0 0 0 0-3 4 0 0 0 0-2 3 0 0 0 1-3 3 0 0 0 0-2 3 0 1-1 0-2 3 0 0 0 0-3 3 0 1 0 0-2 3-1 0 0 0-2 3 0 1 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 4 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 0-3 3 0 0 0 1-3 3 0 0 0 0-3 2-3 3-4 3-5 1-4 1z m-564-171l-5 0-4-1-4-2-4-2-3-4-3-3-2-4-1-4-1-4 0 0 0 0 0-4 0 0-1 0 0-4 0-1 0 0-1-4 0 0 0 0-1-4 0 0 0 0 0-5 0 0 0 0-1-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0-1 0 0-4 0 0 0 0 0-5 0 0 0 0 0-4 0 0 0 0-1-4 0-1 0 0 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 0-4 0 0 0 0 1-5 0 0 0 0 0-4 0 0 0 0 0-4 0-1 0 0 0-4 1 0 0 0 0-4 0 0 0-1 0-4 0 0 0 0 1-4 0 0 0 0 0-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 0-4 1-1 0 0 0-4 0 0 0 0 1-4 0 0 0 0 1-4 0-1 0 0 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0-1 1-4 0 0 0 0 1-4 0 0 0 0 1-4 0 0 0 0 2-4 0 0 0 0 1-4 0-1 0 0 1-1 1-4 3-4 3-3 4-3 4-2 4-1 5 0 4 1 5 1 4 2 3 3 3 4 2 4 2 4 0 5 0 4-1 4 0 1-2 4-1 4-1 3-1 4-1 3-1 4 0 4-1 4-1 3-1 4 0 4-1 4-1 3 0 4-1 4 0 4 0 3-1 4 0 4 0 4-1 4 0 4 0 3 0 4 0 4 0 4 0 4 0 4 0 3 1 4 0 4 0 4 1 4 0 3 0 4 1 4 0 4 1 4 1 3 0 4 1 4 0 4 0 5-1 4-2 4-3 4-3 3-4 2-5 2-4 1z m754-46l-5 0-4-1-4-2-4-2-3-4-3-4-2-4 0-4-1-4 1-4 0-5 0-5 0-5 0-5 0-5 0-5-1-5 0-5 0-5-1-5 0-5-1-5 0-5-1-5-1-4 0-5-1-5-1-5-1-5-1-5-1-5-1-4-1-5-1-5-2-5-1-4-2-5-1-5-1-4-2-5-2-5-1-4-2-5-2-4-2-5-2-5-2-4-2-5-2-4-2-4-2-5-2-4-2-5-1-4 0-5 1-4 2-4 2-4 3-4 4-2 4-2 4-2 5 0 4 1 5 1 4 2 3 3 3 3 2 3 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 3 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 2 4 0 1 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 0 2 5 0 0 0 1 1 5 0 0 0 0 2 5 0 0 0 0 1 5 0 0 0 0 2 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 0 2 6 0 0 0 0 1 5 0 0 0 0 1 5 0 1 0 0 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 1 5 0 0 0 1 1 5 0 0 0 0 0 5 0 0 0 1 1 5 0 0 0 0 0 5 1 0 0 1 0 5 0 0 0 0 0 5 0 1 0 0 1 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0 1 6 0 0 0 0 0 5 0 0 0 1 0 5 0 0 0 0 0 6 0 0 0 0 0 5 0 0 0 0-1 6 0 0 0 0 0 4 0 5-2 4-2 4-3 3-4 3-4 2-4 2-4 0z m-853-16l-5 0-4-1-4-1-4-3-4-3-2-4-2-4-1-4-1-4 0-4 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 0-6 0 0 0 0 0-5 0 0 0 0 0-6 0 0 0 0 1-5 0 0 0-1 0-5 0 0 0 0 1-5 0-1 0 0 0-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 0-5 0-1 0 0 1-5 0 0 0 0 1-5 0-1 0 0 1-5 0 0 0 0 1-5 0 0 0-1 1-5 0 0 0 0 1-5 0 0 0 0 2-6 0 0 0 0 1-5 0 0 0 0 1-5 0 0 0-1 2-5 0 0 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0-1 0 0 1-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0-1 2-4 0-1 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 2-5 0 0 0 0 3-5 0 0 0 0 2-5 0 0 0 0 2-5 1 0 0 0 0-1 3-4 3-3 3-3 4-2 5-1 4 0 5 0 4 1 4 3 4 2 3 4 2 4 2 4 0 5 0 4-1 5-1 3-1 1-2 5-2 4-2 4-2 5-2 4-2 5-2 5-2 4-2 5-1 4-2 5-1 5-2 4-1 5-2 5-1 4-1 5-2 5-1 5-1 4-1 5-1 5-1 5-1 5-1 5 0 5-1 4-1 5 0 5-1 5 0 5-1 5 0 5 0 5-1 5 0 5 0 5 0 5 0 4 0 4-1 5-2 4-3 3-4 4-3 2-5 2-4 0z m756-57l-4 0-5-1-4-2-4-3-3-3-2-4-2-4-1-3 0 0 0 0 0 0 0 0-1-4 0-4-1-4-1-3 0-4-1-4-1-4-1-3-1-4-1-3-1-4-1-4-2-3-1-4-1-3-1-4-2-4-1-3-2-4-1-3-1-4-2-3-2-3-1-4-2-3-2-4-1-3-2-3-2-4-2-3-2-3-2-3-2-4-2-3-2-3-2-3-2-3-2-3-3-3-2-3-2-4-2-1-2-4-2-4-1-5 0-4 1-5 2-4 2-4 3-3 4-3 4-2 4-1 5-1 4 1 4 1 5 2 3 3 3 3 1 1 0 1 0 0 3 3 0 0 0 0 2 3 1 1 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 0 0 0 3 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 0 2 4 0 0 0 0 2 4 0 0 0 0 2 3 0 1 0 0 2 3 0 0 1 1 2 3 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 1 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 2 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 1 0 0 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 1 4 0 0 0 0 1 4 0 0 0 0 1 4 0 0 0 1 0 4 0 0 0 0 0 0 1 5-1 4-1 4-2 4-3 4-4 3-4 2-4 2-5 0z m-590-160l-4-1-4-2-4-2-4-3-3-3-2-4-1-5-1-4 1-5 1-4 2-4 2-3 1-2 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0-1 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 0 0 3-3 0 0 1 0 3-3 0 0 0 0 3-3 0 0 0 0 3-2 1-1 0 0 3-2 0 0 0 0 3-3 1 0 0 0 3-3 0 0 0 0 3-2 1 0 0-1 3-2 0 0 0 0 4-2 0-1 0 0 3-2 0 0 0 0 4-2 0-1 0 0 3-2 1 0 0 0 3-2 0 0 0 0 4-3 0 0 0 0 4-2 0 0 0 0 3-2 1 0 0 0 3-2 0 0 1 0 3-2 0 0 0-1 4-1 0-1 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-2 0 0 0 0 4-1 0-1 0 0 4-1 0 0 0 0 4-2 4-1 4 0 5 0 4 1 4 2 4 3 3 4 2 3 2 5 1 4 0 5-1 4-2 4-2 4-4 3-3 3-4 2-3 1-4 2-3 1-4 2-3 1-3 2-4 1-3 2-4 2-3 2-3 1-4 2-3 2-3 2-3 2-4 2-3 2-3 2-3 2-3 2-3 3-3 2-4 2-3 2-2 3-3 2-3 3-3 2-3 3-3 2-3 3-3 2-2 3-3 3-3 3-3 2-2 3-3 3-2 3-3 3-2 3-1 1-4 3-3 3-5 1-4 1-5 1z m426-77l-5 0-4-1-4-2-1-1-4-2-3-1-3-2-4-2-3-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-2-3-1-4-1-4-1-3-1-4-2-3-1-4-1-4-1-3-1-4-1-4 0-3-1-4-1-4-1-4 0-3-1-4-1-4 0-4-1-3 0-4 0-4-1-4 0-4 0-4-1-3 0-4 0-4 0-5 0-4-2-4-2-4-3-3-3-2-4-1-4-1-5 0-5 1-4 2-4 2-4 4-3 3-3 4-2 5-1 4 0 4 0 0 0 0 0 4 0 0 0 1 0 4 1 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 4 0 0 0 0 0 4 1 1 0 0 0 4 0 0 0 0 0 4 1 0 0 0 0 5 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 0 0 0 0 0 4 1 0 0 0 0 4 1 0 0 1 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 1 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 1 0 0 0 0 4 2 0 0 1 0 3 1 1 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 0 0 4 2 0 0 0 0 4 1 0 0 1 1 3 1 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 2 0 0 1 0 3 1 0 0 0 1 4 1 0 0 0 0 4 2 0 0 0 0 4 2 0 0 0 1 4 1 0 1 0 0 4 2 0 0 0 0 2 1 3 2 4 4 2 3 2 5 1 4 0 5-1 4-1 4-3 4-3 4-3 3-4 2-5 1-4 0z m-440-39l-4-1-5-1-4-3-3-3-3-3-2-4-1-5-1-4 0-5 1-4 2-4 3-4 3-2 1-1 0 0 0 0 4-4 0 0 0 0 4-3 0 0 1 0 4-4 0 0 0 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0-1 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-3 0 0 0 0 4-3 0 0 1 0 4-3 0 0 0 0 5-2 0 0 0-1 5-2 0 0 0 0 4-3 1 0 0 0 4-2 0 0 0-1 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-3 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 4-2 1 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 0 0 5-2 0 0 1 0 5-1 0 0 0 0 5-2 0 0 0 0 5-1 0 0 0 0 5-2 1 0 0 0 5-1 0 0 0 0 5-1 0 0 0 0 6-2 0 0 0 0 4-1 5 0 4 0 5 1 4 2 4 3 3 3 2 4 2 4 1 5 0 4-1 5-1 4-3 4-3 3-4 3-4 2-3 1-5 1-4 1-5 1-5 1-5 2-4 1-5 2-5 1-4 2-5 1-5 2-4 1-5 2-5 2-4 2-5 2-4 2-5 2-4 2-5 2-4 2-4 2-5 3-4 2-4 2-5 3-4 2-4 3-4 3-4 2-4 3-5 3-4 2-4 3-4 3-4 3-3 3-4 3-4 3-1 1-4 3-4 1-4 1-5 1z m543-3l-5 0-4-1-5-2-3-2-1-2-4-3-4-3-4-3-4-3-4-3-4-2-4-3-5-3-4-2-4-3-4-3-4-2-5-3-4-2-4-2-5-3-4-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-2-4-2-5-1-5-2-4-1-5-2-5-1-5-2-4-1-5-2-5-1-5-1-4-1-5-1-3-1-5-1-4-2-3-3-3-3-2-4-2-5-1-4 0-5 1-4 2-4 3-4 3-3 4-3 4-2 4-1 5 0 4 0 3 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 1 0 0 1 0 5 2 0 0 0 0 5 1 0 0 0 0 5 2 0 0 1 0 5 1 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 1 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 0 0 0 5 2 0 0 0 0 5 3 0 0 0 0 5 2 0 1 0 0 4 2 1 0 0 0 4 3 0 0 1 0 4 2 0 1 0 0 5 2 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 5 3 0 0 0 1 4 3 0 0 0 0 5 3 0 0 0 0 4 3 0 0 0 0 4 4 1 0 0 0 4 3 0 0 0 0 2 2 3 3 3 4 2 4 1 4 0 5-1 4-1 5-2 4-3 3-4 3-4 2-4 2-4 0z" horiz-adv-x="1000" />
+<glyph glyph-name="participant" unicode="&#xe85c;" d="m47 654l0-625 906 0 0 625z m857-48l0-533-670 0 0 533 670 0z m-810 0l94 0 0-533-94 0z" horiz-adv-x="1000" />
+<glyph glyph-name="space-tool" unicode="&#xe85f;" d="m366 800l0-900 38 0 0 900-38 0z m233 0l0-900 38 0 0 900-38 0z m-394-287l-164-163 164-163 0 111 93 0 0 105-93 0 0 110z m595 0l0-108-94-1 0-106 94 0 0-111 163 163-163 163z" horiz-adv-x="1000" />
+<glyph glyph-name="connection-multi" unicode="&#xe860;" d="m916 798l-410-109 64-95-486-327 25-38 486 328 62-92 259 333 0 0z m0-328l-411-109 151-224 260 333 0 0z m-409-245l-63-43 25-37 63 42-25 38z m-126-85l-62-42 25-38 62 43-25 37z m-133-90l-63-43 25-37 63 43-25 37z m-126-85l-38-26 25-37 38 26-25 37z" horiz-adv-x="1000" />
+<glyph glyph-name="lasso-tool" unicode="&#xe862;" d="m303 798l0-218 103 0 0 218-103 0z m-248-246l0-103 218 0 0 103-218 0z m379 0l0-103 219 0 0 103-219 0z m349-30l0-40 123 0 0-117 40 0 0 157-163 0z m-480-104l0-218 103 0 0 218-103 0z m603-159l0-77 40 0 0 77-40 0z m0-190l0-116-119 0 0-40 159 0 0 156-40 0z m-570-1l0-157 159 0 0 40-119 0 0 117-40 0z m264-117l0-40 82 0 0 40-82 0z" horiz-adv-x="1000" />
+</font>
+</defs>
+</svg> \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.ttf b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.ttf
new file mode 100644
index 0000000..f940656
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.ttf
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.woff b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.woff
new file mode 100644
index 0000000..e438756
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/bpmn-font/font/bpmn.woff
Binary files differ
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/diagram-js.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/diagram-js.css
new file mode 100644
index 0000000..e251216
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/assets/diagram-js.css
@@ -0,0 +1,457 @@
+/**
+ * outline styles
+ */
+
+.djs-outline {
+ fill: none;
+ visibility: hidden;
+}
+
+.djs-element.hover .djs-outline,
+.djs-element.selected .djs-outline {
+ visibility: visible;
+ shape-rendering: crispEdges;
+ stroke-dasharray: 3,3;
+}
+
+.djs-element.selected .djs-outline {
+ stroke: #8888FF;
+ stroke-width: 1px;
+}
+
+.djs-element.hover .djs-outline {
+ stroke: #FF8888;
+ stroke-width: 1px;
+}
+
+.djs-shape.connect-ok .djs-visual > :nth-child(1) {
+ fill: #54FF00 /* light-green */ !important;
+ fill-opacity: 0.2;
+}
+
+.djs-shape.connect-not-ok .djs-visual > :nth-child(1),
+.djs-shape.drop-not-ok .djs-visual > :nth-child(1) {
+ fill: #E56283 /* light-red */ !important;
+ fill-opacity: 0.2;
+}
+
+svg.drop-not-ok {
+ background: rgba(229, 98, 131, 0.2) /* light-red */ !important;
+}
+
+.djs-connection.connect-ok .djs-visual > :nth-child(1),
+.djs-connection.drop-ok .djs-visual > :nth-child(1) {
+ stroke: #90DD5F /* light-green */ !important;
+}
+
+.djs-connection.connect-not-ok .djs-visual > :nth-child(1),
+.djs-connection.drop-not-ok .djs-visual > :nth-child(1) {
+ stroke: #E56283 /* light-red */ !important;
+}
+
+.drop-not-ok,
+.connect-not-ok {
+ cursor: not-allowed;
+}
+
+
+/**
+* Selection box style
+*
+*/
+.djs-lasso-overlay {
+ fill: rgb(255, 116, 0);
+ fill-opacity: 0.1;
+
+ stroke-dasharray: 5 1 3 1;
+ stroke: rgb(255, 116, 0);
+
+ shape-rendering: crispEdges;
+ pointer-events: none;
+}
+
+/**
+ * Resize styles
+ */
+.djs-resize-overlay {
+ fill: white;
+ fill-opacity: 0.8;
+
+ stroke-dasharray: 5 1 3 1;
+ stroke: rgb(255, 116, 0);
+
+ pointer-events: none;
+}
+
+.djs-resizer-hit {
+ fill: none;
+ pointer-events: all;
+}
+
+.djs-resizer-visual {
+ fill: white;
+ stroke-width: 1px;
+ stroke: black;
+ shape-rendering: crispEdges;
+ stroke-opacity: 0.2;
+}
+
+.djs-cursor-resize-nwse,
+.djs-resizer-nw,
+.djs-resizer-se {
+ cursor: nwse-resize;
+}
+
+.djs-cursor-resize-nesw,
+.djs-resizer-ne,
+.djs-resizer-sw {
+ cursor: nesw-resize;
+}
+
+.djs-shape.djs-resizing > .djs-outline {
+ visibility: hidden !important;
+}
+
+.djs-shape.djs-resizing > .djs-resizer {
+ visibility: hidden;
+}
+
+.djs-dragger > .djs-resizer {
+ visibility: hidden;
+}
+
+/**
+ * drag styles
+ */
+.djs-dragger {
+ fill: white;
+ fill-opacity: 0.6;
+ stroke: #333;
+}
+
+.djs-dragger .djs-visual > :first-child {
+ stroke: rgb(255, 116, 0) !important;
+}
+
+.djs-dragging {
+ opacity: 0.3;
+}
+
+.djs-dragging,
+.djs-dragging > * {
+ pointer-events: none !important;
+}
+
+.djs-dragging .djs-context-pad,
+.djs-dragging .djs-outline {
+ display: none !important;
+}
+
+/**
+ * no pointer events for visual
+ */
+.djs-visual,
+.djs-outline {
+ pointer-events: none;
+}
+
+/**
+ * all pointer events for hit shape
+ */
+.djs-shape .djs-hit {
+ pointer-events: all;
+}
+
+.djs-connection .djs-hit {
+ pointer-events: stroke;
+}
+
+/**
+ * shape / connection basic styles
+ */
+.djs-connection .djs-visual {
+ stroke-width: 2px;
+ fill: none;
+}
+
+.djs-cursor-grabbing {
+ cursor: -webkit-grabbing;
+ cursor: -moz-grabbing;
+ cursor: grabbing;
+}
+
+.djs-cursor-crosshair {
+ cursor: crosshair;
+}
+
+.djs-cursor-move {
+ cursor: move;
+}
+
+.djs-cursor-resize-ns {
+ cursor: ns-resize;
+}
+
+.djs-cursor-resize-ew {
+ cursor: ew-resize;
+}
+
+
+/**
+ * snapping
+ */
+.djs-snap-line {
+ stroke: rgb(255, 195, 66);
+ stroke: rgba(255, 195, 66, 0.50);
+ stroke-linecap: round;
+ stroke-width: 2px;
+ pointer-events: none;
+}
+
+/**
+ * snapping
+ */
+.djs-crosshair {
+ stroke: #555;
+ stroke-linecap: round;
+ stroke-width: 1px;
+ pointer-events: none;
+ shape-rendering: crispEdges;
+ stroke-dasharray: 5, 5;
+}
+
+/**
+ * palette
+ */
+
+.djs-palette {
+ position: absolute;
+ left: 20px;
+ top: 20px;
+}
+
+.djs-palette:not(.open) {
+ overflow: hidden;
+}
+
+.djs-palette .entry,
+.djs-palette .djs-palette-toggle {
+ width: 46px;
+ height: 46px;
+ line-height: 46px;
+}
+
+.djs-palette .separator {
+ margin: 3px 5px 5px 5px;
+ border: solid 1px #DDD;
+ border-radius: 1px;
+};
+
+.djs-palette .entry:before {
+ vertical-align: middle;
+}
+
+.djs-palette .djs-palette-toggle {
+ cursor: pointer;
+}
+
+.djs-palette .entry,
+.djs-palette .djs-palette-toggle {
+ color: #333;
+ font-size: 30px;
+
+ text-align: center;
+}
+
+.djs-palette.open .djs-palette-toggle {
+ height: 10px;
+}
+
+.djs-palette:not(.open) .djs-palette-entries {
+ display: none;
+}
+
+.djs-palette .djs-palette-toggle:hover {
+ background: #666;
+}
+
+.djs-palette .entry:hover {
+ color: rgb(255, 116, 0);
+}
+
+/**
+ * context-pad
+ */
+.djs-overlay-context-pad {
+ width: 72px;
+}
+
+.djs-context-pad {
+ position: absolute;
+ display: none;
+ pointer-events: none;
+}
+
+.djs-context-pad .entry {
+ width: 22px;
+ height: 22px;
+ text-align: center;
+ display: inline-block;
+ font-size: 22px;
+ margin: 0 2px 2px 0;
+
+ border-radius: 3px;
+
+ cursor: default;
+
+ background-color: rgba(255,255,255, 0.85);
+ box-shadow: 0 0 2px 1px rgba(255,255,255, 0.85);
+
+ pointer-events: all;
+}
+
+.djs-context-pad .entry:before {
+ vertical-align: top;
+}
+
+.djs-context-pad .entry:hover {
+ background: rgb(255, 252, 176);
+}
+
+.djs-context-pad.open {
+ display: block;
+}
+
+.djs-popup-entry {
+ font-size: 20px;
+ line-height: 20px;
+ padding: 2px 10px 2px 5px;
+ background-color: rgba(255,255,255, 0.85);
+ white-space: nowrap;
+}
+
+.djs-popup-entry:hover {
+ background: rgb(255, 252, 176);
+}
+
+.djs-popup-entry > span {
+ font-size: 14px;
+ margin-left: 5px;
+
+ vertical-align: middle;
+}
+
+.djs-popup-entry:before {
+ vertical-align: middle;
+}
+
+/**
+ * popup / palette styles
+ */
+.djs-popup, .djs-palette {
+ background: #FAFAFA;
+ border: solid 1px #CCC;
+ border-radius: 2px;
+ box-shadow: 0 1px 4px rgba(0,0,0,0.3);
+}
+
+/**
+ * touch
+ */
+
+.djs-shape,
+.djs-connection {
+ touch-action: none;
+}
+
+.djs-bendpoint {
+ display: none;
+}
+
+/**
+ * bendpoints
+ */
+.djs-bendpoint .djs-visual {
+ pointer-events: none;
+ fill: rgba(255, 255, 121, 0.8);
+ stroke-width: 1px;
+ stroke-opacity: 0.5;
+ stroke: black;
+}
+
+.djs-bendpoint:hover,
+.djs-bendpoints.hover .djs-bendpoint,
+.djs-bendpoints.selected .djs-bendpoint {
+ display: block;
+}
+
+.djs-bendpoints:not(.hover) .floating {
+ display: none;
+}
+
+.djs-bendpoint:hover .djs-visual,
+.djs-bendpoint.floating .djs-visual {
+ fill: yellow;
+}
+
+.djs-bendpoint.floating .djs-hit {
+ pointer-events: none;
+}
+
+.djs-bendpoint .djs-hit {
+ pointer-events: all;
+ fill: none;
+}
+
+.djs-updating,
+.djs-updating > * {
+ pointer-events: none !important;
+}
+
+.djs-updating .djs-context-pad,
+.djs-updating .djs-outline,
+.djs-updating .djs-bendpoint,
+.connect-ok .djs-bendpoint,
+.connect-not-ok .djs-bendpoint,
+.drop-ok .djs-bendpoint,
+.drop-not-ok .djs-bendpoint {
+ display: none !important;
+}
+
+.djs-bendpoint.djs-dragging {
+ display: block;
+ opacity: 1.0;
+}
+
+.djs-bendpoint.djs-dragging .djs-visual {
+ fill: yellow;
+}
+
+
+/**
+ * tooltips
+ */
+.djs-tooltip-error {
+ font-size: 11px;
+ line-height: 18px;
+ text-align: left;
+
+ padding: 5px;
+
+ opacity: 0.7;
+}
+
+.djs-tooltip-error > * {
+ width: 160px;
+
+ background: rgb(252, 236, 240);
+ color: rgb(158, 76, 76);
+ padding: 3px 7px;
+ box-shadow: 0 1px 3px rgba(0,0,0, 0.2);
+ border-radius: 5px;
+ border-left: solid 5px rgb(174, 73, 73);
+}
+
+.djs-tooltip-error:hover {
+ opacity: 1;
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js
new file mode 100644
index 0000000..85e7f04
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js
@@ -0,0 +1,43358 @@
+/*!
+ * bpmn-js - bpmn-modeler v0.10.3
+
+ * Copyright 2014, 2015 camunda Services GmbH and other contributors
+ *
+ * Released under the bpmn.io license
+ * http://bpmn.io/license
+ *
+ * Source Code: https://github.com/bpmn-io/bpmn-js
+ *
+ * Date: 2015-05-18
+ */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.BpmnJS=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var IdSupport = _dereq_(50),
+ Ids = _dereq_(193);
+
+var Viewer = _dereq_(2);
+
+var initialDiagram =
+ '<?xml version="1.0" encoding="UTF-8"?>' +
+ '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
+ 'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
+ 'xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" ' +
+ 'xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" ' +
+ 'targetNamespace="http://bpmn.io/schema/bpmn" ' +
+ 'id="Definitions_1">' +
+ '<bpmn:process id="Process_1" isExecutable="false">' +
+ '<bpmn:startEvent id="StartEvent_1"/>' +
+ '</bpmn:process>' +
+ '<bpmndi:BPMNDiagram id="BPMNDiagram_1">' +
+ '<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">' +
+ '<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">' +
+ '<dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/>' +
+ '</bpmndi:BPMNShape>' +
+ '</bpmndi:BPMNPlane>' +
+ '</bpmndi:BPMNDiagram>' +
+ '</bpmn:definitions>';
+
+
+/**
+ * A modeler for BPMN 2.0 diagrams.
+ *
+ *
+ * ## Extending the Modeler
+ *
+ * In order to extend the viewer pass extension modules to bootstrap via the
+ * `additionalModules` option. An extension module is an object that exposes
+ * named services.
+ *
+ * The following example depicts the integration of a simple
+ * logging component that integrates with interaction events:
+ *
+ *
+ * ```javascript
+ *
+ * // logging component
+ * function InteractionLogger(eventBus) {
+ * eventBus.on('element.hover', function(event) {
+ * console.log()
+ * })
+ * }
+ *
+ * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
+ *
+ * // extension module
+ * var extensionModule = {
+ * __init__: [ 'interactionLogger' ],
+ * interactionLogger: [ 'type', InteractionLogger ]
+ * };
+ *
+ * // extend the viewer
+ * var bpmnModeler = new Modeler({ additionalModules: [ extensionModule ] });
+ * bpmnModeler.importXML(...);
+ * ```
+ *
+ *
+ * ## Customizing / Replacing Components
+ *
+ * You can replace individual diagram components by redefining them in override modules.
+ * This works for all components, including those defined in the core.
+ *
+ * Pass in override modules via the `options.additionalModules` flag like this:
+ *
+ * ```javascript
+ * function CustomContextPadProvider(contextPad) {
+ *
+ * contextPad.registerProvider(this);
+ *
+ * this.getContextPadEntries = function(element) {
+ * // no entries, effectively disable the context pad
+ * return {};
+ * };
+ * }
+ *
+ * CustomContextPadProvider.$inject = [ 'contextPad' ];
+ *
+ * var overrideModule = {
+ * contextPadProvider: [ 'type', CustomContextPadProvider ]
+ * };
+ *
+ * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]});
+ * ```
+ *
+ * @param {Object} [options] configuration options to pass to the viewer
+ * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
+ * @param {String|Number} [options.width] the width of the viewer
+ * @param {String|Number} [options.height] the height of the viewer
+ * @param {Object} [options.moddleExtensions] extension packages to provide
+ * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules
+ * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules
+ */
+function Modeler(options) {
+ Viewer.call(this, options);
+}
+
+inherits(Modeler, Viewer);
+
+Modeler.prototype.createDiagram = function(done) {
+ return this.importXML(initialDiagram, done);
+};
+
+Modeler.prototype.createModdle = function() {
+ var moddle = Viewer.prototype.createModdle.call(this);
+
+ IdSupport.extend(moddle, new Ids([ 32, 36, 1 ]));
+
+ return moddle;
+};
+
+
+Modeler.prototype._interactionModules = [
+ // non-modeling components
+ _dereq_(14),
+ _dereq_(173),
+ _dereq_(170),
+ _dereq_(171)
+];
+
+Modeler.prototype._modelingModules = [
+ // modeling components
+ _dereq_(131),
+ _dereq_(91),
+ _dereq_(144),
+ _dereq_(158),
+ _dereq_(107),
+ _dereq_(10),
+ _dereq_(39),
+ _dereq_(30),
+ _dereq_(8),
+ _dereq_(34)
+];
+
+
+// modules the modeler is composed of
+//
+// - viewer modules
+// - interaction modules
+// - modeling modules
+
+Modeler.prototype._modules = [].concat(
+ Modeler.prototype._modules,
+ Modeler.prototype._interactionModules,
+ Modeler.prototype._modelingModules);
+
+
+module.exports = Modeler;
+
+},{"10":10,"107":107,"131":131,"14":14,"144":144,"158":158,"170":170,"171":171,"173":173,"193":193,"195":195,"2":2,"30":30,"34":34,"39":39,"50":50,"8":8,"91":91}],2:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ omit = _dereq_(329),
+ isString = _dereq_(322),
+ isNumber = _dereq_(319);
+
+var domify = _dereq_(343),
+ domQuery = _dereq_(346),
+ domRemove = _dereq_(347);
+
+var Diagram = _dereq_(73),
+ BpmnModdle = _dereq_(48);
+
+var Importer = _dereq_(42);
+
+
+function initListeners(diagram, listeners) {
+ var events = diagram.get('eventBus');
+
+ listeners.forEach(function(l) {
+ events.on(l.event, l.handler);
+ });
+}
+
+function checkValidationError(err) {
+
+ // check if we can help the user by indicating wrong BPMN 2.0 xml
+ // (in case he or the exporting tool did not get that right)
+
+ var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
+ var match = pattern.exec(err.message);
+
+ if (match) {
+ err.message =
+ 'unparsable content <' + match[1] + '> detected; ' +
+ 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
+ }
+
+ return err;
+}
+
+var DEFAULT_OPTIONS = {
+ width: '100%',
+ height: '100%',
+ position: 'relative',
+ container: 'body'
+};
+
+
+/**
+ * Ensure the passed argument is a proper unit (defaulting to px)
+ */
+function ensureUnit(val) {
+ return val + (isNumber(val) ? 'px' : '');
+}
+
+/**
+ * A viewer for BPMN 2.0 diagrams.
+ *
+ * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include
+ * additional features.
+ *
+ *
+ * ## Extending the Viewer
+ *
+ * In order to extend the viewer pass extension modules to bootstrap via the
+ * `additionalModules` option. An extension module is an object that exposes
+ * named services.
+ *
+ * The following example depicts the integration of a simple
+ * logging component that integrates with interaction events:
+ *
+ *
+ * ```javascript
+ *
+ * // logging component
+ * function InteractionLogger(eventBus) {
+ * eventBus.on('element.hover', function(event) {
+ * console.log()
+ * })
+ * }
+ *
+ * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
+ *
+ * // extension module
+ * var extensionModule = {
+ * __init__: [ 'interactionLogger' ],
+ * interactionLogger: [ 'type', InteractionLogger ]
+ * };
+ *
+ * // extend the viewer
+ * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });
+ * bpmnViewer.importXML(...);
+ * ```
+ *
+ * @param {Object} [options] configuration options to pass to the viewer
+ * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
+ * @param {String|Number} [options.width] the width of the viewer
+ * @param {String|Number} [options.height] the height of the viewer
+ * @param {Object} [options.moddleExtensions] extension packages to provide
+ * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules
+ * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules
+ */
+function Viewer(options) {
+
+ this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
+
+ var parent = options.container;
+
+ // support jquery element
+ // unwrap it if passed
+ if (parent.get) {
+ parent = parent.get(0);
+ }
+
+ // support selector
+ if (isString(parent)) {
+ parent = domQuery(parent);
+ }
+
+ var container = this.container = domify('<div class="bjs-container"></div>');
+ parent.appendChild(container);
+
+ assign(container.style, {
+ width: ensureUnit(options.width),
+ height: ensureUnit(options.height),
+ position: options.position
+ });
+
+ /**
+ * The code in the <project-logo></project-logo> area
+ * must not be changed, see http://bpmn.io/license for more information
+ *
+ * <project-logo>
+ */
+
+ /* jshint -W101 */
+
+ // inlined ../resources/bpmnjs.png
+ var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
+
+ /* jshint +W101 */
+
+ var linkMarkup =
+ '<a href="http://bpmn.io" ' +
+ 'target="_blank" ' +
+ 'class="bjs-powered-by" ' +
+ 'title="Powered by bpmn.io" ' +
+ 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
+ '<img src="data:image/png;base64,' + logoData + '">' +
+ '</a>';
+
+ container.appendChild(domify(linkMarkup));
+
+ /* </project-logo> */
+}
+
+Viewer.prototype.importXML = function(xml, done) {
+
+ var self = this;
+
+ this.moddle = this.createModdle();
+
+ this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
+
+ if (err) {
+ err = checkValidationError(err);
+ return done(err);
+ }
+
+ var parseWarnings = context.warnings;
+
+ self.importDefinitions(definitions, function(err, importWarnings) {
+ if (err) {
+ return done(err);
+ }
+
+ done(null, parseWarnings.concat(importWarnings || []));
+ });
+ });
+};
+
+Viewer.prototype.saveXML = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var definitions = this.definitions;
+
+ if (!definitions) {
+ return done(new Error('no definitions loaded'));
+ }
+
+ this.moddle.toXML(definitions, options, done);
+};
+
+Viewer.prototype.createModdle = function() {
+ return new BpmnModdle(this.options.moddleExtensions);
+};
+
+Viewer.prototype.saveSVG = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var canvas = this.get('canvas');
+
+ var contentNode = canvas.getDefaultLayer(),
+ defsNode = canvas._svg.select('defs');
+
+ var contents = contentNode.innerSVG(),
+ defs = (defsNode && defsNode.outerSVG()) || '';
+
+ var bbox = contentNode.getBBox();
+
+ var svg =
+ '<?xml version="1.0" encoding="utf-8"?>\n' +
+ '<!-- created with bpmn-js / http://bpmn.io -->\n' +
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
+ '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
+ 'width="' + bbox.width + '" height="' + bbox.height + '" ' +
+ 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
+ defs + contents +
+ '</svg>';
+
+ done(null, svg);
+};
+
+Viewer.prototype.get = function(name) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.get(name);
+};
+
+Viewer.prototype.invoke = function(fn) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.invoke(fn);
+};
+
+Viewer.prototype.importDefinitions = function(definitions, done) {
+
+ // use try/catch to not swallow synchronous exceptions
+ // that may be raised during model parsing
+ try {
+ if (this.diagram) {
+ this.clear();
+ }
+
+ this.definitions = definitions;
+
+ var diagram = this.diagram = this._createDiagram(this.options);
+
+ this._init(diagram);
+
+ Importer.importBpmnDiagram(diagram, definitions, done);
+ } catch (e) {
+ done(e);
+ }
+};
+
+Viewer.prototype._init = function(diagram) {
+ initListeners(diagram, this.__listeners || []);
+};
+
+Viewer.prototype._createDiagram = function(options) {
+
+ var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
+
+ // add self as an available service
+ modules.unshift({
+ bpmnjs: [ 'value', this ],
+ moddle: [ 'value', this.moddle ]
+ });
+
+ options = omit(options, 'additionalModules');
+
+ options = assign(options, {
+ canvas: { container: this.container },
+ modules: modules
+ });
+
+ return new Diagram(options);
+};
+
+
+Viewer.prototype.getModules = function() {
+ return this._modules;
+};
+
+/**
+ * Remove all drawn elements from the viewer.
+ *
+ * After calling this method the viewer can still
+ * be reused for opening another diagram.
+ */
+Viewer.prototype.clear = function() {
+ var diagram = this.diagram;
+
+ if (diagram) {
+ diagram.destroy();
+ }
+};
+
+/**
+ * Destroy the viewer instance and remove all its remainders
+ * from the document tree.
+ */
+Viewer.prototype.destroy = function() {
+ // clear underlying diagram
+ this.clear();
+
+ // remove container
+ domRemove(this.container);
+};
+
+/**
+ * Register an event listener on the viewer
+ *
+ * @param {String} event
+ * @param {Function} handler
+ */
+Viewer.prototype.on = function(event, handler) {
+ var diagram = this.diagram,
+ listeners = this.__listeners = this.__listeners || [];
+
+ listeners.push({ event: event, handler: handler });
+
+ if (diagram) {
+ diagram.get('eventBus').on(event, handler);
+ }
+};
+
+// modules the viewer is composed of
+Viewer.prototype._modules = [
+ _dereq_(3),
+ _dereq_(151),
+ _dereq_(135)
+];
+
+module.exports = Viewer;
+
+},{"135":135,"151":151,"3":3,"319":319,"322":322,"325":325,"329":329,"343":343,"346":346,"347":347,"42":42,"48":48,"73":73}],3:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(6),
+ _dereq_(44)
+ ]
+};
+},{"44":44,"6":6}],4:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195),
+ isArray = _dereq_(316),
+ isObject = _dereq_(320),
+ assign = _dereq_(325),
+ forEach = _dereq_(204),
+ every = _dereq_(201),
+ includes = _dereq_(206),
+ some = _dereq_(210);
+
+var DefaultRenderer = _dereq_(84),
+ TextUtil = _dereq_(184),
+ DiUtil = _dereq_(45);
+
+var createLine = DefaultRenderer.createLine;
+
+
+function BpmnRenderer(events, styles, pathMap) {
+
+ DefaultRenderer.call(this, styles);
+
+ var TASK_BORDER_RADIUS = 10;
+ var INNER_OUTER_DIST = 3;
+
+ var LABEL_STYLE = {
+ fontFamily: 'Arial, sans-serif',
+ fontSize: '12px'
+ };
+
+ var textUtil = new TextUtil({
+ style: LABEL_STYLE,
+ size: { width: 100 }
+ });
+
+ var markers = {};
+
+ function addMarker(id, element) {
+ markers[id] = element;
+ }
+
+ function marker(id) {
+ return markers[id];
+ }
+
+ function initMarkers(svg) {
+
+ function createMarker(id, options) {
+ var attrs = assign({
+ fill: 'black',
+ strokeWidth: 1,
+ strokeLinecap: 'round',
+ strokeDasharray: 'none'
+ }, options.attrs);
+
+ var ref = options.ref || { x: 0, y: 0 };
+
+ var scale = options.scale || 1;
+
+ // fix for safari / chrome / firefox bug not correctly
+ // resetting stroke dash array
+ if (attrs.strokeDasharray === 'none') {
+ attrs.strokeDasharray = [10000, 1];
+ }
+
+ var marker = options.element
+ .attr(attrs)
+ .marker(0, 0, 20, 20, ref.x, ref.y)
+ .attr({
+ markerWidth: 20 * scale,
+ markerHeight: 20 * scale
+ });
+
+ return addMarker(id, marker);
+ }
+
+
+ createMarker('sequenceflow-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('messageflow-start', {
+ element: svg.circle(6, 6, 3.5),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 6, y: 6 }
+ });
+
+ createMarker('messageflow-end', {
+ element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black',
+ strokeLinecap: 'butt'
+ },
+ ref: { x: 8.5, y: 5 }
+ });
+
+ createMarker('data-association-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-flow-marker', {
+ element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: -1, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-default-flow-marker', {
+ element: svg.path('M 1 4 L 5 16'),
+ attrs: {
+ stroke: 'black'
+ },
+ ref: { x: -5, y: 10 },
+ scale: 0.5
+ });
+ }
+
+ function computeStyle(custom, traits, defaultStyles) {
+ if (!isArray(traits)) {
+ defaultStyles = traits;
+ traits = [];
+ }
+
+ return styles.style(traits || [], assign(defaultStyles, custom || {}));
+ }
+
+ function drawCircle(p, width, height, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ var cx = width / 2,
+ cy = height / 2;
+
+ return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
+ }
+
+ function drawRect(p, width, height, r, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
+ }
+
+ function drawDiamond(p, width, height, attrs) {
+
+ var x_2 = width / 2;
+ var y_2 = height / 2;
+
+ var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.polygon(points).attr(attrs);
+ }
+
+ function drawLine(p, waypoints, attrs) {
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'none'
+ });
+
+ return createLine(waypoints, attrs).appendTo(p);
+ }
+
+ function drawPath(p, d, attrs) {
+
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ strokeWidth: 2,
+ stroke: 'black'
+ });
+
+ return p.path(d).attr(attrs);
+ }
+
+ function as(type) {
+ return function(p, element) {
+ return handlers[type](p, element);
+ };
+ }
+
+ function renderer(type) {
+ return handlers[type];
+ }
+
+ function renderEventContent(element, p) {
+
+ var event = getSemantic(element);
+ var isThrowing = isThrowEvent(event);
+
+ if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
+ return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
+ return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
+ return renderer('bpmn:ConditionalEventDefinition')(p, element);
+ }
+
+ if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
+ return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {
+ return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {
+ return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
+ return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
+ return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
+ return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
+ return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
+ return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
+ return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
+ }
+
+ return null;
+ }
+
+ function renderLabel(p, label, options) {
+ return textUtil.createText(p, label || '', options).addClass('djs-label');
+ }
+
+ function renderEmbeddedLabel(p, element, align) {
+ var semantic = getSemantic(element);
+ return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });
+ }
+
+ function renderExternalLabel(p, element, align) {
+ var semantic = getSemantic(element);
+
+ if (!semantic.name) {
+ element.hidden = true;
+ }
+
+ return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });
+ }
+
+ function renderLaneLabel(p, text, element) {
+ var textBox = renderLabel(p, text, {
+ box: { height: 30, width: element.height },
+ align: 'center-middle'
+ });
+
+ var top = -1 * element.height;
+ textBox.transform(
+ 'rotate(270) ' +
+ 'translate(' + top + ',' + 0 + ')'
+ );
+ }
+
+ function createPathFromConnection(connection) {
+ var waypoints = connection.waypoints;
+
+ var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;
+ for (var i = 1; i < waypoints.length; i++) {
+ pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
+ }
+ return pathData;
+ }
+
+ var handlers = {
+ 'bpmn:Event': function(p, element, attrs) {
+ return drawCircle(p, element.width, element.height, attrs);
+ },
+ 'bpmn:StartEvent': function(p, element) {
+ var attrs = {};
+ var semantic = getSemantic(element);
+
+ if (!semantic.isInterrupting) {
+ attrs = {
+ strokeDasharray: '6',
+ strokeLinecap: 'round'
+ };
+ }
+
+ var circle = renderer('bpmn:Event')(p, element, attrs);
+
+ renderEventContent(element, p);
+
+ return circle;
+ },
+ 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.235,
+ my: 0.315
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'white';
+ var stroke = isThrowing ? 'white' : 'black';
+
+ var messagePath = drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill,
+ stroke: stroke
+ });
+
+ return messagePath;
+ },
+ 'bpmn:TimerEventDefinition': function(p, element) {
+
+ var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
+ strokeWidth: 2
+ });
+
+ var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ drawPath(p, pathData, {
+ strokeWidth: 2,
+ strokeLinecap: 'square'
+ });
+
+ for(var i = 0;i < 12;i++) {
+
+ var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ var width = element.width / 2;
+ var height = element.height / 2;
+
+ drawPath(p, linePathData, {
+ strokeWidth: 1,
+ strokeLinecap: 'square',
+ transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
+ });
+ }
+
+ return circle;
+ },
+ 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.555
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ConditionalEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.222
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_LINK', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.57,
+ my: 0.263
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ERROR', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.2,
+ my: 0.722
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
+ xScaleFactor: 1.0,
+ yScaleFactor: 1.0,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.638,
+ my: -0.055
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ }).transform('rotate(45)');
+ },
+ 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.201,
+ my: 0.472
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.2
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.222,
+ my: 0.36
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
+ xScaleFactor: 1.2,
+ yScaleFactor: 1.2,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.458,
+ my: 0.194
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:EndEvent': function(p, element) {
+ var circle = renderer('bpmn:Event')(p, element, {
+ strokeWidth: 4
+ });
+
+ renderEventContent(element, p, true);
+
+ return circle;
+ },
+ 'bpmn:TerminateEventDefinition': function(p, element) {
+ var circle = drawCircle(p, element.width, element.height, 8, {
+ strokeWidth: 4,
+ fill: 'black'
+ });
+
+ return circle;
+ },
+ 'bpmn:IntermediateEvent': function(p, element) {
+ var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });
+ /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
+ 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
+
+ 'bpmn:Activity': function(p, element, attrs) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
+ },
+
+ 'bpmn:Task': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+ renderEmbeddedLabel(p, element, 'center-middle');
+ attachTaskMarkers(p, element);
+ return rect;
+ },
+ 'bpmn:ServiceTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 12,
+ y: 18
+ }
+ });
+
+ /* service bg */ drawPath(p, pathDataBG, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
+ abspos: {
+ x: 17.2,
+ y: 18
+ }
+ });
+
+ /* service fill */ drawPath(p, fillPathData, {
+ strokeWidth: 0,
+ stroke: 'none',
+ fill: 'white'
+ });
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 17,
+ y: 22
+ }
+ });
+
+ /* service */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:UserTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var x = 15;
+ var y = 12;
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user path */ drawPath(p, pathData, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user2 path */ drawPath(p, pathData2, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user3 path */ drawPath(p, pathData3, {
+ strokeWidth: 0.5,
+ fill: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:ManualTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
+ abspos: {
+ x: 17,
+ y: 15
+ }
+ });
+
+ /* manual path */ drawPath(p, pathData, {
+ strokeWidth: 0.25,
+ fill: 'white',
+ stroke: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:SendTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.285,
+ my: 0.357
+ }
+ });
+
+ /* send path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black',
+ stroke: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:ReceiveTask' : function(p, element) {
+ var semantic = getSemantic(element);
+
+ var task = renderer('bpmn:Task')(p, element);
+ var pathData;
+
+ if (semantic.instantiate) {
+ drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
+ abspos: {
+ x: 7.77,
+ y: 9.52
+ }
+ });
+ } else {
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.3,
+ my: 0.4
+ }
+ });
+ }
+
+ /* receive path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:ScriptTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
+ abspos: {
+ x: 15,
+ y: 20
+ }
+ });
+
+ /* script path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:BusinessRuleTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessHeaderPath = drawPath(p, headerPathData);
+ businessHeaderPath.attr({
+ strokeWidth: 1,
+ fill: 'AAA'
+ });
+
+ var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessPath = drawPath(p, headerData);
+ businessPath.attr({
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:SubProcess': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+
+ var semantic = getSemantic(element);
+
+ var expanded = DiUtil.isExpanded(semantic);
+
+ var isEventSubProcess = !!semantic.triggeredByEvent;
+ if (isEventSubProcess) {
+ rect.attr({
+ strokeDasharray: '1,2'
+ });
+ }
+
+ renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
+
+ if (expanded) {
+ attachTaskMarkers(p, element);
+ } else {
+ attachTaskMarkers(p, element, ['SubProcessMarker']);
+ }
+
+ return rect;
+ },
+ 'bpmn:AdHocSubProcess': function(p, element) {
+ return renderer('bpmn:SubProcess')(p, element);
+ },
+ 'bpmn:Transaction': function(p, element) {
+ var outer = renderer('bpmn:SubProcess')(p, element);
+
+ var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);
+
+ /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
+
+ return outer;
+ },
+ 'bpmn:CallActivity': function(p, element) {
+ return renderer('bpmn:Task')(p, element, {
+ strokeWidth: 5
+ });
+ },
+ 'bpmn:Participant': function(p, element) {
+
+ var lane = renderer('bpmn:Lane')(p, element, {
+ fill: 'White'
+ });
+
+ var expandedPool = DiUtil.isExpanded(element);
+
+ if (expandedPool) {
+ drawLine(p, [
+ { x: 30, y: 0 },
+ { x: 30, y: element.height }
+ ]);
+ var text = getSemantic(element).name;
+ renderLaneLabel(p, text, element);
+ } else {
+ // Collapsed pool draw text inline
+ var text2 = getSemantic(element).name;
+ renderLabel(p, text2, { box: element, align: 'center-middle' });
+ }
+
+ var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
+
+ if(participantMultiplicity) {
+ renderer('ParticipantMultiplicityMarker')(p, element);
+ }
+
+ return lane;
+ },
+ 'bpmn:Lane': function(p, element, attrs) {
+ var rect = drawRect(p, element.width, element.height, 0, attrs || {
+ fill: 'none'
+ });
+
+ var semantic = getSemantic(element);
+
+ if (semantic.$type === 'bpmn:Lane') {
+ var text = semantic.name;
+ renderLaneLabel(p, text, element);
+ }
+
+ return rect;
+ },
+ 'bpmn:InclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* circle path */
+ drawCircle(p, element.width, element.height, element.height * 0.24, {
+ strokeWidth: 2.5,
+ fill: 'none'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ExclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
+ xScaleFactor: 0.4,
+ yScaleFactor: 0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.32,
+ my: 0.3
+ }
+ });
+
+ if (!!(getDi(element).isMarkerVisible)) {
+ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+
+ return diamond;
+ },
+ 'bpmn:ComplexGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
+ xScaleFactor: 0.5,
+ yScaleFactor:0.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.26
+ }
+ });
+
+ /* complex path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ParallelGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.6,
+ yScaleFactor:0.6,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.2
+ }
+ });
+
+ /* parallel path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:EventBasedGateway': function(p, element) {
+
+ var semantic = getSemantic(element);
+
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var type = semantic.eventGatewayType;
+ var instantiate = !!semantic.instantiate;
+
+ function drawEvent() {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
+ xScaleFactor: 0.18,
+ yScaleFactor: 0.18,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.36,
+ my: 0.44
+ }
+ });
+
+ /* event path */ drawPath(p, pathData, {
+ strokeWidth: 2,
+ fill: 'none'
+ });
+ }
+
+ if (type === 'Parallel') {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.4,
+ yScaleFactor:0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var parallelPath = drawPath(p, pathData);
+ parallelPath.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ } else if (type === 'Exclusive') {
+
+ if (!instantiate) {
+ var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
+ innerCircle.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ }
+
+ drawEvent();
+ }
+
+
+ return diamond;
+ },
+ 'bpmn:Gateway': function(p, element) {
+ return drawDiamond(p, element.width, element.height);
+ },
+ 'bpmn:SequenceFlow': function(p, element) {
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ strokeLinejoin: 'round',
+ markerEnd: marker('sequenceflow-end')
+ });
+
+ var sequenceFlow = getSemantic(element);
+ var source = element.source.businessObject;
+
+ // conditional flow marker
+ if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
+ path.attr({
+ markerStart: marker('conditional-flow-marker')
+ });
+ }
+
+ // default marker
+ if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
+ path.attr({
+ markerStart: marker('conditional-default-flow-marker')
+ });
+ }
+
+ return path;
+ },
+ 'bpmn:Association': function(p, element, attrs) {
+
+ attrs = assign({
+ strokeDasharray: '1,6',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round'
+ }, attrs || {});
+
+ // TODO(nre): style according to directed state
+ return drawLine(p, element.waypoints, attrs);
+ },
+ 'bpmn:DataInputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:DataOutputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:MessageFlow': function(p, element) {
+
+ var semantic = getSemantic(element),
+ di = getDi(element);
+
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ markerEnd: marker('messageflow-end'),
+ markerStart: marker('messageflow-start'),
+ strokeDasharray: '10, 12',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round',
+ strokeWidth: '1.5px'
+ });
+
+ if (semantic.messageRef) {
+ var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
+
+ var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
+ abspos: {
+ x: midPoint.x,
+ y: midPoint.y
+ }
+ });
+
+ var messageAttrs = { strokeWidth: 1 };
+
+ if (di.messageVisibleKind === 'initiating') {
+ messageAttrs.fill = 'white';
+ messageAttrs.stroke = 'black';
+ } else {
+ messageAttrs.fill = '#888';
+ messageAttrs.stroke = 'white';
+ }
+
+ drawPath(p, markerPathData, messageAttrs);
+ }
+
+ return path;
+ },
+ 'bpmn:DataObject': function(p, element) {
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var elementObject = drawPath(p, pathData, { fill: 'white' });
+
+ var semantic = getSemantic(element);
+
+ if (isCollection(semantic)) {
+ renderDataItemCollection(p, element);
+ }
+
+ return elementObject;
+ },
+ 'bpmn:DataObjectReference': as('bpmn:DataObject'),
+ 'bpmn:DataInput': function(p, element) {
+
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });
+
+ return elementObject;
+ },
+ 'bpmn:DataOutput': function(p, element) {
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* output arrow path */ drawPath(p, arrowPathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return elementObject;
+ },
+ 'bpmn:DataStoreReference': function(p, element) {
+ var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0,
+ my: 0.133
+ }
+ });
+
+ var elementStore = drawPath(p, DATA_STORE_PATH, {
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return elementStore;
+ },
+ 'bpmn:BoundaryEvent': function(p, element) {
+
+ var semantic = getSemantic(element),
+ cancel = semantic.cancelActivity;
+
+ var attrs = {
+ strokeLinecap: 'round',
+ strokeWidth: 1
+ };
+
+ if (!cancel) {
+ attrs.strokeDasharray = '6';
+ }
+
+ var outer = renderer('bpmn:Event')(p, element, attrs);
+ /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:Group': function(p, element) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
+ strokeWidth: 1,
+ strokeDasharray: '8,3,1,3',
+ fill: 'none',
+ pointerEvents: 'none'
+ });
+ },
+ 'label': function(p, element) {
+ return renderExternalLabel(p, element, '');
+ },
+ 'bpmn:TextAnnotation': function(p, element) {
+ var style = {
+ 'fill': 'none',
+ 'stroke': 'none'
+ };
+ var textElement = drawRect(p, element.width, element.height, 0, 0, style);
+ var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.0,
+ my: 0.0
+ }
+ });
+ drawPath(p, textPathData);
+
+ var text = getSemantic(element).text || '';
+ renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });
+
+ return textElement;
+ },
+ 'ParticipantMultiplicityMarker': function(p, element) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'SubProcessMarker': function(p, element) {
+ var markerRect = drawRect(p, 14, 14, 0, {
+ strokeWidth: 1
+ });
+
+ // Process marker is placed in the middle of the box
+ // therefore fixed values can be used here
+ markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
+
+ var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
+ xScaleFactor: 1.5,
+ yScaleFactor: 1.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: (element.width / 2 - 7.5) / element.width,
+ my: (element.height - 20) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'ParallelMarker': function(p, element, position) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.parallel) / element.width),
+ my: (element.height - 20) / element.height
+ }
+ });
+ drawPath(p, subProcessPath);
+ },
+ 'SequentialMarker': function(p, element, position) {
+ var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.seq) / element.width),
+ my: (element.height - 19) / element.height
+ }
+ });
+ drawPath(p, sequentialPath);
+ },
+ 'CompensationMarker': function(p, element, position) {
+ var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.compensation) / element.width),
+ my: (element.height - 13) / element.height
+ }
+ });
+ drawPath(p, compensationPath, { strokeWidth: 1 });
+ },
+ 'LoopMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.loop) / element.width),
+ my: (element.height - 7) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'none',
+ strokeLinecap: 'round',
+ strokeMiterlimit: 0.5
+ });
+ },
+ 'AdhocMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.adhoc) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+ };
+
+ function attachTaskMarkers(p, element, taskMarkers) {
+ var obj = getSemantic(element);
+
+ var subprocess = includes(taskMarkers, 'SubProcessMarker');
+ var position;
+
+ if (subprocess) {
+ position = {
+ seq: -21,
+ parallel: -22,
+ compensation: -42,
+ loop: -18,
+ adhoc: 10
+ };
+ } else {
+ position = {
+ seq: -3,
+ parallel: -6,
+ compensation: -27,
+ loop: 0,
+ adhoc: 10
+ };
+ }
+
+ forEach(taskMarkers, function(marker) {
+ renderer(marker)(p, element, position);
+ });
+
+ if (obj.$type === 'bpmn:AdHocSubProcess') {
+ renderer('AdhocMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
+ renderer('LoopMarker')(p, element, position);
+ return;
+ }
+ if (obj.loopCharacteristics &&
+ obj.loopCharacteristics.isSequential !== undefined &&
+ !obj.loopCharacteristics.isSequential) {
+ renderer('ParallelMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
+ renderer('SequentialMarker')(p, element, position);
+ }
+ if (!!obj.isForCompensation) {
+ renderer('CompensationMarker')(p, element, position);
+ }
+ }
+
+ function drawShape(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function drawConnection(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function renderDataItemCollection(p, element) {
+
+ var yPosition = (element.height - 16) / element.height;
+
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.451,
+ my: yPosition
+ }
+ });
+
+ /* collection path */ drawPath(p, pathData, {
+ strokeWidth: 2
+ });
+ }
+
+ function isCollection(element, filter) {
+ return element.isCollection ||
+ (element.elementObjectRef && element.elementObjectRef.isCollection);
+ }
+
+ function getDi(element) {
+ return element.businessObject.di;
+ }
+
+ function getSemantic(element) {
+ return element.businessObject;
+ }
+
+ /**
+ * Checks if eventDefinition of the given element matches with semantic type.
+ *
+ * @return {boolean} true if element is of the given semantic type
+ */
+ function isTypedEvent(event, eventDefinitionType, filter) {
+
+ function matches(definition, filter) {
+ return every(filter, function(val, key) {
+
+ // we want a == conversion here, to be able to catch
+ // undefined == false and friends
+ /* jshint -W116 */
+ return definition[key] == val;
+ });
+ }
+
+ return some(event.eventDefinitions, function(definition) {
+ return definition.$type === eventDefinitionType && matches(event, filter);
+ });
+ }
+
+ function isThrowEvent(event) {
+ return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
+ }
+
+
+ /////// cropping path customizations /////////////////////////
+
+ function componentsToPath(elements) {
+ return elements.join(',').replace(/,?([A-z]),?/g, '$1');
+ }
+
+ function getCirclePath(shape) {
+
+ var cx = shape.x + shape.width / 2,
+ cy = shape.y + shape.height / 2,
+ radius = shape.width / 2;
+
+ var circlePath = [
+ ['M', cx, cy],
+ ['m', 0, -radius],
+ ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
+ ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
+ ['z']
+ ];
+
+ return componentsToPath(circlePath);
+ }
+
+ function getRoundRectPath(shape) {
+
+ var radius = TASK_BORDER_RADIUS,
+ x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var roundRectPath = [
+ ['M', x + radius, y],
+ ['l', width - radius * 2, 0],
+ ['a', radius, radius, 0, 0, 1, radius, radius],
+ ['l', 0, height - radius * 2],
+ ['a', radius, radius, 0, 0, 1, -radius, radius],
+ ['l', radius * 2 - width, 0],
+ ['a', radius, radius, 0, 0, 1, -radius, -radius],
+ ['l', 0, radius * 2 - height],
+ ['a', radius, radius, 0, 0, 1, radius, -radius],
+ ['z']
+ ];
+
+ return componentsToPath(roundRectPath);
+ }
+
+ function getDiamondPath(shape) {
+
+ var width = shape.width,
+ height = shape.height,
+ x = shape.x,
+ y = shape.y,
+ halfWidth = width / 2,
+ halfHeight = height / 2;
+
+ var diamondPath = [
+ ['M', x + halfWidth, y],
+ ['l', halfWidth, halfHeight],
+ ['l', -halfWidth, halfHeight],
+ ['l', -halfWidth, -halfHeight],
+ ['z']
+ ];
+
+ return componentsToPath(diamondPath);
+ }
+
+ function getRectPath(shape) {
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var rectPath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(rectPath);
+ }
+
+ function getShapePath(element) {
+ var obj = getSemantic(element);
+
+ if (obj.$instanceOf('bpmn:Event')) {
+ return getCirclePath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Activity')) {
+ return getRoundRectPath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Gateway')) {
+ return getDiamondPath(element);
+ }
+
+ return getRectPath(element);
+ }
+
+
+ // hook onto canvas init event to initialize
+ // connection start/end markers on svg
+ events.on('canvas.init', function(event) {
+ initMarkers(event.svg);
+ });
+
+ this.drawShape = drawShape;
+ this.drawConnection = drawConnection;
+
+ this.getShapePath = getShapePath;
+}
+
+inherits(BpmnRenderer, DefaultRenderer);
+
+
+BpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];
+
+module.exports = BpmnRenderer;
+
+},{"184":184,"195":195,"201":201,"204":204,"206":206,"210":210,"316":316,"320":320,"325":325,"45":45,"84":84}],5:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(188);
+
+/**
+ * Map containing SVG paths needed by BpmnRenderer.
+ */
+
+function PathMap() {
+
+ /**
+ * Contains a map of path elements
+ *
+ * <h1>Path definition</h1>
+ * A parameterized path is defined like this:
+ * <pre>
+ * 'GATEWAY_PARALLEL': {
+ * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ * height: 17.5,
+ * width: 17.5,
+ * heightElements: [2.5, 7.5],
+ * widthElements: [2.5, 7.5]
+ * }
+ * </pre>
+ * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
+ * is based on the ratio between the specified height and width in this object and the
+ * height and width that is set as scale target (Note x,y coordinates will be scaled with
+ * individual ratios).</p>
+ * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
+ * The scaling is based on the computed ratios.
+ * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
+ * the computed ratio coefficient.
+ * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
+ * <ul>
+ * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
+ * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
+ * </ul>
+ * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
+ * </p>
+ */
+ this.pathMap = {
+ 'EVENT_MESSAGE': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 36,
+ width: 36,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'EVENT_SIGNAL': {
+ d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
+ height: 36,
+ width: 36,
+ heightElements: [18],
+ widthElements: [10, 20]
+ },
+ 'EVENT_ESCALATION': {
+ d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +
+ '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',
+ height: 36,
+ width: 36,
+ heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
+ widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
+ },
+ 'EVENT_CONDITIONAL': {
+ d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
+ 'M {e.x2},{e.y3} l {e.x0},0 ' +
+ 'M {e.x2},{e.y4} l {e.x0},0 ' +
+ 'M {e.x2},{e.y5} l {e.x0},0 ' +
+ 'M {e.x2},{e.y6} l {e.x0},0 ' +
+ 'M {e.x2},{e.y7} l {e.x0},0 ' +
+ 'M {e.x2},{e.y8} l {e.x0},0 ',
+ height: 36,
+ width: 36,
+ heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
+ widthElements: [10.5, 14.5, 12.5]
+ },
+ 'EVENT_LINK': {
+ d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
+ height: 36,
+ width: 36,
+ heightElements: [4.4375, 6.75, 7.8125],
+ widthElements: [9.84375, 13.5]
+ },
+ 'EVENT_ERROR': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
+ height: 36,
+ width: 36,
+ heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
+ widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
+ },
+ 'EVENT_CANCEL_45': {
+ d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [4.75, 8.5],
+ widthElements: [4.75, 8.5]
+ },
+ 'EVENT_COMPENSATION': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
+ height: 36,
+ width: 36,
+ heightElements: [5, 10],
+ widthElements: [10]
+ },
+ 'EVENT_TIMER_WH': {
+ d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 2],
+ widthElements: [3, 7]
+ },
+ 'EVENT_TIMER_LINE': {
+ d: 'M {mx},{my} ' +
+ 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 3],
+ widthElements: [0, 0]
+ },
+ 'EVENT_MULTIPLE': {
+ d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [6.28099, 12.56199],
+ widthElements: [3.1405, 9.42149, 12.56198]
+ },
+ 'EVENT_PARALLEL_MULTIPLE': {
+ d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [2.56228, 7.68683],
+ widthElements: [2.56228, 7.68683]
+ },
+ 'GATEWAY_EXCLUSIVE': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
+ '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
+ '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
+ height: 17.5,
+ width: 17.5,
+ heightElements: [8.5, 6.5312, -6.5312, -8.5],
+ widthElements: [6.5, -6.5, 3, -3, 5, -5]
+ },
+ 'GATEWAY_PARALLEL': {
+ d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 30,
+ width: 30,
+ heightElements: [5, 12.5],
+ widthElements: [5, 12.5]
+ },
+ 'GATEWAY_EVENT_BASED': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
+ height: 11,
+ width: 11,
+ heightElements: [-6, 6, 12, -12],
+ widthElements: [9, -3, -12]
+ },
+ 'GATEWAY_COMPLEX': {
+ d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
+ '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
+ '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
+ '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
+ height: 17.125,
+ width: 17.125,
+ heightElements: [4.875, 3.4375, 2.125, 3],
+ widthElements: [3.4375, 2.125, 4.875, 3]
+ },
+ 'DATA_OBJECT_PATH': {
+ d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
+ height: 61,
+ width: 51,
+ heightElements: [10, 50, 60],
+ widthElements: [10, 40, 50, 60]
+ },
+ 'DATA_OBJECT_COLLECTION_PATH': {
+ d:'m {mx}, {my} ' +
+ 'm 0 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ',
+ height: 61,
+ width: 51,
+ heightElements: [12],
+ widthElements: [1, 6, 12, 15]
+ },
+ 'DATA_ARROW': {
+ d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
+ height: 61,
+ width: 51,
+ heightElements: [],
+ widthElements: []
+ },
+ 'DATA_STORE': {
+ d:'m {mx},{my} ' +
+ 'l 0,{e.y2} ' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'l 0,-{e.y2} ' +
+ 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
+ height: 61,
+ width: 61,
+ heightElements: [7, 10, 45],
+ widthElements: [2, 58, 60]
+ },
+ 'TEXT_ANNOTATION': {
+ d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
+ height: 30,
+ width: 10,
+ heightElements: [30],
+ widthElements: [10]
+ },
+ 'MARKER_SUB_PROCESS': {
+ d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_PARALLEL': {
+ d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_SEQUENTIAL': {
+ d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_COMPENSATION': {
+ d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
+ height: 10,
+ width: 21,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_LOOP': {
+ d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
+ '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
+ '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
+ 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
+ height: 13.9,
+ width: 13.7,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_ADHOC': {
+ d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
+ '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
+ '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
+ '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
+ '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
+ height: 4,
+ width: 15,
+ heightElements: [],
+ widthElements: []
+ },
+ 'TASK_TYPE_SEND': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 14,
+ width: 21,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_SCRIPT': {
+ d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
+ 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
+ 'm -7,-12 l 5,0 ' +
+ 'm -4.5,3 l 4.5,0 ' +
+ 'm -3,3 l 5,0' +
+ 'm -4,3 l 5,0',
+ height: 15,
+ width: 12.6,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_USER_1': {
+ d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
+ '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
+ '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
+ 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
+ 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
+ },
+ 'TASK_TYPE_USER_2': {
+ d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
+ '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
+ },
+ 'TASK_TYPE_USER_3': {
+ d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
+ '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
+ '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
+ },
+ 'TASK_TYPE_MANUAL': {
+ d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
+ '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
+ '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
+ '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
+ '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
+ '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
+ '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
+ '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
+ '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
+ '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
+ '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
+ '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
+ },
+ 'TASK_TYPE_INSTANTIATING_SEND': {
+ d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
+ },
+ 'TASK_TYPE_SERVICE': {
+ d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
+ '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
+ '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
+ 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
+ '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
+ '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
+ 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
+ '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
+ 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
+ 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
+ '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
+ 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
+ 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_SERVICE_FILL': {
+ d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_HEADER': {
+ d: 'm {mx},{my} 0,4 20,0 0,-4 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_MAIN': {
+ d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
+ 'm 0,8 l 20,0 ' +
+ 'm -13,-4 l 0,8'
+ },
+ 'MESSAGE_FLOW_MARKER': {
+ d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
+ }
+ };
+
+ this.getRawPath = function getRawPath(pathId) {
+ return this.pathMap[pathId].d;
+ };
+
+ /**
+ * Scales the path to the given height and width.
+ * <h1>Use case</h1>
+ * <p>Use case is to scale the content of elements (event, gateways) based
+ * on the element bounding box's size.
+ * </p>
+ * <h1>Why not transform</h1>
+ * <p>Scaling a path with transform() will also scale the stroke and IE does not support
+ * the option 'non-scaling-stroke' to prevent this.
+ * Also there are use cases where only some parts of a path should be
+ * scaled.</p>
+ *
+ * @param {String} pathId The ID of the path.
+ * @param {Object} param <p>
+ * Example param object scales the path to 60% size of the container (data.width, data.height).
+ * <pre>
+ * {
+ * xScaleFactor: 0.6,
+ * yScaleFactor:0.6,
+ * containerWidth: data.width,
+ * containerHeight: data.height,
+ * position: {
+ * mx: 0.46,
+ * my: 0.2,
+ * }
+ * }
+ * </pre>
+ * <ul>
+ * <li>targetpathwidth = xScaleFactor * containerWidth</li>
+ * <li>targetpathheight = yScaleFactor * containerHeight</li>
+ * <li>Position is used to set the starting coordinate of the path. M is computed:
+ * <ul>
+ * <li>position.x * containerWidth</li>
+ * <li>position.y * containerHeight</li>
+ * </ul>
+ * Center of the container <pre> position: {
+ * mx: 0.5,
+ * my: 0.5,
+ * }</pre>
+ * Upper left corner of the container
+ * <pre> position: {
+ * mx: 0.0,
+ * my: 0.0,
+ * }</pre>
+ * </li>
+ * </ul>
+ * </p>
+ *
+ */
+ this.getScaledPath = function getScaledPath(pathId, param) {
+ var rawPath = this.pathMap[pathId];
+
+ // positioning
+ // compute the start point of the path
+ var mx, my;
+
+ if(!!param.abspos) {
+ mx = param.abspos.x;
+ my = param.abspos.y;
+ } else {
+ mx = param.containerWidth * param.position.mx;
+ my = param.containerHeight * param.position.my;
+ }
+
+ var coordinates = {}; //map for the scaled coordinates
+ if(param.position) {
+
+ // path
+ var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
+ var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
+
+
+ //Apply height ratio
+ for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
+ coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
+ }
+
+ //Apply width ratio
+ for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
+ coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
+ }
+ }
+
+ //Apply value to raw path
+ var path = Snap.format(
+ rawPath.d, {
+ mx: mx,
+ my: my,
+ e: coordinates
+ }
+ );
+ return path;
+ };
+}
+
+module.exports = PathMap;
+
+},{"188":188}],6:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(4) ],
+ pathMap: [ 'type', _dereq_(5) ]
+};
+},{"4":4,"5":5}],7:[function(_dereq_,module,exports){
+'use strict';
+
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+
+/**
+ * A provider for BPMN 2.0 elements context pad
+ */
+function ContextPadProvider(contextPad, modeling, elementFactory,
+ connect, create, bpmnReplace,
+ canvas) {
+
+ contextPad.registerProvider(this);
+
+ this._contextPad = contextPad;
+
+ this._modeling = modeling;
+
+ this._elementFactory = elementFactory;
+ this._connect = connect;
+ this._create = create;
+ this._bpmnReplace = bpmnReplace;
+ this._canvas = canvas;
+}
+
+ContextPadProvider.$inject = [
+ 'contextPad',
+ 'modeling',
+ 'elementFactory',
+ 'connect',
+ 'create',
+ 'bpmnReplace',
+ 'canvas'
+];
+
+ContextPadProvider.prototype.getContextPadEntries = function(element) {
+
+ var contextPad = this._contextPad,
+ modeling = this._modeling,
+
+ elementFactory = this._elementFactory,
+ connect = this._connect,
+ create = this._create,
+ bpmnReplace = this._bpmnReplace,
+ canvas = this._canvas;
+
+ var actions = {};
+
+ if (element.type === 'label') {
+ return actions;
+ }
+
+ var bpmnElement = element.businessObject;
+
+ function startConnect(event, element, autoActivate) {
+ connect.start(event, element, autoActivate);
+ }
+
+ function removeElement(e) {
+ if (element.waypoints) {
+ modeling.removeConnection(element);
+ } else {
+ modeling.removeShape(element);
+ }
+ }
+
+ function getReplaceMenuPosition(element) {
+
+ var Y_OFFSET = 5;
+
+ var diagramContainer = canvas.getContainer(),
+ pad = contextPad.getPad(element).html;
+
+ var diagramRect = diagramContainer.getBoundingClientRect(),
+ padRect = pad.getBoundingClientRect();
+
+ var top = padRect.top - diagramRect.top;
+ var left = padRect.left - diagramRect.left;
+
+ var pos = {
+ x: left,
+ y: top + padRect.height + Y_OFFSET
+ };
+
+ return pos;
+ }
+
+
+ function appendAction(type, className, options) {
+
+ function appendListener(event, element) {
+
+ var shape = elementFactory.createShape(assign({ type: type }, options));
+ create.start(event, shape, element);
+ }
+
+ var shortType = type.replace(/^bpmn\:/, '');
+
+ return {
+ group: 'model',
+ className: className,
+ title: 'Append ' + shortType,
+ action: {
+ dragstart: appendListener,
+ click: appendListener
+ }
+ };
+ }
+
+ if (bpmnElement.$instanceOf('bpmn:FlowNode')) {
+
+ if (!bpmnElement.$instanceOf('bpmn:EndEvent') &&
+ !bpmnElement.$instanceOf('bpmn:EventBasedGateway') &&
+ !isEventType(bpmnElement, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition')) {
+
+ assign(actions, {
+ 'append.end-event': appendAction('bpmn:EndEvent', 'icon-end-event-none'),
+ 'append.gateway': appendAction('bpmn:ExclusiveGateway', 'icon-gateway-xor'),
+ 'append.append-task': appendAction('bpmn:Task', 'icon-task'),
+ 'append.intermediate-event': appendAction('bpmn:IntermediateThrowEvent',
+ 'icon-intermediate-event-none')
+ });
+ }
+
+ if (bpmnElement.$instanceOf('bpmn:EventBasedGateway')) {
+
+ assign(actions, {
+ 'append.receive-task': appendAction('bpmn:ReceiveTask', 'icon-receive-task'),
+ 'append.message-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
+ 'icon-intermediate-event-catch-message',
+ { _eventDefinitionType: 'bpmn:MessageEventDefinition'}),
+ 'append.timer-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
+ 'icon-intermediate-event-catch-timer',
+ { _eventDefinitionType: 'bpmn:TimerEventDefinition'}),
+ 'append.condtion-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
+ 'icon-intermediate-event-catch-condition',
+ { _eventDefinitionType: 'bpmn:ConditionalEventDefinition'}),
+ 'append.signal-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
+ 'icon-intermediate-event-catch-signal',
+ { _eventDefinitionType: 'bpmn:SignalEventDefinition'})
+ });
+ }
+
+
+ // Replace menu entry
+ if (!bpmnElement.$instanceOf('bpmn:SubProcess')) {
+ assign(actions, {
+ 'replace': {
+ group: 'edit',
+ className: 'icon-screw-wrench',
+ title: 'Change type',
+ action: {
+ click: function(event, element) {
+ bpmnReplace.openChooser(getReplaceMenuPosition(element), element);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
+ bpmnElement.$instanceOf('bpmn:InteractionNode')) {
+
+ assign(actions, {
+ 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
+
+ 'connect': {
+ group: 'connect',
+ className: 'icon-connection-multi',
+ title: 'Connect using Sequence/MessageFlow',
+ action: {
+ click: startConnect,
+ dragstart: startConnect
+ }
+ }
+ });
+ }
+
+ // Delete Element Entry
+ assign(actions, {
+ 'delete': {
+ group: 'edit',
+ className: 'icon-trash',
+ title: 'Remove',
+ action: {
+ click: removeElement,
+ dragstart: removeElement
+ }
+ }
+ });
+
+ return actions;
+};
+
+function isEventType(eventBo, type, definition) {
+
+ var isType = eventBo.$instanceOf(type);
+ var isDefinition = false;
+
+ var definitions = eventBo.eventDefinitions || [];
+ forEach(definitions, function(def) {
+ if (def.$type === definition) {
+ isDefinition = true;
+ }
+ });
+
+ return isType && isDefinition;
+}
+
+
+module.exports = ContextPadProvider;
+
+},{"204":204,"325":325}],8:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(70),
+ _dereq_(97),
+ _dereq_(151),
+ _dereq_(95),
+ _dereq_(99),
+ _dereq_(37)
+ ],
+ __init__: [ 'contextPadProvider' ],
+ contextPadProvider: [ 'type', _dereq_(7) ]
+};
+},{"151":151,"37":37,"7":7,"70":70,"95":95,"97":97,"99":99}],9:[function(_dereq_,module,exports){
+'use strict';
+
+
+function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
+
+ keyboard.addListener(function(key, modifiers) {
+
+ if (keyboard.hasModifier(modifiers)) {
+ return;
+ }
+
+ // S -> activate space tool
+ if (key === 83) {
+ spaceTool.activateSelection();
+
+ return true;
+ }
+
+ // L -> activate lasso tool
+ if (key === 108) {
+ lassoTool.activateSelection();
+
+ return true;
+ }
+
+ var currentSelection = selection.get();
+
+ // E -> activate direct editing
+ if (key === 69) {
+ if (currentSelection.length) {
+ directEditing.activate(currentSelection[0]);
+ }
+
+ return true;
+ }
+ });
+}
+
+BpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ];
+
+module.exports = BpmnKeyBindings;
+},{}],10:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(105)
+ ],
+ __init__: [ 'bpmnKeyBindings' ],
+ bpmnKeyBindings: [ 'type', _dereq_(9) ]
+};
+},{"105":105,"9":9}],11:[function(_dereq_,module,exports){
+'use strict';
+
+var UpdateLabelHandler = _dereq_(13);
+
+var LabelUtil = _dereq_(12);
+
+var is = _dereq_(47).is,
+ isExpanded = _dereq_(45).isExpanded;
+
+
+var MIN_BOUNDS = {
+ width: 150,
+ height: 50
+};
+
+
+function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
+
+ directEditing.registerProvider(this);
+ commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
+
+ // listen to dblclick on non-root elements
+ eventBus.on('element.dblclick', function(event) {
+ directEditing.activate(event.element);
+ });
+
+ // complete on followup canvas operation
+ eventBus.on([ 'element.mousedown', 'drag.activate', 'canvas.viewbox.changed' ], function(event) {
+ directEditing.complete();
+ });
+
+ // cancel on command stack changes
+ eventBus.on([ 'commandStack.changed' ], function() {
+ directEditing.cancel();
+ });
+
+
+ // activate direct editing for activities and text annotations
+
+
+ if ('ontouchstart' in document.documentElement) {
+ // we deactivate automatic label editing on mobile devices
+ // as it breaks the user interaction workflow
+
+ // TODO(nre): we should temporarily focus the edited element here
+ // and release the focused viewport after the direct edit operation is finished
+ } else {
+ eventBus.on('create.end', 500, function(e) {
+
+ var element = e.shape,
+ canExecute = e.context.canExecute;
+
+ if (!canExecute) {
+ return;
+ }
+
+ if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
+ (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
+
+ directEditing.activate(element);
+ }
+ });
+ }
+
+ this._canvas = canvas;
+ this._commandStack = commandStack;
+}
+
+LabelEditingProvider.$inject = [ 'eventBus', 'canvas', 'directEditing', 'commandStack', 'injector' ];
+
+module.exports = LabelEditingProvider;
+
+
+LabelEditingProvider.prototype.activate = function(element) {
+
+ var text = LabelUtil.getLabel(element);
+
+ if (text === undefined) {
+ return;
+ }
+
+ var bbox = this.getEditingBBox(element);
+
+ // adjust for expanded pools AND lanes
+ if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
+
+ bbox.width = MIN_BOUNDS.width;
+ bbox.height = MIN_BOUNDS.height;
+
+ bbox.x = bbox.x + 10 - bbox.width / 2;
+ bbox.y = bbox.mid.y - bbox.height / 2;
+ }
+
+ // adjust for expanded sub processes
+ if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
+
+ bbox.height = MIN_BOUNDS.height;
+
+ bbox.x = bbox.mid.x - bbox.width / 2;
+ bbox.y = bbox.y + 10 - bbox.height / 2;
+ }
+
+ return { bounds: bbox, text: text };
+};
+
+
+LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
+
+ var target = element.label || element;
+
+ var bbox = this._canvas.getAbsoluteBBox(target);
+
+ var mid = {
+ x: bbox.x + bbox.width / 2,
+ y: bbox.y + bbox.height / 2
+ };
+
+ // external label
+ if (target.labelTarget) {
+ bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
+ bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
+
+ bbox.x = mid.x - bbox.width / 2;
+ }
+
+ bbox.mid = mid;
+
+ return bbox;
+};
+
+
+LabelEditingProvider.prototype.update = function(element, newLabel) {
+ this._commandStack.execute('element.updateLabel', {
+ element: element,
+ newLabel: newLabel
+ });
+};
+},{"12":12,"13":13,"45":45,"47":47}],12:[function(_dereq_,module,exports){
+'use strict';
+
+function getLabelAttr(semantic) {
+ if (semantic.$instanceOf('bpmn:FlowElement') ||
+ semantic.$instanceOf('bpmn:Participant') ||
+ semantic.$instanceOf('bpmn:Lane') ||
+ semantic.$instanceOf('bpmn:SequenceFlow') ||
+ semantic.$instanceOf('bpmn:MessageFlow')) {
+ return 'name';
+ }
+
+ if (semantic.$instanceOf('bpmn:TextAnnotation')) {
+ return 'text';
+ }
+}
+
+module.exports.getLabel = function(element) {
+ var semantic = element.businessObject,
+ attr = getLabelAttr(semantic);
+
+ if (attr) {
+ return semantic[attr] || '';
+ }
+};
+
+
+module.exports.setLabel = function(element, text) {
+ var semantic = element.businessObject,
+ attr = getLabelAttr(semantic);
+
+ if (attr) {
+ semantic[attr] = text;
+ }
+
+ var label = element.label || element;
+
+ // show label
+ label.hidden = false;
+
+ return label;
+};
+},{}],13:[function(_dereq_,module,exports){
+'use strict';
+
+var LabelUtil = _dereq_(12);
+
+
+/**
+ * A handler that updates the text of a BPMN element.
+ *
+ * @param {EventBus} eventBus
+ */
+function UpdateTextHandler(eventBus) {
+
+ function setText(element, text) {
+ var label = LabelUtil.setLabel(element, text);
+
+ eventBus.fire('element.changed', { element: label });
+ }
+
+ function execute(ctx) {
+ ctx.oldLabel = LabelUtil.getLabel(ctx.element);
+ return setText(ctx.element, ctx.newLabel);
+ }
+
+ function revert(ctx) {
+ return setText(ctx.element, ctx.oldLabel);
+ }
+
+
+ function canExecute(ctx) {
+ return true;
+ }
+
+ // API
+
+ this.execute = execute;
+ this.revert = revert;
+
+ this.canExecute = canExecute;
+}
+
+
+UpdateTextHandler.$inject = [ 'eventBus' ];
+
+module.exports = UpdateTextHandler;
+},{"12":12}],14:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(77),
+ _dereq_(93),
+ _dereq_(70)
+ ],
+ __init__: [ 'labelEditingProvider' ],
+ labelEditingProvider: [ 'type', _dereq_(11) ]
+};
+},{"11":11,"70":70,"77":77,"93":93}],15:[function(_dereq_,module,exports){
+'use strict';
+
+var map = _dereq_(207),
+ assign = _dereq_(325),
+ pick = _dereq_(330);
+
+
+function BpmnFactory(moddle) {
+ this._model = moddle;
+}
+
+BpmnFactory.$inject = [ 'moddle' ];
+
+
+BpmnFactory.prototype._needsId = function(element) {
+ return element.$instanceOf('bpmn:RootElement') ||
+ element.$instanceOf('bpmn:FlowElement') ||
+ element.$instanceOf('bpmn:MessageFlow') ||
+ element.$instanceOf('bpmn:Artifact') ||
+ element.$instanceOf('bpmn:Participant') ||
+ element.$instanceOf('bpmn:Process') ||
+ element.$instanceOf('bpmn:Collaboration') ||
+ element.$instanceOf('bpmndi:BPMNShape') ||
+ element.$instanceOf('bpmndi:BPMNEdge') ||
+ element.$instanceOf('bpmndi:BPMNDiagram') ||
+ element.$instanceOf('bpmndi:BPMNPlane');
+};
+
+BpmnFactory.prototype._ensureId = function(element) {
+
+ // generate semantic ids for elements
+ // bpmn:SequenceFlow -> SequenceFlow_ID
+ var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
+
+ if (!element.id && this._needsId(element)) {
+ element.id = this._model.ids.nextPrefixed(prefix, element);
+ }
+};
+
+
+BpmnFactory.prototype.create = function(type, attrs) {
+ var element = this._model.create(type, attrs || {});
+
+ this._ensureId(element);
+
+ return element;
+};
+
+
+BpmnFactory.prototype.createDiLabel = function() {
+ return this.create('bpmndi:BPMNLabel', {
+ bounds: this.createDiBounds()
+ });
+};
+
+
+BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
+
+ return this.create('bpmndi:BPMNShape', assign({
+ bpmnElement: semantic,
+ bounds: this.createDiBounds(bounds)
+ }, attrs));
+};
+
+
+BpmnFactory.prototype.createDiBounds = function(bounds) {
+ return this.create('dc:Bounds', bounds);
+};
+
+
+BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
+ return map(waypoints, function(pos) {
+ return this.createDiWaypoint(pos);
+ }, this);
+};
+
+BpmnFactory.prototype.createDiWaypoint = function(point) {
+ return this.create('dc:Point', pick(point, [ 'x', 'y' ]));
+};
+
+
+BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
+ return this.create('bpmndi:BPMNEdge', assign({
+ bpmnElement: semantic
+ }, attrs));
+};
+
+BpmnFactory.prototype.createDiPlane = function(semantic) {
+ return this.create('bpmndi:BPMNPlane', {
+ bpmnElement: semantic
+ });
+};
+
+module.exports = BpmnFactory;
+
+},{"207":207,"325":325,"330":330}],16:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var assign = _dereq_(325);
+
+var BaseLayouter = _dereq_(164),
+ LayoutUtil = _dereq_(166),
+ ManhattanLayout = _dereq_(167);
+
+var is = _dereq_(47).is;
+
+
+function BpmnLayouter() {}
+
+inherits(BpmnLayouter, BaseLayouter);
+
+module.exports = BpmnLayouter;
+
+
+function getAttachment(waypoints, idx, shape) {
+ var point = waypoints && waypoints[idx];
+
+ return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
+}
+
+
+BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
+ var source = connection.source,
+ target = connection.target,
+ waypoints = connection.waypoints,
+ start,
+ end;
+
+ var layoutManhattan,
+ updatedWaypoints;
+
+ start = getAttachment(waypoints, 0, source);
+ end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
+
+ // manhattan layout sequence / message flows
+ if (is(connection, 'bpmn:MessageFlow')) {
+ layoutManhattan = {
+ preferStraight: true,
+ preferVertical: true
+ };
+ }
+
+ if (is(connection, 'bpmn:SequenceFlow')) {
+ layoutManhattan = {};
+ }
+
+ if (layoutManhattan) {
+
+ layoutManhattan = assign(layoutManhattan, hints);
+
+ updatedWaypoints =
+ ManhattanLayout.repairConnection(
+ source, target, start, end,
+ waypoints,
+ layoutManhattan);
+ }
+
+ return updatedWaypoints || [ start, end ];
+};
+},{"164":164,"166":166,"167":167,"195":195,"325":325,"47":47}],17:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204),
+ inherits = _dereq_(195);
+
+var Collections = _dereq_(175),
+ Model = _dereq_(168);
+
+var CommandInterceptor = _dereq_(75);
+
+
+/**
+ * A handler responsible for updating the underlying BPMN 2.0 XML + DI
+ * once changes on the diagram happen
+ */
+function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
+
+ CommandInterceptor.call(this, eventBus);
+
+ this._bpmnFactory = bpmnFactory;
+
+ var self = this;
+
+
+
+ ////// connection cropping /////////////////////////
+
+ // crop connection ends during create/update
+ function cropConnection(e) {
+ var context = e.context,
+ connection;
+
+ if (!context.cropped) {
+ connection = context.connection;
+ connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
+ context.cropped = true;
+ }
+ }
+
+ this.executed([
+ 'connection.layout',
+ 'connection.create',
+ 'connection.reconnectEnd',
+ 'connection.reconnectStart'
+ ], cropConnection);
+
+ this.reverted([ 'connection.layout' ], function(e) {
+ delete e.context.cropped;
+ });
+
+
+
+ ////// BPMN + DI update /////////////////////////
+
+
+ // update parent
+ function updateParent(e) {
+ self.updateParent(e.context.shape || e.context.connection);
+ }
+
+ this.executed([ 'shape.move',
+ 'shape.create',
+ 'shape.delete',
+ 'connection.create',
+ 'connection.move',
+ 'connection.delete' ], updateParent);
+ this.reverted([ 'shape.move',
+ 'shape.create',
+ 'shape.delete',
+ 'connection.create',
+ 'connection.move',
+ 'connection.delete' ], updateParent);
+
+ /*
+ * ## Updating Parent
+ *
+ * When morphing a Process into a Collaboration or vice-versa,
+ * make sure that both the *semantic* and *di* parent of each element
+ * is updated.
+ *
+ */
+ function updateRoot(event) {
+ var context = event.context,
+ oldRoot = context.oldRoot,
+ children = oldRoot.children;
+
+ forEach(children, function(child) {
+ self.updateParent(child);
+ });
+ }
+
+ this.executed([ 'canvas.updateRoot' ], updateRoot);
+ this.reverted([ 'canvas.updateRoot' ], updateRoot);
+
+
+ // update bounds
+ function updateBounds(e) {
+ self.updateBounds(e.context.shape);
+ }
+
+ this.executed([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);
+ this.reverted([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);
+
+
+ // attach / detach connection
+ function updateConnection(e) {
+ self.updateConnection(e.context.connection);
+ }
+
+ this.executed([
+ 'connection.create',
+ 'connection.move',
+ 'connection.delete',
+ 'connection.reconnectEnd',
+ 'connection.reconnectStart'
+ ], updateConnection);
+
+ this.reverted([
+ 'connection.create',
+ 'connection.move',
+ 'connection.delete',
+ 'connection.reconnectEnd',
+ 'connection.reconnectStart'
+ ], updateConnection);
+
+
+ // update waypoints
+ function updateConnectionWaypoints(e) {
+ self.updateConnectionWaypoints(e.context.connection);
+ }
+
+ this.executed([
+ 'connection.layout',
+ 'connection.move',
+ 'connection.updateWaypoints',
+ 'connection.reconnectEnd',
+ 'connection.reconnectStart'
+ ], updateConnectionWaypoints);
+
+ this.reverted([
+ 'connection.layout',
+ 'connection.move',
+ 'connection.updateWaypoints',
+ 'connection.reconnectEnd',
+ 'connection.reconnectStart'
+ ], updateConnectionWaypoints);
+}
+
+inherits(BpmnUpdater, CommandInterceptor);
+
+module.exports = BpmnUpdater;
+
+BpmnUpdater.$inject = [ 'eventBus', 'bpmnFactory', 'connectionDocking'];
+
+
+/////// implementation //////////////////////////////////
+
+
+BpmnUpdater.prototype.updateParent = function(element) {
+
+ // do not update BPMN 2.0 label parent
+ if (element instanceof Model.Label) {
+ return;
+ }
+
+ var parentShape = element.parent;
+
+ var businessObject = element.businessObject,
+ parentBusinessObject = parentShape && parentShape.businessObject,
+ parentDi = parentBusinessObject && parentBusinessObject.di;
+
+ this.updateSemanticParent(businessObject, parentBusinessObject);
+
+ this.updateDiParent(businessObject.di, parentDi);
+};
+
+
+BpmnUpdater.prototype.updateBounds = function(shape) {
+
+ var di = shape.businessObject.di;
+
+ var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
+
+ assign(bounds, {
+ x: shape.x,
+ y: shape.y,
+ width: shape.width,
+ height: shape.height
+ });
+};
+
+
+BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
+
+ if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
+ parentDi = parentDi.$parent;
+ }
+
+ if (di.$parent === parentDi) {
+ return;
+ }
+
+ var planeElements = (parentDi || di.$parent).get('planeElement');
+
+ if (parentDi) {
+ planeElements.push(di);
+ di.$parent = parentDi;
+ } else {
+ Collections.remove(planeElements, di);
+ di.$parent = null;
+ }
+};
+
+function getDefinitions(element) {
+ while (element && !element.$instanceOf('bpmn:Definitions')) {
+ element = element.$parent;
+ }
+
+ return element;
+}
+
+BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
+
+ var containment;
+
+ if (businessObject.$parent === newParent) {
+ return;
+ }
+
+ if (businessObject.$instanceOf('bpmn:FlowElement')) {
+
+ if (newParent && newParent.$instanceOf('bpmn:Participant')) {
+ newParent = newParent.processRef;
+ }
+
+ containment = 'flowElements';
+
+ } else
+
+ if (businessObject.$instanceOf('bpmn:Artifact')) {
+
+ while (newParent &&
+ !newParent.$instanceOf('bpmn:Process') &&
+ !newParent.$instanceOf('bpmn:SubProcess') &&
+ !newParent.$instanceOf('bpmn:Collaboration')) {
+
+ if (newParent.$instanceOf('bpmn:Participant')) {
+ newParent = newParent.processRef;
+ break;
+ } else {
+ newParent = newParent.$parent;
+ }
+ }
+
+ containment = 'artifacts';
+ } else
+
+ if (businessObject.$instanceOf('bpmn:MessageFlow')) {
+ containment = 'messageFlows';
+
+ } else
+
+ if (businessObject.$instanceOf('bpmn:Participant')) {
+ containment = 'participants';
+
+ // make sure the participants process is properly attached / detached
+ // from the XML document
+
+ var process = businessObject.processRef,
+ definitions;
+
+ if (process) {
+ definitions = getDefinitions(businessObject.$parent || newParent);
+
+ if (businessObject.$parent) {
+ Collections.remove(definitions.get('rootElements'), process);
+ process.$parent = null;
+ }
+
+ if (newParent) {
+ Collections.add(definitions.get('rootElements'), process);
+ process.$parent = definitions;
+ }
+ }
+ }
+
+ if (!containment) {
+ throw new Error('no parent for ', businessObject, newParent);
+ }
+
+ var children;
+
+ if (businessObject.$parent) {
+ // remove from old parent
+ children = businessObject.$parent.get(containment);
+ Collections.remove(children, businessObject);
+ }
+
+ if (!newParent) {
+ businessObject.$parent = null;
+ } else {
+ // add to new parent
+ children = newParent.get(containment);
+ children.push(businessObject);
+ businessObject.$parent = newParent;
+ }
+};
+
+
+BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
+
+ connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
+};
+
+
+BpmnUpdater.prototype.updateConnection = function(connection) {
+
+ var businessObject = connection.businessObject,
+ newSource = connection.source && connection.source.businessObject,
+ newTarget = connection.target && connection.target.businessObject;
+
+ var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
+
+ if (businessObject.sourceRef !== newSource) {
+ if (inverseSet) {
+ Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
+
+ if (newSource) {
+ newSource.get('outgoing').push(businessObject);
+ }
+ }
+
+ businessObject.sourceRef = newSource;
+ }
+ if (businessObject.targetRef !== newTarget) {
+ if (inverseSet) {
+ Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
+
+ if (newTarget) {
+ newTarget.get('incoming').push(businessObject);
+ }
+ }
+
+ businessObject.targetRef = newTarget;
+ }
+
+ businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
+};
+
+
+/////// helpers /////////////////////////////////////////
+
+BpmnUpdater.prototype._getLabel = function(di) {
+ if (!di.label) {
+ di.label = this._bpmnFactory.createDiLabel();
+ }
+
+ return di.label;
+};
+},{"168":168,"175":175,"195":195,"204":204,"325":325,"75":75}],18:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ inherits = _dereq_(195);
+
+var BaseElementFactory = _dereq_(79),
+ LabelUtil = _dereq_(46);
+
+
+/**
+ * A bpmn-aware factory for diagram-js shapes
+ */
+function ElementFactory(bpmnFactory, moddle) {
+ BaseElementFactory.call(this);
+
+ this._bpmnFactory = bpmnFactory;
+ this._moddle = moddle;
+}
+
+inherits(ElementFactory, BaseElementFactory);
+
+
+ElementFactory.$inject = [ 'bpmnFactory', 'moddle' ];
+
+module.exports = ElementFactory;
+
+ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
+
+ElementFactory.prototype.create = function(elementType, attrs) {
+
+ // no special magic for labels,
+ // we assume their businessObjects have already been created
+ // and wired via attrs
+ if (elementType === 'label') {
+ return this.baseCreate(elementType, assign({ type: 'label' }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
+ }
+
+ attrs = attrs || {};
+
+ var businessObject = attrs.businessObject,
+ size;
+
+ if (!businessObject) {
+ if (!attrs.type) {
+ throw new Error('no shape type specified');
+ }
+
+ businessObject = this._bpmnFactory.create(attrs.type);
+ }
+
+ if (!businessObject.di) {
+ if (elementType === 'root') {
+ businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
+ id: businessObject.id + '_di'
+ });
+ } else
+ if (elementType === 'connection') {
+ businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
+ id: businessObject.id + '_di'
+ });
+ } else {
+ businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
+ id: businessObject.id + '_di'
+ });
+ }
+ }
+
+ if (!!attrs.isExpanded) {
+ businessObject.di.isExpanded = attrs.isExpanded;
+ }
+
+ if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
+ businessObject.di.isMarkerVisible = true;
+ }
+
+ if (attrs._eventDefinitionType) {
+ var eventDefinitions = businessObject.get('eventDefinitions') || [],
+ newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
+
+ eventDefinitions.push(newEventDefinition);
+ businessObject.eventDefinitions = eventDefinitions;
+ }
+
+ size = this._getDefaultSize(businessObject);
+
+ attrs = assign({
+ businessObject: businessObject,
+ id: businessObject.id
+ }, size, attrs);
+
+ return this.baseCreate(elementType, attrs);
+};
+
+
+ElementFactory.prototype._getDefaultSize = function(semantic) {
+
+ if (semantic.$instanceOf('bpmn:SubProcess')) {
+ var isExpanded = semantic.di.isExpanded === true;
+
+ if (isExpanded) {
+ return { width: 350, height: 200 };
+ } else {
+ return { width: 100, height: 80 };
+ }
+ }
+
+ if (semantic.$instanceOf('bpmn:Task')) {
+ return { width: 100, height: 80 };
+ }
+
+ if (semantic.$instanceOf('bpmn:Gateway')) {
+ return { width: 50, height: 50 };
+ }
+
+ if (semantic.$instanceOf('bpmn:Event')) {
+ return { width: 36, height: 36 };
+ }
+
+ if (semantic.$instanceOf('bpmn:Participant')) {
+ return { width: 600, height: 250 };
+ }
+
+ return { width: 100, height: 80 };
+};
+
+
+ElementFactory.prototype.createParticipantShape = function(collapsed) {
+
+ var participantShape = this.createShape({ type: 'bpmn:Participant' });
+
+ if (!collapsed) {
+ participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
+ }
+
+ return participantShape;
+};
+},{"195":195,"325":325,"46":46,"79":79}],19:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+var LabelUtil = _dereq_(46);
+
+var hasExternalLabel = LabelUtil.hasExternalLabel,
+ getExternalLabelMid = LabelUtil.getExternalLabelMid;
+
+
+function LabelSupport(eventBus, modeling, bpmnFactory) {
+
+ // create external labels on shape creation
+
+ eventBus.on([
+ 'commandStack.shape.create.postExecute',
+ 'commandStack.connection.create.postExecute'
+ ], function(e) {
+ var context = e.context;
+
+ var element = context.shape || context.connection,
+ businessObject = element.businessObject;
+
+ var position;
+
+ if (hasExternalLabel(businessObject)) {
+ position = getExternalLabelMid(element);
+ modeling.createLabel(element, position, {
+ id: businessObject.id + '_label',
+ businessObject: businessObject
+ });
+ }
+ });
+
+
+ // indicate label is dragged during move
+
+ // we need to add labels to the list of selected
+ // shapes before the visuals get drawn.
+ //
+ // Hence this awesome magic number.
+ //
+ eventBus.on('shape.move.start', function(e) {
+
+ var context = e.context,
+ shapes = context.shapes;
+
+ var labels = [];
+
+ forEach(shapes, function(element) {
+ var label = element.label;
+
+ if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
+ labels.push(label);
+ }
+ });
+
+ forEach(labels, function(label) {
+ shapes.push(label);
+ });
+ });
+
+
+ // move labels with shapes
+
+ eventBus.on([
+ 'commandStack.shapes.move.postExecute'
+ ], function(e) {
+
+ var context = e.context,
+ closure = context.closure,
+ enclosedElements = closure.enclosedElements;
+
+ // ensure we move all labels with their respective elements
+ // if they have not been moved already
+
+ forEach(enclosedElements, function(e) {
+ if (e.label && !enclosedElements[e.label.id]) {
+ modeling.moveShape(e.label, context.delta, e.parent);
+ }
+ });
+ });
+
+
+ // update di information on label movement and creation
+
+ eventBus.on([
+ 'commandStack.label.create.executed',
+ 'commandStack.shape.moved.executed'
+ ], function(e) {
+
+ var element = e.context.shape,
+ businessObject = element.businessObject,
+ di = businessObject.di;
+
+ // we want to trigger on real labels only
+ if (!element.labelTarget) {
+ return;
+ }
+
+ if (!di.label) {
+ di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
+ bounds: bpmnFactory.create('dc:Bounds')
+ });
+ }
+
+ assign(di.label.bounds, {
+ x: element.x,
+ y: element.y,
+ width: element.width,
+ height: element.height
+ });
+ });
+}
+
+LabelSupport.$inject = [ 'eventBus', 'modeling', 'bpmnFactory' ];
+
+module.exports = LabelSupport;
+
+},{"204":204,"325":325,"46":46}],20:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var BaseModeling = _dereq_(108);
+
+var UpdatePropertiesHandler = _dereq_(29),
+ UpdateCanvasRootHandler = _dereq_(28);
+
+
+/**
+ * BPMN 2.0 modeling features activator
+ *
+ * @param {EventBus} eventBus
+ * @param {ElementFactory} elementFactory
+ * @param {CommandStack} commandStack
+ * @param {BpmnRules} bpmnRules
+ */
+function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
+ BaseModeling.call(this, eventBus, elementFactory, commandStack);
+
+ this._bpmnRules = bpmnRules;
+}
+
+inherits(Modeling, BaseModeling);
+
+Modeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack', 'bpmnRules' ];
+
+module.exports = Modeling;
+
+
+Modeling.prototype.getHandlers = function() {
+ var handlers = BaseModeling.prototype.getHandlers.call(this);
+
+ handlers['element.updateProperties'] = UpdatePropertiesHandler;
+ handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
+
+ return handlers;
+};
+
+
+Modeling.prototype.updateLabel = function(element, newLabel) {
+ this._commandStack.execute('element.updateLabel', {
+ element: element,
+ newLabel: newLabel
+ });
+};
+
+
+var getSharedParent = _dereq_(21).getSharedParent;
+
+Modeling.prototype.connect = function(source, target, attrs) {
+
+ var bpmnRules = this._bpmnRules;
+
+ if (!attrs) {
+ if (bpmnRules.canConnectMessageFlow(source, target)) {
+ attrs = {
+ type: 'bpmn:MessageFlow'
+ };
+ } else
+ if (bpmnRules.canConnectSequenceFlow(source, target)) {
+ attrs = {
+ type: 'bpmn:SequenceFlow'
+ };
+ } else {
+ attrs = {
+ type: 'bpmn:Association'
+ };
+ }
+ }
+
+ return this.createConnection(source, target, attrs, getSharedParent(source, target));
+};
+
+
+Modeling.prototype.updateProperties = function(element, properties) {
+ this._commandStack.execute('element.updateProperties', {
+ element: element,
+ properties: properties
+ });
+};
+
+
+/**
+ * Transform the current diagram into a collaboration.
+ *
+ * @return {djs.model.Root} the new root element
+ */
+Modeling.prototype.makeCollaboration = function() {
+
+ var collaborationElement = this._create('root', {
+ type: 'bpmn:Collaboration'
+ });
+
+ var context = {
+ newRoot: collaborationElement
+ };
+
+ this._commandStack.execute('canvas.updateRoot', context);
+
+ return collaborationElement;
+};
+
+/**
+ * Transform the current diagram into a process.
+ *
+ * @return {djs.model.Root} the new root element
+ */
+Modeling.prototype.makeProcess = function() {
+
+ var processElement = this._create('root', {
+ type: 'bpmn:Process'
+ });
+
+ var context = {
+ newRoot: processElement
+ };
+
+ this._commandStack.execute('canvas.updateRoot', context);
+};
+},{"108":108,"195":195,"21":21,"28":28,"29":29}],21:[function(_dereq_,module,exports){
+'use strict';
+
+var find = _dereq_(203);
+
+
+function getParents(element) {
+
+ var parents = [];
+
+ while (element) {
+ element = element.parent;
+
+ if (element) {
+ parents.push(element);
+ }
+ }
+
+ return parents;
+}
+
+module.exports.getParents = getParents;
+
+
+function getSharedParent(a, b) {
+
+ var parentsA = getParents(a),
+ parentsB = getParents(b);
+
+ return find(parentsA, function(parent) {
+ return parentsB.indexOf(parent) !== -1;
+ });
+}
+
+module.exports.getSharedParent = getSharedParent;
+},{"203":203}],22:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var is = _dereq_(47).is;
+
+var CommandInterceptor = _dereq_(75);
+
+
+function AppendBehavior(eventBus, elementFactory, bpmnRules) {
+
+ CommandInterceptor.call(this, eventBus);
+
+ // assign correct shape position unless already set
+
+ this.preExecute('shape.append', function(context) {
+
+ var source = context.source,
+ shape = context.shape;
+
+ if (!context.position) {
+
+ if (is(shape, 'bpmn:TextAnnotation')) {
+ context.position = {
+ x: source.x + source.width / 2 + 75,
+ y: source.y - (50) - shape.height / 2
+ };
+ } else {
+ context.position = {
+ x: source.x + source.width + 80 + shape.width / 2,
+ y: source.y + source.height / 2
+ };
+ }
+ }
+ }, true);
+}
+
+
+AppendBehavior.$inject = [ 'eventBus', 'elementFactory', 'bpmnRules' ];
+
+inherits(AppendBehavior, CommandInterceptor);
+
+module.exports = AppendBehavior;
+},{"195":195,"47":47,"75":75}],23:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var CommandInterceptor = _dereq_(75);
+
+var is = _dereq_(47).is;
+
+/**
+ * BPMN specific create behavior
+ */
+function CreateBehavior(eventBus, modeling) {
+
+ CommandInterceptor.call(this, eventBus);
+
+
+ /**
+ * morph process into collaboration before adding
+ * participant onto collaboration
+ */
+
+ this.preExecute('shape.create', function(context) {
+
+ var parent = context.parent,
+ shape = context.shape,
+ position = context.position;
+
+ if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
+
+ // this is going to detach the process root
+ // and set the returned collaboration element
+ // as the new root element
+ var collaborationElement = modeling.makeCollaboration();
+
+ // monkey patch the create context
+ // so that the participant is being dropped
+ // onto the new collaboration root instead
+ context.position = position;
+ context.parent = collaborationElement;
+
+ context.processRoot = parent;
+ }
+ }, true);
+
+ this.execute('shape.create', function(context) {
+
+ var processRoot = context.processRoot,
+ shape = context.shape;
+
+ if (processRoot) {
+ context.oldProcessRef = shape.businessObject.processRef;
+
+ // assign the participant processRef
+ shape.businessObject.processRef = processRoot.businessObject;
+ }
+ }, true);
+
+ this.revert('shape.create', function(context) {
+ var processRoot = context.processRoot,
+ shape = context.shape;
+
+ if (processRoot) {
+ // assign the participant processRef
+ shape.businessObject.processRef = context.oldProcessRef;
+ }
+ }, true);
+
+ this.postExecute('shape.create', function(context) {
+
+ var processRoot = context.processRoot,
+ shape = context.shape;
+
+ if (processRoot) {
+ // process root is already detached at this point
+ var processChildren = processRoot.children.slice();
+ modeling.moveShapes(processChildren, { x: 0, y: 0 }, shape);
+ }
+ }, true);
+
+}
+
+CreateBehavior.$inject = [ 'eventBus', 'modeling' ];
+
+inherits(CreateBehavior, CommandInterceptor);
+
+module.exports = CreateBehavior;
+},{"195":195,"47":47,"75":75}],24:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ inherits = _dereq_(195);
+
+var CommandInterceptor = _dereq_(75);
+
+var is = _dereq_(47).is,
+ getSharedParent = _dereq_(21).getSharedParent;
+
+
+function DropBehavior(eventBus, modeling, bpmnRules) {
+
+ CommandInterceptor.call(this, eventBus);
+
+ // remove sequence flows that should not be allowed
+ // after a move operation
+
+ this.postExecute('shapes.move', function(context) {
+
+ var closure = context.closure,
+ allConnections = closure.allConnections;
+
+ forEach(allConnections, function(c) {
+
+ var source = c.source,
+ target = c.target;
+
+ var replacementType,
+ remove;
+
+ /**
+ * Check if incoming or outgoing connections
+ * can stay or could be substituted with an
+ * appropriate replacement.
+ *
+ * This holds true for SequenceFlow <> MessageFlow.
+ */
+
+ if (is(c, 'bpmn:SequenceFlow')) {
+ if (!bpmnRules.canConnectSequenceFlow(source, target)) {
+ remove = true;
+ }
+
+ if (bpmnRules.canConnectMessageFlow(source, target)) {
+ replacementType = 'bpmn:MessageFlow';
+ }
+ }
+
+ // transform message flows into sequence flows, if possible
+
+ if (is(c, 'bpmn:MessageFlow')) {
+
+ if (!bpmnRules.canConnectMessageFlow(source, target)) {
+ remove = true;
+ }
+
+ if (bpmnRules.canConnectSequenceFlow(source, target)) {
+ replacementType = 'bpmn:SequenceFlow';
+ }
+ }
+
+ if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
+ remove = true;
+ }
+
+
+ // remove invalid connection
+ if (remove) {
+ modeling.removeConnection(c);
+ }
+
+ // replace SequenceFlow <> MessageFlow
+
+ if (replacementType) {
+ modeling.createConnection(source, target, {
+ type: replacementType,
+ waypoints: c.waypoints.slice()
+ }, getSharedParent(source, target));
+ }
+ });
+ }, true);
+}
+
+inherits(DropBehavior, CommandInterceptor);
+
+DropBehavior.$inject = [ 'eventBus', 'modeling', 'bpmnRules' ];
+
+module.exports = DropBehavior;
+},{"195":195,"204":204,"21":21,"47":47,"75":75}],25:[function(_dereq_,module,exports){
+'use strict';
+
+var is = _dereq_(47).is;
+
+
+function ModelingFeedback(eventBus, tooltips) {
+
+ function showError(position, message) {
+ tooltips.add({
+ position: {
+ x: position.x + 5,
+ y: position.y + 5
+ },
+ type: 'error',
+ timeout: 2000,
+ html: '<div>' + message + '</div>'
+ });
+ }
+
+ eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ target = context.target;
+
+ if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
+ showError(event, 'flow elements must be children of pools/participants');
+ }
+ });
+
+}
+
+
+ModelingFeedback.$inject = [ 'eventBus', 'tooltips' ];
+
+module.exports = ModelingFeedback;
+},{"47":47}],26:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var CommandInterceptor = _dereq_(75);
+
+var is = _dereq_(47).is;
+
+
+/**
+ * BPMN specific remove behavior
+ */
+function RemoveBehavior(eventBus, modeling) {
+
+ CommandInterceptor.call(this, eventBus);
+
+
+ /**
+ * morph collaboration diagram into process diagram
+ * after the last participant has been removed
+ */
+
+ this.preExecute('shape.delete', function(context) {
+
+ var shape = context.shape,
+ parent = shape.parent;
+
+ // activate the behavior if the shape to be removed
+ // is a participant
+ if (is(shape, 'bpmn:Participant')) {
+ context.collaborationRoot = parent;
+ }
+ }, true);
+
+ this.postExecute('shape.delete', function(context) {
+
+ var collaborationRoot = context.collaborationRoot;
+
+ if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
+ // replace empty collaboration with process diagram
+ modeling.makeProcess();
+ }
+ }, true);
+
+}
+
+RemoveBehavior.$inject = [ 'eventBus', 'modeling' ];
+
+inherits(RemoveBehavior, CommandInterceptor);
+
+module.exports = RemoveBehavior;
+},{"195":195,"47":47,"75":75}],27:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [
+ 'appendBehavior',
+ 'createBehavior',
+ 'dropBehavior',
+ 'removeBehavior',
+ 'modelingFeedback'
+ ],
+ appendBehavior: [ 'type', _dereq_(22) ],
+ dropBehavior: [ 'type', _dereq_(24) ],
+ createBehavior: [ 'type', _dereq_(23) ],
+ removeBehavior: [ 'type', _dereq_(26) ],
+ modelingFeedback: [ 'type', _dereq_(25) ]
+};
+},{"22":22,"23":23,"24":24,"25":25,"26":26}],28:[function(_dereq_,module,exports){
+'use strict';
+
+var Collections = _dereq_(175);
+
+
+function UpdateCanvasRootHandler(canvas, modeling) {
+ this._canvas = canvas;
+ this._modeling = modeling;
+}
+
+UpdateCanvasRootHandler.$inject = [ 'canvas', 'modeling' ];
+
+module.exports = UpdateCanvasRootHandler;
+
+
+UpdateCanvasRootHandler.prototype.execute = function(context) {
+
+ var canvas = this._canvas;
+
+ var newRoot = context.newRoot,
+ newRootBusinessObject = newRoot.businessObject,
+ oldRoot = canvas.getRootElement(),
+ oldRootBusinessObject = oldRoot.businessObject,
+ bpmnDefinitions = oldRootBusinessObject.$parent,
+ diPlane = oldRootBusinessObject.di;
+
+ // (1) replace process old <> new root
+ canvas.setRootElement(newRoot, true);
+
+ // (2) update root elements
+ Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
+ newRootBusinessObject.$parent = bpmnDefinitions;
+
+ Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
+ oldRootBusinessObject.$parent = null;
+
+ // (3) wire di
+ oldRootBusinessObject.di = null;
+
+ diPlane.bpmnElement = newRootBusinessObject;
+ newRootBusinessObject.di = diPlane;
+
+ context.oldRoot = oldRoot;
+};
+
+
+UpdateCanvasRootHandler.prototype.revert = function(context) {
+
+ var canvas = this._canvas;
+
+ var newRoot = context.newRoot,
+ newRootBusinessObject = newRoot.businessObject,
+ oldRoot = context.oldRoot,
+ oldRootBusinessObject = oldRoot.businessObject,
+ bpmnDefinitions = newRootBusinessObject.$parent,
+ diPlane = newRootBusinessObject.di;
+
+ // (1) replace process old <> new root
+ canvas.setRootElement(oldRoot, true);
+
+ // (2) update root elements
+ Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
+ newRootBusinessObject.$parent = null;
+
+ Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
+ oldRootBusinessObject.$parent = bpmnDefinitions;
+
+ // (3) wire di
+ newRootBusinessObject.di = null;
+
+ diPlane.bpmnElement = oldRootBusinessObject;
+ oldRootBusinessObject.di = diPlane;
+};
+},{"175":175}],29:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ pick = _dereq_(330),
+ keys = _dereq_(326);
+
+var DEFAULT_FLOW = 'default',
+ NAME = 'name',
+ ID = 'id';
+
+
+/**
+ * A handler that implements a BPMN 2.0 property update.
+ *
+ * This should be used to set simple properties on elements with
+ * an underlying BPMN business object.
+ *
+ * Use respective diagram-js provided handlers if you would
+ * like to perform automated modeling.
+ */
+function UpdatePropertiesHandler(elementRegistry) {
+ this._elementRegistry = elementRegistry;
+}
+
+UpdatePropertiesHandler.$inject = [ 'elementRegistry' ];
+
+module.exports = UpdatePropertiesHandler;
+
+
+////// api /////////////////////////////////////////////
+
+/**
+ * Updates a BPMN element with a list of new properties
+ *
+ * @param {Object} context
+ * @param {djs.model.Base} context.element the element to update
+ * @param {Object} context.properties a list of properties to set on the element's
+ * businessObject (the BPMN model element)
+ *
+ * @return {Array<djs.mode.Base>} the updated element
+ */
+UpdatePropertiesHandler.prototype.execute = function(context) {
+
+ var element = context.element,
+ changed = [ element ];
+
+ if (!element) {
+ throw new Error('element required');
+ }
+
+ var elementRegistry = this._elementRegistry;
+
+ var businessObject = element.businessObject,
+ properties = context.properties,
+ oldProperties = context.oldProperties || pick(businessObject, keys(properties));
+
+ if (ID in properties) {
+ elementRegistry.updateId(element, properties[ID]);
+ }
+
+ // correctly indicate visual changes on default flow updates
+ if (DEFAULT_FLOW in properties) {
+
+ if (properties[DEFAULT_FLOW]) {
+ changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
+ }
+
+ if (businessObject[DEFAULT_FLOW]) {
+ changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
+ }
+ }
+
+ if (NAME in properties && element.label) {
+ changed.push(element.label);
+ }
+
+ // update properties
+ assign(businessObject, properties);
+
+
+ // store old values
+ context.oldProperties = oldProperties;
+ context.changed = changed;
+
+ // indicate changed on objects affected by the update
+ return changed;
+};
+
+/**
+ * Reverts the update on a BPMN elements properties.
+ *
+ * @param {Object} context
+ *
+ * @return {djs.mode.Base} the updated element
+ */
+UpdatePropertiesHandler.prototype.revert = function(context) {
+
+ var element = context.element,
+ oldProperties = context.oldProperties,
+ businessObject = element.businessObject,
+ elementRegistry = this._elementRegistry;
+
+ assign(businessObject, context.oldProperties);
+
+ if (ID in oldProperties) {
+ elementRegistry.updateId(element, oldProperties[ID]);
+ }
+
+ return context.changed;
+};
+},{"325":325,"326":326,"330":330}],30:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'modeling', 'bpmnUpdater', 'labelSupport' ],
+ __depends__: [
+ _dereq_(14),
+ _dereq_(32),
+ _dereq_(27),
+ _dereq_(77),
+ _dereq_(160),
+ _dereq_(93)
+ ],
+ bpmnFactory: [ 'type', _dereq_(15) ],
+ bpmnUpdater: [ 'type', _dereq_(17) ],
+ elementFactory: [ 'type', _dereq_(18) ],
+ modeling: [ 'type', _dereq_(20) ],
+ labelSupport: [ 'type', _dereq_(19) ],
+ layouter: [ 'type', _dereq_(16) ],
+ connectionDocking: [ 'type', _dereq_(165) ]
+};
+
+},{"14":14,"15":15,"16":16,"160":160,"165":165,"17":17,"18":18,"19":19,"20":20,"27":27,"32":32,"77":77,"93":93}],31:[function(_dereq_,module,exports){
+'use strict';
+
+var groupBy = _dereq_(205),
+ size = _dereq_(209),
+ find = _dereq_(203),
+ inherits = _dereq_(195);
+
+var getParents = _dereq_(21).getParents,
+ is = _dereq_(47).is,
+ getBusinessObject = _dereq_(47).getBusinessObject,
+ isExpanded = _dereq_(45).isExpanded;
+
+
+var RuleProvider = _dereq_(145);
+
+/**
+ * BPMN specific modeling rule
+ */
+function BpmnRules(eventBus) {
+ RuleProvider.call(this, eventBus);
+}
+
+inherits(BpmnRules, RuleProvider);
+
+BpmnRules.$inject = [ 'eventBus' ];
+
+module.exports = BpmnRules;
+
+BpmnRules.prototype.init = function() {
+
+ this.addRule('connection.create', function(context) {
+ var source = context.source,
+ target = context.target;
+
+ return canConnect(source, target);
+ });
+
+ this.addRule('connection.reconnectStart', function(context) {
+
+ var connection = context.connection,
+ source = context.hover || context.source,
+ target = connection.target;
+
+ return canConnect(source, target, connection);
+ });
+
+ this.addRule('connection.reconnectEnd', function(context) {
+
+ var connection = context.connection,
+ source = connection.source,
+ target = context.hover || context.target;
+
+ return canConnect(source, target, connection);
+ });
+
+ this.addRule('connection.updateWaypoints', function(context) {
+ // OK! but visually ignore
+ return null;
+ });
+
+ this.addRule('shape.resize', function(context) {
+
+ var shape = context.shape,
+ newBounds = context.newBounds;
+
+ return canResize(shape, newBounds);
+ });
+
+ this.addRule('shapes.move', function(context) {
+
+ var target = context.newParent,
+ shapes = context.shapes;
+
+ return canMove(shapes, target);
+ });
+
+ this.addRule([ 'shape.create', 'shape.append' ], function(context) {
+ var target = context.parent,
+ shape = context.shape,
+ source = context.source;
+
+ return canCreate(shape, target, source);
+ });
+
+};
+
+BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
+
+BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
+
+BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
+
+BpmnRules.prototype.canMove = canMove;
+
+BpmnRules.prototype.canDrop = canDrop;
+
+BpmnRules.prototype.canCreate = canCreate;
+
+BpmnRules.prototype.canConnect = canConnect;
+
+BpmnRules.prototype.canResize = canResize;
+
+/**
+ * Utility functions for rule checking
+ */
+
+function nonExistantOrLabel(element) {
+ return !element || isLabel(element);
+}
+
+function isSame(a, b) {
+ return a === b;
+}
+
+function getOrganizationalParent(element) {
+
+ var bo = getBusinessObject(element);
+
+ while (bo && !is(bo, 'bpmn:Process')) {
+ if (is(bo, 'bpmn:Participant')) {
+ return bo.processRef || bo;
+ }
+
+ bo = bo.$parent;
+ }
+
+ return bo;
+}
+
+function isSameOrganization(a, b) {
+ var parentA = getOrganizationalParent(a),
+ parentB = getOrganizationalParent(b);
+
+ return parentA === parentB;
+}
+
+function isMessageFlowSource(element) {
+ return is(element, 'bpmn:InteractionNode') && (
+ !is(element, 'bpmn:Event') || (
+ is(element, 'bpmn:ThrowEvent') &&
+ hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
+ )
+ );
+}
+
+function isMessageFlowTarget(element) {
+ return is(element, 'bpmn:InteractionNode') && (
+ !is(element, 'bpmn:Event') || (
+ is(element, 'bpmn:CatchEvent') &&
+ hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
+ )
+ );
+}
+
+function getScopeParent(element) {
+
+ var bo = getBusinessObject(element);
+
+ if (is(bo, 'bpmn:Participant')) {
+ return null;
+ }
+
+ while (bo) {
+ bo = bo.$parent;
+
+ if (is(bo, 'bpmn:FlowElementsContainer')) {
+ return bo;
+ }
+ }
+
+ return bo;
+}
+
+function isSameScope(a, b) {
+ var scopeParentA = getScopeParent(a),
+ scopeParentB = getScopeParent(b);
+
+ return scopeParentA && (scopeParentA === scopeParentB);
+}
+
+function hasEventDefinition(element, eventDefinition) {
+ var bo = getBusinessObject(element);
+
+ return !!find(bo.eventDefinitions || [], function(definition) {
+ return is(definition, eventDefinition);
+ });
+}
+
+function hasEventDefinitionOrNone(element, eventDefinition) {
+ var bo = getBusinessObject(element);
+
+ return (bo.eventDefinitions || []).every(function(definition) {
+ return is(definition, eventDefinition);
+ });
+}
+
+function isSequenceFlowSource(element) {
+ return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
+ is(element, 'bpmn:IntermediateThrowEvent') &&
+ hasEventDefinition(element, 'bpmn:LinkEventDefinition')
+ );
+}
+
+function isSequenceFlowTarget(element) {
+ return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
+ is(element, 'bpmn:IntermediateCatchEvent') &&
+ hasEventDefinition(element, 'bpmn:LinkEventDefinition')
+ );
+}
+
+function isEventBasedTarget(element) {
+ return is(element, 'bpmn:ReceiveTask') || (
+ is(element, 'bpmn:IntermediateCatchEvent') && (
+ hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
+ hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
+ hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
+ hasEventDefinition(element, 'bpmn:SignalEventDefinition')
+ )
+ );
+}
+
+function isLabel(element) {
+ return element.labelTarget;
+}
+
+function isConnection(element) {
+ return element.waypoints;
+}
+
+function isParent(possibleParent, element) {
+ var allParents = getParents(element);
+ return allParents.indexOf(possibleParent) !== -1;
+}
+
+function canConnect(source, target, connection) {
+
+ if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
+ return null;
+ }
+
+ // See https://github.com/bpmn-io/bpmn-js/issues/178
+ // as a workround we disallow connections with same
+ // target and source element.
+ // This rule must be removed if a auto layout for this
+ // connections is implemented.
+ if (isSame(source, target)) {
+ return false;
+ }
+
+ if (canConnectMessageFlow(source, target) ||
+ canConnectSequenceFlow(source, target)) {
+
+ return true;
+ }
+
+ if (is(connection, 'bpmn:Association')) {
+ return canConnectAssociation(source, target);
+ }
+
+ return false;
+}
+
+/**
+ * Can an element be dropped into the target element
+ *
+ * @return {Boolean}
+ */
+function canDrop(element, target) {
+
+ // can move labels everywhere
+ if (isLabel(element) && !isConnection(target)) {
+ return true;
+ }
+
+ // allow to create new participants on
+ // on existing collaboration and process diagrams
+ if (is(element, 'bpmn:Participant')) {
+ return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
+ }
+
+ // drop flow elements onto flow element containers
+ // and participants
+ if (is(element, 'bpmn:FlowElement')) {
+ if (is(target, 'bpmn:FlowElementsContainer')) {
+ return isExpanded(target) !== false;
+ }
+
+ return is(target, 'bpmn:Participant');
+ }
+
+ if (is(element, 'bpmn:Artifact')) {
+ return is(target, 'bpmn:Collaboration') ||
+ is(target, 'bpmn:Participant') ||
+ is(target, 'bpmn:Process');
+ }
+
+ if (is(element, 'bpmn:MessageFlow')) {
+ return is(target, 'bpmn:Collaboration');
+ }
+
+ return false;
+}
+
+function canMove(elements, target) {
+
+ // only move if they have the same parent
+ var sameParent = size(groupBy(elements, function(s) { return s.parent && s.parent.id; })) === 1;
+
+ if (!sameParent) {
+ return false;
+ }
+
+ if (!target) {
+ return true;
+ }
+
+ return elements.every(function(element) {
+ return canDrop(element, target);
+ });
+}
+
+function canCreate(shape, target, source) {
+
+ if (!target) {
+ return false;
+ }
+
+ if (isLabel(target)) {
+ return null;
+ }
+
+ if (isSame(source, target)) {
+ return false;
+ }
+
+ // ensure we do not drop the element
+ // into source
+ if (source && isParent(source, target)) {
+ return false;
+ }
+
+ return canDrop(shape, target);
+}
+
+function canResize(shape, newBounds) {
+ if (is(shape, 'bpmn:SubProcess')) {
+ return isExpanded(shape) && (
+ !newBounds || (newBounds.width >= 100 && newBounds.height >= 80)
+ );
+ }
+
+ if (is(shape, 'bpmn:Participant')) {
+ return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
+ }
+
+ if (is(shape, 'bpmn:TextAnnotation')) {
+ return true;
+ }
+
+ return false;
+}
+
+function canConnectAssociation(source, target) {
+
+ // do not connect connections
+ if (isConnection(source) || isConnection(target)) {
+ return false;
+ }
+
+ // connect if different parent
+ return !isParent(target, source) &&
+ !isParent(source, target);
+}
+
+function canConnectMessageFlow(source, target) {
+
+ return isMessageFlowSource(source) &&
+ isMessageFlowTarget(target) &&
+ !isSameOrganization(source, target);
+}
+
+function canConnectSequenceFlow(source, target) {
+
+ return isSequenceFlowSource(source) &&
+ isSequenceFlowTarget(target) &&
+ isSameScope(source, target) &&
+ !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
+}
+},{"145":145,"195":195,"203":203,"205":205,"209":209,"21":21,"45":45,"47":47}],32:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(147)
+ ],
+ __init__: [ 'bpmnRules' ],
+ bpmnRules: [ 'type', _dereq_(31) ]
+};
+
+},{"147":147,"31":31}],33:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+/**
+ * A palette provider for BPMN 2.0 elements.
+ */
+function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
+
+ this._create = create;
+ this._elementFactory = elementFactory;
+ this._spaceTool = spaceTool;
+ this._lassoTool = lassoTool;
+
+ palette.registerProvider(this);
+}
+
+module.exports = PaletteProvider;
+
+PaletteProvider.$inject = [ 'palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool' ];
+
+
+PaletteProvider.prototype.getPaletteEntries = function(element) {
+
+ var actions = {},
+ create = this._create,
+ elementFactory = this._elementFactory,
+ spaceTool = this._spaceTool,
+ lassoTool = this._lassoTool;
+
+
+ function createAction(type, group, className, title, options) {
+
+ function createListener(event) {
+ var shape = elementFactory.createShape(assign({ type: type }, options));
+
+ if (options) {
+ shape.businessObject.di.isExpanded = options.isExpanded;
+ }
+
+ create.start(event, shape);
+ }
+
+ var shortType = type.replace(/^bpmn\:/, '');
+
+ return {
+ group: group,
+ className: className,
+ title: title || 'Create ' + shortType,
+ action: {
+ dragstart: createListener,
+ click: createListener
+ }
+ };
+ }
+
+ function createParticipant(event, collapsed) {
+ create.start(event, elementFactory.createParticipantShape(collapsed));
+ }
+
+ assign(actions, {
+ 'lasso-tool': {
+ group: 'tools',
+ className: 'icon-lasso-tool',
+ title: 'Activate the lasso tool',
+ action: {
+ click: function(event) {
+ lassoTool.activateSelection(event);
+ }
+ }
+ },
+ 'space-tool': {
+ group: 'tools',
+ className: 'icon-space-tool',
+ title: 'Activate the create/remove space tool',
+ action: {
+ click: function(event) {
+ spaceTool.activateSelection(event);
+ }
+ }
+ },
+ 'tool-separator': {
+ group: 'tools',
+ separator: true
+ },
+ 'create.start-event': createAction(
+ 'bpmn:StartEvent', 'event', 'icon-start-event-none'
+ ),
+ 'create.intermediate-event': createAction(
+ 'bpmn:IntermediateThrowEvent', 'event', 'icon-intermediate-event-none'
+ ),
+ 'create.end-event': createAction(
+ 'bpmn:EndEvent', 'event', 'icon-end-event-none'
+ ),
+ 'create.exclusive-gateway': createAction(
+ 'bpmn:ExclusiveGateway', 'gateway', 'icon-gateway-xor'
+ ),
+ 'create.task': createAction(
+ 'bpmn:Task', 'activity', 'icon-task'
+ ),
+ 'create.subprocess-collapsed': createAction(
+ 'bpmn:SubProcess', 'activity', 'icon-subprocess-collapsed', 'Create collapsed Sub Process',
+ { isExpanded: false }
+ ),
+ 'create.subprocess-expanded': createAction(
+ 'bpmn:SubProcess', 'activity', 'icon-subprocess-expanded', 'Create expanded SubProcess',
+ { isExpanded: true }
+ ),
+ 'create.participant-expanded': {
+ group: 'collaboration',
+ className: 'icon-participant',
+ title: 'Create Pool/Participant',
+ action: {
+ dragstart: createParticipant,
+ click: createParticipant
+ }
+ }
+ });
+
+ return actions;
+};
+
+},{"325":325}],34:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(137),
+ _dereq_(99)
+ ],
+ __init__: [ 'paletteProvider' ],
+ paletteProvider: [ 'type', _dereq_(33) ]
+};
+
+},{"137":137,"33":33,"99":99}],35:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ filter = _dereq_(202);
+
+var REPLACE_OPTIONS = _dereq_(36);
+
+var startEventReplace = REPLACE_OPTIONS.START_EVENT,
+ intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
+ endEventReplace = REPLACE_OPTIONS.END_EVENT,
+ gatewayReplace = REPLACE_OPTIONS.GATEWAY,
+ taskReplace = REPLACE_OPTIONS.TASK;
+
+
+/**
+ * A replace menu provider that gives users the controls to choose
+ * and replace BPMN elements with each other.
+ *
+ * @param {BpmnFactory} bpmnFactory
+ * @param {Moddle} moddle
+ * @param {PopupMenu} popupMenu
+ * @param {Replace} replace
+ */
+function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
+
+ /**
+ * Prepares a new business object for the replacement element
+ * and triggers the replace operation.
+ *
+ * @param {djs.model.Base} element
+ * @param {Object} target
+ * @return {djs.model.Base} the newly created element
+ */
+ function replaceElement(element, target) {
+
+ var type = target.type,
+ oldBusinessObject = element.businessObject,
+ businessObject = bpmnFactory.create(type);
+
+ var newElement = {
+ type: type,
+ businessObject: businessObject
+ };
+
+ // initialize custom BPMN extensions
+
+ if (target.eventDefinition) {
+ var eventDefinitions = businessObject.get('eventDefinitions'),
+ eventDefinition = moddle.create(target.eventDefinition);
+
+ eventDefinitions.push(eventDefinition);
+ }
+
+ if (target.instantiate !== undefined) {
+ businessObject.instantiate = target.instantiate;
+ }
+
+ if (target.eventGatewayType !== undefined) {
+ businessObject.eventGatewayType = target.eventGatewayType;
+ }
+
+ // copy size (for activities only)
+ if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
+
+ // TODO: need also to respect min/max Size
+
+ newElement.width = element.width;
+ newElement.height = element.height;
+ }
+
+ // TODO: copy other elligable properties from old business object
+ businessObject.name = oldBusinessObject.name;
+
+ newElement = replace.replaceElement(element, newElement);
+
+ selection.select(newElement);
+
+ return newElement;
+ }
+
+
+ function getReplaceOptions(element) {
+
+ var menuEntries = [];
+ var businessObject = element.businessObject;
+
+ if (businessObject.$instanceOf('bpmn:StartEvent')) {
+ addEntries(startEventReplace, filterEvents);
+ } else
+
+ if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
+ businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
+
+ addEntries(intermediateEventReplace, filterEvents);
+ } else
+
+ if (businessObject.$instanceOf('bpmn:EndEvent')) {
+
+ addEntries(endEventReplace, filterEvents);
+ } else
+
+ if (businessObject.$instanceOf('bpmn:Gateway')) {
+
+ addEntries(gatewayReplace, function(entry) {
+
+ return entry.target.type !== businessObject.$type;
+ });
+ } else
+
+ if (businessObject.$instanceOf('bpmn:FlowNode')) {
+ addEntries(taskReplace, function(entry) {
+ return entry.target.type !== businessObject.$type;
+ });
+ }
+
+ function filterEvents(entry) {
+
+ var target = entry.target;
+
+ var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
+ var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
+ var isEventTypeEqual = businessObject.$type == target.type;
+
+ return ((!isEventDefinitionEqual && isEventTypeEqual) ||
+ !isEventTypeEqual) ||
+ !(isEventDefinitionEqual && isEventTypeEqual);
+ }
+
+ function addEntries(entries, filterFun) {
+ // Filter selected type from the array
+ var filteredEntries = filter(entries, filterFun);
+
+ // Add entries to replace menu
+ forEach(filteredEntries, function(definition) {
+
+ var entry = addMenuEntry(definition);
+ menuEntries.push(entry);
+ });
+ }
+
+ function addMenuEntry(definition) {
+
+ return {
+ label: definition.label,
+ className: definition.className,
+ action: {
+ name: definition.actionName,
+ handler: function() {
+ replaceElement(element, definition.target);
+ }
+ }
+ };
+ }
+
+ return menuEntries;
+ }
+
+
+ // API
+
+ this.openChooser = function(position, element) {
+ var entries = this.getReplaceOptions(element);
+
+ popupMenu.open('replace-menu', position, entries);
+ };
+
+ this.getReplaceOptions = getReplaceOptions;
+
+ this.replaceElement = replaceElement;
+}
+
+BpmnReplace.$inject = [ 'bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection' ];
+
+module.exports = BpmnReplace;
+},{"202":202,"204":204,"36":36}],36:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.START_EVENT = [
+ {
+ label: 'Start Event',
+ actionName: 'replace-with-none-start',
+ className: 'icon-start-event-none',
+ target: {
+ type: 'bpmn:StartEvent'
+ }
+ },
+ {
+ label: 'Intermediate Throw Event',
+ actionName: 'replace-with-intermediate-throwing',
+ className: 'icon-intermediate-event-none',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent'
+ }
+ },
+ {
+ label: 'End Event',
+ actionName: 'replace-with-message-end',
+ className: 'icon-end-event-none',
+ target: {
+ type: 'bpmn:EndEvent'
+ }
+ },
+ {
+ label: 'Message Start Event',
+ actionName: 'replace-with-message-start',
+ className: 'icon-start-event-message',
+ target: {
+ type: 'bpmn:StartEvent',
+ eventDefinition: 'bpmn:MessageEventDefinition'
+ }
+ },
+ {
+ label: 'Timer Start Event',
+ actionName: 'replace-with-timer-start',
+ className: 'icon-start-event-timer',
+ target: {
+ type: 'bpmn:StartEvent',
+ eventDefinition: 'bpmn:TimerEventDefinition'
+ }
+ },
+ {
+ label: 'Conditional Start Event',
+ actionName: 'replace-with-conditional-start',
+ className: 'icon-start-event-condition',
+ target: {
+ type: 'bpmn:StartEvent',
+ eventDefinition: 'bpmn:ConditionalEventDefinition'
+ }
+ },
+ {
+ label: 'Signal Start Event',
+ actionName: 'replace-with-signal-start',
+ className: 'icon-start-event-signal',
+ target: {
+ type: 'bpmn:StartEvent',
+ eventDefinition: 'bpmn:SignalEventDefinition'
+ }
+ }
+];
+
+module.exports.INTERMEDIATE_EVENT = [
+ {
+ label: 'Start Event',
+ actionName: 'replace-with-none-start',
+ className: 'icon-start-event-none',
+ target: {
+ type: 'bpmn:StartEvent'
+ }
+ },
+ {
+ label: 'Intermediate Throw Event',
+ actionName: 'replace-with-message-intermediate-throw',
+ className: 'icon-intermediate-event-none',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent'
+ }
+ },
+ {
+ label: 'End Event',
+ actionName: 'replace-with-message-end',
+ className: 'icon-end-event-none',
+ target: {
+ type: 'bpmn:EndEvent'
+ }
+ },
+ {
+ label: 'Message Intermediate Catch Event',
+ actionName: 'replace-with-intermediate-catch',
+ className: 'icon-intermediate-event-catch-message',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:MessageEventDefinition'
+ }
+ },
+ {
+ label: 'Message Intermediate Throw Event',
+ actionName: 'replace-with-intermediate-throw',
+ className: 'icon-intermediate-event-throw-message',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent',
+ eventDefinition: 'bpmn:MessageEventDefinition'
+ }
+ },
+ {
+ label: 'Timer Intermediate Catch Event',
+ actionName: 'replace-with-timer-intermediate-catch',
+ className: 'icon-intermediate-event-catch-timer',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:TimerEventDefinition'
+ }
+ },
+ {
+ label: 'Escalation Intermediate Catch Event',
+ actionName: 'replace-with-escalation-catch',
+ className: 'icon-intermediate-event-catch-escalation',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:EscalationEventDefinition'
+ }
+ },
+ {
+ label: 'Conditional Intermediate Catch Event',
+ actionName: 'replace-with-conditional-intermediate-catch',
+ className: 'icon-intermediate-event-catch-condition',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:ConditionalEventDefinition'
+ }
+ },
+ {
+ label: 'Link Intermediate Catch Event',
+ actionName: 'replace-with-link-intermediate-catch',
+ className: 'icon-intermediate-event-catch-link',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:LinkEventDefinition'
+ }
+ },
+ {
+ label: 'Link Intermediate Throw Event',
+ actionName: 'replace-with-link-intermediate-throw',
+ className: 'icon-intermediate-event-throw-link',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent',
+ eventDefinition: 'bpmn:LinkEventDefinition'
+ }
+ },
+ {
+ label: 'Compensation Intermediate Throw Event',
+ actionName: 'replace-with-compensation-intermediate-throw',
+ className: 'icon-intermediate-event-throw-compensation',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent',
+ eventDefinition: 'bpmn:CompensateEventDefinition'
+ }
+ },
+ {
+ label: 'Signal Throw Catch Event',
+ actionName: 'replace-with-throw-intermediate-catch',
+ className: 'icon-intermediate-event-catch-signal',
+ target: {
+ type: 'bpmn:IntermediateCatchEvent',
+ eventDefinition: 'bpmn:SignalEventDefinition'
+ }
+ },
+ {
+ label: 'Signal Intermediate Throw Event',
+ actionName: 'replace-with-signal-intermediate-throw',
+ className: 'icon-intermediate-event-throw-signal',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent',
+ eventDefinition: 'bpmn:SignalEventDefinition'
+ }
+ }
+];
+
+module.exports.END_EVENT = [
+ {
+ label: 'Start Event',
+ actionName: 'replace-with-none-start',
+ className: 'icon-start-event-none',
+ target: {
+ type: 'bpmn:StartEvent'
+ }
+ },
+ {
+ label: 'Intermediate Throw Event',
+ actionName: 'replace-with-message-intermediate-throw',
+ className: 'icon-intermediate-event-none',
+ target: {
+ type: 'bpmn:IntermediateThrowEvent'
+ }
+ },
+ {
+ label: 'End Event',
+ actionName: 'replace-with-none-end',
+ className: 'icon-end-event-none',
+ target: {
+ type: 'bpmn:EndEvent'
+ }
+ },
+ {
+ label: 'Message End Event',
+ actionName: 'replace-with-message-end',
+ className: 'icon-end-event-message',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:MessageEventDefinition'
+ }
+ },
+ {
+ label: 'Escalation End Event',
+ actionName: 'replace-with-escalation-end',
+ className: 'icon-end-event-escalation',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:EscalationEventDefinition'
+ }
+ },
+ {
+ label: 'Error End Event',
+ actionName: 'replace-with-error-end',
+ className: 'icon-end-event-error',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:ErrorEventDefinition'
+ }
+ },
+ {
+ label: 'Cancel End Event',
+ actionName: 'replace-with-cancel-end',
+ className: 'icon-end-event-cancel',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:CancelEventDefinition'
+ }
+ },
+ {
+ label: 'Compensation End Event',
+ actionName: 'replace-with-compensation-end',
+ className: 'icon-end-event-compensation',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:CompensateEventDefinition'
+ }
+ },
+ {
+ label: 'Signal End Event',
+ actionName: 'replace-with-signal-end',
+ className: 'icon-end-event-signal',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:SignalEventDefinition'
+ }
+ },
+ {
+ label: 'Terminate End Event',
+ actionName: 'replace-with-terminate-end',
+ className: 'icon-end-event-terminate',
+ target: {
+ type: 'bpmn:EndEvent',
+ eventDefinition: 'bpmn:TerminateEventDefinition'
+ }
+ }
+];
+
+module.exports.GATEWAY = [
+ {
+ label: 'Exclusive Gateway',
+ actionName: 'replace-with-exclusive-gateway',
+ className: 'icon-gateway-xor',
+ target: {
+ type: 'bpmn:ExclusiveGateway'
+ }
+ },
+ {
+ label: 'Parallel Gateway',
+ actionName: 'replace-with-parallel-gateway',
+ className: 'icon-gateway-parallel',
+ target: {
+ type: 'bpmn:ParallelGateway'
+ }
+ },
+ {
+ label: 'Inclusive Gateway',
+ actionName: 'replace-with-inclusive-gateway',
+ className: 'icon-gateway-or',
+ target: {
+ type: 'bpmn:InclusiveGateway'
+ }
+ },
+ {
+ label: 'Complex Gateway',
+ actionName: 'replace-with-complex-gateway',
+ className: 'icon-gateway-complex',
+ target: {
+ type: 'bpmn:ComplexGateway'
+ }
+ },
+ {
+ label: 'Event based Gateway',
+ actionName: 'replace-with-event-based-gateway',
+ className: 'icon-gateway-eventbased',
+ target: {
+ type: 'bpmn:EventBasedGateway',
+ instantiate: false,
+ eventGatewayType: 'Exclusive'
+ }
+ }
+ // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
+ // {
+ // label: 'Event based instantiating Gateway',
+ // actionName: 'replace-with-exclusive-event-based-gateway',
+ // className: 'icon-exclusive-event-based',
+ // target: {
+ // type: 'bpmn:EventBasedGateway'
+ // },
+ // options: {
+ // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
+ // }
+ // },
+ // {
+ // label: 'Parallel Event based instantiating Gateway',
+ // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
+ // className: 'icon-parallel-event-based-instantiate-gateway',
+ // target: {
+ // type: 'bpmn:EventBasedGateway'
+ // },
+ // options: {
+ // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
+ // }
+ // }
+];
+
+
+module.exports.TASK = [
+ {
+ label: 'Task',
+ actionName: 'replace-with-task',
+ className: 'icon-task',
+ target: {
+ type: 'bpmn:Task'
+ }
+ },
+ {
+ label: 'Send Task',
+ actionName: 'replace-with-send-task',
+ className: 'icon-send',
+ target: {
+ type: 'bpmn:SendTask'
+ }
+ },
+ {
+ label: 'Receive Task',
+ actionName: 'replace-with-receive-task',
+ className: 'icon-receive',
+ target: {
+ type: 'bpmn:ReceiveTask'
+ }
+ },
+ {
+ label: 'User Task',
+ actionName: 'replace-with-user-task',
+ className: 'icon-user',
+ target: {
+ type: 'bpmn:UserTask'
+ }
+ },
+ {
+ label: 'Manual Task',
+ actionName: 'replace-with-manual-task',
+ className: 'icon-manual',
+ target: {
+ type: 'bpmn:ManualTask'
+ }
+ },
+ {
+ label: 'Business Rule Task',
+ actionName: 'replace-with-rule-task',
+ className: 'icon-business-rule',
+ target: {
+ type: 'bpmn:BusinessRuleTask'
+ }
+ },
+ {
+ label: 'Service Task',
+ actionName: 'replace-with-service-task',
+ className: 'icon-service',
+ target: {
+ type: 'bpmn:ServiceTask'
+ }
+ },
+ {
+ label: 'Script Task',
+ actionName: 'replace-with-script-task',
+ className: 'icon-script',
+ target: {
+ type: 'bpmn:ScriptTask'
+ }
+ }
+];
+},{}],37:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(139),
+ _dereq_(141),
+ _dereq_(151)
+ ],
+ bpmnReplace: [ 'type', _dereq_(35) ]
+};
+},{"139":139,"141":141,"151":151,"35":35}],38:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var forEach = _dereq_(204);
+
+var getBoundingBox = _dereq_(177).getBBox;
+var is = _dereq_(21).is;
+
+var Snapping = _dereq_(154),
+ SnapUtil = _dereq_(153);
+
+var is = _dereq_(47).is;
+
+var mid = SnapUtil.mid,
+ topLeft = SnapUtil.topLeft,
+ bottomRight = SnapUtil.bottomRight;
+
+var round = Math.round;
+
+
+/**
+ * BPMN specific snapping functionality
+ *
+ * * snap on process elements if a pool is created inside a
+ * process diagram
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ */
+function BpmnSnapping(eventBus, canvas) {
+
+ // instantiate super
+ Snapping.call(this, eventBus, canvas);
+
+
+ /**
+ * Drop participant on process <> process elements snapping
+ */
+
+ function initParticipantSnapping(context, shape, elements) {
+
+ if (!elements.length) {
+ return;
+ }
+
+ var snapBox = getBoundingBox(elements.filter(function(e) {
+ return !e.labelTarget && !e.waypoints;
+ }));
+
+ snapBox.x -= 50;
+ snapBox.y -= 20;
+ snapBox.width += 70;
+ snapBox.height += 40;
+
+ // adjust shape height to include bounding box
+ shape.width = Math.max(shape.width, snapBox.width);
+ shape.height = Math.max(shape.height, snapBox.height);
+
+ context.participantSnapBox = snapBox;
+ }
+
+ function snapParticipant(snapBox, shape, event) {
+
+ var shapeHalfWidth = shape.width / 2 - 30,
+ shapeHalfHeight = shape.height / 2;
+
+ var currentTopLeft = {
+ x: event.x - shapeHalfWidth - 30,
+ y: event.y - shapeHalfHeight
+ };
+
+ var currentBottomRight = {
+ x: event.x + shapeHalfWidth + 30,
+ y: event.y + shapeHalfHeight
+ };
+
+ var snapTopLeft = snapBox,
+ snapBottomRight = bottomRight(snapBox);
+
+ if (currentTopLeft.x >= snapTopLeft.x) {
+ event.x = snapTopLeft.x + 30 + shapeHalfWidth;
+ event.snapped = true;
+ } else
+ if (currentBottomRight.x <= snapBottomRight.x) {
+ event.x = snapBottomRight.x - 30 - shapeHalfWidth;
+ event.snapped = true;
+ }
+
+ if (currentTopLeft.y >= snapTopLeft.y) {
+ event.y = snapTopLeft.y + shapeHalfHeight;
+ event.snapped = true;
+ } else
+ if (currentBottomRight.y <= snapBottomRight.y) {
+ event.y = snapBottomRight.y - shapeHalfHeight;
+ event.snapped = true;
+ }
+ }
+
+ eventBus.on('create.start', function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ rootElement = canvas.getRootElement();
+
+ // snap participant around existing elements (if any)
+ if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
+
+ initParticipantSnapping(context, shape, rootElement.children);
+ }
+ });
+
+ eventBus.on([ 'create.move', 'create.end' ], 1500, function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ participantSnapBox = context.participantSnapBox;
+
+ if (!event.snapped && participantSnapBox) {
+ snapParticipant(participantSnapBox, shape, event);
+ }
+ });
+
+ eventBus.on('resize.start', 1500, function(event) {
+ var context = event.context,
+ shape = context.shape;
+
+ if (is(shape, 'bpmn:SubProcess')) {
+ context.minDimensions = { width: 140, height: 120 };
+ }
+
+ if (is(shape, 'bpmn:Participant')) {
+ context.minDimensions = { width: 400, height: 200 };
+ }
+
+ if (is(shape, 'bpmn:TextAnnotation')) {
+ context.minDimensions = { width: 50, height: 50 };
+ }
+ });
+
+}
+
+inherits(BpmnSnapping, Snapping);
+
+BpmnSnapping.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = BpmnSnapping;
+
+
+BpmnSnapping.prototype.initSnap = function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ shapeMid,
+ shapeBounds,
+ shapeTopLeft,
+ shapeBottomRight,
+ snapContext;
+
+
+ snapContext = Snapping.prototype.initSnap.call(this, event);
+
+ if (is(shape, 'bpmn:Participant')) {
+ // assign higher priority for outer snaps on participants
+ snapContext.setSnapLocations([ 'top-left', 'bottom-right', 'mid' ]);
+ }
+
+
+ if (shape) {
+
+ shapeMid = mid(shape, event);
+
+ shapeBounds = {
+ width: shape.width,
+ height: shape.height,
+ x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
+ y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
+ };
+
+ shapeTopLeft = topLeft(shapeBounds);
+ shapeBottomRight = bottomRight(shapeBounds);
+
+ snapContext.setSnapOrigin('top-left', {
+ x: shapeTopLeft.x - event.x,
+ y: shapeTopLeft.y - event.y
+ });
+
+ snapContext.setSnapOrigin('bottom-right', {
+ x: shapeBottomRight.x - event.x,
+ y: shapeBottomRight.y - event.y
+ });
+
+
+ forEach(shape.outgoing, function(c) {
+ var docking = c.waypoints[0];
+
+ docking = docking.original || docking;
+
+ snapContext.setSnapOrigin(c.id + '-docking', {
+ x: docking.x - event.x,
+ y: docking.y - event.y
+ });
+ });
+
+ forEach(shape.incoming, function(c) {
+ var docking = c.waypoints[c.waypoints.length - 1];
+
+ docking = docking.original || docking;
+
+ snapContext.setSnapOrigin(c.id + '-docking', {
+ x: docking.x - event.x,
+ y: docking.y - event.y
+ });
+ });
+
+ }
+
+ var source = context.source;
+
+ if (source) {
+ snapContext.addDefaultSnap('mid', mid(source));
+ }
+};
+
+
+BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
+
+ var siblings = this.getSiblings(shape, target);
+
+
+ forEach(siblings, function(s) {
+ snapPoints.add('mid', mid(s));
+
+ if (is(s, 'bpmn:Participant')) {
+ snapPoints.add('top-left', topLeft(s));
+ snapPoints.add('bottom-right', bottomRight(s));
+ }
+ });
+
+ forEach(shape.incoming, function(c) {
+
+ if (siblings.indexOf(c.source) === -1) {
+ snapPoints.add('mid', mid(c.source));
+
+ var docking = c.waypoints[0];
+ snapPoints.add(c.id + '-docking', docking.original || docking);
+ }
+ });
+
+
+ forEach(shape.outgoing, function(c) {
+
+ if (siblings.indexOf(c.target) === -1) {
+ snapPoints.add('mid', mid(c.target));
+
+ var docking = c.waypoints[c.waypoints.length - 1];
+ snapPoints.add(c.id + '-docking', docking.original || docking);
+ }
+ });
+
+};
+},{"153":153,"154":154,"177":177,"195":195,"204":204,"21":21,"47":47}],39:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'snapping' ],
+ snapping: [ 'type', _dereq_(38) ]
+};
+},{"38":38}],40:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ map = _dereq_(207);
+
+var LabelUtil = _dereq_(46);
+
+var hasExternalLabel = LabelUtil.hasExternalLabel,
+ getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
+ isExpanded = _dereq_(45).isExpanded,
+ elementToString = _dereq_(43).elementToString;
+
+
+function elementData(semantic, attrs) {
+ return assign({
+ id: semantic.id,
+ type: semantic.$type,
+ businessObject: semantic
+ }, attrs);
+}
+
+function collectWaypoints(waypoints) {
+ return map(waypoints, function(p) {
+ return { x: p.x, y: p.y };
+ });
+}
+
+
+/**
+ * An importer that adds bpmn elements to the canvas
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementFactory} elementFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+
+ this._elementFactory = elementFactory;
+ this._elementRegistry = elementRegistry;
+}
+
+BpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];
+
+module.exports = BpmnImporter;
+
+
+/**
+ * Add bpmn element (semantic) to the canvas onto the
+ * specified parent shape.
+ */
+BpmnImporter.prototype.add = function(semantic, parentElement) {
+
+ var di = semantic.di,
+ element;
+
+ // ROOT ELEMENT
+ // handle the special case that we deal with a
+ // invisible root element (process or collaboration)
+ if (di.$instanceOf('bpmndi:BPMNPlane')) {
+
+ // add a virtual element (not being drawn)
+ element = this._elementFactory.createRoot(elementData(semantic));
+
+ this._canvas.setRootElement(element);
+ }
+
+ // SHAPE
+ else if (di.$instanceOf('bpmndi:BPMNShape')) {
+
+ var collapsed = !isExpanded(semantic);
+ var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
+
+ var bounds = semantic.di.bounds;
+
+ element = this._elementFactory.createShape(elementData(semantic, {
+ collapsed: collapsed,
+ hidden: hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ this._canvas.addShape(element, parentElement);
+ }
+
+ // CONNECTION
+ else if (di.$instanceOf('bpmndi:BPMNEdge')) {
+
+ var source = this._getSource(semantic),
+ target = this._getTarget(semantic);
+
+ element = this._elementFactory.createConnection(elementData(semantic, {
+ source: source,
+ target: target,
+ waypoints: collectWaypoints(semantic.di.waypoint)
+ }));
+
+ this._canvas.addConnection(element, parentElement);
+ } else {
+ throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
+ }
+
+ // (optional) LABEL
+ if (hasExternalLabel(semantic)) {
+ this.addLabel(semantic, element);
+ }
+
+
+ this._eventBus.fire('bpmnElement.added', { element: element });
+
+ return element;
+};
+
+
+/**
+ * add label for an element
+ */
+BpmnImporter.prototype.addLabel = function(semantic, element) {
+ var bounds = getExternalLabelBounds(semantic, element);
+
+ var label = this._elementFactory.createLabel(elementData(semantic, {
+ id: semantic.id + '_label',
+ labelTarget: element,
+ type: 'label',
+ hidden: element.hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ return this._canvas.addShape(label, element.parent);
+};
+
+/**
+ * Return the drawn connection end based on the given side.
+ *
+ * @throws {Error} if the end is not yet drawn
+ */
+BpmnImporter.prototype._getEnd = function(semantic, side) {
+
+ var element,
+ refSemantic,
+ type = semantic.$type;
+
+ refSemantic = semantic[side + 'Ref'];
+
+ // handle mysterious isMany DataAssociation#sourceRef
+ if (side === 'source' && type === 'bpmn:DataInputAssociation') {
+ refSemantic = refSemantic && refSemantic[0];
+ }
+
+ // fix source / target for DataInputAssociation / DataOutputAssociation
+ if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
+ side === 'target' && type === 'bpmn:DataInputAssociation') {
+
+ refSemantic = semantic.$parent;
+ }
+
+ element = refSemantic && this._getElement(refSemantic);
+
+ if (element) {
+ return element;
+ }
+
+ if (refSemantic) {
+ throw new Error(
+ 'element ' + elementToString(refSemantic) + ' referenced by ' +
+ elementToString(semantic) + '#' + side + 'Ref not yet drawn');
+ } else {
+ throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
+ }
+};
+
+BpmnImporter.prototype._getSource = function(semantic) {
+ return this._getEnd(semantic, 'source');
+};
+
+BpmnImporter.prototype._getTarget = function(semantic) {
+ return this._getEnd(semantic, 'target');
+};
+
+
+BpmnImporter.prototype._getElement = function(semantic) {
+ return this._elementRegistry.get(semantic.id);
+};
+
+},{"207":207,"325":325,"43":43,"45":45,"46":46}],41:[function(_dereq_,module,exports){
+'use strict';
+
+var filter = _dereq_(202),
+ find = _dereq_(203),
+ forEach = _dereq_(204);
+
+var Refs = _dereq_(356);
+
+var elementToString = _dereq_(43).elementToString;
+
+var diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });
+
+/**
+ * Returns true if an element has the given meta-model type
+ *
+ * @param {ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ return element.$instanceOf(type);
+}
+
+
+/**
+ * Find a suitable display candidate for definitions where the DI does not
+ * correctly specify one.
+ */
+function findDisplayCandidate(definitions) {
+ return find(definitions.rootElements, function(e) {
+ return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
+ });
+}
+
+
+function BpmnTreeWalker(handler) {
+
+ // list of containers already walked
+ var handledProcesses = [];
+
+ // list of elements to handle deferred to ensure
+ // prerequisites are drawn
+ var deferred = [];
+
+ ///// Helpers /////////////////////////////////
+
+ function contextual(fn, ctx) {
+ return function(e) {
+ fn(e, ctx);
+ };
+ }
+
+ function visit(element, ctx) {
+
+ var gfx = element.gfx;
+
+ // avoid multiple rendering of elements
+ if (gfx) {
+ throw new Error('already rendered ' + elementToString(element));
+ }
+
+ // call handler
+ return handler.element(element, ctx);
+ }
+
+ function visitRoot(element, diagram) {
+ return handler.root(element, diagram);
+ }
+
+ function visitIfDi(element, ctx) {
+ try {
+ return element.di && visit(element, ctx);
+ } catch (e) {
+ logError(e.message, { element: element, error: e });
+
+ console.error('failed to import ' + elementToString(element));
+ console.error(e);
+ }
+ }
+
+ function logError(message, context) {
+ handler.error(message, context);
+ }
+
+ ////// DI handling ////////////////////////////
+
+ function registerDi(di) {
+ var bpmnElement = di.bpmnElement;
+
+ if (bpmnElement) {
+ if (bpmnElement.di) {
+ logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });
+ } else {
+ diRefs.bind(bpmnElement, 'di');
+ bpmnElement.di = di;
+ }
+ } else {
+ logError('no bpmnElement referenced in ' + elementToString(di), { element: di });
+ }
+ }
+
+ function handleDiagram(diagram) {
+ handlePlane(diagram.plane);
+ }
+
+ function handlePlane(plane) {
+ registerDi(plane);
+
+ forEach(plane.planeElement, handlePlaneElement);
+ }
+
+ function handlePlaneElement(planeElement) {
+ registerDi(planeElement);
+ }
+
+
+ ////// Semantic handling //////////////////////
+
+ function handleDefinitions(definitions, diagram) {
+ // make sure we walk the correct bpmnElement
+
+ var diagrams = definitions.diagrams;
+
+ if (diagram && diagrams.indexOf(diagram) === -1) {
+ throw new Error('diagram not part of bpmn:Definitions');
+ }
+
+ if (!diagram && diagrams && diagrams.length) {
+ diagram = diagrams[0];
+ }
+
+ // no diagram -> nothing to import
+ if (!diagram) {
+ return;
+ }
+
+ // load DI from selected diagram only
+ handleDiagram(diagram);
+
+
+ var plane = diagram.plane;
+
+ if (!plane) {
+ throw new Error('no plane for ' + elementToString(diagram));
+ }
+
+
+ var rootElement = plane.bpmnElement;
+
+ // ensure we default to a suitable display candidate (process or collaboration),
+ // even if non is specified in DI
+ if (!rootElement) {
+ rootElement = findDisplayCandidate(definitions);
+
+ if (!rootElement) {
+ return logError('no process or collaboration present to display');
+ } else {
+
+ logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
+
+ // correct DI on the fly
+ plane.bpmnElement = rootElement;
+ registerDi(plane);
+ }
+ }
+
+
+ var ctx = visitRoot(rootElement, plane);
+
+ if (is(rootElement, 'bpmn:Process')) {
+ handleProcess(rootElement, ctx);
+ } else if (is(rootElement, 'bpmn:Collaboration')) {
+ handleCollaboration(rootElement, ctx);
+
+ // force drawing of everything not yet drawn that is part of the target DI
+ handleUnhandledProcesses(definitions.rootElements, ctx);
+ } else {
+ throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
+ }
+
+ // handle all deferred elements
+ handleDeferred(deferred);
+ }
+
+ function handleDeferred(deferred) {
+ forEach(deferred, function(d) { d(); });
+ }
+
+ function handleProcess(process, context) {
+ handleFlowElementsContainer(process, context);
+ handleIoSpecification(process.ioSpecification, context);
+
+ handleArtifacts(process.artifacts, context);
+
+ // log process handled
+ handledProcesses.push(process);
+ }
+
+ function handleUnhandledProcesses(rootElements) {
+
+ // walk through all processes that have not yet been drawn and draw them
+ // if they contain lanes with DI information.
+ // we do this to pass the free-floating lane test cases in the MIWG test suite
+ var processes = filter(rootElements, function(e) {
+ return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
+ });
+
+ processes.forEach(contextual(handleProcess));
+ }
+
+ function handleMessageFlow(messageFlow, context) {
+ visitIfDi(messageFlow, context);
+ }
+
+ function handleMessageFlows(messageFlows, context) {
+ forEach(messageFlows, contextual(handleMessageFlow, context));
+ }
+
+ function handleDataAssociation(association, context) {
+ visitIfDi(association, context);
+ }
+
+ function handleDataInput(dataInput, context) {
+ visitIfDi(dataInput, context);
+ }
+
+ function handleDataOutput(dataOutput, context) {
+ visitIfDi(dataOutput, context);
+ }
+
+ function handleArtifact(artifact, context) {
+
+ // bpmn:TextAnnotation
+ // bpmn:Group
+ // bpmn:Association
+
+ visitIfDi(artifact, context);
+ }
+
+ function handleArtifacts(artifacts, context) {
+
+ forEach(artifacts, function(e) {
+ if (is(e, 'bpmn:Association')) {
+ deferred.push(function() {
+ handleArtifact(e, context);
+ });
+ } else {
+ handleArtifact(e, context);
+ }
+ });
+ }
+
+ function handleIoSpecification(ioSpecification, context) {
+
+ if (!ioSpecification) {
+ return;
+ }
+
+ forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
+ forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
+ }
+
+ function handleSubProcess(subProcess, context) {
+ handleFlowElementsContainer(subProcess, context);
+ handleArtifacts(subProcess.artifacts, context);
+ }
+
+ function handleFlowNode(flowNode, context) {
+ var childCtx = visitIfDi(flowNode, context);
+
+ if (is(flowNode, 'bpmn:SubProcess')) {
+ handleSubProcess(flowNode, childCtx || context);
+ }
+ }
+
+ function handleSequenceFlow(sequenceFlow, context) {
+ visitIfDi(sequenceFlow, context);
+ }
+
+ function handleDataElement(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleBoundaryEvent(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleLane(lane, context) {
+ var newContext = visitIfDi(lane, context);
+
+ if (lane.childLaneSet) {
+ handleLaneSet(lane.childLaneSet, newContext || context);
+ } else {
+ var filterList = filter(lane.flowNodeRef, function(e) {
+ return e.$type !== 'bpmn:BoundaryEvent';
+ });
+ handleFlowElements(filterList, newContext || context);
+ }
+ }
+
+ function handleLaneSet(laneSet, context) {
+ forEach(laneSet.lanes, contextual(handleLane, context));
+ }
+
+ function handleLaneSets(laneSets, context) {
+ forEach(laneSets, contextual(handleLaneSet, context));
+ }
+
+ function handleFlowElementsContainer(container, context) {
+
+ if (container.laneSets) {
+ handleLaneSets(container.laneSets, context);
+ handleNonFlowNodes(container.flowElements);
+ } else {
+ handleFlowElements(container.flowElements, context);
+ }
+ }
+
+ function handleNonFlowNodes(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ }
+ });
+ }
+
+ function handleFlowElements(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:FlowNode')) {
+ handleFlowNode(e, context);
+
+ if (is(e, 'bpmn:Activity')) {
+
+ handleIoSpecification(e.ioSpecification, context);
+
+ // defer handling of associations
+ deferred.push(function() {
+ forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
+ forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
+ });
+ }
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ } else {
+ logError(
+ 'unrecognized flowElement ' + elementToString(e) + ' in context ' +
+ (context ? elementToString(context.businessObject) : null),
+ { element: e, context: context });
+ }
+ });
+ }
+
+ function handleParticipant(participant, context) {
+ var newCtx = visitIfDi(participant, context);
+
+ var process = participant.processRef;
+ if (process) {
+ handleProcess(process, newCtx || context);
+ }
+ }
+
+ function handleCollaboration(collaboration) {
+
+ forEach(collaboration.participants, contextual(handleParticipant));
+
+ handleArtifacts(collaboration.artifacts);
+
+ // handle message flows latest in the process
+ deferred.push(function() {
+ handleMessageFlows(collaboration.messageFlows);
+ });
+ }
+
+
+ ///// API ////////////////////////////////
+
+ return {
+ handleDefinitions: handleDefinitions
+ };
+}
+
+module.exports = BpmnTreeWalker;
+},{"202":202,"203":203,"204":204,"356":356,"43":43}],42:[function(_dereq_,module,exports){
+'use strict';
+
+var BpmnTreeWalker = _dereq_(41);
+
+
+/**
+ * Import the definitions into a diagram.
+ *
+ * Errors and warnings are reported through the specified callback.
+ *
+ * @param {Diagram} diagram
+ * @param {ModdleElement} definitions
+ * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done
+ */
+function importBpmnDiagram(diagram, definitions, done) {
+
+ var importer = diagram.get('bpmnImporter'),
+ eventBus = diagram.get('eventBus');
+
+ var error,
+ warnings = [];
+
+ function parse(definitions) {
+
+ var visitor = {
+
+ root: function(element) {
+ return importer.add(element);
+ },
+
+ element: function(element, parentShape) {
+ return importer.add(element, parentShape);
+ },
+
+ error: function(message, context) {
+ warnings.push({ message: message, context: context });
+ }
+ };
+
+ var walker = new BpmnTreeWalker(visitor);
+
+ // import
+ walker.handleDefinitions(definitions);
+ }
+
+ eventBus.fire('import.start');
+
+ try {
+ parse(definitions);
+ } catch (e) {
+ error = e;
+ }
+
+ eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });
+ done(error, warnings);
+}
+
+module.exports.importBpmnDiagram = importBpmnDiagram;
+},{"41":41}],43:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.elementToString = function(e) {
+ if (!e) {
+ return '<null>';
+ }
+
+ return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
+};
+},{}],44:[function(_dereq_,module,exports){
+module.exports = {
+ bpmnImporter: [ 'type', _dereq_(40) ]
+};
+},{"40":40}],45:[function(_dereq_,module,exports){
+'use strict';
+
+var is = _dereq_(47).is,
+ getBusinessObject = _dereq_(47).getBusinessObject;
+
+module.exports.isExpanded = function(element) {
+
+ if (is(element, 'bpmn:CallActivity')) {
+ return false;
+ }
+
+ if (is(element, 'bpmn:SubProcess')) {
+ return getBusinessObject(element).di.isExpanded;
+ }
+
+ if (is(element, 'bpmn:Participant')) {
+ return !!getBusinessObject(element).processRef;
+ }
+
+ return true;
+};
+
+},{"47":47}],46:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+
+var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
+ width: 90,
+ height: 20
+};
+
+
+/**
+ * Returns true if the given semantic has an external label
+ *
+ * @param {BpmnElement} semantic
+ * @return {Boolean} true if has label
+ */
+module.exports.hasExternalLabel = function(semantic) {
+
+ return semantic.$instanceOf('bpmn:Event') ||
+ semantic.$instanceOf('bpmn:Gateway') ||
+ semantic.$instanceOf('bpmn:DataStoreReference') ||
+ semantic.$instanceOf('bpmn:DataObjectReference') ||
+ semantic.$instanceOf('bpmn:SequenceFlow') ||
+ semantic.$instanceOf('bpmn:MessageFlow');
+};
+
+
+/**
+ * Get the middle of a number of waypoints
+ *
+ * @param {Array<Point>} waypoints
+ * @return {Point} the mid point
+ */
+var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
+
+ var mid = waypoints.length / 2 - 1;
+
+ var first = waypoints[Math.floor(mid)];
+ var second = waypoints[Math.ceil(mid + 0.01)];
+
+ return {
+ x: first.x + (second.x - first.x) / 2,
+ y: first.y + (second.y - first.y) / 2
+ };
+};
+
+
+var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
+
+ if (element.waypoints) {
+ return getWaypointsMid(element.waypoints);
+ } else {
+ return {
+ x: element.x + element.width / 2,
+ y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
+ };
+ }
+};
+
+/**
+ * Returns the bounds of an elements label, parsed from the elements DI or
+ * generated from its bounds.
+ *
+ * @param {BpmnElement} semantic
+ * @param {djs.model.Base} element
+ */
+module.exports.getExternalLabelBounds = function(semantic, element) {
+
+ var mid,
+ size,
+ bounds,
+ di = semantic.di,
+ label = di.label;
+
+ if (label && label.bounds) {
+ bounds = label.bounds;
+
+ size = {
+ width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
+ height: bounds.height
+ };
+
+ mid = {
+ x: bounds.x + bounds.width / 2,
+ y: bounds.y + bounds.height / 2
+ };
+ } else {
+
+ mid = getExternalLabelMid(element);
+
+ size = DEFAULT_LABEL_SIZE;
+ }
+
+ return assign({
+ x: mid.x - size.width / 2,
+ y: mid.y - size.height / 2
+ }, size);
+};
+},{"325":325}],47:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Is an element of the given BPMN type?
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ var bo = getBusinessObject(element);
+
+ return bo && bo.$instanceOf(type);
+}
+
+module.exports.is = is;
+
+
+/**
+ * Return the business object for a given element.
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ *
+ * @return {ModdleElement}
+ */
+function getBusinessObject(element) {
+ return (element && element.businessObject) || element;
+}
+
+module.exports.getBusinessObject = getBusinessObject;
+
+},{}],48:[function(_dereq_,module,exports){
+module.exports = _dereq_(51);
+},{"51":51}],49:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(322),
+ isFunction = _dereq_(317),
+ assign = _dereq_(325);
+
+var Moddle = _dereq_(57),
+ XmlReader = _dereq_(53),
+ XmlWriter = _dereq_(54);
+
+/**
+ * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.
+ *
+ * @class BpmnModdle
+ * @extends Moddle
+ *
+ * @param {Object|Array} packages to use for instantiating the model
+ * @param {Object} [options] additional options to pass over
+ */
+function BpmnModdle(packages, options) {
+ Moddle.call(this, packages, options);
+}
+
+BpmnModdle.prototype = Object.create(Moddle.prototype);
+
+module.exports = BpmnModdle;
+
+
+/**
+ * Instantiates a BPMN model tree from a given xml string.
+ *
+ * @param {String} xmlStr
+ * @param {String} [typeName='bpmn:Definitions'] name of the root element
+ * @param {Object} [options] options to pass to the underlying reader
+ * @param {Function} done callback that is invoked with (err, result, parseContext)
+ * once the import completes
+ */
+BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
+
+ if (!isString(typeName)) {
+ done = options;
+ options = typeName;
+ typeName = 'bpmn:Definitions';
+ }
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var reader = new XmlReader(assign({ model: this, lax: true }, options));
+ var rootHandler = reader.handler(typeName);
+
+ reader.fromXML(xmlStr, rootHandler, done);
+};
+
+
+/**
+ * Serializes a BPMN 2.0 object tree to XML.
+ *
+ * @param {String} element the root element, typically an instance of `bpmn:Definitions`
+ * @param {Object} [options] to pass to the underlying writer
+ * @param {Function} done callback invoked with (err, xmlStr) once the import completes
+ */
+BpmnModdle.prototype.toXML = function(element, options, done) {
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var writer = new XmlWriter(options);
+ try {
+ var result = writer.toXML(element);
+ done(null, result);
+ } catch (e) {
+ done(e);
+ }
+};
+
+},{"317":317,"322":322,"325":325,"53":53,"54":54,"57":57}],50:[function(_dereq_,module,exports){
+'use strict';
+
+var ID_PATTERN = /^(.*:)?id$/;
+
+/**
+ * Extends the bpmn instance with id support.
+ *
+ * @example
+ *
+ * var moddle, ids;
+ *
+ * require('id-support').extend(moddle, ids);
+ *
+ * moddle.ids.next(); // create a next id
+ * moddle.ids; // ids instance
+ *
+ * // claims id as used
+ * moddle.create('foo:Bar', { id: 'fooobar1' });
+ *
+ *
+ * @param {Moddle} model
+ * @param {Ids} ids
+ *
+ * @return {Moddle} the extended moddle instance
+ */
+module.exports.extend = function(model, ids) {
+
+ var set = model.properties.set;
+
+ // do not reinitialize setter
+ // unless it is already initialized
+ if (!model.ids) {
+
+ model.properties.set = function(target, property, value) {
+
+ // ensure we log used ids once they are assigned
+ // to model elements
+ if (ID_PATTERN.test(property)) {
+
+ var assigned = model.ids.assigned(value);
+ if (assigned && assigned !== target) {
+ throw new Error('id <' + value + '> already used');
+ }
+
+ model.ids.claim(value, target);
+ }
+
+ set.call(this, target, property, value);
+ };
+ }
+
+ model.ids = ids;
+
+ return model;
+};
+},{}],51:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+var BpmnModdle = _dereq_(49);
+
+var packages = {
+ bpmn: _dereq_(66),
+ bpmndi: _dereq_(67),
+ dc: _dereq_(68),
+ di: _dereq_(69)
+};
+
+module.exports = function(additionalPackages, options) {
+ return new BpmnModdle(assign({}, packages, additionalPackages), options);
+};
+},{"325":325,"49":49,"66":66,"67":67,"68":68,"69":69}],52:[function(_dereq_,module,exports){
+'use strict';
+
+function capitalize(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+}
+
+function lower(string) {
+ return string.charAt(0).toLowerCase() + string.slice(1);
+}
+
+function hasLowerCaseAlias(pkg) {
+ return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
+}
+
+
+module.exports.aliasToName = function(alias, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return capitalize(alias);
+ } else {
+ return alias;
+ }
+};
+
+module.exports.nameToAlias = function(name, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return lower(name);
+ } else {
+ return name;
+ }
+};
+
+module.exports.DEFAULT_NS_MAP = {
+ 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
+};
+
+module.exports.XSI_TYPE = 'xsi:type';
+},{}],53:[function(_dereq_,module,exports){
+'use strict';
+
+var reduce = _dereq_(208),
+ forEach = _dereq_(204),
+ find = _dereq_(203),
+ assign = _dereq_(325),
+ defer = _dereq_(215);
+
+var Stack = _dereq_(56),
+ SaxParser = _dereq_(55).parser,
+ Moddle = _dereq_(57),
+ parseNameNs = _dereq_(62).parseName,
+ Types = _dereq_(65),
+ coerceType = Types.coerceType,
+ isSimpleType = Types.isSimple,
+ common = _dereq_(52),
+ XSI_TYPE = common.XSI_TYPE,
+ XSI_URI = common.DEFAULT_NS_MAP.xsi,
+ aliasToName = common.aliasToName;
+
+function parseNodeAttributes(node) {
+ var nodeAttrs = node.attributes;
+
+ return reduce(nodeAttrs, function(result, v, k) {
+ var name, ns;
+
+ if (!v.local) {
+ name = v.prefix;
+ } else {
+ ns = parseNameNs(v.name, v.prefix);
+ name = ns.name;
+ }
+
+ result[name] = v.value;
+ return result;
+ }, {});
+}
+
+function normalizeType(node, attr, model) {
+ var nameNs = parseNameNs(attr.value);
+
+ var uri = node.ns[nameNs.prefix || ''],
+ localName = nameNs.localName,
+ pkg = uri && model.getPackage(uri),
+ typePrefix;
+
+ if (pkg) {
+ typePrefix = pkg.xml && pkg.xml.typePrefix;
+
+ if (typePrefix && localName.indexOf(typePrefix) === 0) {
+ localName = localName.slice(typePrefix.length);
+ }
+
+ attr.value = pkg.prefix + ':' + localName;
+ }
+}
+
+/**
+ * Normalizes namespaces for a node given an optional default namespace and a
+ * number of mappings from uris to default prefixes.
+ *
+ * @param {XmlNode} node
+ * @param {Model} model the model containing all registered namespaces
+ * @param {Uri} defaultNsUri
+ */
+function normalizeNamespaces(node, model, defaultNsUri) {
+ var uri, prefix;
+
+ uri = node.uri || defaultNsUri;
+
+ if (uri) {
+ var pkg = model.getPackage(uri);
+
+ if (pkg) {
+ prefix = pkg.prefix;
+ } else {
+ prefix = node.prefix;
+ }
+
+ node.prefix = prefix;
+ node.uri = uri;
+ }
+
+ forEach(node.attributes, function(attr) {
+
+ // normalize xsi:type attributes because the
+ // assigned type may or may not be namespace prefixed
+ if (attr.uri === XSI_URI && attr.local === 'type') {
+ normalizeType(node, attr, model);
+ }
+
+ normalizeNamespaces(attr, model, null);
+ });
+}
+
+
+/**
+ * A parse context.
+ *
+ * @class
+ *
+ * @param {Object} options
+ * @param {ElementHandler} options.parseRoot the root handler for parsing a document
+ * @param {boolean} [options.lax=false] whether or not to ignore invalid elements
+ */
+function Context(options) {
+
+ /**
+ * @property {ElementHandler} parseRoot
+ */
+
+ /**
+ * @property {Boolean} lax
+ */
+
+ assign(this, options);
+
+ var elementsById = this.elementsById = {};
+ var references = this.references = [];
+ var warnings = this.warnings = [];
+
+ this.addReference = function(reference) {
+ references.push(reference);
+ };
+
+ this.addElement = function(id, element) {
+
+ if (!id || !element) {
+ throw new Error('[xml-reader] id or ctx must not be null');
+ }
+
+ elementsById[id] = element;
+ };
+
+ this.addWarning = function (w) {
+ warnings.push(w);
+ };
+}
+
+function BaseHandler() {}
+
+BaseHandler.prototype.handleEnd = function() {};
+BaseHandler.prototype.handleText = function() {};
+BaseHandler.prototype.handleNode = function() {};
+
+
+/**
+ * A simple pass through handler that does nothing except for
+ * ignoring all input it receives.
+ *
+ * This is used to ignore unknown elements and
+ * attributes.
+ */
+function NoopHandler() { }
+
+NoopHandler.prototype = new BaseHandler();
+
+NoopHandler.prototype.handleNode = function() {
+ return this;
+};
+
+function BodyHandler() {}
+
+BodyHandler.prototype = new BaseHandler();
+
+BodyHandler.prototype.handleText = function(text) {
+ this.body = (this.body || '') + text;
+};
+
+function ReferenceHandler(property, context) {
+ this.property = property;
+ this.context = context;
+}
+
+ReferenceHandler.prototype = new BodyHandler();
+
+ReferenceHandler.prototype.handleNode = function(node) {
+
+ if (this.element) {
+ throw new Error('expected no sub nodes');
+ } else {
+ this.element = this.createReference(node);
+ }
+
+ return this;
+};
+
+ReferenceHandler.prototype.handleEnd = function() {
+ this.element.id = this.body;
+};
+
+ReferenceHandler.prototype.createReference = function() {
+ return {
+ property: this.property.ns.name,
+ id: ''
+ };
+};
+
+function ValueHandler(propertyDesc, element) {
+ this.element = element;
+ this.propertyDesc = propertyDesc;
+}
+
+ValueHandler.prototype = new BodyHandler();
+
+ValueHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ propertyDesc = this.propertyDesc;
+
+ value = coerceType(propertyDesc.type, value);
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(value);
+ } else {
+ element.set(propertyDesc.name, value);
+ }
+};
+
+
+function BaseElementHandler() {}
+
+BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
+
+BaseElementHandler.prototype.handleNode = function(node) {
+ var parser = this,
+ element = this.element,
+ id;
+
+ if (!element) {
+ element = this.element = this.createElement(node);
+ id = element.id;
+
+ if (id) {
+ this.context.addElement(id, element);
+ }
+ } else {
+ parser = this.handleChild(node);
+ }
+
+ return parser;
+};
+
+/**
+ * @class XMLReader.ElementHandler
+ *
+ */
+function ElementHandler(model, type, context) {
+ this.model = model;
+ this.type = model.getType(type);
+ this.context = context;
+}
+
+ElementHandler.prototype = new BaseElementHandler();
+
+ElementHandler.prototype.addReference = function(reference) {
+ this.context.addReference(reference);
+};
+
+ElementHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ descriptor = element.$descriptor,
+ bodyProperty = descriptor.bodyProperty;
+
+ if (bodyProperty && value !== undefined) {
+ value = coerceType(bodyProperty.type, value);
+ element.set(bodyProperty.name, value);
+ }
+};
+
+/**
+ * Create an instance of the model from the given node.
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.createElement = function(node) {
+ var attributes = parseNodeAttributes(node),
+ Type = this.type,
+ descriptor = Type.$descriptor,
+ context = this.context,
+ instance = new Type({});
+
+ forEach(attributes, function(value, name) {
+
+ var prop = descriptor.propertiesByName[name];
+
+ if (prop && prop.isReference) {
+ context.addReference({
+ element: instance,
+ property: prop.ns.name,
+ id: value
+ });
+ } else {
+ if (prop) {
+ value = coerceType(prop.type, value);
+ }
+
+ instance.set(name, value);
+ }
+ });
+
+ return instance;
+};
+
+ElementHandler.prototype.getPropertyForNode = function(node) {
+
+ var nameNs = parseNameNs(node.local, node.prefix);
+
+ var type = this.type,
+ model = this.model,
+ descriptor = type.$descriptor;
+
+ var propertyName = nameNs.name,
+ property = descriptor.propertiesByName[propertyName],
+ elementTypeName,
+ elementType,
+ typeAnnotation;
+
+ // search for properties by name first
+
+ if (property) {
+
+ if (property.serialize === XSI_TYPE) {
+ typeAnnotation = node.attributes[XSI_TYPE];
+
+ // xsi type is optional, if it does not exists the
+ // default type is assumed
+ if (typeAnnotation) {
+
+ elementTypeName = typeAnnotation.value;
+
+ // TODO: extract real name from attribute
+ elementType = model.getType(elementTypeName);
+
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ }
+
+ // search for properties by name first
+ return property;
+ }
+
+
+ var pkg = model.getPackage(nameNs.prefix);
+
+ if (pkg) {
+ elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
+ elementType = model.getType(elementTypeName);
+
+ // search for collection members later
+ property = find(descriptor.properties, function(p) {
+ return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
+ });
+
+ if (property) {
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ } else {
+ // parse unknown element (maybe extension)
+ property = find(descriptor.properties, function(p) {
+ return !p.isReference && !p.isAttribute && p.type === 'Element';
+ });
+
+ if (property) {
+ return property;
+ }
+ }
+
+ throw new Error('unrecognized element <' + nameNs.name + '>');
+};
+
+ElementHandler.prototype.toString = function() {
+ return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
+};
+
+ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
+ return new ValueHandler(propertyDesc, element);
+};
+
+ElementHandler.prototype.referenceHandler = function(propertyDesc) {
+ return new ReferenceHandler(propertyDesc, this.context);
+};
+
+ElementHandler.prototype.handler = function(type) {
+ if (type === 'Element') {
+ return new GenericElementHandler(this.model, type, this.context);
+ } else {
+ return new ElementHandler(this.model, type, this.context);
+ }
+};
+
+/**
+ * Handle the child element parsing
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.handleChild = function(node) {
+ var propertyDesc, type, element, childHandler;
+
+ propertyDesc = this.getPropertyForNode(node);
+ element = this.element;
+
+ type = propertyDesc.effectiveType || propertyDesc.type;
+
+ if (isSimpleType(type)) {
+ return this.valueHandler(propertyDesc, element);
+ }
+
+ if (propertyDesc.isReference) {
+ childHandler = this.referenceHandler(propertyDesc).handleNode(node);
+ } else {
+ childHandler = this.handler(type).handleNode(node);
+ }
+
+ var newElement = childHandler.element;
+
+ // child handles may decide to skip elements
+ // by not returning anything
+ if (newElement !== undefined) {
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(newElement);
+ } else {
+ element.set(propertyDesc.name, newElement);
+ }
+
+ if (propertyDesc.isReference) {
+ assign(newElement, {
+ element: element
+ });
+
+ this.context.addReference(newElement);
+ } else {
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+ }
+
+ return childHandler;
+};
+
+
+function GenericElementHandler(model, type, context) {
+ this.model = model;
+ this.context = context;
+}
+
+GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
+
+GenericElementHandler.prototype.createElement = function(node) {
+
+ var name = node.name,
+ prefix = node.prefix,
+ uri = node.ns[prefix],
+ attributes = node.attributes;
+
+ return this.model.createAny(name, uri, attributes);
+};
+
+GenericElementHandler.prototype.handleChild = function(node) {
+
+ var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
+ element = this.element;
+
+ var newElement = handler.element,
+ children;
+
+ if (newElement !== undefined) {
+ children = element.$children = element.$children || [];
+ children.push(newElement);
+
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+
+ return handler;
+};
+
+GenericElementHandler.prototype.handleText = function(text) {
+ this.body = this.body || '' + text;
+};
+
+GenericElementHandler.prototype.handleEnd = function() {
+ if (this.body) {
+ this.element.$body = this.body;
+ }
+};
+
+/**
+ * A reader for a meta-model
+ *
+ * @param {Object} options
+ * @param {Model} options.model used to read xml files
+ * @param {Boolean} options.lax whether to make parse errors warnings
+ */
+function XMLReader(options) {
+
+ if (options instanceof Moddle) {
+ options = {
+ model: options
+ };
+ }
+
+ assign(this, { lax: false }, options);
+}
+
+
+XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
+
+ var model = this.model,
+ lax = this.lax,
+ context = new Context({
+ parseRoot: rootHandler
+ });
+
+ var parser = new SaxParser(true, { xmlns: true, trim: true }),
+ stack = new Stack();
+
+ rootHandler.context = context;
+
+ // push root handler
+ stack.push(rootHandler);
+
+
+ function resolveReferences() {
+
+ var elementsById = context.elementsById;
+ var references = context.references;
+
+ var i, r;
+
+ for (i = 0; !!(r = references[i]); i++) {
+ var element = r.element;
+ var reference = elementsById[r.id];
+ var property = element.$descriptor.propertiesByName[r.property];
+
+ if (!reference) {
+ context.addWarning({
+ message: 'unresolved reference <' + r.id + '>',
+ element: r.element,
+ property: r.property,
+ value: r.id
+ });
+ }
+
+ if (property.isMany) {
+ var collection = element.get(property.name),
+ idx = collection.indexOf(r);
+
+ if (!reference) {
+ // remove unresolvable reference
+ collection.splice(idx, 1);
+ } else {
+ // update reference
+ collection[idx] = reference;
+ }
+ } else {
+ element.set(property.name, reference);
+ }
+ }
+ }
+
+ function handleClose(tagName) {
+ stack.pop().handleEnd();
+ }
+
+ function handleOpen(node) {
+ var handler = stack.peek();
+
+ normalizeNamespaces(node, model);
+
+ try {
+ stack.push(handler.handleNode(node));
+ } catch (e) {
+
+ var line = this.line,
+ column = this.column;
+
+ var message =
+ 'unparsable content <' + node.name + '> detected\n\t' +
+ 'line: ' + line + '\n\t' +
+ 'column: ' + column + '\n\t' +
+ 'nested error: ' + e.message;
+
+ if (lax) {
+ context.addWarning({
+ message: message,
+ error: e
+ });
+
+ console.warn('could not parse node');
+ console.warn(e);
+
+ stack.push(new NoopHandler());
+ } else {
+ console.error('could not parse document');
+ console.error(e);
+
+ throw new Error(message);
+ }
+ }
+ }
+
+ function handleText(text) {
+ stack.peek().handleText(text);
+ }
+
+ parser.onopentag = handleOpen;
+ parser.oncdata = parser.ontext = handleText;
+ parser.onclosetag = handleClose;
+ parser.onend = resolveReferences;
+
+ // deferred parse XML to make loading really ascnchronous
+ // this ensures the execution environment (node or browser)
+ // is kept responsive and that certain optimization strategies
+ // can kick in
+ defer(function() {
+ var error;
+
+ try {
+ parser.write(xml).close();
+ } catch (e) {
+ error = e;
+ }
+
+ done(error, error ? undefined : rootHandler.element, context);
+ });
+};
+
+XMLReader.prototype.handler = function(name) {
+ return new ElementHandler(this.model, name);
+};
+
+module.exports = XMLReader;
+module.exports.ElementHandler = ElementHandler;
+},{"203":203,"204":204,"208":208,"215":215,"325":325,"52":52,"55":55,"56":56,"57":57,"62":62,"65":65}],54:[function(_dereq_,module,exports){
+'use strict';
+
+var map = _dereq_(207),
+ forEach = _dereq_(204),
+ isString = _dereq_(322),
+ filter = _dereq_(202),
+ assign = _dereq_(325);
+
+var Types = _dereq_(65),
+ parseNameNs = _dereq_(62).parseName,
+ common = _dereq_(52),
+ nameToAlias = common.nameToAlias;
+
+var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
+ ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
+ DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
+ XSI_TYPE = common.XSI_TYPE;
+
+
+function nsName(ns) {
+ if (isString(ns)) {
+ return ns;
+ } else {
+ return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
+ }
+}
+
+function getElementNs(ns, descriptor) {
+ if (descriptor.isGeneric) {
+ return descriptor.name;
+ } else {
+ return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
+ }
+}
+
+function getPropertyNs(ns, descriptor) {
+ return assign({ localName: descriptor.ns.localName }, ns);
+}
+
+function getSerializableProperties(element) {
+ var descriptor = element.$descriptor;
+
+ return filter(descriptor.properties, function(p) {
+ var name = p.name;
+
+ // do not serialize defaults
+ if (!element.hasOwnProperty(name)) {
+ return false;
+ }
+
+ var value = element[name];
+
+ // do not serialize default equals
+ if (value === p.default) {
+ return false;
+ }
+
+ return p.isMany ? value.length : true;
+ });
+}
+
+var ESCAPE_MAP = {
+ '\n': '10',
+ '\n\r': '10',
+ '"': '34',
+ '\'': '39',
+ '<': '60',
+ '>': '62',
+ '&': '38'
+};
+
+/**
+ * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
+ *
+ * @param {String} str the string to escape
+ * @return {String} the escaped string
+ */
+function escapeAttr(str) {
+
+ // ensure we are handling strings here
+ str = isString(str) ? str : '' + str;
+
+ return str.replace(ESCAPE_CHARS, function(str) {
+ return '&#' + ESCAPE_MAP[str] + ';';
+ });
+}
+
+function filterAttributes(props) {
+ return filter(props, function(p) { return p.isAttr; });
+}
+
+function filterContained(props) {
+ return filter(props, function(p) { return !p.isAttr; });
+}
+
+
+function ReferenceSerializer(parent, ns) {
+ this.ns = ns;
+}
+
+ReferenceSerializer.prototype.build = function(element) {
+ this.element = element;
+ return this;
+};
+
+ReferenceSerializer.prototype.serializeTo = function(writer) {
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function BodySerializer() {}
+
+BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
+ var escape = this.escape;
+
+ if (escape) {
+ writer.append('<![CDATA[');
+ }
+
+ writer.append(this.value);
+
+ if (escape) {
+ writer.append(']]>');
+ }
+};
+
+BodySerializer.prototype.build = function(prop, value) {
+ this.value = value;
+
+ if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
+ this.escape = true;
+ }
+
+ return this;
+};
+
+function ValueSerializer(ns) {
+ this.ns = ns;
+}
+
+ValueSerializer.prototype = new BodySerializer();
+
+ValueSerializer.prototype.serializeTo = function(writer) {
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>');
+
+ this.serializeValue(writer);
+
+ writer
+ .append( '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function ElementSerializer(parent, ns) {
+ this.body = [];
+ this.attrs = [];
+
+ this.parent = parent;
+ this.ns = ns;
+}
+
+ElementSerializer.prototype.build = function(element) {
+ this.element = element;
+
+ var otherAttrs = this.parseNsAttributes(element);
+
+ if (!this.ns) {
+ this.ns = this.nsTagName(element.$descriptor);
+ }
+
+ if (element.$descriptor.isGeneric) {
+ this.parseGeneric(element);
+ } else {
+ var properties = getSerializableProperties(element);
+
+ this.parseAttributes(filterAttributes(properties));
+ this.parseContainments(filterContained(properties));
+
+ this.parseGenericAttributes(element, otherAttrs);
+ }
+
+ return this;
+};
+
+ElementSerializer.prototype.nsTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getElementNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getPropertyNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.ns.uri;
+};
+
+ElementSerializer.prototype.nsAttributeName = function(element) {
+
+ var ns;
+
+ if (isString(element)) {
+ ns = parseNameNs(element);
+ } else
+ if (element.ns) {
+ ns = element.ns;
+ }
+
+ var effectiveNs = this.logNamespaceUsed(ns);
+
+ // strip prefix if same namespace like parent
+ if (this.isLocalNs(effectiveNs)) {
+ return { localName: ns.localName };
+ } else {
+ return assign({ localName: ns.localName }, effectiveNs);
+ }
+};
+
+ElementSerializer.prototype.parseGeneric = function(element) {
+
+ var self = this,
+ body = this.body,
+ attrs = this.attrs;
+
+ forEach(element, function(val, key) {
+
+ if (key === '$body') {
+ body.push(new BodySerializer().build({ type: 'String' }, val));
+ } else
+ if (key === '$children') {
+ forEach(val, function(child) {
+ body.push(new ElementSerializer(self).build(child));
+ });
+ } else
+ if (key.indexOf('$') !== 0) {
+ attrs.push({ name: key, value: escapeAttr(val) });
+ }
+ });
+};
+
+/**
+ * Parse namespaces and return a list of left over generic attributes
+ *
+ * @param {Object} element
+ * @return {Array<Object>}
+ */
+ElementSerializer.prototype.parseNsAttributes = function(element) {
+ var self = this;
+
+ var genericAttrs = element.$attrs;
+
+ var attributes = [];
+
+ // parse namespace attributes first
+ // and log them. push non namespace attributes to a list
+ // and process them later
+ forEach(genericAttrs, function(value, name) {
+ var nameNs = parseNameNs(name);
+
+ if (nameNs.prefix === 'xmlns') {
+ self.logNamespace({ prefix: nameNs.localName, uri: value });
+ } else
+ if (!nameNs.prefix && nameNs.localName === 'xmlns') {
+ self.logNamespace({ uri: value });
+ } else {
+ attributes.push({ name: name, value: value });
+ }
+ });
+
+ return attributes;
+};
+
+ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
+
+ var self = this;
+
+ forEach(attributes, function(attr) {
+
+ // do not serialize xsi:type attribute
+ // it is set manually based on the actual implementation type
+ if (attr.name === XSI_TYPE) {
+ return;
+ }
+
+ try {
+ self.addAttribute(self.nsAttributeName(attr.name), attr.value);
+ } catch (e) {
+ console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
+ }
+ });
+};
+
+ElementSerializer.prototype.parseContainments = function(properties) {
+
+ var self = this,
+ body = this.body,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ var value = element.get(p.name),
+ isReference = p.isReference,
+ isMany = p.isMany;
+
+ var ns = self.nsPropertyTagName(p);
+
+ if (!isMany) {
+ value = [ value ];
+ }
+
+ if (p.isBody) {
+ body.push(new BodySerializer().build(p, value[0]));
+ } else
+ if (Types.isSimple(p.type)) {
+ forEach(value, function(v) {
+ body.push(new ValueSerializer(ns).build(p, v));
+ });
+ } else
+ if (isReference) {
+ forEach(value, function(v) {
+ body.push(new ReferenceSerializer(self, ns).build(v));
+ });
+ } else {
+ // allow serialization via type
+ // rather than element name
+ var asType = p.serialize === XSI_TYPE;
+
+ forEach(value, function(v) {
+ var serializer;
+
+ if (asType) {
+ serializer = new TypeSerializer(self, ns);
+ } else {
+ serializer = new ElementSerializer(self);
+ }
+
+ body.push(serializer.build(v));
+ });
+ }
+ });
+};
+
+ElementSerializer.prototype.getNamespaces = function() {
+ if (!this.parent) {
+ if (!this.namespaces) {
+ this.namespaces = {
+ prefixMap: {},
+ uriMap: {},
+ used: {}
+ };
+ }
+ } else {
+ this.namespaces = this.parent.getNamespaces();
+ }
+
+ return this.namespaces;
+};
+
+ElementSerializer.prototype.logNamespace = function(ns) {
+ var namespaces = this.getNamespaces();
+
+ var existing = namespaces.uriMap[ns.uri];
+
+ if (!existing) {
+ namespaces.uriMap[ns.uri] = ns;
+ }
+
+ namespaces.prefixMap[ns.prefix] = ns.uri;
+
+ return ns;
+};
+
+ElementSerializer.prototype.logNamespaceUsed = function(ns) {
+ var element = this.element,
+ model = element.$model,
+ namespaces = this.getNamespaces();
+
+ // ns may be
+ //
+ // * prefix only
+ // * prefix:uri
+
+ var prefix = ns.prefix;
+ var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
+ namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
+
+ if (!uri) {
+ throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
+ }
+
+ ns = namespaces.uriMap[uri];
+
+ if (!ns) {
+ ns = this.logNamespace({ prefix: prefix, uri: uri });
+ }
+
+ if (!namespaces.used[ns.uri]) {
+ namespaces.used[ns.uri] = ns;
+ }
+
+ return ns;
+};
+
+ElementSerializer.prototype.parseAttributes = function(properties) {
+ var self = this,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ self.logNamespaceUsed(p.ns);
+
+ var value = element.get(p.name);
+
+ if (p.isReference) {
+ value = value.id;
+ }
+
+ self.addAttribute(self.nsAttributeName(p), value);
+ });
+};
+
+ElementSerializer.prototype.addAttribute = function(name, value) {
+ var attrs = this.attrs;
+
+ if (isString(value)) {
+ value = escapeAttr(value);
+ }
+
+ attrs.push({ name: name, value: value });
+};
+
+ElementSerializer.prototype.serializeAttributes = function(writer) {
+ var attrs = this.attrs,
+ root = !this.parent,
+ namespaces = this.namespaces;
+
+ function collectNsAttrs() {
+ return map(namespaces.used, function(ns) {
+ var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
+ return { name: name, value: ns.uri };
+ });
+ }
+
+ if (root) {
+ attrs = collectNsAttrs().concat(attrs);
+ }
+
+ forEach(attrs, function(a) {
+ writer
+ .append(' ')
+ .append(nsName(a.name)).append('="').append(a.value).append('"');
+ });
+};
+
+ElementSerializer.prototype.serializeTo = function(writer) {
+ var hasBody = this.body.length,
+ indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns));
+
+ this.serializeAttributes(writer);
+
+ writer.append(hasBody ? '>' : ' />');
+
+ if (hasBody) {
+
+ if (indent) {
+ writer
+ .appendNewLine()
+ .indent();
+ }
+
+ forEach(this.body, function(b) {
+ b.serializeTo(writer);
+ });
+
+ if (indent) {
+ writer
+ .unindent()
+ .appendIndent();
+ }
+
+ writer.append('</' + nsName(this.ns) + '>');
+ }
+
+ writer.appendNewLine();
+};
+
+/**
+ * A serializer for types that handles serialization of data types
+ */
+function TypeSerializer(parent, ns) {
+ ElementSerializer.call(this, parent, ns);
+}
+
+TypeSerializer.prototype = new ElementSerializer();
+
+TypeSerializer.prototype.build = function(element) {
+ var descriptor = element.$descriptor;
+
+ this.element = element;
+
+ this.typeNs = this.nsTagName(descriptor);
+
+ // add xsi:type attribute to represent the elements
+ // actual type
+
+ var typeNs = this.typeNs,
+ pkg = element.$model.getPackage(typeNs.uri),
+ typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
+
+ this.addAttribute(this.nsAttributeName(XSI_TYPE),
+ (typeNs.prefix ? typeNs.prefix + ':' : '') +
+ typePrefix + descriptor.ns.localName);
+
+ // do the usual stuff
+ return ElementSerializer.prototype.build.call(this, element);
+};
+
+TypeSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.typeNs.uri;
+};
+
+function SavingWriter() {
+ this.value = '';
+
+ this.write = function(str) {
+ this.value += str;
+ };
+}
+
+function FormatingWriter(out, format) {
+
+ var indent = [''];
+
+ this.append = function(str) {
+ out.write(str);
+
+ return this;
+ };
+
+ this.appendNewLine = function() {
+ if (format) {
+ out.write('\n');
+ }
+
+ return this;
+ };
+
+ this.appendIndent = function() {
+ if (format) {
+ out.write(indent.join(' '));
+ }
+
+ return this;
+ };
+
+ this.indent = function() {
+ indent.push('');
+ return this;
+ };
+
+ this.unindent = function() {
+ indent.pop();
+ return this;
+ };
+}
+
+/**
+ * A writer for meta-model backed document trees
+ *
+ * @param {Object} options output options to pass into the writer
+ */
+function XMLWriter(options) {
+
+ options = assign({ format: false, preamble: true }, options || {});
+
+ function toXML(tree, writer) {
+ var internalWriter = writer || new SavingWriter();
+ var formatingWriter = new FormatingWriter(internalWriter, options.format);
+
+ if (options.preamble) {
+ formatingWriter.append(XML_PREAMBLE);
+ }
+
+ new ElementSerializer().build(tree).serializeTo(formatingWriter);
+
+ if (!writer) {
+ return internalWriter.value;
+ }
+ }
+
+ return {
+ toXML: toXML
+ };
+}
+
+module.exports = XMLWriter;
+},{"202":202,"204":204,"207":207,"322":322,"325":325,"52":52,"62":62,"65":65}],55:[function(_dereq_,module,exports){
+(function (Buffer){
+// wrapper for non-node envs
+;(function (sax) {
+
+sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+sax.SAXParser = SAXParser
+sax.SAXStream = SAXStream
+sax.createStream = createStream
+
+// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+// since that's the earliest that a buffer overrun could occur. This way, checks are
+// as rare as required, but as often as necessary to ensure never crossing this bound.
+// Furthermore, buffers are only tested at most once per write(), so passing a very
+// large string into write() might have undesirable effects, but this is manageable by
+// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+// edge case, result in creating at most one complete copy of the string passed in.
+// Set to Infinity to have unlimited buffers.
+sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+var buffers = [
+ "comment", "sgmlDecl", "textNode", "tagName", "doctype",
+ "procInstName", "procInstBody", "entity", "attribName",
+ "attribValue", "cdata", "script"
+]
+
+sax.EVENTS = // for discoverability.
+ [ "text"
+ , "processinginstruction"
+ , "sgmldeclaration"
+ , "doctype"
+ , "comment"
+ , "attribute"
+ , "opentag"
+ , "closetag"
+ , "opencdata"
+ , "cdata"
+ , "closecdata"
+ , "error"
+ , "end"
+ , "ready"
+ , "script"
+ , "opennamespace"
+ , "closenamespace"
+ ]
+
+function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ""
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.ENTITIES = Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, "onready")
+}
+
+if (!Object.create) Object.create = function (o) {
+ function f () { this.__proto__ = o }
+ f.prototype = o
+ return new f
+}
+
+if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {
+ return o.__proto__
+}
+
+if (!Object.keys) Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+}
+
+function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ , maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case "textNode":
+ closeText(parser)
+ break
+
+ case "cdata":
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ break
+
+ case "script":
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ break
+
+ default:
+ error(parser, "Max buffer length exceeded: "+buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)
+ + parser.position
+}
+
+function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ parser[buffers[i]] = ""
+ }
+}
+
+function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== "") {
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ }
+ if (parser.script !== "") {
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+}
+
+SAXParser.prototype =
+ { end: function () { end(this) }
+ , write: write
+ , resume: function () { this.error = null; return this }
+ , close: function () { return this.write(null) }
+ , flush: function () { flushBuffers(this) }
+ }
+
+try {
+ var Stream = _dereq_("stream").Stream
+} catch (ex) {
+ var Stream = function () {}
+}
+
+
+var streamWraps = sax.EVENTS.filter(function (ev) {
+ return ev !== "error" && ev !== "end"
+})
+
+function createStream (strict, opt) {
+ return new SAXStream(strict, opt)
+}
+
+function SAXStream (strict, opt) {
+ if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
+
+ Stream.apply(this)
+
+ this._parser = new SAXParser(strict, opt)
+ this.writable = true
+ this.readable = true
+
+
+ var me = this
+
+ this._parser.onend = function () {
+ me.emit("end")
+ }
+
+ this._parser.onerror = function (er) {
+ me.emit("error", er)
+
+ // if didn't throw, then means error was handled.
+ // go ahead and clear error, so we can write again.
+ me._parser.error = null
+ }
+
+ this._decoder = null;
+
+ streamWraps.forEach(function (ev) {
+ Object.defineProperty(me, "on" + ev, {
+ get: function () { return me._parser["on" + ev] },
+ set: function (h) {
+ if (!h) {
+ me.removeAllListeners(ev)
+ return me._parser["on"+ev] = h
+ }
+ me.on(ev, h)
+ },
+ enumerable: true,
+ configurable: false
+ })
+ })
+}
+
+SAXStream.prototype = Object.create(Stream.prototype,
+ { constructor: { value: SAXStream } })
+
+SAXStream.prototype.write = function (data) {
+ if (typeof Buffer === 'function' &&
+ typeof Buffer.isBuffer === 'function' &&
+ Buffer.isBuffer(data)) {
+ if (!this._decoder) {
+ var SD = _dereq_('string_decoder').StringDecoder
+ this._decoder = new SD('utf8')
+ }
+ data = this._decoder.write(data);
+ }
+
+ this._parser.write(data.toString())
+ this.emit("data", data)
+ return true
+}
+
+SAXStream.prototype.end = function (chunk) {
+ if (chunk && chunk.length) this.write(chunk)
+ this._parser.end()
+ return true
+}
+
+SAXStream.prototype.on = function (ev, handler) {
+ var me = this
+ if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) {
+ me._parser["on"+ev] = function () {
+ var args = arguments.length === 1 ? [arguments[0]]
+ : Array.apply(null, arguments)
+ args.splice(0, 0, ev)
+ me.emit.apply(me, args)
+ }
+ }
+
+ return Stream.prototype.on.call(me, ev, handler)
+}
+
+
+
+// character classes and tokens
+var whitespace = "\r\n\t "
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ , number = "0124356789"
+ , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ // (Letter | "_" | ":")
+ , quote = "'\""
+ , entity = number+letter+"#"
+ , attribEnd = whitespace + ">"
+ , CDATA = "[CDATA["
+ , DOCTYPE = "DOCTYPE"
+ , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
+ , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
+ , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+// turn all the string character sets into character class objects.
+whitespace = charClass(whitespace)
+number = charClass(number)
+letter = charClass(letter)
+
+// http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+// This implementation works on strings, a single character at a time
+// as such, it cannot ever support astral-plane characters (10000-EFFFF)
+// without a significant breaking change to either this parser, or the
+// JavaScript language. Implementation of an emoji-capable xml parser
+// is left as an exercise for the reader.
+var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
+
+quote = charClass(quote)
+entity = charClass(entity)
+attribEnd = charClass(attribEnd)
+
+function charClass (str) {
+ return str.split("").reduce(function (s, c) {
+ s[c] = true
+ return s
+ }, {})
+}
+
+function isRegExp (c) {
+ return Object.prototype.toString.call(c) === '[object RegExp]'
+}
+
+function is (charclass, c) {
+ return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
+}
+
+function not (charclass, c) {
+ return !is(charclass, c)
+}
+
+var S = 0
+sax.STATE =
+{ BEGIN : S++
+, TEXT : S++ // general stuff
+, TEXT_ENTITY : S++ // &amp and such.
+, OPEN_WAKA : S++ // <
+, SGML_DECL : S++ // <!BLARG
+, SGML_DECL_QUOTED : S++ // <!BLARG foo "bar
+, DOCTYPE : S++ // <!DOCTYPE
+, DOCTYPE_QUOTED : S++ // <!DOCTYPE "//blah
+, DOCTYPE_DTD : S++ // <!DOCTYPE "//blah" [ ...
+, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE "//blah" [ "foo
+, COMMENT_STARTING : S++ // <!-
+, COMMENT : S++ // <!--
+, COMMENT_ENDING : S++ // <!-- blah -
+, COMMENT_ENDED : S++ // <!-- blah --
+, CDATA : S++ // <![CDATA[ something
+, CDATA_ENDING : S++ // ]
+, CDATA_ENDING_2 : S++ // ]]
+, PROC_INST : S++ // <?hi
+, PROC_INST_BODY : S++ // <?hi there
+, PROC_INST_ENDING : S++ // <?hi "there" ?
+, OPEN_TAG : S++ // <strong
+, OPEN_TAG_SLASH : S++ // <strong /
+, ATTRIB : S++ // <a
+, ATTRIB_NAME : S++ // <a foo
+, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _
+, ATTRIB_VALUE : S++ // <a foo=
+, ATTRIB_VALUE_QUOTED : S++ // <a foo="bar
+, ATTRIB_VALUE_CLOSED : S++ // <a foo="bar"
+, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar
+, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar="&quot;"
+, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;
+, CLOSE_TAG : S++ // </a
+, CLOSE_TAG_SAW_WHITE : S++ // </a >
+, SCRIPT : S++ // <script> ...
+, SCRIPT_ENDING : S++ // <script> ... <
+}
+
+sax.ENTITIES =
+{ "amp" : "&"
+, "gt" : ">"
+, "lt" : "<"
+, "quot" : "\""
+, "apos" : "'"
+, "AElig" : 198
+, "Aacute" : 193
+, "Acirc" : 194
+, "Agrave" : 192
+, "Aring" : 197
+, "Atilde" : 195
+, "Auml" : 196
+, "Ccedil" : 199
+, "ETH" : 208
+, "Eacute" : 201
+, "Ecirc" : 202
+, "Egrave" : 200
+, "Euml" : 203
+, "Iacute" : 205
+, "Icirc" : 206
+, "Igrave" : 204
+, "Iuml" : 207
+, "Ntilde" : 209
+, "Oacute" : 211
+, "Ocirc" : 212
+, "Ograve" : 210
+, "Oslash" : 216
+, "Otilde" : 213
+, "Ouml" : 214
+, "THORN" : 222
+, "Uacute" : 218
+, "Ucirc" : 219
+, "Ugrave" : 217
+, "Uuml" : 220
+, "Yacute" : 221
+, "aacute" : 225
+, "acirc" : 226
+, "aelig" : 230
+, "agrave" : 224
+, "aring" : 229
+, "atilde" : 227
+, "auml" : 228
+, "ccedil" : 231
+, "eacute" : 233
+, "ecirc" : 234
+, "egrave" : 232
+, "eth" : 240
+, "euml" : 235
+, "iacute" : 237
+, "icirc" : 238
+, "igrave" : 236
+, "iuml" : 239
+, "ntilde" : 241
+, "oacute" : 243
+, "ocirc" : 244
+, "ograve" : 242
+, "oslash" : 248
+, "otilde" : 245
+, "ouml" : 246
+, "szlig" : 223
+, "thorn" : 254
+, "uacute" : 250
+, "ucirc" : 251
+, "ugrave" : 249
+, "uuml" : 252
+, "yacute" : 253
+, "yuml" : 255
+, "copy" : 169
+, "reg" : 174
+, "nbsp" : 160
+, "iexcl" : 161
+, "cent" : 162
+, "pound" : 163
+, "curren" : 164
+, "yen" : 165
+, "brvbar" : 166
+, "sect" : 167
+, "uml" : 168
+, "ordf" : 170
+, "laquo" : 171
+, "not" : 172
+, "shy" : 173
+, "macr" : 175
+, "deg" : 176
+, "plusmn" : 177
+, "sup1" : 185
+, "sup2" : 178
+, "sup3" : 179
+, "acute" : 180
+, "micro" : 181
+, "para" : 182
+, "middot" : 183
+, "cedil" : 184
+, "ordm" : 186
+, "raquo" : 187
+, "frac14" : 188
+, "frac12" : 189
+, "frac34" : 190
+, "iquest" : 191
+, "times" : 215
+, "divide" : 247
+, "OElig" : 338
+, "oelig" : 339
+, "Scaron" : 352
+, "scaron" : 353
+, "Yuml" : 376
+, "fnof" : 402
+, "circ" : 710
+, "tilde" : 732
+, "Alpha" : 913
+, "Beta" : 914
+, "Gamma" : 915
+, "Delta" : 916
+, "Epsilon" : 917
+, "Zeta" : 918
+, "Eta" : 919
+, "Theta" : 920
+, "Iota" : 921
+, "Kappa" : 922
+, "Lambda" : 923
+, "Mu" : 924
+, "Nu" : 925
+, "Xi" : 926
+, "Omicron" : 927
+, "Pi" : 928
+, "Rho" : 929
+, "Sigma" : 931
+, "Tau" : 932
+, "Upsilon" : 933
+, "Phi" : 934
+, "Chi" : 935
+, "Psi" : 936
+, "Omega" : 937
+, "alpha" : 945
+, "beta" : 946
+, "gamma" : 947
+, "delta" : 948
+, "epsilon" : 949
+, "zeta" : 950
+, "eta" : 951
+, "theta" : 952
+, "iota" : 953
+, "kappa" : 954
+, "lambda" : 955
+, "mu" : 956
+, "nu" : 957
+, "xi" : 958
+, "omicron" : 959
+, "pi" : 960
+, "rho" : 961
+, "sigmaf" : 962
+, "sigma" : 963
+, "tau" : 964
+, "upsilon" : 965
+, "phi" : 966
+, "chi" : 967
+, "psi" : 968
+, "omega" : 969
+, "thetasym" : 977
+, "upsih" : 978
+, "piv" : 982
+, "ensp" : 8194
+, "emsp" : 8195
+, "thinsp" : 8201
+, "zwnj" : 8204
+, "zwj" : 8205
+, "lrm" : 8206
+, "rlm" : 8207
+, "ndash" : 8211
+, "mdash" : 8212
+, "lsquo" : 8216
+, "rsquo" : 8217
+, "sbquo" : 8218
+, "ldquo" : 8220
+, "rdquo" : 8221
+, "bdquo" : 8222
+, "dagger" : 8224
+, "Dagger" : 8225
+, "bull" : 8226
+, "hellip" : 8230
+, "permil" : 8240
+, "prime" : 8242
+, "Prime" : 8243
+, "lsaquo" : 8249
+, "rsaquo" : 8250
+, "oline" : 8254
+, "frasl" : 8260
+, "euro" : 8364
+, "image" : 8465
+, "weierp" : 8472
+, "real" : 8476
+, "trade" : 8482
+, "alefsym" : 8501
+, "larr" : 8592
+, "uarr" : 8593
+, "rarr" : 8594
+, "darr" : 8595
+, "harr" : 8596
+, "crarr" : 8629
+, "lArr" : 8656
+, "uArr" : 8657
+, "rArr" : 8658
+, "dArr" : 8659
+, "hArr" : 8660
+, "forall" : 8704
+, "part" : 8706
+, "exist" : 8707
+, "empty" : 8709
+, "nabla" : 8711
+, "isin" : 8712
+, "notin" : 8713
+, "ni" : 8715
+, "prod" : 8719
+, "sum" : 8721
+, "minus" : 8722
+, "lowast" : 8727
+, "radic" : 8730
+, "prop" : 8733
+, "infin" : 8734
+, "ang" : 8736
+, "and" : 8743
+, "or" : 8744
+, "cap" : 8745
+, "cup" : 8746
+, "int" : 8747
+, "there4" : 8756
+, "sim" : 8764
+, "cong" : 8773
+, "asymp" : 8776
+, "ne" : 8800
+, "equiv" : 8801
+, "le" : 8804
+, "ge" : 8805
+, "sub" : 8834
+, "sup" : 8835
+, "nsub" : 8836
+, "sube" : 8838
+, "supe" : 8839
+, "oplus" : 8853
+, "otimes" : 8855
+, "perp" : 8869
+, "sdot" : 8901
+, "lceil" : 8968
+, "rceil" : 8969
+, "lfloor" : 8970
+, "rfloor" : 8971
+, "lang" : 9001
+, "rang" : 9002
+, "loz" : 9674
+, "spades" : 9824
+, "clubs" : 9827
+, "hearts" : 9829
+, "diams" : 9830
+}
+
+Object.keys(sax.ENTITIES).forEach(function (key) {
+ var e = sax.ENTITIES[key]
+ var s = typeof e === 'number' ? String.fromCharCode(e) : e
+ sax.ENTITIES[key] = s
+})
+
+for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
+
+// shorthand
+S = sax.STATE
+
+function emit (parser, event, data) {
+ parser[event] && parser[event](data)
+}
+
+function emitNode (parser, nodeType, data) {
+ if (parser.textNode) closeText(parser)
+ emit(parser, nodeType, data)
+}
+
+function closeText (parser) {
+ parser.textNode = textopts(parser.opt, parser.textNode)
+ if (parser.textNode) emit(parser, "ontext", parser.textNode)
+ parser.textNode = ""
+}
+
+function textopts (opt, text) {
+ if (opt.trim) text = text.trim()
+ if (opt.normalize) text = text.replace(/\s+/g, " ")
+ return text
+}
+
+function error (parser, er) {
+ closeText(parser)
+ if (parser.trackPosition) {
+ er += "\nLine: "+parser.line+
+ "\nColumn: "+parser.column+
+ "\nChar: "+parser.c
+ }
+ er = new Error(er)
+ parser.error = er
+ emit(parser, "onerror", er)
+ return parser
+}
+
+function end (parser) {
+ if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
+ if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
+ closeText(parser)
+ parser.c = ""
+ parser.closed = true
+ emit(parser, "onend")
+ SAXParser.call(parser, parser.strict, parser.opt)
+ return parser
+}
+
+function strictFail (parser, message) {
+ if (typeof parser !== 'object' || !(parser instanceof SAXParser))
+ throw new Error('bad call to strictFail');
+ if (parser.strict) error(parser, message)
+}
+
+function newTag (parser) {
+ if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ , tag = parser.tag = { name : parser.tagName, attributes : {} }
+
+ // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+ if (parser.opt.xmlns) tag.ns = parent.ns
+ parser.attribList.length = 0
+}
+
+function qname (name, attribute) {
+ var i = name.indexOf(":")
+ , qualName = i < 0 ? [ "", name ] : name.split(":")
+ , prefix = qualName[0]
+ , local = qualName[1]
+
+ // <x "xmlns"="http://foo">
+ if (attribute && name === "xmlns") {
+ prefix = "xmlns"
+ local = ""
+ }
+
+ return { prefix: prefix, local: local }
+}
+
+function attrib (parser) {
+ if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
+
+ if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+ parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+ return parser.attribName = parser.attribValue = ""
+ }
+
+ if (parser.opt.xmlns) {
+ var qn = qname(parser.attribName, true)
+ , prefix = qn.prefix
+ , local = qn.local
+
+ if (prefix === "xmlns") {
+ // namespace binding attribute; push the binding into scope
+ if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
+ strictFail( parser
+ , "xml: prefix must be bound to " + XML_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
+ strictFail( parser
+ , "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else {
+ var tag = parser.tag
+ , parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns === parent.ns) {
+ tag.ns = Object.create(parent.ns)
+ }
+ tag.ns[local] = parser.attribValue
+ }
+ }
+
+ // defer onattribute events until all attributes have been seen
+ // so any new bindings can take effect; preserve attribute order
+ // so deferred events can be emitted in document order
+ parser.attribList.push([parser.attribName, parser.attribValue])
+ } else {
+ // in non-xmlns mode, we can emit the event right away
+ parser.tag.attributes[parser.attribName] = parser.attribValue
+ emitNode( parser
+ , "onattribute"
+ , { name: parser.attribName
+ , value: parser.attribValue } )
+ }
+
+ parser.attribName = parser.attribValue = ""
+}
+
+function openTag (parser, selfClosing) {
+ if (parser.opt.xmlns) {
+ // emit namespace binding events
+ var tag = parser.tag
+
+ // add namespace info to tag
+ var qn = qname(parser.tagName)
+ tag.prefix = qn.prefix
+ tag.local = qn.local
+ tag.uri = tag.ns[qn.prefix] || ""
+
+ if (tag.prefix && !tag.uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(parser.tagName))
+ tag.uri = qn.prefix
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns && parent.ns !== tag.ns) {
+ Object.keys(tag.ns).forEach(function (p) {
+ emitNode( parser
+ , "onopennamespace"
+ , { prefix: p , uri: tag.ns[p] } )
+ })
+ }
+
+ // handle deferred onattribute events
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (var i = 0, l = parser.attribList.length; i < l; i ++) {
+ var nv = parser.attribList[i]
+ var name = nv[0]
+ , value = nv[1]
+ , qualName = qname(name, true)
+ , prefix = qualName.prefix
+ , local = qualName.local
+ , uri = prefix == "" ? "" : (tag.ns[prefix] || "")
+ , a = { name: name
+ , value: value
+ , prefix: prefix
+ , local: local
+ , uri: uri
+ }
+
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (prefix && prefix != "xmlns" && !uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(prefix))
+ a.uri = prefix
+ }
+ parser.tag.attributes[name] = a
+ emitNode(parser, "onattribute", a)
+ }
+ parser.attribList.length = 0
+ }
+
+ parser.tag.isSelfClosing = !!selfClosing
+
+ // process the tag
+ parser.sawRoot = true
+ parser.tags.push(parser.tag)
+ emitNode(parser, "onopentag", parser.tag)
+ if (!selfClosing) {
+ // special case for <script> in non-strict mode.
+ if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
+ parser.state = S.SCRIPT
+ } else {
+ parser.state = S.TEXT
+ }
+ parser.tag = null
+ parser.tagName = ""
+ }
+ parser.attribName = parser.attribValue = ""
+ parser.attribList.length = 0
+}
+
+function closeTag (parser) {
+ if (!parser.tagName) {
+ strictFail(parser, "Weird empty close tag.")
+ parser.textNode += "</>"
+ parser.state = S.TEXT
+ return
+ }
+
+ if (parser.script) {
+ if (parser.tagName !== "script") {
+ parser.script += "</" + parser.tagName + ">"
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ return
+ }
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = parser.tags.length
+ var tagName = parser.tagName
+ if (!parser.strict) tagName = tagName[parser.looseCase]()
+ var closeTo = tagName
+ while (t --) {
+ var close = parser.tags[t]
+ if (close.name !== closeTo) {
+ // fail the first time in strict mode
+ strictFail(parser, "Unexpected close tag")
+ } else break
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0) {
+ strictFail(parser, "Unmatched closing tag: "+parser.tagName)
+ parser.textNode += "</" + parser.tagName + ">"
+ parser.state = S.TEXT
+ return
+ }
+ parser.tagName = tagName
+ var s = parser.tags.length
+ while (s --> t) {
+ var tag = parser.tag = parser.tags.pop()
+ parser.tagName = parser.tag.name
+ emitNode(parser, "onclosetag", parser.tagName)
+
+ var x = {}
+ for (var i in tag.ns) x[i] = tag.ns[i]
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (parser.opt.xmlns && tag.ns !== parent.ns) {
+ // remove namespace bindings introduced by tag
+ Object.keys(tag.ns).forEach(function (p) {
+ var n = tag.ns[p]
+ emitNode(parser, "onclosenamespace", { prefix: p, uri: n })
+ })
+ }
+ }
+ if (t === 0) parser.closedRoot = true
+ parser.tagName = parser.attribValue = parser.attribName = ""
+ parser.attribList.length = 0
+ parser.state = S.TEXT
+}
+
+function parseEntity (parser) {
+ var entity = parser.entity
+ , entityLC = entity.toLowerCase()
+ , num
+ , numStr = ""
+ if (parser.ENTITIES[entity])
+ return parser.ENTITIES[entity]
+ if (parser.ENTITIES[entityLC])
+ return parser.ENTITIES[entityLC]
+ entity = entityLC
+ if (entity.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2)
+ num = parseInt(entity, 16)
+ numStr = num.toString(16)
+ } else {
+ entity = entity.slice(1)
+ num = parseInt(entity, 10)
+ numStr = num.toString(10)
+ }
+ }
+ entity = entity.replace(/^0+/, "")
+ if (numStr.toLowerCase() !== entity) {
+ strictFail(parser, "Invalid character entity")
+ return "&"+parser.entity + ";"
+ }
+
+ return String.fromCodePoint(num)
+}
+
+function write (chunk) {
+ var parser = this
+ if (this.error) throw this.error
+ if (parser.closed) return error(parser,
+ "Cannot write after close. Assign an onready handler.")
+ if (chunk === null) return end(parser)
+ var i = 0, c = ""
+ while (parser.c = c = chunk.charAt(i++)) {
+ if (parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ switch (parser.state) {
+
+ case S.BEGIN:
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else if (not(whitespace,c)) {
+ // have to process this as a text node.
+ // weird, but happens.
+ strictFail(parser, "Non-whitespace before first tag.")
+ parser.textNode = c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.TEXT:
+ if (parser.sawRoot && !parser.closedRoot) {
+ var starti = i-1
+ while (c && c!=="<" && c!=="&") {
+ c = chunk.charAt(i++)
+ if (c && parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ }
+ parser.textNode += chunk.substring(starti, i-1)
+ }
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else {
+ if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
+ strictFail(parser, "Text data outside of root node.")
+ if (c === "&") parser.state = S.TEXT_ENTITY
+ else parser.textNode += c
+ }
+ continue
+
+ case S.SCRIPT:
+ // only non-strict
+ if (c === "<") {
+ parser.state = S.SCRIPT_ENDING
+ } else parser.script += c
+ continue
+
+ case S.SCRIPT_ENDING:
+ if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ } else {
+ parser.script += "<" + c
+ parser.state = S.SCRIPT
+ }
+ continue
+
+ case S.OPEN_WAKA:
+ // either a /, ?, !, or text is coming next.
+ if (c === "!") {
+ parser.state = S.SGML_DECL
+ parser.sgmlDecl = ""
+ } else if (is(whitespace, c)) {
+ // wait for it...
+ } else if (is(nameStart,c)) {
+ parser.state = S.OPEN_TAG
+ parser.tagName = c
+ } else if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ parser.tagName = ""
+ } else if (c === "?") {
+ parser.state = S.PROC_INST
+ parser.procInstName = parser.procInstBody = ""
+ } else {
+ strictFail(parser, "Unencoded <")
+ // if there was some whitespace, then add that in.
+ if (parser.startTagPosition + 1 < parser.position) {
+ var pad = parser.position - parser.startTagPosition
+ c = new Array(pad).join(" ") + c
+ }
+ parser.textNode += "<" + c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.SGML_DECL:
+ if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {
+ emitNode(parser, "onopencdata")
+ parser.state = S.CDATA
+ parser.sgmlDecl = ""
+ parser.cdata = ""
+ } else if (parser.sgmlDecl+c === "--") {
+ parser.state = S.COMMENT
+ parser.comment = ""
+ parser.sgmlDecl = ""
+ } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {
+ parser.state = S.DOCTYPE
+ if (parser.doctype || parser.sawRoot) strictFail(parser,
+ "Inappropriately located doctype declaration")
+ parser.doctype = ""
+ parser.sgmlDecl = ""
+ } else if (c === ">") {
+ emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
+ parser.sgmlDecl = ""
+ parser.state = S.TEXT
+ } else if (is(quote, c)) {
+ parser.state = S.SGML_DECL_QUOTED
+ parser.sgmlDecl += c
+ } else parser.sgmlDecl += c
+ continue
+
+ case S.SGML_DECL_QUOTED:
+ if (c === parser.q) {
+ parser.state = S.SGML_DECL
+ parser.q = ""
+ }
+ parser.sgmlDecl += c
+ continue
+
+ case S.DOCTYPE:
+ if (c === ">") {
+ parser.state = S.TEXT
+ emitNode(parser, "ondoctype", parser.doctype)
+ parser.doctype = true // just remember that we saw it.
+ } else {
+ parser.doctype += c
+ if (c === "[") parser.state = S.DOCTYPE_DTD
+ else if (is(quote, c)) {
+ parser.state = S.DOCTYPE_QUOTED
+ parser.q = c
+ }
+ }
+ continue
+
+ case S.DOCTYPE_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.q = ""
+ parser.state = S.DOCTYPE
+ }
+ continue
+
+ case S.DOCTYPE_DTD:
+ parser.doctype += c
+ if (c === "]") parser.state = S.DOCTYPE
+ else if (is(quote,c)) {
+ parser.state = S.DOCTYPE_DTD_QUOTED
+ parser.q = c
+ }
+ continue
+
+ case S.DOCTYPE_DTD_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.state = S.DOCTYPE_DTD
+ parser.q = ""
+ }
+ continue
+
+ case S.COMMENT:
+ if (c === "-") parser.state = S.COMMENT_ENDING
+ else parser.comment += c
+ continue
+
+ case S.COMMENT_ENDING:
+ if (c === "-") {
+ parser.state = S.COMMENT_ENDED
+ parser.comment = textopts(parser.opt, parser.comment)
+ if (parser.comment) emitNode(parser, "oncomment", parser.comment)
+ parser.comment = ""
+ } else {
+ parser.comment += "-" + c
+ parser.state = S.COMMENT
+ }
+ continue
+
+ case S.COMMENT_ENDED:
+ if (c !== ">") {
+ strictFail(parser, "Malformed comment")
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ parser.comment += "--" + c
+ parser.state = S.COMMENT
+ } else parser.state = S.TEXT
+ continue
+
+ case S.CDATA:
+ if (c === "]") parser.state = S.CDATA_ENDING
+ else parser.cdata += c
+ continue
+
+ case S.CDATA_ENDING:
+ if (c === "]") parser.state = S.CDATA_ENDING_2
+ else {
+ parser.cdata += "]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.CDATA_ENDING_2:
+ if (c === ">") {
+ if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
+ emitNode(parser, "onclosecdata")
+ parser.cdata = ""
+ parser.state = S.TEXT
+ } else if (c === "]") {
+ parser.cdata += "]"
+ } else {
+ parser.cdata += "]]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.PROC_INST:
+ if (c === "?") parser.state = S.PROC_INST_ENDING
+ else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
+ else parser.procInstName += c
+ continue
+
+ case S.PROC_INST_BODY:
+ if (!parser.procInstBody && is(whitespace, c)) continue
+ else if (c === "?") parser.state = S.PROC_INST_ENDING
+ else parser.procInstBody += c
+ continue
+
+ case S.PROC_INST_ENDING:
+ if (c === ">") {
+ emitNode(parser, "onprocessinginstruction", {
+ name : parser.procInstName,
+ body : parser.procInstBody
+ })
+ parser.procInstName = parser.procInstBody = ""
+ parser.state = S.TEXT
+ } else {
+ parser.procInstBody += "?" + c
+ parser.state = S.PROC_INST_BODY
+ }
+ continue
+
+ case S.OPEN_TAG:
+ if (is(nameBody, c)) parser.tagName += c
+ else {
+ newTag(parser)
+ if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else {
+ if (not(whitespace, c)) strictFail(
+ parser, "Invalid character in tag name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.OPEN_TAG_SLASH:
+ if (c === ">") {
+ openTag(parser, true)
+ closeTag(parser)
+ } else {
+ strictFail(parser, "Forward-slash in opening tag not followed by >")
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.ATTRIB:
+ // haven't read the attribute name yet.
+ if (is(whitespace, c)) continue
+ else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (c === ">") {
+ strictFail(parser, "Attribute without value")
+ parser.attribValue = parser.attribName
+ attrib(parser)
+ openTag(parser)
+ }
+ else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
+ else if (is(nameBody, c)) parser.attribName += c
+ else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME_SAW_WHITE:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (is(whitespace, c)) continue
+ else {
+ strictFail(parser, "Attribute without value")
+ parser.tag.attributes[parser.attribName] = ""
+ parser.attribValue = ""
+ emitNode(parser, "onattribute",
+ { name : parser.attribName, value : "" })
+ parser.attribName = ""
+ if (c === ">") openTag(parser)
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, "Invalid attribute name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.ATTRIB_VALUE:
+ if (is(whitespace, c)) continue
+ else if (is(quote, c)) {
+ parser.q = c
+ parser.state = S.ATTRIB_VALUE_QUOTED
+ } else {
+ strictFail(parser, "Unquoted attribute value")
+ parser.state = S.ATTRIB_VALUE_UNQUOTED
+ parser.attribValue = c
+ }
+ continue
+
+ case S.ATTRIB_VALUE_QUOTED:
+ if (c !== parser.q) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ parser.q = ""
+ parser.state = S.ATTRIB_VALUE_CLOSED
+ continue
+
+ case S.ATTRIB_VALUE_CLOSED:
+ if (is(whitespace, c)) {
+ parser.state = S.ATTRIB
+ } else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ strictFail(parser, "No whitespace between attributes")
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_VALUE_UNQUOTED:
+ if (not(attribEnd,c)) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ if (c === ">") openTag(parser)
+ else parser.state = S.ATTRIB
+ continue
+
+ case S.CLOSE_TAG:
+ if (!parser.tagName) {
+ if (is(whitespace, c)) continue
+ else if (not(nameStart, c)) {
+ if (parser.script) {
+ parser.script += "</" + c
+ parser.state = S.SCRIPT
+ } else {
+ strictFail(parser, "Invalid tagname in closing tag.")
+ }
+ } else parser.tagName = c
+ }
+ else if (c === ">") closeTag(parser)
+ else if (is(nameBody, c)) parser.tagName += c
+ else if (parser.script) {
+ parser.script += "</" + parser.tagName
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ } else {
+ if (not(whitespace, c)) strictFail(parser,
+ "Invalid tagname in closing tag")
+ parser.state = S.CLOSE_TAG_SAW_WHITE
+ }
+ continue
+
+ case S.CLOSE_TAG_SAW_WHITE:
+ if (is(whitespace, c)) continue
+ if (c === ">") closeTag(parser)
+ else strictFail(parser, "Invalid characters in closing tag")
+ continue
+
+ case S.TEXT_ENTITY:
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ case S.ATTRIB_VALUE_ENTITY_U:
+ switch(parser.state) {
+ case S.TEXT_ENTITY:
+ var returnState = S.TEXT, buffer = "textNode"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_U:
+ var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"
+ break
+ }
+ if (c === ";") {
+ parser[buffer] += parseEntity(parser)
+ parser.entity = ""
+ parser.state = returnState
+ }
+ else if (is(entity, c)) parser.entity += c
+ else {
+ strictFail(parser, "Invalid character entity")
+ parser[buffer] += "&" + parser.entity + c
+ parser.entity = ""
+ parser.state = returnState
+ }
+ continue
+
+ default:
+ throw new Error(parser, "Unknown state: " + parser.state)
+ }
+ } // while
+ // cdata blocks can get very big under normal conditions. emit and move on.
+ // if (parser.state === S.CDATA && parser.cdata) {
+ // emitNode(parser, "oncdata", parser.cdata)
+ // parser.cdata = ""
+ // }
+ if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
+ return parser
+}
+
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+if (!String.fromCodePoint) {
+ (function() {
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function() {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (Object.defineProperty) {
+ Object.defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
+
+})(typeof exports === "undefined" ? sax = {} : exports);
+
+}).call(this,undefined)
+
+},{"undefined":undefined}],56:[function(_dereq_,module,exports){
+/**
+ * Tiny stack for browser or server
+ *
+ * @author Jason Mulligan <jason.mulligan@avoidwork.com>
+ * @copyright 2014 Jason Mulligan
+ * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
+ * @link http://avoidwork.github.io/tiny-stack
+ * @module tiny-stack
+ * @version 0.1.0
+ */
+
+( function ( global ) {
+
+"use strict";
+
+/**
+ * TinyStack
+ *
+ * @constructor
+ */
+function TinyStack () {
+ this.data = [null];
+ this.top = 0;
+}
+
+/**
+ * Clears the stack
+ *
+ * @method clear
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.clear = function clear () {
+ this.data = [null];
+ this.top = 0;
+
+ return this;
+};
+
+/**
+ * Gets the size of the stack
+ *
+ * @method length
+ * @memberOf TinyStack
+ * @return {Number} Size of stack
+ */
+TinyStack.prototype.length = function length () {
+ return this.top;
+};
+
+/**
+ * Gets the item at the top of the stack
+ *
+ * @method peek
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.peek = function peek () {
+ return this.data[this.top];
+};
+
+/**
+ * Gets & removes the item at the top of the stack
+ *
+ * @method pop
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.pop = function pop () {
+ if ( this.top > 0 ) {
+ this.top--;
+
+ return this.data.pop();
+ }
+ else {
+ return undefined;
+ }
+};
+
+/**
+ * Pushes an item onto the stack
+ *
+ * @method push
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.push = function push ( arg ) {
+ this.data[++this.top] = arg;
+
+ return this;
+};
+
+/**
+ * TinyStack factory
+ *
+ * @method factory
+ * @return {Object} {@link TinyStack}
+ */
+function factory () {
+ return new TinyStack();
+}
+
+// Node, AMD & window supported
+if ( typeof exports != "undefined" ) {
+ module.exports = factory;
+}
+else if ( typeof define == "function" ) {
+ define( function () {
+ return factory;
+ } );
+}
+else {
+ global.stack = factory;
+}
+} )( this );
+
+},{}],57:[function(_dereq_,module,exports){
+module.exports = _dereq_(61);
+},{"61":61}],58:[function(_dereq_,module,exports){
+'use strict';
+
+function Base() { }
+
+Base.prototype.get = function(name) {
+ return this.$model.properties.get(this, name);
+};
+
+Base.prototype.set = function(name, value) {
+ this.$model.properties.set(this, name, value);
+};
+
+
+module.exports = Base;
+},{}],59:[function(_dereq_,module,exports){
+'use strict';
+
+var pick = _dereq_(330),
+ assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+var parseNameNs = _dereq_(62).parseName;
+
+
+function DescriptorBuilder(nameNs) {
+ this.ns = nameNs;
+ this.name = nameNs.name;
+ this.allTypes = [];
+ this.properties = [];
+ this.propertiesByName = {};
+}
+
+module.exports = DescriptorBuilder;
+
+
+DescriptorBuilder.prototype.build = function() {
+ return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);
+};
+
+DescriptorBuilder.prototype.addProperty = function(p, idx) {
+ this.addNamedProperty(p, true);
+
+ var properties = this.properties;
+
+ if (idx !== undefined) {
+ properties.splice(idx, 0, p);
+ } else {
+ properties.push(p);
+ }
+};
+
+
+DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
+ var oldNameNs = oldProperty.ns;
+
+ var props = this.properties,
+ propertiesByName = this.propertiesByName,
+ rename = oldProperty.name !== newProperty.name;
+
+ if (oldProperty.isBody) {
+
+ if (!newProperty.isBody) {
+ throw new Error(
+ 'property <' + newProperty.ns.name + '> must be body property ' +
+ 'to refine <' + oldProperty.ns.name + '>');
+ }
+
+ // TODO: Check compatibility
+ this.setBodyProperty(newProperty, false);
+ }
+
+ // replacing the named property is intentional
+ // thus, validate only if this is a "rename" operation
+ this.addNamedProperty(newProperty, rename);
+
+ // replace old property at index with new one
+ var idx = props.indexOf(oldProperty);
+ if (idx === -1) {
+ throw new Error('property <' + oldNameNs.name + '> not found in property list');
+ }
+
+ props[idx] = newProperty;
+
+ // replace propertiesByName entry with new property
+ propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
+};
+
+
+DescriptorBuilder.prototype.redefineProperty = function(p) {
+
+ var nsPrefix = p.ns.prefix;
+ var parts = p.redefines.split('#');
+
+ var name = parseNameNs(parts[0], nsPrefix);
+ var attrName = parseNameNs(parts[1], name.prefix).name;
+
+ var redefinedProperty = this.propertiesByName[attrName];
+ if (!redefinedProperty) {
+ throw new Error('refined property <' + attrName + '> not found');
+ } else {
+ this.replaceProperty(redefinedProperty, p);
+ }
+
+ delete p.redefines;
+};
+
+DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ if (validate) {
+ this.assertNotDefined(p, ns.name);
+ this.assertNotDefined(p, ns.localName);
+ }
+
+ propsByName[ns.name] = propsByName[ns.localName] = p;
+};
+
+DescriptorBuilder.prototype.removeNamedProperty = function(p) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ delete propsByName[ns.name];
+ delete propsByName[ns.localName];
+};
+
+DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
+
+ if (validate && this.bodyProperty) {
+ throw new Error(
+ 'body property defined multiple times ' +
+ '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
+ }
+
+ this.bodyProperty = p;
+};
+
+DescriptorBuilder.prototype.addIdProperty = function(name) {
+ var nameNs = parseNameNs(name, this.ns.prefix);
+
+ var p = {
+ name: nameNs.localName,
+ type: 'String',
+ isAttr: true,
+ ns: nameNs
+ };
+
+ // ensure that id is always the first attribute (if present)
+ this.addProperty(p, 0);
+};
+
+DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
+ var propertyName = p.name,
+ definedProperty = this.propertiesByName[propertyName];
+
+ if (definedProperty) {
+ throw new Error(
+ 'property <' + propertyName + '> already defined; ' +
+ 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
+ '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
+ }
+};
+
+DescriptorBuilder.prototype.hasProperty = function(name) {
+ return this.propertiesByName[name];
+};
+
+DescriptorBuilder.prototype.addTrait = function(t) {
+
+ var allTypes = this.allTypes;
+
+ if (allTypes.indexOf(t) !== -1) {
+ return;
+ }
+
+ forEach(t.properties, function(p) {
+
+ // clone property to allow extensions
+ p = assign({}, p, {
+ name: p.ns.localName
+ });
+
+ Object.defineProperty(p, 'definedBy', {
+ value: t
+ });
+
+ // add redefine support
+ if (p.redefines) {
+ this.redefineProperty(p);
+ } else {
+ if (p.isBody) {
+ this.setBodyProperty(p);
+ }
+ this.addProperty(p);
+ }
+ }, this);
+
+ allTypes.push(t);
+};
+
+},{"204":204,"325":325,"330":330,"62":62}],60:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var Base = _dereq_(58);
+
+
+function Factory(model, properties) {
+ this.model = model;
+ this.properties = properties;
+}
+
+module.exports = Factory;
+
+
+Factory.prototype.createType = function(descriptor) {
+
+ var model = this.model;
+
+ var props = this.properties,
+ prototype = Object.create(Base.prototype);
+
+ // initialize default values
+ forEach(descriptor.properties, function(p) {
+ if (!p.isMany && p.default !== undefined) {
+ prototype[p.name] = p.default;
+ }
+ });
+
+ props.defineModel(prototype, model);
+ props.defineDescriptor(prototype, descriptor);
+
+ var name = descriptor.ns.name;
+
+ /**
+ * The new type constructor
+ */
+ function ModdleElement(attrs) {
+ props.define(this, '$type', { value: name, enumerable: true });
+ props.define(this, '$attrs', { value: {} });
+ props.define(this, '$parent', { writable: true });
+
+ forEach(attrs, function(val, key) {
+ this.set(key, val);
+ }, this);
+ }
+
+ ModdleElement.prototype = prototype;
+
+ ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
+
+ // static links
+ props.defineModel(ModdleElement, model);
+ props.defineDescriptor(ModdleElement, descriptor);
+
+ return ModdleElement;
+};
+},{"204":204,"58":58}],61:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(322),
+ isObject = _dereq_(320),
+ forEach = _dereq_(204),
+ find = _dereq_(203);
+
+
+var Factory = _dereq_(60),
+ Registry = _dereq_(64),
+ Properties = _dereq_(63);
+
+var parseNameNs = _dereq_(62).parseName;
+
+
+//// Moddle implementation /////////////////////////////////////////////////
+
+/**
+ * @class Moddle
+ *
+ * A model that can be used to create elements of a specific type.
+ *
+ * @example
+ *
+ * var Moddle = require('moddle');
+ *
+ * var pkg = {
+ * name: 'mypackage',
+ * prefix: 'my',
+ * types: [
+ * { name: 'Root' }
+ * ]
+ * };
+ *
+ * var moddle = new Moddle([pkg]);
+ *
+ * @param {Array<Package>} packages the packages to contain
+ * @param {Object} options additional options to pass to the model
+ */
+function Moddle(packages, options) {
+
+ options = options || {};
+
+ this.properties = new Properties(this);
+
+ this.factory = new Factory(this, this.properties);
+ this.registry = new Registry(packages, this.properties, options);
+
+ this.typeCache = {};
+}
+
+module.exports = Moddle;
+
+
+/**
+ * Create an instance of the specified type.
+ *
+ * @method Moddle#create
+ *
+ * @example
+ *
+ * var foo = moddle.create('my:Foo');
+ * var bar = moddle.create('my:Bar', { id: 'BAR_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @param {Object} attrs a number of attributes to initialize the model instance with
+ * @return {Object} model instance
+ */
+Moddle.prototype.create = function(descriptor, attrs) {
+ var Type = this.getType(descriptor);
+
+ if (!Type) {
+ throw new Error('unknown type <' + descriptor + '>');
+ }
+
+ return new Type(attrs);
+};
+
+
+/**
+ * Returns the type representing a given descriptor
+ *
+ * @method Moddle#getType
+ *
+ * @example
+ *
+ * var Foo = moddle.getType('my:Foo');
+ * var foo = new Foo({ 'id' : 'FOO_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @return {Object} the type representing the descriptor
+ */
+Moddle.prototype.getType = function(descriptor) {
+
+ var cache = this.typeCache;
+
+ var name = isString(descriptor) ? descriptor : descriptor.ns.name;
+
+ var type = cache[name];
+
+ if (!type) {
+ descriptor = this.registry.getEffectiveDescriptor(name);
+ type = cache[name] = this.factory.createType(descriptor);
+ }
+
+ return type;
+};
+
+
+/**
+ * Creates an any-element type to be used within model instances.
+ *
+ * This can be used to create custom elements that lie outside the meta-model.
+ * The created element contains all the meta-data required to serialize it
+ * as part of meta-model elements.
+ *
+ * @method Moddle#createAny
+ *
+ * @example
+ *
+ * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {
+ * value: 'bar'
+ * });
+ *
+ * var container = moddle.create('my:Container', 'http://my', {
+ * any: [ foo ]
+ * });
+ *
+ * // go ahead and serialize the stuff
+ *
+ *
+ * @param {String} name the name of the element
+ * @param {String} nsUri the namespace uri of the element
+ * @param {Object} [properties] a map of properties to initialize the instance with
+ * @return {Object} the any type instance
+ */
+Moddle.prototype.createAny = function(name, nsUri, properties) {
+
+ var nameNs = parseNameNs(name);
+
+ var element = {
+ $type: name
+ };
+
+ var descriptor = {
+ name: name,
+ isGeneric: true,
+ ns: {
+ prefix: nameNs.prefix,
+ localName: nameNs.localName,
+ uri: nsUri
+ }
+ };
+
+ this.properties.defineDescriptor(element, descriptor);
+ this.properties.defineModel(element, this);
+ this.properties.define(element, '$parent', { enumerable: false, writable: true });
+
+ forEach(properties, function(a, key) {
+ if (isObject(a) && a.value !== undefined) {
+ element[a.name] = a.value;
+ } else {
+ element[key] = a;
+ }
+ });
+
+ return element;
+};
+
+/**
+ * Returns a registered package by uri or prefix
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackage = function(uriOrPrefix) {
+ return this.registry.getPackage(uriOrPrefix);
+};
+
+/**
+ * Returns a snapshot of all known packages
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackages = function() {
+ return this.registry.getPackages();
+};
+
+/**
+ * Returns the descriptor for an element
+ */
+Moddle.prototype.getElementDescriptor = function(element) {
+ return element.$descriptor;
+};
+
+/**
+ * Returns true if the given descriptor or instance
+ * represents the given type.
+ *
+ * May be applied to this, if element is omitted.
+ */
+Moddle.prototype.hasType = function(element, type) {
+ if (type === undefined) {
+ type = element;
+ element = this;
+ }
+
+ var descriptor = element.$model.getElementDescriptor(element);
+
+ return !!find(descriptor.allTypes, function(t) {
+ return t.name === type;
+ });
+};
+
+
+/**
+ * Returns the descriptor of an elements named property
+ */
+Moddle.prototype.getPropertyDescriptor = function(element, property) {
+ return this.getElementDescriptor(element).propertiesByName[property];
+};
+
+},{"203":203,"204":204,"320":320,"322":322,"60":60,"62":62,"63":63,"64":64}],62:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Parses a namespaced attribute name of the form (ns:)localName to an object,
+ * given a default prefix to assume in case no explicit namespace is given.
+ *
+ * @param {String} name
+ * @param {String} [defaultPrefix] the default prefix to take, if none is present.
+ *
+ * @return {Object} the parsed name
+ */
+module.exports.parseName = function(name, defaultPrefix) {
+ var parts = name.split(/:/),
+ localName, prefix;
+
+ // no prefix (i.e. only local name)
+ if (parts.length === 1) {
+ localName = name;
+ prefix = defaultPrefix;
+ } else
+ // prefix + local name
+ if (parts.length === 2) {
+ localName = parts[1];
+ prefix = parts[0];
+ } else {
+ throw new Error('expected <prefix:localName> or <localName>, got ' + name);
+ }
+
+ name = (prefix ? prefix + ':' : '') + localName;
+
+ return {
+ name: name,
+ prefix: prefix,
+ localName: localName
+ };
+};
+},{}],63:[function(_dereq_,module,exports){
+'use strict';
+
+
+/**
+ * A utility that gets and sets properties of model elements.
+ *
+ * @param {Model} model
+ */
+function Properties(model) {
+ this.model = model;
+}
+
+module.exports = Properties;
+
+
+/**
+ * Sets a named property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} value
+ */
+Properties.prototype.set = function(target, name, value) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ target.$attrs[name] = value;
+ } else {
+ Object.defineProperty(target, property.name, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: value
+ });
+ }
+};
+
+/**
+ * Returns the named property of the given element
+ *
+ * @param {Object} target
+ * @param {String} name
+ *
+ * @return {Object}
+ */
+Properties.prototype.get = function(target, name) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ return target.$attrs[name];
+ }
+
+ var propertyName = property.name;
+
+ // check if access to collection property and lazily initialize it
+ if (!target[propertyName] && property.isMany) {
+ Object.defineProperty(target, propertyName, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: []
+ });
+ }
+
+ return target[propertyName];
+};
+
+
+/**
+ * Define a property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} options
+ */
+Properties.prototype.define = function(target, name, options) {
+ Object.defineProperty(target, name, options);
+};
+
+
+/**
+ * Define the descriptor for an element
+ */
+Properties.prototype.defineDescriptor = function(target, descriptor) {
+ this.define(target, '$descriptor', { value: descriptor });
+};
+
+/**
+ * Define the model for an element
+ */
+Properties.prototype.defineModel = function(target, model) {
+ this.define(target, '$model', { value: model });
+};
+},{}],64:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+var Types = _dereq_(65),
+ DescriptorBuilder = _dereq_(59);
+
+var parseNameNs = _dereq_(62).parseName,
+ isBuiltInType = Types.isBuiltIn;
+
+
+function Registry(packages, properties, options) {
+ this.options = assign({ generateId: 'id' }, options || {});
+
+ this.packageMap = {};
+ this.typeMap = {};
+
+ this.packages = [];
+
+ this.properties = properties;
+
+ forEach(packages, this.registerPackage, this);
+}
+
+module.exports = Registry;
+
+
+Registry.prototype.getPackage = function(uriOrPrefix) {
+ return this.packageMap[uriOrPrefix];
+};
+
+Registry.prototype.getPackages = function() {
+ return this.packages;
+};
+
+
+Registry.prototype.registerPackage = function(pkg) {
+
+ // copy package
+ pkg = assign({}, pkg);
+
+ // register types
+ forEach(pkg.types, function(descriptor) {
+ this.registerType(descriptor, pkg);
+ }, this);
+
+ this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
+ this.packages.push(pkg);
+};
+
+
+/**
+ * Register a type from a specific package with us
+ */
+Registry.prototype.registerType = function(type, pkg) {
+
+ type = assign({}, type, {
+ superClass: (type.superClass || []).slice(),
+ extends: (type.extends || []).slice(),
+ properties: (type.properties || []).slice()
+ });
+
+ var ns = parseNameNs(type.name, pkg.prefix),
+ name = ns.name,
+ propertiesByName = {};
+
+ // parse properties
+ forEach(type.properties, function(p) {
+
+ // namespace property names
+ var propertyNs = parseNameNs(p.name, ns.prefix),
+ propertyName = propertyNs.name;
+
+ // namespace property types
+ if (!isBuiltInType(p.type)) {
+ p.type = parseNameNs(p.type, propertyNs.prefix).name;
+ }
+
+ assign(p, {
+ ns: propertyNs,
+ name: propertyName
+ });
+
+ propertiesByName[propertyName] = p;
+ });
+
+ // update ns + name
+ assign(type, {
+ ns: ns,
+ name: name,
+ propertiesByName: propertiesByName
+ });
+
+ forEach(type.extends, function(extendsName) {
+ var extended = this.typeMap[extendsName];
+
+ extended.traits = extended.traits || [];
+ extended.traits.push(name);
+ }, this);
+
+ // link to package
+ this.definePackage(type, pkg);
+
+ // register
+ this.typeMap[name] = type;
+};
+
+
+/**
+ * Traverse the type hierarchy from bottom to top.
+ */
+Registry.prototype.mapTypes = function(nsName, iterator) {
+
+ var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];
+
+ var self = this;
+
+ /**
+ * Traverse the selected super type or trait
+ *
+ * @param {String} cls
+ */
+ function traverseSuper(cls) {
+ var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
+ self.mapTypes(parentNs, iterator);
+ }
+
+ if (!type) {
+ throw new Error('unknown type <' + nsName.name + '>');
+ }
+
+ forEach(type.superClass, traverseSuper);
+
+ iterator(type);
+
+ forEach(type.traits, traverseSuper);
+};
+
+
+/**
+ * Returns the effective descriptor for a type.
+ *
+ * @param {String} type the namespaced name (ns:localName) of the type
+ *
+ * @return {Descriptor} the resulting effective descriptor
+ */
+Registry.prototype.getEffectiveDescriptor = function(name) {
+
+ var nsName = parseNameNs(name);
+
+ var builder = new DescriptorBuilder(nsName);
+
+ this.mapTypes(nsName, function(type) {
+ builder.addTrait(type);
+ });
+
+ // check we have an id assigned
+ var id = this.options.generateId;
+ if (id && !builder.hasProperty(id)) {
+ builder.addIdProperty(id);
+ }
+
+ var descriptor = builder.build();
+
+ // define package link
+ this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
+
+ return descriptor;
+};
+
+
+Registry.prototype.definePackage = function(target, pkg) {
+ this.properties.define(target, '$pkg', { value: pkg });
+};
+},{"204":204,"325":325,"59":59,"62":62,"65":65}],65:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Built-in moddle types
+ */
+var BUILTINS = {
+ String: true,
+ Boolean: true,
+ Integer: true,
+ Real: true,
+ Element: true
+};
+
+/**
+ * Converters for built in types from string representations
+ */
+var TYPE_CONVERTERS = {
+ String: function(s) { return s; },
+ Boolean: function(s) { return s === 'true'; },
+ Integer: function(s) { return parseInt(s, 10); },
+ Real: function(s) { return parseFloat(s, 10); }
+};
+
+/**
+ * Convert a type to its real representation
+ */
+module.exports.coerceType = function(type, value) {
+
+ var converter = TYPE_CONVERTERS[type];
+
+ if (converter) {
+ return converter(value);
+ } else {
+ return value;
+ }
+};
+
+/**
+ * Return whether the given type is built-in
+ */
+module.exports.isBuiltIn = function(type) {
+ return !!BUILTINS[type];
+};
+
+/**
+ * Return whether the given type is simple
+ */
+module.exports.isSimple = function(type) {
+ return !!TYPE_CONVERTERS[type];
+};
+},{}],66:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMN20",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
+ "associations": [],
+ "types": [
+ {
+ "name": "Interface",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operations",
+ "type": "Operation",
+ "isMany": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Operation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "errorRefs",
+ "type": "Error",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EndPoint",
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "Auditing",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "GlobalTask",
+ "superClass": [
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Monitoring",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Performer",
+ "superClass": [
+ "ResourceRole"
+ ]
+ },
+ {
+ "name": "Process",
+ "superClass": [
+ "FlowElementsContainer",
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "processType",
+ "type": "ProcessType",
+ "isAttr": true
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "supports",
+ "type": "Process",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "definitionalCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "isExecutable",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "correlationSubscriptions",
+ "type": "CorrelationSubscription",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LaneSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Lane",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "childLaneSet",
+ "type": "LaneSet",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "partitionElementRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "flowNodeRef",
+ "type": "FlowNode",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "partitionElement",
+ "type": "BaseElement"
+ }
+ ]
+ },
+ {
+ "name": "GlobalManualTask",
+ "superClass": [
+ "GlobalTask"
+ ]
+ },
+ {
+ "name": "ManualTask",
+ "superClass": [
+ "Task"
+ ]
+ },
+ {
+ "name": "UserTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ },
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Rendering",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "HumanPerformer",
+ "superClass": [
+ "Performer"
+ ]
+ },
+ {
+ "name": "PotentialOwner",
+ "superClass": [
+ "HumanPerformer"
+ ]
+ },
+ {
+ "name": "GlobalUserTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Gateway",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "gatewayDirection",
+ "type": "GatewayDirection",
+ "default": "Unspecified",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "eventGatewayType",
+ "type": "EventBasedGatewayType",
+ "isAttr": true,
+ "default": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "ComplexGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "activationCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParallelGateway",
+ "superClass": [
+ "Gateway"
+ ]
+ },
+ {
+ "name": "RootElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Relationship",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "direction",
+ "type": "RelationshipDirection",
+ "isAttr": true
+ },
+ {
+ "name": "source",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "target",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ }
+ ]
+ },
+ {
+ "name": "BaseElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "id",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "type": "Documentation",
+ "isMany": true
+ },
+ {
+ "name": "extensionDefinitions",
+ "type": "ExtensionDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "extensionElements",
+ "type": "ExtensionElements"
+ }
+ ]
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "mustUnderstand",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "definition",
+ "type": "ExtensionDefinition"
+ }
+ ]
+ },
+ {
+ "name": "ExtensionDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "extensionAttributeDefinitions",
+ "type": "ExtensionAttributeDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionAttributeDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isReference",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "extensionDefinition",
+ "type": "ExtensionDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionElements",
+ "properties": [
+ {
+ "name": "valueRef",
+ "isAttr": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ },
+ {
+ "name": "extensionAttributeDefinition",
+ "type": "ExtensionAttributeDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Documentation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Event",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "IntermediateCatchEvent",
+ "superClass": [
+ "CatchEvent"
+ ]
+ },
+ {
+ "name": "IntermediateThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "EndEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "StartEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "isInterrupting",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "ThrowEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "inputSet",
+ "type": "InputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociation",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CatchEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "parallelMultiple",
+ "isAttr": true,
+ "type": "Boolean",
+ "default": false
+ },
+ {
+ "name": "outputSet",
+ "type": "OutputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataOutputAssociation",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "BoundaryEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "cancelActivity",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "attachedToRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "EventDefinition",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CancelEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "ErrorEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "errorRef",
+ "type": "Error",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TerminateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "EscalationEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "escalationRef",
+ "type": "Escalation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Escalation",
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "escalationCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ],
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CompensateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "waitForCompletion",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "activityRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TimerEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "timeDate",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeCycle",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeDuration",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "LinkEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "target",
+ "type": "LinkEventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "source",
+ "type": "LinkEventDefinition",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConditionalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "SignalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "signalRef",
+ "type": "Signal",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Signal",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ImplicitThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "DataState",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ItemAwareElement",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "itemSubjectRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "dataState",
+ "type": "DataState"
+ }
+ ]
+ },
+ {
+ "name": "DataAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "transformation",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "assignment",
+ "type": "Assignment",
+ "isMany": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "ItemAwareElement",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "ItemAwareElement",
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataInput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithOptional",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithWhileExecuting",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataOutput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithOptional",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithWhileExecuting",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "dataInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "OutputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Property",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "DataInputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "DataOutputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "InputOutputSpecification",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "inputSets",
+ "type": "InputSet",
+ "isMany": true
+ },
+ {
+ "name": "outputSets",
+ "type": "OutputSet",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "DataObject",
+ "superClass": [
+ "FlowElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "InputOutputBinding",
+ "properties": [
+ {
+ "name": "inputDataRef",
+ "type": "InputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outputDataRef",
+ "type": "OutputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Assignment",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "from",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "to",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "DataStore",
+ "superClass": [
+ "RootElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "capacity",
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "isUnlimited",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "DataStoreReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataStoreRef",
+ "type": "DataStore",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataObjectReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataObjectRef",
+ "type": "DataObject",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationLink",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ConversationAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CallConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "calledCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Conversation",
+ "superClass": [
+ "ConversationNode"
+ ]
+ },
+ {
+ "name": "SubConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "conversationNodes",
+ "type": "ConversationNode",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationNode",
+ "isAbstract": true,
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "messageFlowRefs",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "GlobalConversation",
+ "superClass": [
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "PartnerEntity",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "PartnerRole",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationProperty",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRetrievalExpression",
+ "type": "CorrelationPropertyRetrievalExpression",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Error",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "errorCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "CorrelationKey",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Expression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "isAbstract": true
+ },
+ {
+ "name": "FormalExpression",
+ "superClass": [
+ "Expression"
+ ],
+ "properties": [
+ {
+ "name": "language",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "body",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "evaluatesToTypeRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Message",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "itemRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ItemDefinition",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "itemKind",
+ "type": "ItemKind",
+ "isAttr": true
+ },
+ {
+ "name": "structureRef",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "import",
+ "type": "Import",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SequenceFlow",
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "isImmediate",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "conditionExpression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "sourceRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElementsContainer",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "laneSets",
+ "type": "LaneSet",
+ "isMany": true
+ },
+ {
+ "name": "flowElements",
+ "type": "FlowElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CallableElement",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "supportedInterfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "ioBinding",
+ "type": "InputOutputBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "FlowNode",
+ "isAbstract": true,
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "incoming",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoing",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyRetrievalExpression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "messagePath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyBinding",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataPath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Resource",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resourceParameters",
+ "type": "ResourceParameter",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameter",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isRequired",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationSubscription",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationKeyRef",
+ "type": "CorrelationKey",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationPropertyBinding",
+ "type": "CorrelationPropertyBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlow",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlowAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InteractionNode",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "incomingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Participant",
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "interfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "participantMultiplicity",
+ "type": "ParticipantMultiplicity"
+ },
+ {
+ "name": "endPointRefs",
+ "type": "EndPoint",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "processRef",
+ "type": "Process",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantMultiplicity",
+ "properties": [
+ {
+ "name": "minimum",
+ "default": 0,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "maximum",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "Collaboration",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "choreographyRef",
+ "type": "Choreography",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ },
+ {
+ "name": "messageFlowAssociations",
+ "type": "MessageFlowAssociation",
+ "isMany": true
+ },
+ {
+ "name": "conversationAssociations",
+ "type": "ConversationAssociation"
+ },
+ {
+ "name": "participants",
+ "type": "Participant",
+ "isMany": true
+ },
+ {
+ "name": "messageFlows",
+ "type": "MessageFlow",
+ "isMany": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "conversations",
+ "type": "ConversationNode",
+ "isMany": true
+ },
+ {
+ "name": "conversationLinks",
+ "type": "ConversationLink",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyActivity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "loopType",
+ "type": "ChoreographyLoopType",
+ "default": "None",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "CallChoreography",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "calledChoreographyRef",
+ "type": "Choreography",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "SubChoreography",
+ "superClass": [
+ "ChoreographyActivity",
+ "FlowElementsContainer"
+ ],
+ "properties": [
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyTask",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "messageFlowRef",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Choreography",
+ "superClass": [
+ "FlowElementsContainer",
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "GlobalChoreographyTask",
+ "superClass": [
+ "Choreography"
+ ],
+ "properties": [
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TextAnnotation",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String"
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Group",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Association",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "associationDirection",
+ "type": "AssociationDirection",
+ "isAttr": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Category",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "categoryValue",
+ "type": "CategoryValue",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Artifact",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "CategoryValue",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "categorizedFlowElements",
+ "type": "FlowElement",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "value",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Activity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "isForCompensation",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCharacteristics",
+ "type": "LoopCharacteristics"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "boundaryEventRefs",
+ "type": "BoundaryEvent",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociations",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputAssociations",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "startQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "completionQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "ServiceTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SubProcess",
+ "superClass": [
+ "Activity",
+ "FlowElementsContainer",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "triggeredByEvent",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LoopCharacteristics",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "MultiInstanceLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "isSequential",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "behavior",
+ "type": "MultiInstanceBehavior",
+ "default": "All",
+ "isAttr": true
+ },
+ {
+ "name": "loopCardinality",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopDataInputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "loopDataOutputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "inputDataItem",
+ "type": "DataInput"
+ },
+ {
+ "name": "outputDataItem",
+ "type": "DataOutput"
+ },
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "complexBehaviorDefinition",
+ "type": "ComplexBehaviorDefinition",
+ "isMany": true
+ },
+ {
+ "name": "oneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "noneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "StandardLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "testBefore",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopMaximum",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "CallActivity",
+ "superClass": [
+ "Activity"
+ ],
+ "properties": [
+ {
+ "name": "calledElement",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Task",
+ "superClass": [
+ "Activity",
+ "InteractionNode"
+ ]
+ },
+ {
+ "name": "SendTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ReceiveTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ScriptTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "scriptFormat",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "BusinessRuleTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "AdHocSubProcess",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "ordering",
+ "type": "AdHocOrdering",
+ "isAttr": true
+ },
+ {
+ "name": "cancelRemainingInstances",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "Transaction",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "protocol",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "method",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalScriptTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "scriptLanguage",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalBusinessRuleTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ComplexBehaviorDefinition",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "event",
+ "type": "ImplicitThrowEvent"
+ }
+ ]
+ },
+ {
+ "name": "ResourceRole",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "resourceRef",
+ "type": "Resource",
+ "isReference": true
+ },
+ {
+ "name": "resourceParameterBindings",
+ "type": "ResourceParameterBinding",
+ "isMany": true
+ },
+ {
+ "name": "resourceAssignmentExpression",
+ "type": "ResourceAssignmentExpression"
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameterBinding",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "parameterRef",
+ "type": "ResourceParameter",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceAssignmentExpression",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Import",
+ "properties": [
+ {
+ "name": "importType",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "location",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "namespace",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Definitions",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "targetNamespace",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "expressionLanguage",
+ "default": "http://www.w3.org/1999/XPath",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "typeLanguage",
+ "default": "http://www.w3.org/2001/XMLSchema",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "imports",
+ "type": "Import",
+ "isMany": true
+ },
+ {
+ "name": "extensions",
+ "type": "Extension",
+ "isMany": true
+ },
+ {
+ "name": "rootElements",
+ "type": "RootElement",
+ "isMany": true
+ },
+ {
+ "name": "diagrams",
+ "isMany": true,
+ "type": "bpmndi:BPMNDiagram"
+ },
+ {
+ "name": "exporter",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "relationships",
+ "type": "Relationship",
+ "isMany": true
+ },
+ {
+ "name": "exporterVersion",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ProcessType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Public"
+ },
+ {
+ "name": "Private"
+ }
+ ]
+ },
+ {
+ "name": "GatewayDirection",
+ "literalValues": [
+ {
+ "name": "Unspecified"
+ },
+ {
+ "name": "Converging"
+ },
+ {
+ "name": "Diverging"
+ },
+ {
+ "name": "Mixed"
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGatewayType",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "RelationshipDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Forward"
+ },
+ {
+ "name": "Backward"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "ItemKind",
+ "literalValues": [
+ {
+ "name": "Physical"
+ },
+ {
+ "name": "Information"
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyLoopType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Standard"
+ },
+ {
+ "name": "MultiInstanceSequential"
+ },
+ {
+ "name": "MultiInstanceParallel"
+ }
+ ]
+ },
+ {
+ "name": "AssociationDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "MultiInstanceBehavior",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "All"
+ },
+ {
+ "name": "Complex"
+ }
+ ]
+ },
+ {
+ "name": "AdHocOrdering",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Sequential"
+ }
+ ]
+ }
+ ],
+ "prefix": "bpmn",
+ "xml": {
+ "tagAlias": "lowerCase",
+ "typePrefix": "t"
+ }
+}
+},{}],67:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMNDI",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
+ "types": [
+ {
+ "name": "BPMNDiagram",
+ "properties": [
+ {
+ "name": "plane",
+ "type": "BPMNPlane",
+ "redefines": "di:Diagram#rootElement"
+ },
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isMany": true
+ }
+ ],
+ "superClass": [
+ "di:Diagram"
+ ]
+ },
+ {
+ "name": "BPMNPlane",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ }
+ ],
+ "superClass": [
+ "di:Plane"
+ ]
+ },
+ {
+ "name": "BPMNShape",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "isHorizontal",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isExpanded",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isMarkerVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "isMessageVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "participantBandKind",
+ "type": "ParticipantBandKind",
+ "isAttr": true
+ },
+ {
+ "name": "choreographyActivityShape",
+ "type": "BPMNShape",
+ "isAttr": true,
+ "isReference": true
+ }
+ ],
+ "superClass": [
+ "di:LabeledShape"
+ ]
+ },
+ {
+ "name": "BPMNEdge",
+ "properties": [
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "sourceElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#source"
+ },
+ {
+ "name": "targetElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#target"
+ },
+ {
+ "name": "messageVisibleKind",
+ "type": "MessageVisibleKind",
+ "isAttr": true,
+ "default": "initiating"
+ }
+ ],
+ "superClass": [
+ "di:LabeledEdge"
+ ]
+ },
+ {
+ "name": "BPMNLabel",
+ "properties": [
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isAttr": true,
+ "isReference": true,
+ "redefines": "di:DiagramElement#style"
+ }
+ ],
+ "superClass": [
+ "di:Label"
+ ]
+ },
+ {
+ "name": "BPMNLabelStyle",
+ "properties": [
+ {
+ "name": "font",
+ "type": "dc:Font"
+ }
+ ],
+ "superClass": [
+ "di:Style"
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ParticipantBandKind",
+ "literalValues": [
+ {
+ "name": "top_initiating"
+ },
+ {
+ "name": "middle_initiating"
+ },
+ {
+ "name": "bottom_initiating"
+ },
+ {
+ "name": "top_non_initiating"
+ },
+ {
+ "name": "middle_non_initiating"
+ },
+ {
+ "name": "bottom_non_initiating"
+ }
+ ]
+ },
+ {
+ "name": "MessageVisibleKind",
+ "literalValues": [
+ {
+ "name": "initiating"
+ },
+ {
+ "name": "non_initiating"
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "bpmndi"
+}
+},{}],68:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DC",
+ "uri": "http://www.omg.org/spec/DD/20100524/DC",
+ "types": [
+ {
+ "name": "Boolean"
+ },
+ {
+ "name": "Integer"
+ },
+ {
+ "name": "Real"
+ },
+ {
+ "name": "String"
+ },
+ {
+ "name": "Font",
+ "properties": [
+ {
+ "name": "name",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "size",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "isBold",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isItalic",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isUnderline",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isStrikeThrough",
+ "type": "Boolean",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Point",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Bounds",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "width",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "height",
+ "type": "Real",
+ "isAttr": true
+ }
+ ]
+ }
+ ],
+ "prefix": "dc",
+ "associations": []
+}
+},{}],69:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DI",
+ "uri": "http://www.omg.org/spec/DD/20100524/DI",
+ "types": [
+ {
+ "name": "DiagramElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "extension",
+ "type": "Extension"
+ },
+ {
+ "name": "owningDiagram",
+ "type": "Diagram",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "owningElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "modelElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "style",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "ownedElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Node",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ]
+ },
+ {
+ "name": "Edge",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ],
+ "properties": [
+ {
+ "name": "source",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "target",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "waypoint",
+ "isUnique": false,
+ "isMany": true,
+ "type": "dc:Point",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Diagram",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "rootElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resolution",
+ "isAttr": true,
+ "type": "Real"
+ },
+ {
+ "name": "ownedStyle",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Shape",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Plane",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "planeElement",
+ "type": "DiagramElement",
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledEdge",
+ "isAbstract": true,
+ "superClass": [
+ "Edge"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledShape",
+ "isAbstract": true,
+ "superClass": [
+ "Shape"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Label",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Style",
+ "isAbstract": true
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "di",
+ "xml": {
+ "tagAlias": "lowerCase"
+ }
+}
+},{}],70:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(103) ],
+ __init__: [ 'directEditing' ],
+ directEditing: [ 'type', _dereq_(71) ]
+};
+},{"103":103,"71":71}],71:[function(_dereq_,module,exports){
+'use strict';
+
+var bind = _dereq_(213),
+ find = _dereq_(203);
+
+var TextBox = _dereq_(72);
+
+
+/**
+ * A direct editing component that allows users
+ * to edit an elements text directly in the diagram
+ *
+ * @param {EventBus} eventBus the event bus
+ */
+function DirectEditing(eventBus, canvas) {
+
+ this._eventBus = eventBus;
+
+ this._providers = [];
+ this._textbox = new TextBox({
+ container: canvas.getContainer(),
+ keyHandler: bind(this._handleKey, this)
+ });
+}
+
+DirectEditing.$inject = [ 'eventBus', 'canvas' ];
+
+
+/**
+ * Register a direct editing provider
+
+ * @param {Object} provider the provider, must expose an #activate(element) method that returns
+ * an activation context ({ bounds: {x, y, width, height }, text }) if
+ * direct editing is available for the given element.
+ * Additionally the provider must expose a #update(element, value) method
+ * to receive direct editing updates.
+ */
+DirectEditing.prototype.registerProvider = function(provider) {
+ this._providers.push(provider);
+};
+
+
+/**
+ * Returns true if direct editing is currently active
+ *
+ * @return {Boolean}
+ */
+DirectEditing.prototype.isActive = function() {
+ return !!this._active;
+};
+
+
+/**
+ * Cancel direct editing, if it is currently active
+ */
+DirectEditing.prototype.cancel = function() {
+ if (!this._active) {
+ return;
+ }
+
+ this._fire('cancel');
+ this.close();
+};
+
+
+DirectEditing.prototype._fire = function(event) {
+ this._eventBus.fire('directEditing.' + event, { active: this._active });
+};
+
+DirectEditing.prototype.close = function() {
+ this._textbox.destroy();
+
+ this._fire('deactivate');
+
+ this._active = null;
+};
+
+
+DirectEditing.prototype.complete = function() {
+
+ var active = this._active;
+
+ if (!active) {
+ return;
+ }
+
+ var text = this.getValue();
+
+ if (text !== active.context.text) {
+ active.provider.update(active.element, text, active.context.text);
+ }
+
+ this._fire('complete');
+
+ this.close();
+};
+
+
+DirectEditing.prototype.getValue = function() {
+ return this._textbox.getValue();
+};
+
+
+DirectEditing.prototype._handleKey = function(e) {
+
+ // stop bubble
+ e.stopPropagation();
+
+ var key = e.keyCode || e.charCode;
+
+ // ESC
+ if (key === 27) {
+ e.preventDefault();
+ return this.cancel();
+ }
+
+ // Enter
+ if (key === 13 && !e.shiftKey) {
+ e.preventDefault();
+ return this.complete();
+ }
+};
+
+
+/**
+ * Activate direct editing on the given element
+ *
+ * @param {Object} ElementDescriptor the descriptor for a shape or connection
+ * @return {Boolean} true if the activation was possible
+ */
+DirectEditing.prototype.activate = function(element) {
+
+ if (this.isActive()) {
+ this.cancel();
+ }
+
+ // the direct editing context
+ var context;
+
+ var provider = find(this._providers, function(p) {
+ return !!(context = p.activate(element)) ? p : null;
+ });
+
+ // check if activation took place
+ if (context) {
+ this._textbox.create(context.bounds, context.style, context.text);
+
+ this._active = {
+ element: element,
+ context: context,
+ provider: provider
+ };
+
+ this._fire('activate');
+ }
+
+ return !!context;
+};
+
+
+module.exports = DirectEditing;
+},{"203":203,"213":213,"72":72}],72:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ domEvent = _dereq_(344),
+ domRemove = _dereq_(347);
+
+function stopPropagation(event) {
+ event.stopPropagation();
+}
+
+function TextBox(options) {
+
+ this.container = options.container;
+ this.textarea = document.createElement('textarea');
+
+ this.keyHandler = options.keyHandler || function() {};
+}
+
+module.exports = TextBox;
+
+
+TextBox.prototype.create = function(bounds, style, value) {
+
+ var textarea = this.textarea,
+ container = this.container;
+
+ assign(textarea.style, {
+ width: bounds.width + 'px',
+ height: bounds.height + 'px',
+ left: bounds.x + 'px',
+ top: bounds.y + 'px',
+ position: 'absolute',
+ textAlign: 'center',
+ boxSizing: 'border-box'
+ }, style || {});
+
+ textarea.value = value;
+ textarea.title = 'Press SHIFT+Enter for line feed';
+
+ domEvent.bind(textarea, 'keydown', this.keyHandler);
+ domEvent.bind(textarea, 'mousedown', stopPropagation);
+
+ container.appendChild(textarea);
+
+ setTimeout(function() {
+ textarea.select();
+ textarea.focus();
+ }, 100);
+};
+
+TextBox.prototype.destroy = function() {
+ var textarea = this.textarea;
+
+ textarea.value = '';
+
+ domEvent.unbind(textarea, 'keydown', this.keyHandler);
+ domEvent.unbind(textarea, 'mousedown', stopPropagation);
+
+ domRemove(textarea);
+};
+
+TextBox.prototype.getValue = function() {
+ return this.textarea.value;
+};
+},{"325":325,"344":344,"347":347}],73:[function(_dereq_,module,exports){
+module.exports = _dereq_(74);
+},{"74":74}],74:[function(_dereq_,module,exports){
+'use strict';
+
+var di = _dereq_(190);
+
+
+/**
+ * Bootstrap an injector from a list of modules, instantiating a number of default components
+ *
+ * @ignore
+ * @param {Array<didi.Module>} bootstrapModules
+ *
+ * @return {didi.Injector} a injector to use to access the components
+ */
+function bootstrap(bootstrapModules) {
+
+ var modules = [],
+ components = [];
+
+ function hasModule(m) {
+ return modules.indexOf(m) >= 0;
+ }
+
+ function addModule(m) {
+ modules.push(m);
+ }
+
+ function visit(m) {
+ if (hasModule(m)) {
+ return;
+ }
+
+ (m.__depends__ || []).forEach(visit);
+
+ if (hasModule(m)) {
+ return;
+ }
+
+ addModule(m);
+
+ (m.__init__ || []).forEach(function(c) {
+ components.push(c);
+ });
+ }
+
+ bootstrapModules.forEach(visit);
+
+ var injector = new di.Injector(modules);
+
+ components.forEach(function(c) {
+
+ try {
+ // eagerly resolve component (fn or string)
+ injector[typeof c === 'string' ? 'get' : 'invoke'](c);
+ } catch (e) {
+ console.error('Failed to instantiate component');
+ console.error(e.stack);
+
+ throw e;
+ }
+ });
+
+ return injector;
+}
+
+/**
+ * Creates an injector from passed options.
+ *
+ * @ignore
+ * @param {Object} options
+ * @return {didi.Injector}
+ */
+function createInjector(options) {
+
+ options = options || {};
+
+ var configModule = {
+ 'config': ['value', options]
+ };
+
+ var coreModule = _dereq_(83);
+
+ var modules = [ configModule, coreModule ].concat(options.modules || []);
+
+ return bootstrap(modules);
+}
+
+
+/**
+ * The main diagram-js entry point that bootstraps the diagram with the given
+ * configuration.
+ *
+ * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.
+ *
+ * @class djs.Diagram
+ * @memberOf djs
+ * @constructor
+ *
+ * @example
+ *
+ * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>
+ *
+ * // plug-in implemenentation
+ * function MyLoggingPlugin(eventBus) {
+ * eventBus.on('shape.added', function(event) {
+ * console.log('shape ', event.shape, ' was added to the diagram');
+ * });
+ * }
+ *
+ * // export as module
+ * module.exports = {
+ * __init__: [ 'myLoggingPlugin' ],
+ * myLoggingPlugin: [ 'type', MyLoggingPlugin ]
+ * };
+ *
+ *
+ * // instantiate the diagram with the new plug-in
+ *
+ * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });
+ *
+ * diagram.invoke([ 'canvas', function(canvas) {
+ * // add shape to drawing canvas
+ * canvas.addShape({ x: 10, y: 10 });
+ * });
+ *
+ * // 'shape ... was added to the diagram' logged to console
+ *
+ * @param {Object} options
+ * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram
+ * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with
+ */
+function Diagram(options, injector) {
+
+ // create injector unless explicitly specified
+ this.injector = injector = injector || createInjector(options);
+
+ // API
+
+ /**
+ * Resolves a diagram service
+ *
+ * @method Diagram#get
+ *
+ * @param {String} name the name of the diagram service to be retrieved
+ * @param {Object} [locals] a number of locals to use to resolve certain dependencies
+ */
+ this.get = injector.get;
+
+ /**
+ * Executes a function into which diagram services are injected
+ *
+ * @method Diagram#invoke
+ *
+ * @param {Function|Object[]} fn the function to resolve
+ * @param {Object} locals a number of locals to use to resolve certain dependencies
+ */
+ this.invoke = injector.invoke;
+
+ // init
+
+ // indicate via event
+
+
+ /**
+ * An event indicating that all plug-ins are loaded.
+ *
+ * Use this event to fire other events to interested plug-ins
+ *
+ * @memberOf Diagram
+ *
+ * @event diagram.init
+ *
+ * @example
+ *
+ * eventBus.on('diagram.init', function() {
+ * eventBus.fire('my-custom-event', { foo: 'BAR' });
+ * });
+ *
+ * @type {Object}
+ */
+ this.get('eventBus').fire('diagram.init');
+}
+
+module.exports = Diagram;
+
+
+/**
+ * Destroys the diagram
+ *
+ * @method Diagram#destroy
+ */
+Diagram.prototype.destroy = function() {
+ this.get('eventBus').fire('diagram.destroy');
+};
+},{"190":190,"83":83}],75:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ isFunction = _dereq_(317),
+ isArray = _dereq_(316);
+
+
+/**
+ * A utility that can be used to plug-in into the command execution for
+ * extension and/or validation.
+ *
+ * @param {EventBus} eventBus
+ *
+ * @example
+ *
+ * var inherits = require('inherits');
+ *
+ * var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
+ *
+ * function CommandLogger(eventBus) {
+ * CommandInterceptor.call(this, eventBus);
+ *
+ * this.preExecute(function(event) {
+ * console.log('command pre-execute', event);
+ * });
+ * }
+ *
+ * inherits(CommandLogger, CommandInterceptor);
+ *
+ */
+function CommandInterceptor(eventBus) {
+ this._eventBus = eventBus;
+}
+
+CommandInterceptor.$inject = [ 'eventBus' ];
+
+module.exports = CommandInterceptor;
+
+function unwrapEvent(fn) {
+ return function(event) {
+ return fn(event.context, event.command, event);
+ };
+}
+
+/**
+ * Register an interceptor for a command execution
+ *
+ * @param {String|Array<String>} [events] list of commands to register on
+ * @param {String} [hook] command hook, i.e. preExecute, executed to listen on
+ * @param {Function} handlerFn interceptor to be invoked with (event)
+ * @param {Boolean} unwrap if true, unwrap the event and pass (context, command, event) to the
+ * listener instead
+ */
+CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
+
+ if (isFunction(hook)) {
+ unwrap = handlerFn;
+ handlerFn = hook;
+ hook = null;
+ }
+
+ if (!isFunction(handlerFn)) {
+ throw new Error('handlerFn must be a function');
+ }
+
+ if (!isArray(events)) {
+ events = [ events ];
+ }
+
+ var eventBus = this._eventBus;
+
+ forEach(events, function(event) {
+ // concat commandStack(.event)?(.hook)?
+ var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
+
+ eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
+ });
+};
+
+
+var hooks = [
+ 'canExecute',
+ 'preExecute',
+ 'execute',
+ 'executed',
+ 'postExecute',
+ 'revert',
+ 'reverted'
+];
+
+/*
+ * Install hook shortcuts
+ *
+ * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
+ * which will in term forward to CommandInterceptor#on.
+ */
+forEach(hooks, function(hook) {
+ CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
+ if (isFunction(events)) {
+ unwrap = fn;
+ fn = events;
+ events = null;
+ }
+
+ this.on(events, hook, fn, unwrap);
+ };
+});
+},{"204":204,"316":316,"317":317}],76:[function(_dereq_,module,exports){
+'use strict';
+
+var unique = _dereq_(199),
+ isArray = _dereq_(316),
+ assign = _dereq_(325);
+
+var InternalEvent = _dereq_(81).Event;
+
+
+/**
+ * A service that offers un- and redoable execution of commands.
+ *
+ * The command stack is responsible for executing modeling actions
+ * in a un- and redoable manner. To do this it delegates the actual
+ * command execution to {@link CommandHandler}s.
+ *
+ * Command handlers provide {@link CommandHandler#execute(ctx)} and
+ * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
+ * identified by a command context.
+ *
+ *
+ * ## Life-Cycle events
+ *
+ * In the process the command stack fires a number of life-cycle events
+ * that other components to participate in the command execution.
+ *
+ * * preExecute
+ * * execute
+ * * executed
+ * * postExecute
+ * * revert
+ * * reverted
+ *
+ * A special event is used for validating, whether a command can be
+ * performed prior to its execution.
+ *
+ * * canExecute
+ *
+ * Each of the events is fired as `commandStack.{eventName}` and
+ * `commandStack.{commandName}.{eventName}`, respectively. This gives
+ * components fine grained control on where to hook into.
+ *
+ * The event object fired transports `command`, the name of the
+ * command and `context`, the command context.
+ *
+ *
+ * ## Creating Command Handlers
+ *
+ * Command handlers should provide the {@link CommandHandler#execute(ctx)}
+ * and {@link CommandHandler#revert(ctx)} methods to implement
+ * redoing and undoing of a command. They must ensure undo is performed
+ * properly in order not to break the undo chain.
+ *
+ * Command handlers may execute other modeling operations (and thus
+ * commands) in their `preExecute` and `postExecute` phases. The command
+ * stack will properly group all commands together into a logical unit
+ * that may be re- and undone atomically.
+ *
+ * Command handlers must not execute other commands from within their
+ * core implementation (`execute`, `revert`).
+ *
+ *
+ * ## Change Tracking
+ *
+ * During the execution of the CommandStack it will keep track of all
+ * elements that have been touched during the command's execution.
+ *
+ * At the end of the CommandStack execution it will notify interested
+ * components via an 'elements.changed' event with all the dirty
+ * elements.
+ *
+ * The event can be picked up by components that are interested in the fact
+ * that elements have been changed. One use case for this is updating
+ * their graphical representation after moving / resizing or deletion.
+ *
+ *
+ * @param {EventBus} eventBus
+ * @param {Injector} injector
+ */
+function CommandStack(eventBus, injector) {
+
+ /**
+ * A map of all registered command handlers.
+ *
+ * @type {Object}
+ */
+ this._handlerMap = {};
+
+ /**
+ * A stack containing all re/undoable actions on the diagram
+ *
+ * @type {Array<Object>}
+ */
+ this._stack = [];
+
+ /**
+ * The current index on the stack
+ *
+ * @type {Number}
+ */
+ this._stackIdx = -1;
+
+ /**
+ * Current active commandStack execution
+ *
+ * @type {Object}
+ */
+ this._currentExecution = {
+ actions: [],
+ dirty: []
+ };
+
+
+ this._injector = injector;
+ this._eventBus = eventBus;
+
+ this._uid = 1;
+}
+
+CommandStack.$inject = [ 'eventBus', 'injector' ];
+
+module.exports = CommandStack;
+
+
+/**
+ * Execute a command
+ *
+ * @param {String} command the command to execute
+ * @param {Object} context the environment to execute the command in
+ */
+CommandStack.prototype.execute = function(command, context) {
+ if (!command) {
+ throw new Error('command required');
+ }
+
+ var action = { command: command, context: context };
+
+ this._pushAction(action);
+ this._internalExecute(action);
+ this._popAction(action);
+};
+
+
+/**
+ * Ask whether a given command can be executed.
+ *
+ * Implementors may hook into the mechanism on two ways:
+ *
+ * * in event listeners:
+ *
+ * Users may prevent the execution via an event listener.
+ * It must prevent the default action for `commandStack.(<command>.)canExecute` events.
+ *
+ * * in command handlers:
+ *
+ * If the method {@link CommandHandler#canExecute} is implemented in a handler
+ * it will be called to figure out whether the execution is allowed.
+ *
+ * @param {String} command the command to execute
+ * @param {Object} context the environment to execute the command in
+ *
+ * @return {Boolean} true if the command can be executed
+ */
+CommandStack.prototype.canExecute = function(command, context) {
+
+ var action = { command: command, context: context };
+
+ var handler = this._getHandler(command);
+
+ if (!handler) {
+ return false;
+ }
+
+ var result = this._fire(command, 'canExecute', action);
+
+ // handler#canExecute will only be called if no listener
+ // decided on a result already
+ if (result === undefined && handler.canExecute) {
+ result = handler.canExecute(context);
+ }
+
+ return result;
+};
+
+
+/**
+ * Clear the command stack, erasing all undo / redo history
+ */
+CommandStack.prototype.clear = function() {
+ this._stack.length = 0;
+ this._stackIdx = -1;
+
+ this._fire('changed');
+};
+
+
+/**
+ * Undo last command(s)
+ */
+CommandStack.prototype.undo = function() {
+ var action = this._getUndoAction(),
+ next;
+
+ if (action) {
+ this._pushAction(action);
+
+ while (action) {
+ this._internalUndo(action);
+ next = this._getUndoAction();
+
+ if (!next || next.id !== action.id) {
+ break;
+ }
+
+ action = next;
+ }
+
+ this._popAction();
+ }
+};
+
+
+/**
+ * Redo last command(s)
+ */
+CommandStack.prototype.redo = function() {
+ var action = this._getRedoAction(),
+ next;
+
+ if (action) {
+ this._pushAction(action);
+
+ while (action) {
+ this._internalExecute(action, true);
+ next = this._getRedoAction();
+
+ if (!next || next.id !== action.id) {
+ break;
+ }
+
+ action = next;
+ }
+
+ this._popAction();
+ }
+};
+
+
+/**
+ * Register a handler instance with the command stack
+ *
+ * @param {String} command
+ * @param {CommandHandler} handler
+ */
+CommandStack.prototype.register = function(command, handler) {
+ this._setHandler(command, handler);
+};
+
+
+/**
+ * Register a handler type with the command stack
+ * by instantiating it and injecting its dependencies.
+ *
+ * @param {String} command
+ * @param {Function} a constructor for a {@link CommandHandler}
+ */
+CommandStack.prototype.registerHandler = function(command, handlerCls) {
+
+ if (!command || !handlerCls) {
+ throw new Error('command and handlerCls must be defined');
+ }
+
+ var handler = this._injector.instantiate(handlerCls);
+ this.register(command, handler);
+};
+
+CommandStack.prototype.canUndo = function() {
+ return !!this._getUndoAction();
+};
+
+CommandStack.prototype.canRedo = function() {
+ return !!this._getRedoAction();
+};
+
+////// stack access //////////////////////////////////////
+
+CommandStack.prototype._getRedoAction = function() {
+ return this._stack[this._stackIdx + 1];
+};
+
+
+CommandStack.prototype._getUndoAction = function() {
+ return this._stack[this._stackIdx];
+};
+
+
+////// internal functionality /////////////////////////////
+
+CommandStack.prototype._internalUndo = function(action) {
+ var command = action.command,
+ context = action.context;
+
+ var handler = this._getHandler(command);
+
+ this._fire(command, 'revert', action);
+
+ this._markDirty(handler.revert(context));
+
+ this._revertedAction(action);
+
+ this._fire(command, 'reverted', action);
+};
+
+
+CommandStack.prototype._fire = function(command, qualifier, event) {
+ if (arguments.length < 3) {
+ event = qualifier;
+ qualifier = null;
+ }
+
+ var names = qualifier ? [ command + '.' + qualifier, qualifier ] : [ command ],
+ i, name, result;
+
+ event = assign(new InternalEvent(), event);
+
+ for (i = 0; !!(name = names[i]); i++) {
+ result = this._eventBus.fire('commandStack.' + name, event);
+
+ if (event.cancelBubble) {
+ break;
+ }
+ }
+
+ return result;
+};
+
+CommandStack.prototype._createId = function() {
+ return this._uid++;
+};
+
+
+CommandStack.prototype._internalExecute = function(action, redo) {
+ var command = action.command,
+ context = action.context;
+
+ var handler = this._getHandler(command);
+
+ if (!handler) {
+ throw new Error('no command handler registered for <' + command + '>');
+ }
+
+ this._pushAction(action);
+
+ if (!redo) {
+ this._fire(command, 'preExecute', action);
+
+ if (handler.preExecute) {
+ handler.preExecute(context);
+ }
+ }
+
+ this._fire(command, 'execute', action);
+
+ // execute
+ this._markDirty(handler.execute(context));
+
+ // log to stack
+ this._executedAction(action, redo);
+
+ this._fire(command, 'executed', action);
+
+ if (!redo) {
+ if (handler.postExecute) {
+ handler.postExecute(context);
+ }
+
+ this._fire(command, 'postExecute', action);
+ }
+
+ this._popAction(action);
+};
+
+
+CommandStack.prototype._pushAction = function(action) {
+
+ var execution = this._currentExecution,
+ actions = execution.actions;
+
+ var baseAction = actions[0];
+
+ if (!action.id) {
+ action.id = (baseAction && baseAction.id) || this._createId();
+ }
+
+ actions.push(action);
+};
+
+
+CommandStack.prototype._popAction = function() {
+ var execution = this._currentExecution,
+ actions = execution.actions,
+ dirty = execution.dirty;
+
+ actions.pop();
+
+ if (!actions.length) {
+ this._eventBus.fire('elements.changed', { elements: unique(dirty) });
+
+ dirty.length = 0;
+
+ this._fire('changed');
+ }
+};
+
+
+CommandStack.prototype._markDirty = function(elements) {
+ var execution = this._currentExecution;
+
+ if (!elements) {
+ return;
+ }
+
+ elements = isArray(elements) ? elements : [ elements ];
+
+ execution.dirty = execution.dirty.concat(elements);
+};
+
+
+CommandStack.prototype._executedAction = function(action, redo) {
+ var stackIdx = ++this._stackIdx;
+
+ if (!redo) {
+ this._stack.splice(stackIdx, this._stack.length, action);
+ }
+};
+
+
+CommandStack.prototype._revertedAction = function(action) {
+ this._stackIdx--;
+};
+
+
+CommandStack.prototype._getHandler = function(command) {
+ return this._handlerMap[command];
+};
+
+CommandStack.prototype._setHandler = function(command, handler) {
+ if (!command || !handler) {
+ throw new Error('command and handler required');
+ }
+
+ if (this._handlerMap[command]) {
+ throw new Error('overriding handler for command <' + command + '>');
+ }
+
+ this._handlerMap[command] = handler;
+};
+
+},{"199":199,"316":316,"325":325,"81":81}],77:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(83) ],
+ commandStack: [ 'type', _dereq_(76) ]
+};
+},{"76":76,"83":83}],78:[function(_dereq_,module,exports){
+'use strict';
+
+var isNumber = _dereq_(319),
+ assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+var Collections = _dereq_(175);
+
+var Snap = _dereq_(188);
+
+function round(number, resolution) {
+ return Math.round(number * resolution) / resolution;
+}
+
+function ensurePx(number) {
+ return isNumber(number) ? number + 'px' : number;
+}
+
+/**
+ * Creates a HTML container element for a SVG element with
+ * the given configuration
+ *
+ * @param {Object} options
+ * @return {HTMLElement} the container element
+ */
+function createContainer(options) {
+
+ options = assign({}, { width: '100%', height: '100%' }, options);
+
+ var container = options.container || document.body;
+
+ // create a <div> around the svg element with the respective size
+ // this way we can always get the correct container size
+ // (this is impossible for <svg> elements at the moment)
+ var parent = document.createElement('div');
+ parent.setAttribute('class', 'djs-container');
+
+ assign(parent.style, {
+ position: 'relative',
+ overflow: 'hidden',
+ width: ensurePx(options.width),
+ height: ensurePx(options.height)
+ });
+
+ container.appendChild(parent);
+
+ return parent;
+}
+
+function createGroup(parent, cls) {
+ return parent.group().attr({ 'class' : cls });
+}
+
+var BASE_LAYER = 'base';
+
+
+/**
+ * The main drawing canvas.
+ *
+ * @class
+ * @constructor
+ *
+ * @emits Canvas#canvas.init
+ *
+ * @param {Object} config
+ * @param {EventBus} eventBus
+ * @param {GraphicsFactory} graphicsFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._elementRegistry = elementRegistry;
+ this._graphicsFactory = graphicsFactory;
+
+ this._init(config || {});
+}
+
+Canvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];
+
+module.exports = Canvas;
+
+
+Canvas.prototype._init = function(config) {
+
+ // Creates a <svg> element that is wrapped into a <div>.
+ // This way we are always able to correctly figure out the size of the svg element
+ // by querying the parent node.
+ //
+ // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
+ //
+ // <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
+ // <svg width="100%" height="100%">
+ // ...
+ // </svg>
+ // </div>
+
+ // html container
+ var eventBus = this._eventBus,
+
+ container = createContainer(config),
+ svg = Snap.createSnapAt('100%', '100%', container),
+ viewport = createGroup(svg, 'viewport'),
+
+ self = this;
+
+ this._container = container;
+ this._svg = svg;
+ this._viewport = viewport;
+ this._layers = {};
+
+ eventBus.on('diagram.init', function(event) {
+
+ /**
+ * An event indicating that the canvas is ready to be drawn on.
+ *
+ * @memberOf Canvas
+ *
+ * @event canvas.init
+ *
+ * @type {Object}
+ * @property {Snap<SVGSVGElement>} svg the created svg element
+ * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes
+ */
+ eventBus.fire('canvas.init', { svg: svg, viewport: viewport });
+ });
+
+ eventBus.on('diagram.destroy', function() {
+
+ var parent = self._container.parentNode;
+
+ if (parent) {
+ parent.removeChild(container);
+ }
+
+ eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });
+
+ self._svg.remove();
+
+ self._svg = self._container = self._layers = self._viewport = null;
+ });
+
+};
+
+/**
+ * Returns the default layer on which
+ * all elements are drawn.
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getDefaultLayer = function() {
+ return this.getLayer(BASE_LAYER);
+};
+
+/**
+ * Returns a layer that is used to draw elements
+ * or annotations on it.
+ *
+ * @param {String} name
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getLayer = function(name) {
+
+ if (!name) {
+ throw new Error('must specify a name');
+ }
+
+ var layer = this._layers[name];
+ if (!layer) {
+ layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
+ }
+
+ return layer;
+};
+
+
+/**
+ * Returns the html element that encloses the
+ * drawing canvas.
+ *
+ * @return {DOMNode}
+ */
+Canvas.prototype.getContainer = function() {
+ return this._container;
+};
+
+
+/////////////// markers ///////////////////////////////////
+
+Canvas.prototype._updateMarker = function(element, marker, add) {
+ var container;
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ // we need to access all
+ container = this._elementRegistry._elements[element.id];
+
+ if (!container) {
+ return;
+ }
+
+ forEach([ container.gfx, container.secondaryGfx ], function(gfx) {
+ if (gfx) {
+ // invoke either addClass or removeClass based on mode
+ gfx[add ? 'addClass' : 'removeClass'](marker);
+ }
+ });
+
+ /**
+ * An event indicating that a marker has been updated for an element
+ *
+ * @event element.marker.update
+ * @type {Object}
+ * @property {djs.model.Element} element the shape
+ * @property {Object} gfx the graphical representation of the shape
+ * @property {String} marker
+ * @property {Boolean} add true if the marker was added, false if it got removed
+ */
+ this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });
+};
+
+
+/**
+ * Adds a marker to an element (basically a css class).
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @example
+ * canvas.addMarker('foo', 'some-marker');
+ *
+ * var fooGfx = canvas.getGraphics('foo');
+ *
+ * fooGfx; // <g class="... some-marker"> ... </g>
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.addMarker = function(element, marker) {
+ this._updateMarker(element, marker, true);
+};
+
+
+/**
+ * Remove a marker from an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.removeMarker = function(element, marker) {
+ this._updateMarker(element, marker, false);
+};
+
+/**
+ * Check the existence of a marker on element.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.hasMarker = function(element, marker) {
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ var gfx = this.getGraphics(element);
+
+ return gfx && gfx.hasClass(marker);
+};
+
+/**
+ * Toggles a marker on an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.toggleMarker = function(element, marker) {
+ if(this.hasMarker(element, marker)) {
+ this.removeMarker(element, marker);
+ } else {
+ this.addMarker(element, marker);
+ }
+};
+
+Canvas.prototype.getRootElement = function() {
+ if (!this._rootElement) {
+ this.setRootElement({ id: '__implicitroot' });
+ }
+
+ return this._rootElement;
+};
+
+
+
+//////////////// root element handling ///////////////////////////
+
+/**
+ * Sets a given element as the new root element for the canvas
+ * and returns the new root element.
+ *
+ * @param {Object|djs.model.Root} element
+ * @param {Boolean} [override] whether to override the current root element, if any
+ *
+ * @return {Object|djs.model.Root} new root element
+ */
+Canvas.prototype.setRootElement = function(element, override) {
+
+ this._ensureValidId(element);
+
+ var oldRoot = this._rootElement,
+ elementRegistry = this._elementRegistry,
+ eventBus = this._eventBus;
+
+ if (oldRoot) {
+ if (!override) {
+ throw new Error('rootElement already set, need to specify override');
+ }
+
+ // simulate element remove event sequence
+ eventBus.fire('root.remove', { element: oldRoot });
+ eventBus.fire('root.removed', { element: oldRoot });
+
+ elementRegistry.remove(oldRoot);
+ }
+
+ var gfx = this.getDefaultLayer();
+
+ // resemble element add event sequence
+ eventBus.fire('root.add', { element: element });
+
+ elementRegistry.add(element, gfx, this._svg);
+
+ eventBus.fire('root.added', { element: element, gfx: gfx });
+
+ this._rootElement = element;
+
+ return element;
+};
+
+
+
+///////////// add functionality ///////////////////////////////
+
+Canvas.prototype._ensureValidId = function(element) {
+ if (!element.id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elementRegistry.get(element.id)) {
+ throw new Error('element with id ' + element.id + ' already exists');
+ }
+};
+
+Canvas.prototype._setParent = function(element, parent) {
+ Collections.add(parent.children, element);
+ element.parent = parent;
+};
+
+/**
+ * Adds an element to the canvas.
+ *
+ * This wires the parent <-> child relationship between the element and
+ * a explicitly specified parent or an implicit root element.
+ *
+ * During add it emits the events
+ *
+ * * <{type}.add> (element, parent)
+ * * <{type}.added> (element, gfx)
+ *
+ * Extensions may hook into these events to perform their magic.
+ *
+ * @param {String} type
+ * @param {Object|djs.model.Base} element
+ * @param {Object|djs.model.Base} [parent]
+ *
+ * @return {Object|djs.model.Base} the added element
+ */
+Canvas.prototype._addElement = function(type, element, parent) {
+
+ parent = parent || this.getRootElement();
+
+ var eventBus = this._eventBus,
+ graphicsFactory = this._graphicsFactory;
+
+ this._ensureValidId(element);
+
+ eventBus.fire(type + '.add', { element: element, parent: parent });
+
+ this._setParent(element, parent);
+
+ // create graphics
+ var gfx = graphicsFactory.create(type, element);
+
+ this._elementRegistry.add(element, gfx);
+
+ // update its visual
+ graphicsFactory.update(type, element, gfx);
+
+ eventBus.fire(type + '.added', { element: element, gfx: gfx });
+
+ return element;
+};
+
+/**
+ * Adds a shape to the canvas
+ *
+ * @param {Object|djs.model.Shape} shape to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Shape} the added shape
+ */
+Canvas.prototype.addShape = function(shape, parent) {
+ return this._addElement('shape', shape, parent);
+};
+
+/**
+ * Adds a connection to the canvas
+ *
+ * @param {Object|djs.model.Connection} connection to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Connection} the added connection
+ */
+Canvas.prototype.addConnection = function(connection, parent) {
+ return this._addElement('connection', connection, parent);
+};
+
+
+/**
+ * Internal remove element
+ */
+Canvas.prototype._removeElement = function(element, type) {
+
+ var elementRegistry = this._elementRegistry,
+ graphicsFactory = this._graphicsFactory,
+ eventBus = this._eventBus;
+
+ element = elementRegistry.get(element.id || element);
+
+ if (!element) {
+ // element was removed already
+ return;
+ }
+
+ eventBus.fire(type + '.remove', { element: element });
+
+ graphicsFactory.remove(element);
+
+ // unset parent <-> child relationship
+ Collections.remove(element.parent && element.parent.children, element);
+ element.parent = null;
+
+ eventBus.fire(type + '.removed', { element: element });
+
+ elementRegistry.remove(element);
+
+ return element;
+};
+
+
+/**
+ * Removes a shape from the canvas
+ *
+ * @param {String|djs.model.Shape} shape or shape id to be removed
+ *
+ * @return {djs.model.Shape} the removed shape
+ */
+Canvas.prototype.removeShape = function(shape) {
+
+ /**
+ * An event indicating that a shape is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.remove
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+
+ /**
+ * An event indicating that a shape has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.removed
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+ return this._removeElement(shape, 'shape');
+};
+
+
+/**
+ * Removes a connection from the canvas
+ *
+ * @param {String|djs.model.Connection} connection or connection id to be removed
+ *
+ * @return {djs.model.Connection} the removed connection
+ */
+Canvas.prototype.removeConnection = function(connection) {
+
+ /**
+ * An event indicating that a connection is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.remove
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+
+ /**
+ * An event indicating that a connection has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.removed
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+ return this._removeElement(connection, 'connection');
+};
+
+
+/**
+ * Sends a shape to the front.
+ *
+ * This method takes parent / child relationships between shapes into account
+ * and makes sure that children are properly handled, too.
+ *
+ * @param {djs.model.Shape} shape descriptor of the shape to be sent to front
+ * @param {boolean} [bubble=true] whether to send parent shapes to front, too
+ */
+Canvas.prototype.sendToFront = function(shape, bubble) {
+
+ if (bubble !== false) {
+ bubble = true;
+ }
+
+ if (bubble && shape.parent) {
+ this.sendToFront(shape.parent);
+ }
+
+ forEach(shape.children, function(child) {
+ this.sendToFront(child, false);
+ }, this);
+
+ var gfx = this.getGraphics(shape),
+ gfxParent = gfx.parent();
+
+ gfx.remove().appendTo(gfxParent);
+};
+
+
+/**
+ * Return the graphical object underlaying a certain diagram element
+ *
+ * @param {String|djs.model.Base} element descriptor of the element
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+Canvas.prototype.getGraphics = function(element, secondary) {
+ return this._elementRegistry.getGraphics(element, secondary);
+};
+
+
+Canvas.prototype._fireViewboxChange = function() {
+ this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });
+};
+
+
+/**
+ * Gets or sets the view box of the canvas, i.e. the area that is currently displayed
+ *
+ * @param {Object} [box] the new view box to set
+ * @param {Number} box.x the top left X coordinate of the canvas visible in view box
+ * @param {Number} box.y the top left Y coordinate of the canvas visible in view box
+ * @param {Number} box.width the visible width
+ * @param {Number} box.height
+ *
+ * @example
+ *
+ * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
+ *
+ * // sets the visible area of the diagram to (100|100) -> (600|100)
+ * // and and scales it according to the diagram width
+ *
+ * @return {Object} the current view box
+ */
+Canvas.prototype.viewbox = function(box) {
+
+ if (box === undefined && this._cachedViewbox) {
+ return this._cachedViewbox;
+ }
+
+ var viewport = this._viewport,
+ innerBox,
+ outerBox = this.getSize(),
+ matrix,
+ scale,
+ x, y;
+
+ if (!box) {
+ // compute the inner box based on the
+ // diagrams default layer. This allows us to exclude
+ // external components, such as overlays
+ innerBox = this.getDefaultLayer().getBBox(true);
+
+ matrix = viewport.transform().localMatrix;
+ scale = round(matrix.a, 1000);
+
+ x = round(-matrix.e || 0, 1000);
+ y = round(-matrix.f || 0, 1000);
+
+ box = this._cachedViewbox = {
+ x: x ? x / scale : 0,
+ y: y ? y / scale : 0,
+ width: outerBox.width / scale,
+ height: outerBox.height / scale,
+ scale: scale,
+ inner: {
+ width: innerBox.width,
+ height: innerBox.height,
+ x: innerBox.x,
+ y: innerBox.y
+ },
+ outer: outerBox
+ };
+
+ return box;
+ } else {
+ scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
+
+ matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
+ viewport.transform(matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return box;
+};
+
+
+/**
+ * Gets or sets the scroll of the canvas.
+ *
+ * @param {Object} [delta] the new scroll to apply.
+ *
+ * @param {Number} [delta.dx]
+ * @param {Number} [delta.dy]
+ */
+Canvas.prototype.scroll = function(delta) {
+
+ var node = this._viewport.node;
+ var matrix = node.getCTM();
+
+ if (delta) {
+ delta = assign({ dx: 0, dy: 0 }, delta || {});
+
+ matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
+
+ setCTM(node, matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return { x: matrix.e, y: matrix.f };
+};
+
+
+/**
+ * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.
+ *
+ * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,
+ * or `fit-viewport` to adjust the size to fit the current viewport
+ * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null
+ *
+ * @return {Number} the current scale
+ */
+Canvas.prototype.zoom = function(newScale, center) {
+
+ if (newScale === 'fit-viewport') {
+ return this._fitViewport(center);
+ }
+
+ var vbox = this.viewbox();
+
+ if (newScale === undefined) {
+ return vbox.scale;
+ }
+
+ var outer = vbox.outer;
+
+ if (center === 'auto') {
+ center = {
+ x: outer.width / 2,
+ y: outer.height / 2
+ };
+ }
+
+ var matrix = this._setZoom(newScale, center);
+
+ this._fireViewboxChange();
+
+ return round(matrix.a, 1000);
+};
+
+function setCTM(node, m) {
+ var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
+ node.setAttribute('transform', mstr);
+}
+
+Canvas.prototype._fitViewport = function(center) {
+
+ var vbox = this.viewbox(),
+ outer = vbox.outer,
+ inner = vbox.inner,
+ newScale,
+ newViewbox;
+
+ // display the complete diagram without zooming in.
+ // instead of relying on internal zoom, we perform a
+ // hard reset on the canvas viewbox to realize this
+ //
+ // if diagram does not need to be zoomed in, we focus it around
+ // the diagram origin instead
+
+ if (inner.x >= 0 &&
+ inner.y >= 0 &&
+ inner.x + inner.width <= outer.width &&
+ inner.y + inner.height <= outer.height &&
+ !center) {
+
+ newViewbox = {
+ x: 0,
+ y: 0,
+ width: Math.max(inner.width + inner.x, outer.width),
+ height: Math.max(inner.height + inner.y, outer.height)
+ };
+ } else {
+
+ newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
+ newViewbox = {
+ x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
+ y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
+ width: outer.width / newScale,
+ height: outer.height / newScale
+ };
+ }
+
+ this.viewbox(newViewbox);
+
+ return this.viewbox().scale;
+};
+
+
+Canvas.prototype._setZoom = function(scale, center) {
+
+ var svg = this._svg.node,
+ viewport = this._viewport.node;
+
+ var matrix = svg.createSVGMatrix();
+ var point = svg.createSVGPoint();
+
+ var centerPoint,
+ originalPoint,
+ currentMatrix,
+ scaleMatrix,
+ newMatrix;
+
+ currentMatrix = viewport.getCTM();
+
+
+ var currentScale = currentMatrix.a;
+
+ if (center) {
+ centerPoint = assign(point, center);
+
+ // revert applied viewport transformations
+ originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
+
+ // create scale matrix
+ scaleMatrix = matrix
+ .translate(originalPoint.x, originalPoint.y)
+ .scale(1 / currentScale * scale)
+ .translate(-originalPoint.x, -originalPoint.y);
+
+ newMatrix = currentMatrix.multiply(scaleMatrix);
+ } else {
+ newMatrix = matrix.scale(scale);
+ }
+
+ setCTM(this._viewport.node, newMatrix);
+
+ return newMatrix;
+};
+
+
+/**
+ * Returns the size of the canvas
+ *
+ * @return {Dimensions}
+ */
+Canvas.prototype.getSize = function () {
+ return {
+ width: this._container.clientWidth,
+ height: this._container.clientHeight
+ };
+};
+
+
+/**
+ * Return the absolute bounding box for the given element
+ *
+ * The absolute bounding box may be used to display overlays in the
+ * callers (browser) coordinate system rather than the zoomed in/out
+ * canvas coordinates.
+ *
+ * @param {ElementDescriptor} element
+ * @return {Bounds} the absolute bounding box
+ */
+Canvas.prototype.getAbsoluteBBox = function(element) {
+ var vbox = this.viewbox();
+ var bbox;
+
+ // connection
+ // use svg bbox
+ if (element.waypoints) {
+ var gfx = this.getGraphics(element);
+
+ var transformBBox = gfx.getBBox(true);
+ bbox = gfx.getBBox();
+
+ bbox.x -= transformBBox.x;
+ bbox.y -= transformBBox.y;
+
+ bbox.width += 2 * transformBBox.x;
+ bbox.height += 2 * transformBBox.y;
+ }
+ // shapes
+ // use data
+ else {
+ bbox = element;
+ }
+
+ var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
+ var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
+
+ var width = bbox.width * vbox.scale;
+ var height = bbox.height * vbox.scale;
+
+ return {
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ };
+};
+
+},{"175":175,"188":188,"204":204,"319":319,"325":325}],79:[function(_dereq_,module,exports){
+'use strict';
+
+var Model = _dereq_(168);
+
+
+/**
+ * A factory for diagram-js shapes
+ */
+function ElementFactory() {
+ this._uid = 12;
+}
+
+module.exports = ElementFactory;
+
+
+ElementFactory.prototype.createRoot = function(attrs) {
+ return this.create('root', attrs);
+};
+
+ElementFactory.prototype.createLabel = function(attrs) {
+ return this.create('label', attrs);
+};
+
+ElementFactory.prototype.createShape = function(attrs) {
+ return this.create('shape', attrs);
+};
+
+ElementFactory.prototype.createConnection = function(attrs) {
+ return this.create('connection', attrs);
+};
+
+/**
+ * Create a model element with the given type and
+ * a number of pre-set attributes.
+ *
+ * @param {String} type
+ * @param {Object} attrs
+ * @return {djs.model.Base} the newly created model instance
+ */
+ElementFactory.prototype.create = function(type, attrs) {
+
+ attrs = attrs || {};
+
+ if (!attrs.id) {
+ attrs.id = type + '_' + (this._uid++);
+ }
+
+ return Model.create(type, attrs);
+};
+},{"168":168}],80:[function(_dereq_,module,exports){
+'use strict';
+
+var ELEMENT_ID = 'data-element-id';
+
+
+/**
+ * @class
+ *
+ * A registry that keeps track of all shapes in the diagram.
+ */
+function ElementRegistry() {
+ this._elements = {};
+}
+
+module.exports = ElementRegistry;
+
+/**
+ * Register a pair of (element, gfx, (secondaryGfx)).
+ *
+ * @param {djs.model.Base} element
+ * @param {Snap<SVGElement>} gfx
+ * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too
+ */
+ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
+
+ var id = element.id;
+
+ this._validateId(id);
+
+ // associate dom node with element
+ gfx.attr(ELEMENT_ID, id);
+
+ if (secondaryGfx) {
+ secondaryGfx.attr(ELEMENT_ID, id);
+ }
+
+ this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
+};
+
+/**
+ * Removes an element from the registry.
+ *
+ * @param {djs.model.Base} element
+ */
+ElementRegistry.prototype.remove = function(element) {
+ var elements = this._elements,
+ id = element.id || element,
+ container = id && elements[id];
+
+ if (container) {
+
+ // unset element id on gfx
+ container.gfx.attr(ELEMENT_ID, null);
+
+ if (container.secondaryGfx) {
+ container.secondaryGfx.attr(ELEMENT_ID, null);
+ }
+
+ delete elements[id];
+ }
+};
+
+/**
+ * Update the id of an element
+ *
+ * @param {djs.model.Base} element
+ * @param {String} newId
+ */
+ElementRegistry.prototype.updateId = function(element, newId) {
+
+ this._validateId(newId);
+
+ if (typeof element === 'string') {
+ element = this.get(element);
+ }
+
+ var gfx = this.getGraphics(element),
+ secondaryGfx = this.getGraphics(element, true);
+
+ this.remove(element);
+
+ element.id = newId;
+
+ this.add(element, gfx, secondaryGfx);
+};
+
+/**
+ * Return the model element for a given id or graphics.
+ *
+ * @example
+ *
+ * elementRegistry.get('SomeElementId_1');
+ * elementRegistry.get(gfx);
+ *
+ *
+ * @param {String|SVGElement} filter for selecting the element
+ *
+ * @return {djs.model.Base}
+ */
+ElementRegistry.prototype.get = function(filter) {
+ var id;
+
+ if (typeof filter === 'string') {
+ id = filter;
+ } else {
+ id = filter && filter.attr(ELEMENT_ID);
+ }
+
+ var container = this._elements[id];
+ return container && container.element;
+};
+
+/**
+ * Return all elements that match a given filter function.
+ *
+ * @param {Function} fn
+ *
+ * @return {Array<djs.model.Base>}
+ */
+ElementRegistry.prototype.filter = function(fn) {
+
+ var filtered = [];
+
+ this.forEach(function(element, gfx) {
+ if(fn(element, gfx)) {
+ filtered.push(element);
+ }
+ });
+
+ return filtered;
+};
+
+/**
+ * Iterate over all diagram elements.
+ *
+ * @param {Function} fn
+ */
+ElementRegistry.prototype.forEach = function(fn) {
+
+ var map = this._elements;
+
+ Object.keys(map).forEach(function(id) {
+ var container = map[id],
+ element = container.element,
+ gfx = container.gfx;
+
+ return fn(element, gfx);
+ });
+};
+
+/**
+ * Return the graphical representation of an element or its id.
+ *
+ * @example
+ * elementRegistry.getGraphics('SomeElementId_1');
+ * elementRegistry.getGraphics(rootElement); // <g ...>
+ *
+ * elementRegistry.getGraphics(rootElement, true); // <svg ...>
+ *
+ *
+ * @param {String|djs.model.Base} filter
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+ElementRegistry.prototype.getGraphics = function(filter, secondary) {
+ var id = filter.id || filter;
+
+ var container = this._elements[id];
+ return container && (secondary ? container.secondaryGfx : container.gfx);
+};
+
+/**
+ * Validate the suitability of the given id and signals a problem
+ * with an exception.
+ *
+ * @param {String} id
+ *
+ * @throws {Error} if id is empty or already assigned
+ */
+ElementRegistry.prototype._validateId = function(id) {
+ if (!id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elements[id]) {
+ throw new Error('element with id ' + id + ' already added');
+ }
+};
+},{}],81:[function(_dereq_,module,exports){
+'use strict';
+
+var isFunction = _dereq_(317),
+ isArray = _dereq_(316),
+ isNumber = _dereq_(319),
+ assign = _dereq_(325);
+
+var DEFAULT_PRIORITY = 1000;
+
+
+/**
+ * A general purpose event bus.
+ *
+ * This component is used to communicate across a diagram instance.
+ * Other parts of a diagram can use it to listen to and broadcast events.
+ *
+ *
+ * ## Registering for Events
+ *
+ * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
+ * methods to register for events. {@link EventBus#off} can be used to
+ * remove event registrations. Listeners receive an instance of {@link Event}
+ * as the first argument. It allows them to hook into the event execution.
+ *
+ * ```javascript
+ *
+ * // listen for event
+ * eventBus.on('foo', function(event) {
+ *
+ * // access event type
+ * event.type; // 'foo'
+ *
+ * // stop propagation to other listeners
+ * event.stopPropagation();
+ *
+ * // prevent event default
+ * event.preventDefault();
+ * });
+ *
+ * // listen for event with custom payload
+ * eventBus.on('bar', function(event, payload) {
+ * console.log(payload);
+ * });
+ *
+ * // listen for event returning value
+ * eventBus.on('foobar', function(event) {
+ *
+ * // stop event propagation + prevent default
+ * return false;
+ *
+ * // stop event propagation + return custom result
+ * return {
+ * complex: 'listening result'
+ * };
+ * });
+ *
+ *
+ * // listen with custom priority (default=1000, higher is better)
+ * eventBus.on('priorityfoo', 1500, function(event) {
+ * console.log('invoked first!');
+ * });
+ * ```
+ *
+ *
+ * ## Emitting Events
+ *
+ * Events can be emitted via the event bus using {@link EventBus#fire}.
+ *
+ * ```javascript
+ *
+ * // false indicates that the default action
+ * // was prevented by listeners
+ * if (eventBus.fire('foo') === false) {
+ * console.log('default has been prevented!');
+ * };
+ *
+ *
+ * // custom args + return value listener
+ * eventBus.on('sum', function(event, a, b) {
+ * return a + b;
+ * });
+ *
+ * // you can pass custom arguments + retrieve result values.
+ * var sum = eventBus.fire('sum', 1, 2);
+ * console.log(sum); // 3
+ * ```
+ */
+function EventBus() {
+ this._listeners = {};
+
+ // cleanup on destroy
+
+ var self = this;
+
+ // destroy on lowest priority to allow
+ // message passing until the bitter end
+ this.on('diagram.destroy', 1, function() {
+ self._listeners = null;
+ });
+}
+
+module.exports = EventBus;
+
+
+/**
+ * Register an event listener for events with the given name.
+ *
+ * The callback will be invoked with `event, ...additionalArguments`
+ * that have been passed to {@link EventBus#fire}.
+ *
+ * Returning false from a listener will prevent the events default action
+ * (if any is specified). To stop an event from being processed further in
+ * other listeners execute {@link Event#stopPropagation}.
+ *
+ * Returning anything but `undefined` from a listener will stop the listener propagation.
+ *
+ * @param {String|Array<String>} events
+ * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher
+ * @param {Function} callback
+ */
+EventBus.prototype.on = function(events, priority, callback) {
+
+ events = isArray(events) ? events : [ events ];
+
+ if (isFunction(priority)) {
+ callback = priority;
+ priority = DEFAULT_PRIORITY;
+ }
+
+ if (!isNumber(priority)) {
+ throw new Error('priority must be a number');
+ }
+
+ var self = this,
+ listener = { priority: priority, callback: callback };
+
+ events.forEach(function(e) {
+ self._addListener(e, listener);
+ });
+};
+
+
+/**
+ * Register an event listener that is executed only once.
+ *
+ * @param {String} event the event name to register for
+ * @param {Function} callback the callback to execute
+ */
+EventBus.prototype.once = function(event, callback) {
+
+ var self = this;
+
+ function wrappedCallback() {
+ callback.apply(self, arguments);
+ self.off(event, wrappedCallback);
+ }
+
+ this.on(event, wrappedCallback);
+};
+
+
+/**
+ * Removes event listeners by event and callback.
+ *
+ * If no callback is given, all listeners for a given event name are being removed.
+ *
+ * @param {String} event
+ * @param {Function} [callback]
+ */
+EventBus.prototype.off = function(event, callback) {
+ var listeners = this._getListeners(event),
+ listener, idx;
+
+ if (callback) {
+
+ // move through listeners from back to front
+ // and remove matching listeners
+ for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
+ if (listener.callback === callback) {
+ listeners.splice(idx, 1);
+ }
+ }
+ } else {
+ // clear listeners
+ listeners.length = 0;
+ }
+};
+
+
+/**
+ * Fires a named event.
+ *
+ * @example
+ *
+ * // fire event by name
+ * events.fire('foo');
+ *
+ * // fire event object with nested type
+ * var event = { type: 'foo' };
+ * events.fire(event);
+ *
+ * // fire event with explicit type
+ * var event = { x: 10, y: 20 };
+ * events.fire('element.moved', event);
+ *
+ * // pass additional arguments to the event
+ * events.on('foo', function(event, bar) {
+ * alert(bar);
+ * });
+ *
+ * events.fire({ type: 'foo' }, 'I am bar!');
+ *
+ * @param {String} [name] the optional event name
+ * @param {Object} [event] the event object
+ * @param {...Object} additional arguments to be passed to the callback functions
+ *
+ * @return {Boolean} the events return value, if specified or false if the
+ * default action was prevented by listeners
+ */
+EventBus.prototype.fire = function(type, data) {
+
+ var event,
+ originalType,
+ listeners, idx, listener,
+ returnValue,
+ args;
+
+ args = Array.prototype.slice.call(arguments);
+
+ if (typeof type === 'object') {
+ event = type;
+ type = event.type;
+ }
+
+ if (!type) {
+ throw new Error('no event type specified');
+ }
+
+ listeners = this._listeners[type];
+
+ if (!listeners) {
+ return;
+ }
+
+ // we make sure we fire instances of our home made
+ // events here. We wrap them only once, though
+ if (data instanceof Event) {
+ // we are fine, we alread have an event
+ event = data;
+ } else {
+ event = new Event();
+ event.init(data);
+ }
+
+ // ensure we pass the event as the first parameter
+ args[0] = event;
+
+ // original event type (in case we delegate)
+ originalType = event.type;
+
+ try {
+
+ // update event type before delegation
+ if (type !== originalType) {
+ event.type = type;
+ }
+
+ for (idx = 0; !!(listener = listeners[idx]); idx++) {
+
+ // handle stopped propagation
+ if (event.cancelBubble) {
+ break;
+ }
+
+ try {
+ // returning false prevents the default action
+ returnValue = event.returnValue = listener.callback.apply(null, args);
+
+ // stop propagation on return value
+ if (returnValue !== undefined) {
+ event.stopPropagation();
+ }
+
+ // prevent default on return false
+ if (returnValue === false) {
+ event.preventDefault();
+ }
+ } catch (e) {
+ if (!this.handleError(e)) {
+ console.error('unhandled error in event listener');
+ console.error(e.stack);
+
+ throw e;
+ }
+ }
+ }
+ } finally {
+ // reset event type after delegation
+ if (type !== originalType) {
+ event.type = originalType;
+ }
+ }
+
+ // set the return value to false if the event default
+ // got prevented and no other return value exists
+ if (returnValue === undefined && event.defaultPrevented) {
+ returnValue = false;
+ }
+
+ return returnValue;
+};
+
+
+EventBus.prototype.handleError = function(error) {
+ return this.fire('error', { error: error }) === false;
+};
+
+
+/*
+ * Add new listener with a certain priority to the list
+ * of listeners (for the given event).
+ *
+ * The semantics of listener registration / listener execution are
+ * first register, first serve: New listeners will always be inserted
+ * after existing listeners with the same priority.
+ *
+ * Example: Inserting two listeners with priority 1000 and 1300
+ *
+ * * before: [ 1500, 1500, 1000, 1000 ]
+ * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
+ *
+ * @param {String} event
+ * @param {Object} listener { priority, callback }
+ */
+EventBus.prototype._addListener = function(event, newListener) {
+
+ var listeners = this._getListeners(event),
+ existingListener,
+ idx;
+
+ // ensure we order listeners by priority from
+ // 0 (high) to n > 0 (low)
+ for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
+ if (existingListener.priority < newListener.priority) {
+
+ // prepend newListener at before existingListener
+ listeners.splice(idx, 0, newListener);
+ return;
+ }
+ }
+
+ listeners.push(newListener);
+};
+
+
+EventBus.prototype._getListeners = function(name) {
+ var listeners = this._listeners[name];
+
+ if (!listeners) {
+ this._listeners[name] = listeners = [];
+ }
+
+ return listeners;
+};
+
+
+/**
+ * A event that is emitted via the event bus.
+ */
+function Event() { }
+
+module.exports.Event = Event;
+
+Event.prototype.stopPropagation = function() {
+ this.cancelBubble = true;
+};
+
+Event.prototype.preventDefault = function() {
+ this.defaultPrevented = true;
+};
+
+Event.prototype.init = function(data) {
+ assign(this, data || {});
+};
+
+},{"316":316,"317":317,"319":319,"325":325}],82:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ reduce = _dereq_(208);
+
+var GraphicsUtil = _dereq_(180),
+ domClear = _dereq_(340);
+
+/**
+ * A factory that creates graphical elements
+ *
+ * @param {Renderer} renderer
+ */
+function GraphicsFactory(renderer, elementRegistry) {
+ this._renderer = renderer;
+ this._elementRegistry = elementRegistry;
+}
+
+GraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];
+
+module.exports = GraphicsFactory;
+
+
+GraphicsFactory.prototype._getChildren = function(element) {
+
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ var childrenGfx;
+
+ // root element
+ if (!element.parent) {
+ childrenGfx = gfx;
+ } else {
+ childrenGfx = GraphicsUtil.getChildren(gfx);
+ if (!childrenGfx) {
+ childrenGfx = gfx.parent().group().attr('class', 'djs-children');
+ }
+ }
+
+ return childrenGfx;
+};
+
+/**
+ * Clears the graphical representation of the element and returns the
+ * cleared visual (the <g class="djs-visual" /> element).
+ */
+GraphicsFactory.prototype._clear = function(gfx) {
+ var visual = GraphicsUtil.getVisual(gfx);
+
+ domClear(visual.node);
+
+ return visual;
+};
+
+/**
+ * Creates a gfx container for shapes and connections
+ *
+ * The layout is as follows:
+ *
+ * <g class="djs-group">
+ *
+ * <!-- the gfx -->
+ * <g class="djs-element djs-(shape|connection)">
+ * <g class="djs-visual">
+ * <!-- the renderer draws in here -->
+ * </g>
+ *
+ * <!-- extensions (overlays, click box, ...) goes here
+ * </g>
+ *
+ * <!-- the gfx child nodes -->
+ * <g class="djs-children"></g>
+ * </g>
+ *
+ * @param {Object} parent
+ * @param {String} type the type of the element, i.e. shape | connection
+ */
+GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
+ var outerGfx = parentGfx.group().attr('class', 'djs-group'),
+ gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
+
+ // create visual
+ gfx.group().attr('class', 'djs-visual');
+
+ return gfx;
+};
+
+GraphicsFactory.prototype.create = function(type, element) {
+ var childrenGfx = this._getChildren(element.parent);
+ return this._createContainer(type, childrenGfx);
+};
+
+
+GraphicsFactory.prototype.updateContainments = function(elements) {
+
+ var self = this,
+ elementRegistry = this._elementRegistry,
+ parents;
+
+
+ parents = reduce(elements, function(map, e) {
+
+ if (e.parent) {
+ map[e.parent.id] = e.parent;
+ }
+
+ return map;
+ }, {});
+
+ // update all parents of changed and reorganized their children
+ // in the correct order (as indicated in our model)
+ forEach(parents, function(parent) {
+
+ var childGfx = self._getChildren(parent),
+ children = parent.children;
+
+ if (!children) {
+ return;
+ }
+
+ forEach(children.slice().reverse(), function(c) {
+ var gfx = elementRegistry.getGraphics(c);
+ gfx.parent().prependTo(childGfx);
+ });
+ });
+
+};
+
+GraphicsFactory.prototype.update = function(type, element, gfx) {
+
+ // Do not update root element
+ if (!element.parent) {
+ return;
+ }
+
+ var visual = this._clear(gfx);
+
+ // redraw
+ if (type === 'shape') {
+ this._renderer.drawShape(visual, element);
+
+ // update positioning
+ gfx.translate(element.x, element.y);
+ } else
+ if (type === 'connection') {
+ this._renderer.drawConnection(visual, element);
+ } else {
+ throw new Error('unknown type: ' + type);
+ }
+
+ gfx.attr('display', element.hidden ? 'none' : 'block');
+};
+
+
+GraphicsFactory.prototype.remove = function(element) {
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ // remove
+ gfx.parent().remove();
+};
+
+},{"180":180,"204":204,"208":208,"340":340}],83:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(86) ],
+ __init__: [ 'canvas' ],
+ canvas: [ 'type', _dereq_(78) ],
+ elementRegistry: [ 'type', _dereq_(80) ],
+ elementFactory: [ 'type', _dereq_(79) ],
+ eventBus: [ 'type', _dereq_(81) ],
+ graphicsFactory: [ 'type', _dereq_(82) ]
+};
+},{"78":78,"79":79,"80":80,"81":81,"82":82,"86":86}],84:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(188);
+
+
+/**
+ * The default renderer used for shapes and connections.
+ *
+ * @param {Styles} styles
+ */
+function Renderer(styles) {
+ this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });
+ this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });
+}
+
+module.exports = Renderer;
+
+Renderer.$inject = ['styles'];
+
+
+Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
+ return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
+};
+
+Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
+ return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
+};
+
+function componentsToPath(components) {
+ return components.join(',').replace(/,?([A-z]),?/g, '$1');
+}
+
+/**
+ * Gets the default SVG path of a shape that represents it's visual bounds.
+ *
+ * @param {djs.model.Shape} shape
+ * @return {string} svg path
+ */
+Renderer.prototype.getShapePath = function getShapePath(shape) {
+
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var shapePath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(shapePath);
+};
+
+/**
+ * Gets the default SVG path of a connection that represents it's visual bounds.
+ *
+ * @param {djs.model.Connection} connection
+ * @return {string} svg path
+ */
+Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
+ var waypoints = connection.waypoints;
+
+ var idx, point, connectionPath = [];
+
+ for (idx = 0; !!(point = waypoints[idx]); idx++) {
+
+ // take invisible docking into account
+ // when creating the path
+ point = point.original || point;
+
+ connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);
+ }
+
+ return componentsToPath(connectionPath);
+};
+
+
+function toSVGPoints(points) {
+ var result = '';
+
+ for (var i = 0, p; !!(p = points[i]); i++) {
+ result += p.x + ',' + p.y + ' ';
+ }
+
+ return result;
+}
+
+function createLine(points, attrs) {
+ return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});
+}
+
+function updateLine(gfx, points) {
+ return gfx.attr({ points: toSVGPoints(points) });
+}
+
+module.exports.createLine = createLine;
+module.exports.updateLine = updateLine;
+},{"188":188}],85:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ assign = _dereq_(325),
+ reduce = _dereq_(208);
+
+
+/**
+ * A component that manages shape styles
+ */
+function Styles() {
+
+ var defaultTraits = {
+
+ 'no-fill': {
+ fill: 'none'
+ },
+ 'no-border': {
+ strokeOpacity: 0.0
+ },
+ 'no-events': {
+ pointerEvents: 'none'
+ }
+ };
+
+ /**
+ * Builds a style definition from a className, a list of traits and an object of additional attributes.
+ *
+ * @param {String} className
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.cls = function(className, traits, additionalAttrs) {
+ var attrs = this.style(traits, additionalAttrs);
+
+ return assign(attrs, { 'class': className });
+ };
+
+ /**
+ * Builds a style definition from a list of traits and an object of additional attributes.
+ *
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.style = function(traits, additionalAttrs) {
+
+ if (!isArray(traits) && !additionalAttrs) {
+ additionalAttrs = traits;
+ traits = [];
+ }
+
+ var attrs = reduce(traits, function(attrs, t) {
+ return assign(attrs, defaultTraits[t] || {});
+ }, {});
+
+ return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
+ };
+}
+
+module.exports = Styles;
+},{"208":208,"316":316,"325":325}],86:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(84) ],
+ styles: [ 'type', _dereq_(85) ]
+};
+},{"84":84,"85":85}],87:[function(_dereq_,module,exports){
+'use strict';
+
+var Geometry = _dereq_(179),
+ Util = _dereq_(90);
+
+var MARKER_OK = 'connect-ok',
+ MARKER_NOT_OK = 'connect-not-ok',
+ MARKER_CONNECT_HOVER = 'connect-hover',
+ MARKER_CONNECT_UPDATING = 'djs-updating';
+
+var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
+ COMMAND_RECONNECT_START = 'connection.reconnectStart',
+ COMMAND_RECONNECT_END = 'connection.reconnectEnd';
+
+var round = Math.round;
+
+
+/**
+ * A component that implements moving of bendpoints
+ */
+function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
+
+ var connectionDocking;
+
+ // optional connection docking integration
+ try {
+ connectionDocking = injector.get('connectionDocking');
+ } catch (e) {}
+
+
+ // API
+
+ this.start = function(event, connection, bendpointIndex, insert) {
+
+ var type,
+ context,
+ waypoints = connection.waypoints,
+ gfx = canvas.getGraphics(connection);
+
+ if (!insert && bendpointIndex === 0) {
+ type = COMMAND_RECONNECT_START;
+ } else
+ if (!insert && bendpointIndex === waypoints.length - 1) {
+ type = COMMAND_RECONNECT_END;
+ } else {
+ type = COMMAND_BENDPOINT_UPDATE;
+ }
+
+ context = {
+ connection: connection,
+ bendpointIndex: bendpointIndex,
+ insert: insert,
+ type: type
+ };
+
+ dragging.activate(event, 'bendpoint.move', {
+ data: {
+ connection: connection,
+ connectionGfx: gfx,
+ context: context
+ }
+ });
+ };
+
+
+ // DRAGGING IMPLEMENTATION
+
+
+ function redrawConnection(data) {
+ graphicsFactory.update('connection', data.connection, data.connectionGfx);
+ }
+
+ function filterRedundantWaypoints(waypoints) {
+ return waypoints.filter(function(r, idx) {
+ return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
+ });
+ }
+
+ eventBus.on('bendpoint.move.start', function(e) {
+
+ var context = e.context,
+ connection = context.connection,
+ originalWaypoints = connection.waypoints,
+ waypoints = originalWaypoints.slice(),
+ insert = context.insert,
+ idx = context.bendpointIndex;
+
+ context.originalWaypoints = originalWaypoints;
+
+ if (insert) {
+ // insert placeholder for bendpoint to-be-added
+ waypoints.splice(idx, 0, null);
+ }
+
+ connection.waypoints = waypoints;
+
+ // add dragger gfx
+ context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
+ context.draggerGfx.addClass('djs-dragging');
+
+ canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
+ });
+
+ eventBus.on('bendpoint.move.hover', function(e) {
+ e.context.hover = e.hover;
+
+ canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
+ });
+
+ eventBus.on([
+ 'bendpoint.move.out',
+ 'bendpoint.move.cleanup'
+ ], function(e) {
+
+ // remove connect marker
+ // if it was added
+ var hover = e.context.hover;
+
+ if (hover) {
+ canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
+ canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
+ }
+ });
+
+ eventBus.on('bendpoint.move.move', function(e) {
+
+ var context = e.context,
+ moveType = context.type,
+ connection = e.connection,
+ source, target;
+
+ connection.waypoints[context.bendpointIndex] = { x: e.x, y: e.y };
+
+ if (connectionDocking) {
+
+ if (context.hover) {
+ if (moveType === COMMAND_RECONNECT_START) {
+ source = context.hover;
+ }
+
+ if (moveType === COMMAND_RECONNECT_END) {
+ target = context.hover;
+ }
+ }
+
+ connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
+ }
+
+ // asks whether reconnect / bendpoint move / bendpoint add
+ // is allowed at the given position
+ var allowed = context.allowed = rules.allowed(context.type, context);
+
+ if (allowed) {
+
+ if (context.hover) {
+ canvas.removeMarker(context.hover, MARKER_NOT_OK);
+ canvas.addMarker(context.hover, MARKER_OK);
+
+ context.target = context.hover;
+ }
+ } else
+ if (allowed === false) {
+ if (context.hover) {
+ canvas.removeMarker(context.hover, MARKER_OK);
+ canvas.addMarker(context.hover, MARKER_NOT_OK);
+
+ context.target = null;
+ }
+ }
+
+ // add dragger gfx
+ context.draggerGfx.translate(e.x, e.y);
+
+ redrawConnection(e);
+ });
+
+ eventBus.on([
+ 'bendpoint.move.end',
+ 'bendpoint.move.cancel'
+ ], function(e) {
+
+ var context = e.context,
+ connection = context.connection;
+
+ // remove dragger gfx
+ context.draggerGfx.remove();
+
+ context.newWaypoints = connection.waypoints.slice();
+
+ connection.waypoints = context.originalWaypoints;
+
+ canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
+ });
+
+ eventBus.on('bendpoint.move.end', function(e) {
+
+ var context = e.context,
+ waypoints = context.newWaypoints,
+ bendpointIndex = context.bendpointIndex,
+ bendpoint = waypoints[bendpointIndex],
+ allowed = context.allowed;
+
+ // ensure we have actual pixel values bendpoint
+ // coordinates (important when zoom level was > 1 during move)
+ bendpoint.x = round(bendpoint.x);
+ bendpoint.y = round(bendpoint.y);
+
+ if (allowed === true && context.type === COMMAND_RECONNECT_START) {
+ modeling.reconnectStart(context.connection, context.target, bendpoint);
+ } else
+ if (allowed === true && context.type === COMMAND_RECONNECT_END) {
+ modeling.reconnectEnd(context.connection, context.target, bendpoint);
+ } else
+ if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
+ modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
+ } else {
+ redrawConnection(e);
+
+ return false;
+ }
+ });
+
+ eventBus.on('bendpoint.move.cancel', function(e) {
+ redrawConnection(e);
+ });
+}
+
+BendpointMove.$inject = [ 'injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling' ];
+
+module.exports = BendpointMove;
+},{"179":179,"90":90}],88:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ pick = _dereq_(330),
+ forEach = _dereq_(204);
+
+var Snap = _dereq_(188);
+
+var round = Math.round;
+
+
+function BendpointSnapping(eventBus) {
+
+ function snapTo(candidates, point) {
+ return Snap.snapTo(candidates, point);
+ }
+
+ function toPoint(e) {
+ return pick(e, [ 'x', 'y' ]);
+ }
+
+ function mid(element) {
+ if (element.width) {
+ return {
+ x: round(element.width / 2 + element.x),
+ y: round(element.height / 2 + element.y)
+ };
+ }
+ }
+
+ function getSnapPoints(context) {
+
+ var snapPoints = context.snapPoints,
+ waypoints = context.connection.waypoints,
+ bendpointIndex = context.bendpointIndex,
+ referenceWaypoints = [ waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1] ];
+
+ if (!snapPoints) {
+ context.snapPoints = snapPoints = { horizontal: [] , vertical: [] };
+
+ forEach(referenceWaypoints, function(p) {
+ // we snap on existing bendpoints only,
+ // not placeholders that are inserted during add
+ if (p) {
+ p = p.original || p;
+
+ snapPoints.horizontal.push(p.y);
+ snapPoints.vertical.push(p.x);
+ }
+ });
+ }
+
+ return snapPoints;
+ }
+
+ eventBus.on('bendpoint.move.start', function(event) {
+ event.context.snapStart = toPoint(event);
+ });
+
+ eventBus.on('bendpoint.move.move', 1500, function(event) {
+
+ var context = event.context,
+ snapPoints = getSnapPoints(context),
+ start = context.snapStart,
+ target = context.target,
+ targetMid = target && mid(target),
+ x = start.x + event.dx,
+ y = start.y + event.dy,
+ sx, sy;
+
+ if (!snapPoints) {
+ return;
+ }
+
+ // snap
+ sx = snapTo(targetMid ? snapPoints.vertical.concat([ targetMid.x ]) : snapPoints.vertical, x);
+ sy = snapTo(targetMid ? snapPoints.horizontal.concat([ targetMid.y ]) : snapPoints.horizontal, y);
+
+
+ // correction x/y
+ var cx = (x - sx),
+ cy = (y - sy);
+
+ // update delta
+ assign(event, {
+ dx: event.dx - cx,
+ dy: event.dy - cy,
+ x: event.x - cx,
+ y: event.y - cy
+ });
+ });
+}
+
+
+BendpointSnapping.$inject = [ 'eventBus' ];
+
+module.exports = BendpointSnapping;
+},{"188":188,"204":204,"325":325,"330":330}],89:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(344),
+ Util = _dereq_(90);
+
+var BENDPOINT_CLS = Util.BENDPOINT_CLS;
+
+
+/**
+ * A service that adds editable bendpoints to connections.
+ */
+function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
+
+ function getConnectionIntersection(waypoints, event) {
+ var localPosition = Util.toCanvasCoordinates(canvas, event);
+ return Util.getApproxIntersection(waypoints, localPosition);
+ }
+
+ function activateBendpointMove(event, connection) {
+ var waypoints = connection.waypoints,
+ intersection = getConnectionIntersection(waypoints, event);
+
+ if (!intersection) {
+ return;
+ }
+
+ bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
+ }
+
+ function getBendpointsContainer(element, create) {
+
+ var layer = canvas.getLayer('overlays'),
+ gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
+
+ if (!gfx && create) {
+ gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
+
+ domEvent.bind(gfx.node, 'mousedown', function(event) {
+ activateBendpointMove(event, element);
+ });
+ }
+
+ return gfx;
+ }
+
+ function createBendpoints(gfx, connection) {
+ connection.waypoints.forEach(function(p, idx) {
+ Util.addBendpoint(gfx).translate(p.x, p.y);
+ });
+
+ // add floating bendpoint
+ Util.addBendpoint(gfx).addClass('floating');
+ }
+
+ function clearBendpoints(gfx) {
+ gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
+ s.remove();
+ });
+ }
+
+ function addBendpoints(connection) {
+ var gfx = getBendpointsContainer(connection);
+
+ if (!gfx) {
+ gfx = getBendpointsContainer(connection, true);
+ createBendpoints(gfx, connection);
+ }
+
+ return gfx;
+ }
+
+ function updateBendpoints(connection) {
+
+ var gfx = getBendpointsContainer(connection);
+
+ if (gfx) {
+ clearBendpoints(gfx);
+ createBendpoints(gfx, connection);
+ }
+ }
+
+ eventBus.on('connection.changed', function(event) {
+ updateBendpoints(event.element);
+ });
+
+ eventBus.on('connection.remove', function(event) {
+ var gfx = getBendpointsContainer(event.element);
+ if (gfx) {
+ gfx.remove();
+ }
+ });
+
+ eventBus.on('element.marker.update', function(event) {
+
+ var element = event.element,
+ bendpointsGfx;
+
+ if (!element.waypoints) {
+ return;
+ }
+
+ bendpointsGfx = addBendpoints(element);
+ bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
+ });
+
+ eventBus.on('element.mousemove', function(event) {
+
+ var element = event.element,
+ waypoints = element.waypoints,
+ bendpointsGfx,
+ floating,
+ intersection;
+
+ if (waypoints) {
+
+ bendpointsGfx = getBendpointsContainer(element, true);
+ floating = bendpointsGfx.select('.floating');
+
+ if (!floating) {
+ return;
+ }
+
+ intersection = getConnectionIntersection(waypoints, event.originalEvent);
+
+ if (intersection) {
+ floating.translate(intersection.point.x, intersection.point.y);
+ }
+ }
+ });
+
+ eventBus.on('element.mousedown', function(event) {
+
+ var originalEvent = event.originalEvent,
+ element = event.element,
+ waypoints = element.waypoints;
+
+ if (!waypoints) {
+ return;
+ }
+
+ activateBendpointMove(originalEvent, element, waypoints);
+ });
+
+ eventBus.on('selection.changed', function(event) {
+ var newSelection = event.newSelection,
+ primary = newSelection[0];
+
+ if (primary && primary.waypoints) {
+ addBendpoints(primary);
+ }
+ });
+
+ eventBus.on('element.hover', function(event) {
+ var element = event.element;
+
+ if (element.waypoints) {
+ addBendpoints(element);
+
+ interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
+ }
+ });
+
+ eventBus.on('element.out', function(event) {
+ interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
+ });
+}
+
+Bendpoints.$inject = [ 'injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove' ];
+
+module.exports = Bendpoints;
+},{"344":344,"90":90}],90:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(188);
+
+var Events = _dereq_(178),
+ Geometry = _dereq_(179);
+
+var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
+
+module.exports.toCanvasCoordinates = function(canvas, event) {
+
+ var position = Events.toPoint(event),
+ clientRect = canvas._container.getBoundingClientRect(),
+ offset;
+
+ // canvas relative position
+
+ offset = {
+ x: clientRect.left,
+ y: clientRect.top
+ };
+
+ // update actual event payload with canvas relative measures
+
+ var viewbox = canvas.viewbox();
+
+ return {
+ x: viewbox.x + (position.x - offset.x) / viewbox.scale,
+ y: viewbox.y + (position.y - offset.y) / viewbox.scale
+ };
+};
+
+module.exports.addBendpoint = function(parentGfx) {
+ var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
+
+ groupGfx.circle(0, 0, 4).addClass('djs-visual');
+ groupGfx.circle(0, 0, 10).addClass('djs-hit');
+
+ return groupGfx;
+};
+
+
+function circlePath(center, r) {
+ var x = center.x,
+ y = center.y;
+
+ return [
+ ['M', x, y],
+ ['m', 0, -r],
+ ['a', r, r, 0, 1, 1, 0, 2 * r],
+ ['a', r, r, 0, 1, 1, 0, -2 * r],
+ ['z']
+ ];
+}
+
+function linePath(points) {
+ var segments = [];
+
+ points.forEach(function(p, idx) {
+ segments.push([ idx === 0 ? 'M' : 'L', p.x, p.y ]);
+ });
+
+ return segments;
+}
+
+
+var INTERSECTION_THRESHOLD = 10;
+
+function getBendpointIntersection(waypoints, reference) {
+
+ var i, w;
+
+ for (i = 0; !!(w = waypoints[i]); i++) {
+
+ if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
+ return {
+ point: waypoints[i],
+ bendpoint: true,
+ index: i
+ };
+ }
+ }
+
+ return null;
+}
+
+function getPathIntersection(waypoints, reference) {
+
+ var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
+
+ var a = intersections[0],
+ b = intersections[intersections.length - 1],
+ idx;
+
+ if (!a) {
+ // no intersection
+ return null;
+ }
+
+ if (a !== b) {
+
+ if (a.segment2 !== b.segment2) {
+ // we use the bendpoint in between both segments
+ // as the intersection point
+
+ idx = Math.max(a.segment2, b.segment2) - 1;
+
+ return {
+ point: waypoints[idx],
+ bendpoint: true,
+ index: idx
+ };
+ }
+
+ return {
+ point: {
+ x: (Math.round(a.x + b.x) / 2),
+ y: (Math.round(a.y + b.y) / 2)
+ },
+ index: a.segment2
+ };
+ }
+
+ return {
+ point: {
+ x: Math.round(a.x),
+ y: Math.round(a.y)
+ },
+ index: a.segment2
+ };
+}
+
+/**
+ * Returns the closest point on the connection towards a given reference point.
+ *
+ * @param {Array<Point>} waypoints
+ * @param {Point} reference
+ *
+ * @return {Object} intersection data (segment, point)
+ */
+module.exports.getApproxIntersection = function(waypoints, reference) {
+ return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
+};
+},{"178":178,"179":179,"188":188}],91:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(101), _dereq_(147) ],
+ __init__: [ 'bendpoints', 'bendpointSnapping' ],
+ bendpoints: [ 'type', _dereq_(89) ],
+ bendpointMove: [ 'type', _dereq_(87) ],
+ bendpointSnapping: [ 'type', _dereq_(88) ]
+};
+},{"101":101,"147":147,"87":87,"88":88,"89":89}],92:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Adds change support to the diagram, including
+ *
+ * <ul>
+ * <li>redrawing shapes and connections on change</li>
+ * </ul>
+ *
+ * @param {EventBus} eventBus
+ * @param {ElementRegistry} elementRegistry
+ * @param {GraphicsFactory} graphicsFactory
+ */
+function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
+
+ // redraw shapes / connections on change
+
+ eventBus.on('element.changed', function(event) {
+
+ var element = event.element;
+
+ if (!event.gfx) {
+ event.gfx = elementRegistry.getGraphics(element);
+ }
+
+ // shape + gfx may have been deleted
+ if (!event.gfx) {
+ return;
+ }
+
+ if (element.waypoints) {
+ eventBus.fire('connection.changed', event);
+ } else {
+ eventBus.fire('shape.changed', event);
+ }
+ });
+
+ eventBus.on('elements.changed', function(event) {
+
+ var elements = event.elements;
+
+ elements.forEach(function(e) {
+ eventBus.fire('element.changed', { element: e });
+ });
+
+ graphicsFactory.updateContainments(elements);
+ });
+
+ eventBus.on('shape.changed', function(event) {
+ graphicsFactory.update('shape', event.element, event.gfx);
+ });
+
+ eventBus.on('connection.changed', function(event) {
+ graphicsFactory.update('connection', event.element, event.gfx);
+ });
+}
+
+ChangeSupport.$inject = [ 'eventBus', 'elementRegistry', 'graphicsFactory' ];
+
+module.exports = ChangeSupport;
+
+},{}],93:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'changeSupport'],
+ changeSupport: [ 'type', _dereq_(92) ]
+};
+},{"92":92}],94:[function(_dereq_,module,exports){
+'use strict';
+
+var LayoutUtil = _dereq_(166);
+
+var MARKER_OK = 'connect-ok',
+ MARKER_NOT_OK = 'connect-not-ok';
+
+
+function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
+
+ // TODO(nre): separate UI and events
+
+ // rules
+
+ function canConnect(source, target) {
+ return rules.allowed('connection.create', {
+ source: source,
+ target: target
+ });
+ }
+
+
+ // layouting
+
+ function crop(start, end, source, target) {
+
+ var sourcePath = renderer.getShapePath(source),
+ targetPath = target && renderer.getShapePath(target),
+ connectionPath = renderer.getConnectionPath({ waypoints: [ start, end ] });
+
+ start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
+ end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
+
+ return [ start, end ];
+ }
+
+
+ // event handlers
+
+ eventBus.on('connect.move', function(event) {
+
+ var context = event.context,
+ source = context.source,
+ target = context.target,
+ visual = context.visual,
+ start, end, waypoints;
+
+ // update connection visuals during drag
+
+ start = LayoutUtil.getMidPoint(source);
+
+ end = {
+ x: event.x,
+ y: event.y
+ };
+
+ waypoints = crop(start, end, source, target);
+
+ visual.attr('points', [ waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y ]);
+ });
+
+ eventBus.on('connect.hover', function(event) {
+ var context = event.context,
+ source = context.source,
+ hover = event.hover,
+ canExecute;
+
+ canExecute = context.canExecute = canConnect(source, hover);
+
+ // simply ignore hover
+ if (canExecute === null) {
+ return;
+ }
+
+ context.target = hover;
+
+ canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
+ });
+
+ eventBus.on([ 'connect.out', 'connect.cleanup' ], function(event) {
+ var context = event.context;
+
+ if (context.target) {
+ canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
+ }
+
+ context.target = null;
+ });
+
+ eventBus.on('connect.cleanup', function(event) {
+ var context = event.context;
+
+ if (context.visual) {
+ context.visual.remove();
+ }
+ });
+
+ eventBus.on('connect.start', function(event) {
+ var context = event.context,
+ visual;
+
+ visual = canvas.getDefaultLayer().polyline().attr({
+ 'stroke': '#333',
+ 'strokeDasharray': [ 1 ],
+ 'strokeWidth': 2,
+ 'pointer-events': 'none'
+ });
+
+ context.visual = visual;
+ });
+
+ eventBus.on('connect.end', function(event) {
+
+ var context = event.context,
+ source = context.source,
+ target = context.target,
+ canExecute = context.canExecute || canConnect(source, target);
+
+ if (!canExecute) {
+ return false;
+ }
+
+ modeling.connect(source, target);
+ });
+
+
+ // API
+
+ this.start = function(event, source, autoActivate) {
+
+ dragging.activate(event, 'connect', {
+ autoActivate: autoActivate,
+ data: {
+ shape: source,
+ context: {
+ source: source
+ }
+ }
+ });
+ };
+}
+
+Connect.$inject = [ 'eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer' ];
+
+module.exports = Connect;
+},{"166":166}],95:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(151),
+ _dereq_(147),
+ _dereq_(101)
+ ],
+ connect: [ 'type', _dereq_(94) ]
+};
+
+},{"101":101,"147":147,"151":151,"94":94}],96:[function(_dereq_,module,exports){
+'use strict';
+
+var isFunction = _dereq_(317),
+ forEach = _dereq_(204),
+
+ domDelegate = _dereq_(342),
+ domClear = _dereq_(340),
+ domEvent = _dereq_(344),
+ domAttr = _dereq_(338),
+ domQuery = _dereq_(346),
+ domClasses = _dereq_(339),
+ domify = _dereq_(343);
+
+
+var entrySelector = '.entry';
+
+
+/**
+ * A context pad that displays element specific, contextual actions next
+ * to a diagram element.
+ *
+ * @param {EventBus} eventBus
+ * @param {Overlays} overlays
+ */
+function ContextPad(eventBus, overlays) {
+
+ this._providers = [];
+
+ this._eventBus = eventBus;
+ this._overlays = overlays;
+
+ this._current = null;
+
+ this._init();
+}
+
+ContextPad.$inject = [ 'eventBus', 'overlays' ];
+
+/**
+ * Registers events needed for interaction with other components
+ */
+ContextPad.prototype._init = function() {
+
+ var eventBus = this._eventBus;
+
+ var self = this;
+
+ eventBus.on('selection.changed', function(e) {
+
+ var selection = e.newSelection;
+
+ if (selection.length === 1) {
+ self.open(selection[0]);
+ } else {
+ self.close();
+ }
+ });
+};
+
+
+/**
+ * Register a provider with the context pad
+ *
+ * @param {ContextPadProvider} provider
+ */
+ContextPad.prototype.registerProvider = function(provider) {
+ this._providers.push(provider);
+};
+
+
+/**
+ * Returns the context pad entries for a given element
+ *
+ * @param {djs.element.Base} element
+ *
+ * @return {Array<ContextPadEntryDescriptor>} list of entries
+ */
+ContextPad.prototype.getEntries = function(element) {
+ var entries = {};
+
+ // loop through all providers and their entries.
+ // group entries by id so that overriding an entry is possible
+ forEach(this._providers, function(provider) {
+ var e = provider.getContextPadEntries(element);
+
+ forEach(e, function(entry, id) {
+ entries[id] = entry;
+ });
+ });
+
+ return entries;
+};
+
+
+/**
+ * Trigger an action available on the opened context pad
+ *
+ * @param {String} action
+ * @param {Event} event
+ */
+ContextPad.prototype.trigger = function(action, event, autoActivate) {
+
+ var current = this._current,
+ element = current.element,
+ entries = current.entries,
+ entry,
+ handler,
+ originalEvent,
+ button = event.delegateTarget || event.target;
+
+ if (!button) {
+ return event.preventDefault();
+ }
+
+ entry = entries[domAttr(button, 'data-action')];
+ handler = entry.action;
+
+ originalEvent = event.originalEvent || event;
+
+ // simple action (via callback function)
+ if (isFunction(handler)) {
+ if (action === 'click') {
+ return handler(originalEvent, element, autoActivate);
+ }
+ } else {
+ if (handler[action]) {
+ return handler[action](originalEvent, element, autoActivate);
+ }
+ }
+
+ // silence other actions
+ event.preventDefault();
+};
+
+
+/**
+ * Open the context pad for the given element
+ *
+ * @param {djs.model.Base} element
+ */
+ContextPad.prototype.open = function(element) {
+
+ if (this._current && this._current.open) {
+
+ if (this._current.element === element) {
+ // no change needed
+ return;
+ }
+
+ this.close();
+ }
+
+ this._updateAndOpen(element);
+};
+
+
+ContextPad.prototype._updateAndOpen = function(element) {
+
+ var entries = this.getEntries(element),
+ pad = this.getPad(element),
+ html = pad.html;
+
+ domClear(html);
+
+ forEach(entries, function(entry, id) {
+ var grouping = entry.group || 'default',
+ control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
+ container;
+
+ domAttr(control, 'data-action', id);
+
+ container = domQuery('[data-group=' + grouping + ']', html);
+ if (!container) {
+ container = domify('<div class="group" data-group="' + grouping + '"></div>');
+ html.appendChild(container);
+ }
+
+ container.appendChild(control);
+
+ if (entry.className) {
+ domClasses(control).add(entry.className);
+ }
+
+ if (entry.title) {
+ domAttr(control, 'title', entry.title);
+ }
+
+ if (entry.imageUrl) {
+ control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
+ }
+ });
+
+ domClasses(html).add('open');
+
+ this._current = {
+ element: element,
+ pad: pad,
+ entries: entries,
+ open: true
+ };
+
+ this._eventBus.fire('contextPad.open', { current: this._current });
+};
+
+ContextPad.prototype.getPad = function(element) {
+
+ var self = this;
+
+ var overlays = this._overlays,
+ pads = overlays.get({ element: element, type: 'context-pad' });
+
+ // create context pad on demand if needed
+ if (!pads.length) {
+
+ var html = domify('<div class="djs-context-pad"></div>');
+
+ domDelegate.bind(html, entrySelector, 'click', function(event) {
+ self.trigger('click', event);
+ });
+
+ domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
+ self.trigger('dragstart', event);
+ });
+
+ // stop propagation of mouse events
+ domEvent.bind(html, 'mousedown', function(event) {
+ event.stopPropagation();
+ });
+
+ overlays.add(element, 'context-pad', {
+ position: {
+ right: -9,
+ top: -6
+ },
+ html: html
+ });
+
+ pads = overlays.get({ element: element, type: 'context-pad' });
+
+ this._eventBus.fire('contextPad.create', { element: element, pad: pads[0] });
+ }
+
+ return pads[0];
+};
+
+
+/**
+ * Close the context pad
+ */
+ContextPad.prototype.close = function() {
+
+ var html;
+
+ if (this._current) {
+ if (this._current.open) {
+ html = this._current.pad.html;
+ domClasses(html).remove('open');
+ }
+
+ this._current.open = false;
+
+ this._eventBus.fire('contextPad.close', { current: this._current });
+ }
+};
+
+
+/**
+ * Return the element the context pad is currently opened for,
+ * if it is opened.
+ *
+ * @example
+ *
+ * contextPad.open(shape1);
+ *
+ * if (contextPad.isOpen()) {
+ * // yes, we are open
+ * }
+ *
+ * @return {djs.model.Base} element
+ */
+ContextPad.prototype.isOpen = function() {
+ return this._current && this._current.open;
+};
+
+module.exports = ContextPad;
+
+},{"204":204,"317":317,"338":338,"339":339,"340":340,"342":342,"343":343,"344":344,"346":346}],97:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(103),
+ _dereq_(135)
+ ],
+ contextPad: [ 'type', _dereq_(96) ]
+};
+},{"103":103,"135":135,"96":96}],98:[function(_dereq_,module,exports){
+'use strict';
+
+var MARKER_OK = 'drop-ok',
+ MARKER_NOT_OK = 'drop-not-ok';
+
+
+function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
+
+ // rules
+
+ function canCreate(shape, target, source) {
+
+ if (source) {
+ return rules.allowed('shape.append', {
+ source: source,
+ shape: shape,
+ parent: target
+ });
+ } else {
+ return rules.allowed('shape.create', {
+ shape: shape,
+ parent: target
+ });
+ }
+ }
+
+
+ // visual helpers
+
+ function createVisual(shape) {
+ var group, preview, visual;
+
+ group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));
+
+ preview = group.group().addClass('djs-dragger');
+
+ preview.translate(shape.width / -2, shape.height / -2);
+
+ visual = preview.group().addClass('djs-visual');
+
+ // hijack renderer to draw preview
+ renderer.drawShape(visual, shape);
+
+ return group;
+ }
+
+
+ // event handlers
+
+ eventBus.on('create.move', function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ visual = context.visual;
+
+ // lazy init drag visual once we received the first real
+ // drag move event (this allows us to get the proper canvas local coordinates)
+ if (!visual) {
+ visual = context.visual = createVisual(shape);
+ }
+
+ visual.translate(event.x, event.y);
+
+ var hover = event.hover,
+ canExecute;
+
+ canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
+
+ // ignore hover visually if canExecute is null
+ if (hover && canExecute !== null) {
+ context.target = hover;
+ canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
+ }
+ });
+
+ eventBus.on([ 'create.end', 'create.out', 'create.cleanup' ], function(event) {
+ var context = event.context;
+
+ if (context.target) {
+ canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
+ }
+ });
+
+ eventBus.on('create.end', function(event) {
+ var context = event.context,
+ source = context.source,
+ shape = context.shape,
+ target = context.target,
+ canExecute = context.canExecute,
+ position = {
+ x: event.x,
+ y: event.y
+ };
+
+ if (!canExecute) {
+ return false;
+ }
+
+ if (source) {
+ modeling.appendShape(source, shape, position, target);
+ } else {
+ modeling.createShape(shape, position, target);
+ }
+ });
+
+
+ eventBus.on('create.cleanup', function(event) {
+ var context = event.context;
+
+ if (context.visual) {
+ context.visual.remove();
+ }
+ });
+
+ // API
+
+ this.start = function(event, shape, source) {
+
+ dragging.activate(event, 'create', {
+ cursor: 'grabbing',
+ autoActivate: true,
+ data: {
+ shape: shape,
+ context: {
+ shape: shape,
+ source: source
+ }
+ }
+ });
+ };
+}
+
+Create.$inject = [ 'eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles' ];
+
+module.exports = Create;
+},{}],99:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(101),
+ _dereq_(151)
+ ],
+ create: [ 'type', _dereq_(98) ]
+};
+},{"101":101,"151":151,"98":98}],100:[function(_dereq_,module,exports){
+'use strict';
+
+/* global TouchEvent */
+
+var assign = _dereq_(325);
+
+var domEvent = _dereq_(344),
+ Event = _dereq_(178),
+ ClickTrap = _dereq_(174),
+ Cursor = _dereq_(176);
+
+function suppressEvent(event) {
+ if (event instanceof MouseEvent) {
+ Event.stopEvent(event, true);
+ } else {
+ Event.preventDefault(event);
+ }
+}
+
+function getLength(point) {
+ return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
+}
+
+function substract(p1, p2) {
+ return {
+ x: p1.x - p2.x,
+ y: p1.y - p2.y
+ };
+}
+
+/**
+ * A helper that fires canvas localized drag events and realizes
+ * the general "drag-and-drop" look and feel.
+ *
+ * Calling {@link Dragging#activate} activates dragging on a canvas.
+ *
+ * It provides the following:
+ *
+ * * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the {@link EventBus}.
+ * Each of the events is prefixed with a prefix that is assigned during activate.
+ * * sets and restores the cursor
+ * * sets and restores the selection
+ * * ensures there can be only one drag operation active at a time
+ *
+ * Dragging may be canceled manually by calling {@link Dragging#cancel} or by pressing ESC.
+ *
+ * @example
+ *
+ * function MyDragComponent(eventBus, dragging) {
+ *
+ * eventBus.on('mydrag.start', function(event) {
+ * console.log('yes, we start dragging');
+ * });
+ *
+ * eventBus.on('mydrag.move', function(event) {
+ * console.log('canvas local coordinates', event.x, event.y, event.dx, event.dy);
+ *
+ * // local drag data is passed with the event
+ * event.context.foo; // "BAR"
+ *
+ * // the original mouse event, too
+ * event.originalEvent; // MouseEvent(...)
+ * });
+ *
+ * eventBus.on('element.click', function(event) {
+ * dragging.activate(event, 'mydrag', {
+ * cursor: 'grabbing',
+ * data: {
+ * context: {
+ * foo: "BAR"
+ * }
+ * }
+ * });
+ * });
+ * }
+ */
+function Dragging(eventBus, canvas, selection) {
+
+ var defaultOptions = {
+ threshold: 5
+ };
+
+ // the currently active drag operation
+ // dragging is active as soon as this context exists.
+ //
+ // it is visually _active_ only when a context.active flag is set to true.
+ var context;
+
+
+ // helpers
+
+ function fire(type) {
+
+ var ActualEvent = _dereq_(81).Event;
+
+ var event = assign(new ActualEvent(), context.payload, context.data);
+
+ // default integration
+ if (eventBus.fire('drag.' + type, event) === false) {
+ return false;
+ }
+
+ return eventBus.fire(context.prefix + '.' + type, event);
+ }
+
+ // event listeners
+
+ function move(event, activate) {
+
+ var payload = context.payload,
+ start = context.start,
+ position = Event.toPoint(event),
+ delta = substract(position, start),
+ clientRect = canvas._container.getBoundingClientRect(),
+ offset;
+
+ // canvas relative position
+
+ offset = {
+ x: clientRect.left,
+ y: clientRect.top
+ };
+
+ // update actual event payload with canvas relative measures
+
+ var viewbox = canvas.viewbox();
+
+ var movement = {
+ x: viewbox.x + (position.x - offset.x) / viewbox.scale,
+ y: viewbox.y + (position.y - offset.y) / viewbox.scale,
+ dx: delta.x / viewbox.scale,
+ dy: delta.y / viewbox.scale
+ };
+
+ // activate context explicitly or once threshold is reached
+
+ if (!context.active && (activate || getLength(delta) > context.threshold)) {
+
+ // fire start event with original
+ // starting coordinates
+
+ assign(payload, {
+ x: movement.x - movement.dx,
+ y: movement.y - movement.dy,
+ dx: 0,
+ dy: 0
+ }, { originalEvent: event });
+
+ if (false === fire('start')) {
+ return cancel();
+ }
+
+ context.active = true;
+
+ // unset selection
+ if (!context.keepSelection) {
+ context.previousSelection = selection.get();
+ selection.select(null);
+ }
+
+ // allow custom cursor
+ if (context.cursor) {
+ Cursor.set(context.cursor);
+ }
+ }
+
+ suppressEvent(event);
+
+ if (context.active) {
+
+ // fire move event with actual coordinates
+ assign(payload, movement, { originalEvent: event });
+
+ fire('move');
+ }
+ }
+
+ function end(event) {
+
+ var returnValue = true;
+
+ if (context.active) {
+
+ if (event) {
+ context.payload.originalEvent = event;
+
+ // suppress original event (click, ...)
+ // because we just ended a drag operation
+ suppressEvent(event);
+ }
+
+ // implementations may stop restoring the
+ // original state (selections, ...) by preventing the
+ // end events default action
+ returnValue = fire('end');
+ }
+
+ if (returnValue === false) {
+ fire('rejected');
+ }
+
+ cleanup(returnValue !== true);
+ }
+
+
+ // cancel active drag operation if the user presses
+ // the ESC key on the keyboard
+
+ function checkCancel(event) {
+
+ if (event.which === 27) {
+ event.preventDefault();
+
+ cancel();
+ }
+ }
+
+
+ // prevent ghost click that might occur after a finished
+ // drag and drop session
+
+ function trapClickAndEnd(event) {
+
+ var untrap;
+
+ // trap the click in case we are part of an active
+ // drag operation. This will effectively prevent
+ // the ghost click that cannot be canceled otherwise.
+ if (context.active) {
+ untrap = ClickTrap.install();
+ setTimeout(untrap, 400);
+ }
+
+ end(event);
+ }
+
+ function trapTouch(event) {
+ move(event);
+ }
+
+ // update the drag events hover (djs.model.Base) and hoverGfx (Snap<SVGElement>)
+ // properties during hover and out and fire {prefix}.hover and {prefix}.out properties
+ // respectively
+
+ function hover(event) {
+ var payload = context.payload;
+
+ payload.hoverGfx = event.gfx;
+ payload.hover = event.element;
+
+ fire('hover');
+ }
+
+ function out(event) {
+ fire('out');
+
+ var payload = context.payload;
+
+ payload.hoverGfx = null;
+ payload.hover = null;
+ }
+
+
+ // life-cycle methods
+
+ function cancel(restore) {
+
+ if (!context) {
+ return;
+ }
+
+ if (context.active) {
+ fire('cancel');
+ }
+
+ cleanup(restore);
+ }
+
+ function cleanup(restore) {
+
+ fire('cleanup');
+
+ // reset cursor
+ Cursor.unset();
+
+ // reset dom listeners
+ domEvent.unbind(document, 'mousemove', move);
+
+ domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
+ domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
+
+ domEvent.unbind(document, 'keyup', checkCancel);
+
+ domEvent.unbind(document, 'touchstart', trapTouch, true);
+ domEvent.unbind(document, 'touchcancel', cancel, true);
+ domEvent.unbind(document, 'touchmove', move, true);
+ domEvent.unbind(document, 'touchend', end, true);
+
+ eventBus.off('element.hover', hover);
+ eventBus.off('element.out', out);
+
+ // restore selection, unless it has changed
+ if (restore !== false && context.previousSelection && !selection.get().length) {
+ selection.select(context.previousSelection);
+ }
+
+ context = null;
+ }
+
+ /**
+ * Activate a drag operation
+ *
+ * @param {MouseEvent|TouchEvent} [event]
+ * @param {String} prefix
+ * @param {Object} [options]
+ */
+ function activate(event, prefix, options) {
+
+ // only one drag operation may be active, at a time
+ if (context) {
+ cancel(false);
+ }
+
+ options = assign({}, defaultOptions, options || {});
+
+ var data = options.data || {},
+ originalEvent,
+ start;
+
+ if (event) {
+ originalEvent = Event.getOriginal(event) || event;
+ start = Event.toPoint(event);
+
+ suppressEvent(event);
+ } else {
+ originalEvent = null;
+ start = { x: 0, y: 0 };
+ }
+
+ context = assign({
+ prefix: prefix,
+ data: data,
+ payload: {},
+ start: start
+ }, options);
+
+ // skip dom registration if trigger
+ // is set to manual (during testing)
+ if (!options.manual) {
+
+ // add dom listeners
+
+ // fixes TouchEvent not being available on desktop Firefox
+ if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
+ domEvent.bind(document, 'touchstart', trapTouch, true);
+ domEvent.bind(document, 'touchcancel', cancel, true);
+ domEvent.bind(document, 'touchmove', move, true);
+ domEvent.bind(document, 'touchend', end, true);
+ } else {
+ // assume we use the mouse to interact per default
+ domEvent.bind(document, 'mousemove', move);
+
+ domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
+ domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
+ }
+
+ domEvent.bind(document, 'keyup', checkCancel);
+
+ eventBus.on('element.hover', hover);
+ eventBus.on('element.out', out);
+ }
+
+ fire('activate');
+
+ if (options.autoActivate) {
+ move(event, true);
+ }
+ }
+
+ // cancel on diagram destruction
+ eventBus.on('diagram.destroy', cancel);
+
+
+ // API
+
+ this.activate = activate;
+ this.move = move;
+ this.hover = hover;
+ this.out = out;
+ this.end = end;
+
+ this.cancel = cancel;
+
+ // for introspection
+
+ this.active = function() {
+ return context;
+ };
+
+ this.setOptions = function(options) {
+ assign(defaultOptions, options);
+ };
+}
+
+Dragging.$inject = [ 'eventBus', 'canvas', 'selection' ];
+
+module.exports = Dragging;
+},{"174":174,"176":176,"178":178,"325":325,"344":344,"81":81}],101:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(151)
+ ],
+ dragging: [ 'type', _dereq_(100) ]
+};
+},{"100":100,"151":151}],102:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ domDelegate = _dereq_(342),
+ Renderer = _dereq_(84),
+ createLine = Renderer.createLine,
+ updateLine = Renderer.updateLine;
+
+
+var isPrimaryButton = _dereq_(182).isPrimaryButton;
+
+var Snap = _dereq_(188);
+
+/**
+ * A plugin that provides interaction events for diagram elements.
+ *
+ * It emits the following events:
+ *
+ * * element.hover
+ * * element.out
+ * * element.click
+ * * element.dblclick
+ * * element.mousedown
+ *
+ * Each event is a tuple { element, gfx, originalEvent }.
+ *
+ * Canceling the event via Event#preventDefault() prevents the original DOM operation.
+ *
+ * @param {EventBus} eventBus
+ */
+function InteractionEvents(eventBus, elementRegistry, styles) {
+
+ var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {
+ stroke: 'white',
+ strokeWidth: 15
+ });
+
+ function fire(type, event) {
+ var target = event.delegateTarget || event.target,
+ gfx = target && new Snap(target),
+ element = elementRegistry.get(gfx),
+ returnValue;
+
+ if (!gfx || !element) {
+ return;
+ }
+
+ returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });
+
+ if (returnValue === false) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+
+ var handlers = {};
+
+ function mouseHandler(type) {
+
+ var fn = handlers[type];
+
+ if (!fn) {
+ fn = handlers[type] = function(event) {
+ // only indicate left mouse button interactions
+ if (isPrimaryButton(event)) {
+ fire(type, event);
+ }
+ };
+ }
+
+ return fn;
+ }
+
+ var bindings = {
+ mouseover: 'element.hover',
+ mouseout: 'element.out',
+ click: 'element.click',
+ dblclick: 'element.dblclick',
+ mousedown: 'element.mousedown',
+ mouseup: 'element.mouseup'
+ };
+
+ var elementSelector = 'svg, .djs-element';
+
+ ///// event registration
+
+ function registerEvent(node, event, localEvent) {
+ var handler = mouseHandler(localEvent);
+ handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
+ }
+
+ function unregisterEvent(node, event, localEvent) {
+ domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
+ }
+
+ function registerEvents(svg) {
+ forEach(bindings, function(val, key) {
+ registerEvent(svg.node, key, val);
+ });
+ }
+
+ function unregisterEvents(svg) {
+ forEach(bindings, function(val, key) {
+ unregisterEvent(svg.node, key, val);
+ });
+ }
+
+ eventBus.on('canvas.destroy', function(event) {
+ unregisterEvents(event.svg);
+ });
+
+ eventBus.on('canvas.init', function(event) {
+ registerEvents(event.svg);
+ });
+
+
+ eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx,
+ hit,
+ type;
+
+ if (element.waypoints) {
+ hit = createLine(element.waypoints);
+ type = 'connection';
+ } else {
+ hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });
+ type = 'shape';
+ }
+
+ hit.attr(HIT_STYLE).appendTo(gfx.node);
+ });
+
+ // update djs-hit on change
+
+ eventBus.on('shape.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ hit.attr({
+ width: element.width,
+ height: element.height
+ });
+ });
+
+ eventBus.on('connection.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ updateLine(hit, element.waypoints);
+ });
+
+
+ // API
+
+ this.fire = fire;
+
+ this.mouseHandler = mouseHandler;
+
+ this.registerEvent = registerEvent;
+ this.unregisterEvent = unregisterEvent;
+}
+
+
+InteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];
+
+module.exports = InteractionEvents;
+
+
+/**
+ * An event indicating that the mouse hovered over an element
+ *
+ * @event element.hover
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has left an element
+ *
+ * @event element.out
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has clicked an element
+ *
+ * @event element.click
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has double clicked an element
+ *
+ * @event element.dblclick
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone down on an element.
+ *
+ * @event element.mousedown
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone up on an element.
+ *
+ * @event element.mouseup
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+},{"182":182,"188":188,"204":204,"342":342,"84":84}],103:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'interactionEvents' ],
+ interactionEvents: [ 'type', _dereq_(102) ]
+};
+},{"102":102}],104:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(344),
+ domMatches = _dereq_(345);
+
+/**
+ * A keyboard abstraction that may be activated and
+ * deactivated by users at will, consuming key events
+ * and triggering diagram actions.
+ *
+ * The implementation fires the following key events that allow
+ * other components to hook into key handling:
+ *
+ * - keyboard.bind
+ * - keyboard.unbind
+ * - keyboard.init
+ * - keyboard.destroy
+ *
+ * All events contain the fields (node, listeners).
+ *
+ * A default binding for the keyboard may be specified via the
+ * `keyboard.bindTo` configuration option.
+ *
+ * @param {EventBus} eventBus
+ * @param {CommandStack} commandStack
+ * @param {Modeling} modeling
+ * @param {Selection} selection
+ */
+function Keyboard(config, eventBus, commandStack, modeling, selection) {
+
+ var self = this;
+
+ this._commandStack = commandStack;
+ this._modeling = modeling;
+ this._selection = selection;
+ this._eventBus = eventBus;
+
+ this._listeners = [];
+
+ // our key handler is a singleton that passes
+ // (keycode, modifiers) to each listener.
+ //
+ // listeners must indicate that they handled a key event
+ // by returning true. This stops the event propagation.
+ //
+ this._keyHandler = function(event) {
+
+ var i, l,
+ target = event.target,
+ listeners = self._listeners,
+ code = event.keyCode || event.charCode || -1;
+
+ if (domMatches(target, 'input, textarea')) {
+ return;
+ }
+
+ for (i = 0; !!(l = listeners[i]); i++) {
+ if (l(code, event)) {
+ event.stopPropagation();
+ }
+ }
+ };
+
+ // properly clean dom registrations
+ eventBus.on('diagram.destroy', function() {
+ self._fire('destroy');
+
+ self.unbind();
+ self._listeners = null;
+ });
+
+ eventBus.on('diagram.init', function() {
+ self._fire('init');
+
+ if (config && config.bindTo) {
+ self.bind(config.bindTo);
+ }
+ });
+
+ this._init();
+}
+
+Keyboard.$inject = [ 'config.keyboard', 'eventBus', 'commandStack', 'modeling', 'selection' ];
+
+module.exports = Keyboard;
+
+
+Keyboard.prototype.bind = function(node) {
+ this._node = node;
+
+ // bind key events
+ domEvent.bind(node, 'keydown', this._keyHandler, true);
+
+ this._fire('bind');
+};
+
+Keyboard.prototype.getBinding = function() {
+ return this._node;
+};
+
+Keyboard.prototype.unbind = function() {
+ var node = this._node;
+
+ if (node) {
+ this._fire('unbind');
+
+ // unbind key events
+ domEvent.unbind(node, 'keydown', this._keyHandler, true);
+ }
+
+ this._node = null;
+};
+
+
+Keyboard.prototype._fire = function(event) {
+ this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });
+};
+
+Keyboard.prototype._init = function() {
+
+ var listeners = this._listeners,
+ commandStack = this._commandStack,
+ modeling = this._modeling,
+ selection = this._selection;
+
+
+ // init default listeners
+
+ // undo
+ // (CTRL|CMD) + Z
+ function undo(key, modifiers) {
+
+ if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
+ commandStack.undo();
+
+ return true;
+ }
+ }
+
+ // redo
+ // CTRL + Y
+ // CMD + SHIFT + Z
+ function redo(key, modifiers) {
+
+ if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
+ commandStack.redo();
+
+ return true;
+ }
+ }
+
+
+ // delete selected element
+ // DEL
+ function remove(key, modifiers) {
+
+ if (key === 46) {
+
+ var selectedElements = selection.get();
+
+ if (selectedElements.length) {
+ modeling.removeElements(selectedElements.slice());
+ }
+
+ return true;
+ }
+ }
+
+ listeners.push(undo);
+ listeners.push(redo);
+ listeners.push(remove);
+};
+
+
+/**
+ * Add a listener function that is notified with (key, modifiers) whenever
+ * the keyboard is bound and the user presses a key.
+ *
+ * @param {Function} listenerFn
+ */
+Keyboard.prototype.addListener = function(listenerFn) {
+ this._listeners.push(listenerFn);
+};
+
+Keyboard.prototype.hasModifier = hasModifier;
+Keyboard.prototype.isCmd = isCmd;
+Keyboard.prototype.isShift = isShift;
+
+
+function hasModifier(modifiers) {
+ return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
+}
+
+function isCmd(modifiers) {
+ return modifiers.ctrlKey || modifiers.metaKey;
+}
+
+function isShift(modifiers) {
+ return modifiers.shiftKey;
+}
+
+},{"344":344,"345":345}],105:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'keyboard' ],
+ keyboard: [ 'type', _dereq_(104) ]
+};
+
+},{"104":104}],106:[function(_dereq_,module,exports){
+'use strict';
+
+var values = _dereq_(331);
+
+var getEnclosedElements = _dereq_(177).getEnclosedElements;
+
+var hasPrimaryModifier = _dereq_(182).hasPrimaryModifier;
+
+var Snap = _dereq_(188);
+
+
+function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
+
+ this._selection = selection;
+ this._dragging = dragging;
+
+ var self = this;
+
+ // lasso visuals implementation
+
+ /**
+ * A helper that realizes the selection box visual
+ */
+ var visuals = {
+
+ create: function(context) {
+ var container = canvas.getDefaultLayer(),
+ frame;
+
+ frame = context.frame = Snap.create('rect', {
+ class: 'djs-lasso-overlay',
+ width: 1,
+ height: 1,
+ x: 0,
+ y: 0
+ });
+
+ frame.appendTo(container);
+ },
+
+ update: function(context) {
+ var frame = context.frame,
+ bbox = context.bbox;
+
+ frame.attr({
+ x: bbox.x,
+ y: bbox.y,
+ width: bbox.width,
+ height: bbox.height
+ });
+ },
+
+ remove: function(context) {
+
+ if (context.frame) {
+ context.frame.remove();
+ }
+ }
+ };
+
+
+ eventBus.on('lasso.selection.end', function(event) {
+
+ setTimeout(function() {
+ self.activateLasso(event.originalEvent, true);
+ });
+ });
+
+ // lasso interaction implementation
+
+ eventBus.on('lasso.end', function(event) {
+
+ var bbox = toBBox(event);
+
+ var elements = elementRegistry.filter(function(element) {
+ return element;
+ });
+
+ self.select(elements, bbox);
+ });
+
+ eventBus.on('lasso.start', function(event) {
+
+ var context = event.context;
+
+ context.bbox = toBBox(event);
+ visuals.create(context);
+ });
+
+ eventBus.on('lasso.move', function(event) {
+
+ var context = event.context;
+
+ context.bbox = toBBox(event);
+ visuals.update(context);
+ });
+
+ eventBus.on('lasso.end', function(event) {
+
+ var context = event.context;
+
+ visuals.remove(context);
+ });
+
+ eventBus.on('lasso.cleanup', function(event) {
+
+ var context = event.context;
+
+ visuals.remove(context);
+ });
+
+
+ // event integration
+
+ eventBus.on('element.mousedown', 1500, function(event) {
+
+ if (hasPrimaryModifier(event)) {
+ self.activateLasso(event.originalEvent);
+
+ event.stopPropagation();
+ }
+ });
+}
+
+LassoTool.$inject = [
+ 'eventBus',
+ 'canvas',
+ 'dragging',
+ 'elementRegistry',
+ 'selection'
+];
+
+module.exports = LassoTool;
+
+
+LassoTool.prototype.activateLasso = function(event, autoActivate) {
+
+ this._dragging.activate(event, 'lasso', {
+ autoActivate: autoActivate,
+ cursor: 'crosshair',
+ data: {
+ context: {}
+ }
+ });
+};
+
+LassoTool.prototype.activateSelection = function(event) {
+
+ this._dragging.activate(event, 'lasso.selection', {
+ cursor: 'crosshair'
+ });
+};
+
+LassoTool.prototype.select = function(elements, bbox) {
+ var selectedElements = getEnclosedElements(elements, bbox);
+
+ this._selection.select(values(selectedElements));
+};
+
+
+function toBBox(event) {
+
+ var start = {
+
+ x: event.x - event.dx,
+ y: event.y - event.dy
+ };
+
+ var end = {
+ x: event.x,
+ y: event.y
+ };
+
+ var bbox;
+
+ if ((start.x <= end.x && start.y < end.y) ||
+ (start.x < end.x && start.y <= end.y)) {
+
+ bbox = {
+ x: start.x,
+ y: start.y,
+ width: end.x - start.x,
+ height: end.y - start.y
+ };
+ } else if ((start.x >= end.x && start.y < end.y) ||
+ (start.x > end.x && start.y <= end.y)) {
+
+ bbox = {
+ x: end.x,
+ y: start.y,
+ width: start.x - end.x,
+ height: end.y - start.y
+ };
+ } else if ((start.x <= end.x && start.y > end.y) ||
+ (start.x < end.x && start.y >= end.y)) {
+
+ bbox = {
+ x: start.x,
+ y: end.y,
+ width: end.x - start.x,
+ height: start.y - end.y
+ };
+ } else if ((start.x >= end.x && start.y > end.y) ||
+ (start.x > end.x && start.y >= end.y)) {
+
+ bbox = {
+ x: end.x,
+ y: end.y,
+ width: start.x - end.x,
+ height: start.y - end.y
+ };
+ } else {
+
+ bbox = {
+ x: end.x,
+ y: end.y,
+ width: 0,
+ height: 0
+ };
+ }
+ return bbox;
+}
+},{"177":177,"182":182,"188":188,"331":331}],107:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'lassoTool' ],
+ lassoTool: [ 'type', _dereq_(106) ]
+};
+
+},{"106":106}],108:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var model = _dereq_(168);
+
+
+/**
+ * The basic modeling entry point.
+ *
+ * @param {EventBus} eventBus
+ * @param {ElementFactory} elementFactory
+ * @param {CommandStack} commandStack
+ */
+function Modeling(eventBus, elementFactory, commandStack) {
+ this._eventBus = eventBus;
+ this._elementFactory = elementFactory;
+ this._commandStack = commandStack;
+
+ var self = this;
+
+ eventBus.on('diagram.init', function() {
+ // register modeling handlers
+ self.registerHandlers(commandStack);
+ });
+}
+
+Modeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack' ];
+
+module.exports = Modeling;
+
+
+Modeling.prototype.getHandlers = function() {
+ return {
+ 'shape.append': _dereq_(109),
+ 'shape.create': _dereq_(112),
+ 'shape.delete': _dereq_(115),
+ 'shape.move': _dereq_(118),
+ 'shapes.move': _dereq_(119),
+ 'shape.resize': _dereq_(123),
+ 'shape.replace': _dereq_(122),
+
+ 'spaceTool': _dereq_(124),
+
+ 'label.create': _dereq_(111),
+
+ 'connection.create': _dereq_(110),
+ 'connection.delete': _dereq_(113),
+ 'connection.move': _dereq_(117),
+ 'connection.layout': _dereq_(116),
+
+ 'connection.updateWaypoints': _dereq_(126),
+
+ 'connection.reconnectStart': _dereq_(121),
+ 'connection.reconnectEnd': _dereq_(121),
+
+ 'elements.delete': _dereq_(114),
+ 'element.updateAnchors': _dereq_(125)
+ };
+};
+
+/**
+ * Register handlers with the command stack
+ *
+ * @param {CommandStack} commandStack
+ */
+Modeling.prototype.registerHandlers = function(commandStack) {
+ forEach(this.getHandlers(), function(handler, id) {
+ commandStack.registerHandler(id, handler);
+ });
+};
+
+
+///// modeling helpers /////////////////////////////////////////
+
+
+Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
+
+ var context = {
+ shape: shape,
+ delta: delta,
+ newParent: newParent,
+ hints: hints || {}
+ };
+
+ this._commandStack.execute('shape.move', context);
+};
+
+
+Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
+
+ var context = {
+ shapes: shapes,
+ delta: delta,
+ newParent: newParent,
+ hints: hints || {}
+ };
+
+ this._commandStack.execute('shapes.move', context);
+};
+
+/**
+ * Update the anchors on the element with the given delta movement
+ * @param {djs.model.Element} element
+ * @param {Point} delta
+ */
+Modeling.prototype.updateAnchors = function(element, delta) {
+ var context = {
+ element: element,
+ delta: delta
+ };
+
+ this._commandStack.execute('element.updateAnchors', context);
+};
+
+Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
+
+ var context = {
+ connection: connection,
+ delta: delta,
+ newParent: newParent,
+ hints: hints || {}
+ };
+
+ this._commandStack.execute('connection.move', context);
+};
+
+
+Modeling.prototype.layoutConnection = function(connection, hints) {
+
+ var context = {
+ connection: connection,
+ hints: hints || {}
+ };
+
+ this._commandStack.execute('connection.layout', context);
+};
+
+
+Modeling.prototype.createConnection = function(source, target, connection, parent) {
+
+ connection = this._create('connection', connection);
+
+ var context = {
+ source: source,
+ target: target,
+ parent: parent,
+ connection: connection
+ };
+
+ this._commandStack.execute('connection.create', context);
+
+ return context.connection;
+};
+
+Modeling.prototype.createShape = function(shape, position, parent) {
+
+ shape = this._create('shape', shape);
+
+ var context = {
+ position: position,
+ parent: parent,
+ shape: shape
+ };
+
+ this._commandStack.execute('shape.create', context);
+
+ return context.shape;
+};
+
+
+Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
+
+ label = this._create('label', label);
+
+ var context = {
+ labelTarget: labelTarget,
+ position: position,
+ parent: parent,
+ shape: label
+ };
+
+ this._commandStack.execute('label.create', context);
+
+ return context.shape;
+};
+
+
+Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
+
+ shape = this._create('shape', shape);
+
+ var context = {
+ source: source,
+ position: position,
+ parent: parent,
+ shape: shape,
+ connection: connection,
+ connectionParent: connectionParent
+ };
+
+ this._commandStack.execute('shape.append', context);
+
+ return context.shape;
+};
+
+
+Modeling.prototype.removeElements = function(elements) {
+ var context = {
+ elements: elements
+ };
+
+ this._commandStack.execute('elements.delete', context);
+};
+
+
+Modeling.prototype.removeShape = function(shape) {
+ var context = {
+ shape: shape
+ };
+
+ this._commandStack.execute('shape.delete', context);
+};
+
+
+Modeling.prototype.removeConnection = function(connection) {
+ var context = {
+ connection: connection
+ };
+
+ this._commandStack.execute('connection.delete', context);
+};
+
+Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
+ var context = {
+ oldShape: oldShape,
+ newData: newShape,
+ options: options
+ };
+
+ this._commandStack.execute('shape.replace', context);
+
+ return context.newShape;
+};
+
+Modeling.prototype.resizeShape = function(shape, newBounds) {
+ var context = {
+ shape: shape,
+ newBounds: newBounds
+ };
+
+ this._commandStack.execute('shape.resize', context);
+};
+
+Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
+ var context = {
+ movingShapes: movingShapes,
+ resizingShapes: resizingShapes,
+ delta: delta,
+ direction: direction
+ };
+
+ this._commandStack.execute('spaceTool', context);
+};
+
+Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
+ var context = {
+ connection: connection,
+ newWaypoints: newWaypoints
+ };
+
+ this._commandStack.execute('connection.updateWaypoints', context);
+};
+
+Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
+ var context = {
+ connection: connection,
+ newSource: newSource,
+ dockingPoint: dockingPoint
+ };
+
+ this._commandStack.execute('connection.reconnectStart', context);
+};
+
+Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
+ var context = {
+ connection: connection,
+ newTarget: newTarget,
+ dockingPoint: dockingPoint
+ };
+
+ this._commandStack.execute('connection.reconnectEnd', context);
+};
+
+Modeling.prototype.connect = function(source, target, attrs) {
+ return this.createConnection(source, target, attrs || {}, source.parent);
+};
+
+
+Modeling.prototype._create = function(type, attrs) {
+ if (attrs instanceof model.Base) {
+ return attrs;
+ } else {
+ return this._elementFactory.create(type, attrs);
+ }
+};
+
+},{"109":109,"110":110,"111":111,"112":112,"113":113,"114":114,"115":115,"116":116,"117":117,"118":118,"119":119,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"168":168,"204":204}],109:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+
+/**
+ * A handler that implements reversible appending of shapes
+ * to a source shape.
+ *
+ * @param {canvas} Canvas
+ * @param {elementFactory} ElementFactory
+ * @param {modeling} Modeling
+ */
+function AppendShapeHandler(modeling) {
+ this._modeling = modeling;
+}
+
+inherits(AppendShapeHandler, _dereq_(120));
+
+
+AppendShapeHandler.$inject = [ 'modeling' ];
+
+module.exports = AppendShapeHandler;
+
+
+////// api /////////////////////////////////////////////
+
+/**
+ * Creates a new shape
+ *
+ * @param {Object} context
+ * @param {ElementDescriptor} context.shape the new shape
+ * @param {ElementDescriptor} context.source the source object
+ * @param {ElementDescriptor} context.parent the parent object
+ * @param {Point} context.position position of the new element
+ */
+AppendShapeHandler.prototype.preExecute = function(context) {
+
+ if (!context.source) {
+ throw new Error('source required');
+ }
+
+ var parent = context.parent || context.source.parent,
+ shape = this._modeling.createShape(context.shape, context.position, parent);
+
+ context.shape = shape;
+};
+
+AppendShapeHandler.prototype.postExecute = function(context) {
+ var parent = context.connectionParent || context.shape.parent;
+
+ // create connection
+ this._modeling.connect(context.source, context.shape, context.connection, parent);
+};
+},{"120":120,"195":195}],110:[function(_dereq_,module,exports){
+'use strict';
+
+
+function CreateConnectionHandler(canvas, layouter) {
+ this._canvas = canvas;
+ this._layouter = layouter;
+}
+
+CreateConnectionHandler.$inject = [ 'canvas', 'layouter' ];
+
+module.exports = CreateConnectionHandler;
+
+
+
+////// api /////////////////////////////////////////
+
+/**
+ * Appends a shape to a target shape
+ *
+ * @param {Object} context
+ * @param {djs.element.Base} context.source the source object
+ * @param {djs.element.Base} context.target the parent object
+ * @param {Point} context.position position of the new element
+ */
+CreateConnectionHandler.prototype.execute = function(context) {
+
+ var source = context.source,
+ target = context.target,
+ parent = context.parent;
+
+ if (!source || !target) {
+ throw new Error('source and target required');
+ }
+
+ if (!parent) {
+ throw new Error('parent required');
+ }
+
+ var connection = context.connection;
+
+ connection.source = source;
+ connection.target = target;
+
+ if (!connection.waypoints) {
+ connection.waypoints = this._layouter.layoutConnection(connection);
+ }
+
+ // add connection
+ this._canvas.addConnection(connection, parent);
+
+ return connection;
+};
+
+CreateConnectionHandler.prototype.revert = function(context) {
+ var connection = context.connection;
+
+ this._canvas.removeConnection(connection);
+
+ connection.source = null;
+ connection.target = null;
+};
+},{}],111:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var CreateShapeHandler = _dereq_(112);
+
+
+/**
+ * A handler that attaches a label to a given target shape.
+ *
+ * @param {canvas} Canvas
+ */
+function CreateLabelHandler(canvas) {
+ CreateShapeHandler.call(this, canvas);
+}
+
+inherits(CreateLabelHandler, CreateShapeHandler);
+
+CreateLabelHandler.$inject = [ 'canvas' ];
+
+module.exports = CreateLabelHandler;
+
+
+
+////// api /////////////////////////////////////////
+
+
+/**
+ * Appends a label to a target shape.
+ *
+ * @method CreateLabelHandler#execute
+ *
+ * @param {Object} context
+ * @param {ElementDescriptor} context.target the element the label is attached to
+ * @param {ElementDescriptor} context.parent the parent object
+ * @param {Point} context.position position of the new element
+ */
+
+/**
+ * Undo append by removing the shape
+ */
+CreateLabelHandler.prototype.revert = function(context) {
+ context.shape.labelTarget = null;
+ this._canvas.removeShape(context.shape);
+};
+
+
+////// helpers /////////////////////////////////////////
+
+CreateLabelHandler.prototype.getParent = function(context) {
+ return context.parent || context.labelTarget && context.labelTarget.parent;
+};
+
+CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
+ shape.labelTarget = context.labelTarget;
+ this._canvas.addShape(shape, parent, true);
+};
+},{"112":112,"195":195}],112:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+
+/**
+ * A handler that implements reversible addition of shapes.
+ *
+ * @param {canvas} Canvas
+ */
+function CreateShapeHandler(canvas) {
+ this._canvas = canvas;
+}
+
+CreateShapeHandler.$inject = [ 'canvas' ];
+
+module.exports = CreateShapeHandler;
+
+
+
+////// api /////////////////////////////////////////
+
+
+/**
+ * Appends a shape to a target shape
+ *
+ * @param {Object} context
+ * @param {djs.model.Base} context.parent the parent object
+ * @param {Point} context.position position of the new element
+ */
+CreateShapeHandler.prototype.execute = function(context) {
+
+ var parent = this.getParent(context);
+
+ var shape = context.shape;
+
+ this.setPosition(shape, context);
+
+ this.addElement(shape, parent, context);
+
+ return shape;
+};
+
+
+/**
+ * Undo append by removing the shape
+ */
+CreateShapeHandler.prototype.revert = function(context) {
+ this._canvas.removeShape(context.shape);
+};
+
+
+////// helpers /////////////////////////////////////////
+
+CreateShapeHandler.prototype.getParent = function(context) {
+ var parent = context.parent;
+
+ if (!parent) {
+ throw new Error('parent required');
+ }
+
+ return parent;
+};
+
+CreateShapeHandler.prototype.getPosition = function(context) {
+ if (!context.position) {
+ throw new Error('no position given');
+ }
+
+ return context.position;
+};
+
+CreateShapeHandler.prototype.addElement = function(shape, parent) {
+ this._canvas.addShape(shape, parent);
+};
+
+CreateShapeHandler.prototype.setPosition = function(shape, context) {
+ var position = this.getPosition(context);
+
+ // update to center position
+ // specified in create context
+ assign(shape, {
+ x: position.x - shape.width / 2,
+ y: position.y - shape.height / 2
+ });
+};
+},{"325":325}],113:[function(_dereq_,module,exports){
+'use strict';
+
+var Collections = _dereq_(175);
+
+
+/**
+ * A handler that implements reversible deletion of Connections.
+ *
+ */
+function DeleteConnectionHandler(canvas, modeling) {
+ this._canvas = canvas;
+ this._modeling = modeling;
+}
+
+DeleteConnectionHandler.$inject = [ 'canvas', 'modeling' ];
+
+module.exports = DeleteConnectionHandler;
+
+
+/**
+ * - Remove attached label
+ */
+DeleteConnectionHandler.prototype.preExecute = function(context) {
+
+ var connection = context.connection;
+
+ // Remove label
+ if (connection.label) {
+ this._modeling.removeShape(connection.label);
+ }
+};
+
+DeleteConnectionHandler.prototype.execute = function(context) {
+
+ var connection = context.connection,
+ parent = connection.parent;
+
+ context.parent = parent;
+ context.parentIndex = Collections.indexOf(parent.children, connection);
+
+ context.source = connection.source;
+ context.target = connection.target;
+
+ this._canvas.removeConnection(connection);
+
+ connection.source = null;
+ connection.target = null;
+ connection.label = null;
+};
+
+/**
+ * Command revert implementation.
+ */
+DeleteConnectionHandler.prototype.revert = function(context) {
+
+ var connection = context.connection,
+ parent = context.parent,
+ parentIndex = context.parentIndex;
+
+ connection.source = context.source;
+ connection.target = context.target;
+
+ // restore previous location in old parent
+ Collections.add(parent.children, connection, parentIndex);
+
+ this._canvas.addConnection(connection, parent);
+};
+
+},{"175":175}],114:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ inherits = _dereq_(195);
+
+
+function DeleteElementsHandler(modeling, elementRegistry) {
+ this._modeling = modeling;
+ this._elementRegistry = elementRegistry;
+}
+
+inherits(DeleteElementsHandler, _dereq_(120));
+
+DeleteElementsHandler.$inject = [ 'modeling', 'elementRegistry' ];
+
+module.exports = DeleteElementsHandler;
+
+
+DeleteElementsHandler.prototype.postExecute = function(context) {
+
+ var modeling = this._modeling,
+ elementRegistry = this._elementRegistry,
+ elements = context.elements;
+
+ forEach(elements, function(element) {
+
+ // element may have been removed with previous
+ // remove operations already (e.g. in case of nesting)
+ if (!elementRegistry.get(element.id)) {
+ return;
+ }
+
+ if (element.waypoints) {
+ modeling.removeConnection(element);
+ } else {
+ modeling.removeShape(element);
+ }
+ });
+};
+},{"120":120,"195":195,"204":204}],115:[function(_dereq_,module,exports){
+'use strict';
+
+var Collections = _dereq_(175);
+
+
+/**
+ * A handler that implements reversible deletion of shapes.
+ *
+ */
+function DeleteShapeHandler(canvas, modeling) {
+ this._canvas = canvas;
+ this._modeling = modeling;
+}
+
+DeleteShapeHandler.$inject = [ 'canvas', 'modeling' ];
+
+module.exports = DeleteShapeHandler;
+
+
+/**
+ * - Remove connections
+ * - Remove all direct children
+ */
+DeleteShapeHandler.prototype.preExecute = function(context) {
+
+ var shape = context.shape,
+ label = shape.label,
+ modeling = this._modeling;
+
+ // Clean up on removeShape(label)
+ if (shape.labelTarget) {
+ context.labelTarget = shape.labelTarget;
+ shape.labelTarget = null;
+ }
+
+ // Remove label
+ if (label) {
+ this._modeling.removeShape(label);
+ }
+
+ // remove connections
+ this._saveClear(shape.incoming, function(connection) {
+ // To make sure that the connection isn't removed twice
+ // For example if a container is removed
+ modeling.removeConnection(connection);
+ });
+
+ this._saveClear(shape.outgoing, function(connection) {
+ modeling.removeConnection(connection);
+ });
+
+
+ // remove children
+ this._saveClear(shape.children, function(e) {
+ modeling.removeShape(e);
+ });
+};
+
+
+DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
+
+ var e;
+
+ while (!!(e = collection[0])) {
+ remove(e);
+ }
+};
+
+
+/**
+ * Remove shape and remember the parent
+ */
+DeleteShapeHandler.prototype.execute = function(context) {
+
+ var shape = context.shape,
+ parent = shape.parent;
+
+ context.parent = parent;
+ context.parentIndex = Collections.indexOf(parent.children, shape);
+
+ shape.label = null;
+
+ this._canvas.removeShape(shape);
+};
+
+
+/**
+ * Command revert implementation
+ */
+DeleteShapeHandler.prototype.revert = function(context) {
+
+ var shape = context.shape,
+ parent = context.parent,
+ parentIndex = context.parentIndex,
+ labelTarget = context.labelTarget;
+
+ // restore previous location in old parent
+ Collections.add(parent.children, shape, parentIndex);
+
+ if (labelTarget) {
+ labelTarget.label = shape;
+ }
+
+ this._canvas.addShape(shape, parent);
+};
+
+},{"175":175}],116:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+
+/**
+ * A handler that implements reversible moving of shapes.
+ */
+function LayoutConnectionHandler(layouter, canvas) {
+ this._layouter = layouter;
+ this._canvas = canvas;
+}
+
+LayoutConnectionHandler.$inject = [ 'layouter', 'canvas' ];
+
+module.exports = LayoutConnectionHandler;
+
+LayoutConnectionHandler.prototype.execute = function(context) {
+
+ var connection = context.connection,
+ parent = connection.parent,
+ connectionSiblings = parent.children;
+
+ var oldIndex = connectionSiblings.indexOf(connection);
+
+ assign(context, {
+ oldWaypoints: connection.waypoints,
+ oldIndex: oldIndex
+ });
+
+ sendToFront(connection);
+
+ connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
+
+ return connection;
+};
+
+LayoutConnectionHandler.prototype.revert = function(context) {
+
+ var connection = context.connection,
+ parent = connection.parent,
+ connectionSiblings = parent.children,
+ currentIndex = connectionSiblings.indexOf(connection),
+ oldIndex = context.oldIndex;
+
+ connection.waypoints = context.oldWaypoints;
+
+ if (oldIndex !== currentIndex) {
+
+ // change position of connection in shape
+ connectionSiblings.splice(currentIndex, 1);
+ connectionSiblings.splice(oldIndex, 0, connection);
+ }
+
+ return connection;
+};
+
+// connections should have a higher z-order as there source and targets
+function sendToFront(connection) {
+
+ var connectionSiblings = connection.parent.children;
+
+ var connectionIdx = connectionSiblings.indexOf(connection),
+ sourceIdx = findIndex(connectionSiblings, connection.source),
+ targetIdx = findIndex(connectionSiblings, connection.target),
+
+ // ensure we do not send the connection back
+ // if it is already in front
+ insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
+
+ if (connectionIdx < insertIndex) {
+ connectionSiblings.splice(insertIndex, 0, connection); // add to new position
+ connectionSiblings.splice(connectionIdx, 1); // remove from old position
+ }
+
+ function findIndex(array, obj) {
+
+ var index = array.indexOf(obj);
+ if (index < 0 && obj) {
+ var parent = obj.parent;
+ index = findIndex(array, parent);
+ }
+ return index;
+ }
+
+ return insertIndex;
+}
+
+},{"325":325}],117:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var Collections = _dereq_(175);
+
+
+/**
+ * A handler that implements reversible moving of connections.
+ *
+ * The handler differs from the layout connection handler in a sense
+ * that it preserves the connection layout.
+ */
+function MoveConnectionHandler() { }
+
+module.exports = MoveConnectionHandler;
+
+
+MoveConnectionHandler.prototype.execute = function(context) {
+
+ var updateAnchors = (context.hints.updateAnchors !== false);
+
+ var connection = context.connection,
+ delta = context.delta;
+
+ var newParent = this.getNewParent(connection, context),
+ oldParent = connection.parent;
+
+ // save old position + parent in context
+ context.oldParent = oldParent;
+ context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
+
+ // update waypoint positions
+ forEach(connection.waypoints, function(p) {
+ p.x += delta.x;
+ p.y += delta.y;
+
+ if (updateAnchors && p.original) {
+ p.original.x += delta.x;
+ p.original.y += delta.y;
+ }
+ });
+
+ // update parent
+ connection.parent = newParent;
+
+ return connection;
+};
+
+MoveConnectionHandler.prototype.revert = function(context) {
+
+ var updateAnchors = (context.hints.updateAnchors !== false);
+
+ var connection = context.connection,
+ oldParent = context.oldParent,
+ oldParentIndex = context.oldParentIndex,
+ delta = context.delta;
+
+ // restore previous location in old parent
+ Collections.add(oldParent.children, connection, oldParentIndex);
+
+ // restore parent
+ connection.parent = oldParent;
+
+ // revert to old waypoint positions
+ forEach(connection.waypoints, function(p) {
+ p.x -= delta.x;
+ p.y -= delta.y;
+
+ if (updateAnchors && p.original) {
+ p.original.x -= delta.x;
+ p.original.y -= delta.y;
+ }
+ });
+
+ return connection;
+};
+
+
+MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
+ return context.newParent || connection.parent;
+};
+
+},{"175":175,"204":204}],118:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+var MoveHelper = _dereq_(127),
+ Collections = _dereq_(175);
+
+
+/**
+ * A handler that implements reversible moving of shapes.
+ */
+function MoveShapeHandler(modeling) {
+ this._modeling = modeling;
+
+ this._helper = new MoveHelper(modeling);
+}
+
+MoveShapeHandler.$inject = [ 'modeling' ];
+
+module.exports = MoveShapeHandler;
+
+
+MoveShapeHandler.prototype.execute = function(context) {
+
+ var shape = context.shape,
+ delta = context.delta,
+ newParent = this.getNewParent(context),
+ oldParent = shape.parent;
+
+ // save old parent in context
+ context.oldParent = oldParent;
+ context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
+
+ // update shape parent + position
+ assign(shape, {
+ parent: newParent,
+ x: shape.x + delta.x,
+ y: shape.y + delta.y
+ });
+
+ return shape;
+};
+
+MoveShapeHandler.prototype.postExecute = function(context) {
+
+ var shape = context.shape,
+ delta = context.delta;
+
+ var modeling = this._modeling;
+
+ if (context.hints.updateAnchors !== false) {
+ modeling.updateAnchors(shape, delta);
+ }
+
+ if (context.hints.layout !== false) {
+ forEach(shape.incoming, function(c) {
+ modeling.layoutConnection(c, { endChanged: true });
+ });
+
+ forEach(shape.outgoing, function(c) {
+ modeling.layoutConnection(c, { startChanged: true });
+ });
+ }
+
+ if (context.hints.recurse !== false) {
+ this.moveChildren(context);
+ }
+};
+
+MoveShapeHandler.prototype.revert = function(context) {
+
+ var shape = context.shape,
+ oldParent = context.oldParent,
+ oldParentIndex = context.oldParentIndex,
+ delta = context.delta;
+
+ // restore previous location in old parent
+ Collections.add(oldParent.children, shape, oldParentIndex);
+
+ // revert to old position and parent
+ assign(shape, {
+ parent: oldParent,
+ x: shape.x - delta.x,
+ y: shape.y - delta.y
+ });
+
+ return shape;
+};
+
+MoveShapeHandler.prototype.moveChildren = function(context) {
+
+ var delta = context.delta,
+ shape = context.shape;
+
+ this._helper.moveRecursive(shape.children, delta, null);
+};
+
+MoveShapeHandler.prototype.getNewParent = function(context) {
+ return context.newParent || context.shape.parent;
+};
+},{"127":127,"175":175,"204":204,"325":325}],119:[function(_dereq_,module,exports){
+'use strict';
+
+var MoveHelper = _dereq_(127);
+
+
+/**
+ * A handler that implements reversible moving of shapes.
+ */
+function MoveShapesHandler(modeling) {
+ this._helper = new MoveHelper(modeling);
+}
+
+MoveShapesHandler.$inject = [ 'modeling' ];
+
+module.exports = MoveShapesHandler;
+
+MoveShapesHandler.prototype.preExecute = function(context) {
+ context.closure = this._helper.getClosure(context.shapes);
+};
+
+MoveShapesHandler.prototype.postExecute = function(context) {
+ this._helper.moveClosure(context.closure, context.delta, context.newParent);
+};
+
+
+MoveShapesHandler.prototype.execute = function(context) { };
+MoveShapesHandler.prototype.revert = function(context) { };
+
+},{"127":127}],120:[function(_dereq_,module,exports){
+'use strict';
+
+function NoopHandler() {}
+
+module.exports = NoopHandler;
+
+NoopHandler.prototype.execute = function() {};
+NoopHandler.prototype.revert = function() {};
+},{}],121:[function(_dereq_,module,exports){
+'use strict';
+
+
+function ReconnectConnectionHandler(layouter) { }
+
+ReconnectConnectionHandler.$inject = [ 'layouter' ];
+
+module.exports = ReconnectConnectionHandler;
+
+ReconnectConnectionHandler.prototype.execute = function(context) {
+
+ var newSource = context.newSource,
+ newTarget = context.newTarget,
+ connection = context.connection;
+
+ if (!newSource && !newTarget) {
+ throw new Error('newSource or newTarget are required');
+ }
+
+ if (newSource && newTarget) {
+ throw new Error('must specify either newSource or newTarget');
+ }
+
+ if (newSource) {
+ context.oldSource = connection.source;
+ connection.source = newSource;
+
+ context.oldDockingPoint = connection.waypoints[0];
+ connection.waypoints[0] = context.dockingPoint;
+ }
+
+ if (newTarget) {
+ context.oldTarget = connection.target;
+ connection.target = newTarget;
+
+ context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
+ connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
+ }
+
+ return connection;
+};
+
+ReconnectConnectionHandler.prototype.revert = function(context) {
+
+ var newSource = context.newSource,
+ newTarget = context.newTarget,
+ connection = context.connection;
+
+ if (newSource) {
+ connection.source = context.oldSource;
+ connection.waypoints[0] = context.oldDockingPoint;
+ }
+
+ if (newTarget) {
+ connection.target = context.oldTarget;
+ connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
+ }
+
+ return connection;
+};
+},{}],122:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+
+/**
+ * A handler that implements reversible replacing of shapes.
+ * Internally the old shape will be removed and the new shape will be added.
+ *
+ *
+ * @class
+ * @constructor
+ *
+ * @param {canvas} Canvas
+ */
+function ReplaceShapeHandler(modeling, rules) {
+ this._modeling = modeling;
+ this._rules = rules;
+}
+
+ReplaceShapeHandler.$inject = [ 'modeling', 'rules' ];
+
+module.exports = ReplaceShapeHandler;
+
+
+
+////// api /////////////////////////////////////////
+
+
+/**
+ * Replaces a shape with an replacement Element.
+ *
+ * The newData object should contain type, x, y.
+ *
+ * If possible also the incoming/outgoing connection
+ * will be restored.
+ *
+ * @param {Object} context
+ */
+ ReplaceShapeHandler.prototype.preExecute = function(context) {
+
+ var modeling = this._modeling,
+ rules = this._rules;
+
+ var oldShape = context.oldShape,
+ newData = context.newData,
+ newShape;
+
+
+ // (1) place a new shape at the given position
+
+ var position = {
+ x: newData.x,
+ y: newData.y
+ };
+
+ newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
+
+
+ // (2) reconnect connections to the new shape (where allowed)
+
+ var incoming = oldShape.incoming.slice(),
+ outgoing = oldShape.outgoing.slice();
+
+ forEach(incoming, function(connection) {
+ var waypoints = connection.waypoints,
+ docking = waypoints[waypoints.length - 1],
+ allowed = rules.allowed('connection.reconnectEnd', {
+ source: connection.source,
+ target: newShape,
+ connection: connection
+ });
+
+ if (allowed) {
+ modeling.reconnectEnd(connection, newShape, docking);
+ }
+ });
+
+ forEach(outgoing, function(connection) {
+ var waypoints = connection.waypoints,
+ docking = waypoints[0],
+ allowed = rules.allowed('connection.reconnectStart', {
+ source: newShape,
+ target: connection.target,
+ connection: connection
+ });
+
+ if (allowed) {
+ modeling.reconnectStart(connection, newShape, docking);
+ }
+ });
+};
+
+
+ReplaceShapeHandler.prototype.postExecute = function(context) {
+ var modeling = this._modeling;
+
+ var oldShape = context.oldShape;
+
+ modeling.removeShape(oldShape);
+};
+
+
+ReplaceShapeHandler.prototype.execute = function(context) { };
+
+ReplaceShapeHandler.prototype.revert = function(context) {};
+
+},{"204":204}],123:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ forEach = _dereq_(204);
+
+
+/**
+ * A handler that implements reversible resizing of shapes.
+ *
+ */
+function ResizeShapeHandler(modeling) {
+ this._modeling = modeling;
+}
+
+ResizeShapeHandler.$inject = [ 'modeling' ];
+
+module.exports = ResizeShapeHandler;
+
+/**
+ * {
+ * shape: {....}
+ * newBounds: {
+ * width: 20,
+ * height: 40,
+ * x: 5,
+ * y: 10
+ * }
+ *
+ * }
+ */
+ResizeShapeHandler.prototype.execute = function(context) {
+
+ var shape = context.shape,
+ newBounds = context.newBounds;
+
+ if (newBounds.x === undefined || newBounds.y === undefined ||
+ newBounds.width === undefined || newBounds.height === undefined) {
+ throw new Error('newBounds must have {x, y, width, height} properties');
+ }
+
+ if (newBounds.width < 10 || newBounds.height < 10) {
+ throw new Error('width and height cannot be less than 10px');
+ }
+
+ // save old bbox in context
+ context.oldBounds = {
+ width: shape.width,
+ height: shape.height,
+ x: shape.x,
+ y: shape.y
+ };
+
+ // update shape
+ assign(shape, {
+ width: newBounds.width,
+ height: newBounds.height,
+ x: newBounds.x,
+ y: newBounds.y
+ });
+
+ return shape;
+};
+
+ResizeShapeHandler.prototype.postExecute = function(context) {
+
+ var shape = context.shape;
+
+ var modeling = this._modeling;
+
+ forEach(shape.incoming, function(c) {
+ modeling.layoutConnection(c, { endChanged: true });
+ });
+
+ forEach(shape.outgoing, function(c) {
+ modeling.layoutConnection(c, { startChanged: true });
+ });
+
+};
+
+ResizeShapeHandler.prototype.revert = function(context) {
+
+ var shape = context.shape,
+ oldBounds = context.oldBounds;
+
+ // restore previous bbox
+ assign(shape, {
+ width: oldBounds.width,
+ height: oldBounds.height,
+ x: oldBounds.x,
+ y: oldBounds.y
+ });
+
+ return shape;
+};
+
+},{"204":204,"325":325}],124:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var SpaceUtil = _dereq_(157);
+
+/**
+ * A handler that implements reversible creating and removing of space.
+ *
+ * It executes in two phases:
+ *
+ * (1) resize all affected resizeShapes
+ * (2) move all affected moveShapes
+ */
+function SpaceToolHandler(modeling) {
+ this._modeling = modeling;
+}
+
+SpaceToolHandler.$inject = [ 'modeling' ];
+
+module.exports = SpaceToolHandler;
+
+
+SpaceToolHandler.prototype.preExecute = function(context) {
+
+ // resize
+ var modeling = this._modeling,
+ resizingShapes = context.resizingShapes,
+ delta = context.delta,
+ direction = context.direction;
+
+ forEach(resizingShapes, function(shape) {
+ var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
+
+ modeling.resizeShape(shape, newBounds);
+ });
+};
+
+SpaceToolHandler.prototype.postExecute = function(context) {
+ // move
+ var modeling = this._modeling,
+ movingShapes = context.movingShapes,
+ delta = context.delta;
+
+ modeling.moveShapes(movingShapes, delta);
+};
+
+SpaceToolHandler.prototype.execute = function(context) {};
+SpaceToolHandler.prototype.revert = function(context) {};
+
+},{"157":157,"204":204}],125:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ assign = _dereq_(325);
+
+
+/**
+ * Update the anchors of
+ */
+function UpdateAnchorsHandler() { }
+
+module.exports = UpdateAnchorsHandler;
+
+
+UpdateAnchorsHandler.prototype.execute = function(context) {
+
+ // update connection anchors
+ return this.updateAnchors(context.element, context.delta);
+};
+
+UpdateAnchorsHandler.prototype.revert = function(context) {
+
+ var delta = context.delta,
+ revertedDelta = { x: -1 * delta.x, y: -1 * delta.y };
+
+ // revert update connection anchors
+ return this.updateAnchors(context.element, revertedDelta);
+};
+
+/**
+ * Update anchors on the element according to the delta movement.
+ *
+ * @param {djs.model.Element} element
+ * @param {Point} delta
+ *
+ * @return Array<djs.model.Connection>
+ */
+UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
+
+ function add(point, delta) {
+ return {
+ x: point.x + delta.x,
+ y: point.y + delta.y
+ };
+ }
+
+ function updateAnchor(waypoint) {
+ var original = waypoint.original;
+
+ waypoint.original = assign(original || {}, add(original || waypoint, delta));
+ }
+
+ var changed = [];
+
+ forEach(element.incoming, function(c) {
+ var waypoints = c.waypoints;
+ updateAnchor(waypoints[waypoints.length - 1]);
+
+ changed.push(c);
+ });
+
+ forEach(element.outgoing, function(c) {
+ var waypoints = c.waypoints;
+ updateAnchor(waypoints[0]);
+
+ changed.push(c);
+ });
+
+ return changed;
+};
+},{"204":204,"325":325}],126:[function(_dereq_,module,exports){
+'use strict';
+
+function UpdateWaypointsHandler() { }
+
+module.exports = UpdateWaypointsHandler;
+
+UpdateWaypointsHandler.prototype.execute = function(context) {
+
+ var connection = context.connection,
+ newWaypoints = context.newWaypoints;
+
+ context.oldWaypoints = connection.waypoints;
+
+ connection.waypoints = newWaypoints;
+
+ return connection;
+};
+
+UpdateWaypointsHandler.prototype.revert = function(context) {
+
+ var connection = context.connection,
+ oldWaypoints = context.oldWaypoints;
+
+ connection.waypoints = oldWaypoints;
+
+ return connection;
+};
+},{}],127:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var Elements = _dereq_(177);
+
+
+/**
+ * A helper that is able to carry out serialized move operations on multiple elements.
+ *
+ * @param {Modeling} modeling
+ */
+function MoveHelper(modeling) {
+ this._modeling = modeling;
+}
+
+module.exports = MoveHelper;
+
+/**
+ * Move the specified elements and all children by the given delta.
+ *
+ * This moves all enclosed connections, too and layouts all affected
+ * external connections.
+ *
+ * @param {Array<djs.model.Base>} elements
+ * @param {Point} delta
+ * @param {djs.model.Base} newParent applied to the first level of shapes
+ *
+ * @return {Array<djs.model.Base>} list of touched elements
+ */
+MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
+ return this.moveClosure(this.getClosure(elements), delta, newParent);
+};
+
+/**
+ * Move the given closure of elmements
+ */
+MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
+
+ var modeling = this._modeling;
+
+ var allShapes = closure.allShapes,
+ allConnections = closure.allConnections,
+ enclosedConnections = closure.enclosedConnections,
+ topLevel = closure.topLevel;
+
+ // move all shapes
+ forEach(allShapes, function(s) {
+
+ modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
+ recurse: false,
+ layout: false
+ });
+ });
+
+ // move all child connections / layout external connections
+ forEach(allConnections, function(c) {
+
+ var startMoved = !!allShapes[c.source.id],
+ endMoved = !!allShapes[c.target.id];
+
+ if (enclosedConnections[c.id] &&
+ startMoved && endMoved) {
+ modeling.moveConnection(c, delta, topLevel[c.id] && newParent, { updateAnchors: false });
+ } else {
+ modeling.layoutConnection(c, {
+ startChanged: startMoved,
+ endChanged: endMoved
+ });
+ }
+ });
+};
+
+/**
+ * Returns the closure for the selected elements
+ *
+ * @param {Array<djs.model.Base>} elements
+ * @return {Object} closure
+ */
+MoveHelper.prototype.getClosure = function(elements) {
+ return Elements.getClosure(elements);
+};
+
+},{"177":177,"204":204}],128:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(77),
+ _dereq_(93),
+ _dereq_(147)
+ ],
+ __init__: [ 'modeling' ],
+ modeling: [ 'type', _dereq_(108) ],
+ layouter: [ 'type', _dereq_(164) ]
+};
+
+},{"108":108,"147":147,"164":164,"77":77,"93":93}],129:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ filter = _dereq_(202),
+ groupBy = _dereq_(205);
+
+
+var LOW_PRIORITY = 500,
+ HIGH_PRIORITY = 1500;
+
+var getOriginalEvent = _dereq_(178).getOriginal;
+
+var round = Math.round;
+
+
+/**
+ * Return a filtered list of elements that do not contain
+ * those nested into others.
+ *
+ * @param {Array<djs.model.Base>} elements
+ *
+ * @return {Array<djs.model.Base>} filtered
+ */
+function removeNested(elements) {
+
+ var ids = groupBy(elements, 'id');
+
+ return filter(elements, function(element) {
+ while (!!(element = element.parent)) {
+ if (ids[element.id]) {
+ return false;
+ }
+ }
+
+ return true;
+ });
+}
+
+
+
+/**
+ * A plugin that makes shapes draggable / droppable.
+ *
+ * @param {EventBus} eventBus
+ * @param {Dragging} dragging
+ * @param {Modeling} modeling
+ * @param {Selection} selection
+ * @param {Rules} rules
+ */
+function MoveEvents(eventBus, dragging, modeling, selection, rules) {
+
+ // rules
+
+ function canMove(shapes, delta, target) {
+
+ return rules.allowed('shapes.move', {
+ shapes: shapes,
+ delta: delta,
+ newParent: target
+ });
+ }
+
+
+ // move events
+
+ // assign a high priority to this handler to setup the environment
+ // others may hook up later, e.g. at default priority and modify
+ // the move environment
+ //
+ eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
+
+ var context = event.context,
+ shape = event.shape,
+ shapes = selection.get().slice();
+
+ // move only single shape shape if the dragged element
+ // is not part of the current selection
+ if (shapes.indexOf(shape) === -1) {
+ shapes = [ shape ];
+ }
+
+ // ensure we remove nested elements in the collection
+ shapes = removeNested(shapes);
+
+ // attach shapes to drag context
+ assign(context, {
+ shapes: shapes,
+ shape: shape
+ });
+
+ // check if we can move the elements
+ if (!canMove(shapes)) {
+ // suppress move operation
+ event.stopPropagation();
+
+ return false;
+ }
+ });
+
+ // assign a low priority to this handler
+ // to let others modify the move event before we update
+ // the context
+ //
+ eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
+
+ var context = event.context,
+ shapes = context.shapes,
+ hover = event.hover,
+ delta = { x: event.dx, y: event.dy },
+ canExecute;
+
+ // check if we can move the elements
+ canExecute = canMove(shapes, delta, hover);
+
+ context.delta = delta;
+ context.canExecute = canExecute;
+
+ // simply ignore move over
+ if (canExecute === null) {
+ context.target = null;
+
+ return;
+ }
+
+ context.target = hover;
+ });
+
+ eventBus.on('shape.move.end', function(event) {
+
+ var context = event.context;
+
+ var delta = context.delta,
+ canExecute = context.canExecute;
+
+ if (!canExecute) {
+ return false;
+ }
+
+ // ensure we have actual pixel values deltas
+ // (important when zoom level was > 1 during move)
+ delta.x = round(delta.x);
+ delta.y = round(delta.y);
+
+ modeling.moveShapes(context.shapes, delta, context.target);
+ });
+
+
+ // move activation
+
+ eventBus.on('element.mousedown', function(event) {
+
+ var originalEvent = getOriginalEvent(event);
+
+ if (!originalEvent) {
+ throw new Error('must supply DOM mousedown event');
+ }
+
+ start(originalEvent, event.element);
+ });
+
+
+ function start(event, element, activate) {
+
+ // do not move connections or the root element
+ if (element.waypoints || !element.parent) {
+ return;
+ }
+
+ dragging.activate(event, 'shape.move', {
+ cursor: 'grabbing',
+ autoActivate: activate,
+ data: {
+ shape: element,
+ context: {}
+ }
+ });
+ }
+
+ // API
+
+ this.start = start;
+}
+
+MoveEvents.$inject = [ 'eventBus', 'dragging', 'modeling', 'selection', 'rules' ];
+
+module.exports = MoveEvents;
+
+},{"178":178,"202":202,"205":205,"325":325}],130:[function(_dereq_,module,exports){
+'use strict';
+
+var flatten = _dereq_(196),
+ forEach = _dereq_(204),
+ filter = _dereq_(202),
+ find = _dereq_(203),
+ map = _dereq_(207);
+
+var Elements = _dereq_(177);
+
+var LOW_PRIORITY = 500;
+
+var MARKER_DRAGGING = 'djs-dragging',
+ MARKER_OK = 'drop-ok',
+ MARKER_NOT_OK = 'drop-not-ok';
+
+
+/**
+ * A plugin that makes shapes draggable / droppable.
+ *
+ * @param {EventBus} eventBus
+ * @param {ElementRegistry} elementRegistry
+ * @param {Canvas} canvas
+ * @param {Styles} styles
+ */
+function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
+
+ function getGfx(e) {
+ return elementRegistry.getGraphics(e);
+ }
+
+ function getVisualDragShapes(shapes) {
+
+ var elements = Elements.selfAndDirectChildren(shapes, true);
+ var filteredElements = removeEdges(elements);
+
+ return filteredElements;
+ }
+
+ function getAllDraggedElements(shapes) {
+ var allShapes = Elements.selfAndAllChildren(shapes, true);
+
+ var allConnections = map(allShapes, function(shape) {
+ return (shape.incoming || []).concat(shape.outgoing || []);
+ });
+
+ return flatten(allShapes.concat(allConnections), true);
+ }
+
+ function addDragger(shape, dragGroup) {
+ var gfx = getGfx(shape);
+ var dragger = gfx.clone();
+ var bbox = gfx.getBBox();
+
+ dragger.attr(styles.cls('djs-dragger', [], {
+ x: bbox.x,
+ y: bbox.y
+ }));
+
+ dragGroup.add(dragger);
+ }
+
+ // assign a low priority to this handler
+ // to let others modify the move context before
+ // we draw things
+ //
+ eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
+
+ var context = event.context,
+ dragShapes = context.shapes;
+
+ var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));
+
+ var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
+
+ visuallyDraggedShapes.forEach(function(shape) {
+ addDragger(shape, dragGroup);
+ });
+
+
+ // cache all dragged elements / gfx
+ // so that we can quickly undo their state changes later
+ var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
+
+ // add dragging marker
+ forEach(allDraggedElements, function(e) {
+ canvas.addMarker(e, MARKER_DRAGGING);
+ });
+
+ context.dragGroup = dragGroup;
+ });
+
+ // assign a low priority to this handler
+ // to let others modify the move context before
+ // we draw things
+ //
+ eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
+
+ var context = event.context,
+ dragGroup = context.dragGroup,
+ target = context.target;
+
+ if (target) {
+ canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
+ }
+
+ dragGroup.translate(event.dx, event.dy);
+ });
+
+ eventBus.on([ 'shape.move.out', 'shape.move.cleanup' ], function(event) {
+ var context = event.context;
+
+ if (context.target) {
+ canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
+ }
+ });
+
+ eventBus.on('shape.move.cleanup', function(event) {
+
+ var context = event.context,
+ allDraggedElements = context.allDraggedElements,
+ dragGroup = context.dragGroup;
+
+
+ // remove dragging marker
+ forEach(allDraggedElements, function(e) {
+ canvas.removeMarker(e, MARKER_DRAGGING);
+ });
+
+ if (dragGroup) {
+ dragGroup.remove();
+ }
+ });
+}
+
+// returns elements minus all connections
+// where source or target is not elements
+function removeEdges(elements) {
+
+ var filteredElements = filter(elements, function(element) {
+
+ if (!element.waypoints) { // shapes
+ return true;
+ } else { // connections
+ var srcFound = find(elements, element.source);
+ var targetFound = find(elements, element.target);
+
+ return srcFound && targetFound;
+ }
+ });
+
+ return filteredElements;
+}
+
+MoveVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];
+
+module.exports = MoveVisuals;
+
+},{"177":177,"196":196,"202":202,"203":203,"204":204,"207":207}],131:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(103),
+ _dereq_(151),
+ _dereq_(133),
+ _dereq_(147),
+ _dereq_(101)
+ ],
+ __init__: [ 'move', 'moveVisuals' ],
+ move: [ 'type', _dereq_(129) ],
+ moveVisuals: [ 'type', _dereq_(130) ]
+};
+
+},{"101":101,"103":103,"129":129,"130":130,"133":133,"147":147,"151":151}],132:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(188);
+var getBBox = _dereq_(177).getBBox;
+
+
+/**
+ * @class
+ *
+ * A plugin that adds an outline to shapes and connections that may be activated and styled
+ * via CSS classes.
+ *
+ * @param {EventBus} events the event bus
+ */
+function Outline(eventBus, styles, elementRegistry) {
+
+ var OUTLINE_OFFSET = 6;
+
+ var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
+
+ function createOutline(gfx, bounds) {
+ return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
+ }
+
+ function updateShapeOutline(outline, bounds) {
+
+ outline.attr({
+ x: -OUTLINE_OFFSET,
+ y: -OUTLINE_OFFSET,
+ width: bounds.width + OUTLINE_OFFSET * 2,
+ height: bounds.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ function updateConnectionOutline(outline, connection) {
+
+ var bbox = getBBox(connection);
+
+ outline.attr({
+ x: bbox.x - OUTLINE_OFFSET,
+ y: bbox.y - OUTLINE_OFFSET,
+ width: bbox.width + OUTLINE_OFFSET * 2,
+ height: bbox.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateShapeOutline(outline, element);
+ });
+
+ eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateConnectionOutline(outline, element);
+ });
+
+
+}
+
+
+Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
+
+module.exports = Outline;
+
+},{"177":177,"188":188}],133:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'outline' ],
+ outline: [ 'type', _dereq_(132) ]
+};
+},{"132":132}],134:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ isString = _dereq_(322),
+ isObject = _dereq_(320),
+ assign = _dereq_(325),
+ forEach = _dereq_(204),
+ filter = _dereq_(202),
+ debounce = _dereq_(214);
+
+var domify = _dereq_(343),
+ domClasses = _dereq_(339),
+ domRemove = _dereq_(347);
+
+var getBBox = _dereq_(177).getBBox;
+
+// document wide unique overlay ids
+var ids = new (_dereq_(181))('ov');
+
+
+function createRoot(parent) {
+ var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
+ parent.insertBefore(root, parent.firstChild);
+
+ return root;
+}
+
+
+function setPosition(el, x, y) {
+ assign(el.style, { left: x + 'px', top: y + 'px' });
+}
+
+function setVisible(el, visible) {
+ el.style.display = visible === false ? 'none' : '';
+}
+
+/**
+ * A service that allows users to attach overlays to diagram elements.
+ *
+ * The overlay service will take care of overlay positioning during updates.
+ *
+ * @example
+ *
+ * // add a pink badge on the top left of the shape
+ * overlays.add(someShape, {
+ * position: {
+ * top: -5,
+ * left: -5
+ * },
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add via shape id
+ *
+ * overlays.add('some-element-id', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add with optional type
+ *
+ * overlays.add(someShape, 'badge', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ *
+ * // remove an overlay
+ *
+ * var id = overlays.add(...);
+ * overlays.remove(id);
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementRegistry} elementRegistry
+ */
+function Overlays(config, eventBus, canvas, elementRegistry) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+ this._elementRegistry = elementRegistry;
+
+ this._ids = ids;
+
+ this._overlayDefaults = {
+ show: {
+ minZoom: 0.7,
+ maxZoom: 5.0
+ }
+ };
+
+ /**
+ * Mapping overlayId -> overlay
+ */
+ this._overlays = {};
+
+ /**
+ * Mapping elementId -> overlay container
+ */
+ this._overlayContainers = {};
+
+ // root html element for all overlays
+ this._overlayRoot = createRoot(canvas.getContainer());
+
+ this._init(config);
+}
+
+
+Overlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];
+
+module.exports = Overlays;
+
+
+/**
+ * Returns the overlay with the specified id or a list of overlays
+ * for an element with a given type.
+ *
+ * @example
+ *
+ * // return the single overlay with the given id
+ * overlays.get('some-id');
+ *
+ * // return all overlays for the shape
+ * overlays.get({ element: someShape });
+ *
+ * // return all overlays on shape with type 'badge'
+ * overlays.get({ element: someShape, type: 'badge' });
+ *
+ * // shape can also be specified as id
+ * overlays.get({ element: 'element-id', type: 'badge' });
+ *
+ *
+ * @param {Object} search
+ * @param {String} [search.id]
+ * @param {String|djs.model.Base} [search.element]
+ * @param {String} [search.type]
+ *
+ * @return {Object|Array<Object>} the overlay(s)
+ */
+Overlays.prototype.get = function(search) {
+
+ if (isString(search)) {
+ search = { id: search };
+ }
+
+ if (search.element) {
+ var container = this._getOverlayContainer(search.element, true);
+
+ // return a list of overlays when searching by element (+type)
+ if (container) {
+ return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();
+ } else {
+ return [];
+ }
+ } else
+ if (search.type) {
+ return filter(this._overlays, { type: search.type });
+ } else {
+ // return single element when searching by id
+ return search.id ? this._overlays[search.id] : null;
+ }
+};
+
+/**
+ * Adds a HTML overlay to an element.
+ *
+ * @param {String|djs.model.Base} element attach overlay to this shape
+ * @param {String} [type] optional type to assign to the overlay
+ * @param {Object} overlay the overlay configuration
+ *
+ * @param {String|DOMElement} overlay.html html element to use as an overlay
+ * @param {Object} [overlay.show] show configuration
+ * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay
+ * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay
+ * @param {Object} overlay.position where to attach the overlay
+ * @param {Number} [overlay.position.left] relative to element bbox left attachment
+ * @param {Number} [overlay.position.top] relative to element bbox top attachment
+ * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment
+ * @param {Number} [overlay.position.right] relative to element bbox right attachment
+ *
+ * @return {String} id that may be used to reference the overlay for update or removal
+ */
+Overlays.prototype.add = function(element, type, overlay) {
+
+ if (isObject(type)) {
+ overlay = type;
+ type = null;
+ }
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ if (!overlay.position) {
+ throw new Error('must specifiy overlay position');
+ }
+
+ if (!overlay.html) {
+ throw new Error('must specifiy overlay html');
+ }
+
+ if (!element) {
+ throw new Error('invalid element specified');
+ }
+
+ var id = this._ids.next();
+
+ overlay = assign({}, this._overlayDefaults, overlay, {
+ id: id,
+ type: type,
+ element: element,
+ html: overlay.html
+ });
+
+ this._addOverlay(overlay);
+
+ return id;
+};
+
+
+/**
+ * Remove an overlay with the given id or all overlays matching the given filter.
+ *
+ * @see Overlays#get for filter options.
+ *
+ * @param {String} [id]
+ * @param {Object} [filter]
+ */
+Overlays.prototype.remove = function(filter) {
+
+ var overlays = this.get(filter) || [];
+
+ if (!isArray(overlays)) {
+ overlays = [ overlays ];
+ }
+
+ var self = this;
+
+ forEach(overlays, function(overlay) {
+
+ var container = self._getOverlayContainer(overlay.element, true);
+
+ if (overlay) {
+ domRemove(overlay.html);
+ domRemove(overlay.htmlContainer);
+
+ delete overlay.htmlContainer;
+ delete overlay.element;
+
+ delete self._overlays[overlay.id];
+ }
+
+ if (container) {
+ var idx = container.overlays.indexOf(overlay);
+ if (idx !== -1) {
+ container.overlays.splice(idx, 1);
+ }
+ }
+ });
+
+};
+
+
+Overlays.prototype.show = function() {
+ setVisible(this._overlayRoot);
+};
+
+
+Overlays.prototype.hide = function() {
+ setVisible(this._overlayRoot, false);
+};
+
+
+Overlays.prototype._updateOverlayContainer = function(container) {
+ var element = container.element,
+ html = container.html;
+
+ // update container left,top according to the elements x,y coordinates
+ // this ensures we can attach child elements relative to this container
+
+ var x = element.x,
+ y = element.y;
+
+ if (element.waypoints) {
+ var bbox = getBBox(element);
+ x = bbox.x;
+ y = bbox.y;
+ }
+
+ setPosition(html, x, y);
+};
+
+
+Overlays.prototype._updateOverlay = function(overlay) {
+
+ var position = overlay.position,
+ htmlContainer = overlay.htmlContainer,
+ element = overlay.element;
+
+ // update overlay html relative to shape because
+ // it is already positioned on the element
+
+ // update relative
+ var left = position.left,
+ top = position.top;
+
+ if (position.right !== undefined) {
+
+ var width;
+
+ if (element.waypoints) {
+ width = getBBox(element).width;
+ } else {
+ width = element.width;
+ }
+
+ left = position.right * -1 + width;
+ }
+
+ if (position.bottom !== undefined) {
+
+ var height;
+
+ if (element.waypoints) {
+ height = getBBox(element).height;
+ } else {
+ height = element.height;
+ }
+
+ top = position.bottom * -1 + height;
+ }
+
+ setPosition(htmlContainer, left || 0, top || 0);
+};
+
+
+Overlays.prototype._createOverlayContainer = function(element) {
+ var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
+
+ this._overlayRoot.appendChild(html);
+
+ var container = {
+ html: html,
+ element: element,
+ overlays: []
+ };
+
+ this._updateOverlayContainer(container);
+
+ return container;
+};
+
+
+Overlays.prototype._updateRoot = function(viewbox) {
+ var a = viewbox.scale || 1;
+ var d = viewbox.scale || 1;
+
+ var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
+
+ this._overlayRoot.style.transform = matrix;
+ this._overlayRoot.style['-ms-transform'] = matrix;
+};
+
+
+Overlays.prototype._getOverlayContainer = function(element, raw) {
+ var id = (element && element.id) || element;
+
+ var container = this._overlayContainers[id];
+ if (!container && !raw) {
+ container = this._overlayContainers[id] = this._createOverlayContainer(element);
+ }
+
+ return container;
+};
+
+
+Overlays.prototype._addOverlay = function(overlay) {
+
+ var id = overlay.id,
+ element = overlay.element,
+ html = overlay.html,
+ htmlContainer,
+ overlayContainer;
+
+ // unwrap jquery (for those who need it)
+ if (html.get) {
+ html = html.get(0);
+ }
+
+ // create proper html elements from
+ // overlay HTML strings
+ if (isString(html)) {
+ html = domify(html);
+ }
+
+ overlayContainer = this._getOverlayContainer(element);
+
+ htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
+
+ htmlContainer.appendChild(html);
+
+ if (overlay.type) {
+ domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
+ }
+
+ overlay.htmlContainer = htmlContainer;
+
+ overlayContainer.overlays.push(overlay);
+ overlayContainer.html.appendChild(htmlContainer);
+
+ this._overlays[id] = overlay;
+
+ this._updateOverlay(overlay);
+};
+
+Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
+
+ forEach(this._overlays, function(overlay) {
+ var show = overlay.show,
+ htmlContainer = overlay.htmlContainer,
+ visible = true;
+
+ if (show) {
+ if (show.minZoom > viewbox.scale ||
+ show.maxZoom < viewbox.scale) {
+ visible = false;
+ }
+
+ setVisible(htmlContainer, visible);
+ }
+ });
+};
+
+Overlays.prototype._init = function(config) {
+
+ var eventBus = this._eventBus;
+
+ var self = this;
+
+
+ // scroll/zoom integration
+
+ var updateViewbox = function(viewbox) {
+ self._updateRoot(viewbox);
+ self._updateOverlayVisibilty(viewbox);
+
+ self.show();
+ };
+
+ if (!config || config.deferUpdate !== false) {
+ updateViewbox = debounce(updateViewbox, 300);
+ }
+
+ eventBus.on('canvas.viewbox.changed', function(event) {
+ self.hide();
+ updateViewbox(event.viewbox);
+ });
+
+
+ // remove integration
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var overlays = self.get({ element: e.element });
+
+ forEach(overlays, function(o) {
+ self.remove(o.id);
+ });
+ });
+
+
+ // move integration
+
+ eventBus.on([
+ 'element.changed'
+ ], function(e) {
+ var element = e.element;
+
+ var container = self._getOverlayContainer(element, true);
+
+ if (container) {
+ forEach(container.overlays, function(overlay) {
+ self._updateOverlay(overlay);
+ });
+
+ self._updateOverlayContainer(container);
+ }
+ });
+
+
+ // marker integration, simply add them on the overlays as classes, too.
+
+ eventBus.on('element.marker.update', function(e) {
+ var container = self._getOverlayContainer(e.element, true);
+ if (container) {
+ domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
+ }
+ });
+};
+
+},{"177":177,"181":181,"202":202,"204":204,"214":214,"316":316,"320":320,"322":322,"325":325,"339":339,"343":343,"347":347}],135:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'overlays' ],
+ overlays: [ 'type', _dereq_(134) ]
+};
+},{"134":134}],136:[function(_dereq_,module,exports){
+'use strict';
+
+var isFunction = _dereq_(317),
+ forEach = _dereq_(204);
+
+var domify = _dereq_(343),
+ domQuery = _dereq_(346),
+ domAttr = _dereq_(338),
+ domClear = _dereq_(340),
+ domClasses = _dereq_(339),
+ domMatches = _dereq_(345),
+ domDelegate = _dereq_(342),
+ domEvent = _dereq_(344);
+
+
+var toggleSelector = '.djs-palette-toggle',
+ entrySelector = '.entry',
+ elementSelector = toggleSelector + ', ' + entrySelector;
+
+
+/**
+ * A palette containing modeling elements.
+ */
+function Palette(eventBus, canvas) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+
+ this._providers = [];
+}
+
+Palette.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = Palette;
+
+
+/**
+ * Register a provider with the palette
+ *
+ * @param {PaletteProvider} provider
+ */
+Palette.prototype.registerProvider = function(provider) {
+ this._providers.push(provider);
+
+ if (!this._container) {
+ this._init();
+ }
+
+ this._update();
+};
+
+
+/**
+ * Returns the palette entries for a given element
+ *
+ * @return {Array<PaletteEntryDescriptor>} list of entries
+ */
+Palette.prototype.getEntries = function() {
+
+ var entries = {};
+
+ // loop through all providers and their entries.
+ // group entries by id so that overriding an entry is possible
+ forEach(this._providers, function(provider) {
+ var e = provider.getPaletteEntries();
+
+ forEach(e, function(entry, id) {
+ entries[id] = entry;
+ });
+ });
+
+ return entries;
+};
+
+
+/**
+ * Initialize
+ */
+Palette.prototype._init = function() {
+ var parent = this._canvas.getContainer(),
+ container = this._container = domify(Palette.HTML_MARKUP),
+ self = this;
+
+ parent.appendChild(container);
+
+ domDelegate.bind(container, elementSelector, 'click', function(event) {
+
+ var target = event.delegateTarget;
+
+ if (domMatches(target, toggleSelector)) {
+ return self.toggle();
+ }
+
+ self.trigger('click', event);
+ });
+
+ // prevent drag propagation
+ domEvent.bind(container, 'mousedown', function(event) {
+ event.stopPropagation();
+ });
+
+ // prevent drag propagation
+ domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
+ self.trigger('dragstart', event);
+ });
+
+ this._eventBus.fire('palette.create', {
+ html: container
+ });
+};
+
+
+Palette.prototype._update = function() {
+
+ var entriesContainer = domQuery('.djs-palette-entries', this._container),
+ entries = this._entries = this.getEntries();
+
+ domClear(entriesContainer);
+
+ forEach(entries, function(entry, id) {
+
+ var grouping = entry.group || 'default';
+
+ var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
+ if (!container) {
+ container = domify('<div class="group" data-group="' + grouping + '"></div>');
+ entriesContainer.appendChild(container);
+ }
+
+ var html = entry.html || (
+ entry.separator ?
+ '<hr class="separator" />' :
+ '<div class="entry" draggable="true"></div>');
+
+
+ var control = domify(html);
+ container.appendChild(control);
+
+ if (!entry.separator) {
+ domAttr(control, 'data-action', id);
+
+ if (entry.title) {
+ domAttr(control, 'title', entry.title);
+ }
+
+ if (entry.className) {
+ domClasses(control).add(entry.className);
+ }
+
+ if (entry.imageUrl) {
+ control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
+ }
+ }
+ });
+
+ // open after update
+ this.open(true);
+};
+
+
+/**
+ * Trigger an action available on the palette
+ *
+ * @param {String} action
+ * @param {Event} event
+ */
+Palette.prototype.trigger = function(action, event, autoActivate) {
+
+ var entries = this._entries,
+ entry,
+ handler,
+ originalEvent,
+ button = event.delegateTarget || event.target;
+
+ if (!button) {
+ return event.preventDefault();
+ }
+
+
+ entry = entries[domAttr(button, 'data-action')];
+ handler = entry.action;
+
+ originalEvent = event.originalEvent || event;
+
+ // simple action (via callback function)
+ if (isFunction(handler)) {
+ if (action === 'click') {
+ return handler(originalEvent, autoActivate);
+ }
+ } else {
+ if (handler[action]) {
+ return handler[action](originalEvent, autoActivate);
+ }
+ }
+
+ // silence other actions
+ event.preventDefault();
+};
+
+
+/**
+ * Close the palette
+ */
+Palette.prototype.close = function() {
+ domClasses(this._container).remove('open');
+};
+
+
+/**
+ * Open the palette
+ */
+Palette.prototype.open = function() {
+ domClasses(this._container).add('open');
+};
+
+
+Palette.prototype.toggle = function(open) {
+ if (this.isOpen()) {
+ this.close();
+ } else {
+ this.open();
+ }
+};
+
+
+/**
+ * Return true if the palette is opened.
+ *
+ * @example
+ *
+ * palette.open();
+ *
+ * if (palette.isOpen()) {
+ * // yes, we are open
+ * }
+ *
+ * @return {boolean} true if palette is opened
+ */
+Palette.prototype.isOpen = function() {
+ return this._container && domClasses(this._container).has('open');
+};
+
+
+/* markup definition */
+
+Palette.HTML_MARKUP =
+ '<div class="djs-palette">' +
+ '<div class="djs-palette-entries"></div>' +
+ '<div class="djs-palette-toggle"></div>' +
+ '</div>';
+},{"204":204,"317":317,"338":338,"339":339,"340":340,"342":342,"343":343,"344":344,"345":345,"346":346}],137:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'palette' ],
+ palette: [ 'type', _dereq_(136) ]
+};
+
+},{"136":136}],138:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ assign = _dereq_(325),
+ domEvent = _dereq_(344),
+ domify = _dereq_(343),
+ domClasses = _dereq_(339),
+ domAttr = _dereq_(338),
+ domRemove = _dereq_(347);
+
+
+function PopupMenu(eventBus, canvas) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+ this._instances = {};
+}
+
+PopupMenu.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = PopupMenu;
+
+PopupMenu.prototype.open = function(name, position, entries, options) {
+
+ var outer = this,
+ canvas = this._canvas,
+ instances = outer._instances;
+
+ // return existing instance
+ if (instances[name]) {
+ return instances[name];
+ }
+
+ var parent = canvas.getContainer();
+
+ //------------------------
+ function PopupMenuInstance() {
+
+ var self = this;
+
+ self._actions = {};
+ self.name = name || 'popup-menu';
+
+ var _options = {
+ entryClassName: 'entry'
+ };
+ assign(_options, options);
+
+ // Container setup
+ var container = this._container = domify('<div class="djs-popup">');
+
+ assign(container.style, {
+ position: 'absolute',
+ left: position.x + 'px',
+ top: position.y + 'px'
+ });
+ domClasses(container).add(name);
+
+ // Add entries
+ forEach(entries, function(entry) {
+
+ var entryContainer = domify('<div>');
+ domClasses(entryContainer).add(entry.className || _options.entryClassName);
+ domClasses(entryContainer).add('djs-popup-entry');
+
+ if (entry.style) {
+ domAttr(entryContainer, 'style', entry.style);
+ }
+
+ if (entry.action) {
+ domAttr(entryContainer, 'data-action', entry.action.name);
+ self._actions[entry.action.name] = entry.action.handler;
+ }
+
+ var title = domify('<span>');
+ title.textContent = entry.label;
+ entryContainer.appendChild(title);
+
+ container.appendChild(entryContainer);
+ });
+
+ // Event handler
+ domEvent.bind(container, 'click', function(event) {
+ self.trigger(event);
+ });
+
+ // apply canvas zoom level
+ var zoom = canvas.zoom();
+
+ container.style.transformOrigin = 'top left';
+ container.style.transform = 'scale(' + zoom + ')';
+
+ // Attach to DOM
+ parent.appendChild(container);
+
+ // Add Handler
+ this.bindHandlers();
+ }
+
+ PopupMenuInstance.prototype.close = function() {
+ this.unbindHandlers();
+ domRemove(this._container);
+ delete outer._instances[this.name];
+ };
+
+ PopupMenuInstance.prototype.bindHandlers = function() {
+
+ var self = this,
+ eventBus = outer._eventBus;
+
+ this._closeHandler = function() {
+ self.close();
+ };
+
+ eventBus.once('contextPad.close', this._closeHandler);
+ eventBus.once('canvas.viewbox.changed', this._closeHandler);
+ };
+
+ PopupMenuInstance.prototype.unbindHandlers = function() {
+
+ var eventBus = outer._eventBus;
+
+ eventBus.off('contextPad.close', this._closeHandler);
+ eventBus.off('canvas.viewbox.changed', this._closeHandler);
+ };
+
+ PopupMenuInstance.prototype.trigger = function(event) {
+
+ var element = event.target,
+ actionName = element.getAttribute('data-action') ||
+ element.parentNode.getAttribute('data-action');
+
+ var action = this._actions[actionName];
+
+
+ if (action) {
+ action();
+ }
+
+ // silence other actions
+ event.preventDefault();
+ };
+
+ var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
+
+ return instance;
+};
+
+},{"204":204,"325":325,"338":338,"339":339,"343":343,"344":344,"347":347}],139:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'popupMenu' ],
+ popupMenu: [ 'type', _dereq_(138) ]
+};
+
+},{"138":138}],140:[function(_dereq_,module,exports){
+'use strict';
+
+
+/**
+ * Service that allow replacing of elements.
+ *
+ *
+ * @class
+ * @constructor
+ */
+function Replace(modeling) {
+
+ this._modeling = modeling;
+}
+
+module.exports = Replace;
+
+Replace.$inject = [ 'modeling' ];
+
+/**
+ * @param {Element} oldElement - Element to be replaced
+ * @param {Object} newElementData - Containing information about the new Element, for example height, width, type.
+ * @param {Object} options - Custom options that will be attached to the context. It can be used to inject data
+ * that is needed in the command chain. For example it could be used in
+ * eventbus.on('commandStack.shape.replace.postExecute') to change shape attributes after
+ * shape creation.
+ */
+Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
+
+ var modeling = this._modeling;
+
+ var newElement = null;
+
+ if (oldElement.waypoints) {
+ // TODO
+ // modeling.replaceConnection
+ } else {
+ // set center of element for modeling API
+ // if no new width / height is given use old elements size
+ newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
+ newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
+
+ newElement = modeling.replaceShape(oldElement, newElementData, options);
+ }
+
+ return newElement;
+};
+
+},{}],141:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'replace' ],
+ replace: [ 'type', _dereq_(140) ]
+};
+
+},{"140":140}],142:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ filter = _dereq_(202),
+ pick = _dereq_(330);
+
+var ResizeUtil = _dereq_(143),
+ domEvent = _dereq_(344),
+ Elements = _dereq_(177);
+
+var isPrimaryButton = _dereq_(182).isPrimaryButton;
+
+var round = Math.round;
+
+var Snap = _dereq_(188);
+
+var HANDLE_OFFSET = -2,
+ HANDLE_SIZE = 5,
+ HANDLE_HIT_SIZE = 20;
+
+var MARKER_RESIZING = 'djs-resizing',
+ MARKER_RESIZE_NOT_OK = 'resize-not-ok',
+ CLS_RESIZER = 'djs-resizer';
+
+
+/**
+ * Implements resize on shapes by
+ *
+ * * adding resize handles,
+ * * creating a visual during resize
+ * * checking resize rules
+ * * committing a change once finished
+ *
+ *
+ * ## Customizing
+ *
+ * It's possible to customize the resizing behaviour by intercepting 'resize.start'
+ * and providing the following parameters through the 'context':
+ *
+ * * minDimensions ({ width, height }) - Minimum shape dimensions
+ * * childrenBoxPadding (number) - Gap between the minimum bounding box and the container
+ *
+ * f.ex:
+ *
+ * eventBus.on('resize.start', 1500, function(event) {
+ * var context = event.context,
+ *
+ * context.minDimensions = { width: 140, height: 120 };
+ * context.childrenBoxPadding = 30;
+ * });
+ */
+
+function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
+
+ function canResize(context) {
+ var ctx = pick(context, [ 'newBounds', 'shape', 'delta', 'direction' ]);
+ return rules.allowed('shape.resize', ctx);
+ }
+
+
+ // resizing implementation //////////////////////////////////
+
+ /**
+ * A helper that realizes the resize visuals
+ */
+ var visuals = {
+ create: function(context) {
+ var container = canvas.getDefaultLayer(),
+ shape = context.shape,
+ frame;
+
+ frame = context.frame = Snap.create('rect', {
+ class: 'djs-resize-overlay',
+ width: shape.width + 10,
+ height: shape.height + 10,
+ x: shape.x -5,
+ y: shape.y -5
+ });
+
+ frame.appendTo(container);
+ },
+
+ update: function(context) {
+ var frame = context.frame,
+ bounds = context.newBounds;
+
+ if (bounds.width > 5) {
+ frame.attr({
+ x: bounds.x,
+ width: bounds.width
+ });
+ }
+
+ if (bounds.height > 5) {
+ frame.attr({
+ y: bounds.y,
+ height: bounds.height
+ });
+ }
+
+ frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
+ },
+
+ remove: function(context) {
+ if (context.frame) {
+ context.frame.remove();
+ }
+ }
+ };
+
+ function computeMinBoundaryBox(context) {
+
+ var shape = context.shape,
+ direction = context.direction,
+ minDimensions = context.minDimensions || {},
+ childrenBoxPadding = context.childrenBoxPadding || 20,
+ children,
+ minBoundaryBox;
+
+ // grab all the shapes that are NOT labels or connections
+ children = filter(shape.children, function(child) {
+ // connections
+ if (child.waypoints) {
+ return false;
+ }
+
+ // labels
+ if (child.type === 'label') {
+ return false;
+ }
+
+ return true;
+ });
+
+ // compute a minimum bounding box
+ // around the existing children
+ if (children.length) {
+ minBoundaryBox = Elements.getBBox(children);
+
+ // add a gap between the minBoundaryBox and the resizable container
+ minBoundaryBox.width += childrenBoxPadding * 2;
+ minBoundaryBox.height += childrenBoxPadding * 2;
+ minBoundaryBox.x -= childrenBoxPadding;
+ minBoundaryBox.y -= childrenBoxPadding;
+ } else {
+ minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
+ width: minDimensions.width || 10,
+ height: minDimensions.height || 10
+ });
+ }
+
+ return minBoundaryBox;
+ }
+
+ eventBus.on('resize.start', function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ minBoundaryBox = context.minBoundaryBox;
+
+ if (minBoundaryBox === undefined) {
+ context.minBoundaryBox = computeMinBoundaryBox(context);
+ }
+
+ // add resizable indicator
+ canvas.addMarker(shape, MARKER_RESIZING);
+
+ visuals.create(context);
+ });
+
+ eventBus.on('resize.move', function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ direction = context.direction,
+ minBoundaryBox = context.minBoundaryBox,
+ delta;
+
+ delta = {
+ x: event.dx,
+ y: event.dy
+ };
+
+ context.delta = delta;
+
+ context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
+
+ if (minBoundaryBox) {
+ context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
+ }
+
+ // update + cache executable state
+ context.canExecute = canResize(context);
+
+ // update resize frame visuals
+ visuals.update(context);
+ });
+
+ eventBus.on('resize.end', function(event) {
+ var context = event.context,
+ shape = context.shape;
+
+ var newBounds = context.newBounds;
+
+
+ // ensure we have actual pixel values for new bounds
+ // (important when zoom level was > 1 during move)
+ newBounds.x = round(newBounds.x);
+ newBounds.y = round(newBounds.y);
+ newBounds.width = round(newBounds.width);
+ newBounds.height = round(newBounds.height);
+
+ // perform the actual resize
+ if (context.canExecute) {
+ modeling.resizeShape(shape, context.newBounds);
+ }
+ });
+
+ eventBus.on('resize.cleanup', function(event) {
+
+ var context = event.context,
+ shape = context.shape;
+
+ // remove resizable indicator
+ canvas.removeMarker(shape, MARKER_RESIZING);
+
+ // remove frame + destroy context
+ visuals.remove(context);
+ });
+
+
+ function activate(event, shape, direction) {
+
+ dragging.activate(event, 'resize', {
+ autoActivate: true,
+ cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
+ data: {
+ shape: shape,
+ context: {
+ direction: direction,
+ shape: shape
+ }
+ }
+ });
+ }
+
+ function makeDraggable(element, gfx, direction) {
+
+ function listener(event) {
+ // only trigger on left mouse button
+ if (isPrimaryButton(event)) {
+ activate(event, element, direction);
+ }
+ }
+
+ domEvent.bind(gfx.node, 'mousedown', listener);
+ domEvent.bind(gfx.node, 'touchstart', listener);
+ }
+
+ function __createResizer(gfx, x, y, rotation, direction) {
+
+ var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
+
+ var origin = -HANDLE_SIZE + HANDLE_OFFSET;
+
+ // Create four drag indicators on the outline
+ group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
+ group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
+
+ var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
+ group.transform(matrix);
+
+ return group;
+ }
+
+ function createResizer(element, gfx, direction) {
+
+ var resizer;
+
+ if (direction === 'nw') {
+ resizer = __createResizer(gfx, 0, 0, 0, direction);
+ } else if (direction === 'ne') {
+ resizer = __createResizer(gfx, element.width, 0, 90, direction);
+ } else if (direction === 'se') {
+ resizer = __createResizer(gfx, element.width, element.height, 180, direction);
+ } else {
+ resizer = __createResizer(gfx, 0, element.height, 270, direction);
+ }
+
+ makeDraggable(element, resizer, direction);
+ }
+
+ // resize handles implementation ///////////////////////////////
+
+ function addResize(shape) {
+
+ if (!canResize({ shape: shape })) {
+ return;
+ }
+
+ var gfx = elementRegistry.getGraphics(shape);
+
+ createResizer(shape, gfx, 'nw');
+ createResizer(shape, gfx, 'ne');
+ createResizer(shape, gfx, 'se');
+ createResizer(shape, gfx, 'sw');
+ }
+
+ function removeResize(shape) {
+
+ var gfx = elementRegistry.getGraphics(shape);
+ var resizers = gfx.selectAll('.' + CLS_RESIZER);
+
+ forEach(resizers, function(resizer){
+ resizer.remove();
+ });
+ }
+
+ eventBus.on('selection.changed', function(e) {
+
+ var oldSelection = e.oldSelection,
+ newSelection = e.newSelection;
+
+ // remove old selection markers
+ forEach(oldSelection, removeResize);
+
+ // add new selection markers ONLY if single selection
+ if (newSelection.length === 1) {
+ forEach(newSelection, addResize);
+ }
+ });
+
+ eventBus.on('shape.changed', function(e) {
+ var shape = e.element;
+
+ removeResize(shape);
+
+ if (selection.isSelected(shape)) {
+ addResize(shape);
+ }
+ });
+
+
+ // API
+
+ this.activate = activate;
+}
+
+Resize.$inject = [ 'eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging' ];
+
+module.exports = Resize;
+
+},{"143":143,"177":177,"182":182,"188":188,"202":202,"204":204,"330":330,"344":344}],143:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Resize the given bounds by the specified delta from a given anchor point.
+ *
+ * @param {Bounds} bounds the bounding box that should be resized
+ * @param {String} direction in which the element is resized (nw, ne, se, sw)
+ * @param {Point} delta of the resize operation
+ *
+ * @return {Bounds} resized bounding box
+ */
+module.exports.resizeBounds = function(bounds, direction, delta) {
+
+ var dx = delta.x,
+ dy = delta.y;
+
+ switch (direction) {
+
+ case 'nw':
+ return {
+ x: bounds.x + dx,
+ y: bounds.y + dy,
+ width: bounds.width - dx,
+ height: bounds.height - dy
+ };
+
+ case 'sw':
+ return {
+ x: bounds.x + dx,
+ y: bounds.y,
+ width: bounds.width - dx,
+ height: bounds.height + dy
+ };
+
+ case 'ne':
+ return {
+ x: bounds.x,
+ y: bounds.y + dy,
+ width: bounds.width + dx,
+ height: bounds.height - dy
+ };
+
+ case 'se':
+ return {
+ x: bounds.x,
+ y: bounds.y,
+ width: bounds.width + dx,
+ height: bounds.height + dy
+ };
+
+ default:
+ throw new Error('unrecognized direction: ' + direction);
+ }
+};
+
+module.exports.reattachPoint = function(bounds, newBounds, point) {
+
+ var sx = bounds.width / newBounds.width,
+ sy = bounds.height / newBounds.height;
+
+ return {
+ x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
+ y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
+ };
+};
+
+
+module.exports.ensureMinBounds = function(currentBounds, minBounds) {
+ var topLeft = {
+ x: Math.min(currentBounds.x, minBounds.x),
+ y: Math.min(currentBounds.y, minBounds.y)
+ };
+
+ var bottomRight = {
+ x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
+ y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
+ };
+
+ return {
+ x: topLeft.x,
+ y: topLeft.y,
+ width: bottomRight.x - topLeft.x,
+ height: bottomRight.y - topLeft.y
+ };
+};
+
+
+module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
+
+ switch(direction) {
+ case 'nw':
+ return {
+ x: currentBounds.x + currentBounds.width - minDimensions.width,
+ y: currentBounds.y + currentBounds.height - minDimensions.height,
+ width: minDimensions.width,
+ height: minDimensions.height
+ };
+ case 'sw':
+ return {
+ x: currentBounds.x + currentBounds.width - minDimensions.width,
+ y: currentBounds.y,
+ width: minDimensions.width,
+ height: minDimensions.height
+ };
+ case 'ne':
+ return {
+ x: currentBounds.x,
+ y: currentBounds.y + currentBounds.height - minDimensions.height,
+ width: minDimensions.width,
+ height: minDimensions.height
+ };
+ case 'se':
+ return {
+ x: currentBounds.x,
+ y: currentBounds.y,
+ width: minDimensions.width,
+ height: minDimensions.height
+ };
+ default:
+ throw new Error('unrecognized direction: ' + direction);
+ }
+};
+
+
+
+},{}],144:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(128),
+ _dereq_(147),
+ _dereq_(101)
+ ],
+ __init__: [ 'resize' ],
+ resize: [ 'type', _dereq_(142) ]
+};
+
+},{"101":101,"128":128,"142":142,"147":147}],145:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(195);
+
+var CommandInterceptor = _dereq_(75);
+
+/**
+ * A basic provider that may be extended to implement modeling rules.
+ *
+ * Extensions should implement the init method to actually add their custom
+ * modeling checks. Checks may be added via the #addRule(action, fn) method.
+ *
+ * @param {EventBus} eventBus
+ */
+function RuleProvider(eventBus) {
+ CommandInterceptor.call(this, eventBus);
+
+ this.init();
+}
+
+RuleProvider.$inject = [ 'eventBus' ];
+
+inherits(RuleProvider, CommandInterceptor);
+
+module.exports = RuleProvider;
+
+
+/**
+ * Adds a modeling rule for the given action, implemented through a callback function.
+ *
+ * The function will receive the modeling specific action context to perform its check.
+ * It must return false or null to disallow the action from happening.
+ *
+ * Returning <code>null</code> may encode simply ignoring the action.
+ *
+ * @example
+ *
+ * ResizableRules.prototype.init = function() {
+ *
+ * this.addRule('shape.resize', function(context) {
+ *
+ * var shape = context.shape;
+ *
+ * if (!context.newBounds) {
+ * // check general resizability
+ * if (!shape.resizable) {
+ * return false;
+ * }
+ * } else {
+ * // element must have minimum size of 10*10 points
+ * return context.newBounds.width > 10 && context.newBounds.height > 10;
+ * }
+ * });
+ * };
+ *
+ * @param {String|Array<String>} actions the identifier for the modeling action to check
+ * @param {Function} fn the callback function that performs the actual check
+ */
+RuleProvider.prototype.addRule = function(actions, fn) {
+
+ var self = this;
+
+ if (typeof actions === 'string') {
+ actions = [ actions ];
+ }
+
+ actions.forEach(function(action) {
+
+ self.canExecute(action, function(context, action, event) {
+ return fn(context);
+ }, true);
+ });
+};
+},{"195":195,"75":75}],146:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * A service that provides rules for certain diagram actions.
+ *
+ * @param {CommandStack} commandStack
+ */
+function Rules(commandStack) {
+ this._commandStack = commandStack;
+}
+
+Rules.$inject = [ 'commandStack' ];
+
+module.exports = Rules;
+
+
+/**
+ * This method can be queried to ask whether certain modeling actions
+ * are allowed or not.
+ *
+ * @param {String} action the action to be checked
+ * @param {Object} [context] the context to check the action in
+ *
+ * @return {Boolean} returns true, false or null depending on whether the
+ * operation is allowed, not allowed or should be ignored.
+ */
+Rules.prototype.allowed = function(action, context) {
+ var allowed = this._commandStack.canExecute(action, context);
+
+ // map undefined to true, i.e. no rules
+ return allowed === undefined ? true : allowed;
+};
+},{}],147:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(77) ],
+ __init__: [ 'rules' ],
+ rules: [ 'type', _dereq_(146) ]
+};
+
+},{"146":146,"77":77}],148:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ forEach = _dereq_(204);
+
+
+/**
+ * A service that offers the current selection in a diagram.
+ * Offers the api to control the selection, too.
+ *
+ * @class
+ *
+ * @param {EventBus} eventBus the event bus
+ */
+function Selection(eventBus) {
+
+ this._eventBus = eventBus;
+
+ this._selectedElements = [];
+
+ var self = this;
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var element = e.element;
+ self.deselect(element);
+ });
+}
+
+Selection.$inject = [ 'eventBus' ];
+
+module.exports = Selection;
+
+
+Selection.prototype.deselect = function(element) {
+ var selectedElements = this._selectedElements;
+
+ var idx = selectedElements.indexOf(element);
+
+ if (idx !== -1) {
+ var oldSelection = selectedElements.slice();
+
+ selectedElements.splice(idx, 1);
+
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+ }
+};
+
+
+Selection.prototype.get = function() {
+ return this._selectedElements;
+};
+
+Selection.prototype.isSelected = function(element) {
+ return this._selectedElements.indexOf(element) !== -1;
+};
+
+
+/**
+ * This method selects one or more elements on the diagram.
+ *
+ * By passing an additional add parameter you can decide whether or not the element(s)
+ * should be added to the already existing selection or not.
+ *
+ * @method Selection#select
+ *
+ * @param {Object|Object[]} elements element or array of elements to be selected
+ * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false
+ */
+Selection.prototype.select = function(elements, add) {
+ var selectedElements = this._selectedElements,
+ oldSelection = selectedElements.slice();
+
+ if (!isArray(elements)) {
+ elements = elements ? [ elements ] : [];
+ }
+
+ // selection may be cleared by passing an empty array or null
+ // to the method
+ if (add) {
+ forEach(elements, function(element) {
+ if (selectedElements.indexOf(element) !== -1) {
+ // already selected
+ return;
+ } else {
+ selectedElements.push(element);
+ }
+ });
+ } else {
+ this._selectedElements = selectedElements = elements.slice();
+ }
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+};
+
+},{"204":204,"316":316}],149:[function(_dereq_,module,exports){
+'use strict';
+
+var hasPrimaryModifier = _dereq_(182).hasPrimaryModifier;
+
+
+function SelectionBehavior(eventBus, selection, canvas) {
+
+ eventBus.on('create.end', 500, function(e) {
+ if (e.context.canExecute) {
+ selection.select(e.shape);
+ }
+ });
+
+ eventBus.on('connect.end', 500, function(e) {
+ if (e.context.canExecute && e.context.target) {
+ selection.select(e.context.target);
+ }
+ });
+
+ eventBus.on('shape.move.end', 500, function(e) {
+ selection.select(e.context.shapes);
+ });
+
+
+ // Shift + click selection
+ eventBus.on('element.click', function(event) {
+
+ var element = event.element;
+
+ // do not select the root element
+ // or connections
+ if (element === canvas.getRootElement()) {
+ element = null;
+ }
+
+ var isSelected = selection.isSelected(element),
+ isMultiSelect = selection.get().length > 1;
+
+ // mouse-event: SELECTION_KEY
+ var add = hasPrimaryModifier(event);
+
+ // select OR deselect element in multi selection
+ if (isSelected && isMultiSelect) {
+ if (add) {
+ return selection.deselect(element);
+ } else {
+ return selection.select(element);
+ }
+ } else
+ if (!isSelected) {
+ selection.select(element, add);
+ } else {
+ selection.deselect(element);
+ }
+ });
+}
+
+SelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];
+
+module.exports = SelectionBehavior;
+
+},{"182":182}],150:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var MARKER_HOVER = 'hover',
+ MARKER_SELECTED = 'selected';
+
+
+/**
+ * A plugin that adds a visible selection UI to shapes and connections
+ * by appending the <code>hover</code> and <code>selected</code> classes to them.
+ *
+ * @class
+ *
+ * Makes elements selectable, too.
+ *
+ * @param {EventBus} events
+ * @param {SelectionService} selection
+ * @param {Canvas} canvas
+ */
+function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
+
+ this._multiSelectionBox = null;
+
+ function addMarker(e, cls) {
+ canvas.addMarker(e, cls);
+ }
+
+ function removeMarker(e, cls) {
+ canvas.removeMarker(e, cls);
+ }
+
+ events.on('element.hover', function(event) {
+ addMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('element.out', function(event) {
+ removeMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('selection.changed', function(event) {
+
+ function deselect(s) {
+ removeMarker(s, MARKER_SELECTED);
+ }
+
+ function select(s) {
+ addMarker(s, MARKER_SELECTED);
+ }
+
+ var oldSelection = event.oldSelection,
+ newSelection = event.newSelection;
+
+ forEach(oldSelection, function(e) {
+ if (newSelection.indexOf(e) === -1) {
+ deselect(e);
+ }
+ });
+
+ forEach(newSelection, function(e) {
+ if (oldSelection.indexOf(e) === -1) {
+ select(e);
+ }
+ });
+ });
+}
+
+SelectionVisuals.$inject = [
+ 'eventBus',
+ 'canvas',
+ 'selection',
+ 'graphicsFactory',
+ 'styles'
+];
+
+module.exports = SelectionVisuals;
+
+},{"204":204}],151:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'selectionVisuals', 'selectionBehavior' ],
+ __depends__: [
+ _dereq_(103),
+ _dereq_(133)
+ ],
+ selection: [ 'type', _dereq_(148) ],
+ selectionVisuals: [ 'type', _dereq_(150) ],
+ selectionBehavior: [ 'type', _dereq_(149) ]
+};
+
+},{"103":103,"133":133,"148":148,"149":149,"150":150}],152:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+var snapTo = _dereq_(153).snapTo;
+
+
+/**
+ * A snap context, containing the (possibly incomplete)
+ * mappings of drop targets (to identify the snapping)
+ * to computed snap points.
+ */
+function SnapContext() {
+
+ /**
+ * Map<String, SnapPoints> mapping drop targets to
+ * a list of possible snappings.
+ *
+ * @type {Object}
+ */
+ this._targets = {};
+
+ /**
+ * Map<String, Point> initial positioning of element
+ * regarding various snap directions.
+ *
+ * @type {Object}
+ */
+ this._snapOrigins = {};
+
+ /**
+ * List of snap locations
+ *
+ * @type {Array<String>}
+ */
+ this._snapLocations = [];
+
+ /**
+ * Map<String, Array<Point>> of default snapping locations
+ *
+ * @type {Object}
+ */
+ this._defaultSnaps = {};
+}
+
+
+SnapContext.prototype.getSnapOrigin = function(snapLocation) {
+ return this._snapOrigins[snapLocation];
+};
+
+
+SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
+ this._snapOrigins[snapLocation] = initialValue;
+
+ if (this._snapLocations.indexOf(snapLocation) === -1) {
+ this._snapLocations.push(snapLocation);
+ }
+};
+
+
+SnapContext.prototype.addDefaultSnap = function(type, point) {
+
+ var snapValues = this._defaultSnaps[type];
+
+ if (!snapValues) {
+ snapValues = this._defaultSnaps[type] = [];
+ }
+
+ snapValues.push(point);
+};
+
+/**
+ * Return a number of initialized snaps, i.e. snap locations such as
+ * top-left, mid, bottom-right and so forth.
+ *
+ * @return {Array<String>} snapLocations
+ */
+SnapContext.prototype.getSnapLocations = function() {
+ return this._snapLocations;
+};
+
+/**
+ * Set the snap locations for this context.
+ *
+ * The order of locations determines precedence.
+ *
+ * @param {Array<String>} snapLocations
+ */
+SnapContext.prototype.setSnapLocations = function(snapLocations) {
+ this._snapLocations = snapLocations;
+};
+
+/**
+ * Get snap points for a given target
+ *
+ * @param {Element|String} target
+ */
+SnapContext.prototype.pointsForTarget = function(target) {
+
+ var targetId = target.id || target;
+
+ var snapPoints = this._targets[targetId];
+
+ if (!snapPoints) {
+ snapPoints = this._targets[targetId] = new SnapPoints();
+ snapPoints.initDefaults(this._defaultSnaps);
+ }
+
+ return snapPoints;
+};
+
+module.exports = SnapContext;
+
+
+/**
+ * Creates the snap points and initializes them with the
+ * given default values.
+ *
+ * @param {Object<String, Array<Point>>} [defaultPoints]
+ */
+function SnapPoints(defaultSnaps) {
+
+ /**
+ * Map<String, Map<(x|y), Array<Number>>> mapping snap locations,
+ * i.e. top-left, bottom-right, center to actual snap values.
+ *
+ * @type {Object}
+ */
+ this._snapValues = {};
+}
+
+SnapPoints.prototype.add = function(snapLocation, point) {
+
+ var snapValues = this._snapValues[snapLocation];
+
+ if (!snapValues) {
+ snapValues = this._snapValues[snapLocation] = { x: [], y: [] };
+ }
+
+ if (snapValues.x.indexOf(point.x) === -1) {
+ snapValues.x.push(point.x);
+ }
+
+ if (snapValues.y.indexOf(point.y) === -1) {
+ snapValues.y.push(point.y);
+ }
+};
+
+
+SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
+ var snappingValues = this._snapValues[snapLocation];
+
+ return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
+};
+
+/**
+ * Initialize a number of default snapping points.
+ *
+ * @param {Object} defaultSnaps
+ */
+SnapPoints.prototype.initDefaults = function(defaultSnaps) {
+
+ var self = this;
+
+ forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
+ forEach(snapPoints, function(point) {
+ self.add(snapLocation, point);
+ });
+ });
+};
+},{"153":153,"204":204}],153:[function(_dereq_,module,exports){
+'use strict';
+
+var abs = Math.abs,
+ round = Math.round;
+
+
+/**
+ * Snap value to a collection of reference values.
+ *
+ * @param {Number} value
+ * @param {Array<Number>} values
+ * @param {Number} [tolerance=10]
+ *
+ * @return {Number} the value we snapped to or null, if none snapped
+ */
+function snapTo(value, values, tolerance) {
+ tolerance = tolerance === undefined ? 10 : tolerance;
+
+ var idx, snapValue;
+
+ for (idx = 0; idx < values.length; idx++) {
+ snapValue = values[idx];
+
+ if (abs(snapValue - value) <= tolerance) {
+ return snapValue;
+ }
+ }
+}
+
+
+module.exports.snapTo = snapTo;
+
+
+function topLeft(bounds) {
+ return {
+ x: bounds.x,
+ y: bounds.y
+ };
+}
+
+module.exports.topLeft = topLeft;
+
+
+function mid(bounds, defaultValue) {
+
+ if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
+ return defaultValue;
+ }
+
+ return {
+ x: round(bounds.x + bounds.width / 2),
+ y: round(bounds.y + bounds.height / 2)
+ };
+}
+
+module.exports.mid = mid;
+
+
+function bottomRight(bounds) {
+ return {
+ x: bounds.x + bounds.width,
+ y: bounds.y + bounds.height
+ };
+}
+
+module.exports.bottomRight = bottomRight;
+},{}],154:[function(_dereq_,module,exports){
+'use strict';
+
+var filter = _dereq_(202),
+ forEach = _dereq_(204),
+ debounce = _dereq_(214);
+
+
+var mid = _dereq_(153).mid;
+
+var SnapContext = _dereq_(152);
+
+/**
+ * A general purpose snapping component for diagram elements.
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ */
+function Snapping(eventBus, canvas) {
+
+ this._canvas = canvas;
+
+ var self = this;
+
+ eventBus.on([ 'shape.move.start', 'create.start' ], function(event) {
+ self.initSnap(event);
+ });
+
+ eventBus.on([ 'shape.move.move', 'shape.move.end', 'create.move', 'create.end' ], function(event) {
+ if (event.snapped) {
+ return;
+ }
+
+ self.snap(event);
+ });
+
+ eventBus.on([ 'shape.move.cleanup', 'create.cleanup' ], function(event) {
+ self.hide();
+ });
+
+ // delay hide by 1000 seconds since last match
+ this._asyncHide = debounce(this.hide, 1000);
+}
+
+Snapping.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = Snapping;
+
+
+Snapping.prototype.initSnap = function(event) {
+
+ var context = event.context,
+ shape = context.shape,
+ snapContext = context.snapContext;
+
+ if (!snapContext) {
+ snapContext = context.snapContext = new SnapContext();
+ }
+
+ var snapMid = mid(shape, event);
+
+ snapContext.setSnapOrigin('mid', {
+ x: snapMid.x - event.x,
+ y: snapMid.y - event.y
+ });
+
+ return snapContext;
+};
+
+
+Snapping.prototype.snap = function(event) {
+
+ var context = event.context,
+ snapContext = context.snapContext,
+ shape = context.shape,
+ target = context.target,
+ snapLocations = snapContext.getSnapLocations();
+
+ if (!target) {
+ return;
+ }
+
+ var snapPoints = snapContext.pointsForTarget(target);
+
+ if (!snapPoints.initialized) {
+ this.addTargetSnaps(snapPoints, shape, target);
+
+ snapPoints.initialized = true;
+ }
+
+
+ var snapping = {};
+
+ forEach(snapLocations, function(location) {
+
+ var snapOrigin = snapContext.getSnapOrigin(location);
+
+ var snapCurrent = {
+ x: event.x + snapOrigin.x,
+ y: event.y + snapOrigin.y
+ };
+
+ // snap on both axis, if not snapped already
+ forEach([ 'x', 'y' ], function(axis) {
+ var locationSnapping;
+
+ if (!snapping[axis]) {
+ locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
+
+ if (locationSnapping !== undefined) {
+ snapping[axis] = {
+ value: locationSnapping,
+ originValue: locationSnapping - snapOrigin[axis]
+ };
+ }
+ }
+ });
+
+ // no more need to snap, drop out of interation
+ if (snapping.x && snapping.y) {
+ return false;
+ }
+ });
+
+
+ // show snap visuals
+
+ this.showSnapLine('vertical', snapping.x && snapping.x.value);
+ this.showSnapLine('horizontal', snapping.y && snapping.y.value);
+
+
+ // adjust event { x, y, dx, dy } and mark as snapping
+ var cx, cy;
+
+ if (snapping.x) {
+
+ cx = event.x - snapping.x.originValue;
+
+ event.x = snapping.x.originValue;
+ event.dx = event.dx - cx;
+
+ event.snapped = true;
+ }
+
+ if (snapping.y) {
+ cy = event.y - snapping.y.originValue;
+
+ event.y = snapping.y.originValue;
+ event.dy = event.dy - cy;
+
+ event.snapped = true;
+ }
+};
+
+
+Snapping.prototype._createLine = function(orientation) {
+
+ var root = this._canvas.getLayer('snap');
+
+ var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
+
+ return {
+ update: function(position) {
+
+ if (position === undefined) {
+ line.attr({ display: 'none' });
+ } else {
+ if (orientation === 'horizontal') {
+ line.attr({
+ path: 'M-100000,' + position + ' L+100000,' + position,
+ display: ''
+ });
+ } else {
+ line.attr({
+ path: 'M ' + position + ',-100000 L ' + position + ', +100000',
+ display: ''
+ });
+ }
+ }
+ }
+ };
+};
+
+
+Snapping.prototype._createSnapLines = function() {
+
+ this._snapLines = {
+ horizontal: this._createLine('horizontal'),
+ vertical: this._createLine('vertical')
+ };
+};
+
+Snapping.prototype.showSnapLine = function(orientation, position) {
+
+ var line = this.getSnapLine(orientation);
+
+ if (line) {
+ line.update(position);
+ }
+
+ this._asyncHide();
+};
+
+Snapping.prototype.getSnapLine = function(orientation) {
+ if (!this._snapLines) {
+ this._createSnapLines();
+ }
+
+ return this._snapLines[orientation];
+};
+
+Snapping.prototype.hide = function() {
+ forEach(this._snapLines, function(l) {
+ l.update();
+ });
+};
+
+Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
+
+ var siblings = this.getSiblings(shape, target);
+
+ forEach(siblings, function(s) {
+ snapPoints.add('mid', mid(s));
+ });
+
+};
+
+Snapping.prototype.getSiblings = function(element, target) {
+
+ // snap to all non connection siblings
+ return target && filter(target.children, function(e) {
+ return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
+ });
+};
+},{"152":152,"153":153,"202":202,"204":204,"214":214}],155:[function(_dereq_,module,exports){
+'use strict';
+
+var SpaceUtil = _dereq_(157);
+
+var Cursor = _dereq_(176);
+
+var hasPrimaryModifier = _dereq_(182).hasPrimaryModifier;
+
+var abs = Math.abs,
+ round = Math.round;
+
+var HIGH_PRIORITY = 1500;
+
+/**
+ * A tool that allows users to create and remove space in a diagram.
+ *
+ * The tool needs to be activated manually via {@link SpaceTool#activate(MouseEvent)}.
+ */
+function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
+
+ function canResize(shape) {
+ var ctx = { shape: shape };
+ return rules.allowed('shape.resize', ctx);
+ }
+
+ function activateSelection(event, autoActivate) {
+ dragging.activate(event, 'spaceTool.selection', {
+ cursor: 'crosshair',
+ autoActivate: autoActivate,
+ data: {
+ context: {
+ crosshair: {}
+ }
+ }
+ });
+ }
+
+ function activateMakeSpace(event) {
+ dragging.activate(event, 'spaceTool', {
+ autoActivate: true,
+ cursor: 'crosshair',
+ data: {
+ context: {}
+ }
+ });
+ }
+
+
+ eventBus.on('spaceTool.selection.end', function(event) {
+ setTimeout(function() {
+ activateMakeSpace(event.originalEvent);
+ });
+ });
+
+
+ var AXIS_TO_DIMENSION = { x: 'width', y: 'height' },
+ AXIS_INVERTED = { x: 'y', y: 'x' };
+
+
+ function initializeMakeSpace(event, context) {
+
+ var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
+ offset = event['d' + axis],
+ // start point of create space operation
+ spacePos = event[axis] - offset,
+ // list of moving shapes
+ movingShapes = [],
+ // list of resizing shapes
+ resizingShapes = [];
+
+ if (abs(offset) < 5) {
+ return false;
+ }
+
+ // inverts the offset to choose the shapes
+ // on the opposite side of the resizer if
+ // a key modifier is pressed
+ if (hasPrimaryModifier(event)) {
+ offset *= -1;
+ }
+
+ // collect all elements that need to be moved _AND_
+ // resized given on the initial create space position
+ elementRegistry.forEach(function (shape) {
+ var shapeStart = shape[ [ axis ]],
+ shapeEnd = shapeStart + shape[ AXIS_TO_DIMENSION[ axis ]];
+
+ // checking if it's root
+ if (!shape.parent) {
+ return;
+ }
+
+ // checking if it's a shape
+ if (shape.waypoints) {
+ return;
+ }
+
+ // shape after spacePos
+ if (offset > 0 && shapeStart > spacePos) {
+ return movingShapes.push(shape);
+ }
+
+ // shape before spacePos
+ if (offset < 0 && shapeEnd < spacePos) {
+ return movingShapes.push(shape);
+ }
+
+ // shape on top of spacePos, resize only if allowed
+ if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
+ return resizingShapes.push(shape);
+ }
+ });
+
+ // store data in context
+ context.axis = axis;
+ context.direction = SpaceUtil.getDirection(axis, offset);
+ context.movingShapes = movingShapes;
+ context.resizingShapes = resizingShapes;
+
+ Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
+
+ return true;
+ }
+
+
+ eventBus.on('spaceTool.move', HIGH_PRIORITY , function(event) {
+
+ var context = event.context;
+
+ if (!context.initialized) {
+ context.initialized = initializeMakeSpace(event, context);
+ }
+ });
+
+
+ eventBus.on('spaceTool.end', function(event) {
+
+ var context = event.context,
+ axis = context.axis,
+ direction = context.direction,
+ movingShapes = context.movingShapes,
+ resizingShapes = context.resizingShapes;
+
+ // skip if create space has not been initialized yet
+ if (!context.initialized) {
+ return;
+ }
+
+ var delta = { x: round(event.dx), y: round(event.dy) };
+ delta[ AXIS_INVERTED[ axis ] ] = 0;
+
+ return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
+ });
+
+ // API
+ this.activateSelection = activateSelection;
+ this.activateMakeSpace = activateMakeSpace;
+}
+
+SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
+
+module.exports = SpaceTool;
+
+},{"157":157,"176":176,"182":182}],156:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204);
+
+
+var MARKER_DRAGGING = 'djs-dragging';
+
+
+/**
+ * A plugin that makes shapes draggable / droppable.
+ *
+ * @param {EventBus} eventBus
+ * @param {ElementRegistry} elementRegistry
+ * @param {Canvas} canvas
+ * @param {Styles} styles
+ */
+
+function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
+
+ function getGfx(e) {
+ return elementRegistry.getGraphics(e);
+ }
+
+ function addDragger(shape, dragGroup) {
+ var gfx = getGfx(shape);
+ var dragger = gfx.clone();
+ var bbox = gfx.getBBox();
+
+ dragger.attr(styles.cls('djs-dragger', [], {
+ x: bbox.x,
+ y: bbox.y
+ }));
+
+ dragGroup.add(dragger);
+ }
+
+ eventBus.on('spaceTool.selection.start', function(event) {
+ var space = canvas.getLayer('space'),
+ context = event.context;
+
+ var orientation = {
+ x: 'M 0,-10000 L 0,10000',
+ y: 'M -10000,0 L 10000,0'
+ };
+
+ var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', [ 'no-events' ]));
+
+ crosshairGroup.path(orientation.x).addClass('djs-crosshair');
+ crosshairGroup.path(orientation.y).addClass('djs-crosshair');
+
+ context.crosshairGroup = crosshairGroup;
+ });
+
+ eventBus.on('spaceTool.selection.move', function(event) {
+ var crosshairGroup = event.context.crosshairGroup;
+
+ crosshairGroup.translate(event.x, event.y);
+ });
+
+ eventBus.on('spaceTool.selection.cleanup', function(event) {
+ var context = event.context,
+ crosshairGroup = context.crosshairGroup;
+
+ if (crosshairGroup) {
+ crosshairGroup.remove();
+ }
+ });
+
+
+ // assign a low priority to this handler
+ // to let others modify the move context before
+ // we draw things
+ eventBus.on('spaceTool.move', function(event) {
+ /*
+ TODO (Ricardo): extend connections while adding space
+ */
+
+ var context = event.context,
+ line = context.line,
+ axis = context.axis,
+ dragShapes = context.movingShapes;
+
+ if (!context.initialized) {
+ return;
+ }
+
+ if (!context.dragGroup) {
+ var spaceLayer = canvas.getLayer('space');
+ line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
+
+ context.line = line;
+ var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));
+
+
+ forEach(dragShapes, function(shape) {
+ addDragger(shape, dragGroup);
+ canvas.addMarker(shape, MARKER_DRAGGING);
+ });
+
+ context.dragGroup = dragGroup;
+ }
+
+ var orientation = {
+ x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
+ y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
+ };
+
+ line.attr({
+ path: orientation[ axis ],
+ display: ''
+ });
+
+ var opposite = { x: 'y', y: 'x' };
+ var delta = { x: event.dx, y: event.dy };
+ delta[ opposite[ context.axis ] ] = 0;
+
+ context.dragGroup.translate(delta.x, delta.y);
+ });
+
+ eventBus.on('spaceTool.cleanup', function(event) {
+
+ var context = event.context,
+ shapes = context.movingShapes,
+ line = context.line,
+ dragGroup = context.dragGroup;
+
+ // remove dragging marker
+ forEach(shapes, function(e) {
+ canvas.removeMarker(e, MARKER_DRAGGING);
+ });
+
+ if (dragGroup) {
+ line.remove();
+ dragGroup.remove();
+ }
+ });
+}
+
+SpaceToolVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];
+
+module.exports = SpaceToolVisuals;
+
+},{"204":204}],157:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Get Resize direction given axis + offset
+ *
+ * @param {String} axis (x|y)
+ * @param {Number} offset
+ *
+ * @return {String} (e|w|n|s)
+ */
+function getDirection(axis, offset) {
+
+ if (axis === 'x') {
+ if (offset > 0) {
+ return 'e';
+ }
+
+ if (offset < 0) {
+ return 'w';
+ }
+ }
+
+ if (axis === 'y') {
+ if (offset > 0) {
+ return 's';
+ }
+
+ if (offset < 0) {
+ return 'n';
+ }
+ }
+
+ return null;
+}
+
+module.exports.getDirection = getDirection;
+
+/**
+ * Resize the given bounds by the specified delta from a given anchor point.
+ *
+ * @param {Bounds} bounds the bounding box that should be resized
+ * @param {String} direction in which the element is resized (n, s, e, w)
+ * @param {Point} delta of the resize operation
+ *
+ * @return {Bounds} resized bounding box
+ */
+module.exports.resizeBounds = function(bounds, direction, delta) {
+
+ var dx = delta.x,
+ dy = delta.y;
+
+ switch (direction) {
+
+ case 'n':
+ return {
+ x: bounds.x,
+ y: bounds.y + dy,
+ width: bounds.width,
+ height: bounds.height - dy
+ };
+
+ case 's':
+ return {
+ x: bounds.x,
+ y: bounds.y,
+ width: bounds.width,
+ height: bounds.height + dy
+ };
+
+ case 'w':
+ return {
+ x: bounds.x + dx,
+ y: bounds.y,
+ width: bounds.width - dx,
+ height: bounds.height
+ };
+
+ case 'e':
+ return {
+ x: bounds.x,
+ y: bounds.y,
+ width: bounds.width + dx,
+ height: bounds.height
+ };
+
+ default:
+ throw new Error('unrecognized direction: ' + direction);
+ }
+};
+},{}],158:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: ['spaceToolVisuals'],
+ __depends__: [_dereq_(101), _dereq_(128), _dereq_(147) ],
+ spaceTool: ['type', _dereq_(155)],
+ spaceToolVisuals: ['type', _dereq_(156) ]
+};
+
+},{"101":101,"128":128,"147":147,"155":155,"156":156}],159:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(322),
+ assign = _dereq_(325),
+ forEach = _dereq_(204),
+ debounce = _dereq_(214);
+
+var domify = _dereq_(343),
+ domAttr = _dereq_(338),
+ domClasses = _dereq_(339),
+ domRemove = _dereq_(347),
+ domDelegate = _dereq_(342);
+
+
+// document wide unique tooltip ids
+var ids = new (_dereq_(181))('tt');
+
+
+function createRoot(parent) {
+ var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
+ parent.insertBefore(root, parent.firstChild);
+
+ return root;
+}
+
+
+function setPosition(el, x, y) {
+ assign(el.style, { left: x + 'px', top: y + 'px' });
+}
+
+function setVisible(el, visible) {
+ el.style.display = visible === false ? 'none' : '';
+}
+
+
+var tooltipClass = 'djs-tooltip',
+ tooltipSelector = '.' + tooltipClass;
+
+/**
+ * A service that allows users to render tool tips on the diagram.
+ *
+ * The tooltip service will take care of updating the tooltip positioning
+ * during navigation + zooming.
+ *
+ * @example
+ *
+ * ```javascript
+ *
+ * // add a pink badge on the top left of the shape
+ * tooltips.add({
+ * position: {
+ * x: 50,
+ * y: 100
+ * },
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or with optional life span
+ * tooltips.add({
+ * position: {
+ * top: -5,
+ * left: -5
+ * },
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
+ * ttl: 2000
+ * });
+ *
+ * // remove a tool tip
+ * var id = tooltips.add(...);
+ * tooltips.remove(id);
+ * ```
+ *
+ * @param {Object} config
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ */
+function Tooltips(config, eventBus, canvas) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+
+ this._ids = ids;
+
+ this._tooltipDefaults = {
+ show: {
+ minZoom: 0.7,
+ maxZoom: 5.0
+ }
+ };
+
+ /**
+ * Mapping tooltipId -> tooltip
+ */
+ this._tooltips = {};
+
+ // root html element for all tooltips
+ this._tooltipRoot = createRoot(canvas.getContainer());
+
+
+ var self = this;
+
+ domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
+ event.stopPropagation();
+ });
+
+ domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
+ self.trigger('mouseover', event);
+ });
+
+ domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
+ self.trigger('mouseout', event);
+ });
+
+ this._init(config);
+}
+
+
+Tooltips.$inject = [ 'config.tooltips', 'eventBus', 'canvas' ];
+
+module.exports = Tooltips;
+
+
+/**
+ * Adds a HTML tooltip to the diagram
+ *
+ * @param {Object} tooltip the tooltip configuration
+ *
+ * @param {String|DOMElement} tooltip.html html element to use as an tooltip
+ * @param {Object} [tooltip.show] show configuration
+ * @param {Number} [tooltip.show.minZoom] minimal zoom level to show the tooltip
+ * @param {Number} [tooltip.show.maxZoom] maximum zoom level to show the tooltip
+ * @param {Object} tooltip.position where to attach the tooltip
+ * @param {Number} [tooltip.position.left] relative to element bbox left attachment
+ * @param {Number} [tooltip.position.top] relative to element bbox top attachment
+ * @param {Number} [tooltip.position.bottom] relative to element bbox bottom attachment
+ * @param {Number} [tooltip.position.right] relative to element bbox right attachment
+ * @param {Number} [tooltip.timeout=-1]
+ *
+ * @return {String} id that may be used to reference the tooltip for update or removal
+ */
+Tooltips.prototype.add = function(tooltip) {
+
+ if (!tooltip.position) {
+ throw new Error('must specifiy tooltip position');
+ }
+
+ if (!tooltip.html) {
+ throw new Error('must specifiy tooltip html');
+ }
+
+ var id = this._ids.next();
+
+ tooltip = assign({}, this._tooltipDefaults, tooltip, {
+ id: id
+ });
+
+ this._addTooltip(tooltip);
+
+ if (tooltip.timeout) {
+ this.setTimeout(tooltip);
+ }
+
+ return id;
+};
+
+Tooltips.prototype.trigger = function(action, event) {
+
+ var node = event.delegateTarget || event.target;
+
+ var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
+
+ if (!tooltip) {
+ return;
+ }
+
+ if (action === 'mouseover' && tooltip.timeout) {
+ this.clearTimeout(tooltip);
+ }
+
+ if (action === 'mouseout' && tooltip.timeout) {
+ // cut timeout after mouse out
+ tooltip.timeout = 1000;
+
+ this.setTimeout(tooltip);
+ }
+
+ console.log('mouse leave', event);
+};
+
+/**
+ * Get a tooltip with the given id
+ *
+ * @param {String} id
+ */
+Tooltips.prototype.get = function(id) {
+
+ if (typeof id !== 'string') {
+ id = id.id;
+ }
+
+ return this._tooltips[id];
+};
+
+Tooltips.prototype.clearTimeout = function(tooltip) {
+
+ tooltip = this.get(tooltip);
+
+ if (!tooltip) {
+ return;
+ }
+
+ var removeTimer = tooltip.removeTimer;
+
+ if (removeTimer) {
+ clearTimeout(removeTimer);
+ tooltip.removeTimer = null;
+ }
+};
+
+Tooltips.prototype.setTimeout = function(tooltip) {
+
+ tooltip = this.get(tooltip);
+
+ if (!tooltip) {
+ return;
+ }
+
+ this.clearTimeout(tooltip);
+
+ var self = this;
+
+ tooltip.removeTimer = setTimeout(function() {
+ self.remove(tooltip);
+ }, tooltip.timeout);
+};
+
+/**
+ * Remove an tooltip with the given id
+ *
+ * @param {String} id
+ */
+Tooltips.prototype.remove = function(id) {
+
+ var tooltip = this.get(id);
+
+ if (tooltip) {
+ domRemove(tooltip.html);
+ domRemove(tooltip.htmlContainer);
+
+ delete tooltip.htmlContainer;
+
+ delete this._tooltips[tooltip.id];
+ }
+};
+
+
+Tooltips.prototype.show = function() {
+ setVisible(this._tooltipRoot);
+};
+
+
+Tooltips.prototype.hide = function() {
+ setVisible(this._tooltipRoot, false);
+};
+
+
+Tooltips.prototype._updateRoot = function(viewbox) {
+ var a = viewbox.scale || 1;
+ var d = viewbox.scale || 1;
+
+ var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
+
+ this._tooltipRoot.style.transform = matrix;
+ this._tooltipRoot.style['-ms-transform'] = matrix;
+};
+
+
+Tooltips.prototype._addTooltip = function(tooltip) {
+
+ var id = tooltip.id,
+ html = tooltip.html,
+ htmlContainer,
+ tooltipRoot = this._tooltipRoot;
+
+ // unwrap jquery (for those who need it)
+ if (html.get) {
+ html = html.get(0);
+ }
+
+ // create proper html elements from
+ // tooltip HTML strings
+ if (isString(html)) {
+ html = domify(html);
+ }
+
+ htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
+
+ htmlContainer.appendChild(html);
+
+ if (tooltip.type) {
+ domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
+ }
+
+ if (tooltip.className) {
+ domClasses(htmlContainer).add(tooltip.className);
+ }
+
+ tooltip.htmlContainer = htmlContainer;
+
+ tooltipRoot.appendChild(htmlContainer);
+
+ this._tooltips[id] = tooltip;
+
+ this._updateTooltip(tooltip);
+};
+
+
+Tooltips.prototype._updateTooltip = function(tooltip) {
+
+ var position = tooltip.position,
+ htmlContainer = tooltip.htmlContainer;
+
+ // update overlay html based on tooltip x, y
+
+ setPosition(htmlContainer, position.x, position.y);
+};
+
+
+Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
+
+ forEach(this._tooltips, function(tooltip) {
+ var show = tooltip.show,
+ htmlContainer = tooltip.htmlContainer,
+ visible = true;
+
+ if (show) {
+ if (show.minZoom > viewbox.scale ||
+ show.maxZoom < viewbox.scale) {
+ visible = false;
+ }
+
+ setVisible(htmlContainer, visible);
+ }
+ });
+};
+
+Tooltips.prototype._init = function(config) {
+
+ var self = this;
+
+
+ // scroll/zoom integration
+
+ var updateViewbox = function(viewbox) {
+ self._updateRoot(viewbox);
+ self._updateTooltipVisibilty(viewbox);
+
+ self.show();
+ };
+
+ if (!config || config.deferUpdate !== false) {
+ updateViewbox = debounce(updateViewbox, 300);
+ }
+
+ this._eventBus.on('canvas.viewbox.changed', function(event) {
+ self.hide();
+ updateViewbox(event.viewbox);
+ });
+};
+
+},{"181":181,"204":204,"214":214,"322":322,"325":325,"338":338,"339":339,"342":342,"343":343,"347":347}],160:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'tooltips' ],
+ tooltips: [ 'type', _dereq_(159) ]
+};
+},{"159":159}],161:[function(_dereq_,module,exports){
+'use strict';
+
+function TouchFix(canvas, eventBus) {
+
+ var self = this;
+
+ eventBus.on('canvas.init', function(e) {
+ self.addBBoxMarker(e.svg);
+ });
+}
+
+TouchFix.$inject = [ 'canvas', 'eventBus' ];
+
+module.exports = TouchFix;
+
+
+/**
+ * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element
+ * if there is no shape between 0,0 and viewport elements origin.
+ *
+ * So touchstart event is only fired when the <g class="viewport"> element was hit.
+ * Putting an element over and below the 'viewport' fixes that behavior.
+ */
+TouchFix.prototype.addBBoxMarker = function(paper) {
+
+ var markerStyle = {
+ fill: 'none',
+ class: 'outer-bound-marker'
+ };
+
+ paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
+ paper.rect(10000, 10000, 10, 10).attr(markerStyle);
+};
+
+},{}],162:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(204),
+ domEvent = _dereq_(344),
+ domClosest = _dereq_(341),
+ Hammer = _dereq_(186),
+ Snap = _dereq_(188),
+ Event = _dereq_(178);
+
+var MIN_ZOOM = 0.2,
+ MAX_ZOOM = 4;
+
+var mouseEvents = [
+ 'mousedown',
+ 'mouseup',
+ 'mouseover',
+ 'mouseout',
+ 'click',
+ 'dblclick'
+];
+
+function log() {
+ if (false) {
+ console.log.apply(console, arguments);
+ }
+}
+
+function get(service, injector) {
+ try {
+ return injector.get(service);
+ } catch (e) {
+ return null;
+ }
+}
+
+function createTouchRecognizer(node) {
+
+ function stopEvent(event) {
+ Event.stopEvent(event, true);
+ }
+
+ function stopMouse(event) {
+
+ forEach(mouseEvents, function(e) {
+ domEvent.bind(node, e, stopEvent, true);
+ });
+ }
+
+ function allowMouse(event) {
+ setTimeout(function() {
+ forEach(mouseEvents, function(e) {
+ domEvent.unbind(node, e, stopEvent, true);
+ });
+ }, 500);
+ }
+
+ domEvent.bind(node, 'touchstart', stopMouse, true);
+ domEvent.bind(node, 'touchend', allowMouse, true);
+ domEvent.bind(node, 'touchcancel', allowMouse, true);
+
+ // A touch event recognizer that handles
+ // touch events only (we know, we can already handle
+ // mouse events out of the box)
+
+ var recognizer = new Hammer.Manager(node, {
+ inputClass: Hammer.TouchInput,
+ recognizers: []
+ });
+
+
+ var tap = new Hammer.Tap();
+ var pan = new Hammer.Pan({ threshold: 10 });
+ var press = new Hammer.Press();
+ var pinch = new Hammer.Pinch();
+
+ var doubleTap = new Hammer.Tap({ event: 'doubletap', taps: 2 });
+
+ pinch.requireFailure(pan);
+ pinch.requireFailure(press);
+
+ recognizer.add([ pan, press, pinch, doubleTap, tap ]);
+
+ recognizer.reset = function(force) {
+ var recognizers = this.recognizers,
+ session = this.session;
+
+ if (session.stopped) {
+ return;
+ }
+
+ log('recognizer', 'stop');
+
+ recognizer.stop(force);
+
+ setTimeout(function() {
+ var i, r;
+
+ log('recognizer', 'reset');
+ for (i = 0; !!(r = recognizers[i]); i++) {
+ r.reset();
+ r.state = 8; // FAILED STATE
+ }
+
+ session.curRecognizer = null;
+ }, 0);
+ };
+
+ recognizer.on('hammer.input', function(event) {
+ if (event.srcEvent.defaultPrevented) {
+ recognizer.reset(true);
+ }
+ });
+
+ return recognizer;
+}
+
+/**
+ * A plugin that provides touch events for elements.
+ *
+ * @param {EventBus} eventBus
+ * @param {InteractionEvents} interactionEvents
+ */
+function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
+
+ // optional integrations
+ var dragging = get('dragging', injector),
+ move = get('move', injector),
+ contextPad = get('contextPad', injector),
+ palette = get('palette', injector);
+
+ // the touch recognizer
+ var recognizer;
+
+ function handler(type) {
+
+ return function(event) {
+ log('element', type, event);
+
+ interactionEvents.fire(type, event);
+ };
+ }
+
+ function getGfx(target) {
+ var node = domClosest(target, 'svg, .djs-element', true);
+ return node && new Snap(node);
+ }
+
+ function initEvents(svg) {
+
+ // touch recognizer
+ recognizer = createTouchRecognizer(svg);
+
+ recognizer.on('doubletap', handler('element.dblclick'));
+
+ recognizer.on('tap', handler('element.click'));
+
+ function startGrabCanvas(event) {
+
+ log('canvas', 'grab start');
+
+ var lx = 0, ly = 0;
+
+ function update(e) {
+
+ var dx = e.deltaX - lx,
+ dy = e.deltaY - ly;
+
+ canvas.scroll({ dx: dx, dy: dy });
+
+ lx = e.deltaX;
+ ly = e.deltaY;
+ }
+
+ function end(e) {
+ recognizer.off('panmove', update);
+ recognizer.off('panend', end);
+ recognizer.off('pancancel', end);
+
+ log('canvas', 'grab end');
+ }
+
+ recognizer.on('panmove', update);
+ recognizer.on('panend', end);
+ recognizer.on('pancancel', end);
+ }
+
+ function startGrab(event) {
+
+ var gfx = getGfx(event.target),
+ element = gfx && elementRegistry.get(gfx);
+
+ // recognizer
+ if (move && canvas.getRootElement() !== element) {
+ log('element', 'move start', element, event, true);
+ return move.start(event, element, true);
+ } else {
+ startGrabCanvas(event);
+ }
+ }
+
+ function startZoom(e) {
+
+ log('canvas', 'zoom start');
+
+ var zoom = canvas.zoom(),
+ mid = e.center;
+
+ function update(e) {
+
+ var ratio = 1 - (1 - e.scale) / 1.50,
+ newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
+
+ canvas.zoom(newZoom, mid);
+
+ Event.stopEvent(e, true);
+ }
+
+ function end(e) {
+ recognizer.off('pinchmove', update);
+ recognizer.off('pinchend', end);
+ recognizer.off('pinchcancel', end);
+
+ recognizer.reset(true);
+
+ log('canvas', 'zoom end');
+ }
+
+ recognizer.on('pinchmove', update);
+ recognizer.on('pinchend', end);
+ recognizer.on('pinchcancel', end);
+ }
+
+ recognizer.on('panstart', startGrab);
+ recognizer.on('press', startGrab);
+
+ recognizer.on('pinchstart', startZoom);
+ }
+
+ if (dragging) {
+
+ // simulate hover during dragging
+ eventBus.on('drag.move', function(event) {
+
+ var position = Event.toPoint(event.originalEvent);
+
+ var node = document.elementFromPoint(position.x, position.y),
+ gfx = getGfx(node),
+ element = gfx && elementRegistry.get(gfx);
+
+ if (element !== event.hover) {
+ if (event.hover) {
+ dragging.out(event);
+ }
+
+ if (element) {
+ dragging.hover({ element: element, gfx: gfx });
+
+ event.hover = element;
+ event.hoverGfx = gfx;
+ }
+ }
+ });
+ }
+
+ if (contextPad) {
+
+ eventBus.on('contextPad.create', function(event) {
+ var node = event.pad.html;
+
+ // touch recognizer
+ var padRecognizer = createTouchRecognizer(node);
+
+ padRecognizer.on('panstart', function(event) {
+ log('context-pad', 'panstart', event);
+ contextPad.trigger('dragstart', event, true);
+ });
+
+ padRecognizer.on('press', function(event) {
+ log('context-pad', 'press', event);
+ contextPad.trigger('dragstart', event, true);
+ });
+
+ padRecognizer.on('tap', function(event) {
+ log('context-pad', 'tap', event);
+ contextPad.trigger('click', event);
+ });
+ });
+ }
+
+ if (palette) {
+ eventBus.on('palette.create', function(event) {
+ var node = event.html;
+
+ // touch recognizer
+ var padRecognizer = createTouchRecognizer(node);
+
+ padRecognizer.on('panstart', function(event) {
+ log('palette', 'panstart', event);
+ palette.trigger('dragstart', event, true);
+ });
+
+ padRecognizer.on('press', function(event) {
+ log('palette', 'press', event);
+ palette.trigger('dragstart', event, true);
+ });
+
+ padRecognizer.on('tap', function(event) {
+ log('palette', 'tap', event);
+ palette.trigger('click', event);
+ });
+ });
+ }
+
+ eventBus.on('canvas.init', function(event) {
+ initEvents(event.svg.node);
+ });
+}
+
+
+TouchInteractionEvents.$inject = [
+ 'injector',
+ 'canvas',
+ 'eventBus',
+ 'elementRegistry',
+ 'interactionEvents',
+ 'touchFix'
+];
+
+module.exports = TouchInteractionEvents;
+},{"178":178,"186":186,"188":188,"204":204,"341":341,"344":344}],163:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(103) ],
+ __init__: [ 'touchInteractionEvents' ],
+ touchInteractionEvents: [ 'type', _dereq_(162) ],
+ touchFix: [ 'type', _dereq_(161) ]
+};
+},{"103":103,"161":161,"162":162}],164:[function(_dereq_,module,exports){
+'use strict';
+
+var LayoutUtil = _dereq_(166);
+
+
+/**
+ * A base connection layouter implementation
+ * that layouts the connection by directly connecting
+ * mid(source) + mid(target).
+ */
+function BaseLayouter() {}
+
+module.exports = BaseLayouter;
+
+
+/**
+ * Return the new layouted waypoints for the given connection.
+ *
+ * @param {djs.model.Connection} connection
+ * @param {Object} hints
+ * @param {Boolean} [hints.movedStart=false]
+ * @param {Boolean} [hints.movedEnd=false]
+ *
+ * @return {Array<Point>} the layouted connection waypoints
+ */
+BaseLayouter.prototype.layoutConnection = function(connection, hints) {
+ return [
+ LayoutUtil.getMidPoint(connection.source),
+ LayoutUtil.getMidPoint(connection.target)
+ ];
+};
+
+},{"166":166}],165:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325);
+
+var LayoutUtil = _dereq_(166);
+
+
+function dockingToPoint(docking) {
+ // use the dockings actual point and
+ // retain the original docking
+ return assign({ original: docking.point.original || docking.point }, docking.actual);
+}
+
+
+/**
+ * A {@link ConnectionDocking} that crops connection waypoints based on
+ * the path(s) of the connection source and target.
+ *
+ * @param {djs.core.ElementRegistry} elementRegistry
+ */
+function CroppingConnectionDocking(elementRegistry, renderer) {
+ this._elementRegistry = elementRegistry;
+ this._renderer = renderer;
+}
+
+CroppingConnectionDocking.$inject = [ 'elementRegistry', 'renderer' ];
+
+module.exports = CroppingConnectionDocking;
+
+
+/**
+ * @inheritDoc ConnectionDocking#getCroppedWaypoints
+ */
+CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
+
+ source = source || connection.source;
+ target = target || connection.target;
+
+ var sourceDocking = this.getDockingPoint(connection, source, true),
+ targetDocking = this.getDockingPoint(connection, target);
+
+ var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
+
+ croppedWaypoints.unshift(dockingToPoint(sourceDocking));
+ croppedWaypoints.push(dockingToPoint(targetDocking));
+
+ return croppedWaypoints;
+};
+
+/**
+ * Return the connection docking point on the specified shape
+ *
+ * @inheritDoc ConnectionDocking#getDockingPoint
+ */
+CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
+
+ var waypoints = connection.waypoints,
+ dockingIdx,
+ dockingPoint,
+ croppedPoint;
+
+ dockingIdx = dockStart ? 0 : waypoints.length - 1;
+ dockingPoint = waypoints[dockingIdx];
+
+ croppedPoint = this._getIntersection(shape, connection, dockStart);
+
+ return {
+ point: dockingPoint,
+ actual: croppedPoint || dockingPoint,
+ idx: dockingIdx
+ };
+};
+
+
+////// helper methods ///////////////////////////////////////////////////
+
+CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
+
+ var shapePath = this._getShapePath(shape),
+ connectionPath = this._getConnectionPath(connection);
+
+ return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
+};
+
+CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
+ return this._renderer.getConnectionPath(connection);
+};
+
+CroppingConnectionDocking.prototype._getShapePath = function(shape) {
+ return this._renderer.getShapePath(shape);
+};
+
+CroppingConnectionDocking.prototype._getGfx = function(element) {
+ return this._elementRegistry.getGraphics(element);
+};
+},{"166":166,"325":325}],166:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ sortBy = _dereq_(211);
+
+var Snap = _dereq_(188);
+
+/**
+ * Returns whether two points are in a horizontal or vertical line.
+ *
+ * @param {Point} a
+ * @param {Point} b
+ *
+ * @return {String|Boolean} returns false if the points are not
+ * aligned or 'h|v' if they are aligned
+ * horizontally / vertically.
+ */
+function pointsAligned(a, b) {
+ switch (true) {
+ case a.x === b.x:
+ return 'h';
+ case a.y === b.y:
+ return 'v';
+ }
+
+ return false;
+}
+
+module.exports.pointsAligned = pointsAligned;
+
+
+function roundPoint(point) {
+
+ return {
+ x: Math.round(point.x),
+ y: Math.round(point.y)
+ };
+}
+
+module.exports.roundPoint = roundPoint;
+
+
+function pointsEqual(a, b) {
+ return a.x === b.x && a.y === b.y;
+}
+
+module.exports.pointsEqual = pointsEqual;
+
+
+function pointDistance(a, b) {
+ return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
+}
+
+module.exports.pointDistance = pointDistance;
+
+
+function asTRBL(bounds) {
+ return {
+ top: bounds.y,
+ right: bounds.x + (bounds.width || 0),
+ bottom: bounds.y + (bounds.height || 0),
+ left: bounds.x
+ };
+}
+
+module.exports.asTRBL = asTRBL;
+
+
+function getMidPoint(bounds) {
+ return roundPoint({
+ x: bounds.x + bounds.width / 2,
+ y: bounds.y + bounds.height / 2
+ });
+}
+
+module.exports.getMidPoint = getMidPoint;
+
+
+////// orientation utils //////////////////////////////
+
+function getOrientation(rect, reference, pointDistance) {
+
+ pointDistance = pointDistance || 0;
+
+ var rectOrientation = asTRBL(rect),
+ referenceOrientation = asTRBL(reference);
+
+ var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
+ right = rectOrientation.left - pointDistance >= referenceOrientation.right,
+ bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
+ left = rectOrientation.right + pointDistance <= referenceOrientation.left;
+
+ var vertical = top ? 'top' : (bottom ? 'bottom' : null),
+ horizontal = left ? 'left' : (right ? 'right' : null);
+
+ if (horizontal && vertical) {
+ return vertical + '-' + horizontal;
+ } else
+ if (horizontal || vertical) {
+ return horizontal || vertical;
+ } else {
+ return 'intersect';
+ }
+}
+
+module.exports.getOrientation = getOrientation;
+
+
+function hasAnyOrientation(rect, reference, pointDistance, locations) {
+
+ if (isArray(pointDistance)) {
+ locations = pointDistance;
+ pointDistance = 0;
+ }
+
+ var orientation = getOrientation(rect, reference, pointDistance);
+
+ return locations.indexOf(orientation) !== -1;
+}
+
+module.exports.hasAnyOrientation = hasAnyOrientation;
+
+
+////// intersection utils //////////////////////////////
+
+function getElementLineIntersection(elementPath, linePath, cropStart) {
+
+ var intersections = getIntersections(elementPath, linePath);
+
+ // recognize intersections
+ // only one -> choose
+ // two close together -> choose first
+ // two or more distinct -> pull out appropriate one
+ // none -> ok (fallback to point itself)
+ if (intersections.length === 1) {
+ return roundPoint(intersections[0]);
+ } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
+ return roundPoint(intersections[0]);
+ } else if (intersections.length > 1) {
+
+ // sort by intersections based on connection segment +
+ // distance from start
+ intersections = sortBy(intersections, function(i) {
+ var distance = Math.floor(i.t2 * 100) || 1;
+
+ distance = 100 - distance;
+
+ distance = (distance < 10 ? '0' : '') + distance;
+
+ // create a sort string that makes sure we sort
+ // line segment ASC + line segment position DESC (for cropStart)
+ // line segment ASC + line segment position ASC (for cropEnd)
+ return i.segment2 + '#' + distance;
+ });
+
+ return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
+ }
+
+ return null;
+}
+
+module.exports.getElementLineIntersection = getElementLineIntersection;
+
+
+function getIntersections(a, b) {
+ return Snap.path.intersection(a, b);
+}
+
+module.exports.getIntersections = getIntersections;
+},{"188":188,"211":211,"316":316}],167:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ find = _dereq_(203);
+
+var LayoutUtil = _dereq_(166),
+ Geometry = _dereq_(179);
+
+var MIN_DISTANCE = 20;
+
+
+/**
+ * Returns the mid points for a manhattan connection between two points.
+ *
+ * @example
+ *
+ * [a]----[x]
+ * |
+ * [x]--->[b]
+ *
+ * @param {Point} a
+ * @param {Point} b
+ * @param {String} directions
+ *
+ * @return {Array<Point>}
+ */
+module.exports.getMidPoints = function(a, b, directions) {
+
+ directions = directions || 'h:h';
+
+ var xmid, ymid;
+
+ // one point, next to a
+ if (directions === 'h:v') {
+ return [ { x: b.x, y: a.y } ];
+ } else
+ // one point, above a
+ if (directions === 'v:h') {
+ return [ { x: a.x, y: b.y } ];
+ } else
+ // vertical edge xmid
+ if (directions === 'h:h') {
+ xmid = Math.round((b.x - a.x) / 2 + a.x);
+
+ return [
+ { x: xmid, y: a.y },
+ { x: xmid, y: b.y }
+ ];
+ } else
+ // horizontal edge ymid
+ if (directions === 'v:v') {
+ ymid = Math.round((b.y - a.y) / 2 + a.y);
+
+ return [
+ { x: a.x, y: ymid },
+ { x: b.x, y: ymid }
+ ];
+ } else {
+ throw new Error(
+ 'unknown directions: <' + directions + '>: ' +
+ 'directions must be specified as {a direction}:{b direction} (direction in h|v)');
+ }
+};
+
+
+/**
+ * Create a connection between the two points according
+ * to the manhattan layout (only horizontal and vertical) edges.
+ *
+ * @param {Point} a
+ * @param {Point} b
+ *
+ * @param {String} [directions='h:h'] specifies manhattan directions for each point as {adirection}:{bdirection}.
+ A directionfor a point is either `h` (horizontal) or `v` (vertical)
+ *
+ * @return {Array<Point>}
+ */
+module.exports.connectPoints = function(a, b, directions) {
+
+ var points = [];
+
+ if (!LayoutUtil.pointsAligned(a, b)) {
+ points = this.getMidPoints(a, b, directions);
+ }
+
+ points.unshift(a);
+ points.push(b);
+
+ return points;
+};
+
+
+/**
+ * Connect two rectangles using a manhattan layouted connection.
+ *
+ * @param {Bounds} source source rectangle
+ * @param {Bounds} target target rectangle
+ * @param {Point} [start] source docking
+ * @param {Point} [end] target docking
+ *
+ * @return {Array<Point>} connection points
+ */
+module.exports.connectRectangles = function(source, target, start, end, options) {
+
+ options = options || {};
+
+ var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
+
+ var directions = this.getDirections(source, target, options.preferVertical);
+
+ start = start || LayoutUtil.getMidPoint(source);
+ end = end || LayoutUtil.getMidPoint(target);
+
+ // overlapping elements
+ if (!directions) {
+ return;
+ }
+
+ if (directions === 'h:h') {
+
+ switch (orientation) {
+ case 'top-right':
+ case 'right':
+ case 'bottom-right':
+ start = { original: start, x: source.x, y: start.y };
+ end = { original: end, x: target.x + target.width, y: end.y };
+ break;
+ case 'top-left':
+ case 'left':
+ case 'bottom-left':
+ start = { original: start, x: source.x + source.width, y: start.y };
+ end = { original: end, x: target.x, y: end.y };
+ break;
+ }
+ }
+
+ if (directions === 'v:v') {
+
+ switch (orientation) {
+ case 'top-left':
+ case 'top':
+ case 'top-right':
+ start = { original: start, x: start.x, y: source.y + source.height };
+ end = { original: end, x: end.x, y: target.y };
+ break;
+ case 'bottom-left':
+ case 'bottom':
+ case 'bottom-right':
+ start = { original: start, x: start.x, y: source.y };
+ end = { original: end, x: end.x, y: target.y + target.height };
+ break;
+ }
+ }
+
+ return this.connectPoints(start, end, directions);
+};
+
+/**
+ * Repair the connection between two rectangles, of which one has been updated.
+ *
+ * @param {Bounds} source
+ * @param {Bounds} target
+ * @param {Point} [start]
+ * @param {Point} [end]
+ * @param {Array<Point>} waypoints
+ * @param {Object} [hints]
+ * @param {Boolean} hints.preferStraight
+ * @param {Boolean} hints.preferVertical
+ * @param {Boolean} hints.startChanged
+ * @param {Boolean} hints.endChanged
+ *
+ * @return {Array<Point>} repaired waypoints
+ */
+module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
+
+ if (isArray(start)) {
+ waypoints = start;
+ hints = end;
+
+ start = LayoutUtil.getMidPoint(source);
+ end = LayoutUtil.getMidPoint(target);
+ }
+
+ hints = hints || {};
+
+
+ var repairedWaypoints;
+
+ // just layout non-existing or simple connections
+ // attempt to render straight lines, if required
+ if (!waypoints || waypoints.length < 3) {
+
+ if (hints.preferStraight) {
+ // attempt to layout a straight line
+ repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
+ }
+ } else {
+ // check if we layout from start or end
+ if (hints.endChanged) {
+ repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
+ repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
+ } else
+ if (hints.startChanged) {
+ repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
+ }
+ // or whether nothing seems to have changed
+ else {
+ repairedWaypoints = waypoints;
+ }
+ }
+
+ // simply reconnect if nothing else worked
+ if (!repairedWaypoints) {
+ return this.connectRectangles(source, target, start, end, hints);
+ }
+
+ return repairedWaypoints;
+};
+
+function max(a, b) {
+ return Math.max(a, b);
+}
+
+function min(a, b) {
+ return Math.min(a, b);
+}
+
+function inRange(a, start, end) {
+ return a >= start && a <= end;
+}
+
+module.exports.layoutStraight = function(source, target, start, end, hints) {
+
+ var startX, endX, x,
+ startY, endY, y;
+
+ startX = max(source.x + 10, target.x + 10);
+ endX = min(source.x + source.width - 10, target.x + target.width - 10);
+
+ if (startX < endX) {
+
+ if (source.width === target.width) {
+
+ if (hints.endChanged && inRange(end.x, startX, endX)) {
+ x = end.x;
+ } else
+ if (inRange(start.x, startX, endX)) {
+ x = start.x;
+ }
+ }
+
+ if (x === undefined) {
+ if (source.width < target.width && inRange(start.x, startX, endX)) {
+ x = start.x;
+ } else
+ if (source.width > target.width && inRange(end.x, startX, endX)) {
+ x = end.x;
+ } else {
+ x = (startX + endX) / 2;
+ }
+ }
+ }
+
+ startY = max(source.y + 10, target.y + 10);
+ endY = min(source.y + source.height - 10, target.y + target.height - 10);
+
+ if (startY < endY) {
+
+ if (source.height === target.height) {
+ if (hints.endChanged && inRange(end.y, startY, endY)) {
+ y = end.y;
+ } else
+ if (inRange(start.y, startY, endY)) {
+ y = start.y;
+ }
+ }
+
+ if (y === undefined) {
+ if (source.height <= target.height && inRange(start.y, startY, endY)) {
+ y = start.y;
+ } else
+ if (target.height <= source.height && inRange(end.y, startY, endY)) {
+ y = end.y;
+ } else {
+ y = (startY + endY) / 2;
+ }
+ }
+ }
+
+ // cannot layout straight
+ if (x === undefined && y === undefined) {
+ return null;
+ }
+
+ return [
+ {
+ x: x !== undefined ? x : start.x,
+ y: y !== undefined ? y : start.y
+ },
+ {
+ x: x !== undefined ? x : end.x,
+ y: y !== undefined ? y : end.y
+ }
+ ];
+};
+
+
+/**
+ * Repair a connection from one side that moved.
+ *
+ * @param {Bounds} moved
+ * @param {Bounds} other
+ * @param {Point} newDocking
+ * @param {Array<Point>} points originalPoints from moved to other
+ *
+ * @return {Array<Point>} the repaired points between the two rectangles
+ */
+module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
+
+ function needsRelayout(moved, other, points) {
+
+ if (points.length < 3) {
+ return true;
+ }
+
+ if (points.length > 4) {
+ return false;
+ }
+
+ // relayout if two points overlap
+ // this is most likely due to
+ return !!find(points, function(p, idx) {
+ var q = points[idx - 1];
+
+ return q && Geometry.distance(p, q) < 3;
+ });
+ }
+
+ function repairBendpoint(candidate, oldPeer, newPeer) {
+
+ var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
+
+ switch (alignment) {
+ case 'v':
+ // repair vertical alignment
+ return { x: candidate.x, y: newPeer.y };
+ case 'h':
+ // repair horizontal alignment
+ return { x: newPeer.x, y: candidate.y };
+ }
+
+ return { x: candidate.x, y: candidate. y };
+ }
+
+ function removeOverlapping(points, a, b) {
+ var i;
+
+ for (i = points.length - 2; i !== 0; i--) {
+
+ // intersects (?) break, remove all bendpoints up to this one and relayout
+ if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
+ Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
+
+ // return sliced old connection
+ return points.slice(i);
+ }
+ }
+
+ return points;
+ }
+
+
+ // (0) only repair what has layoutable bendpoints
+
+ // (1) if only one bendpoint and on shape moved onto other shapes axis
+ // (horizontally / vertically), relayout
+
+ if (needsRelayout(moved, other, points)) {
+ return null;
+ }
+
+ var oldDocking = points[0],
+ newPoints = points.slice(),
+ slicedPoints;
+
+ // (2) repair only last line segment and only if it was layouted before
+
+ newPoints[0] = newDocking;
+ newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
+
+
+ // (3) if shape intersects with any bendpoint after repair,
+ // remove all segments up to this bendpoint and repair from there
+
+ slicedPoints = removeOverlapping(newPoints, moved, other);
+ if (slicedPoints !== newPoints) {
+ return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
+ }
+
+ return newPoints;
+};
+
+/**
+ * Returns the default manhattan directions connecting two rectangles.
+ *
+ * @param {Bounds} source
+ * @param {Bounds} target
+ * @param {Boolean} preferVertical
+ *
+ * @return {String}
+ */
+module.exports.getDirections = function(source, target, preferVertical) {
+ var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
+
+ switch (orientation) {
+ case 'intersect':
+ return null;
+
+ case 'top':
+ case 'bottom':
+ return 'v:v';
+
+ case 'left':
+ case 'right':
+ return 'h:h';
+
+ default:
+ return preferVertical ? 'v:v' : 'h:h';
+ }
+};
+},{"166":166,"179":179,"203":203,"316":316}],168:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(325),
+ inherits = _dereq_(195);
+
+var Refs = _dereq_(356);
+
+var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
+ labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),
+ outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),
+ incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });
+
+/**
+ * @namespace djs.model
+ */
+
+/**
+ * @memberOf djs.model
+ */
+
+/**
+ * The basic graphical representation
+ *
+ * @class
+ *
+ * @abstract
+ */
+function Base() {
+
+ /**
+ * The object that backs up the shape
+ *
+ * @name Base#businessObject
+ * @type Object
+ */
+ Object.defineProperty(this, 'businessObject', {
+ writable: true
+ });
+
+ /**
+ * The parent shape
+ *
+ * @name Base#parent
+ * @type Shape
+ */
+ parentRefs.bind(this, 'parent');
+
+ /**
+ * @name Base#label
+ * @type Label
+ */
+ labelRefs.bind(this, 'label');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#outgoing
+ * @type Array<Connection>
+ */
+ outgoingRefs.bind(this, 'outgoing');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#incoming
+ * @type Array<Connection>
+ */
+ incomingRefs.bind(this, 'incoming');
+}
+
+
+/**
+ * A graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Shape() {
+ Base.call(this);
+
+ /**
+ * The list of children
+ *
+ * @name Shape#children
+ * @type Array<Base>
+ */
+ parentRefs.bind(this, 'children');
+}
+
+inherits(Shape, Base);
+
+
+/**
+ * A root graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Root() {
+ Shape.call(this);
+}
+
+inherits(Root, Shape);
+
+
+/**
+ * A label for an element
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Label() {
+ Shape.call(this);
+
+ /**
+ * The labeled element
+ *
+ * @name Label#labelTarget
+ * @type Base
+ */
+ labelRefs.bind(this, 'labelTarget');
+}
+
+inherits(Label, Shape);
+
+
+/**
+ * A connection between two elements
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Connection() {
+ Base.call(this);
+
+ /**
+ * The element this connection originates from
+ *
+ * @name Connection#source
+ * @type Base
+ */
+ outgoingRefs.bind(this, 'source');
+
+ /**
+ * The element this connection points to
+ *
+ * @name Connection#target
+ * @type Base
+ */
+ incomingRefs.bind(this, 'target');
+}
+
+inherits(Connection, Base);
+
+
+var types = {
+ connection: Connection,
+ shape: Shape,
+ label: Label,
+ root: Root
+};
+
+/**
+ * Creates a new model element of the specified type
+ *
+ * @method create
+ *
+ * @example
+ *
+ * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });
+ * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });
+ *
+ * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });
+ *
+ * @param {String} type lower-cased model name
+ * @param {Object} attrs attributes to initialize the new model instance with
+ *
+ * @return {Base} the new model instance
+ */
+module.exports.create = function(type, attrs) {
+ var Type = types[type];
+ if (!Type) {
+ throw new Error('unknown type: <' + type + '>');
+ }
+ return assign(new Type(), attrs);
+};
+
+
+module.exports.Base = Base;
+module.exports.Root = Root;
+module.exports.Shape = Shape;
+module.exports.Connection = Connection;
+module.exports.Label = Label;
+},{"195":195,"325":325,"356":356}],169:[function(_dereq_,module,exports){
+'use strict';
+
+var Cursor = _dereq_(176),
+ ClickTrap = _dereq_(174),
+ domEvent = _dereq_(344),
+ Event = _dereq_(178);
+
+function substract(p1, p2) {
+ return {
+ x: p1.x - p2.x,
+ y: p1.y - p2.y
+ };
+}
+
+function length(point) {
+ return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
+}
+
+
+var THRESHOLD = 15;
+
+
+function MoveCanvas(eventBus, canvas) {
+
+ var container = canvas._container,
+ context;
+
+
+ function handleMove(event) {
+
+ var start = context.start,
+ position = Event.toPoint(event),
+ delta = substract(position, start);
+
+ if (!context.dragging && length(delta) > THRESHOLD) {
+ context.dragging = true;
+
+ // prevent mouse click in this
+ // interaction sequence
+ ClickTrap.install();
+
+ Cursor.set('move');
+ }
+
+ if (context.dragging) {
+
+ var lastPosition = context.last || context.start;
+
+ delta = substract(position, lastPosition);
+
+ canvas.scroll({
+ dx: delta.x,
+ dy: delta.y
+ });
+
+ context.last = position;
+ }
+
+ // prevent select
+ event.preventDefault();
+ }
+
+
+ function handleEnd(event) {
+ domEvent.unbind(document, 'mousemove', handleMove);
+ domEvent.unbind(document, 'mouseup', handleEnd);
+
+ context = null;
+
+ Cursor.unset();
+
+ // prevent select
+ Event.stopEvent(event);
+ }
+
+ function handleStart(event) {
+
+ // reject non-left left mouse button or modifier key
+ if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
+ return;
+ }
+
+ context = {
+ start: Event.toPoint(event)
+ };
+
+ domEvent.bind(document, 'mousemove', handleMove);
+ domEvent.bind(document, 'mouseup', handleEnd);
+
+ // prevent select
+ Event.stopEvent(event);
+ }
+
+ domEvent.bind(container, 'mousedown', handleStart);
+}
+
+
+MoveCanvas.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = MoveCanvas;
+
+},{"174":174,"176":176,"178":178,"344":344}],170:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'moveCanvas' ],
+ moveCanvas: [ 'type', _dereq_(169) ]
+};
+},{"169":169}],171:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(163) ]
+};
+},{"163":163}],172:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(344);
+
+var hasPrimaryModifier = _dereq_(182).hasPrimaryModifier,
+ hasSecondaryModifier = _dereq_(182).hasSecondaryModifier;
+
+var isMac = _dereq_(183).isMac;
+
+
+function ZoomScroll(events, canvas) {
+
+ var RANGE = { min: 0.2, max: 4 };
+
+ function cap(scale) {
+ return Math.max(RANGE.min, Math.min(RANGE.max, scale));
+ }
+
+ function reset() {
+ canvas.zoom('fit-viewport');
+ }
+
+ function zoom(direction, position) {
+
+ var currentZoom = canvas.zoom();
+ var factor = Math.pow(1 + Math.abs(direction) , direction > 0 ? 1 : -1);
+
+ canvas.zoom(cap(currentZoom * factor), position);
+ }
+
+ function scroll(delta) {
+ canvas.scroll(delta);
+ }
+
+ function init(element) {
+
+ domEvent.bind(element, 'wheel', function(event) {
+
+ event.preventDefault();
+
+ // mouse-event: SELECTION_KEY
+ // mouse-event: AND_KEY
+ var isVerticalScroll = hasPrimaryModifier(event),
+ isHorizontalScroll = hasSecondaryModifier(event);
+
+ var factor;
+
+ if (isVerticalScroll || isHorizontalScroll) {
+
+ if (isMac) {
+ factor = event.deltaMode === 0 ? 1.25 : 50;
+ } else {
+ factor = event.deltaMode === 0 ? 1/40 : 1/2;
+ }
+
+ var delta = {};
+
+ if (isHorizontalScroll) {
+ delta.dx = (factor * (event.deltaX || event.deltaY));
+ } else {
+ delta.dy = (factor * event.deltaY);
+ }
+
+ scroll(delta);
+ } else {
+ factor = (event.deltaMode === 0 ? 1/40 : 1/2);
+
+ var elementRect = element.getBoundingClientRect();
+
+ var offset = {
+ x: event.clientX - elementRect.left,
+ y: event.clientY - elementRect.top
+ };
+
+ // zoom in relative to diagram {x,y} coordinates
+ zoom(event.deltaY * factor / (-5), offset);
+ }
+ });
+ }
+
+ events.on('canvas.init', function(e) {
+ init(canvas._container);
+ });
+
+ // API
+ this.zoom = zoom;
+ this.reset = reset;
+}
+
+
+ZoomScroll.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = ZoomScroll;
+
+
+},{"182":182,"183":183,"344":344}],173:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'zoomScroll' ],
+ zoomScroll: [ 'type', _dereq_(172) ]
+};
+},{"172":172}],174:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(344),
+ stopEvent = _dereq_(178).stopEvent;
+
+function trap(event) {
+ stopEvent(event);
+
+ toggle(false);
+}
+
+function toggle(active) {
+ domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
+}
+
+/**
+ * Installs a click trap that prevents a ghost click following a dragging operation.
+ *
+ * @return {Function} a function to immediately remove the installed trap.
+ */
+function install() {
+
+ toggle(true);
+
+ return function() {
+ toggle(false);
+ };
+}
+
+module.exports.install = install;
+},{"178":178,"344":344}],175:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Failsafe remove an element from a collection
+ *
+ * @param {Array<Object>} [collection]
+ * @param {Object} [element]
+ *
+ * @return {Object} the element that got removed or undefined
+ */
+module.exports.remove = function(collection, element) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ var idx = collection.indexOf(element);
+ if (idx === -1) {
+ return;
+ }
+
+ collection.splice(idx, 1);
+
+ return element;
+};
+
+/**
+ * Fail save add an element to the given connection, ensuring
+ * it does not yet exist.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ * @param {Number} idx
+ */
+module.exports.add = function(collection, element, idx) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ if (isNaN(idx)) {
+ idx = -1;
+ }
+
+ var currentIdx = collection.indexOf(element);
+
+ if (currentIdx !== -1) {
+
+ if (currentIdx === idx) {
+ // nothing to do, position has not changed
+ return;
+ } else {
+
+ if (idx !== -1) {
+ // remove from current position
+ collection.splice(currentIdx, 1);
+ } else {
+ // already exists in collection
+ return;
+ }
+ }
+ }
+
+ if (idx !== -1) {
+ // insert at specified position
+ collection.splice(idx, 0, element);
+ } else {
+ // push to end
+ collection.push(element);
+ }
+};
+
+
+/**
+ * Fail get the index of an element in a collection.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ *
+ * @return {Number} the index or -1 if collection or element do
+ * not exist or the element is not contained.
+ */
+module.exports.indexOf = function(collection, element) {
+
+ if (!collection || !element) {
+ return -1;
+ }
+
+ return collection.indexOf(element);
+};
+
+},{}],176:[function(_dereq_,module,exports){
+'use strict';
+
+var domClasses = _dereq_(339);
+
+var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
+
+
+module.exports.set = function(mode) {
+ var classes = domClasses(document.body);
+
+ classes.removeMatching(CURSOR_CLS_PATTERN);
+
+ if (mode) {
+ classes.add('djs-cursor-' + mode);
+ }
+};
+
+module.exports.unset = function() {
+ this.set(null);
+};
+},{"339":339}],177:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(316),
+ isNumber = _dereq_(319),
+ groupBy = _dereq_(205),
+ forEach = _dereq_(204);
+
+/**
+ * Adds an element to a collection and returns true if the
+ * element was added.
+ *
+ * @param {Array<Object>} elements
+ * @param {Object} e
+ * @param {Boolean} unique
+ */
+function add(elements, e, unique) {
+ var canAdd = !unique || elements.indexOf(e) === -1;
+
+ if (canAdd) {
+ elements.push(e);
+ }
+
+ return canAdd;
+}
+
+function eachElement(elements, fn, depth) {
+
+ depth = depth || 0;
+
+ forEach(elements, function(s, i) {
+ var filter = fn(s, i, depth);
+
+ if (isArray(filter) && filter.length) {
+ eachElement(filter, fn, depth + 1);
+ }
+ });
+}
+
+/**
+ * Collects self + child elements up to a given depth from a list of elements.
+ *
+ * @param {Array<djs.model.Base>} elements the elements to select the children from
+ * @param {Boolean} unique whether to return a unique result set (no duplicates)
+ * @param {Number} maxDepth the depth to search through or -1 for infinite
+ *
+ * @return {Array<djs.model.Base>} found elements
+ */
+function selfAndChildren(elements, unique, maxDepth) {
+ var result = [],
+ processedChildren = [];
+
+ eachElement(elements, function(element, i, depth) {
+ add(result, element, unique);
+
+ var children = element.children;
+
+ // max traversal depth not reached yet
+ if (maxDepth === -1 || depth < maxDepth) {
+
+ // children exist && children not yet processed
+ if (children && add(processedChildren, children, unique)) {
+ return children;
+ }
+ }
+ });
+
+ return result;
+}
+
+/**
+ * Return self + direct children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndDirectChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, 1);
+}
+
+/**
+ * Return self + ALL children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndAllChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, -1);
+}
+
+/**
+ * Gets the the closure fo all selected elements,
+ * their connections and
+ *
+ * @param {Array<djs.model.Base>} elements
+ * @return {Object} enclosure
+ */
+function getClosure(elements) {
+
+ // original elements passed to this function
+ var topLevel = groupBy(elements, function(e) { return e.id; });
+
+ var allShapes = {},
+ allConnections = {},
+ enclosedElements = {},
+ enclosedConnections = {};
+
+ function handleConnection(c) {
+ if (topLevel[c.source.id] && topLevel[c.target.id]) {
+ topLevel[c.id] = c;
+ }
+
+ // not enclosed as a child, but maybe logically
+ // (connecting two moved elements?)
+ if (allShapes[c.source.id] && allShapes[c.target.id]) {
+ enclosedConnections[c.id] = enclosedElements[c.id] = c;
+ }
+
+ allConnections[c.id] = c;
+ }
+
+ function handleElement(element) {
+
+ enclosedElements[element.id] = element;
+
+ if (element.waypoints) {
+ // remember connection
+ enclosedConnections[element.id] = allConnections[element.id] = element;
+ } else {
+ // remember shape
+ allShapes[element.id] = element;
+
+ // remember all connections
+ forEach(element.incoming, handleConnection);
+
+ forEach(element.outgoing, handleConnection);
+
+ // recurse into children
+ return element.children;
+ }
+ }
+
+ eachElement(elements, handleElement);
+
+ return {
+ allShapes: allShapes,
+ allConnections: allConnections,
+ topLevel: topLevel,
+ enclosedConnections: enclosedConnections,
+ enclosedElements: enclosedElements
+ };
+}
+
+/**
+ * Returns the surrounding bbox for all elements in the array or the element primitive.
+ */
+function getBBox(elements, stopRecursion) {
+
+ stopRecursion = !!stopRecursion;
+ if (!isArray(elements)) {
+ elements = [elements];
+ }
+
+ var minX,
+ minY,
+ maxX,
+ maxY;
+
+ forEach(elements, function(element) {
+
+ // If element is a connection the bbox must be computed first
+ var bbox = element;
+ if (element.waypoints && !stopRecursion) {
+ bbox = getBBox(element.waypoints, true);
+ }
+
+ var x = bbox.x,
+ y = bbox.y,
+ height = bbox.height || 0,
+ width = bbox.width || 0;
+
+ if (x < minX || minX === undefined) {
+ minX = x;
+ }
+ if (y < minY || minY === undefined) {
+ minY = y;
+ }
+
+ if ((x + width) > maxX || maxX === undefined) {
+ maxX = x + width;
+ }
+ if ((y + height) > maxY || maxY === undefined) {
+ maxY = y + height;
+ }
+ });
+
+ return {
+ x: minX,
+ y: minY,
+ height: maxY - minY,
+ width: maxX - minX
+ };
+}
+
+
+/**
+ * Returns all elements that are enclosed from the bounding box.
+ *
+ * @param {Array<Object>} elements List of Elements to search through
+ * @param {Object} bbox the enclosing bbox.
+ * <ul>
+ * <li>If bbox.(width|height) is not specified
+ * the method returns all elements with element.x/y &gt; bbox.x/y
+ * </li>
+ * <li>If only bbox.x or bbox.y is specified, method return all elements with
+ * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
+ * </ul>
+ *
+ */
+function getEnclosedElements(elements, bbox) {
+
+ var filteredElements = {};
+
+ forEach(elements, function(element) {
+
+ var e = element;
+
+ if (e.waypoints) {
+ e = getBBox(e);
+ }
+
+ if (!isNumber(bbox.y) && (e.x > bbox.x)) {
+ filteredElements[element.id] = element;
+ }
+ if (!isNumber(bbox.x) && (e.y > bbox.y)) {
+ filteredElements[element.id] = element;
+ }
+ if (e.x > bbox.x && e.y > bbox.y) {
+ if (isNumber(bbox.width) && isNumber(bbox.height) &&
+ e.width + e.x < bbox.width + bbox.x &&
+ e.height + e.y < bbox.height + bbox.y) {
+
+ filteredElements[element.id] = element;
+ } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
+ filteredElements[element.id] = element;
+ }
+ }
+ });
+
+ return filteredElements;
+}
+
+
+
+module.exports.eachElement = eachElement;
+module.exports.selfAndDirectChildren = selfAndDirectChildren;
+module.exports.selfAndAllChildren = selfAndAllChildren;
+module.exports.getBBox = getBBox;
+module.exports.getEnclosedElements = getEnclosedElements;
+
+module.exports.getClosure = getClosure;
+
+},{"204":204,"205":205,"316":316,"319":319}],178:[function(_dereq_,module,exports){
+'use strict';
+
+function __preventDefault(event) {
+ return event && event.preventDefault();
+}
+
+function __stopPropagation(event, immediate) {
+ if (!event) {
+ return;
+ }
+
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
+ if (immediate && event.stopImmediatePropagation) {
+ event.stopImmediatePropagation();
+ }
+}
+
+
+function getOriginal(event) {
+ return event.originalEvent || event.srcEvent;
+}
+
+module.exports.getOriginal = getOriginal;
+
+
+function stopEvent(event, immediate) {
+ stopPropagation(event, immediate);
+ preventDefault(event);
+}
+
+module.exports.stopEvent = stopEvent;
+
+
+function preventDefault(event) {
+ __preventDefault(event);
+ __preventDefault(getOriginal(event));
+}
+
+module.exports.preventDefault = preventDefault;
+
+
+function stopPropagation(event, immediate) {
+ __stopPropagation(event, immediate);
+ __stopPropagation(getOriginal(event), immediate);
+}
+
+module.exports.stopPropagation = stopPropagation;
+
+
+function toPoint(event) {
+
+ if (event.pointers && event.pointers.length) {
+ event = event.pointers[0];
+ }
+
+ if (event.touches && event.touches.length) {
+ event = event.touches[0];
+ }
+
+ return event ? {
+ x: event.clientX,
+ y: event.clientY
+ } : null;
+}
+
+module.exports.toPoint = toPoint;
+
+},{}],179:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Computes the distance between two points
+ *
+ * @param {Point} p
+ * @param {Point} q
+ *
+ * @return {Number} distance
+ */
+var distance = module.exports.distance = function(p, q) {
+ return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
+};
+
+/**
+ * Returns true if the point r is on the line between p and y
+ *
+ * @param {Point} p
+ * @param {Point} q
+ * @param {Point} r
+ *
+ * @return {Boolean}
+ */
+module.exports.pointsOnLine = function(p, q, r) {
+
+ if (!p || !q || !r) {
+ return false;
+ }
+
+ var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
+ dist = distance(p, q);
+
+ // @see http://stackoverflow.com/a/907491/412190
+ return Math.abs(val / dist) < 5;
+};
+
+module.exports.pointInRect = function(p, rect, tolerance) {
+ tolerance = tolerance || 0;
+
+ return p.x > rect.x - tolerance &&
+ p.y > rect.y - tolerance &&
+ p.x < rect.x + rect.width + tolerance &&
+ p.y < rect.y + rect.height + tolerance;
+};
+},{}],180:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * SVGs for elements are generated by the {@link GraphicsFactory}.
+ *
+ * This utility gives quick access to the important semantic
+ * parts of an element.
+ */
+
+/**
+ * Returns the visual part of a diagram element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Snap<SVGElement>}
+ */
+function getVisual(gfx) {
+ return gfx.select('.djs-visual');
+}
+
+/**
+ * Returns the children for a given diagram element.
+ *
+ * @param {Snap<SVGElement>} gfx
+ * @return {Snap<SVGElement>}
+ */
+function getChildren(gfx) {
+ return gfx.parent().children()[1];
+}
+
+/**
+ * Returns the visual bbox of an element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Bounds}
+ */
+function getBBox(gfx) {
+ return getVisual(gfx).select('*').getBBox();
+}
+
+
+module.exports.getVisual = getVisual;
+module.exports.getChildren = getChildren;
+module.exports.getBBox = getBBox;
+},{}],181:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Util that provides unique IDs.
+ *
+ * @class djs.util.IdGenerator
+ * @constructor
+ * @memberOf djs.util
+ *
+ * The ids can be customized via a given prefix and contain a random value to avoid collisions.
+ *
+ * @param {String} prefix a prefix to prepend to generated ids (for better readability)
+ */
+function IdGenerator(prefix) {
+
+ this._counter = 0;
+ this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
+}
+
+module.exports = IdGenerator;
+
+/**
+ * Returns a next unique ID.
+ *
+ * @method djs.util.IdGenerator#next
+ *
+ * @returns {String} the id
+ */
+IdGenerator.prototype.next = function() {
+ return this._prefix + (++this._counter);
+};
+
+},{}],182:[function(_dereq_,module,exports){
+'use strict';
+
+var getOriginalEvent = _dereq_(178).getOriginal;
+
+var isMac = _dereq_(183).isMac;
+
+
+function isPrimaryButton(event) {
+ // button === 0 -> left áka primary mouse button
+ return !(getOriginalEvent(event) || event).button;
+}
+
+module.exports.isPrimaryButton = isPrimaryButton;
+
+module.exports.isMac = isMac;
+
+module.exports.hasPrimaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ if (!isPrimaryButton(event)) {
+ return false;
+ }
+
+ // Use alt as primary modifier key for mac OS
+ if (isMac()) {
+ return originalEvent.altKey;
+ } else {
+ return originalEvent.ctrlKey;
+ }
+};
+
+
+module.exports.hasSecondaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ return isPrimaryButton(event) && originalEvent.shiftKey;
+};
+
+},{"178":178,"183":183}],183:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.isMac = function isMac() {
+ return (/mac/i).test(navigator.platform);
+};
+},{}],184:[function(_dereq_,module,exports){
+'use strict';
+
+var isObject = _dereq_(320),
+ assign = _dereq_(325),
+ forEach = _dereq_(204),
+ reduce = _dereq_(208),
+ merge = _dereq_(328);
+
+var Snap = _dereq_(188);
+
+var DEFAULT_BOX_PADDING = 0;
+
+var DEFAULT_LABEL_SIZE = {
+ width: 150,
+ height: 50
+};
+
+
+function parseAlign(align) {
+
+ var parts = align.split('-');
+
+ return {
+ horizontal: parts[0] || 'center',
+ vertical: parts[1] || 'top'
+ };
+}
+
+function parsePadding(padding) {
+
+ if (isObject(padding)) {
+ return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
+ } else {
+ return {
+ top: padding,
+ left: padding,
+ right: padding,
+ bottom: padding
+ };
+ }
+}
+
+function getTextBBox(text, fakeText) {
+ fakeText.textContent = text;
+ return fakeText.getBBox();
+}
+
+
+/**
+ * Layout the next line and return the layouted element.
+ *
+ * Alters the lines passed.
+ *
+ * @param {Array<String>} lines
+ * @return {Object} the line descriptor, an object { width, height, text }
+ */
+function layoutNext(lines, maxWidth, fakeText) {
+
+ var originalLine = lines.shift(),
+ fitLine = originalLine;
+
+ var textBBox;
+
+ while (true) {
+ textBBox = getTextBBox(fitLine, fakeText);
+
+ textBBox.width = fitLine ? textBBox.width : 0;
+
+ // try to fit
+ if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
+ return fit(lines, fitLine, originalLine, textBBox);
+ }
+
+
+ fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
+ }
+}
+
+function fit(lines, fitLine, originalLine, textBBox) {
+ if (fitLine.length < originalLine.length) {
+ var nextLine = lines[0] || '',
+ remainder = originalLine.slice(fitLine.length).trim();
+
+ if (/-\s*$/.test(remainder)) {
+ nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
+ } else {
+ nextLine = remainder + ' ' + nextLine;
+ }
+
+ lines[0] = nextLine;
+ }
+ return { width: textBBox.width, height: textBBox.height, text: fitLine };
+}
+
+
+/**
+ * Shortens a line based on spacing and hyphens.
+ * Returns the shortened result on success.
+ *
+ * @param {String} line
+ * @param {Number} maxLength the maximum characters of the string
+ * @return {String} the shortened string
+ */
+function semanticShorten(line, maxLength) {
+ var parts = line.split(/(\s|-)/g),
+ part,
+ shortenedParts = [],
+ length = 0;
+
+ // try to shorten via spaces + hyphens
+ if (parts.length > 1) {
+ while ((part = parts.shift())) {
+ if (part.length + length < maxLength) {
+ shortenedParts.push(part);
+ length += part.length;
+ } else {
+ // remove previous part, too if hyphen does not fit anymore
+ if (part === '-') {
+ shortenedParts.pop();
+ }
+
+ break;
+ }
+ }
+ }
+
+ return shortenedParts.join('');
+}
+
+
+function shortenLine(line, width, maxWidth) {
+ var length = Math.max(line.length * (maxWidth / width), 1);
+
+ // try to shorten semantically (i.e. based on spaces and hyphens)
+ var shortenedLine = semanticShorten(line, length);
+
+ if (!shortenedLine) {
+
+ // force shorten by cutting the long word
+ shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
+ }
+
+ return shortenedLine;
+}
+
+
+/**
+ * Creates a new label utility
+ *
+ * @param {Object} config
+ * @param {Dimensions} config.size
+ * @param {Number} config.padding
+ * @param {Object} config.style
+ * @param {String} config.align
+ */
+function Text(config) {
+
+ this._config = assign({}, {
+ size: DEFAULT_LABEL_SIZE,
+ padding: DEFAULT_BOX_PADDING,
+ style: {},
+ align: 'center-top'
+ }, config || {});
+}
+
+
+/**
+ * Create a label in the parent node.
+ *
+ * @method Text#createText
+ *
+ * @param {SVGElement} parent the parent to draw the label on
+ * @param {String} text the text to render on the label
+ * @param {Object} options
+ * @param {String} options.align how to align in the bounding box.
+ * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.
+ * @param {String} options.style style to be applied to the text
+ *
+ * @return {SVGText} the text element created
+ */
+Text.prototype.createText = function(parent, text, options) {
+
+ var box = merge({}, this._config.size, options.box || {}),
+ style = merge({}, this._config.style, options.style || {}),
+ align = parseAlign(options.align || this._config.align),
+ padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
+
+ var lines = text.split(/\r?\n/g),
+ layouted = [];
+
+ var maxWidth = box.width - padding.left - padding.right;
+
+ // FF regression: ensure text is shown during rendering
+ // by attaching it directly to the body
+ var fakeText = parent.paper.text(0, 0, '').attr(style).node;
+
+ while (lines.length) {
+ layouted.push(layoutNext(lines, maxWidth, fakeText));
+ }
+
+ var totalHeight = reduce(layouted, function(sum, line, idx) {
+ return sum + line.height;
+ }, 0);
+
+ // the y position of the next line
+ var y, x;
+
+ switch (align.vertical) {
+ case 'middle':
+ y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
+ break;
+
+ default:
+ y = padding.top;
+ }
+
+ var textElement = parent.text().attr(style);
+
+ forEach(layouted, function(line) {
+ y += line.height;
+
+ switch (align.horizontal) {
+ case 'left':
+ x = padding.left;
+ break;
+
+ case 'right':
+ x = (maxWidth - padding.right - line.width);
+ break;
+
+ default:
+ // aka center
+ x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
+ }
+
+
+ var tspan = Snap.create('tspan', { x: x, y: y }).node;
+ tspan.textContent = line.text;
+
+ textElement.append(tspan);
+ });
+
+ // remove fake text
+ fakeText.parentNode.removeChild(fakeText);
+
+ return textElement;
+};
+
+
+module.exports = Text;
+},{"188":188,"204":204,"208":208,"320":320,"325":325,"328":328}],185:[function(_dereq_,module,exports){
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ┌────────────────────────────────────────────────────────────┐ \\
+// │ Eve 0.4.2 - JavaScript Events Library │ \\
+// ├────────────────────────────────────────────────────────────┤ \\
+// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
+// └────────────────────────────────────────────────────────────┘ \\
+
+(function (glob) {
+ var version = "0.4.2",
+ has = "hasOwnProperty",
+ separator = /[\.\/]/,
+ comaseparator = /\s*,\s*/,
+ wildcard = "*",
+ fun = function () {},
+ numsort = function (a, b) {
+ return a - b;
+ },
+ current_event,
+ stop,
+ events = {n: {}},
+ firstDefined = function () {
+ for (var i = 0, ii = this.length; i < ii; i++) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ lastDefined = function () {
+ var i = this.length;
+ while (--i) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ /*\
+ * eve
+ [ method ]
+
+ * Fires event with given `name`, given scope and other parameters.
+
+ > Arguments
+
+ - name (string) name of the *event*, dot (`.`) or slash (`/`) separated
+ - scope (object) context for the event handlers
+ - varargs (...) the rest of arguments will be sent to event handlers
+
+ = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
+ \*/
+ eve = function (name, scope) {
+ name = String(name);
+ var e = events,
+ oldstop = stop,
+ args = Array.prototype.slice.call(arguments, 2),
+ listeners = eve.listeners(name),
+ z = 0,
+ f = false,
+ l,
+ indexed = [],
+ queue = {},
+ out = [],
+ ce = current_event,
+ errors = [];
+ out.firstDefined = firstDefined;
+ out.lastDefined = lastDefined;
+ current_event = name;
+ stop = 0;
+ for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
+ indexed.push(listeners[i].zIndex);
+ if (listeners[i].zIndex < 0) {
+ queue[listeners[i].zIndex] = listeners[i];
+ }
+ }
+ indexed.sort(numsort);
+ while (indexed[z] < 0) {
+ l = queue[indexed[z++]];
+ out.push(l.apply(scope, args));
+ if (stop) {
+ stop = oldstop;
+ return out;
+ }
+ }
+ for (i = 0; i < ii; i++) {
+ l = listeners[i];
+ if ("zIndex" in l) {
+ if (l.zIndex == indexed[z]) {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ do {
+ z++;
+ l = queue[indexed[z]];
+ l && out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ } while (l)
+ } else {
+ queue[l.zIndex] = l;
+ }
+ } else {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ }
+ }
+ stop = oldstop;
+ current_event = ce;
+ return out;
+ };
+ // Undocumented. Debug only.
+ eve._events = events;
+ /*\
+ * eve.listeners
+ [ method ]
+
+ * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
+
+ > Arguments
+
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated
+
+ = (array) array of event handlers
+ \*/
+ eve.listeners = function (name) {
+ var names = name.split(separator),
+ e = events,
+ item,
+ items,
+ k,
+ i,
+ ii,
+ j,
+ jj,
+ nes,
+ es = [e],
+ out = [];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ nes = [];
+ for (j = 0, jj = es.length; j < jj; j++) {
+ e = es[j].n;
+ items = [e[names[i]], e[wildcard]];
+ k = 2;
+ while (k--) {
+ item = items[k];
+ if (item) {
+ nes.push(item);
+ out = out.concat(item.f || []);
+ }
+ }
+ }
+ es = nes;
+ }
+ return out;
+ };
+
+ /*\
+ * eve.on
+ [ method ]
+ **
+ * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
+ | eve.on("*.under.*", f);
+ | eve("mouse.under.floor"); // triggers f
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
+ > Example:
+ | eve.on("mouse", eatIt)(2);
+ | eve.on("mouse", scream);
+ | eve.on("mouse", catchIt)(1);
+ * This will ensure that `catchIt` function will be called before `eatIt`.
+ *
+ * If you want to put your handler before non-indexed handlers, specify a negative value.
+ * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
+ \*/
+ eve.on = function (name, f) {
+ name = String(name);
+ if (typeof f != "function") {
+ return function () {};
+ }
+ var names = name.split(comaseparator);
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ (function (name) {
+ var names = name.split(separator),
+ e = events,
+ exist;
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ e = e.n;
+ e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
+ }
+ e.f = e.f || [];
+ for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
+ exist = true;
+ break;
+ }
+ !exist && e.f.push(f);
+ }(names[i]));
+ }
+ return function (zIndex) {
+ if (+zIndex == +zIndex) {
+ f.zIndex = +zIndex;
+ }
+ };
+ };
+ /*\
+ * eve.f
+ [ method ]
+ **
+ * Returns function that will fire given event with optional arguments.
+ * Arguments that will be passed to the result function will be also
+ * concated to the list of final arguments.
+ | el.onclick = eve.f("click", 1, 2);
+ | eve.on("click", function (a, b, c) {
+ | console.log(a, b, c); // 1, 2, [event object]
+ | });
+ > Arguments
+ - event (string) event name
+ - varargs (…) and any other arguments
+ = (function) possible event handler function
+ \*/
+ eve.f = function (event) {
+ var attrs = [].slice.call(arguments, 1);
+ return function () {
+ eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
+ };
+ };
+ /*\
+ * eve.stop
+ [ method ]
+ **
+ * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
+ \*/
+ eve.stop = function () {
+ stop = 1;
+ };
+ /*\
+ * eve.nt
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ > Arguments
+ **
+ - subname (string) #optional subname of the event
+ **
+ = (string) name of the event, if `subname` is not specified
+ * or
+ = (boolean) `true`, if current event’s name contains `subname`
+ \*/
+ eve.nt = function (subname) {
+ if (subname) {
+ return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
+ }
+ return current_event;
+ };
+ /*\
+ * eve.nts
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ **
+ = (array) names of the event
+ \*/
+ eve.nts = function () {
+ return current_event.split(separator);
+ };
+ /*\
+ * eve.off
+ [ method ]
+ **
+ * Removes given function from the list of event listeners assigned to given name.
+ * If no arguments specified all the events will be cleared.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ \*/
+ /*\
+ * eve.unbind
+ [ method ]
+ **
+ * See @eve.off
+ \*/
+ eve.off = eve.unbind = function (name, f) {
+ if (!name) {
+ eve._events = events = {n: {}};
+ return;
+ }
+ var names = name.split(comaseparator);
+ if (names.length > 1) {
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ eve.off(names[i], f);
+ }
+ return;
+ }
+ names = name.split(separator);
+ var e,
+ key,
+ splice,
+ i, ii, j, jj,
+ cur = [events];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ for (j = 0; j < cur.length; j += splice.length - 2) {
+ splice = [j, 1];
+ e = cur[j].n;
+ if (names[i] != wildcard) {
+ if (e[names[i]]) {
+ splice.push(e[names[i]]);
+ }
+ } else {
+ for (key in e) if (e[has](key)) {
+ splice.push(e[key]);
+ }
+ }
+ cur.splice.apply(cur, splice);
+ }
+ }
+ for (i = 0, ii = cur.length; i < ii; i++) {
+ e = cur[i];
+ while (e.n) {
+ if (f) {
+ if (e.f) {
+ for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
+ e.f.splice(j, 1);
+ break;
+ }
+ !e.f.length && delete e.f;
+ }
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ var funcs = e.n[key].f;
+ for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
+ funcs.splice(j, 1);
+ break;
+ }
+ !funcs.length && delete e.n[key].f;
+ }
+ } else {
+ delete e.f;
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ delete e.n[key].f;
+ }
+ }
+ e = e.n;
+ }
+ }
+ };
+ /*\
+ * eve.once
+ [ method ]
+ **
+ * Binds given event handler with a given name to only run once then unbind itself.
+ | eve.once("login", f);
+ | eve("login"); // triggers f
+ | eve("login"); // no listeners
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) same return function as @eve.on
+ \*/
+ eve.once = function (name, f) {
+ var f2 = function () {
+ eve.unbind(name, f2);
+ return f.apply(this, arguments);
+ };
+ return eve.on(name, f2);
+ };
+ /*\
+ * eve.version
+ [ property (string) ]
+ **
+ * Current version of the library.
+ \*/
+ eve.version = version;
+ eve.toString = function () {
+ return "You are running Eve " + version;
+ };
+ (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() { return eve; })) : (glob.eve = eve));
+})(this);
+
+},{}],186:[function(_dereq_,module,exports){
+/*! Hammer.JS - v2.0.4 - 2014-09-28
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2014 Jorik Tangelder;
+ * Licensed under the MIT license */
+(function(window, document, exportName, undefined) {
+ 'use strict';
+
+var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
+var TEST_ELEMENT = document.createElement('div');
+
+var TYPE_FUNCTION = 'function';
+
+var round = Math.round;
+var abs = Math.abs;
+var now = Date.now;
+
+/**
+ * set a timeout with a given scope
+ * @param {Function} fn
+ * @param {Number} timeout
+ * @param {Object} context
+ * @returns {number}
+ */
+function setTimeoutContext(fn, timeout, context) {
+ return setTimeout(bindFn(fn, context), timeout);
+}
+
+/**
+ * if the argument is an array, we want to execute the fn on each entry
+ * if it aint an array we don't want to do a thing.
+ * this is used by all the methods that accept a single and array argument.
+ * @param {*|Array} arg
+ * @param {String} fn
+ * @param {Object} [context]
+ * @returns {Boolean}
+ */
+function invokeArrayArg(arg, fn, context) {
+ if (Array.isArray(arg)) {
+ each(arg, context[fn], context);
+ return true;
+ }
+ return false;
+}
+
+/**
+ * walk objects and arrays
+ * @param {Object} obj
+ * @param {Function} iterator
+ * @param {Object} context
+ */
+function each(obj, iterator, context) {
+ var i;
+
+ if (!obj) {
+ return;
+ }
+
+ if (obj.forEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length !== undefined) {
+ i = 0;
+ while (i < obj.length) {
+ iterator.call(context, obj[i], i, obj);
+ i++;
+ }
+ } else {
+ for (i in obj) {
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
+ }
+ }
+}
+
+/**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} dest
+ * @param {Object} src
+ * @param {Boolean} [merge]
+ * @returns {Object} dest
+ */
+function extend(dest, src, merge) {
+ var keys = Object.keys(src);
+ var i = 0;
+ while (i < keys.length) {
+ if (!merge || (merge && dest[keys[i]] === undefined)) {
+ dest[keys[i]] = src[keys[i]];
+ }
+ i++;
+ }
+ return dest;
+}
+
+/**
+ * merge the values from src in the dest.
+ * means that properties that exist in dest will not be overwritten by src
+ * @param {Object} dest
+ * @param {Object} src
+ * @returns {Object} dest
+ */
+function merge(dest, src) {
+ return extend(dest, src, true);
+}
+
+/**
+ * simple class inheritance
+ * @param {Function} child
+ * @param {Function} base
+ * @param {Object} [properties]
+ */
+function inherit(child, base, properties) {
+ var baseP = base.prototype,
+ childP;
+
+ childP = child.prototype = Object.create(baseP);
+ childP.constructor = child;
+ childP._super = baseP;
+
+ if (properties) {
+ extend(childP, properties);
+ }
+}
+
+/**
+ * simple function bind
+ * @param {Function} fn
+ * @param {Object} context
+ * @returns {Function}
+ */
+function bindFn(fn, context) {
+ return function boundFn() {
+ return fn.apply(context, arguments);
+ };
+}
+
+/**
+ * let a boolean value also be a function that must return a boolean
+ * this first item in args will be used as the context
+ * @param {Boolean|Function} val
+ * @param {Array} [args]
+ * @returns {Boolean}
+ */
+function boolOrFn(val, args) {
+ if (typeof val == TYPE_FUNCTION) {
+ return val.apply(args ? args[0] || undefined : undefined, args);
+ }
+ return val;
+}
+
+/**
+ * use the val2 when val1 is undefined
+ * @param {*} val1
+ * @param {*} val2
+ * @returns {*}
+ */
+function ifUndefined(val1, val2) {
+ return (val1 === undefined) ? val2 : val1;
+}
+
+/**
+ * addEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+function addEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.addEventListener(type, handler, false);
+ });
+}
+
+/**
+ * removeEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+function removeEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.removeEventListener(type, handler, false);
+ });
+}
+
+/**
+ * find if a node is in the given parent
+ * @method hasParent
+ * @param {HTMLElement} node
+ * @param {HTMLElement} parent
+ * @return {Boolean} found
+ */
+function hasParent(node, parent) {
+ while (node) {
+ if (node == parent) {
+ return true;
+ }
+ node = node.parentNode;
+ }
+ return false;
+}
+
+/**
+ * small indexOf wrapper
+ * @param {String} str
+ * @param {String} find
+ * @returns {Boolean} found
+ */
+function inStr(str, find) {
+ return str.indexOf(find) > -1;
+}
+
+/**
+ * split string on whitespace
+ * @param {String} str
+ * @returns {Array} words
+ */
+function splitStr(str) {
+ return str.trim().split(/\s+/g);
+}
+
+/**
+ * find if a array contains the object using indexOf or a simple polyFill
+ * @param {Array} src
+ * @param {String} find
+ * @param {String} [findByKey]
+ * @return {Boolean|Number} false when not found, or the index
+ */
+function inArray(src, find, findByKey) {
+ if (src.indexOf && !findByKey) {
+ return src.indexOf(find);
+ } else {
+ var i = 0;
+ while (i < src.length) {
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
+ return i;
+ }
+ i++;
+ }
+ return -1;
+ }
+}
+
+/**
+ * convert array-like objects to real arrays
+ * @param {Object} obj
+ * @returns {Array}
+ */
+function toArray(obj) {
+ return Array.prototype.slice.call(obj, 0);
+}
+
+/**
+ * unique array with objects based on a key (like 'id') or just by the array's value
+ * @param {Array} src [{id:1},{id:2},{id:1}]
+ * @param {String} [key]
+ * @param {Boolean} [sort=False]
+ * @returns {Array} [{id:1},{id:2}]
+ */
+function uniqueArray(src, key, sort) {
+ var results = [];
+ var values = [];
+ var i = 0;
+
+ while (i < src.length) {
+ var val = key ? src[i][key] : src[i];
+ if (inArray(values, val) < 0) {
+ results.push(src[i]);
+ }
+ values[i] = val;
+ i++;
+ }
+
+ if (sort) {
+ if (!key) {
+ results = results.sort();
+ } else {
+ results = results.sort(function sortUniqueArray(a, b) {
+ return a[key] > b[key];
+ });
+ }
+ }
+
+ return results;
+}
+
+/**
+ * get the prefixed property
+ * @param {Object} obj
+ * @param {String} property
+ * @returns {String|Undefined} prefixed
+ */
+function prefixed(obj, property) {
+ var prefix, prop;
+ var camelProp = property[0].toUpperCase() + property.slice(1);
+
+ var i = 0;
+ while (i < VENDOR_PREFIXES.length) {
+ prefix = VENDOR_PREFIXES[i];
+ prop = (prefix) ? prefix + camelProp : property;
+
+ if (prop in obj) {
+ return prop;
+ }
+ i++;
+ }
+ return undefined;
+}
+
+/**
+ * get a unique id
+ * @returns {number} uniqueId
+ */
+var _uniqueId = 1;
+function uniqueId() {
+ return _uniqueId++;
+}
+
+/**
+ * get the window object of an element
+ * @param {HTMLElement} element
+ * @returns {DocumentView|Window}
+ */
+function getWindowForElement(element) {
+ var doc = element.ownerDocument;
+ return (doc.defaultView || doc.parentWindow);
+}
+
+var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
+
+var SUPPORT_TOUCH = ('ontouchstart' in window);
+var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
+var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
+
+var INPUT_TYPE_TOUCH = 'touch';
+var INPUT_TYPE_PEN = 'pen';
+var INPUT_TYPE_MOUSE = 'mouse';
+var INPUT_TYPE_KINECT = 'kinect';
+
+var COMPUTE_INTERVAL = 25;
+
+var INPUT_START = 1;
+var INPUT_MOVE = 2;
+var INPUT_END = 4;
+var INPUT_CANCEL = 8;
+
+var DIRECTION_NONE = 1;
+var DIRECTION_LEFT = 2;
+var DIRECTION_RIGHT = 4;
+var DIRECTION_UP = 8;
+var DIRECTION_DOWN = 16;
+
+var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
+var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
+var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
+
+var PROPS_XY = ['x', 'y'];
+var PROPS_CLIENT_XY = ['clientX', 'clientY'];
+
+/**
+ * create new input type manager
+ * @param {Manager} manager
+ * @param {Function} callback
+ * @returns {Input}
+ * @constructor
+ */
+function Input(manager, callback) {
+ var self = this;
+ this.manager = manager;
+ this.callback = callback;
+ this.element = manager.element;
+ this.target = manager.options.inputTarget;
+
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
+ // so when disabled the input events are completely bypassed.
+ this.domHandler = function(ev) {
+ if (boolOrFn(manager.options.enable, [manager])) {
+ self.handler(ev);
+ }
+ };
+
+ this.init();
+
+}
+
+Input.prototype = {
+ /**
+ * should handle the inputEvent data and trigger the callback
+ * @virtual
+ */
+ handler: function() { },
+
+ /**
+ * bind the events
+ */
+ init: function() {
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ },
+
+ /**
+ * unbind the events
+ */
+ destroy: function() {
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ }
+};
+
+/**
+ * create new input type manager
+ * called by the Manager constructor
+ * @param {Hammer} manager
+ * @returns {Input}
+ */
+function createInputInstance(manager) {
+ var Type;
+ var inputClass = manager.options.inputClass;
+
+ if (inputClass) {
+ Type = inputClass;
+ } else if (SUPPORT_POINTER_EVENTS) {
+ Type = PointerEventInput;
+ } else if (SUPPORT_ONLY_TOUCH) {
+ Type = TouchInput;
+ } else if (!SUPPORT_TOUCH) {
+ Type = MouseInput;
+ } else {
+ Type = TouchMouseInput;
+ }
+ return new (Type)(manager, inputHandler);
+}
+
+/**
+ * handle input events
+ * @param {Manager} manager
+ * @param {String} eventType
+ * @param {Object} input
+ */
+function inputHandler(manager, eventType, input) {
+ var pointersLen = input.pointers.length;
+ var changedPointersLen = input.changedPointers.length;
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
+
+ input.isFirst = !!isFirst;
+ input.isFinal = !!isFinal;
+
+ if (isFirst) {
+ manager.session = {};
+ }
+
+ // source event is the normalized value of the domEvents
+ // like 'touchstart, mouseup, pointerdown'
+ input.eventType = eventType;
+
+ // compute scale, rotation etc
+ computeInputData(manager, input);
+
+ // emit secret event
+ manager.emit('hammer.input', input);
+
+ manager.recognize(input);
+ manager.session.prevInput = input;
+}
+
+/**
+ * extend the data with some usable properties like scale, rotate, velocity etc
+ * @param {Object} manager
+ * @param {Object} input
+ */
+function computeInputData(manager, input) {
+ var session = manager.session;
+ var pointers = input.pointers;
+ var pointersLength = pointers.length;
+
+ // store the first input to calculate the distance and direction
+ if (!session.firstInput) {
+ session.firstInput = simpleCloneInputData(input);
+ }
+
+ // to compute scale and rotation we need to store the multiple touches
+ if (pointersLength > 1 && !session.firstMultiple) {
+ session.firstMultiple = simpleCloneInputData(input);
+ } else if (pointersLength === 1) {
+ session.firstMultiple = false;
+ }
+
+ var firstInput = session.firstInput;
+ var firstMultiple = session.firstMultiple;
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
+
+ var center = input.center = getCenter(pointers);
+ input.timeStamp = now();
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
+
+ input.angle = getAngle(offsetCenter, center);
+ input.distance = getDistance(offsetCenter, center);
+
+ computeDeltaXY(session, input);
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
+
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
+
+ computeIntervalInputData(session, input);
+
+ // find the correct target
+ var target = manager.element;
+ if (hasParent(input.srcEvent.target, target)) {
+ target = input.srcEvent.target;
+ }
+ input.target = target;
+}
+
+function computeDeltaXY(session, input) {
+ var center = input.center;
+ var offset = session.offsetDelta || {};
+ var prevDelta = session.prevDelta || {};
+ var prevInput = session.prevInput || {};
+
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
+ prevDelta = session.prevDelta = {
+ x: prevInput.deltaX || 0,
+ y: prevInput.deltaY || 0
+ };
+
+ offset = session.offsetDelta = {
+ x: center.x,
+ y: center.y
+ };
+ }
+
+ input.deltaX = prevDelta.x + (center.x - offset.x);
+ input.deltaY = prevDelta.y + (center.y - offset.y);
+}
+
+/**
+ * velocity is calculated every x ms
+ * @param {Object} session
+ * @param {Object} input
+ */
+function computeIntervalInputData(session, input) {
+ var last = session.lastInterval || input,
+ deltaTime = input.timeStamp - last.timeStamp,
+ velocity, velocityX, velocityY, direction;
+
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
+ var deltaX = last.deltaX - input.deltaX;
+ var deltaY = last.deltaY - input.deltaY;
+
+ var v = getVelocity(deltaTime, deltaX, deltaY);
+ velocityX = v.x;
+ velocityY = v.y;
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
+ direction = getDirection(deltaX, deltaY);
+
+ session.lastInterval = input;
+ } else {
+ // use latest velocity info if it doesn't overtake a minimum period
+ velocity = last.velocity;
+ velocityX = last.velocityX;
+ velocityY = last.velocityY;
+ direction = last.direction;
+ }
+
+ input.velocity = velocity;
+ input.velocityX = velocityX;
+ input.velocityY = velocityY;
+ input.direction = direction;
+}
+
+/**
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
+ * @param {Object} input
+ * @returns {Object} clonedInputData
+ */
+function simpleCloneInputData(input) {
+ // make a simple copy of the pointers because we will get a reference if we don't
+ // we only need clientXY for the calculations
+ var pointers = [];
+ var i = 0;
+ while (i < input.pointers.length) {
+ pointers[i] = {
+ clientX: round(input.pointers[i].clientX),
+ clientY: round(input.pointers[i].clientY)
+ };
+ i++;
+ }
+
+ return {
+ timeStamp: now(),
+ pointers: pointers,
+ center: getCenter(pointers),
+ deltaX: input.deltaX,
+ deltaY: input.deltaY
+ };
+}
+
+/**
+ * get the center of all the pointers
+ * @param {Array} pointers
+ * @return {Object} center contains `x` and `y` properties
+ */
+function getCenter(pointers) {
+ var pointersLength = pointers.length;
+
+ // no need to loop when only one touch
+ if (pointersLength === 1) {
+ return {
+ x: round(pointers[0].clientX),
+ y: round(pointers[0].clientY)
+ };
+ }
+
+ var x = 0, y = 0, i = 0;
+ while (i < pointersLength) {
+ x += pointers[i].clientX;
+ y += pointers[i].clientY;
+ i++;
+ }
+
+ return {
+ x: round(x / pointersLength),
+ y: round(y / pointersLength)
+ };
+}
+
+/**
+ * calculate the velocity between two points. unit is in px per ms.
+ * @param {Number} deltaTime
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object} velocity `x` and `y`
+ */
+function getVelocity(deltaTime, x, y) {
+ return {
+ x: x / deltaTime || 0,
+ y: y / deltaTime || 0
+ };
+}
+
+/**
+ * get the direction between two points
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Number} direction
+ */
+function getDirection(x, y) {
+ if (x === y) {
+ return DIRECTION_NONE;
+ }
+
+ if (abs(x) >= abs(y)) {
+ return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ }
+ return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
+}
+
+/**
+ * calculate the absolute distance between two points
+ * @param {Object} p1 {x, y}
+ * @param {Object} p2 {x, y}
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} distance
+ */
+function getDistance(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+
+ return Math.sqrt((x * x) + (y * y));
+}
+
+/**
+ * calculate the angle between two coordinates
+ * @param {Object} p1
+ * @param {Object} p2
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} angle
+ */
+function getAngle(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+ return Math.atan2(y, x) * 180 / Math.PI;
+}
+
+/**
+ * calculate the rotation degrees between two pointersets
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} rotation
+ */
+function getRotation(start, end) {
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
+}
+
+/**
+ * calculate the scale factor between two pointersets
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} scale
+ */
+function getScale(start, end) {
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
+}
+
+var MOUSE_INPUT_MAP = {
+ mousedown: INPUT_START,
+ mousemove: INPUT_MOVE,
+ mouseup: INPUT_END
+};
+
+var MOUSE_ELEMENT_EVENTS = 'mousedown';
+var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
+
+/**
+ * Mouse events input
+ * @constructor
+ * @extends Input
+ */
+function MouseInput() {
+ this.evEl = MOUSE_ELEMENT_EVENTS;
+ this.evWin = MOUSE_WINDOW_EVENTS;
+
+ this.allow = true; // used by Input.TouchMouse to disable mouse events
+ this.pressed = false; // mousedown state
+
+ Input.apply(this, arguments);
+}
+
+inherit(MouseInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function MEhandler(ev) {
+ var eventType = MOUSE_INPUT_MAP[ev.type];
+
+ // on start we want to have the left mouse button down
+ if (eventType & INPUT_START && ev.button === 0) {
+ this.pressed = true;
+ }
+
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
+ eventType = INPUT_END;
+ }
+
+ // mouse must be down, and mouse events are allowed (see the TouchMouse input)
+ if (!this.pressed || !this.allow) {
+ return;
+ }
+
+ if (eventType & INPUT_END) {
+ this.pressed = false;
+ }
+
+ this.callback(this.manager, eventType, {
+ pointers: [ev],
+ changedPointers: [ev],
+ pointerType: INPUT_TYPE_MOUSE,
+ srcEvent: ev
+ });
+ }
+});
+
+var POINTER_INPUT_MAP = {
+ pointerdown: INPUT_START,
+ pointermove: INPUT_MOVE,
+ pointerup: INPUT_END,
+ pointercancel: INPUT_CANCEL,
+ pointerout: INPUT_CANCEL
+};
+
+// in IE10 the pointer types is defined as an enum
+var IE10_POINTER_TYPE_ENUM = {
+ 2: INPUT_TYPE_TOUCH,
+ 3: INPUT_TYPE_PEN,
+ 4: INPUT_TYPE_MOUSE,
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
+};
+
+var POINTER_ELEMENT_EVENTS = 'pointerdown';
+var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
+
+// IE10 has prefixed support, and case-sensitive
+if (window.MSPointerEvent) {
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
+}
+
+/**
+ * Pointer events input
+ * @constructor
+ * @extends Input
+ */
+function PointerEventInput() {
+ this.evEl = POINTER_ELEMENT_EVENTS;
+ this.evWin = POINTER_WINDOW_EVENTS;
+
+ Input.apply(this, arguments);
+
+ this.store = (this.manager.session.pointerEvents = []);
+}
+
+inherit(PointerEventInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function PEhandler(ev) {
+ var store = this.store;
+ var removePointer = false;
+
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
+
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
+
+ // get index of the event in the store
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
+
+ // start and mouse must be down
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
+ if (storeIndex < 0) {
+ store.push(ev);
+ storeIndex = store.length - 1;
+ }
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
+ removePointer = true;
+ }
+
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
+ if (storeIndex < 0) {
+ return;
+ }
+
+ // update the event in the store
+ store[storeIndex] = ev;
+
+ this.callback(this.manager, eventType, {
+ pointers: store,
+ changedPointers: [ev],
+ pointerType: pointerType,
+ srcEvent: ev
+ });
+
+ if (removePointer) {
+ // remove from the store
+ store.splice(storeIndex, 1);
+ }
+ }
+});
+
+var SINGLE_TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+};
+
+var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
+var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+/**
+ * Touch events input
+ * @constructor
+ * @extends Input
+ */
+function SingleTouchInput() {
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
+ this.started = false;
+
+ Input.apply(this, arguments);
+}
+
+inherit(SingleTouchInput, Input, {
+ handler: function TEhandler(ev) {
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
+
+ // should we handle the touch events?
+ if (type === INPUT_START) {
+ this.started = true;
+ }
+
+ if (!this.started) {
+ return;
+ }
+
+ var touches = normalizeSingleTouches.call(this, ev, type);
+
+ // when done, reset the started state
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
+ this.started = false;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+});
+
+/**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+function normalizeSingleTouches(ev, type) {
+ var all = toArray(ev.touches);
+ var changed = toArray(ev.changedTouches);
+
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ all = uniqueArray(all.concat(changed), 'identifier', true);
+ }
+
+ return [all, changed];
+}
+
+var TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+};
+
+var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+/**
+ * Multi-user touch events input
+ * @constructor
+ * @extends Input
+ */
+function TouchInput() {
+ this.evTarget = TOUCH_TARGET_EVENTS;
+ this.targetIds = {};
+
+ Input.apply(this, arguments);
+}
+
+inherit(TouchInput, Input, {
+ handler: function MTEhandler(ev) {
+ var type = TOUCH_INPUT_MAP[ev.type];
+ var touches = getTouches.call(this, ev, type);
+ if (!touches) {
+ return;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+});
+
+/**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+function getTouches(ev, type) {
+ var allTouches = toArray(ev.touches);
+ var targetIds = this.targetIds;
+
+ // when there is only one touch, the process can be simplified
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
+ targetIds[allTouches[0].identifier] = true;
+ return [allTouches, allTouches];
+ }
+
+ var i,
+ targetTouches,
+ changedTouches = toArray(ev.changedTouches),
+ changedTargetTouches = [],
+ target = this.target;
+
+ // get target touches from touches
+ targetTouches = allTouches.filter(function(touch) {
+ return hasParent(touch.target, target);
+ });
+
+ // collect touches
+ if (type === INPUT_START) {
+ i = 0;
+ while (i < targetTouches.length) {
+ targetIds[targetTouches[i].identifier] = true;
+ i++;
+ }
+ }
+
+ // filter changed touches to only contain touches that exist in the collected target ids
+ i = 0;
+ while (i < changedTouches.length) {
+ if (targetIds[changedTouches[i].identifier]) {
+ changedTargetTouches.push(changedTouches[i]);
+ }
+
+ // cleanup removed touches
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ delete targetIds[changedTouches[i].identifier];
+ }
+ i++;
+ }
+
+ if (!changedTargetTouches.length) {
+ return;
+ }
+
+ return [
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
+ changedTargetTouches
+ ];
+}
+
+/**
+ * Combined touch and mouse input
+ *
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
+ * This because touch devices also emit mouse events while doing a touch.
+ *
+ * @constructor
+ * @extends Input
+ */
+function TouchMouseInput() {
+ Input.apply(this, arguments);
+
+ var handler = bindFn(this.handler, this);
+ this.touch = new TouchInput(this.manager, handler);
+ this.mouse = new MouseInput(this.manager, handler);
+}
+
+inherit(TouchMouseInput, Input, {
+ /**
+ * handle mouse and touch events
+ * @param {Hammer} manager
+ * @param {String} inputEvent
+ * @param {Object} inputData
+ */
+ handler: function TMEhandler(manager, inputEvent, inputData) {
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
+
+ // when we're in a touch event, so block all upcoming mouse events
+ // most mobile browser also emit mouseevents, right after touchstart
+ if (isTouch) {
+ this.mouse.allow = false;
+ } else if (isMouse && !this.mouse.allow) {
+ return;
+ }
+
+ // reset the allowMouse when we're done
+ if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
+ this.mouse.allow = true;
+ }
+
+ this.callback(manager, inputEvent, inputData);
+ },
+
+ /**
+ * remove the event listeners
+ */
+ destroy: function destroy() {
+ this.touch.destroy();
+ this.mouse.destroy();
+ }
+});
+
+var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
+var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
+
+// magical touchAction value
+var TOUCH_ACTION_COMPUTE = 'compute';
+var TOUCH_ACTION_AUTO = 'auto';
+var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
+var TOUCH_ACTION_NONE = 'none';
+var TOUCH_ACTION_PAN_X = 'pan-x';
+var TOUCH_ACTION_PAN_Y = 'pan-y';
+
+/**
+ * Touch Action
+ * sets the touchAction property or uses the js alternative
+ * @param {Manager} manager
+ * @param {String} value
+ * @constructor
+ */
+function TouchAction(manager, value) {
+ this.manager = manager;
+ this.set(value);
+}
+
+TouchAction.prototype = {
+ /**
+ * set the touchAction value on the element or enable the polyfill
+ * @param {String} value
+ */
+ set: function(value) {
+ // find out the touch-action by the event handlers
+ if (value == TOUCH_ACTION_COMPUTE) {
+ value = this.compute();
+ }
+
+ if (NATIVE_TOUCH_ACTION) {
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
+ }
+ this.actions = value.toLowerCase().trim();
+ },
+
+ /**
+ * just re-set the touchAction value
+ */
+ update: function() {
+ this.set(this.manager.options.touchAction);
+ },
+
+ /**
+ * compute the value for the touchAction property based on the recognizer's settings
+ * @returns {String} value
+ */
+ compute: function() {
+ var actions = [];
+ each(this.manager.recognizers, function(recognizer) {
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
+ actions = actions.concat(recognizer.getTouchAction());
+ }
+ });
+ return cleanTouchActions(actions.join(' '));
+ },
+
+ /**
+ * this method is called on each input cycle and provides the preventing of the browser behavior
+ * @param {Object} input
+ */
+ preventDefaults: function(input) {
+ // not needed with native support for the touchAction property
+ if (NATIVE_TOUCH_ACTION) {
+ return;
+ }
+
+ var srcEvent = input.srcEvent;
+ var direction = input.offsetDirection;
+
+ // if the touch action did prevented once this session
+ if (this.manager.session.prevented) {
+ srcEvent.preventDefault();
+ return;
+ }
+
+ var actions = this.actions;
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+
+ if (hasNone ||
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
+ return this.preventSrc(srcEvent);
+ }
+ },
+
+ /**
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
+ * @param {Object} srcEvent
+ */
+ preventSrc: function(srcEvent) {
+ this.manager.session.prevented = true;
+ srcEvent.preventDefault();
+ }
+};
+
+/**
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
+ * @param {String} actions
+ * @returns {*}
+ */
+function cleanTouchActions(actions) {
+ // none
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+
+ // pan-x and pan-y can be combined
+ if (hasPanX && hasPanY) {
+ return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
+ }
+
+ // pan-x OR pan-y
+ if (hasPanX || hasPanY) {
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
+ }
+
+ // manipulation
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
+ return TOUCH_ACTION_MANIPULATION;
+ }
+
+ return TOUCH_ACTION_AUTO;
+}
+
+/**
+ * Recognizer flow explained; *
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
+ *
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
+ * which determines with state it should be.
+ *
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
+ * POSSIBLE to give it another change on the next cycle.
+ *
+ * Possible
+ * |
+ * +-----+---------------+
+ * | |
+ * +-----+-----+ |
+ * | | |
+ * Failed Cancelled |
+ * +-------+------+
+ * | |
+ * Recognized Began
+ * |
+ * Changed
+ * |
+ * Ended/Recognized
+ */
+var STATE_POSSIBLE = 1;
+var STATE_BEGAN = 2;
+var STATE_CHANGED = 4;
+var STATE_ENDED = 8;
+var STATE_RECOGNIZED = STATE_ENDED;
+var STATE_CANCELLED = 16;
+var STATE_FAILED = 32;
+
+/**
+ * Recognizer
+ * Every recognizer needs to extend from this class.
+ * @constructor
+ * @param {Object} options
+ */
+function Recognizer(options) {
+ this.id = uniqueId();
+
+ this.manager = null;
+ this.options = merge(options || {}, this.defaults);
+
+ // default is enable true
+ this.options.enable = ifUndefined(this.options.enable, true);
+
+ this.state = STATE_POSSIBLE;
+
+ this.simultaneous = {};
+ this.requireFail = [];
+}
+
+Recognizer.prototype = {
+ /**
+ * @virtual
+ * @type {Object}
+ */
+ defaults: {},
+
+ /**
+ * set options
+ * @param {Object} options
+ * @return {Recognizer}
+ */
+ set: function(options) {
+ extend(this.options, options);
+
+ // also update the touchAction, in case something changed about the directions/enabled state
+ this.manager && this.manager.touchAction.update();
+ return this;
+ },
+
+ /**
+ * recognize simultaneous with an other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ recognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
+ return this;
+ }
+
+ var simultaneous = this.simultaneous;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (!simultaneous[otherRecognizer.id]) {
+ simultaneous[otherRecognizer.id] = otherRecognizer;
+ otherRecognizer.recognizeWith(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRecognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ delete this.simultaneous[otherRecognizer.id];
+ return this;
+ },
+
+ /**
+ * recognizer can only run when an other is failing
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ requireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
+ return this;
+ }
+
+ var requireFail = this.requireFail;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (inArray(requireFail, otherRecognizer) === -1) {
+ requireFail.push(otherRecognizer);
+ otherRecognizer.requireFailure(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRequireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ var index = inArray(this.requireFail, otherRecognizer);
+ if (index > -1) {
+ this.requireFail.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * has require failures boolean
+ * @returns {boolean}
+ */
+ hasRequireFailures: function() {
+ return this.requireFail.length > 0;
+ },
+
+ /**
+ * if the recognizer can recognize simultaneous with an other recognizer
+ * @param {Recognizer} otherRecognizer
+ * @returns {Boolean}
+ */
+ canRecognizeWith: function(otherRecognizer) {
+ return !!this.simultaneous[otherRecognizer.id];
+ },
+
+ /**
+ * You should use `tryEmit` instead of `emit` directly to check
+ * that all the needed recognizers has failed before emitting.
+ * @param {Object} input
+ */
+ emit: function(input) {
+ var self = this;
+ var state = this.state;
+
+ function emit(withState) {
+ self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
+ }
+
+ // 'panstart' and 'panmove'
+ if (state < STATE_ENDED) {
+ emit(true);
+ }
+
+ emit(); // simple 'eventName' events
+
+ // panend and pancancel
+ if (state >= STATE_ENDED) {
+ emit(true);
+ }
+ },
+
+ /**
+ * Check that all the require failure recognizers has failed,
+ * if true, it emits a gesture event,
+ * otherwise, setup the state to FAILED.
+ * @param {Object} input
+ */
+ tryEmit: function(input) {
+ if (this.canEmit()) {
+ return this.emit(input);
+ }
+ // it's failing anyway
+ this.state = STATE_FAILED;
+ },
+
+ /**
+ * can we emit?
+ * @returns {boolean}
+ */
+ canEmit: function() {
+ var i = 0;
+ while (i < this.requireFail.length) {
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
+ return false;
+ }
+ i++;
+ }
+ return true;
+ },
+
+ /**
+ * update the recognizer
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ // make a new copy of the inputData
+ // so we can change the inputData without messing up the other recognizers
+ var inputDataClone = extend({}, inputData);
+
+ // is is enabled and allow recognizing?
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
+ this.reset();
+ this.state = STATE_FAILED;
+ return;
+ }
+
+ // reset when we've reached the end
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
+ this.state = STATE_POSSIBLE;
+ }
+
+ this.state = this.process(inputDataClone);
+
+ // the recognizer has recognized a gesture
+ // so trigger an event
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
+ this.tryEmit(inputDataClone);
+ }
+ },
+
+ /**
+ * return the state of the recognizer
+ * the actual recognizing happens in this method
+ * @virtual
+ * @param {Object} inputData
+ * @returns {Const} STATE
+ */
+ process: function(inputData) { }, // jshint ignore:line
+
+ /**
+ * return the preferred touch-action
+ * @virtual
+ * @returns {Array}
+ */
+ getTouchAction: function() { },
+
+ /**
+ * called when the gesture isn't allowed to recognize
+ * like when another is being recognized or it is disabled
+ * @virtual
+ */
+ reset: function() { }
+};
+
+/**
+ * get a usable string, used as event postfix
+ * @param {Const} state
+ * @returns {String} state
+ */
+function stateStr(state) {
+ if (state & STATE_CANCELLED) {
+ return 'cancel';
+ } else if (state & STATE_ENDED) {
+ return 'end';
+ } else if (state & STATE_CHANGED) {
+ return 'move';
+ } else if (state & STATE_BEGAN) {
+ return 'start';
+ }
+ return '';
+}
+
+/**
+ * direction cons to string
+ * @param {Const} direction
+ * @returns {String}
+ */
+function directionStr(direction) {
+ if (direction == DIRECTION_DOWN) {
+ return 'down';
+ } else if (direction == DIRECTION_UP) {
+ return 'up';
+ } else if (direction == DIRECTION_LEFT) {
+ return 'left';
+ } else if (direction == DIRECTION_RIGHT) {
+ return 'right';
+ }
+ return '';
+}
+
+/**
+ * get a recognizer by name if it is bound to a manager
+ * @param {Recognizer|String} otherRecognizer
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer}
+ */
+function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
+ var manager = recognizer.manager;
+ if (manager) {
+ return manager.get(otherRecognizer);
+ }
+ return otherRecognizer;
+}
+
+/**
+ * This recognizer is just used as a base for the simple attribute recognizers.
+ * @constructor
+ * @extends Recognizer
+ */
+function AttrRecognizer() {
+ Recognizer.apply(this, arguments);
+}
+
+inherit(AttrRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof AttrRecognizer
+ */
+ defaults: {
+ /**
+ * @type {Number}
+ * @default 1
+ */
+ pointers: 1
+ },
+
+ /**
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {Boolean} recognized
+ */
+ attrTest: function(input) {
+ var optionPointers = this.options.pointers;
+ return optionPointers === 0 || input.pointers.length === optionPointers;
+ },
+
+ /**
+ * Process the input and return the state for the recognizer
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {*} State
+ */
+ process: function(input) {
+ var state = this.state;
+ var eventType = input.eventType;
+
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
+ var isValid = this.attrTest(input);
+
+ // on cancel input and we've recognized before, return STATE_CANCELLED
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
+ return state | STATE_CANCELLED;
+ } else if (isRecognized || isValid) {
+ if (eventType & INPUT_END) {
+ return state | STATE_ENDED;
+ } else if (!(state & STATE_BEGAN)) {
+ return STATE_BEGAN;
+ }
+ return state | STATE_CHANGED;
+ }
+ return STATE_FAILED;
+ }
+});
+
+/**
+ * Pan
+ * Recognized when the pointer is down and moved in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function PanRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+
+ this.pX = null;
+ this.pY = null;
+}
+
+inherit(PanRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PanRecognizer
+ */
+ defaults: {
+ event: 'pan',
+ threshold: 10,
+ pointers: 1,
+ direction: DIRECTION_ALL
+ },
+
+ getTouchAction: function() {
+ var direction = this.options.direction;
+ var actions = [];
+ if (direction & DIRECTION_HORIZONTAL) {
+ actions.push(TOUCH_ACTION_PAN_Y);
+ }
+ if (direction & DIRECTION_VERTICAL) {
+ actions.push(TOUCH_ACTION_PAN_X);
+ }
+ return actions;
+ },
+
+ directionTest: function(input) {
+ var options = this.options;
+ var hasMoved = true;
+ var distance = input.distance;
+ var direction = input.direction;
+ var x = input.deltaX;
+ var y = input.deltaY;
+
+ // lock to axis?
+ if (!(direction & options.direction)) {
+ if (options.direction & DIRECTION_HORIZONTAL) {
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ hasMoved = x != this.pX;
+ distance = Math.abs(input.deltaX);
+ } else {
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
+ hasMoved = y != this.pY;
+ distance = Math.abs(input.deltaY);
+ }
+ }
+ input.direction = direction;
+ return hasMoved && distance > options.threshold && direction & options.direction;
+ },
+
+ attrTest: function(input) {
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
+ },
+
+ emit: function(input) {
+ this.pX = input.deltaX;
+ this.pY = input.deltaY;
+
+ var direction = directionStr(input.direction);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this._super.emit.call(this, input);
+ }
+});
+
+/**
+ * Pinch
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function PinchRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(PinchRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'pinch',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
+ },
+
+ emit: function(input) {
+ this._super.emit.call(this, input);
+ if (input.scale !== 1) {
+ var inOut = input.scale < 1 ? 'in' : 'out';
+ this.manager.emit(this.options.event + inOut, input);
+ }
+ }
+});
+
+/**
+ * Press
+ * Recognized when the pointer is down for x ms without any movement.
+ * @constructor
+ * @extends Recognizer
+ */
+function PressRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ this._timer = null;
+ this._input = null;
+}
+
+inherit(PressRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PressRecognizer
+ */
+ defaults: {
+ event: 'press',
+ pointers: 1,
+ time: 500, // minimal time of the pointer to be pressed
+ threshold: 5 // a minimal movement is ok, but keep it low
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_AUTO];
+ },
+
+ process: function(input) {
+ var options = this.options;
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTime = input.deltaTime > options.time;
+
+ this._input = input;
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
+ this.reset();
+ } else if (input.eventType & INPUT_START) {
+ this.reset();
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.time, this);
+ } else if (input.eventType & INPUT_END) {
+ return STATE_RECOGNIZED;
+ }
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function(input) {
+ if (this.state !== STATE_RECOGNIZED) {
+ return;
+ }
+
+ if (input && (input.eventType & INPUT_END)) {
+ this.manager.emit(this.options.event + 'up', input);
+ } else {
+ this._input.timeStamp = now();
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+});
+
+/**
+ * Rotate
+ * Recognized when two or more pointer are moving in a circular motion.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function RotateRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(RotateRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof RotateRecognizer
+ */
+ defaults: {
+ event: 'rotate',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
+ }
+});
+
+/**
+ * Swipe
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function SwipeRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(SwipeRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof SwipeRecognizer
+ */
+ defaults: {
+ event: 'swipe',
+ threshold: 10,
+ velocity: 0.65,
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
+ pointers: 1
+ },
+
+ getTouchAction: function() {
+ return PanRecognizer.prototype.getTouchAction.call(this);
+ },
+
+ attrTest: function(input) {
+ var direction = this.options.direction;
+ var velocity;
+
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
+ velocity = input.velocity;
+ } else if (direction & DIRECTION_HORIZONTAL) {
+ velocity = input.velocityX;
+ } else if (direction & DIRECTION_VERTICAL) {
+ velocity = input.velocityY;
+ }
+
+ return this._super.attrTest.call(this, input) &&
+ direction & input.direction &&
+ input.distance > this.options.threshold &&
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
+ },
+
+ emit: function(input) {
+ var direction = directionStr(input.direction);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this.manager.emit(this.options.event, input);
+ }
+});
+
+/**
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
+ * a single tap.
+ *
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
+ * multi-taps being recognized.
+ * @constructor
+ * @extends Recognizer
+ */
+function TapRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ // previous time and center,
+ // used for tap counting
+ this.pTime = false;
+ this.pCenter = false;
+
+ this._timer = null;
+ this._input = null;
+ this.count = 0;
+}
+
+inherit(TapRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'tap',
+ pointers: 1,
+ taps: 1,
+ interval: 300, // max time between the multi-tap taps
+ time: 250, // max time of the pointer to be down (like finger on the screen)
+ threshold: 2, // a minimal movement is ok, but keep it low
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_MANIPULATION];
+ },
+
+ process: function(input) {
+ var options = this.options;
+
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTouchTime = input.deltaTime < options.time;
+
+ this.reset();
+
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
+ return this.failTimeout();
+ }
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (validMovement && validTouchTime && validPointers) {
+ if (input.eventType != INPUT_END) {
+ return this.failTimeout();
+ }
+
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
+
+ this.pTime = input.timeStamp;
+ this.pCenter = input.center;
+
+ if (!validMultiTap || !validInterval) {
+ this.count = 1;
+ } else {
+ this.count += 1;
+ }
+
+ this._input = input;
+
+ // if tap count matches we have recognized it,
+ // else it has began recognizing...
+ var tapCount = this.count % options.taps;
+ if (tapCount === 0) {
+ // no failing requirements, immediately trigger the tap event
+ // or wait as long as the multitap interval to trigger
+ if (!this.hasRequireFailures()) {
+ return STATE_RECOGNIZED;
+ } else {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.interval, this);
+ return STATE_BEGAN;
+ }
+ }
+ }
+ return STATE_FAILED;
+ },
+
+ failTimeout: function() {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_FAILED;
+ }, this.options.interval, this);
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function() {
+ if (this.state == STATE_RECOGNIZED ) {
+ this._input.tapCount = this.count;
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+});
+
+/**
+ * Simple way to create an manager with a default set of recognizers.
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+function Hammer(element, options) {
+ options = options || {};
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
+ return new Manager(element, options);
+}
+
+/**
+ * @const {string}
+ */
+Hammer.VERSION = '2.0.4';
+
+/**
+ * default settings
+ * @namespace
+ */
+Hammer.defaults = {
+ /**
+ * set if DOM events are being triggered.
+ * But this is slower and unused by simple implementations, so disabled by default.
+ * @type {Boolean}
+ * @default false
+ */
+ domEvents: false,
+
+ /**
+ * The value for the touchAction property/fallback.
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
+ * @type {String}
+ * @default compute
+ */
+ touchAction: TOUCH_ACTION_COMPUTE,
+
+ /**
+ * @type {Boolean}
+ * @default true
+ */
+ enable: true,
+
+ /**
+ * EXPERIMENTAL FEATURE -- can be removed/changed
+ * Change the parent input target element.
+ * If Null, then it is being set the to main element.
+ * @type {Null|EventTarget}
+ * @default null
+ */
+ inputTarget: null,
+
+ /**
+ * force an input class
+ * @type {Null|Function}
+ * @default null
+ */
+ inputClass: null,
+
+ /**
+ * Default recognizer setup when calling `Hammer()`
+ * When creating a new Manager these will be skipped.
+ * @type {Array}
+ */
+ preset: [
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
+ [RotateRecognizer, { enable: false }],
+ [PinchRecognizer, { enable: false }, ['rotate']],
+ [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],
+ [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],
+ [TapRecognizer],
+ [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],
+ [PressRecognizer]
+ ],
+
+ /**
+ * Some CSS properties can be used to improve the working of Hammer.
+ * Add them to this method and they will be set when creating a new Manager.
+ * @namespace
+ */
+ cssProps: {
+ /**
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userSelect: 'none',
+
+ /**
+ * Disable the Windows Phone grippers when pressing an element.
+ * @type {String}
+ * @default 'none'
+ */
+ touchSelect: 'none',
+
+ /**
+ * Disables the default callout shown when you touch and hold a touch target.
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
+ * a callout containing information about the link. This property allows you to disable that callout.
+ * @type {String}
+ * @default 'none'
+ */
+ touchCallout: 'none',
+
+ /**
+ * Specifies whether zooming is enabled. Used by IE10>
+ * @type {String}
+ * @default 'none'
+ */
+ contentZooming: 'none',
+
+ /**
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userDrag: 'none',
+
+ /**
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
+ * clickable element in iOS. This property obeys the alpha value, if specified.
+ * @type {String}
+ * @default 'rgba(0,0,0,0)'
+ */
+ tapHighlightColor: 'rgba(0,0,0,0)'
+ }
+};
+
+var STOP = 1;
+var FORCED_STOP = 2;
+
+/**
+ * Manager
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+function Manager(element, options) {
+ options = options || {};
+
+ this.options = merge(options, Hammer.defaults);
+ this.options.inputTarget = this.options.inputTarget || element;
+
+ this.handlers = {};
+ this.session = {};
+ this.recognizers = [];
+
+ this.element = element;
+ this.input = createInputInstance(this);
+ this.touchAction = new TouchAction(this, this.options.touchAction);
+
+ toggleCssProps(this, true);
+
+ each(options.recognizers, function(item) {
+ var recognizer = this.add(new (item[0])(item[1]));
+ item[2] && recognizer.recognizeWith(item[2]);
+ item[3] && recognizer.requireFailure(item[3]);
+ }, this);
+}
+
+Manager.prototype = {
+ /**
+ * set options
+ * @param {Object} options
+ * @returns {Manager}
+ */
+ set: function(options) {
+ extend(this.options, options);
+
+ // Options that need a little more setup
+ if (options.touchAction) {
+ this.touchAction.update();
+ }
+ if (options.inputTarget) {
+ // Clean up existing event listeners and reinitialize
+ this.input.destroy();
+ this.input.target = options.inputTarget;
+ this.input.init();
+ }
+ return this;
+ },
+
+ /**
+ * stop recognizing for this session.
+ * This session will be discarded, when a new [input]start event is fired.
+ * When forced, the recognizer cycle is stopped immediately.
+ * @param {Boolean} [force]
+ */
+ stop: function(force) {
+ this.session.stopped = force ? FORCED_STOP : STOP;
+ },
+
+ /**
+ * run the recognizers!
+ * called by the inputHandler function on every movement of the pointers (touches)
+ * it walks through all the recognizers and tries to detect the gesture that is being made
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ var session = this.session;
+ if (session.stopped) {
+ return;
+ }
+
+ // run the touch-action polyfill
+ this.touchAction.preventDefaults(inputData);
+
+ var recognizer;
+ var recognizers = this.recognizers;
+
+ // this holds the recognizer that is being recognized.
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
+ // if no recognizer is detecting a thing, it is set to `null`
+ var curRecognizer = session.curRecognizer;
+
+ // reset when the last recognizer is recognized
+ // or when we're in a new session
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
+ curRecognizer = session.curRecognizer = null;
+ }
+
+ var i = 0;
+ while (i < recognizers.length) {
+ recognizer = recognizers[i];
+
+ // find out if we are allowed try to recognize the input for this one.
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
+ // that is being recognized.
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
+ // this can be setup with the `recognizeWith()` method on the recognizer.
+ if (session.stopped !== FORCED_STOP && ( // 1
+ !curRecognizer || recognizer == curRecognizer || // 2
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
+ recognizer.recognize(inputData);
+ } else {
+ recognizer.reset();
+ }
+
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
+ // current active recognizer. but only if we don't already have an active recognizer
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
+ curRecognizer = session.curRecognizer = recognizer;
+ }
+ i++;
+ }
+ },
+
+ /**
+ * get a recognizer by its event name.
+ * @param {Recognizer|String} recognizer
+ * @returns {Recognizer|Null}
+ */
+ get: function(recognizer) {
+ if (recognizer instanceof Recognizer) {
+ return recognizer;
+ }
+
+ var recognizers = this.recognizers;
+ for (var i = 0; i < recognizers.length; i++) {
+ if (recognizers[i].options.event == recognizer) {
+ return recognizers[i];
+ }
+ }
+ return null;
+ },
+
+ /**
+ * add a recognizer to the manager
+ * existing recognizers with the same event name will be removed
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer|Manager}
+ */
+ add: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'add', this)) {
+ return this;
+ }
+
+ // remove existing
+ var existing = this.get(recognizer.options.event);
+ if (existing) {
+ this.remove(existing);
+ }
+
+ this.recognizers.push(recognizer);
+ recognizer.manager = this;
+
+ this.touchAction.update();
+ return recognizer;
+ },
+
+ /**
+ * remove a recognizer by name or instance
+ * @param {Recognizer|String} recognizer
+ * @returns {Manager}
+ */
+ remove: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'remove', this)) {
+ return this;
+ }
+
+ var recognizers = this.recognizers;
+ recognizer = this.get(recognizer);
+ recognizers.splice(inArray(recognizers, recognizer), 1);
+
+ this.touchAction.update();
+ return this;
+ },
+
+ /**
+ * bind event
+ * @param {String} events
+ * @param {Function} handler
+ * @returns {EventEmitter} this
+ */
+ on: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ handlers[event] = handlers[event] || [];
+ handlers[event].push(handler);
+ });
+ return this;
+ },
+
+ /**
+ * unbind event, leave emit blank to remove all handlers
+ * @param {String} events
+ * @param {Function} [handler]
+ * @returns {EventEmitter} this
+ */
+ off: function(events, handler) {
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ if (!handler) {
+ delete handlers[event];
+ } else {
+ handlers[event].splice(inArray(handlers[event], handler), 1);
+ }
+ });
+ return this;
+ },
+
+ /**
+ * emit event to the listeners
+ * @param {String} event
+ * @param {Object} data
+ */
+ emit: function(event, data) {
+ // we also want to trigger dom events
+ if (this.options.domEvents) {
+ triggerDomEvent(event, data);
+ }
+
+ // no handlers, so skip it all
+ var handlers = this.handlers[event] && this.handlers[event].slice();
+ if (!handlers || !handlers.length) {
+ return;
+ }
+
+ data.type = event;
+ data.preventDefault = function() {
+ data.srcEvent.preventDefault();
+ };
+
+ var i = 0;
+ while (i < handlers.length) {
+ handlers[i](data);
+ i++;
+ }
+ },
+
+ /**
+ * destroy the manager and unbinds all events
+ * it doesn't unbind dom events, that is the user own responsibility
+ */
+ destroy: function() {
+ this.element && toggleCssProps(this, false);
+
+ this.handlers = {};
+ this.session = {};
+ this.input.destroy();
+ this.element = null;
+ }
+};
+
+/**
+ * add/remove the css properties as defined in manager.options.cssProps
+ * @param {Manager} manager
+ * @param {Boolean} add
+ */
+function toggleCssProps(manager, add) {
+ var element = manager.element;
+ each(manager.options.cssProps, function(value, name) {
+ element.style[prefixed(element.style, name)] = add ? value : '';
+ });
+}
+
+/**
+ * trigger dom event
+ * @param {String} event
+ * @param {Object} data
+ */
+function triggerDomEvent(event, data) {
+ var gestureEvent = document.createEvent('Event');
+ gestureEvent.initEvent(event, true, true);
+ gestureEvent.gesture = data;
+ data.target.dispatchEvent(gestureEvent);
+}
+
+extend(Hammer, {
+ INPUT_START: INPUT_START,
+ INPUT_MOVE: INPUT_MOVE,
+ INPUT_END: INPUT_END,
+ INPUT_CANCEL: INPUT_CANCEL,
+
+ STATE_POSSIBLE: STATE_POSSIBLE,
+ STATE_BEGAN: STATE_BEGAN,
+ STATE_CHANGED: STATE_CHANGED,
+ STATE_ENDED: STATE_ENDED,
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
+ STATE_CANCELLED: STATE_CANCELLED,
+ STATE_FAILED: STATE_FAILED,
+
+ DIRECTION_NONE: DIRECTION_NONE,
+ DIRECTION_LEFT: DIRECTION_LEFT,
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
+ DIRECTION_UP: DIRECTION_UP,
+ DIRECTION_DOWN: DIRECTION_DOWN,
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
+ DIRECTION_ALL: DIRECTION_ALL,
+
+ Manager: Manager,
+ Input: Input,
+ TouchAction: TouchAction,
+
+ TouchInput: TouchInput,
+ MouseInput: MouseInput,
+ PointerEventInput: PointerEventInput,
+ TouchMouseInput: TouchMouseInput,
+ SingleTouchInput: SingleTouchInput,
+
+ Recognizer: Recognizer,
+ AttrRecognizer: AttrRecognizer,
+ Tap: TapRecognizer,
+ Pan: PanRecognizer,
+ Swipe: SwipeRecognizer,
+ Pinch: PinchRecognizer,
+ Rotate: RotateRecognizer,
+ Press: PressRecognizer,
+
+ on: addEventListeners,
+ off: removeEventListeners,
+ each: each,
+ merge: merge,
+ extend: extend,
+ inherit: inherit,
+ bindFn: bindFn,
+ prefixed: prefixed
+});
+
+if (typeof define == TYPE_FUNCTION && define.amd) {
+ define(function() {
+ return Hammer;
+ });
+} else if (typeof module != 'undefined' && module.exports) {
+ module.exports = Hammer;
+} else {
+ window[exportName] = Hammer;
+}
+
+})(window, document, 'Hammer');
+
+},{}],187:[function(_dereq_,module,exports){
+// Snap.svg 0.3.0
+//
+// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// build: 2014-09-08
+
+(function (glob, factory) {
+ // AMD support
+ if (typeof define === "function" && define.amd) {
+ // Define as an anonymous module
+ define(["eve"], function( eve ) {
+ return factory(glob, eve);
+ });
+ } else if (typeof exports !== 'undefined') {
+ // Next for Node.js or CommonJS
+ var eve = _dereq_(185);
+ module.exports = factory(glob, eve);
+ } else {
+ // Browser globals (glob is window)
+ // Snap adds itself to window
+ factory(glob, glob.eve);
+ }
+}(window || this, function (window, eve) {
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+var mina = (function (eve) {
+ var animations = {},
+ requestAnimFrame = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function (callback) {
+ setTimeout(callback, 16);
+ },
+ isArray = Array.isArray || function (a) {
+ return a instanceof Array ||
+ Object.prototype.toString.call(a) == "[object Array]";
+ },
+ idgen = 0,
+ idprefix = "M" + (+new Date).toString(36),
+ ID = function () {
+ return idprefix + (idgen++).toString(36);
+ },
+ diff = function (a, b, A, B) {
+ if (isArray(a)) {
+ res = [];
+ for (var i = 0, ii = a.length; i < ii; i++) {
+ res[i] = diff(a[i], b, A[i], B);
+ }
+ return res;
+ }
+ var dif = (A - a) / (B - b);
+ return function (bb) {
+ return a + dif * (bb - b);
+ };
+ },
+ timer = Date.now || function () {
+ return +new Date;
+ },
+ sta = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.s;
+ }
+ var ds = a.s - val;
+ a.b += a.dur * ds;
+ a.B += a.dur * ds;
+ a.s = val;
+ },
+ speed = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.spd;
+ }
+ a.spd = val;
+ },
+ duration = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.dur;
+ }
+ a.s = a.s * val / a.dur;
+ a.dur = val;
+ },
+ stopit = function () {
+ var a = this;
+ delete animations[a.id];
+ a.update();
+ eve("mina.stop." + a.id, a);
+ },
+ pause = function () {
+ var a = this;
+ if (a.pdif) {
+ return;
+ }
+ delete animations[a.id];
+ a.update();
+ a.pdif = a.get() - a.b;
+ },
+ resume = function () {
+ var a = this;
+ if (!a.pdif) {
+ return;
+ }
+ a.b = a.get() - a.pdif;
+ delete a.pdif;
+ animations[a.id] = a;
+ },
+ update = function () {
+ var a = this,
+ res;
+ if (isArray(a.start)) {
+ res = [];
+ for (var j = 0, jj = a.start.length; j < jj; j++) {
+ res[j] = +a.start[j] +
+ (a.end[j] - a.start[j]) * a.easing(a.s);
+ }
+ } else {
+ res = +a.start + (a.end - a.start) * a.easing(a.s);
+ }
+ a.set(res);
+ },
+ frame = function () {
+ var len = 0;
+ for (var i in animations) if (animations.hasOwnProperty(i)) {
+ var a = animations[i],
+ b = a.get(),
+ res;
+ len++;
+ a.s = (b - a.b) / (a.dur / a.spd);
+ if (a.s >= 1) {
+ delete animations[i];
+ a.s = 1;
+ len--;
+ (function (a) {
+ setTimeout(function () {
+ eve("mina.finish." + a.id, a);
+ });
+ }(a));
+ }
+ a.update();
+ }
+ len && requestAnimFrame(frame);
+ },
+ /*\
+ * mina
+ [ method ]
+ **
+ * Generic animation of numbers
+ **
+ - a (number) start _slave_ number
+ - A (number) end _slave_ number
+ - b (number) start _master_ number (start time in general case)
+ - B (number) end _master_ number (end time in gereal case)
+ - get (function) getter of _master_ number (see @mina.time)
+ - set (function) setter of _slave_ number
+ - easing (function) #optional easing function, default is @mina.linear
+ = (object) animation descriptor
+ o {
+ o id (string) animation id,
+ o start (number) start _slave_ number,
+ o end (number) end _slave_ number,
+ o b (number) start _master_ number,
+ o s (number) animation status (0..1),
+ o dur (number) animation duration,
+ o spd (number) animation speed,
+ o get (function) getter of _master_ number (see @mina.time),
+ o set (function) setter of _slave_ number,
+ o easing (function) easing function, default is @mina.linear,
+ o status (function) status getter/setter,
+ o speed (function) speed getter/setter,
+ o duration (function) duration getter/setter,
+ o stop (function) animation stopper
+ o pause (function) pauses the animation
+ o resume (function) resumes the animation
+ o update (function) calles setter with the right value of the animation
+ o }
+ \*/
+ mina = function (a, A, b, B, get, set, easing) {
+ var anim = {
+ id: ID(),
+ start: a,
+ end: A,
+ b: b,
+ s: 0,
+ dur: B - b,
+ spd: 1,
+ get: get,
+ set: set,
+ easing: easing || mina.linear,
+ status: sta,
+ speed: speed,
+ duration: duration,
+ stop: stopit,
+ pause: pause,
+ resume: resume,
+ update: update
+ };
+ animations[anim.id] = anim;
+ var len = 0, i;
+ for (i in animations) if (animations.hasOwnProperty(i)) {
+ len++;
+ if (len == 2) {
+ break;
+ }
+ }
+ len == 1 && requestAnimFrame(frame);
+ return anim;
+ };
+ /*\
+ * mina.time
+ [ method ]
+ **
+ * Returns the current time. Equivalent to:
+ | function () {
+ | return (new Date).getTime();
+ | }
+ \*/
+ mina.time = timer;
+ /*\
+ * mina.getById
+ [ method ]
+ **
+ * Returns an animation by its id
+ - id (string) animation's id
+ = (object) See @mina
+ \*/
+ mina.getById = function (id) {
+ return animations[id] || null;
+ };
+
+ /*\
+ * mina.linear
+ [ method ]
+ **
+ * Default linear easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.linear = function (n) {
+ return n;
+ };
+ /*\
+ * mina.easeout
+ [ method ]
+ **
+ * Easeout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeout = function (n) {
+ return Math.pow(n, 1.7);
+ };
+ /*\
+ * mina.easein
+ [ method ]
+ **
+ * Easein easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easein = function (n) {
+ return Math.pow(n, .48);
+ };
+ /*\
+ * mina.easeinout
+ [ method ]
+ **
+ * Easeinout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeinout = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ if (n == 0) {
+ return 0;
+ }
+ var q = .48 - n / 1.04,
+ Q = Math.sqrt(.1734 + q * q),
+ x = Q - q,
+ X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
+ y = -Q - q,
+ Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
+ t = X + Y + .5;
+ return (1 - t) * 3 * t * t + t * t * t;
+ };
+ /*\
+ * mina.backin
+ [ method ]
+ **
+ * Backin easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backin = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ var s = 1.70158;
+ return n * n * ((s + 1) * n - s);
+ };
+ /*\
+ * mina.backout
+ [ method ]
+ **
+ * Backout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backout = function (n) {
+ if (n == 0) {
+ return 0;
+ }
+ n = n - 1;
+ var s = 1.70158;
+ return n * n * ((s + 1) * n + s) + 1;
+ };
+ /*\
+ * mina.elastic
+ [ method ]
+ **
+ * Elastic easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.elastic = function (n) {
+ if (n == !!n) {
+ return n;
+ }
+ return Math.pow(2, -10 * n) * Math.sin((n - .075) *
+ (2 * Math.PI) / .3) + 1;
+ };
+ /*\
+ * mina.bounce
+ [ method ]
+ **
+ * Bounce easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.bounce = function (n) {
+ var s = 7.5625,
+ p = 2.75,
+ l;
+ if (n < (1 / p)) {
+ l = s * n * n;
+ } else {
+ if (n < (2 / p)) {
+ n -= (1.5 / p);
+ l = s * n * n + .75;
+ } else {
+ if (n < (2.5 / p)) {
+ n -= (2.25 / p);
+ l = s * n * n + .9375;
+ } else {
+ n -= (2.625 / p);
+ l = s * n * n + .984375;
+ }
+ }
+ }
+ return l;
+ };
+ window.mina = mina;
+ return mina;
+})(typeof eve == "undefined" ? function () {} : eve);
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+var Snap = (function(root) {
+Snap.version = "0.3.0";
+/*\
+ * Snap
+ [ method ]
+ **
+ * Creates a drawing surface or wraps existing SVG element.
+ **
+ - width (number|string) width of surface
+ - height (number|string) height of surface
+ * or
+ - DOM (SVGElement) element to be wrapped into Snap structure
+ * or
+ - array (array) array of elements (will return set of elements)
+ * or
+ - query (string) CSS query selector
+ = (object) @Element
+\*/
+function Snap(w, h) {
+ if (w) {
+ if (w.tagName) {
+ return wrap(w);
+ }
+ if (is(w, "array") && Snap.set) {
+ return Snap.set.apply(Snap, w);
+ }
+ if (w instanceof Element) {
+ return w;
+ }
+ if (h == null) {
+ w = glob.doc.querySelector(w);
+ return wrap(w);
+ }
+ }
+ w = w == null ? "100%" : w;
+ h = h == null ? "100%" : h;
+ return new Paper(w, h);
+}
+Snap.toString = function () {
+ return "Snap v" + this.version;
+};
+Snap._ = {};
+var glob = {
+ win: root.window,
+ doc: root.window.document
+};
+Snap._.glob = glob;
+var has = "hasOwnProperty",
+ Str = String,
+ toFloat = parseFloat,
+ toInt = parseInt,
+ math = Math,
+ mmax = math.max,
+ mmin = math.min,
+ abs = math.abs,
+ pow = math.pow,
+ PI = math.PI,
+ round = math.round,
+ E = "",
+ S = " ",
+ objectToString = Object.prototype.toString,
+ ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
+ colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
+ bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ separator = Snap._.separator = /[,\s]+/,
+ whitespace = /[\s]/g,
+ commaSpaces = /[\s]*,[\s]*/,
+ hsrg = {hs: 1, rg: 1},
+ pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
+ idgen = 0,
+ idprefix = "S" + (+new Date).toString(36),
+ ID = function (el) {
+ return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
+ },
+ xlink = "http://www.w3.org/1999/xlink",
+ xmlns = "http://www.w3.org/2000/svg",
+ hub = {},
+ URL = Snap.url = function (url) {
+ return "url('#" + url + "')";
+ };
+
+function $(el, attr) {
+ if (attr) {
+ if (el == "#text") {
+ el = glob.doc.createTextNode(attr.text || "");
+ }
+ if (typeof el == "string") {
+ el = $(el);
+ }
+ if (typeof attr == "string") {
+ if (attr.substring(0, 6) == "xlink:") {
+ return el.getAttributeNS(xlink, attr.substring(6));
+ }
+ if (attr.substring(0, 4) == "xml:") {
+ return el.getAttributeNS(xmlns, attr.substring(4));
+ }
+ return el.getAttribute(attr);
+ }
+ for (var key in attr) if (attr[has](key)) {
+ var val = Str(attr[key]);
+ if (val) {
+ if (key.substring(0, 6) == "xlink:") {
+ el.setAttributeNS(xlink, key.substring(6), val);
+ } else if (key.substring(0, 4) == "xml:") {
+ el.setAttributeNS(xmlns, key.substring(4), val);
+ } else {
+ el.setAttribute(key, val);
+ }
+ } else {
+ el.removeAttribute(key);
+ }
+ }
+ } else {
+ el = glob.doc.createElementNS(xmlns, el);
+ }
+ return el;
+}
+Snap._.$ = $;
+Snap._.id = ID;
+function getAttrs(el) {
+ var attrs = el.attributes,
+ name,
+ out = {};
+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].namespaceURI == xlink) {
+ name = "xlink:";
+ } else {
+ name = "";
+ }
+ name += attrs[i].name;
+ out[name] = attrs[i].textContent;
+ }
+ return out;
+}
+function is(o, type) {
+ type = Str.prototype.toLowerCase.call(type);
+ if (type == "finite") {
+ return isFinite(o);
+ }
+ if (type == "array" &&
+ (o instanceof Array || Array.isArray && Array.isArray(o))) {
+ return true;
+ }
+ return (type == "null" && o === null) ||
+ (type == typeof o && o !== null) ||
+ (type == "object" && o === Object(o)) ||
+ objectToString.call(o).slice(8, -1).toLowerCase() == type;
+}
+/*\
+ * Snap.format
+ [ method ]
+ **
+ * Replaces construction of type `{<name>}` to the corresponding argument
+ **
+ - token (string) string to format
+ - json (object) object which properties are used as a replacement
+ = (string) formatted string
+ > Usage
+ | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+ | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
+ | x: 10,
+ | y: 20,
+ | dim: {
+ | width: 40,
+ | height: 50,
+ | "negative width": -40
+ | }
+ | }));
+\*/
+Snap.format = (function () {
+ var tokenRegex = /\{([^\}]+)\}/g,
+ objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
+ replacer = function (all, key, obj) {
+ var res = obj;
+ key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
+ name = name || quotedName;
+ if (res) {
+ if (name in res) {
+ res = res[name];
+ }
+ typeof res == "function" && isFunc && (res = res());
+ }
+ });
+ res = (res == null || res == obj ? all : res) + "";
+ return res;
+ };
+ return function (str, obj) {
+ return Str(str).replace(tokenRegex, function (all, key) {
+ return replacer(all, key, obj);
+ });
+ };
+})();
+function clone(obj) {
+ if (typeof obj == "function" || Object(obj) !== obj) {
+ return obj;
+ }
+ var res = new obj.constructor;
+ for (var key in obj) if (obj[has](key)) {
+ res[key] = clone(obj[key]);
+ }
+ return res;
+}
+Snap._.clone = clone;
+function repush(array, item) {
+ for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
+ return array.push(array.splice(i, 1)[0]);
+ }
+}
+function cacher(f, scope, postprocessor) {
+ function newf() {
+ var arg = Array.prototype.slice.call(arguments, 0),
+ args = arg.join("\u2400"),
+ cache = newf.cache = newf.cache || {},
+ count = newf.count = newf.count || [];
+ if (cache[has](args)) {
+ repush(count, args);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ count.length >= 1e3 && delete cache[count.shift()];
+ count.push(args);
+ cache[args] = f.apply(scope, arg);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ return newf;
+}
+Snap._.cacher = cacher;
+function angle(x1, y1, x2, y2, x3, y3) {
+ if (x3 == null) {
+ var x = x1 - x2,
+ y = y1 - y2;
+ if (!x && !y) {
+ return 0;
+ }
+ return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
+ } else {
+ return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
+ }
+}
+function rad(deg) {
+ return deg % 360 * PI / 180;
+}
+function deg(rad) {
+ return rad * 180 / PI % 360;
+}
+function x_y() {
+ return this.x + S + this.y;
+}
+function x_y_w_h() {
+ return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
+}
+
+/*\
+ * Snap.rad
+ [ method ]
+ **
+ * Transform angle to radians
+ - deg (number) angle in degrees
+ = (number) angle in radians
+\*/
+Snap.rad = rad;
+/*\
+ * Snap.deg
+ [ method ]
+ **
+ * Transform angle to degrees
+ - rad (number) angle in radians
+ = (number) angle in degrees
+\*/
+Snap.deg = deg;
+/*\
+ * Snap.angle
+ [ method ]
+ **
+ * Returns an angle between two or three points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ - x3 (number) #optional x coord of third point
+ - y3 (number) #optional y coord of third point
+ = (number) angle in degrees
+\*/
+Snap.angle = angle;
+/*\
+ * Snap.is
+ [ method ]
+ **
+ * Handy replacement for the `typeof` operator
+ - o (…) any object or primitive
+ - type (string) name of the type, e.g., `string`, `function`, `number`, etc.
+ = (boolean) `true` if given value is of given type
+\*/
+Snap.is = is;
+/*\
+ * Snap.snapTo
+ [ method ]
+ **
+ * Snaps given value to given grid
+ - values (array|number) given array of values or step of the grid
+ - value (number) value to adjust
+ - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.
+ = (number) adjusted value
+\*/
+Snap.snapTo = function (values, value, tolerance) {
+ tolerance = is(tolerance, "finite") ? tolerance : 10;
+ if (is(values, "array")) {
+ var i = values.length;
+ while (i--) if (abs(values[i] - value) <= tolerance) {
+ return values[i];
+ }
+ } else {
+ values = +values;
+ var rem = value % values;
+ if (rem < tolerance) {
+ return value - rem;
+ }
+ if (rem > values - tolerance) {
+ return value - rem + values;
+ }
+ }
+ return value;
+};
+// Colour
+/*\
+ * Snap.getRGB
+ [ method ]
+ **
+ * Parses color string as RGB object
+ - color (string) color string in one of the following formats:
+ # <ul>
+ # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
+ # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
+ # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
+ # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>
+ # <li>rgba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>
+ # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>
+ # <li>hsba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>
+ # <li>hsla(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # </ul>
+ * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) true if string can't be parsed
+ o }
+\*/
+Snap.getRGB = cacher(function (colour) {
+ if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ if (colour == "none") {
+ return {r: -1, g: -1, b: -1, hex: "none", toString: rgbtoString};
+ }
+ !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
+ if (!colour) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ var res,
+ red,
+ green,
+ blue,
+ opacity,
+ t,
+ values,
+ rgb = colour.match(colourRegExp);
+ if (rgb) {
+ if (rgb[2]) {
+ blue = toInt(rgb[2].substring(5), 16);
+ green = toInt(rgb[2].substring(3, 5), 16);
+ red = toInt(rgb[2].substring(1, 3), 16);
+ }
+ if (rgb[3]) {
+ blue = toInt((t = rgb[3].charAt(3)) + t, 16);
+ green = toInt((t = rgb[3].charAt(2)) + t, 16);
+ red = toInt((t = rgb[3].charAt(1)) + t, 16);
+ }
+ if (rgb[4]) {
+ values = rgb[4].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ }
+ if (rgb[5]) {
+ values = rgb[5].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsb2rgb(red, green, blue, opacity);
+ }
+ if (rgb[6]) {
+ values = rgb[6].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsl2rgb(red, green, blue, opacity);
+ }
+ red = mmin(math.round(red), 255);
+ green = mmin(math.round(green), 255);
+ blue = mmin(math.round(blue), 255);
+ opacity = mmin(mmax(opacity, 0), 1);
+ rgb = {r: red, g: green, b: blue, toString: rgbtoString};
+ rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
+ rgb.opacity = is(opacity, "finite") ? opacity : 1;
+ return rgb;
+ }
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+}, Snap);
+// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.
+/*\
+ * Snap.hsb
+ [ method ]
+ **
+ * Converts HSB values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - b (number) value or brightness
+ = (string) hex representation of the color
+\*/
+Snap.hsb = cacher(function (h, s, b) {
+ return Snap.hsb2rgb(h, s, b).hex;
+});
+/*\
+ * Snap.hsl
+ [ method ]
+ **
+ * Converts HSL values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (string) hex representation of the color
+\*/
+Snap.hsl = cacher(function (h, s, l) {
+ return Snap.hsl2rgb(h, s, l).hex;
+});
+/*\
+ * Snap.rgb
+ [ method ]
+ **
+ * Converts RGB values to a hex representation of the color
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (string) hex representation of the color
+\*/
+Snap.rgb = cacher(function (r, g, b, o) {
+ if (is(o, "finite")) {
+ var round = math.round;
+ return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
+ }
+ return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
+});
+var toHex = function (color) {
+ var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
+ red = "rgb(255, 0, 0)";
+ toHex = cacher(function (color) {
+ if (color.toLowerCase() == "red") {
+ return red;
+ }
+ i.style.color = red;
+ i.style.color = color;
+ var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
+ return out == red ? null : out;
+ });
+ return toHex(color);
+},
+hsbtoString = function () {
+ return "hsb(" + [this.h, this.s, this.b] + ")";
+},
+hsltoString = function () {
+ return "hsl(" + [this.h, this.s, this.l] + ")";
+},
+rgbtoString = function () {
+ return this.opacity == 1 || this.opacity == null ?
+ this.hex :
+ "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
+},
+prepareRGB = function (r, g, b) {
+ if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
+ b = r.b;
+ g = r.g;
+ r = r.r;
+ }
+ if (g == null && is(r, string)) {
+ var clr = Snap.getRGB(r);
+ r = clr.r;
+ g = clr.g;
+ b = clr.b;
+ }
+ if (r > 1 || g > 1 || b > 1) {
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ }
+
+ return [r, g, b];
+},
+packageRGB = function (r, g, b, o) {
+ r = math.round(r * 255);
+ g = math.round(g * 255);
+ b = math.round(b * 255);
+ var rgb = {
+ r: r,
+ g: g,
+ b: b,
+ opacity: is(o, "finite") ? o : 1,
+ hex: Snap.rgb(r, g, b),
+ toString: rgbtoString
+ };
+ is(o, "finite") && (rgb.opacity = o);
+ return rgb;
+};
+// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?
+/*\
+ * Snap.color
+ [ method ]
+ **
+ * Parses the color string and returns an object featuring the color's component values
+ - clr (string) color string in one of the supported formats (see @Snap.getRGB)
+ = (object) Combined RGB/HSB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) `true` if string can't be parsed,
+ o h (number) hue,
+ o s (number) saturation,
+ o v (number) value (brightness),
+ o l (number) lightness
+ o }
+\*/
+Snap.color = function (clr) {
+ var rgb;
+ if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
+ rgb = Snap.hsb2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
+ rgb = Snap.hsl2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else {
+ if (is(clr, "string")) {
+ clr = Snap.getRGB(clr);
+ }
+ if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
+ rgb = Snap.rgb2hsl(clr);
+ clr.h = rgb.h;
+ clr.s = rgb.s;
+ clr.l = rgb.l;
+ rgb = Snap.rgb2hsb(clr);
+ clr.v = rgb.b;
+ } else {
+ clr = {hex: "none"};
+ clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
+ clr.error = 1;
+ }
+ }
+ clr.toString = rgbtoString;
+ return clr;
+};
+/*\
+ * Snap.hsb2rgb
+ [ method ]
+ **
+ * Converts HSB values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - v (number) value or brightness
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsb2rgb = function (h, s, v, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
+ v = h.b;
+ s = h.s;
+ h = h.h;
+ o = h.o;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = v * s;
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = v - C;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.hsl2rgb
+ [ method ]
+ **
+ * Converts HSL values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsl2rgb = function (h, s, l, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
+ l = h.l;
+ s = h.s;
+ h = h.h;
+ }
+ if (h > 1 || s > 1 || l > 1) {
+ h /= 360;
+ s /= 100;
+ l /= 100;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = 2 * s * (l < .5 ? l : 1 - l);
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = l - C / 2;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.rgb2hsb
+ [ method ]
+ **
+ * Converts RGB values to an HSB object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSB object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o b (number) brightness
+ o }
+\*/
+Snap.rgb2hsb = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, V, C;
+ V = mmax(r, g, b);
+ C = V - mmin(r, g, b);
+ H = (C == 0 ? null :
+ V == r ? (g - b) / C :
+ V == g ? (b - r) / C + 2 :
+ (r - g) / C + 4
+ );
+ H = ((H + 360) % 6) * 60 / 360;
+ S = C == 0 ? 0 : C / V;
+ return {h: H, s: S, b: V, toString: hsbtoString};
+};
+/*\
+ * Snap.rgb2hsl
+ [ method ]
+ **
+ * Converts RGB values to an HSL object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSL object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o l (number) luminosity
+ o }
+\*/
+Snap.rgb2hsl = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, L, M, m, C;
+ M = mmax(r, g, b);
+ m = mmin(r, g, b);
+ C = M - m;
+ H = (C == 0 ? null :
+ M == r ? (g - b) / C :
+ M == g ? (b - r) / C + 2 :
+ (r - g) / C + 4);
+ H = ((H + 360) % 6) * 60 / 360;
+ L = (M + m) / 2;
+ S = (C == 0 ? 0 :
+ L < .5 ? C / (2 * L) :
+ C / (2 - 2 * L));
+ return {h: H, s: S, l: L, toString: hsltoString};
+};
+
+// Transformations
+// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured?
+/*\
+ * Snap.parsePathString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given path string into an array of arrays of path segments
+ - pathString (string|array) path string or array of segments (in the last case it is returned straight away)
+ = (array) array of segments
+\*/
+Snap.parsePathString = function (pathString) {
+ if (!pathString) {
+ return null;
+ }
+ var pth = Snap.path(pathString);
+ if (pth.arr) {
+ return Snap.path.clone(pth.arr);
+ }
+
+ var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
+ data = [];
+ if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
+ data = Snap.path.clone(pathString);
+ }
+ if (!data.length) {
+ Str(pathString).replace(pathCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ if (name == "m" && params.length > 2) {
+ data.push([b].concat(params.splice(0, 2)));
+ name = "l";
+ b = b == "m" ? "l" : "L";
+ }
+ if (name == "o" && params.length == 1) {
+ data.push([b, params[0]]);
+ }
+ if (name == "r") {
+ data.push([b].concat(params));
+ } else while (params.length >= paramCounts[name]) {
+ data.push([b].concat(params.splice(0, paramCounts[name])));
+ if (!paramCounts[name]) {
+ break;
+ }
+ }
+ });
+ }
+ data.toString = Snap.path.toString;
+ pth.arr = Snap.path.clone(data);
+ return data;
+};
+/*\
+ * Snap.parseTransformString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given transform string into an array of transformations
+ - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)
+ = (array) array of transformations
+\*/
+var parseTransformString = Snap.parseTransformString = function (TString) {
+ if (!TString) {
+ return null;
+ }
+ var paramCounts = {r: 3, s: 4, t: 2, m: 6},
+ data = [];
+ if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
+ data = Snap.path.clone(TString);
+ }
+ if (!data.length) {
+ Str(TString).replace(tCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ data.push([b].concat(params));
+ });
+ }
+ data.toString = Snap.path.toString;
+ return data;
+};
+function svgTransform2string(tstr) {
+ var res = [];
+ tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function (all, name, params) {
+ params = params.split(/\s*,\s*|\s+/);
+ if (name == "rotate" && params.length == 1) {
+ params.push(0, 0);
+ }
+ if (name == "scale") {
+ if (params.length > 2) {
+ params = params.slice(0, 2);
+ } else if (params.length == 2) {
+ params.push(0, 0);
+ }
+ if (params.length == 1) {
+ params.push(params[0], 0, 0);
+ }
+ }
+ if (name == "skewX") {
+ res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
+ } else if (name == "skewY") {
+ res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
+ } else {
+ res.push([name.charAt(0)].concat(params));
+ }
+ return all;
+ });
+ return res;
+}
+Snap._.svgTransform2string = svgTransform2string;
+Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
+function transform2matrix(tstr, bbox) {
+ var tdata = parseTransformString(tstr),
+ m = new Snap.Matrix;
+ if (tdata) {
+ for (var i = 0, ii = tdata.length; i < ii; i++) {
+ var t = tdata[i],
+ tlen = t.length,
+ command = Str(t[0]).toLowerCase(),
+ absolute = t[0] != command,
+ inver = absolute ? m.invert() : 0,
+ x1,
+ y1,
+ x2,
+ y2,
+ bb;
+ if (command == "t" && tlen == 2){
+ m.translate(t[1], 0);
+ } else if (command == "t" && tlen == 3) {
+ if (absolute) {
+ x1 = inver.x(0, 0);
+ y1 = inver.y(0, 0);
+ x2 = inver.x(t[1], t[2]);
+ y2 = inver.y(t[1], t[2]);
+ m.translate(x2 - x1, y2 - y1);
+ } else {
+ m.translate(t[1], t[2]);
+ }
+ } else if (command == "r") {
+ if (tlen == 2) {
+ bb = bb || bbox;
+ m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.rotate(t[1], x2, y2);
+ } else {
+ m.rotate(t[1], t[2], t[3]);
+ }
+ }
+ } else if (command == "s") {
+ if (tlen == 2 || tlen == 3) {
+ bb = bb || bbox;
+ m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.scale(t[1], t[1], x2, y2);
+ } else {
+ m.scale(t[1], t[1], t[2], t[3]);
+ }
+ } else if (tlen == 5) {
+ if (absolute) {
+ x2 = inver.x(t[3], t[4]);
+ y2 = inver.y(t[3], t[4]);
+ m.scale(t[1], t[2], x2, y2);
+ } else {
+ m.scale(t[1], t[2], t[3], t[4]);
+ }
+ }
+ } else if (command == "m" && tlen == 7) {
+ m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
+ }
+ }
+ }
+ return m;
+}
+Snap._.transform2matrix = transform2matrix;
+Snap._unit2px = unit2px;
+var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
+ function (a, b) {
+ var adown = a.nodeType == 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a == bup || !!(bup && bup.nodeType == 1 && (
+ adown.contains ?
+ adown.contains(bup) :
+ a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
+ ));
+ } :
+ function (a, b) {
+ if (b) {
+ while (b) {
+ b = b.parentNode;
+ if (b == a) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+function getSomeDefs(el) {
+ var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
+ (el.node.parentNode && wrap(el.node.parentNode)) ||
+ Snap.select("svg") ||
+ Snap(0, 0),
+ pdefs = p.select("defs"),
+ defs = pdefs == null ? false : pdefs.node;
+ if (!defs) {
+ defs = make("defs", p.node).node;
+ }
+ return defs;
+}
+function getSomeSVG(el) {
+ return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
+}
+Snap._.getSomeDefs = getSomeDefs;
+Snap._.getSomeSVG = getSomeSVG;
+function unit2px(el, name, value) {
+ var svg = getSomeSVG(el).node,
+ out = {},
+ mgr = svg.querySelector(".svg---mgr");
+ if (!mgr) {
+ mgr = $("rect");
+ $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, "class": "svg---mgr", fill: "none"});
+ svg.appendChild(mgr);
+ }
+ function getW(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {width: val});
+ try {
+ return mgr.getBBox().width;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function getH(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {height: val});
+ try {
+ return mgr.getBBox().height;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function set(nam, f) {
+ if (name == null) {
+ out[nam] = f(el.attr(nam) || 0);
+ } else if (nam == name) {
+ out = f(value == null ? el.attr(nam) || 0 : value);
+ }
+ }
+ switch (el.type) {
+ case "rect":
+ set("rx", getW);
+ set("ry", getH);
+ case "image":
+ set("width", getW);
+ set("height", getH);
+ case "text":
+ set("x", getW);
+ set("y", getH);
+ break;
+ case "circle":
+ set("cx", getW);
+ set("cy", getH);
+ set("r", getW);
+ break;
+ case "ellipse":
+ set("cx", getW);
+ set("cy", getH);
+ set("rx", getW);
+ set("ry", getH);
+ break;
+ case "line":
+ set("x1", getW);
+ set("x2", getW);
+ set("y1", getH);
+ set("y2", getH);
+ break;
+ case "marker":
+ set("refX", getW);
+ set("markerWidth", getW);
+ set("refY", getH);
+ set("markerHeight", getH);
+ break;
+ case "radialGradient":
+ set("fx", getW);
+ set("fy", getH);
+ break;
+ case "tspan":
+ set("dx", getW);
+ set("dy", getH);
+ break;
+ default:
+ set(name, getW);
+ }
+ svg.removeChild(mgr);
+ return out;
+}
+/*\
+ * Snap.select
+ [ method ]
+ **
+ * Wraps a DOM element specified by CSS selector as @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(glob.doc.querySelector(query));
+};
+/*\
+ * Snap.selectAll
+ [ method ]
+ **
+ * Wraps DOM elements specified by CSS selector as set or array of @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.selectAll = function (query) {
+ var nodelist = glob.doc.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+};
+
+function add2group(list) {
+ if (!is(list, "array")) {
+ list = Array.prototype.slice.call(arguments, 0);
+ }
+ var i = 0,
+ j = 0,
+ node = this.node;
+ while (this[i]) delete this[i++];
+ for (i = 0; i < list.length; i++) {
+ if (list[i].type == "set") {
+ list[i].forEach(function (el) {
+ node.appendChild(el.node);
+ });
+ } else {
+ node.appendChild(list[i].node);
+ }
+ }
+ var children = node.childNodes;
+ for (i = 0; i < children.length; i++) {
+ this[j++] = wrap(children[i]);
+ }
+ return this;
+}
+// Hub garbage collector every 10s
+setInterval(function () {
+ for (var key in hub) if (hub[has](key)) {
+ var el = hub[key],
+ node = el.node;
+ if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
+ delete hub[key];
+ }
+ }
+}, 1e4);
+function Element(el) {
+ if (el.snap in hub) {
+ return hub[el.snap];
+ }
+ var svg;
+ try {
+ svg = el.ownerSVGElement;
+ } catch(e) {}
+ /*\
+ * Element.node
+ [ property (object) ]
+ **
+ * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
+ > Usage
+ | // draw a circle at coordinate 10,10 with radius of 10
+ | var c = paper.circle(10, 10, 10);
+ | c.node.onclick = function () {
+ | c.attr("fill", "red");
+ | };
+ \*/
+ this.node = el;
+ if (svg) {
+ this.paper = new Paper(svg);
+ }
+ /*\
+ * Element.type
+ [ property (string) ]
+ **
+ * SVG tag name of the given element.
+ \*/
+ this.type = el.tagName;
+ var id = this.id = ID(this);
+ this.anims = {};
+ this._ = {
+ transform: []
+ };
+ el.snap = id;
+ hub[id] = this;
+ if (this.type == "g") {
+ this.add = add2group;
+ }
+ if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
+ for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
+ this[method] = Paper.prototype[method];
+ }
+ }
+}
+ /*\
+ * Element.attr
+ [ method ]
+ **
+ * Gets or sets given attributes of the element.
+ **
+ - params (object) contains key-value pairs of attributes you want to set
+ * or
+ - param (string) name of the attribute
+ = (Element) the current element
+ * or
+ = (string) value of attribute
+ > Usage
+ | el.attr({
+ | fill: "#fc0",
+ | stroke: "#000",
+ | strokeWidth: 2, // CamelCase...
+ | "fill-opacity": 0.5, // or dash-separated names
+ | width: "*=2" // prefixed values
+ | });
+ | console.log(el.attr("fill")); // #fc0
+ * Prefixed values in format `"+=10"` supported. All four operations
+ * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`
+ * and `-`: `"+=2em"`.
+ \*/
+ Element.prototype.attr = function (params, value) {
+ var el = this,
+ node = el.node;
+ if (!params) {
+ return el;
+ }
+ if (is(params, "string")) {
+ if (arguments.length > 1) {
+ var json = {};
+ json[params] = value;
+ params = json;
+ } else {
+ return eve("snap.util.getattr." + params, el).firstDefined();
+ }
+ }
+ for (var att in params) {
+ if (params[has](att)) {
+ eve("snap.util.attr." + att, el, params[att]);
+ }
+ }
+ return el;
+ };
+/*\
+ * Snap.parse
+ [ method ]
+ **
+ * Parses SVG fragment and converts it into a @Fragment
+ **
+ - svg (string) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.parse = function (svg) {
+ var f = glob.doc.createDocumentFragment(),
+ full = true,
+ div = glob.doc.createElement("div");
+ svg = Str(svg);
+ if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
+ svg = "<svg>" + svg + "</svg>";
+ full = false;
+ }
+ div.innerHTML = svg;
+ svg = div.getElementsByTagName("svg")[0];
+ if (svg) {
+ if (full) {
+ f = svg;
+ } else {
+ while (svg.firstChild) {
+ f.appendChild(svg.firstChild);
+ }
+ div.innerHTML = E;
+ }
+ }
+ return new Fragment(f);
+};
+function Fragment(frag) {
+ this.node = frag;
+}
+// SIERRA Snap.fragment() could especially use a code example
+/*\
+ * Snap.fragment
+ [ method ]
+ **
+ * Creates a DOM fragment from a given list of elements or strings
+ **
+ - varargs (…) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.fragment = function () {
+ var args = Array.prototype.slice.call(arguments, 0),
+ f = glob.doc.createDocumentFragment();
+ for (var i = 0, ii = args.length; i < ii; i++) {
+ var item = args[i];
+ if (item.node && item.node.nodeType) {
+ f.appendChild(item.node);
+ }
+ if (item.nodeType) {
+ f.appendChild(item);
+ }
+ if (typeof item == "string") {
+ f.appendChild(Snap.parse(item).node);
+ }
+ }
+ return new Fragment(f);
+};
+
+function make(name, parent) {
+ var res = $(name);
+ parent.appendChild(res);
+ var el = wrap(res);
+ return el;
+}
+function Paper(w, h) {
+ var res,
+ desc,
+ defs,
+ proto = Paper.prototype;
+ if (w && w.tagName == "svg") {
+ if (w.snap in hub) {
+ return hub[w.snap];
+ }
+ var doc = w.ownerDocument;
+ res = new Element(w);
+ desc = w.getElementsByTagName("desc")[0];
+ defs = w.getElementsByTagName("defs")[0];
+ if (!desc) {
+ desc = $("desc");
+ desc.appendChild(doc.createTextNode("Created with Snap"));
+ res.node.appendChild(desc);
+ }
+ if (!defs) {
+ defs = $("defs");
+ res.node.appendChild(defs);
+ }
+ res.defs = defs;
+ for (var key in proto) if (proto[has](key)) {
+ res[key] = proto[key];
+ }
+ res.paper = res.root = res;
+ } else {
+ res = make("svg", glob.doc.body);
+ $(res.node, {
+ height: h,
+ version: 1.1,
+ width: w,
+ xmlns: xmlns
+ });
+ }
+ return res;
+}
+function wrap(dom) {
+ if (!dom) {
+ return dom;
+ }
+ if (dom instanceof Element || dom instanceof Fragment) {
+ return dom;
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
+ return new Paper(dom);
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
+ return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
+ }
+ return new Element(dom);
+}
+
+Snap._.make = make;
+Snap._.wrap = wrap;
+/*\
+ * Paper.el
+ [ method ]
+ **
+ * Creates an element on paper with a given name and no attributes
+ **
+ - name (string) tag name
+ - attr (object) attributes
+ = (Element) the current element
+ > Usage
+ | var c = paper.circle(10, 10, 10); // is the same as...
+ | var c = paper.el("circle").attr({
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+ | // and the same as
+ | var c = paper.el("circle", {
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+\*/
+Paper.prototype.el = function (name, attr) {
+ var el = make(name, this.node);
+ attr && el.attr(attr);
+ return el;
+};
+// default
+eve.on("snap.util.getattr", function () {
+ var att = eve.nt();
+ att = att.substring(att.lastIndexOf(".") + 1);
+ var css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
+ } else {
+ return $(this.node, att);
+ }
+});
+var cssAttr = {
+ "alignment-baseline": 0,
+ "baseline-shift": 0,
+ "clip": 0,
+ "clip-path": 0,
+ "clip-rule": 0,
+ "color": 0,
+ "color-interpolation": 0,
+ "color-interpolation-filters": 0,
+ "color-profile": 0,
+ "color-rendering": 0,
+ "cursor": 0,
+ "direction": 0,
+ "display": 0,
+ "dominant-baseline": 0,
+ "enable-background": 0,
+ "fill": 0,
+ "fill-opacity": 0,
+ "fill-rule": 0,
+ "filter": 0,
+ "flood-color": 0,
+ "flood-opacity": 0,
+ "font": 0,
+ "font-family": 0,
+ "font-size": 0,
+ "font-size-adjust": 0,
+ "font-stretch": 0,
+ "font-style": 0,
+ "font-variant": 0,
+ "font-weight": 0,
+ "glyph-orientation-horizontal": 0,
+ "glyph-orientation-vertical": 0,
+ "image-rendering": 0,
+ "kerning": 0,
+ "letter-spacing": 0,
+ "lighting-color": 0,
+ "marker": 0,
+ "marker-end": 0,
+ "marker-mid": 0,
+ "marker-start": 0,
+ "mask": 0,
+ "opacity": 0,
+ "overflow": 0,
+ "pointer-events": 0,
+ "shape-rendering": 0,
+ "stop-color": 0,
+ "stop-opacity": 0,
+ "stroke": 0,
+ "stroke-dasharray": 0,
+ "stroke-dashoffset": 0,
+ "stroke-linecap": 0,
+ "stroke-linejoin": 0,
+ "stroke-miterlimit": 0,
+ "stroke-opacity": 0,
+ "stroke-width": 0,
+ "text-anchor": 0,
+ "text-decoration": 0,
+ "text-rendering": 0,
+ "unicode-bidi": 0,
+ "visibility": 0,
+ "word-spacing": 0,
+ "writing-mode": 0
+};
+
+eve.on("snap.util.attr", function (value) {
+ var att = eve.nt(),
+ attr = {};
+ att = att.substring(att.lastIndexOf(".") + 1);
+ attr[att] = value;
+ var style = att.replace(/-(\w)/gi, function (all, letter) {
+ return letter.toUpperCase();
+ }),
+ css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ this.node.style[style] = value == null ? E : value;
+ } else {
+ $(this.node, attr);
+ }
+});
+(function (proto) {}(Paper.prototype));
+
+// simple ajax
+/*\
+ * Snap.ajax
+ [ method ]
+ **
+ * Simple implementation of Ajax
+ **
+ - url (string) URL
+ - postData (object|string) data for post request
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ * or
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ = (XMLHttpRequest) the XMLHttpRequest object, just in case
+\*/
+Snap.ajax = function (url, postData, callback, scope){
+ var req = new XMLHttpRequest,
+ id = ID();
+ if (req) {
+ if (is(postData, "function")) {
+ scope = callback;
+ callback = postData;
+ postData = null;
+ } else if (is(postData, "object")) {
+ var pd = [];
+ for (var key in postData) if (postData.hasOwnProperty(key)) {
+ pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
+ }
+ postData = pd.join("&");
+ }
+ req.open((postData ? "POST" : "GET"), url, true);
+ if (postData) {
+ req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ }
+ if (callback) {
+ eve.once("snap.ajax." + id + ".0", callback);
+ eve.once("snap.ajax." + id + ".200", callback);
+ eve.once("snap.ajax." + id + ".304", callback);
+ }
+ req.onreadystatechange = function() {
+ if (req.readyState != 4) return;
+ eve("snap.ajax." + id + "." + req.status, scope, req);
+ };
+ if (req.readyState == 4) {
+ return req;
+ }
+ req.send(postData);
+ return req;
+ }
+};
+/*\
+ * Snap.load
+ [ method ]
+ **
+ * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
+ **
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+\*/
+Snap.load = function (url, callback, scope) {
+ Snap.ajax(url, function (req) {
+ var f = Snap.parse(req.responseText);
+ scope ? callback.call(scope, f) : callback(f);
+ });
+};
+var getOffset = function (elem) {
+ var box = elem.getBoundingClientRect(),
+ doc = elem.ownerDocument,
+ body = doc.body,
+ docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return {
+ y: top,
+ x: left
+ };
+};
+/*\
+ * Snap.getElementByPoint
+ [ method ]
+ **
+ * Returns you topmost element under given point.
+ **
+ = (object) Snap element object
+ - x (number) x coordinate from the top left corner of the window
+ - y (number) y coordinate from the top left corner of the window
+ > Usage
+ | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
+\*/
+Snap.getElementByPoint = function (x, y) {
+ var paper = this,
+ svg = paper.canvas,
+ target = glob.doc.elementFromPoint(x, y);
+ if (glob.win.opera && target.tagName == "svg") {
+ var so = getOffset(target),
+ sr = target.createSVGRect();
+ sr.x = x - so.x;
+ sr.y = y - so.y;
+ sr.width = sr.height = 1;
+ var hits = target.getIntersectionList(sr, null);
+ if (hits.length) {
+ target = hits[hits.length - 1];
+ }
+ }
+ if (!target) {
+ return null;
+ }
+ return wrap(target);
+};
+/*\
+ * Snap.plugin
+ [ method ]
+ **
+ * Let you write plugins. You pass in a function with four arguments, like this:
+ | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+ | Snap.newmethod = function () {};
+ | Element.prototype.newmethod = function () {};
+ | Paper.prototype.newmethod = function () {};
+ | });
+ * Inside the function you have access to all main objects (and their
+ * prototypes). This allow you to extend anything you want.
+ **
+ - f (function) your plugin body
+\*/
+Snap.plugin = function (f) {
+ f(Snap, Element, Paper, glob, Fragment);
+};
+glob.win.Snap = Snap;
+return Snap;
+}(window || this));
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ Str = String,
+ unit2px = Snap._unit2px,
+ $ = Snap._.$,
+ make = Snap._.make,
+ getSomeDefs = Snap._.getSomeDefs,
+ has = "hasOwnProperty",
+ wrap = Snap._.wrap;
+ /*\
+ * Element.getBBox
+ [ method ]
+ **
+ * Returns the bounding box descriptor for the given element
+ **
+ = (object) bounding box descriptor:
+ o {
+ o cx: (number) x of the center,
+ o cy: (number) x of the center,
+ o h: (number) height,
+ o height: (number) height,
+ o path: (string) path command for the box,
+ o r0: (number) radius of a circle that fully encloses the box,
+ o r1: (number) radius of the smallest circle that can be enclosed,
+ o r2: (number) radius of the largest circle that can be enclosed,
+ o vb: (string) box as a viewbox command,
+ o w: (number) width,
+ o width: (number) width,
+ o x2: (number) x of the right side,
+ o x: (number) x of the left side,
+ o y2: (number) y of the bottom edge,
+ o y: (number) y of the top edge
+ o }
+ \*/
+ elproto.getBBox = function (isWithoutTransform) {
+ if (!Snap.Matrix || !Snap.path) {
+ return this.node.getBBox();
+ }
+ var el = this,
+ m = new Snap.Matrix;
+ if (el.removed) {
+ return Snap._.box();
+ }
+ while (el.type == "use") {
+ if (!isWithoutTransform) {
+ m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
+ }
+ if (el.original) {
+ el = el.original;
+ } else {
+ var href = el.attr("xlink:href");
+ el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
+ }
+ }
+ var _ = el._,
+ pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
+ try {
+ if (isWithoutTransform) {
+ _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
+ return Snap._.box(_.bboxwt);
+ } else {
+ el.realPath = pathfinder(el);
+ el.matrix = el.transform().localMatrix;
+ _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
+ return Snap._.box(_.bbox);
+ }
+ } catch (e) {
+ // Firefox doesn’t give you bbox of hidden element
+ return Snap._.box();
+ }
+ };
+ var propString = function () {
+ return this.string;
+ };
+ function extractTransform(el, tstr) {
+ if (tstr == null) {
+ var doReturn = true;
+ if (el.type == "linearGradient" || el.type == "radialGradient") {
+ tstr = el.node.getAttribute("gradientTransform");
+ } else if (el.type == "pattern") {
+ tstr = el.node.getAttribute("patternTransform");
+ } else {
+ tstr = el.node.getAttribute("transform");
+ }
+ if (!tstr) {
+ return new Snap.Matrix;
+ }
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ if (!Snap._.rgTransform.test(tstr)) {
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
+ }
+ if (is(tstr, "array")) {
+ tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
+ }
+ el._.transform = tstr;
+ }
+ var m = Snap._.transform2matrix(tstr, el.getBBox(1));
+ if (doReturn) {
+ return m;
+ } else {
+ el.matrix = m;
+ }
+ }
+ /*\
+ * Element.transform
+ [ method ]
+ **
+ * Gets or sets transformation of the element
+ **
+ - tstr (string) transform string in Snap or SVG format
+ = (Element) the current element
+ * or
+ = (object) transformation descriptor:
+ o {
+ o string (string) transform string,
+ o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,
+ o localMatrix (Matrix) matrix of transformations applied only to the element,
+ o diffMatrix (Matrix) matrix of difference between global and local transformations,
+ o global (string) global transformation as string,
+ o local (string) local transformation as string,
+ o toString (function) returns `string` property
+ o }
+ \*/
+ elproto.transform = function (tstr) {
+ var _ = this._;
+ if (tstr == null) {
+ var papa = this,
+ global = new Snap.Matrix(this.node.getCTM()),
+ local = extractTransform(this),
+ ms = [local],
+ m = new Snap.Matrix,
+ i,
+ localString = local.toTransformString(),
+ string = Str(local) == Str(this.matrix) ?
+ Str(_.transform) : localString;
+ while (papa.type != "svg" && (papa = papa.parent())) {
+ ms.push(extractTransform(papa));
+ }
+ i = ms.length;
+ while (i--) {
+ m.add(ms[i]);
+ }
+ return {
+ string: string,
+ globalMatrix: global,
+ totalMatrix: m,
+ localMatrix: local,
+ diffMatrix: global.clone().add(local.invert()),
+ global: global.toTransformString(),
+ total: m.toTransformString(),
+ local: localString,
+ toString: propString
+ };
+ }
+ if (tstr instanceof Snap.Matrix) {
+ this.matrix = tstr;
+ this._.transform = tstr.toTransformString();
+ } else {
+ extractTransform(this, tstr);
+ }
+
+ if (this.node) {
+ if (this.type == "linearGradient" || this.type == "radialGradient") {
+ $(this.node, {gradientTransform: this.matrix});
+ } else if (this.type == "pattern") {
+ $(this.node, {patternTransform: this.matrix});
+ } else {
+ $(this.node, {transform: this.matrix});
+ }
+ }
+
+ return this;
+ };
+ /*\
+ * Element.parent
+ [ method ]
+ **
+ * Returns the element's parent
+ **
+ = (Element) the parent element
+ \*/
+ elproto.parent = function () {
+ return wrap(this.node.parentNode);
+ };
+ /*\
+ * Element.append
+ [ method ]
+ **
+ * Appends the given element to current one
+ **
+ - el (Element|Set) element to append
+ = (Element) the parent element
+ \*/
+ /*\
+ * Element.add
+ [ method ]
+ **
+ * See @Element.append
+ \*/
+ elproto.append = elproto.add = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ it.add(el);
+ });
+ return this;
+ }
+ el = wrap(el);
+ this.node.appendChild(el.node);
+ el.paper = this.paper;
+ }
+ return this;
+ };
+ /*\
+ * Element.appendTo
+ [ method ]
+ **
+ * Appends the current element to the given one
+ **
+ - el (Element) parent element to append to
+ = (Element) the child element
+ \*/
+ elproto.appendTo = function (el) {
+ if (el) {
+ el = wrap(el);
+ el.append(this);
+ }
+ return this;
+ };
+ /*\
+ * Element.prepend
+ [ method ]
+ **
+ * Prepends the given element to the current one
+ **
+ - el (Element) element to prepend
+ = (Element) the parent element
+ \*/
+ elproto.prepend = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this,
+ first;
+ el.forEach(function (el) {
+ if (first) {
+ first.after(el);
+ } else {
+ it.prepend(el);
+ }
+ first = el;
+ });
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.insertBefore(el.node, this.node.firstChild);
+ this.add && this.add();
+ el.paper = this.paper;
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ }
+ return this;
+ };
+ /*\
+ * Element.prependTo
+ [ method ]
+ **
+ * Prepends the current element to the given one
+ **
+ - el (Element) parent element to prepend to
+ = (Element) the child element
+ \*/
+ elproto.prependTo = function (el) {
+ el = wrap(el);
+ el.prepend(this);
+ return this;
+ };
+ /*\
+ * Element.before
+ [ method ]
+ **
+ * Inserts given element before the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.before = function (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ var parent = el.parent();
+ it.node.parentNode.insertBefore(el.node, it.node);
+ parent && parent.add();
+ });
+ this.parent().add();
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.parentNode.insertBefore(el.node, this.node);
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.after
+ [ method ]
+ **
+ * Inserts given element after the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.after = function (el) {
+ el = wrap(el);
+ var parent = el.parent();
+ if (this.node.nextSibling) {
+ this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
+ } else {
+ this.node.parentNode.appendChild(el.node);
+ }
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.insertBefore
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertBefore = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.insertAfter
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertAfter = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.remove
+ [ method ]
+ **
+ * Removes element from the DOM
+ = (Element) the detached element
+ \*/
+ elproto.remove = function () {
+ var parent = this.parent();
+ this.node.parentNode && this.node.parentNode.removeChild(this.node);
+ delete this.paper;
+ this.removed = true;
+ parent && parent.add();
+ return this;
+ };
+ /*\
+ * Element.select
+ [ method ]
+ **
+ * Gathers the nested @Element matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Element) result of query selection
+ \*/
+ elproto.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(this.node.querySelector(query));
+ };
+ /*\
+ * Element.selectAll
+ [ method ]
+ **
+ * Gathers nested @Element objects matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Set|array) result of query selection
+ \*/
+ elproto.selectAll = function (query) {
+ var nodelist = this.node.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+ };
+ /*\
+ * Element.asPX
+ [ method ]
+ **
+ * Returns given attribute of the element as a `px` value (not %, em, etc.)
+ **
+ - attr (string) attribute name
+ - value (string) #optional attribute value
+ = (Element) result of query selection
+ \*/
+ elproto.asPX = function (attr, value) {
+ if (value == null) {
+ value = this.attr(attr);
+ }
+ return +unit2px(this, attr, value);
+ };
+ // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
+ /*\
+ * Element.use
+ [ method ]
+ **
+ * Creates a `<use>` element linked to the current element
+ **
+ = (Element) the `<use>` element
+ \*/
+ elproto.use = function () {
+ var use,
+ id = this.node.id;
+ if (!id) {
+ id = this.id;
+ $(this.node, {
+ id: id
+ });
+ }
+ if (this.type == "linearGradient" || this.type == "radialGradient" ||
+ this.type == "pattern") {
+ use = make(this.type, this.node.parentNode);
+ } else {
+ use = make("use", this.node.parentNode);
+ }
+ $(use.node, {
+ "xlink:href": "#" + id
+ });
+ use.original = this;
+ return use;
+ };
+ function fixids(el) {
+ var els = el.selectAll("*"),
+ it,
+ url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
+ ids = [],
+ uses = {};
+ function urltest(it, name) {
+ var val = $(it.node, name);
+ val = val && val.match(url);
+ val = val && val[2];
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ var attr = {};
+ attr[name] = URL(id);
+ $(it.node, attr);
+ });
+ }
+ }
+ function linktest(it) {
+ var val = $(it.node, "xlink:href");
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ it.attr("xlink:href", "#" + id);
+ });
+ }
+ }
+ for (var i = 0, ii = els.length; i < ii; i++) {
+ it = els[i];
+ urltest(it, "fill");
+ urltest(it, "stroke");
+ urltest(it, "filter");
+ urltest(it, "mask");
+ urltest(it, "clip-path");
+ linktest(it);
+ var oldid = $(it.node, "id");
+ if (oldid) {
+ $(it.node, {id: it.id});
+ ids.push({
+ old: oldid,
+ id: it.id
+ });
+ }
+ }
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ var fs = uses[ids[i].old];
+ if (fs) {
+ for (var j = 0, jj = fs.length; j < jj; j++) {
+ fs[j](ids[i].id);
+ }
+ }
+ }
+ }
+ /*\
+ * Element.clone
+ [ method ]
+ **
+ * Creates a clone of the element and inserts it after the element
+ **
+ = (Element) the clone
+ \*/
+ elproto.clone = function () {
+ var clone = wrap(this.node.cloneNode(true));
+ if ($(clone.node, "id")) {
+ $(clone.node, {id: clone.id});
+ }
+ fixids(clone);
+ clone.insertAfter(this);
+ return clone;
+ };
+ /*\
+ * Element.toDefs
+ [ method ]
+ **
+ * Moves element to the shared `<defs>` area
+ **
+ = (Element) the element
+ \*/
+ elproto.toDefs = function () {
+ var defs = getSomeDefs(this);
+ defs.appendChild(this.node);
+ return this;
+ };
+ /*\
+ * Element.toPattern
+ [ method ]
+ **
+ * Creates a `<pattern>` element from the current element
+ **
+ * To create a pattern you have to specify the pattern rect:
+ - x (string|number)
+ - y (string|number)
+ - width (string|number)
+ - height (string|number)
+ = (Element) the `<pattern>` element
+ * You can use pattern later on as an argument for `fill` attribute:
+ | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+ | fill: "none",
+ | stroke: "#bada55",
+ | strokeWidth: 5
+ | }).pattern(0, 0, 10, 10),
+ | c = paper.circle(200, 200, 100);
+ | c.attr({
+ | fill: p
+ | });
+ \*/
+ elproto.pattern = elproto.toPattern = function (x, y, width, height) {
+ var p = make("pattern", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ $(p.node, {
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ patternUnits: "userSpaceOnUse",
+ id: p.id,
+ viewBox: [x, y, width, height].join(" ")
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
+// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
+ /*\
+ * Element.marker
+ [ method ]
+ **
+ * Creates a `<marker>` element from the current element
+ **
+ * To create a marker you have to specify the bounding rect and reference point:
+ - x (number)
+ - y (number)
+ - width (number)
+ - height (number)
+ - refX (number)
+ - refY (number)
+ = (Element) the `<marker>` element
+ * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
+ \*/
+ // TODO add usage for markers
+ elproto.marker = function (x, y, width, height, refX, refY) {
+ var p = make("marker", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ refX = x.refX || x.cx;
+ refY = x.refY || x.cy;
+ x = x.x;
+ }
+ $(p.node, {
+ viewBox: [x, y, width, height].join(" "),
+ markerWidth: width,
+ markerHeight: height,
+ orient: "auto",
+ refX: refX || 0,
+ refY: refY || 0,
+ id: p.id
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+ // animation
+ function slice(from, to, f) {
+ return function (arr) {
+ var res = arr.slice(from, to);
+ if (res.length == 1) {
+ res = res[0];
+ }
+ return f ? f(res) : res;
+ };
+ }
+ var Animation = function (attr, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ this.attr = attr;
+ this.dur = ms;
+ easing && (this.easing = easing);
+ callback && (this.callback = callback);
+ };
+ Snap._.Animation = Animation;
+ /*\
+ * Snap.animation
+ [ method ]
+ **
+ * Creates an animation object
+ **
+ - attr (object) attributes of final destination
+ - duration (number) duration of the animation, in milliseconds
+ - easing (function) #optional one of easing functions of @mina or custom one
+ - callback (function) #optional callback function that fires when animation ends
+ = (object) animation object
+ \*/
+ Snap.animation = function (attr, ms, easing, callback) {
+ return new Animation(attr, ms, easing, callback);
+ };
+ /*\
+ * Element.inAnim
+ [ method ]
+ **
+ * Returns a set of animations that may be able to manipulate the current element
+ **
+ = (object) in format:
+ o {
+ o anim (object) animation object,
+ o mina (object) @mina object,
+ o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ \*/
+ elproto.inAnim = function () {
+ var el = this,
+ res = [];
+ for (var id in el.anims) if (el.anims[has](id)) {
+ (function (a) {
+ res.push({
+ anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
+ mina: a,
+ curStatus: a.status(),
+ status: function (val) {
+ return a.status(val);
+ },
+ stop: function () {
+ a.stop();
+ }
+ });
+ }(el.anims[id]));
+ }
+ return res;
+ };
+ /*\
+ * Snap.animate
+ [ method ]
+ **
+ * Runs generic animation of one number into another with a caring function
+ **
+ - from (number|array) number or array of numbers
+ - to (number|array) number or array of numbers
+ - setter (function) caring function that accepts one number argument
+ - duration (number) duration, in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function to execute when animation ends
+ = (object) animation object in @mina format
+ o {
+ o id (string) animation id, consider it read-only,
+ o duration (function) gets or sets the duration of the animation,
+ o easing (function) easing,
+ o speed (function) gets or sets the speed of the animation,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ | var rect = Snap().rect(0, 0, 10, 10);
+ | Snap.animate(0, 10, function (val) {
+ | rect.attr({
+ | x: val
+ | });
+ | }, 1000);
+ | // in given context is equivalent to
+ | rect.animate({x: 10}, 1000);
+ \*/
+ Snap.animate = function (from, to, setter, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ var now = mina.time(),
+ anim = mina(from, to, now, now + ms, mina.time, setter, easing);
+ callback && eve.once("mina.finish." + anim.id, callback);
+ return anim;
+ };
+ /*\
+ * Element.stop
+ [ method ]
+ **
+ * Stops all the animations for the current element
+ **
+ = (Element) the current element
+ \*/
+ elproto.stop = function () {
+ var anims = this.inAnim();
+ for (var i = 0, ii = anims.length; i < ii; i++) {
+ anims[i].stop();
+ }
+ return this;
+ };
+ /*\
+ * Element.animate
+ [ method ]
+ **
+ * Animates the given attributes of the element
+ **
+ - attrs (object) key-value pairs of destination attributes
+ - duration (number) duration of the animation in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function that executes when the animation ends
+ = (Element) the current element
+ \*/
+ elproto.animate = function (attrs, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ if (attrs instanceof Animation) {
+ callback = attrs.callback;
+ easing = attrs.easing;
+ ms = easing.dur;
+ attrs = attrs.attr;
+ }
+ var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,
+ el = this;
+ for (var key in attrs) if (attrs[has](key)) {
+ if (el.equal) {
+ eq = el.equal(key, Str(attrs[key]));
+ from = eq.from;
+ to = eq.to;
+ f = eq.f;
+ } else {
+ from = +el.attr(key);
+ to = +attrs[key];
+ }
+ var len = is(from, "array") ? from.length : 1;
+ keys[key] = slice(fkeys.length, fkeys.length + len, f);
+ fkeys = fkeys.concat(from);
+ tkeys = tkeys.concat(to);
+ }
+ var now = mina.time(),
+ anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {
+ var attr = {};
+ for (var key in keys) if (keys[has](key)) {
+ attr[key] = keys[key](val);
+ }
+ el.attr(attr);
+ }, easing);
+ el.anims[anim.id] = anim;
+ anim._attrs = attrs;
+ anim._callback = callback;
+ eve("snap.animcreated." + el.id, anim);
+ eve.once("mina.finish." + anim.id, function () {
+ delete el.anims[anim.id];
+ callback && callback.call(el);
+ });
+ eve.once("mina.stop." + anim.id, function () {
+ delete el.anims[anim.id];
+ });
+ return el;
+ };
+ var eldata = {};
+ /*\
+ * Element.data
+ [ method ]
+ **
+ * Adds or retrieves given value associated with given key. (Don’t confuse
+ * with `data-` attributes)
+ *
+ * See also @Element.removeData
+ - key (string) key to store data
+ - value (any) #optional value to store
+ = (object) @Element
+ * or, if value is not specified:
+ = (any) value
+ > Usage
+ | for (var i = 0, i < 5, i++) {
+ | paper.circle(10 + 15 * i, 10, 10)
+ | .attr({fill: "#000"})
+ | .data("i", i)
+ | .click(function () {
+ | alert(this.data("i"));
+ | });
+ | }
+ \*/
+ elproto.data = function (key, value) {
+ var data = eldata[this.id] = eldata[this.id] || {};
+ if (arguments.length == 0){
+ eve("snap.data.get." + this.id, this, data, null);
+ return data;
+ }
+ if (arguments.length == 1) {
+ if (Snap.is(key, "object")) {
+ for (var i in key) if (key[has](i)) {
+ this.data(i, key[i]);
+ }
+ return this;
+ }
+ eve("snap.data.get." + this.id, this, data[key], key);
+ return data[key];
+ }
+ data[key] = value;
+ eve("snap.data.set." + this.id, this, value, key);
+ return this;
+ };
+ /*\
+ * Element.removeData
+ [ method ]
+ **
+ * Removes value associated with an element by given key.
+ * If key is not provided, removes all the data of the element.
+ - key (string) #optional key
+ = (object) @Element
+ \*/
+ elproto.removeData = function (key) {
+ if (key == null) {
+ eldata[this.id] = {};
+ } else {
+ eldata[this.id] && delete eldata[this.id][key];
+ }
+ return this;
+ };
+ /*\
+ * Element.outerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element, equivalent to HTML's `outerHTML`.
+ *
+ * See also @Element.innerSVG
+ = (string) SVG code for the element
+ \*/
+ /*\
+ * Element.toString
+ [ method ]
+ **
+ * See @Element.outerSVG
+ \*/
+ elproto.outerSVG = elproto.toString = toString(1);
+ /*\
+ * Element.innerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`
+ = (string) SVG code for the element
+ \*/
+ elproto.innerSVG = toString();
+ function toString(type) {
+ return function () {
+ var res = type ? "<" + this.type : "",
+ attr = this.node.attributes,
+ chld = this.node.childNodes;
+ if (type) {
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ res += " " + attr[i].name + '="' +
+ attr[i].value.replace(/"/g, '\\"') + '"';
+ }
+ }
+ if (chld.length) {
+ type && (res += ">");
+ for (i = 0, ii = chld.length; i < ii; i++) {
+ if (chld[i].nodeType == 3) {
+ res += chld[i].nodeValue;
+ } else if (chld[i].nodeType == 1) {
+ res += wrap(chld[i]).toString();
+ }
+ }
+ type && (res += "</" + this.type + ">");
+ } else {
+ type && (res += "/>");
+ }
+ return res;
+ };
+ }
+ elproto.toDataURL = function () {
+ if (window && window.btoa) {
+ var bb = this.getBBox(),
+ svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
+ x: +bb.x.toFixed(3),
+ y: +bb.y.toFixed(3),
+ width: +bb.width.toFixed(3),
+ height: +bb.height.toFixed(3),
+ contents: this.outerSVG()
+ });
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
+ }
+ };
+ /*\
+ * Fragment.select
+ [ method ]
+ **
+ * See @Element.select
+ \*/
+ Fragment.prototype.select = elproto.select;
+ /*\
+ * Fragment.selectAll
+ [ method ]
+ **
+ * See @Element.selectAll
+ \*/
+ Fragment.prototype.selectAll = elproto.selectAll;
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var objectToString = Object.prototype.toString,
+ Str = String,
+ math = Math,
+ E = "";
+ function Matrix(a, b, c, d, e, f) {
+ if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
+ this.a = a.a;
+ this.b = a.b;
+ this.c = a.c;
+ this.d = a.d;
+ this.e = a.e;
+ this.f = a.f;
+ return;
+ }
+ if (a != null) {
+ this.a = +a;
+ this.b = +b;
+ this.c = +c;
+ this.d = +d;
+ this.e = +e;
+ this.f = +f;
+ } else {
+ this.a = 1;
+ this.b = 0;
+ this.c = 0;
+ this.d = 1;
+ this.e = 0;
+ this.f = 0;
+ }
+ }
+ (function (matrixproto) {
+ /*\
+ * Matrix.add
+ [ method ]
+ **
+ * Adds the given matrix to existing one
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - matrix (object) @Matrix
+ \*/
+ matrixproto.add = function (a, b, c, d, e, f) {
+ var out = [[], [], []],
+ m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
+ matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
+ x, y, z, res;
+
+ if (a && a instanceof Matrix) {
+ matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
+ }
+
+ for (x = 0; x < 3; x++) {
+ for (y = 0; y < 3; y++) {
+ res = 0;
+ for (z = 0; z < 3; z++) {
+ res += m[x][z] * matrix[z][y];
+ }
+ out[x][y] = res;
+ }
+ }
+ this.a = out[0][0];
+ this.b = out[1][0];
+ this.c = out[0][1];
+ this.d = out[1][1];
+ this.e = out[0][2];
+ this.f = out[1][2];
+ return this;
+ };
+ /*\
+ * Matrix.invert
+ [ method ]
+ **
+ * Returns an inverted version of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.invert = function () {
+ var me = this,
+ x = me.a * me.d - me.b * me.c;
+ return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
+ };
+ /*\
+ * Matrix.clone
+ [ method ]
+ **
+ * Returns a copy of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.clone = function () {
+ return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
+ };
+ /*\
+ * Matrix.translate
+ [ method ]
+ **
+ * Translate the matrix
+ - x (number) horizontal offset distance
+ - y (number) vertical offset distance
+ \*/
+ matrixproto.translate = function (x, y) {
+ return this.add(1, 0, 0, 1, x, y);
+ };
+ /*\
+ * Matrix.scale
+ [ method ]
+ **
+ * Scales the matrix
+ - x (number) amount to be scaled, with `1` resulting in no change
+ - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)
+ - cx (number) #optional horizontal origin point from which to scale
+ - cy (number) #optional vertical origin point from which to scale
+ * Default cx, cy is the middle point of the element.
+ \*/
+ matrixproto.scale = function (x, y, cx, cy) {
+ y == null && (y = x);
+ (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
+ this.add(x, 0, 0, y, 0, 0);
+ (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
+ return this;
+ };
+ /*\
+ * Matrix.rotate
+ [ method ]
+ **
+ * Rotates the matrix
+ - a (number) angle of rotation, in degrees
+ - x (number) horizontal origin point from which to rotate
+ - y (number) vertical origin point from which to rotate
+ \*/
+ matrixproto.rotate = function (a, x, y) {
+ a = Snap.rad(a);
+ x = x || 0;
+ y = y || 0;
+ var cos = +math.cos(a).toFixed(9),
+ sin = +math.sin(a).toFixed(9);
+ this.add(cos, sin, -sin, cos, x, y);
+ return this.add(1, 0, 0, 1, -x, -y);
+ };
+ /*\
+ * Matrix.x
+ [ method ]
+ **
+ * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y
+ - x (number)
+ - y (number)
+ = (number) x
+ \*/
+ matrixproto.x = function (x, y) {
+ return x * this.a + y * this.c + this.e;
+ };
+ /*\
+ * Matrix.y
+ [ method ]
+ **
+ * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x
+ - x (number)
+ - y (number)
+ = (number) y
+ \*/
+ matrixproto.y = function (x, y) {
+ return x * this.b + y * this.d + this.f;
+ };
+ matrixproto.get = function (i) {
+ return +this[Str.fromCharCode(97 + i)].toFixed(4);
+ };
+ matrixproto.toString = function () {
+ return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
+ };
+ matrixproto.offset = function () {
+ return [this.e.toFixed(4), this.f.toFixed(4)];
+ };
+ function norm(a) {
+ return a[0] * a[0] + a[1] * a[1];
+ }
+ function normalize(a) {
+ var mag = math.sqrt(norm(a));
+ a[0] && (a[0] /= mag);
+ a[1] && (a[1] /= mag);
+ }
+ /*\
+ * Matrix.determinant
+ [ method ]
+ **
+ * Finds determinant of the given matrix.
+ = (number) determinant
+ \*/
+ matrixproto.determinant = function () {
+ return this.a * this.d - this.b * this.c;
+ };
+ /*\
+ * Matrix.split
+ [ method ]
+ **
+ * Splits matrix into primitive transformations
+ = (object) in format:
+ o dx (number) translation by x
+ o dy (number) translation by y
+ o scalex (number) scale by x
+ o scaley (number) scale by y
+ o shear (number) shear
+ o rotate (number) rotation in deg
+ o isSimple (boolean) could it be represented via simple transformations
+ \*/
+ matrixproto.split = function () {
+ var out = {};
+ // translation
+ out.dx = this.e;
+ out.dy = this.f;
+
+ // scale and shear
+ var row = [[this.a, this.c], [this.b, this.d]];
+ out.scalex = math.sqrt(norm(row[0]));
+ normalize(row[0]);
+
+ out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
+ row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
+
+ out.scaley = math.sqrt(norm(row[1]));
+ normalize(row[1]);
+ out.shear /= out.scaley;
+
+ if (this.determinant() < 0) {
+ out.scalex = -out.scalex;
+ }
+
+ // rotation
+ var sin = -row[0][1],
+ cos = row[1][1];
+ if (cos < 0) {
+ out.rotate = Snap.deg(math.acos(cos));
+ if (sin < 0) {
+ out.rotate = 360 - out.rotate;
+ }
+ } else {
+ out.rotate = Snap.deg(math.asin(sin));
+ }
+
+ out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
+ out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
+ out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
+ return out;
+ };
+ /*\
+ * Matrix.toTransformString
+ [ method ]
+ **
+ * Returns transform string that represents given matrix
+ = (string) transform string
+ \*/
+ matrixproto.toTransformString = function (shorter) {
+ var s = shorter || this.split();
+ if (!+s.shear.toFixed(9)) {
+ s.scalex = +s.scalex.toFixed(4);
+ s.scaley = +s.scaley.toFixed(4);
+ s.rotate = +s.rotate.toFixed(4);
+ return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
+ (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
+ (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
+ } else {
+ return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
+ }
+ };
+ })(Matrix.prototype);
+ /*\
+ * Snap.Matrix
+ [ method ]
+ **
+ * Matrix constructor, extend on your own risk.
+ * To create matrices use @Snap.matrix.
+ \*/
+ Snap.Matrix = Matrix;
+ /*\
+ * Snap.matrix
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns a matrix based on the given parameters
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - svgMatrix (SVGMatrix)
+ = (object) @Matrix
+ \*/
+ Snap.matrix = function (a, b, c, d, e, f) {
+ return new Matrix(a, b, c, d, e, f);
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var has = "hasOwnProperty",
+ make = Snap._.make,
+ wrap = Snap._.wrap,
+ is = Snap.is,
+ getSomeDefs = Snap._.getSomeDefs,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ $ = Snap._.$,
+ URL = Snap.url,
+ Str = String,
+ separator = Snap._.separator,
+ E = "";
+ // Attributes event handlers
+ eve.on("snap.util.attr.mask", function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value.type == "mask") {
+ var mask = value;
+ } else {
+ mask = make("mask", getSomeDefs(this));
+ mask.node.appendChild(value.node);
+ }
+ !mask.node.id && $(mask.node, {
+ id: mask.id
+ });
+ $(this.node, {
+ mask: URL(mask.id)
+ });
+ }
+ });
+ (function (clipIt) {
+ eve.on("snap.util.attr.clip", clipIt);
+ eve.on("snap.util.attr.clip-path", clipIt);
+ eve.on("snap.util.attr.clipPath", clipIt);
+ }(function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value.type == "clipPath") {
+ var clip = value;
+ } else {
+ clip = make("clipPath", getSomeDefs(this));
+ clip.node.appendChild(value.node);
+ !clip.node.id && $(clip.node, {
+ id: clip.id
+ });
+ }
+ $(this.node, {
+ "clip-path": URL(clip.node.id || clip.id)
+ });
+ }
+ }));
+ function fillStroke(name) {
+ return function (value) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1 &&
+ (value.node.firstChild.tagName == "radialGradient" ||
+ value.node.firstChild.tagName == "linearGradient" ||
+ value.node.firstChild.tagName == "pattern")) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value instanceof Element) {
+ if (value.type == "radialGradient" || value.type == "linearGradient"
+ || value.type == "pattern") {
+ if (!value.node.id) {
+ $(value.node, {
+ id: value.id
+ });
+ }
+ var fill = URL(value.node.id);
+ } else {
+ fill = value.attr(name);
+ }
+ } else {
+ fill = Snap.color(value);
+ if (fill.error) {
+ var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
+ if (grad) {
+ if (!grad.node.id) {
+ $(grad.node, {
+ id: grad.id
+ });
+ }
+ fill = URL(grad.node.id);
+ } else {
+ fill = value;
+ }
+ } else {
+ fill = Str(fill);
+ }
+ }
+ var attrs = {};
+ attrs[name] = fill;
+ $(this.node, attrs);
+ this.node.style[name] = E;
+ };
+ }
+ eve.on("snap.util.attr.fill", fillStroke("fill"));
+ eve.on("snap.util.attr.stroke", fillStroke("stroke"));
+ var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
+ eve.on("snap.util.grad.parse", function parseGrad(string) {
+ string = Str(string);
+ var tokens = string.match(gradrg);
+ if (!tokens) {
+ return null;
+ }
+ var type = tokens[1],
+ params = tokens[2],
+ stops = tokens[3];
+ params = params.split(/\s*,\s*/).map(function (el) {
+ return +el == el ? +el : el;
+ });
+ if (params.length == 1 && params[0] == 0) {
+ params = [];
+ }
+ stops = stops.split("-");
+ stops = stops.map(function (el) {
+ el = el.split(":");
+ var out = {
+ color: el[0]
+ };
+ if (el[1]) {
+ out.offset = parseFloat(el[1]);
+ }
+ return out;
+ });
+ return {
+ type: type,
+ params: params,
+ stops: stops
+ };
+ });
+
+ eve.on("snap.util.attr.d", function (value) {
+ eve.stop();
+ if (is(value, "array") && is(value[0], "array")) {
+ value = Snap.path.toString.call(value);
+ }
+ value = Str(value);
+ if (value.match(/[ruo]/i)) {
+ value = Snap.path.toAbsolute(value);
+ }
+ $(this.node, {d: value});
+ })(-1);
+ eve.on("snap.util.attr.#text", function (value) {
+ eve.stop();
+ value = Str(value);
+ var txt = glob.doc.createTextNode(value);
+ while (this.node.firstChild) {
+ this.node.removeChild(this.node.firstChild);
+ }
+ this.node.appendChild(txt);
+ })(-1);
+ eve.on("snap.util.attr.path", function (value) {
+ eve.stop();
+ this.attr({d: value});
+ })(-1);
+ eve.on("snap.util.attr.class", function (value) {
+ eve.stop();
+ this.node.className.baseVal = value;
+ })(-1);
+ eve.on("snap.util.attr.viewBox", function (value) {
+ var vb;
+ if (is(value, "object") && "x" in value) {
+ vb = [value.x, value.y, value.width, value.height].join(" ");
+ } else if (is(value, "array")) {
+ vb = value.join(" ");
+ } else {
+ vb = value;
+ }
+ $(this.node, {
+ viewBox: vb
+ });
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.transform", function (value) {
+ this.transform(value);
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.r", function (value) {
+ if (this.type == "rect") {
+ eve.stop();
+ $(this.node, {
+ rx: value,
+ ry: value
+ });
+ }
+ })(-1);
+ eve.on("snap.util.attr.textpath", function (value) {
+ eve.stop();
+ if (this.type == "text") {
+ var id, tp, node;
+ if (!value && this.textPath) {
+ tp = this.textPath;
+ while (tp.node.firstChild) {
+ this.node.appendChild(tp.node.firstChild);
+ }
+ tp.remove();
+ delete this.textPath;
+ return;
+ }
+ if (is(value, "string")) {
+ var defs = getSomeDefs(this),
+ path = wrap(defs.parentNode).path(value);
+ defs.appendChild(path.node);
+ id = path.id;
+ path.attr({id: id});
+ } else {
+ value = wrap(value);
+ if (value instanceof Element) {
+ id = value.attr("id");
+ if (!id) {
+ id = value.id;
+ value.attr({id: id});
+ }
+ }
+ }
+ if (id) {
+ tp = this.textPath;
+ node = this.node;
+ if (tp) {
+ tp.attr({"xlink:href": "#" + id});
+ } else {
+ tp = $("textPath", {
+ "xlink:href": "#" + id
+ });
+ while (node.firstChild) {
+ tp.appendChild(node.firstChild);
+ }
+ node.appendChild(tp);
+ this.textPath = wrap(tp);
+ }
+ }
+ }
+ })(-1);
+ eve.on("snap.util.attr.text", function (value) {
+ if (this.type == "text") {
+ var i = 0,
+ node = this.node,
+ tuner = function (chunk) {
+ var out = $("tspan");
+ if (is(chunk, "array")) {
+ for (var i = 0; i < chunk.length; i++) {
+ out.appendChild(tuner(chunk[i]));
+ }
+ } else {
+ out.appendChild(glob.doc.createTextNode(chunk));
+ }
+ out.normalize && out.normalize();
+ return out;
+ };
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ var tuned = tuner(value);
+ while (tuned.firstChild) {
+ node.appendChild(tuned.firstChild);
+ }
+ }
+ eve.stop();
+ })(-1);
+ function setFontSize(value) {
+ eve.stop();
+ if (value == +value) {
+ value += "px";
+ }
+ this.node.style.fontSize = value;
+ }
+ eve.on("snap.util.attr.fontSize", setFontSize)(-1);
+ eve.on("snap.util.attr.font-size", setFontSize)(-1);
+
+
+ eve.on("snap.util.getattr.transform", function () {
+ eve.stop();
+ return this.transform();
+ })(-1);
+ eve.on("snap.util.getattr.textpath", function () {
+ eve.stop();
+ return this.textPath;
+ })(-1);
+ // Markers
+ (function () {
+ function getter(end) {
+ return function () {
+ eve.stop();
+ var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
+ if (style == "none") {
+ return style;
+ } else {
+ return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
+ }
+ };
+ }
+ function setter(end) {
+ return function (value) {
+ eve.stop();
+ var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
+ if (value == "" || !value) {
+ this.node.style[name] = "none";
+ return;
+ }
+ if (value.type == "marker") {
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ }
+ this.node.style[name] = URL(id);
+ return;
+ }
+ };
+ }
+ eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
+ eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
+ eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
+ eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
+ eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
+ eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
+ eve.on("snap.util.attr.marker-end", setter("end"))(-1);
+ eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
+ eve.on("snap.util.attr.marker-start", setter("start"))(-1);
+ eve.on("snap.util.attr.markerStart", setter("start"))(-1);
+ eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
+ eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
+ }());
+ eve.on("snap.util.getattr.r", function () {
+ if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
+ eve.stop();
+ return $(this.node, "rx");
+ }
+ })(-1);
+ function textExtract(node) {
+ var out = [];
+ var children = node.childNodes;
+ for (var i = 0, ii = children.length; i < ii; i++) {
+ var chi = children[i];
+ if (chi.nodeType == 3) {
+ out.push(chi.nodeValue);
+ }
+ if (chi.tagName == "tspan") {
+ if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
+ out.push(chi.firstChild.nodeValue);
+ } else {
+ out.push(textExtract(chi));
+ }
+ }
+ }
+ return out;
+ }
+ eve.on("snap.util.getattr.text", function () {
+ if (this.type == "text" || this.type == "tspan") {
+ eve.stop();
+ var out = textExtract(this.node);
+ return out.length == 1 ? out[0] : out;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.#text", function () {
+ return this.node.textContent;
+ })(-1);
+ eve.on("snap.util.getattr.viewBox", function () {
+ eve.stop();
+ var vb = $(this.node, "viewBox");
+ if (vb) {
+ vb = vb.split(separator);
+ return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.points", function () {
+ var p = $(this.node, "points");
+ eve.stop();
+ if (p) {
+ return p.split(separator);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.path", function () {
+ var p = $(this.node, "d");
+ eve.stop();
+ return p;
+ })(-1);
+ eve.on("snap.util.getattr.class", function () {
+ return this.node.className.baseVal;
+ })(-1);
+ function getFontSize() {
+ eve.stop();
+ return this.node.style.fontSize;
+ }
+ eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
+ eve.on("snap.util.getattr.font-size", getFontSize)(-1);
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var proto = Paper.prototype,
+ is = Snap.is;
+ /*\
+ * Paper.rect
+ [ method ]
+ *
+ * Draws a rectangle
+ **
+ - x (number) x coordinate of the top left corner
+ - y (number) y coordinate of the top left corner
+ - width (number) width
+ - height (number) height
+ - rx (number) #optional horizontal radius for rounded corners, default is 0
+ - ry (number) #optional vertical radius for rounded corners, default is rx or 0
+ = (object) the `rect` element
+ **
+ > Usage
+ | // regular rectangle
+ | var c = paper.rect(10, 10, 50, 50);
+ | // rectangle with rounded corners
+ | var c = paper.rect(40, 40, 50, 50, 10);
+ \*/
+ proto.rect = function (x, y, w, h, rx, ry) {
+ var attr;
+ if (ry == null) {
+ ry = rx;
+ }
+ if (is(x, "object") && x == "[object Object]") {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ width: w,
+ height: h
+ };
+ if (rx != null) {
+ attr.rx = rx;
+ attr.ry = ry;
+ }
+ }
+ return this.el("rect", attr);
+ };
+ /*\
+ * Paper.circle
+ [ method ]
+ **
+ * Draws a circle
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - r (number) radius
+ = (object) the `circle` element
+ **
+ > Usage
+ | var c = paper.circle(50, 50, 40);
+ \*/
+ proto.circle = function (cx, cy, r) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr = {
+ cx: cx,
+ cy: cy,
+ r: r
+ };
+ }
+ return this.el("circle", attr);
+ };
+
+ var preload = (function () {
+ function onerror() {
+ this.parentNode.removeChild(this);
+ }
+ return function (src, f) {
+ var img = glob.doc.createElement("img"),
+ body = glob.doc.body;
+ img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
+ img.onload = function () {
+ f.call(img);
+ img.onload = img.onerror = null;
+ body.removeChild(img);
+ };
+ img.onerror = onerror;
+ body.appendChild(img);
+ img.src = src;
+ };
+ }());
+
+ /*\
+ * Paper.image
+ [ method ]
+ **
+ * Places an image on the surface
+ **
+ - src (string) URI of the source image
+ - x (number) x offset position
+ - y (number) y offset position
+ - width (number) width of the image
+ - height (number) height of the image
+ = (object) the `image` element
+ * or
+ = (object) Snap element object with type `image`
+ **
+ > Usage
+ | var c = paper.image("apple.png", 10, 10, 80, 80);
+ \*/
+ proto.image = function (src, x, y, width, height) {
+ var el = this.el("image");
+ if (is(src, "object") && "src" in src) {
+ el.attr(src);
+ } else if (src != null) {
+ var set = {
+ "xlink:href": src,
+ preserveAspectRatio: "none"
+ };
+ if (x != null && y != null) {
+ set.x = x;
+ set.y = y;
+ }
+ if (width != null && height != null) {
+ set.width = width;
+ set.height = height;
+ } else {
+ preload(src, function () {
+ Snap._.$(el.node, {
+ width: this.offsetWidth,
+ height: this.offsetHeight
+ });
+ });
+ }
+ Snap._.$(el.node, set);
+ }
+ return el;
+ };
+ /*\
+ * Paper.ellipse
+ [ method ]
+ **
+ * Draws an ellipse
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - rx (number) horizontal radius
+ - ry (number) vertical radius
+ = (object) the `ellipse` element
+ **
+ > Usage
+ | var c = paper.ellipse(50, 50, 40, 20);
+ \*/
+ proto.ellipse = function (cx, cy, rx, ry) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr ={
+ cx: cx,
+ cy: cy,
+ rx: rx,
+ ry: ry
+ };
+ }
+ return this.el("ellipse", attr);
+ };
+ // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
+ /*\
+ * Paper.path
+ [ method ]
+ **
+ * Creates a `<path>` element using the given string as the path's definition
+ - pathString (string) #optional path string in SVG format
+ * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
+ | "M10,20L30,40"
+ * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
+ *
+ # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
+ # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
+ # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
+ # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
+ # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
+ # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
+ # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
+ # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
+ # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
+ # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
+ # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
+ # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
+ # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
+ * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
+ * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.
+ > Usage
+ | var c = paper.path("M10 10L90 90");
+ | // draw a diagonal line:
+ | // move to 10,10, line to 90,90
+ \*/
+ proto.path = function (d) {
+ var attr;
+ if (is(d, "object") && !is(d, "array")) {
+ attr = d;
+ } else if (d) {
+ attr = {d: d};
+ }
+ return this.el("path", attr);
+ };
+ /*\
+ * Paper.g
+ [ method ]
+ **
+ * Creates a group element
+ **
+ - varargs (…) #optional elements to nest within the group
+ = (object) the `g` element
+ **
+ > Usage
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g(c2, c1); // note that the order of elements is different
+ * or
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g();
+ | g.add(c2, c1);
+ \*/
+ /*\
+ * Paper.group
+ [ method ]
+ **
+ * See @Paper.g
+ \*/
+ proto.group = proto.g = function (first) {
+ var attr,
+ el = this.el("g");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.svg
+ [ method ]
+ **
+ * Creates a nested SVG element.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `svg` element
+ **
+ \*/
+ proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {
+ var attrs = {};
+ if (is(x, "object") && y == null) {
+ attrs = x;
+ } else {
+ if (x != null) {
+ attrs.x = x;
+ }
+ if (y != null) {
+ attrs.y = y;
+ }
+ if (width != null) {
+ attrs.width = width;
+ }
+ if (height != null) {
+ attrs.height = height;
+ }
+ if (vbx != null && vby != null && vbw != null && vbh != null) {
+ attrs.viewBox = [vbx, vby, vbw, vbh];
+ }
+ }
+ return this.el("svg", attrs);
+ };
+ /*\
+ * Paper.mask
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a mask.
+ **
+ = (object) the `mask` element
+ **
+ \*/
+ proto.mask = function (first) {
+ var attr,
+ el = this.el("mask");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.ptrn
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a pattern.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `pattern` element
+ **
+ \*/
+ proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
+ if (is(x, "object")) {
+ var attr = x;
+ } else {
+ attr = {patternUnits: "userSpaceOnUse"};
+ if (x) {
+ attr.x = x;
+ }
+ if (y) {
+ attr.y = y;
+ }
+ if (width != null) {
+ attr.width = width;
+ }
+ if (height != null) {
+ attr.height = height;
+ }
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+ }
+ return this.el("pattern", attr);
+ };
+ /*\
+ * Paper.use
+ [ method ]
+ **
+ * Creates a <use> element.
+ - id (string) @optional id of element to link
+ * or
+ - id (Element) @optional element to link
+ **
+ = (object) the `use` element
+ **
+ \*/
+ proto.use = function (id) {
+ if (id != null) {
+ if (id instanceof Element) {
+ if (!id.attr("id")) {
+ id.attr({id: Snap._.id(id)});
+ }
+ id = id.attr("id");
+ }
+ if (String(id).charAt() == "#") {
+ id = id.substring(1);
+ }
+ return this.el("use", {"xlink:href": "#" + id});
+ } else {
+ return Element.prototype.use.call(this);
+ }
+ };
+ /*\
+ * Paper.symbol
+ [ method ]
+ **
+ * Creates a <symbol> element.
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ = (object) the `symbol` element
+ **
+ \*/
+ proto.symbol = function (vx, vy, vw, vh) {
+ var attr = {};
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+
+ return this.el("symbol", attr);
+ };
+ /*\
+ * Paper.text
+ [ method ]
+ **
+ * Draws a text string
+ **
+ - x (number) x coordinate position
+ - y (number) y coordinate position
+ - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements
+ = (object) the `text` element
+ **
+ > Usage
+ | var t1 = paper.text(50, 50, "Snap");
+ | var t2 = paper.text(50, 50, ["S","n","a","p"]);
+ | // Text path usage
+ | t1.attr({textpath: "M10,10L100,100"});
+ | // or
+ | var pth = paper.path("M10,10L100,100");
+ | t1.attr({textpath: pth});
+ \*/
+ proto.text = function (x, y, text) {
+ var attr = {};
+ if (is(x, "object")) {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ text: text || ""
+ };
+ }
+ return this.el("text", attr);
+ };
+ /*\
+ * Paper.line
+ [ method ]
+ **
+ * Draws a line
+ **
+ - x1 (number) x coordinate position of the start
+ - y1 (number) y coordinate position of the start
+ - x2 (number) x coordinate position of the end
+ - y2 (number) y coordinate position of the end
+ = (object) the `line` element
+ **
+ > Usage
+ | var t1 = paper.line(50, 50, 100, 100);
+ \*/
+ proto.line = function (x1, y1, x2, y2) {
+ var attr = {};
+ if (is(x1, "object")) {
+ attr = x1;
+ } else if (x1 != null) {
+ attr = {
+ x1: x1,
+ x2: x2,
+ y1: y1,
+ y2: y2
+ };
+ }
+ return this.el("line", attr);
+ };
+ /*\
+ * Paper.polyline
+ [ method ]
+ **
+ * Draws a polyline
+ **
+ - points (array) array of points
+ * or
+ - varargs (…) points
+ = (object) the `polyline` element
+ **
+ > Usage
+ | var p1 = paper.polyline([10, 10, 100, 100]);
+ | var p2 = paper.polyline(10, 10, 100, 100);
+ \*/
+ proto.polyline = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polyline", attr);
+ };
+ /*\
+ * Paper.polygon
+ [ method ]
+ **
+ * Draws a polygon. See @Paper.polyline
+ \*/
+ proto.polygon = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polygon", attr);
+ };
+ // gradients
+ (function () {
+ var $ = Snap._.$;
+ // gradients' helpers
+ function Gstops() {
+ return this.selectAll("stop");
+ }
+ function GaddStop(color, offset) {
+ var stop = $("stop"),
+ attr = {
+ offset: +offset + "%"
+ };
+ color = Snap.color(color);
+ attr["stop-color"] = color.hex;
+ if (color.opacity < 1) {
+ attr["stop-opacity"] = color.opacity;
+ }
+ $(stop, attr);
+ this.node.appendChild(stop);
+ return this;
+ }
+ function GgetBBox() {
+ if (this.type == "linearGradient") {
+ var x1 = $(this.node, "x1") || 0,
+ x2 = $(this.node, "x2") || 1,
+ y1 = $(this.node, "y1") || 0,
+ y2 = $(this.node, "y2") || 0;
+ return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
+ } else {
+ var cx = this.node.cx || .5,
+ cy = this.node.cy || .5,
+ r = this.node.r || 0;
+ return Snap._.box(cx - r, cy - r, r * 2, r * 2);
+ }
+ }
+ function gradient(defs, str) {
+ var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
+ el;
+ if (!grad) {
+ return null;
+ }
+ grad.params.unshift(defs);
+ if (grad.type.toLowerCase() == "l") {
+ el = gradientLinear.apply(0, grad.params);
+ } else {
+ el = gradientRadial.apply(0, grad.params);
+ }
+ if (grad.type != grad.type.toLowerCase()) {
+ $(el.node, {
+ gradientUnits: "userSpaceOnUse"
+ });
+ }
+ var stops = grad.stops,
+ len = stops.length,
+ start = 0,
+ j = 0;
+ function seed(i, end) {
+ var step = (end - start) / (i - j);
+ for (var k = j; k < i; k++) {
+ stops[k].offset = +(+start + step * (k - j)).toFixed(2);
+ }
+ j = i;
+ start = end;
+ }
+ len--;
+ for (var i = 0; i < len; i++) if ("offset" in stops[i]) {
+ seed(i, stops[i].offset);
+ }
+ stops[len].offset = stops[len].offset || 100;
+ seed(len, stops[len].offset);
+ for (i = 0; i <= len; i++) {
+ var stop = stops[i];
+ el.addStop(stop.color, stop.offset);
+ }
+ return el;
+ }
+ function gradientLinear(defs, x1, y1, x2, y2) {
+ var el = Snap._.make("linearGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (x1 != null) {
+ $(el.node, {
+ x1: x1,
+ y1: y1,
+ x2: x2,
+ y2: y2
+ });
+ }
+ return el;
+ }
+ function gradientRadial(defs, cx, cy, r, fx, fy) {
+ var el = Snap._.make("radialGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (cx != null) {
+ $(el.node, {
+ cx: cx,
+ cy: cy,
+ r: r
+ });
+ }
+ if (fx != null && fy != null) {
+ $(el.node, {
+ fx: fx,
+ fy: fy
+ });
+ }
+ return el;
+ }
+ /*\
+ * Paper.gradient
+ [ method ]
+ **
+ * Creates a gradient element
+ **
+ - gradient (string) gradient descriptor
+ > Gradient Descriptor
+ * The gradient descriptor is an expression formatted as
+ * follows: `<type>(<coords>)<colors>`. The `<type>` can be
+ * either linear or radial. The uppercase `L` or `R` letters
+ * indicate absolute coordinates offset from the SVG surface.
+ * Lowercase `l` or `r` letters indicate coordinates
+ * calculated relative to the element to which the gradient is
+ * applied. Coordinates specify a linear gradient vector as
+ * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
+ * `r` and optional `fx`, `fy` specifying a focal point away
+ * from the center of the circle. Specify `<colors>` as a list
+ * of dash-separated CSS color values. Each color may be
+ * followed by a custom offset value, separated with a colon
+ * character.
+ > Examples
+ * Linear gradient, relative from top-left corner to bottom-right
+ * corner, from black through red to white:
+ | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
+ * Linear gradient, absolute from (0, 0) to (100, 100), from black
+ * through red at 25% to white:
+ | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
+ * Radial gradient, relative from the center of the element with radius
+ * half the width, from black to white:
+ | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
+ * To apply the gradient:
+ | paper.circle(50, 50, 40).attr({
+ | fill: g
+ | });
+ = (object) the `gradient` element
+ \*/
+ proto.gradient = function (str) {
+ return gradient(this.defs, str);
+ };
+ proto.gradientLinear = function (x1, y1, x2, y2) {
+ return gradientLinear(this.defs, x1, y1, x2, y2);
+ };
+ proto.gradientRadial = function (cx, cy, r, fx, fy) {
+ return gradientRadial(this.defs, cx, cy, r, fx, fy);
+ };
+ /*\
+ * Paper.toString
+ [ method ]
+ **
+ * Returns SVG code for the @Paper
+ = (string) SVG code for the @Paper
+ \*/
+ proto.toString = function () {
+ var doc = this.node.ownerDocument,
+ f = doc.createDocumentFragment(),
+ d = doc.createElement("div"),
+ svg = this.node.cloneNode(true),
+ res;
+ f.appendChild(d);
+ d.appendChild(svg);
+ Snap._.$(svg, {xmlns: "http://www.w3.org/2000/svg"});
+ res = d.innerHTML;
+ f.removeChild(f.firstChild);
+ return res;
+ };
+ /*\
+ * Paper.toDataURL
+ [ method ]
+ **
+ * Returns SVG code for the @Paper as Data URI string.
+ = (string) Data URI string
+ \*/
+ proto.toDataURL = function () {
+ if (window && window.btoa) {
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
+ }
+ };
+ /*\
+ * Paper.clear
+ [ method ]
+ **
+ * Removes all child nodes of the paper, except <defs>.
+ \*/
+ proto.clear = function () {
+ var node = this.node.firstChild,
+ next;
+ while (node) {
+ next = node.nextSibling;
+ if (node.tagName != "defs") {
+ node.parentNode.removeChild(node);
+ } else {
+ proto.clear.call({node: node});
+ }
+ node = next;
+ }
+ };
+ }());
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ clone = Snap._.clone,
+ has = "hasOwnProperty",
+ p2s = /,?([a-z]),?/gi,
+ toFloat = parseFloat,
+ math = Math,
+ PI = math.PI,
+ mmin = math.min,
+ mmax = math.max,
+ pow = math.pow,
+ abs = math.abs;
+ function paths(ps) {
+ var p = paths.ps = paths.ps || {};
+ if (p[ps]) {
+ p[ps].sleep = 100;
+ } else {
+ p[ps] = {
+ sleep: 100
+ };
+ }
+ setTimeout(function () {
+ for (var key in p) if (p[has](key) && key != ps) {
+ p[key].sleep--;
+ !p[key].sleep && delete p[key];
+ }
+ });
+ return p[ps];
+ }
+ function box(x, y, width, height) {
+ if (x == null) {
+ x = y = width = height = 0;
+ }
+ if (y == null) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ return {
+ x: x,
+ y: y,
+ width: width,
+ w: width,
+ height: height,
+ h: height,
+ x2: x + width,
+ y2: y + height,
+ cx: x + width / 2,
+ cy: y + height / 2,
+ r1: math.min(width, height) / 2,
+ r2: math.max(width, height) / 2,
+ r0: math.sqrt(width * width + height * height) / 2,
+ path: rectPath(x, y, width, height),
+ vb: [x, y, width, height].join(" ")
+ };
+ }
+ function toString() {
+ return this.join(",").replace(p2s, "$1");
+ }
+ function pathClone(pathArray) {
+ var res = clone(pathArray);
+ res.toString = toString;
+ return res;
+ }
+ function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
+ if (length == null) {
+ return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
+ } else {
+ return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
+ getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
+ }
+ }
+ function getLengthFactory(istotal, subpath) {
+ function O(val) {
+ return +(+val).toFixed(3);
+ }
+ return Snap._.cacher(function (path, length, onlystart) {
+ if (path instanceof Element) {
+ path = path.attr("d");
+ }
+ path = path2curve(path);
+ var x, y, p, l, sp = "", subpaths = {}, point,
+ len = 0;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = +p[1];
+ y = +p[2];
+ } else {
+ l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ if (len + l > length) {
+ if (subpath && !subpaths.start) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ sp += [
+ "C" + O(point.start.x),
+ O(point.start.y),
+ O(point.m.x),
+ O(point.m.y),
+ O(point.x),
+ O(point.y)
+ ];
+ if (onlystart) {return sp;}
+ subpaths.start = sp;
+ sp = [
+ "M" + O(point.x),
+ O(point.y) + "C" + O(point.n.x),
+ O(point.n.y),
+ O(point.end.x),
+ O(point.end.y),
+ O(p[5]),
+ O(p[6])
+ ].join();
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ continue;
+ }
+ if (!istotal && !subpath) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ return point;
+ }
+ }
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ }
+ sp += p.shift() + p;
+ }
+ subpaths.end = sp;
+ point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
+ return point;
+ }, null, Snap._.clone);
+ }
+ var getTotalLength = getLengthFactory(1),
+ getPointAtLength = getLengthFactory(),
+ getSubpathsAtLength = getLengthFactory(0, 1);
+ function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t,
+ t13 = pow(t1, 3),
+ t12 = pow(t1, 2),
+ t2 = t * t,
+ t3 = t2 * t,
+ x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
+ y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
+ mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
+ my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
+ nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
+ ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
+ ax = t1 * p1x + t * c1x,
+ ay = t1 * p1y + t * c1y,
+ cx = t1 * c2x + t * p2x,
+ cy = t1 * c2y + t * p2y,
+ alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
+ // (mx > nx || my < ny) && (alpha += 180);
+ return {
+ x: x,
+ y: y,
+ m: {x: mx, y: my},
+ n: {x: nx, y: ny},
+ start: {x: ax, y: ay},
+ end: {x: cx, y: cy},
+ alpha: alpha
+ };
+ }
+ function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
+ if (!Snap.is(p1x, "array")) {
+ p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
+ }
+ var bbox = curveDim.apply(null, p1x);
+ return box(
+ bbox.min.x,
+ bbox.min.y,
+ bbox.max.x - bbox.min.x,
+ bbox.max.y - bbox.min.y
+ );
+ }
+ function isPointInsideBBox(bbox, x, y) {
+ return x >= bbox.x &&
+ x <= bbox.x + bbox.width &&
+ y >= bbox.y &&
+ y <= bbox.y + bbox.height;
+ }
+ function isBBoxIntersect(bbox1, bbox2) {
+ bbox1 = box(bbox1);
+ bbox2 = box(bbox2);
+ return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)
+ || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
+ || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
+ && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y
+ || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
+ }
+ function base3(t, p1, p2, p3, p4) {
+ var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
+ t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
+ return t * t2 - 3 * p1 + 3 * p2;
+ }
+ function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
+ if (z == null) {
+ z = 1;
+ }
+ z = z > 1 ? 1 : z < 0 ? 0 : z;
+ var z2 = z / 2,
+ n = 12,
+ Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
+ Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],
+ sum = 0;
+ for (var i = 0; i < n; i++) {
+ var ct = z2 * Tvalues[i] + z2,
+ xbase = base3(ct, x1, x2, x3, x4),
+ ybase = base3(ct, y1, y2, y3, y4),
+ comb = xbase * xbase + ybase * ybase;
+ sum += Cvalues[i] * math.sqrt(comb);
+ }
+ return z2 * sum;
+ }
+ function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
+ if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
+ return;
+ }
+ var t = 1,
+ step = t / 2,
+ t2 = t - step,
+ l,
+ e = .01;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ while (abs(l - ll) > e) {
+ step /= 2;
+ t2 += (l < ll ? 1 : -1) * step;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ }
+ return t2;
+ }
+ function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
+ if (
+ mmax(x1, x2) < mmin(x3, x4) ||
+ mmin(x1, x2) > mmax(x3, x4) ||
+ mmax(y1, y2) < mmin(y3, y4) ||
+ mmin(y1, y2) > mmax(y3, y4)
+ ) {
+ return;
+ }
+ var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
+ ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
+ denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
+
+ if (!denominator) {
+ return;
+ }
+ var px = nx / denominator,
+ py = ny / denominator,
+ px2 = +px.toFixed(2),
+ py2 = +py.toFixed(2);
+ if (
+ px2 < +mmin(x1, x2).toFixed(2) ||
+ px2 > +mmax(x1, x2).toFixed(2) ||
+ px2 < +mmin(x3, x4).toFixed(2) ||
+ px2 > +mmax(x3, x4).toFixed(2) ||
+ py2 < +mmin(y1, y2).toFixed(2) ||
+ py2 > +mmax(y1, y2).toFixed(2) ||
+ py2 < +mmin(y3, y4).toFixed(2) ||
+ py2 > +mmax(y3, y4).toFixed(2)
+ ) {
+ return;
+ }
+ return {x: px, y: py};
+ }
+ function inter(bez1, bez2) {
+ return interHelper(bez1, bez2);
+ }
+ function interCount(bez1, bez2) {
+ return interHelper(bez1, bez2, 1);
+ }
+ function interHelper(bez1, bez2, justCount) {
+ var bbox1 = bezierBBox(bez1),
+ bbox2 = bezierBBox(bez2);
+ if (!isBBoxIntersect(bbox1, bbox2)) {
+ return justCount ? 0 : [];
+ }
+ var l1 = bezlen.apply(0, bez1),
+ l2 = bezlen.apply(0, bez2),
+ n1 = ~~(l1 / 8),
+ n2 = ~~(l2 / 8),
+ dots1 = [],
+ dots2 = [],
+ xy = {},
+ res = justCount ? 0 : [];
+ for (var i = 0; i < n1 + 1; i++) {
+ var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
+ dots1.push({x: p.x, y: p.y, t: i / n1});
+ }
+ for (i = 0; i < n2 + 1; i++) {
+ p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
+ dots2.push({x: p.x, y: p.y, t: i / n2});
+ }
+ for (i = 0; i < n1; i++) {
+ for (var j = 0; j < n2; j++) {
+ var di = dots1[i],
+ di1 = dots1[i + 1],
+ dj = dots2[j],
+ dj1 = dots2[j + 1],
+ ci = abs(di1.x - di.x) < .001 ? "y" : "x",
+ cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
+ is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
+ if (is) {
+ if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
+ continue;
+ }
+ xy[is.x.toFixed(4)] = is.y.toFixed(4);
+ var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
+ t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
+ if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
+ if (justCount) {
+ res++;
+ } else {
+ res.push({
+ x: is.x,
+ y: is.y,
+ t1: t1,
+ t2: t2
+ });
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function pathIntersection(path1, path2) {
+ return interPathHelper(path1, path2);
+ }
+ function pathIntersectionNumber(path1, path2) {
+ return interPathHelper(path1, path2, 1);
+ }
+ function interPathHelper(path1, path2, justCount) {
+ path1 = path2curve(path1);
+ path2 = path2curve(path2);
+ var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
+ res = justCount ? 0 : [];
+ for (var i = 0, ii = path1.length; i < ii; i++) {
+ var pi = path1[i];
+ if (pi[0] == "M") {
+ x1 = x1m = pi[1];
+ y1 = y1m = pi[2];
+ } else {
+ if (pi[0] == "C") {
+ bez1 = [x1, y1].concat(pi.slice(1));
+ x1 = bez1[6];
+ y1 = bez1[7];
+ } else {
+ bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
+ x1 = x1m;
+ y1 = y1m;
+ }
+ for (var j = 0, jj = path2.length; j < jj; j++) {
+ var pj = path2[j];
+ if (pj[0] == "M") {
+ x2 = x2m = pj[1];
+ y2 = y2m = pj[2];
+ } else {
+ if (pj[0] == "C") {
+ bez2 = [x2, y2].concat(pj.slice(1));
+ x2 = bez2[6];
+ y2 = bez2[7];
+ } else {
+ bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
+ x2 = x2m;
+ y2 = y2m;
+ }
+ var intr = interHelper(bez1, bez2, justCount);
+ if (justCount) {
+ res += intr;
+ } else {
+ for (var k = 0, kk = intr.length; k < kk; k++) {
+ intr[k].segment1 = i;
+ intr[k].segment2 = j;
+ intr[k].bez1 = bez1;
+ intr[k].bez2 = bez2;
+ }
+ res = res.concat(intr);
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function isPointInsidePath(path, x, y) {
+ var bbox = pathBBox(path);
+ return isPointInsideBBox(bbox, x, y) &&
+ interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1;
+ }
+ function pathBBox(path) {
+ var pth = paths(path);
+ if (pth.bbox) {
+ return clone(pth.bbox);
+ }
+ if (!path) {
+ return box();
+ }
+ path = path2curve(path);
+ var x = 0,
+ y = 0,
+ X = [],
+ Y = [],
+ p;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = p[1];
+ y = p[2];
+ X.push(x);
+ Y.push(y);
+ } else {
+ var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ X = X.concat(dim.min.x, dim.max.x);
+ Y = Y.concat(dim.min.y, dim.max.y);
+ x = p[5];
+ y = p[6];
+ }
+ }
+ var xmin = mmin.apply(0, X),
+ ymin = mmin.apply(0, Y),
+ xmax = mmax.apply(0, X),
+ ymax = mmax.apply(0, Y),
+ bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
+ pth.bbox = clone(bb);
+ return bb;
+ }
+ function rectPath(x, y, w, h, r) {
+ if (r) {
+ return [
+ ["M", +x + (+r), y],
+ ["l", w - r * 2, 0],
+ ["a", r, r, 0, 0, 1, r, r],
+ ["l", 0, h - r * 2],
+ ["a", r, r, 0, 0, 1, -r, r],
+ ["l", r * 2 - w, 0],
+ ["a", r, r, 0, 0, 1, -r, -r],
+ ["l", 0, r * 2 - h],
+ ["a", r, r, 0, 0, 1, r, -r],
+ ["z"]
+ ];
+ }
+ var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
+ res.toString = toString;
+ return res;
+ }
+ function ellipsePath(x, y, rx, ry, a) {
+ if (a == null && ry == null) {
+ ry = rx;
+ }
+ x = +x;
+ y = +y;
+ rx = +rx;
+ ry = +ry;
+ if (a != null) {
+ var rad = Math.PI / 180,
+ x1 = x + rx * Math.cos(-ry * rad),
+ x2 = x + rx * Math.cos(-a * rad),
+ y1 = y + rx * Math.sin(-ry * rad),
+ y2 = y + rx * Math.sin(-a * rad),
+ res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
+ } else {
+ res = [
+ ["M", x, y],
+ ["m", 0, -ry],
+ ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
+ ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
+ ["z"]
+ ];
+ }
+ res.toString = toString;
+ return res;
+ }
+ var unit2px = Snap._unit2px,
+ getPath = {
+ path: function (el) {
+ return el.attr("path");
+ },
+ circle: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx, attr.cy, attr.r);
+ },
+ ellipse: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
+ },
+ rect: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
+ },
+ image: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
+ },
+ line: function (el) {
+ return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
+ },
+ polyline: function (el) {
+ return "M" + el.attr("points");
+ },
+ polygon: function (el) {
+ return "M" + el.attr("points") + "z";
+ },
+ deflt: function (el) {
+ var bbox = el.node.getBBox();
+ return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
+ }
+ };
+ function pathToRelative(pathArray) {
+ var pth = paths(pathArray),
+ lowerCase = String.prototype.toLowerCase;
+ if (pth.rel) {
+ return pathClone(pth.rel);
+ }
+ if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = pathArray[0][1];
+ y = pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res.push(["M", x, y]);
+ }
+ for (var i = start, ii = pathArray.length; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != lowerCase.call(pa[0])) {
+ r[0] = lowerCase.call(pa[0]);
+ switch (r[0]) {
+ case "a":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] - x).toFixed(3);
+ r[7] = +(pa[7] - y).toFixed(3);
+ break;
+ case "v":
+ r[1] = +(pa[1] - y).toFixed(3);
+ break;
+ case "m":
+ mx = pa[1];
+ my = pa[2];
+ default:
+ for (var j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
+ }
+ }
+ } else {
+ r = res[i] = [];
+ if (pa[0] == "m") {
+ mx = pa[1] + x;
+ my = pa[2] + y;
+ }
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ var len = res[i].length;
+ switch (res[i][0]) {
+ case "z":
+ x = mx;
+ y = my;
+ break;
+ case "h":
+ x += +res[i][len - 1];
+ break;
+ case "v":
+ y += +res[i][len - 1];
+ break;
+ default:
+ x += +res[i][len - 2];
+ y += +res[i][len - 1];
+ }
+ }
+ res.toString = toString;
+ pth.rel = pathClone(res);
+ return res;
+ }
+ function pathToAbsolute(pathArray) {
+ var pth = paths(pathArray);
+ if (pth.abs) {
+ return pathClone(pth.abs);
+ }
+ if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough assumption
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ if (!pathArray || !pathArray.length) {
+ return [["M", 0, 0]];
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0,
+ pa0;
+ if (pathArray[0][0] == "M") {
+ x = +pathArray[0][1];
+ y = +pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[0] = ["M", x, y];
+ }
+ var crz = pathArray.length == 3 &&
+ pathArray[0][0] == "M" &&
+ pathArray[1][0].toUpperCase() == "R" &&
+ pathArray[2][0].toUpperCase() == "Z";
+ for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
+ res.push(r = []);
+ pa = pathArray[i];
+ pa0 = pa[0];
+ if (pa0 != pa0.toUpperCase()) {
+ r[0] = pa0.toUpperCase();
+ switch (r[0]) {
+ case "A":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +pa[6] + x;
+ r[7] = +pa[7] + y;
+ break;
+ case "V":
+ r[1] = +pa[1] + y;
+ break;
+ case "H":
+ r[1] = +pa[1] + x;
+ break;
+ case "R":
+ var dots = [x, y].concat(pa.slice(1));
+ for (var j = 2, jj = dots.length; j < jj; j++) {
+ dots[j] = +dots[j] + x;
+ dots[++j] = +dots[j] + y;
+ }
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ break;
+ case "O":
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ break;
+ case "U":
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ break;
+ case "M":
+ mx = +pa[1] + x;
+ my = +pa[2] + y;
+ default:
+ for (j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +pa[j] + ((j % 2) ? x : y);
+ }
+ }
+ } else if (pa0 == "R") {
+ dots = [x, y].concat(pa.slice(1));
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ r = ["R"].concat(pa.slice(-2));
+ } else if (pa0 == "O") {
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ } else if (pa0 == "U") {
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ } else {
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ r[k] = pa[k];
+ }
+ }
+ pa0 = pa0.toUpperCase();
+ if (pa0 != "O") {
+ switch (r[0]) {
+ case "Z":
+ x = +mx;
+ y = +my;
+ break;
+ case "H":
+ x = r[1];
+ break;
+ case "V":
+ y = r[1];
+ break;
+ case "M":
+ mx = r[r.length - 2];
+ my = r[r.length - 1];
+ default:
+ x = r[r.length - 2];
+ y = r[r.length - 1];
+ }
+ }
+ }
+ res.toString = toString;
+ pth.abs = pathClone(res);
+ return res;
+ }
+ function l2c(x1, y1, x2, y2) {
+ return [x1, y1, x2, y2, x2, y2];
+ }
+ function q2c(x1, y1, ax, ay, x2, y2) {
+ var _13 = 1 / 3,
+ _23 = 2 / 3;
+ return [
+ _13 * x1 + _23 * ax,
+ _13 * y1 + _23 * ay,
+ _13 * x2 + _23 * ax,
+ _13 * y2 + _23 * ay,
+ x2,
+ y2
+ ];
+ }
+ function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ var _120 = PI * 120 / 180,
+ rad = PI / 180 * (+angle || 0),
+ res = [],
+ xy,
+ rotate = Snap._.cacher(function (x, y, rad) {
+ var X = x * math.cos(rad) - y * math.sin(rad),
+ Y = x * math.sin(rad) + y * math.cos(rad);
+ return {x: X, y: Y};
+ });
+ if (!recursive) {
+ xy = rotate(x1, y1, -rad);
+ x1 = xy.x;
+ y1 = xy.y;
+ xy = rotate(x2, y2, -rad);
+ x2 = xy.x;
+ y2 = xy.y;
+ var cos = math.cos(PI / 180 * angle),
+ sin = math.sin(PI / 180 * angle),
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2;
+ var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
+ if (h > 1) {
+ h = math.sqrt(h);
+ rx = h * rx;
+ ry = h * ry;
+ }
+ var rx2 = rx * rx,
+ ry2 = ry * ry,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
+ f2 = math.asin(((y2 - cy) / ry).toFixed(9));
+
+ f1 = x1 < cx ? PI - f1 : f1;
+ f2 = x2 < cx ? PI - f2 : f2;
+ f1 < 0 && (f1 = PI * 2 + f1);
+ f2 < 0 && (f2 = PI * 2 + f2);
+ if (sweep_flag && f1 > f2) {
+ f1 = f1 - PI * 2;
+ }
+ if (!sweep_flag && f2 > f1) {
+ f2 = f2 - PI * 2;
+ }
+ } else {
+ f1 = recursive[0];
+ f2 = recursive[1];
+ cx = recursive[2];
+ cy = recursive[3];
+ }
+ var df = f2 - f1;
+ if (abs(df) > _120) {
+ var f2old = f2,
+ x2old = x2,
+ y2old = y2;
+ f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
+ x2 = cx + rx * math.cos(f2);
+ y2 = cy + ry * math.sin(f2);
+ res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
+ }
+ df = f2 - f1;
+ var c1 = math.cos(f1),
+ s1 = math.sin(f1),
+ c2 = math.cos(f2),
+ s2 = math.sin(f2),
+ t = math.tan(df / 4),
+ hx = 4 / 3 * rx * t,
+ hy = 4 / 3 * ry * t,
+ m1 = [x1, y1],
+ m2 = [x1 + hx * s1, y1 - hy * c1],
+ m3 = [x2 + hx * s2, y2 - hy * c2],
+ m4 = [x2, y2];
+ m2[0] = 2 * m1[0] - m2[0];
+ m2[1] = 2 * m1[1] - m2[1];
+ if (recursive) {
+ return [m2, m3, m4].concat(res);
+ } else {
+ res = [m2, m3, m4].concat(res).join().split(",");
+ var newres = [];
+ for (var i = 0, ii = res.length; i < ii; i++) {
+ newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
+ }
+ return newres;
+ }
+ }
+ function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t;
+ return {
+ x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
+ };
+ }
+
+ // Returns bounding box of cubic bezier curve.
+ // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
+ // Original version: NISHIO Hirokazu
+ // Modifications: https://github.com/timo22345
+ function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var tvalues = [],
+ bounds = [[], []],
+ a, b, c, t, t1, t2, b2ac, sqrtb2ac;
+ for (var i = 0; i < 2; ++i) {
+ if (i == 0) {
+ b = 6 * x0 - 12 * x1 + 6 * x2;
+ a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
+ c = 3 * x1 - 3 * x0;
+ } else {
+ b = 6 * y0 - 12 * y1 + 6 * y2;
+ a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
+ c = 3 * y1 - 3 * y0;
+ }
+ if (abs(a) < 1e-12) {
+ if (abs(b) < 1e-12) {
+ continue;
+ }
+ t = -c / b;
+ if (0 < t && t < 1) {
+ tvalues.push(t);
+ }
+ continue;
+ }
+ b2ac = b * b - 4 * c * a;
+ sqrtb2ac = math.sqrt(b2ac);
+ if (b2ac < 0) {
+ continue;
+ }
+ t1 = (-b + sqrtb2ac) / (2 * a);
+ if (0 < t1 && t1 < 1) {
+ tvalues.push(t1);
+ }
+ t2 = (-b - sqrtb2ac) / (2 * a);
+ if (0 < t2 && t2 < 1) {
+ tvalues.push(t2);
+ }
+ }
+
+ var x, y, j = tvalues.length,
+ jlen = j,
+ mt;
+ while (j--) {
+ t = tvalues[j];
+ mt = 1 - t;
+ bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
+ bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
+ }
+
+ bounds[0][jlen] = x0;
+ bounds[1][jlen] = y0;
+ bounds[0][jlen + 1] = x3;
+ bounds[1][jlen + 1] = y3;
+ bounds[0].length = bounds[1].length = jlen + 2;
+
+
+ return {
+ min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},
+ max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}
+ };
+ }
+
+ function path2curve(path, path2) {
+ var pth = !path2 && paths(path);
+ if (!path2 && pth.curve) {
+ return pathClone(pth.curve);
+ }
+ var p = pathToAbsolute(path),
+ p2 = path2 && pathToAbsolute(path2),
+ attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ processPath = function (path, d, pcom) {
+ var nx, ny;
+ if (!path) {
+ return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
+ }
+ !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);
+ switch (path[0]) {
+ case "M":
+ d.X = path[1];
+ d.Y = path[2];
+ break;
+ case "A":
+ path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
+ break;
+ case "S":
+ if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
+ nx = d.x * 2 - d.bx; // And reflect the previous
+ ny = d.y * 2 - d.by; // command's control point relative to the current point.
+ }
+ else { // or some else or nothing
+ nx = d.x;
+ ny = d.y;
+ }
+ path = ["C", nx, ny].concat(path.slice(1));
+ break;
+ case "T":
+ if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
+ d.qx = d.x * 2 - d.qx; // And make a reflection similar
+ d.qy = d.y * 2 - d.qy; // to case "S".
+ }
+ else { // or something else or nothing
+ d.qx = d.x;
+ d.qy = d.y;
+ }
+ path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
+ break;
+ case "Q":
+ d.qx = path[1];
+ d.qy = path[2];
+ path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
+ break;
+ case "L":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
+ break;
+ case "H":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
+ break;
+ case "V":
+ path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
+ break;
+ case "Z":
+ path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
+ break;
+ }
+ return path;
+ },
+ fixArc = function (pp, i) {
+ if (pp[i].length > 7) {
+ pp[i].shift();
+ var pi = pp[i];
+ while (pi.length) {
+ pcoms1[i] = "A"; // if created multiple C:s, their original seg is saved
+ p2 && (pcoms2[i] = "A"); // the same as above
+ pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
+ }
+ pp.splice(i, 1);
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ fixM = function (path1, path2, a1, a2, i) {
+ if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
+ path2.splice(i, 0, ["M", a2.x, a2.y]);
+ a1.bx = 0;
+ a1.by = 0;
+ a1.x = path1[i][1];
+ a1.y = path1[i][2];
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ pcoms1 = [], // path commands of original path p
+ pcoms2 = [], // path commands of original path p2
+ pfirst = "", // temporary holder for original path command
+ pcom = ""; // holder for previous path command of original path
+ for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
+ p[i] && (pfirst = p[i][0]); // save current path command
+
+ if (pfirst != "C") // C is not saved yet, because it may be result of conversion
+ {
+ pcoms1[i] = pfirst; // Save current path command
+ i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom
+ }
+ p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
+
+ if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
+ // which may produce multiple C:s
+ // so we have to make sure that C is also C in original path
+
+ fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
+
+ if (p2) { // the same procedures is done to p2
+ p2[i] && (pfirst = p2[i][0]);
+ if (pfirst != "C") {
+ pcoms2[i] = pfirst;
+ i && (pcom = pcoms2[i - 1]);
+ }
+ p2[i] = processPath(p2[i], attrs2, pcom);
+
+ if (pcoms2[i] != "A" && pfirst == "C") {
+ pcoms2[i] = "C";
+ }
+
+ fixArc(p2, i);
+ }
+ fixM(p, p2, attrs, attrs2, i);
+ fixM(p2, p, attrs2, attrs, i);
+ var seg = p[i],
+ seg2 = p2 && p2[i],
+ seglen = seg.length,
+ seg2len = p2 && seg2.length;
+ attrs.x = seg[seglen - 2];
+ attrs.y = seg[seglen - 1];
+ attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
+ attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
+ attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
+ attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
+ attrs2.x = p2 && seg2[seg2len - 2];
+ attrs2.y = p2 && seg2[seg2len - 1];
+ }
+ if (!p2) {
+ pth.curve = pathClone(p);
+ }
+ return p2 ? [p, p2] : p;
+ }
+ function mapPath(path, matrix) {
+ if (!matrix) {
+ return path;
+ }
+ var x, y, i, j, ii, jj, pathi;
+ path = path2curve(path);
+ for (i = 0, ii = path.length; i < ii; i++) {
+ pathi = path[i];
+ for (j = 1, jj = pathi.length; j < jj; j += 2) {
+ x = matrix.x(pathi[j], pathi[j + 1]);
+ y = matrix.y(pathi[j], pathi[j + 1]);
+ pathi[j] = x;
+ pathi[j + 1] = y;
+ }
+ }
+ return path;
+ }
+
+ // http://schepers.cc/getting-to-the-point
+ function catmullRom2bezier(crp, z) {
+ var d = [];
+ for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
+ var p = [
+ {x: +crp[i - 2], y: +crp[i - 1]},
+ {x: +crp[i], y: +crp[i + 1]},
+ {x: +crp[i + 2], y: +crp[i + 3]},
+ {x: +crp[i + 4], y: +crp[i + 5]}
+ ];
+ if (z) {
+ if (!i) {
+ p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};
+ } else if (iLen - 4 == i) {
+ p[3] = {x: +crp[0], y: +crp[1]};
+ } else if (iLen - 2 == i) {
+ p[2] = {x: +crp[0], y: +crp[1]};
+ p[3] = {x: +crp[2], y: +crp[3]};
+ }
+ } else {
+ if (iLen - 4 == i) {
+ p[3] = p[2];
+ } else if (!i) {
+ p[0] = {x: +crp[i], y: +crp[i + 1]};
+ }
+ }
+ d.push(["C",
+ (-p[0].x + 6 * p[1].x + p[2].x) / 6,
+ (-p[0].y + 6 * p[1].y + p[2].y) / 6,
+ (p[1].x + 6 * p[2].x - p[3].x) / 6,
+ (p[1].y + 6*p[2].y - p[3].y) / 6,
+ p[2].x,
+ p[2].y
+ ]);
+ }
+
+ return d;
+ }
+
+ // export
+ Snap.path = paths;
+
+ /*\
+ * Snap.path.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the given path in pixels
+ **
+ - path (string) SVG path string
+ **
+ = (number) length
+ \*/
+ Snap.path.getTotalLength = getTotalLength;
+ /*\
+ * Snap.path.getPointAtLength
+ [ method ]
+ **
+ * Returns the coordinates of the point located at the given length along the given path
+ **
+ - path (string) SVG path string
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ Snap.path.getPointAtLength = getPointAtLength;
+ /*\
+ * Snap.path.getSubpath
+ [ method ]
+ **
+ * Returns the subpath of a given path between given start and end lengths
+ **
+ - path (string) SVG path string
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ Snap.path.getSubpath = function (path, from, to) {
+ if (this.getTotalLength(path) - to < 1e-6) {
+ return getSubpathsAtLength(path, from).end;
+ }
+ var a = getSubpathsAtLength(path, to, 1);
+ return from ? getSubpathsAtLength(a, from).end : a;
+ };
+ /*\
+ * Element.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the path in pixels (only works for `path` elements)
+ = (number) length
+ \*/
+ elproto.getTotalLength = function () {
+ if (this.node.getTotalLength) {
+ return this.node.getTotalLength();
+ }
+ };
+ // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?
+ /*\
+ * Element.getPointAtLength
+ [ method ]
+ **
+ * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)
+ **
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ elproto.getPointAtLength = function (length) {
+ return getPointAtLength(this.attr("d"), length);
+ };
+ // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.
+ /*\
+ * Element.getSubpath
+ [ method ]
+ **
+ * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
+ **
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ elproto.getSubpath = function (from, to) {
+ return Snap.path.getSubpath(this.attr("d"), from, to);
+ };
+ Snap._.box = box;
+ /*\
+ * Snap.path.findDotsAtSegment
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds dot coordinates on the given cubic beziér curve at the given t
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ - t (number) position on the curve (0..1)
+ = (object) point information in format:
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o m: {
+ o x: (number) x coordinate of the left anchor,
+ o y: (number) y coordinate of the left anchor
+ o },
+ o n: {
+ o x: (number) x coordinate of the right anchor,
+ o y: (number) y coordinate of the right anchor
+ o },
+ o start: {
+ o x: (number) x coordinate of the start of the curve,
+ o y: (number) y coordinate of the start of the curve
+ o },
+ o end: {
+ o x: (number) x coordinate of the end of the curve,
+ o y: (number) y coordinate of the end of the curve
+ o },
+ o alpha: (number) angle of the curve derivative at the point
+ o }
+ \*/
+ Snap.path.findDotsAtSegment = findDotsAtSegment;
+ /*\
+ * Snap.path.bezierBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given cubic beziér curve
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ * or
+ - bez (array) array of six points for beziér curve
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.bezierBBox = bezierBBox;
+ /*\
+ * Snap.path.isPointInsideBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside bounding box
+ - bbox (string) bounding box
+ - x (string) x coordinate of the point
+ - y (string) y coordinate of the point
+ = (boolean) `true` if point is inside
+ \*/
+ Snap.path.isPointInsideBBox = isPointInsideBBox;
+ /*\
+ * Snap.path.isBBoxIntersect
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if two bounding boxes intersect
+ - bbox1 (string) first bounding box
+ - bbox2 (string) second bounding box
+ = (boolean) `true` if bounding boxes intersect
+ \*/
+ Snap.path.isBBoxIntersect = isBBoxIntersect;
+ /*\
+ * Snap.path.intersection
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds intersections of two paths
+ - path1 (string) path string
+ - path2 (string) path string
+ = (array) dots of intersection
+ o [
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o t1: (number) t value for segment of path1,
+ o t2: (number) t value for segment of path2,
+ o segment1: (number) order number for segment of path1,
+ o segment2: (number) order number for segment of path2,
+ o bez1: (array) eight coordinates representing beziér curve for the segment of path1,
+ o bez2: (array) eight coordinates representing beziér curve for the segment of path2
+ o }
+ o ]
+ \*/
+ Snap.path.intersection = pathIntersection;
+ Snap.path.intersectionNumber = pathIntersectionNumber;
+ /*\
+ * Snap.path.isPointInside
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside a given closed path.
+ *
+ * Note: fill mode doesn’t affect the result of this method.
+ - path (string) path string
+ - x (number) x of the point
+ - y (number) y of the point
+ = (boolean) `true` if point is inside the path
+ \*/
+ Snap.path.isPointInside = isPointInsidePath;
+ /*\
+ * Snap.path.getBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given path
+ - path (string) path string
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.getBBox = pathBBox;
+ Snap.path.get = getPath;
+ /*\
+ * Snap.path.toRelative
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into relative values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toRelative = pathToRelative;
+ /*\
+ * Snap.path.toAbsolute
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into absolute values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toAbsolute = pathToAbsolute;
+ /*\
+ * Snap.path.toCubic
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path to a new path where all segments are cubic beziér curves
+ - pathString (string|array) path string or array of segments
+ = (array) array of segments
+ \*/
+ Snap.path.toCubic = path2curve;
+ /*\
+ * Snap.path.map
+ [ method ]
+ **
+ * Transform the path string with the given matrix
+ - path (string) path string
+ - matrix (object) see @Matrix
+ = (string) transformed path string
+ \*/
+ Snap.path.map = mapPath;
+ Snap.path.toString = toString;
+ Snap.path.clone = pathClone;
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ has = "hasOwnProperty",
+ supportsTouch = "createTouch" in glob.doc,
+ events = [
+ "click", "dblclick", "mousedown", "mousemove", "mouseout",
+ "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
+ "touchcancel"
+ ],
+ touchMap = {
+ mousedown: "touchstart",
+ mousemove: "touchmove",
+ mouseup: "touchend"
+ },
+ getScroll = function (xy, el) {
+ var name = xy == "y" ? "scrollTop" : "scrollLeft",
+ doc = el && el.node ? el.node.ownerDocument : glob.doc;
+ return doc[name in doc.documentElement ? "documentElement" : "body"][name];
+ },
+ preventDefault = function () {
+ this.returnValue = false;
+ },
+ preventTouch = function () {
+ return this.originalEvent.preventDefault();
+ },
+ stopPropagation = function () {
+ this.cancelBubble = true;
+ },
+ stopTouch = function () {
+ return this.originalEvent.stopPropagation();
+ },
+ addEvent = (function () {
+ if (glob.doc.addEventListener) {
+ return function (obj, type, fn, element) {
+ var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
+ f = function (e) {
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element);
+ if (supportsTouch && touchMap[has](type)) {
+ for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
+ if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
+ var olde = e;
+ e = e.targetTouches[i];
+ e.originalEvent = olde;
+ e.preventDefault = preventTouch;
+ e.stopPropagation = stopTouch;
+ break;
+ }
+ }
+ }
+ var x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ return fn.call(element, e, x, y);
+ };
+
+ if (type !== realName) {
+ obj.addEventListener(type, f, false);
+ }
+
+ obj.addEventListener(realName, f, false);
+
+ return function () {
+ if (type !== realName) {
+ obj.removeEventListener(type, f, false);
+ }
+
+ obj.removeEventListener(realName, f, false);
+ return true;
+ };
+ };
+ } else if (glob.doc.attachEvent) {
+ return function (obj, type, fn, element) {
+ var f = function (e) {
+ e = e || element.node.ownerDocument.window.event;
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element),
+ x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ e.preventDefault = e.preventDefault || preventDefault;
+ e.stopPropagation = e.stopPropagation || stopPropagation;
+ return fn.call(element, e, x, y);
+ };
+ obj.attachEvent("on" + type, f);
+ var detacher = function () {
+ obj.detachEvent("on" + type, f);
+ return true;
+ };
+ return detacher;
+ };
+ }
+ })(),
+ drag = [],
+ dragMove = function (e) {
+ var x = e.clientX,
+ y = e.clientY,
+ scrollY = getScroll("y"),
+ scrollX = getScroll("x"),
+ dragi,
+ j = drag.length;
+ while (j--) {
+ dragi = drag[j];
+ if (supportsTouch) {
+ var i = e.touches && e.touches.length,
+ touch;
+ while (i--) {
+ touch = e.touches[i];
+ if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
+ x = touch.clientX;
+ y = touch.clientY;
+ (e.originalEvent ? e.originalEvent : e).preventDefault();
+ break;
+ }
+ }
+ } else {
+ e.preventDefault();
+ }
+ var node = dragi.el.node,
+ o,
+ next = node.nextSibling,
+ parent = node.parentNode,
+ display = node.style.display;
+ // glob.win.opera && parent.removeChild(node);
+ // node.style.display = "none";
+ // o = dragi.el.paper.getElementByPoint(x, y);
+ // node.style.display = display;
+ // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
+ // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
+ x += scrollX;
+ y += scrollY;
+ eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
+ }
+ },
+ dragUp = function (e) {
+ Snap.unmousemove(dragMove).unmouseup(dragUp);
+ var i = drag.length,
+ dragi;
+ while (i--) {
+ dragi = drag[i];
+ dragi.el._drag = {};
+ eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
+ }
+ drag = [];
+ };
+ /*\
+ * Element.click
+ [ method ]
+ **
+ * Adds a click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unclick
+ [ method ]
+ **
+ * Removes a click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.dblclick
+ [ method ]
+ **
+ * Adds a double click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.undblclick
+ [ method ]
+ **
+ * Removes a double click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousedown
+ [ method ]
+ **
+ * Adds a mousedown event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousedown
+ [ method ]
+ **
+ * Removes a mousedown event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousemove
+ [ method ]
+ **
+ * Adds a mousemove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousemove
+ [ method ]
+ **
+ * Removes a mousemove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseout
+ [ method ]
+ **
+ * Adds a mouseout event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseout
+ [ method ]
+ **
+ * Removes a mouseout event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseover
+ [ method ]
+ **
+ * Adds a mouseover event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseover
+ [ method ]
+ **
+ * Removes a mouseover event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseup
+ [ method ]
+ **
+ * Adds a mouseup event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseup
+ [ method ]
+ **
+ * Removes a mouseup event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchstart
+ [ method ]
+ **
+ * Adds a touchstart event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchstart
+ [ method ]
+ **
+ * Removes a touchstart event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchmove
+ [ method ]
+ **
+ * Adds a touchmove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchmove
+ [ method ]
+ **
+ * Removes a touchmove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchend
+ [ method ]
+ **
+ * Adds a touchend event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchend
+ [ method ]
+ **
+ * Removes a touchend event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchcancel
+ [ method ]
+ **
+ * Adds a touchcancel event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchcancel
+ [ method ]
+ **
+ * Removes a touchcancel event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ for (var i = events.length; i--;) {
+ (function (eventName) {
+ Snap[eventName] = elproto[eventName] = function (fn, scope) {
+ if (Snap.is(fn, "function")) {
+ this.events = this.events || [];
+ this.events.push({
+ name: eventName,
+ f: fn,
+ unbind: addEvent(this.node || document, eventName, fn, scope || this)
+ });
+ }
+ return this;
+ };
+ Snap["un" + eventName] =
+ elproto["un" + eventName] = function (fn) {
+ var events = this.events || [],
+ l = events.length;
+ while (l--) if (events[l].name == eventName &&
+ (events[l].f == fn || !fn)) {
+ events[l].unbind();
+ events.splice(l, 1);
+ !events.length && delete this.events;
+ return this;
+ }
+ return this;
+ };
+ })(events[i]);
+ }
+ /*\
+ * Element.hover
+ [ method ]
+ **
+ * Adds hover event handlers to the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ - icontext (object) #optional context for hover in handler
+ - ocontext (object) #optional context for hover out handler
+ = (object) @Element
+ \*/
+ elproto.hover = function (f_in, f_out, scope_in, scope_out) {
+ return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
+ };
+ /*\
+ * Element.unhover
+ [ method ]
+ **
+ * Removes hover event handlers from the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ = (object) @Element
+ \*/
+ elproto.unhover = function (f_in, f_out) {
+ return this.unmouseover(f_in).unmouseout(f_out);
+ };
+ var draggable = [];
+ // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.
+ // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?
+ // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.
+ // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
+ /*\
+ * Element.drag
+ [ method ]
+ **
+ * Adds event handlers for an element's drag gesture
+ **
+ - onmove (function) handler for moving
+ - onstart (function) handler for drag start
+ - onend (function) handler for drag end
+ - mcontext (object) #optional context for moving handler
+ - scontext (object) #optional context for drag start handler
+ - econtext (object) #optional context for drag end handler
+ * Additionaly following `drag` events are triggered: `drag.start.<id>` on start,
+ * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element
+ * `drag.over.<id>` fires as well.
+ *
+ * Start event and start handler are called in specified context or in context of the element with following parameters:
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * Move event and move handler are called in specified context or in context of the element with following parameters:
+ o dx (number) shift by x from the start point
+ o dy (number) shift by y from the start point
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * End event and end handler are called in specified context or in context of the element with following parameters:
+ o event (object) DOM event object
+ = (object) @Element
+ \*/
+ elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
+ if (!arguments.length) {
+ var origTransform;
+ return this.drag(function (dx, dy) {
+ this.attr({
+ transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
+ });
+ }, function () {
+ origTransform = this.transform().local;
+ });
+ }
+ function start(e, x, y) {
+ (e.originalEvent || e).preventDefault();
+ this._drag.x = x;
+ this._drag.y = y;
+ this._drag.id = e.identifier;
+ !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
+ drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
+ onstart && eve.on("snap.drag.start." + this.id, onstart);
+ onmove && eve.on("snap.drag.move." + this.id, onmove);
+ onend && eve.on("snap.drag.end." + this.id, onend);
+ eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
+ }
+ this._drag = {};
+ draggable.push({el: this, start: start});
+ this.mousedown(start);
+ return this;
+ };
+ /*
+ * Element.onDragOver
+ [ method ]
+ **
+ * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)
+ - f (function) handler for event, first argument would be the element you are dragging over
+ \*/
+ // elproto.onDragOver = function (f) {
+ // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over." + this.id);
+ // };
+ /*\
+ * Element.undrag
+ [ method ]
+ **
+ * Removes all drag event handlers from the given element
+ \*/
+ elproto.undrag = function () {
+ var i = draggable.length;
+ while (i--) if (draggable[i].el == this) {
+ this.unmousedown(draggable[i].start);
+ draggable.splice(i, 1);
+ eve.unbind("snap.drag.*." + this.id);
+ }
+ !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
+ return this;
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ pproto = Paper.prototype,
+ rgurl = /^\s*url\((.+)\)/,
+ Str = String,
+ $ = Snap._.$;
+ Snap.filter = {};
+ /*\
+ * Paper.filter
+ [ method ]
+ **
+ * Creates a `<filter>` element
+ **
+ - filstr (string) SVG fragment of filter provided as a string
+ = (object) @Element
+ * Note: It is recommended to use filters embedded into the page inside an empty SVG element.
+ > Usage
+ | var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ pproto.filter = function (filstr) {
+ var paper = this;
+ if (paper.type != "svg") {
+ paper = paper.paper;
+ }
+ var f = Snap.parse(Str(filstr)),
+ id = Snap._.id(),
+ width = paper.node.offsetWidth,
+ height = paper.node.offsetHeight,
+ filter = $("filter");
+ $(filter, {
+ id: id,
+ filterUnits: "userSpaceOnUse"
+ });
+ filter.appendChild(f.node);
+ paper.defs.appendChild(filter);
+ return new Element(filter);
+ };
+
+ eve.on("snap.util.getattr.filter", function () {
+ eve.stop();
+ var p = $(this.node, "filter");
+ if (p) {
+ var match = Str(p).match(rgurl);
+ return match && Snap.select(match[1]);
+ }
+ });
+ eve.on("snap.util.attr.filter", function (value) {
+ if (value instanceof Element && value.type == "filter") {
+ eve.stop();
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ id = value.id;
+ }
+ $(this.node, {
+ filter: Snap.url(id)
+ });
+ }
+ if (!value || value == "none") {
+ eve.stop();
+ this.node.removeAttribute("filter");
+ }
+ });
+ /*\
+ * Snap.filter.blur
+ [ method ]
+ **
+ * Returns an SVG markup string for the blur filter
+ **
+ - x (number) amount of horizontal blur, in pixels
+ - y (number) #optional amount of vertical blur, in pixels
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.blur(5, 10)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.blur = function (x, y) {
+ if (x == null) {
+ x = 2;
+ }
+ var def = y == null ? x : [x, y];
+ return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
+ def: def
+ });
+ };
+ Snap.filter.blur.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.shadow
+ [ method ]
+ **
+ * Returns an SVG markup string for the shadow filter
+ **
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - blur (number) #optional amount of blur
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * which makes blur default to `4`. Or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - opacity (number) #optional `0..1` opacity of the shadow
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
+ if (typeof blur == "string") {
+ color = blur;
+ opacity = color;
+ blur = 4;
+ }
+ if (typeof color != "string") {
+ opacity = color;
+ color = "#000";
+ }
+ color = color || "#000";
+ if (blur == null) {
+ blur = 4;
+ }
+ if (opacity == null) {
+ opacity = 1;
+ }
+ if (dx == null) {
+ dx = 0;
+ dy = 2;
+ }
+ if (dy == null) {
+ dy = dx;
+ }
+ color = Snap.color(color);
+ return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
+ color: color,
+ dx: dx,
+ dy: dy,
+ blur: blur,
+ opacity: opacity
+ });
+ };
+ Snap.filter.shadow.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.grayscale
+ [ method ]
+ **
+ * Returns an SVG markup string for the grayscale filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.grayscale = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
+ a: 0.2126 + 0.7874 * (1 - amount),
+ b: 0.7152 - 0.7152 * (1 - amount),
+ c: 0.0722 - 0.0722 * (1 - amount),
+ d: 0.2126 - 0.2126 * (1 - amount),
+ e: 0.7152 + 0.2848 * (1 - amount),
+ f: 0.0722 - 0.0722 * (1 - amount),
+ g: 0.2126 - 0.2126 * (1 - amount),
+ h: 0.0722 + 0.9278 * (1 - amount)
+ });
+ };
+ Snap.filter.grayscale.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.sepia
+ [ method ]
+ **
+ * Returns an SVG markup string for the sepia filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.sepia = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
+ a: 0.393 + 0.607 * (1 - amount),
+ b: 0.769 - 0.769 * (1 - amount),
+ c: 0.189 - 0.189 * (1 - amount),
+ d: 0.349 - 0.349 * (1 - amount),
+ e: 0.686 + 0.314 * (1 - amount),
+ f: 0.168 - 0.168 * (1 - amount),
+ g: 0.272 - 0.272 * (1 - amount),
+ h: 0.534 - 0.534 * (1 - amount),
+ i: 0.131 + 0.869 * (1 - amount)
+ });
+ };
+ Snap.filter.sepia.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.saturate
+ [ method ]
+ **
+ * Returns an SVG markup string for the saturate filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.saturate = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
+ amount: 1 - amount
+ });
+ };
+ Snap.filter.saturate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.hueRotate
+ [ method ]
+ **
+ * Returns an SVG markup string for the hue-rotate filter
+ **
+ - angle (number) angle of rotation
+ = (string) filter representation
+ \*/
+ Snap.filter.hueRotate = function (angle) {
+ angle = angle || 0;
+ return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
+ angle: angle
+ });
+ };
+ Snap.filter.hueRotate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.invert
+ [ method ]
+ **
+ * Returns an SVG markup string for the invert filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.invert = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: 1 - amount
+ });
+ };
+ Snap.filter.invert.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.brightness
+ [ method ]
+ **
+ * Returns an SVG markup string for the brightness filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.brightness = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
+ amount: amount
+ });
+ };
+ Snap.filter.brightness.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.contrast
+ [ method ]
+ **
+ * Returns an SVG markup string for the contrast filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.contrast = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: .5 - amount / 2
+ });
+ };
+ Snap.filter.contrast.toString = function () {
+ return this();
+ };
+});
+
+return Snap;
+}));
+},{"185":185}],188:[function(_dereq_,module,exports){
+'use strict';
+
+var snapsvg = module.exports = _dereq_(187);
+
+snapsvg.plugin(function(Snap, Element) {
+
+ /*\
+ * Element.children
+ [ method ]
+ **
+ * Returns array of all the children of the element.
+ = (array) array of Elements
+ \*/
+ Element.prototype.children = function () {
+ var out = [],
+ ch = this.node.childNodes;
+ for (var i = 0, ii = ch.length; i < ii; i++) {
+ out[i] = new Snap(ch[i]);
+ }
+ return out;
+ };
+});
+
+
+/**
+ * @class ClassPlugin
+ *
+ * Extends snapsvg with methods to add and remove classes
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ function split(str) {
+ return str.split(/\s+/);
+ }
+
+ function join(array) {
+ return array.join(' ');
+ }
+
+ function getClasses(e) {
+ return split(e.attr('class') || '');
+ }
+
+ function setClasses(e, classes) {
+ e.attr('class', join(classes));
+ }
+
+ /**
+ * @method snapsvg.Element#addClass
+ *
+ * @example
+ *
+ * e.attr('class', 'selector');
+ *
+ * e.addClass('foo bar'); // adds classes foo and bar
+ * e.attr('class'); // -> 'selector foo bar'
+ *
+ * e.addClass('fooBar');
+ * e.attr('class'); // -> 'selector foo bar fooBar'
+ *
+ * @param {String} cls classes to be added to the element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.addClass = function(cls) {
+ var current = getClasses(this),
+ add = split(cls),
+ i, e;
+
+ for (i = 0, e; !!(e = add[i]); i++) {
+ if (current.indexOf(e) === -1) {
+ current.push(e);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+ /**
+ * @method snapsvg.Element#hasClass
+ *
+ * @param {String} cls the class to query for
+ * @return {Boolean} returns true if the element has the given class
+ */
+ Element.prototype.hasClass = function(cls) {
+ if (!cls) {
+ throw new Error('[snapsvg] syntax: hasClass(clsStr)');
+ }
+
+ return getClasses(this).indexOf(cls) !== -1;
+ };
+
+ /**
+ * @method snapsvg.Element#removeClass
+ *
+ * @example
+ *
+ * e.attr('class', 'foo bar');
+ *
+ * e.removeClass('foo');
+ * e.attr('class'); // -> 'bar'
+ *
+ * e.removeClass('foo bar'); // removes classes foo and bar
+ * e.attr('class'); // -> ''
+ *
+ * @param {String} cls classes to be removed from element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.removeClass = function(cls) {
+ var current = getClasses(this),
+ remove = split(cls),
+ i, e, idx;
+
+ for (i = 0, e; !!(e = remove[i]); i++) {
+ idx = current.indexOf(e);
+
+ if (idx !== -1) {
+ // remove element from array
+ current.splice(idx, 1);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+});
+
+/**
+ * @class TranslatePlugin
+ *
+ * Extends snapsvg with methods to translate elements
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.Element#translate
+ *
+ * @example
+ *
+ * e.translate(10, 20);
+ *
+ * // sets transform matrix to translate(10, 20)
+ *
+ * @param {Number} x translation
+ * @param {Number} y translation
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.translate = function(x, y) {
+ var matrix = new Snap.Matrix();
+ matrix.translate(x, y);
+ return this.transform(matrix);
+ };
+});
+
+
+/**
+ * @class CreatePlugin
+ *
+ * Create an svg element without attaching it to the dom
+ */
+snapsvg.plugin(function(Snap) {
+
+ Snap.create = function(name, attrs) {
+ return Snap._.wrap(Snap._.$(name, attrs));
+ };
+});
+
+
+/**
+ * @class CreatSnapAtPlugin
+ *
+ * Extends snap.svg with a method to create a SVG element
+ * at a specific position in the DOM.
+ */
+snapsvg.plugin(function(Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.createSnapAt
+ *
+ * @example
+ *
+ * snapsvg.createSnapAt(parentNode, 200, 200);
+ *
+ * @param {Number} width of svg
+ * @param {Number} height of svg
+ * @param {Object} parentNode svg Element will be child of this
+ *
+ * @return {snapsvg.Element} the newly created wrapped SVG element instance
+ */
+ Snap.createSnapAt = function(width, height, parentNode) {
+
+ var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ svg.setAttribute('width', width);
+ svg.setAttribute('height', height);
+ if (!parentNode) {
+ parentNode = document.body;
+ }
+ parentNode.appendChild(svg);
+
+ return new Snap(svg);
+ };
+});
+},{"187":187}],189:[function(_dereq_,module,exports){
+
+var isArray = function(obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+};
+
+var annotate = function() {
+ var args = Array.prototype.slice.call(arguments);
+
+ if (args.length === 1 && isArray(args[0])) {
+ args = args[0];
+ }
+
+ var fn = args.pop();
+
+ fn.$inject = args;
+
+ return fn;
+};
+
+
+// Current limitations:
+// - can't put into "function arg" comments
+// function /* (no parenthesis like this) */ (){}
+// function abc( /* xx (no parenthesis like this) */ a, b) {}
+//
+// Just put the comment before function or inside:
+// /* (((this is fine))) */ function(a, b) {}
+// function abc(a) { /* (((this is fine))) */}
+
+var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG = /\/\*([^\*]*)\*\//m;
+
+var parse = function(fn) {
+ if (typeof fn !== 'function') {
+ throw new Error('Cannot annotate "' + fn + '". Expected a function!');
+ }
+
+ var match = fn.toString().match(FN_ARGS);
+ return match[1] && match[1].split(',').map(function(arg) {
+ match = arg.match(FN_ARG);
+ return match ? match[1].trim() : arg.trim();
+ }) || [];
+};
+
+
+exports.annotate = annotate;
+exports.parse = parse;
+exports.isArray = isArray;
+
+},{}],190:[function(_dereq_,module,exports){
+module.exports = {
+ annotate: _dereq_(189).annotate,
+ Module: _dereq_(192),
+ Injector: _dereq_(191)
+};
+
+},{"189":189,"191":191,"192":192}],191:[function(_dereq_,module,exports){
+var Module = _dereq_(192);
+var autoAnnotate = _dereq_(189).parse;
+var annotate = _dereq_(189).annotate;
+var isArray = _dereq_(189).isArray;
+
+
+var Injector = function(modules, parent) {
+ parent = parent || {
+ get: function(name) {
+ currentlyResolving.push(name);
+ throw error('No provider for "' + name + '"!');
+ }
+ };
+
+ var currentlyResolving = [];
+ var providers = this._providers = Object.create(parent._providers || null);
+ var instances = this._instances = Object.create(null);
+
+ var self = instances.injector = this;
+
+ var error = function(msg) {
+ var stack = currentlyResolving.join(' -> ');
+ currentlyResolving.length = 0;
+ return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
+ };
+
+ var get = function(name) {
+ if (!providers[name] && name.indexOf('.') !== -1) {
+ var parts = name.split('.');
+ var pivot = get(parts.shift());
+
+ while(parts.length) {
+ pivot = pivot[parts.shift()];
+ }
+
+ return pivot;
+ }
+
+ if (Object.hasOwnProperty.call(instances, name)) {
+ return instances[name];
+ }
+
+ if (Object.hasOwnProperty.call(providers, name)) {
+ if (currentlyResolving.indexOf(name) !== -1) {
+ currentlyResolving.push(name);
+ throw error('Cannot resolve circular dependency!');
+ }
+
+ currentlyResolving.push(name);
+ instances[name] = providers[name][0](providers[name][1]);
+ currentlyResolving.pop();
+
+ return instances[name];
+ }
+
+ return parent.get(name);
+ };
+
+ var instantiate = function(Type) {
+ var instance = Object.create(Type.prototype);
+ var returned = invoke(Type, instance);
+
+ return typeof returned === 'object' ? returned : instance;
+ };
+
+ var invoke = function(fn, context) {
+ if (typeof fn !== 'function') {
+ if (isArray(fn)) {
+ fn = annotate(fn.slice());
+ } else {
+ throw new Error('Cannot invoke "' + fn + '". Expected a function!');
+ }
+ }
+
+ var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
+ var dependencies = inject.map(function(dep) {
+ return get(dep);
+ });
+
+ // TODO(vojta): optimize without apply
+ return fn.apply(context, dependencies);
+ };
+
+
+ var createPrivateInjectorFactory = function(privateChildInjector) {
+ return annotate(function(key) {
+ return privateChildInjector.get(key);
+ });
+ };
+
+ var createChild = function(modules, forceNewInstances) {
+ if (forceNewInstances && forceNewInstances.length) {
+ var fromParentModule = Object.create(null);
+ var matchedScopes = Object.create(null);
+
+ var privateInjectorsCache = [];
+ var privateChildInjectors = [];
+ var privateChildFactories = [];
+
+ var provider;
+ var cacheIdx;
+ var privateChildInjector;
+ var privateChildInjectorFactory;
+ for (var name in providers) {
+ provider = providers[name];
+
+ if (forceNewInstances.indexOf(name) !== -1) {
+ if (provider[2] === 'private') {
+ cacheIdx = privateInjectorsCache.indexOf(provider[3]);
+ if (cacheIdx === -1) {
+ privateChildInjector = provider[3].createChild([], forceNewInstances);
+ privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
+ privateInjectorsCache.push(provider[3]);
+ privateChildInjectors.push(privateChildInjector);
+ privateChildFactories.push(privateChildInjectorFactory);
+ fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
+ } else {
+ fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
+ }
+ } else {
+ fromParentModule[name] = [provider[2], provider[1]];
+ }
+ matchedScopes[name] = true;
+ }
+
+ if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
+ forceNewInstances.forEach(function(scope) {
+ if (provider[1].$scope.indexOf(scope) !== -1) {
+ fromParentModule[name] = [provider[2], provider[1]];
+ matchedScopes[scope] = true;
+ }
+ });
+ }
+ }
+
+ forceNewInstances.forEach(function(scope) {
+ if (!matchedScopes[scope]) {
+ throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
+ }
+ });
+
+ modules.unshift(fromParentModule);
+ }
+
+ return new Injector(modules, self);
+ };
+
+ var factoryMap = {
+ factory: invoke,
+ type: instantiate,
+ value: function(value) {
+ return value;
+ }
+ };
+
+ modules.forEach(function(module) {
+
+ function arrayUnwrap(type, value) {
+ if (type !== 'value' && isArray(value)) {
+ value = annotate(value.slice());
+ }
+
+ return value;
+ }
+
+ // TODO(vojta): handle wrong inputs (modules)
+ if (module instanceof Module) {
+ module.forEach(function(provider) {
+ var name = provider[0];
+ var type = provider[1];
+ var value = provider[2];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ } else if (typeof module === 'object') {
+ if (module.__exports__) {
+ var clonedModule = Object.keys(module).reduce(function(m, key) {
+ if (key.substring(0, 2) !== '__') {
+ m[key] = module[key];
+ }
+ return m;
+ }, Object.create(null));
+
+ var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
+ var getFromPrivateInjector = annotate(function(key) {
+ return privateInjector.get(key);
+ });
+ module.__exports__.forEach(function(key) {
+ providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
+ });
+ } else {
+ Object.keys(module).forEach(function(name) {
+ if (module[name][2] === 'private') {
+ providers[name] = module[name];
+ return;
+ }
+
+ var type = module[name][0];
+ var value = module[name][1];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ }
+ }
+ });
+
+ // public API
+ this.get = get;
+ this.invoke = invoke;
+ this.instantiate = instantiate;
+ this.createChild = createChild;
+};
+
+module.exports = Injector;
+
+},{"189":189,"192":192}],192:[function(_dereq_,module,exports){
+var Module = function() {
+ var providers = [];
+
+ this.factory = function(name, factory) {
+ providers.push([name, 'factory', factory]);
+ return this;
+ };
+
+ this.value = function(name, value) {
+ providers.push([name, 'value', value]);
+ return this;
+ };
+
+ this.type = function(name, type) {
+ providers.push([name, 'type', type]);
+ return this;
+ };
+
+ this.forEach = function(iterator) {
+ providers.forEach(iterator);
+ };
+};
+
+module.exports = Module;
+
+},{}],193:[function(_dereq_,module,exports){
+'use strict';
+
+var hat = _dereq_(194);
+
+
+/**
+ * Create a new id generator / cache instance.
+ *
+ * You may optionally provide a seed that is used internally.
+ *
+ * @param {Seed} seed
+ */
+function Ids(seed) {
+ seed = seed || [ 128, 36, 1 ];
+ this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
+}
+
+module.exports = Ids;
+
+/**
+ * Generate a next id.
+ *
+ * @param {Object} [element] element to bind the id to
+ *
+ * @return {String} id
+ */
+Ids.prototype.next = function(element) {
+ return this._seed(element || true);
+};
+
+/**
+ * Generate a next id with a given prefix.
+ *
+ * @param {Object} [element] element to bind the id to
+ *
+ * @return {String} id
+ */
+Ids.prototype.nextPrefixed = function(prefix, element) {
+ var id;
+
+ do {
+ id = prefix + this.next(true);
+ } while (this.assigned(id));
+
+ // claim {prefix}{random}
+ this.claim(id, element);
+
+ // return
+ return id;
+};
+
+/**
+ * Manually claim an existing id.
+ *
+ * @param {String} id
+ * @param {String} [element] element the id is claimed by
+ */
+Ids.prototype.claim = function(id, element) {
+ this._seed.set(id, element || true);
+};
+
+/**
+ * Returns true if the given id has already been assigned.
+ *
+ * @param {String} id
+ * @return {Boolean}
+ */
+Ids.prototype.assigned = function(id) {
+ return this._seed.get(id) || false;
+};
+},{"194":194}],194:[function(_dereq_,module,exports){
+var hat = module.exports = function (bits, base) {
+ if (!base) base = 16;
+ if (bits === undefined) bits = 128;
+ if (bits <= 0) return '0';
+
+ var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
+ for (var i = 2; digits === Infinity; i *= 2) {
+ digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
+ }
+
+ var rem = digits - Math.floor(digits);
+
+ var res = '';
+
+ for (var i = 0; i < Math.floor(digits); i++) {
+ var x = Math.floor(Math.random() * base).toString(base);
+ res = x + res;
+ }
+
+ if (rem) {
+ var b = Math.pow(base, rem);
+ var x = Math.floor(Math.random() * b).toString(base);
+ res = x + res;
+ }
+
+ var parsed = parseInt(res, base);
+ if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
+ return hat(bits, base)
+ }
+ else return res;
+};
+
+hat.rack = function (bits, base, expandBy) {
+ var fn = function (data) {
+ var iters = 0;
+ do {
+ if (iters ++ > 10) {
+ if (expandBy) bits += expandBy;
+ else throw new Error('too many ID collisions, use more bits')
+ }
+
+ var id = hat(bits, base);
+ } while (Object.hasOwnProperty.call(hats, id));
+
+ hats[id] = data;
+ return id;
+ };
+ var hats = fn.hats = {};
+
+ fn.get = function (id) {
+ return fn.hats[id];
+ };
+
+ fn.set = function (id, value) {
+ fn.hats[id] = value;
+ return fn;
+ };
+
+ fn.bits = bits || 128;
+ fn.base = base || 16;
+ return fn;
+};
+
+},{}],195:[function(_dereq_,module,exports){
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+
+},{}],196:[function(_dereq_,module,exports){
+var baseFlatten = _dereq_(240),
+ isIterateeCall = _dereq_(295);
+
+/**
+ * Flattens a nested array. If `isDeep` is `true` the array is recursively
+ * flattened, otherwise it is only flattened a single level.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flatten([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, [4]]
+ *
+ * // using `isDeep`
+ * _.flatten([1, [2, 3, [4]]], true);
+ * // => [1, 2, 3, 4]
+ */
+function flatten(array, isDeep, guard) {
+ var length = array ? array.length : 0;
+ if (guard && isIterateeCall(array, isDeep, guard)) {
+ isDeep = false;
+ }
+ return length ? baseFlatten(array, isDeep) : [];
+}
+
+module.exports = flatten;
+
+},{"240":240,"295":295}],197:[function(_dereq_,module,exports){
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
+
+},{}],198:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(229),
+ baseUniq = _dereq_(264),
+ isIterateeCall = _dereq_(295),
+ sortedUniq = _dereq_(311);
+
+/**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurence of each element
+ * is kept. Providing `true` for `isSorted` performs a faster search algorithm
+ * for sorted arrays. If an iteratee function is provided it is invoked for
+ * each element in the array to generate the criterion by which uniqueness
+ * is computed. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, array).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias unique
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {boolean} [isSorted] Specify the array is sorted.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ *
+ * // using `isSorted`
+ * _.uniq([1, 1, 2], true);
+ * // => [1, 2]
+ *
+ * // using an iteratee function
+ * _.uniq([1, 2.5, 1.5, 2], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => [1, 2.5]
+ *
+ * // using the `_.property` callback shorthand
+ * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+function uniq(array, isSorted, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (isSorted != null && typeof isSorted != 'boolean') {
+ thisArg = iteratee;
+ iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
+ isSorted = false;
+ }
+ iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
+ return (isSorted)
+ ? sortedUniq(array, iteratee)
+ : baseUniq(array, iteratee);
+}
+
+module.exports = uniq;
+
+},{"229":229,"264":264,"295":295,"311":311}],199:[function(_dereq_,module,exports){
+module.exports = _dereq_(198);
+
+},{"198":198}],200:[function(_dereq_,module,exports){
+var LazyWrapper = _dereq_(217),
+ LodashWrapper = _dereq_(218),
+ baseLodash = _dereq_(250),
+ isArray = _dereq_(316),
+ isObjectLike = _dereq_(299),
+ wrapperClone = _dereq_(314);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that return a boolean or single value will
+ * automatically end the chain returning the unwrapped value. Explicit chaining
+ * may be enabled using `_.chain`. The execution of chained methods is lazy,
+ * that is, execution is deferred until `_#value` is implicitly or explicitly
+ * called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization that merges iteratees to avoid creating intermediate
+ * arrays and reduce the number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`,
+ * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`,
+ * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,
+ * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
+ * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
+ * `keysIn`, `map`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
+ * `merge`, `mixin`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
+ * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
+ * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
+ * `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`,
+ * `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`,
+ * `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`,
+ * `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, `where`,
+ * `without`, `wrap`, `xor`, `zip`, and `zipObject`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,
+ * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
+ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,
+ * `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`,
+ * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
+ * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`,
+ * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`,
+ * `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`,
+ * `noop`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`,
+ * `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`,
+ * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`,
+ * `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
+ * `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+}
+
+// Ensure wrappers are instances of `baseLodash`.
+lodash.prototype = baseLodash.prototype;
+
+module.exports = lodash;
+
+},{"217":217,"218":218,"250":250,"299":299,"314":314,"316":316}],201:[function(_dereq_,module,exports){
+var arrayEvery = _dereq_(222),
+ baseCallback = _dereq_(229),
+ baseEvery = _dereq_(236),
+ isArray = _dereq_(316),
+ isIterateeCall = _dereq_(295);
+
+/**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = every;
+
+},{"222":222,"229":229,"236":236,"295":295,"316":316}],202:[function(_dereq_,module,exports){
+var arrayFilter = _dereq_(223),
+ baseCallback = _dereq_(229),
+ baseFilter = _dereq_(237),
+ isArray = _dereq_(316);
+
+/**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = baseCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+}
+
+module.exports = filter;
+
+},{"223":223,"229":229,"237":237,"316":316}],203:[function(_dereq_,module,exports){
+var baseEach = _dereq_(235),
+ createFind = _dereq_(279);
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
+
+},{"235":235,"279":279}],204:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(221),
+ baseEach = _dereq_(235),
+ createForEach = _dereq_(280);
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
+
+},{"221":221,"235":235,"280":280}],205:[function(_dereq_,module,exports){
+var createAggregator = _dereq_(272);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+});
+
+module.exports = groupBy;
+
+},{"272":272}],206:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(245),
+ getLength = _dereq_(290),
+ isArray = _dereq_(316),
+ isIterateeCall = _dereq_(295),
+ isLength = _dereq_(298),
+ isString = _dereq_(322),
+ values = _dereq_(331);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (!length) {
+ return false;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
+ : (baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+},{"245":245,"290":290,"295":295,"298":298,"316":316,"322":322,"331":331}],207:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(224),
+ baseCallback = _dereq_(229),
+ baseMap = _dereq_(251),
+ isArray = _dereq_(316);
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
+
+},{"224":224,"229":229,"251":251,"316":316}],208:[function(_dereq_,module,exports){
+var arrayReduce = _dereq_(225),
+ baseEach = _dereq_(235),
+ createReduce = _dereq_(283);
+
+/**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+var reduce = createReduce(arrayReduce, baseEach);
+
+module.exports = reduce;
+
+},{"225":225,"235":235,"283":283}],209:[function(_dereq_,module,exports){
+var getLength = _dereq_(290),
+ isLength = _dereq_(298),
+ keys = _dereq_(326);
+
+/**
+ * Gets the size of `collection` by returning its length for array-like
+ * values or the number of own enumerable properties for objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @returns {number} Returns the size of `collection`.
+ * @example
+ *
+ * _.size([1, 2, 3]);
+ * // => 3
+ *
+ * _.size({ 'a': 1, 'b': 2 });
+ * // => 2
+ *
+ * _.size('pebbles');
+ * // => 7
+ */
+function size(collection) {
+ var length = collection ? getLength(collection) : 0;
+ return isLength(length) ? length : keys(collection).length;
+}
+
+module.exports = size;
+
+},{"290":290,"298":298,"326":326}],210:[function(_dereq_,module,exports){
+var arraySome = _dereq_(226),
+ baseCallback = _dereq_(229),
+ baseSome = _dereq_(261),
+ isArray = _dereq_(316),
+ isIterateeCall = _dereq_(295);
+
+/**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = some;
+
+},{"226":226,"229":229,"261":261,"295":295,"316":316}],211:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(229),
+ baseMap = _dereq_(251),
+ baseSortBy = _dereq_(262),
+ compareAscending = _dereq_(269),
+ isIterateeCall = _dereq_(295);
+
+/**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection through `iteratee`. This method performs
+ * a stable sort, that is, it preserves the original sort order of equal elements.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return Math.sin(n);
+ * });
+ * // => [3, 1, 2]
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return this.sin(n);
+ * }, Math);
+ * // => [3, 1, 2]
+ *
+ * var users = [
+ * { 'user': 'fred' },
+ * { 'user': 'pebbles' },
+ * { 'user': 'barney' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.sortBy(users, 'user'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+function sortBy(collection, iteratee, thisArg) {
+ if (collection == null) {
+ return [];
+ }
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ var index = -1;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ var result = baseMap(collection, function(value, key, collection) {
+ return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
+ });
+ return baseSortBy(result, compareAscending);
+}
+
+module.exports = sortBy;
+
+},{"229":229,"251":251,"262":262,"269":269,"295":295}],212:[function(_dereq_,module,exports){
+var isNative = _dereq_(318);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = isNative(nativeNow = Date.now) && nativeNow;
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
+
+},{"318":318}],213:[function(_dereq_,module,exports){
+var createWrapper = _dereq_(284),
+ replaceHolders = _dereq_(307),
+ restParam = _dereq_(216);
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+});
+
+// Assign default placeholders.
+bind.placeholder = {};
+
+module.exports = bind;
+
+},{"216":216,"284":284,"307":307}],214:[function(_dereq_,module,exports){
+var isObject = _dereq_(320),
+ now = _dereq_(212);
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that delays invoking `func` until after `wait` milliseconds
+ * have elapsed since the last time it was invoked. The created function comes
+ * with a `cancel` method to cancel delayed invocations. Provide an options
+ * object to indicate that `func` should be invoked on the leading and/or
+ * trailing edge of the `wait` timeout. Subsequent calls to the debounced
+ * function return the result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ var isCalled = trailingCall;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (trailing || (maxWait !== wait)) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+}
+
+module.exports = debounce;
+
+},{"212":212,"320":320}],215:[function(_dereq_,module,exports){
+var baseDelay = _dereq_(233),
+ restParam = _dereq_(216);
+
+/**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+});
+
+module.exports = defer;
+
+},{"216":216,"233":233}],216:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],217:[function(_dereq_,module,exports){
+var baseCreate = _dereq_(232),
+ baseLodash = _dereq_(250);
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = null;
+ this.__dir__ = 1;
+ this.__dropCount__ = 0;
+ this.__filtered__ = false;
+ this.__iteratees__ = null;
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = null;
+}
+
+LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+LazyWrapper.prototype.constructor = LazyWrapper;
+
+module.exports = LazyWrapper;
+
+},{"232":232,"250":250}],218:[function(_dereq_,module,exports){
+var baseCreate = _dereq_(232),
+ baseLodash = _dereq_(250);
+
+/**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+}
+
+LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+LodashWrapper.prototype.constructor = LodashWrapper;
+
+module.exports = LodashWrapper;
+
+},{"232":232,"250":250}],219:[function(_dereq_,module,exports){
+(function (global){
+var cachePush = _dereq_(268),
+ isNative = _dereq_(318);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+}
+
+// Add functions to the `Set` cache.
+SetCache.prototype.push = cachePush;
+
+module.exports = SetCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"268":268,"318":318}],220:[function(_dereq_,module,exports){
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
+
+},{}],221:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+},{}],222:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = arrayEvery;
+
+},{}],223:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayFilter;
+
+},{}],224:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+},{}],225:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+}
+
+module.exports = arrayReduce;
+
+},{}],226:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+},{}],227:[function(_dereq_,module,exports){
+var getSymbols = _dereq_(291),
+ keys = _dereq_(326);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+function assignWith(object, source, customizer) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+}
+
+module.exports = assignWith;
+
+},{"291":291,"326":326}],228:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(231),
+ getSymbols = _dereq_(291),
+ isNative = _dereq_(318),
+ keys = _dereq_(326);
+
+/** Native method references. */
+var preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;
+
+/** Used as `baseAssign`. */
+var nativeAssign = (function() {
+ // Avoid `Object.assign` in Firefox 34-37 which have an early implementation
+ // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
+ // for more details.
+ //
+ // Use `Object.preventExtensions` on a plain object instead of simply using
+ // `Object('x')` because Chrome and IE fail to throw an error when attempting
+ // to assign values to readonly indexes of strings.
+ var func = preventExtensions && isNative(func = Object.assign) && func;
+ try {
+ if (func) {
+ var object = preventExtensions({ '1': 0 });
+ object[0] = 1;
+ }
+ } catch(e) {
+ // Only attempt in strict mode.
+ try { func(object, 'xo'); } catch(e) {}
+ return !object[1] && func;
+ }
+ return false;
+}());
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+var baseAssign = nativeAssign || function(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
+};
+
+module.exports = baseAssign;
+
+},{"231":231,"291":291,"318":318,"326":326}],229:[function(_dereq_,module,exports){
+var baseMatches = _dereq_(252),
+ baseMatchesProperty = _dereq_(253),
+ bindCallback = _dereq_(266),
+ identity = _dereq_(335),
+ property = _dereq_(337);
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
+
+},{"252":252,"253":253,"266":266,"335":335,"337":337}],230:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `compareAscending` which compares values and
+ * sorts them in ascending order without guaranteeing a stable sort.
+ *
+ * @private
+ * @param {*} value The value to compare to `other`.
+ * @param {*} other The value to compare to `value`.
+ * @returns {number} Returns the sort order indicator for `value`.
+ */
+function baseCompareAscending(value, other) {
+ if (value !== other) {
+ var valIsReflexive = value === value,
+ othIsReflexive = other === other;
+
+ if (value > other || !valIsReflexive || (value === undefined && othIsReflexive)) {
+ return 1;
+ }
+ if (value < other || !othIsReflexive || (other === undefined && valIsReflexive)) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+module.exports = baseCompareAscending;
+
+},{}],231:[function(_dereq_,module,exports){
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],232:[function(_dereq_,module,exports){
+(function (global){
+var isObject = _dereq_(320);
+
+/**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+var baseCreate = (function() {
+ function Object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ Object.prototype = prototype;
+ var result = new Object;
+ Object.prototype = null;
+ }
+ return result || global.Object();
+ };
+}());
+
+module.exports = baseCreate;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"320":320}],233:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+}
+
+module.exports = baseDelay;
+
+},{}],234:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(245),
+ cacheIndexOf = _dereq_(267),
+ createCache = _dereq_(277);
+
+/**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = baseIndexOf,
+ isCommon = true,
+ cache = (isCommon && values.length >= 200) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseDifference;
+
+},{"245":245,"267":267,"277":277}],235:[function(_dereq_,module,exports){
+var baseForOwn = _dereq_(243),
+ createBaseEach = _dereq_(274);
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
+
+},{"243":243,"274":274}],236:[function(_dereq_,module,exports){
+var baseEach = _dereq_(235);
+
+/**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+}
+
+module.exports = baseEvery;
+
+},{"235":235}],237:[function(_dereq_,module,exports){
+var baseEach = _dereq_(235);
+
+/**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+}
+
+module.exports = baseFilter;
+
+},{"235":235}],238:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
+
+},{}],239:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+},{}],240:[function(_dereq_,module,exports){
+var isArguments = _dereq_(315),
+ isArray = _dereq_(316),
+ isArrayLike = _dereq_(293),
+ isObjectLike = _dereq_(299);
+
+/**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = baseFlatten;
+
+},{"293":293,"299":299,"315":315,"316":316}],241:[function(_dereq_,module,exports){
+var createBaseFor = _dereq_(275);
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
+
+},{"275":275}],242:[function(_dereq_,module,exports){
+var baseFor = _dereq_(241),
+ keysIn = _dereq_(327);
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
+
+},{"241":241,"327":327}],243:[function(_dereq_,module,exports){
+var baseFor = _dereq_(241),
+ keys = _dereq_(326);
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
+
+},{"241":241,"326":326}],244:[function(_dereq_,module,exports){
+var toObject = _dereq_(312);
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = -1,
+ length = path.length;
+
+ while (object != null && ++index < length) {
+ object = object[path[index]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+},{"312":312}],245:[function(_dereq_,module,exports){
+var indexOfNaN = _dereq_(292);
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
+
+},{"292":292}],246:[function(_dereq_,module,exports){
+var baseIsEqualDeep = _dereq_(247);
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ // Exit early for identical values.
+ if (value === other) {
+ return true;
+ }
+ var valType = typeof value,
+ othType = typeof other;
+
+ // Exit early for unlike primitive values.
+ if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||
+ value == null || other == null) {
+ // Return `false` unless both values are `NaN`.
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
+
+},{"247":247}],247:[function(_dereq_,module,exports){
+var equalArrays = _dereq_(285),
+ equalByTag = _dereq_(286),
+ equalObjects = _dereq_(287),
+ isArray = _dereq_(316),
+ isTypedArray = _dereq_(323);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (valWrapped || othWrapped) {
+ return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
+
+},{"285":285,"286":286,"287":287,"316":316,"323":323}],248:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+}
+
+module.exports = baseIsFunction;
+
+},{}],249:[function(_dereq_,module,exports){
+var baseIsEqual = _dereq_(246);
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The source property names to match.
+ * @param {Array} values The source values to match.
+ * @param {Array} strictCompareFlags Strict comparison flags for source values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
+ var index = -1,
+ length = props.length,
+ noCustomizer = !customizer;
+
+ while (++index < length) {
+ if ((noCustomizer && strictCompareFlags[index])
+ ? values[index] !== object[props[index]]
+ : !(props[index] in object)
+ ) {
+ return false;
+ }
+ }
+ index = -1;
+ while (++index < length) {
+ var key = props[index],
+ objValue = object[key],
+ srcValue = values[index];
+
+ if (noCustomizer && strictCompareFlags[index]) {
+ var result = objValue !== undefined || (key in object);
+ } else {
+ result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (result === undefined) {
+ result = baseIsEqual(srcValue, objValue, customizer, true);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+},{"246":246}],250:[function(_dereq_,module,exports){
+/**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+function baseLodash() {
+ // No operation performed.
+}
+
+module.exports = baseLodash;
+
+},{}],251:[function(_dereq_,module,exports){
+var baseEach = _dereq_(235),
+ isArrayLike = _dereq_(293);
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
+
+},{"235":235,"293":293}],252:[function(_dereq_,module,exports){
+var baseIsMatch = _dereq_(249),
+ constant = _dereq_(334),
+ isStrictComparable = _dereq_(300),
+ keys = _dereq_(326),
+ toObject = _dereq_(312);
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var props = keys(source),
+ length = props.length;
+
+ if (!length) {
+ return constant(true);
+ }
+ if (length == 1) {
+ var key = props[0],
+ value = source[key];
+
+ if (isStrictComparable(value)) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ }
+ var values = Array(length),
+ strictCompareFlags = Array(length);
+
+ while (length--) {
+ value = source[props[length]];
+ values[length] = value;
+ strictCompareFlags[length] = isStrictComparable(value);
+ }
+ return function(object) {
+ return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
+ };
+}
+
+module.exports = baseMatches;
+
+},{"249":249,"300":300,"312":312,"326":326,"334":334}],253:[function(_dereq_,module,exports){
+var baseGet = _dereq_(244),
+ baseIsEqual = _dereq_(246),
+ baseSlice = _dereq_(260),
+ isArray = _dereq_(316),
+ isKey = _dereq_(296),
+ isStrictComparable = _dereq_(300),
+ last = _dereq_(197),
+ toObject = _dereq_(312),
+ toPath = _dereq_(313);
+
+/**
+ * The base implementation of `_.matchesProperty` which does not which does
+ * not clone `value`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} value The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, value) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(value),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === value
+ ? (value !== undefined || (key in object))
+ : baseIsEqual(value, object[key], null, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+},{"197":197,"244":244,"246":246,"260":260,"296":296,"300":300,"312":312,"313":313,"316":316}],254:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(221),
+ baseMergeDeep = _dereq_(255),
+ getSymbols = _dereq_(291),
+ isArray = _dereq_(316),
+ isArrayLike = _dereq_(293),
+ isObject = _dereq_(320),
+ isObjectLike = _dereq_(299),
+ isTypedArray = _dereq_(323),
+ keys = _dereq_(326);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));
+ if (!isSrcArr) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+ }
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((isSrcArr || result !== undefined) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+}
+
+module.exports = baseMerge;
+
+},{"221":221,"255":255,"291":291,"293":293,"299":299,"316":316,"320":320,"323":323,"326":326}],255:[function(_dereq_,module,exports){
+var arrayCopy = _dereq_(220),
+ isArguments = _dereq_(315),
+ isArray = _dereq_(316),
+ isArrayLike = _dereq_(293),
+ isPlainObject = _dereq_(321),
+ isTypedArray = _dereq_(323),
+ toPlainObject = _dereq_(324);
+
+/**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+}
+
+module.exports = baseMergeDeep;
+
+},{"220":220,"293":293,"315":315,"316":316,"321":321,"323":323,"324":324}],256:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+module.exports = baseProperty;
+
+},{}],257:[function(_dereq_,module,exports){
+var baseGet = _dereq_(244),
+ toPath = _dereq_(313);
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+},{"244":244,"313":313}],258:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+}
+
+module.exports = baseReduce;
+
+},{}],259:[function(_dereq_,module,exports){
+var identity = _dereq_(335),
+ metaMap = _dereq_(302);
+
+/**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+};
+
+module.exports = baseSetData;
+
+},{"302":302,"335":335}],260:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
+
+},{}],261:[function(_dereq_,module,exports){
+var baseEach = _dereq_(235);
+
+/**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+}
+
+module.exports = baseSome;
+
+},{"235":235}],262:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.sortBy` which uses `comparer` to define
+ * the sort order of `array` and replaces criteria objects with their
+ * corresponding values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */
+function baseSortBy(array, comparer) {
+ var length = array.length;
+
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+}
+
+module.exports = baseSortBy;
+
+},{}],263:[function(_dereq_,module,exports){
+/**
+ * Converts `value` to a string if it is not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
+
+},{}],264:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(245),
+ cacheIndexOf = _dereq_(267),
+ createCache = _dereq_(277);
+
+/**
+ * The base implementation of `_.uniq` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+function baseUniq(array, iteratee) {
+ var index = -1,
+ indexOf = baseIndexOf,
+ length = array.length,
+ isCommon = true,
+ isLarge = isCommon && length >= 200,
+ seen = isLarge ? createCache() : null,
+ result = [];
+
+ if (seen) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ } else {
+ isLarge = false;
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (isCommon && value === value) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (indexOf(seen, computed, 0) < 0) {
+ if (iteratee || isLarge) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseUniq;
+
+},{"245":245,"267":267,"277":277}],265:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
+
+},{}],266:[function(_dereq_,module,exports){
+var identity = _dereq_(335);
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
+
+},{"335":335}],267:[function(_dereq_,module,exports){
+var isObject = _dereq_(320);
+
+/**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+}
+
+module.exports = cacheIndexOf;
+
+},{"320":320}],268:[function(_dereq_,module,exports){
+var isObject = _dereq_(320);
+
+/**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+}
+
+module.exports = cachePush;
+
+},{"320":320}],269:[function(_dereq_,module,exports){
+var baseCompareAscending = _dereq_(230);
+
+/**
+ * Used by `_.sortBy` to compare transformed elements of a collection and stable
+ * sort them in ascending order.
+ *
+ * @private
+ * @param {Object} object The object to compare to `other`.
+ * @param {Object} other The object to compare to `object`.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+function compareAscending(object, other) {
+ return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
+}
+
+module.exports = compareAscending;
+
+},{"230":230}],270:[function(_dereq_,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgs;
+
+},{}],271:[function(_dereq_,module,exports){
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgsRight;
+
+},{}],272:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(229),
+ baseEach = _dereq_(235),
+ isArray = _dereq_(316);
+
+/**
+ * Creates a function that aggregates a collection, creating an accumulator
+ * object composed from the results of running each element in the collection
+ * through an iteratee.
+ *
+ * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
+ * and `_.partition`.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+}
+
+module.exports = createAggregator;
+
+},{"229":229,"235":235,"316":316}],273:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(266),
+ isIterateeCall = _dereq_(295),
+ restParam = _dereq_(216);
+
+/**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 && sources[length - 2],
+ guard = length > 2 && sources[2],
+ thisArg = length > 1 && sources[length - 1];
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : null;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? null : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+}
+
+module.exports = createAssigner;
+
+},{"216":216,"266":266,"295":295}],274:[function(_dereq_,module,exports){
+var getLength = _dereq_(290),
+ isLength = _dereq_(298),
+ toObject = _dereq_(312);
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
+
+},{"290":290,"298":298,"312":312}],275:[function(_dereq_,module,exports){
+var toObject = _dereq_(312);
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
+
+},{"312":312}],276:[function(_dereq_,module,exports){
+(function (global){
+var createCtorWrapper = _dereq_(278);
+
+/**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+}
+
+module.exports = createBindWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"278":278}],277:[function(_dereq_,module,exports){
+(function (global){
+var SetCache = _dereq_(219),
+ constant = _dereq_(334),
+ isNative = _dereq_(318);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
+ return new SetCache(values);
+};
+
+module.exports = createCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"219":219,"318":318,"334":334}],278:[function(_dereq_,module,exports){
+var baseCreate = _dereq_(232),
+ isObject = _dereq_(320);
+
+/**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createCtorWrapper(Ctor) {
+ return function() {
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, arguments);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+}
+
+module.exports = createCtorWrapper;
+
+},{"232":232,"320":320}],279:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(229),
+ baseFind = _dereq_(238),
+ baseFindIndex = _dereq_(239),
+ isArray = _dereq_(316);
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
+
+},{"229":229,"238":238,"239":239,"316":316}],280:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(266),
+ isArray = _dereq_(316);
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
+
+},{"266":266,"316":316}],281:[function(_dereq_,module,exports){
+(function (global){
+var arrayCopy = _dereq_(220),
+ composeArgs = _dereq_(270),
+ composeArgsRight = _dereq_(271),
+ createCtorWrapper = _dereq_(278),
+ isLaziable = _dereq_(297),
+ reorder = _dereq_(306),
+ replaceHolders = _dereq_(307),
+ setData = _dereq_(308);
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG;
+
+ var Ctor = !isBindKey && createCtorWrapper(func),
+ key = func;
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : null,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : null,
+ newHoldersRight = isCurry ? null : argsHolders,
+ newPartials = isCurry ? args : null,
+ newPartialsRight = isCurry ? null : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this;
+ if (isBindKey) {
+ func = thisBinding[key];
+ }
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ var fn = (this && this !== global && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+}
+
+module.exports = createHybridWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"220":220,"270":270,"271":271,"278":278,"297":297,"306":306,"307":307,"308":308}],282:[function(_dereq_,module,exports){
+(function (global){
+var createCtorWrapper = _dereq_(278);
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1;
+
+/**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+}
+
+module.exports = createPartialWrapper;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"278":278}],283:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(229),
+ baseReduce = _dereq_(258),
+ isArray = _dereq_(316);
+
+/**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+}
+
+module.exports = createReduce;
+
+},{"229":229,"258":258,"316":316}],284:[function(_dereq_,module,exports){
+var baseSetData = _dereq_(259),
+ createBindWrapper = _dereq_(276),
+ createHybridWrapper = _dereq_(281),
+ createPartialWrapper = _dereq_(282),
+ getData = _dereq_(288),
+ mergeData = _dereq_(301),
+ setData = _dereq_(308);
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = null;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = null;
+ }
+ var data = isBindKey ? null : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+}
+
+module.exports = createWrapper;
+
+},{"259":259,"276":276,"281":281,"282":282,"288":288,"301":301,"308":308}],285:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length,
+ result = true;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (result && ++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, arrValue, index)
+ : customizer(arrValue, othValue, index);
+ }
+ if (result === undefined) {
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ var othIndex = othLength;
+ while (othIndex--) {
+ othValue = other[othIndex];
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ if (result) {
+ break;
+ }
+ }
+ } else {
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ }
+ return !!result;
+}
+
+module.exports = equalArrays;
+
+},{}],286:[function(_dereq_,module,exports){
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} value The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+},{}],287:[function(_dereq_,module,exports){
+var keys = _dereq_(326);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var skipCtor = isLoose,
+ index = -1;
+
+ while (++index < objLength) {
+ var key = objProps[index],
+ result = isLoose ? key in other : hasOwnProperty.call(other, key);
+
+ if (result) {
+ var objValue = object[key],
+ othValue = other[key];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, objValue, key)
+ : customizer(objValue, othValue, key);
+ }
+ if (result === undefined) {
+ // Recursively compare objects (susceptible to call stack limits).
+ result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
+
+},{"326":326}],288:[function(_dereq_,module,exports){
+var metaMap = _dereq_(302),
+ noop = _dereq_(336);
+
+/**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+};
+
+module.exports = getData;
+
+},{"302":302,"336":336}],289:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(256),
+ constant = _dereq_(334),
+ realNames = _dereq_(305),
+ support = _dereq_(333);
+
+/**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+var getFuncName = (function() {
+ if (!support.funcNames) {
+ return constant('');
+ }
+ if (constant.name == 'constant') {
+ return baseProperty('name');
+ }
+ return function(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+ };
+}());
+
+module.exports = getFuncName;
+
+},{"256":256,"305":305,"333":333,"334":334}],290:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(256);
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
+
+},{"256":256}],291:[function(_dereq_,module,exports){
+var constant = _dereq_(334),
+ isNative = _dereq_(318),
+ toObject = _dereq_(312);
+
+/** Native method references. */
+var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
+ return getOwnPropertySymbols(toObject(object));
+};
+
+module.exports = getSymbols;
+
+},{"312":312,"318":318,"334":334}],292:[function(_dereq_,module,exports){
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
+
+},{}],293:[function(_dereq_,module,exports){
+var getLength = _dereq_(290),
+ isLength = _dereq_(298);
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
+
+},{"290":290,"298":298}],294:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = +value;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
+
+},{}],295:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(293),
+ isIndex = _dereq_(294),
+ isObject = _dereq_(320);
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+},{"293":293,"294":294,"320":320}],296:[function(_dereq_,module,exports){
+var isArray = _dereq_(316),
+ toObject = _dereq_(312);
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
+
+},{"312":312,"316":316}],297:[function(_dereq_,module,exports){
+var LazyWrapper = _dereq_(217),
+ getFuncName = _dereq_(289),
+ lodash = _dereq_(200);
+
+/**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+function isLaziable(func) {
+ var funcName = getFuncName(func);
+ return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
+}
+
+module.exports = isLaziable;
+
+},{"200":200,"217":217,"289":289}],298:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+},{}],299:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+},{}],300:[function(_dereq_,module,exports){
+var isObject = _dereq_(320);
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+},{"320":320}],301:[function(_dereq_,module,exports){
+var arrayCopy = _dereq_(220),
+ composeArgs = _dereq_(270),
+ composeArgsRight = _dereq_(271),
+ replaceHolders = _dereq_(307);
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+}
+
+module.exports = mergeData;
+
+},{"220":220,"270":270,"271":271,"307":307}],302:[function(_dereq_,module,exports){
+(function (global){
+var isNative = _dereq_(318);
+
+/** Native method references. */
+var WeakMap = isNative(WeakMap = global.WeakMap) && WeakMap;
+
+/** Used to store function metadata. */
+var metaMap = WeakMap && new WeakMap;
+
+module.exports = metaMap;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"318":318}],303:[function(_dereq_,module,exports){
+var toObject = _dereq_(312);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+
+module.exports = pickByArray;
+
+},{"312":312}],304:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(242);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+}
+
+module.exports = pickByCallback;
+
+},{"242":242}],305:[function(_dereq_,module,exports){
+/** Used to lookup unminified function names. */
+var realNames = {};
+
+module.exports = realNames;
+
+},{}],306:[function(_dereq_,module,exports){
+var arrayCopy = _dereq_(220),
+ isIndex = _dereq_(294);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+}
+
+module.exports = reorder;
+
+},{"220":220,"294":294}],307:[function(_dereq_,module,exports){
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+}
+
+module.exports = replaceHolders;
+
+},{}],308:[function(_dereq_,module,exports){
+var baseSetData = _dereq_(259),
+ now = _dereq_(212);
+
+/** Used to detect when a function becomes hot. */
+var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+/**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+}());
+
+module.exports = setData;
+
+},{"212":212,"259":259}],309:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(242),
+ isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+function shimIsPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = shimIsPlainObject;
+
+},{"242":242,"299":299}],310:[function(_dereq_,module,exports){
+var isArguments = _dereq_(315),
+ isArray = _dereq_(316),
+ isIndex = _dereq_(294),
+ isLength = _dereq_(298),
+ keysIn = _dereq_(327),
+ support = _dereq_(333);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object)));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
+
+},{"294":294,"298":298,"315":315,"316":316,"327":327,"333":333}],311:[function(_dereq_,module,exports){
+/**
+ * An implementation of `_.uniq` optimized for sorted arrays without support
+ * for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+function sortedUniq(array, iteratee) {
+ var seen,
+ index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (!index || seen !== computed) {
+ seen = computed;
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = sortedUniq;
+
+},{}],312:[function(_dereq_,module,exports){
+var isObject = _dereq_(320);
+
+/**
+ * Converts `value` to an object if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
+
+},{"320":320}],313:[function(_dereq_,module,exports){
+var baseToString = _dereq_(263),
+ isArray = _dereq_(316);
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
+
+},{"263":263,"316":316}],314:[function(_dereq_,module,exports){
+var LazyWrapper = _dereq_(217),
+ LodashWrapper = _dereq_(218),
+ arrayCopy = _dereq_(220);
+
+/**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+}
+
+module.exports = wrapperClone;
+
+},{"217":217,"218":218,"220":220}],315:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(293),
+ isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+}
+
+module.exports = isArguments;
+
+},{"293":293,"299":299}],316:[function(_dereq_,module,exports){
+var isLength = _dereq_(298),
+ isNative = _dereq_(318),
+ isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
+
+},{"298":298,"299":299,"318":318}],317:[function(_dereq_,module,exports){
+(function (global){
+var baseIsFunction = _dereq_(248),
+ isNative = _dereq_(318);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+};
+
+module.exports = isFunction;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"248":248,"318":318}],318:[function(_dereq_,module,exports){
+var escapeRegExp = _dereq_(332),
+ isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(objToString)
+ .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+module.exports = isNative;
+
+},{"299":299,"332":332}],319:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+}
+
+module.exports = isNumber;
+
+},{"299":299}],320:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return type == 'function' || (!!value && type == 'object');
+}
+
+module.exports = isObject;
+
+},{}],321:[function(_dereq_,module,exports){
+var isNative = _dereq_(318),
+ shimIsPlainObject = _dereq_(309);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = value.valueOf,
+ objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+};
+
+module.exports = isPlainObject;
+
+},{"309":309,"318":318}],322:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
+
+},{"299":299}],323:[function(_dereq_,module,exports){
+var isLength = _dereq_(298),
+ isObjectLike = _dereq_(299);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
+
+},{"298":298,"299":299}],324:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(231),
+ keysIn = _dereq_(327);
+
+/**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+}
+
+module.exports = toPlainObject;
+
+},{"231":231,"327":327}],325:[function(_dereq_,module,exports){
+var assignWith = _dereq_(227),
+ baseAssign = _dereq_(228),
+ createAssigner = _dereq_(273);
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+});
+
+module.exports = assign;
+
+},{"227":227,"228":228,"273":273}],326:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(293),
+ isNative = _dereq_(318),
+ isObject = _dereq_(320),
+ shimKeys = _dereq_(310);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object != null && object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
+
+},{"293":293,"310":310,"318":318,"320":320}],327:[function(_dereq_,module,exports){
+var isArguments = _dereq_(315),
+ isArray = _dereq_(316),
+ isIndex = _dereq_(294),
+ isLength = _dereq_(298),
+ isObject = _dereq_(320),
+ support = _dereq_(333);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"294":294,"298":298,"315":315,"316":316,"320":320,"333":333}],328:[function(_dereq_,module,exports){
+var baseMerge = _dereq_(254),
+ createAssigner = _dereq_(273);
+
+/**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+var merge = createAssigner(baseMerge);
+
+module.exports = merge;
+
+},{"254":254,"273":273}],329:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(224),
+ baseDifference = _dereq_(234),
+ baseFlatten = _dereq_(240),
+ bindCallback = _dereq_(266),
+ keysIn = _dereq_(327),
+ pickByArray = _dereq_(303),
+ pickByCallback = _dereq_(304),
+ restParam = _dereq_(216);
+
+/**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+});
+
+module.exports = omit;
+
+},{"216":216,"224":224,"234":234,"240":240,"266":266,"303":303,"304":304,"327":327}],330:[function(_dereq_,module,exports){
+var baseFlatten = _dereq_(240),
+ bindCallback = _dereq_(266),
+ pickByArray = _dereq_(303),
+ pickByCallback = _dereq_(304),
+ restParam = _dereq_(216);
+
+/**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+});
+
+module.exports = pick;
+
+},{"216":216,"240":240,"266":266,"303":303,"304":304}],331:[function(_dereq_,module,exports){
+var baseValues = _dereq_(265),
+ keys = _dereq_(326);
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
+
+},{"265":265,"326":326}],332:[function(_dereq_,module,exports){
+var baseToString = _dereq_(263);
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = escapeRegExp;
+
+},{"263":263}],333:[function(_dereq_,module,exports){
+(function (global){
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to detect DOM support. */
+var document = (document = global.window) && document.document;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ args = arguments,
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if functions can be decompiled by `Function#toString`
+ * (all but Firefox OS certified apps, older Opera mobile browsers, and
+ * the PlayStation 3; forced `false` for Windows 8 apps).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcDecomp = /\bthis\b/.test(function() { return this; });
+
+ /**
+ * Detect if `Function#name` is supported (all but IE).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcNames = typeof Function.name == 'string';
+
+ /**
+ * Detect if the DOM is supported.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.dom = document.createDocumentFragment().nodeType === 11;
+ } catch(e) {
+ support.dom = false;
+ }
+
+ /**
+ * Detect if `arguments` object indexes are non-enumerable.
+ *
+ * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object
+ * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat
+ * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`
+ * checks for indexes that exceed the number of function parameters and
+ * whose associated argument values are `0`.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
+ } catch(e) {
+ support.nonEnumArgs = true;
+ }
+}(1, 0));
+
+module.exports = support;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],334:[function(_dereq_,module,exports){
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+function constant(value) {
+ return function() {
+ return value;
+ };
+}
+
+module.exports = constant;
+
+},{}],335:[function(_dereq_,module,exports){
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+},{}],336:[function(_dereq_,module,exports){
+/**
+ * A no-operation function which returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
+
+},{}],337:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(256),
+ basePropertyDeep = _dereq_(257),
+ isKey = _dereq_(296);
+
+/**
+ * Creates a function which returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+},{"256":256,"257":257,"296":296}],338:[function(_dereq_,module,exports){
+/**
+ * Set attribute `name` to `val`, or get attr `name`.
+ *
+ * @param {Element} el
+ * @param {String} name
+ * @param {String} [val]
+ * @api public
+ */
+
+module.exports = function(el, name, val) {
+ // get
+ if (arguments.length == 2) {
+ return el.getAttribute(name);
+ }
+
+ // remove
+ if (val === null) {
+ return el.removeAttribute(name);
+ }
+
+ // set
+ el.setAttribute(name, val);
+
+ return el;
+};
+},{}],339:[function(_dereq_,module,exports){
+module.exports = _dereq_(348);
+},{"348":348}],340:[function(_dereq_,module,exports){
+module.exports = function(el) {
+
+ var c;
+
+ while (el.childNodes.length) {
+ c = el.childNodes[0];
+ el.removeChild(c);
+ }
+
+ return el;
+};
+},{}],341:[function(_dereq_,module,exports){
+module.exports = _dereq_(350);
+},{"350":350}],342:[function(_dereq_,module,exports){
+module.exports = _dereq_(351);
+},{"351":351}],343:[function(_dereq_,module,exports){
+module.exports = _dereq_(355);
+},{"355":355}],344:[function(_dereq_,module,exports){
+module.exports = _dereq_(352);
+},{"352":352}],345:[function(_dereq_,module,exports){
+module.exports = _dereq_(353);
+},{"353":353}],346:[function(_dereq_,module,exports){
+module.exports = _dereq_(354);
+},{"354":354}],347:[function(_dereq_,module,exports){
+module.exports = function(el) {
+ el.parentNode && el.parentNode.removeChild(el);
+};
+},{}],348:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var index = _dereq_(349);
+
+/**
+ * Whitespace regexp.
+ */
+
+var re = /\s+/;
+
+/**
+ * toString reference.
+ */
+
+var toString = Object.prototype.toString;
+
+/**
+ * Wrap `el` in a `ClassList`.
+ *
+ * @param {Element} el
+ * @return {ClassList}
+ * @api public
+ */
+
+module.exports = function(el){
+ return new ClassList(el);
+};
+
+/**
+ * Initialize a new ClassList for `el`.
+ *
+ * @param {Element} el
+ * @api private
+ */
+
+function ClassList(el) {
+ if (!el || !el.nodeType) {
+ throw new Error('A DOM element reference is required');
+ }
+ this.el = el;
+ this.list = el.classList;
+}
+
+/**
+ * Add class `name` if not already present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.add = function(name){
+ // classList
+ if (this.list) {
+ this.list.add(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (!~i) arr.push(name);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove class `name` when present, or
+ * pass a regular expression to remove
+ * any which match.
+ *
+ * @param {String|RegExp} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.remove = function(name){
+ if ('[object RegExp]' == toString.call(name)) {
+ return this.removeMatching(name);
+ }
+
+ // classList
+ if (this.list) {
+ this.list.remove(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (~i) arr.splice(i, 1);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove all classes matching `re`.
+ *
+ * @param {RegExp} re
+ * @return {ClassList}
+ * @api private
+ */
+
+ClassList.prototype.removeMatching = function(re){
+ var arr = this.array();
+ for (var i = 0; i < arr.length; i++) {
+ if (re.test(arr[i])) {
+ this.remove(arr[i]);
+ }
+ }
+ return this;
+};
+
+/**
+ * Toggle class `name`, can force state via `force`.
+ *
+ * For browsers that support classList, but do not support `force` yet,
+ * the mistake will be detected and corrected.
+ *
+ * @param {String} name
+ * @param {Boolean} force
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.toggle = function(name, force){
+ // classList
+ if (this.list) {
+ if ("undefined" !== typeof force) {
+ if (force !== this.list.toggle(name, force)) {
+ this.list.toggle(name); // toggle again to correct
+ }
+ } else {
+ this.list.toggle(name);
+ }
+ return this;
+ }
+
+ // fallback
+ if ("undefined" !== typeof force) {
+ if (!force) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ } else {
+ if (this.has(name)) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an array of classes.
+ *
+ * @return {Array}
+ * @api public
+ */
+
+ClassList.prototype.array = function(){
+ var className = this.el.getAttribute('class') || '';
+ var str = className.replace(/^\s+|\s+$/g, '');
+ var arr = str.split(re);
+ if ('' === arr[0]) arr.shift();
+ return arr;
+};
+
+/**
+ * Check if class `name` is present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.has =
+ClassList.prototype.contains = function(name){
+ return this.list
+ ? this.list.contains(name)
+ : !! ~index(this.array(), name);
+};
+
+},{"349":349}],349:[function(_dereq_,module,exports){
+module.exports = function(arr, obj){
+ if (arr.indexOf) return arr.indexOf(obj);
+ for (var i = 0; i < arr.length; ++i) {
+ if (arr[i] === obj) return i;
+ }
+ return -1;
+};
+},{}],350:[function(_dereq_,module,exports){
+var matches = _dereq_(353)
+
+module.exports = function (element, selector, checkYoSelf, root) {
+ element = checkYoSelf ? {parentNode: element} : element
+
+ root = root || document
+
+ // Make sure `element !== document` and `element != null`
+ // otherwise we get an illegal invocation
+ while ((element = element.parentNode) && element !== document) {
+ if (matches(element, selector))
+ return element
+ // After `matches` on the edge case that
+ // the selector matches the root
+ // (when the root is not the document)
+ if (element === root)
+ return
+ }
+}
+
+},{"353":353}],351:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var closest = _dereq_(350)
+ , event = _dereq_(352);
+
+/**
+ * Delegate event `type` to `selector`
+ * and invoke `fn(e)`. A callback function
+ * is returned which may be passed to `.unbind()`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, selector, type, fn, capture){
+ return event.bind(el, type, function(e){
+ var target = e.target || e.srcElement;
+ e.delegateTarget = closest(target, selector, true, el);
+ if (e.delegateTarget) fn.call(el, e);
+ }, capture);
+};
+
+/**
+ * Unbind event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ event.unbind(el, type, fn, capture);
+};
+
+},{"350":350,"352":352}],352:[function(_dereq_,module,exports){
+var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
+ unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
+ prefix = bind !== 'addEventListener' ? 'on' : '';
+
+/**
+ * Bind `el` event `type` to `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, type, fn, capture){
+ el[bind](prefix + type, fn, capture || false);
+ return fn;
+};
+
+/**
+ * Unbind `el` event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ el[unbind](prefix + type, fn, capture || false);
+ return fn;
+};
+},{}],353:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var query = _dereq_(354);
+
+/**
+ * Element prototype.
+ */
+
+var proto = Element.prototype;
+
+/**
+ * Vendor function.
+ */
+
+var vendor = proto.matches
+ || proto.webkitMatchesSelector
+ || proto.mozMatchesSelector
+ || proto.msMatchesSelector
+ || proto.oMatchesSelector;
+
+/**
+ * Expose `match()`.
+ */
+
+module.exports = match;
+
+/**
+ * Match `el` to `selector`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @return {Boolean}
+ * @api public
+ */
+
+function match(el, selector) {
+ if (!el || el.nodeType !== 1) return false;
+ if (vendor) return vendor.call(el, selector);
+ var nodes = query.all(selector, el.parentNode);
+ for (var i = 0; i < nodes.length; ++i) {
+ if (nodes[i] == el) return true;
+ }
+ return false;
+}
+
+},{"354":354}],354:[function(_dereq_,module,exports){
+function one(selector, el) {
+ return el.querySelector(selector);
+}
+
+exports = module.exports = function(selector, el){
+ el = el || document;
+ return one(selector, el);
+};
+
+exports.all = function(selector, el){
+ el = el || document;
+ return el.querySelectorAll(selector);
+};
+
+exports.engine = function(obj){
+ if (!obj.one) throw new Error('.one callback required');
+ if (!obj.all) throw new Error('.all callback required');
+ one = obj.one;
+ exports.all = obj.all;
+ return exports;
+};
+
+},{}],355:[function(_dereq_,module,exports){
+
+/**
+ * Expose `parse`.
+ */
+
+module.exports = parse;
+
+/**
+ * Tests for browser support.
+ */
+
+var div = document.createElement('div');
+// Setup
+div.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
+// Make sure that link elements get serialized correctly by innerHTML
+// This requires a wrapper element in IE
+var innerHTMLBug = !div.getElementsByTagName('link').length;
+div = undefined;
+
+/**
+ * Wrap map from jquery.
+ */
+
+var map = {
+ legend: [1, '<fieldset>', '</fieldset>'],
+ tr: [2, '<table><tbody>', '</tbody></table>'],
+ col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
+ // for script/link/style tags to work in IE6-8, you have to wrap
+ // in a div with a non-whitespace character in front, ha!
+ _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
+};
+
+map.td =
+map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
+
+map.option =
+map.optgroup = [1, '<select multiple="multiple">', '</select>'];
+
+map.thead =
+map.tbody =
+map.colgroup =
+map.caption =
+map.tfoot = [1, '<table>', '</table>'];
+
+map.polyline =
+map.ellipse =
+map.polygon =
+map.circle =
+map.text =
+map.line =
+map.path =
+map.rect =
+map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
+
+/**
+ * Parse `html` and return a DOM Node instance, which could be a TextNode,
+ * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
+ * instance, depending on the contents of the `html` string.
+ *
+ * @param {String} html - HTML string to "domify"
+ * @param {Document} doc - The `document` instance to create the Node for
+ * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
+ * @api private
+ */
+
+function parse(html, doc) {
+ if ('string' != typeof html) throw new TypeError('String expected');
+
+ // default to the global `document` object
+ if (!doc) doc = document;
+
+ // tag name
+ var m = /<([\w:]+)/.exec(html);
+ if (!m) return doc.createTextNode(html);
+
+ html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
+
+ var tag = m[1];
+
+ // body support
+ if (tag == 'body') {
+ var el = doc.createElement('html');
+ el.innerHTML = html;
+ return el.removeChild(el.lastChild);
+ }
+
+ // wrap map
+ var wrap = map[tag] || map._default;
+ var depth = wrap[0];
+ var prefix = wrap[1];
+ var suffix = wrap[2];
+ var el = doc.createElement('div');
+ el.innerHTML = prefix + html + suffix;
+ while (depth--) el = el.lastChild;
+
+ // one element
+ if (el.firstChild == el.lastChild) {
+ return el.removeChild(el.firstChild);
+ }
+
+ // several elements
+ var fragment = doc.createDocumentFragment();
+ while (el.firstChild) {
+ fragment.appendChild(el.removeChild(el.firstChild));
+ }
+
+ return fragment;
+}
+
+},{}],356:[function(_dereq_,module,exports){
+module.exports = _dereq_(358);
+
+module.exports.Collection = _dereq_(357);
+},{"357":357,"358":358}],357:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * An empty collection stub. Use {@link RefsCollection.extend} to extend a
+ * collection with ref semantics.
+ *
+ * @classdesc A change and inverse-reference aware collection with set semantics.
+ *
+ * @class RefsCollection
+ */
+function RefsCollection() { }
+
+/**
+ * Extends a collection with {@link Refs} aware methods
+ *
+ * @memberof RefsCollection
+ * @static
+ *
+ * @param {Array<Object>} collection
+ * @param {Refs} refs instance
+ * @param {Object} property represented by the collection
+ * @param {Object} target object the collection is attached to
+ *
+ * @return {RefsCollection<Object>} the extended array
+ */
+function extend(collection, refs, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ /**
+ * Removes the given element from the array and returns it.
+ *
+ * @method RefsCollection#remove
+ *
+ * @param {Object} element the element to remove
+ */
+ collection.remove = function(element) {
+ var idx = this.indexOf(element);
+ if (idx !== -1) {
+ this.splice(idx, 1);
+
+ // unset inverse
+ refs.unset(element, inverseProperty, target);
+ }
+
+ return element;
+ };
+
+ /**
+ * Returns true if the collection contains the given element
+ *
+ * @method RefsCollection#contains
+ *
+ * @param {Object} element the element to check for
+ */
+ collection.contains = function(element) {
+ return this.indexOf(element) !== -1;
+ };
+
+ /**
+ * Adds an element to the array, unless it exists already (set semantics).
+ *
+ * @method RefsCollection#add
+ *
+ * @param {Object} element the element to add
+ */
+ collection.add = function(element) {
+
+ if (!this.contains(element)) {
+ this.push(element);
+
+ // set inverse
+ refs.set(element, inverseProperty, target);
+ }
+ };
+
+ return collection;
+}
+
+
+module.exports.extend = extend;
+},{}],358:[function(_dereq_,module,exports){
+'use strict';
+
+var Collection = _dereq_(357);
+
+function hasOwnProperty(e, property) {
+ return Object.prototype.hasOwnProperty.call(e, property.name || property);
+}
+
+
+function defineCollectionProperty(ref, property, target) {
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+ value: Collection.extend(target[property.name] || [], ref, property, target)
+ });
+}
+
+
+function defineProperty(ref, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ var _value = target[property.name];
+
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+
+ get: function() {
+ return _value;
+ },
+
+ set: function(value) {
+
+ // return if we already performed all changes
+ if (value === _value) {
+ return;
+ }
+
+ var old = _value;
+
+ // temporary set null
+ _value = null;
+
+ if (old) {
+ ref.unset(old, inverseProperty, target);
+ }
+
+ // set new value
+ _value = value;
+
+ // set inverse value
+ ref.set(_value, inverseProperty, target);
+ }
+ });
+
+}
+
+/**
+ * Creates a new references object defining two inversly related
+ * attribute descriptors a and b.
+ *
+ * <p>
+ * When bound to an object using {@link Refs#bind} the references
+ * get activated and ensure that add and remove operations are applied
+ * reversely, too.
+ * </p>
+ *
+ * <p>
+ * For attributes represented as collections {@link Refs} provides the
+ * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions
+ * that must be used to properly hook into the inverse change mechanism.
+ * </p>
+ *
+ * @class Refs
+ *
+ * @classdesc A bi-directional reference between two attributes.
+ *
+ * @param {Refs.AttributeDescriptor} a property descriptor
+ * @param {Refs.AttributeDescriptor} b property descriptor
+ *
+ * @example
+ *
+ * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });
+ *
+ * var car = { name: 'toyota' };
+ * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];
+ *
+ * refs.bind(car, 'wheels');
+ *
+ * car.wheels // []
+ * car.wheels.add(wheels[0]);
+ * car.wheels.add(wheels[1]);
+ *
+ * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
+ *
+ * wheels[0].car // { name: 'toyota' };
+ * car.wheels.remove(wheels[0]);
+ *
+ * wheels[0].car // undefined
+ */
+function Refs(a, b) {
+
+ if (!(this instanceof Refs)) {
+ return new Refs(a, b);
+ }
+
+ // link
+ a.inverse = b;
+ b.inverse = a;
+
+ this.props = {};
+ this.props[a.name] = a;
+ this.props[b.name] = b;
+}
+
+/**
+ * Binds one side of a bi-directional reference to a
+ * target object.
+ *
+ * @memberOf Refs
+ *
+ * @param {Object} target
+ * @param {String} property
+ */
+Refs.prototype.bind = function(target, property) {
+ if (typeof property === 'string') {
+ if (!this.props[property]) {
+ throw new Error('no property <' + property + '> in ref');
+ }
+ property = this.props[property];
+ }
+
+ if (property.collection) {
+ defineCollectionProperty(this, property, target);
+ } else {
+ defineProperty(this, property, target);
+ }
+};
+
+Refs.prototype.ensureBound = function(target, property) {
+ if (!hasOwnProperty(target, property)) {
+ this.bind(target, property);
+ }
+};
+
+Refs.prototype.unset = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].remove(value);
+ } else {
+ target[property.name] = undefined;
+ }
+ }
+};
+
+Refs.prototype.set = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].add(value);
+ } else {
+ target[property.name] = value;
+ }
+ }
+};
+
+module.exports = Refs;
+
+
+/**
+ * An attribute descriptor to be used specify an attribute in a {@link Refs} instance
+ *
+ * @typedef {Object} Refs.AttributeDescriptor
+ * @property {String} name
+ * @property {boolean} [collection=false]
+ * @property {boolean} [enumerable=false]
+ */
+},{"357":357}]},{},[1])(1)
+});
+//# sourceMappingURL=bpmn-modeler.js.map \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js.map b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js.map
new file mode 100644
index 0000000..b3d93bd
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","lib/Modeler.js","lib/Viewer.js","lib/core/index.js","lib/draw/BpmnRenderer.js","lib/draw/PathMap.js","lib/draw/index.js","lib/features/context-pad/ContextPadProvider.js","lib/features/context-pad/index.js","lib/features/keyboard/BpmnKeyBindings.js","lib/features/keyboard/index.js","lib/features/label-editing/LabelEditingProvider.js","lib/features/label-editing/LabelUtil.js","lib/features/label-editing/cmd/UpdateLabelHandler.js","lib/features/label-editing/index.js","lib/features/modeling/BpmnFactory.js","lib/features/modeling/BpmnLayouter.js","lib/features/modeling/BpmnUpdater.js","lib/features/modeling/ElementFactory.js","lib/features/modeling/LabelSupport.js","lib/features/modeling/Modeling.js","lib/features/modeling/ModelingUtil.js","lib/features/modeling/behavior/AppendBehavior.js","lib/features/modeling/behavior/CreateBehavior.js","lib/features/modeling/behavior/DropBehavior.js","lib/features/modeling/behavior/ModelingFeedback.js","lib/features/modeling/behavior/RemoveBehavior.js","lib/features/modeling/behavior/index.js","lib/features/modeling/cmd/UpdateCanvasRootHandler.js","lib/features/modeling/cmd/UpdatePropertiesHandler.js","lib/features/modeling/index.js","lib/features/modeling/rules/BpmnRules.js","lib/features/modeling/rules/index.js","lib/features/palette/PaletteProvider.js","lib/features/palette/index.js","lib/features/replace/BpmnReplace.js","lib/features/replace/ReplaceOptions.js","lib/features/replace/index.js","lib/features/snapping/BpmnSnapping.js","lib/features/snapping/index.js","lib/import/BpmnImporter.js","lib/import/BpmnTreeWalker.js","lib/import/Importer.js","lib/import/Util.js","lib/import/index.js","lib/util/DiUtil.js","lib/util/LabelUtil.js","lib/util/ModelUtil.js","node_modules/bpmn-moddle/index.js","node_modules/bpmn-moddle/lib/bpmn-moddle.js","node_modules/bpmn-moddle/lib/id-support.js","node_modules/bpmn-moddle/lib/simple.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/common.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/reader.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/writer.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/sax/lib/sax.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/tiny-stack/lib/tiny-stack.js","node_modules/bpmn-moddle/node_modules/moddle/index.js","node_modules/bpmn-moddle/node_modules/moddle/lib/base.js","node_modules/bpmn-moddle/node_modules/moddle/lib/descriptor-builder.js","node_modules/bpmn-moddle/node_modules/moddle/lib/factory.js","node_modules/bpmn-moddle/node_modules/moddle/lib/moddle.js","node_modules/bpmn-moddle/node_modules/moddle/lib/ns.js","node_modules/bpmn-moddle/node_modules/moddle/lib/properties.js","node_modules/bpmn-moddle/node_modules/moddle/lib/registry.js","node_modules/bpmn-moddle/node_modules/moddle/lib/types.js","node_modules/bpmn-moddle/resources/bpmn/json/bpmn.json","node_modules/bpmn-moddle/resources/bpmn/json/bpmndi.json","node_modules/bpmn-moddle/resources/bpmn/json/dc.json","node_modules/bpmn-moddle/resources/bpmn/json/di.json","node_modules/diagram-js-direct-editing/index.js","node_modules/diagram-js-direct-editing/lib/DirectEditing.js","node_modules/diagram-js-direct-editing/lib/TextBox.js","node_modules/diagram-js/index.js","node_modules/diagram-js/lib/Diagram.js","node_modules/diagram-js/lib/command/CommandInterceptor.js","node_modules/diagram-js/lib/command/CommandStack.js","node_modules/diagram-js/lib/command/index.js","node_modules/diagram-js/lib/core/Canvas.js","node_modules/diagram-js/lib/core/ElementFactory.js","node_modules/diagram-js/lib/core/ElementRegistry.js","node_modules/diagram-js/lib/core/EventBus.js","node_modules/diagram-js/lib/core/GraphicsFactory.js","node_modules/diagram-js/lib/core/index.js","node_modules/diagram-js/lib/draw/Renderer.js","node_modules/diagram-js/lib/draw/Styles.js","node_modules/diagram-js/lib/draw/index.js","node_modules/diagram-js/lib/features/bendpoints/BendpointMove.js","node_modules/diagram-js/lib/features/bendpoints/BendpointSnapping.js","node_modules/diagram-js/lib/features/bendpoints/Bendpoints.js","node_modules/diagram-js/lib/features/bendpoints/Util.js","node_modules/diagram-js/lib/features/bendpoints/index.js","node_modules/diagram-js/lib/features/change-support/ChangeSupport.js","node_modules/diagram-js/lib/features/change-support/index.js","node_modules/diagram-js/lib/features/connect/Connect.js","node_modules/diagram-js/lib/features/connect/index.js","node_modules/diagram-js/lib/features/context-pad/ContextPad.js","node_modules/diagram-js/lib/features/context-pad/index.js","node_modules/diagram-js/lib/features/create/Create.js","node_modules/diagram-js/lib/features/create/index.js","node_modules/diagram-js/lib/features/dragging/Dragging.js","node_modules/diagram-js/lib/features/dragging/index.js","node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js","node_modules/diagram-js/lib/features/interaction-events/index.js","node_modules/diagram-js/lib/features/keyboard/Keyboard.js","node_modules/diagram-js/lib/features/keyboard/index.js","node_modules/diagram-js/lib/features/lasso-tool/LassoTool.js","node_modules/diagram-js/lib/features/lasso-tool/index.js","node_modules/diagram-js/lib/features/modeling/Modeling.js","node_modules/diagram-js/lib/features/modeling/cmd/AppendShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateLabelHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteElementsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/LayoutConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveShapesHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/NoopHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ReconnectConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ReplaceShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ResizeShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/SpaceToolHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/UpdateAnchorsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/UpdateWaypointsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/helper/MoveHelper.js","node_modules/diagram-js/lib/features/modeling/index.js","node_modules/diagram-js/lib/features/move/Move.js","node_modules/diagram-js/lib/features/move/MoveVisuals.js","node_modules/diagram-js/lib/features/move/index.js","node_modules/diagram-js/lib/features/outline/Outline.js","node_modules/diagram-js/lib/features/outline/index.js","node_modules/diagram-js/lib/features/overlays/Overlays.js","node_modules/diagram-js/lib/features/overlays/index.js","node_modules/diagram-js/lib/features/palette/Palette.js","node_modules/diagram-js/lib/features/palette/index.js","node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js","node_modules/diagram-js/lib/features/popup-menu/index.js","node_modules/diagram-js/lib/features/replace/Replace.js","node_modules/diagram-js/lib/features/replace/index.js","node_modules/diagram-js/lib/features/resize/Resize.js","node_modules/diagram-js/lib/features/resize/ResizeUtil.js","node_modules/diagram-js/lib/features/resize/index.js","node_modules/diagram-js/lib/features/rules/RuleProvider.js","node_modules/diagram-js/lib/features/rules/Rules.js","node_modules/diagram-js/lib/features/rules/index.js","node_modules/diagram-js/lib/features/selection/Selection.js","node_modules/diagram-js/lib/features/selection/SelectionBehavior.js","node_modules/diagram-js/lib/features/selection/SelectionVisuals.js","node_modules/diagram-js/lib/features/selection/index.js","node_modules/diagram-js/lib/features/snapping/SnapContext.js","node_modules/diagram-js/lib/features/snapping/SnapUtil.js","node_modules/diagram-js/lib/features/snapping/Snapping.js","node_modules/diagram-js/lib/features/space-tool/SpaceTool.js","node_modules/diagram-js/lib/features/space-tool/SpaceToolVisuals.js","node_modules/diagram-js/lib/features/space-tool/SpaceUtil.js","node_modules/diagram-js/lib/features/space-tool/index.js","node_modules/diagram-js/lib/features/tooltips/Tooltips.js","node_modules/diagram-js/lib/features/tooltips/index.js","node_modules/diagram-js/lib/features/touch/TouchFix.js","node_modules/diagram-js/lib/features/touch/TouchInteractionEvents.js","node_modules/diagram-js/lib/features/touch/index.js","node_modules/diagram-js/lib/layout/BaseLayouter.js","node_modules/diagram-js/lib/layout/CroppingConnectionDocking.js","node_modules/diagram-js/lib/layout/LayoutUtil.js","node_modules/diagram-js/lib/layout/ManhattanLayout.js","node_modules/diagram-js/lib/model/index.js","node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js","node_modules/diagram-js/lib/navigation/movecanvas/index.js","node_modules/diagram-js/lib/navigation/touch/index.js","node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js","node_modules/diagram-js/lib/navigation/zoomscroll/index.js","node_modules/diagram-js/lib/util/ClickTrap.js","node_modules/diagram-js/lib/util/Collections.js","node_modules/diagram-js/lib/util/Cursor.js","node_modules/diagram-js/lib/util/Elements.js","node_modules/diagram-js/lib/util/Event.js","node_modules/diagram-js/lib/util/Geometry.js","node_modules/diagram-js/lib/util/GraphicsUtil.js","node_modules/diagram-js/lib/util/IdGenerator.js","node_modules/diagram-js/lib/util/Mouse.js","node_modules/diagram-js/lib/util/Platform.js","node_modules/diagram-js/lib/util/Text.js","node_modules/diagram-js/node_modules/eve/eve.js","node_modules/diagram-js/node_modules/hammerjs/hammer.js","node_modules/diagram-js/node_modules/snapsvg/dist/snap.svg.js","node_modules/diagram-js/vendor/snapsvg.js","node_modules/didi/lib/annotation.js","node_modules/didi/lib/index.js","node_modules/didi/lib/injector.js","node_modules/didi/lib/module.js","node_modules/ids/index.js","node_modules/ids/node_modules/hat/index.js","node_modules/inherits/inherits_browser.js","node_modules/lodash/array/flatten.js","node_modules/lodash/array/last.js","node_modules/lodash/array/uniq.js","node_modules/lodash/array/unique.js","node_modules/lodash/chain/lodash.js","node_modules/lodash/collection/every.js","node_modules/lodash/collection/filter.js","node_modules/lodash/collection/find.js","node_modules/lodash/collection/forEach.js","node_modules/lodash/collection/groupBy.js","node_modules/lodash/collection/includes.js","node_modules/lodash/collection/map.js","node_modules/lodash/collection/reduce.js","node_modules/lodash/collection/size.js","node_modules/lodash/collection/some.js","node_modules/lodash/collection/sortBy.js","node_modules/lodash/date/now.js","node_modules/lodash/function/bind.js","node_modules/lodash/function/debounce.js","node_modules/lodash/function/defer.js","node_modules/lodash/function/restParam.js","node_modules/lodash/internal/LazyWrapper.js","node_modules/lodash/internal/LodashWrapper.js","node_modules/lodash/internal/SetCache.js","node_modules/lodash/internal/arrayCopy.js","node_modules/lodash/internal/arrayEach.js","node_modules/lodash/internal/arrayEvery.js","node_modules/lodash/internal/arrayFilter.js","node_modules/lodash/internal/arrayMap.js","node_modules/lodash/internal/arrayReduce.js","node_modules/lodash/internal/arraySome.js","node_modules/lodash/internal/assignWith.js","node_modules/lodash/internal/baseAssign.js","node_modules/lodash/internal/baseCallback.js","node_modules/lodash/internal/baseCompareAscending.js","node_modules/lodash/internal/baseCopy.js","node_modules/lodash/internal/baseCreate.js","node_modules/lodash/internal/baseDelay.js","node_modules/lodash/internal/baseDifference.js","node_modules/lodash/internal/baseEach.js","node_modules/lodash/internal/baseEvery.js","node_modules/lodash/internal/baseFilter.js","node_modules/lodash/internal/baseFind.js","node_modules/lodash/internal/baseFindIndex.js","node_modules/lodash/internal/baseFlatten.js","node_modules/lodash/internal/baseFor.js","node_modules/lodash/internal/baseForIn.js","node_modules/lodash/internal/baseForOwn.js","node_modules/lodash/internal/baseGet.js","node_modules/lodash/internal/baseIndexOf.js","node_modules/lodash/internal/baseIsEqual.js","node_modules/lodash/internal/baseIsEqualDeep.js","node_modules/lodash/internal/baseIsFunction.js","node_modules/lodash/internal/baseIsMatch.js","node_modules/lodash/internal/baseLodash.js","node_modules/lodash/internal/baseMap.js","node_modules/lodash/internal/baseMatches.js","node_modules/lodash/internal/baseMatchesProperty.js","node_modules/lodash/internal/baseMerge.js","node_modules/lodash/internal/baseMergeDeep.js","node_modules/lodash/internal/baseProperty.js","node_modules/lodash/internal/basePropertyDeep.js","node_modules/lodash/internal/baseReduce.js","node_modules/lodash/internal/baseSetData.js","node_modules/lodash/internal/baseSlice.js","node_modules/lodash/internal/baseSome.js","node_modules/lodash/internal/baseSortBy.js","node_modules/lodash/internal/baseToString.js","node_modules/lodash/internal/baseUniq.js","node_modules/lodash/internal/baseValues.js","node_modules/lodash/internal/bindCallback.js","node_modules/lodash/internal/cacheIndexOf.js","node_modules/lodash/internal/cachePush.js","node_modules/lodash/internal/compareAscending.js","node_modules/lodash/internal/composeArgs.js","node_modules/lodash/internal/composeArgsRight.js","node_modules/lodash/internal/createAggregator.js","node_modules/lodash/internal/createAssigner.js","node_modules/lodash/internal/createBaseEach.js","node_modules/lodash/internal/createBaseFor.js","node_modules/lodash/internal/createBindWrapper.js","node_modules/lodash/internal/createCache.js","node_modules/lodash/internal/createCtorWrapper.js","node_modules/lodash/internal/createFind.js","node_modules/lodash/internal/createForEach.js","node_modules/lodash/internal/createHybridWrapper.js","node_modules/lodash/internal/createPartialWrapper.js","node_modules/lodash/internal/createReduce.js","node_modules/lodash/internal/createWrapper.js","node_modules/lodash/internal/equalArrays.js","node_modules/lodash/internal/equalByTag.js","node_modules/lodash/internal/equalObjects.js","node_modules/lodash/internal/getData.js","node_modules/lodash/internal/getFuncName.js","node_modules/lodash/internal/getLength.js","node_modules/lodash/internal/getSymbols.js","node_modules/lodash/internal/indexOfNaN.js","node_modules/lodash/internal/isArrayLike.js","node_modules/lodash/internal/isIndex.js","node_modules/lodash/internal/isIterateeCall.js","node_modules/lodash/internal/isKey.js","node_modules/lodash/internal/isLaziable.js","node_modules/lodash/internal/isLength.js","node_modules/lodash/internal/isObjectLike.js","node_modules/lodash/internal/isStrictComparable.js","node_modules/lodash/internal/mergeData.js","node_modules/lodash/internal/metaMap.js","node_modules/lodash/internal/pickByArray.js","node_modules/lodash/internal/pickByCallback.js","node_modules/lodash/internal/realNames.js","node_modules/lodash/internal/reorder.js","node_modules/lodash/internal/replaceHolders.js","node_modules/lodash/internal/setData.js","node_modules/lodash/internal/shimIsPlainObject.js","node_modules/lodash/internal/shimKeys.js","node_modules/lodash/internal/sortedUniq.js","node_modules/lodash/internal/toObject.js","node_modules/lodash/internal/toPath.js","node_modules/lodash/internal/wrapperClone.js","node_modules/lodash/lang/isArguments.js","node_modules/lodash/lang/isArray.js","node_modules/lodash/lang/isFunction.js","node_modules/lodash/lang/isNative.js","node_modules/lodash/lang/isNumber.js","node_modules/lodash/lang/isObject.js","node_modules/lodash/lang/isPlainObject.js","node_modules/lodash/lang/isString.js","node_modules/lodash/lang/isTypedArray.js","node_modules/lodash/lang/toPlainObject.js","node_modules/lodash/object/assign.js","node_modules/lodash/object/keys.js","node_modules/lodash/object/keysIn.js","node_modules/lodash/object/merge.js","node_modules/lodash/object/omit.js","node_modules/lodash/object/pick.js","node_modules/lodash/object/values.js","node_modules/lodash/string/escapeRegExp.js","node_modules/lodash/support.js","node_modules/lodash/utility/constant.js","node_modules/lodash/utility/identity.js","node_modules/lodash/utility/noop.js","node_modules/lodash/utility/property.js","node_modules/min-dom/lib/attr.js","node_modules/min-dom/lib/classes.js","node_modules/min-dom/lib/clear.js","node_modules/min-dom/lib/closest.js","node_modules/min-dom/lib/delegate.js","node_modules/min-dom/lib/domify.js","node_modules/min-dom/lib/event.js","node_modules/min-dom/lib/matches.js","node_modules/min-dom/lib/query.js","node_modules/min-dom/lib/remove.js","node_modules/min-dom/node_modules/component-classes/index.js","node_modules/min-dom/node_modules/component-classes/node_modules/component-indexof/index.js","node_modules/min-dom/node_modules/component-closest/index.js","node_modules/min-dom/node_modules/component-delegate/index.js","node_modules/min-dom/node_modules/component-event/index.js","node_modules/min-dom/node_modules/component-matches-selector/index.js","node_modules/min-dom/node_modules/component-query/index.js","node_modules/min-dom/node_modules/domify/index.js","node_modules/object-refs/index.js","node_modules/object-refs/lib/collection.js","node_modules/object-refs/lib/refs.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChWA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpQA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACl4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt0FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvNA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7OA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxfA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjXA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxUA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;;ACHA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;ACAA;;ACAA;;ACAA;;ACAA;;ACAA;;ACAA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","'use strict';\n\nvar inherits = require(195);\n\nvar IdSupport = require(50),\n Ids = require(193);\n\nvar Viewer = require(2);\n\nvar initialDiagram =\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' +\n '<bpmn:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ' +\n 'xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" ' +\n 'xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" ' +\n 'xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" ' +\n 'targetNamespace=\"http://bpmn.io/schema/bpmn\" ' +\n 'id=\"Definitions_1\">' +\n '<bpmn:process id=\"Process_1\" isExecutable=\"false\">' +\n '<bpmn:startEvent id=\"StartEvent_1\"/>' +\n '</bpmn:process>' +\n '<bpmndi:BPMNDiagram id=\"BPMNDiagram_1\">' +\n '<bpmndi:BPMNPlane id=\"BPMNPlane_1\" bpmnElement=\"Process_1\">' +\n '<bpmndi:BPMNShape id=\"_BPMNShape_StartEvent_2\" bpmnElement=\"StartEvent_1\">' +\n '<dc:Bounds height=\"36.0\" width=\"36.0\" x=\"173.0\" y=\"102.0\"/>' +\n '</bpmndi:BPMNShape>' +\n '</bpmndi:BPMNPlane>' +\n '</bpmndi:BPMNDiagram>' +\n '</bpmn:definitions>';\n\n\n/**\n * A modeler for BPMN 2.0 diagrams.\n *\n *\n * ## Extending the Modeler\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n * eventBus.on('element.hover', function(event) {\n * console.log()\n * })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n * __init__: [ 'interactionLogger' ],\n * interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnModeler = new Modeler({ additionalModules: [ extensionModule ] });\n * bpmnModeler.importXML(...);\n * ```\n *\n *\n * ## Customizing / Replacing Components\n *\n * You can replace individual diagram components by redefining them in override modules.\n * This works for all components, including those defined in the core.\n *\n * Pass in override modules via the `options.additionalModules` flag like this:\n *\n * ```javascript\n * function CustomContextPadProvider(contextPad) {\n *\n * contextPad.registerProvider(this);\n *\n * this.getContextPadEntries = function(element) {\n * // no entries, effectively disable the context pad\n * return {};\n * };\n * }\n *\n * CustomContextPadProvider.$inject = [ 'contextPad' ];\n *\n * var overrideModule = {\n * contextPadProvider: [ 'type', CustomContextPadProvider ]\n * };\n *\n * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]});\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Modeler(options) {\n Viewer.call(this, options);\n}\n\ninherits(Modeler, Viewer);\n\nModeler.prototype.createDiagram = function(done) {\n return this.importXML(initialDiagram, done);\n};\n\nModeler.prototype.createModdle = function() {\n var moddle = Viewer.prototype.createModdle.call(this);\n\n IdSupport.extend(moddle, new Ids([ 32, 36, 1 ]));\n\n return moddle;\n};\n\n\nModeler.prototype._interactionModules = [\n // non-modeling components\n require(14),\n require(173),\n require(170),\n require(171)\n];\n\nModeler.prototype._modelingModules = [\n // modeling components\n require(131),\n require(91),\n require(144),\n require(158),\n require(107),\n require(10),\n require(39),\n require(30),\n require(8),\n require(34)\n];\n\n\n// modules the modeler is composed of\n//\n// - viewer modules\n// - interaction modules\n// - modeling modules\n\nModeler.prototype._modules = [].concat(\n Modeler.prototype._modules,\n Modeler.prototype._interactionModules,\n Modeler.prototype._modelingModules);\n\n\nmodule.exports = Modeler;\n","'use strict';\n\nvar assign = require(325),\n omit = require(329),\n isString = require(322),\n isNumber = require(319);\n\nvar domify = require(343),\n domQuery = require(346),\n domRemove = require(347);\n\nvar Diagram = require(73),\n BpmnModdle = require(48);\n\nvar Importer = require(42);\n\n\nfunction initListeners(diagram, listeners) {\n var events = diagram.get('eventBus');\n\n listeners.forEach(function(l) {\n events.on(l.event, l.handler);\n });\n}\n\nfunction checkValidationError(err) {\n\n // check if we can help the user by indicating wrong BPMN 2.0 xml\n // (in case he or the exporting tool did not get that right)\n\n var pattern = /unparsable content <([^>]+)> detected([/s/S]*)$/;\n var match = pattern.exec(err.message);\n\n if (match) {\n err.message =\n 'unparsable content <' + match[1] + '> detected; ' +\n 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];\n }\n\n return err;\n}\n\nvar DEFAULT_OPTIONS = {\n width: '100%',\n height: '100%',\n position: 'relative',\n container: 'body'\n};\n\n\n/**\n * Ensure the passed argument is a proper unit (defaulting to px)\n */\nfunction ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}\n\n/**\n * A viewer for BPMN 2.0 diagrams.\n *\n * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include\n * additional features.\n *\n *\n * ## Extending the Viewer\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n * eventBus.on('element.hover', function(event) {\n * console.log()\n * })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n * __init__: [ 'interactionLogger' ],\n * interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });\n * bpmnViewer.importXML(...);\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Viewer(options) {\n\n this.options = options = assign({}, DEFAULT_OPTIONS, options || {});\n\n var parent = options.container;\n\n // support jquery element\n // unwrap it if passed\n if (parent.get) {\n parent = parent.get(0);\n }\n\n // support selector\n if (isString(parent)) {\n parent = domQuery(parent);\n }\n\n var container = this.container = domify('<div class=\"bjs-container\"></div>');\n parent.appendChild(container);\n\n assign(container.style, {\n width: ensureUnit(options.width),\n height: ensureUnit(options.height),\n position: options.position\n });\n\n /**\n * The code in the <project-logo></project-logo> area\n * must not be changed, see http://bpmn.io/license for more information\n *\n * <project-logo>\n */\n\n /* jshint -W101 */\n\n // inlined ../resources/bpmnjs.png\n var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';\n\n /* jshint +W101 */\n\n var linkMarkup =\n '<a href=\"http://bpmn.io\" ' +\n 'target=\"_blank\" ' +\n 'class=\"bjs-powered-by\" ' +\n 'title=\"Powered by bpmn.io\" ' +\n 'style=\"position: absolute; bottom: 15px; right: 15px; z-index: 100\">' +\n '<img src=\"data:image/png;base64,' + logoData + '\">' +\n '</a>';\n\n container.appendChild(domify(linkMarkup));\n\n /* </project-logo> */\n}\n\nViewer.prototype.importXML = function(xml, done) {\n\n var self = this;\n\n this.moddle = this.createModdle();\n\n this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {\n\n if (err) {\n err = checkValidationError(err);\n return done(err);\n }\n\n var parseWarnings = context.warnings;\n\n self.importDefinitions(definitions, function(err, importWarnings) {\n if (err) {\n return done(err);\n }\n\n done(null, parseWarnings.concat(importWarnings || []));\n });\n });\n};\n\nViewer.prototype.saveXML = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var definitions = this.definitions;\n\n if (!definitions) {\n return done(new Error('no definitions loaded'));\n }\n\n this.moddle.toXML(definitions, options, done);\n};\n\nViewer.prototype.createModdle = function() {\n return new BpmnModdle(this.options.moddleExtensions);\n};\n\nViewer.prototype.saveSVG = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var canvas = this.get('canvas');\n\n var contentNode = canvas.getDefaultLayer(),\n defsNode = canvas._svg.select('defs');\n\n var contents = contentNode.innerSVG(),\n defs = (defsNode && defsNode.outerSVG()) || '';\n\n var bbox = contentNode.getBBox();\n\n var svg =\n '<?xml version=\"1.0\" encoding=\"utf-8\"?>/n' +\n '<!-- created with bpmn-js / http://bpmn.io -->/n' +\n '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">/n' +\n '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ' +\n 'width=\"' + bbox.width + '\" height=\"' + bbox.height + '\" ' +\n 'viewBox=\"' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '\" version=\"1.1\">' +\n defs + contents +\n '</svg>';\n\n done(null, svg);\n};\n\nViewer.prototype.get = function(name) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.get(name);\n};\n\nViewer.prototype.invoke = function(fn) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.invoke(fn);\n};\n\nViewer.prototype.importDefinitions = function(definitions, done) {\n\n // use try/catch to not swallow synchronous exceptions\n // that may be raised during model parsing\n try {\n if (this.diagram) {\n this.clear();\n }\n\n this.definitions = definitions;\n\n var diagram = this.diagram = this._createDiagram(this.options);\n\n this._init(diagram);\n\n Importer.importBpmnDiagram(diagram, definitions, done);\n } catch (e) {\n done(e);\n }\n};\n\nViewer.prototype._init = function(diagram) {\n initListeners(diagram, this.__listeners || []);\n};\n\nViewer.prototype._createDiagram = function(options) {\n\n var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);\n\n // add self as an available service\n modules.unshift({\n bpmnjs: [ 'value', this ],\n moddle: [ 'value', this.moddle ]\n });\n\n options = omit(options, 'additionalModules');\n\n options = assign(options, {\n canvas: { container: this.container },\n modules: modules\n });\n\n return new Diagram(options);\n};\n\n\nViewer.prototype.getModules = function() {\n return this._modules;\n};\n\n/**\n * Remove all drawn elements from the viewer.\n *\n * After calling this method the viewer can still\n * be reused for opening another diagram.\n */\nViewer.prototype.clear = function() {\n var diagram = this.diagram;\n\n if (diagram) {\n diagram.destroy();\n }\n};\n\n/**\n * Destroy the viewer instance and remove all its remainders\n * from the document tree.\n */\nViewer.prototype.destroy = function() {\n // clear underlying diagram\n this.clear();\n\n // remove container\n domRemove(this.container);\n};\n\n/**\n * Register an event listener on the viewer\n *\n * @param {String} event\n * @param {Function} handler\n */\nViewer.prototype.on = function(event, handler) {\n var diagram = this.diagram,\n listeners = this.__listeners = this.__listeners || [];\n\n listeners.push({ event: event, handler: handler });\n\n if (diagram) {\n diagram.get('eventBus').on(event, handler);\n }\n};\n\n// modules the viewer is composed of\nViewer.prototype._modules = [\n require(3),\n require(151),\n require(135)\n];\n\nmodule.exports = Viewer;\n","module.exports = {\n __depends__: [\n require(6),\n require(44)\n ]\n};","'use strict';\n\nvar inherits = require(195),\n isArray = require(316),\n isObject = require(320),\n assign = require(325),\n forEach = require(204),\n every = require(201),\n includes = require(206),\n some = require(210);\n\nvar DefaultRenderer = require(84),\n TextUtil = require(184),\n DiUtil = require(45);\n\nvar createLine = DefaultRenderer.createLine;\n\n\nfunction BpmnRenderer(events, styles, pathMap) {\n\n DefaultRenderer.call(this, styles);\n\n var TASK_BORDER_RADIUS = 10;\n var INNER_OUTER_DIST = 3;\n\n var LABEL_STYLE = {\n fontFamily: 'Arial, sans-serif',\n fontSize: '12px'\n };\n\n var textUtil = new TextUtil({\n style: LABEL_STYLE,\n size: { width: 100 }\n });\n\n var markers = {};\n\n function addMarker(id, element) {\n markers[id] = element;\n }\n\n function marker(id) {\n return markers[id];\n }\n\n function initMarkers(svg) {\n\n function createMarker(id, options) {\n var attrs = assign({\n fill: 'black',\n strokeWidth: 1,\n strokeLinecap: 'round',\n strokeDasharray: 'none'\n }, options.attrs);\n\n var ref = options.ref || { x: 0, y: 0 };\n\n var scale = options.scale || 1;\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n if (attrs.strokeDasharray === 'none') {\n attrs.strokeDasharray = [10000, 1];\n }\n\n var marker = options.element\n .attr(attrs)\n .marker(0, 0, 20, 20, ref.x, ref.y)\n .attr({\n markerWidth: 20 * scale,\n markerHeight: 20 * scale\n });\n\n return addMarker(id, marker);\n }\n\n\n createMarker('sequenceflow-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15 Z'),\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('messageflow-start', {\n element: svg.circle(6, 6, 3.5),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 6, y: 6 }\n });\n\n createMarker('messageflow-end', {\n element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),\n attrs: {\n fill: 'white',\n stroke: 'black',\n strokeLinecap: 'butt'\n },\n ref: { x: 8.5, y: 5 }\n });\n\n createMarker('data-association-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-flow-marker', {\n element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: -1, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-default-flow-marker', {\n element: svg.path('M 1 4 L 5 16'),\n attrs: {\n stroke: 'black'\n },\n ref: { x: -5, y: 10 },\n scale: 0.5\n });\n }\n\n function computeStyle(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return styles.style(traits || [], assign(defaultStyles, custom || {}));\n }\n\n function drawCircle(p, width, height, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n var cx = width / 2,\n cy = height / 2;\n\n return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);\n }\n\n function drawRect(p, width, height, r, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);\n }\n\n function drawDiamond(p, width, height, attrs) {\n\n var x_2 = width / 2;\n var y_2 = height / 2;\n\n var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.polygon(points).attr(attrs);\n }\n\n function drawLine(p, waypoints, attrs) {\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'none'\n });\n\n return createLine(waypoints, attrs).appendTo(p);\n }\n\n function drawPath(p, d, attrs) {\n\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n strokeWidth: 2,\n stroke: 'black'\n });\n\n return p.path(d).attr(attrs);\n }\n\n function as(type) {\n return function(p, element) {\n return handlers[type](p, element);\n };\n }\n\n function renderer(type) {\n return handlers[type];\n }\n\n function renderEventContent(element, p) {\n\n var event = getSemantic(element);\n var isThrowing = isThrowEvent(event);\n\n if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {\n return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {\n return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {\n return renderer('bpmn:ConditionalEventDefinition')(p, element);\n }\n\n if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {\n return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {\n return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {\n return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {\n return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {\n return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {\n return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {\n return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {\n return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {\n return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);\n }\n\n return null;\n }\n\n function renderLabel(p, label, options) {\n return textUtil.createText(p, label || '', options).addClass('djs-label');\n }\n\n function renderEmbeddedLabel(p, element, align) {\n var semantic = getSemantic(element);\n return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });\n }\n\n function renderExternalLabel(p, element, align) {\n var semantic = getSemantic(element);\n\n if (!semantic.name) {\n element.hidden = true;\n }\n\n return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });\n }\n\n function renderLaneLabel(p, text, element) {\n var textBox = renderLabel(p, text, {\n box: { height: 30, width: element.height },\n align: 'center-middle'\n });\n\n var top = -1 * element.height;\n textBox.transform(\n 'rotate(270) ' +\n 'translate(' + top + ',' + 0 + ')'\n );\n }\n\n function createPathFromConnection(connection) {\n var waypoints = connection.waypoints;\n\n var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;\n for (var i = 1; i < waypoints.length; i++) {\n pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';\n }\n return pathData;\n }\n\n var handlers = {\n 'bpmn:Event': function(p, element, attrs) {\n return drawCircle(p, element.width, element.height, attrs);\n },\n 'bpmn:StartEvent': function(p, element) {\n var attrs = {};\n var semantic = getSemantic(element);\n\n if (!semantic.isInterrupting) {\n attrs = {\n strokeDasharray: '6',\n strokeLinecap: 'round'\n };\n }\n\n var circle = renderer('bpmn:Event')(p, element, attrs);\n\n renderEventContent(element, p);\n\n return circle;\n },\n 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.235,\n my: 0.315\n }\n });\n\n var fill = isThrowing ? 'black' : 'white';\n var stroke = isThrowing ? 'white' : 'black';\n\n var messagePath = drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill,\n stroke: stroke\n });\n\n return messagePath;\n },\n 'bpmn:TimerEventDefinition': function(p, element) {\n\n var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {\n strokeWidth: 2\n });\n\n var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n drawPath(p, pathData, {\n strokeWidth: 2,\n strokeLinecap: 'square'\n });\n\n for(var i = 0;i < 12;i++) {\n\n var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n var width = element.width / 2;\n var height = element.height / 2;\n\n drawPath(p, linePathData, {\n strokeWidth: 1,\n strokeLinecap: 'square',\n transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'\n });\n }\n\n return circle;\n },\n 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.555\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ConditionalEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.222\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_LINK', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.57,\n my: 0.263\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ERROR', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.2,\n my: 0.722\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {\n xScaleFactor: 1.0,\n yScaleFactor: 1.0,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.638,\n my: -0.055\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n }).transform('rotate(45)');\n },\n 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.201,\n my: 0.472\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.2\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.222,\n my: 0.36\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ParallelMultipleEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {\n xScaleFactor: 1.2,\n yScaleFactor: 1.2,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.458,\n my: 0.194\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:EndEvent': function(p, element) {\n var circle = renderer('bpmn:Event')(p, element, {\n strokeWidth: 4\n });\n\n renderEventContent(element, p, true);\n\n return circle;\n },\n 'bpmn:TerminateEventDefinition': function(p, element) {\n var circle = drawCircle(p, element.width, element.height, 8, {\n strokeWidth: 4,\n fill: 'black'\n });\n\n return circle;\n },\n 'bpmn:IntermediateEvent': function(p, element) {\n var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });\n /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),\n 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),\n\n 'bpmn:Activity': function(p, element, attrs) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);\n },\n\n 'bpmn:Task': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n renderEmbeddedLabel(p, element, 'center-middle');\n attachTaskMarkers(p, element);\n return rect;\n },\n 'bpmn:ServiceTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 12,\n y: 18\n }\n });\n\n /* service bg */ drawPath(p, pathDataBG, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {\n abspos: {\n x: 17.2,\n y: 18\n }\n });\n\n /* service fill */ drawPath(p, fillPathData, {\n strokeWidth: 0,\n stroke: 'none',\n fill: 'white'\n });\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 17,\n y: 22\n }\n });\n\n /* service */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'white'\n });\n\n return task;\n },\n 'bpmn:UserTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var x = 15;\n var y = 12;\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user path */ drawPath(p, pathData, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user2 path */ drawPath(p, pathData2, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user3 path */ drawPath(p, pathData3, {\n strokeWidth: 0.5,\n fill: 'black'\n });\n\n return task;\n },\n 'bpmn:ManualTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {\n abspos: {\n x: 17,\n y: 15\n }\n });\n\n /* manual path */ drawPath(p, pathData, {\n strokeWidth: 0.25,\n fill: 'white',\n stroke: 'black'\n });\n\n return task;\n },\n 'bpmn:SendTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.285,\n my: 0.357\n }\n });\n\n /* send path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black',\n stroke: 'white'\n });\n\n return task;\n },\n 'bpmn:ReceiveTask' : function(p, element) {\n var semantic = getSemantic(element);\n\n var task = renderer('bpmn:Task')(p, element);\n var pathData;\n\n if (semantic.instantiate) {\n drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });\n\n pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {\n abspos: {\n x: 7.77,\n y: 9.52\n }\n });\n } else {\n\n pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.3,\n my: 0.4\n }\n });\n }\n\n /* receive path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:ScriptTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {\n abspos: {\n x: 15,\n y: 20\n }\n });\n\n /* script path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:BusinessRuleTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessHeaderPath = drawPath(p, headerPathData);\n businessHeaderPath.attr({\n strokeWidth: 1,\n fill: 'AAA'\n });\n\n var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessPath = drawPath(p, headerData);\n businessPath.attr({\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:SubProcess': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n\n var semantic = getSemantic(element);\n\n var expanded = DiUtil.isExpanded(semantic);\n\n var isEventSubProcess = !!semantic.triggeredByEvent;\n if (isEventSubProcess) {\n rect.attr({\n strokeDasharray: '1,2'\n });\n }\n\n renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');\n\n if (expanded) {\n attachTaskMarkers(p, element);\n } else {\n attachTaskMarkers(p, element, ['SubProcessMarker']);\n }\n\n return rect;\n },\n 'bpmn:AdHocSubProcess': function(p, element) {\n return renderer('bpmn:SubProcess')(p, element);\n },\n 'bpmn:Transaction': function(p, element) {\n var outer = renderer('bpmn:SubProcess')(p, element);\n\n var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);\n\n /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);\n\n return outer;\n },\n 'bpmn:CallActivity': function(p, element) {\n return renderer('bpmn:Task')(p, element, {\n strokeWidth: 5\n });\n },\n 'bpmn:Participant': function(p, element) {\n\n var lane = renderer('bpmn:Lane')(p, element, {\n fill: 'White'\n });\n\n var expandedPool = DiUtil.isExpanded(element);\n\n if (expandedPool) {\n drawLine(p, [\n { x: 30, y: 0 },\n { x: 30, y: element.height }\n ]);\n var text = getSemantic(element).name;\n renderLaneLabel(p, text, element);\n } else {\n // Collapsed pool draw text inline\n var text2 = getSemantic(element).name;\n renderLabel(p, text2, { box: element, align: 'center-middle' });\n }\n\n var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);\n\n if(participantMultiplicity) {\n renderer('ParticipantMultiplicityMarker')(p, element);\n }\n\n return lane;\n },\n 'bpmn:Lane': function(p, element, attrs) {\n var rect = drawRect(p, element.width, element.height, 0, attrs || {\n fill: 'none'\n });\n\n var semantic = getSemantic(element);\n\n if (semantic.$type === 'bpmn:Lane') {\n var text = semantic.name;\n renderLaneLabel(p, text, element);\n }\n\n return rect;\n },\n 'bpmn:InclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* circle path */\n drawCircle(p, element.width, element.height, element.height * 0.24, {\n strokeWidth: 2.5,\n fill: 'none'\n });\n\n return diamond;\n },\n 'bpmn:ExclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {\n xScaleFactor: 0.4,\n yScaleFactor: 0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.32,\n my: 0.3\n }\n });\n\n if (!!(getDi(element).isMarkerVisible)) {\n drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n\n return diamond;\n },\n 'bpmn:ComplexGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {\n xScaleFactor: 0.5,\n yScaleFactor:0.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.26\n }\n });\n\n /* complex path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:ParallelGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.6,\n yScaleFactor:0.6,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.2\n }\n });\n\n /* parallel path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:EventBasedGateway': function(p, element) {\n\n var semantic = getSemantic(element);\n\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var type = semantic.eventGatewayType;\n var instantiate = !!semantic.instantiate;\n\n function drawEvent() {\n\n var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {\n xScaleFactor: 0.18,\n yScaleFactor: 0.18,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.36,\n my: 0.44\n }\n });\n\n /* event path */ drawPath(p, pathData, {\n strokeWidth: 2,\n fill: 'none'\n });\n }\n\n if (type === 'Parallel') {\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.4,\n yScaleFactor:0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var parallelPath = drawPath(p, pathData);\n parallelPath.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n } else if (type === 'Exclusive') {\n\n if (!instantiate) {\n var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);\n innerCircle.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n }\n\n drawEvent();\n }\n\n\n return diamond;\n },\n 'bpmn:Gateway': function(p, element) {\n return drawDiamond(p, element.width, element.height);\n },\n 'bpmn:SequenceFlow': function(p, element) {\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n strokeLinejoin: 'round',\n markerEnd: marker('sequenceflow-end')\n });\n\n var sequenceFlow = getSemantic(element);\n var source = element.source.businessObject;\n\n // conditional flow marker\n if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {\n path.attr({\n markerStart: marker('conditional-flow-marker')\n });\n }\n\n // default marker\n if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {\n path.attr({\n markerStart: marker('conditional-default-flow-marker')\n });\n }\n\n return path;\n },\n 'bpmn:Association': function(p, element, attrs) {\n\n attrs = assign({\n strokeDasharray: '1,6',\n strokeLinecap: 'round',\n strokeLinejoin: 'round'\n }, attrs || {});\n\n // TODO(nre): style according to directed state\n return drawLine(p, element.waypoints, attrs);\n },\n 'bpmn:DataInputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:DataOutputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:MessageFlow': function(p, element) {\n\n var semantic = getSemantic(element),\n di = getDi(element);\n\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n markerEnd: marker('messageflow-end'),\n markerStart: marker('messageflow-start'),\n strokeDasharray: '10, 12',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: '1.5px'\n });\n\n if (semantic.messageRef) {\n var midPoint = path.getPointAtLength(path.getTotalLength() / 2);\n\n var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {\n abspos: {\n x: midPoint.x,\n y: midPoint.y\n }\n });\n\n var messageAttrs = { strokeWidth: 1 };\n\n if (di.messageVisibleKind === 'initiating') {\n messageAttrs.fill = 'white';\n messageAttrs.stroke = 'black';\n } else {\n messageAttrs.fill = '#888';\n messageAttrs.stroke = 'white';\n }\n\n drawPath(p, markerPathData, messageAttrs);\n }\n\n return path;\n },\n 'bpmn:DataObject': function(p, element) {\n var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var elementObject = drawPath(p, pathData, { fill: 'white' });\n\n var semantic = getSemantic(element);\n\n if (isCollection(semantic)) {\n renderDataItemCollection(p, element);\n }\n\n return elementObject;\n },\n 'bpmn:DataObjectReference': as('bpmn:DataObject'),\n 'bpmn:DataInput': function(p, element) {\n\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });\n\n return elementObject;\n },\n 'bpmn:DataOutput': function(p, element) {\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* output arrow path */ drawPath(p, arrowPathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return elementObject;\n },\n 'bpmn:DataStoreReference': function(p, element) {\n var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0,\n my: 0.133\n }\n });\n\n var elementStore = drawPath(p, DATA_STORE_PATH, {\n strokeWidth: 2,\n fill: 'white'\n });\n\n return elementStore;\n },\n 'bpmn:BoundaryEvent': function(p, element) {\n\n var semantic = getSemantic(element),\n cancel = semantic.cancelActivity;\n\n var attrs = {\n strokeLinecap: 'round',\n strokeWidth: 1\n };\n\n if (!cancel) {\n attrs.strokeDasharray = '6';\n }\n\n var outer = renderer('bpmn:Event')(p, element, attrs);\n /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:Group': function(p, element) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {\n strokeWidth: 1,\n strokeDasharray: '8,3,1,3',\n fill: 'none',\n pointerEvents: 'none'\n });\n },\n 'label': function(p, element) {\n return renderExternalLabel(p, element, '');\n },\n 'bpmn:TextAnnotation': function(p, element) {\n var style = {\n 'fill': 'none',\n 'stroke': 'none'\n };\n var textElement = drawRect(p, element.width, element.height, 0, 0, style);\n var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.0,\n my: 0.0\n }\n });\n drawPath(p, textPathData);\n\n var text = getSemantic(element).text || '';\n renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });\n\n return textElement;\n },\n 'ParticipantMultiplicityMarker': function(p, element) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'SubProcessMarker': function(p, element) {\n var markerRect = drawRect(p, 14, 14, 0, {\n strokeWidth: 1\n });\n\n // Process marker is placed in the middle of the box\n // therefore fixed values can be used here\n markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');\n\n var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {\n xScaleFactor: 1.5,\n yScaleFactor: 1.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: (element.width / 2 - 7.5) / element.width,\n my: (element.height - 20) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'ParallelMarker': function(p, element, position) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.parallel) / element.width),\n my: (element.height - 20) / element.height\n }\n });\n drawPath(p, subProcessPath);\n },\n 'SequentialMarker': function(p, element, position) {\n var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.seq) / element.width),\n my: (element.height - 19) / element.height\n }\n });\n drawPath(p, sequentialPath);\n },\n 'CompensationMarker': function(p, element, position) {\n var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.compensation) / element.width),\n my: (element.height - 13) / element.height\n }\n });\n drawPath(p, compensationPath, { strokeWidth: 1 });\n },\n 'LoopMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_LOOP', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.loop) / element.width),\n my: (element.height - 7) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'none',\n strokeLinecap: 'round',\n strokeMiterlimit: 0.5\n });\n },\n 'AdhocMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.adhoc) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n };\n\n function attachTaskMarkers(p, element, taskMarkers) {\n var obj = getSemantic(element);\n\n var subprocess = includes(taskMarkers, 'SubProcessMarker');\n var position;\n\n if (subprocess) {\n position = {\n seq: -21,\n parallel: -22,\n compensation: -42,\n loop: -18,\n adhoc: 10\n };\n } else {\n position = {\n seq: -3,\n parallel: -6,\n compensation: -27,\n loop: 0,\n adhoc: 10\n };\n }\n\n forEach(taskMarkers, function(marker) {\n renderer(marker)(p, element, position);\n });\n\n if (obj.$type === 'bpmn:AdHocSubProcess') {\n renderer('AdhocMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {\n renderer('LoopMarker')(p, element, position);\n return;\n }\n if (obj.loopCharacteristics &&\n obj.loopCharacteristics.isSequential !== undefined &&\n !obj.loopCharacteristics.isSequential) {\n renderer('ParallelMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {\n renderer('SequentialMarker')(p, element, position);\n }\n if (!!obj.isForCompensation) {\n renderer('CompensationMarker')(p, element, position);\n }\n }\n\n function drawShape(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function drawConnection(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function renderDataItemCollection(p, element) {\n\n var yPosition = (element.height - 16) / element.height;\n\n var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.451,\n my: yPosition\n }\n });\n\n /* collection path */ drawPath(p, pathData, {\n strokeWidth: 2\n });\n }\n\n function isCollection(element, filter) {\n return element.isCollection ||\n (element.elementObjectRef && element.elementObjectRef.isCollection);\n }\n\n function getDi(element) {\n return element.businessObject.di;\n }\n\n function getSemantic(element) {\n return element.businessObject;\n }\n\n /**\n * Checks if eventDefinition of the given element matches with semantic type.\n *\n * @return {boolean} true if element is of the given semantic type\n */\n function isTypedEvent(event, eventDefinitionType, filter) {\n\n function matches(definition, filter) {\n return every(filter, function(val, key) {\n\n // we want a == conversion here, to be able to catch\n // undefined == false and friends\n /* jshint -W116 */\n return definition[key] == val;\n });\n }\n\n return some(event.eventDefinitions, function(definition) {\n return definition.$type === eventDefinitionType && matches(event, filter);\n });\n }\n\n function isThrowEvent(event) {\n return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');\n }\n\n\n /////// cropping path customizations /////////////////////////\n\n function componentsToPath(elements) {\n return elements.join(',').replace(/,?([A-z]),?/g, '$1');\n }\n\n function getCirclePath(shape) {\n\n var cx = shape.x + shape.width / 2,\n cy = shape.y + shape.height / 2,\n radius = shape.width / 2;\n\n var circlePath = [\n ['M', cx, cy],\n ['m', 0, -radius],\n ['a', radius, radius, 0, 1, 1, 0, 2 * radius],\n ['a', radius, radius, 0, 1, 1, 0, -2 * radius],\n ['z']\n ];\n\n return componentsToPath(circlePath);\n }\n\n function getRoundRectPath(shape) {\n\n var radius = TASK_BORDER_RADIUS,\n x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var roundRectPath = [\n ['M', x + radius, y],\n ['l', width - radius * 2, 0],\n ['a', radius, radius, 0, 0, 1, radius, radius],\n ['l', 0, height - radius * 2],\n ['a', radius, radius, 0, 0, 1, -radius, radius],\n ['l', radius * 2 - width, 0],\n ['a', radius, radius, 0, 0, 1, -radius, -radius],\n ['l', 0, radius * 2 - height],\n ['a', radius, radius, 0, 0, 1, radius, -radius],\n ['z']\n ];\n\n return componentsToPath(roundRectPath);\n }\n\n function getDiamondPath(shape) {\n\n var width = shape.width,\n height = shape.height,\n x = shape.x,\n y = shape.y,\n halfWidth = width / 2,\n halfHeight = height / 2;\n\n var diamondPath = [\n ['M', x + halfWidth, y],\n ['l', halfWidth, halfHeight],\n ['l', -halfWidth, halfHeight],\n ['l', -halfWidth, -halfHeight],\n ['z']\n ];\n\n return componentsToPath(diamondPath);\n }\n\n function getRectPath(shape) {\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var rectPath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(rectPath);\n }\n\n function getShapePath(element) {\n var obj = getSemantic(element);\n\n if (obj.$instanceOf('bpmn:Event')) {\n return getCirclePath(element);\n }\n\n if (obj.$instanceOf('bpmn:Activity')) {\n return getRoundRectPath(element);\n }\n\n if (obj.$instanceOf('bpmn:Gateway')) {\n return getDiamondPath(element);\n }\n\n return getRectPath(element);\n }\n\n\n // hook onto canvas init event to initialize\n // connection start/end markers on svg\n events.on('canvas.init', function(event) {\n initMarkers(event.svg);\n });\n\n this.drawShape = drawShape;\n this.drawConnection = drawConnection;\n\n this.getShapePath = getShapePath;\n}\n\ninherits(BpmnRenderer, DefaultRenderer);\n\n\nBpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];\n\nmodule.exports = BpmnRenderer;\n","'use strict';\n\nvar Snap = require(188);\n\n/**\n * Map containing SVG paths needed by BpmnRenderer.\n */\n\nfunction PathMap() {\n\n /**\n * Contains a map of path elements\n *\n * <h1>Path definition</h1>\n * A parameterized path is defined like this:\n * <pre>\n * 'GATEWAY_PARALLEL': {\n * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n * height: 17.5,\n * width: 17.5,\n * heightElements: [2.5, 7.5],\n * widthElements: [2.5, 7.5]\n * }\n * </pre>\n * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling\n * is based on the ratio between the specified height and width in this object and the\n * height and width that is set as scale target (Note x,y coordinates will be scaled with\n * individual ratios).</p>\n * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.\n * The scaling is based on the computed ratios.\n * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using\n * the computed ratio coefficient.\n * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.\n * <ul>\n * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>\n * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>\n * </ul>\n * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.\n * </p>\n */\n this.pathMap = {\n 'EVENT_MESSAGE': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 36,\n width: 36,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'EVENT_SIGNAL': {\n d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',\n height: 36,\n width: 36,\n heightElements: [18],\n widthElements: [10, 20]\n },\n 'EVENT_ESCALATION': {\n d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +\n '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',\n height: 36,\n width: 36,\n heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],\n widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]\n },\n 'EVENT_CONDITIONAL': {\n d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +\n 'M {e.x2},{e.y3} l {e.x0},0 ' +\n 'M {e.x2},{e.y4} l {e.x0},0 ' +\n 'M {e.x2},{e.y5} l {e.x0},0 ' +\n 'M {e.x2},{e.y6} l {e.x0},0 ' +\n 'M {e.x2},{e.y7} l {e.x0},0 ' +\n 'M {e.x2},{e.y8} l {e.x0},0 ',\n height: 36,\n width: 36,\n heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],\n widthElements: [10.5, 14.5, 12.5]\n },\n 'EVENT_LINK': {\n d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',\n height: 36,\n width: 36,\n heightElements: [4.4375, 6.75, 7.8125],\n widthElements: [9.84375, 13.5]\n },\n 'EVENT_ERROR': {\n d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',\n height: 36,\n width: 36,\n heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],\n widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]\n },\n 'EVENT_CANCEL_45': {\n d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 36,\n width: 36,\n heightElements: [4.75, 8.5],\n widthElements: [4.75, 8.5]\n },\n 'EVENT_COMPENSATION': {\n d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',\n height: 36,\n width: 36,\n heightElements: [5, 10],\n widthElements: [10]\n },\n 'EVENT_TIMER_WH': {\n d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 2],\n widthElements: [3, 7]\n },\n 'EVENT_TIMER_LINE': {\n d: 'M {mx},{my} ' +\n 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 3],\n widthElements: [0, 0]\n },\n 'EVENT_MULTIPLE': {\n d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',\n height: 36,\n width: 36,\n heightElements: [6.28099, 12.56199],\n widthElements: [3.1405, 9.42149, 12.56198]\n },\n 'EVENT_PARALLEL_MULTIPLE': {\n d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n height: 36,\n width: 36,\n heightElements: [2.56228, 7.68683],\n widthElements: [2.56228, 7.68683]\n },\n 'GATEWAY_EXCLUSIVE': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +\n '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +\n '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',\n height: 17.5,\n width: 17.5,\n heightElements: [8.5, 6.5312, -6.5312, -8.5],\n widthElements: [6.5, -6.5, 3, -3, 5, -5]\n },\n 'GATEWAY_PARALLEL': {\n d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 30,\n width: 30,\n heightElements: [5, 12.5],\n widthElements: [5, 12.5]\n },\n 'GATEWAY_EVENT_BASED': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',\n height: 11,\n width: 11,\n heightElements: [-6, 6, 12, -12],\n widthElements: [9, -3, -12]\n },\n 'GATEWAY_COMPLEX': {\n d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +\n '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +\n '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +\n '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',\n height: 17.125,\n width: 17.125,\n heightElements: [4.875, 3.4375, 2.125, 3],\n widthElements: [3.4375, 2.125, 4.875, 3]\n },\n 'DATA_OBJECT_PATH': {\n d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',\n height: 61,\n width: 51,\n heightElements: [10, 50, 60],\n widthElements: [10, 40, 50, 60]\n },\n 'DATA_OBJECT_COLLECTION_PATH': {\n d:'m {mx}, {my} ' +\n 'm 0 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ',\n height: 61,\n width: 51,\n heightElements: [12],\n widthElements: [1, 6, 12, 15]\n },\n 'DATA_ARROW': {\n d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',\n height: 61,\n width: 51,\n heightElements: [],\n widthElements: []\n },\n 'DATA_STORE': {\n d:'m {mx},{my} ' +\n 'l 0,{e.y2} ' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'l 0,-{e.y2} ' +\n 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',\n height: 61,\n width: 61,\n heightElements: [7, 10, 45],\n widthElements: [2, 58, 60]\n },\n 'TEXT_ANNOTATION': {\n d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',\n height: 30,\n width: 10,\n heightElements: [30],\n widthElements: [10]\n },\n 'MARKER_SUB_PROCESS': {\n d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_PARALLEL': {\n d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_SEQUENTIAL': {\n d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_COMPENSATION': {\n d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',\n height: 10,\n width: 21,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_LOOP': {\n d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +\n '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +\n '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +\n 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',\n height: 13.9,\n width: 13.7,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_ADHOC': {\n d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +\n '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +\n '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +\n '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +\n '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',\n height: 4,\n width: 15,\n heightElements: [],\n widthElements: []\n },\n 'TASK_TYPE_SEND': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 14,\n width: 21,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_SCRIPT': {\n d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +\n 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +\n 'm -7,-12 l 5,0 ' +\n 'm -4.5,3 l 4.5,0 ' +\n 'm -3,3 l 5,0' +\n 'm -4,3 l 5,0',\n height: 15,\n width: 12.6,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_USER_1': {\n d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +\n '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +\n '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +\n 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +\n 'm -8,6 l 0,5.5 m 11,0 l 0,-5'\n },\n 'TASK_TYPE_USER_2': {\n d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +\n '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '\n },\n 'TASK_TYPE_USER_3': {\n d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +\n '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +\n '-4.20799998,3.36699999 -4.20699998,4.34799999 z'\n },\n 'TASK_TYPE_MANUAL': {\n d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +\n '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +\n '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +\n '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +\n '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +\n '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +\n '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +\n '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +\n '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +\n '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +\n '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +\n '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'\n },\n 'TASK_TYPE_INSTANTIATING_SEND': {\n d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'\n },\n 'TASK_TYPE_SERVICE': {\n d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +\n '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +\n '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +\n 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +\n '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +\n '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +\n 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +\n '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +\n 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +\n 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +\n '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +\n 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +\n 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_SERVICE_FILL': {\n d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_HEADER': {\n d: 'm {mx},{my} 0,4 20,0 0,-4 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_MAIN': {\n d: 'm {mx},{my} 0,12 20,0 0,-12 z' +\n 'm 0,8 l 20,0 ' +\n 'm -13,-4 l 0,8'\n },\n 'MESSAGE_FLOW_MARKER': {\n d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'\n }\n };\n\n this.getRawPath = function getRawPath(pathId) {\n return this.pathMap[pathId].d;\n };\n\n /**\n * Scales the path to the given height and width.\n * <h1>Use case</h1>\n * <p>Use case is to scale the content of elements (event, gateways) based\n * on the element bounding box's size.\n * </p>\n * <h1>Why not transform</h1>\n * <p>Scaling a path with transform() will also scale the stroke and IE does not support\n * the option 'non-scaling-stroke' to prevent this.\n * Also there are use cases where only some parts of a path should be\n * scaled.</p>\n *\n * @param {String} pathId The ID of the path.\n * @param {Object} param <p>\n * Example param object scales the path to 60% size of the container (data.width, data.height).\n * <pre>\n * {\n * xScaleFactor: 0.6,\n * yScaleFactor:0.6,\n * containerWidth: data.width,\n * containerHeight: data.height,\n * position: {\n * mx: 0.46,\n * my: 0.2,\n * }\n * }\n * </pre>\n * <ul>\n * <li>targetpathwidth = xScaleFactor * containerWidth</li>\n * <li>targetpathheight = yScaleFactor * containerHeight</li>\n * <li>Position is used to set the starting coordinate of the path. M is computed:\n * <ul>\n * <li>position.x * containerWidth</li>\n * <li>position.y * containerHeight</li>\n * </ul>\n * Center of the container <pre> position: {\n * mx: 0.5,\n * my: 0.5,\n * }</pre>\n * Upper left corner of the container\n * <pre> position: {\n * mx: 0.0,\n * my: 0.0,\n * }</pre>\n * </li>\n * </ul>\n * </p>\n *\n */\n this.getScaledPath = function getScaledPath(pathId, param) {\n var rawPath = this.pathMap[pathId];\n\n // positioning\n // compute the start point of the path\n var mx, my;\n\n if(!!param.abspos) {\n mx = param.abspos.x;\n my = param.abspos.y;\n } else {\n mx = param.containerWidth * param.position.mx;\n my = param.containerHeight * param.position.my;\n }\n\n var coordinates = {}; //map for the scaled coordinates\n if(param.position) {\n\n // path\n var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;\n var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;\n\n\n //Apply height ratio\n for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {\n coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;\n }\n\n //Apply width ratio\n for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {\n coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;\n }\n }\n\n //Apply value to raw path\n var path = Snap.format(\n rawPath.d, {\n mx: mx,\n my: my,\n e: coordinates\n }\n );\n return path;\n };\n}\n\nmodule.exports = PathMap;\n","module.exports = {\n renderer: [ 'type', require(4) ],\n pathMap: [ 'type', require(5) ]\n};","'use strict';\n\n\nvar assign = require(325),\n forEach = require(204);\n\n\n/**\n * A provider for BPMN 2.0 elements context pad\n */\nfunction ContextPadProvider(contextPad, modeling, elementFactory,\n connect, create, bpmnReplace,\n canvas) {\n\n contextPad.registerProvider(this);\n\n this._contextPad = contextPad;\n\n this._modeling = modeling;\n\n this._elementFactory = elementFactory;\n this._connect = connect;\n this._create = create;\n this._bpmnReplace = bpmnReplace;\n this._canvas = canvas;\n}\n\nContextPadProvider.$inject = [\n 'contextPad',\n 'modeling',\n 'elementFactory',\n 'connect',\n 'create',\n 'bpmnReplace',\n 'canvas'\n];\n\nContextPadProvider.prototype.getContextPadEntries = function(element) {\n\n var contextPad = this._contextPad,\n modeling = this._modeling,\n\n elementFactory = this._elementFactory,\n connect = this._connect,\n create = this._create,\n bpmnReplace = this._bpmnReplace,\n canvas = this._canvas;\n\n var actions = {};\n\n if (element.type === 'label') {\n return actions;\n }\n\n var bpmnElement = element.businessObject;\n\n function startConnect(event, element, autoActivate) {\n connect.start(event, element, autoActivate);\n }\n\n function removeElement(e) {\n if (element.waypoints) {\n modeling.removeConnection(element);\n } else {\n modeling.removeShape(element);\n }\n }\n\n function getReplaceMenuPosition(element) {\n\n var Y_OFFSET = 5;\n\n var diagramContainer = canvas.getContainer(),\n pad = contextPad.getPad(element).html;\n\n var diagramRect = diagramContainer.getBoundingClientRect(),\n padRect = pad.getBoundingClientRect();\n\n var top = padRect.top - diagramRect.top;\n var left = padRect.left - diagramRect.left;\n\n var pos = {\n x: left,\n y: top + padRect.height + Y_OFFSET\n };\n\n return pos;\n }\n\n\n function appendAction(type, className, options) {\n\n function appendListener(event, element) {\n\n var shape = elementFactory.createShape(assign({ type: type }, options));\n create.start(event, shape, element);\n }\n\n var shortType = type.replace(/^bpmn/:/, '');\n\n return {\n group: 'model',\n className: className,\n title: 'Append ' + shortType,\n action: {\n dragstart: appendListener,\n click: appendListener\n }\n };\n }\n\n if (bpmnElement.$instanceOf('bpmn:FlowNode')) {\n\n if (!bpmnElement.$instanceOf('bpmn:EndEvent') &&\n !bpmnElement.$instanceOf('bpmn:EventBasedGateway') &&\n !isEventType(bpmnElement, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition')) {\n\n assign(actions, {\n 'append.end-event': appendAction('bpmn:EndEvent', 'icon-end-event-none'),\n 'append.gateway': appendAction('bpmn:ExclusiveGateway', 'icon-gateway-xor'),\n 'append.append-task': appendAction('bpmn:Task', 'icon-task'),\n 'append.intermediate-event': appendAction('bpmn:IntermediateThrowEvent',\n 'icon-intermediate-event-none')\n });\n }\n\n if (bpmnElement.$instanceOf('bpmn:EventBasedGateway')) {\n\n assign(actions, {\n 'append.receive-task': appendAction('bpmn:ReceiveTask', 'icon-receive-task'),\n 'append.message-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n 'icon-intermediate-event-catch-message',\n { _eventDefinitionType: 'bpmn:MessageEventDefinition'}),\n 'append.timer-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n 'icon-intermediate-event-catch-timer',\n { _eventDefinitionType: 'bpmn:TimerEventDefinition'}),\n 'append.condtion-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n 'icon-intermediate-event-catch-condition',\n { _eventDefinitionType: 'bpmn:ConditionalEventDefinition'}),\n 'append.signal-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n 'icon-intermediate-event-catch-signal',\n { _eventDefinitionType: 'bpmn:SignalEventDefinition'})\n });\n }\n\n\n // Replace menu entry\n if (!bpmnElement.$instanceOf('bpmn:SubProcess')) {\n assign(actions, {\n 'replace': {\n group: 'edit',\n className: 'icon-screw-wrench',\n title: 'Change type',\n action: {\n click: function(event, element) {\n bpmnReplace.openChooser(getReplaceMenuPosition(element), element);\n }\n }\n }\n });\n }\n }\n\n if (bpmnElement.$instanceOf('bpmn:FlowNode') ||\n bpmnElement.$instanceOf('bpmn:InteractionNode')) {\n\n assign(actions, {\n 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),\n\n 'connect': {\n group: 'connect',\n className: 'icon-connection-multi',\n title: 'Connect using Sequence/MessageFlow',\n action: {\n click: startConnect,\n dragstart: startConnect\n }\n }\n });\n }\n\n // Delete Element Entry\n assign(actions, {\n 'delete': {\n group: 'edit',\n className: 'icon-trash',\n title: 'Remove',\n action: {\n click: removeElement,\n dragstart: removeElement\n }\n }\n });\n\n return actions;\n};\n\nfunction isEventType(eventBo, type, definition) {\n\n var isType = eventBo.$instanceOf(type);\n var isDefinition = false;\n\n var definitions = eventBo.eventDefinitions || [];\n forEach(definitions, function(def) {\n if (def.$type === definition) {\n isDefinition = true;\n }\n });\n\n return isType && isDefinition;\n}\n\n\nmodule.exports = ContextPadProvider;\n","module.exports = {\n __depends__: [\n require(70),\n require(97),\n require(151),\n require(95),\n require(99),\n require(37)\n ],\n __init__: [ 'contextPadProvider' ],\n contextPadProvider: [ 'type', require(7) ]\n};","'use strict';\n\n\nfunction BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {\n\n keyboard.addListener(function(key, modifiers) {\n\n if (keyboard.hasModifier(modifiers)) {\n return;\n }\n\n // S -> activate space tool\n if (key === 83) {\n spaceTool.activateSelection();\n\n return true;\n }\n\n // L -> activate lasso tool\n if (key === 108) {\n lassoTool.activateSelection();\n\n return true;\n }\n\n var currentSelection = selection.get();\n\n // E -> activate direct editing\n if (key === 69) {\n if (currentSelection.length) {\n directEditing.activate(currentSelection[0]);\n }\n\n return true;\n }\n });\n}\n\nBpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ];\n\nmodule.exports = BpmnKeyBindings;","module.exports = {\n __depends__: [\n require(105)\n ],\n __init__: [ 'bpmnKeyBindings' ],\n bpmnKeyBindings: [ 'type', require(9) ]\n};","'use strict';\n\nvar UpdateLabelHandler = require(13);\n\nvar LabelUtil = require(12);\n\nvar is = require(47).is,\n isExpanded = require(45).isExpanded;\n\n\nvar MIN_BOUNDS = {\n width: 150,\n height: 50\n};\n\n\nfunction LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {\n\n directEditing.registerProvider(this);\n commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);\n\n // listen to dblclick on non-root elements\n eventBus.on('element.dblclick', function(event) {\n directEditing.activate(event.element);\n });\n\n // complete on followup canvas operation\n eventBus.on([ 'element.mousedown', 'drag.activate', 'canvas.viewbox.changed' ], function(event) {\n directEditing.complete();\n });\n\n // cancel on command stack changes\n eventBus.on([ 'commandStack.changed' ], function() {\n directEditing.cancel();\n });\n\n\n // activate direct editing for activities and text annotations\n\n\n if ('ontouchstart' in document.documentElement) {\n // we deactivate automatic label editing on mobile devices\n // as it breaks the user interaction workflow\n\n // TODO(nre): we should temporarily focus the edited element here\n // and release the focused viewport after the direct edit operation is finished\n } else {\n eventBus.on('create.end', 500, function(e) {\n\n var element = e.shape,\n canExecute = e.context.canExecute;\n\n if (!canExecute) {\n return;\n }\n\n if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||\n (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {\n\n directEditing.activate(element);\n }\n });\n }\n\n this._canvas = canvas;\n this._commandStack = commandStack;\n}\n\nLabelEditingProvider.$inject = [ 'eventBus', 'canvas', 'directEditing', 'commandStack', 'injector' ];\n\nmodule.exports = LabelEditingProvider;\n\n\nLabelEditingProvider.prototype.activate = function(element) {\n\n var text = LabelUtil.getLabel(element);\n\n if (text === undefined) {\n return;\n }\n\n var bbox = this.getEditingBBox(element);\n\n // adjust for expanded pools AND lanes\n if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {\n\n bbox.width = MIN_BOUNDS.width;\n bbox.height = MIN_BOUNDS.height;\n\n bbox.x = bbox.x + 10 - bbox.width / 2;\n bbox.y = bbox.mid.y - bbox.height / 2;\n }\n\n // adjust for expanded sub processes\n if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {\n\n bbox.height = MIN_BOUNDS.height;\n\n bbox.x = bbox.mid.x - bbox.width / 2;\n bbox.y = bbox.y + 10 - bbox.height / 2;\n }\n\n return { bounds: bbox, text: text };\n};\n\n\nLabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {\n\n var target = element.label || element;\n\n var bbox = this._canvas.getAbsoluteBBox(target);\n\n var mid = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n\n // external label\n if (target.labelTarget) {\n bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);\n bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);\n\n bbox.x = mid.x - bbox.width / 2;\n }\n\n bbox.mid = mid;\n\n return bbox;\n};\n\n\nLabelEditingProvider.prototype.update = function(element, newLabel) {\n this._commandStack.execute('element.updateLabel', {\n element: element,\n newLabel: newLabel\n });\n};","'use strict';\n\nfunction getLabelAttr(semantic) {\n if (semantic.$instanceOf('bpmn:FlowElement') ||\n semantic.$instanceOf('bpmn:Participant') ||\n semantic.$instanceOf('bpmn:Lane') ||\n semantic.$instanceOf('bpmn:SequenceFlow') ||\n semantic.$instanceOf('bpmn:MessageFlow')) {\n return 'name';\n }\n\n if (semantic.$instanceOf('bpmn:TextAnnotation')) {\n return 'text';\n }\n}\n\nmodule.exports.getLabel = function(element) {\n var semantic = element.businessObject,\n attr = getLabelAttr(semantic);\n\n if (attr) {\n return semantic[attr] || '';\n }\n};\n\n\nmodule.exports.setLabel = function(element, text) {\n var semantic = element.businessObject,\n attr = getLabelAttr(semantic);\n\n if (attr) {\n semantic[attr] = text;\n }\n\n var label = element.label || element;\n\n // show label\n label.hidden = false;\n\n return label;\n};","'use strict';\n\nvar LabelUtil = require(12);\n\n\n/**\n * A handler that updates the text of a BPMN element.\n *\n * @param {EventBus} eventBus\n */\nfunction UpdateTextHandler(eventBus) {\n\n function setText(element, text) {\n var label = LabelUtil.setLabel(element, text);\n\n eventBus.fire('element.changed', { element: label });\n }\n\n function execute(ctx) {\n ctx.oldLabel = LabelUtil.getLabel(ctx.element);\n return setText(ctx.element, ctx.newLabel);\n }\n\n function revert(ctx) {\n return setText(ctx.element, ctx.oldLabel);\n }\n\n\n function canExecute(ctx) {\n return true;\n }\n\n // API\n\n this.execute = execute;\n this.revert = revert;\n\n this.canExecute = canExecute;\n}\n\n\nUpdateTextHandler.$inject = [ 'eventBus' ];\n\nmodule.exports = UpdateTextHandler;","module.exports = {\n __depends__: [\n require(77),\n require(93),\n require(70)\n ],\n __init__: [ 'labelEditingProvider' ],\n labelEditingProvider: [ 'type', require(11) ]\n};","'use strict';\n\nvar map = require(207),\n assign = require(325),\n pick = require(330);\n\n\nfunction BpmnFactory(moddle) {\n this._model = moddle;\n}\n\nBpmnFactory.$inject = [ 'moddle' ];\n\n\nBpmnFactory.prototype._needsId = function(element) {\n return element.$instanceOf('bpmn:RootElement') ||\n element.$instanceOf('bpmn:FlowElement') ||\n element.$instanceOf('bpmn:MessageFlow') ||\n element.$instanceOf('bpmn:Artifact') ||\n element.$instanceOf('bpmn:Participant') ||\n element.$instanceOf('bpmn:Process') ||\n element.$instanceOf('bpmn:Collaboration') ||\n element.$instanceOf('bpmndi:BPMNShape') ||\n element.$instanceOf('bpmndi:BPMNEdge') ||\n element.$instanceOf('bpmndi:BPMNDiagram') ||\n element.$instanceOf('bpmndi:BPMNPlane');\n};\n\nBpmnFactory.prototype._ensureId = function(element) {\n\n // generate semantic ids for elements\n // bpmn:SequenceFlow -> SequenceFlow_ID\n var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';\n\n if (!element.id && this._needsId(element)) {\n element.id = this._model.ids.nextPrefixed(prefix, element);\n }\n};\n\n\nBpmnFactory.prototype.create = function(type, attrs) {\n var element = this._model.create(type, attrs || {});\n\n this._ensureId(element);\n\n return element;\n};\n\n\nBpmnFactory.prototype.createDiLabel = function() {\n return this.create('bpmndi:BPMNLabel', {\n bounds: this.createDiBounds()\n });\n};\n\n\nBpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {\n\n return this.create('bpmndi:BPMNShape', assign({\n bpmnElement: semantic,\n bounds: this.createDiBounds(bounds)\n }, attrs));\n};\n\n\nBpmnFactory.prototype.createDiBounds = function(bounds) {\n return this.create('dc:Bounds', bounds);\n};\n\n\nBpmnFactory.prototype.createDiWaypoints = function(waypoints) {\n return map(waypoints, function(pos) {\n return this.createDiWaypoint(pos);\n }, this);\n};\n\nBpmnFactory.prototype.createDiWaypoint = function(point) {\n return this.create('dc:Point', pick(point, [ 'x', 'y' ]));\n};\n\n\nBpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {\n return this.create('bpmndi:BPMNEdge', assign({\n bpmnElement: semantic\n }, attrs));\n};\n\nBpmnFactory.prototype.createDiPlane = function(semantic) {\n return this.create('bpmndi:BPMNPlane', {\n bpmnElement: semantic\n });\n};\n\nmodule.exports = BpmnFactory;\n","'use strict';\n\nvar inherits = require(195);\n\nvar assign = require(325);\n\nvar BaseLayouter = require(164),\n LayoutUtil = require(166),\n ManhattanLayout = require(167);\n\nvar is = require(47).is;\n\n\nfunction BpmnLayouter() {}\n\ninherits(BpmnLayouter, BaseLayouter);\n\nmodule.exports = BpmnLayouter;\n\n\nfunction getAttachment(waypoints, idx, shape) {\n var point = waypoints && waypoints[idx];\n\n return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);\n}\n\n\nBpmnLayouter.prototype.layoutConnection = function(connection, hints) {\n var source = connection.source,\n target = connection.target,\n waypoints = connection.waypoints,\n start,\n end;\n\n var layoutManhattan,\n updatedWaypoints;\n\n start = getAttachment(waypoints, 0, source);\n end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);\n\n // manhattan layout sequence / message flows\n if (is(connection, 'bpmn:MessageFlow')) {\n layoutManhattan = {\n preferStraight: true,\n preferVertical: true\n };\n }\n\n if (is(connection, 'bpmn:SequenceFlow')) {\n layoutManhattan = {};\n }\n\n if (layoutManhattan) {\n\n layoutManhattan = assign(layoutManhattan, hints);\n\n updatedWaypoints =\n ManhattanLayout.repairConnection(\n source, target, start, end,\n waypoints,\n layoutManhattan);\n }\n\n return updatedWaypoints || [ start, end ];\n};","'use strict';\n\nvar assign = require(325),\n forEach = require(204),\n inherits = require(195);\n\nvar Collections = require(175),\n Model = require(168);\n\nvar CommandInterceptor = require(75);\n\n\n/**\n * A handler responsible for updating the underlying BPMN 2.0 XML + DI\n * once changes on the diagram happen\n */\nfunction BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {\n\n CommandInterceptor.call(this, eventBus);\n\n this._bpmnFactory = bpmnFactory;\n\n var self = this;\n\n\n\n ////// connection cropping /////////////////////////\n\n // crop connection ends during create/update\n function cropConnection(e) {\n var context = e.context,\n connection;\n\n if (!context.cropped) {\n connection = context.connection;\n connection.waypoints = connectionDocking.getCroppedWaypoints(connection);\n context.cropped = true;\n }\n }\n\n this.executed([\n 'connection.layout',\n 'connection.create',\n 'connection.reconnectEnd',\n 'connection.reconnectStart'\n ], cropConnection);\n\n this.reverted([ 'connection.layout' ], function(e) {\n delete e.context.cropped;\n });\n\n\n\n ////// BPMN + DI update /////////////////////////\n\n\n // update parent\n function updateParent(e) {\n self.updateParent(e.context.shape || e.context.connection);\n }\n\n this.executed([ 'shape.move',\n 'shape.create',\n 'shape.delete',\n 'connection.create',\n 'connection.move',\n 'connection.delete' ], updateParent);\n this.reverted([ 'shape.move',\n 'shape.create',\n 'shape.delete',\n 'connection.create',\n 'connection.move',\n 'connection.delete' ], updateParent);\n\n /*\n * ## Updating Parent\n *\n * When morphing a Process into a Collaboration or vice-versa, \n * make sure that both the *semantic* and *di* parent of each element\n * is updated.\n *\n */\n function updateRoot(event) {\n var context = event.context,\n oldRoot = context.oldRoot,\n children = oldRoot.children;\n\n forEach(children, function(child) {\n self.updateParent(child);\n });\n }\n\n this.executed([ 'canvas.updateRoot' ], updateRoot);\n this.reverted([ 'canvas.updateRoot' ], updateRoot);\n\n\n // update bounds\n function updateBounds(e) {\n self.updateBounds(e.context.shape);\n }\n\n this.executed([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);\n this.reverted([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);\n\n\n // attach / detach connection\n function updateConnection(e) {\n self.updateConnection(e.context.connection);\n }\n\n this.executed([\n 'connection.create',\n 'connection.move',\n 'connection.delete',\n 'connection.reconnectEnd',\n 'connection.reconnectStart'\n ], updateConnection);\n\n this.reverted([\n 'connection.create',\n 'connection.move',\n 'connection.delete',\n 'connection.reconnectEnd',\n 'connection.reconnectStart'\n ], updateConnection);\n\n\n // update waypoints\n function updateConnectionWaypoints(e) {\n self.updateConnectionWaypoints(e.context.connection);\n }\n\n this.executed([\n 'connection.layout',\n 'connection.move',\n 'connection.updateWaypoints',\n 'connection.reconnectEnd',\n 'connection.reconnectStart'\n ], updateConnectionWaypoints);\n\n this.reverted([\n 'connection.layout',\n 'connection.move',\n 'connection.updateWaypoints',\n 'connection.reconnectEnd',\n 'connection.reconnectStart'\n ], updateConnectionWaypoints);\n}\n\ninherits(BpmnUpdater, CommandInterceptor);\n\nmodule.exports = BpmnUpdater;\n\nBpmnUpdater.$inject = [ 'eventBus', 'bpmnFactory', 'connectionDocking'];\n\n\n/////// implementation //////////////////////////////////\n\n\nBpmnUpdater.prototype.updateParent = function(element) {\n\n // do not update BPMN 2.0 label parent\n if (element instanceof Model.Label) {\n return;\n }\n\n var parentShape = element.parent;\n\n var businessObject = element.businessObject,\n parentBusinessObject = parentShape && parentShape.businessObject,\n parentDi = parentBusinessObject && parentBusinessObject.di;\n\n this.updateSemanticParent(businessObject, parentBusinessObject);\n\n this.updateDiParent(businessObject.di, parentDi);\n};\n\n\nBpmnUpdater.prototype.updateBounds = function(shape) {\n\n var di = shape.businessObject.di;\n\n var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;\n\n assign(bounds, {\n x: shape.x,\n y: shape.y,\n width: shape.width,\n height: shape.height\n });\n};\n\n\nBpmnUpdater.prototype.updateDiParent = function(di, parentDi) {\n\n if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {\n parentDi = parentDi.$parent;\n }\n\n if (di.$parent === parentDi) {\n return;\n }\n\n var planeElements = (parentDi || di.$parent).get('planeElement');\n\n if (parentDi) {\n planeElements.push(di);\n di.$parent = parentDi;\n } else {\n Collections.remove(planeElements, di);\n di.$parent = null;\n }\n};\n\nfunction getDefinitions(element) {\n while (element && !element.$instanceOf('bpmn:Definitions')) {\n element = element.$parent;\n }\n\n return element;\n}\n\nBpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {\n\n var containment;\n\n if (businessObject.$parent === newParent) {\n return;\n }\n\n if (businessObject.$instanceOf('bpmn:FlowElement')) {\n\n if (newParent && newParent.$instanceOf('bpmn:Participant')) {\n newParent = newParent.processRef;\n }\n\n containment = 'flowElements';\n\n } else\n\n if (businessObject.$instanceOf('bpmn:Artifact')) {\n\n while (newParent &&\n !newParent.$instanceOf('bpmn:Process') &&\n !newParent.$instanceOf('bpmn:SubProcess') &&\n !newParent.$instanceOf('bpmn:Collaboration')) {\n\n if (newParent.$instanceOf('bpmn:Participant')) {\n newParent = newParent.processRef;\n break;\n } else {\n newParent = newParent.$parent;\n }\n }\n\n containment = 'artifacts';\n } else\n\n if (businessObject.$instanceOf('bpmn:MessageFlow')) {\n containment = 'messageFlows';\n\n } else\n\n if (businessObject.$instanceOf('bpmn:Participant')) {\n containment = 'participants';\n\n // make sure the participants process is properly attached / detached\n // from the XML document\n\n var process = businessObject.processRef,\n definitions;\n\n if (process) {\n definitions = getDefinitions(businessObject.$parent || newParent);\n\n if (businessObject.$parent) {\n Collections.remove(definitions.get('rootElements'), process);\n process.$parent = null;\n }\n\n if (newParent) {\n Collections.add(definitions.get('rootElements'), process);\n process.$parent = definitions;\n }\n }\n }\n\n if (!containment) {\n throw new Error('no parent for ', businessObject, newParent);\n }\n\n var children;\n\n if (businessObject.$parent) {\n // remove from old parent\n children = businessObject.$parent.get(containment);\n Collections.remove(children, businessObject);\n }\n\n if (!newParent) {\n businessObject.$parent = null;\n } else {\n // add to new parent\n children = newParent.get(containment);\n children.push(businessObject);\n businessObject.$parent = newParent;\n }\n};\n\n\nBpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {\n\n connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));\n};\n\n\nBpmnUpdater.prototype.updateConnection = function(connection) {\n\n var businessObject = connection.businessObject,\n newSource = connection.source && connection.source.businessObject,\n newTarget = connection.target && connection.target.businessObject;\n\n var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');\n\n if (businessObject.sourceRef !== newSource) {\n if (inverseSet) {\n Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);\n\n if (newSource) {\n newSource.get('outgoing').push(businessObject);\n }\n }\n\n businessObject.sourceRef = newSource;\n }\n if (businessObject.targetRef !== newTarget) {\n if (inverseSet) {\n Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);\n\n if (newTarget) {\n newTarget.get('incoming').push(businessObject);\n }\n }\n\n businessObject.targetRef = newTarget;\n }\n\n businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));\n};\n\n\n/////// helpers /////////////////////////////////////////\n\nBpmnUpdater.prototype._getLabel = function(di) {\n if (!di.label) {\n di.label = this._bpmnFactory.createDiLabel();\n }\n\n return di.label;\n};","'use strict';\n\nvar assign = require(325),\n inherits = require(195);\n\nvar BaseElementFactory = require(79),\n LabelUtil = require(46);\n\n\n/**\n * A bpmn-aware factory for diagram-js shapes\n */\nfunction ElementFactory(bpmnFactory, moddle) {\n BaseElementFactory.call(this);\n\n this._bpmnFactory = bpmnFactory;\n this._moddle = moddle;\n}\n\ninherits(ElementFactory, BaseElementFactory);\n\n\nElementFactory.$inject = [ 'bpmnFactory', 'moddle' ];\n\nmodule.exports = ElementFactory;\n\nElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;\n\nElementFactory.prototype.create = function(elementType, attrs) {\n\n // no special magic for labels,\n // we assume their businessObjects have already been created\n // and wired via attrs\n if (elementType === 'label') {\n return this.baseCreate(elementType, assign({ type: 'label' }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));\n }\n\n attrs = attrs || {};\n\n var businessObject = attrs.businessObject,\n size;\n\n if (!businessObject) {\n if (!attrs.type) {\n throw new Error('no shape type specified');\n }\n\n businessObject = this._bpmnFactory.create(attrs.type);\n }\n\n if (!businessObject.di) {\n if (elementType === 'root') {\n businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {\n id: businessObject.id + '_di'\n });\n } else\n if (elementType === 'connection') {\n businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {\n id: businessObject.id + '_di'\n });\n } else {\n businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {\n id: businessObject.id + '_di'\n });\n }\n }\n\n if (!!attrs.isExpanded) {\n businessObject.di.isExpanded = attrs.isExpanded;\n }\n\n if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {\n businessObject.di.isMarkerVisible = true;\n }\n\n if (attrs._eventDefinitionType) {\n var eventDefinitions = businessObject.get('eventDefinitions') || [],\n newEventDefinition = this._moddle.create(attrs._eventDefinitionType);\n\n eventDefinitions.push(newEventDefinition);\n businessObject.eventDefinitions = eventDefinitions;\n }\n\n size = this._getDefaultSize(businessObject);\n\n attrs = assign({\n businessObject: businessObject,\n id: businessObject.id\n }, size, attrs);\n\n return this.baseCreate(elementType, attrs);\n};\n\n\nElementFactory.prototype._getDefaultSize = function(semantic) {\n\n if (semantic.$instanceOf('bpmn:SubProcess')) {\n var isExpanded = semantic.di.isExpanded === true;\n\n if (isExpanded) {\n return { width: 350, height: 200 };\n } else {\n return { width: 100, height: 80 };\n }\n }\n\n if (semantic.$instanceOf('bpmn:Task')) {\n return { width: 100, height: 80 };\n }\n\n if (semantic.$instanceOf('bpmn:Gateway')) {\n return { width: 50, height: 50 };\n }\n\n if (semantic.$instanceOf('bpmn:Event')) {\n return { width: 36, height: 36 };\n }\n\n if (semantic.$instanceOf('bpmn:Participant')) {\n return { width: 600, height: 250 };\n }\n\n return { width: 100, height: 80 };\n};\n\n\nElementFactory.prototype.createParticipantShape = function(collapsed) {\n\n var participantShape = this.createShape({ type: 'bpmn:Participant' });\n\n if (!collapsed) {\n participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');\n }\n\n return participantShape;\n};","'use strict';\n\nvar assign = require(325),\n forEach = require(204);\n\nvar LabelUtil = require(46);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n getExternalLabelMid = LabelUtil.getExternalLabelMid;\n\n\nfunction LabelSupport(eventBus, modeling, bpmnFactory) {\n\n // create external labels on shape creation\n\n eventBus.on([\n 'commandStack.shape.create.postExecute',\n 'commandStack.connection.create.postExecute'\n ], function(e) {\n var context = e.context;\n\n var element = context.shape || context.connection,\n businessObject = element.businessObject;\n\n var position;\n\n if (hasExternalLabel(businessObject)) {\n position = getExternalLabelMid(element);\n modeling.createLabel(element, position, {\n id: businessObject.id + '_label',\n businessObject: businessObject\n });\n }\n });\n\n\n // indicate label is dragged during move\n\n // we need to add labels to the list of selected\n // shapes before the visuals get drawn.\n //\n // Hence this awesome magic number.\n //\n eventBus.on('shape.move.start', function(e) {\n\n var context = e.context,\n shapes = context.shapes;\n\n var labels = [];\n\n forEach(shapes, function(element) {\n var label = element.label;\n\n if (label && !label.hidden && context.shapes.indexOf(label) === -1) {\n labels.push(label);\n }\n });\n\n forEach(labels, function(label) {\n shapes.push(label);\n });\n });\n\n\n // move labels with shapes\n\n eventBus.on([\n 'commandStack.shapes.move.postExecute'\n ], function(e) {\n\n var context = e.context,\n closure = context.closure,\n enclosedElements = closure.enclosedElements;\n\n // ensure we move all labels with their respective elements\n // if they have not been moved already\n\n forEach(enclosedElements, function(e) {\n if (e.label && !enclosedElements[e.label.id]) {\n modeling.moveShape(e.label, context.delta, e.parent);\n }\n });\n });\n\n\n // update di information on label movement and creation\n\n eventBus.on([\n 'commandStack.label.create.executed',\n 'commandStack.shape.moved.executed'\n ], function(e) {\n\n var element = e.context.shape,\n businessObject = element.businessObject,\n di = businessObject.di;\n\n // we want to trigger on real labels only\n if (!element.labelTarget) {\n return;\n }\n\n if (!di.label) {\n di.label = bpmnFactory.create('bpmndi:BPMNLabel', {\n bounds: bpmnFactory.create('dc:Bounds')\n });\n }\n\n assign(di.label.bounds, {\n x: element.x,\n y: element.y,\n width: element.width,\n height: element.height\n });\n });\n}\n\nLabelSupport.$inject = [ 'eventBus', 'modeling', 'bpmnFactory' ];\n\nmodule.exports = LabelSupport;\n","'use strict';\n\nvar inherits = require(195);\n\nvar BaseModeling = require(108);\n\nvar UpdatePropertiesHandler = require(29),\n UpdateCanvasRootHandler = require(28);\n\n\n/**\n * BPMN 2.0 modeling features activator\n *\n * @param {EventBus} eventBus\n * @param {ElementFactory} elementFactory\n * @param {CommandStack} commandStack\n * @param {BpmnRules} bpmnRules\n */\nfunction Modeling(eventBus, elementFactory, commandStack, bpmnRules) {\n BaseModeling.call(this, eventBus, elementFactory, commandStack);\n\n this._bpmnRules = bpmnRules;\n}\n\ninherits(Modeling, BaseModeling);\n\nModeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack', 'bpmnRules' ];\n\nmodule.exports = Modeling;\n\n\nModeling.prototype.getHandlers = function() {\n var handlers = BaseModeling.prototype.getHandlers.call(this);\n\n handlers['element.updateProperties'] = UpdatePropertiesHandler;\n handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;\n\n return handlers;\n};\n\n\nModeling.prototype.updateLabel = function(element, newLabel) {\n this._commandStack.execute('element.updateLabel', {\n element: element,\n newLabel: newLabel\n });\n};\n\n\nvar getSharedParent = require(21).getSharedParent;\n\nModeling.prototype.connect = function(source, target, attrs) {\n\n var bpmnRules = this._bpmnRules;\n\n if (!attrs) {\n if (bpmnRules.canConnectMessageFlow(source, target)) {\n attrs = {\n type: 'bpmn:MessageFlow'\n };\n } else\n if (bpmnRules.canConnectSequenceFlow(source, target)) {\n attrs = {\n type: 'bpmn:SequenceFlow'\n };\n } else {\n attrs = {\n type: 'bpmn:Association'\n };\n }\n }\n\n return this.createConnection(source, target, attrs, getSharedParent(source, target));\n};\n\n\nModeling.prototype.updateProperties = function(element, properties) {\n this._commandStack.execute('element.updateProperties', {\n element: element,\n properties: properties\n });\n};\n\n\n/**\n * Transform the current diagram into a collaboration.\n *\n * @return {djs.model.Root} the new root element\n */\nModeling.prototype.makeCollaboration = function() {\n\n var collaborationElement = this._create('root', {\n type: 'bpmn:Collaboration'\n });\n\n var context = {\n newRoot: collaborationElement\n };\n\n this._commandStack.execute('canvas.updateRoot', context);\n\n return collaborationElement;\n};\n\n/**\n * Transform the current diagram into a process.\n *\n * @return {djs.model.Root} the new root element\n */\nModeling.prototype.makeProcess = function() {\n\n var processElement = this._create('root', {\n type: 'bpmn:Process'\n });\n\n var context = {\n newRoot: processElement\n };\n\n this._commandStack.execute('canvas.updateRoot', context);\n};","'use strict';\n\nvar find = require(203);\n\n\nfunction getParents(element) {\n\n var parents = [];\n\n while (element) {\n element = element.parent;\n\n if (element) {\n parents.push(element);\n }\n }\n\n return parents;\n}\n\nmodule.exports.getParents = getParents;\n\n\nfunction getSharedParent(a, b) {\n\n var parentsA = getParents(a),\n parentsB = getParents(b);\n\n return find(parentsA, function(parent) {\n return parentsB.indexOf(parent) !== -1;\n });\n}\n\nmodule.exports.getSharedParent = getSharedParent;","'use strict';\n\nvar inherits = require(195);\n\nvar is = require(47).is;\n\nvar CommandInterceptor = require(75);\n\n\nfunction AppendBehavior(eventBus, elementFactory, bpmnRules) {\n\n CommandInterceptor.call(this, eventBus);\n\n // assign correct shape position unless already set\n\n this.preExecute('shape.append', function(context) {\n\n var source = context.source,\n shape = context.shape;\n\n if (!context.position) {\n\n if (is(shape, 'bpmn:TextAnnotation')) {\n context.position = {\n x: source.x + source.width / 2 + 75,\n y: source.y - (50) - shape.height / 2\n };\n } else {\n context.position = {\n x: source.x + source.width + 80 + shape.width / 2,\n y: source.y + source.height / 2\n };\n }\n }\n }, true);\n}\n\n\nAppendBehavior.$inject = [ 'eventBus', 'elementFactory', 'bpmnRules' ];\n\ninherits(AppendBehavior, CommandInterceptor);\n\nmodule.exports = AppendBehavior;","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is;\n\n/**\n * BPMN specific create behavior\n */\nfunction CreateBehavior(eventBus, modeling) {\n\n CommandInterceptor.call(this, eventBus);\n\n\n /**\n * morph process into collaboration before adding\n * participant onto collaboration\n */\n\n this.preExecute('shape.create', function(context) {\n\n var parent = context.parent,\n shape = context.shape,\n position = context.position;\n\n if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {\n\n // this is going to detach the process root\n // and set the returned collaboration element\n // as the new root element\n var collaborationElement = modeling.makeCollaboration();\n\n // monkey patch the create context\n // so that the participant is being dropped\n // onto the new collaboration root instead\n context.position = position;\n context.parent = collaborationElement;\n\n context.processRoot = parent;\n }\n }, true);\n\n this.execute('shape.create', function(context) {\n\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n context.oldProcessRef = shape.businessObject.processRef;\n\n // assign the participant processRef\n shape.businessObject.processRef = processRoot.businessObject;\n }\n }, true);\n\n this.revert('shape.create', function(context) {\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n // assign the participant processRef\n shape.businessObject.processRef = context.oldProcessRef;\n }\n }, true);\n\n this.postExecute('shape.create', function(context) {\n\n var processRoot = context.processRoot,\n shape = context.shape;\n\n if (processRoot) {\n // process root is already detached at this point\n var processChildren = processRoot.children.slice();\n modeling.moveShapes(processChildren, { x: 0, y: 0 }, shape);\n }\n }, true);\n\n}\n\nCreateBehavior.$inject = [ 'eventBus', 'modeling' ];\n\ninherits(CreateBehavior, CommandInterceptor);\n\nmodule.exports = CreateBehavior;","'use strict';\n\nvar forEach = require(204),\n inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is,\n getSharedParent = require(21).getSharedParent;\n\n\nfunction DropBehavior(eventBus, modeling, bpmnRules) {\n\n CommandInterceptor.call(this, eventBus);\n\n // remove sequence flows that should not be allowed\n // after a move operation\n\n this.postExecute('shapes.move', function(context) {\n\n var closure = context.closure,\n allConnections = closure.allConnections;\n\n forEach(allConnections, function(c) {\n\n var source = c.source,\n target = c.target;\n\n var replacementType,\n remove;\n\n /**\n * Check if incoming or outgoing connections\n * can stay or could be substituted with an\n * appropriate replacement.\n *\n * This holds true for SequenceFlow <> MessageFlow.\n */\n\n if (is(c, 'bpmn:SequenceFlow')) {\n if (!bpmnRules.canConnectSequenceFlow(source, target)) {\n remove = true;\n }\n\n if (bpmnRules.canConnectMessageFlow(source, target)) {\n replacementType = 'bpmn:MessageFlow';\n }\n }\n\n // transform message flows into sequence flows, if possible\n\n if (is(c, 'bpmn:MessageFlow')) {\n\n if (!bpmnRules.canConnectMessageFlow(source, target)) {\n remove = true;\n }\n\n if (bpmnRules.canConnectSequenceFlow(source, target)) {\n replacementType = 'bpmn:SequenceFlow';\n }\n }\n\n if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {\n remove = true;\n }\n\n\n // remove invalid connection\n if (remove) {\n modeling.removeConnection(c);\n }\n\n // replace SequenceFlow <> MessageFlow\n\n if (replacementType) {\n modeling.createConnection(source, target, {\n type: replacementType,\n waypoints: c.waypoints.slice()\n }, getSharedParent(source, target));\n }\n });\n }, true);\n}\n\ninherits(DropBehavior, CommandInterceptor);\n\nDropBehavior.$inject = [ 'eventBus', 'modeling', 'bpmnRules' ];\n\nmodule.exports = DropBehavior;","'use strict';\n\nvar is = require(47).is;\n\n\nfunction ModelingFeedback(eventBus, tooltips) {\n\n function showError(position, message) {\n tooltips.add({\n position: {\n x: position.x + 5,\n y: position.y + 5\n },\n type: 'error',\n timeout: 2000,\n html: '<div>' + message + '</div>'\n });\n }\n\n eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) {\n\n var context = event.context,\n shape = context.shape,\n target = context.target;\n\n if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {\n showError(event, 'flow elements must be children of pools/participants');\n }\n });\n\n}\n\n\nModelingFeedback.$inject = [ 'eventBus', 'tooltips' ];\n\nmodule.exports = ModelingFeedback;","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is;\n\n\n/**\n * BPMN specific remove behavior\n */\nfunction RemoveBehavior(eventBus, modeling) {\n\n CommandInterceptor.call(this, eventBus);\n\n\n /**\n * morph collaboration diagram into process diagram\n * after the last participant has been removed\n */\n\n this.preExecute('shape.delete', function(context) {\n\n var shape = context.shape,\n parent = shape.parent;\n\n // activate the behavior if the shape to be removed\n // is a participant\n if (is(shape, 'bpmn:Participant')) {\n context.collaborationRoot = parent;\n }\n }, true);\n\n this.postExecute('shape.delete', function(context) {\n\n var collaborationRoot = context.collaborationRoot;\n\n if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {\n // replace empty collaboration with process diagram\n modeling.makeProcess();\n }\n }, true);\n\n}\n\nRemoveBehavior.$inject = [ 'eventBus', 'modeling' ];\n\ninherits(RemoveBehavior, CommandInterceptor);\n\nmodule.exports = RemoveBehavior;","module.exports = {\n __init__: [\n 'appendBehavior',\n 'createBehavior',\n 'dropBehavior',\n 'removeBehavior',\n 'modelingFeedback'\n ],\n appendBehavior: [ 'type', require(22) ],\n dropBehavior: [ 'type', require(24) ],\n createBehavior: [ 'type', require(23) ],\n removeBehavior: [ 'type', require(26) ],\n modelingFeedback: [ 'type', require(25) ]\n};","'use strict';\n\nvar Collections = require(175);\n\n\nfunction UpdateCanvasRootHandler(canvas, modeling) {\n this._canvas = canvas;\n this._modeling = modeling;\n}\n\nUpdateCanvasRootHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = UpdateCanvasRootHandler;\n\n\nUpdateCanvasRootHandler.prototype.execute = function(context) {\n\n var canvas = this._canvas;\n\n var newRoot = context.newRoot,\n newRootBusinessObject = newRoot.businessObject,\n oldRoot = canvas.getRootElement(),\n oldRootBusinessObject = oldRoot.businessObject,\n bpmnDefinitions = oldRootBusinessObject.$parent,\n diPlane = oldRootBusinessObject.di;\n\n // (1) replace process old <> new root\n canvas.setRootElement(newRoot, true);\n\n // (2) update root elements\n Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);\n newRootBusinessObject.$parent = bpmnDefinitions;\n\n Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);\n oldRootBusinessObject.$parent = null;\n\n // (3) wire di\n oldRootBusinessObject.di = null;\n\n diPlane.bpmnElement = newRootBusinessObject;\n newRootBusinessObject.di = diPlane;\n\n context.oldRoot = oldRoot;\n};\n\n\nUpdateCanvasRootHandler.prototype.revert = function(context) {\n\n var canvas = this._canvas;\n\n var newRoot = context.newRoot,\n newRootBusinessObject = newRoot.businessObject,\n oldRoot = context.oldRoot,\n oldRootBusinessObject = oldRoot.businessObject,\n bpmnDefinitions = newRootBusinessObject.$parent,\n diPlane = newRootBusinessObject.di;\n\n // (1) replace process old <> new root\n canvas.setRootElement(oldRoot, true);\n\n // (2) update root elements\n Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);\n newRootBusinessObject.$parent = null;\n\n Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);\n oldRootBusinessObject.$parent = bpmnDefinitions;\n\n // (3) wire di\n newRootBusinessObject.di = null;\n\n diPlane.bpmnElement = oldRootBusinessObject;\n oldRootBusinessObject.di = diPlane;\n};","'use strict';\n\nvar assign = require(325),\n pick = require(330),\n keys = require(326);\n\nvar DEFAULT_FLOW = 'default',\n NAME = 'name',\n ID = 'id';\n\n\n/**\n * A handler that implements a BPMN 2.0 property update.\n *\n * This should be used to set simple properties on elements with\n * an underlying BPMN business object.\n *\n * Use respective diagram-js provided handlers if you would\n * like to perform automated modeling.\n */\nfunction UpdatePropertiesHandler(elementRegistry) {\n this._elementRegistry = elementRegistry;\n}\n\nUpdatePropertiesHandler.$inject = [ 'elementRegistry' ];\n\nmodule.exports = UpdatePropertiesHandler;\n\n\n////// api /////////////////////////////////////////////\n\n/**\n * Updates a BPMN element with a list of new properties\n *\n * @param {Object} context\n * @param {djs.model.Base} context.element the element to update\n * @param {Object} context.properties a list of properties to set on the element's\n * businessObject (the BPMN model element)\n *\n * @return {Array<djs.mode.Base>} the updated element\n */\nUpdatePropertiesHandler.prototype.execute = function(context) {\n\n var element = context.element,\n changed = [ element ];\n\n if (!element) {\n throw new Error('element required');\n }\n\n var elementRegistry = this._elementRegistry;\n\n var businessObject = element.businessObject,\n properties = context.properties,\n oldProperties = context.oldProperties || pick(businessObject, keys(properties));\n\n if (ID in properties) {\n elementRegistry.updateId(element, properties[ID]);\n }\n\n // correctly indicate visual changes on default flow updates\n if (DEFAULT_FLOW in properties) {\n\n if (properties[DEFAULT_FLOW]) {\n changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));\n }\n\n if (businessObject[DEFAULT_FLOW]) {\n changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));\n }\n }\n\n if (NAME in properties && element.label) {\n changed.push(element.label);\n }\n\n // update properties\n assign(businessObject, properties);\n\n\n // store old values\n context.oldProperties = oldProperties;\n context.changed = changed;\n\n // indicate changed on objects affected by the update\n return changed;\n};\n\n/**\n * Reverts the update on a BPMN elements properties.\n *\n * @param {Object} context\n *\n * @return {djs.mode.Base} the updated element\n */\nUpdatePropertiesHandler.prototype.revert = function(context) {\n\n var element = context.element,\n oldProperties = context.oldProperties,\n businessObject = element.businessObject,\n elementRegistry = this._elementRegistry;\n\n assign(businessObject, context.oldProperties);\n\n if (ID in oldProperties) {\n elementRegistry.updateId(element, oldProperties[ID]);\n }\n\n return context.changed;\n};","module.exports = {\n __init__: [ 'modeling', 'bpmnUpdater', 'labelSupport' ],\n __depends__: [\n require(14),\n require(32),\n require(27),\n require(77),\n require(160),\n require(93)\n ],\n bpmnFactory: [ 'type', require(15) ],\n bpmnUpdater: [ 'type', require(17) ],\n elementFactory: [ 'type', require(18) ],\n modeling: [ 'type', require(20) ],\n labelSupport: [ 'type', require(19) ],\n layouter: [ 'type', require(16) ],\n connectionDocking: [ 'type', require(165) ]\n};\n","'use strict';\n\nvar groupBy = require(205),\n size = require(209),\n find = require(203),\n inherits = require(195);\n\nvar getParents = require(21).getParents,\n is = require(47).is,\n getBusinessObject = require(47).getBusinessObject,\n isExpanded = require(45).isExpanded;\n\n\nvar RuleProvider = require(145);\n\n/**\n * BPMN specific modeling rule\n */\nfunction BpmnRules(eventBus) {\n RuleProvider.call(this, eventBus);\n}\n\ninherits(BpmnRules, RuleProvider);\n\nBpmnRules.$inject = [ 'eventBus' ];\n\nmodule.exports = BpmnRules;\n\nBpmnRules.prototype.init = function() {\n\n this.addRule('connection.create', function(context) {\n var source = context.source,\n target = context.target;\n\n return canConnect(source, target);\n });\n\n this.addRule('connection.reconnectStart', function(context) {\n\n var connection = context.connection,\n source = context.hover || context.source,\n target = connection.target;\n\n return canConnect(source, target, connection);\n });\n\n this.addRule('connection.reconnectEnd', function(context) {\n\n var connection = context.connection,\n source = connection.source,\n target = context.hover || context.target;\n\n return canConnect(source, target, connection);\n });\n\n this.addRule('connection.updateWaypoints', function(context) {\n // OK! but visually ignore\n return null;\n });\n\n this.addRule('shape.resize', function(context) {\n\n var shape = context.shape,\n newBounds = context.newBounds;\n\n return canResize(shape, newBounds);\n });\n\n this.addRule('shapes.move', function(context) {\n\n var target = context.newParent,\n shapes = context.shapes;\n\n return canMove(shapes, target);\n });\n\n this.addRule([ 'shape.create', 'shape.append' ], function(context) {\n var target = context.parent,\n shape = context.shape,\n source = context.source;\n\n return canCreate(shape, target, source);\n });\n\n};\n\nBpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;\n\nBpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;\n\nBpmnRules.prototype.canConnectAssociation = canConnectAssociation;\n\nBpmnRules.prototype.canMove = canMove;\n\nBpmnRules.prototype.canDrop = canDrop;\n\nBpmnRules.prototype.canCreate = canCreate;\n\nBpmnRules.prototype.canConnect = canConnect;\n\nBpmnRules.prototype.canResize = canResize;\n\n/**\n * Utility functions for rule checking\n */\n\nfunction nonExistantOrLabel(element) {\n return !element || isLabel(element);\n}\n\nfunction isSame(a, b) {\n return a === b;\n}\n\nfunction getOrganizationalParent(element) {\n\n var bo = getBusinessObject(element);\n\n while (bo && !is(bo, 'bpmn:Process')) {\n if (is(bo, 'bpmn:Participant')) {\n return bo.processRef || bo;\n }\n\n bo = bo.$parent;\n }\n\n return bo;\n}\n\nfunction isSameOrganization(a, b) {\n var parentA = getOrganizationalParent(a),\n parentB = getOrganizationalParent(b);\n\n return parentA === parentB;\n}\n\nfunction isMessageFlowSource(element) {\n return is(element, 'bpmn:InteractionNode') && (\n !is(element, 'bpmn:Event') || (\n is(element, 'bpmn:ThrowEvent') &&\n hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')\n )\n );\n}\n\nfunction isMessageFlowTarget(element) {\n return is(element, 'bpmn:InteractionNode') && (\n !is(element, 'bpmn:Event') || (\n is(element, 'bpmn:CatchEvent') &&\n hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')\n )\n );\n}\n\nfunction getScopeParent(element) {\n\n var bo = getBusinessObject(element);\n\n if (is(bo, 'bpmn:Participant')) {\n return null;\n }\n\n while (bo) {\n bo = bo.$parent;\n\n if (is(bo, 'bpmn:FlowElementsContainer')) {\n return bo;\n }\n }\n\n return bo;\n}\n\nfunction isSameScope(a, b) {\n var scopeParentA = getScopeParent(a),\n scopeParentB = getScopeParent(b);\n\n return scopeParentA && (scopeParentA === scopeParentB);\n}\n\nfunction hasEventDefinition(element, eventDefinition) {\n var bo = getBusinessObject(element);\n\n return !!find(bo.eventDefinitions || [], function(definition) {\n return is(definition, eventDefinition);\n });\n}\n\nfunction hasEventDefinitionOrNone(element, eventDefinition) {\n var bo = getBusinessObject(element);\n\n return (bo.eventDefinitions || []).every(function(definition) {\n return is(definition, eventDefinition);\n });\n}\n\nfunction isSequenceFlowSource(element) {\n return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(\n is(element, 'bpmn:IntermediateThrowEvent') &&\n hasEventDefinition(element, 'bpmn:LinkEventDefinition')\n );\n}\n\nfunction isSequenceFlowTarget(element) {\n return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(\n is(element, 'bpmn:IntermediateCatchEvent') &&\n hasEventDefinition(element, 'bpmn:LinkEventDefinition')\n );\n}\n\nfunction isEventBasedTarget(element) {\n return is(element, 'bpmn:ReceiveTask') || (\n is(element, 'bpmn:IntermediateCatchEvent') && (\n hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||\n hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||\n hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||\n hasEventDefinition(element, 'bpmn:SignalEventDefinition')\n )\n );\n}\n\nfunction isLabel(element) {\n return element.labelTarget;\n}\n\nfunction isConnection(element) {\n return element.waypoints;\n}\n\nfunction isParent(possibleParent, element) {\n var allParents = getParents(element);\n return allParents.indexOf(possibleParent) !== -1;\n}\n\nfunction canConnect(source, target, connection) {\n\n if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {\n return null;\n }\n\n // See https://github.com/bpmn-io/bpmn-js/issues/178\n // as a workround we disallow connections with same\n // target and source element.\n // This rule must be removed if a auto layout for this\n // connections is implemented.\n if (isSame(source, target)) {\n return false;\n }\n\n if (canConnectMessageFlow(source, target) ||\n canConnectSequenceFlow(source, target)) {\n\n return true;\n }\n\n if (is(connection, 'bpmn:Association')) {\n return canConnectAssociation(source, target);\n }\n\n return false;\n}\n\n/**\n * Can an element be dropped into the target element\n *\n * @return {Boolean}\n */\nfunction canDrop(element, target) {\n\n // can move labels everywhere\n if (isLabel(element) && !isConnection(target)) {\n return true;\n }\n\n // allow to create new participants on\n // on existing collaboration and process diagrams\n if (is(element, 'bpmn:Participant')) {\n return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');\n }\n\n // drop flow elements onto flow element containers\n // and participants\n if (is(element, 'bpmn:FlowElement')) {\n if (is(target, 'bpmn:FlowElementsContainer')) {\n return isExpanded(target) !== false;\n }\n\n return is(target, 'bpmn:Participant');\n }\n\n if (is(element, 'bpmn:Artifact')) {\n return is(target, 'bpmn:Collaboration') ||\n is(target, 'bpmn:Participant') ||\n is(target, 'bpmn:Process');\n }\n\n if (is(element, 'bpmn:MessageFlow')) {\n return is(target, 'bpmn:Collaboration');\n }\n\n return false;\n}\n\nfunction canMove(elements, target) {\n\n // only move if they have the same parent\n var sameParent = size(groupBy(elements, function(s) { return s.parent && s.parent.id; })) === 1;\n\n if (!sameParent) {\n return false;\n }\n\n if (!target) {\n return true;\n }\n\n return elements.every(function(element) {\n return canDrop(element, target);\n });\n}\n\nfunction canCreate(shape, target, source) {\n\n if (!target) {\n return false;\n }\n\n if (isLabel(target)) {\n return null;\n }\n\n if (isSame(source, target)) {\n return false;\n }\n\n // ensure we do not drop the element\n // into source\n if (source && isParent(source, target)) {\n return false;\n }\n\n return canDrop(shape, target);\n}\n\nfunction canResize(shape, newBounds) {\n if (is(shape, 'bpmn:SubProcess')) {\n return isExpanded(shape) && (\n !newBounds || (newBounds.width >= 100 && newBounds.height >= 80)\n );\n }\n\n if (is(shape, 'bpmn:Participant')) {\n return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);\n }\n\n if (is(shape, 'bpmn:TextAnnotation')) {\n return true;\n }\n\n return false;\n}\n\nfunction canConnectAssociation(source, target) {\n\n // do not connect connections\n if (isConnection(source) || isConnection(target)) {\n return false;\n }\n\n // connect if different parent\n return !isParent(target, source) &&\n !isParent(source, target);\n}\n\nfunction canConnectMessageFlow(source, target) {\n\n return isMessageFlowSource(source) &&\n isMessageFlowTarget(target) &&\n !isSameOrganization(source, target);\n}\n\nfunction canConnectSequenceFlow(source, target) {\n\n return isSequenceFlowSource(source) &&\n isSequenceFlowTarget(target) &&\n isSameScope(source, target) &&\n !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));\n}","module.exports = {\n __depends__: [\n require(147)\n ],\n __init__: [ 'bpmnRules' ],\n bpmnRules: [ 'type', require(31) ]\n};\n","'use strict';\n\nvar assign = require(325);\n\n/**\n * A palette provider for BPMN 2.0 elements.\n */\nfunction PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {\n\n this._create = create;\n this._elementFactory = elementFactory;\n this._spaceTool = spaceTool;\n this._lassoTool = lassoTool;\n\n palette.registerProvider(this);\n}\n\nmodule.exports = PaletteProvider;\n\nPaletteProvider.$inject = [ 'palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool' ];\n\n\nPaletteProvider.prototype.getPaletteEntries = function(element) {\n\n var actions = {},\n create = this._create,\n elementFactory = this._elementFactory,\n spaceTool = this._spaceTool,\n lassoTool = this._lassoTool;\n\n\n function createAction(type, group, className, title, options) {\n\n function createListener(event) {\n var shape = elementFactory.createShape(assign({ type: type }, options));\n\n if (options) {\n shape.businessObject.di.isExpanded = options.isExpanded;\n }\n\n create.start(event, shape);\n }\n\n var shortType = type.replace(/^bpmn/:/, '');\n\n return {\n group: group,\n className: className,\n title: title || 'Create ' + shortType,\n action: {\n dragstart: createListener,\n click: createListener\n }\n };\n }\n\n function createParticipant(event, collapsed) {\n create.start(event, elementFactory.createParticipantShape(collapsed));\n }\n\n assign(actions, {\n 'lasso-tool': {\n group: 'tools',\n className: 'icon-lasso-tool',\n title: 'Activate the lasso tool',\n action: {\n click: function(event) {\n lassoTool.activateSelection(event);\n }\n }\n },\n 'space-tool': {\n group: 'tools',\n className: 'icon-space-tool',\n title: 'Activate the create/remove space tool',\n action: {\n click: function(event) {\n spaceTool.activateSelection(event);\n }\n }\n },\n 'tool-separator': {\n group: 'tools',\n separator: true\n },\n 'create.start-event': createAction(\n 'bpmn:StartEvent', 'event', 'icon-start-event-none'\n ),\n 'create.intermediate-event': createAction(\n 'bpmn:IntermediateThrowEvent', 'event', 'icon-intermediate-event-none'\n ),\n 'create.end-event': createAction(\n 'bpmn:EndEvent', 'event', 'icon-end-event-none'\n ),\n 'create.exclusive-gateway': createAction(\n 'bpmn:ExclusiveGateway', 'gateway', 'icon-gateway-xor'\n ),\n 'create.task': createAction(\n 'bpmn:Task', 'activity', 'icon-task'\n ),\n 'create.subprocess-collapsed': createAction(\n 'bpmn:SubProcess', 'activity', 'icon-subprocess-collapsed', 'Create collapsed Sub Process',\n { isExpanded: false }\n ),\n 'create.subprocess-expanded': createAction(\n 'bpmn:SubProcess', 'activity', 'icon-subprocess-expanded', 'Create expanded SubProcess',\n { isExpanded: true }\n ),\n 'create.participant-expanded': {\n group: 'collaboration',\n className: 'icon-participant',\n title: 'Create Pool/Participant',\n action: {\n dragstart: createParticipant,\n click: createParticipant\n }\n }\n });\n\n return actions;\n};\n","module.exports = {\n __depends__: [\n require(137),\n require(99)\n ],\n __init__: [ 'paletteProvider' ],\n paletteProvider: [ 'type', require(33) ]\n};\n","'use strict';\n\nvar forEach = require(204),\n filter = require(202);\n\nvar REPLACE_OPTIONS = require(36);\n\nvar startEventReplace = REPLACE_OPTIONS.START_EVENT,\n intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,\n endEventReplace = REPLACE_OPTIONS.END_EVENT,\n gatewayReplace = REPLACE_OPTIONS.GATEWAY,\n taskReplace = REPLACE_OPTIONS.TASK;\n\n\n/**\n * A replace menu provider that gives users the controls to choose\n * and replace BPMN elements with each other.\n *\n * @param {BpmnFactory} bpmnFactory\n * @param {Moddle} moddle\n * @param {PopupMenu} popupMenu\n * @param {Replace} replace\n */\nfunction BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {\n\n /**\n * Prepares a new business object for the replacement element\n * and triggers the replace operation.\n *\n * @param {djs.model.Base} element\n * @param {Object} target\n * @return {djs.model.Base} the newly created element\n */\n function replaceElement(element, target) {\n\n var type = target.type,\n oldBusinessObject = element.businessObject,\n businessObject = bpmnFactory.create(type);\n\n var newElement = {\n type: type,\n businessObject: businessObject\n };\n\n // initialize custom BPMN extensions\n\n if (target.eventDefinition) {\n var eventDefinitions = businessObject.get('eventDefinitions'),\n eventDefinition = moddle.create(target.eventDefinition);\n\n eventDefinitions.push(eventDefinition);\n }\n\n if (target.instantiate !== undefined) {\n businessObject.instantiate = target.instantiate;\n }\n\n if (target.eventGatewayType !== undefined) {\n businessObject.eventGatewayType = target.eventGatewayType;\n }\n\n // copy size (for activities only)\n if (oldBusinessObject.$instanceOf('bpmn:Activity')) {\n\n // TODO: need also to respect min/max Size\n\n newElement.width = element.width;\n newElement.height = element.height;\n }\n\n // TODO: copy other elligable properties from old business object\n businessObject.name = oldBusinessObject.name;\n\n newElement = replace.replaceElement(element, newElement);\n\n selection.select(newElement);\n\n return newElement;\n }\n\n\n function getReplaceOptions(element) {\n\n var menuEntries = [];\n var businessObject = element.businessObject;\n\n if (businessObject.$instanceOf('bpmn:StartEvent')) {\n addEntries(startEventReplace, filterEvents);\n } else\n\n if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||\n businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {\n\n addEntries(intermediateEventReplace, filterEvents);\n } else\n\n if (businessObject.$instanceOf('bpmn:EndEvent')) {\n\n addEntries(endEventReplace, filterEvents);\n } else\n\n if (businessObject.$instanceOf('bpmn:Gateway')) {\n\n addEntries(gatewayReplace, function(entry) {\n\n return entry.target.type !== businessObject.$type;\n });\n } else\n\n if (businessObject.$instanceOf('bpmn:FlowNode')) {\n addEntries(taskReplace, function(entry) {\n return entry.target.type !== businessObject.$type;\n });\n }\n\n function filterEvents(entry) {\n\n var target = entry.target;\n\n var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;\n var isEventDefinitionEqual = target.eventDefinition == eventDefinition;\n var isEventTypeEqual = businessObject.$type == target.type;\n\n return ((!isEventDefinitionEqual && isEventTypeEqual) ||\n !isEventTypeEqual) ||\n !(isEventDefinitionEqual && isEventTypeEqual);\n }\n\n function addEntries(entries, filterFun) {\n // Filter selected type from the array\n var filteredEntries = filter(entries, filterFun);\n\n // Add entries to replace menu\n forEach(filteredEntries, function(definition) {\n\n var entry = addMenuEntry(definition);\n menuEntries.push(entry);\n });\n }\n\n function addMenuEntry(definition) {\n\n return {\n label: definition.label,\n className: definition.className,\n action: {\n name: definition.actionName,\n handler: function() {\n replaceElement(element, definition.target);\n }\n }\n };\n }\n\n return menuEntries;\n }\n\n\n // API\n\n this.openChooser = function(position, element) {\n var entries = this.getReplaceOptions(element);\n\n popupMenu.open('replace-menu', position, entries);\n };\n\n this.getReplaceOptions = getReplaceOptions;\n\n this.replaceElement = replaceElement;\n}\n\nBpmnReplace.$inject = [ 'bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection' ];\n\nmodule.exports = BpmnReplace;","'use strict';\n\nmodule.exports.START_EVENT = [\n {\n label: 'Start Event',\n actionName: 'replace-with-none-start',\n className: 'icon-start-event-none',\n target: {\n type: 'bpmn:StartEvent'\n }\n },\n {\n label: 'Intermediate Throw Event',\n actionName: 'replace-with-intermediate-throwing',\n className: 'icon-intermediate-event-none',\n target: {\n type: 'bpmn:IntermediateThrowEvent'\n }\n },\n {\n label: 'End Event',\n actionName: 'replace-with-message-end',\n className: 'icon-end-event-none',\n target: {\n type: 'bpmn:EndEvent'\n }\n },\n {\n label: 'Message Start Event',\n actionName: 'replace-with-message-start',\n className: 'icon-start-event-message',\n target: {\n type: 'bpmn:StartEvent',\n eventDefinition: 'bpmn:MessageEventDefinition'\n }\n },\n {\n label: 'Timer Start Event',\n actionName: 'replace-with-timer-start',\n className: 'icon-start-event-timer',\n target: {\n type: 'bpmn:StartEvent',\n eventDefinition: 'bpmn:TimerEventDefinition'\n }\n },\n {\n label: 'Conditional Start Event',\n actionName: 'replace-with-conditional-start',\n className: 'icon-start-event-condition',\n target: {\n type: 'bpmn:StartEvent',\n eventDefinition: 'bpmn:ConditionalEventDefinition'\n }\n },\n {\n label: 'Signal Start Event',\n actionName: 'replace-with-signal-start',\n className: 'icon-start-event-signal',\n target: {\n type: 'bpmn:StartEvent',\n eventDefinition: 'bpmn:SignalEventDefinition'\n }\n }\n];\n\nmodule.exports.INTERMEDIATE_EVENT = [\n {\n label: 'Start Event',\n actionName: 'replace-with-none-start',\n className: 'icon-start-event-none',\n target: {\n type: 'bpmn:StartEvent'\n }\n },\n {\n label: 'Intermediate Throw Event',\n actionName: 'replace-with-message-intermediate-throw',\n className: 'icon-intermediate-event-none',\n target: {\n type: 'bpmn:IntermediateThrowEvent'\n }\n },\n {\n label: 'End Event',\n actionName: 'replace-with-message-end',\n className: 'icon-end-event-none',\n target: {\n type: 'bpmn:EndEvent'\n }\n },\n {\n label: 'Message Intermediate Catch Event',\n actionName: 'replace-with-intermediate-catch',\n className: 'icon-intermediate-event-catch-message',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:MessageEventDefinition'\n }\n },\n {\n label: 'Message Intermediate Throw Event',\n actionName: 'replace-with-intermediate-throw',\n className: 'icon-intermediate-event-throw-message',\n target: {\n type: 'bpmn:IntermediateThrowEvent',\n eventDefinition: 'bpmn:MessageEventDefinition'\n }\n },\n {\n label: 'Timer Intermediate Catch Event',\n actionName: 'replace-with-timer-intermediate-catch',\n className: 'icon-intermediate-event-catch-timer',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:TimerEventDefinition'\n }\n },\n {\n label: 'Escalation Intermediate Catch Event',\n actionName: 'replace-with-escalation-catch',\n className: 'icon-intermediate-event-catch-escalation',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:EscalationEventDefinition'\n }\n },\n {\n label: 'Conditional Intermediate Catch Event',\n actionName: 'replace-with-conditional-intermediate-catch',\n className: 'icon-intermediate-event-catch-condition',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:ConditionalEventDefinition'\n }\n },\n {\n label: 'Link Intermediate Catch Event',\n actionName: 'replace-with-link-intermediate-catch',\n className: 'icon-intermediate-event-catch-link',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:LinkEventDefinition'\n }\n },\n {\n label: 'Link Intermediate Throw Event',\n actionName: 'replace-with-link-intermediate-throw',\n className: 'icon-intermediate-event-throw-link',\n target: {\n type: 'bpmn:IntermediateThrowEvent',\n eventDefinition: 'bpmn:LinkEventDefinition'\n }\n },\n {\n label: 'Compensation Intermediate Throw Event',\n actionName: 'replace-with-compensation-intermediate-throw',\n className: 'icon-intermediate-event-throw-compensation',\n target: {\n type: 'bpmn:IntermediateThrowEvent',\n eventDefinition: 'bpmn:CompensateEventDefinition'\n }\n },\n {\n label: 'Signal Throw Catch Event',\n actionName: 'replace-with-throw-intermediate-catch',\n className: 'icon-intermediate-event-catch-signal',\n target: {\n type: 'bpmn:IntermediateCatchEvent',\n eventDefinition: 'bpmn:SignalEventDefinition'\n }\n },\n {\n label: 'Signal Intermediate Throw Event',\n actionName: 'replace-with-signal-intermediate-throw',\n className: 'icon-intermediate-event-throw-signal',\n target: {\n type: 'bpmn:IntermediateThrowEvent',\n eventDefinition: 'bpmn:SignalEventDefinition'\n }\n }\n];\n\nmodule.exports.END_EVENT = [\n {\n label: 'Start Event',\n actionName: 'replace-with-none-start',\n className: 'icon-start-event-none',\n target: {\n type: 'bpmn:StartEvent'\n }\n },\n {\n label: 'Intermediate Throw Event',\n actionName: 'replace-with-message-intermediate-throw',\n className: 'icon-intermediate-event-none',\n target: {\n type: 'bpmn:IntermediateThrowEvent'\n }\n },\n {\n label: 'End Event',\n actionName: 'replace-with-none-end',\n className: 'icon-end-event-none',\n target: {\n type: 'bpmn:EndEvent'\n }\n },\n {\n label: 'Message End Event',\n actionName: 'replace-with-message-end',\n className: 'icon-end-event-message',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:MessageEventDefinition'\n }\n },\n {\n label: 'Escalation End Event',\n actionName: 'replace-with-escalation-end',\n className: 'icon-end-event-escalation',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:EscalationEventDefinition'\n }\n },\n {\n label: 'Error End Event',\n actionName: 'replace-with-error-end',\n className: 'icon-end-event-error',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:ErrorEventDefinition'\n }\n },\n {\n label: 'Cancel End Event',\n actionName: 'replace-with-cancel-end',\n className: 'icon-end-event-cancel',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:CancelEventDefinition'\n }\n },\n {\n label: 'Compensation End Event',\n actionName: 'replace-with-compensation-end',\n className: 'icon-end-event-compensation',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:CompensateEventDefinition'\n }\n },\n {\n label: 'Signal End Event',\n actionName: 'replace-with-signal-end',\n className: 'icon-end-event-signal',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:SignalEventDefinition'\n }\n },\n {\n label: 'Terminate End Event',\n actionName: 'replace-with-terminate-end',\n className: 'icon-end-event-terminate',\n target: {\n type: 'bpmn:EndEvent',\n eventDefinition: 'bpmn:TerminateEventDefinition'\n }\n }\n];\n\nmodule.exports.GATEWAY = [\n {\n label: 'Exclusive Gateway',\n actionName: 'replace-with-exclusive-gateway',\n className: 'icon-gateway-xor',\n target: {\n type: 'bpmn:ExclusiveGateway'\n }\n },\n {\n label: 'Parallel Gateway',\n actionName: 'replace-with-parallel-gateway',\n className: 'icon-gateway-parallel',\n target: {\n type: 'bpmn:ParallelGateway'\n }\n },\n {\n label: 'Inclusive Gateway',\n actionName: 'replace-with-inclusive-gateway',\n className: 'icon-gateway-or',\n target: {\n type: 'bpmn:InclusiveGateway'\n }\n },\n {\n label: 'Complex Gateway',\n actionName: 'replace-with-complex-gateway',\n className: 'icon-gateway-complex',\n target: {\n type: 'bpmn:ComplexGateway'\n }\n },\n {\n label: 'Event based Gateway',\n actionName: 'replace-with-event-based-gateway',\n className: 'icon-gateway-eventbased',\n target: {\n type: 'bpmn:EventBasedGateway',\n instantiate: false,\n eventGatewayType: 'Exclusive'\n }\n }\n // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194\n // {\n // label: 'Event based instantiating Gateway',\n // actionName: 'replace-with-exclusive-event-based-gateway',\n // className: 'icon-exclusive-event-based',\n // target: {\n // type: 'bpmn:EventBasedGateway'\n // },\n // options: {\n // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }\n // }\n // },\n // {\n // label: 'Parallel Event based instantiating Gateway',\n // actionName: 'replace-with-parallel-event-based-instantiate-gateway',\n // className: 'icon-parallel-event-based-instantiate-gateway',\n // target: {\n // type: 'bpmn:EventBasedGateway'\n // },\n // options: {\n // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }\n // }\n // }\n];\n\n\nmodule.exports.TASK = [\n {\n label: 'Task',\n actionName: 'replace-with-task',\n className: 'icon-task',\n target: {\n type: 'bpmn:Task'\n }\n },\n {\n label: 'Send Task',\n actionName: 'replace-with-send-task',\n className: 'icon-send',\n target: {\n type: 'bpmn:SendTask'\n }\n },\n {\n label: 'Receive Task',\n actionName: 'replace-with-receive-task',\n className: 'icon-receive',\n target: {\n type: 'bpmn:ReceiveTask'\n }\n },\n {\n label: 'User Task',\n actionName: 'replace-with-user-task',\n className: 'icon-user',\n target: {\n type: 'bpmn:UserTask'\n }\n },\n {\n label: 'Manual Task',\n actionName: 'replace-with-manual-task',\n className: 'icon-manual',\n target: {\n type: 'bpmn:ManualTask'\n }\n },\n {\n label: 'Business Rule Task',\n actionName: 'replace-with-rule-task',\n className: 'icon-business-rule',\n target: {\n type: 'bpmn:BusinessRuleTask'\n }\n },\n {\n label: 'Service Task',\n actionName: 'replace-with-service-task',\n className: 'icon-service',\n target: {\n type: 'bpmn:ServiceTask'\n }\n },\n {\n label: 'Script Task',\n actionName: 'replace-with-script-task',\n className: 'icon-script',\n target: {\n type: 'bpmn:ScriptTask'\n }\n }\n];","module.exports = {\n __depends__: [\n require(139),\n require(141),\n require(151)\n ],\n bpmnReplace: [ 'type', require(35) ]\n};","'use strict';\n\nvar inherits = require(195);\n\nvar forEach = require(204);\n\nvar getBoundingBox = require(177).getBBox;\nvar is = require(21).is;\n\nvar Snapping = require(154),\n SnapUtil = require(153);\n\nvar is = require(47).is;\n\nvar mid = SnapUtil.mid,\n topLeft = SnapUtil.topLeft,\n bottomRight = SnapUtil.bottomRight;\n\nvar round = Math.round;\n\n\n/**\n * BPMN specific snapping functionality\n *\n * * snap on process elements if a pool is created inside a\n * process diagram\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction BpmnSnapping(eventBus, canvas) {\n\n // instantiate super\n Snapping.call(this, eventBus, canvas);\n\n\n /**\n * Drop participant on process <> process elements snapping\n */\n\n function initParticipantSnapping(context, shape, elements) {\n\n if (!elements.length) {\n return;\n }\n\n var snapBox = getBoundingBox(elements.filter(function(e) {\n return !e.labelTarget && !e.waypoints;\n }));\n\n snapBox.x -= 50;\n snapBox.y -= 20;\n snapBox.width += 70;\n snapBox.height += 40;\n\n // adjust shape height to include bounding box\n shape.width = Math.max(shape.width, snapBox.width);\n shape.height = Math.max(shape.height, snapBox.height);\n\n context.participantSnapBox = snapBox;\n }\n\n function snapParticipant(snapBox, shape, event) {\n\n var shapeHalfWidth = shape.width / 2 - 30,\n shapeHalfHeight = shape.height / 2;\n\n var currentTopLeft = {\n x: event.x - shapeHalfWidth - 30,\n y: event.y - shapeHalfHeight\n };\n\n var currentBottomRight = {\n x: event.x + shapeHalfWidth + 30,\n y: event.y + shapeHalfHeight\n };\n\n var snapTopLeft = snapBox,\n snapBottomRight = bottomRight(snapBox);\n\n if (currentTopLeft.x >= snapTopLeft.x) {\n event.x = snapTopLeft.x + 30 + shapeHalfWidth;\n event.snapped = true;\n } else\n if (currentBottomRight.x <= snapBottomRight.x) {\n event.x = snapBottomRight.x - 30 - shapeHalfWidth;\n event.snapped = true;\n }\n\n if (currentTopLeft.y >= snapTopLeft.y) {\n event.y = snapTopLeft.y + shapeHalfHeight;\n event.snapped = true;\n } else\n if (currentBottomRight.y <= snapBottomRight.y) {\n event.y = snapBottomRight.y - shapeHalfHeight;\n event.snapped = true;\n }\n }\n\n eventBus.on('create.start', function(event) {\n\n var context = event.context,\n shape = context.shape,\n rootElement = canvas.getRootElement();\n\n // snap participant around existing elements (if any)\n if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {\n\n initParticipantSnapping(context, shape, rootElement.children);\n }\n });\n\n eventBus.on([ 'create.move', 'create.end' ], 1500, function(event) {\n\n var context = event.context,\n shape = context.shape,\n participantSnapBox = context.participantSnapBox;\n\n if (!event.snapped && participantSnapBox) {\n snapParticipant(participantSnapBox, shape, event);\n }\n });\n\n eventBus.on('resize.start', 1500, function(event) {\n var context = event.context,\n shape = context.shape;\n\n if (is(shape, 'bpmn:SubProcess')) {\n context.minDimensions = { width: 140, height: 120 };\n }\n\n if (is(shape, 'bpmn:Participant')) {\n context.minDimensions = { width: 400, height: 200 };\n }\n\n if (is(shape, 'bpmn:TextAnnotation')) {\n context.minDimensions = { width: 50, height: 50 };\n }\n });\n \n}\n\ninherits(BpmnSnapping, Snapping);\n\nBpmnSnapping.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = BpmnSnapping;\n\n\nBpmnSnapping.prototype.initSnap = function(event) {\n\n var context = event.context,\n shape = context.shape,\n shapeMid,\n shapeBounds,\n shapeTopLeft,\n shapeBottomRight,\n snapContext;\n\n\n snapContext = Snapping.prototype.initSnap.call(this, event);\n\n if (is(shape, 'bpmn:Participant')) {\n // assign higher priority for outer snaps on participants\n snapContext.setSnapLocations([ 'top-left', 'bottom-right', 'mid' ]);\n }\n\n\n if (shape) {\n\n shapeMid = mid(shape, event);\n\n shapeBounds = {\n width: shape.width,\n height: shape.height,\n x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,\n y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,\n };\n\n shapeTopLeft = topLeft(shapeBounds);\n shapeBottomRight = bottomRight(shapeBounds);\n\n snapContext.setSnapOrigin('top-left', {\n x: shapeTopLeft.x - event.x,\n y: shapeTopLeft.y - event.y\n });\n\n snapContext.setSnapOrigin('bottom-right', {\n x: shapeBottomRight.x - event.x,\n y: shapeBottomRight.y - event.y\n });\n\n\n forEach(shape.outgoing, function(c) {\n var docking = c.waypoints[0];\n\n docking = docking.original || docking;\n\n snapContext.setSnapOrigin(c.id + '-docking', {\n x: docking.x - event.x,\n y: docking.y - event.y\n });\n });\n\n forEach(shape.incoming, function(c) {\n var docking = c.waypoints[c.waypoints.length - 1];\n\n docking = docking.original || docking;\n\n snapContext.setSnapOrigin(c.id + '-docking', {\n x: docking.x - event.x,\n y: docking.y - event.y\n });\n });\n\n }\n\n var source = context.source;\n\n if (source) {\n snapContext.addDefaultSnap('mid', mid(source));\n }\n};\n\n\nBpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {\n\n var siblings = this.getSiblings(shape, target);\n\n\n forEach(siblings, function(s) {\n snapPoints.add('mid', mid(s));\n\n if (is(s, 'bpmn:Participant')) {\n snapPoints.add('top-left', topLeft(s));\n snapPoints.add('bottom-right', bottomRight(s));\n }\n });\n\n forEach(shape.incoming, function(c) {\n\n if (siblings.indexOf(c.source) === -1) {\n snapPoints.add('mid', mid(c.source));\n\n var docking = c.waypoints[0];\n snapPoints.add(c.id + '-docking', docking.original || docking);\n }\n });\n\n\n forEach(shape.outgoing, function(c) {\n\n if (siblings.indexOf(c.target) === -1) {\n snapPoints.add('mid', mid(c.target));\n\n var docking = c.waypoints[c.waypoints.length - 1];\n snapPoints.add(c.id + '-docking', docking.original || docking);\n }\n });\n\n};","module.exports = {\n __init__: [ 'snapping' ],\n snapping: [ 'type', require(38) ]\n};","'use strict';\n\nvar assign = require(325),\n map = require(207);\n\nvar LabelUtil = require(46);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n getExternalLabelBounds = LabelUtil.getExternalLabelBounds,\n isExpanded = require(45).isExpanded,\n elementToString = require(43).elementToString;\n\n\nfunction elementData(semantic, attrs) {\n return assign({\n id: semantic.id,\n type: semantic.$type,\n businessObject: semantic\n }, attrs);\n}\n\nfunction collectWaypoints(waypoints) {\n return map(waypoints, function(p) {\n return { x: p.x, y: p.y };\n });\n}\n\n\n/**\n * An importer that adds bpmn elements to the canvas\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementFactory} elementFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n this._elementFactory = elementFactory;\n this._elementRegistry = elementRegistry;\n}\n\nBpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];\n\nmodule.exports = BpmnImporter;\n\n\n/**\n * Add bpmn element (semantic) to the canvas onto the\n * specified parent shape.\n */\nBpmnImporter.prototype.add = function(semantic, parentElement) {\n\n var di = semantic.di,\n element;\n\n // ROOT ELEMENT\n // handle the special case that we deal with a\n // invisible root element (process or collaboration)\n if (di.$instanceOf('bpmndi:BPMNPlane')) {\n\n // add a virtual element (not being drawn)\n element = this._elementFactory.createRoot(elementData(semantic));\n\n this._canvas.setRootElement(element);\n }\n\n // SHAPE\n else if (di.$instanceOf('bpmndi:BPMNShape')) {\n\n var collapsed = !isExpanded(semantic);\n var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n var bounds = semantic.di.bounds;\n\n element = this._elementFactory.createShape(elementData(semantic, {\n collapsed: collapsed,\n hidden: hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n this._canvas.addShape(element, parentElement);\n }\n\n // CONNECTION\n else if (di.$instanceOf('bpmndi:BPMNEdge')) {\n\n var source = this._getSource(semantic),\n target = this._getTarget(semantic);\n\n element = this._elementFactory.createConnection(elementData(semantic, {\n source: source,\n target: target,\n waypoints: collectWaypoints(semantic.di.waypoint)\n }));\n\n this._canvas.addConnection(element, parentElement);\n } else {\n throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));\n }\n\n // (optional) LABEL\n if (hasExternalLabel(semantic)) {\n this.addLabel(semantic, element);\n }\n\n\n this._eventBus.fire('bpmnElement.added', { element: element });\n\n return element;\n};\n\n\n/**\n * add label for an element\n */\nBpmnImporter.prototype.addLabel = function(semantic, element) {\n var bounds = getExternalLabelBounds(semantic, element);\n\n var label = this._elementFactory.createLabel(elementData(semantic, {\n id: semantic.id + '_label',\n labelTarget: element,\n type: 'label',\n hidden: element.hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n return this._canvas.addShape(label, element.parent);\n};\n\n/**\n * Return the drawn connection end based on the given side.\n *\n * @throws {Error} if the end is not yet drawn\n */\nBpmnImporter.prototype._getEnd = function(semantic, side) {\n\n var element,\n refSemantic,\n type = semantic.$type;\n\n refSemantic = semantic[side + 'Ref'];\n\n // handle mysterious isMany DataAssociation#sourceRef\n if (side === 'source' && type === 'bpmn:DataInputAssociation') {\n refSemantic = refSemantic && refSemantic[0];\n }\n\n // fix source / target for DataInputAssociation / DataOutputAssociation\n if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||\n side === 'target' && type === 'bpmn:DataInputAssociation') {\n\n refSemantic = semantic.$parent;\n }\n\n element = refSemantic && this._getElement(refSemantic);\n\n if (element) {\n return element;\n }\n\n if (refSemantic) {\n throw new Error(\n 'element ' + elementToString(refSemantic) + ' referenced by ' +\n elementToString(semantic) + '#' + side + 'Ref not yet drawn');\n } else {\n throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');\n }\n};\n\nBpmnImporter.prototype._getSource = function(semantic) {\n return this._getEnd(semantic, 'source');\n};\n\nBpmnImporter.prototype._getTarget = function(semantic) {\n return this._getEnd(semantic, 'target');\n};\n\n\nBpmnImporter.prototype._getElement = function(semantic) {\n return this._elementRegistry.get(semantic.id);\n};\n","'use strict';\n\nvar filter = require(202),\n find = require(203),\n forEach = require(204);\n\nvar Refs = require(356);\n\nvar elementToString = require(43).elementToString;\n\nvar diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });\n\n/**\n * Returns true if an element has the given meta-model type\n *\n * @param {ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n return element.$instanceOf(type);\n}\n\n\n/**\n * Find a suitable display candidate for definitions where the DI does not\n * correctly specify one.\n */\nfunction findDisplayCandidate(definitions) {\n return find(definitions.rootElements, function(e) {\n return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');\n });\n}\n\n\nfunction BpmnTreeWalker(handler) {\n\n // list of containers already walked\n var handledProcesses = [];\n\n // list of elements to handle deferred to ensure\n // prerequisites are drawn\n var deferred = [];\n\n ///// Helpers /////////////////////////////////\n\n function contextual(fn, ctx) {\n return function(e) {\n fn(e, ctx);\n };\n }\n\n function visit(element, ctx) {\n\n var gfx = element.gfx;\n\n // avoid multiple rendering of elements\n if (gfx) {\n throw new Error('already rendered ' + elementToString(element));\n }\n\n // call handler\n return handler.element(element, ctx);\n }\n\n function visitRoot(element, diagram) {\n return handler.root(element, diagram);\n }\n\n function visitIfDi(element, ctx) {\n try {\n return element.di && visit(element, ctx);\n } catch (e) {\n logError(e.message, { element: element, error: e });\n\n console.error('failed to import ' + elementToString(element));\n console.error(e);\n }\n }\n\n function logError(message, context) {\n handler.error(message, context);\n }\n\n ////// DI handling ////////////////////////////\n\n function registerDi(di) {\n var bpmnElement = di.bpmnElement;\n\n if (bpmnElement) {\n if (bpmnElement.di) {\n logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });\n } else {\n diRefs.bind(bpmnElement, 'di');\n bpmnElement.di = di;\n }\n } else {\n logError('no bpmnElement referenced in ' + elementToString(di), { element: di });\n }\n }\n\n function handleDiagram(diagram) {\n handlePlane(diagram.plane);\n }\n\n function handlePlane(plane) {\n registerDi(plane);\n\n forEach(plane.planeElement, handlePlaneElement);\n }\n\n function handlePlaneElement(planeElement) {\n registerDi(planeElement);\n }\n\n\n ////// Semantic handling //////////////////////\n\n function handleDefinitions(definitions, diagram) {\n // make sure we walk the correct bpmnElement\n\n var diagrams = definitions.diagrams;\n\n if (diagram && diagrams.indexOf(diagram) === -1) {\n throw new Error('diagram not part of bpmn:Definitions');\n }\n\n if (!diagram && diagrams && diagrams.length) {\n diagram = diagrams[0];\n }\n\n // no diagram -> nothing to import\n if (!diagram) {\n return;\n }\n\n // load DI from selected diagram only\n handleDiagram(diagram);\n\n\n var plane = diagram.plane;\n\n if (!plane) {\n throw new Error('no plane for ' + elementToString(diagram));\n }\n\n\n var rootElement = plane.bpmnElement;\n\n // ensure we default to a suitable display candidate (process or collaboration),\n // even if non is specified in DI\n if (!rootElement) {\n rootElement = findDisplayCandidate(definitions);\n\n if (!rootElement) {\n return logError('no process or collaboration present to display');\n } else {\n\n logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));\n\n // correct DI on the fly\n plane.bpmnElement = rootElement;\n registerDi(plane);\n }\n }\n\n\n var ctx = visitRoot(rootElement, plane);\n\n if (is(rootElement, 'bpmn:Process')) {\n handleProcess(rootElement, ctx);\n } else if (is(rootElement, 'bpmn:Collaboration')) {\n handleCollaboration(rootElement, ctx);\n\n // force drawing of everything not yet drawn that is part of the target DI\n handleUnhandledProcesses(definitions.rootElements, ctx);\n } else {\n throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));\n }\n\n // handle all deferred elements\n handleDeferred(deferred);\n }\n\n function handleDeferred(deferred) {\n forEach(deferred, function(d) { d(); });\n }\n\n function handleProcess(process, context) {\n handleFlowElementsContainer(process, context);\n handleIoSpecification(process.ioSpecification, context);\n\n handleArtifacts(process.artifacts, context);\n\n // log process handled\n handledProcesses.push(process);\n }\n\n function handleUnhandledProcesses(rootElements) {\n\n // walk through all processes that have not yet been drawn and draw them\n // if they contain lanes with DI information.\n // we do this to pass the free-floating lane test cases in the MIWG test suite\n var processes = filter(rootElements, function(e) {\n return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;\n });\n\n processes.forEach(contextual(handleProcess));\n }\n\n function handleMessageFlow(messageFlow, context) {\n visitIfDi(messageFlow, context);\n }\n\n function handleMessageFlows(messageFlows, context) {\n forEach(messageFlows, contextual(handleMessageFlow, context));\n }\n\n function handleDataAssociation(association, context) {\n visitIfDi(association, context);\n }\n\n function handleDataInput(dataInput, context) {\n visitIfDi(dataInput, context);\n }\n\n function handleDataOutput(dataOutput, context) {\n visitIfDi(dataOutput, context);\n }\n\n function handleArtifact(artifact, context) {\n\n // bpmn:TextAnnotation\n // bpmn:Group\n // bpmn:Association\n\n visitIfDi(artifact, context);\n }\n\n function handleArtifacts(artifacts, context) {\n\n forEach(artifacts, function(e) {\n if (is(e, 'bpmn:Association')) {\n deferred.push(function() {\n handleArtifact(e, context);\n });\n } else {\n handleArtifact(e, context);\n }\n });\n }\n\n function handleIoSpecification(ioSpecification, context) {\n\n if (!ioSpecification) {\n return;\n }\n\n forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));\n forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));\n }\n\n function handleSubProcess(subProcess, context) {\n handleFlowElementsContainer(subProcess, context);\n handleArtifacts(subProcess.artifacts, context);\n }\n\n function handleFlowNode(flowNode, context) {\n var childCtx = visitIfDi(flowNode, context);\n\n if (is(flowNode, 'bpmn:SubProcess')) {\n handleSubProcess(flowNode, childCtx || context);\n }\n }\n\n function handleSequenceFlow(sequenceFlow, context) {\n visitIfDi(sequenceFlow, context);\n }\n\n function handleDataElement(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleBoundaryEvent(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleLane(lane, context) {\n var newContext = visitIfDi(lane, context);\n\n if (lane.childLaneSet) {\n handleLaneSet(lane.childLaneSet, newContext || context);\n } else {\n var filterList = filter(lane.flowNodeRef, function(e) {\n return e.$type !== 'bpmn:BoundaryEvent';\n });\n handleFlowElements(filterList, newContext || context);\n }\n }\n\n function handleLaneSet(laneSet, context) {\n forEach(laneSet.lanes, contextual(handleLane, context));\n }\n\n function handleLaneSets(laneSets, context) {\n forEach(laneSets, contextual(handleLaneSet, context));\n }\n\n function handleFlowElementsContainer(container, context) {\n\n if (container.laneSets) {\n handleLaneSets(container.laneSets, context);\n handleNonFlowNodes(container.flowElements);\n } else {\n handleFlowElements(container.flowElements, context);\n }\n }\n\n function handleNonFlowNodes(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n }\n });\n }\n\n function handleFlowElements(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:FlowNode')) {\n handleFlowNode(e, context);\n\n if (is(e, 'bpmn:Activity')) {\n\n handleIoSpecification(e.ioSpecification, context);\n\n // defer handling of associations\n deferred.push(function() {\n forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));\n forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));\n });\n }\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n } else {\n logError(\n 'unrecognized flowElement ' + elementToString(e) + ' in context ' +\n (context ? elementToString(context.businessObject) : null),\n { element: e, context: context });\n }\n });\n }\n\n function handleParticipant(participant, context) {\n var newCtx = visitIfDi(participant, context);\n\n var process = participant.processRef;\n if (process) {\n handleProcess(process, newCtx || context);\n }\n }\n\n function handleCollaboration(collaboration) {\n\n forEach(collaboration.participants, contextual(handleParticipant));\n\n handleArtifacts(collaboration.artifacts);\n\n // handle message flows latest in the process\n deferred.push(function() {\n handleMessageFlows(collaboration.messageFlows);\n });\n }\n\n\n ///// API ////////////////////////////////\n\n return {\n handleDefinitions: handleDefinitions\n };\n}\n\nmodule.exports = BpmnTreeWalker;","'use strict';\n\nvar BpmnTreeWalker = require(41);\n\n\n/**\n * Import the definitions into a diagram.\n *\n * Errors and warnings are reported through the specified callback.\n *\n * @param {Diagram} diagram\n * @param {ModdleElement} definitions\n * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done\n */\nfunction importBpmnDiagram(diagram, definitions, done) {\n\n var importer = diagram.get('bpmnImporter'),\n eventBus = diagram.get('eventBus');\n\n var error,\n warnings = [];\n\n function parse(definitions) {\n\n var visitor = {\n\n root: function(element) {\n return importer.add(element);\n },\n\n element: function(element, parentShape) {\n return importer.add(element, parentShape);\n },\n\n error: function(message, context) {\n warnings.push({ message: message, context: context });\n }\n };\n\n var walker = new BpmnTreeWalker(visitor);\n\n // import\n walker.handleDefinitions(definitions);\n }\n\n eventBus.fire('import.start');\n\n try {\n parse(definitions);\n } catch (e) {\n error = e;\n }\n\n eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });\n done(error, warnings);\n}\n\nmodule.exports.importBpmnDiagram = importBpmnDiagram;","'use strict';\n\nmodule.exports.elementToString = function(e) {\n if (!e) {\n return '<null>';\n }\n\n return '<' + e.$type + (e.id ? ' id=\"' + e.id : '') + '\" />';\n};","module.exports = {\n bpmnImporter: [ 'type', require(40) ]\n};","'use strict';\n\nvar is = require(47).is,\n getBusinessObject = require(47).getBusinessObject;\n\nmodule.exports.isExpanded = function(element) {\n\n if (is(element, 'bpmn:CallActivity')) {\n return false;\n }\n\n if (is(element, 'bpmn:SubProcess')) {\n return getBusinessObject(element).di.isExpanded;\n }\n\n if (is(element, 'bpmn:Participant')) {\n return !!getBusinessObject(element).processRef;\n }\n\n return true;\n};\n","'use strict';\n\nvar assign = require(325);\n\n\nvar DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {\n width: 90,\n height: 20\n};\n\n\n/**\n * Returns true if the given semantic has an external label\n *\n * @param {BpmnElement} semantic\n * @return {Boolean} true if has label\n */\nmodule.exports.hasExternalLabel = function(semantic) {\n\n return semantic.$instanceOf('bpmn:Event') ||\n semantic.$instanceOf('bpmn:Gateway') ||\n semantic.$instanceOf('bpmn:DataStoreReference') ||\n semantic.$instanceOf('bpmn:DataObjectReference') ||\n semantic.$instanceOf('bpmn:SequenceFlow') ||\n semantic.$instanceOf('bpmn:MessageFlow');\n};\n\n\n/**\n * Get the middle of a number of waypoints\n *\n * @param {Array<Point>} waypoints\n * @return {Point} the mid point\n */\nvar getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {\n\n var mid = waypoints.length / 2 - 1;\n\n var first = waypoints[Math.floor(mid)];\n var second = waypoints[Math.ceil(mid + 0.01)];\n\n return {\n x: first.x + (second.x - first.x) / 2,\n y: first.y + (second.y - first.y) / 2\n };\n};\n\n\nvar getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {\n\n if (element.waypoints) {\n return getWaypointsMid(element.waypoints);\n } else {\n return {\n x: element.x + element.width / 2,\n y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2\n };\n }\n};\n\n/**\n * Returns the bounds of an elements label, parsed from the elements DI or\n * generated from its bounds.\n *\n * @param {BpmnElement} semantic\n * @param {djs.model.Base} element\n */\nmodule.exports.getExternalLabelBounds = function(semantic, element) {\n\n var mid,\n size,\n bounds,\n di = semantic.di,\n label = di.label;\n\n if (label && label.bounds) {\n bounds = label.bounds;\n\n size = {\n width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),\n height: bounds.height\n };\n\n mid = {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n };\n } else {\n\n mid = getExternalLabelMid(element);\n\n size = DEFAULT_LABEL_SIZE;\n }\n\n return assign({\n x: mid.x - size.width / 2,\n y: mid.y - size.height / 2\n }, size);\n};","'use strict';\n\n/**\n * Is an element of the given BPMN type?\n *\n * @param {djs.model.Base|ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n var bo = getBusinessObject(element);\n\n return bo && bo.$instanceOf(type);\n}\n\nmodule.exports.is = is;\n\n\n/**\n * Return the business object for a given element.\n *\n * @param {djs.model.Base|ModdleElement} element\n *\n * @return {ModdleElement}\n */\nfunction getBusinessObject(element) {\n return (element && element.businessObject) || element;\n}\n\nmodule.exports.getBusinessObject = getBusinessObject;\n","module.exports = require(51);","'use strict';\n\nvar isString = require(322),\n isFunction = require(317),\n assign = require(325);\n\nvar Moddle = require(57),\n XmlReader = require(53),\n XmlWriter = require(54);\n\n/**\n * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.\n *\n * @class BpmnModdle\n * @extends Moddle\n *\n * @param {Object|Array} packages to use for instantiating the model\n * @param {Object} [options] additional options to pass over\n */\nfunction BpmnModdle(packages, options) {\n Moddle.call(this, packages, options);\n}\n\nBpmnModdle.prototype = Object.create(Moddle.prototype);\n\nmodule.exports = BpmnModdle;\n\n\n/**\n * Instantiates a BPMN model tree from a given xml string.\n *\n * @param {String} xmlStr\n * @param {String} [typeName='bpmn:Definitions'] name of the root element\n * @param {Object} [options] options to pass to the underlying reader\n * @param {Function} done callback that is invoked with (err, result, parseContext)\n * once the import completes\n */\nBpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {\n\n if (!isString(typeName)) {\n done = options;\n options = typeName;\n typeName = 'bpmn:Definitions';\n }\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var reader = new XmlReader(assign({ model: this, lax: true }, options));\n var rootHandler = reader.handler(typeName);\n\n reader.fromXML(xmlStr, rootHandler, done);\n};\n\n\n/**\n * Serializes a BPMN 2.0 object tree to XML.\n *\n * @param {String} element the root element, typically an instance of `bpmn:Definitions`\n * @param {Object} [options] to pass to the underlying writer\n * @param {Function} done callback invoked with (err, xmlStr) once the import completes\n */\nBpmnModdle.prototype.toXML = function(element, options, done) {\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var writer = new XmlWriter(options);\n try {\n var result = writer.toXML(element);\n done(null, result);\n } catch (e) {\n done(e);\n }\n};\n","'use strict';\n\nvar ID_PATTERN = /^(.*:)?id$/;\n\n/**\n * Extends the bpmn instance with id support.\n *\n * @example\n *\n * var moddle, ids;\n *\n * require('id-support').extend(moddle, ids);\n *\n * moddle.ids.next(); // create a next id\n * moddle.ids; // ids instance\n *\n * // claims id as used\n * moddle.create('foo:Bar', { id: 'fooobar1' });\n *\n *\n * @param {Moddle} model\n * @param {Ids} ids\n *\n * @return {Moddle} the extended moddle instance\n */\nmodule.exports.extend = function(model, ids) {\n\n var set = model.properties.set;\n\n // do not reinitialize setter\n // unless it is already initialized\n if (!model.ids) {\n\n model.properties.set = function(target, property, value) {\n\n // ensure we log used ids once they are assigned\n // to model elements\n if (ID_PATTERN.test(property)) {\n\n var assigned = model.ids.assigned(value);\n if (assigned && assigned !== target) {\n throw new Error('id <' + value + '> already used');\n }\n\n model.ids.claim(value, target);\n }\n\n set.call(this, target, property, value);\n };\n }\n\n model.ids = ids;\n\n return model;\n};","'use strict';\n\nvar assign = require(325);\n\nvar BpmnModdle = require(49);\n\nvar packages = {\n bpmn: require(66),\n bpmndi: require(67),\n dc: require(68),\n di: require(69)\n};\n\nmodule.exports = function(additionalPackages, options) {\n return new BpmnModdle(assign({}, packages, additionalPackages), options);\n};","'use strict';\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction lower(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n}\n\nfunction hasLowerCaseAlias(pkg) {\n return pkg.xml && pkg.xml.tagAlias === 'lowerCase';\n}\n\n\nmodule.exports.aliasToName = function(alias, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return capitalize(alias);\n } else {\n return alias;\n }\n};\n\nmodule.exports.nameToAlias = function(name, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return lower(name);\n } else {\n return name;\n }\n};\n\nmodule.exports.DEFAULT_NS_MAP = {\n 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'\n};\n\nmodule.exports.XSI_TYPE = 'xsi:type';","'use strict';\n\nvar reduce = require(208),\n forEach = require(204),\n find = require(203),\n assign = require(325),\n defer = require(215);\n\nvar Stack = require(56),\n SaxParser = require(55).parser,\n Moddle = require(57),\n parseNameNs = require(62).parseName,\n Types = require(65),\n coerceType = Types.coerceType,\n isSimpleType = Types.isSimple,\n common = require(52),\n XSI_TYPE = common.XSI_TYPE,\n XSI_URI = common.DEFAULT_NS_MAP.xsi,\n aliasToName = common.aliasToName;\n\nfunction parseNodeAttributes(node) {\n var nodeAttrs = node.attributes;\n\n return reduce(nodeAttrs, function(result, v, k) {\n var name, ns;\n\n if (!v.local) {\n name = v.prefix;\n } else {\n ns = parseNameNs(v.name, v.prefix);\n name = ns.name;\n }\n\n result[name] = v.value;\n return result;\n }, {});\n}\n\nfunction normalizeType(node, attr, model) {\n var nameNs = parseNameNs(attr.value);\n\n var uri = node.ns[nameNs.prefix || ''],\n localName = nameNs.localName,\n pkg = uri && model.getPackage(uri),\n typePrefix;\n\n if (pkg) {\n typePrefix = pkg.xml && pkg.xml.typePrefix;\n\n if (typePrefix && localName.indexOf(typePrefix) === 0) {\n localName = localName.slice(typePrefix.length);\n }\n\n attr.value = pkg.prefix + ':' + localName;\n }\n}\n\n/**\n * Normalizes namespaces for a node given an optional default namespace and a\n * number of mappings from uris to default prefixes.\n *\n * @param {XmlNode} node\n * @param {Model} model the model containing all registered namespaces\n * @param {Uri} defaultNsUri\n */\nfunction normalizeNamespaces(node, model, defaultNsUri) {\n var uri, prefix;\n\n uri = node.uri || defaultNsUri;\n\n if (uri) {\n var pkg = model.getPackage(uri);\n\n if (pkg) {\n prefix = pkg.prefix;\n } else {\n prefix = node.prefix;\n }\n\n node.prefix = prefix;\n node.uri = uri;\n }\n\n forEach(node.attributes, function(attr) {\n\n // normalize xsi:type attributes because the\n // assigned type may or may not be namespace prefixed\n if (attr.uri === XSI_URI && attr.local === 'type') {\n normalizeType(node, attr, model);\n }\n\n normalizeNamespaces(attr, model, null);\n });\n}\n\n\n/**\n * A parse context.\n *\n * @class\n *\n * @param {Object} options\n * @param {ElementHandler} options.parseRoot the root handler for parsing a document\n * @param {boolean} [options.lax=false] whether or not to ignore invalid elements\n */\nfunction Context(options) {\n\n /**\n * @property {ElementHandler} parseRoot\n */\n\n /**\n * @property {Boolean} lax\n */\n\n assign(this, options);\n\n var elementsById = this.elementsById = {};\n var references = this.references = [];\n var warnings = this.warnings = [];\n\n this.addReference = function(reference) {\n references.push(reference);\n };\n\n this.addElement = function(id, element) {\n\n if (!id || !element) {\n throw new Error('[xml-reader] id or ctx must not be null');\n }\n\n elementsById[id] = element;\n };\n\n this.addWarning = function (w) {\n warnings.push(w);\n };\n}\n\nfunction BaseHandler() {}\n\nBaseHandler.prototype.handleEnd = function() {};\nBaseHandler.prototype.handleText = function() {};\nBaseHandler.prototype.handleNode = function() {};\n\n\n/**\n * A simple pass through handler that does nothing except for\n * ignoring all input it receives.\n *\n * This is used to ignore unknown elements and\n * attributes.\n */\nfunction NoopHandler() { }\n\nNoopHandler.prototype = new BaseHandler();\n\nNoopHandler.prototype.handleNode = function() {\n return this;\n};\n\nfunction BodyHandler() {}\n\nBodyHandler.prototype = new BaseHandler();\n\nBodyHandler.prototype.handleText = function(text) {\n this.body = (this.body || '') + text;\n};\n\nfunction ReferenceHandler(property, context) {\n this.property = property;\n this.context = context;\n}\n\nReferenceHandler.prototype = new BodyHandler();\n\nReferenceHandler.prototype.handleNode = function(node) {\n\n if (this.element) {\n throw new Error('expected no sub nodes');\n } else {\n this.element = this.createReference(node);\n }\n\n return this;\n};\n\nReferenceHandler.prototype.handleEnd = function() {\n this.element.id = this.body;\n};\n\nReferenceHandler.prototype.createReference = function() {\n return {\n property: this.property.ns.name,\n id: ''\n };\n};\n\nfunction ValueHandler(propertyDesc, element) {\n this.element = element;\n this.propertyDesc = propertyDesc;\n}\n\nValueHandler.prototype = new BodyHandler();\n\nValueHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n propertyDesc = this.propertyDesc;\n\n value = coerceType(propertyDesc.type, value);\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(value);\n } else {\n element.set(propertyDesc.name, value);\n }\n};\n\n\nfunction BaseElementHandler() {}\n\nBaseElementHandler.prototype = Object.create(BodyHandler.prototype);\n\nBaseElementHandler.prototype.handleNode = function(node) {\n var parser = this,\n element = this.element,\n id;\n\n if (!element) {\n element = this.element = this.createElement(node);\n id = element.id;\n\n if (id) {\n this.context.addElement(id, element);\n }\n } else {\n parser = this.handleChild(node);\n }\n\n return parser;\n};\n\n/**\n * @class XMLReader.ElementHandler\n *\n */\nfunction ElementHandler(model, type, context) {\n this.model = model;\n this.type = model.getType(type);\n this.context = context;\n}\n\nElementHandler.prototype = new BaseElementHandler();\n\nElementHandler.prototype.addReference = function(reference) {\n this.context.addReference(reference);\n};\n\nElementHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n descriptor = element.$descriptor,\n bodyProperty = descriptor.bodyProperty;\n\n if (bodyProperty && value !== undefined) {\n value = coerceType(bodyProperty.type, value);\n element.set(bodyProperty.name, value);\n }\n};\n\n/**\n * Create an instance of the model from the given node.\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.createElement = function(node) {\n var attributes = parseNodeAttributes(node),\n Type = this.type,\n descriptor = Type.$descriptor,\n context = this.context,\n instance = new Type({});\n\n forEach(attributes, function(value, name) {\n\n var prop = descriptor.propertiesByName[name];\n\n if (prop && prop.isReference) {\n context.addReference({\n element: instance,\n property: prop.ns.name,\n id: value\n });\n } else {\n if (prop) {\n value = coerceType(prop.type, value);\n }\n\n instance.set(name, value);\n }\n });\n\n return instance;\n};\n\nElementHandler.prototype.getPropertyForNode = function(node) {\n\n var nameNs = parseNameNs(node.local, node.prefix);\n\n var type = this.type,\n model = this.model,\n descriptor = type.$descriptor;\n\n var propertyName = nameNs.name,\n property = descriptor.propertiesByName[propertyName],\n elementTypeName,\n elementType,\n typeAnnotation;\n\n // search for properties by name first\n\n if (property) {\n\n if (property.serialize === XSI_TYPE) {\n typeAnnotation = node.attributes[XSI_TYPE];\n\n // xsi type is optional, if it does not exists the\n // default type is assumed\n if (typeAnnotation) {\n\n elementTypeName = typeAnnotation.value;\n\n // TODO: extract real name from attribute\n elementType = model.getType(elementTypeName);\n\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n }\n\n // search for properties by name first\n return property;\n }\n\n\n var pkg = model.getPackage(nameNs.prefix);\n\n if (pkg) {\n elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);\n elementType = model.getType(elementTypeName);\n\n // search for collection members later\n property = find(descriptor.properties, function(p) {\n return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);\n });\n\n if (property) {\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n } else {\n // parse unknown element (maybe extension)\n property = find(descriptor.properties, function(p) {\n return !p.isReference && !p.isAttribute && p.type === 'Element';\n });\n\n if (property) {\n return property;\n }\n }\n\n throw new Error('unrecognized element <' + nameNs.name + '>');\n};\n\nElementHandler.prototype.toString = function() {\n return 'ElementDescriptor[' + this.type.$descriptor.name + ']';\n};\n\nElementHandler.prototype.valueHandler = function(propertyDesc, element) {\n return new ValueHandler(propertyDesc, element);\n};\n\nElementHandler.prototype.referenceHandler = function(propertyDesc) {\n return new ReferenceHandler(propertyDesc, this.context);\n};\n\nElementHandler.prototype.handler = function(type) {\n if (type === 'Element') {\n return new GenericElementHandler(this.model, type, this.context);\n } else {\n return new ElementHandler(this.model, type, this.context);\n }\n};\n\n/**\n * Handle the child element parsing\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.handleChild = function(node) {\n var propertyDesc, type, element, childHandler;\n\n propertyDesc = this.getPropertyForNode(node);\n element = this.element;\n\n type = propertyDesc.effectiveType || propertyDesc.type;\n\n if (isSimpleType(type)) {\n return this.valueHandler(propertyDesc, element);\n }\n\n if (propertyDesc.isReference) {\n childHandler = this.referenceHandler(propertyDesc).handleNode(node);\n } else {\n childHandler = this.handler(type).handleNode(node);\n }\n\n var newElement = childHandler.element;\n\n // child handles may decide to skip elements\n // by not returning anything\n if (newElement !== undefined) {\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(newElement);\n } else {\n element.set(propertyDesc.name, newElement);\n }\n\n if (propertyDesc.isReference) {\n assign(newElement, {\n element: element\n });\n\n this.context.addReference(newElement);\n } else {\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n }\n\n return childHandler;\n};\n\n\nfunction GenericElementHandler(model, type, context) {\n this.model = model;\n this.context = context;\n}\n\nGenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);\n\nGenericElementHandler.prototype.createElement = function(node) {\n\n var name = node.name,\n prefix = node.prefix,\n uri = node.ns[prefix],\n attributes = node.attributes;\n\n return this.model.createAny(name, uri, attributes);\n};\n\nGenericElementHandler.prototype.handleChild = function(node) {\n\n var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),\n element = this.element;\n\n var newElement = handler.element,\n children;\n\n if (newElement !== undefined) {\n children = element.$children = element.$children || [];\n children.push(newElement);\n\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n\n return handler;\n};\n\nGenericElementHandler.prototype.handleText = function(text) {\n this.body = this.body || '' + text;\n};\n\nGenericElementHandler.prototype.handleEnd = function() {\n if (this.body) {\n this.element.$body = this.body;\n }\n};\n\n/**\n * A reader for a meta-model\n *\n * @param {Object} options\n * @param {Model} options.model used to read xml files\n * @param {Boolean} options.lax whether to make parse errors warnings\n */\nfunction XMLReader(options) {\n\n if (options instanceof Moddle) {\n options = {\n model: options\n };\n }\n\n assign(this, { lax: false }, options);\n}\n\n\nXMLReader.prototype.fromXML = function(xml, rootHandler, done) {\n\n var model = this.model,\n lax = this.lax,\n context = new Context({\n parseRoot: rootHandler\n });\n\n var parser = new SaxParser(true, { xmlns: true, trim: true }),\n stack = new Stack();\n\n rootHandler.context = context;\n\n // push root handler\n stack.push(rootHandler);\n\n\n function resolveReferences() {\n\n var elementsById = context.elementsById;\n var references = context.references;\n\n var i, r;\n\n for (i = 0; !!(r = references[i]); i++) {\n var element = r.element;\n var reference = elementsById[r.id];\n var property = element.$descriptor.propertiesByName[r.property];\n\n if (!reference) {\n context.addWarning({\n message: 'unresolved reference <' + r.id + '>',\n element: r.element,\n property: r.property,\n value: r.id\n });\n }\n\n if (property.isMany) {\n var collection = element.get(property.name),\n idx = collection.indexOf(r);\n\n if (!reference) {\n // remove unresolvable reference\n collection.splice(idx, 1);\n } else {\n // update reference\n collection[idx] = reference;\n }\n } else {\n element.set(property.name, reference);\n }\n }\n }\n\n function handleClose(tagName) {\n stack.pop().handleEnd();\n }\n\n function handleOpen(node) {\n var handler = stack.peek();\n\n normalizeNamespaces(node, model);\n\n try {\n stack.push(handler.handleNode(node));\n } catch (e) {\n\n var line = this.line,\n column = this.column;\n\n var message =\n 'unparsable content <' + node.name + '> detected/n/t' +\n 'line: ' + line + '/n/t' +\n 'column: ' + column + '/n/t' +\n 'nested error: ' + e.message;\n\n if (lax) {\n context.addWarning({\n message: message,\n error: e\n });\n\n console.warn('could not parse node');\n console.warn(e);\n\n stack.push(new NoopHandler());\n } else {\n console.error('could not parse document');\n console.error(e);\n\n throw new Error(message);\n }\n }\n }\n\n function handleText(text) {\n stack.peek().handleText(text);\n }\n\n parser.onopentag = handleOpen;\n parser.oncdata = parser.ontext = handleText;\n parser.onclosetag = handleClose;\n parser.onend = resolveReferences;\n\n // deferred parse XML to make loading really ascnchronous\n // this ensures the execution environment (node or browser)\n // is kept responsive and that certain optimization strategies\n // can kick in\n defer(function() {\n var error;\n\n try {\n parser.write(xml).close();\n } catch (e) {\n error = e;\n }\n\n done(error, error ? undefined : rootHandler.element, context);\n });\n};\n\nXMLReader.prototype.handler = function(name) {\n return new ElementHandler(this.model, name);\n};\n\nmodule.exports = XMLReader;\nmodule.exports.ElementHandler = ElementHandler;","'use strict';\n\nvar map = require(207),\n forEach = require(204),\n isString = require(322),\n filter = require(202),\n assign = require(325);\n\nvar Types = require(65),\n parseNameNs = require(62).parseName,\n common = require(52),\n nameToAlias = common.nameToAlias;\n\nvar XML_PREAMBLE = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>/n',\n ESCAPE_CHARS = /(<|>|'|\"|&|/n/r|/n)/g,\n DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,\n XSI_TYPE = common.XSI_TYPE;\n\n\nfunction nsName(ns) {\n if (isString(ns)) {\n return ns;\n } else {\n return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;\n }\n}\n\nfunction getElementNs(ns, descriptor) {\n if (descriptor.isGeneric) {\n return descriptor.name;\n } else {\n return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);\n }\n}\n\nfunction getPropertyNs(ns, descriptor) {\n return assign({ localName: descriptor.ns.localName }, ns);\n}\n\nfunction getSerializableProperties(element) {\n var descriptor = element.$descriptor;\n\n return filter(descriptor.properties, function(p) {\n var name = p.name;\n\n // do not serialize defaults\n if (!element.hasOwnProperty(name)) {\n return false;\n }\n\n var value = element[name];\n\n // do not serialize default equals\n if (value === p.default) {\n return false;\n }\n\n return p.isMany ? value.length : true;\n });\n}\n\nvar ESCAPE_MAP = {\n '/n': '10',\n '/n/r': '10',\n '\"': '34',\n '/'': '39',\n '<': '60',\n '>': '62',\n '&': '38'\n};\n\n/**\n * Escape a string attribute to not contain any bad values (line breaks, '\"', ...)\n *\n * @param {String} str the string to escape\n * @return {String} the escaped string\n */\nfunction escapeAttr(str) {\n\n // ensure we are handling strings here\n str = isString(str) ? str : '' + str;\n\n return str.replace(ESCAPE_CHARS, function(str) {\n return '&#' + ESCAPE_MAP[str] + ';';\n });\n}\n\nfunction filterAttributes(props) {\n return filter(props, function(p) { return p.isAttr; });\n}\n\nfunction filterContained(props) {\n return filter(props, function(p) { return !p.isAttr; });\n}\n\n\nfunction ReferenceSerializer(parent, ns) {\n this.ns = ns;\n}\n\nReferenceSerializer.prototype.build = function(element) {\n this.element = element;\n return this;\n};\n\nReferenceSerializer.prototype.serializeTo = function(writer) {\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction BodySerializer() {}\n\nBodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {\n var escape = this.escape;\n\n if (escape) {\n writer.append('<![CDATA[');\n }\n\n writer.append(this.value);\n\n if (escape) {\n writer.append(']]>');\n }\n};\n\nBodySerializer.prototype.build = function(prop, value) {\n this.value = value;\n\n if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {\n this.escape = true;\n }\n\n return this;\n};\n\nfunction ValueSerializer(ns) {\n this.ns = ns;\n}\n\nValueSerializer.prototype = new BodySerializer();\n\nValueSerializer.prototype.serializeTo = function(writer) {\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>');\n\n this.serializeValue(writer);\n\n writer\n .append( '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction ElementSerializer(parent, ns) {\n this.body = [];\n this.attrs = [];\n\n this.parent = parent;\n this.ns = ns;\n}\n\nElementSerializer.prototype.build = function(element) {\n this.element = element;\n\n var otherAttrs = this.parseNsAttributes(element);\n\n if (!this.ns) {\n this.ns = this.nsTagName(element.$descriptor);\n }\n\n if (element.$descriptor.isGeneric) {\n this.parseGeneric(element);\n } else {\n var properties = getSerializableProperties(element);\n\n this.parseAttributes(filterAttributes(properties));\n this.parseContainments(filterContained(properties));\n\n this.parseGenericAttributes(element, otherAttrs);\n }\n\n return this;\n};\n\nElementSerializer.prototype.nsTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getElementNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.nsPropertyTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getPropertyNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.ns.uri;\n};\n\nElementSerializer.prototype.nsAttributeName = function(element) {\n\n var ns;\n\n if (isString(element)) {\n ns = parseNameNs(element);\n } else\n if (element.ns) {\n ns = element.ns;\n }\n\n var effectiveNs = this.logNamespaceUsed(ns);\n\n // strip prefix if same namespace like parent\n if (this.isLocalNs(effectiveNs)) {\n return { localName: ns.localName };\n } else {\n return assign({ localName: ns.localName }, effectiveNs);\n }\n};\n\nElementSerializer.prototype.parseGeneric = function(element) {\n\n var self = this,\n body = this.body,\n attrs = this.attrs;\n\n forEach(element, function(val, key) {\n\n if (key === '$body') {\n body.push(new BodySerializer().build({ type: 'String' }, val));\n } else\n if (key === '$children') {\n forEach(val, function(child) {\n body.push(new ElementSerializer(self).build(child));\n });\n } else\n if (key.indexOf('$') !== 0) {\n attrs.push({ name: key, value: escapeAttr(val) });\n }\n });\n};\n\n/**\n * Parse namespaces and return a list of left over generic attributes\n *\n * @param {Object} element\n * @return {Array<Object>}\n */\nElementSerializer.prototype.parseNsAttributes = function(element) {\n var self = this;\n\n var genericAttrs = element.$attrs;\n\n var attributes = [];\n\n // parse namespace attributes first\n // and log them. push non namespace attributes to a list\n // and process them later\n forEach(genericAttrs, function(value, name) {\n var nameNs = parseNameNs(name);\n\n if (nameNs.prefix === 'xmlns') {\n self.logNamespace({ prefix: nameNs.localName, uri: value });\n } else\n if (!nameNs.prefix && nameNs.localName === 'xmlns') {\n self.logNamespace({ uri: value });\n } else {\n attributes.push({ name: name, value: value });\n }\n });\n\n return attributes;\n};\n\nElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {\n\n var self = this;\n\n forEach(attributes, function(attr) {\n\n // do not serialize xsi:type attribute\n // it is set manually based on the actual implementation type\n if (attr.name === XSI_TYPE) {\n return;\n }\n\n try {\n self.addAttribute(self.nsAttributeName(attr.name), attr.value);\n } catch (e) {\n console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);\n }\n });\n};\n\nElementSerializer.prototype.parseContainments = function(properties) {\n\n var self = this,\n body = this.body,\n element = this.element;\n\n forEach(properties, function(p) {\n var value = element.get(p.name),\n isReference = p.isReference,\n isMany = p.isMany;\n\n var ns = self.nsPropertyTagName(p);\n\n if (!isMany) {\n value = [ value ];\n }\n\n if (p.isBody) {\n body.push(new BodySerializer().build(p, value[0]));\n } else\n if (Types.isSimple(p.type)) {\n forEach(value, function(v) {\n body.push(new ValueSerializer(ns).build(p, v));\n });\n } else\n if (isReference) {\n forEach(value, function(v) {\n body.push(new ReferenceSerializer(self, ns).build(v));\n });\n } else {\n // allow serialization via type\n // rather than element name\n var asType = p.serialize === XSI_TYPE;\n\n forEach(value, function(v) {\n var serializer;\n\n if (asType) {\n serializer = new TypeSerializer(self, ns);\n } else {\n serializer = new ElementSerializer(self);\n }\n\n body.push(serializer.build(v));\n });\n }\n });\n};\n\nElementSerializer.prototype.getNamespaces = function() {\n if (!this.parent) {\n if (!this.namespaces) {\n this.namespaces = {\n prefixMap: {},\n uriMap: {},\n used: {}\n };\n }\n } else {\n this.namespaces = this.parent.getNamespaces();\n }\n\n return this.namespaces;\n};\n\nElementSerializer.prototype.logNamespace = function(ns) {\n var namespaces = this.getNamespaces();\n\n var existing = namespaces.uriMap[ns.uri];\n\n if (!existing) {\n namespaces.uriMap[ns.uri] = ns;\n }\n\n namespaces.prefixMap[ns.prefix] = ns.uri;\n\n return ns;\n};\n\nElementSerializer.prototype.logNamespaceUsed = function(ns) {\n var element = this.element,\n model = element.$model,\n namespaces = this.getNamespaces();\n\n // ns may be\n //\n // * prefix only\n // * prefix:uri\n\n var prefix = ns.prefix;\n var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||\n namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);\n\n if (!uri) {\n throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');\n }\n\n ns = namespaces.uriMap[uri];\n\n if (!ns) {\n ns = this.logNamespace({ prefix: prefix, uri: uri });\n }\n\n if (!namespaces.used[ns.uri]) {\n namespaces.used[ns.uri] = ns;\n }\n\n return ns;\n};\n\nElementSerializer.prototype.parseAttributes = function(properties) {\n var self = this,\n element = this.element;\n\n forEach(properties, function(p) {\n self.logNamespaceUsed(p.ns);\n\n var value = element.get(p.name);\n\n if (p.isReference) {\n value = value.id;\n }\n\n self.addAttribute(self.nsAttributeName(p), value);\n });\n};\n\nElementSerializer.prototype.addAttribute = function(name, value) {\n var attrs = this.attrs;\n\n if (isString(value)) {\n value = escapeAttr(value);\n }\n\n attrs.push({ name: name, value: value });\n};\n\nElementSerializer.prototype.serializeAttributes = function(writer) {\n var attrs = this.attrs,\n root = !this.parent,\n namespaces = this.namespaces;\n\n function collectNsAttrs() {\n return map(namespaces.used, function(ns) {\n var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');\n return { name: name, value: ns.uri };\n });\n }\n\n if (root) {\n attrs = collectNsAttrs().concat(attrs);\n }\n\n forEach(attrs, function(a) {\n writer\n .append(' ')\n .append(nsName(a.name)).append('=\"').append(a.value).append('\"');\n });\n};\n\nElementSerializer.prototype.serializeTo = function(writer) {\n var hasBody = this.body.length,\n indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns));\n\n this.serializeAttributes(writer);\n\n writer.append(hasBody ? '>' : ' />');\n\n if (hasBody) {\n\n if (indent) {\n writer\n .appendNewLine()\n .indent();\n }\n\n forEach(this.body, function(b) {\n b.serializeTo(writer);\n });\n\n if (indent) {\n writer\n .unindent()\n .appendIndent();\n }\n\n writer.append('</' + nsName(this.ns) + '>');\n }\n\n writer.appendNewLine();\n};\n\n/**\n * A serializer for types that handles serialization of data types\n */\nfunction TypeSerializer(parent, ns) {\n ElementSerializer.call(this, parent, ns);\n}\n\nTypeSerializer.prototype = new ElementSerializer();\n\nTypeSerializer.prototype.build = function(element) {\n var descriptor = element.$descriptor;\n\n this.element = element;\n\n this.typeNs = this.nsTagName(descriptor);\n\n // add xsi:type attribute to represent the elements\n // actual type\n\n var typeNs = this.typeNs,\n pkg = element.$model.getPackage(typeNs.uri),\n typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';\n\n this.addAttribute(this.nsAttributeName(XSI_TYPE),\n (typeNs.prefix ? typeNs.prefix + ':' : '') +\n typePrefix + descriptor.ns.localName);\n\n // do the usual stuff\n return ElementSerializer.prototype.build.call(this, element);\n};\n\nTypeSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.typeNs.uri;\n};\n\nfunction SavingWriter() {\n this.value = '';\n\n this.write = function(str) {\n this.value += str;\n };\n}\n\nfunction FormatingWriter(out, format) {\n\n var indent = [''];\n\n this.append = function(str) {\n out.write(str);\n\n return this;\n };\n\n this.appendNewLine = function() {\n if (format) {\n out.write('/n');\n }\n\n return this;\n };\n\n this.appendIndent = function() {\n if (format) {\n out.write(indent.join(' '));\n }\n\n return this;\n };\n\n this.indent = function() {\n indent.push('');\n return this;\n };\n\n this.unindent = function() {\n indent.pop();\n return this;\n };\n}\n\n/**\n * A writer for meta-model backed document trees\n *\n * @param {Object} options output options to pass into the writer\n */\nfunction XMLWriter(options) {\n\n options = assign({ format: false, preamble: true }, options || {});\n\n function toXML(tree, writer) {\n var internalWriter = writer || new SavingWriter();\n var formatingWriter = new FormatingWriter(internalWriter, options.format);\n\n if (options.preamble) {\n formatingWriter.append(XML_PREAMBLE);\n }\n\n new ElementSerializer().build(tree).serializeTo(formatingWriter);\n\n if (!writer) {\n return internalWriter.value;\n }\n }\n\n return {\n toXML: toXML\n };\n}\n\nmodule.exports = XMLWriter;","// wrapper for non-node envs\n;(function (sax) {\n\nsax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\nsax.SAXParser = SAXParser\nsax.SAXStream = SAXStream\nsax.createStream = createStream\n\n// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n// since that's the earliest that a buffer overrun could occur. This way, checks are\n// as rare as required, but as often as necessary to ensure never crossing this bound.\n// Furthermore, buffers are only tested at most once per write(), so passing a very\n// large string into write() might have undesirable effects, but this is manageable by\n// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n// edge case, result in creating at most one complete copy of the string passed in.\n// Set to Infinity to have unlimited buffers.\nsax.MAX_BUFFER_LENGTH = 64 * 1024\n\nvar buffers = [\n \"comment\", \"sgmlDecl\", \"textNode\", \"tagName\", \"doctype\",\n \"procInstName\", \"procInstBody\", \"entity\", \"attribName\",\n \"attribValue\", \"cdata\", \"script\"\n]\n\nsax.EVENTS = // for discoverability.\n [ \"text\"\n , \"processinginstruction\"\n , \"sgmldeclaration\"\n , \"doctype\"\n , \"comment\"\n , \"attribute\"\n , \"opentag\"\n , \"closetag\"\n , \"opencdata\"\n , \"cdata\"\n , \"closecdata\"\n , \"error\"\n , \"end\"\n , \"ready\"\n , \"script\"\n , \"opennamespace\"\n , \"closenamespace\"\n ]\n\nfunction SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = \"\"\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\"\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.ENTITIES = Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) parser.ns = Object.create(rootNS)\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, \"onready\")\n}\n\nif (!Object.create) Object.create = function (o) {\n function f () { this.__proto__ = o }\n f.prototype = o\n return new f\n}\n\nif (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {\n return o.__proto__\n}\n\nif (!Object.keys) Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n}\n\nfunction checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n , maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i ++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case \"textNode\":\n closeText(parser)\n break\n\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n break\n\n case \"script\":\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n break\n\n default:\n error(parser, \"Max buffer length exceeded: \"+buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)\n + parser.position\n}\n\nfunction clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i ++) {\n parser[buffers[i]] = \"\"\n }\n}\n\nfunction flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n}\n\nSAXParser.prototype =\n { end: function () { end(this) }\n , write: write\n , resume: function () { this.error = null; return this }\n , close: function () { return this.write(null) }\n , flush: function () { flushBuffers(this) }\n }\n\ntry {\n var Stream = require(\"stream\").Stream\n} catch (ex) {\n var Stream = function () {}\n}\n\n\nvar streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== \"error\" && ev !== \"end\"\n})\n\nfunction createStream (strict, opt) {\n return new SAXStream(strict, opt)\n}\n\nfunction SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n\n var me = this\n\n this._parser.onend = function () {\n me.emit(\"end\")\n }\n\n this._parser.onerror = function (er) {\n me.emit(\"error\", er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null;\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function () { return me._parser[\"on\" + ev] },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n return me._parser[\"on\"+ev] = h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n}\n\nSAXStream.prototype = Object.create(Stream.prototype,\n { constructor: { value: SAXStream } })\n\nSAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data);\n }\n\n this._parser.write(data.toString())\n this.emit(\"data\", data)\n return true\n}\n\nSAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) this.write(chunk)\n this._parser.end()\n return true\n}\n\nSAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser[\"on\"+ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\"+ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]]\n : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n}\n\n\n\n// character classes and tokens\nvar whitespace = \"/r/n/t \"\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n , number = \"0124356789\"\n , letter = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n // (Letter | \"_\" | \":\")\n , quote = \"'/\"\"\n , entity = number+letter+\"#\"\n , attribEnd = whitespace + \">\"\n , CDATA = \"[CDATA[\"\n , DOCTYPE = \"DOCTYPE\"\n , XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\"\n , XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\"\n , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n// turn all the string character sets into character class objects.\nwhitespace = charClass(whitespace)\nnumber = charClass(number)\nletter = charClass(letter)\n\n// http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n// This implementation works on strings, a single character at a time\n// as such, it cannot ever support astral-plane characters (10000-EFFFF)\n// without a significant breaking change to either this parser, or the\n// JavaScript language. Implementation of an emoji-capable xml parser\n// is left as an exercise for the reader.\nvar nameStart = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD]/\n\nvar nameBody = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD/u00B7/u0300-/u036F/u203F-/u2040/./d-]/\n\nquote = charClass(quote)\nentity = charClass(entity)\nattribEnd = charClass(attribEnd)\n\nfunction charClass (str) {\n return str.split(\"\").reduce(function (s, c) {\n s[c] = true\n return s\n }, {})\n}\n\nfunction isRegExp (c) {\n return Object.prototype.toString.call(c) === '[object RegExp]'\n}\n\nfunction is (charclass, c) {\n return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]\n}\n\nfunction not (charclass, c) {\n return !is(charclass, c)\n}\n\nvar S = 0\nsax.STATE =\n{ BEGIN : S++\n, TEXT : S++ // general stuff\n, TEXT_ENTITY : S++ // &amp and such.\n, OPEN_WAKA : S++ // <\n, SGML_DECL : S++ // <!BLARG\n, SGML_DECL_QUOTED : S++ // <!BLARG foo \"bar\n, DOCTYPE : S++ // <!DOCTYPE\n, DOCTYPE_QUOTED : S++ // <!DOCTYPE \"//blah\n, DOCTYPE_DTD : S++ // <!DOCTYPE \"//blah\" [ ...\n, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE \"//blah\" [ \"foo\n, COMMENT_STARTING : S++ // <!-\n, COMMENT : S++ // <!--\n, COMMENT_ENDING : S++ // <!-- blah -\n, COMMENT_ENDED : S++ // <!-- blah --\n, CDATA : S++ // <![CDATA[ something\n, CDATA_ENDING : S++ // ]\n, CDATA_ENDING_2 : S++ // ]]\n, PROC_INST : S++ // <?hi\n, PROC_INST_BODY : S++ // <?hi there\n, PROC_INST_ENDING : S++ // <?hi \"there\" ?\n, OPEN_TAG : S++ // <strong\n, OPEN_TAG_SLASH : S++ // <strong /\n, ATTRIB : S++ // <a\n, ATTRIB_NAME : S++ // <a foo\n, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _\n, ATTRIB_VALUE : S++ // <a foo=\n, ATTRIB_VALUE_QUOTED : S++ // <a foo=\"bar\n, ATTRIB_VALUE_CLOSED : S++ // <a foo=\"bar\"\n, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar\n, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar=\"&quot;\"\n, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;\n, CLOSE_TAG : S++ // </a\n, CLOSE_TAG_SAW_WHITE : S++ // </a >\n, SCRIPT : S++ // <script> ...\n, SCRIPT_ENDING : S++ // <script> ... <\n}\n\nsax.ENTITIES =\n{ \"amp\" : \"&\"\n, \"gt\" : \">\"\n, \"lt\" : \"<\"\n, \"quot\" : \"/\"\"\n, \"apos\" : \"'\"\n, \"AElig\" : 198\n, \"Aacute\" : 193\n, \"Acirc\" : 194\n, \"Agrave\" : 192\n, \"Aring\" : 197\n, \"Atilde\" : 195\n, \"Auml\" : 196\n, \"Ccedil\" : 199\n, \"ETH\" : 208\n, \"Eacute\" : 201\n, \"Ecirc\" : 202\n, \"Egrave\" : 200\n, \"Euml\" : 203\n, \"Iacute\" : 205\n, \"Icirc\" : 206\n, \"Igrave\" : 204\n, \"Iuml\" : 207\n, \"Ntilde\" : 209\n, \"Oacute\" : 211\n, \"Ocirc\" : 212\n, \"Ograve\" : 210\n, \"Oslash\" : 216\n, \"Otilde\" : 213\n, \"Ouml\" : 214\n, \"THORN\" : 222\n, \"Uacute\" : 218\n, \"Ucirc\" : 219\n, \"Ugrave\" : 217\n, \"Uuml\" : 220\n, \"Yacute\" : 221\n, \"aacute\" : 225\n, \"acirc\" : 226\n, \"aelig\" : 230\n, \"agrave\" : 224\n, \"aring\" : 229\n, \"atilde\" : 227\n, \"auml\" : 228\n, \"ccedil\" : 231\n, \"eacute\" : 233\n, \"ecirc\" : 234\n, \"egrave\" : 232\n, \"eth\" : 240\n, \"euml\" : 235\n, \"iacute\" : 237\n, \"icirc\" : 238\n, \"igrave\" : 236\n, \"iuml\" : 239\n, \"ntilde\" : 241\n, \"oacute\" : 243\n, \"ocirc\" : 244\n, \"ograve\" : 242\n, \"oslash\" : 248\n, \"otilde\" : 245\n, \"ouml\" : 246\n, \"szlig\" : 223\n, \"thorn\" : 254\n, \"uacute\" : 250\n, \"ucirc\" : 251\n, \"ugrave\" : 249\n, \"uuml\" : 252\n, \"yacute\" : 253\n, \"yuml\" : 255\n, \"copy\" : 169\n, \"reg\" : 174\n, \"nbsp\" : 160\n, \"iexcl\" : 161\n, \"cent\" : 162\n, \"pound\" : 163\n, \"curren\" : 164\n, \"yen\" : 165\n, \"brvbar\" : 166\n, \"sect\" : 167\n, \"uml\" : 168\n, \"ordf\" : 170\n, \"laquo\" : 171\n, \"not\" : 172\n, \"shy\" : 173\n, \"macr\" : 175\n, \"deg\" : 176\n, \"plusmn\" : 177\n, \"sup1\" : 185\n, \"sup2\" : 178\n, \"sup3\" : 179\n, \"acute\" : 180\n, \"micro\" : 181\n, \"para\" : 182\n, \"middot\" : 183\n, \"cedil\" : 184\n, \"ordm\" : 186\n, \"raquo\" : 187\n, \"frac14\" : 188\n, \"frac12\" : 189\n, \"frac34\" : 190\n, \"iquest\" : 191\n, \"times\" : 215\n, \"divide\" : 247\n, \"OElig\" : 338\n, \"oelig\" : 339\n, \"Scaron\" : 352\n, \"scaron\" : 353\n, \"Yuml\" : 376\n, \"fnof\" : 402\n, \"circ\" : 710\n, \"tilde\" : 732\n, \"Alpha\" : 913\n, \"Beta\" : 914\n, \"Gamma\" : 915\n, \"Delta\" : 916\n, \"Epsilon\" : 917\n, \"Zeta\" : 918\n, \"Eta\" : 919\n, \"Theta\" : 920\n, \"Iota\" : 921\n, \"Kappa\" : 922\n, \"Lambda\" : 923\n, \"Mu\" : 924\n, \"Nu\" : 925\n, \"Xi\" : 926\n, \"Omicron\" : 927\n, \"Pi\" : 928\n, \"Rho\" : 929\n, \"Sigma\" : 931\n, \"Tau\" : 932\n, \"Upsilon\" : 933\n, \"Phi\" : 934\n, \"Chi\" : 935\n, \"Psi\" : 936\n, \"Omega\" : 937\n, \"alpha\" : 945\n, \"beta\" : 946\n, \"gamma\" : 947\n, \"delta\" : 948\n, \"epsilon\" : 949\n, \"zeta\" : 950\n, \"eta\" : 951\n, \"theta\" : 952\n, \"iota\" : 953\n, \"kappa\" : 954\n, \"lambda\" : 955\n, \"mu\" : 956\n, \"nu\" : 957\n, \"xi\" : 958\n, \"omicron\" : 959\n, \"pi\" : 960\n, \"rho\" : 961\n, \"sigmaf\" : 962\n, \"sigma\" : 963\n, \"tau\" : 964\n, \"upsilon\" : 965\n, \"phi\" : 966\n, \"chi\" : 967\n, \"psi\" : 968\n, \"omega\" : 969\n, \"thetasym\" : 977\n, \"upsih\" : 978\n, \"piv\" : 982\n, \"ensp\" : 8194\n, \"emsp\" : 8195\n, \"thinsp\" : 8201\n, \"zwnj\" : 8204\n, \"zwj\" : 8205\n, \"lrm\" : 8206\n, \"rlm\" : 8207\n, \"ndash\" : 8211\n, \"mdash\" : 8212\n, \"lsquo\" : 8216\n, \"rsquo\" : 8217\n, \"sbquo\" : 8218\n, \"ldquo\" : 8220\n, \"rdquo\" : 8221\n, \"bdquo\" : 8222\n, \"dagger\" : 8224\n, \"Dagger\" : 8225\n, \"bull\" : 8226\n, \"hellip\" : 8230\n, \"permil\" : 8240\n, \"prime\" : 8242\n, \"Prime\" : 8243\n, \"lsaquo\" : 8249\n, \"rsaquo\" : 8250\n, \"oline\" : 8254\n, \"frasl\" : 8260\n, \"euro\" : 8364\n, \"image\" : 8465\n, \"weierp\" : 8472\n, \"real\" : 8476\n, \"trade\" : 8482\n, \"alefsym\" : 8501\n, \"larr\" : 8592\n, \"uarr\" : 8593\n, \"rarr\" : 8594\n, \"darr\" : 8595\n, \"harr\" : 8596\n, \"crarr\" : 8629\n, \"lArr\" : 8656\n, \"uArr\" : 8657\n, \"rArr\" : 8658\n, \"dArr\" : 8659\n, \"hArr\" : 8660\n, \"forall\" : 8704\n, \"part\" : 8706\n, \"exist\" : 8707\n, \"empty\" : 8709\n, \"nabla\" : 8711\n, \"isin\" : 8712\n, \"notin\" : 8713\n, \"ni\" : 8715\n, \"prod\" : 8719\n, \"sum\" : 8721\n, \"minus\" : 8722\n, \"lowast\" : 8727\n, \"radic\" : 8730\n, \"prop\" : 8733\n, \"infin\" : 8734\n, \"ang\" : 8736\n, \"and\" : 8743\n, \"or\" : 8744\n, \"cap\" : 8745\n, \"cup\" : 8746\n, \"int\" : 8747\n, \"there4\" : 8756\n, \"sim\" : 8764\n, \"cong\" : 8773\n, \"asymp\" : 8776\n, \"ne\" : 8800\n, \"equiv\" : 8801\n, \"le\" : 8804\n, \"ge\" : 8805\n, \"sub\" : 8834\n, \"sup\" : 8835\n, \"nsub\" : 8836\n, \"sube\" : 8838\n, \"supe\" : 8839\n, \"oplus\" : 8853\n, \"otimes\" : 8855\n, \"perp\" : 8869\n, \"sdot\" : 8901\n, \"lceil\" : 8968\n, \"rceil\" : 8969\n, \"lfloor\" : 8970\n, \"rfloor\" : 8971\n, \"lang\" : 9001\n, \"rang\" : 9002\n, \"loz\" : 9674\n, \"spades\" : 9824\n, \"clubs\" : 9827\n, \"hearts\" : 9829\n, \"diams\" : 9830\n}\n\nObject.keys(sax.ENTITIES).forEach(function (key) {\n var e = sax.ENTITIES[key]\n var s = typeof e === 'number' ? String.fromCharCode(e) : e\n sax.ENTITIES[key] = s\n})\n\nfor (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S\n\n// shorthand\nS = sax.STATE\n\nfunction emit (parser, event, data) {\n parser[event] && parser[event](data)\n}\n\nfunction emitNode (parser, nodeType, data) {\n if (parser.textNode) closeText(parser)\n emit(parser, nodeType, data)\n}\n\nfunction closeText (parser) {\n parser.textNode = textopts(parser.opt, parser.textNode)\n if (parser.textNode) emit(parser, \"ontext\", parser.textNode)\n parser.textNode = \"\"\n}\n\nfunction textopts (opt, text) {\n if (opt.trim) text = text.trim()\n if (opt.normalize) text = text.replace(//s+/g, \" \")\n return text\n}\n\nfunction error (parser, er) {\n closeText(parser)\n if (parser.trackPosition) {\n er += \"/nLine: \"+parser.line+\n \"/nColumn: \"+parser.column+\n \"/nChar: \"+parser.c\n }\n er = new Error(er)\n parser.error = er\n emit(parser, \"onerror\", er)\n return parser\n}\n\nfunction end (parser) {\n if (!parser.closedRoot) strictFail(parser, \"Unclosed root tag\")\n if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, \"Unexpected end\")\n closeText(parser)\n parser.c = \"\"\n parser.closed = true\n emit(parser, \"onend\")\n SAXParser.call(parser, parser.strict, parser.opt)\n return parser\n}\n\nfunction strictFail (parser, message) {\n if (typeof parser !== 'object' || !(parser instanceof SAXParser))\n throw new Error('bad call to strictFail');\n if (parser.strict) error(parser, message)\n}\n\nfunction newTag (parser) {\n if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()\n var parent = parser.tags[parser.tags.length - 1] || parser\n , tag = parser.tag = { name : parser.tagName, attributes : {} }\n\n // will be overridden if tag contails an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (parser.opt.xmlns) tag.ns = parent.ns\n parser.attribList.length = 0\n}\n\nfunction qname (name, attribute) {\n var i = name.indexOf(\":\")\n , qualName = i < 0 ? [ \"\", name ] : name.split(\":\")\n , prefix = qualName[0]\n , local = qualName[1]\n\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === \"xmlns\") {\n prefix = \"xmlns\"\n local = \"\"\n }\n\n return { prefix: prefix, local: local }\n}\n\nfunction attrib (parser) {\n if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()\n\n if (parser.attribList.indexOf(parser.attribName) !== -1 ||\n parser.tag.attributes.hasOwnProperty(parser.attribName)) {\n return parser.attribName = parser.attribValue = \"\"\n }\n\n if (parser.opt.xmlns) {\n var qn = qname(parser.attribName, true)\n , prefix = qn.prefix\n , local = qn.local\n\n if (prefix === \"xmlns\") {\n // namespace binding attribute; push the binding into scope\n if (local === \"xml\" && parser.attribValue !== XML_NAMESPACE) {\n strictFail( parser\n , \"xml: prefix must be bound to \" + XML_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else if (local === \"xmlns\" && parser.attribValue !== XMLNS_NAMESPACE) {\n strictFail( parser\n , \"xmlns: prefix must be bound to \" + XMLNS_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else {\n var tag = parser.tag\n , parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns)\n }\n tag.ns[local] = parser.attribValue\n }\n }\n\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect; preserve attribute order\n // so deferred events can be emitted in document order\n parser.attribList.push([parser.attribName, parser.attribValue])\n } else {\n // in non-xmlns mode, we can emit the event right away\n parser.tag.attributes[parser.attribName] = parser.attribValue\n emitNode( parser\n , \"onattribute\"\n , { name: parser.attribName\n , value: parser.attribValue } )\n }\n\n parser.attribName = parser.attribValue = \"\"\n}\n\nfunction openTag (parser, selfClosing) {\n if (parser.opt.xmlns) {\n // emit namespace binding events\n var tag = parser.tag\n\n // add namespace info to tag\n var qn = qname(parser.tagName)\n tag.prefix = qn.prefix\n tag.local = qn.local\n tag.uri = tag.ns[qn.prefix] || \"\"\n\n if (tag.prefix && !tag.uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(parser.tagName))\n tag.uri = qn.prefix\n }\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns && parent.ns !== tag.ns) {\n Object.keys(tag.ns).forEach(function (p) {\n emitNode( parser\n , \"onopennamespace\"\n , { prefix: p , uri: tag.ns[p] } )\n })\n }\n\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (var i = 0, l = parser.attribList.length; i < l; i ++) {\n var nv = parser.attribList[i]\n var name = nv[0]\n , value = nv[1]\n , qualName = qname(name, true)\n , prefix = qualName.prefix\n , local = qualName.local\n , uri = prefix == \"\" ? \"\" : (tag.ns[prefix] || \"\")\n , a = { name: name\n , value: value\n , prefix: prefix\n , local: local\n , uri: uri\n }\n\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix != \"xmlns\" && !uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(prefix))\n a.uri = prefix\n }\n parser.tag.attributes[name] = a\n emitNode(parser, \"onattribute\", a)\n }\n parser.attribList.length = 0\n }\n\n parser.tag.isSelfClosing = !!selfClosing\n\n // process the tag\n parser.sawRoot = true\n parser.tags.push(parser.tag)\n emitNode(parser, \"onopentag\", parser.tag)\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!parser.noscript && parser.tagName.toLowerCase() === \"script\") {\n parser.state = S.SCRIPT\n } else {\n parser.state = S.TEXT\n }\n parser.tag = null\n parser.tagName = \"\"\n }\n parser.attribName = parser.attribValue = \"\"\n parser.attribList.length = 0\n}\n\nfunction closeTag (parser) {\n if (!parser.tagName) {\n strictFail(parser, \"Weird empty close tag.\")\n parser.textNode += \"</>\"\n parser.state = S.TEXT\n return\n }\n\n if (parser.script) {\n if (parser.tagName !== \"script\") {\n parser.script += \"</\" + parser.tagName + \">\"\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n return\n }\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n var t = parser.tags.length\n var tagName = parser.tagName\n if (!parser.strict) tagName = tagName[parser.looseCase]()\n var closeTo = tagName\n while (t --) {\n var close = parser.tags[t]\n if (close.name !== closeTo) {\n // fail the first time in strict mode\n strictFail(parser, \"Unexpected close tag\")\n } else break\n }\n\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n strictFail(parser, \"Unmatched closing tag: \"+parser.tagName)\n parser.textNode += \"</\" + parser.tagName + \">\"\n parser.state = S.TEXT\n return\n }\n parser.tagName = tagName\n var s = parser.tags.length\n while (s --> t) {\n var tag = parser.tag = parser.tags.pop()\n parser.tagName = parser.tag.name\n emitNode(parser, \"onclosetag\", parser.tagName)\n\n var x = {}\n for (var i in tag.ns) x[i] = tag.ns[i]\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (parser.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n Object.keys(tag.ns).forEach(function (p) {\n var n = tag.ns[p]\n emitNode(parser, \"onclosenamespace\", { prefix: p, uri: n })\n })\n }\n }\n if (t === 0) parser.closedRoot = true\n parser.tagName = parser.attribValue = parser.attribName = \"\"\n parser.attribList.length = 0\n parser.state = S.TEXT\n}\n\nfunction parseEntity (parser) {\n var entity = parser.entity\n , entityLC = entity.toLowerCase()\n , num\n , numStr = \"\"\n if (parser.ENTITIES[entity])\n return parser.ENTITIES[entity]\n if (parser.ENTITIES[entityLC])\n return parser.ENTITIES[entityLC]\n entity = entityLC\n if (entity.charAt(0) === \"#\") {\n if (entity.charAt(1) === \"x\") {\n entity = entity.slice(2)\n num = parseInt(entity, 16)\n numStr = num.toString(16)\n } else {\n entity = entity.slice(1)\n num = parseInt(entity, 10)\n numStr = num.toString(10)\n }\n }\n entity = entity.replace(/^0+/, \"\")\n if (numStr.toLowerCase() !== entity) {\n strictFail(parser, \"Invalid character entity\")\n return \"&\"+parser.entity + \";\"\n }\n\n return String.fromCodePoint(num)\n}\n\nfunction write (chunk) {\n var parser = this\n if (this.error) throw this.error\n if (parser.closed) return error(parser,\n \"Cannot write after close. Assign an onready handler.\")\n if (chunk === null) return end(parser)\n var i = 0, c = \"\"\n while (parser.c = c = chunk.charAt(i++)) {\n if (parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n switch (parser.state) {\n\n case S.BEGIN:\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else if (not(whitespace,c)) {\n // have to process this as a text node.\n // weird, but happens.\n strictFail(parser, \"Non-whitespace before first tag.\")\n parser.textNode = c\n parser.state = S.TEXT\n }\n continue\n\n case S.TEXT:\n if (parser.sawRoot && !parser.closedRoot) {\n var starti = i-1\n while (c && c!==\"<\" && c!==\"&\") {\n c = chunk.charAt(i++)\n if (c && parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n }\n parser.textNode += chunk.substring(starti, i-1)\n }\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else {\n if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))\n strictFail(parser, \"Text data outside of root node.\")\n if (c === \"&\") parser.state = S.TEXT_ENTITY\n else parser.textNode += c\n }\n continue\n\n case S.SCRIPT:\n // only non-strict\n if (c === \"<\") {\n parser.state = S.SCRIPT_ENDING\n } else parser.script += c\n continue\n\n case S.SCRIPT_ENDING:\n if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n } else {\n parser.script += \"<\" + c\n parser.state = S.SCRIPT\n }\n continue\n\n case S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === \"!\") {\n parser.state = S.SGML_DECL\n parser.sgmlDecl = \"\"\n } else if (is(whitespace, c)) {\n // wait for it...\n } else if (is(nameStart,c)) {\n parser.state = S.OPEN_TAG\n parser.tagName = c\n } else if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n parser.tagName = \"\"\n } else if (c === \"?\") {\n parser.state = S.PROC_INST\n parser.procInstName = parser.procInstBody = \"\"\n } else {\n strictFail(parser, \"Unencoded <\")\n // if there was some whitespace, then add that in.\n if (parser.startTagPosition + 1 < parser.position) {\n var pad = parser.position - parser.startTagPosition\n c = new Array(pad).join(\" \") + c\n }\n parser.textNode += \"<\" + c\n parser.state = S.TEXT\n }\n continue\n\n case S.SGML_DECL:\n if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {\n emitNode(parser, \"onopencdata\")\n parser.state = S.CDATA\n parser.sgmlDecl = \"\"\n parser.cdata = \"\"\n } else if (parser.sgmlDecl+c === \"--\") {\n parser.state = S.COMMENT\n parser.comment = \"\"\n parser.sgmlDecl = \"\"\n } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {\n parser.state = S.DOCTYPE\n if (parser.doctype || parser.sawRoot) strictFail(parser,\n \"Inappropriately located doctype declaration\")\n parser.doctype = \"\"\n parser.sgmlDecl = \"\"\n } else if (c === \">\") {\n emitNode(parser, \"onsgmldeclaration\", parser.sgmlDecl)\n parser.sgmlDecl = \"\"\n parser.state = S.TEXT\n } else if (is(quote, c)) {\n parser.state = S.SGML_DECL_QUOTED\n parser.sgmlDecl += c\n } else parser.sgmlDecl += c\n continue\n\n case S.SGML_DECL_QUOTED:\n if (c === parser.q) {\n parser.state = S.SGML_DECL\n parser.q = \"\"\n }\n parser.sgmlDecl += c\n continue\n\n case S.DOCTYPE:\n if (c === \">\") {\n parser.state = S.TEXT\n emitNode(parser, \"ondoctype\", parser.doctype)\n parser.doctype = true // just remember that we saw it.\n } else {\n parser.doctype += c\n if (c === \"[\") parser.state = S.DOCTYPE_DTD\n else if (is(quote, c)) {\n parser.state = S.DOCTYPE_QUOTED\n parser.q = c\n }\n }\n continue\n\n case S.DOCTYPE_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.q = \"\"\n parser.state = S.DOCTYPE\n }\n continue\n\n case S.DOCTYPE_DTD:\n parser.doctype += c\n if (c === \"]\") parser.state = S.DOCTYPE\n else if (is(quote,c)) {\n parser.state = S.DOCTYPE_DTD_QUOTED\n parser.q = c\n }\n continue\n\n case S.DOCTYPE_DTD_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.state = S.DOCTYPE_DTD\n parser.q = \"\"\n }\n continue\n\n case S.COMMENT:\n if (c === \"-\") parser.state = S.COMMENT_ENDING\n else parser.comment += c\n continue\n\n case S.COMMENT_ENDING:\n if (c === \"-\") {\n parser.state = S.COMMENT_ENDED\n parser.comment = textopts(parser.opt, parser.comment)\n if (parser.comment) emitNode(parser, \"oncomment\", parser.comment)\n parser.comment = \"\"\n } else {\n parser.comment += \"-\" + c\n parser.state = S.COMMENT\n }\n continue\n\n case S.COMMENT_ENDED:\n if (c !== \">\") {\n strictFail(parser, \"Malformed comment\")\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n parser.comment += \"--\" + c\n parser.state = S.COMMENT\n } else parser.state = S.TEXT\n continue\n\n case S.CDATA:\n if (c === \"]\") parser.state = S.CDATA_ENDING\n else parser.cdata += c\n continue\n\n case S.CDATA_ENDING:\n if (c === \"]\") parser.state = S.CDATA_ENDING_2\n else {\n parser.cdata += \"]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.CDATA_ENDING_2:\n if (c === \">\") {\n if (parser.cdata) emitNode(parser, \"oncdata\", parser.cdata)\n emitNode(parser, \"onclosecdata\")\n parser.cdata = \"\"\n parser.state = S.TEXT\n } else if (c === \"]\") {\n parser.cdata += \"]\"\n } else {\n parser.cdata += \"]]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.PROC_INST:\n if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY\n else parser.procInstName += c\n continue\n\n case S.PROC_INST_BODY:\n if (!parser.procInstBody && is(whitespace, c)) continue\n else if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else parser.procInstBody += c\n continue\n\n case S.PROC_INST_ENDING:\n if (c === \">\") {\n emitNode(parser, \"onprocessinginstruction\", {\n name : parser.procInstName,\n body : parser.procInstBody\n })\n parser.procInstName = parser.procInstBody = \"\"\n parser.state = S.TEXT\n } else {\n parser.procInstBody += \"?\" + c\n parser.state = S.PROC_INST_BODY\n }\n continue\n\n case S.OPEN_TAG:\n if (is(nameBody, c)) parser.tagName += c\n else {\n newTag(parser)\n if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else {\n if (not(whitespace, c)) strictFail(\n parser, \"Invalid character in tag name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.OPEN_TAG_SLASH:\n if (c === \">\") {\n openTag(parser, true)\n closeTag(parser)\n } else {\n strictFail(parser, \"Forward-slash in opening tag not followed by >\")\n parser.state = S.ATTRIB\n }\n continue\n\n case S.ATTRIB:\n // haven't read the attribute name yet.\n if (is(whitespace, c)) continue\n else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (c === \">\") {\n strictFail(parser, \"Attribute without value\")\n parser.attribValue = parser.attribName\n attrib(parser)\n openTag(parser)\n }\n else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE\n else if (is(nameBody, c)) parser.attribName += c\n else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME_SAW_WHITE:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (is(whitespace, c)) continue\n else {\n strictFail(parser, \"Attribute without value\")\n parser.tag.attributes[parser.attribName] = \"\"\n parser.attribValue = \"\"\n emitNode(parser, \"onattribute\",\n { name : parser.attribName, value : \"\" })\n parser.attribName = \"\"\n if (c === \">\") openTag(parser)\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.state = S.ATTRIB_NAME\n } else {\n strictFail(parser, \"Invalid attribute name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.ATTRIB_VALUE:\n if (is(whitespace, c)) continue\n else if (is(quote, c)) {\n parser.q = c\n parser.state = S.ATTRIB_VALUE_QUOTED\n } else {\n strictFail(parser, \"Unquoted attribute value\")\n parser.state = S.ATTRIB_VALUE_UNQUOTED\n parser.attribValue = c\n }\n continue\n\n case S.ATTRIB_VALUE_QUOTED:\n if (c !== parser.q) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_Q\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n parser.q = \"\"\n parser.state = S.ATTRIB_VALUE_CLOSED\n continue\n\n case S.ATTRIB_VALUE_CLOSED:\n if (is(whitespace, c)) {\n parser.state = S.ATTRIB\n } else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n strictFail(parser, \"No whitespace between attributes\")\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_VALUE_UNQUOTED:\n if (not(attribEnd,c)) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_U\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n if (c === \">\") openTag(parser)\n else parser.state = S.ATTRIB\n continue\n\n case S.CLOSE_TAG:\n if (!parser.tagName) {\n if (is(whitespace, c)) continue\n else if (not(nameStart, c)) {\n if (parser.script) {\n parser.script += \"</\" + c\n parser.state = S.SCRIPT\n } else {\n strictFail(parser, \"Invalid tagname in closing tag.\")\n }\n } else parser.tagName = c\n }\n else if (c === \">\") closeTag(parser)\n else if (is(nameBody, c)) parser.tagName += c\n else if (parser.script) {\n parser.script += \"</\" + parser.tagName\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n } else {\n if (not(whitespace, c)) strictFail(parser,\n \"Invalid tagname in closing tag\")\n parser.state = S.CLOSE_TAG_SAW_WHITE\n }\n continue\n\n case S.CLOSE_TAG_SAW_WHITE:\n if (is(whitespace, c)) continue\n if (c === \">\") closeTag(parser)\n else strictFail(parser, \"Invalid characters in closing tag\")\n continue\n\n case S.TEXT_ENTITY:\n case S.ATTRIB_VALUE_ENTITY_Q:\n case S.ATTRIB_VALUE_ENTITY_U:\n switch(parser.state) {\n case S.TEXT_ENTITY:\n var returnState = S.TEXT, buffer = \"textNode\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_Q:\n var returnState = S.ATTRIB_VALUE_QUOTED, buffer = \"attribValue\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_U:\n var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = \"attribValue\"\n break\n }\n if (c === \";\") {\n parser[buffer] += parseEntity(parser)\n parser.entity = \"\"\n parser.state = returnState\n }\n else if (is(entity, c)) parser.entity += c\n else {\n strictFail(parser, \"Invalid character entity\")\n parser[buffer] += \"&\" + parser.entity + c\n parser.entity = \"\"\n parser.state = returnState\n }\n continue\n\n default:\n throw new Error(parser, \"Unknown state: \" + parser.state)\n }\n } // while\n // cdata blocks can get very big under normal conditions. emit and move on.\n // if (parser.state === S.CDATA && parser.cdata) {\n // emitNode(parser, \"oncdata\", parser.cdata)\n // parser.cdata = \"\"\n // }\n if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)\n return parser\n}\n\n/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n (function() {\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n if (Object.defineProperty) {\n Object.defineProperty(String, 'fromCodePoint', {\n 'value': fromCodePoint,\n 'configurable': true,\n 'writable': true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n }());\n}\n\n})(typeof exports === \"undefined\" ? sax = {} : exports);\n","/**\n * Tiny stack for browser or server\n *\n * @author Jason Mulligan <jason.mulligan@avoidwork.com>\n * @copyright 2014 Jason Mulligan\n * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>\n * @link http://avoidwork.github.io/tiny-stack\n * @module tiny-stack\n * @version 0.1.0\n */\n\n( function ( global ) {\n\n\"use strict\";\n\n/**\n * TinyStack\n *\n * @constructor\n */\nfunction TinyStack () {\n\tthis.data = [null];\n\tthis.top = 0;\n}\n\n/**\n * Clears the stack\n *\n * @method clear\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.clear = function clear () {\n\tthis.data = [null];\n\tthis.top = 0;\n\n\treturn this;\n};\n\n/**\n * Gets the size of the stack\n *\n * @method length\n * @memberOf TinyStack\n * @return {Number} Size of stack\n */\nTinyStack.prototype.length = function length () {\n\treturn this.top;\n};\n\n/**\n * Gets the item at the top of the stack\n *\n * @method peek\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.peek = function peek () {\n\treturn this.data[this.top];\n};\n\n/**\n * Gets & removes the item at the top of the stack\n *\n * @method pop\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.pop = function pop () {\n\tif ( this.top > 0 ) {\n\t\tthis.top--;\n\n\t\treturn this.data.pop();\n\t}\n\telse {\n\t\treturn undefined;\n\t}\n};\n\n/**\n * Pushes an item onto the stack\n *\n * @method push\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.push = function push ( arg ) {\n\tthis.data[++this.top] = arg;\n\n\treturn this;\n};\n\n/**\n * TinyStack factory\n *\n * @method factory\n * @return {Object} {@link TinyStack}\n */\nfunction factory () {\n\treturn new TinyStack();\n}\n\n// Node, AMD & window supported\nif ( typeof exports != \"undefined\" ) {\n\tmodule.exports = factory;\n}\nelse if ( typeof define == \"function\" ) {\n\tdefine( function () {\n\t\treturn factory;\n\t} );\n}\nelse {\n\tglobal.stack = factory;\n}\n} )( this );\n","module.exports = require(61);","'use strict';\n\nfunction Base() { }\n\nBase.prototype.get = function(name) {\n return this.$model.properties.get(this, name);\n};\n\nBase.prototype.set = function(name, value) {\n this.$model.properties.set(this, name, value);\n};\n\n\nmodule.exports = Base;","'use strict';\n\nvar pick = require(330),\n assign = require(325),\n forEach = require(204);\n\nvar parseNameNs = require(62).parseName;\n\n\nfunction DescriptorBuilder(nameNs) {\n this.ns = nameNs;\n this.name = nameNs.name;\n this.allTypes = [];\n this.properties = [];\n this.propertiesByName = {};\n}\n\nmodule.exports = DescriptorBuilder;\n\n\nDescriptorBuilder.prototype.build = function() {\n return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);\n};\n\nDescriptorBuilder.prototype.addProperty = function(p, idx) {\n this.addNamedProperty(p, true);\n\n var properties = this.properties;\n\n if (idx !== undefined) {\n properties.splice(idx, 0, p);\n } else {\n properties.push(p);\n }\n};\n\n\nDescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {\n var oldNameNs = oldProperty.ns;\n\n var props = this.properties,\n propertiesByName = this.propertiesByName,\n rename = oldProperty.name !== newProperty.name;\n\n if (oldProperty.isBody) {\n\n if (!newProperty.isBody) {\n throw new Error(\n 'property <' + newProperty.ns.name + '> must be body property ' +\n 'to refine <' + oldProperty.ns.name + '>');\n }\n\n // TODO: Check compatibility\n this.setBodyProperty(newProperty, false);\n }\n\n // replacing the named property is intentional\n // thus, validate only if this is a \"rename\" operation\n this.addNamedProperty(newProperty, rename);\n\n // replace old property at index with new one\n var idx = props.indexOf(oldProperty);\n if (idx === -1) {\n throw new Error('property <' + oldNameNs.name + '> not found in property list');\n }\n\n props[idx] = newProperty;\n\n // replace propertiesByName entry with new property\n propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;\n};\n\n\nDescriptorBuilder.prototype.redefineProperty = function(p) {\n\n var nsPrefix = p.ns.prefix;\n var parts = p.redefines.split('#');\n\n var name = parseNameNs(parts[0], nsPrefix);\n var attrName = parseNameNs(parts[1], name.prefix).name;\n\n var redefinedProperty = this.propertiesByName[attrName];\n if (!redefinedProperty) {\n throw new Error('refined property <' + attrName + '> not found');\n } else {\n this.replaceProperty(redefinedProperty, p);\n }\n\n delete p.redefines;\n};\n\nDescriptorBuilder.prototype.addNamedProperty = function(p, validate) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n if (validate) {\n this.assertNotDefined(p, ns.name);\n this.assertNotDefined(p, ns.localName);\n }\n\n propsByName[ns.name] = propsByName[ns.localName] = p;\n};\n\nDescriptorBuilder.prototype.removeNamedProperty = function(p) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n delete propsByName[ns.name];\n delete propsByName[ns.localName];\n};\n\nDescriptorBuilder.prototype.setBodyProperty = function(p, validate) {\n\n if (validate && this.bodyProperty) {\n throw new Error(\n 'body property defined multiple times ' +\n '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');\n }\n\n this.bodyProperty = p;\n};\n\nDescriptorBuilder.prototype.addIdProperty = function(name) {\n var nameNs = parseNameNs(name, this.ns.prefix);\n\n var p = {\n name: nameNs.localName,\n type: 'String',\n isAttr: true,\n ns: nameNs\n };\n\n // ensure that id is always the first attribute (if present)\n this.addProperty(p, 0);\n};\n\nDescriptorBuilder.prototype.assertNotDefined = function(p, name) {\n var propertyName = p.name,\n definedProperty = this.propertiesByName[propertyName];\n\n if (definedProperty) {\n throw new Error(\n 'property <' + propertyName + '> already defined; ' +\n 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +\n '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');\n }\n};\n\nDescriptorBuilder.prototype.hasProperty = function(name) {\n return this.propertiesByName[name];\n};\n\nDescriptorBuilder.prototype.addTrait = function(t) {\n\n var allTypes = this.allTypes;\n\n if (allTypes.indexOf(t) !== -1) {\n return;\n }\n\n forEach(t.properties, function(p) {\n\n // clone property to allow extensions\n p = assign({}, p, {\n name: p.ns.localName\n });\n\n Object.defineProperty(p, 'definedBy', {\n value: t\n });\n\n // add redefine support\n if (p.redefines) {\n this.redefineProperty(p);\n } else {\n if (p.isBody) {\n this.setBodyProperty(p);\n }\n this.addProperty(p);\n }\n }, this);\n\n allTypes.push(t);\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar Base = require(58);\n\n\nfunction Factory(model, properties) {\n this.model = model;\n this.properties = properties;\n}\n\nmodule.exports = Factory;\n\n\nFactory.prototype.createType = function(descriptor) {\n\n var model = this.model;\n\n var props = this.properties,\n prototype = Object.create(Base.prototype);\n\n // initialize default values\n forEach(descriptor.properties, function(p) {\n if (!p.isMany && p.default !== undefined) {\n prototype[p.name] = p.default;\n }\n });\n\n props.defineModel(prototype, model);\n props.defineDescriptor(prototype, descriptor);\n\n var name = descriptor.ns.name;\n\n /**\n * The new type constructor\n */\n function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, function(val, key) {\n this.set(key, val);\n }, this);\n }\n\n ModdleElement.prototype = prototype;\n\n ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;\n\n // static links\n props.defineModel(ModdleElement, model);\n props.defineDescriptor(ModdleElement, descriptor);\n\n return ModdleElement;\n};","'use strict';\n\nvar isString = require(322),\n isObject = require(320),\n forEach = require(204),\n find = require(203);\n\n\nvar Factory = require(60),\n Registry = require(64),\n Properties = require(63);\n\nvar parseNameNs = require(62).parseName;\n\n\n//// Moddle implementation /////////////////////////////////////////////////\n\n/**\n * @class Moddle\n *\n * A model that can be used to create elements of a specific type.\n *\n * @example\n *\n * var Moddle = require('moddle');\n *\n * var pkg = {\n * name: 'mypackage',\n * prefix: 'my',\n * types: [\n * { name: 'Root' }\n * ]\n * };\n *\n * var moddle = new Moddle([pkg]);\n *\n * @param {Array<Package>} packages the packages to contain\n * @param {Object} options additional options to pass to the model\n */\nfunction Moddle(packages, options) {\n\n options = options || {};\n\n this.properties = new Properties(this);\n\n this.factory = new Factory(this, this.properties);\n this.registry = new Registry(packages, this.properties, options);\n\n this.typeCache = {};\n}\n\nmodule.exports = Moddle;\n\n\n/**\n * Create an instance of the specified type.\n *\n * @method Moddle#create\n *\n * @example\n *\n * var foo = moddle.create('my:Foo');\n * var bar = moddle.create('my:Bar', { id: 'BAR_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @param {Object} attrs a number of attributes to initialize the model instance with\n * @return {Object} model instance\n */\nModdle.prototype.create = function(descriptor, attrs) {\n var Type = this.getType(descriptor);\n\n if (!Type) {\n throw new Error('unknown type <' + descriptor + '>');\n }\n\n return new Type(attrs);\n};\n\n\n/**\n * Returns the type representing a given descriptor\n *\n * @method Moddle#getType\n *\n * @example\n *\n * var Foo = moddle.getType('my:Foo');\n * var foo = new Foo({ 'id' : 'FOO_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @return {Object} the type representing the descriptor\n */\nModdle.prototype.getType = function(descriptor) {\n\n var cache = this.typeCache;\n\n var name = isString(descriptor) ? descriptor : descriptor.ns.name;\n\n var type = cache[name];\n\n if (!type) {\n descriptor = this.registry.getEffectiveDescriptor(name);\n type = cache[name] = this.factory.createType(descriptor);\n }\n\n return type;\n};\n\n\n/**\n * Creates an any-element type to be used within model instances.\n *\n * This can be used to create custom elements that lie outside the meta-model.\n * The created element contains all the meta-data required to serialize it\n * as part of meta-model elements.\n *\n * @method Moddle#createAny\n *\n * @example\n *\n * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {\n * value: 'bar'\n * });\n *\n * var container = moddle.create('my:Container', 'http://my', {\n * any: [ foo ]\n * });\n *\n * // go ahead and serialize the stuff\n *\n *\n * @param {String} name the name of the element\n * @param {String} nsUri the namespace uri of the element\n * @param {Object} [properties] a map of properties to initialize the instance with\n * @return {Object} the any type instance\n */\nModdle.prototype.createAny = function(name, nsUri, properties) {\n\n var nameNs = parseNameNs(name);\n\n var element = {\n $type: name\n };\n\n var descriptor = {\n name: name,\n isGeneric: true,\n ns: {\n prefix: nameNs.prefix,\n localName: nameNs.localName,\n uri: nsUri\n }\n };\n\n this.properties.defineDescriptor(element, descriptor);\n this.properties.defineModel(element, this);\n this.properties.define(element, '$parent', { enumerable: false, writable: true });\n\n forEach(properties, function(a, key) {\n if (isObject(a) && a.value !== undefined) {\n element[a.name] = a.value;\n } else {\n element[key] = a;\n }\n });\n\n return element;\n};\n\n/**\n * Returns a registered package by uri or prefix\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackage = function(uriOrPrefix) {\n return this.registry.getPackage(uriOrPrefix);\n};\n\n/**\n * Returns a snapshot of all known packages\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackages = function() {\n return this.registry.getPackages();\n};\n\n/**\n * Returns the descriptor for an element\n */\nModdle.prototype.getElementDescriptor = function(element) {\n return element.$descriptor;\n};\n\n/**\n * Returns true if the given descriptor or instance\n * represents the given type.\n *\n * May be applied to this, if element is omitted.\n */\nModdle.prototype.hasType = function(element, type) {\n if (type === undefined) {\n type = element;\n element = this;\n }\n\n var descriptor = element.$model.getElementDescriptor(element);\n\n return !!find(descriptor.allTypes, function(t) {\n return t.name === type;\n });\n};\n\n\n/**\n * Returns the descriptor of an elements named property\n */\nModdle.prototype.getPropertyDescriptor = function(element, property) {\n return this.getElementDescriptor(element).propertiesByName[property];\n};\n","'use strict';\n\n/**\n * Parses a namespaced attribute name of the form (ns:)localName to an object,\n * given a default prefix to assume in case no explicit namespace is given.\n *\n * @param {String} name\n * @param {String} [defaultPrefix] the default prefix to take, if none is present.\n *\n * @return {Object} the parsed name\n */\nmodule.exports.parseName = function(name, defaultPrefix) {\n var parts = name.split(/:/),\n localName, prefix;\n\n // no prefix (i.e. only local name)\n if (parts.length === 1) {\n localName = name;\n prefix = defaultPrefix;\n } else\n // prefix + local name\n if (parts.length === 2) {\n localName = parts[1];\n prefix = parts[0];\n } else {\n throw new Error('expected <prefix:localName> or <localName>, got ' + name);\n }\n\n name = (prefix ? prefix + ':' : '') + localName;\n\n return {\n name: name,\n prefix: prefix,\n localName: localName\n };\n};","'use strict';\n\n\n/**\n * A utility that gets and sets properties of model elements.\n *\n * @param {Model} model\n */\nfunction Properties(model) {\n this.model = model;\n}\n\nmodule.exports = Properties;\n\n\n/**\n * Sets a named property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} value\n */\nProperties.prototype.set = function(target, name, value) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n target.$attrs[name] = value;\n } else {\n Object.defineProperty(target, property.name, {\n enumerable: !property.isReference,\n writable: true,\n value: value\n });\n }\n};\n\n/**\n * Returns the named property of the given element\n *\n * @param {Object} target\n * @param {String} name\n *\n * @return {Object}\n */\nProperties.prototype.get = function(target, name) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n return target.$attrs[name];\n }\n\n var propertyName = property.name;\n\n // check if access to collection property and lazily initialize it\n if (!target[propertyName] && property.isMany) {\n Object.defineProperty(target, propertyName, {\n enumerable: !property.isReference,\n writable: true,\n value: []\n });\n }\n\n return target[propertyName];\n};\n\n\n/**\n * Define a property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} options\n */\nProperties.prototype.define = function(target, name, options) {\n Object.defineProperty(target, name, options);\n};\n\n\n/**\n * Define the descriptor for an element\n */\nProperties.prototype.defineDescriptor = function(target, descriptor) {\n this.define(target, '$descriptor', { value: descriptor });\n};\n\n/**\n * Define the model for an element\n */\nProperties.prototype.defineModel = function(target, model) {\n this.define(target, '$model', { value: model });\n};","'use strict';\n\nvar assign = require(325),\n forEach = require(204);\n\nvar Types = require(65),\n DescriptorBuilder = require(59);\n\nvar parseNameNs = require(62).parseName,\n isBuiltInType = Types.isBuiltIn;\n\n\nfunction Registry(packages, properties, options) {\n this.options = assign({ generateId: 'id' }, options || {});\n\n this.packageMap = {};\n this.typeMap = {};\n\n this.packages = [];\n\n this.properties = properties;\n\n forEach(packages, this.registerPackage, this);\n}\n\nmodule.exports = Registry;\n\n\nRegistry.prototype.getPackage = function(uriOrPrefix) {\n return this.packageMap[uriOrPrefix];\n};\n\nRegistry.prototype.getPackages = function() {\n return this.packages;\n};\n\n\nRegistry.prototype.registerPackage = function(pkg) {\n\n // copy package\n pkg = assign({}, pkg);\n\n // register types\n forEach(pkg.types, function(descriptor) {\n this.registerType(descriptor, pkg);\n }, this);\n\n this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;\n this.packages.push(pkg);\n};\n\n\n/**\n * Register a type from a specific package with us\n */\nRegistry.prototype.registerType = function(type, pkg) {\n\n type = assign({}, type, {\n superClass: (type.superClass || []).slice(),\n extends: (type.extends || []).slice(),\n properties: (type.properties || []).slice()\n });\n\n var ns = parseNameNs(type.name, pkg.prefix),\n name = ns.name,\n propertiesByName = {};\n\n // parse properties\n forEach(type.properties, function(p) {\n\n // namespace property names\n var propertyNs = parseNameNs(p.name, ns.prefix),\n propertyName = propertyNs.name;\n\n // namespace property types\n if (!isBuiltInType(p.type)) {\n p.type = parseNameNs(p.type, propertyNs.prefix).name;\n }\n\n assign(p, {\n ns: propertyNs,\n name: propertyName\n });\n\n propertiesByName[propertyName] = p;\n });\n\n // update ns + name\n assign(type, {\n ns: ns,\n name: name,\n propertiesByName: propertiesByName\n });\n\n forEach(type.extends, function(extendsName) {\n var extended = this.typeMap[extendsName];\n\n extended.traits = extended.traits || [];\n extended.traits.push(name);\n }, this);\n\n // link to package\n this.definePackage(type, pkg);\n\n // register\n this.typeMap[name] = type;\n};\n\n\n/**\n * Traverse the type hierarchy from bottom to top.\n */\nRegistry.prototype.mapTypes = function(nsName, iterator) {\n\n var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];\n\n var self = this;\n\n /**\n * Traverse the selected super type or trait\n *\n * @param {String} cls\n */\n function traverseSuper(cls) {\n var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);\n self.mapTypes(parentNs, iterator);\n }\n\n if (!type) {\n throw new Error('unknown type <' + nsName.name + '>');\n }\n\n forEach(type.superClass, traverseSuper);\n\n iterator(type);\n\n forEach(type.traits, traverseSuper);\n};\n\n\n/**\n * Returns the effective descriptor for a type.\n *\n * @param {String} type the namespaced name (ns:localName) of the type\n *\n * @return {Descriptor} the resulting effective descriptor\n */\nRegistry.prototype.getEffectiveDescriptor = function(name) {\n\n var nsName = parseNameNs(name);\n\n var builder = new DescriptorBuilder(nsName);\n\n this.mapTypes(nsName, function(type) {\n builder.addTrait(type);\n });\n\n // check we have an id assigned\n var id = this.options.generateId;\n if (id && !builder.hasProperty(id)) {\n builder.addIdProperty(id);\n }\n\n var descriptor = builder.build();\n\n // define package link\n this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);\n\n return descriptor;\n};\n\n\nRegistry.prototype.definePackage = function(target, pkg) {\n this.properties.define(target, '$pkg', { value: pkg });\n};","'use strict';\n\n/**\n * Built-in moddle types\n */\nvar BUILTINS = {\n String: true,\n Boolean: true,\n Integer: true,\n Real: true,\n Element: true\n};\n\n/**\n * Converters for built in types from string representations\n */\nvar TYPE_CONVERTERS = {\n String: function(s) { return s; },\n Boolean: function(s) { return s === 'true'; },\n Integer: function(s) { return parseInt(s, 10); },\n Real: function(s) { return parseFloat(s, 10); }\n};\n\n/**\n * Convert a type to its real representation\n */\nmodule.exports.coerceType = function(type, value) {\n\n var converter = TYPE_CONVERTERS[type];\n\n if (converter) {\n return converter(value);\n } else {\n return value;\n }\n};\n\n/**\n * Return whether the given type is built-in\n */\nmodule.exports.isBuiltIn = function(type) {\n return !!BUILTINS[type];\n};\n\n/**\n * Return whether the given type is simple\n */\nmodule.exports.isSimple = function(type) {\n return !!TYPE_CONVERTERS[type];\n};","module.exports={\n \"name\": \"BPMN20\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/MODEL\",\n \"associations\": [],\n \"types\": [\n {\n \"name\": \"Interface\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operations\",\n \"type\": \"Operation\",\n \"isMany\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Operation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"errorRefs\",\n \"type\": \"Error\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EndPoint\",\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"Auditing\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"GlobalTask\",\n \"superClass\": [\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Monitoring\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Performer\",\n \"superClass\": [\n \"ResourceRole\"\n ]\n },\n {\n \"name\": \"Process\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"processType\",\n \"type\": \"ProcessType\",\n \"isAttr\": true\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"supports\",\n \"type\": \"Process\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"definitionalCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"isExecutable\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationSubscriptions\",\n \"type\": \"CorrelationSubscription\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LaneSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Lane\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"childLaneSet\",\n \"type\": \"LaneSet\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"partitionElementRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"flowNodeRef\",\n \"type\": \"FlowNode\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"partitionElement\",\n \"type\": \"BaseElement\"\n }\n ]\n },\n {\n \"name\": \"GlobalManualTask\",\n \"superClass\": [\n \"GlobalTask\"\n ]\n },\n {\n \"name\": \"ManualTask\",\n \"superClass\": [\n \"Task\"\n ]\n },\n {\n \"name\": \"UserTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n },\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Rendering\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"HumanPerformer\",\n \"superClass\": [\n \"Performer\"\n ]\n },\n {\n \"name\": \"PotentialOwner\",\n \"superClass\": [\n \"HumanPerformer\"\n ]\n },\n {\n \"name\": \"GlobalUserTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Gateway\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"gatewayDirection\",\n \"type\": \"GatewayDirection\",\n \"default\": \"Unspecified\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EventBasedGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"eventGatewayType\",\n \"type\": \"EventBasedGatewayType\",\n \"isAttr\": true,\n \"default\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"ComplexGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"activationCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParallelGateway\",\n \"superClass\": [\n \"Gateway\"\n ]\n },\n {\n \"name\": \"RootElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Relationship\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"direction\",\n \"type\": \"RelationshipDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"source\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"target\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n }\n ]\n },\n {\n \"name\": \"BaseElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"id\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"type\": \"Documentation\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionDefinitions\",\n \"type\": \"ExtensionDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"extensionElements\",\n \"type\": \"ExtensionElements\"\n }\n ]\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"mustUnderstand\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"definition\",\n \"type\": \"ExtensionDefinition\"\n }\n ]\n },\n {\n \"name\": \"ExtensionDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"extensionAttributeDefinitions\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionAttributeDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isReference\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"extensionDefinition\",\n \"type\": \"ExtensionDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionElements\",\n \"properties\": [\n {\n \"name\": \"valueRef\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionAttributeDefinition\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Documentation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Event\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"IntermediateCatchEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ]\n },\n {\n \"name\": \"IntermediateThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"EndEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"StartEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"isInterrupting\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"ThrowEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSet\",\n \"type\": \"InputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociation\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CatchEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"parallelMultiple\",\n \"isAttr\": true,\n \"type\": \"Boolean\",\n \"default\": false\n },\n {\n \"name\": \"outputSet\",\n \"type\": \"OutputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataOutputAssociation\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"BoundaryEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"cancelActivity\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"attachedToRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"EventDefinition\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CancelEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"ErrorEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"errorRef\",\n \"type\": \"Error\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TerminateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"EscalationEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"escalationRef\",\n \"type\": \"Escalation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Escalation\",\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"escalationCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ],\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CompensateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"waitForCompletion\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"activityRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TimerEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"timeDate\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeCycle\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeDuration\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"LinkEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"target\",\n \"type\": \"LinkEventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"source\",\n \"type\": \"LinkEventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConditionalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"SignalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"signalRef\",\n \"type\": \"Signal\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Signal\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ImplicitThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"DataState\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ItemAwareElement\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemSubjectRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataState\",\n \"type\": \"DataState\"\n }\n ]\n },\n {\n \"name\": \"DataAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"transformation\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"assignment\",\n \"type\": \"Assignment\",\n \"isMany\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"ItemAwareElement\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"ItemAwareElement\",\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataInput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithOptional\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithWhileExecuting\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataOutput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithOptional\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithWhileExecuting\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"dataInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"OutputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Property\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"DataInputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"DataOutputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"InputOutputSpecification\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSets\",\n \"type\": \"InputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"outputSets\",\n \"type\": \"OutputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"DataObject\",\n \"superClass\": [\n \"FlowElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"InputOutputBinding\",\n \"properties\": [\n {\n \"name\": \"inputDataRef\",\n \"type\": \"InputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputDataRef\",\n \"type\": \"OutputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Assignment\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"from\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"to\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"DataStore\",\n \"superClass\": [\n \"RootElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"capacity\",\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"isUnlimited\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"DataStoreReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataStoreRef\",\n \"type\": \"DataStore\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataObjectReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataObjectRef\",\n \"type\": \"DataObject\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConversationLink\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ConversationAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CallConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"calledCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Conversation\",\n \"superClass\": [\n \"ConversationNode\"\n ]\n },\n {\n \"name\": \"SubConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"conversationNodes\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ConversationNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageFlowRefs\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"GlobalConversation\",\n \"superClass\": [\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"PartnerEntity\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"PartnerRole\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationProperty\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRetrievalExpression\",\n \"type\": \"CorrelationPropertyRetrievalExpression\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Error\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"errorCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"CorrelationKey\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Expression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"isAbstract\": true\n },\n {\n \"name\": \"FormalExpression\",\n \"superClass\": [\n \"Expression\"\n ],\n \"properties\": [\n {\n \"name\": \"language\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"body\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"evaluatesToTypeRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Message\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"itemRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ItemDefinition\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemKind\",\n \"type\": \"ItemKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"structureRef\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"import\",\n \"type\": \"Import\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SequenceFlow\",\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isImmediate\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"conditionExpression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElementsContainer\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"laneSets\",\n \"type\": \"LaneSet\",\n \"isMany\": true\n },\n {\n \"name\": \"flowElements\",\n \"type\": \"FlowElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CallableElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"supportedInterfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ioBinding\",\n \"type\": \"InputOutputBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"FlowNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"incoming\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoing\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyRetrievalExpression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"messagePath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyBinding\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataPath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Resource\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resourceParameters\",\n \"type\": \"ResourceParameter\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ResourceParameter\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isRequired\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationSubscription\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationKeyRef\",\n \"type\": \"CorrelationKey\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationPropertyBinding\",\n \"type\": \"CorrelationPropertyBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlow\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlowAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InteractionNode\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"incomingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Participant\",\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"interfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantMultiplicity\",\n \"type\": \"ParticipantMultiplicity\"\n },\n {\n \"name\": \"endPointRefs\",\n \"type\": \"EndPoint\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"processRef\",\n \"type\": \"Process\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantMultiplicity\",\n \"properties\": [\n {\n \"name\": \"minimum\",\n \"default\": 0,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"maximum\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"Collaboration\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"choreographyRef\",\n \"type\": \"Choreography\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlowAssociations\",\n \"type\": \"MessageFlowAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationAssociations\",\n \"type\": \"ConversationAssociation\"\n },\n {\n \"name\": \"participants\",\n \"type\": \"Participant\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlows\",\n \"type\": \"MessageFlow\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"conversations\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationLinks\",\n \"type\": \"ConversationLink\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyActivity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"loopType\",\n \"type\": \"ChoreographyLoopType\",\n \"default\": \"None\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"CallChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledChoreographyRef\",\n \"type\": \"Choreography\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"SubChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\",\n \"FlowElementsContainer\"\n ],\n \"properties\": [\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyTask\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"messageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Choreography\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"GlobalChoreographyTask\",\n \"superClass\": [\n \"Choreography\"\n ],\n \"properties\": [\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TextAnnotation\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\"\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Group\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Association\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"associationDirection\",\n \"type\": \"AssociationDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Category\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValue\",\n \"type\": \"CategoryValue\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Artifact\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"CategoryValue\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categorizedFlowElements\",\n \"type\": \"FlowElement\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"value\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Activity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"isForCompensation\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCharacteristics\",\n \"type\": \"LoopCharacteristics\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"boundaryEventRefs\",\n \"type\": \"BoundaryEvent\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociations\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputAssociations\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"startQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"completionQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"ServiceTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SubProcess\",\n \"superClass\": [\n \"Activity\",\n \"FlowElementsContainer\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"triggeredByEvent\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LoopCharacteristics\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"MultiInstanceLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"isSequential\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"behavior\",\n \"type\": \"MultiInstanceBehavior\",\n \"default\": \"All\",\n \"isAttr\": true\n },\n {\n \"name\": \"loopCardinality\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopDataInputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"loopDataOutputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputDataItem\",\n \"type\": \"DataInput\"\n },\n {\n \"name\": \"outputDataItem\",\n \"type\": \"DataOutput\"\n },\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"complexBehaviorDefinition\",\n \"type\": \"ComplexBehaviorDefinition\",\n \"isMany\": true\n },\n {\n \"name\": \"oneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"noneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"StandardLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"testBefore\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopMaximum\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"CallActivity\",\n \"superClass\": [\n \"Activity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledElement\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Task\",\n \"superClass\": [\n \"Activity\",\n \"InteractionNode\"\n ]\n },\n {\n \"name\": \"SendTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ReceiveTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ScriptTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptFormat\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"BusinessRuleTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"AdHocSubProcess\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"ordering\",\n \"type\": \"AdHocOrdering\",\n \"isAttr\": true\n },\n {\n \"name\": \"cancelRemainingInstances\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"Transaction\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"protocol\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"method\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalScriptTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptLanguage\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalBusinessRuleTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ComplexBehaviorDefinition\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"event\",\n \"type\": \"ImplicitThrowEvent\"\n }\n ]\n },\n {\n \"name\": \"ResourceRole\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resourceRef\",\n \"type\": \"Resource\",\n \"isReference\": true\n },\n {\n \"name\": \"resourceParameterBindings\",\n \"type\": \"ResourceParameterBinding\",\n \"isMany\": true\n },\n {\n \"name\": \"resourceAssignmentExpression\",\n \"type\": \"ResourceAssignmentExpression\"\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ResourceParameterBinding\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"parameterRef\",\n \"type\": \"ResourceParameter\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ResourceAssignmentExpression\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Import\",\n \"properties\": [\n {\n \"name\": \"importType\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"location\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"namespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Definitions\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"targetNamespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"expressionLanguage\",\n \"default\": \"http://www.w3.org/1999/XPath\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"typeLanguage\",\n \"default\": \"http://www.w3.org/2001/XMLSchema\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"imports\",\n \"type\": \"Import\",\n \"isMany\": true\n },\n {\n \"name\": \"extensions\",\n \"type\": \"Extension\",\n \"isMany\": true\n },\n {\n \"name\": \"rootElements\",\n \"type\": \"RootElement\",\n \"isMany\": true\n },\n {\n \"name\": \"diagrams\",\n \"isMany\": true,\n \"type\": \"bpmndi:BPMNDiagram\"\n },\n {\n \"name\": \"exporter\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"relationships\",\n \"type\": \"Relationship\",\n \"isMany\": true\n },\n {\n \"name\": \"exporterVersion\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ProcessType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Public\"\n },\n {\n \"name\": \"Private\"\n }\n ]\n },\n {\n \"name\": \"GatewayDirection\",\n \"literalValues\": [\n {\n \"name\": \"Unspecified\"\n },\n {\n \"name\": \"Converging\"\n },\n {\n \"name\": \"Diverging\"\n },\n {\n \"name\": \"Mixed\"\n }\n ]\n },\n {\n \"name\": \"EventBasedGatewayType\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"RelationshipDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Forward\"\n },\n {\n \"name\": \"Backward\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"ItemKind\",\n \"literalValues\": [\n {\n \"name\": \"Physical\"\n },\n {\n \"name\": \"Information\"\n }\n ]\n },\n {\n \"name\": \"ChoreographyLoopType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Standard\"\n },\n {\n \"name\": \"MultiInstanceSequential\"\n },\n {\n \"name\": \"MultiInstanceParallel\"\n }\n ]\n },\n {\n \"name\": \"AssociationDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"MultiInstanceBehavior\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"All\"\n },\n {\n \"name\": \"Complex\"\n }\n ]\n },\n {\n \"name\": \"AdHocOrdering\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Sequential\"\n }\n ]\n }\n ],\n \"prefix\": \"bpmn\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\",\n \"typePrefix\": \"t\"\n }\n}","module.exports={\n \"name\": \"BPMNDI\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/DI\",\n \"types\": [\n {\n \"name\": \"BPMNDiagram\",\n \"properties\": [\n {\n \"name\": \"plane\",\n \"type\": \"BPMNPlane\",\n \"redefines\": \"di:Diagram#rootElement\"\n },\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isMany\": true\n }\n ],\n \"superClass\": [\n \"di:Diagram\"\n ]\n },\n {\n \"name\": \"BPMNPlane\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n }\n ],\n \"superClass\": [\n \"di:Plane\"\n ]\n },\n {\n \"name\": \"BPMNShape\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"isHorizontal\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isExpanded\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isMarkerVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"isMessageVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"participantBandKind\",\n \"type\": \"ParticipantBandKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"choreographyActivityShape\",\n \"type\": \"BPMNShape\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ],\n \"superClass\": [\n \"di:LabeledShape\"\n ]\n },\n {\n \"name\": \"BPMNEdge\",\n \"properties\": [\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"sourceElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#source\"\n },\n {\n \"name\": \"targetElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#target\"\n },\n {\n \"name\": \"messageVisibleKind\",\n \"type\": \"MessageVisibleKind\",\n \"isAttr\": true,\n \"default\": \"initiating\"\n }\n ],\n \"superClass\": [\n \"di:LabeledEdge\"\n ]\n },\n {\n \"name\": \"BPMNLabel\",\n \"properties\": [\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isAttr\": true,\n \"isReference\": true,\n \"redefines\": \"di:DiagramElement#style\"\n }\n ],\n \"superClass\": [\n \"di:Label\"\n ]\n },\n {\n \"name\": \"BPMNLabelStyle\",\n \"properties\": [\n {\n \"name\": \"font\",\n \"type\": \"dc:Font\"\n }\n ],\n \"superClass\": [\n \"di:Style\"\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ParticipantBandKind\",\n \"literalValues\": [\n {\n \"name\": \"top_initiating\"\n },\n {\n \"name\": \"middle_initiating\"\n },\n {\n \"name\": \"bottom_initiating\"\n },\n {\n \"name\": \"top_non_initiating\"\n },\n {\n \"name\": \"middle_non_initiating\"\n },\n {\n \"name\": \"bottom_non_initiating\"\n }\n ]\n },\n {\n \"name\": \"MessageVisibleKind\",\n \"literalValues\": [\n {\n \"name\": \"initiating\"\n },\n {\n \"name\": \"non_initiating\"\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"bpmndi\"\n}","module.exports={\n \"name\": \"DC\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DC\",\n \"types\": [\n {\n \"name\": \"Boolean\"\n },\n {\n \"name\": \"Integer\"\n },\n {\n \"name\": \"Real\"\n },\n {\n \"name\": \"String\"\n },\n {\n \"name\": \"Font\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"size\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"isBold\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isItalic\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isUnderline\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isStrikeThrough\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Point\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Bounds\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"width\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"height\",\n \"type\": \"Real\",\n \"isAttr\": true\n }\n ]\n }\n ],\n \"prefix\": \"dc\",\n \"associations\": []\n}","module.exports={\n \"name\": \"DI\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DI\",\n \"types\": [\n {\n \"name\": \"DiagramElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"extension\",\n \"type\": \"Extension\"\n },\n {\n \"name\": \"owningDiagram\",\n \"type\": \"Diagram\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"owningElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"modelElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"style\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ownedElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Node\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ]\n },\n {\n \"name\": \"Edge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ],\n \"properties\": [\n {\n \"name\": \"source\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"target\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"waypoint\",\n \"isUnique\": false,\n \"isMany\": true,\n \"type\": \"dc:Point\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Diagram\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"rootElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resolution\",\n \"isAttr\": true,\n \"type\": \"Real\"\n },\n {\n \"name\": \"ownedStyle\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Shape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Plane\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"planeElement\",\n \"type\": \"DiagramElement\",\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledEdge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Edge\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledShape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Shape\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Label\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Style\",\n \"isAbstract\": true\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"di\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\"\n }\n}","module.exports = {\n __depends__: [ require(103) ],\n __init__: [ 'directEditing' ],\n directEditing: [ 'type', require(71) ]\n};","'use strict';\n\nvar bind = require(213),\n find = require(203);\n\nvar TextBox = require(72);\n\n\n/**\n * A direct editing component that allows users\n * to edit an elements text directly in the diagram\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction DirectEditing(eventBus, canvas) {\n\n this._eventBus = eventBus;\n\n this._providers = [];\n this._textbox = new TextBox({\n container: canvas.getContainer(),\n keyHandler: bind(this._handleKey, this)\n });\n}\n\nDirectEditing.$inject = [ 'eventBus', 'canvas' ];\n\n\n/**\n * Register a direct editing provider\n\n * @param {Object} provider the provider, must expose an #activate(element) method that returns\n * an activation context ({ bounds: {x, y, width, height }, text }) if\n * direct editing is available for the given element.\n * Additionally the provider must expose a #update(element, value) method\n * to receive direct editing updates.\n */\nDirectEditing.prototype.registerProvider = function(provider) {\n this._providers.push(provider);\n};\n\n\n/**\n * Returns true if direct editing is currently active\n *\n * @return {Boolean}\n */\nDirectEditing.prototype.isActive = function() {\n return !!this._active;\n};\n\n\n/**\n * Cancel direct editing, if it is currently active\n */\nDirectEditing.prototype.cancel = function() {\n if (!this._active) {\n return;\n }\n\n this._fire('cancel');\n this.close();\n};\n\n\nDirectEditing.prototype._fire = function(event) {\n this._eventBus.fire('directEditing.' + event, { active: this._active });\n};\n\nDirectEditing.prototype.close = function() {\n this._textbox.destroy();\n\n this._fire('deactivate');\n\n this._active = null;\n};\n\n\nDirectEditing.prototype.complete = function() {\n\n var active = this._active;\n\n if (!active) {\n return;\n }\n\n var text = this.getValue();\n\n if (text !== active.context.text) {\n active.provider.update(active.element, text, active.context.text);\n }\n\n this._fire('complete');\n\n this.close();\n};\n\n\nDirectEditing.prototype.getValue = function() {\n return this._textbox.getValue();\n};\n\n\nDirectEditing.prototype._handleKey = function(e) {\n\n // stop bubble\n e.stopPropagation();\n\n var key = e.keyCode || e.charCode;\n\n // ESC\n if (key === 27) {\n e.preventDefault();\n return this.cancel();\n }\n\n // Enter\n if (key === 13 && !e.shiftKey) {\n e.preventDefault();\n return this.complete();\n }\n};\n\n\n/**\n * Activate direct editing on the given element\n *\n * @param {Object} ElementDescriptor the descriptor for a shape or connection\n * @return {Boolean} true if the activation was possible\n */\nDirectEditing.prototype.activate = function(element) {\n\n if (this.isActive()) {\n this.cancel();\n }\n\n // the direct editing context\n var context;\n\n var provider = find(this._providers, function(p) {\n return !!(context = p.activate(element)) ? p : null;\n });\n\n // check if activation took place\n if (context) {\n this._textbox.create(context.bounds, context.style, context.text);\n\n this._active = {\n element: element,\n context: context,\n provider: provider\n };\n\n this._fire('activate');\n }\n\n return !!context;\n};\n\n\nmodule.exports = DirectEditing;","'use strict';\n\nvar assign = require(325),\n domEvent = require(344),\n domRemove = require(347);\n\nfunction stopPropagation(event) {\n event.stopPropagation();\n}\n\nfunction TextBox(options) {\n\n this.container = options.container;\n this.textarea = document.createElement('textarea');\n\n this.keyHandler = options.keyHandler || function() {};\n}\n\nmodule.exports = TextBox;\n\n\nTextBox.prototype.create = function(bounds, style, value) {\n\n var textarea = this.textarea,\n container = this.container;\n\n assign(textarea.style, {\n width: bounds.width + 'px',\n height: bounds.height + 'px',\n left: bounds.x + 'px',\n top: bounds.y + 'px',\n position: 'absolute',\n textAlign: 'center',\n boxSizing: 'border-box'\n }, style || {});\n\n textarea.value = value;\n textarea.title = 'Press SHIFT+Enter for line feed';\n\n domEvent.bind(textarea, 'keydown', this.keyHandler);\n domEvent.bind(textarea, 'mousedown', stopPropagation);\n\n container.appendChild(textarea);\n\n setTimeout(function() {\n textarea.select();\n textarea.focus();\n }, 100);\n};\n\nTextBox.prototype.destroy = function() {\n var textarea = this.textarea;\n\n textarea.value = '';\n\n domEvent.unbind(textarea, 'keydown', this.keyHandler);\n domEvent.unbind(textarea, 'mousedown', stopPropagation);\n\n domRemove(textarea);\n};\n\nTextBox.prototype.getValue = function() {\n return this.textarea.value;\n};","module.exports = require(74);","'use strict';\n\nvar di = require(190);\n\n\n/**\n * Bootstrap an injector from a list of modules, instantiating a number of default components\n *\n * @ignore\n * @param {Array<didi.Module>} bootstrapModules\n *\n * @return {didi.Injector} a injector to use to access the components\n */\nfunction bootstrap(bootstrapModules) {\n\n var modules = [],\n components = [];\n\n function hasModule(m) {\n return modules.indexOf(m) >= 0;\n }\n\n function addModule(m) {\n modules.push(m);\n }\n\n function visit(m) {\n if (hasModule(m)) {\n return;\n }\n\n (m.__depends__ || []).forEach(visit);\n\n if (hasModule(m)) {\n return;\n }\n\n addModule(m);\n\n (m.__init__ || []).forEach(function(c) {\n components.push(c);\n });\n }\n\n bootstrapModules.forEach(visit);\n\n var injector = new di.Injector(modules);\n\n components.forEach(function(c) {\n\n try {\n // eagerly resolve component (fn or string)\n injector[typeof c === 'string' ? 'get' : 'invoke'](c);\n } catch (e) {\n console.error('Failed to instantiate component');\n console.error(e.stack);\n\n throw e;\n }\n });\n\n return injector;\n}\n\n/**\n * Creates an injector from passed options.\n *\n * @ignore\n * @param {Object} options\n * @return {didi.Injector}\n */\nfunction createInjector(options) {\n\n options = options || {};\n\n var configModule = {\n 'config': ['value', options]\n };\n\n var coreModule = require(83);\n\n var modules = [ configModule, coreModule ].concat(options.modules || []);\n\n return bootstrap(modules);\n}\n\n\n/**\n * The main diagram-js entry point that bootstraps the diagram with the given\n * configuration.\n *\n * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.\n *\n * @class djs.Diagram\n * @memberOf djs\n * @constructor\n *\n * @example\n *\n * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>\n *\n * // plug-in implemenentation\n * function MyLoggingPlugin(eventBus) {\n * eventBus.on('shape.added', function(event) {\n * console.log('shape ', event.shape, ' was added to the diagram');\n * });\n * }\n *\n * // export as module\n * module.exports = {\n * __init__: [ 'myLoggingPlugin' ],\n * myLoggingPlugin: [ 'type', MyLoggingPlugin ]\n * };\n *\n *\n * // instantiate the diagram with the new plug-in\n *\n * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });\n *\n * diagram.invoke([ 'canvas', function(canvas) {\n * // add shape to drawing canvas\n * canvas.addShape({ x: 10, y: 10 });\n * });\n *\n * // 'shape ... was added to the diagram' logged to console\n *\n * @param {Object} options\n * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram\n * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with\n */\nfunction Diagram(options, injector) {\n\n // create injector unless explicitly specified\n this.injector = injector = injector || createInjector(options);\n\n // API\n\n /**\n * Resolves a diagram service\n *\n * @method Diagram#get\n *\n * @param {String} name the name of the diagram service to be retrieved\n * @param {Object} [locals] a number of locals to use to resolve certain dependencies\n */\n this.get = injector.get;\n\n /**\n * Executes a function into which diagram services are injected\n *\n * @method Diagram#invoke\n *\n * @param {Function|Object[]} fn the function to resolve\n * @param {Object} locals a number of locals to use to resolve certain dependencies\n */\n this.invoke = injector.invoke;\n\n // init\n\n // indicate via event\n\n\n /**\n * An event indicating that all plug-ins are loaded.\n *\n * Use this event to fire other events to interested plug-ins\n *\n * @memberOf Diagram\n *\n * @event diagram.init\n *\n * @example\n *\n * eventBus.on('diagram.init', function() {\n * eventBus.fire('my-custom-event', { foo: 'BAR' });\n * });\n *\n * @type {Object}\n */\n this.get('eventBus').fire('diagram.init');\n}\n\nmodule.exports = Diagram;\n\n\n/**\n * Destroys the diagram\n *\n * @method Diagram#destroy\n */\nDiagram.prototype.destroy = function() {\n this.get('eventBus').fire('diagram.destroy');\n};","'use strict';\n\nvar forEach = require(204),\n isFunction = require(317),\n isArray = require(316);\n\n\n/**\n * A utility that can be used to plug-in into the command execution for\n * extension and/or validation.\n *\n * @param {EventBus} eventBus\n *\n * @example\n *\n * var inherits = require('inherits');\n *\n * var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');\n *\n * function CommandLogger(eventBus) {\n * CommandInterceptor.call(this, eventBus);\n *\n * this.preExecute(function(event) {\n * console.log('command pre-execute', event);\n * });\n * }\n *\n * inherits(CommandLogger, CommandInterceptor);\n *\n */\nfunction CommandInterceptor(eventBus) {\n this._eventBus = eventBus;\n}\n\nCommandInterceptor.$inject = [ 'eventBus' ];\n\nmodule.exports = CommandInterceptor;\n\nfunction unwrapEvent(fn) {\n return function(event) {\n return fn(event.context, event.command, event);\n };\n}\n\n/**\n * Register an interceptor for a command execution\n *\n * @param {String|Array<String>} [events] list of commands to register on\n * @param {String} [hook] command hook, i.e. preExecute, executed to listen on\n * @param {Function} handlerFn interceptor to be invoked with (event)\n * @param {Boolean} unwrap if true, unwrap the event and pass (context, command, event) to the\n * listener instead\n */\nCommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {\n\n if (isFunction(hook)) {\n unwrap = handlerFn;\n handlerFn = hook;\n hook = null;\n }\n\n if (!isFunction(handlerFn)) {\n throw new Error('handlerFn must be a function');\n }\n\n if (!isArray(events)) {\n events = [ events ];\n }\n\n var eventBus = this._eventBus;\n\n forEach(events, function(event) {\n // concat commandStack(.event)?(.hook)?\n var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');\n\n eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);\n });\n};\n\n\nvar hooks = [\n 'canExecute',\n 'preExecute',\n 'execute',\n 'executed',\n 'postExecute',\n 'revert',\n 'reverted'\n];\n\n/*\n * Install hook shortcuts\n *\n * This will generate the CommandInterceptor#(preExecute|...|reverted) methods\n * which will in term forward to CommandInterceptor#on.\n */\nforEach(hooks, function(hook) {\n CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {\n if (isFunction(events)) {\n unwrap = fn;\n fn = events;\n events = null;\n }\n\n this.on(events, hook, fn, unwrap);\n };\n});","'use strict';\n\nvar unique = require(199),\n isArray = require(316),\n assign = require(325);\n\nvar InternalEvent = require(81).Event;\n\n\n/**\n * A service that offers un- and redoable execution of commands.\n *\n * The command stack is responsible for executing modeling actions\n * in a un- and redoable manner. To do this it delegates the actual\n * command execution to {@link CommandHandler}s.\n *\n * Command handlers provide {@link CommandHandler#execute(ctx)} and\n * {@link CommandHandler#revert(ctx)} methods to un- and redo a command\n * identified by a command context.\n *\n *\n * ## Life-Cycle events\n *\n * In the process the command stack fires a number of life-cycle events\n * that other components to participate in the command execution.\n *\n * * preExecute\n * * execute\n * * executed\n * * postExecute\n * * revert\n * * reverted\n *\n * A special event is used for validating, whether a command can be\n * performed prior to its execution.\n *\n * * canExecute\n *\n * Each of the events is fired as `commandStack.{eventName}` and\n * `commandStack.{commandName}.{eventName}`, respectively. This gives\n * components fine grained control on where to hook into.\n *\n * The event object fired transports `command`, the name of the\n * command and `context`, the command context.\n *\n *\n * ## Creating Command Handlers\n *\n * Command handlers should provide the {@link CommandHandler#execute(ctx)}\n * and {@link CommandHandler#revert(ctx)} methods to implement\n * redoing and undoing of a command. They must ensure undo is performed\n * properly in order not to break the undo chain.\n *\n * Command handlers may execute other modeling operations (and thus\n * commands) in their `preExecute` and `postExecute` phases. The command\n * stack will properly group all commands together into a logical unit\n * that may be re- and undone atomically.\n *\n * Command handlers must not execute other commands from within their\n * core implementation (`execute`, `revert`).\n *\n *\n * ## Change Tracking\n *\n * During the execution of the CommandStack it will keep track of all\n * elements that have been touched during the command's execution.\n *\n * At the end of the CommandStack execution it will notify interested\n * components via an 'elements.changed' event with all the dirty\n * elements.\n *\n * The event can be picked up by components that are interested in the fact\n * that elements have been changed. One use case for this is updating\n * their graphical representation after moving / resizing or deletion.\n *\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nfunction CommandStack(eventBus, injector) {\n\n /**\n * A map of all registered command handlers.\n *\n * @type {Object}\n */\n this._handlerMap = {};\n\n /**\n * A stack containing all re/undoable actions on the diagram\n *\n * @type {Array<Object>}\n */\n this._stack = [];\n\n /**\n * The current index on the stack\n *\n * @type {Number}\n */\n this._stackIdx = -1;\n\n /**\n * Current active commandStack execution\n *\n * @type {Object}\n */\n this._currentExecution = {\n actions: [],\n dirty: []\n };\n\n\n this._injector = injector;\n this._eventBus = eventBus;\n\n this._uid = 1;\n}\n\nCommandStack.$inject = [ 'eventBus', 'injector' ];\n\nmodule.exports = CommandStack;\n\n\n/**\n * Execute a command\n *\n * @param {String} command the command to execute\n * @param {Object} context the environment to execute the command in\n */\nCommandStack.prototype.execute = function(command, context) {\n if (!command) {\n throw new Error('command required');\n }\n\n var action = { command: command, context: context };\n\n this._pushAction(action);\n this._internalExecute(action);\n this._popAction(action);\n};\n\n\n/**\n * Ask whether a given command can be executed.\n *\n * Implementors may hook into the mechanism on two ways:\n *\n * * in event listeners:\n *\n * Users may prevent the execution via an event listener.\n * It must prevent the default action for `commandStack.(<command>.)canExecute` events.\n *\n * * in command handlers:\n *\n * If the method {@link CommandHandler#canExecute} is implemented in a handler\n * it will be called to figure out whether the execution is allowed.\n *\n * @param {String} command the command to execute\n * @param {Object} context the environment to execute the command in\n *\n * @return {Boolean} true if the command can be executed\n */\nCommandStack.prototype.canExecute = function(command, context) {\n\n var action = { command: command, context: context };\n\n var handler = this._getHandler(command);\n\n if (!handler) {\n return false;\n }\n\n var result = this._fire(command, 'canExecute', action);\n\n // handler#canExecute will only be called if no listener\n // decided on a result already\n if (result === undefined && handler.canExecute) {\n result = handler.canExecute(context);\n }\n\n return result;\n};\n\n\n/**\n * Clear the command stack, erasing all undo / redo history\n */\nCommandStack.prototype.clear = function() {\n this._stack.length = 0;\n this._stackIdx = -1;\n\n this._fire('changed');\n};\n\n\n/**\n * Undo last command(s)\n */\nCommandStack.prototype.undo = function() {\n var action = this._getUndoAction(),\n next;\n\n if (action) {\n this._pushAction(action);\n\n while (action) {\n this._internalUndo(action);\n next = this._getUndoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Redo last command(s)\n */\nCommandStack.prototype.redo = function() {\n var action = this._getRedoAction(),\n next;\n\n if (action) {\n this._pushAction(action);\n\n while (action) {\n this._internalExecute(action, true);\n next = this._getRedoAction();\n\n if (!next || next.id !== action.id) {\n break;\n }\n\n action = next;\n }\n\n this._popAction();\n }\n};\n\n\n/**\n * Register a handler instance with the command stack\n *\n * @param {String} command\n * @param {CommandHandler} handler\n */\nCommandStack.prototype.register = function(command, handler) {\n this._setHandler(command, handler);\n};\n\n\n/**\n * Register a handler type with the command stack\n * by instantiating it and injecting its dependencies.\n *\n * @param {String} command\n * @param {Function} a constructor for a {@link CommandHandler}\n */\nCommandStack.prototype.registerHandler = function(command, handlerCls) {\n\n if (!command || !handlerCls) {\n throw new Error('command and handlerCls must be defined');\n }\n\n var handler = this._injector.instantiate(handlerCls);\n this.register(command, handler);\n};\n\nCommandStack.prototype.canUndo = function() {\n return !!this._getUndoAction();\n};\n\nCommandStack.prototype.canRedo = function() {\n return !!this._getRedoAction();\n};\n\n////// stack access //////////////////////////////////////\n\nCommandStack.prototype._getRedoAction = function() {\n return this._stack[this._stackIdx + 1];\n};\n\n\nCommandStack.prototype._getUndoAction = function() {\n return this._stack[this._stackIdx];\n};\n\n\n////// internal functionality /////////////////////////////\n\nCommandStack.prototype._internalUndo = function(action) {\n var command = action.command,\n context = action.context;\n\n var handler = this._getHandler(command);\n\n this._fire(command, 'revert', action);\n\n this._markDirty(handler.revert(context));\n\n this._revertedAction(action);\n\n this._fire(command, 'reverted', action);\n};\n\n\nCommandStack.prototype._fire = function(command, qualifier, event) {\n if (arguments.length < 3) {\n event = qualifier;\n qualifier = null;\n }\n\n var names = qualifier ? [ command + '.' + qualifier, qualifier ] : [ command ],\n i, name, result;\n\n event = assign(new InternalEvent(), event);\n\n for (i = 0; !!(name = names[i]); i++) {\n result = this._eventBus.fire('commandStack.' + name, event);\n\n if (event.cancelBubble) {\n break;\n }\n }\n\n return result;\n};\n\nCommandStack.prototype._createId = function() {\n return this._uid++;\n};\n\n\nCommandStack.prototype._internalExecute = function(action, redo) {\n var command = action.command,\n context = action.context;\n\n var handler = this._getHandler(command);\n\n if (!handler) {\n throw new Error('no command handler registered for <' + command + '>');\n }\n\n this._pushAction(action);\n\n if (!redo) {\n this._fire(command, 'preExecute', action);\n\n if (handler.preExecute) {\n handler.preExecute(context);\n }\n }\n\n this._fire(command, 'execute', action);\n\n // execute\n this._markDirty(handler.execute(context));\n\n // log to stack\n this._executedAction(action, redo);\n\n this._fire(command, 'executed', action);\n\n if (!redo) {\n if (handler.postExecute) {\n handler.postExecute(context);\n }\n\n this._fire(command, 'postExecute', action);\n }\n\n this._popAction(action);\n};\n\n\nCommandStack.prototype._pushAction = function(action) {\n\n var execution = this._currentExecution,\n actions = execution.actions;\n\n var baseAction = actions[0];\n\n if (!action.id) {\n action.id = (baseAction && baseAction.id) || this._createId();\n }\n\n actions.push(action);\n};\n\n\nCommandStack.prototype._popAction = function() {\n var execution = this._currentExecution,\n actions = execution.actions,\n dirty = execution.dirty;\n\n actions.pop();\n\n if (!actions.length) {\n this._eventBus.fire('elements.changed', { elements: unique(dirty) });\n\n dirty.length = 0;\n\n this._fire('changed');\n }\n};\n\n\nCommandStack.prototype._markDirty = function(elements) {\n var execution = this._currentExecution;\n\n if (!elements) {\n return;\n }\n\n elements = isArray(elements) ? elements : [ elements ];\n\n execution.dirty = execution.dirty.concat(elements);\n};\n\n\nCommandStack.prototype._executedAction = function(action, redo) {\n var stackIdx = ++this._stackIdx;\n\n if (!redo) {\n this._stack.splice(stackIdx, this._stack.length, action);\n }\n};\n\n\nCommandStack.prototype._revertedAction = function(action) {\n this._stackIdx--;\n};\n\n\nCommandStack.prototype._getHandler = function(command) {\n return this._handlerMap[command];\n};\n\nCommandStack.prototype._setHandler = function(command, handler) {\n if (!command || !handler) {\n throw new Error('command and handler required');\n }\n\n if (this._handlerMap[command]) {\n throw new Error('overriding handler for command <' + command + '>');\n }\n\n this._handlerMap[command] = handler;\n};\n","module.exports = {\n __depends__: [ require(83) ],\n commandStack: [ 'type', require(76) ]\n};","'use strict';\n\nvar isNumber = require(319),\n assign = require(325),\n forEach = require(204);\n\nvar Collections = require(175);\n\nvar Snap = require(188);\n\nfunction round(number, resolution) {\n return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n return isNumber(number) ? number + 'px' : number;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param {Object} options\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n options = assign({}, { width: '100%', height: '100%' }, options);\n\n var container = options.container || document.body;\n\n // create a <div> around the svg element with the respective size\n // this way we can always get the correct container size\n // (this is impossible for <svg> elements at the moment)\n var parent = document.createElement('div');\n parent.setAttribute('class', 'djs-container');\n\n assign(parent.style, {\n position: 'relative',\n overflow: 'hidden',\n width: ensurePx(options.width),\n height: ensurePx(options.height)\n });\n\n container.appendChild(parent);\n\n return parent;\n}\n\nfunction createGroup(parent, cls) {\n return parent.group().attr({ 'class' : cls });\n}\n\nvar BASE_LAYER = 'base';\n\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._graphicsFactory = graphicsFactory;\n\n this._init(config || {});\n}\n\nCanvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];\n\nmodule.exports = Canvas;\n\n\nCanvas.prototype._init = function(config) {\n\n // Creates a <svg> element that is wrapped into a <div>.\n // This way we are always able to correctly figure out the size of the svg element\n // by querying the parent node.\n //\n // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n //\n // <div class=\"djs-container\" style=\"width: {desired-width}, height: {desired-height}\">\n // <svg width=\"100%\" height=\"100%\">\n // ...\n // </svg>\n // </div>\n\n // html container\n var eventBus = this._eventBus,\n\n container = createContainer(config),\n svg = Snap.createSnapAt('100%', '100%', container),\n viewport = createGroup(svg, 'viewport'),\n\n self = this;\n\n this._container = container;\n this._svg = svg;\n this._viewport = viewport;\n this._layers = {};\n\n eventBus.on('diagram.init', function(event) {\n\n /**\n * An event indicating that the canvas is ready to be drawn on.\n *\n * @memberOf Canvas\n *\n * @event canvas.init\n *\n * @type {Object}\n * @property {Snap<SVGSVGElement>} svg the created svg element\n * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes\n */\n eventBus.fire('canvas.init', { svg: svg, viewport: viewport });\n });\n\n eventBus.on('diagram.destroy', function() {\n\n var parent = self._container.parentNode;\n\n if (parent) {\n parent.removeChild(container);\n }\n\n eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });\n\n self._svg.remove();\n\n self._svg = self._container = self._layers = self._viewport = null;\n });\n\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getDefaultLayer = function() {\n return this.getLayer(BASE_LAYER);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * @param {String} name\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n var layer = this._layers[name];\n if (!layer) {\n layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);\n }\n\n return layer;\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {DOMNode}\n */\nCanvas.prototype.getContainer = function() {\n return this._container;\n};\n\n\n/////////////// markers ///////////////////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n var container;\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n // we need to access all\n container = this._elementRegistry._elements[element.id];\n\n if (!container) {\n return;\n }\n\n forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n if (gfx) {\n // invoke either addClass or removeClass based on mode\n gfx[add ? 'addClass' : 'removeClass'](marker);\n }\n });\n\n /**\n * An event indicating that a marker has been updated for an element\n *\n * @event element.marker.update\n * @type {Object}\n * @property {djs.model.Element} element the shape\n * @property {Object} gfx the graphical representation of the shape\n * @property {String} marker\n * @property {Boolean} add true if the marker was added, false if it got removed\n */\n this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n * canvas.addMarker('foo', 'some-marker');\n *\n * var fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; // <g class=\"... some-marker\"> ... </g>\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.addMarker = function(element, marker) {\n this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n this._updateMarker(element, marker, false);\n};\n\n/**\n * Check the existence of a marker on element.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n var gfx = this.getGraphics(element);\n\n return gfx && gfx.hasClass(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n if(this.hasMarker(element, marker)) {\n this.removeMarker(element, marker);\n } else {\n this.addMarker(element, marker);\n }\n};\n\nCanvas.prototype.getRootElement = function() {\n if (!this._rootElement) {\n this.setRootElement({ id: '__implicitroot' });\n }\n\n return this._rootElement;\n};\n\n\n\n//////////////// root element handling ///////////////////////////\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {Object|djs.model.Root} element\n * @param {Boolean} [override] whether to override the current root element, if any\n *\n * @return {Object|djs.model.Root} new root element\n */\nCanvas.prototype.setRootElement = function(element, override) {\n\n this._ensureValidId(element);\n\n var oldRoot = this._rootElement,\n elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n if (oldRoot) {\n if (!override) {\n throw new Error('rootElement already set, need to specify override');\n }\n\n // simulate element remove event sequence\n eventBus.fire('root.remove', { element: oldRoot });\n eventBus.fire('root.removed', { element: oldRoot });\n\n elementRegistry.remove(oldRoot);\n }\n\n var gfx = this.getDefaultLayer();\n\n // resemble element add event sequence\n eventBus.fire('root.add', { element: element });\n\n elementRegistry.add(element, gfx, this._svg);\n\n eventBus.fire('root.added', { element: element, gfx: gfx });\n\n this._rootElement = element;\n\n return element;\n};\n\n\n\n///////////// add functionality ///////////////////////////////\n\nCanvas.prototype._ensureValidId = function(element) {\n if (!element.id) {\n throw new Error('element must have an id');\n }\n\n if (this._elementRegistry.get(element.id)) {\n throw new Error('element with id ' + element.id + ' already exists');\n }\n};\n\nCanvas.prototype._setParent = function(element, parent) {\n Collections.add(parent.children, element);\n element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n * * <{type}.add> (element, parent)\n * * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {String} type\n * @param {Object|djs.model.Base} element\n * @param {Object|djs.model.Base} [parent]\n *\n * @return {Object|djs.model.Base} the added element\n */\nCanvas.prototype._addElement = function(type, element, parent) {\n\n parent = parent || this.getRootElement();\n\n var eventBus = this._eventBus,\n graphicsFactory = this._graphicsFactory;\n\n this._ensureValidId(element);\n\n eventBus.fire(type + '.add', { element: element, parent: parent });\n\n this._setParent(element, parent);\n\n // create graphics\n var gfx = graphicsFactory.create(type, element);\n\n this._elementRegistry.add(element, gfx);\n\n // update its visual\n graphicsFactory.update(type, element, gfx);\n\n eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n return element;\n};\n\n/**\n * Adds a shape to the canvas\n *\n * @param {Object|djs.model.Shape} shape to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Shape} the added shape\n */\nCanvas.prototype.addShape = function(shape, parent) {\n return this._addElement('shape', shape, parent);\n};\n\n/**\n * Adds a connection to the canvas\n *\n * @param {Object|djs.model.Connection} connection to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Connection} the added connection\n */\nCanvas.prototype.addConnection = function(connection, parent) {\n return this._addElement('connection', connection, parent);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n var elementRegistry = this._elementRegistry,\n graphicsFactory = this._graphicsFactory,\n eventBus = this._eventBus;\n\n element = elementRegistry.get(element.id || element);\n\n if (!element) {\n // element was removed already\n return;\n }\n\n eventBus.fire(type + '.remove', { element: element });\n\n graphicsFactory.remove(element);\n\n // unset parent <-> child relationship\n Collections.remove(element.parent && element.parent.children, element);\n element.parent = null;\n\n eventBus.fire(type + '.removed', { element: element });\n\n elementRegistry.remove(element);\n\n return element;\n};\n\n\n/**\n * Removes a shape from the canvas\n *\n * @param {String|djs.model.Shape} shape or shape id to be removed\n *\n * @return {djs.model.Shape} the removed shape\n */\nCanvas.prototype.removeShape = function(shape) {\n\n /**\n * An event indicating that a shape is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.remove\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n\n /**\n * An event indicating that a shape has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.removed\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas\n *\n * @param {String|djs.model.Connection} connection or connection id to be removed\n *\n * @return {djs.model.Connection} the removed connection\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n /**\n * An event indicating that a connection is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.remove\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n\n /**\n * An event indicating that a connection has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.removed\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Sends a shape to the front.\n *\n * This method takes parent / child relationships between shapes into account\n * and makes sure that children are properly handled, too.\n *\n * @param {djs.model.Shape} shape descriptor of the shape to be sent to front\n * @param {boolean} [bubble=true] whether to send parent shapes to front, too\n */\nCanvas.prototype.sendToFront = function(shape, bubble) {\n\n if (bubble !== false) {\n bubble = true;\n }\n\n if (bubble && shape.parent) {\n this.sendToFront(shape.parent);\n }\n\n forEach(shape.children, function(child) {\n this.sendToFront(child, false);\n }, this);\n\n var gfx = this.getGraphics(shape),\n gfxParent = gfx.parent();\n\n gfx.remove().appendTo(gfxParent);\n};\n\n\n/**\n * Return the graphical object underlaying a certain diagram element\n *\n * @param {String|djs.model.Base} element descriptor of the element\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\nCanvas.prototype._fireViewboxChange = function() {\n this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the area that is currently displayed\n *\n * @param {Object} [box] the new view box to set\n * @param {Number} box.x the top left X coordinate of the canvas visible in view box\n * @param {Number} box.y the top left Y coordinate of the canvas visible in view box\n * @param {Number} box.width the visible width\n * @param {Number} box.height\n *\n * @example\n *\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * @return {Object} the current view box\n */\nCanvas.prototype.viewbox = function(box) {\n\n if (box === undefined && this._cachedViewbox) {\n return this._cachedViewbox;\n }\n\n var viewport = this._viewport,\n innerBox,\n outerBox = this.getSize(),\n matrix,\n scale,\n x, y;\n\n if (!box) {\n // compute the inner box based on the\n // diagrams default layer. This allows us to exclude\n // external components, such as overlays\n innerBox = this.getDefaultLayer().getBBox(true);\n\n matrix = viewport.transform().localMatrix;\n scale = round(matrix.a, 1000);\n\n x = round(-matrix.e || 0, 1000);\n y = round(-matrix.f || 0, 1000);\n\n box = this._cachedViewbox = {\n x: x ? x / scale : 0,\n y: y ? y / scale : 0,\n width: outerBox.width / scale,\n height: outerBox.height / scale,\n scale: scale,\n inner: {\n width: innerBox.width,\n height: innerBox.height,\n x: innerBox.x,\n y: innerBox.y\n },\n outer: outerBox\n };\n\n return box;\n } else {\n scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);\n viewport.transform(matrix);\n\n this._fireViewboxChange();\n }\n\n return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {Object} [delta] the new scroll to apply.\n *\n * @param {Number} [delta.dx]\n * @param {Number} [delta.dy]\n */\nCanvas.prototype.scroll = function(delta) {\n\n var node = this._viewport.node;\n var matrix = node.getCTM();\n\n if (delta) {\n delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n setCTM(node, matrix);\n\n this._fireViewboxChange();\n }\n\n return { x: matrix.e, y: matrix.f };\n};\n\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.\n *\n * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,\n * or `fit-viewport` to adjust the size to fit the current viewport\n * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null\n *\n * @return {Number} the current scale\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n if (newScale === 'fit-viewport') {\n return this._fitViewport(center);\n }\n\n var vbox = this.viewbox();\n\n if (newScale === undefined) {\n return vbox.scale;\n }\n\n var outer = vbox.outer;\n\n if (center === 'auto') {\n center = {\n x: outer.width / 2,\n y: outer.height / 2\n };\n }\n\n var matrix = this._setZoom(newScale, center);\n\n this._fireViewboxChange();\n\n return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n var vbox = this.viewbox(),\n outer = vbox.outer,\n inner = vbox.inner,\n newScale,\n newViewbox;\n\n // display the complete diagram without zooming in.\n // instead of relying on internal zoom, we perform a\n // hard reset on the canvas viewbox to realize this\n //\n // if diagram does not need to be zoomed in, we focus it around\n // the diagram origin instead\n\n if (inner.x >= 0 &&\n inner.y >= 0 &&\n inner.x + inner.width <= outer.width &&\n inner.y + inner.height <= outer.height &&\n !center) {\n\n newViewbox = {\n x: 0,\n y: 0,\n width: Math.max(inner.width + inner.x, outer.width),\n height: Math.max(inner.height + inner.y, outer.height)\n };\n } else {\n\n newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n newViewbox = {\n x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n width: outer.width / newScale,\n height: outer.height / newScale\n };\n }\n\n this.viewbox(newViewbox);\n\n return this.viewbox().scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n var svg = this._svg.node,\n viewport = this._viewport.node;\n\n var matrix = svg.createSVGMatrix();\n var point = svg.createSVGPoint();\n\n var centerPoint,\n originalPoint,\n currentMatrix,\n scaleMatrix,\n newMatrix;\n\n currentMatrix = viewport.getCTM();\n\n\n var currentScale = currentMatrix.a;\n\n if (center) {\n centerPoint = assign(point, center);\n\n // revert applied viewport transformations\n originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n // create scale matrix\n scaleMatrix = matrix\n .translate(originalPoint.x, originalPoint.y)\n .scale(1 / currentScale * scale)\n .translate(-originalPoint.x, -originalPoint.y);\n\n newMatrix = currentMatrix.multiply(scaleMatrix);\n } else {\n newMatrix = matrix.scale(scale);\n }\n\n setCTM(this._viewport.node, newMatrix);\n\n return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas\n *\n * @return {Dimensions}\n */\nCanvas.prototype.getSize = function () {\n return {\n width: this._container.clientWidth,\n height: this._container.clientHeight\n };\n};\n\n\n/**\n * Return the absolute bounding box for the given element\n *\n * The absolute bounding box may be used to display overlays in the\n * callers (browser) coordinate system rather than the zoomed in/out\n * canvas coordinates.\n *\n * @param {ElementDescriptor} element\n * @return {Bounds} the absolute bounding box\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n var vbox = this.viewbox();\n var bbox;\n\n // connection\n // use svg bbox\n if (element.waypoints) {\n var gfx = this.getGraphics(element);\n\n var transformBBox = gfx.getBBox(true);\n bbox = gfx.getBBox();\n\n bbox.x -= transformBBox.x;\n bbox.y -= transformBBox.y;\n\n bbox.width += 2 * transformBBox.x;\n bbox.height += 2 * transformBBox.y;\n }\n // shapes\n // use data\n else {\n bbox = element;\n }\n\n var x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n var y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n var width = bbox.width * vbox.scale;\n var height = bbox.height * vbox.scale;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n};\n","'use strict';\n\nvar Model = require(168);\n\n\n/**\n * A factory for diagram-js shapes\n */\nfunction ElementFactory() {\n this._uid = 12;\n}\n\nmodule.exports = ElementFactory;\n\n\nElementFactory.prototype.createRoot = function(attrs) {\n return this.create('root', attrs);\n};\n\nElementFactory.prototype.createLabel = function(attrs) {\n return this.create('label', attrs);\n};\n\nElementFactory.prototype.createShape = function(attrs) {\n return this.create('shape', attrs);\n};\n\nElementFactory.prototype.createConnection = function(attrs) {\n return this.create('connection', attrs);\n};\n\n/**\n * Create a model element with the given type and\n * a number of pre-set attributes.\n *\n * @param {String} type\n * @param {Object} attrs\n * @return {djs.model.Base} the newly created model instance\n */\nElementFactory.prototype.create = function(type, attrs) {\n\n attrs = attrs || {};\n\n if (!attrs.id) {\n attrs.id = type + '_' + (this._uid++);\n }\n\n return Model.create(type, attrs);\n};","'use strict';\n\nvar ELEMENT_ID = 'data-element-id';\n\n\n/**\n * @class\n *\n * A registry that keeps track of all shapes in the diagram.\n */\nfunction ElementRegistry() {\n this._elements = {};\n}\n\nmodule.exports = ElementRegistry;\n\n/**\n * Register a pair of (element, gfx, (secondaryGfx)).\n *\n * @param {djs.model.Base} element\n * @param {Snap<SVGElement>} gfx\n * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n var id = element.id;\n\n this._validateId(id);\n\n // associate dom node with element\n gfx.attr(ELEMENT_ID, id);\n\n if (secondaryGfx) {\n secondaryGfx.attr(ELEMENT_ID, id);\n }\n\n this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Removes an element from the registry.\n *\n * @param {djs.model.Base} element\n */\nElementRegistry.prototype.remove = function(element) {\n var elements = this._elements,\n id = element.id || element,\n container = id && elements[id];\n\n if (container) {\n\n // unset element id on gfx\n container.gfx.attr(ELEMENT_ID, null);\n\n if (container.secondaryGfx) {\n container.secondaryGfx.attr(ELEMENT_ID, null);\n }\n\n delete elements[id];\n }\n};\n\n/**\n * Update the id of an element\n *\n * @param {djs.model.Base} element\n * @param {String} newId\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n this._validateId(newId);\n\n if (typeof element === 'string') {\n element = this.get(element);\n }\n\n var gfx = this.getGraphics(element),\n secondaryGfx = this.getGraphics(element, true);\n\n this.remove(element);\n\n element.id = newId;\n\n this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Return the model element for a given id or graphics.\n *\n * @example\n *\n * elementRegistry.get('SomeElementId_1');\n * elementRegistry.get(gfx);\n *\n *\n * @param {String|SVGElement} filter for selecting the element\n *\n * @return {djs.model.Base}\n */\nElementRegistry.prototype.get = function(filter) {\n var id;\n\n if (typeof filter === 'string') {\n id = filter;\n } else {\n id = filter && filter.attr(ELEMENT_ID);\n }\n\n var container = this._elements[id];\n return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {Function} fn\n *\n * @return {Array<djs.model.Base>}\n */\nElementRegistry.prototype.filter = function(fn) {\n\n var filtered = [];\n\n this.forEach(function(element, gfx) {\n if(fn(element, gfx)) {\n filtered.push(element);\n }\n });\n\n return filtered;\n};\n\n/**\n * Iterate over all diagram elements.\n *\n * @param {Function} fn\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n var map = this._elements;\n\n Object.keys(map).forEach(function(id) {\n var container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n return fn(element, gfx);\n });\n};\n\n/**\n * Return the graphical representation of an element or its id.\n *\n * @example\n * elementRegistry.getGraphics('SomeElementId_1');\n * elementRegistry.getGraphics(rootElement); // <g ...>\n *\n * elementRegistry.getGraphics(rootElement, true); // <svg ...>\n *\n *\n * @param {String|djs.model.Base} filter\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate the suitability of the given id and signals a problem\n * with an exception.\n *\n * @param {String} id\n *\n * @throws {Error} if id is empty or already assigned\n */\nElementRegistry.prototype._validateId = function(id) {\n if (!id) {\n throw new Error('element must have an id');\n }\n\n if (this._elements[id]) {\n throw new Error('element with id ' + id + ' already added');\n }\n};","'use strict';\n\nvar isFunction = require(317),\n isArray = require(316),\n isNumber = require(319),\n assign = require(325);\n\nvar DEFAULT_PRIORITY = 1000;\n\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nfunction EventBus() {\n this._listeners = {};\n\n // cleanup on destroy\n\n var self = this;\n\n // destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, function() {\n self._listeners = null;\n });\n}\n\nmodule.exports = EventBus;\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {String|Array<String>} events\n * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n */\nEventBus.prototype.on = function(events, priority, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var self = this,\n listener = { priority: priority, callback: callback };\n\n events.forEach(function(e) {\n self._addListener(e, listener);\n });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {String} event the event name to register for\n * @param {Function} callback the callback to execute\n */\nEventBus.prototype.once = function(event, callback) {\n\n var self = this;\n\n function wrappedCallback() {\n callback.apply(self, arguments);\n self.off(event, wrappedCallback);\n }\n\n this.on(event, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {String} event\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(event, callback) {\n var listeners = this._getListeners(event),\n listener, idx;\n\n if (callback) {\n\n // move through listeners from back to front\n // and remove matching listeners\n for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {\n if (listener.callback === callback) {\n listeners.splice(idx, 1);\n }\n }\n } else {\n // clear listeners\n listeners.length = 0;\n }\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {String} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {Boolean} the events return value, if specified or false if the\n * default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n\n var event,\n originalType,\n listeners, idx, listener,\n returnValue,\n args;\n\n args = Array.prototype.slice.call(arguments);\n\n if (typeof type === 'object') {\n event = type;\n type = event.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n listeners = this._listeners[type];\n\n if (!listeners) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof Event) {\n // we are fine, we alread have an event\n event = data;\n } else {\n event = new Event();\n event.init(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n originalType = event.type;\n\n try {\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n for (idx = 0; !!(listener = listeners[idx]); idx++) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n try {\n // returning false prevents the default action\n returnValue = event.returnValue = listener.callback.apply(null, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (e) {\n if (!this.handleError(e)) {\n console.error('unhandled error in event listener');\n console.error(e.stack);\n\n throw e;\n }\n }\n }\n } finally {\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {String} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listeners = this._getListeners(event),\n existingListener,\n idx;\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n for (idx = 0; !!(existingListener = listeners[idx]); idx++) {\n if (existingListener.priority < newListener.priority) {\n\n // prepend newListener at before existingListener\n listeners.splice(idx, 0, newListener);\n return;\n }\n }\n\n listeners.push(newListener);\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n var listeners = this._listeners[name];\n\n if (!listeners) {\n this._listeners[name] = listeners = [];\n }\n\n return listeners;\n};\n\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction Event() { }\n\nmodule.exports.Event = Event;\n\nEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n","'use strict';\n\nvar forEach = require(204),\n reduce = require(208);\n\nvar GraphicsUtil = require(180),\n domClear = require(340);\n\n/**\n * A factory that creates graphical elements\n *\n * @param {Renderer} renderer\n */\nfunction GraphicsFactory(renderer, elementRegistry) {\n this._renderer = renderer;\n this._elementRegistry = elementRegistry;\n}\n\nGraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];\n\nmodule.exports = GraphicsFactory;\n\n\nGraphicsFactory.prototype._getChildren = function(element) {\n\n var gfx = this._elementRegistry.getGraphics(element);\n\n var childrenGfx;\n\n // root element\n if (!element.parent) {\n childrenGfx = gfx;\n } else {\n childrenGfx = GraphicsUtil.getChildren(gfx);\n if (!childrenGfx) {\n childrenGfx = gfx.parent().group().attr('class', 'djs-children');\n }\n }\n\n return childrenGfx;\n};\n\n/**\n * Clears the graphical representation of the element and returns the\n * cleared visual (the <g class=\"djs-visual\" /> element).\n */\nGraphicsFactory.prototype._clear = function(gfx) {\n var visual = GraphicsUtil.getVisual(gfx);\n\n domClear(visual.node);\n\n return visual;\n};\n\n/**\n * Creates a gfx container for shapes and connections\n *\n * The layout is as follows:\n *\n * <g class=\"djs-group\">\n *\n * <!-- the gfx -->\n * <g class=\"djs-element djs-(shape|connection)\">\n * <g class=\"djs-visual\">\n * <!-- the renderer draws in here -->\n * </g>\n *\n * <!-- extensions (overlays, click box, ...) goes here\n * </g>\n *\n * <!-- the gfx child nodes -->\n * <g class=\"djs-children\"></g>\n * </g>\n *\n * @param {Object} parent\n * @param {String} type the type of the element, i.e. shape | connection\n */\nGraphicsFactory.prototype._createContainer = function(type, parentGfx) {\n var outerGfx = parentGfx.group().attr('class', 'djs-group'),\n gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);\n\n // create visual\n gfx.group().attr('class', 'djs-visual');\n\n return gfx;\n};\n\nGraphicsFactory.prototype.create = function(type, element) {\n var childrenGfx = this._getChildren(element.parent);\n return this._createContainer(type, childrenGfx);\n};\n\n\nGraphicsFactory.prototype.updateContainments = function(elements) {\n\n var self = this,\n elementRegistry = this._elementRegistry,\n parents;\n\n\n parents = reduce(elements, function(map, e) {\n\n if (e.parent) {\n map[e.parent.id] = e.parent;\n }\n\n return map;\n }, {});\n\n // update all parents of changed and reorganized their children\n // in the correct order (as indicated in our model)\n forEach(parents, function(parent) {\n\n var childGfx = self._getChildren(parent),\n children = parent.children;\n\n if (!children) {\n return;\n }\n\n forEach(children.slice().reverse(), function(c) {\n var gfx = elementRegistry.getGraphics(c);\n gfx.parent().prependTo(childGfx);\n });\n });\n\n};\n\nGraphicsFactory.prototype.update = function(type, element, gfx) {\n\n // Do not update root element\n if (!element.parent) {\n return;\n }\n\n var visual = this._clear(gfx);\n\n // redraw\n if (type === 'shape') {\n this._renderer.drawShape(visual, element);\n\n // update positioning\n gfx.translate(element.x, element.y);\n } else\n if (type === 'connection') {\n this._renderer.drawConnection(visual, element);\n } else {\n throw new Error('unknown type: ' + type);\n }\n\n gfx.attr('display', element.hidden ? 'none' : 'block');\n};\n\n\nGraphicsFactory.prototype.remove = function(element) {\n var gfx = this._elementRegistry.getGraphics(element);\n\n // remove\n gfx.parent().remove();\n};\n","module.exports = {\n __depends__: [ require(86) ],\n __init__: [ 'canvas' ],\n canvas: [ 'type', require(78) ],\n elementRegistry: [ 'type', require(80) ],\n elementFactory: [ 'type', require(79) ],\n eventBus: [ 'type', require(81) ],\n graphicsFactory: [ 'type', require(82) ]\n};","'use strict';\n\nvar Snap = require(188);\n\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {Styles} styles\n */\nfunction Renderer(styles) {\n this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n}\n\nmodule.exports = Renderer;\n\nRenderer.$inject = ['styles'];\n\n\nRenderer.prototype.drawShape = function drawShape(gfxGroup, data) {\n return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);\n};\n\nRenderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {\n return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);\n};\n\nfunction componentsToPath(components) {\n return components.join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * Gets the default SVG path of a shape that represents it's visual bounds.\n *\n * @param {djs.model.Shape} shape\n * @return {string} svg path\n */\nRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var shapePath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(shapePath);\n};\n\n/**\n * Gets the default SVG path of a connection that represents it's visual bounds.\n *\n * @param {djs.model.Connection} connection\n * @return {string} svg path\n */\nRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n var waypoints = connection.waypoints;\n\n var idx, point, connectionPath = [];\n\n for (idx = 0; !!(point = waypoints[idx]); idx++) {\n\n // take invisible docking into account\n // when creating the path\n point = point.original || point;\n\n connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n }\n\n return componentsToPath(connectionPath);\n};\n\n\nfunction toSVGPoints(points) {\n var result = '';\n\n for (var i = 0, p; !!(p = points[i]); i++) {\n result += p.x + ',' + p.y + ' ';\n }\n\n return result;\n}\n\nfunction createLine(points, attrs) {\n return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});\n}\n\nfunction updateLine(gfx, points) {\n return gfx.attr({ points: toSVGPoints(points) });\n}\n\nmodule.exports.createLine = createLine;\nmodule.exports.updateLine = updateLine;","'use strict';\n\nvar isArray = require(316),\n assign = require(325),\n reduce = require(208);\n\n\n/**\n * A component that manages shape styles\n */\nfunction Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n}\n\nmodule.exports = Styles;","module.exports = {\n renderer: [ 'type', require(84) ],\n styles: [ 'type', require(85) ]\n};","'use strict';\n\nvar Geometry = require(179),\n Util = require(90);\n\nvar MARKER_OK = 'connect-ok',\n MARKER_NOT_OK = 'connect-not-ok',\n MARKER_CONNECT_HOVER = 'connect-hover',\n MARKER_CONNECT_UPDATING = 'djs-updating';\n\nvar COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',\n COMMAND_RECONNECT_START = 'connection.reconnectStart',\n COMMAND_RECONNECT_END = 'connection.reconnectEnd';\n\nvar round = Math.round;\n\n\n/**\n * A component that implements moving of bendpoints\n */\nfunction BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {\n\n var connectionDocking;\n\n // optional connection docking integration\n try {\n connectionDocking = injector.get('connectionDocking');\n } catch (e) {}\n\n\n // API\n\n this.start = function(event, connection, bendpointIndex, insert) {\n\n var type,\n context,\n waypoints = connection.waypoints,\n gfx = canvas.getGraphics(connection);\n\n if (!insert && bendpointIndex === 0) {\n type = COMMAND_RECONNECT_START;\n } else\n if (!insert && bendpointIndex === waypoints.length - 1) {\n type = COMMAND_RECONNECT_END;\n } else {\n type = COMMAND_BENDPOINT_UPDATE;\n }\n\n context = {\n connection: connection,\n bendpointIndex: bendpointIndex,\n insert: insert,\n type: type\n };\n\n dragging.activate(event, 'bendpoint.move', {\n data: {\n connection: connection,\n connectionGfx: gfx,\n context: context\n }\n });\n };\n\n\n // DRAGGING IMPLEMENTATION\n\n\n function redrawConnection(data) {\n graphicsFactory.update('connection', data.connection, data.connectionGfx);\n }\n\n function filterRedundantWaypoints(waypoints) {\n return waypoints.filter(function(r, idx) {\n return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);\n });\n }\n\n eventBus.on('bendpoint.move.start', function(e) {\n\n var context = e.context,\n connection = context.connection,\n originalWaypoints = connection.waypoints,\n waypoints = originalWaypoints.slice(),\n insert = context.insert,\n idx = context.bendpointIndex;\n\n context.originalWaypoints = originalWaypoints;\n\n if (insert) {\n // insert placeholder for bendpoint to-be-added\n waypoints.splice(idx, 0, null);\n }\n\n connection.waypoints = waypoints;\n\n // add dragger gfx\n context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));\n context.draggerGfx.addClass('djs-dragging');\n\n canvas.addMarker(connection, MARKER_CONNECT_UPDATING);\n });\n\n eventBus.on('bendpoint.move.hover', function(e) {\n e.context.hover = e.hover;\n\n canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);\n });\n\n eventBus.on([\n 'bendpoint.move.out',\n 'bendpoint.move.cleanup'\n ], function(e) {\n\n // remove connect marker\n // if it was added\n var hover = e.context.hover;\n\n if (hover) {\n canvas.removeMarker(hover, MARKER_CONNECT_HOVER);\n canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);\n }\n });\n\n eventBus.on('bendpoint.move.move', function(e) {\n\n var context = e.context,\n moveType = context.type,\n connection = e.connection,\n source, target;\n\n connection.waypoints[context.bendpointIndex] = { x: e.x, y: e.y };\n\n if (connectionDocking) {\n\n if (context.hover) {\n if (moveType === COMMAND_RECONNECT_START) {\n source = context.hover;\n }\n\n if (moveType === COMMAND_RECONNECT_END) {\n target = context.hover;\n }\n }\n\n connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);\n }\n\n // asks whether reconnect / bendpoint move / bendpoint add\n // is allowed at the given position\n var allowed = context.allowed = rules.allowed(context.type, context);\n\n if (allowed) {\n\n if (context.hover) {\n canvas.removeMarker(context.hover, MARKER_NOT_OK);\n canvas.addMarker(context.hover, MARKER_OK);\n\n context.target = context.hover;\n }\n } else\n if (allowed === false) {\n if (context.hover) {\n canvas.removeMarker(context.hover, MARKER_OK);\n canvas.addMarker(context.hover, MARKER_NOT_OK);\n\n context.target = null;\n }\n }\n\n // add dragger gfx\n context.draggerGfx.translate(e.x, e.y);\n\n redrawConnection(e);\n });\n\n eventBus.on([\n 'bendpoint.move.end',\n 'bendpoint.move.cancel'\n ], function(e) {\n\n var context = e.context,\n connection = context.connection;\n\n // remove dragger gfx\n context.draggerGfx.remove();\n\n context.newWaypoints = connection.waypoints.slice();\n\n connection.waypoints = context.originalWaypoints;\n\n canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);\n });\n\n eventBus.on('bendpoint.move.end', function(e) {\n\n var context = e.context,\n waypoints = context.newWaypoints,\n bendpointIndex = context.bendpointIndex,\n bendpoint = waypoints[bendpointIndex],\n allowed = context.allowed;\n\n // ensure we have actual pixel values bendpoint\n // coordinates (important when zoom level was > 1 during move)\n bendpoint.x = round(bendpoint.x);\n bendpoint.y = round(bendpoint.y);\n\n if (allowed === true && context.type === COMMAND_RECONNECT_START) {\n modeling.reconnectStart(context.connection, context.target, bendpoint);\n } else\n if (allowed === true && context.type === COMMAND_RECONNECT_END) {\n modeling.reconnectEnd(context.connection, context.target, bendpoint);\n } else\n if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {\n modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));\n } else {\n redrawConnection(e);\n\n return false;\n }\n });\n\n eventBus.on('bendpoint.move.cancel', function(e) {\n redrawConnection(e);\n });\n}\n\nBendpointMove.$inject = [ 'injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling' ];\n\nmodule.exports = BendpointMove;","'use strict';\n\nvar assign = require(325),\n pick = require(330),\n forEach = require(204);\n\nvar Snap = require(188);\n\nvar round = Math.round;\n\n\nfunction BendpointSnapping(eventBus) {\n\n function snapTo(candidates, point) {\n return Snap.snapTo(candidates, point);\n }\n\n function toPoint(e) {\n return pick(e, [ 'x', 'y' ]);\n }\n\n function mid(element) {\n if (element.width) {\n return {\n x: round(element.width / 2 + element.x),\n y: round(element.height / 2 + element.y)\n };\n }\n }\n\n function getSnapPoints(context) {\n\n var snapPoints = context.snapPoints,\n waypoints = context.connection.waypoints,\n bendpointIndex = context.bendpointIndex,\n referenceWaypoints = [ waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1] ];\n\n if (!snapPoints) {\n context.snapPoints = snapPoints = { horizontal: [] , vertical: [] };\n\n forEach(referenceWaypoints, function(p) {\n // we snap on existing bendpoints only,\n // not placeholders that are inserted during add\n if (p) {\n p = p.original || p;\n\n snapPoints.horizontal.push(p.y);\n snapPoints.vertical.push(p.x);\n }\n });\n }\n\n return snapPoints;\n }\n\n eventBus.on('bendpoint.move.start', function(event) {\n event.context.snapStart = toPoint(event);\n });\n\n eventBus.on('bendpoint.move.move', 1500, function(event) {\n\n var context = event.context,\n snapPoints = getSnapPoints(context),\n start = context.snapStart,\n target = context.target,\n targetMid = target && mid(target),\n x = start.x + event.dx,\n y = start.y + event.dy,\n sx, sy;\n\n if (!snapPoints) {\n return;\n }\n\n // snap\n sx = snapTo(targetMid ? snapPoints.vertical.concat([ targetMid.x ]) : snapPoints.vertical, x);\n sy = snapTo(targetMid ? snapPoints.horizontal.concat([ targetMid.y ]) : snapPoints.horizontal, y);\n\n\n // correction x/y\n var cx = (x - sx),\n cy = (y - sy);\n\n // update delta\n assign(event, {\n dx: event.dx - cx,\n dy: event.dy - cy,\n x: event.x - cx,\n y: event.y - cy\n });\n });\n}\n\n\nBendpointSnapping.$inject = [ 'eventBus' ];\n\nmodule.exports = BendpointSnapping;","'use strict';\n\nvar domEvent = require(344),\n Util = require(90);\n\nvar BENDPOINT_CLS = Util.BENDPOINT_CLS;\n\n\n/**\n * A service that adds editable bendpoints to connections.\n */\nfunction Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {\n\n function getConnectionIntersection(waypoints, event) {\n var localPosition = Util.toCanvasCoordinates(canvas, event);\n return Util.getApproxIntersection(waypoints, localPosition);\n }\n\n function activateBendpointMove(event, connection) {\n var waypoints = connection.waypoints,\n intersection = getConnectionIntersection(waypoints, event);\n\n if (!intersection) {\n return;\n }\n\n bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);\n }\n\n function getBendpointsContainer(element, create) {\n\n var layer = canvas.getLayer('overlays'),\n gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');\n\n if (!gfx && create) {\n gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);\n\n domEvent.bind(gfx.node, 'mousedown', function(event) {\n activateBendpointMove(event, element);\n });\n }\n\n return gfx;\n }\n\n function createBendpoints(gfx, connection) {\n connection.waypoints.forEach(function(p, idx) {\n Util.addBendpoint(gfx).translate(p.x, p.y);\n });\n\n // add floating bendpoint\n Util.addBendpoint(gfx).addClass('floating');\n }\n\n function clearBendpoints(gfx) {\n gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {\n s.remove();\n });\n }\n\n function addBendpoints(connection) {\n var gfx = getBendpointsContainer(connection);\n\n if (!gfx) {\n gfx = getBendpointsContainer(connection, true);\n createBendpoints(gfx, connection);\n }\n\n return gfx;\n }\n\n function updateBendpoints(connection) {\n\n var gfx = getBendpointsContainer(connection);\n\n if (gfx) {\n clearBendpoints(gfx);\n createBendpoints(gfx, connection);\n }\n }\n\n eventBus.on('connection.changed', function(event) {\n updateBendpoints(event.element);\n });\n\n eventBus.on('connection.remove', function(event) {\n var gfx = getBendpointsContainer(event.element);\n if (gfx) {\n gfx.remove();\n }\n });\n\n eventBus.on('element.marker.update', function(event) {\n\n var element = event.element,\n bendpointsGfx;\n\n if (!element.waypoints) {\n return;\n }\n\n bendpointsGfx = addBendpoints(element);\n bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);\n });\n\n eventBus.on('element.mousemove', function(event) {\n\n var element = event.element,\n waypoints = element.waypoints,\n bendpointsGfx,\n floating,\n intersection;\n\n if (waypoints) {\n\n bendpointsGfx = getBendpointsContainer(element, true);\n floating = bendpointsGfx.select('.floating');\n\n if (!floating) {\n return;\n }\n\n intersection = getConnectionIntersection(waypoints, event.originalEvent);\n\n if (intersection) {\n floating.translate(intersection.point.x, intersection.point.y);\n }\n }\n });\n\n eventBus.on('element.mousedown', function(event) {\n\n var originalEvent = event.originalEvent,\n element = event.element,\n waypoints = element.waypoints;\n\n if (!waypoints) {\n return;\n }\n\n activateBendpointMove(originalEvent, element, waypoints);\n });\n\n eventBus.on('selection.changed', function(event) {\n var newSelection = event.newSelection,\n primary = newSelection[0];\n\n if (primary && primary.waypoints) {\n addBendpoints(primary);\n }\n });\n\n eventBus.on('element.hover', function(event) {\n var element = event.element;\n\n if (element.waypoints) {\n addBendpoints(element);\n\n interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n }\n });\n\n eventBus.on('element.out', function(event) {\n interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n });\n}\n\nBendpoints.$inject = [ 'injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove' ];\n\nmodule.exports = Bendpoints;","'use strict';\n\nvar Snap = require(188);\n\nvar Events = require(178),\n Geometry = require(179);\n\nvar BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';\n\nmodule.exports.toCanvasCoordinates = function(canvas, event) {\n\n var position = Events.toPoint(event),\n clientRect = canvas._container.getBoundingClientRect(),\n offset;\n\n // canvas relative position\n\n offset = {\n x: clientRect.left,\n y: clientRect.top\n };\n\n // update actual event payload with canvas relative measures\n\n var viewbox = canvas.viewbox();\n\n return {\n x: viewbox.x + (position.x - offset.x) / viewbox.scale,\n y: viewbox.y + (position.y - offset.y) / viewbox.scale\n };\n};\n\nmodule.exports.addBendpoint = function(parentGfx) {\n var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);\n\n groupGfx.circle(0, 0, 4).addClass('djs-visual');\n groupGfx.circle(0, 0, 10).addClass('djs-hit');\n\n return groupGfx;\n};\n\n\nfunction circlePath(center, r) {\n var x = center.x,\n y = center.y;\n\n return [\n ['M', x, y],\n ['m', 0, -r],\n ['a', r, r, 0, 1, 1, 0, 2 * r],\n ['a', r, r, 0, 1, 1, 0, -2 * r],\n ['z']\n ];\n}\n\nfunction linePath(points) {\n var segments = [];\n\n points.forEach(function(p, idx) {\n segments.push([ idx === 0 ? 'M' : 'L', p.x, p.y ]);\n });\n\n return segments;\n}\n\n\nvar INTERSECTION_THRESHOLD = 10;\n\nfunction getBendpointIntersection(waypoints, reference) {\n\n var i, w;\n\n for (i = 0; !!(w = waypoints[i]); i++) {\n\n if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {\n return {\n point: waypoints[i],\n bendpoint: true,\n index: i\n };\n }\n }\n\n return null;\n}\n\nfunction getPathIntersection(waypoints, reference) {\n\n var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));\n\n var a = intersections[0],\n b = intersections[intersections.length - 1],\n idx;\n\n if (!a) {\n // no intersection\n return null;\n }\n\n if (a !== b) {\n\n if (a.segment2 !== b.segment2) {\n // we use the bendpoint in between both segments\n // as the intersection point\n\n idx = Math.max(a.segment2, b.segment2) - 1;\n\n return {\n point: waypoints[idx],\n bendpoint: true,\n index: idx\n };\n }\n\n return {\n point: {\n x: (Math.round(a.x + b.x) / 2),\n y: (Math.round(a.y + b.y) / 2)\n },\n index: a.segment2\n };\n }\n\n return {\n point: {\n x: Math.round(a.x),\n y: Math.round(a.y)\n },\n index: a.segment2\n };\n}\n\n/**\n * Returns the closest point on the connection towards a given reference point.\n *\n * @param {Array<Point>} waypoints\n * @param {Point} reference\n *\n * @return {Object} intersection data (segment, point)\n */\nmodule.exports.getApproxIntersection = function(waypoints, reference) {\n return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);\n};","module.exports = {\n __depends__: [ require(101), require(147) ],\n __init__: [ 'bendpoints', 'bendpointSnapping' ],\n bendpoints: [ 'type', require(89) ],\n bendpointMove: [ 'type', require(87) ],\n bendpointSnapping: [ 'type', require(88) ]\n};","'use strict';\n\n/**\n * Adds change support to the diagram, including\n *\n * <ul>\n * <li>redrawing shapes and connections on change</li>\n * </ul>\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {GraphicsFactory} graphicsFactory\n */\nfunction ChangeSupport(eventBus, elementRegistry, graphicsFactory) {\n\n // redraw shapes / connections on change\n\n eventBus.on('element.changed', function(event) {\n\n var element = event.element;\n\n if (!event.gfx) {\n event.gfx = elementRegistry.getGraphics(element);\n }\n\n // shape + gfx may have been deleted\n if (!event.gfx) {\n return;\n }\n\n if (element.waypoints) {\n eventBus.fire('connection.changed', event);\n } else {\n eventBus.fire('shape.changed', event);\n }\n });\n\n eventBus.on('elements.changed', function(event) {\n\n var elements = event.elements;\n\n elements.forEach(function(e) {\n eventBus.fire('element.changed', { element: e });\n });\n\n graphicsFactory.updateContainments(elements);\n });\n\n eventBus.on('shape.changed', function(event) {\n graphicsFactory.update('shape', event.element, event.gfx);\n });\n\n eventBus.on('connection.changed', function(event) {\n graphicsFactory.update('connection', event.element, event.gfx);\n });\n}\n\nChangeSupport.$inject = [ 'eventBus', 'elementRegistry', 'graphicsFactory' ];\n\nmodule.exports = ChangeSupport;\n","module.exports = {\n __init__: [ 'changeSupport'],\n changeSupport: [ 'type', require(92) ]\n};","'use strict';\n\nvar LayoutUtil = require(166);\n\nvar MARKER_OK = 'connect-ok',\n MARKER_NOT_OK = 'connect-not-ok';\n\n\nfunction Connect(eventBus, dragging, modeling, rules, canvas, renderer) {\n\n // TODO(nre): separate UI and events\n\n // rules\n\n function canConnect(source, target) {\n return rules.allowed('connection.create', {\n source: source,\n target: target\n });\n }\n\n\n // layouting\n\n function crop(start, end, source, target) {\n\n var sourcePath = renderer.getShapePath(source),\n targetPath = target && renderer.getShapePath(target),\n connectionPath = renderer.getConnectionPath({ waypoints: [ start, end ] });\n\n start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;\n end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;\n\n return [ start, end ];\n }\n\n\n // event handlers\n\n eventBus.on('connect.move', function(event) {\n\n var context = event.context,\n source = context.source,\n target = context.target,\n visual = context.visual,\n start, end, waypoints;\n\n // update connection visuals during drag\n\n start = LayoutUtil.getMidPoint(source);\n\n end = {\n x: event.x,\n y: event.y\n };\n\n waypoints = crop(start, end, source, target);\n\n visual.attr('points', [ waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y ]);\n });\n\n eventBus.on('connect.hover', function(event) {\n var context = event.context,\n source = context.source,\n hover = event.hover,\n canExecute;\n\n canExecute = context.canExecute = canConnect(source, hover);\n\n // simply ignore hover\n if (canExecute === null) {\n return;\n }\n\n context.target = hover;\n\n canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);\n });\n\n eventBus.on([ 'connect.out', 'connect.cleanup' ], function(event) {\n var context = event.context;\n\n if (context.target) {\n canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n }\n\n context.target = null;\n });\n\n eventBus.on('connect.cleanup', function(event) {\n var context = event.context;\n\n if (context.visual) {\n context.visual.remove();\n }\n });\n\n eventBus.on('connect.start', function(event) {\n var context = event.context,\n visual;\n\n visual = canvas.getDefaultLayer().polyline().attr({\n 'stroke': '#333',\n 'strokeDasharray': [ 1 ],\n 'strokeWidth': 2,\n 'pointer-events': 'none'\n });\n\n context.visual = visual;\n });\n\n eventBus.on('connect.end', function(event) {\n\n var context = event.context,\n source = context.source,\n target = context.target,\n canExecute = context.canExecute || canConnect(source, target);\n\n if (!canExecute) {\n return false;\n }\n\n modeling.connect(source, target);\n });\n\n\n // API\n\n this.start = function(event, source, autoActivate) {\n\n dragging.activate(event, 'connect', {\n autoActivate: autoActivate,\n data: {\n shape: source,\n context: {\n source: source\n }\n }\n });\n };\n}\n\nConnect.$inject = [ 'eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer' ];\n\nmodule.exports = Connect;","module.exports = {\n __depends__: [\n require(151),\n require(147),\n require(101)\n ],\n connect: [ 'type', require(94) ]\n};\n","'use strict';\n\nvar isFunction = require(317),\n forEach = require(204),\n\n domDelegate = require(342),\n domClear = require(340),\n domEvent = require(344),\n domAttr = require(338),\n domQuery = require(346),\n domClasses = require(339),\n domify = require(343);\n\n\nvar entrySelector = '.entry';\n\n\n/**\n * A context pad that displays element specific, contextual actions next\n * to a diagram element.\n *\n * @param {EventBus} eventBus\n * @param {Overlays} overlays\n */\nfunction ContextPad(eventBus, overlays) {\n\n this._providers = [];\n\n this._eventBus = eventBus;\n this._overlays = overlays;\n\n this._current = null;\n\n this._init();\n}\n\nContextPad.$inject = [ 'eventBus', 'overlays' ];\n\n/**\n * Registers events needed for interaction with other components\n */\nContextPad.prototype._init = function() {\n\n var eventBus = this._eventBus;\n\n var self = this;\n\n eventBus.on('selection.changed', function(e) {\n\n var selection = e.newSelection;\n\n if (selection.length === 1) {\n self.open(selection[0]);\n } else {\n self.close();\n }\n });\n};\n\n\n/**\n * Register a provider with the context pad\n *\n * @param {ContextPadProvider} provider\n */\nContextPad.prototype.registerProvider = function(provider) {\n this._providers.push(provider);\n};\n\n\n/**\n * Returns the context pad entries for a given element\n *\n * @param {djs.element.Base} element\n *\n * @return {Array<ContextPadEntryDescriptor>} list of entries\n */\nContextPad.prototype.getEntries = function(element) {\n var entries = {};\n\n // loop through all providers and their entries.\n // group entries by id so that overriding an entry is possible\n forEach(this._providers, function(provider) {\n var e = provider.getContextPadEntries(element);\n\n forEach(e, function(entry, id) {\n entries[id] = entry;\n });\n });\n\n return entries;\n};\n\n\n/**\n * Trigger an action available on the opened context pad\n *\n * @param {String} action\n * @param {Event} event\n */\nContextPad.prototype.trigger = function(action, event, autoActivate) {\n\n var current = this._current,\n element = current.element,\n entries = current.entries,\n entry,\n handler,\n originalEvent,\n button = event.delegateTarget || event.target;\n\n if (!button) {\n return event.preventDefault();\n }\n\n entry = entries[domAttr(button, 'data-action')];\n handler = entry.action;\n\n originalEvent = event.originalEvent || event;\n\n // simple action (via callback function)\n if (isFunction(handler)) {\n if (action === 'click') {\n return handler(originalEvent, element, autoActivate);\n }\n } else {\n if (handler[action]) {\n return handler[action](originalEvent, element, autoActivate);\n }\n }\n\n // silence other actions\n event.preventDefault();\n};\n\n\n/**\n * Open the context pad for the given element\n *\n * @param {djs.model.Base} element\n */\nContextPad.prototype.open = function(element) {\n\n if (this._current && this._current.open) {\n\n if (this._current.element === element) {\n // no change needed\n return;\n }\n\n this.close();\n }\n\n this._updateAndOpen(element);\n};\n\n\nContextPad.prototype._updateAndOpen = function(element) {\n\n var entries = this.getEntries(element),\n pad = this.getPad(element),\n html = pad.html;\n\n domClear(html);\n\n forEach(entries, function(entry, id) {\n var grouping = entry.group || 'default',\n control = domify(entry.html || '<div class=\"entry\" draggable=\"true\"></div>'),\n container;\n\n domAttr(control, 'data-action', id);\n\n container = domQuery('[data-group=' + grouping + ']', html);\n if (!container) {\n container = domify('<div class=\"group\" data-group=\"' + grouping + '\"></div>');\n html.appendChild(container);\n }\n\n container.appendChild(control);\n\n if (entry.className) {\n domClasses(control).add(entry.className);\n }\n\n if (entry.title) {\n domAttr(control, 'title', entry.title);\n }\n\n if (entry.imageUrl) {\n control.appendChild(domify('<img src=\"' + entry.imageUrl + '\">'));\n }\n });\n\n domClasses(html).add('open');\n\n this._current = {\n element: element,\n pad: pad,\n entries: entries,\n open: true\n };\n\n this._eventBus.fire('contextPad.open', { current: this._current });\n};\n\nContextPad.prototype.getPad = function(element) {\n\n var self = this;\n\n var overlays = this._overlays,\n pads = overlays.get({ element: element, type: 'context-pad' });\n\n // create context pad on demand if needed\n if (!pads.length) {\n\n var html = domify('<div class=\"djs-context-pad\"></div>');\n\n domDelegate.bind(html, entrySelector, 'click', function(event) {\n self.trigger('click', event);\n });\n\n domDelegate.bind(html, entrySelector, 'dragstart', function(event) {\n self.trigger('dragstart', event);\n });\n\n // stop propagation of mouse events\n domEvent.bind(html, 'mousedown', function(event) {\n event.stopPropagation();\n });\n\n overlays.add(element, 'context-pad', {\n position: {\n right: -9,\n top: -6\n },\n html: html\n });\n\n pads = overlays.get({ element: element, type: 'context-pad' });\n\n this._eventBus.fire('contextPad.create', { element: element, pad: pads[0] });\n }\n\n return pads[0];\n};\n\n\n/**\n * Close the context pad\n */\nContextPad.prototype.close = function() {\n\n var html;\n\n if (this._current) {\n if (this._current.open) {\n html = this._current.pad.html;\n domClasses(html).remove('open');\n }\n\n this._current.open = false;\n\n this._eventBus.fire('contextPad.close', { current: this._current });\n }\n};\n\n\n/**\n * Return the element the context pad is currently opened for,\n * if it is opened.\n *\n * @example\n *\n * contextPad.open(shape1);\n *\n * if (contextPad.isOpen()) {\n * // yes, we are open\n * }\n *\n * @return {djs.model.Base} element\n */\nContextPad.prototype.isOpen = function() {\n return this._current && this._current.open;\n};\n\nmodule.exports = ContextPad;\n","module.exports = {\n __depends__: [\n require(103),\n require(135)\n ],\n contextPad: [ 'type', require(96) ]\n};","'use strict';\n\nvar MARKER_OK = 'drop-ok',\n MARKER_NOT_OK = 'drop-not-ok';\n\n\nfunction Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {\n\n // rules\n\n function canCreate(shape, target, source) {\n\n if (source) {\n return rules.allowed('shape.append', {\n source: source,\n shape: shape,\n parent: target\n });\n } else {\n return rules.allowed('shape.create', {\n shape: shape,\n parent: target\n });\n }\n }\n\n\n // visual helpers\n\n function createVisual(shape) {\n var group, preview, visual;\n\n group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n preview = group.group().addClass('djs-dragger');\n\n preview.translate(shape.width / -2, shape.height / -2);\n\n visual = preview.group().addClass('djs-visual');\n\n // hijack renderer to draw preview\n renderer.drawShape(visual, shape);\n\n return group;\n }\n\n\n // event handlers\n\n eventBus.on('create.move', function(event) {\n\n var context = event.context,\n shape = context.shape,\n visual = context.visual;\n\n // lazy init drag visual once we received the first real\n // drag move event (this allows us to get the proper canvas local coordinates)\n if (!visual) {\n visual = context.visual = createVisual(shape);\n }\n\n visual.translate(event.x, event.y);\n\n var hover = event.hover,\n canExecute;\n\n canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);\n\n // ignore hover visually if canExecute is null\n if (hover && canExecute !== null) {\n context.target = hover;\n canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);\n }\n });\n\n eventBus.on([ 'create.end', 'create.out', 'create.cleanup' ], function(event) {\n var context = event.context;\n\n if (context.target) {\n canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n }\n });\n\n eventBus.on('create.end', function(event) {\n var context = event.context,\n source = context.source,\n shape = context.shape,\n target = context.target,\n canExecute = context.canExecute,\n position = {\n x: event.x,\n y: event.y\n };\n\n if (!canExecute) {\n return false;\n }\n\n if (source) {\n modeling.appendShape(source, shape, position, target);\n } else {\n modeling.createShape(shape, position, target);\n }\n });\n\n\n eventBus.on('create.cleanup', function(event) {\n var context = event.context;\n\n if (context.visual) {\n context.visual.remove();\n }\n });\n\n // API\n\n this.start = function(event, shape, source) {\n\n dragging.activate(event, 'create', {\n cursor: 'grabbing',\n autoActivate: true,\n data: {\n shape: shape,\n context: {\n shape: shape,\n source: source\n }\n }\n });\n };\n}\n\nCreate.$inject = [ 'eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles' ];\n\nmodule.exports = Create;","module.exports = {\n __depends__: [\n require(101),\n require(151)\n ],\n create: [ 'type', require(98) ]\n};","'use strict';\n\n/* global TouchEvent */\n\nvar assign = require(325);\n\nvar domEvent = require(344),\n Event = require(178),\n ClickTrap = require(174),\n Cursor = require(176);\n\nfunction suppressEvent(event) {\n if (event instanceof MouseEvent) {\n Event.stopEvent(event, true);\n } else {\n Event.preventDefault(event);\n }\n}\n\nfunction getLength(point) {\n return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));\n}\n\nfunction substract(p1, p2) {\n return {\n x: p1.x - p2.x,\n y: p1.y - p2.y\n };\n}\n\n/**\n * A helper that fires canvas localized drag events and realizes\n * the general \"drag-and-drop\" look and feel.\n *\n * Calling {@link Dragging#activate} activates dragging on a canvas.\n *\n * It provides the following:\n *\n * * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the {@link EventBus}.\n * Each of the events is prefixed with a prefix that is assigned during activate.\n * * sets and restores the cursor\n * * sets and restores the selection\n * * ensures there can be only one drag operation active at a time\n *\n * Dragging may be canceled manually by calling {@link Dragging#cancel} or by pressing ESC.\n *\n * @example\n *\n * function MyDragComponent(eventBus, dragging) {\n *\n * eventBus.on('mydrag.start', function(event) {\n * console.log('yes, we start dragging');\n * });\n *\n * eventBus.on('mydrag.move', function(event) {\n * console.log('canvas local coordinates', event.x, event.y, event.dx, event.dy);\n *\n * // local drag data is passed with the event\n * event.context.foo; // \"BAR\"\n *\n * // the original mouse event, too\n * event.originalEvent; // MouseEvent(...)\n * });\n *\n * eventBus.on('element.click', function(event) {\n * dragging.activate(event, 'mydrag', {\n * cursor: 'grabbing',\n * data: {\n * context: {\n * foo: \"BAR\"\n * }\n * }\n * });\n * });\n * }\n */\nfunction Dragging(eventBus, canvas, selection) {\n\n var defaultOptions = {\n threshold: 5\n };\n\n // the currently active drag operation\n // dragging is active as soon as this context exists.\n //\n // it is visually _active_ only when a context.active flag is set to true.\n var context;\n\n\n // helpers\n\n function fire(type) {\n\n var ActualEvent = require(81).Event;\n\n var event = assign(new ActualEvent(), context.payload, context.data);\n\n // default integration\n if (eventBus.fire('drag.' + type, event) === false) {\n return false;\n }\n\n return eventBus.fire(context.prefix + '.' + type, event);\n }\n\n // event listeners\n\n function move(event, activate) {\n\n var payload = context.payload,\n start = context.start,\n position = Event.toPoint(event),\n delta = substract(position, start),\n clientRect = canvas._container.getBoundingClientRect(),\n offset;\n\n // canvas relative position\n\n offset = {\n x: clientRect.left,\n y: clientRect.top\n };\n\n // update actual event payload with canvas relative measures\n\n var viewbox = canvas.viewbox();\n\n var movement = {\n x: viewbox.x + (position.x - offset.x) / viewbox.scale,\n y: viewbox.y + (position.y - offset.y) / viewbox.scale,\n dx: delta.x / viewbox.scale,\n dy: delta.y / viewbox.scale\n };\n\n // activate context explicitly or once threshold is reached\n\n if (!context.active && (activate || getLength(delta) > context.threshold)) {\n\n // fire start event with original\n // starting coordinates\n\n assign(payload, {\n x: movement.x - movement.dx,\n y: movement.y - movement.dy,\n dx: 0,\n dy: 0\n }, { originalEvent: event });\n\n if (false === fire('start')) {\n return cancel();\n }\n\n context.active = true;\n\n // unset selection\n if (!context.keepSelection) {\n context.previousSelection = selection.get();\n selection.select(null);\n }\n\n // allow custom cursor\n if (context.cursor) {\n Cursor.set(context.cursor);\n }\n }\n\n suppressEvent(event);\n\n if (context.active) {\n\n // fire move event with actual coordinates\n assign(payload, movement, { originalEvent: event });\n\n fire('move');\n }\n }\n\n function end(event) {\n\n var returnValue = true;\n\n if (context.active) {\n\n if (event) {\n context.payload.originalEvent = event;\n\n // suppress original event (click, ...)\n // because we just ended a drag operation\n suppressEvent(event);\n }\n\n // implementations may stop restoring the\n // original state (selections, ...) by preventing the\n // end events default action\n returnValue = fire('end');\n }\n\n if (returnValue === false) {\n fire('rejected');\n }\n\n cleanup(returnValue !== true);\n }\n\n\n // cancel active drag operation if the user presses\n // the ESC key on the keyboard\n\n function checkCancel(event) {\n\n if (event.which === 27) {\n event.preventDefault();\n\n cancel();\n }\n }\n\n\n // prevent ghost click that might occur after a finished\n // drag and drop session\n\n function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n untrap = ClickTrap.install();\n setTimeout(untrap, 400);\n }\n\n end(event);\n }\n\n function trapTouch(event) {\n move(event);\n }\n\n // update the drag events hover (djs.model.Base) and hoverGfx (Snap<SVGElement>)\n // properties during hover and out and fire {prefix}.hover and {prefix}.out properties\n // respectively\n\n function hover(event) {\n var payload = context.payload;\n\n payload.hoverGfx = event.gfx;\n payload.hover = event.element;\n\n fire('hover');\n }\n\n function out(event) {\n fire('out');\n\n var payload = context.payload;\n\n payload.hoverGfx = null;\n payload.hover = null;\n }\n\n\n // life-cycle methods\n\n function cancel(restore) {\n\n if (!context) {\n return;\n }\n\n if (context.active) {\n fire('cancel');\n }\n\n cleanup(restore);\n }\n\n function cleanup(restore) {\n\n fire('cleanup');\n\n // reset cursor\n Cursor.unset();\n\n // reset dom listeners\n domEvent.unbind(document, 'mousemove', move);\n\n domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);\n domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);\n\n domEvent.unbind(document, 'keyup', checkCancel);\n\n domEvent.unbind(document, 'touchstart', trapTouch, true);\n domEvent.unbind(document, 'touchcancel', cancel, true);\n domEvent.unbind(document, 'touchmove', move, true);\n domEvent.unbind(document, 'touchend', end, true);\n\n eventBus.off('element.hover', hover);\n eventBus.off('element.out', out);\n\n // restore selection, unless it has changed\n if (restore !== false && context.previousSelection && !selection.get().length) {\n selection.select(context.previousSelection);\n }\n\n context = null;\n }\n\n /**\n * Activate a drag operation\n *\n * @param {MouseEvent|TouchEvent} [event]\n * @param {String} prefix\n * @param {Object} [options]\n */\n function activate(event, prefix, options) {\n\n // only one drag operation may be active, at a time\n if (context) {\n cancel(false);\n }\n\n options = assign({}, defaultOptions, options || {});\n\n var data = options.data || {},\n originalEvent,\n start;\n\n if (event) {\n originalEvent = Event.getOriginal(event) || event;\n start = Event.toPoint(event);\n\n suppressEvent(event);\n } else {\n originalEvent = null;\n start = { x: 0, y: 0 };\n }\n\n context = assign({\n prefix: prefix,\n data: data,\n payload: {},\n start: start\n }, options);\n\n // skip dom registration if trigger\n // is set to manual (during testing)\n if (!options.manual) {\n\n // add dom listeners\n\n // fixes TouchEvent not being available on desktop Firefox\n if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {\n domEvent.bind(document, 'touchstart', trapTouch, true);\n domEvent.bind(document, 'touchcancel', cancel, true);\n domEvent.bind(document, 'touchmove', move, true);\n domEvent.bind(document, 'touchend', end, true);\n } else {\n // assume we use the mouse to interact per default\n domEvent.bind(document, 'mousemove', move);\n\n domEvent.bind(document, 'mousedown', trapClickAndEnd, true);\n domEvent.bind(document, 'mouseup', trapClickAndEnd, true);\n }\n\n domEvent.bind(document, 'keyup', checkCancel);\n\n eventBus.on('element.hover', hover);\n eventBus.on('element.out', out);\n }\n\n fire('activate');\n\n if (options.autoActivate) {\n move(event, true);\n }\n }\n\n // cancel on diagram destruction\n eventBus.on('diagram.destroy', cancel);\n\n\n // API\n\n this.activate = activate;\n this.move = move;\n this.hover = hover;\n this.out = out;\n this.end = end;\n\n this.cancel = cancel;\n\n // for introspection\n\n this.active = function() {\n return context;\n };\n\n this.setOptions = function(options) {\n assign(defaultOptions, options);\n };\n}\n\nDragging.$inject = [ 'eventBus', 'canvas', 'selection' ];\n\nmodule.exports = Dragging;","module.exports = {\n __depends__: [\n require(151)\n ],\n dragging: [ 'type', require(100) ]\n};","'use strict';\n\nvar forEach = require(204),\n domDelegate = require(342),\n Renderer = require(84),\n createLine = Renderer.createLine,\n updateLine = Renderer.updateLine;\n\n\nvar isPrimaryButton = require(182).isPrimaryButton;\n\nvar Snap = require(188);\n\n/**\n * A plugin that provides interaction events for diagram elements.\n *\n * It emits the following events:\n *\n * * element.hover\n * * element.out\n * * element.click\n * * element.dblclick\n * * element.mousedown\n *\n * Each event is a tuple { element, gfx, originalEvent }.\n *\n * Canceling the event via Event#preventDefault() prevents the original DOM operation.\n *\n * @param {EventBus} eventBus\n */\nfunction InteractionEvents(eventBus, elementRegistry, styles) {\n\n var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {\n stroke: 'white',\n strokeWidth: 15\n });\n\n function fire(type, event) {\n var target = event.delegateTarget || event.target,\n gfx = target && new Snap(target),\n element = elementRegistry.get(gfx),\n returnValue;\n\n if (!gfx || !element) {\n return;\n }\n\n returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });\n\n if (returnValue === false) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n var handlers = {};\n\n function mouseHandler(type) {\n\n var fn = handlers[type];\n\n if (!fn) {\n fn = handlers[type] = function(event) {\n // only indicate left mouse button interactions\n if (isPrimaryButton(event)) {\n fire(type, event);\n }\n };\n }\n\n return fn;\n }\n\n var bindings = {\n mouseover: 'element.hover',\n mouseout: 'element.out',\n click: 'element.click',\n dblclick: 'element.dblclick',\n mousedown: 'element.mousedown',\n mouseup: 'element.mouseup'\n };\n\n var elementSelector = 'svg, .djs-element';\n\n ///// event registration\n\n function registerEvent(node, event, localEvent) {\n var handler = mouseHandler(localEvent);\n handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);\n }\n\n function unregisterEvent(node, event, localEvent) {\n domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);\n }\n\n function registerEvents(svg) {\n forEach(bindings, function(val, key) {\n registerEvent(svg.node, key, val);\n });\n }\n\n function unregisterEvents(svg) {\n forEach(bindings, function(val, key) {\n unregisterEvent(svg.node, key, val);\n });\n }\n\n eventBus.on('canvas.destroy', function(event) {\n unregisterEvents(event.svg);\n });\n\n eventBus.on('canvas.init', function(event) {\n registerEvents(event.svg);\n });\n\n\n eventBus.on([ 'shape.added', 'connection.added' ], function(event) {\n var element = event.element,\n gfx = event.gfx,\n hit,\n type;\n\n if (element.waypoints) {\n hit = createLine(element.waypoints);\n type = 'connection';\n } else {\n hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });\n type = 'shape';\n }\n\n hit.attr(HIT_STYLE).appendTo(gfx.node);\n });\n\n // update djs-hit on change\n\n eventBus.on('shape.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n hit.attr({\n width: element.width,\n height: element.height\n });\n });\n\n eventBus.on('connection.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n updateLine(hit, element.waypoints);\n });\n\n\n // API\n\n this.fire = fire;\n\n this.mouseHandler = mouseHandler;\n\n this.registerEvent = registerEvent;\n this.unregisterEvent = unregisterEvent;\n}\n\n\nInteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];\n\nmodule.exports = InteractionEvents;\n\n\n/**\n * An event indicating that the mouse hovered over an element\n *\n * @event element.hover\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has left an element\n *\n * @event element.out\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has clicked an element\n *\n * @event element.click\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has double clicked an element\n *\n * @event element.dblclick\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone down on an element.\n *\n * @event element.mousedown\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone up on an element.\n *\n * @event element.mouseup\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */","module.exports = {\n __init__: [ 'interactionEvents' ],\n interactionEvents: [ 'type', require(102) ]\n};","'use strict';\n\nvar domEvent = require(344),\n domMatches = require(345);\n\n/**\n * A keyboard abstraction that may be activated and\n * deactivated by users at will, consuming key events\n * and triggering diagram actions.\n *\n * The implementation fires the following key events that allow\n * other components to hook into key handling:\n *\n * - keyboard.bind\n * - keyboard.unbind\n * - keyboard.init\n * - keyboard.destroy\n *\n * All events contain the fields (node, listeners).\n *\n * A default binding for the keyboard may be specified via the\n * `keyboard.bindTo` configuration option.\n *\n * @param {EventBus} eventBus\n * @param {CommandStack} commandStack\n * @param {Modeling} modeling\n * @param {Selection} selection\n */\nfunction Keyboard(config, eventBus, commandStack, modeling, selection) {\n\n var self = this;\n\n this._commandStack = commandStack;\n this._modeling = modeling;\n this._selection = selection;\n this._eventBus = eventBus;\n\n this._listeners = [];\n\n // our key handler is a singleton that passes\n // (keycode, modifiers) to each listener.\n //\n // listeners must indicate that they handled a key event\n // by returning true. This stops the event propagation.\n //\n this._keyHandler = function(event) {\n\n var i, l,\n target = event.target,\n listeners = self._listeners,\n code = event.keyCode || event.charCode || -1;\n\n if (domMatches(target, 'input, textarea')) {\n return;\n }\n\n for (i = 0; !!(l = listeners[i]); i++) {\n if (l(code, event)) {\n event.stopPropagation();\n }\n }\n };\n\n // properly clean dom registrations\n eventBus.on('diagram.destroy', function() {\n self._fire('destroy');\n\n self.unbind();\n self._listeners = null;\n });\n\n eventBus.on('diagram.init', function() {\n self._fire('init');\n\n if (config && config.bindTo) {\n self.bind(config.bindTo);\n }\n });\n\n this._init();\n}\n\nKeyboard.$inject = [ 'config.keyboard', 'eventBus', 'commandStack', 'modeling', 'selection' ];\n\nmodule.exports = Keyboard;\n\n\nKeyboard.prototype.bind = function(node) {\n this._node = node;\n\n // bind key events\n domEvent.bind(node, 'keydown', this._keyHandler, true);\n\n this._fire('bind');\n};\n\nKeyboard.prototype.getBinding = function() {\n return this._node;\n};\n\nKeyboard.prototype.unbind = function() {\n var node = this._node;\n\n if (node) {\n this._fire('unbind');\n\n // unbind key events\n domEvent.unbind(node, 'keydown', this._keyHandler, true);\n }\n\n this._node = null;\n};\n\n\nKeyboard.prototype._fire = function(event) {\n this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });\n};\n\nKeyboard.prototype._init = function() {\n\n var listeners = this._listeners,\n commandStack = this._commandStack,\n modeling = this._modeling,\n selection = this._selection;\n\n\n // init default listeners\n\n // undo\n // (CTRL|CMD) + Z\n function undo(key, modifiers) {\n\n if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {\n commandStack.undo();\n\n return true;\n }\n }\n\n // redo\n // CTRL + Y\n // CMD + SHIFT + Z\n function redo(key, modifiers) {\n\n if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {\n commandStack.redo();\n\n return true;\n }\n }\n\n\n // delete selected element\n // DEL\n function remove(key, modifiers) {\n\n if (key === 46) {\n\n var selectedElements = selection.get();\n\n if (selectedElements.length) {\n modeling.removeElements(selectedElements.slice());\n }\n\n return true;\n }\n }\n\n listeners.push(undo);\n listeners.push(redo);\n listeners.push(remove);\n};\n\n\n/**\n * Add a listener function that is notified with (key, modifiers) whenever\n * the keyboard is bound and the user presses a key.\n *\n * @param {Function} listenerFn\n */\nKeyboard.prototype.addListener = function(listenerFn) {\n this._listeners.push(listenerFn);\n};\n\nKeyboard.prototype.hasModifier = hasModifier;\nKeyboard.prototype.isCmd = isCmd;\nKeyboard.prototype.isShift = isShift;\n\n\nfunction hasModifier(modifiers) {\n return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);\n}\n\nfunction isCmd(modifiers) {\n return modifiers.ctrlKey || modifiers.metaKey;\n}\n\nfunction isShift(modifiers) {\n return modifiers.shiftKey;\n}\n","module.exports = {\n __init__: [ 'keyboard' ],\n keyboard: [ 'type', require(104) ]\n};\n","'use strict';\n\nvar values = require(331);\n\nvar getEnclosedElements = require(177).getEnclosedElements;\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\nvar Snap = require(188);\n\n\nfunction LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {\n\n this._selection = selection;\n this._dragging = dragging;\n\n var self = this;\n\n // lasso visuals implementation\n\n /**\n * A helper that realizes the selection box visual\n */\n var visuals = {\n\n create: function(context) {\n var container = canvas.getDefaultLayer(),\n frame;\n\n frame = context.frame = Snap.create('rect', {\n class: 'djs-lasso-overlay',\n width: 1,\n height: 1,\n x: 0,\n y: 0\n });\n\n frame.appendTo(container);\n },\n\n update: function(context) {\n var frame = context.frame,\n bbox = context.bbox;\n\n frame.attr({\n x: bbox.x,\n y: bbox.y,\n width: bbox.width,\n height: bbox.height\n });\n },\n\n remove: function(context) {\n\n if (context.frame) {\n context.frame.remove();\n }\n }\n };\n\n\n eventBus.on('lasso.selection.end', function(event) {\n\n setTimeout(function() {\n self.activateLasso(event.originalEvent, true);\n });\n });\n\n // lasso interaction implementation\n\n eventBus.on('lasso.end', function(event) {\n\n var bbox = toBBox(event);\n\n var elements = elementRegistry.filter(function(element) {\n return element;\n });\n\n self.select(elements, bbox);\n });\n\n eventBus.on('lasso.start', function(event) {\n\n var context = event.context;\n\n context.bbox = toBBox(event);\n visuals.create(context);\n });\n\n eventBus.on('lasso.move', function(event) {\n\n var context = event.context;\n\n context.bbox = toBBox(event);\n visuals.update(context);\n });\n\n eventBus.on('lasso.end', function(event) {\n\n var context = event.context;\n\n visuals.remove(context);\n });\n\n eventBus.on('lasso.cleanup', function(event) {\n\n var context = event.context;\n\n visuals.remove(context);\n });\n\n\n // event integration\n\n eventBus.on('element.mousedown', 1500, function(event) {\n\n if (hasPrimaryModifier(event)) {\n self.activateLasso(event.originalEvent);\n\n event.stopPropagation();\n }\n });\n}\n\nLassoTool.$inject = [\n 'eventBus',\n 'canvas',\n 'dragging',\n 'elementRegistry',\n 'selection'\n];\n\nmodule.exports = LassoTool;\n\n\nLassoTool.prototype.activateLasso = function(event, autoActivate) {\n\n this._dragging.activate(event, 'lasso', {\n autoActivate: autoActivate,\n cursor: 'crosshair',\n data: {\n context: {}\n }\n });\n};\n\nLassoTool.prototype.activateSelection = function(event) {\n\n this._dragging.activate(event, 'lasso.selection', {\n cursor: 'crosshair'\n });\n};\n\nLassoTool.prototype.select = function(elements, bbox) {\n var selectedElements = getEnclosedElements(elements, bbox);\n\n this._selection.select(values(selectedElements));\n};\n\n\nfunction toBBox(event) {\n\n var start = {\n\n x: event.x - event.dx,\n y: event.y - event.dy\n };\n\n var end = {\n x: event.x,\n y: event.y\n };\n\n var bbox;\n\n if ((start.x <= end.x && start.y < end.y) ||\n (start.x < end.x && start.y <= end.y)) {\n\n bbox = {\n x: start.x,\n y: start.y,\n width: end.x - start.x,\n height: end.y - start.y\n };\n } else if ((start.x >= end.x && start.y < end.y) ||\n (start.x > end.x && start.y <= end.y)) {\n\n bbox = {\n x: end.x,\n y: start.y,\n width: start.x - end.x,\n height: end.y - start.y\n };\n } else if ((start.x <= end.x && start.y > end.y) ||\n (start.x < end.x && start.y >= end.y)) {\n\n bbox = {\n x: start.x,\n y: end.y,\n width: end.x - start.x,\n height: start.y - end.y\n };\n } else if ((start.x >= end.x && start.y > end.y) ||\n (start.x > end.x && start.y >= end.y)) {\n\n bbox = {\n x: end.x,\n y: end.y,\n width: start.x - end.x,\n height: start.y - end.y\n };\n } else {\n\n bbox = {\n x: end.x,\n y: end.y,\n width: 0,\n height: 0\n };\n }\n return bbox;\n}","'use strict';\n\nmodule.exports = {\n __init__: [ 'lassoTool' ],\n lassoTool: [ 'type', require(106) ]\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar model = require(168);\n\n\n/**\n * The basic modeling entry point.\n *\n * @param {EventBus} eventBus\n * @param {ElementFactory} elementFactory\n * @param {CommandStack} commandStack\n */\nfunction Modeling(eventBus, elementFactory, commandStack) {\n this._eventBus = eventBus;\n this._elementFactory = elementFactory;\n this._commandStack = commandStack;\n\n var self = this;\n\n eventBus.on('diagram.init', function() {\n // register modeling handlers\n self.registerHandlers(commandStack);\n });\n}\n\nModeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack' ];\n\nmodule.exports = Modeling;\n\n\nModeling.prototype.getHandlers = function() {\n return {\n 'shape.append': require(109),\n 'shape.create': require(112),\n 'shape.delete': require(115),\n 'shape.move': require(118),\n 'shapes.move': require(119),\n 'shape.resize': require(123),\n 'shape.replace': require(122),\n\n 'spaceTool': require(124),\n\n 'label.create': require(111),\n\n 'connection.create': require(110),\n 'connection.delete': require(113),\n 'connection.move': require(117),\n 'connection.layout': require(116),\n\n 'connection.updateWaypoints': require(126),\n\n 'connection.reconnectStart': require(121),\n 'connection.reconnectEnd': require(121),\n\n 'elements.delete': require(114),\n 'element.updateAnchors': require(125)\n };\n};\n\n/**\n * Register handlers with the command stack\n *\n * @param {CommandStack} commandStack\n */\nModeling.prototype.registerHandlers = function(commandStack) {\n forEach(this.getHandlers(), function(handler, id) {\n commandStack.registerHandler(id, handler);\n });\n};\n\n\n///// modeling helpers /////////////////////////////////////////\n\n\nModeling.prototype.moveShape = function(shape, delta, newParent, hints) {\n\n var context = {\n shape: shape,\n delta: delta,\n newParent: newParent,\n hints: hints || {}\n };\n\n this._commandStack.execute('shape.move', context);\n};\n\n\nModeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {\n\n var context = {\n shapes: shapes,\n delta: delta,\n newParent: newParent,\n hints: hints || {}\n };\n\n this._commandStack.execute('shapes.move', context);\n};\n\n/**\n * Update the anchors on the element with the given delta movement\n * @param {djs.model.Element} element\n * @param {Point} delta\n */\nModeling.prototype.updateAnchors = function(element, delta) {\n var context = {\n element: element,\n delta: delta\n };\n\n this._commandStack.execute('element.updateAnchors', context);\n};\n\nModeling.prototype.moveConnection = function(connection, delta, newParent, hints) {\n\n var context = {\n connection: connection,\n delta: delta,\n newParent: newParent,\n hints: hints || {}\n };\n\n this._commandStack.execute('connection.move', context);\n};\n\n\nModeling.prototype.layoutConnection = function(connection, hints) {\n\n var context = {\n connection: connection,\n hints: hints || {}\n };\n\n this._commandStack.execute('connection.layout', context);\n};\n\n\nModeling.prototype.createConnection = function(source, target, connection, parent) {\n\n connection = this._create('connection', connection);\n\n var context = {\n source: source,\n target: target,\n parent: parent,\n connection: connection\n };\n\n this._commandStack.execute('connection.create', context);\n\n return context.connection;\n};\n\nModeling.prototype.createShape = function(shape, position, parent) {\n\n shape = this._create('shape', shape);\n\n var context = {\n position: position,\n parent: parent,\n shape: shape\n };\n\n this._commandStack.execute('shape.create', context);\n\n return context.shape;\n};\n\n\nModeling.prototype.createLabel = function(labelTarget, position, label, parent) {\n\n label = this._create('label', label);\n\n var context = {\n labelTarget: labelTarget,\n position: position,\n parent: parent,\n shape: label\n };\n\n this._commandStack.execute('label.create', context);\n\n return context.shape;\n};\n\n\nModeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {\n\n shape = this._create('shape', shape);\n\n var context = {\n source: source,\n position: position,\n parent: parent,\n shape: shape,\n connection: connection,\n connectionParent: connectionParent\n };\n\n this._commandStack.execute('shape.append', context);\n\n return context.shape;\n};\n\n\nModeling.prototype.removeElements = function(elements) {\n var context = {\n elements: elements\n };\n\n this._commandStack.execute('elements.delete', context);\n};\n\n\nModeling.prototype.removeShape = function(shape) {\n var context = {\n shape: shape\n };\n\n this._commandStack.execute('shape.delete', context);\n};\n\n\nModeling.prototype.removeConnection = function(connection) {\n var context = {\n connection: connection\n };\n\n this._commandStack.execute('connection.delete', context);\n};\n\nModeling.prototype.replaceShape = function(oldShape, newShape, options) {\n var context = {\n oldShape: oldShape,\n newData: newShape,\n options: options\n };\n\n this._commandStack.execute('shape.replace', context);\n\n return context.newShape;\n};\n\nModeling.prototype.resizeShape = function(shape, newBounds) {\n var context = {\n shape: shape,\n newBounds: newBounds\n };\n\n this._commandStack.execute('shape.resize', context);\n};\n\nModeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {\n var context = {\n movingShapes: movingShapes,\n resizingShapes: resizingShapes,\n delta: delta,\n direction: direction\n };\n\n this._commandStack.execute('spaceTool', context);\n};\n\nModeling.prototype.updateWaypoints = function(connection, newWaypoints) {\n var context = {\n connection: connection,\n newWaypoints: newWaypoints\n };\n\n this._commandStack.execute('connection.updateWaypoints', context);\n};\n\nModeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {\n var context = {\n connection: connection,\n newSource: newSource,\n dockingPoint: dockingPoint\n };\n\n this._commandStack.execute('connection.reconnectStart', context);\n};\n\nModeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {\n var context = {\n connection: connection,\n newTarget: newTarget,\n dockingPoint: dockingPoint\n };\n\n this._commandStack.execute('connection.reconnectEnd', context);\n};\n\nModeling.prototype.connect = function(source, target, attrs) {\n return this.createConnection(source, target, attrs || {}, source.parent);\n};\n\n\nModeling.prototype._create = function(type, attrs) {\n if (attrs instanceof model.Base) {\n return attrs;\n } else {\n return this._elementFactory.create(type, attrs);\n }\n};\n","'use strict';\n\nvar inherits = require(195);\n\n\n/**\n * A handler that implements reversible appending of shapes\n * to a source shape.\n *\n * @param {canvas} Canvas\n * @param {elementFactory} ElementFactory\n * @param {modeling} Modeling\n */\nfunction AppendShapeHandler(modeling) {\n this._modeling = modeling;\n}\n\ninherits(AppendShapeHandler, require(120));\n\n\nAppendShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = AppendShapeHandler;\n\n\n////// api /////////////////////////////////////////////\n\n/**\n * Creates a new shape\n *\n * @param {Object} context\n * @param {ElementDescriptor} context.shape the new shape\n * @param {ElementDescriptor} context.source the source object\n * @param {ElementDescriptor} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\nAppendShapeHandler.prototype.preExecute = function(context) {\n\n if (!context.source) {\n throw new Error('source required');\n }\n\n var parent = context.parent || context.source.parent,\n shape = this._modeling.createShape(context.shape, context.position, parent);\n\n context.shape = shape;\n};\n\nAppendShapeHandler.prototype.postExecute = function(context) {\n var parent = context.connectionParent || context.shape.parent;\n\n // create connection\n this._modeling.connect(context.source, context.shape, context.connection, parent);\n};","'use strict';\n\n\nfunction CreateConnectionHandler(canvas, layouter) {\n this._canvas = canvas;\n this._layouter = layouter;\n}\n\nCreateConnectionHandler.$inject = [ 'canvas', 'layouter' ];\n\nmodule.exports = CreateConnectionHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n/**\n * Appends a shape to a target shape\n *\n * @param {Object} context\n * @param {djs.element.Base} context.source the source object\n * @param {djs.element.Base} context.target the parent object\n * @param {Point} context.position position of the new element\n */\nCreateConnectionHandler.prototype.execute = function(context) {\n\n var source = context.source,\n target = context.target,\n parent = context.parent;\n\n if (!source || !target) {\n throw new Error('source and target required');\n }\n\n if (!parent) {\n throw new Error('parent required');\n }\n\n var connection = context.connection;\n\n connection.source = source;\n connection.target = target;\n\n if (!connection.waypoints) {\n connection.waypoints = this._layouter.layoutConnection(connection);\n }\n\n // add connection\n this._canvas.addConnection(connection, parent);\n\n return connection;\n};\n\nCreateConnectionHandler.prototype.revert = function(context) {\n var connection = context.connection;\n\n this._canvas.removeConnection(connection);\n\n connection.source = null;\n connection.target = null;\n};","'use strict';\n\nvar inherits = require(195);\n\nvar CreateShapeHandler = require(112);\n\n\n/**\n * A handler that attaches a label to a given target shape.\n *\n * @param {canvas} Canvas\n */\nfunction CreateLabelHandler(canvas) {\n CreateShapeHandler.call(this, canvas);\n}\n\ninherits(CreateLabelHandler, CreateShapeHandler);\n\nCreateLabelHandler.$inject = [ 'canvas' ];\n\nmodule.exports = CreateLabelHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Appends a label to a target shape.\n *\n * @method CreateLabelHandler#execute\n *\n * @param {Object} context\n * @param {ElementDescriptor} context.target the element the label is attached to\n * @param {ElementDescriptor} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\n\n/**\n * Undo append by removing the shape\n */\nCreateLabelHandler.prototype.revert = function(context) {\n context.shape.labelTarget = null;\n this._canvas.removeShape(context.shape);\n};\n\n\n////// helpers /////////////////////////////////////////\n\nCreateLabelHandler.prototype.getParent = function(context) {\n return context.parent || context.labelTarget && context.labelTarget.parent;\n};\n\nCreateLabelHandler.prototype.addElement = function(shape, parent, context) {\n shape.labelTarget = context.labelTarget;\n this._canvas.addShape(shape, parent, true);\n};","'use strict';\n\nvar assign = require(325);\n\n\n/**\n * A handler that implements reversible addition of shapes.\n *\n * @param {canvas} Canvas\n */\nfunction CreateShapeHandler(canvas) {\n this._canvas = canvas;\n}\n\nCreateShapeHandler.$inject = [ 'canvas' ];\n\nmodule.exports = CreateShapeHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Appends a shape to a target shape\n *\n * @param {Object} context\n * @param {djs.model.Base} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\nCreateShapeHandler.prototype.execute = function(context) {\n\n var parent = this.getParent(context);\n\n var shape = context.shape;\n\n this.setPosition(shape, context);\n\n this.addElement(shape, parent, context);\n\n return shape;\n};\n\n\n/**\n * Undo append by removing the shape\n */\nCreateShapeHandler.prototype.revert = function(context) {\n this._canvas.removeShape(context.shape);\n};\n\n\n////// helpers /////////////////////////////////////////\n\nCreateShapeHandler.prototype.getParent = function(context) {\n var parent = context.parent;\n\n if (!parent) {\n throw new Error('parent required');\n }\n\n return parent;\n};\n\nCreateShapeHandler.prototype.getPosition = function(context) {\n if (!context.position) {\n throw new Error('no position given');\n }\n\n return context.position;\n};\n\nCreateShapeHandler.prototype.addElement = function(shape, parent) {\n this._canvas.addShape(shape, parent);\n};\n\nCreateShapeHandler.prototype.setPosition = function(shape, context) {\n var position = this.getPosition(context);\n\n // update to center position\n // specified in create context\n assign(shape, {\n x: position.x - shape.width / 2,\n y: position.y - shape.height / 2\n });\n};","'use strict';\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible deletion of Connections.\n *\n */\nfunction DeleteConnectionHandler(canvas, modeling) {\n this._canvas = canvas;\n this._modeling = modeling;\n}\n\nDeleteConnectionHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = DeleteConnectionHandler;\n\n\n/**\n * - Remove attached label\n */\nDeleteConnectionHandler.prototype.preExecute = function(context) {\n\n var connection = context.connection;\n\n // Remove label\n if (connection.label) {\n this._modeling.removeShape(connection.label);\n }\n};\n\nDeleteConnectionHandler.prototype.execute = function(context) {\n\n var connection = context.connection,\n parent = connection.parent;\n\n context.parent = parent;\n context.parentIndex = Collections.indexOf(parent.children, connection);\n\n context.source = connection.source;\n context.target = connection.target;\n\n this._canvas.removeConnection(connection);\n\n connection.source = null;\n connection.target = null;\n connection.label = null;\n};\n\n/**\n * Command revert implementation.\n */\nDeleteConnectionHandler.prototype.revert = function(context) {\n\n var connection = context.connection,\n parent = context.parent,\n parentIndex = context.parentIndex;\n\n connection.source = context.source;\n connection.target = context.target;\n\n // restore previous location in old parent\n Collections.add(parent.children, connection, parentIndex);\n\n this._canvas.addConnection(connection, parent);\n};\n","'use strict';\n\nvar forEach = require(204),\n inherits = require(195);\n\n\nfunction DeleteElementsHandler(modeling, elementRegistry) {\n this._modeling = modeling;\n this._elementRegistry = elementRegistry;\n}\n\ninherits(DeleteElementsHandler, require(120));\n\nDeleteElementsHandler.$inject = [ 'modeling', 'elementRegistry' ];\n\nmodule.exports = DeleteElementsHandler;\n\n\nDeleteElementsHandler.prototype.postExecute = function(context) {\n\n var modeling = this._modeling,\n elementRegistry = this._elementRegistry,\n elements = context.elements;\n\n forEach(elements, function(element) {\n\n // element may have been removed with previous\n // remove operations already (e.g. in case of nesting)\n if (!elementRegistry.get(element.id)) {\n return;\n }\n\n if (element.waypoints) {\n modeling.removeConnection(element);\n } else {\n modeling.removeShape(element);\n }\n });\n};","'use strict';\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible deletion of shapes.\n *\n */\nfunction DeleteShapeHandler(canvas, modeling) {\n this._canvas = canvas;\n this._modeling = modeling;\n}\n\nDeleteShapeHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = DeleteShapeHandler;\n\n\n/**\n * - Remove connections\n * - Remove all direct children\n */\nDeleteShapeHandler.prototype.preExecute = function(context) {\n\n var shape = context.shape,\n label = shape.label,\n modeling = this._modeling;\n\n // Clean up on removeShape(label)\n if (shape.labelTarget) {\n context.labelTarget = shape.labelTarget;\n shape.labelTarget = null;\n }\n\n // Remove label\n if (label) {\n this._modeling.removeShape(label);\n }\n\n // remove connections\n this._saveClear(shape.incoming, function(connection) {\n // To make sure that the connection isn't removed twice\n // For example if a container is removed\n modeling.removeConnection(connection);\n });\n\n this._saveClear(shape.outgoing, function(connection) {\n modeling.removeConnection(connection);\n });\n\n\n // remove children\n this._saveClear(shape.children, function(e) {\n modeling.removeShape(e);\n });\n};\n\n\nDeleteShapeHandler.prototype._saveClear = function(collection, remove) {\n\n var e;\n\n while (!!(e = collection[0])) {\n remove(e);\n }\n};\n\n\n/**\n * Remove shape and remember the parent\n */\nDeleteShapeHandler.prototype.execute = function(context) {\n\n var shape = context.shape,\n parent = shape.parent;\n\n context.parent = parent;\n context.parentIndex = Collections.indexOf(parent.children, shape);\n\n shape.label = null;\n\n this._canvas.removeShape(shape);\n};\n\n\n/**\n * Command revert implementation\n */\nDeleteShapeHandler.prototype.revert = function(context) {\n\n var shape = context.shape,\n parent = context.parent,\n parentIndex = context.parentIndex,\n labelTarget = context.labelTarget;\n\n // restore previous location in old parent\n Collections.add(parent.children, shape, parentIndex);\n\n if (labelTarget) {\n labelTarget.label = shape;\n }\n\n this._canvas.addShape(shape, parent);\n};\n","'use strict';\n\nvar assign = require(325);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction LayoutConnectionHandler(layouter, canvas) {\n this._layouter = layouter;\n this._canvas = canvas;\n}\n\nLayoutConnectionHandler.$inject = [ 'layouter', 'canvas' ];\n\nmodule.exports = LayoutConnectionHandler;\n\nLayoutConnectionHandler.prototype.execute = function(context) {\n\n var connection = context.connection,\n parent = connection.parent,\n connectionSiblings = parent.children;\n\n var oldIndex = connectionSiblings.indexOf(connection);\n\n assign(context, {\n oldWaypoints: connection.waypoints,\n oldIndex: oldIndex\n });\n\n sendToFront(connection);\n\n connection.waypoints = this._layouter.layoutConnection(connection, context.hints);\n\n return connection;\n};\n\nLayoutConnectionHandler.prototype.revert = function(context) {\n\n var connection = context.connection,\n parent = connection.parent,\n connectionSiblings = parent.children,\n currentIndex = connectionSiblings.indexOf(connection),\n oldIndex = context.oldIndex;\n\n connection.waypoints = context.oldWaypoints;\n\n if (oldIndex !== currentIndex) {\n\n // change position of connection in shape\n connectionSiblings.splice(currentIndex, 1);\n connectionSiblings.splice(oldIndex, 0, connection);\n }\n\n return connection;\n};\n\n// connections should have a higher z-order as there source and targets\nfunction sendToFront(connection) {\n\n var connectionSiblings = connection.parent.children;\n\n var connectionIdx = connectionSiblings.indexOf(connection),\n sourceIdx = findIndex(connectionSiblings, connection.source),\n targetIdx = findIndex(connectionSiblings, connection.target),\n\n // ensure we do not send the connection back\n // if it is already in front\n insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);\n\n if (connectionIdx < insertIndex) {\n connectionSiblings.splice(insertIndex, 0, connection); // add to new position\n connectionSiblings.splice(connectionIdx, 1); // remove from old position\n }\n\n function findIndex(array, obj) {\n\n var index = array.indexOf(obj);\n if (index < 0 && obj) {\n var parent = obj.parent;\n index = findIndex(array, parent);\n }\n return index;\n }\n\n return insertIndex;\n}\n","'use strict';\n\nvar forEach = require(204);\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible moving of connections.\n *\n * The handler differs from the layout connection handler in a sense\n * that it preserves the connection layout.\n */\nfunction MoveConnectionHandler() { }\n\nmodule.exports = MoveConnectionHandler;\n\n\nMoveConnectionHandler.prototype.execute = function(context) {\n\n var updateAnchors = (context.hints.updateAnchors !== false);\n\n var connection = context.connection,\n delta = context.delta;\n\n var newParent = this.getNewParent(connection, context),\n oldParent = connection.parent;\n\n // save old position + parent in context\n context.oldParent = oldParent;\n context.oldParentIndex = Collections.indexOf(oldParent.children, connection);\n\n // update waypoint positions\n forEach(connection.waypoints, function(p) {\n p.x += delta.x;\n p.y += delta.y;\n\n if (updateAnchors && p.original) {\n p.original.x += delta.x;\n p.original.y += delta.y;\n }\n });\n\n // update parent\n connection.parent = newParent;\n\n return connection;\n};\n\nMoveConnectionHandler.prototype.revert = function(context) {\n\n var updateAnchors = (context.hints.updateAnchors !== false);\n\n var connection = context.connection,\n oldParent = context.oldParent,\n oldParentIndex = context.oldParentIndex,\n delta = context.delta;\n\n // restore previous location in old parent\n Collections.add(oldParent.children, connection, oldParentIndex);\n\n // restore parent\n connection.parent = oldParent;\n\n // revert to old waypoint positions\n forEach(connection.waypoints, function(p) {\n p.x -= delta.x;\n p.y -= delta.y;\n\n if (updateAnchors && p.original) {\n p.original.x -= delta.x;\n p.original.y -= delta.y;\n }\n });\n\n return connection;\n};\n\n\nMoveConnectionHandler.prototype.getNewParent = function(connection, context) {\n return context.newParent || connection.parent;\n};\n","'use strict';\n\nvar assign = require(325),\n forEach = require(204);\n\nvar MoveHelper = require(127),\n Collections = require(175);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction MoveShapeHandler(modeling) {\n this._modeling = modeling;\n\n this._helper = new MoveHelper(modeling);\n}\n\nMoveShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = MoveShapeHandler;\n\n\nMoveShapeHandler.prototype.execute = function(context) {\n\n var shape = context.shape,\n delta = context.delta,\n newParent = this.getNewParent(context),\n oldParent = shape.parent;\n\n // save old parent in context\n context.oldParent = oldParent;\n context.oldParentIndex = Collections.indexOf(oldParent.children, shape);\n\n // update shape parent + position\n assign(shape, {\n parent: newParent,\n x: shape.x + delta.x,\n y: shape.y + delta.y\n });\n\n return shape;\n};\n\nMoveShapeHandler.prototype.postExecute = function(context) {\n\n var shape = context.shape,\n delta = context.delta;\n\n var modeling = this._modeling;\n\n if (context.hints.updateAnchors !== false) {\n modeling.updateAnchors(shape, delta);\n }\n\n if (context.hints.layout !== false) {\n forEach(shape.incoming, function(c) {\n modeling.layoutConnection(c, { endChanged: true });\n });\n\n forEach(shape.outgoing, function(c) {\n modeling.layoutConnection(c, { startChanged: true });\n });\n }\n\n if (context.hints.recurse !== false) {\n this.moveChildren(context);\n }\n};\n\nMoveShapeHandler.prototype.revert = function(context) {\n\n var shape = context.shape,\n oldParent = context.oldParent,\n oldParentIndex = context.oldParentIndex,\n delta = context.delta;\n\n // restore previous location in old parent\n Collections.add(oldParent.children, shape, oldParentIndex);\n\n // revert to old position and parent\n assign(shape, {\n parent: oldParent,\n x: shape.x - delta.x,\n y: shape.y - delta.y\n });\n\n return shape;\n};\n\nMoveShapeHandler.prototype.moveChildren = function(context) {\n\n var delta = context.delta,\n shape = context.shape;\n\n this._helper.moveRecursive(shape.children, delta, null);\n};\n\nMoveShapeHandler.prototype.getNewParent = function(context) {\n return context.newParent || context.shape.parent;\n};","'use strict';\n\nvar MoveHelper = require(127);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction MoveShapesHandler(modeling) {\n this._helper = new MoveHelper(modeling);\n}\n\nMoveShapesHandler.$inject = [ 'modeling' ];\n\nmodule.exports = MoveShapesHandler;\n\nMoveShapesHandler.prototype.preExecute = function(context) {\n context.closure = this._helper.getClosure(context.shapes);\n};\n\nMoveShapesHandler.prototype.postExecute = function(context) {\n this._helper.moveClosure(context.closure, context.delta, context.newParent);\n};\n\n\nMoveShapesHandler.prototype.execute = function(context) { };\nMoveShapesHandler.prototype.revert = function(context) { };\n","'use strict';\n\nfunction NoopHandler() {}\n\nmodule.exports = NoopHandler;\n\nNoopHandler.prototype.execute = function() {};\nNoopHandler.prototype.revert = function() {};","'use strict';\n\n\nfunction ReconnectConnectionHandler(layouter) { }\n\nReconnectConnectionHandler.$inject = [ 'layouter' ];\n\nmodule.exports = ReconnectConnectionHandler;\n\nReconnectConnectionHandler.prototype.execute = function(context) {\n\n var newSource = context.newSource,\n newTarget = context.newTarget,\n connection = context.connection;\n\n if (!newSource && !newTarget) {\n throw new Error('newSource or newTarget are required');\n }\n\n if (newSource && newTarget) {\n throw new Error('must specify either newSource or newTarget');\n }\n\n if (newSource) {\n context.oldSource = connection.source;\n connection.source = newSource;\n\n context.oldDockingPoint = connection.waypoints[0];\n connection.waypoints[0] = context.dockingPoint;\n }\n\n if (newTarget) {\n context.oldTarget = connection.target;\n connection.target = newTarget;\n\n context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];\n connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;\n }\n\n return connection;\n};\n\nReconnectConnectionHandler.prototype.revert = function(context) {\n\n var newSource = context.newSource,\n newTarget = context.newTarget,\n connection = context.connection;\n\n if (newSource) {\n connection.source = context.oldSource;\n connection.waypoints[0] = context.oldDockingPoint;\n }\n\n if (newTarget) {\n connection.target = context.oldTarget;\n connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;\n }\n\n return connection;\n};","'use strict';\n\nvar forEach = require(204);\n\n\n/**\n * A handler that implements reversible replacing of shapes.\n * Internally the old shape will be removed and the new shape will be added.\n *\n *\n * @class\n * @constructor\n *\n * @param {canvas} Canvas\n */\nfunction ReplaceShapeHandler(modeling, rules) {\n this._modeling = modeling;\n this._rules = rules;\n}\n\nReplaceShapeHandler.$inject = [ 'modeling', 'rules' ];\n\nmodule.exports = ReplaceShapeHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Replaces a shape with an replacement Element.\n *\n * The newData object should contain type, x, y.\n *\n * If possible also the incoming/outgoing connection\n * will be restored.\n *\n * @param {Object} context\n */\n ReplaceShapeHandler.prototype.preExecute = function(context) {\n\n var modeling = this._modeling,\n rules = this._rules;\n\n var oldShape = context.oldShape,\n newData = context.newData,\n newShape;\n\n\n // (1) place a new shape at the given position\n\n var position = {\n x: newData.x,\n y: newData.y\n };\n\n newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);\n\n\n // (2) reconnect connections to the new shape (where allowed)\n\n var incoming = oldShape.incoming.slice(),\n outgoing = oldShape.outgoing.slice();\n\n forEach(incoming, function(connection) {\n var waypoints = connection.waypoints,\n docking = waypoints[waypoints.length - 1],\n allowed = rules.allowed('connection.reconnectEnd', {\n source: connection.source,\n target: newShape,\n connection: connection\n });\n\n if (allowed) {\n modeling.reconnectEnd(connection, newShape, docking);\n }\n });\n\n forEach(outgoing, function(connection) {\n var waypoints = connection.waypoints,\n docking = waypoints[0],\n allowed = rules.allowed('connection.reconnectStart', {\n source: newShape,\n target: connection.target,\n connection: connection\n });\n\n if (allowed) {\n modeling.reconnectStart(connection, newShape, docking);\n }\n });\n};\n\n\nReplaceShapeHandler.prototype.postExecute = function(context) {\n var modeling = this._modeling;\n\n var oldShape = context.oldShape;\n\n modeling.removeShape(oldShape);\n};\n\n\nReplaceShapeHandler.prototype.execute = function(context) { };\n\nReplaceShapeHandler.prototype.revert = function(context) {};\n","'use strict';\n\nvar assign = require(325),\n forEach = require(204);\n\n\n/**\n * A handler that implements reversible resizing of shapes.\n *\n */\nfunction ResizeShapeHandler(modeling) {\n this._modeling = modeling;\n}\n\nResizeShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = ResizeShapeHandler;\n\n/**\n * {\n * shape: {....}\n * newBounds: {\n * width: 20,\n * height: 40,\n * x: 5,\n * y: 10\n * }\n *\n * }\n */\nResizeShapeHandler.prototype.execute = function(context) {\n\n var shape = context.shape,\n newBounds = context.newBounds;\n\n if (newBounds.x === undefined || newBounds.y === undefined || \n newBounds.width === undefined || newBounds.height === undefined) {\n throw new Error('newBounds must have {x, y, width, height} properties');\n }\n\n if (newBounds.width < 10 || newBounds.height < 10) {\n throw new Error('width and height cannot be less than 10px');\n }\n\n // save old bbox in context\n context.oldBounds = {\n width: shape.width,\n height: shape.height,\n x: shape.x,\n y: shape.y\n };\n\n // update shape\n assign(shape, {\n width: newBounds.width,\n height: newBounds.height,\n x: newBounds.x,\n y: newBounds.y\n });\n\n return shape;\n};\n\nResizeShapeHandler.prototype.postExecute = function(context) {\n\n var shape = context.shape;\n\n var modeling = this._modeling;\n\n forEach(shape.incoming, function(c) {\n modeling.layoutConnection(c, { endChanged: true });\n });\n\n forEach(shape.outgoing, function(c) {\n modeling.layoutConnection(c, { startChanged: true });\n });\n\n};\n\nResizeShapeHandler.prototype.revert = function(context) {\n\n var shape = context.shape,\n oldBounds = context.oldBounds;\n\n // restore previous bbox\n assign(shape, {\n width: oldBounds.width,\n height: oldBounds.height,\n x: oldBounds.x,\n y: oldBounds.y\n });\n\n return shape;\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar SpaceUtil = require(157);\n\n/**\n * A handler that implements reversible creating and removing of space.\n *\n * It executes in two phases:\n *\n * (1) resize all affected resizeShapes\n * (2) move all affected moveShapes\n */\nfunction SpaceToolHandler(modeling) {\n this._modeling = modeling;\n}\n\nSpaceToolHandler.$inject = [ 'modeling' ];\n\nmodule.exports = SpaceToolHandler;\n\n\nSpaceToolHandler.prototype.preExecute = function(context) {\n\n // resize\n var modeling = this._modeling,\n resizingShapes = context.resizingShapes,\n delta = context.delta,\n direction = context.direction;\n\n forEach(resizingShapes, function(shape) {\n var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);\n\n modeling.resizeShape(shape, newBounds);\n });\n};\n\nSpaceToolHandler.prototype.postExecute = function(context) {\n // move\n var modeling = this._modeling,\n movingShapes = context.movingShapes,\n delta = context.delta;\n\n modeling.moveShapes(movingShapes, delta);\n};\n\nSpaceToolHandler.prototype.execute = function(context) {};\nSpaceToolHandler.prototype.revert = function(context) {};\n","'use strict';\n\nvar forEach = require(204),\n assign = require(325);\n\n\n/**\n * Update the anchors of\n */\nfunction UpdateAnchorsHandler() { }\n\nmodule.exports = UpdateAnchorsHandler;\n\n\nUpdateAnchorsHandler.prototype.execute = function(context) {\n\n // update connection anchors\n return this.updateAnchors(context.element, context.delta);\n};\n\nUpdateAnchorsHandler.prototype.revert = function(context) {\n\n var delta = context.delta,\n revertedDelta = { x: -1 * delta.x, y: -1 * delta.y };\n\n // revert update connection anchors\n return this.updateAnchors(context.element, revertedDelta);\n};\n\n/**\n * Update anchors on the element according to the delta movement.\n *\n * @param {djs.model.Element} element\n * @param {Point} delta\n *\n * @return Array<djs.model.Connection>\n */\nUpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {\n\n function add(point, delta) {\n return {\n x: point.x + delta.x,\n y: point.y + delta.y\n };\n }\n\n function updateAnchor(waypoint) {\n var original = waypoint.original;\n\n waypoint.original = assign(original || {}, add(original || waypoint, delta));\n }\n\n var changed = [];\n\n forEach(element.incoming, function(c) {\n var waypoints = c.waypoints;\n updateAnchor(waypoints[waypoints.length - 1]);\n\n changed.push(c);\n });\n\n forEach(element.outgoing, function(c) {\n var waypoints = c.waypoints;\n updateAnchor(waypoints[0]);\n\n changed.push(c);\n });\n\n return changed;\n};","'use strict';\n\nfunction UpdateWaypointsHandler() { }\n\nmodule.exports = UpdateWaypointsHandler;\n\nUpdateWaypointsHandler.prototype.execute = function(context) {\n\n var connection = context.connection,\n newWaypoints = context.newWaypoints;\n\n context.oldWaypoints = connection.waypoints;\n\n connection.waypoints = newWaypoints;\n\n return connection;\n};\n\nUpdateWaypointsHandler.prototype.revert = function(context) {\n\n var connection = context.connection,\n oldWaypoints = context.oldWaypoints;\n\n connection.waypoints = oldWaypoints;\n\n return connection;\n};","'use strict';\n\nvar forEach = require(204);\n\nvar Elements = require(177);\n\n\n/**\n * A helper that is able to carry out serialized move operations on multiple elements.\n *\n * @param {Modeling} modeling\n */\nfunction MoveHelper(modeling) {\n this._modeling = modeling;\n}\n\nmodule.exports = MoveHelper;\n\n/**\n * Move the specified elements and all children by the given delta.\n *\n * This moves all enclosed connections, too and layouts all affected\n * external connections.\n *\n * @param {Array<djs.model.Base>} elements\n * @param {Point} delta\n * @param {djs.model.Base} newParent applied to the first level of shapes\n *\n * @return {Array<djs.model.Base>} list of touched elements\n */\nMoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {\n return this.moveClosure(this.getClosure(elements), delta, newParent);\n};\n\n/**\n * Move the given closure of elmements\n */\nMoveHelper.prototype.moveClosure = function(closure, delta, newParent) {\n\n var modeling = this._modeling;\n\n var allShapes = closure.allShapes,\n allConnections = closure.allConnections,\n enclosedConnections = closure.enclosedConnections,\n topLevel = closure.topLevel;\n\n // move all shapes\n forEach(allShapes, function(s) {\n\n modeling.moveShape(s, delta, topLevel[s.id] && newParent, {\n recurse: false,\n layout: false\n });\n });\n\n // move all child connections / layout external connections\n forEach(allConnections, function(c) {\n\n var startMoved = !!allShapes[c.source.id],\n endMoved = !!allShapes[c.target.id];\n\n if (enclosedConnections[c.id] &&\n startMoved && endMoved) {\n modeling.moveConnection(c, delta, topLevel[c.id] && newParent, { updateAnchors: false });\n } else {\n modeling.layoutConnection(c, {\n startChanged: startMoved,\n endChanged: endMoved\n });\n }\n });\n};\n\n/**\n * Returns the closure for the selected elements\n *\n * @param {Array<djs.model.Base>} elements\n * @return {Object} closure\n */\nMoveHelper.prototype.getClosure = function(elements) {\n return Elements.getClosure(elements);\n};\n","module.exports = {\n __depends__: [\n require(77),\n require(93),\n require(147)\n ],\n __init__: [ 'modeling' ],\n modeling: [ 'type', require(108) ],\n layouter: [ 'type', require(164) ]\n};\n","'use strict';\n\nvar assign = require(325),\n filter = require(202),\n groupBy = require(205);\n\n\nvar LOW_PRIORITY = 500,\n HIGH_PRIORITY = 1500;\n\nvar getOriginalEvent = require(178).getOriginal;\n\nvar round = Math.round;\n\n\n/**\n * Return a filtered list of elements that do not contain\n * those nested into others.\n *\n * @param {Array<djs.model.Base>} elements\n *\n * @return {Array<djs.model.Base>} filtered\n */\nfunction removeNested(elements) {\n\n var ids = groupBy(elements, 'id');\n\n return filter(elements, function(element) {\n while (!!(element = element.parent)) {\n if (ids[element.id]) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {Dragging} dragging\n * @param {Modeling} modeling\n * @param {Selection} selection\n * @param {Rules} rules\n */\nfunction MoveEvents(eventBus, dragging, modeling, selection, rules) {\n\n // rules\n\n function canMove(shapes, delta, target) {\n\n return rules.allowed('shapes.move', {\n shapes: shapes,\n delta: delta,\n newParent: target\n });\n }\n\n\n // move events\n\n // assign a high priority to this handler to setup the environment\n // others may hook up later, e.g. at default priority and modify\n // the move environment\n //\n eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {\n\n var context = event.context,\n shape = event.shape,\n shapes = selection.get().slice();\n\n // move only single shape shape if the dragged element\n // is not part of the current selection\n if (shapes.indexOf(shape) === -1) {\n shapes = [ shape ];\n }\n\n // ensure we remove nested elements in the collection\n shapes = removeNested(shapes);\n\n // attach shapes to drag context\n assign(context, {\n shapes: shapes,\n shape: shape\n });\n\n // check if we can move the elements\n if (!canMove(shapes)) {\n // suppress move operation\n event.stopPropagation();\n\n return false;\n }\n });\n\n // assign a low priority to this handler\n // to let others modify the move event before we update\n // the context\n //\n eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {\n\n var context = event.context,\n shapes = context.shapes,\n hover = event.hover,\n delta = { x: event.dx, y: event.dy },\n canExecute;\n\n // check if we can move the elements\n canExecute = canMove(shapes, delta, hover);\n\n context.delta = delta;\n context.canExecute = canExecute;\n\n // simply ignore move over\n if (canExecute === null) {\n context.target = null;\n\n return;\n }\n\n context.target = hover;\n });\n\n eventBus.on('shape.move.end', function(event) {\n\n var context = event.context;\n\n var delta = context.delta,\n canExecute = context.canExecute;\n\n if (!canExecute) {\n return false;\n }\n\n // ensure we have actual pixel values deltas\n // (important when zoom level was > 1 during move)\n delta.x = round(delta.x);\n delta.y = round(delta.y);\n\n modeling.moveShapes(context.shapes, delta, context.target);\n });\n\n\n // move activation\n\n eventBus.on('element.mousedown', function(event) {\n\n var originalEvent = getOriginalEvent(event);\n\n if (!originalEvent) {\n throw new Error('must supply DOM mousedown event');\n }\n\n start(originalEvent, event.element);\n });\n\n\n function start(event, element, activate) {\n\n // do not move connections or the root element\n if (element.waypoints || !element.parent) {\n return;\n }\n\n dragging.activate(event, 'shape.move', {\n cursor: 'grabbing',\n autoActivate: activate,\n data: {\n shape: element,\n context: {}\n }\n });\n }\n\n // API\n\n this.start = start;\n}\n\nMoveEvents.$inject = [ 'eventBus', 'dragging', 'modeling', 'selection', 'rules' ];\n\nmodule.exports = MoveEvents;\n","'use strict';\n\nvar flatten = require(196),\n forEach = require(204),\n filter = require(202),\n find = require(203),\n map = require(207);\n\nvar Elements = require(177);\n\nvar LOW_PRIORITY = 500;\n\nvar MARKER_DRAGGING = 'djs-dragging',\n MARKER_OK = 'drop-ok',\n MARKER_NOT_OK = 'drop-not-ok';\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Canvas} canvas\n * @param {Styles} styles\n */\nfunction MoveVisuals(eventBus, elementRegistry, canvas, styles) {\n\n function getGfx(e) {\n return elementRegistry.getGraphics(e);\n }\n\n function getVisualDragShapes(shapes) {\n\n var elements = Elements.selfAndDirectChildren(shapes, true);\n var filteredElements = removeEdges(elements);\n\n return filteredElements;\n }\n\n function getAllDraggedElements(shapes) {\n var allShapes = Elements.selfAndAllChildren(shapes, true);\n\n var allConnections = map(allShapes, function(shape) {\n return (shape.incoming || []).concat(shape.outgoing || []);\n });\n\n return flatten(allShapes.concat(allConnections), true);\n }\n\n function addDragger(shape, dragGroup) {\n var gfx = getGfx(shape);\n var dragger = gfx.clone();\n var bbox = gfx.getBBox();\n\n dragger.attr(styles.cls('djs-dragger', [], {\n x: bbox.x,\n y: bbox.y\n }));\n\n dragGroup.add(dragger);\n }\n\n // assign a low priority to this handler\n // to let others modify the move context before\n // we draw things\n //\n eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {\n\n var context = event.context,\n dragShapes = context.shapes;\n\n var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n var visuallyDraggedShapes = getVisualDragShapes(dragShapes);\n\n visuallyDraggedShapes.forEach(function(shape) {\n addDragger(shape, dragGroup);\n });\n\n\n // cache all dragged elements / gfx\n // so that we can quickly undo their state changes later\n var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);\n\n // add dragging marker\n forEach(allDraggedElements, function(e) {\n canvas.addMarker(e, MARKER_DRAGGING);\n });\n\n context.dragGroup = dragGroup;\n });\n\n // assign a low priority to this handler\n // to let others modify the move context before\n // we draw things\n //\n eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {\n\n var context = event.context,\n dragGroup = context.dragGroup,\n target = context.target;\n\n if (target) {\n canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n }\n\n dragGroup.translate(event.dx, event.dy);\n });\n\n eventBus.on([ 'shape.move.out', 'shape.move.cleanup' ], function(event) {\n var context = event.context;\n\n if (context.target) {\n canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n }\n });\n\n eventBus.on('shape.move.cleanup', function(event) {\n\n var context = event.context,\n allDraggedElements = context.allDraggedElements,\n dragGroup = context.dragGroup;\n\n\n // remove dragging marker\n forEach(allDraggedElements, function(e) {\n canvas.removeMarker(e, MARKER_DRAGGING);\n });\n\n if (dragGroup) {\n dragGroup.remove();\n }\n });\n}\n\n// returns elements minus all connections\n// where source or target is not elements\nfunction removeEdges(elements) {\n\n var filteredElements = filter(elements, function(element) {\n\n if (!element.waypoints) { // shapes\n return true;\n } else { // connections\n var srcFound = find(elements, element.source);\n var targetFound = find(elements, element.target);\n\n return srcFound && targetFound;\n }\n });\n\n return filteredElements;\n}\n\nMoveVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];\n\nmodule.exports = MoveVisuals;\n","module.exports = {\n __depends__: [\n require(103),\n require(151),\n require(133),\n require(147),\n require(101)\n ],\n __init__: [ 'move', 'moveVisuals' ],\n move: [ 'type', require(129) ],\n moveVisuals: [ 'type', require(130) ]\n};\n","'use strict';\n\nvar Snap = require(188);\nvar getBBox = require(177).getBBox;\n\n\n/**\n * @class\n *\n * A plugin that adds an outline to shapes and connections that may be activated and styled\n * via CSS classes.\n *\n * @param {EventBus} events the event bus\n */\nfunction Outline(eventBus, styles, elementRegistry) {\n\n var OUTLINE_OFFSET = 6;\n\n var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);\n\n function createOutline(gfx, bounds) {\n return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);\n }\n\n function updateShapeOutline(outline, bounds) {\n\n outline.attr({\n x: -OUTLINE_OFFSET,\n y: -OUTLINE_OFFSET,\n width: bounds.width + OUTLINE_OFFSET * 2,\n height: bounds.height + OUTLINE_OFFSET * 2\n });\n }\n\n function updateConnectionOutline(outline, connection) {\n\n var bbox = getBBox(connection);\n\n outline.attr({\n x: bbox.x - OUTLINE_OFFSET,\n y: bbox.y - OUTLINE_OFFSET,\n width: bbox.width + OUTLINE_OFFSET * 2,\n height: bbox.height + OUTLINE_OFFSET * 2\n });\n }\n\n eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateShapeOutline(outline, element);\n });\n\n eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateConnectionOutline(outline, element);\n });\n\n\n}\n\n\nOutline.$inject = ['eventBus', 'styles', 'elementRegistry'];\n\nmodule.exports = Outline;\n","'use strict';\n\nmodule.exports = {\n __init__: [ 'outline' ],\n outline: [ 'type', require(132) ]\n};","'use strict';\n\nvar isArray = require(316),\n isString = require(322),\n isObject = require(320),\n assign = require(325),\n forEach = require(204),\n filter = require(202),\n debounce = require(214);\n\nvar domify = require(343),\n domClasses = require(339),\n domRemove = require(347);\n\nvar getBBox = require(177).getBBox;\n\n// document wide unique overlay ids\nvar ids = new (require(181))('ov');\n\n\nfunction createRoot(parent) {\n var root = domify('<div class=\"djs-overlay-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n parent.insertBefore(root, parent.firstChild);\n\n return root;\n}\n\n\nfunction setPosition(el, x, y) {\n assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n el.style.display = visible === false ? 'none' : '';\n}\n\n/**\n * A service that allows users to attach overlays to diagram elements.\n *\n * The overlay service will take care of overlay positioning during updates.\n *\n * @example\n *\n * // add a pink badge on the top left of the shape\n * overlays.add(someShape, {\n * position: {\n * top: -5,\n * left: -5\n * },\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add via shape id\n *\n * overlays.add('some-element-id', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add with optional type\n *\n * overlays.add(someShape, 'badge', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n *\n * // remove an overlay\n *\n * var id = overlays.add(...);\n * overlays.remove(id);\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nfunction Overlays(config, eventBus, canvas, elementRegistry) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._elementRegistry = elementRegistry;\n\n this._ids = ids;\n\n this._overlayDefaults = {\n show: {\n minZoom: 0.7,\n maxZoom: 5.0\n }\n };\n\n /**\n * Mapping overlayId -> overlay\n */\n this._overlays = {};\n\n /**\n * Mapping elementId -> overlay container\n */\n this._overlayContainers = {};\n\n // root html element for all overlays\n this._overlayRoot = createRoot(canvas.getContainer());\n\n this._init(config);\n}\n\n\nOverlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];\n\nmodule.exports = Overlays;\n\n\n/**\n * Returns the overlay with the specified id or a list of overlays\n * for an element with a given type.\n *\n * @example\n *\n * // return the single overlay with the given id\n * overlays.get('some-id');\n *\n * // return all overlays for the shape\n * overlays.get({ element: someShape });\n *\n * // return all overlays on shape with type 'badge'\n * overlays.get({ element: someShape, type: 'badge' });\n *\n * // shape can also be specified as id\n * overlays.get({ element: 'element-id', type: 'badge' });\n *\n *\n * @param {Object} search\n * @param {String} [search.id]\n * @param {String|djs.model.Base} [search.element]\n * @param {String} [search.type]\n *\n * @return {Object|Array<Object>} the overlay(s)\n */\nOverlays.prototype.get = function(search) {\n\n if (isString(search)) {\n search = { id: search };\n }\n\n if (search.element) {\n var container = this._getOverlayContainer(search.element, true);\n\n // return a list of overlays when searching by element (+type)\n if (container) {\n return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();\n } else {\n return [];\n }\n } else\n if (search.type) {\n return filter(this._overlays, { type: search.type });\n } else {\n // return single element when searching by id\n return search.id ? this._overlays[search.id] : null;\n }\n};\n\n/**\n * Adds a HTML overlay to an element.\n *\n * @param {String|djs.model.Base} element attach overlay to this shape\n * @param {String} [type] optional type to assign to the overlay\n * @param {Object} overlay the overlay configuration\n *\n * @param {String|DOMElement} overlay.html html element to use as an overlay\n * @param {Object} [overlay.show] show configuration\n * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay\n * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay\n * @param {Object} overlay.position where to attach the overlay\n * @param {Number} [overlay.position.left] relative to element bbox left attachment\n * @param {Number} [overlay.position.top] relative to element bbox top attachment\n * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment\n * @param {Number} [overlay.position.right] relative to element bbox right attachment\n *\n * @return {String} id that may be used to reference the overlay for update or removal\n */\nOverlays.prototype.add = function(element, type, overlay) {\n\n if (isObject(type)) {\n overlay = type;\n type = null;\n }\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n if (!overlay.position) {\n throw new Error('must specifiy overlay position');\n }\n\n if (!overlay.html) {\n throw new Error('must specifiy overlay html');\n }\n\n if (!element) {\n throw new Error('invalid element specified');\n }\n\n var id = this._ids.next();\n\n overlay = assign({}, this._overlayDefaults, overlay, {\n id: id,\n type: type,\n element: element,\n html: overlay.html\n });\n\n this._addOverlay(overlay);\n\n return id;\n};\n\n\n/**\n * Remove an overlay with the given id or all overlays matching the given filter.\n *\n * @see Overlays#get for filter options.\n *\n * @param {String} [id]\n * @param {Object} [filter]\n */\nOverlays.prototype.remove = function(filter) {\n\n var overlays = this.get(filter) || [];\n\n if (!isArray(overlays)) {\n overlays = [ overlays ];\n }\n\n var self = this;\n\n forEach(overlays, function(overlay) {\n\n var container = self._getOverlayContainer(overlay.element, true);\n\n if (overlay) {\n domRemove(overlay.html);\n domRemove(overlay.htmlContainer);\n\n delete overlay.htmlContainer;\n delete overlay.element;\n\n delete self._overlays[overlay.id];\n }\n\n if (container) {\n var idx = container.overlays.indexOf(overlay);\n if (idx !== -1) {\n container.overlays.splice(idx, 1);\n }\n }\n });\n\n};\n\n\nOverlays.prototype.show = function() {\n setVisible(this._overlayRoot);\n};\n\n\nOverlays.prototype.hide = function() {\n setVisible(this._overlayRoot, false);\n};\n\n\nOverlays.prototype._updateOverlayContainer = function(container) {\n var element = container.element,\n html = container.html;\n\n // update container left,top according to the elements x,y coordinates\n // this ensures we can attach child elements relative to this container\n\n var x = element.x,\n y = element.y;\n\n if (element.waypoints) {\n var bbox = getBBox(element);\n x = bbox.x;\n y = bbox.y;\n }\n\n setPosition(html, x, y);\n};\n\n\nOverlays.prototype._updateOverlay = function(overlay) {\n\n var position = overlay.position,\n htmlContainer = overlay.htmlContainer,\n element = overlay.element;\n\n // update overlay html relative to shape because\n // it is already positioned on the element\n\n // update relative\n var left = position.left,\n top = position.top;\n\n if (position.right !== undefined) {\n\n var width;\n\n if (element.waypoints) {\n width = getBBox(element).width;\n } else {\n width = element.width;\n }\n\n left = position.right * -1 + width;\n }\n\n if (position.bottom !== undefined) {\n\n var height;\n\n if (element.waypoints) {\n height = getBBox(element).height;\n } else {\n height = element.height;\n }\n\n top = position.bottom * -1 + height;\n }\n\n setPosition(htmlContainer, left || 0, top || 0);\n};\n\n\nOverlays.prototype._createOverlayContainer = function(element) {\n var html = domify('<div class=\"djs-overlays djs-overlays-' + element.id + '\" style=\"position: absolute\" />');\n\n this._overlayRoot.appendChild(html);\n\n var container = {\n html: html,\n element: element,\n overlays: []\n };\n\n this._updateOverlayContainer(container);\n\n return container;\n};\n\n\nOverlays.prototype._updateRoot = function(viewbox) {\n var a = viewbox.scale || 1;\n var d = viewbox.scale || 1;\n\n var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n this._overlayRoot.style.transform = matrix;\n this._overlayRoot.style['-ms-transform'] = matrix;\n};\n\n\nOverlays.prototype._getOverlayContainer = function(element, raw) {\n var id = (element && element.id) || element;\n\n var container = this._overlayContainers[id];\n if (!container && !raw) {\n container = this._overlayContainers[id] = this._createOverlayContainer(element);\n }\n\n return container;\n};\n\n\nOverlays.prototype._addOverlay = function(overlay) {\n\n var id = overlay.id,\n element = overlay.element,\n html = overlay.html,\n htmlContainer,\n overlayContainer;\n\n // unwrap jquery (for those who need it)\n if (html.get) {\n html = html.get(0);\n }\n\n // create proper html elements from\n // overlay HTML strings\n if (isString(html)) {\n html = domify(html);\n }\n\n overlayContainer = this._getOverlayContainer(element);\n\n htmlContainer = domify('<div class=\"djs-overlay\" data-overlay-id=\"' + id + '\" style=\"position: absolute\">');\n\n htmlContainer.appendChild(html);\n\n if (overlay.type) {\n domClasses(htmlContainer).add('djs-overlay-' + overlay.type);\n }\n\n overlay.htmlContainer = htmlContainer;\n\n overlayContainer.overlays.push(overlay);\n overlayContainer.html.appendChild(htmlContainer);\n\n this._overlays[id] = overlay;\n\n this._updateOverlay(overlay);\n};\n\nOverlays.prototype._updateOverlayVisibilty = function(viewbox) {\n\n forEach(this._overlays, function(overlay) {\n var show = overlay.show,\n htmlContainer = overlay.htmlContainer,\n visible = true;\n\n if (show) {\n if (show.minZoom > viewbox.scale ||\n show.maxZoom < viewbox.scale) {\n visible = false;\n }\n\n setVisible(htmlContainer, visible);\n }\n });\n};\n\nOverlays.prototype._init = function(config) {\n\n var eventBus = this._eventBus;\n\n var self = this;\n\n\n // scroll/zoom integration\n\n var updateViewbox = function(viewbox) {\n self._updateRoot(viewbox);\n self._updateOverlayVisibilty(viewbox);\n\n self.show();\n };\n\n if (!config || config.deferUpdate !== false) {\n updateViewbox = debounce(updateViewbox, 300);\n }\n\n eventBus.on('canvas.viewbox.changed', function(event) {\n self.hide();\n updateViewbox(event.viewbox);\n });\n\n\n // remove integration\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var overlays = self.get({ element: e.element });\n\n forEach(overlays, function(o) {\n self.remove(o.id);\n });\n });\n\n\n // move integration\n\n eventBus.on([\n 'element.changed'\n ], function(e) {\n var element = e.element;\n\n var container = self._getOverlayContainer(element, true);\n\n if (container) {\n forEach(container.overlays, function(overlay) {\n self._updateOverlay(overlay);\n });\n\n self._updateOverlayContainer(container);\n }\n });\n\n\n // marker integration, simply add them on the overlays as classes, too.\n\n eventBus.on('element.marker.update', function(e) {\n var container = self._getOverlayContainer(e.element, true);\n if (container) {\n domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);\n }\n });\n};\n","module.exports = {\n __init__: [ 'overlays' ],\n overlays: [ 'type', require(134) ]\n};","'use strict';\n\nvar isFunction = require(317),\n forEach = require(204);\n\nvar domify = require(343),\n domQuery = require(346),\n domAttr = require(338),\n domClear = require(340),\n domClasses = require(339),\n domMatches = require(345),\n domDelegate = require(342),\n domEvent = require(344);\n\n\nvar toggleSelector = '.djs-palette-toggle',\n entrySelector = '.entry',\n elementSelector = toggleSelector + ', ' + entrySelector;\n\n\n/**\n * A palette containing modeling elements.\n */\nfunction Palette(eventBus, canvas) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n this._providers = [];\n}\n\nPalette.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = Palette;\n\n\n/**\n * Register a provider with the palette\n *\n * @param {PaletteProvider} provider\n */\nPalette.prototype.registerProvider = function(provider) {\n this._providers.push(provider);\n\n if (!this._container) {\n this._init();\n }\n\n this._update();\n};\n\n\n/**\n * Returns the palette entries for a given element\n *\n * @return {Array<PaletteEntryDescriptor>} list of entries\n */\nPalette.prototype.getEntries = function() {\n\n var entries = {};\n\n // loop through all providers and their entries.\n // group entries by id so that overriding an entry is possible\n forEach(this._providers, function(provider) {\n var e = provider.getPaletteEntries();\n\n forEach(e, function(entry, id) {\n entries[id] = entry;\n });\n });\n\n return entries;\n};\n\n\n/**\n * Initialize\n */\nPalette.prototype._init = function() {\n var parent = this._canvas.getContainer(),\n container = this._container = domify(Palette.HTML_MARKUP),\n self = this;\n\n parent.appendChild(container);\n\n domDelegate.bind(container, elementSelector, 'click', function(event) {\n\n var target = event.delegateTarget;\n\n if (domMatches(target, toggleSelector)) {\n return self.toggle();\n }\n\n self.trigger('click', event);\n });\n\n // prevent drag propagation\n domEvent.bind(container, 'mousedown', function(event) {\n event.stopPropagation();\n });\n\n // prevent drag propagation\n domDelegate.bind(container, entrySelector, 'dragstart', function(event) {\n self.trigger('dragstart', event);\n });\n\n this._eventBus.fire('palette.create', {\n html: container\n });\n};\n\n\nPalette.prototype._update = function() {\n\n var entriesContainer = domQuery('.djs-palette-entries', this._container),\n entries = this._entries = this.getEntries();\n\n domClear(entriesContainer);\n\n forEach(entries, function(entry, id) {\n\n var grouping = entry.group || 'default';\n\n var container = domQuery('[data-group=' + grouping + ']', entriesContainer);\n if (!container) {\n container = domify('<div class=\"group\" data-group=\"' + grouping + '\"></div>');\n entriesContainer.appendChild(container);\n }\n\n var html = entry.html || (\n entry.separator ?\n '<hr class=\"separator\" />' :\n '<div class=\"entry\" draggable=\"true\"></div>');\n\n\n var control = domify(html);\n container.appendChild(control);\n\n if (!entry.separator) {\n domAttr(control, 'data-action', id);\n\n if (entry.title) {\n domAttr(control, 'title', entry.title);\n }\n\n if (entry.className) {\n domClasses(control).add(entry.className);\n }\n\n if (entry.imageUrl) {\n control.appendChild(domify('<img src=\"' + entry.imageUrl + '\">'));\n }\n }\n });\n\n // open after update\n this.open(true);\n};\n\n\n/**\n * Trigger an action available on the palette\n *\n * @param {String} action\n * @param {Event} event\n */\nPalette.prototype.trigger = function(action, event, autoActivate) {\n\n var entries = this._entries,\n entry,\n handler,\n originalEvent,\n button = event.delegateTarget || event.target;\n\n if (!button) {\n return event.preventDefault();\n }\n\n\n entry = entries[domAttr(button, 'data-action')];\n handler = entry.action;\n\n originalEvent = event.originalEvent || event;\n\n // simple action (via callback function)\n if (isFunction(handler)) {\n if (action === 'click') {\n return handler(originalEvent, autoActivate);\n }\n } else {\n if (handler[action]) {\n return handler[action](originalEvent, autoActivate);\n }\n }\n\n // silence other actions\n event.preventDefault();\n};\n\n\n/**\n * Close the palette\n */\nPalette.prototype.close = function() {\n domClasses(this._container).remove('open');\n};\n\n\n/**\n * Open the palette\n */\nPalette.prototype.open = function() {\n domClasses(this._container).add('open');\n};\n\n\nPalette.prototype.toggle = function(open) {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n};\n\n\n/**\n * Return true if the palette is opened.\n *\n * @example\n *\n * palette.open();\n *\n * if (palette.isOpen()) {\n * // yes, we are open\n * }\n *\n * @return {boolean} true if palette is opened\n */\nPalette.prototype.isOpen = function() {\n return this._container && domClasses(this._container).has('open');\n};\n\n\n/* markup definition */\n\nPalette.HTML_MARKUP =\n '<div class=\"djs-palette\">' +\n '<div class=\"djs-palette-entries\"></div>' +\n '<div class=\"djs-palette-toggle\"></div>' +\n '</div>';","module.exports = {\n __init__: [ 'palette' ],\n palette: [ 'type', require(136) ]\n};\n","'use strict';\n\nvar forEach = require(204),\n assign = require(325),\n domEvent = require(344),\n domify = require(343),\n domClasses = require(339),\n domAttr = require(338),\n domRemove = require(347);\n\n\nfunction PopupMenu(eventBus, canvas) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._instances = {};\n}\n\nPopupMenu.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = PopupMenu;\n\nPopupMenu.prototype.open = function(name, position, entries, options) {\n\n var outer = this,\n canvas = this._canvas,\n instances = outer._instances;\n\n // return existing instance\n if (instances[name]) {\n return instances[name];\n }\n\n var parent = canvas.getContainer();\n\n //------------------------\n function PopupMenuInstance() {\n\n var self = this;\n\n self._actions = {};\n self.name = name || 'popup-menu';\n\n var _options = {\n entryClassName: 'entry'\n };\n assign(_options, options);\n\n // Container setup\n var container = this._container = domify('<div class=\"djs-popup\">');\n\n assign(container.style, {\n position: 'absolute',\n left: position.x + 'px',\n top: position.y + 'px'\n });\n domClasses(container).add(name);\n\n // Add entries\n forEach(entries, function(entry) {\n\n var entryContainer = domify('<div>');\n domClasses(entryContainer).add(entry.className || _options.entryClassName);\n domClasses(entryContainer).add('djs-popup-entry');\n\n if (entry.style) {\n domAttr(entryContainer, 'style', entry.style);\n }\n\n if (entry.action) {\n domAttr(entryContainer, 'data-action', entry.action.name);\n self._actions[entry.action.name] = entry.action.handler;\n }\n\n var title = domify('<span>');\n title.textContent = entry.label;\n entryContainer.appendChild(title);\n\n container.appendChild(entryContainer);\n });\n\n // Event handler\n domEvent.bind(container, 'click', function(event) {\n self.trigger(event);\n });\n\n // apply canvas zoom level\n var zoom = canvas.zoom();\n\n container.style.transformOrigin = 'top left';\n container.style.transform = 'scale(' + zoom + ')';\n\n // Attach to DOM\n parent.appendChild(container);\n\n // Add Handler\n this.bindHandlers();\n }\n\n PopupMenuInstance.prototype.close = function() {\n this.unbindHandlers();\n domRemove(this._container);\n delete outer._instances[this.name];\n };\n\n PopupMenuInstance.prototype.bindHandlers = function() {\n\n var self = this,\n eventBus = outer._eventBus;\n\n this._closeHandler = function() {\n self.close();\n };\n\n eventBus.once('contextPad.close', this._closeHandler);\n eventBus.once('canvas.viewbox.changed', this._closeHandler);\n };\n\n PopupMenuInstance.prototype.unbindHandlers = function() {\n\n var eventBus = outer._eventBus;\n\n eventBus.off('contextPad.close', this._closeHandler);\n eventBus.off('canvas.viewbox.changed', this._closeHandler);\n };\n\n PopupMenuInstance.prototype.trigger = function(event) {\n\n var element = event.target,\n actionName = element.getAttribute('data-action') ||\n element.parentNode.getAttribute('data-action');\n\n var action = this._actions[actionName];\n\n\n if (action) {\n action();\n }\n\n // silence other actions\n event.preventDefault();\n };\n\n var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);\n\n return instance;\n};\n","'use strict';\n\nmodule.exports = {\n __init__: [ 'popupMenu' ],\n popupMenu: [ 'type', require(138) ]\n};\n","'use strict';\n\n\n/**\n * Service that allow replacing of elements.\n *\n *\n * @class\n * @constructor\n */\nfunction Replace(modeling) {\n\n this._modeling = modeling;\n}\n\nmodule.exports = Replace;\n\nReplace.$inject = [ 'modeling' ];\n\n/**\n * @param {Element} oldElement - Element to be replaced\n * @param {Object} newElementData - Containing information about the new Element, for example height, width, type.\n * @param {Object} options - Custom options that will be attached to the context. It can be used to inject data\n * that is needed in the command chain. For example it could be used in\n * eventbus.on('commandStack.shape.replace.postExecute') to change shape attributes after\n * shape creation.\n */\nReplace.prototype.replaceElement = function(oldElement, newElementData, options) {\n\n var modeling = this._modeling;\n\n var newElement = null;\n\n if (oldElement.waypoints) {\n // TODO\n // modeling.replaceConnection\n } else {\n // set center of element for modeling API\n // if no new width / height is given use old elements size\n newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;\n newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;\n\n newElement = modeling.replaceShape(oldElement, newElementData, options);\n }\n\n return newElement;\n};\n","'use strict';\n\nmodule.exports = {\n __init__: [ 'replace' ],\n replace: [ 'type', require(140) ]\n};\n","'use strict';\n\nvar forEach = require(204),\n filter = require(202),\n pick = require(330);\n\nvar ResizeUtil = require(143),\n domEvent = require(344),\n Elements = require(177);\n\nvar isPrimaryButton = require(182).isPrimaryButton;\n\nvar round = Math.round;\n\nvar Snap = require(188);\n\nvar HANDLE_OFFSET = -2,\n HANDLE_SIZE = 5,\n HANDLE_HIT_SIZE = 20;\n\nvar MARKER_RESIZING = 'djs-resizing',\n MARKER_RESIZE_NOT_OK = 'resize-not-ok',\n CLS_RESIZER = 'djs-resizer';\n\n\n/**\n * Implements resize on shapes by\n *\n * * adding resize handles,\n * * creating a visual during resize\n * * checking resize rules\n * * committing a change once finished\n *\n *\n * ## Customizing\n *\n * It's possible to customize the resizing behaviour by intercepting 'resize.start'\n * and providing the following parameters through the 'context':\n *\n * * minDimensions ({ width, height }) - Minimum shape dimensions\n * * childrenBoxPadding (number) - Gap between the minimum bounding box and the container\n *\n * f.ex:\n *\n * eventBus.on('resize.start', 1500, function(event) {\n * var context = event.context,\n *\n * context.minDimensions = { width: 140, height: 120 };\n * context.childrenBoxPadding = 30;\n * });\n */\n\nfunction Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {\n\n function canResize(context) {\n var ctx = pick(context, [ 'newBounds', 'shape', 'delta', 'direction' ]);\n return rules.allowed('shape.resize', ctx);\n }\n\n\n // resizing implementation //////////////////////////////////\n\n /**\n * A helper that realizes the resize visuals\n */\n var visuals = {\n create: function(context) {\n var container = canvas.getDefaultLayer(),\n shape = context.shape,\n frame;\n\n frame = context.frame = Snap.create('rect', {\n class: 'djs-resize-overlay',\n width: shape.width + 10,\n height: shape.height + 10,\n x: shape.x -5,\n y: shape.y -5\n });\n\n frame.appendTo(container);\n },\n\n update: function(context) {\n var frame = context.frame,\n bounds = context.newBounds;\n\n if (bounds.width > 5) {\n frame.attr({\n x: bounds.x,\n width: bounds.width\n });\n }\n\n if (bounds.height > 5) {\n frame.attr({\n y: bounds.y,\n height: bounds.height\n });\n }\n\n frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);\n },\n\n remove: function(context) {\n if (context.frame) {\n context.frame.remove();\n }\n }\n };\n\n function computeMinBoundaryBox(context) {\n\n var shape = context.shape,\n direction = context.direction,\n minDimensions = context.minDimensions || {},\n childrenBoxPadding = context.childrenBoxPadding || 20,\n children,\n minBoundaryBox;\n\n // grab all the shapes that are NOT labels or connections\n children = filter(shape.children, function(child) {\n // connections\n if (child.waypoints) {\n return false;\n }\n\n // labels\n if (child.type === 'label') {\n return false;\n }\n\n return true;\n });\n\n // compute a minimum bounding box\n // around the existing children\n if (children.length) {\n minBoundaryBox = Elements.getBBox(children);\n\n // add a gap between the minBoundaryBox and the resizable container\n minBoundaryBox.width += childrenBoxPadding * 2;\n minBoundaryBox.height += childrenBoxPadding * 2;\n minBoundaryBox.x -= childrenBoxPadding;\n minBoundaryBox.y -= childrenBoxPadding;\n } else {\n minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {\n width: minDimensions.width || 10,\n height: minDimensions.height || 10\n });\n }\n\n return minBoundaryBox;\n }\n\n eventBus.on('resize.start', function(event) {\n\n var context = event.context,\n shape = context.shape,\n minBoundaryBox = context.minBoundaryBox;\n\n if (minBoundaryBox === undefined) {\n context.minBoundaryBox = computeMinBoundaryBox(context);\n }\n\n // add resizable indicator\n canvas.addMarker(shape, MARKER_RESIZING);\n\n visuals.create(context);\n });\n\n eventBus.on('resize.move', function(event) {\n\n var context = event.context,\n shape = context.shape,\n direction = context.direction,\n minBoundaryBox = context.minBoundaryBox,\n delta;\n\n delta = {\n x: event.dx,\n y: event.dy\n };\n\n context.delta = delta;\n\n context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);\n\n if (minBoundaryBox) {\n context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);\n }\n\n // update + cache executable state\n context.canExecute = canResize(context);\n\n // update resize frame visuals\n visuals.update(context);\n });\n\n eventBus.on('resize.end', function(event) {\n var context = event.context,\n shape = context.shape;\n\n var newBounds = context.newBounds;\n\n\n // ensure we have actual pixel values for new bounds\n // (important when zoom level was > 1 during move)\n newBounds.x = round(newBounds.x);\n newBounds.y = round(newBounds.y);\n newBounds.width = round(newBounds.width);\n newBounds.height = round(newBounds.height);\n\n // perform the actual resize\n if (context.canExecute) {\n modeling.resizeShape(shape, context.newBounds);\n }\n });\n\n eventBus.on('resize.cleanup', function(event) {\n\n var context = event.context,\n shape = context.shape;\n\n // remove resizable indicator\n canvas.removeMarker(shape, MARKER_RESIZING);\n\n // remove frame + destroy context\n visuals.remove(context);\n });\n\n\n function activate(event, shape, direction) {\n\n dragging.activate(event, 'resize', {\n autoActivate: true,\n cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),\n data: {\n shape: shape,\n context: {\n direction: direction,\n shape: shape\n }\n }\n });\n }\n\n function makeDraggable(element, gfx, direction) {\n\n function listener(event) {\n // only trigger on left mouse button\n if (isPrimaryButton(event)) {\n activate(event, element, direction);\n }\n }\n\n domEvent.bind(gfx.node, 'mousedown', listener);\n domEvent.bind(gfx.node, 'touchstart', listener);\n }\n\n function __createResizer(gfx, x, y, rotation, direction) {\n\n var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);\n\n var origin = -HANDLE_SIZE + HANDLE_OFFSET;\n\n // Create four drag indicators on the outline\n group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');\n group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');\n\n var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);\n group.transform(matrix);\n\n return group;\n }\n\n function createResizer(element, gfx, direction) {\n\n var resizer;\n\n if (direction === 'nw') {\n resizer = __createResizer(gfx, 0, 0, 0, direction);\n } else if (direction === 'ne') {\n resizer = __createResizer(gfx, element.width, 0, 90, direction);\n } else if (direction === 'se') {\n resizer = __createResizer(gfx, element.width, element.height, 180, direction);\n } else {\n resizer = __createResizer(gfx, 0, element.height, 270, direction);\n }\n\n makeDraggable(element, resizer, direction);\n }\n\n // resize handles implementation ///////////////////////////////\n\n function addResize(shape) {\n\n if (!canResize({ shape: shape })) {\n return;\n }\n\n var gfx = elementRegistry.getGraphics(shape);\n\n createResizer(shape, gfx, 'nw');\n createResizer(shape, gfx, 'ne');\n createResizer(shape, gfx, 'se');\n createResizer(shape, gfx, 'sw');\n }\n\n function removeResize(shape) {\n\n var gfx = elementRegistry.getGraphics(shape);\n var resizers = gfx.selectAll('.' + CLS_RESIZER);\n\n forEach(resizers, function(resizer){\n resizer.remove();\n });\n }\n\n eventBus.on('selection.changed', function(e) {\n\n var oldSelection = e.oldSelection,\n newSelection = e.newSelection;\n\n // remove old selection markers\n forEach(oldSelection, removeResize);\n\n // add new selection markers ONLY if single selection\n if (newSelection.length === 1) {\n forEach(newSelection, addResize);\n }\n });\n\n eventBus.on('shape.changed', function(e) {\n var shape = e.element;\n\n removeResize(shape);\n\n if (selection.isSelected(shape)) {\n addResize(shape);\n }\n });\n\n\n // API\n\n this.activate = activate;\n}\n\nResize.$inject = [ 'eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging' ];\n\nmodule.exports = Resize;\n","'use strict';\n\n/**\n * Resize the given bounds by the specified delta from a given anchor point.\n *\n * @param {Bounds} bounds the bounding box that should be resized\n * @param {String} direction in which the element is resized (nw, ne, se, sw)\n * @param {Point} delta of the resize operation\n *\n * @return {Bounds} resized bounding box\n */\nmodule.exports.resizeBounds = function(bounds, direction, delta) {\n\n var dx = delta.x,\n dy = delta.y;\n\n switch (direction) {\n\n case 'nw':\n return {\n x: bounds.x + dx,\n y: bounds.y + dy,\n width: bounds.width - dx,\n height: bounds.height - dy\n };\n\n case 'sw':\n return {\n x: bounds.x + dx,\n y: bounds.y,\n width: bounds.width - dx,\n height: bounds.height + dy\n };\n\n case 'ne':\n return {\n x: bounds.x,\n y: bounds.y + dy,\n width: bounds.width + dx,\n height: bounds.height - dy\n };\n\n case 'se':\n return {\n x: bounds.x,\n y: bounds.y,\n width: bounds.width + dx,\n height: bounds.height + dy\n };\n\n default:\n throw new Error('unrecognized direction: ' + direction);\n }\n};\n\nmodule.exports.reattachPoint = function(bounds, newBounds, point) {\n\n var sx = bounds.width / newBounds.width,\n sy = bounds.height / newBounds.height;\n\n return {\n x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),\n y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)\n };\n};\n\n\nmodule.exports.ensureMinBounds = function(currentBounds, minBounds) {\n var topLeft = {\n x: Math.min(currentBounds.x, minBounds.x),\n y: Math.min(currentBounds.y, minBounds.y)\n };\n\n var bottomRight = {\n x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),\n y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)\n };\n\n return {\n x: topLeft.x,\n y: topLeft.y,\n width: bottomRight.x - topLeft.x,\n height: bottomRight.y - topLeft.y\n };\n};\n\n\nmodule.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {\n \n switch(direction) {\n case 'nw':\n return {\n x: currentBounds.x + currentBounds.width - minDimensions.width,\n y: currentBounds.y + currentBounds.height - minDimensions.height,\n width: minDimensions.width,\n height: minDimensions.height\n };\n case 'sw':\n return {\n x: currentBounds.x + currentBounds.width - minDimensions.width,\n y: currentBounds.y,\n width: minDimensions.width,\n height: minDimensions.height\n };\n case 'ne':\n return {\n x: currentBounds.x,\n y: currentBounds.y + currentBounds.height - minDimensions.height,\n width: minDimensions.width,\n height: minDimensions.height\n };\n case 'se':\n return {\n x: currentBounds.x,\n y: currentBounds.y,\n width: minDimensions.width,\n height: minDimensions.height\n };\n default:\n throw new Error('unrecognized direction: ' + direction);\n }\n};\n\n\n","module.exports = {\n __depends__: [\n require(128),\n require(147),\n require(101)\n ],\n __init__: [ 'resize' ],\n resize: [ 'type', require(142) ]\n};\n","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\n/**\n * A basic provider that may be extended to implement modeling rules.\n *\n * Extensions should implement the init method to actually add their custom\n * modeling checks. Checks may be added via the #addRule(action, fn) method.\n *\n * @param {EventBus} eventBus\n */\nfunction RuleProvider(eventBus) {\n CommandInterceptor.call(this, eventBus);\n\n this.init();\n}\n\nRuleProvider.$inject = [ 'eventBus' ];\n\ninherits(RuleProvider, CommandInterceptor);\n\nmodule.exports = RuleProvider;\n\n\n/**\n * Adds a modeling rule for the given action, implemented through a callback function.\n *\n * The function will receive the modeling specific action context to perform its check.\n * It must return false or null to disallow the action from happening.\n *\n * Returning <code>null</code> may encode simply ignoring the action.\n *\n * @example\n *\n * ResizableRules.prototype.init = function() {\n *\n * this.addRule('shape.resize', function(context) {\n *\n * var shape = context.shape;\n *\n * if (!context.newBounds) {\n * // check general resizability\n * if (!shape.resizable) {\n * return false;\n * }\n * } else {\n * // element must have minimum size of 10*10 points\n * return context.newBounds.width > 10 && context.newBounds.height > 10;\n * }\n * });\n * };\n *\n * @param {String|Array<String>} actions the identifier for the modeling action to check\n * @param {Function} fn the callback function that performs the actual check\n */\nRuleProvider.prototype.addRule = function(actions, fn) {\n\n var self = this;\n\n if (typeof actions === 'string') {\n actions = [ actions ];\n }\n\n actions.forEach(function(action) {\n\n self.canExecute(action, function(context, action, event) {\n return fn(context);\n }, true);\n });\n};","'use strict';\n\n/**\n * A service that provides rules for certain diagram actions.\n *\n * @param {CommandStack} commandStack\n */\nfunction Rules(commandStack) {\n this._commandStack = commandStack;\n}\n\nRules.$inject = [ 'commandStack' ];\n\nmodule.exports = Rules;\n\n\n/**\n * This method can be queried to ask whether certain modeling actions\n * are allowed or not.\n *\n * @param {String} action the action to be checked\n * @param {Object} [context] the context to check the action in\n *\n * @return {Boolean} returns true, false or null depending on whether the\n * operation is allowed, not allowed or should be ignored.\n */\nRules.prototype.allowed = function(action, context) {\n var allowed = this._commandStack.canExecute(action, context);\n\n // map undefined to true, i.e. no rules\n return allowed === undefined ? true : allowed;\n};","module.exports = {\n __depends__: [ require(77) ],\n __init__: [ 'rules' ],\n rules: [ 'type', require(146) ]\n};\n","'use strict';\n\nvar isArray = require(316),\n forEach = require(204);\n\n\n/**\n * A service that offers the current selection in a diagram.\n * Offers the api to control the selection, too.\n *\n * @class\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction Selection(eventBus) {\n\n this._eventBus = eventBus;\n\n this._selectedElements = [];\n\n var self = this;\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var element = e.element;\n self.deselect(element);\n });\n}\n\nSelection.$inject = [ 'eventBus' ];\n\nmodule.exports = Selection;\n\n\nSelection.prototype.deselect = function(element) {\n var selectedElements = this._selectedElements;\n\n var idx = selectedElements.indexOf(element);\n\n if (idx !== -1) {\n var oldSelection = selectedElements.slice();\n\n selectedElements.splice(idx, 1);\n\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n }\n};\n\n\nSelection.prototype.get = function() {\n return this._selectedElements;\n};\n\nSelection.prototype.isSelected = function(element) {\n return this._selectedElements.indexOf(element) !== -1;\n};\n\n\n/**\n * This method selects one or more elements on the diagram.\n *\n * By passing an additional add parameter you can decide whether or not the element(s)\n * should be added to the already existing selection or not.\n *\n * @method Selection#select\n *\n * @param {Object|Object[]} elements element or array of elements to be selected\n * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false\n */\nSelection.prototype.select = function(elements, add) {\n var selectedElements = this._selectedElements,\n oldSelection = selectedElements.slice();\n\n if (!isArray(elements)) {\n elements = elements ? [ elements ] : [];\n }\n\n // selection may be cleared by passing an empty array or null\n // to the method\n if (add) {\n forEach(elements, function(element) {\n if (selectedElements.indexOf(element) !== -1) {\n // already selected\n return;\n } else {\n selectedElements.push(element);\n }\n });\n } else {\n this._selectedElements = selectedElements = elements.slice();\n }\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n};\n","'use strict';\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\n\nfunction SelectionBehavior(eventBus, selection, canvas) {\n\n eventBus.on('create.end', 500, function(e) {\n if (e.context.canExecute) {\n selection.select(e.shape);\n }\n });\n\n eventBus.on('connect.end', 500, function(e) {\n if (e.context.canExecute && e.context.target) {\n selection.select(e.context.target);\n }\n });\n\n eventBus.on('shape.move.end', 500, function(e) {\n selection.select(e.context.shapes);\n });\n\n\n // Shift + click selection\n eventBus.on('element.click', function(event) {\n\n var element = event.element;\n\n // do not select the root element\n // or connections\n if (element === canvas.getRootElement()) {\n element = null;\n }\n\n var isSelected = selection.isSelected(element),\n isMultiSelect = selection.get().length > 1;\n\n // mouse-event: SELECTION_KEY\n var add = hasPrimaryModifier(event);\n\n // select OR deselect element in multi selection\n if (isSelected && isMultiSelect) {\n if (add) {\n return selection.deselect(element);\n } else {\n return selection.select(element);\n }\n } else\n if (!isSelected) {\n selection.select(element, add);\n } else {\n selection.deselect(element);\n }\n });\n}\n\nSelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];\n\nmodule.exports = SelectionBehavior;\n","'use strict';\n\nvar forEach = require(204);\n\nvar MARKER_HOVER = 'hover',\n MARKER_SELECTED = 'selected';\n\n\n/**\n * A plugin that adds a visible selection UI to shapes and connections\n * by appending the <code>hover</code> and <code>selected</code> classes to them.\n *\n * @class\n *\n * Makes elements selectable, too.\n *\n * @param {EventBus} events\n * @param {SelectionService} selection\n * @param {Canvas} canvas\n */\nfunction SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {\n\n this._multiSelectionBox = null;\n\n function addMarker(e, cls) {\n canvas.addMarker(e, cls);\n }\n\n function removeMarker(e, cls) {\n canvas.removeMarker(e, cls);\n }\n\n events.on('element.hover', function(event) {\n addMarker(event.element, MARKER_HOVER);\n });\n\n events.on('element.out', function(event) {\n removeMarker(event.element, MARKER_HOVER);\n });\n\n events.on('selection.changed', function(event) {\n\n function deselect(s) {\n removeMarker(s, MARKER_SELECTED);\n }\n\n function select(s) {\n addMarker(s, MARKER_SELECTED);\n }\n\n var oldSelection = event.oldSelection,\n newSelection = event.newSelection;\n\n forEach(oldSelection, function(e) {\n if (newSelection.indexOf(e) === -1) {\n deselect(e);\n }\n });\n\n forEach(newSelection, function(e) {\n if (oldSelection.indexOf(e) === -1) {\n select(e);\n }\n });\n });\n}\n\nSelectionVisuals.$inject = [\n 'eventBus',\n 'canvas',\n 'selection',\n 'graphicsFactory',\n 'styles'\n];\n\nmodule.exports = SelectionVisuals;\n","module.exports = {\n __init__: [ 'selectionVisuals', 'selectionBehavior' ],\n __depends__: [\n require(103),\n require(133)\n ],\n selection: [ 'type', require(148) ],\n selectionVisuals: [ 'type', require(150) ],\n selectionBehavior: [ 'type', require(149) ]\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar snapTo = require(153).snapTo;\n\n\n/**\n * A snap context, containing the (possibly incomplete)\n * mappings of drop targets (to identify the snapping)\n * to computed snap points.\n */\nfunction SnapContext() {\n\n /**\n * Map<String, SnapPoints> mapping drop targets to\n * a list of possible snappings.\n *\n * @type {Object}\n */\n this._targets = {};\n\n /**\n * Map<String, Point> initial positioning of element\n * regarding various snap directions.\n *\n * @type {Object}\n */\n this._snapOrigins = {};\n\n /**\n * List of snap locations\n *\n * @type {Array<String>}\n */\n this._snapLocations = [];\n\n /**\n * Map<String, Array<Point>> of default snapping locations\n *\n * @type {Object}\n */\n this._defaultSnaps = {};\n}\n\n\nSnapContext.prototype.getSnapOrigin = function(snapLocation) {\n return this._snapOrigins[snapLocation];\n};\n\n\nSnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {\n this._snapOrigins[snapLocation] = initialValue;\n\n if (this._snapLocations.indexOf(snapLocation) === -1) {\n this._snapLocations.push(snapLocation);\n }\n};\n\n\nSnapContext.prototype.addDefaultSnap = function(type, point) {\n\n var snapValues = this._defaultSnaps[type];\n\n if (!snapValues) {\n snapValues = this._defaultSnaps[type] = [];\n }\n\n snapValues.push(point);\n};\n\n/**\n * Return a number of initialized snaps, i.e. snap locations such as\n * top-left, mid, bottom-right and so forth.\n *\n * @return {Array<String>} snapLocations\n */\nSnapContext.prototype.getSnapLocations = function() {\n return this._snapLocations;\n};\n\n/**\n * Set the snap locations for this context.\n *\n * The order of locations determines precedence.\n *\n * @param {Array<String>} snapLocations\n */\nSnapContext.prototype.setSnapLocations = function(snapLocations) {\n this._snapLocations = snapLocations;\n};\n\n/**\n * Get snap points for a given target\n *\n * @param {Element|String} target\n */\nSnapContext.prototype.pointsForTarget = function(target) {\n\n var targetId = target.id || target;\n\n var snapPoints = this._targets[targetId];\n\n if (!snapPoints) {\n snapPoints = this._targets[targetId] = new SnapPoints();\n snapPoints.initDefaults(this._defaultSnaps);\n }\n\n return snapPoints;\n};\n\nmodule.exports = SnapContext;\n\n\n/**\n * Creates the snap points and initializes them with the\n * given default values.\n *\n * @param {Object<String, Array<Point>>} [defaultPoints]\n */\nfunction SnapPoints(defaultSnaps) {\n\n /**\n * Map<String, Map<(x|y), Array<Number>>> mapping snap locations,\n * i.e. top-left, bottom-right, center to actual snap values.\n *\n * @type {Object}\n */\n this._snapValues = {};\n}\n\nSnapPoints.prototype.add = function(snapLocation, point) {\n\n var snapValues = this._snapValues[snapLocation];\n\n if (!snapValues) {\n snapValues = this._snapValues[snapLocation] = { x: [], y: [] };\n }\n\n if (snapValues.x.indexOf(point.x) === -1) {\n snapValues.x.push(point.x);\n }\n\n if (snapValues.y.indexOf(point.y) === -1) {\n snapValues.y.push(point.y);\n }\n};\n\n\nSnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {\n var snappingValues = this._snapValues[snapLocation];\n \n return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);\n};\n\n/**\n * Initialize a number of default snapping points.\n *\n * @param {Object} defaultSnaps\n */\nSnapPoints.prototype.initDefaults = function(defaultSnaps) {\n\n var self = this;\n\n forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {\n forEach(snapPoints, function(point) {\n self.add(snapLocation, point);\n });\n });\n};","'use strict';\n\nvar abs = Math.abs,\n round = Math.round;\n\n\n/**\n * Snap value to a collection of reference values.\n *\n * @param {Number} value\n * @param {Array<Number>} values\n * @param {Number} [tolerance=10]\n *\n * @return {Number} the value we snapped to or null, if none snapped\n */\nfunction snapTo(value, values, tolerance) {\n tolerance = tolerance === undefined ? 10 : tolerance;\n\n var idx, snapValue;\n\n for (idx = 0; idx < values.length; idx++) {\n snapValue = values[idx];\n\n if (abs(snapValue - value) <= tolerance) {\n return snapValue;\n }\n }\n}\n\n\nmodule.exports.snapTo = snapTo;\n\n\nfunction topLeft(bounds) {\n return {\n x: bounds.x,\n y: bounds.y\n };\n}\n\nmodule.exports.topLeft = topLeft;\n\n\nfunction mid(bounds, defaultValue) {\n\n if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {\n return defaultValue;\n }\n\n return {\n x: round(bounds.x + bounds.width / 2),\n y: round(bounds.y + bounds.height / 2)\n };\n}\n\nmodule.exports.mid = mid;\n\n\nfunction bottomRight(bounds) {\n return {\n x: bounds.x + bounds.width,\n y: bounds.y + bounds.height\n };\n}\n\nmodule.exports.bottomRight = bottomRight;","'use strict';\n\nvar filter = require(202),\n forEach = require(204),\n debounce = require(214);\n\n\nvar mid = require(153).mid;\n\nvar SnapContext = require(152);\n\n/**\n * A general purpose snapping component for diagram elements.\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction Snapping(eventBus, canvas) {\n\n this._canvas = canvas;\n\n var self = this;\n\n eventBus.on([ 'shape.move.start', 'create.start' ], function(event) {\n self.initSnap(event);\n });\n\n eventBus.on([ 'shape.move.move', 'shape.move.end', 'create.move', 'create.end' ], function(event) {\n if (event.snapped) {\n return;\n }\n\n self.snap(event);\n });\n\n eventBus.on([ 'shape.move.cleanup', 'create.cleanup' ], function(event) {\n self.hide();\n });\n\n // delay hide by 1000 seconds since last match\n this._asyncHide = debounce(this.hide, 1000);\n}\n\nSnapping.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = Snapping;\n\n\nSnapping.prototype.initSnap = function(event) {\n\n var context = event.context,\n shape = context.shape,\n snapContext = context.snapContext;\n\n if (!snapContext) {\n snapContext = context.snapContext = new SnapContext();\n }\n\n var snapMid = mid(shape, event);\n\n snapContext.setSnapOrigin('mid', {\n x: snapMid.x - event.x,\n y: snapMid.y - event.y\n });\n\n return snapContext;\n};\n\n\nSnapping.prototype.snap = function(event) {\n\n var context = event.context,\n snapContext = context.snapContext,\n shape = context.shape,\n target = context.target,\n snapLocations = snapContext.getSnapLocations();\n\n if (!target) {\n return;\n }\n\n var snapPoints = snapContext.pointsForTarget(target);\n\n if (!snapPoints.initialized) {\n this.addTargetSnaps(snapPoints, shape, target);\n\n snapPoints.initialized = true;\n }\n\n\n var snapping = {};\n\n forEach(snapLocations, function(location) {\n\n var snapOrigin = snapContext.getSnapOrigin(location);\n\n var snapCurrent = {\n x: event.x + snapOrigin.x,\n y: event.y + snapOrigin.y\n };\n\n // snap on both axis, if not snapped already\n forEach([ 'x', 'y' ], function(axis) {\n var locationSnapping;\n\n if (!snapping[axis]) {\n locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);\n \n if (locationSnapping !== undefined) {\n snapping[axis] = {\n value: locationSnapping,\n originValue: locationSnapping - snapOrigin[axis]\n };\n }\n }\n });\n \n // no more need to snap, drop out of interation\n if (snapping.x && snapping.y) {\n return false;\n }\n });\n\n\n // show snap visuals\n\n this.showSnapLine('vertical', snapping.x && snapping.x.value);\n this.showSnapLine('horizontal', snapping.y && snapping.y.value);\n\n\n // adjust event { x, y, dx, dy } and mark as snapping\n var cx, cy;\n\n if (snapping.x) {\n\n cx = event.x - snapping.x.originValue;\n\n event.x = snapping.x.originValue;\n event.dx = event.dx - cx;\n\n event.snapped = true;\n }\n\n if (snapping.y) {\n cy = event.y - snapping.y.originValue;\n\n event.y = snapping.y.originValue;\n event.dy = event.dy - cy;\n\n event.snapped = true;\n }\n};\n\n\nSnapping.prototype._createLine = function(orientation) {\n\n var root = this._canvas.getLayer('snap');\n\n var line = root.path('M0,0 L0,0').addClass('djs-snap-line');\n\n return {\n update: function(position) {\n\n if (position === undefined) {\n line.attr({ display: 'none' });\n } else {\n if (orientation === 'horizontal') {\n line.attr({\n path: 'M-100000,' + position + ' L+100000,' + position,\n display: ''\n });\n } else {\n line.attr({\n path: 'M ' + position + ',-100000 L ' + position + ', +100000',\n display: ''\n });\n }\n }\n }\n };\n};\n\n\nSnapping.prototype._createSnapLines = function() {\n\n this._snapLines = {\n horizontal: this._createLine('horizontal'),\n vertical: this._createLine('vertical')\n };\n};\n\nSnapping.prototype.showSnapLine = function(orientation, position) {\n\n var line = this.getSnapLine(orientation);\n\n if (line) {\n line.update(position);\n }\n\n this._asyncHide();\n};\n\nSnapping.prototype.getSnapLine = function(orientation) {\n if (!this._snapLines) {\n this._createSnapLines();\n }\n\n return this._snapLines[orientation];\n};\n\nSnapping.prototype.hide = function() {\n forEach(this._snapLines, function(l) {\n l.update();\n });\n};\n\nSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {\n\n var siblings = this.getSiblings(shape, target);\n\n forEach(siblings, function(s) {\n snapPoints.add('mid', mid(s));\n });\n\n};\n\nSnapping.prototype.getSiblings = function(element, target) {\n\n // snap to all non connection siblings\n return target && filter(target.children, function(e) {\n return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;\n });\n};","'use strict';\n\nvar SpaceUtil = require(157);\n\nvar Cursor = require(176);\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\nvar abs = Math.abs,\n round = Math.round;\n\nvar HIGH_PRIORITY = 1500;\n\n/**\n * A tool that allows users to create and remove space in a diagram.\n *\n * The tool needs to be activated manually via {@link SpaceTool#activate(MouseEvent)}.\n */\nfunction SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {\n\n function canResize(shape) {\n var ctx = { shape: shape };\n return rules.allowed('shape.resize', ctx);\n }\n\n function activateSelection(event, autoActivate) {\n dragging.activate(event, 'spaceTool.selection', {\n cursor: 'crosshair',\n autoActivate: autoActivate,\n data: {\n context: {\n crosshair: {}\n }\n }\n });\n }\n\n function activateMakeSpace(event) {\n dragging.activate(event, 'spaceTool', {\n autoActivate: true,\n cursor: 'crosshair',\n data: {\n context: {}\n }\n });\n }\n\n\n eventBus.on('spaceTool.selection.end', function(event) {\n setTimeout(function() {\n activateMakeSpace(event.originalEvent);\n });\n });\n\n\n var AXIS_TO_DIMENSION = { x: 'width', y: 'height' },\n AXIS_INVERTED = { x: 'y', y: 'x' };\n\n\n function initializeMakeSpace(event, context) {\n\n var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',\n offset = event['d' + axis],\n // start point of create space operation\n spacePos = event[axis] - offset,\n // list of moving shapes\n movingShapes = [],\n // list of resizing shapes\n resizingShapes = [];\n\n if (abs(offset) < 5) {\n return false;\n }\n\n // inverts the offset to choose the shapes\n // on the opposite side of the resizer if\n // a key modifier is pressed\n if (hasPrimaryModifier(event)) {\n offset *= -1;\n }\n\n // collect all elements that need to be moved _AND_\n // resized given on the initial create space position\n elementRegistry.forEach(function (shape) {\n var shapeStart = shape[ [ axis ]],\n shapeEnd = shapeStart + shape[ AXIS_TO_DIMENSION[ axis ]];\n\n // checking if it's root\n if (!shape.parent) {\n return;\n }\n\n // checking if it's a shape\n if (shape.waypoints) {\n return;\n }\n\n // shape after spacePos\n if (offset > 0 && shapeStart > spacePos) {\n return movingShapes.push(shape);\n }\n\n // shape before spacePos\n if (offset < 0 && shapeEnd < spacePos) {\n return movingShapes.push(shape);\n }\n\n // shape on top of spacePos, resize only if allowed\n if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {\n return resizingShapes.push(shape);\n }\n });\n\n // store data in context\n context.axis = axis;\n context.direction = SpaceUtil.getDirection(axis, offset);\n context.movingShapes = movingShapes;\n context.resizingShapes = resizingShapes;\n\n Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));\n\n return true;\n }\n\n\n eventBus.on('spaceTool.move', HIGH_PRIORITY , function(event) {\n\n var context = event.context;\n\n if (!context.initialized) {\n context.initialized = initializeMakeSpace(event, context);\n }\n });\n\n\n eventBus.on('spaceTool.end', function(event) {\n\n var context = event.context,\n axis = context.axis,\n direction = context.direction,\n movingShapes = context.movingShapes,\n resizingShapes = context.resizingShapes;\n\n // skip if create space has not been initialized yet\n if (!context.initialized) {\n return;\n }\n\n var delta = { x: round(event.dx), y: round(event.dy) };\n delta[ AXIS_INVERTED[ axis ] ] = 0;\n\n return modeling.createSpace(movingShapes, resizingShapes, delta, direction);\n });\n\n // API\n this.activateSelection = activateSelection;\n this.activateMakeSpace = activateMakeSpace;\n}\n\nSpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];\n\nmodule.exports = SpaceTool;\n","'use strict';\n\nvar forEach = require(204);\n\n\nvar MARKER_DRAGGING = 'djs-dragging';\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Canvas} canvas\n * @param {Styles} styles\n */\n\nfunction SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {\n\n function getGfx(e) {\n return elementRegistry.getGraphics(e);\n }\n\n function addDragger(shape, dragGroup) {\n var gfx = getGfx(shape);\n var dragger = gfx.clone();\n var bbox = gfx.getBBox();\n\n dragger.attr(styles.cls('djs-dragger', [], {\n x: bbox.x,\n y: bbox.y\n }));\n\n dragGroup.add(dragger);\n }\n\n eventBus.on('spaceTool.selection.start', function(event) {\n var space = canvas.getLayer('space'),\n context = event.context;\n\n var orientation = {\n x: 'M 0,-10000 L 0,10000',\n y: 'M -10000,0 L 10000,0'\n };\n\n var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', [ 'no-events' ]));\n\n crosshairGroup.path(orientation.x).addClass('djs-crosshair');\n crosshairGroup.path(orientation.y).addClass('djs-crosshair');\n\n context.crosshairGroup = crosshairGroup;\n });\n\n eventBus.on('spaceTool.selection.move', function(event) {\n var crosshairGroup = event.context.crosshairGroup;\n\n crosshairGroup.translate(event.x, event.y);\n });\n\n eventBus.on('spaceTool.selection.cleanup', function(event) {\n var context = event.context,\n crosshairGroup = context.crosshairGroup;\n\n if (crosshairGroup) {\n crosshairGroup.remove();\n }\n });\n\n\n // assign a low priority to this handler\n // to let others modify the move context before\n // we draw things\n eventBus.on('spaceTool.move', function(event) {\n /*\n TODO (Ricardo): extend connections while adding space\n */\n\n var context = event.context,\n line = context.line,\n axis = context.axis,\n dragShapes = context.movingShapes;\n\n if (!context.initialized) {\n return;\n }\n\n if (!context.dragGroup) {\n var spaceLayer = canvas.getLayer('space');\n line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');\n\n context.line = line;\n var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n\n forEach(dragShapes, function(shape) {\n addDragger(shape, dragGroup);\n canvas.addMarker(shape, MARKER_DRAGGING);\n });\n\n context.dragGroup = dragGroup;\n }\n\n var orientation = {\n x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',\n y: 'M -10000, ' + event.y + ' L 10000, ' + event.y\n };\n\n line.attr({\n path: orientation[ axis ],\n display: ''\n });\n\n var opposite = { x: 'y', y: 'x' };\n var delta = { x: event.dx, y: event.dy };\n delta[ opposite[ context.axis ] ] = 0;\n\n context.dragGroup.translate(delta.x, delta.y);\n });\n\n eventBus.on('spaceTool.cleanup', function(event) {\n\n var context = event.context,\n shapes = context.movingShapes,\n line = context.line,\n dragGroup = context.dragGroup;\n\n // remove dragging marker\n forEach(shapes, function(e) {\n canvas.removeMarker(e, MARKER_DRAGGING);\n });\n\n if (dragGroup) {\n line.remove();\n dragGroup.remove();\n }\n });\n}\n\nSpaceToolVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];\n\nmodule.exports = SpaceToolVisuals;\n","'use strict';\n\n/**\n * Get Resize direction given axis + offset\n *\n * @param {String} axis (x|y)\n * @param {Number} offset\n *\n * @return {String} (e|w|n|s)\n */\nfunction getDirection(axis, offset) {\n\n if (axis === 'x') {\n if (offset > 0) {\n return 'e';\n }\n\n if (offset < 0) {\n return 'w';\n }\n }\n\n if (axis === 'y') {\n if (offset > 0) {\n return 's';\n }\n\n if (offset < 0) {\n return 'n';\n }\n }\n\n return null;\n}\n\nmodule.exports.getDirection = getDirection;\n\n/**\n * Resize the given bounds by the specified delta from a given anchor point.\n *\n * @param {Bounds} bounds the bounding box that should be resized\n * @param {String} direction in which the element is resized (n, s, e, w)\n * @param {Point} delta of the resize operation\n *\n * @return {Bounds} resized bounding box\n */\nmodule.exports.resizeBounds = function(bounds, direction, delta) {\n\n var dx = delta.x,\n dy = delta.y;\n\n switch (direction) {\n\n case 'n':\n return {\n x: bounds.x,\n y: bounds.y + dy,\n width: bounds.width,\n height: bounds.height - dy\n };\n\n case 's':\n return {\n x: bounds.x,\n y: bounds.y,\n width: bounds.width,\n height: bounds.height + dy\n };\n\n case 'w':\n return {\n x: bounds.x + dx,\n y: bounds.y,\n width: bounds.width - dx,\n height: bounds.height\n };\n\n case 'e':\n return {\n x: bounds.x,\n y: bounds.y,\n width: bounds.width + dx,\n height: bounds.height\n };\n\n default:\n throw new Error('unrecognized direction: ' + direction);\n }\n};","module.exports = {\n __init__: ['spaceToolVisuals'],\n __depends__: [require(101), require(128), require(147) ],\n spaceTool: ['type', require(155)],\n spaceToolVisuals: ['type', require(156) ]\n};\n","'use strict';\n\nvar isString = require(322),\n assign = require(325),\n forEach = require(204),\n debounce = require(214);\n\nvar domify = require(343),\n domAttr = require(338),\n domClasses = require(339),\n domRemove = require(347),\n domDelegate = require(342);\n\n\n// document wide unique tooltip ids\nvar ids = new (require(181))('tt');\n\n\nfunction createRoot(parent) {\n var root = domify('<div class=\"djs-tooltip-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n parent.insertBefore(root, parent.firstChild);\n\n return root;\n}\n\n\nfunction setPosition(el, x, y) {\n assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n el.style.display = visible === false ? 'none' : '';\n}\n\n\nvar tooltipClass = 'djs-tooltip',\n tooltipSelector = '.' + tooltipClass;\n\n/**\n * A service that allows users to render tool tips on the diagram.\n *\n * The tooltip service will take care of updating the tooltip positioning\n * during navigation + zooming.\n *\n * @example\n *\n * ```javascript\n *\n * // add a pink badge on the top left of the shape\n * tooltips.add({\n * position: {\n * x: 50,\n * y: 100\n * },\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or with optional life span\n * tooltips.add({\n * position: {\n * top: -5,\n * left: -5\n * },\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>',\n * ttl: 2000\n * });\n *\n * // remove a tool tip\n * var id = tooltips.add(...);\n * tooltips.remove(id);\n * ```\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction Tooltips(config, eventBus, canvas) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n this._ids = ids;\n\n this._tooltipDefaults = {\n show: {\n minZoom: 0.7,\n maxZoom: 5.0\n }\n };\n\n /**\n * Mapping tooltipId -> tooltip\n */\n this._tooltips = {};\n\n // root html element for all tooltips\n this._tooltipRoot = createRoot(canvas.getContainer());\n\n\n var self = this;\n\n domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {\n event.stopPropagation();\n });\n\n domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {\n self.trigger('mouseover', event);\n });\n\n domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {\n self.trigger('mouseout', event);\n });\n\n this._init(config);\n}\n\n\nTooltips.$inject = [ 'config.tooltips', 'eventBus', 'canvas' ];\n\nmodule.exports = Tooltips;\n\n\n/**\n * Adds a HTML tooltip to the diagram\n *\n * @param {Object} tooltip the tooltip configuration\n *\n * @param {String|DOMElement} tooltip.html html element to use as an tooltip\n * @param {Object} [tooltip.show] show configuration\n * @param {Number} [tooltip.show.minZoom] minimal zoom level to show the tooltip\n * @param {Number} [tooltip.show.maxZoom] maximum zoom level to show the tooltip\n * @param {Object} tooltip.position where to attach the tooltip\n * @param {Number} [tooltip.position.left] relative to element bbox left attachment\n * @param {Number} [tooltip.position.top] relative to element bbox top attachment\n * @param {Number} [tooltip.position.bottom] relative to element bbox bottom attachment\n * @param {Number} [tooltip.position.right] relative to element bbox right attachment\n * @param {Number} [tooltip.timeout=-1]\n *\n * @return {String} id that may be used to reference the tooltip for update or removal\n */\nTooltips.prototype.add = function(tooltip) {\n\n if (!tooltip.position) {\n throw new Error('must specifiy tooltip position');\n }\n\n if (!tooltip.html) {\n throw new Error('must specifiy tooltip html');\n }\n\n var id = this._ids.next();\n\n tooltip = assign({}, this._tooltipDefaults, tooltip, {\n id: id\n });\n\n this._addTooltip(tooltip);\n\n if (tooltip.timeout) {\n this.setTimeout(tooltip);\n }\n\n return id;\n};\n\nTooltips.prototype.trigger = function(action, event) {\n\n var node = event.delegateTarget || event.target;\n\n var tooltip = this.get(domAttr(node, 'data-tooltip-id'));\n\n if (!tooltip) {\n return;\n }\n\n if (action === 'mouseover' && tooltip.timeout) {\n this.clearTimeout(tooltip);\n }\n\n if (action === 'mouseout' && tooltip.timeout) {\n // cut timeout after mouse out\n tooltip.timeout = 1000;\n\n this.setTimeout(tooltip);\n }\n\n console.log('mouse leave', event);\n};\n\n/**\n * Get a tooltip with the given id\n *\n * @param {String} id\n */\nTooltips.prototype.get = function(id) {\n\n if (typeof id !== 'string') {\n id = id.id;\n }\n\n return this._tooltips[id];\n};\n\nTooltips.prototype.clearTimeout = function(tooltip) {\n\n tooltip = this.get(tooltip);\n\n if (!tooltip) {\n return;\n }\n\n var removeTimer = tooltip.removeTimer;\n\n if (removeTimer) {\n clearTimeout(removeTimer);\n tooltip.removeTimer = null;\n }\n};\n\nTooltips.prototype.setTimeout = function(tooltip) {\n\n tooltip = this.get(tooltip);\n\n if (!tooltip) {\n return;\n }\n\n this.clearTimeout(tooltip);\n\n var self = this;\n\n tooltip.removeTimer = setTimeout(function() {\n self.remove(tooltip);\n }, tooltip.timeout);\n};\n\n/**\n * Remove an tooltip with the given id\n *\n * @param {String} id\n */\nTooltips.prototype.remove = function(id) {\n\n var tooltip = this.get(id);\n\n if (tooltip) {\n domRemove(tooltip.html);\n domRemove(tooltip.htmlContainer);\n\n delete tooltip.htmlContainer;\n\n delete this._tooltips[tooltip.id];\n }\n};\n\n\nTooltips.prototype.show = function() {\n setVisible(this._tooltipRoot);\n};\n\n\nTooltips.prototype.hide = function() {\n setVisible(this._tooltipRoot, false);\n};\n\n\nTooltips.prototype._updateRoot = function(viewbox) {\n var a = viewbox.scale || 1;\n var d = viewbox.scale || 1;\n\n var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n this._tooltipRoot.style.transform = matrix;\n this._tooltipRoot.style['-ms-transform'] = matrix;\n};\n\n\nTooltips.prototype._addTooltip = function(tooltip) {\n\n var id = tooltip.id,\n html = tooltip.html,\n htmlContainer,\n tooltipRoot = this._tooltipRoot;\n\n // unwrap jquery (for those who need it)\n if (html.get) {\n html = html.get(0);\n }\n\n // create proper html elements from\n // tooltip HTML strings\n if (isString(html)) {\n html = domify(html);\n }\n\n htmlContainer = domify('<div data-tooltip-id=\"' + id + '\" class=\"' + tooltipClass + '\" style=\"position: absolute\">');\n\n htmlContainer.appendChild(html);\n\n if (tooltip.type) {\n domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);\n }\n\n if (tooltip.className) {\n domClasses(htmlContainer).add(tooltip.className);\n }\n\n tooltip.htmlContainer = htmlContainer;\n\n tooltipRoot.appendChild(htmlContainer);\n\n this._tooltips[id] = tooltip;\n\n this._updateTooltip(tooltip);\n};\n\n\nTooltips.prototype._updateTooltip = function(tooltip) {\n\n var position = tooltip.position,\n htmlContainer = tooltip.htmlContainer;\n\n // update overlay html based on tooltip x, y\n\n setPosition(htmlContainer, position.x, position.y);\n};\n\n\nTooltips.prototype._updateTooltipVisibilty = function(viewbox) {\n\n forEach(this._tooltips, function(tooltip) {\n var show = tooltip.show,\n htmlContainer = tooltip.htmlContainer,\n visible = true;\n\n if (show) {\n if (show.minZoom > viewbox.scale ||\n show.maxZoom < viewbox.scale) {\n visible = false;\n }\n\n setVisible(htmlContainer, visible);\n }\n });\n};\n\nTooltips.prototype._init = function(config) {\n\n var self = this;\n\n\n // scroll/zoom integration\n\n var updateViewbox = function(viewbox) {\n self._updateRoot(viewbox);\n self._updateTooltipVisibilty(viewbox);\n\n self.show();\n };\n\n if (!config || config.deferUpdate !== false) {\n updateViewbox = debounce(updateViewbox, 300);\n }\n\n this._eventBus.on('canvas.viewbox.changed', function(event) {\n self.hide();\n updateViewbox(event.viewbox);\n });\n};\n","module.exports = {\n __init__: [ 'tooltips' ],\n tooltips: [ 'type', require(159) ]\n};","'use strict';\n\nfunction TouchFix(canvas, eventBus) {\n\n var self = this;\n\n eventBus.on('canvas.init', function(e) {\n self.addBBoxMarker(e.svg);\n });\n}\n\nTouchFix.$inject = [ 'canvas', 'eventBus' ];\n\nmodule.exports = TouchFix;\n\n\n/**\n * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element\n * if there is no shape between 0,0 and viewport elements origin.\n *\n * So touchstart event is only fired when the <g class=\"viewport\"> element was hit.\n * Putting an element over and below the 'viewport' fixes that behavior.\n */\nTouchFix.prototype.addBBoxMarker = function(paper) {\n\n var markerStyle = {\n fill: 'none',\n class: 'outer-bound-marker'\n };\n\n paper.rect(-10000, -10000, 10, 10).attr(markerStyle);\n paper.rect(10000, 10000, 10, 10).attr(markerStyle);\n};\n","'use strict';\n\nvar forEach = require(204),\n domEvent = require(344),\n domClosest = require(341),\n Hammer = require(186),\n Snap = require(188),\n Event = require(178);\n\nvar MIN_ZOOM = 0.2,\n MAX_ZOOM = 4;\n\nvar mouseEvents = [\n 'mousedown',\n 'mouseup',\n 'mouseover',\n 'mouseout',\n 'click',\n 'dblclick'\n];\n\nfunction log() {\n if (false) {\n console.log.apply(console, arguments);\n }\n}\n\nfunction get(service, injector) {\n try {\n return injector.get(service);\n } catch (e) {\n return null;\n }\n}\n\nfunction createTouchRecognizer(node) {\n\n function stopEvent(event) {\n Event.stopEvent(event, true);\n }\n\n function stopMouse(event) {\n\n forEach(mouseEvents, function(e) {\n domEvent.bind(node, e, stopEvent, true);\n });\n }\n\n function allowMouse(event) {\n setTimeout(function() {\n forEach(mouseEvents, function(e) {\n domEvent.unbind(node, e, stopEvent, true);\n });\n }, 500);\n }\n\n domEvent.bind(node, 'touchstart', stopMouse, true);\n domEvent.bind(node, 'touchend', allowMouse, true);\n domEvent.bind(node, 'touchcancel', allowMouse, true);\n\n // A touch event recognizer that handles\n // touch events only (we know, we can already handle\n // mouse events out of the box)\n\n var recognizer = new Hammer.Manager(node, {\n inputClass: Hammer.TouchInput,\n recognizers: []\n });\n\n\n var tap = new Hammer.Tap();\n var pan = new Hammer.Pan({ threshold: 10 });\n var press = new Hammer.Press();\n var pinch = new Hammer.Pinch();\n\n var doubleTap = new Hammer.Tap({ event: 'doubletap', taps: 2 });\n\n pinch.requireFailure(pan);\n pinch.requireFailure(press);\n\n recognizer.add([ pan, press, pinch, doubleTap, tap ]);\n\n recognizer.reset = function(force) {\n var recognizers = this.recognizers,\n session = this.session;\n\n if (session.stopped) {\n return;\n }\n\n log('recognizer', 'stop');\n\n recognizer.stop(force);\n\n setTimeout(function() {\n var i, r;\n\n log('recognizer', 'reset');\n for (i = 0; !!(r = recognizers[i]); i++) {\n r.reset();\n r.state = 8; // FAILED STATE\n }\n\n session.curRecognizer = null;\n }, 0);\n };\n\n recognizer.on('hammer.input', function(event) {\n if (event.srcEvent.defaultPrevented) {\n recognizer.reset(true);\n }\n });\n\n return recognizer;\n}\n\n/**\n * A plugin that provides touch events for elements.\n *\n * @param {EventBus} eventBus\n * @param {InteractionEvents} interactionEvents\n */\nfunction TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {\n\n // optional integrations\n var dragging = get('dragging', injector),\n move = get('move', injector),\n contextPad = get('contextPad', injector),\n palette = get('palette', injector);\n\n // the touch recognizer\n var recognizer;\n\n function handler(type) {\n\n return function(event) {\n log('element', type, event);\n\n interactionEvents.fire(type, event);\n };\n }\n\n function getGfx(target) {\n var node = domClosest(target, 'svg, .djs-element', true);\n return node && new Snap(node);\n }\n\n function initEvents(svg) {\n\n // touch recognizer\n recognizer = createTouchRecognizer(svg);\n\n recognizer.on('doubletap', handler('element.dblclick'));\n\n recognizer.on('tap', handler('element.click'));\n\n function startGrabCanvas(event) {\n\n log('canvas', 'grab start');\n\n var lx = 0, ly = 0;\n\n function update(e) {\n\n var dx = e.deltaX - lx,\n dy = e.deltaY - ly;\n\n canvas.scroll({ dx: dx, dy: dy });\n\n lx = e.deltaX;\n ly = e.deltaY;\n }\n\n function end(e) {\n recognizer.off('panmove', update);\n recognizer.off('panend', end);\n recognizer.off('pancancel', end);\n\n log('canvas', 'grab end');\n }\n\n recognizer.on('panmove', update);\n recognizer.on('panend', end);\n recognizer.on('pancancel', end);\n }\n\n function startGrab(event) {\n\n var gfx = getGfx(event.target),\n element = gfx && elementRegistry.get(gfx);\n\n // recognizer\n if (move && canvas.getRootElement() !== element) {\n log('element', 'move start', element, event, true);\n return move.start(event, element, true);\n } else {\n startGrabCanvas(event);\n }\n }\n\n function startZoom(e) {\n\n log('canvas', 'zoom start');\n\n var zoom = canvas.zoom(),\n mid = e.center;\n\n function update(e) {\n\n var ratio = 1 - (1 - e.scale) / 1.50,\n newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));\n\n canvas.zoom(newZoom, mid);\n\n Event.stopEvent(e, true);\n }\n\n function end(e) {\n recognizer.off('pinchmove', update);\n recognizer.off('pinchend', end);\n recognizer.off('pinchcancel', end);\n\n recognizer.reset(true);\n\n log('canvas', 'zoom end');\n }\n\n recognizer.on('pinchmove', update);\n recognizer.on('pinchend', end);\n recognizer.on('pinchcancel', end);\n }\n\n recognizer.on('panstart', startGrab);\n recognizer.on('press', startGrab);\n\n recognizer.on('pinchstart', startZoom);\n }\n\n if (dragging) {\n\n // simulate hover during dragging\n eventBus.on('drag.move', function(event) {\n\n var position = Event.toPoint(event.originalEvent);\n\n var node = document.elementFromPoint(position.x, position.y),\n gfx = getGfx(node),\n element = gfx && elementRegistry.get(gfx);\n\n if (element !== event.hover) {\n if (event.hover) {\n dragging.out(event);\n }\n\n if (element) {\n dragging.hover({ element: element, gfx: gfx });\n\n event.hover = element;\n event.hoverGfx = gfx;\n }\n }\n });\n }\n\n if (contextPad) {\n\n eventBus.on('contextPad.create', function(event) {\n var node = event.pad.html;\n\n // touch recognizer\n var padRecognizer = createTouchRecognizer(node);\n\n padRecognizer.on('panstart', function(event) {\n log('context-pad', 'panstart', event);\n contextPad.trigger('dragstart', event, true);\n });\n\n padRecognizer.on('press', function(event) {\n log('context-pad', 'press', event);\n contextPad.trigger('dragstart', event, true);\n });\n\n padRecognizer.on('tap', function(event) {\n log('context-pad', 'tap', event);\n contextPad.trigger('click', event);\n });\n });\n }\n\n if (palette) {\n eventBus.on('palette.create', function(event) {\n var node = event.html;\n\n // touch recognizer\n var padRecognizer = createTouchRecognizer(node);\n\n padRecognizer.on('panstart', function(event) {\n log('palette', 'panstart', event);\n palette.trigger('dragstart', event, true);\n });\n\n padRecognizer.on('press', function(event) {\n log('palette', 'press', event);\n palette.trigger('dragstart', event, true);\n });\n\n padRecognizer.on('tap', function(event) {\n log('palette', 'tap', event);\n palette.trigger('click', event);\n });\n });\n }\n\n eventBus.on('canvas.init', function(event) {\n initEvents(event.svg.node);\n });\n}\n\n\nTouchInteractionEvents.$inject = [\n 'injector',\n 'canvas',\n 'eventBus',\n 'elementRegistry',\n 'interactionEvents',\n 'touchFix'\n];\n\nmodule.exports = TouchInteractionEvents;","module.exports = {\n __depends__: [ require(103) ],\n __init__: [ 'touchInteractionEvents' ],\n touchInteractionEvents: [ 'type', require(162) ],\n touchFix: [ 'type', require(161) ]\n};","'use strict';\n\nvar LayoutUtil = require(166);\n\n\n/**\n * A base connection layouter implementation\n * that layouts the connection by directly connecting\n * mid(source) + mid(target).\n */\nfunction BaseLayouter() {}\n\nmodule.exports = BaseLayouter;\n\n\n/**\n * Return the new layouted waypoints for the given connection.\n *\n * @param {djs.model.Connection} connection\n * @param {Object} hints\n * @param {Boolean} [hints.movedStart=false]\n * @param {Boolean} [hints.movedEnd=false]\n *\n * @return {Array<Point>} the layouted connection waypoints\n */\nBaseLayouter.prototype.layoutConnection = function(connection, hints) {\n return [\n LayoutUtil.getMidPoint(connection.source),\n LayoutUtil.getMidPoint(connection.target)\n ];\n};\n","'use strict';\n\nvar assign = require(325);\n\nvar LayoutUtil = require(166);\n\n\nfunction dockingToPoint(docking) {\n // use the dockings actual point and\n // retain the original docking\n return assign({ original: docking.point.original || docking.point }, docking.actual);\n}\n\n\n/**\n * A {@link ConnectionDocking} that crops connection waypoints based on\n * the path(s) of the connection source and target.\n *\n * @param {djs.core.ElementRegistry} elementRegistry\n */\nfunction CroppingConnectionDocking(elementRegistry, renderer) {\n this._elementRegistry = elementRegistry;\n this._renderer = renderer;\n}\n\nCroppingConnectionDocking.$inject = [ 'elementRegistry', 'renderer' ];\n\nmodule.exports = CroppingConnectionDocking;\n\n\n/**\n * @inheritDoc ConnectionDocking#getCroppedWaypoints\n */\nCroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {\n\n source = source || connection.source;\n target = target || connection.target;\n\n var sourceDocking = this.getDockingPoint(connection, source, true),\n targetDocking = this.getDockingPoint(connection, target);\n\n var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);\n\n croppedWaypoints.unshift(dockingToPoint(sourceDocking));\n croppedWaypoints.push(dockingToPoint(targetDocking));\n\n return croppedWaypoints;\n};\n\n/**\n * Return the connection docking point on the specified shape\n *\n * @inheritDoc ConnectionDocking#getDockingPoint\n */\nCroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {\n\n var waypoints = connection.waypoints,\n dockingIdx,\n dockingPoint,\n croppedPoint;\n\n dockingIdx = dockStart ? 0 : waypoints.length - 1;\n dockingPoint = waypoints[dockingIdx];\n\n croppedPoint = this._getIntersection(shape, connection, dockStart);\n\n return {\n point: dockingPoint,\n actual: croppedPoint || dockingPoint,\n idx: dockingIdx\n };\n};\n\n\n////// helper methods ///////////////////////////////////////////////////\n\nCroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {\n\n var shapePath = this._getShapePath(shape),\n connectionPath = this._getConnectionPath(connection);\n\n return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);\n};\n\nCroppingConnectionDocking.prototype._getConnectionPath = function(connection) {\n return this._renderer.getConnectionPath(connection);\n};\n\nCroppingConnectionDocking.prototype._getShapePath = function(shape) {\n return this._renderer.getShapePath(shape);\n};\n\nCroppingConnectionDocking.prototype._getGfx = function(element) {\n return this._elementRegistry.getGraphics(element);\n};","'use strict';\n\nvar isArray = require(316),\n sortBy = require(211);\n\nvar Snap = require(188);\n\n/**\n * Returns whether two points are in a horizontal or vertical line.\n *\n * @param {Point} a\n * @param {Point} b\n *\n * @return {String|Boolean} returns false if the points are not\n * aligned or 'h|v' if they are aligned\n * horizontally / vertically.\n */\nfunction pointsAligned(a, b) {\n switch (true) {\n case a.x === b.x:\n return 'h';\n case a.y === b.y:\n return 'v';\n }\n\n return false;\n}\n\nmodule.exports.pointsAligned = pointsAligned;\n\n\nfunction roundPoint(point) {\n\n return {\n x: Math.round(point.x),\n y: Math.round(point.y)\n };\n}\n\nmodule.exports.roundPoint = roundPoint;\n\n\nfunction pointsEqual(a, b) {\n return a.x === b.x && a.y === b.y;\n}\n\nmodule.exports.pointsEqual = pointsEqual;\n\n\nfunction pointDistance(a, b) {\n return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n}\n\nmodule.exports.pointDistance = pointDistance;\n\n\nfunction asTRBL(bounds) {\n return {\n top: bounds.y,\n right: bounds.x + (bounds.width || 0),\n bottom: bounds.y + (bounds.height || 0),\n left: bounds.x\n };\n}\n\nmodule.exports.asTRBL = asTRBL;\n\n\nfunction getMidPoint(bounds) {\n return roundPoint({\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n });\n}\n\nmodule.exports.getMidPoint = getMidPoint;\n\n\n////// orientation utils //////////////////////////////\n\nfunction getOrientation(rect, reference, pointDistance) {\n\n pointDistance = pointDistance || 0;\n\n var rectOrientation = asTRBL(rect),\n referenceOrientation = asTRBL(reference);\n\n var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,\n right = rectOrientation.left - pointDistance >= referenceOrientation.right,\n bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,\n left = rectOrientation.right + pointDistance <= referenceOrientation.left;\n\n var vertical = top ? 'top' : (bottom ? 'bottom' : null),\n horizontal = left ? 'left' : (right ? 'right' : null);\n\n if (horizontal && vertical) {\n return vertical + '-' + horizontal;\n } else\n if (horizontal || vertical) {\n return horizontal || vertical;\n } else {\n return 'intersect';\n }\n}\n\nmodule.exports.getOrientation = getOrientation;\n\n\nfunction hasAnyOrientation(rect, reference, pointDistance, locations) {\n\n if (isArray(pointDistance)) {\n locations = pointDistance;\n pointDistance = 0;\n }\n\n var orientation = getOrientation(rect, reference, pointDistance);\n\n return locations.indexOf(orientation) !== -1;\n}\n\nmodule.exports.hasAnyOrientation = hasAnyOrientation;\n\n\n////// intersection utils //////////////////////////////\n\nfunction getElementLineIntersection(elementPath, linePath, cropStart) {\n\n var intersections = getIntersections(elementPath, linePath);\n\n // recognize intersections\n // only one -> choose\n // two close together -> choose first\n // two or more distinct -> pull out appropriate one\n // none -> ok (fallback to point itself)\n if (intersections.length === 1) {\n return roundPoint(intersections[0]);\n } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {\n return roundPoint(intersections[0]);\n } else if (intersections.length > 1) {\n\n // sort by intersections based on connection segment +\n // distance from start\n intersections = sortBy(intersections, function(i) {\n var distance = Math.floor(i.t2 * 100) || 1;\n\n distance = 100 - distance;\n\n distance = (distance < 10 ? '0' : '') + distance;\n\n // create a sort string that makes sure we sort\n // line segment ASC + line segment position DESC (for cropStart)\n // line segment ASC + line segment position ASC (for cropEnd)\n return i.segment2 + '#' + distance;\n });\n\n return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);\n }\n\n return null;\n}\n\nmodule.exports.getElementLineIntersection = getElementLineIntersection;\n\n\nfunction getIntersections(a, b) {\n return Snap.path.intersection(a, b);\n}\n\nmodule.exports.getIntersections = getIntersections;","'use strict';\n\nvar isArray = require(316),\n find = require(203);\n\nvar LayoutUtil = require(166),\n Geometry = require(179);\n\nvar MIN_DISTANCE = 20;\n\n\n/**\n * Returns the mid points for a manhattan connection between two points.\n *\n * @example\n *\n * [a]----[x]\n * |\n * [x]--->[b]\n *\n * @param {Point} a\n * @param {Point} b\n * @param {String} directions\n *\n * @return {Array<Point>}\n */\nmodule.exports.getMidPoints = function(a, b, directions) {\n\n directions = directions || 'h:h';\n\n var xmid, ymid;\n\n // one point, next to a\n if (directions === 'h:v') {\n return [ { x: b.x, y: a.y } ];\n } else\n // one point, above a\n if (directions === 'v:h') {\n return [ { x: a.x, y: b.y } ];\n } else\n // vertical edge xmid\n if (directions === 'h:h') {\n xmid = Math.round((b.x - a.x) / 2 + a.x);\n\n return [\n { x: xmid, y: a.y },\n { x: xmid, y: b.y }\n ];\n } else\n // horizontal edge ymid\n if (directions === 'v:v') {\n ymid = Math.round((b.y - a.y) / 2 + a.y);\n\n return [\n { x: a.x, y: ymid },\n { x: b.x, y: ymid }\n ];\n } else {\n throw new Error(\n 'unknown directions: <' + directions + '>: ' +\n 'directions must be specified as {a direction}:{b direction} (direction in h|v)');\n }\n};\n\n\n/**\n * Create a connection between the two points according\n * to the manhattan layout (only horizontal and vertical) edges.\n *\n * @param {Point} a\n * @param {Point} b\n *\n * @param {String} [directions='h:h'] specifies manhattan directions for each point as {adirection}:{bdirection}.\n A directionfor a point is either `h` (horizontal) or `v` (vertical)\n *\n * @return {Array<Point>}\n */\nmodule.exports.connectPoints = function(a, b, directions) {\n\n var points = [];\n\n if (!LayoutUtil.pointsAligned(a, b)) {\n points = this.getMidPoints(a, b, directions);\n }\n\n points.unshift(a);\n points.push(b);\n\n return points;\n};\n\n\n/**\n * Connect two rectangles using a manhattan layouted connection.\n *\n * @param {Bounds} source source rectangle\n * @param {Bounds} target target rectangle\n * @param {Point} [start] source docking\n * @param {Point} [end] target docking\n *\n * @return {Array<Point>} connection points\n */\nmodule.exports.connectRectangles = function(source, target, start, end, options) {\n\n options = options || {};\n\n var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);\n\n var directions = this.getDirections(source, target, options.preferVertical);\n\n start = start || LayoutUtil.getMidPoint(source);\n end = end || LayoutUtil.getMidPoint(target);\n\n // overlapping elements\n if (!directions) {\n return;\n }\n\n if (directions === 'h:h') {\n\n switch (orientation) {\n case 'top-right':\n case 'right':\n case 'bottom-right':\n start = { original: start, x: source.x, y: start.y };\n end = { original: end, x: target.x + target.width, y: end.y };\n break;\n case 'top-left':\n case 'left':\n case 'bottom-left':\n start = { original: start, x: source.x + source.width, y: start.y };\n end = { original: end, x: target.x, y: end.y };\n break;\n }\n }\n\n if (directions === 'v:v') {\n\n switch (orientation) {\n case 'top-left':\n case 'top':\n case 'top-right':\n start = { original: start, x: start.x, y: source.y + source.height };\n end = { original: end, x: end.x, y: target.y };\n break;\n case 'bottom-left':\n case 'bottom':\n case 'bottom-right':\n start = { original: start, x: start.x, y: source.y };\n end = { original: end, x: end.x, y: target.y + target.height };\n break;\n }\n }\n\n return this.connectPoints(start, end, directions);\n};\n\n/**\n * Repair the connection between two rectangles, of which one has been updated.\n *\n * @param {Bounds} source\n * @param {Bounds} target\n * @param {Point} [start]\n * @param {Point} [end]\n * @param {Array<Point>} waypoints\n * @param {Object} [hints]\n * @param {Boolean} hints.preferStraight\n * @param {Boolean} hints.preferVertical\n * @param {Boolean} hints.startChanged\n * @param {Boolean} hints.endChanged\n *\n * @return {Array<Point>} repaired waypoints\n */\nmodule.exports.repairConnection = function(source, target, start, end, waypoints, hints) {\n\n if (isArray(start)) {\n waypoints = start;\n hints = end;\n\n start = LayoutUtil.getMidPoint(source);\n end = LayoutUtil.getMidPoint(target);\n }\n\n hints = hints || {};\n\n\n var repairedWaypoints;\n\n // just layout non-existing or simple connections\n // attempt to render straight lines, if required\n if (!waypoints || waypoints.length < 3) {\n\n if (hints.preferStraight) {\n // attempt to layout a straight line\n repairedWaypoints = this.layoutStraight(source, target, start, end, hints);\n }\n } else {\n // check if we layout from start or end\n if (hints.endChanged) {\n repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());\n repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();\n } else\n if (hints.startChanged) {\n repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);\n }\n // or whether nothing seems to have changed\n else {\n repairedWaypoints = waypoints;\n }\n }\n\n // simply reconnect if nothing else worked\n if (!repairedWaypoints) {\n return this.connectRectangles(source, target, start, end, hints);\n }\n\n return repairedWaypoints;\n};\n\nfunction max(a, b) {\n return Math.max(a, b);\n}\n\nfunction min(a, b) {\n return Math.min(a, b);\n}\n\nfunction inRange(a, start, end) {\n return a >= start && a <= end;\n}\n\nmodule.exports.layoutStraight = function(source, target, start, end, hints) {\n\n var startX, endX, x,\n startY, endY, y;\n\n startX = max(source.x + 10, target.x + 10);\n endX = min(source.x + source.width - 10, target.x + target.width - 10);\n\n if (startX < endX) {\n\n if (source.width === target.width) {\n\n if (hints.endChanged && inRange(end.x, startX, endX)) {\n x = end.x;\n } else\n if (inRange(start.x, startX, endX)) {\n x = start.x;\n }\n }\n\n if (x === undefined) {\n if (source.width < target.width && inRange(start.x, startX, endX)) {\n x = start.x;\n } else\n if (source.width > target.width && inRange(end.x, startX, endX)) {\n x = end.x;\n } else {\n x = (startX + endX) / 2;\n }\n }\n }\n\n startY = max(source.y + 10, target.y + 10);\n endY = min(source.y + source.height - 10, target.y + target.height - 10);\n\n if (startY < endY) {\n\n if (source.height === target.height) {\n if (hints.endChanged && inRange(end.y, startY, endY)) {\n y = end.y;\n } else\n if (inRange(start.y, startY, endY)) {\n y = start.y;\n }\n }\n\n if (y === undefined) {\n if (source.height <= target.height && inRange(start.y, startY, endY)) {\n y = start.y;\n } else\n if (target.height <= source.height && inRange(end.y, startY, endY)) {\n y = end.y;\n } else {\n y = (startY + endY) / 2;\n }\n }\n }\n\n // cannot layout straight\n if (x === undefined && y === undefined) {\n return null;\n }\n\n return [\n {\n x: x !== undefined ? x : start.x,\n y: y !== undefined ? y : start.y\n },\n {\n x: x !== undefined ? x : end.x,\n y: y !== undefined ? y : end.y\n }\n ];\n};\n\n\n/**\n * Repair a connection from one side that moved.\n *\n * @param {Bounds} moved\n * @param {Bounds} other\n * @param {Point} newDocking\n * @param {Array<Point>} points originalPoints from moved to other\n *\n * @return {Array<Point>} the repaired points between the two rectangles\n */\nmodule.exports._repairConnectionSide = function(moved, other, newDocking, points) {\n\n function needsRelayout(moved, other, points) {\n\n if (points.length < 3) {\n return true;\n }\n\n if (points.length > 4) {\n return false;\n }\n\n // relayout if two points overlap\n // this is most likely due to\n return !!find(points, function(p, idx) {\n var q = points[idx - 1];\n\n return q && Geometry.distance(p, q) < 3;\n });\n }\n\n function repairBendpoint(candidate, oldPeer, newPeer) {\n\n var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);\n\n switch (alignment) {\n case 'v':\n // repair vertical alignment\n return { x: candidate.x, y: newPeer.y };\n case 'h':\n // repair horizontal alignment\n return { x: newPeer.x, y: candidate.y };\n }\n\n return { x: candidate.x, y: candidate. y };\n }\n\n function removeOverlapping(points, a, b) {\n var i;\n\n for (i = points.length - 2; i !== 0; i--) {\n\n // intersects (?) break, remove all bendpoints up to this one and relayout\n if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||\n Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {\n\n // return sliced old connection\n return points.slice(i);\n }\n }\n\n return points;\n }\n\n\n // (0) only repair what has layoutable bendpoints\n\n // (1) if only one bendpoint and on shape moved onto other shapes axis\n // (horizontally / vertically), relayout\n\n if (needsRelayout(moved, other, points)) {\n return null;\n }\n\n var oldDocking = points[0],\n newPoints = points.slice(),\n slicedPoints;\n\n // (2) repair only last line segment and only if it was layouted before\n\n newPoints[0] = newDocking;\n newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);\n\n\n // (3) if shape intersects with any bendpoint after repair,\n // remove all segments up to this bendpoint and repair from there\n\n slicedPoints = removeOverlapping(newPoints, moved, other);\n if (slicedPoints !== newPoints) {\n return this._repairConnectionSide(moved, other, newDocking, slicedPoints);\n }\n\n return newPoints;\n};\n\n/**\n * Returns the default manhattan directions connecting two rectangles.\n *\n * @param {Bounds} source\n * @param {Bounds} target\n * @param {Boolean} preferVertical\n *\n * @return {String}\n */\nmodule.exports.getDirections = function(source, target, preferVertical) {\n var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);\n\n switch (orientation) {\n case 'intersect':\n return null;\n\n case 'top':\n case 'bottom':\n return 'v:v';\n\n case 'left':\n case 'right':\n return 'h:h';\n\n default:\n return preferVertical ? 'v:v' : 'h:h';\n }\n};","'use strict';\n\nvar assign = require(325),\n inherits = require(195);\n\nvar Refs = require(356);\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),\n outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @namespace djs.model\n */\n\n/**\n * @memberOf djs.model\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n *\n * @abstract\n */\nfunction Base() {\n\n /**\n * The object that backs up the shape\n *\n * @name Base#businessObject\n * @type Object\n */\n Object.defineProperty(this, 'businessObject', {\n writable: true\n });\n\n /**\n * The parent shape\n *\n * @name Base#parent\n * @type Shape\n */\n parentRefs.bind(this, 'parent');\n\n /**\n * @name Base#label\n * @type Label\n */\n labelRefs.bind(this, 'label');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#outgoing\n * @type Array<Connection>\n */\n outgoingRefs.bind(this, 'outgoing');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#incoming\n * @type Array<Connection>\n */\n incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Shape() {\n Base.call(this);\n\n /**\n * The list of children\n *\n * @name Shape#children\n * @type Array<Base>\n */\n parentRefs.bind(this, 'children');\n}\n\ninherits(Shape, Base);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Root() {\n Shape.call(this);\n}\n\ninherits(Root, Shape);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(Label, Shape);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Connection() {\n Base.call(this);\n\n /**\n * The element this connection originates from\n *\n * @name Connection#source\n * @type Base\n */\n outgoingRefs.bind(this, 'source');\n\n /**\n * The element this connection points to\n *\n * @name Connection#target\n * @type Base\n */\n incomingRefs.bind(this, 'target');\n}\n\ninherits(Connection, Base);\n\n\nvar types = {\n connection: Connection,\n shape: Shape,\n label: Label,\n root: Root\n};\n\n/**\n * Creates a new model element of the specified type\n *\n * @method create\n *\n * @example\n *\n * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });\n * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });\n *\n * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });\n *\n * @param {String} type lower-cased model name\n * @param {Object} attrs attributes to initialize the new model instance with\n *\n * @return {Base} the new model instance\n */\nmodule.exports.create = function(type, attrs) {\n var Type = types[type];\n if (!Type) {\n throw new Error('unknown type: <' + type + '>');\n }\n return assign(new Type(), attrs);\n};\n\n\nmodule.exports.Base = Base;\nmodule.exports.Root = Root;\nmodule.exports.Shape = Shape;\nmodule.exports.Connection = Connection;\nmodule.exports.Label = Label;","'use strict';\n\nvar Cursor = require(176),\n ClickTrap = require(174),\n domEvent = require(344),\n Event = require(178);\n\nfunction substract(p1, p2) {\n return {\n x: p1.x - p2.x,\n y: p1.y - p2.y\n };\n}\n\nfunction length(point) {\n return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));\n}\n\n\nvar THRESHOLD = 15;\n\n\nfunction MoveCanvas(eventBus, canvas) {\n\n var container = canvas._container,\n context;\n\n\n function handleMove(event) {\n\n var start = context.start,\n position = Event.toPoint(event),\n delta = substract(position, start);\n\n if (!context.dragging && length(delta) > THRESHOLD) {\n context.dragging = true;\n\n // prevent mouse click in this\n // interaction sequence\n ClickTrap.install();\n\n Cursor.set('move');\n }\n\n if (context.dragging) {\n\n var lastPosition = context.last || context.start;\n\n delta = substract(position, lastPosition);\n\n canvas.scroll({\n dx: delta.x,\n dy: delta.y\n });\n\n context.last = position;\n }\n\n // prevent select\n event.preventDefault();\n }\n\n\n function handleEnd(event) {\n domEvent.unbind(document, 'mousemove', handleMove);\n domEvent.unbind(document, 'mouseup', handleEnd);\n\n context = null;\n\n Cursor.unset();\n\n // prevent select\n Event.stopEvent(event);\n }\n\n function handleStart(event) {\n\n // reject non-left left mouse button or modifier key\n if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n context = {\n start: Event.toPoint(event)\n };\n\n domEvent.bind(document, 'mousemove', handleMove);\n domEvent.bind(document, 'mouseup', handleEnd);\n\n // prevent select\n Event.stopEvent(event);\n }\n\n domEvent.bind(container, 'mousedown', handleStart);\n}\n\n\nMoveCanvas.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = MoveCanvas;\n","module.exports = {\n __init__: [ 'moveCanvas' ],\n moveCanvas: [ 'type', require(169) ]\n};","module.exports = {\n __depends__: [ require(163) ]\n};","'use strict';\n\nvar domEvent = require(344);\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier,\n hasSecondaryModifier = require(182).hasSecondaryModifier;\n\nvar isMac = require(183).isMac;\n\n\nfunction ZoomScroll(events, canvas) {\n\n var RANGE = { min: 0.2, max: 4 };\n\n function cap(scale) {\n return Math.max(RANGE.min, Math.min(RANGE.max, scale));\n }\n\n function reset() {\n canvas.zoom('fit-viewport');\n }\n\n function zoom(direction, position) {\n\n var currentZoom = canvas.zoom();\n var factor = Math.pow(1 + Math.abs(direction) , direction > 0 ? 1 : -1);\n\n canvas.zoom(cap(currentZoom * factor), position);\n }\n\n function scroll(delta) {\n canvas.scroll(delta);\n }\n\n function init(element) {\n\n domEvent.bind(element, 'wheel', function(event) {\n\n event.preventDefault();\n\n // mouse-event: SELECTION_KEY\n // mouse-event: AND_KEY\n var isVerticalScroll = hasPrimaryModifier(event),\n isHorizontalScroll = hasSecondaryModifier(event);\n\n var factor;\n\n if (isVerticalScroll || isHorizontalScroll) {\n\n if (isMac) {\n factor = event.deltaMode === 0 ? 1.25 : 50;\n } else {\n factor = event.deltaMode === 0 ? 1/40 : 1/2;\n }\n\n var delta = {};\n\n if (isHorizontalScroll) {\n delta.dx = (factor * (event.deltaX || event.deltaY));\n } else {\n delta.dy = (factor * event.deltaY);\n }\n\n scroll(delta);\n } else {\n factor = (event.deltaMode === 0 ? 1/40 : 1/2);\n\n var elementRect = element.getBoundingClientRect();\n\n var offset = {\n x: event.clientX - elementRect.left,\n y: event.clientY - elementRect.top\n };\n\n // zoom in relative to diagram {x,y} coordinates\n zoom(event.deltaY * factor / (-5), offset);\n }\n });\n }\n\n events.on('canvas.init', function(e) {\n init(canvas._container);\n });\n\n // API\n this.zoom = zoom;\n this.reset = reset;\n}\n\n\nZoomScroll.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = ZoomScroll;\n\n","module.exports = {\n __init__: [ 'zoomScroll' ],\n zoomScroll: [ 'type', require(172) ]\n};","'use strict';\n\nvar domEvent = require(344),\n stopEvent = require(178).stopEvent;\n\nfunction trap(event) {\n stopEvent(event);\n\n toggle(false);\n}\n\nfunction toggle(active) {\n domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);\n}\n\n/**\n * Installs a click trap that prevents a ghost click following a dragging operation.\n *\n * @return {Function} a function to immediately remove the installed trap.\n */\nfunction install() {\n\n toggle(true);\n\n return function() {\n toggle(false);\n };\n}\n\nmodule.exports.install = install;","'use strict';\n\n/**\n * Failsafe remove an element from a collection\n *\n * @param {Array<Object>} [collection]\n * @param {Object} [element]\n *\n * @return {Object} the element that got removed or undefined\n */\nmodule.exports.remove = function(collection, element) {\n\n if (!collection || !element) {\n return;\n }\n\n var idx = collection.indexOf(element);\n if (idx === -1) {\n return;\n }\n\n collection.splice(idx, 1);\n\n return element;\n};\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n * @param {Number} idx\n */\nmodule.exports.add = function(collection, element, idx) {\n\n if (!collection || !element) {\n return;\n }\n\n if (isNaN(idx)) {\n idx = -1;\n }\n\n var currentIdx = collection.indexOf(element);\n\n if (currentIdx !== -1) {\n\n if (currentIdx === idx) {\n // nothing to do, position has not changed\n return;\n } else {\n\n if (idx !== -1) {\n // remove from current position\n collection.splice(currentIdx, 1);\n } else {\n // already exists in collection\n return;\n }\n }\n }\n\n if (idx !== -1) {\n // insert at specified position\n collection.splice(idx, 0, element);\n } else {\n // push to end\n collection.push(element);\n }\n};\n\n\n/**\n * Fail get the index of an element in a collection.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n *\n * @return {Number} the index or -1 if collection or element do\n * not exist or the element is not contained.\n */\nmodule.exports.indexOf = function(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n return collection.indexOf(element);\n};\n","'use strict';\n\nvar domClasses = require(339);\n\nvar CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;\n\n\nmodule.exports.set = function(mode) {\n var classes = domClasses(document.body);\n\n classes.removeMatching(CURSOR_CLS_PATTERN);\n\n if (mode) {\n classes.add('djs-cursor-' + mode);\n }\n};\n\nmodule.exports.unset = function() {\n this.set(null);\n};","'use strict';\n\nvar isArray = require(316),\n isNumber = require(319),\n groupBy = require(205),\n forEach = require(204);\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Array<Object>} elements\n * @param {Object} e\n * @param {Boolean} unique\n */\nfunction add(elements, e, unique) {\n var canAdd = !unique || elements.indexOf(e) === -1;\n\n if (canAdd) {\n elements.push(e);\n }\n\n return canAdd;\n}\n\nfunction eachElement(elements, fn, depth) {\n\n depth = depth || 0;\n\n forEach(elements, function(s, i) {\n var filter = fn(s, i, depth);\n\n if (isArray(filter) && filter.length) {\n eachElement(filter, fn, depth + 1);\n }\n });\n}\n\n/**\n * Collects self + child elements up to a given depth from a list of elements.\n *\n * @param {Array<djs.model.Base>} elements the elements to select the children from\n * @param {Boolean} unique whether to return a unique result set (no duplicates)\n * @param {Number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Array<djs.model.Base>} found elements\n */\nfunction selfAndChildren(elements, unique, maxDepth) {\n var result = [],\n processedChildren = [];\n\n eachElement(elements, function(element, i, depth) {\n add(result, element, unique);\n\n var children = element.children;\n\n // max traversal depth not reached yet\n if (maxDepth === -1 || depth < maxDepth) {\n\n // children exist && children not yet processed\n if (children && add(processedChildren, children, unique)) {\n return children;\n }\n }\n });\n\n return result;\n}\n\n/**\n * Return self + direct children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndDirectChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, 1);\n}\n\n/**\n * Return self + ALL children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndAllChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, -1);\n}\n\n/**\n * Gets the the closure fo all selected elements,\n * their connections and\n *\n * @param {Array<djs.model.Base>} elements\n * @return {Object} enclosure\n */\nfunction getClosure(elements) {\n\n // original elements passed to this function\n var topLevel = groupBy(elements, function(e) { return e.id; });\n\n var allShapes = {},\n allConnections = {},\n enclosedElements = {},\n enclosedConnections = {};\n\n function handleConnection(c) {\n if (topLevel[c.source.id] && topLevel[c.target.id]) {\n topLevel[c.id] = c;\n }\n\n // not enclosed as a child, but maybe logically\n // (connecting two moved elements?)\n if (allShapes[c.source.id] && allShapes[c.target.id]) {\n enclosedConnections[c.id] = enclosedElements[c.id] = c;\n }\n\n allConnections[c.id] = c;\n }\n\n function handleElement(element) {\n\n enclosedElements[element.id] = element;\n\n if (element.waypoints) {\n // remember connection\n enclosedConnections[element.id] = allConnections[element.id] = element;\n } else {\n // remember shape\n allShapes[element.id] = element;\n\n // remember all connections\n forEach(element.incoming, handleConnection);\n\n forEach(element.outgoing, handleConnection);\n\n // recurse into children\n return element.children;\n }\n }\n\n eachElement(elements, handleElement);\n\n return {\n allShapes: allShapes,\n allConnections: allConnections,\n topLevel: topLevel,\n enclosedConnections: enclosedConnections,\n enclosedElements: enclosedElements\n };\n}\n\n/**\n * Returns the surrounding bbox for all elements in the array or the element primitive.\n */\nfunction getBBox(elements, stopRecursion) {\n\n stopRecursion = !!stopRecursion;\n if (!isArray(elements)) {\n elements = [elements];\n }\n\n var minX,\n minY,\n maxX,\n maxY;\n\n forEach(elements, function(element) {\n\n // If element is a connection the bbox must be computed first\n var bbox = element;\n if (element.waypoints && !stopRecursion) {\n bbox = getBBox(element.waypoints, true);\n }\n\n var x = bbox.x,\n y = bbox.y,\n height = bbox.height || 0,\n width = bbox.width || 0;\n\n if (x < minX || minX === undefined) {\n minX = x;\n }\n if (y < minY || minY === undefined) {\n minY = y;\n }\n\n if ((x + width) > maxX || maxX === undefined) {\n maxX = x + width;\n }\n if ((y + height) > maxY || maxY === undefined) {\n maxY = y + height;\n }\n });\n\n return {\n x: minX,\n y: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n}\n\n\n/**\n * Returns all elements that are enclosed from the bounding box.\n *\n * @param {Array<Object>} elements List of Elements to search through\n * @param {Object} bbox the enclosing bbox.\n * <ul>\n * <li>If bbox.(width|height) is not specified\n * the method returns all elements with element.x/y &gt; bbox.x/y\n * </li>\n * <li>If only bbox.x or bbox.y is specified, method return all elements with\n * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>\n * </ul>\n *\n */\nfunction getEnclosedElements(elements, bbox) {\n\n var filteredElements = {};\n\n forEach(elements, function(element) {\n\n var e = element;\n\n if (e.waypoints) {\n e = getBBox(e);\n }\n\n if (!isNumber(bbox.y) && (e.x > bbox.x)) {\n filteredElements[element.id] = element;\n }\n if (!isNumber(bbox.x) && (e.y > bbox.y)) {\n filteredElements[element.id] = element;\n }\n if (e.x > bbox.x && e.y > bbox.y) {\n if (isNumber(bbox.width) && isNumber(bbox.height) &&\n e.width + e.x < bbox.width + bbox.x &&\n e.height + e.y < bbox.height + bbox.y) {\n\n filteredElements[element.id] = element;\n } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {\n filteredElements[element.id] = element;\n }\n }\n });\n\n return filteredElements;\n}\n\n\n\nmodule.exports.eachElement = eachElement;\nmodule.exports.selfAndDirectChildren = selfAndDirectChildren;\nmodule.exports.selfAndAllChildren = selfAndAllChildren;\nmodule.exports.getBBox = getBBox;\nmodule.exports.getEnclosedElements = getEnclosedElements;\n\nmodule.exports.getClosure = getClosure;\n","'use strict';\n\nfunction __preventDefault(event) {\n return event && event.preventDefault();\n}\n\nfunction __stopPropagation(event, immediate) {\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (immediate && event.stopImmediatePropagation) {\n event.stopImmediatePropagation();\n }\n}\n\n\nfunction getOriginal(event) {\n return event.originalEvent || event.srcEvent;\n}\n\nmodule.exports.getOriginal = getOriginal;\n\n\nfunction stopEvent(event, immediate) {\n stopPropagation(event, immediate);\n preventDefault(event);\n}\n\nmodule.exports.stopEvent = stopEvent;\n\n\nfunction preventDefault(event) {\n __preventDefault(event);\n __preventDefault(getOriginal(event));\n}\n\nmodule.exports.preventDefault = preventDefault;\n\n\nfunction stopPropagation(event, immediate) {\n __stopPropagation(event, immediate);\n __stopPropagation(getOriginal(event), immediate);\n}\n\nmodule.exports.stopPropagation = stopPropagation;\n\n\nfunction toPoint(event) {\n\n if (event.pointers && event.pointers.length) {\n event = event.pointers[0];\n }\n\n if (event.touches && event.touches.length) {\n event = event.touches[0];\n }\n\n return event ? {\n x: event.clientX,\n y: event.clientY\n } : null;\n}\n\nmodule.exports.toPoint = toPoint;\n","'use strict';\n\n/**\n * Computes the distance between two points\n *\n * @param {Point} p\n * @param {Point} q\n *\n * @return {Number} distance\n */\nvar distance = module.exports.distance = function(p, q) {\n return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));\n};\n\n/**\n * Returns true if the point r is on the line between p and y\n *\n * @param {Point} p\n * @param {Point} q\n * @param {Point} r\n *\n * @return {Boolean}\n */\nmodule.exports.pointsOnLine = function(p, q, r) {\n\n if (!p || !q || !r) {\n return false;\n }\n\n var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),\n dist = distance(p, q);\n\n // @see http://stackoverflow.com/a/907491/412190\n return Math.abs(val / dist) < 5;\n};\n\nmodule.exports.pointInRect = function(p, rect, tolerance) {\n tolerance = tolerance || 0;\n\n return p.x > rect.x - tolerance &&\n p.y > rect.y - tolerance &&\n p.x < rect.x + rect.width + tolerance &&\n p.y < rect.y + rect.height + tolerance;\n};","'use strict';\n\n/**\n * SVGs for elements are generated by the {@link GraphicsFactory}.\n *\n * This utility gives quick access to the important semantic\n * parts of an element.\n */\n\n/**\n * Returns the visual part of a diagram element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Snap<SVGElement>}\n */\nfunction getVisual(gfx) {\n return gfx.select('.djs-visual');\n}\n\n/**\n * Returns the children for a given diagram element.\n *\n * @param {Snap<SVGElement>} gfx\n * @return {Snap<SVGElement>}\n */\nfunction getChildren(gfx) {\n return gfx.parent().children()[1];\n}\n\n/**\n * Returns the visual bbox of an element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Bounds}\n */\nfunction getBBox(gfx) {\n return getVisual(gfx).select('*').getBBox();\n}\n\n\nmodule.exports.getVisual = getVisual;\nmodule.exports.getChildren = getChildren;\nmodule.exports.getBBox = getBBox;","'use strict';\n\n/**\n * Util that provides unique IDs.\n *\n * @class djs.util.IdGenerator\n * @constructor\n * @memberOf djs.util\n *\n * The ids can be customized via a given prefix and contain a random value to avoid collisions.\n *\n * @param {String} prefix a prefix to prepend to generated ids (for better readability)\n */\nfunction IdGenerator(prefix) {\n\n this._counter = 0;\n this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';\n}\n\nmodule.exports = IdGenerator;\n\n/**\n * Returns a next unique ID.\n *\n * @method djs.util.IdGenerator#next\n *\n * @returns {String} the id\n */\nIdGenerator.prototype.next = function() {\n return this._prefix + (++this._counter);\n};\n","'use strict';\n\nvar getOriginalEvent = require(178).getOriginal;\n\nvar isMac = require(183).isMac;\n\n\nfunction isPrimaryButton(event) {\n // button === 0 -> left áka primary mouse button\n return !(getOriginalEvent(event) || event).button;\n}\n\nmodule.exports.isPrimaryButton = isPrimaryButton;\n\nmodule.exports.isMac = isMac;\n\nmodule.exports.hasPrimaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n if (!isPrimaryButton(event)) {\n return false;\n }\n\n // Use alt as primary modifier key for mac OS\n if (isMac()) {\n return originalEvent.altKey;\n } else {\n return originalEvent.ctrlKey;\n }\n};\n\n\nmodule.exports.hasSecondaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n return isPrimaryButton(event) && originalEvent.shiftKey;\n};\n","'use strict';\n\nmodule.exports.isMac = function isMac() {\n return (/mac/i).test(navigator.platform);\n};","'use strict';\n\nvar isObject = require(320),\n assign = require(325),\n forEach = require(204),\n reduce = require(208),\n merge = require(328);\n\nvar Snap = require(188);\n\nvar DEFAULT_BOX_PADDING = 0;\n\nvar DEFAULT_LABEL_SIZE = {\n width: 150,\n height: 50\n};\n\n\nfunction parseAlign(align) {\n\n var parts = align.split('-');\n\n return {\n horizontal: parts[0] || 'center',\n vertical: parts[1] || 'top'\n };\n}\n\nfunction parsePadding(padding) {\n\n if (isObject(padding)) {\n return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);\n } else {\n return {\n top: padding,\n left: padding,\n right: padding,\n bottom: padding\n };\n }\n}\n\nfunction getTextBBox(text, fakeText) {\n fakeText.textContent = text;\n return fakeText.getBBox();\n}\n\n\n/**\n * Layout the next line and return the layouted element.\n *\n * Alters the lines passed.\n *\n * @param {Array<String>} lines\n * @return {Object} the line descriptor, an object { width, height, text }\n */\nfunction layoutNext(lines, maxWidth, fakeText) {\n\n var originalLine = lines.shift(),\n fitLine = originalLine;\n\n var textBBox;\n\n while (true) {\n textBBox = getTextBBox(fitLine, fakeText);\n\n textBBox.width = fitLine ? textBBox.width : 0;\n\n // try to fit\n if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {\n return fit(lines, fitLine, originalLine, textBBox);\n }\n\n\n fitLine = shortenLine(fitLine, textBBox.width, maxWidth);\n }\n}\n\nfunction fit(lines, fitLine, originalLine, textBBox) {\n if (fitLine.length < originalLine.length) {\n var nextLine = lines[0] || '',\n remainder = originalLine.slice(fitLine.length).trim();\n\n if (/-/s*$/.test(remainder)) {\n nextLine = remainder.replace(/-/s*$/, '') + nextLine.replace(/^/s+/, '');\n } else {\n nextLine = remainder + ' ' + nextLine;\n }\n\n lines[0] = nextLine;\n }\n return { width: textBBox.width, height: textBBox.height, text: fitLine };\n}\n\n\n/**\n * Shortens a line based on spacing and hyphens.\n * Returns the shortened result on success.\n *\n * @param {String} line\n * @param {Number} maxLength the maximum characters of the string\n * @return {String} the shortened string\n */\nfunction semanticShorten(line, maxLength) {\n var parts = line.split(/(/s|-)/g),\n part,\n shortenedParts = [],\n length = 0;\n\n // try to shorten via spaces + hyphens\n if (parts.length > 1) {\n while ((part = parts.shift())) {\n if (part.length + length < maxLength) {\n shortenedParts.push(part);\n length += part.length;\n } else {\n // remove previous part, too if hyphen does not fit anymore\n if (part === '-') {\n shortenedParts.pop();\n }\n\n break;\n }\n }\n }\n\n return shortenedParts.join('');\n}\n\n\nfunction shortenLine(line, width, maxWidth) {\n var length = Math.max(line.length * (maxWidth / width), 1);\n\n // try to shorten semantically (i.e. based on spaces and hyphens)\n var shortenedLine = semanticShorten(line, length);\n\n if (!shortenedLine) {\n\n // force shorten by cutting the long word\n shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));\n }\n\n return shortenedLine;\n}\n\n\n/**\n * Creates a new label utility\n *\n * @param {Object} config\n * @param {Dimensions} config.size\n * @param {Number} config.padding\n * @param {Object} config.style\n * @param {String} config.align\n */\nfunction Text(config) {\n\n this._config = assign({}, {\n size: DEFAULT_LABEL_SIZE,\n padding: DEFAULT_BOX_PADDING,\n style: {},\n align: 'center-top'\n }, config || {});\n}\n\n\n/**\n * Create a label in the parent node.\n *\n * @method Text#createText\n *\n * @param {SVGElement} parent the parent to draw the label on\n * @param {String} text the text to render on the label\n * @param {Object} options\n * @param {String} options.align how to align in the bounding box.\n * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.\n * @param {String} options.style style to be applied to the text\n *\n * @return {SVGText} the text element created\n */\nText.prototype.createText = function(parent, text, options) {\n\n var box = merge({}, this._config.size, options.box || {}),\n style = merge({}, this._config.style, options.style || {}),\n align = parseAlign(options.align || this._config.align),\n padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);\n\n var lines = text.split(//r?/n/g),\n layouted = [];\n\n var maxWidth = box.width - padding.left - padding.right;\n\n // FF regression: ensure text is shown during rendering\n // by attaching it directly to the body\n var fakeText = parent.paper.text(0, 0, '').attr(style).node;\n\n while (lines.length) {\n layouted.push(layoutNext(lines, maxWidth, fakeText));\n }\n\n var totalHeight = reduce(layouted, function(sum, line, idx) {\n return sum + line.height;\n }, 0);\n\n // the y position of the next line\n var y, x;\n\n switch (align.vertical) {\n case 'middle':\n y = (box.height - totalHeight) / 2 - layouted[0].height / 4;\n break;\n\n default:\n y = padding.top;\n }\n\n var textElement = parent.text().attr(style);\n\n forEach(layouted, function(line) {\n y += line.height;\n\n switch (align.horizontal) {\n case 'left':\n x = padding.left;\n break;\n\n case 'right':\n x = (maxWidth - padding.right - line.width);\n break;\n\n default:\n // aka center\n x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);\n }\n\n\n var tspan = Snap.create('tspan', { x: x, y: y }).node;\n tspan.textContent = line.text;\n\n textElement.append(tspan);\n });\n\n // remove fake text\n fakeText.parentNode.removeChild(fakeText);\n\n return textElement;\n};\n\n\nmodule.exports = Text;","// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ┌────────────────────────────────────────────────────────────┐ //\n// │ Eve 0.4.2 - JavaScript Events Library │ //\n// ├────────────────────────────────────────────────────────────┤ //\n// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ //\n// └────────────────────────────────────────────────────────────┘ //\n\n(function (glob) {\n var version = \"0.4.2\",\n has = \"hasOwnProperty\",\n separator = /[/.//]/,\n comaseparator = //s*,/s*/,\n wildcard = \"*\",\n fun = function () {},\n numsort = function (a, b) {\n return a - b;\n },\n current_event,\n stop,\n events = {n: {}},\n firstDefined = function () {\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n lastDefined = function () {\n var i = this.length;\n while (--i) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n /*/\n * eve\n [ method ]\n\n * Fires event with given `name`, given scope and other parameters.\n\n > Arguments\n\n - name (string) name of the *event*, dot (`.`) or slash (`/`) separated\n - scope (object) context for the event handlers\n - varargs (...) the rest of arguments will be sent to event handlers\n\n = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.\n /*/\n eve = function (name, scope) {\n name = String(name);\n var e = events,\n oldstop = stop,\n args = Array.prototype.slice.call(arguments, 2),\n listeners = eve.listeners(name),\n z = 0,\n f = false,\n l,\n indexed = [],\n queue = {},\n out = [],\n ce = current_event,\n errors = [];\n out.firstDefined = firstDefined;\n out.lastDefined = lastDefined;\n current_event = name;\n stop = 0;\n for (var i = 0, ii = listeners.length; i < ii; i++) if (\"zIndex\" in listeners[i]) {\n indexed.push(listeners[i].zIndex);\n if (listeners[i].zIndex < 0) {\n queue[listeners[i].zIndex] = listeners[i];\n }\n }\n indexed.sort(numsort);\n while (indexed[z] < 0) {\n l = queue[indexed[z++]];\n out.push(l.apply(scope, args));\n if (stop) {\n stop = oldstop;\n return out;\n }\n }\n for (i = 0; i < ii; i++) {\n l = listeners[i];\n if (\"zIndex\" in l) {\n if (l.zIndex == indexed[z]) {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n do {\n z++;\n l = queue[indexed[z]];\n l && out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n } while (l)\n } else {\n queue[l.zIndex] = l;\n }\n } else {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n }\n }\n stop = oldstop;\n current_event = ce;\n return out;\n };\n // Undocumented. Debug only.\n eve._events = events;\n /*/\n * eve.listeners\n [ method ]\n\n * Internal method which gives you array of all event handlers that will be triggered by the given `name`.\n\n > Arguments\n\n - name (string) name of the event, dot (`.`) or slash (`/`) separated\n\n = (array) array of event handlers\n /*/\n eve.listeners = function (name) {\n var names = name.split(separator),\n e = events,\n item,\n items,\n k,\n i,\n ii,\n j,\n jj,\n nes,\n es = [e],\n out = [];\n for (i = 0, ii = names.length; i < ii; i++) {\n nes = [];\n for (j = 0, jj = es.length; j < jj; j++) {\n e = es[j].n;\n items = [e[names[i]], e[wildcard]];\n k = 2;\n while (k--) {\n item = items[k];\n if (item) {\n nes.push(item);\n out = out.concat(item.f || []);\n }\n }\n }\n es = nes;\n }\n return out;\n };\n \n /*/\n * eve.on\n [ method ]\n **\n * Binds given event handler with a given name. You can use wildcards “`*`” for the names:\n | eve.on(\"*.under.*\", f);\n | eve(\"mouse.under.floor\"); // triggers f\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. \n > Example:\n | eve.on(\"mouse\", eatIt)(2);\n | eve.on(\"mouse\", scream);\n | eve.on(\"mouse\", catchIt)(1);\n * This will ensure that `catchIt` function will be called before `eatIt`.\n *\n * If you want to put your handler before non-indexed handlers, specify a negative value.\n * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.\n /*/\n eve.on = function (name, f) {\n name = String(name);\n if (typeof f != \"function\") {\n return function () {};\n }\n var names = name.split(comaseparator);\n for (var i = 0, ii = names.length; i < ii; i++) {\n (function (name) {\n var names = name.split(separator),\n e = events,\n exist;\n for (var i = 0, ii = names.length; i < ii; i++) {\n e = e.n;\n e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});\n }\n e.f = e.f || [];\n for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {\n exist = true;\n break;\n }\n !exist && e.f.push(f);\n }(names[i]));\n }\n return function (zIndex) {\n if (+zIndex == +zIndex) {\n f.zIndex = +zIndex;\n }\n };\n };\n /*/\n * eve.f\n [ method ]\n **\n * Returns function that will fire given event with optional arguments.\n * Arguments that will be passed to the result function will be also\n * concated to the list of final arguments.\n | el.onclick = eve.f(\"click\", 1, 2);\n | eve.on(\"click\", function (a, b, c) {\n | console.log(a, b, c); // 1, 2, [event object]\n | });\n > Arguments\n - event (string) event name\n - varargs (…) and any other arguments\n = (function) possible event handler function\n /*/\n eve.f = function (event) {\n var attrs = [].slice.call(arguments, 1);\n return function () {\n eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));\n };\n };\n /*/\n * eve.stop\n [ method ]\n **\n * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.\n /*/\n eve.stop = function () {\n stop = 1;\n };\n /*/\n * eve.nt\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n > Arguments\n **\n - subname (string) #optional subname of the event\n **\n = (string) name of the event, if `subname` is not specified\n * or\n = (boolean) `true`, if current event’s name contains `subname`\n /*/\n eve.nt = function (subname) {\n if (subname) {\n return new RegExp(\"(?://.|///|^)\" + subname + \"(?://.|///|$)\").test(current_event);\n }\n return current_event;\n };\n /*/\n * eve.nts\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n **\n = (array) names of the event\n /*/\n eve.nts = function () {\n return current_event.split(separator);\n };\n /*/\n * eve.off\n [ method ]\n **\n * Removes given function from the list of event listeners assigned to given name.\n * If no arguments specified all the events will be cleared.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n /*/\n /*/\n * eve.unbind\n [ method ]\n **\n * See @eve.off\n /*/\n eve.off = eve.unbind = function (name, f) {\n if (!name) {\n eve._events = events = {n: {}};\n return;\n }\n var names = name.split(comaseparator);\n if (names.length > 1) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n eve.off(names[i], f);\n }\n return;\n }\n names = name.split(separator);\n var e,\n key,\n splice,\n i, ii, j, jj,\n cur = [events];\n for (i = 0, ii = names.length; i < ii; i++) {\n for (j = 0; j < cur.length; j += splice.length - 2) {\n splice = [j, 1];\n e = cur[j].n;\n if (names[i] != wildcard) {\n if (e[names[i]]) {\n splice.push(e[names[i]]);\n }\n } else {\n for (key in e) if (e[has](key)) {\n splice.push(e[key]);\n }\n }\n cur.splice.apply(cur, splice);\n }\n }\n for (i = 0, ii = cur.length; i < ii; i++) {\n e = cur[i];\n while (e.n) {\n if (f) {\n if (e.f) {\n for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {\n e.f.splice(j, 1);\n break;\n }\n !e.f.length && delete e.f;\n }\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n var funcs = e.n[key].f;\n for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {\n funcs.splice(j, 1);\n break;\n }\n !funcs.length && delete e.n[key].f;\n }\n } else {\n delete e.f;\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n delete e.n[key].f;\n }\n }\n e = e.n;\n }\n }\n };\n /*/\n * eve.once\n [ method ]\n **\n * Binds given event handler with a given name to only run once then unbind itself.\n | eve.once(\"login\", f);\n | eve(\"login\"); // triggers f\n | eve(\"login\"); // no listeners\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) same return function as @eve.on\n /*/\n eve.once = function (name, f) {\n var f2 = function () {\n eve.unbind(name, f2);\n return f.apply(this, arguments);\n };\n return eve.on(name, f2);\n };\n /*/\n * eve.version\n [ property (string) ]\n **\n * Current version of the library.\n /*/\n eve.version = version;\n eve.toString = function () {\n return \"You are running Eve \" + version;\n };\n (typeof module != \"undefined\" && module.exports) ? (module.exports = eve) : (typeof define === \"function\" && define.amd ? (define(\"eve\", [], function() { return eve; })) : (glob.eve = eve));\n})(this);\n","/*! Hammer.JS - v2.0.4 - 2014-09-28\r\n * http://hammerjs.github.io/\r\n *\r\n * Copyright (c) 2014 Jorik Tangelder;\r\n * Licensed under the MIT license */\r\n(function(window, document, exportName, undefined) {\r\n 'use strict';\r\n\r\nvar VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];\r\nvar TEST_ELEMENT = document.createElement('div');\r\n\r\nvar TYPE_FUNCTION = 'function';\r\n\r\nvar round = Math.round;\r\nvar abs = Math.abs;\r\nvar now = Date.now;\r\n\r\n/**\r\n * set a timeout with a given scope\r\n * @param {Function} fn\r\n * @param {Number} timeout\r\n * @param {Object} context\r\n * @returns {number}\r\n */\r\nfunction setTimeoutContext(fn, timeout, context) {\r\n return setTimeout(bindFn(fn, context), timeout);\r\n}\r\n\r\n/**\r\n * if the argument is an array, we want to execute the fn on each entry\r\n * if it aint an array we don't want to do a thing.\r\n * this is used by all the methods that accept a single and array argument.\r\n * @param {*|Array} arg\r\n * @param {String} fn\r\n * @param {Object} [context]\r\n * @returns {Boolean}\r\n */\r\nfunction invokeArrayArg(arg, fn, context) {\r\n if (Array.isArray(arg)) {\r\n each(arg, context[fn], context);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * walk objects and arrays\r\n * @param {Object} obj\r\n * @param {Function} iterator\r\n * @param {Object} context\r\n */\r\nfunction each(obj, iterator, context) {\r\n var i;\r\n\r\n if (!obj) {\r\n return;\r\n }\r\n\r\n if (obj.forEach) {\r\n obj.forEach(iterator, context);\r\n } else if (obj.length !== undefined) {\r\n i = 0;\r\n while (i < obj.length) {\r\n iterator.call(context, obj[i], i, obj);\r\n i++;\r\n }\r\n } else {\r\n for (i in obj) {\r\n obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * extend object.\r\n * means that properties in dest will be overwritten by the ones in src.\r\n * @param {Object} dest\r\n * @param {Object} src\r\n * @param {Boolean} [merge]\r\n * @returns {Object} dest\r\n */\r\nfunction extend(dest, src, merge) {\r\n var keys = Object.keys(src);\r\n var i = 0;\r\n while (i < keys.length) {\r\n if (!merge || (merge && dest[keys[i]] === undefined)) {\r\n dest[keys[i]] = src[keys[i]];\r\n }\r\n i++;\r\n }\r\n return dest;\r\n}\r\n\r\n/**\r\n * merge the values from src in the dest.\r\n * means that properties that exist in dest will not be overwritten by src\r\n * @param {Object} dest\r\n * @param {Object} src\r\n * @returns {Object} dest\r\n */\r\nfunction merge(dest, src) {\r\n return extend(dest, src, true);\r\n}\r\n\r\n/**\r\n * simple class inheritance\r\n * @param {Function} child\r\n * @param {Function} base\r\n * @param {Object} [properties]\r\n */\r\nfunction inherit(child, base, properties) {\r\n var baseP = base.prototype,\r\n childP;\r\n\r\n childP = child.prototype = Object.create(baseP);\r\n childP.constructor = child;\r\n childP._super = baseP;\r\n\r\n if (properties) {\r\n extend(childP, properties);\r\n }\r\n}\r\n\r\n/**\r\n * simple function bind\r\n * @param {Function} fn\r\n * @param {Object} context\r\n * @returns {Function}\r\n */\r\nfunction bindFn(fn, context) {\r\n return function boundFn() {\r\n return fn.apply(context, arguments);\r\n };\r\n}\r\n\r\n/**\r\n * let a boolean value also be a function that must return a boolean\r\n * this first item in args will be used as the context\r\n * @param {Boolean|Function} val\r\n * @param {Array} [args]\r\n * @returns {Boolean}\r\n */\r\nfunction boolOrFn(val, args) {\r\n if (typeof val == TYPE_FUNCTION) {\r\n return val.apply(args ? args[0] || undefined : undefined, args);\r\n }\r\n return val;\r\n}\r\n\r\n/**\r\n * use the val2 when val1 is undefined\r\n * @param {*} val1\r\n * @param {*} val2\r\n * @returns {*}\r\n */\r\nfunction ifUndefined(val1, val2) {\r\n return (val1 === undefined) ? val2 : val1;\r\n}\r\n\r\n/**\r\n * addEventListener with multiple events at once\r\n * @param {EventTarget} target\r\n * @param {String} types\r\n * @param {Function} handler\r\n */\r\nfunction addEventListeners(target, types, handler) {\r\n each(splitStr(types), function(type) {\r\n target.addEventListener(type, handler, false);\r\n });\r\n}\r\n\r\n/**\r\n * removeEventListener with multiple events at once\r\n * @param {EventTarget} target\r\n * @param {String} types\r\n * @param {Function} handler\r\n */\r\nfunction removeEventListeners(target, types, handler) {\r\n each(splitStr(types), function(type) {\r\n target.removeEventListener(type, handler, false);\r\n });\r\n}\r\n\r\n/**\r\n * find if a node is in the given parent\r\n * @method hasParent\r\n * @param {HTMLElement} node\r\n * @param {HTMLElement} parent\r\n * @return {Boolean} found\r\n */\r\nfunction hasParent(node, parent) {\r\n while (node) {\r\n if (node == parent) {\r\n return true;\r\n }\r\n node = node.parentNode;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * small indexOf wrapper\r\n * @param {String} str\r\n * @param {String} find\r\n * @returns {Boolean} found\r\n */\r\nfunction inStr(str, find) {\r\n return str.indexOf(find) > -1;\r\n}\r\n\r\n/**\r\n * split string on whitespace\r\n * @param {String} str\r\n * @returns {Array} words\r\n */\r\nfunction splitStr(str) {\r\n return str.trim().split(//s+/g);\r\n}\r\n\r\n/**\r\n * find if a array contains the object using indexOf or a simple polyFill\r\n * @param {Array} src\r\n * @param {String} find\r\n * @param {String} [findByKey]\r\n * @return {Boolean|Number} false when not found, or the index\r\n */\r\nfunction inArray(src, find, findByKey) {\r\n if (src.indexOf && !findByKey) {\r\n return src.indexOf(find);\r\n } else {\r\n var i = 0;\r\n while (i < src.length) {\r\n if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\r\n return i;\r\n }\r\n i++;\r\n }\r\n return -1;\r\n }\r\n}\r\n\r\n/**\r\n * convert array-like objects to real arrays\r\n * @param {Object} obj\r\n * @returns {Array}\r\n */\r\nfunction toArray(obj) {\r\n return Array.prototype.slice.call(obj, 0);\r\n}\r\n\r\n/**\r\n * unique array with objects based on a key (like 'id') or just by the array's value\r\n * @param {Array} src [{id:1},{id:2},{id:1}]\r\n * @param {String} [key]\r\n * @param {Boolean} [sort=False]\r\n * @returns {Array} [{id:1},{id:2}]\r\n */\r\nfunction uniqueArray(src, key, sort) {\r\n var results = [];\r\n var values = [];\r\n var i = 0;\r\n\r\n while (i < src.length) {\r\n var val = key ? src[i][key] : src[i];\r\n if (inArray(values, val) < 0) {\r\n results.push(src[i]);\r\n }\r\n values[i] = val;\r\n i++;\r\n }\r\n\r\n if (sort) {\r\n if (!key) {\r\n results = results.sort();\r\n } else {\r\n results = results.sort(function sortUniqueArray(a, b) {\r\n return a[key] > b[key];\r\n });\r\n }\r\n }\r\n\r\n return results;\r\n}\r\n\r\n/**\r\n * get the prefixed property\r\n * @param {Object} obj\r\n * @param {String} property\r\n * @returns {String|Undefined} prefixed\r\n */\r\nfunction prefixed(obj, property) {\r\n var prefix, prop;\r\n var camelProp = property[0].toUpperCase() + property.slice(1);\r\n\r\n var i = 0;\r\n while (i < VENDOR_PREFIXES.length) {\r\n prefix = VENDOR_PREFIXES[i];\r\n prop = (prefix) ? prefix + camelProp : property;\r\n\r\n if (prop in obj) {\r\n return prop;\r\n }\r\n i++;\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * get a unique id\r\n * @returns {number} uniqueId\r\n */\r\nvar _uniqueId = 1;\r\nfunction uniqueId() {\r\n return _uniqueId++;\r\n}\r\n\r\n/**\r\n * get the window object of an element\r\n * @param {HTMLElement} element\r\n * @returns {DocumentView|Window}\r\n */\r\nfunction getWindowForElement(element) {\r\n var doc = element.ownerDocument;\r\n return (doc.defaultView || doc.parentWindow);\r\n}\r\n\r\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\r\n\r\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\r\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\r\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\r\n\r\nvar INPUT_TYPE_TOUCH = 'touch';\r\nvar INPUT_TYPE_PEN = 'pen';\r\nvar INPUT_TYPE_MOUSE = 'mouse';\r\nvar INPUT_TYPE_KINECT = 'kinect';\r\n\r\nvar COMPUTE_INTERVAL = 25;\r\n\r\nvar INPUT_START = 1;\r\nvar INPUT_MOVE = 2;\r\nvar INPUT_END = 4;\r\nvar INPUT_CANCEL = 8;\r\n\r\nvar DIRECTION_NONE = 1;\r\nvar DIRECTION_LEFT = 2;\r\nvar DIRECTION_RIGHT = 4;\r\nvar DIRECTION_UP = 8;\r\nvar DIRECTION_DOWN = 16;\r\n\r\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\r\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\r\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\r\n\r\nvar PROPS_XY = ['x', 'y'];\r\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\r\n\r\n/**\r\n * create new input type manager\r\n * @param {Manager} manager\r\n * @param {Function} callback\r\n * @returns {Input}\r\n * @constructor\r\n */\r\nfunction Input(manager, callback) {\r\n var self = this;\r\n this.manager = manager;\r\n this.callback = callback;\r\n this.element = manager.element;\r\n this.target = manager.options.inputTarget;\r\n\r\n // smaller wrapper around the handler, for the scope and the enabled state of the manager,\r\n // so when disabled the input events are completely bypassed.\r\n this.domHandler = function(ev) {\r\n if (boolOrFn(manager.options.enable, [manager])) {\r\n self.handler(ev);\r\n }\r\n };\r\n\r\n this.init();\r\n\r\n}\r\n\r\nInput.prototype = {\r\n /**\r\n * should handle the inputEvent data and trigger the callback\r\n * @virtual\r\n */\r\n handler: function() { },\r\n\r\n /**\r\n * bind the events\r\n */\r\n init: function() {\r\n this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\r\n this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\r\n this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\r\n },\r\n\r\n /**\r\n * unbind the events\r\n */\r\n destroy: function() {\r\n this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\r\n this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\r\n this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\r\n }\r\n};\r\n\r\n/**\r\n * create new input type manager\r\n * called by the Manager constructor\r\n * @param {Hammer} manager\r\n * @returns {Input}\r\n */\r\nfunction createInputInstance(manager) {\r\n var Type;\r\n var inputClass = manager.options.inputClass;\r\n\r\n if (inputClass) {\r\n Type = inputClass;\r\n } else if (SUPPORT_POINTER_EVENTS) {\r\n Type = PointerEventInput;\r\n } else if (SUPPORT_ONLY_TOUCH) {\r\n Type = TouchInput;\r\n } else if (!SUPPORT_TOUCH) {\r\n Type = MouseInput;\r\n } else {\r\n Type = TouchMouseInput;\r\n }\r\n return new (Type)(manager, inputHandler);\r\n}\r\n\r\n/**\r\n * handle input events\r\n * @param {Manager} manager\r\n * @param {String} eventType\r\n * @param {Object} input\r\n */\r\nfunction inputHandler(manager, eventType, input) {\r\n var pointersLen = input.pointers.length;\r\n var changedPointersLen = input.changedPointers.length;\r\n var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\r\n var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\r\n\r\n input.isFirst = !!isFirst;\r\n input.isFinal = !!isFinal;\r\n\r\n if (isFirst) {\r\n manager.session = {};\r\n }\r\n\r\n // source event is the normalized value of the domEvents\r\n // like 'touchstart, mouseup, pointerdown'\r\n input.eventType = eventType;\r\n\r\n // compute scale, rotation etc\r\n computeInputData(manager, input);\r\n\r\n // emit secret event\r\n manager.emit('hammer.input', input);\r\n\r\n manager.recognize(input);\r\n manager.session.prevInput = input;\r\n}\r\n\r\n/**\r\n * extend the data with some usable properties like scale, rotate, velocity etc\r\n * @param {Object} manager\r\n * @param {Object} input\r\n */\r\nfunction computeInputData(manager, input) {\r\n var session = manager.session;\r\n var pointers = input.pointers;\r\n var pointersLength = pointers.length;\r\n\r\n // store the first input to calculate the distance and direction\r\n if (!session.firstInput) {\r\n session.firstInput = simpleCloneInputData(input);\r\n }\r\n\r\n // to compute scale and rotation we need to store the multiple touches\r\n if (pointersLength > 1 && !session.firstMultiple) {\r\n session.firstMultiple = simpleCloneInputData(input);\r\n } else if (pointersLength === 1) {\r\n session.firstMultiple = false;\r\n }\r\n\r\n var firstInput = session.firstInput;\r\n var firstMultiple = session.firstMultiple;\r\n var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\r\n\r\n var center = input.center = getCenter(pointers);\r\n input.timeStamp = now();\r\n input.deltaTime = input.timeStamp - firstInput.timeStamp;\r\n\r\n input.angle = getAngle(offsetCenter, center);\r\n input.distance = getDistance(offsetCenter, center);\r\n\r\n computeDeltaXY(session, input);\r\n input.offsetDirection = getDirection(input.deltaX, input.deltaY);\r\n\r\n input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\r\n input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\r\n\r\n computeIntervalInputData(session, input);\r\n\r\n // find the correct target\r\n var target = manager.element;\r\n if (hasParent(input.srcEvent.target, target)) {\r\n target = input.srcEvent.target;\r\n }\r\n input.target = target;\r\n}\r\n\r\nfunction computeDeltaXY(session, input) {\r\n var center = input.center;\r\n var offset = session.offsetDelta || {};\r\n var prevDelta = session.prevDelta || {};\r\n var prevInput = session.prevInput || {};\r\n\r\n if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\r\n prevDelta = session.prevDelta = {\r\n x: prevInput.deltaX || 0,\r\n y: prevInput.deltaY || 0\r\n };\r\n\r\n offset = session.offsetDelta = {\r\n x: center.x,\r\n y: center.y\r\n };\r\n }\r\n\r\n input.deltaX = prevDelta.x + (center.x - offset.x);\r\n input.deltaY = prevDelta.y + (center.y - offset.y);\r\n}\r\n\r\n/**\r\n * velocity is calculated every x ms\r\n * @param {Object} session\r\n * @param {Object} input\r\n */\r\nfunction computeIntervalInputData(session, input) {\r\n var last = session.lastInterval || input,\r\n deltaTime = input.timeStamp - last.timeStamp,\r\n velocity, velocityX, velocityY, direction;\r\n\r\n if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\r\n var deltaX = last.deltaX - input.deltaX;\r\n var deltaY = last.deltaY - input.deltaY;\r\n\r\n var v = getVelocity(deltaTime, deltaX, deltaY);\r\n velocityX = v.x;\r\n velocityY = v.y;\r\n velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\r\n direction = getDirection(deltaX, deltaY);\r\n\r\n session.lastInterval = input;\r\n } else {\r\n // use latest velocity info if it doesn't overtake a minimum period\r\n velocity = last.velocity;\r\n velocityX = last.velocityX;\r\n velocityY = last.velocityY;\r\n direction = last.direction;\r\n }\r\n\r\n input.velocity = velocity;\r\n input.velocityX = velocityX;\r\n input.velocityY = velocityY;\r\n input.direction = direction;\r\n}\r\n\r\n/**\r\n * create a simple clone from the input used for storage of firstInput and firstMultiple\r\n * @param {Object} input\r\n * @returns {Object} clonedInputData\r\n */\r\nfunction simpleCloneInputData(input) {\r\n // make a simple copy of the pointers because we will get a reference if we don't\r\n // we only need clientXY for the calculations\r\n var pointers = [];\r\n var i = 0;\r\n while (i < input.pointers.length) {\r\n pointers[i] = {\r\n clientX: round(input.pointers[i].clientX),\r\n clientY: round(input.pointers[i].clientY)\r\n };\r\n i++;\r\n }\r\n\r\n return {\r\n timeStamp: now(),\r\n pointers: pointers,\r\n center: getCenter(pointers),\r\n deltaX: input.deltaX,\r\n deltaY: input.deltaY\r\n };\r\n}\r\n\r\n/**\r\n * get the center of all the pointers\r\n * @param {Array} pointers\r\n * @return {Object} center contains `x` and `y` properties\r\n */\r\nfunction getCenter(pointers) {\r\n var pointersLength = pointers.length;\r\n\r\n // no need to loop when only one touch\r\n if (pointersLength === 1) {\r\n return {\r\n x: round(pointers[0].clientX),\r\n y: round(pointers[0].clientY)\r\n };\r\n }\r\n\r\n var x = 0, y = 0, i = 0;\r\n while (i < pointersLength) {\r\n x += pointers[i].clientX;\r\n y += pointers[i].clientY;\r\n i++;\r\n }\r\n\r\n return {\r\n x: round(x / pointersLength),\r\n y: round(y / pointersLength)\r\n };\r\n}\r\n\r\n/**\r\n * calculate the velocity between two points. unit is in px per ms.\r\n * @param {Number} deltaTime\r\n * @param {Number} x\r\n * @param {Number} y\r\n * @return {Object} velocity `x` and `y`\r\n */\r\nfunction getVelocity(deltaTime, x, y) {\r\n return {\r\n x: x / deltaTime || 0,\r\n y: y / deltaTime || 0\r\n };\r\n}\r\n\r\n/**\r\n * get the direction between two points\r\n * @param {Number} x\r\n * @param {Number} y\r\n * @return {Number} direction\r\n */\r\nfunction getDirection(x, y) {\r\n if (x === y) {\r\n return DIRECTION_NONE;\r\n }\r\n\r\n if (abs(x) >= abs(y)) {\r\n return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\r\n }\r\n return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;\r\n}\r\n\r\n/**\r\n * calculate the absolute distance between two points\r\n * @param {Object} p1 {x, y}\r\n * @param {Object} p2 {x, y}\r\n * @param {Array} [props] containing x and y keys\r\n * @return {Number} distance\r\n */\r\nfunction getDistance(p1, p2, props) {\r\n if (!props) {\r\n props = PROPS_XY;\r\n }\r\n var x = p2[props[0]] - p1[props[0]],\r\n y = p2[props[1]] - p1[props[1]];\r\n\r\n return Math.sqrt((x * x) + (y * y));\r\n}\r\n\r\n/**\r\n * calculate the angle between two coordinates\r\n * @param {Object} p1\r\n * @param {Object} p2\r\n * @param {Array} [props] containing x and y keys\r\n * @return {Number} angle\r\n */\r\nfunction getAngle(p1, p2, props) {\r\n if (!props) {\r\n props = PROPS_XY;\r\n }\r\n var x = p2[props[0]] - p1[props[0]],\r\n y = p2[props[1]] - p1[props[1]];\r\n return Math.atan2(y, x) * 180 / Math.PI;\r\n}\r\n\r\n/**\r\n * calculate the rotation degrees between two pointersets\r\n * @param {Array} start array of pointers\r\n * @param {Array} end array of pointers\r\n * @return {Number} rotation\r\n */\r\nfunction getRotation(start, end) {\r\n return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);\r\n}\r\n\r\n/**\r\n * calculate the scale factor between two pointersets\r\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\r\n * @param {Array} start array of pointers\r\n * @param {Array} end array of pointers\r\n * @return {Number} scale\r\n */\r\nfunction getScale(start, end) {\r\n return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\r\n}\r\n\r\nvar MOUSE_INPUT_MAP = {\r\n mousedown: INPUT_START,\r\n mousemove: INPUT_MOVE,\r\n mouseup: INPUT_END\r\n};\r\n\r\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\r\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\r\n\r\n/**\r\n * Mouse events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction MouseInput() {\r\n this.evEl = MOUSE_ELEMENT_EVENTS;\r\n this.evWin = MOUSE_WINDOW_EVENTS;\r\n\r\n this.allow = true; // used by Input.TouchMouse to disable mouse events\r\n this.pressed = false; // mousedown state\r\n\r\n Input.apply(this, arguments);\r\n}\r\n\r\ninherit(MouseInput, Input, {\r\n /**\r\n * handle mouse events\r\n * @param {Object} ev\r\n */\r\n handler: function MEhandler(ev) {\r\n var eventType = MOUSE_INPUT_MAP[ev.type];\r\n\r\n // on start we want to have the left mouse button down\r\n if (eventType & INPUT_START && ev.button === 0) {\r\n this.pressed = true;\r\n }\r\n\r\n if (eventType & INPUT_MOVE && ev.which !== 1) {\r\n eventType = INPUT_END;\r\n }\r\n\r\n // mouse must be down, and mouse events are allowed (see the TouchMouse input)\r\n if (!this.pressed || !this.allow) {\r\n return;\r\n }\r\n\r\n if (eventType & INPUT_END) {\r\n this.pressed = false;\r\n }\r\n\r\n this.callback(this.manager, eventType, {\r\n pointers: [ev],\r\n changedPointers: [ev],\r\n pointerType: INPUT_TYPE_MOUSE,\r\n srcEvent: ev\r\n });\r\n }\r\n});\r\n\r\nvar POINTER_INPUT_MAP = {\r\n pointerdown: INPUT_START,\r\n pointermove: INPUT_MOVE,\r\n pointerup: INPUT_END,\r\n pointercancel: INPUT_CANCEL,\r\n pointerout: INPUT_CANCEL\r\n};\r\n\r\n// in IE10 the pointer types is defined as an enum\r\nvar IE10_POINTER_TYPE_ENUM = {\r\n 2: INPUT_TYPE_TOUCH,\r\n 3: INPUT_TYPE_PEN,\r\n 4: INPUT_TYPE_MOUSE,\r\n 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\r\n};\r\n\r\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\r\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\r\n\r\n// IE10 has prefixed support, and case-sensitive\r\nif (window.MSPointerEvent) {\r\n POINTER_ELEMENT_EVENTS = 'MSPointerDown';\r\n POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\r\n}\r\n\r\n/**\r\n * Pointer events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction PointerEventInput() {\r\n this.evEl = POINTER_ELEMENT_EVENTS;\r\n this.evWin = POINTER_WINDOW_EVENTS;\r\n\r\n Input.apply(this, arguments);\r\n\r\n this.store = (this.manager.session.pointerEvents = []);\r\n}\r\n\r\ninherit(PointerEventInput, Input, {\r\n /**\r\n * handle mouse events\r\n * @param {Object} ev\r\n */\r\n handler: function PEhandler(ev) {\r\n var store = this.store;\r\n var removePointer = false;\r\n\r\n var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\r\n var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\r\n var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\r\n\r\n var isTouch = (pointerType == INPUT_TYPE_TOUCH);\r\n\r\n // get index of the event in the store\r\n var storeIndex = inArray(store, ev.pointerId, 'pointerId');\r\n\r\n // start and mouse must be down\r\n if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\r\n if (storeIndex < 0) {\r\n store.push(ev);\r\n storeIndex = store.length - 1;\r\n }\r\n } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\r\n removePointer = true;\r\n }\r\n\r\n // it not found, so the pointer hasn't been down (so it's probably a hover)\r\n if (storeIndex < 0) {\r\n return;\r\n }\r\n\r\n // update the event in the store\r\n store[storeIndex] = ev;\r\n\r\n this.callback(this.manager, eventType, {\r\n pointers: store,\r\n changedPointers: [ev],\r\n pointerType: pointerType,\r\n srcEvent: ev\r\n });\r\n\r\n if (removePointer) {\r\n // remove from the store\r\n store.splice(storeIndex, 1);\r\n }\r\n }\r\n});\r\n\r\nvar SINGLE_TOUCH_INPUT_MAP = {\r\n touchstart: INPUT_START,\r\n touchmove: INPUT_MOVE,\r\n touchend: INPUT_END,\r\n touchcancel: INPUT_CANCEL\r\n};\r\n\r\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\r\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\r\n\r\n/**\r\n * Touch events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction SingleTouchInput() {\r\n this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\r\n this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\r\n this.started = false;\r\n\r\n Input.apply(this, arguments);\r\n}\r\n\r\ninherit(SingleTouchInput, Input, {\r\n handler: function TEhandler(ev) {\r\n var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\r\n\r\n // should we handle the touch events?\r\n if (type === INPUT_START) {\r\n this.started = true;\r\n }\r\n\r\n if (!this.started) {\r\n return;\r\n }\r\n\r\n var touches = normalizeSingleTouches.call(this, ev, type);\r\n\r\n // when done, reset the started state\r\n if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\r\n this.started = false;\r\n }\r\n\r\n this.callback(this.manager, type, {\r\n pointers: touches[0],\r\n changedPointers: touches[1],\r\n pointerType: INPUT_TYPE_TOUCH,\r\n srcEvent: ev\r\n });\r\n }\r\n});\r\n\r\n/**\r\n * @this {TouchInput}\r\n * @param {Object} ev\r\n * @param {Number} type flag\r\n * @returns {undefined|Array} [all, changed]\r\n */\r\nfunction normalizeSingleTouches(ev, type) {\r\n var all = toArray(ev.touches);\r\n var changed = toArray(ev.changedTouches);\r\n\r\n if (type & (INPUT_END | INPUT_CANCEL)) {\r\n all = uniqueArray(all.concat(changed), 'identifier', true);\r\n }\r\n\r\n return [all, changed];\r\n}\r\n\r\nvar TOUCH_INPUT_MAP = {\r\n touchstart: INPUT_START,\r\n touchmove: INPUT_MOVE,\r\n touchend: INPUT_END,\r\n touchcancel: INPUT_CANCEL\r\n};\r\n\r\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\r\n\r\n/**\r\n * Multi-user touch events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction TouchInput() {\r\n this.evTarget = TOUCH_TARGET_EVENTS;\r\n this.targetIds = {};\r\n\r\n Input.apply(this, arguments);\r\n}\r\n\r\ninherit(TouchInput, Input, {\r\n handler: function MTEhandler(ev) {\r\n var type = TOUCH_INPUT_MAP[ev.type];\r\n var touches = getTouches.call(this, ev, type);\r\n if (!touches) {\r\n return;\r\n }\r\n\r\n this.callback(this.manager, type, {\r\n pointers: touches[0],\r\n changedPointers: touches[1],\r\n pointerType: INPUT_TYPE_TOUCH,\r\n srcEvent: ev\r\n });\r\n }\r\n});\r\n\r\n/**\r\n * @this {TouchInput}\r\n * @param {Object} ev\r\n * @param {Number} type flag\r\n * @returns {undefined|Array} [all, changed]\r\n */\r\nfunction getTouches(ev, type) {\r\n var allTouches = toArray(ev.touches);\r\n var targetIds = this.targetIds;\r\n\r\n // when there is only one touch, the process can be simplified\r\n if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\r\n targetIds[allTouches[0].identifier] = true;\r\n return [allTouches, allTouches];\r\n }\r\n\r\n var i,\r\n targetTouches,\r\n changedTouches = toArray(ev.changedTouches),\r\n changedTargetTouches = [],\r\n target = this.target;\r\n\r\n // get target touches from touches\r\n targetTouches = allTouches.filter(function(touch) {\r\n return hasParent(touch.target, target);\r\n });\r\n\r\n // collect touches\r\n if (type === INPUT_START) {\r\n i = 0;\r\n while (i < targetTouches.length) {\r\n targetIds[targetTouches[i].identifier] = true;\r\n i++;\r\n }\r\n }\r\n\r\n // filter changed touches to only contain touches that exist in the collected target ids\r\n i = 0;\r\n while (i < changedTouches.length) {\r\n if (targetIds[changedTouches[i].identifier]) {\r\n changedTargetTouches.push(changedTouches[i]);\r\n }\r\n\r\n // cleanup removed touches\r\n if (type & (INPUT_END | INPUT_CANCEL)) {\r\n delete targetIds[changedTouches[i].identifier];\r\n }\r\n i++;\r\n }\r\n\r\n if (!changedTargetTouches.length) {\r\n return;\r\n }\r\n\r\n return [\r\n // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\r\n uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\r\n changedTargetTouches\r\n ];\r\n}\r\n\r\n/**\r\n * Combined touch and mouse input\r\n *\r\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\r\n * This because touch devices also emit mouse events while doing a touch.\r\n *\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction TouchMouseInput() {\r\n Input.apply(this, arguments);\r\n\r\n var handler = bindFn(this.handler, this);\r\n this.touch = new TouchInput(this.manager, handler);\r\n this.mouse = new MouseInput(this.manager, handler);\r\n}\r\n\r\ninherit(TouchMouseInput, Input, {\r\n /**\r\n * handle mouse and touch events\r\n * @param {Hammer} manager\r\n * @param {String} inputEvent\r\n * @param {Object} inputData\r\n */\r\n handler: function TMEhandler(manager, inputEvent, inputData) {\r\n var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\r\n isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\r\n\r\n // when we're in a touch event, so block all upcoming mouse events\r\n // most mobile browser also emit mouseevents, right after touchstart\r\n if (isTouch) {\r\n this.mouse.allow = false;\r\n } else if (isMouse && !this.mouse.allow) {\r\n return;\r\n }\r\n\r\n // reset the allowMouse when we're done\r\n if (inputEvent & (INPUT_END | INPUT_CANCEL)) {\r\n this.mouse.allow = true;\r\n }\r\n\r\n this.callback(manager, inputEvent, inputData);\r\n },\r\n\r\n /**\r\n * remove the event listeners\r\n */\r\n destroy: function destroy() {\r\n this.touch.destroy();\r\n this.mouse.destroy();\r\n }\r\n});\r\n\r\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\r\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\r\n\r\n// magical touchAction value\r\nvar TOUCH_ACTION_COMPUTE = 'compute';\r\nvar TOUCH_ACTION_AUTO = 'auto';\r\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\r\nvar TOUCH_ACTION_NONE = 'none';\r\nvar TOUCH_ACTION_PAN_X = 'pan-x';\r\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\r\n\r\n/**\r\n * Touch Action\r\n * sets the touchAction property or uses the js alternative\r\n * @param {Manager} manager\r\n * @param {String} value\r\n * @constructor\r\n */\r\nfunction TouchAction(manager, value) {\r\n this.manager = manager;\r\n this.set(value);\r\n}\r\n\r\nTouchAction.prototype = {\r\n /**\r\n * set the touchAction value on the element or enable the polyfill\r\n * @param {String} value\r\n */\r\n set: function(value) {\r\n // find out the touch-action by the event handlers\r\n if (value == TOUCH_ACTION_COMPUTE) {\r\n value = this.compute();\r\n }\r\n\r\n if (NATIVE_TOUCH_ACTION) {\r\n this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\r\n }\r\n this.actions = value.toLowerCase().trim();\r\n },\r\n\r\n /**\r\n * just re-set the touchAction value\r\n */\r\n update: function() {\r\n this.set(this.manager.options.touchAction);\r\n },\r\n\r\n /**\r\n * compute the value for the touchAction property based on the recognizer's settings\r\n * @returns {String} value\r\n */\r\n compute: function() {\r\n var actions = [];\r\n each(this.manager.recognizers, function(recognizer) {\r\n if (boolOrFn(recognizer.options.enable, [recognizer])) {\r\n actions = actions.concat(recognizer.getTouchAction());\r\n }\r\n });\r\n return cleanTouchActions(actions.join(' '));\r\n },\r\n\r\n /**\r\n * this method is called on each input cycle and provides the preventing of the browser behavior\r\n * @param {Object} input\r\n */\r\n preventDefaults: function(input) {\r\n // not needed with native support for the touchAction property\r\n if (NATIVE_TOUCH_ACTION) {\r\n return;\r\n }\r\n\r\n var srcEvent = input.srcEvent;\r\n var direction = input.offsetDirection;\r\n\r\n // if the touch action did prevented once this session\r\n if (this.manager.session.prevented) {\r\n srcEvent.preventDefault();\r\n return;\r\n }\r\n\r\n var actions = this.actions;\r\n var hasNone = inStr(actions, TOUCH_ACTION_NONE);\r\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\r\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\r\n\r\n if (hasNone ||\r\n (hasPanY && direction & DIRECTION_HORIZONTAL) ||\r\n (hasPanX && direction & DIRECTION_VERTICAL)) {\r\n return this.preventSrc(srcEvent);\r\n }\r\n },\r\n\r\n /**\r\n * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\r\n * @param {Object} srcEvent\r\n */\r\n preventSrc: function(srcEvent) {\r\n this.manager.session.prevented = true;\r\n srcEvent.preventDefault();\r\n }\r\n};\r\n\r\n/**\r\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\r\n * @param {String} actions\r\n * @returns {*}\r\n */\r\nfunction cleanTouchActions(actions) {\r\n // none\r\n if (inStr(actions, TOUCH_ACTION_NONE)) {\r\n return TOUCH_ACTION_NONE;\r\n }\r\n\r\n var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\r\n var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\r\n\r\n // pan-x and pan-y can be combined\r\n if (hasPanX && hasPanY) {\r\n return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;\r\n }\r\n\r\n // pan-x OR pan-y\r\n if (hasPanX || hasPanY) {\r\n return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\r\n }\r\n\r\n // manipulation\r\n if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\r\n return TOUCH_ACTION_MANIPULATION;\r\n }\r\n\r\n return TOUCH_ACTION_AUTO;\r\n}\r\n\r\n/**\r\n * Recognizer flow explained; *\r\n * All recognizers have the initial state of POSSIBLE when a input session starts.\r\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\r\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\r\n *\r\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\r\n * which determines with state it should be.\r\n *\r\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\r\n * POSSIBLE to give it another change on the next cycle.\r\n *\r\n * Possible\r\n * |\r\n * +-----+---------------+\r\n * | |\r\n * +-----+-----+ |\r\n * | | |\r\n * Failed Cancelled |\r\n * +-------+------+\r\n * | |\r\n * Recognized Began\r\n * |\r\n * Changed\r\n * |\r\n * Ended/Recognized\r\n */\r\nvar STATE_POSSIBLE = 1;\r\nvar STATE_BEGAN = 2;\r\nvar STATE_CHANGED = 4;\r\nvar STATE_ENDED = 8;\r\nvar STATE_RECOGNIZED = STATE_ENDED;\r\nvar STATE_CANCELLED = 16;\r\nvar STATE_FAILED = 32;\r\n\r\n/**\r\n * Recognizer\r\n * Every recognizer needs to extend from this class.\r\n * @constructor\r\n * @param {Object} options\r\n */\r\nfunction Recognizer(options) {\r\n this.id = uniqueId();\r\n\r\n this.manager = null;\r\n this.options = merge(options || {}, this.defaults);\r\n\r\n // default is enable true\r\n this.options.enable = ifUndefined(this.options.enable, true);\r\n\r\n this.state = STATE_POSSIBLE;\r\n\r\n this.simultaneous = {};\r\n this.requireFail = [];\r\n}\r\n\r\nRecognizer.prototype = {\r\n /**\r\n * @virtual\r\n * @type {Object}\r\n */\r\n defaults: {},\r\n\r\n /**\r\n * set options\r\n * @param {Object} options\r\n * @return {Recognizer}\r\n */\r\n set: function(options) {\r\n extend(this.options, options);\r\n\r\n // also update the touchAction, in case something changed about the directions/enabled state\r\n this.manager && this.manager.touchAction.update();\r\n return this;\r\n },\r\n\r\n /**\r\n * recognize simultaneous with an other recognizer.\r\n * @param {Recognizer} otherRecognizer\r\n * @returns {Recognizer} this\r\n */\r\n recognizeWith: function(otherRecognizer) {\r\n if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\r\n return this;\r\n }\r\n\r\n var simultaneous = this.simultaneous;\r\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n if (!simultaneous[otherRecognizer.id]) {\r\n simultaneous[otherRecognizer.id] = otherRecognizer;\r\n otherRecognizer.recognizeWith(this);\r\n }\r\n return this;\r\n },\r\n\r\n /**\r\n * drop the simultaneous link. it doesnt remove the link on the other recognizer.\r\n * @param {Recognizer} otherRecognizer\r\n * @returns {Recognizer} this\r\n */\r\n dropRecognizeWith: function(otherRecognizer) {\r\n if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\r\n return this;\r\n }\r\n\r\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n delete this.simultaneous[otherRecognizer.id];\r\n return this;\r\n },\r\n\r\n /**\r\n * recognizer can only run when an other is failing\r\n * @param {Recognizer} otherRecognizer\r\n * @returns {Recognizer} this\r\n */\r\n requireFailure: function(otherRecognizer) {\r\n if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\r\n return this;\r\n }\r\n\r\n var requireFail = this.requireFail;\r\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n if (inArray(requireFail, otherRecognizer) === -1) {\r\n requireFail.push(otherRecognizer);\r\n otherRecognizer.requireFailure(this);\r\n }\r\n return this;\r\n },\r\n\r\n /**\r\n * drop the requireFailure link. it does not remove the link on the other recognizer.\r\n * @param {Recognizer} otherRecognizer\r\n * @returns {Recognizer} this\r\n */\r\n dropRequireFailure: function(otherRecognizer) {\r\n if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\r\n return this;\r\n }\r\n\r\n otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n var index = inArray(this.requireFail, otherRecognizer);\r\n if (index > -1) {\r\n this.requireFail.splice(index, 1);\r\n }\r\n return this;\r\n },\r\n\r\n /**\r\n * has require failures boolean\r\n * @returns {boolean}\r\n */\r\n hasRequireFailures: function() {\r\n return this.requireFail.length > 0;\r\n },\r\n\r\n /**\r\n * if the recognizer can recognize simultaneous with an other recognizer\r\n * @param {Recognizer} otherRecognizer\r\n * @returns {Boolean}\r\n */\r\n canRecognizeWith: function(otherRecognizer) {\r\n return !!this.simultaneous[otherRecognizer.id];\r\n },\r\n\r\n /**\r\n * You should use `tryEmit` instead of `emit` directly to check\r\n * that all the needed recognizers has failed before emitting.\r\n * @param {Object} input\r\n */\r\n emit: function(input) {\r\n var self = this;\r\n var state = this.state;\r\n\r\n function emit(withState) {\r\n self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);\r\n }\r\n\r\n // 'panstart' and 'panmove'\r\n if (state < STATE_ENDED) {\r\n emit(true);\r\n }\r\n\r\n emit(); // simple 'eventName' events\r\n\r\n // panend and pancancel\r\n if (state >= STATE_ENDED) {\r\n emit(true);\r\n }\r\n },\r\n\r\n /**\r\n * Check that all the require failure recognizers has failed,\r\n * if true, it emits a gesture event,\r\n * otherwise, setup the state to FAILED.\r\n * @param {Object} input\r\n */\r\n tryEmit: function(input) {\r\n if (this.canEmit()) {\r\n return this.emit(input);\r\n }\r\n // it's failing anyway\r\n this.state = STATE_FAILED;\r\n },\r\n\r\n /**\r\n * can we emit?\r\n * @returns {boolean}\r\n */\r\n canEmit: function() {\r\n var i = 0;\r\n while (i < this.requireFail.length) {\r\n if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\r\n return false;\r\n }\r\n i++;\r\n }\r\n return true;\r\n },\r\n\r\n /**\r\n * update the recognizer\r\n * @param {Object} inputData\r\n */\r\n recognize: function(inputData) {\r\n // make a new copy of the inputData\r\n // so we can change the inputData without messing up the other recognizers\r\n var inputDataClone = extend({}, inputData);\r\n\r\n // is is enabled and allow recognizing?\r\n if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\r\n this.reset();\r\n this.state = STATE_FAILED;\r\n return;\r\n }\r\n\r\n // reset when we've reached the end\r\n if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\r\n this.state = STATE_POSSIBLE;\r\n }\r\n\r\n this.state = this.process(inputDataClone);\r\n\r\n // the recognizer has recognized a gesture\r\n // so trigger an event\r\n if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\r\n this.tryEmit(inputDataClone);\r\n }\r\n },\r\n\r\n /**\r\n * return the state of the recognizer\r\n * the actual recognizing happens in this method\r\n * @virtual\r\n * @param {Object} inputData\r\n * @returns {Const} STATE\r\n */\r\n process: function(inputData) { }, // jshint ignore:line\r\n\r\n /**\r\n * return the preferred touch-action\r\n * @virtual\r\n * @returns {Array}\r\n */\r\n getTouchAction: function() { },\r\n\r\n /**\r\n * called when the gesture isn't allowed to recognize\r\n * like when another is being recognized or it is disabled\r\n * @virtual\r\n */\r\n reset: function() { }\r\n};\r\n\r\n/**\r\n * get a usable string, used as event postfix\r\n * @param {Const} state\r\n * @returns {String} state\r\n */\r\nfunction stateStr(state) {\r\n if (state & STATE_CANCELLED) {\r\n return 'cancel';\r\n } else if (state & STATE_ENDED) {\r\n return 'end';\r\n } else if (state & STATE_CHANGED) {\r\n return 'move';\r\n } else if (state & STATE_BEGAN) {\r\n return 'start';\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * direction cons to string\r\n * @param {Const} direction\r\n * @returns {String}\r\n */\r\nfunction directionStr(direction) {\r\n if (direction == DIRECTION_DOWN) {\r\n return 'down';\r\n } else if (direction == DIRECTION_UP) {\r\n return 'up';\r\n } else if (direction == DIRECTION_LEFT) {\r\n return 'left';\r\n } else if (direction == DIRECTION_RIGHT) {\r\n return 'right';\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * get a recognizer by name if it is bound to a manager\r\n * @param {Recognizer|String} otherRecognizer\r\n * @param {Recognizer} recognizer\r\n * @returns {Recognizer}\r\n */\r\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\r\n var manager = recognizer.manager;\r\n if (manager) {\r\n return manager.get(otherRecognizer);\r\n }\r\n return otherRecognizer;\r\n}\r\n\r\n/**\r\n * This recognizer is just used as a base for the simple attribute recognizers.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction AttrRecognizer() {\r\n Recognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(AttrRecognizer, Recognizer, {\r\n /**\r\n * @namespace\r\n * @memberof AttrRecognizer\r\n */\r\n defaults: {\r\n /**\r\n * @type {Number}\r\n * @default 1\r\n */\r\n pointers: 1\r\n },\r\n\r\n /**\r\n * Used to check if it the recognizer receives valid input, like input.distance > 10.\r\n * @memberof AttrRecognizer\r\n * @param {Object} input\r\n * @returns {Boolean} recognized\r\n */\r\n attrTest: function(input) {\r\n var optionPointers = this.options.pointers;\r\n return optionPointers === 0 || input.pointers.length === optionPointers;\r\n },\r\n\r\n /**\r\n * Process the input and return the state for the recognizer\r\n * @memberof AttrRecognizer\r\n * @param {Object} input\r\n * @returns {*} State\r\n */\r\n process: function(input) {\r\n var state = this.state;\r\n var eventType = input.eventType;\r\n\r\n var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\r\n var isValid = this.attrTest(input);\r\n\r\n // on cancel input and we've recognized before, return STATE_CANCELLED\r\n if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\r\n return state | STATE_CANCELLED;\r\n } else if (isRecognized || isValid) {\r\n if (eventType & INPUT_END) {\r\n return state | STATE_ENDED;\r\n } else if (!(state & STATE_BEGAN)) {\r\n return STATE_BEGAN;\r\n }\r\n return state | STATE_CHANGED;\r\n }\r\n return STATE_FAILED;\r\n }\r\n});\r\n\r\n/**\r\n * Pan\r\n * Recognized when the pointer is down and moved in the allowed direction.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction PanRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n\r\n this.pX = null;\r\n this.pY = null;\r\n}\r\n\r\ninherit(PanRecognizer, AttrRecognizer, {\r\n /**\r\n * @namespace\r\n * @memberof PanRecognizer\r\n */\r\n defaults: {\r\n event: 'pan',\r\n threshold: 10,\r\n pointers: 1,\r\n direction: DIRECTION_ALL\r\n },\r\n\r\n getTouchAction: function() {\r\n var direction = this.options.direction;\r\n var actions = [];\r\n if (direction & DIRECTION_HORIZONTAL) {\r\n actions.push(TOUCH_ACTION_PAN_Y);\r\n }\r\n if (direction & DIRECTION_VERTICAL) {\r\n actions.push(TOUCH_ACTION_PAN_X);\r\n }\r\n return actions;\r\n },\r\n\r\n directionTest: function(input) {\r\n var options = this.options;\r\n var hasMoved = true;\r\n var distance = input.distance;\r\n var direction = input.direction;\r\n var x = input.deltaX;\r\n var y = input.deltaY;\r\n\r\n // lock to axis?\r\n if (!(direction & options.direction)) {\r\n if (options.direction & DIRECTION_HORIZONTAL) {\r\n direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\r\n hasMoved = x != this.pX;\r\n distance = Math.abs(input.deltaX);\r\n } else {\r\n direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\r\n hasMoved = y != this.pY;\r\n distance = Math.abs(input.deltaY);\r\n }\r\n }\r\n input.direction = direction;\r\n return hasMoved && distance > options.threshold && direction & options.direction;\r\n },\r\n\r\n attrTest: function(input) {\r\n return AttrRecognizer.prototype.attrTest.call(this, input) &&\r\n (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\r\n },\r\n\r\n emit: function(input) {\r\n this.pX = input.deltaX;\r\n this.pY = input.deltaY;\r\n\r\n var direction = directionStr(input.direction);\r\n if (direction) {\r\n this.manager.emit(this.options.event + direction, input);\r\n }\r\n\r\n this._super.emit.call(this, input);\r\n }\r\n});\r\n\r\n/**\r\n * Pinch\r\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction PinchRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(PinchRecognizer, AttrRecognizer, {\r\n /**\r\n * @namespace\r\n * @memberof PinchRecognizer\r\n */\r\n defaults: {\r\n event: 'pinch',\r\n threshold: 0,\r\n pointers: 2\r\n },\r\n\r\n getTouchAction: function() {\r\n return [TOUCH_ACTION_NONE];\r\n },\r\n\r\n attrTest: function(input) {\r\n return this._super.attrTest.call(this, input) &&\r\n (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\r\n },\r\n\r\n emit: function(input) {\r\n this._super.emit.call(this, input);\r\n if (input.scale !== 1) {\r\n var inOut = input.scale < 1 ? 'in' : 'out';\r\n this.manager.emit(this.options.event + inOut, input);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Press\r\n * Recognized when the pointer is down for x ms without any movement.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction PressRecognizer() {\r\n Recognizer.apply(this, arguments);\r\n\r\n this._timer = null;\r\n this._input = null;\r\n}\r\n\r\ninherit(PressRecognizer, Recognizer, {\r\n /**\r\n * @namespace\r\n * @memberof PressRecognizer\r\n */\r\n defaults: {\r\n event: 'press',\r\n pointers: 1,\r\n time: 500, // minimal time of the pointer to be pressed\r\n threshold: 5 // a minimal movement is ok, but keep it low\r\n },\r\n\r\n getTouchAction: function() {\r\n return [TOUCH_ACTION_AUTO];\r\n },\r\n\r\n process: function(input) {\r\n var options = this.options;\r\n var validPointers = input.pointers.length === options.pointers;\r\n var validMovement = input.distance < options.threshold;\r\n var validTime = input.deltaTime > options.time;\r\n\r\n this._input = input;\r\n\r\n // we only allow little movement\r\n // and we've reached an end event, so a tap is possible\r\n if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\r\n this.reset();\r\n } else if (input.eventType & INPUT_START) {\r\n this.reset();\r\n this._timer = setTimeoutContext(function() {\r\n this.state = STATE_RECOGNIZED;\r\n this.tryEmit();\r\n }, options.time, this);\r\n } else if (input.eventType & INPUT_END) {\r\n return STATE_RECOGNIZED;\r\n }\r\n return STATE_FAILED;\r\n },\r\n\r\n reset: function() {\r\n clearTimeout(this._timer);\r\n },\r\n\r\n emit: function(input) {\r\n if (this.state !== STATE_RECOGNIZED) {\r\n return;\r\n }\r\n\r\n if (input && (input.eventType & INPUT_END)) {\r\n this.manager.emit(this.options.event + 'up', input);\r\n } else {\r\n this._input.timeStamp = now();\r\n this.manager.emit(this.options.event, this._input);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Rotate\r\n * Recognized when two or more pointer are moving in a circular motion.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction RotateRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(RotateRecognizer, AttrRecognizer, {\r\n /**\r\n * @namespace\r\n * @memberof RotateRecognizer\r\n */\r\n defaults: {\r\n event: 'rotate',\r\n threshold: 0,\r\n pointers: 2\r\n },\r\n\r\n getTouchAction: function() {\r\n return [TOUCH_ACTION_NONE];\r\n },\r\n\r\n attrTest: function(input) {\r\n return this._super.attrTest.call(this, input) &&\r\n (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\r\n }\r\n});\r\n\r\n/**\r\n * Swipe\r\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction SwipeRecognizer() {\r\n AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(SwipeRecognizer, AttrRecognizer, {\r\n /**\r\n * @namespace\r\n * @memberof SwipeRecognizer\r\n */\r\n defaults: {\r\n event: 'swipe',\r\n threshold: 10,\r\n velocity: 0.65,\r\n direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\r\n pointers: 1\r\n },\r\n\r\n getTouchAction: function() {\r\n return PanRecognizer.prototype.getTouchAction.call(this);\r\n },\r\n\r\n attrTest: function(input) {\r\n var direction = this.options.direction;\r\n var velocity;\r\n\r\n if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\r\n velocity = input.velocity;\r\n } else if (direction & DIRECTION_HORIZONTAL) {\r\n velocity = input.velocityX;\r\n } else if (direction & DIRECTION_VERTICAL) {\r\n velocity = input.velocityY;\r\n }\r\n\r\n return this._super.attrTest.call(this, input) &&\r\n direction & input.direction &&\r\n input.distance > this.options.threshold &&\r\n abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\r\n },\r\n\r\n emit: function(input) {\r\n var direction = directionStr(input.direction);\r\n if (direction) {\r\n this.manager.emit(this.options.event + direction, input);\r\n }\r\n\r\n this.manager.emit(this.options.event, input);\r\n }\r\n});\r\n\r\n/**\r\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\r\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\r\n * a single tap.\r\n *\r\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\r\n * multi-taps being recognized.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction TapRecognizer() {\r\n Recognizer.apply(this, arguments);\r\n\r\n // previous time and center,\r\n // used for tap counting\r\n this.pTime = false;\r\n this.pCenter = false;\r\n\r\n this._timer = null;\r\n this._input = null;\r\n this.count = 0;\r\n}\r\n\r\ninherit(TapRecognizer, Recognizer, {\r\n /**\r\n * @namespace\r\n * @memberof PinchRecognizer\r\n */\r\n defaults: {\r\n event: 'tap',\r\n pointers: 1,\r\n taps: 1,\r\n interval: 300, // max time between the multi-tap taps\r\n time: 250, // max time of the pointer to be down (like finger on the screen)\r\n threshold: 2, // a minimal movement is ok, but keep it low\r\n posThreshold: 10 // a multi-tap can be a bit off the initial position\r\n },\r\n\r\n getTouchAction: function() {\r\n return [TOUCH_ACTION_MANIPULATION];\r\n },\r\n\r\n process: function(input) {\r\n var options = this.options;\r\n\r\n var validPointers = input.pointers.length === options.pointers;\r\n var validMovement = input.distance < options.threshold;\r\n var validTouchTime = input.deltaTime < options.time;\r\n\r\n this.reset();\r\n\r\n if ((input.eventType & INPUT_START) && (this.count === 0)) {\r\n return this.failTimeout();\r\n }\r\n\r\n // we only allow little movement\r\n // and we've reached an end event, so a tap is possible\r\n if (validMovement && validTouchTime && validPointers) {\r\n if (input.eventType != INPUT_END) {\r\n return this.failTimeout();\r\n }\r\n\r\n var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\r\n var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\r\n\r\n this.pTime = input.timeStamp;\r\n this.pCenter = input.center;\r\n\r\n if (!validMultiTap || !validInterval) {\r\n this.count = 1;\r\n } else {\r\n this.count += 1;\r\n }\r\n\r\n this._input = input;\r\n\r\n // if tap count matches we have recognized it,\r\n // else it has began recognizing...\r\n var tapCount = this.count % options.taps;\r\n if (tapCount === 0) {\r\n // no failing requirements, immediately trigger the tap event\r\n // or wait as long as the multitap interval to trigger\r\n if (!this.hasRequireFailures()) {\r\n return STATE_RECOGNIZED;\r\n } else {\r\n this._timer = setTimeoutContext(function() {\r\n this.state = STATE_RECOGNIZED;\r\n this.tryEmit();\r\n }, options.interval, this);\r\n return STATE_BEGAN;\r\n }\r\n }\r\n }\r\n return STATE_FAILED;\r\n },\r\n\r\n failTimeout: function() {\r\n this._timer = setTimeoutContext(function() {\r\n this.state = STATE_FAILED;\r\n }, this.options.interval, this);\r\n return STATE_FAILED;\r\n },\r\n\r\n reset: function() {\r\n clearTimeout(this._timer);\r\n },\r\n\r\n emit: function() {\r\n if (this.state == STATE_RECOGNIZED ) {\r\n this._input.tapCount = this.count;\r\n this.manager.emit(this.options.event, this._input);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Simple way to create an manager with a default set of recognizers.\r\n * @param {HTMLElement} element\r\n * @param {Object} [options]\r\n * @constructor\r\n */\r\nfunction Hammer(element, options) {\r\n options = options || {};\r\n options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\r\n return new Manager(element, options);\r\n}\r\n\r\n/**\r\n * @const {string}\r\n */\r\nHammer.VERSION = '2.0.4';\r\n\r\n/**\r\n * default settings\r\n * @namespace\r\n */\r\nHammer.defaults = {\r\n /**\r\n * set if DOM events are being triggered.\r\n * But this is slower and unused by simple implementations, so disabled by default.\r\n * @type {Boolean}\r\n * @default false\r\n */\r\n domEvents: false,\r\n\r\n /**\r\n * The value for the touchAction property/fallback.\r\n * When set to `compute` it will magically set the correct value based on the added recognizers.\r\n * @type {String}\r\n * @default compute\r\n */\r\n touchAction: TOUCH_ACTION_COMPUTE,\r\n\r\n /**\r\n * @type {Boolean}\r\n * @default true\r\n */\r\n enable: true,\r\n\r\n /**\r\n * EXPERIMENTAL FEATURE -- can be removed/changed\r\n * Change the parent input target element.\r\n * If Null, then it is being set the to main element.\r\n * @type {Null|EventTarget}\r\n * @default null\r\n */\r\n inputTarget: null,\r\n\r\n /**\r\n * force an input class\r\n * @type {Null|Function}\r\n * @default null\r\n */\r\n inputClass: null,\r\n\r\n /**\r\n * Default recognizer setup when calling `Hammer()`\r\n * When creating a new Manager these will be skipped.\r\n * @type {Array}\r\n */\r\n preset: [\r\n // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\r\n [RotateRecognizer, { enable: false }],\r\n [PinchRecognizer, { enable: false }, ['rotate']],\r\n [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],\r\n [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],\r\n [TapRecognizer],\r\n [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],\r\n [PressRecognizer]\r\n ],\r\n\r\n /**\r\n * Some CSS properties can be used to improve the working of Hammer.\r\n * Add them to this method and they will be set when creating a new Manager.\r\n * @namespace\r\n */\r\n cssProps: {\r\n /**\r\n * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\r\n * @type {String}\r\n * @default 'none'\r\n */\r\n userSelect: 'none',\r\n\r\n /**\r\n * Disable the Windows Phone grippers when pressing an element.\r\n * @type {String}\r\n * @default 'none'\r\n */\r\n touchSelect: 'none',\r\n\r\n /**\r\n * Disables the default callout shown when you touch and hold a touch target.\r\n * On iOS, when you touch and hold a touch target such as a link, Safari displays\r\n * a callout containing information about the link. This property allows you to disable that callout.\r\n * @type {String}\r\n * @default 'none'\r\n */\r\n touchCallout: 'none',\r\n\r\n /**\r\n * Specifies whether zooming is enabled. Used by IE10>\r\n * @type {String}\r\n * @default 'none'\r\n */\r\n contentZooming: 'none',\r\n\r\n /**\r\n * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\r\n * @type {String}\r\n * @default 'none'\r\n */\r\n userDrag: 'none',\r\n\r\n /**\r\n * Overrides the highlight color shown when the user taps a link or a JavaScript\r\n * clickable element in iOS. This property obeys the alpha value, if specified.\r\n * @type {String}\r\n * @default 'rgba(0,0,0,0)'\r\n */\r\n tapHighlightColor: 'rgba(0,0,0,0)'\r\n }\r\n};\r\n\r\nvar STOP = 1;\r\nvar FORCED_STOP = 2;\r\n\r\n/**\r\n * Manager\r\n * @param {HTMLElement} element\r\n * @param {Object} [options]\r\n * @constructor\r\n */\r\nfunction Manager(element, options) {\r\n options = options || {};\r\n\r\n this.options = merge(options, Hammer.defaults);\r\n this.options.inputTarget = this.options.inputTarget || element;\r\n\r\n this.handlers = {};\r\n this.session = {};\r\n this.recognizers = [];\r\n\r\n this.element = element;\r\n this.input = createInputInstance(this);\r\n this.touchAction = new TouchAction(this, this.options.touchAction);\r\n\r\n toggleCssProps(this, true);\r\n\r\n each(options.recognizers, function(item) {\r\n var recognizer = this.add(new (item[0])(item[1]));\r\n item[2] && recognizer.recognizeWith(item[2]);\r\n item[3] && recognizer.requireFailure(item[3]);\r\n }, this);\r\n}\r\n\r\nManager.prototype = {\r\n /**\r\n * set options\r\n * @param {Object} options\r\n * @returns {Manager}\r\n */\r\n set: function(options) {\r\n extend(this.options, options);\r\n\r\n // Options that need a little more setup\r\n if (options.touchAction) {\r\n this.touchAction.update();\r\n }\r\n if (options.inputTarget) {\r\n // Clean up existing event listeners and reinitialize\r\n this.input.destroy();\r\n this.input.target = options.inputTarget;\r\n this.input.init();\r\n }\r\n return this;\r\n },\r\n\r\n /**\r\n * stop recognizing for this session.\r\n * This session will be discarded, when a new [input]start event is fired.\r\n * When forced, the recognizer cycle is stopped immediately.\r\n * @param {Boolean} [force]\r\n */\r\n stop: function(force) {\r\n this.session.stopped = force ? FORCED_STOP : STOP;\r\n },\r\n\r\n /**\r\n * run the recognizers!\r\n * called by the inputHandler function on every movement of the pointers (touches)\r\n * it walks through all the recognizers and tries to detect the gesture that is being made\r\n * @param {Object} inputData\r\n */\r\n recognize: function(inputData) {\r\n var session = this.session;\r\n if (session.stopped) {\r\n return;\r\n }\r\n\r\n // run the touch-action polyfill\r\n this.touchAction.preventDefaults(inputData);\r\n\r\n var recognizer;\r\n var recognizers = this.recognizers;\r\n\r\n // this holds the recognizer that is being recognized.\r\n // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\r\n // if no recognizer is detecting a thing, it is set to `null`\r\n var curRecognizer = session.curRecognizer;\r\n\r\n // reset when the last recognizer is recognized\r\n // or when we're in a new session\r\n if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\r\n curRecognizer = session.curRecognizer = null;\r\n }\r\n\r\n var i = 0;\r\n while (i < recognizers.length) {\r\n recognizer = recognizers[i];\r\n\r\n // find out if we are allowed try to recognize the input for this one.\r\n // 1. allow if the session is NOT forced stopped (see the .stop() method)\r\n // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\r\n // that is being recognized.\r\n // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\r\n // this can be setup with the `recognizeWith()` method on the recognizer.\r\n if (session.stopped !== FORCED_STOP && ( // 1\r\n !curRecognizer || recognizer == curRecognizer || // 2\r\n recognizer.canRecognizeWith(curRecognizer))) { // 3\r\n recognizer.recognize(inputData);\r\n } else {\r\n recognizer.reset();\r\n }\r\n\r\n // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\r\n // current active recognizer. but only if we don't already have an active recognizer\r\n if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\r\n curRecognizer = session.curRecognizer = recognizer;\r\n }\r\n i++;\r\n }\r\n },\r\n\r\n /**\r\n * get a recognizer by its event name.\r\n * @param {Recognizer|String} recognizer\r\n * @returns {Recognizer|Null}\r\n */\r\n get: function(recognizer) {\r\n if (recognizer instanceof Recognizer) {\r\n return recognizer;\r\n }\r\n\r\n var recognizers = this.recognizers;\r\n for (var i = 0; i < recognizers.length; i++) {\r\n if (recognizers[i].options.event == recognizer) {\r\n return recognizers[i];\r\n }\r\n }\r\n return null;\r\n },\r\n\r\n /**\r\n * add a recognizer to the manager\r\n * existing recognizers with the same event name will be removed\r\n * @param {Recognizer} recognizer\r\n * @returns {Recognizer|Manager}\r\n */\r\n add: function(recognizer) {\r\n if (invokeArrayArg(recognizer, 'add', this)) {\r\n return this;\r\n }\r\n\r\n // remove existing\r\n var existing = this.get(recognizer.options.event);\r\n if (existing) {\r\n this.remove(existing);\r\n }\r\n\r\n this.recognizers.push(recognizer);\r\n recognizer.manager = this;\r\n\r\n this.touchAction.update();\r\n return recognizer;\r\n },\r\n\r\n /**\r\n * remove a recognizer by name or instance\r\n * @param {Recognizer|String} recognizer\r\n * @returns {Manager}\r\n */\r\n remove: function(recognizer) {\r\n if (invokeArrayArg(recognizer, 'remove', this)) {\r\n return this;\r\n }\r\n\r\n var recognizers = this.recognizers;\r\n recognizer = this.get(recognizer);\r\n recognizers.splice(inArray(recognizers, recognizer), 1);\r\n\r\n this.touchAction.update();\r\n return this;\r\n },\r\n\r\n /**\r\n * bind event\r\n * @param {String} events\r\n * @param {Function} handler\r\n * @returns {EventEmitter} this\r\n */\r\n on: function(events, handler) {\r\n var handlers = this.handlers;\r\n each(splitStr(events), function(event) {\r\n handlers[event] = handlers[event] || [];\r\n handlers[event].push(handler);\r\n });\r\n return this;\r\n },\r\n\r\n /**\r\n * unbind event, leave emit blank to remove all handlers\r\n * @param {String} events\r\n * @param {Function} [handler]\r\n * @returns {EventEmitter} this\r\n */\r\n off: function(events, handler) {\r\n var handlers = this.handlers;\r\n each(splitStr(events), function(event) {\r\n if (!handler) {\r\n delete handlers[event];\r\n } else {\r\n handlers[event].splice(inArray(handlers[event], handler), 1);\r\n }\r\n });\r\n return this;\r\n },\r\n\r\n /**\r\n * emit event to the listeners\r\n * @param {String} event\r\n * @param {Object} data\r\n */\r\n emit: function(event, data) {\r\n // we also want to trigger dom events\r\n if (this.options.domEvents) {\r\n triggerDomEvent(event, data);\r\n }\r\n\r\n // no handlers, so skip it all\r\n var handlers = this.handlers[event] && this.handlers[event].slice();\r\n if (!handlers || !handlers.length) {\r\n return;\r\n }\r\n\r\n data.type = event;\r\n data.preventDefault = function() {\r\n data.srcEvent.preventDefault();\r\n };\r\n\r\n var i = 0;\r\n while (i < handlers.length) {\r\n handlers[i](data);\r\n i++;\r\n }\r\n },\r\n\r\n /**\r\n * destroy the manager and unbinds all events\r\n * it doesn't unbind dom events, that is the user own responsibility\r\n */\r\n destroy: function() {\r\n this.element && toggleCssProps(this, false);\r\n\r\n this.handlers = {};\r\n this.session = {};\r\n this.input.destroy();\r\n this.element = null;\r\n }\r\n};\r\n\r\n/**\r\n * add/remove the css properties as defined in manager.options.cssProps\r\n * @param {Manager} manager\r\n * @param {Boolean} add\r\n */\r\nfunction toggleCssProps(manager, add) {\r\n var element = manager.element;\r\n each(manager.options.cssProps, function(value, name) {\r\n element.style[prefixed(element.style, name)] = add ? value : '';\r\n });\r\n}\r\n\r\n/**\r\n * trigger dom event\r\n * @param {String} event\r\n * @param {Object} data\r\n */\r\nfunction triggerDomEvent(event, data) {\r\n var gestureEvent = document.createEvent('Event');\r\n gestureEvent.initEvent(event, true, true);\r\n gestureEvent.gesture = data;\r\n data.target.dispatchEvent(gestureEvent);\r\n}\r\n\r\nextend(Hammer, {\r\n INPUT_START: INPUT_START,\r\n INPUT_MOVE: INPUT_MOVE,\r\n INPUT_END: INPUT_END,\r\n INPUT_CANCEL: INPUT_CANCEL,\r\n\r\n STATE_POSSIBLE: STATE_POSSIBLE,\r\n STATE_BEGAN: STATE_BEGAN,\r\n STATE_CHANGED: STATE_CHANGED,\r\n STATE_ENDED: STATE_ENDED,\r\n STATE_RECOGNIZED: STATE_RECOGNIZED,\r\n STATE_CANCELLED: STATE_CANCELLED,\r\n STATE_FAILED: STATE_FAILED,\r\n\r\n DIRECTION_NONE: DIRECTION_NONE,\r\n DIRECTION_LEFT: DIRECTION_LEFT,\r\n DIRECTION_RIGHT: DIRECTION_RIGHT,\r\n DIRECTION_UP: DIRECTION_UP,\r\n DIRECTION_DOWN: DIRECTION_DOWN,\r\n DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\r\n DIRECTION_VERTICAL: DIRECTION_VERTICAL,\r\n DIRECTION_ALL: DIRECTION_ALL,\r\n\r\n Manager: Manager,\r\n Input: Input,\r\n TouchAction: TouchAction,\r\n\r\n TouchInput: TouchInput,\r\n MouseInput: MouseInput,\r\n PointerEventInput: PointerEventInput,\r\n TouchMouseInput: TouchMouseInput,\r\n SingleTouchInput: SingleTouchInput,\r\n\r\n Recognizer: Recognizer,\r\n AttrRecognizer: AttrRecognizer,\r\n Tap: TapRecognizer,\r\n Pan: PanRecognizer,\r\n Swipe: SwipeRecognizer,\r\n Pinch: PinchRecognizer,\r\n Rotate: RotateRecognizer,\r\n Press: PressRecognizer,\r\n\r\n on: addEventListeners,\r\n off: removeEventListeners,\r\n each: each,\r\n merge: merge,\r\n extend: extend,\r\n inherit: inherit,\r\n bindFn: bindFn,\r\n prefixed: prefixed\r\n});\r\n\r\nif (typeof define == TYPE_FUNCTION && define.amd) {\r\n define(function() {\r\n return Hammer;\r\n });\r\n} else if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Hammer;\r\n} else {\r\n window[exportName] = Hammer;\r\n}\r\n\r\n})(window, document, 'Hammer');\r\n","// Snap.svg 0.3.0\n// \n// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// \n// build: 2014-09-08\n\n(function (glob, factory) {\n // AMD support\n if (typeof define === \"function\" && define.amd) {\n // Define as an anonymous module\n define([\"eve\"], function( eve ) {\n return factory(glob, eve);\n });\n } else if (typeof exports !== 'undefined') {\n // Next for Node.js or CommonJS\n var eve = require(185);\n module.exports = factory(glob, eve);\n } else {\n // Browser globals (glob is window)\n // Snap adds itself to window\n factory(glob, glob.eve);\n }\n}(window || this, function (window, eve) {\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar mina = (function (eve) {\n var animations = {},\n requestAnimFrame = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n },\n isArray = Array.isArray || function (a) {\n return a instanceof Array ||\n Object.prototype.toString.call(a) == \"[object Array]\";\n },\n idgen = 0,\n idprefix = \"M\" + (+new Date).toString(36),\n ID = function () {\n return idprefix + (idgen++).toString(36);\n },\n diff = function (a, b, A, B) {\n if (isArray(a)) {\n res = [];\n for (var i = 0, ii = a.length; i < ii; i++) {\n res[i] = diff(a[i], b, A[i], B);\n }\n return res;\n }\n var dif = (A - a) / (B - b);\n return function (bb) {\n return a + dif * (bb - b);\n };\n },\n timer = Date.now || function () {\n return +new Date;\n },\n sta = function (val) {\n var a = this;\n if (val == null) {\n return a.s;\n }\n var ds = a.s - val;\n a.b += a.dur * ds;\n a.B += a.dur * ds;\n a.s = val;\n },\n speed = function (val) {\n var a = this;\n if (val == null) {\n return a.spd;\n }\n a.spd = val;\n },\n duration = function (val) {\n var a = this;\n if (val == null) {\n return a.dur;\n }\n a.s = a.s * val / a.dur;\n a.dur = val;\n },\n stopit = function () {\n var a = this;\n delete animations[a.id];\n a.update();\n eve(\"mina.stop.\" + a.id, a);\n },\n pause = function () {\n var a = this;\n if (a.pdif) {\n return;\n }\n delete animations[a.id];\n a.update();\n a.pdif = a.get() - a.b;\n },\n resume = function () {\n var a = this;\n if (!a.pdif) {\n return;\n }\n a.b = a.get() - a.pdif;\n delete a.pdif;\n animations[a.id] = a;\n },\n update = function () {\n var a = this,\n res;\n if (isArray(a.start)) {\n res = [];\n for (var j = 0, jj = a.start.length; j < jj; j++) {\n res[j] = +a.start[j] +\n (a.end[j] - a.start[j]) * a.easing(a.s);\n }\n } else {\n res = +a.start + (a.end - a.start) * a.easing(a.s);\n }\n a.set(res);\n },\n frame = function () {\n var len = 0;\n for (var i in animations) if (animations.hasOwnProperty(i)) {\n var a = animations[i],\n b = a.get(),\n res;\n len++;\n a.s = (b - a.b) / (a.dur / a.spd);\n if (a.s >= 1) {\n delete animations[i];\n a.s = 1;\n len--;\n (function (a) {\n setTimeout(function () {\n eve(\"mina.finish.\" + a.id, a);\n });\n }(a));\n }\n a.update();\n }\n len && requestAnimFrame(frame);\n },\n /*/\n * mina\n [ method ]\n **\n * Generic animation of numbers\n **\n - a (number) start _slave_ number\n - A (number) end _slave_ number\n - b (number) start _master_ number (start time in general case)\n - B (number) end _master_ number (end time in gereal case)\n - get (function) getter of _master_ number (see @mina.time)\n - set (function) setter of _slave_ number\n - easing (function) #optional easing function, default is @mina.linear\n = (object) animation descriptor\n o {\n o id (string) animation id,\n o start (number) start _slave_ number,\n o end (number) end _slave_ number,\n o b (number) start _master_ number,\n o s (number) animation status (0..1),\n o dur (number) animation duration,\n o spd (number) animation speed,\n o get (function) getter of _master_ number (see @mina.time),\n o set (function) setter of _slave_ number,\n o easing (function) easing function, default is @mina.linear,\n o status (function) status getter/setter,\n o speed (function) speed getter/setter,\n o duration (function) duration getter/setter,\n o stop (function) animation stopper\n o pause (function) pauses the animation\n o resume (function) resumes the animation\n o update (function) calles setter with the right value of the animation\n o }\n /*/\n mina = function (a, A, b, B, get, set, easing) {\n var anim = {\n id: ID(),\n start: a,\n end: A,\n b: b,\n s: 0,\n dur: B - b,\n spd: 1,\n get: get,\n set: set,\n easing: easing || mina.linear,\n status: sta,\n speed: speed,\n duration: duration,\n stop: stopit,\n pause: pause,\n resume: resume,\n update: update\n };\n animations[anim.id] = anim;\n var len = 0, i;\n for (i in animations) if (animations.hasOwnProperty(i)) {\n len++;\n if (len == 2) {\n break;\n }\n }\n len == 1 && requestAnimFrame(frame);\n return anim;\n };\n /*/\n * mina.time\n [ method ]\n **\n * Returns the current time. Equivalent to:\n | function () {\n | return (new Date).getTime();\n | }\n /*/\n mina.time = timer;\n /*/\n * mina.getById\n [ method ]\n **\n * Returns an animation by its id\n - id (string) animation's id\n = (object) See @mina\n /*/\n mina.getById = function (id) {\n return animations[id] || null;\n };\n\n /*/\n * mina.linear\n [ method ]\n **\n * Default linear easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.linear = function (n) {\n return n;\n };\n /*/\n * mina.easeout\n [ method ]\n **\n * Easeout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeout = function (n) {\n return Math.pow(n, 1.7);\n };\n /*/\n * mina.easein\n [ method ]\n **\n * Easein easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easein = function (n) {\n return Math.pow(n, .48);\n };\n /*/\n * mina.easeinout\n [ method ]\n **\n * Easeinout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeinout = function (n) {\n if (n == 1) {\n return 1;\n }\n if (n == 0) {\n return 0;\n }\n var q = .48 - n / 1.04,\n Q = Math.sqrt(.1734 + q * q),\n x = Q - q,\n X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),\n y = -Q - q,\n Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),\n t = X + Y + .5;\n return (1 - t) * 3 * t * t + t * t * t;\n };\n /*/\n * mina.backin\n [ method ]\n **\n * Backin easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backin = function (n) {\n if (n == 1) {\n return 1;\n }\n var s = 1.70158;\n return n * n * ((s + 1) * n - s);\n };\n /*/\n * mina.backout\n [ method ]\n **\n * Backout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backout = function (n) {\n if (n == 0) {\n return 0;\n }\n n = n - 1;\n var s = 1.70158;\n return n * n * ((s + 1) * n + s) + 1;\n };\n /*/\n * mina.elastic\n [ method ]\n **\n * Elastic easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.elastic = function (n) {\n if (n == !!n) {\n return n;\n }\n return Math.pow(2, -10 * n) * Math.sin((n - .075) *\n (2 * Math.PI) / .3) + 1;\n };\n /*/\n * mina.bounce\n [ method ]\n **\n * Bounce easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.bounce = function (n) {\n var s = 7.5625,\n p = 2.75,\n l;\n if (n < (1 / p)) {\n l = s * n * n;\n } else {\n if (n < (2 / p)) {\n n -= (1.5 / p);\n l = s * n * n + .75;\n } else {\n if (n < (2.5 / p)) {\n n -= (2.25 / p);\n l = s * n * n + .9375;\n } else {\n n -= (2.625 / p);\n l = s * n * n + .984375;\n }\n }\n }\n return l;\n };\n window.mina = mina;\n return mina;\n})(typeof eve == \"undefined\" ? function () {} : eve);\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nvar Snap = (function(root) {\nSnap.version = \"0.3.0\";\n/*/\n * Snap\n [ method ]\n **\n * Creates a drawing surface or wraps existing SVG element.\n **\n - width (number|string) width of surface\n - height (number|string) height of surface\n * or\n - DOM (SVGElement) element to be wrapped into Snap structure\n * or\n - array (array) array of elements (will return set of elements)\n * or\n - query (string) CSS query selector\n = (object) @Element\n/*/\nfunction Snap(w, h) {\n if (w) {\n if (w.tagName) {\n return wrap(w);\n }\n if (is(w, \"array\") && Snap.set) {\n return Snap.set.apply(Snap, w);\n }\n if (w instanceof Element) {\n return w;\n }\n if (h == null) {\n w = glob.doc.querySelector(w);\n return wrap(w);\n }\n }\n w = w == null ? \"100%\" : w;\n h = h == null ? \"100%\" : h;\n return new Paper(w, h);\n}\nSnap.toString = function () {\n return \"Snap v\" + this.version;\n};\nSnap._ = {};\nvar glob = {\n win: root.window,\n doc: root.window.document\n};\nSnap._.glob = glob;\nvar has = \"hasOwnProperty\",\n Str = String,\n toFloat = parseFloat,\n toInt = parseInt,\n math = Math,\n mmax = math.max,\n mmin = math.min,\n abs = math.abs,\n pow = math.pow,\n PI = math.PI,\n round = math.round,\n E = \"\",\n S = \" \",\n objectToString = Object.prototype.toString,\n ISURL = /^url/(['\"]?([^/)]+?)['\"]?/)$/i,\n colourRegExp = /^/s*((#[a-f/d]{6})|(#[a-f/d]{3})|rgba?/(/s*([/d/.]+%?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+%?(?:/s*,/s*[/d/.]+%?)?)/s*/)|hsba?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/)|hsla?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/))/s*$/i,\n bezierrg = /^(?:cubic-)?bezier/(([^,]+),([^,]+),([^,]+),([^/)]+)/)/,\n reURLValue = /^url/(#?([^)]+)/)$/,\n separator = Snap._.separator = /[,/s]+/,\n whitespace = /[/s]/g,\n commaSpaces = /[/s]*,[/s]*/,\n hsrg = {hs: 1, rg: 1},\n pathCommand = /([a-z])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n tCommand = /([rstm])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n pathValues = /(-?/d*/.?/d*(?:e[/-+]?//d+)?)[/s]*,?[/s]*/ig,\n idgen = 0,\n idprefix = \"S\" + (+new Date).toString(36),\n ID = function (el) {\n return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);\n },\n xlink = \"http://www.w3.org/1999/xlink\",\n xmlns = \"http://www.w3.org/2000/svg\",\n hub = {},\n URL = Snap.url = function (url) {\n return \"url('#\" + url + \"')\";\n };\n\nfunction $(el, attr) {\n if (attr) {\n if (el == \"#text\") {\n el = glob.doc.createTextNode(attr.text || \"\");\n }\n if (typeof el == \"string\") {\n el = $(el);\n }\n if (typeof attr == \"string\") {\n if (attr.substring(0, 6) == \"xlink:\") {\n return el.getAttributeNS(xlink, attr.substring(6));\n }\n if (attr.substring(0, 4) == \"xml:\") {\n return el.getAttributeNS(xmlns, attr.substring(4));\n }\n return el.getAttribute(attr);\n }\n for (var key in attr) if (attr[has](key)) {\n var val = Str(attr[key]);\n if (val) {\n if (key.substring(0, 6) == \"xlink:\") {\n el.setAttributeNS(xlink, key.substring(6), val);\n } else if (key.substring(0, 4) == \"xml:\") {\n el.setAttributeNS(xmlns, key.substring(4), val);\n } else {\n el.setAttribute(key, val);\n }\n } else {\n el.removeAttribute(key);\n }\n }\n } else {\n el = glob.doc.createElementNS(xmlns, el);\n }\n return el;\n}\nSnap._.$ = $;\nSnap._.id = ID;\nfunction getAttrs(el) {\n var attrs = el.attributes,\n name,\n out = {};\n for (var i = 0; i < attrs.length; i++) {\n if (attrs[i].namespaceURI == xlink) {\n name = \"xlink:\";\n } else {\n name = \"\";\n }\n name += attrs[i].name;\n out[name] = attrs[i].textContent;\n }\n return out;\n}\nfunction is(o, type) {\n type = Str.prototype.toLowerCase.call(type);\n if (type == \"finite\") {\n return isFinite(o);\n }\n if (type == \"array\" &&\n (o instanceof Array || Array.isArray && Array.isArray(o))) {\n return true;\n }\n return (type == \"null\" && o === null) ||\n (type == typeof o && o !== null) ||\n (type == \"object\" && o === Object(o)) ||\n objectToString.call(o).slice(8, -1).toLowerCase() == type;\n}\n/*/\n * Snap.format\n [ method ]\n **\n * Replaces construction of type `{<name>}` to the corresponding argument\n **\n - token (string) string to format\n - json (object) object which properties are used as a replacement\n = (string) formatted string\n > Usage\n | // this draws a rectangular shape equivalent to \"M10,20h40v50h-40z\"\n | paper.path(Snap.format(\"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z\", {\n | x: 10,\n | y: 20,\n | dim: {\n | width: 40,\n | height: 50,\n | \"negative width\": -40\n | }\n | }));\n/*/\nSnap.format = (function () {\n var tokenRegex = //{([^/}]+)/}/g,\n objNotationRegex = /(?:(?:^|/.)(.+?)(?=/[|/.|$|/()|/[('|\")(.+?)/2/])(/(/))?/g, // matches .xxxxx or [\"xxxxx\"] to run over object properties\n replacer = function (all, key, obj) {\n var res = obj;\n key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {\n name = name || quotedName;\n if (res) {\n if (name in res) {\n res = res[name];\n }\n typeof res == \"function\" && isFunc && (res = res());\n }\n });\n res = (res == null || res == obj ? all : res) + \"\";\n return res;\n };\n return function (str, obj) {\n return Str(str).replace(tokenRegex, function (all, key) {\n return replacer(all, key, obj);\n });\n };\n})();\nfunction clone(obj) {\n if (typeof obj == \"function\" || Object(obj) !== obj) {\n return obj;\n }\n var res = new obj.constructor;\n for (var key in obj) if (obj[has](key)) {\n res[key] = clone(obj[key]);\n }\n return res;\n}\nSnap._.clone = clone;\nfunction repush(array, item) {\n for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {\n return array.push(array.splice(i, 1)[0]);\n }\n}\nfunction cacher(f, scope, postprocessor) {\n function newf() {\n var arg = Array.prototype.slice.call(arguments, 0),\n args = arg.join(\"/u2400\"),\n cache = newf.cache = newf.cache || {},\n count = newf.count = newf.count || [];\n if (cache[has](args)) {\n repush(count, args);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n count.length >= 1e3 && delete cache[count.shift()];\n count.push(args);\n cache[args] = f.apply(scope, arg);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n return newf;\n}\nSnap._.cacher = cacher;\nfunction angle(x1, y1, x2, y2, x3, y3) {\n if (x3 == null) {\n var x = x1 - x2,\n y = y1 - y2;\n if (!x && !y) {\n return 0;\n }\n return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;\n } else {\n return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);\n }\n}\nfunction rad(deg) {\n return deg % 360 * PI / 180;\n}\nfunction deg(rad) {\n return rad * 180 / PI % 360;\n}\nfunction x_y() {\n return this.x + S + this.y;\n}\nfunction x_y_w_h() {\n return this.x + S + this.y + S + this.width + \" /xd7 \" + this.height;\n}\n\n/*/\n * Snap.rad\n [ method ]\n **\n * Transform angle to radians\n - deg (number) angle in degrees\n = (number) angle in radians\n/*/\nSnap.rad = rad;\n/*/\n * Snap.deg\n [ method ]\n **\n * Transform angle to degrees\n - rad (number) angle in radians\n = (number) angle in degrees\n/*/\nSnap.deg = deg;\n/*/\n * Snap.angle\n [ method ]\n **\n * Returns an angle between two or three points\n > Parameters\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n - x3 (number) #optional x coord of third point\n - y3 (number) #optional y coord of third point\n = (number) angle in degrees\n/*/\nSnap.angle = angle;\n/*/\n * Snap.is\n [ method ]\n **\n * Handy replacement for the `typeof` operator\n - o (…) any object or primitive\n - type (string) name of the type, e.g., `string`, `function`, `number`, etc.\n = (boolean) `true` if given value is of given type\n/*/\nSnap.is = is;\n/*/\n * Snap.snapTo\n [ method ]\n **\n * Snaps given value to given grid\n - values (array|number) given array of values or step of the grid\n - value (number) value to adjust\n - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.\n = (number) adjusted value\n/*/\nSnap.snapTo = function (values, value, tolerance) {\n tolerance = is(tolerance, \"finite\") ? tolerance : 10;\n if (is(values, \"array\")) {\n var i = values.length;\n while (i--) if (abs(values[i] - value) <= tolerance) {\n return values[i];\n }\n } else {\n values = +values;\n var rem = value % values;\n if (rem < tolerance) {\n return value - rem;\n }\n if (rem > values - tolerance) {\n return value - rem + values;\n }\n }\n return value;\n};\n// Colour\n/*/\n * Snap.getRGB\n [ method ]\n **\n * Parses color string as RGB object\n - color (string) color string in one of the following formats:\n # <ul>\n # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>\n # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>\n # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>\n # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>\n # <li>rgba(•••, •••, •••, •••) — also with opacity</li>\n # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>\n # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>\n # <li>hsba(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>\n # <li>hsla(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>\n # </ul>\n * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) true if string can't be parsed\n o }\n/*/\nSnap.getRGB = cacher(function (colour) {\n if (!colour || !!((colour = Str(colour)).indexOf(\"-\") + 1)) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n if (colour == \"none\") {\n return {r: -1, g: -1, b: -1, hex: \"none\", toString: rgbtoString};\n }\n !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == \"#\") && (colour = toHex(colour));\n if (!colour) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n var res,\n red,\n green,\n blue,\n opacity,\n t,\n values,\n rgb = colour.match(colourRegExp);\n if (rgb) {\n if (rgb[2]) {\n blue = toInt(rgb[2].substring(5), 16);\n green = toInt(rgb[2].substring(3, 5), 16);\n red = toInt(rgb[2].substring(1, 3), 16);\n }\n if (rgb[3]) {\n blue = toInt((t = rgb[3].charAt(3)) + t, 16);\n green = toInt((t = rgb[3].charAt(2)) + t, 16);\n red = toInt((t = rgb[3].charAt(1)) + t, 16);\n }\n if (rgb[4]) {\n values = rgb[4].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red *= 2.55);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green *= 2.55);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue *= 2.55);\n rgb[1].toLowerCase().slice(0, 4) == \"rgba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n }\n if (rgb[5]) {\n values = rgb[5].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsb2rgb(red, green, blue, opacity);\n }\n if (rgb[6]) {\n values = rgb[6].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsla\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsl2rgb(red, green, blue, opacity);\n }\n red = mmin(math.round(red), 255);\n green = mmin(math.round(green), 255);\n blue = mmin(math.round(blue), 255);\n opacity = mmin(mmax(opacity, 0), 1);\n rgb = {r: red, g: green, b: blue, toString: rgbtoString};\n rgb.hex = \"#\" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);\n rgb.opacity = is(opacity, \"finite\") ? opacity : 1;\n return rgb;\n }\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n}, Snap);\n// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.\n/*/\n * Snap.hsb\n [ method ]\n **\n * Converts HSB values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - b (number) value or brightness\n = (string) hex representation of the color\n/*/\nSnap.hsb = cacher(function (h, s, b) {\n return Snap.hsb2rgb(h, s, b).hex;\n});\n/*/\n * Snap.hsl\n [ method ]\n **\n * Converts HSL values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (string) hex representation of the color\n/*/\nSnap.hsl = cacher(function (h, s, l) {\n return Snap.hsl2rgb(h, s, l).hex;\n});\n/*/\n * Snap.rgb\n [ method ]\n **\n * Converts RGB values to a hex representation of the color\n - r (number) red\n - g (number) green\n - b (number) blue\n = (string) hex representation of the color\n/*/\nSnap.rgb = cacher(function (r, g, b, o) {\n if (is(o, \"finite\")) {\n var round = math.round;\n return \"rgba(\" + [round(r), round(g), round(b), +o.toFixed(2)] + \")\";\n }\n return \"#\" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);\n});\nvar toHex = function (color) {\n var i = glob.doc.getElementsByTagName(\"head\")[0] || glob.doc.getElementsByTagName(\"svg\")[0],\n red = \"rgb(255, 0, 0)\";\n toHex = cacher(function (color) {\n if (color.toLowerCase() == \"red\") {\n return red;\n }\n i.style.color = red;\n i.style.color = color;\n var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue(\"color\");\n return out == red ? null : out;\n });\n return toHex(color);\n},\nhsbtoString = function () {\n return \"hsb(\" + [this.h, this.s, this.b] + \")\";\n},\nhsltoString = function () {\n return \"hsl(\" + [this.h, this.s, this.l] + \")\";\n},\nrgbtoString = function () {\n return this.opacity == 1 || this.opacity == null ?\n this.hex :\n \"rgba(\" + [this.r, this.g, this.b, this.opacity] + \")\";\n},\nprepareRGB = function (r, g, b) {\n if (g == null && is(r, \"object\") && \"r\" in r && \"g\" in r && \"b\" in r) {\n b = r.b;\n g = r.g;\n r = r.r;\n }\n if (g == null && is(r, string)) {\n var clr = Snap.getRGB(r);\n r = clr.r;\n g = clr.g;\n b = clr.b;\n }\n if (r > 1 || g > 1 || b > 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n }\n\n return [r, g, b];\n},\npackageRGB = function (r, g, b, o) {\n r = math.round(r * 255);\n g = math.round(g * 255);\n b = math.round(b * 255);\n var rgb = {\n r: r,\n g: g,\n b: b,\n opacity: is(o, \"finite\") ? o : 1,\n hex: Snap.rgb(r, g, b),\n toString: rgbtoString\n };\n is(o, \"finite\") && (rgb.opacity = o);\n return rgb;\n};\n// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?\n/*/\n * Snap.color\n [ method ]\n **\n * Parses the color string and returns an object featuring the color's component values\n - clr (string) color string in one of the supported formats (see @Snap.getRGB)\n = (object) Combined RGB/HSB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) `true` if string can't be parsed,\n o h (number) hue,\n o s (number) saturation,\n o v (number) value (brightness),\n o l (number) lightness\n o }\n/*/\nSnap.color = function (clr) {\n var rgb;\n if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"b\" in clr) {\n rgb = Snap.hsb2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"l\" in clr) {\n rgb = Snap.hsl2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else {\n if (is(clr, \"string\")) {\n clr = Snap.getRGB(clr);\n }\n if (is(clr, \"object\") && \"r\" in clr && \"g\" in clr && \"b\" in clr && !(\"error\" in clr)) {\n rgb = Snap.rgb2hsl(clr);\n clr.h = rgb.h;\n clr.s = rgb.s;\n clr.l = rgb.l;\n rgb = Snap.rgb2hsb(clr);\n clr.v = rgb.b;\n } else {\n clr = {hex: \"none\"};\n clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;\n clr.error = 1;\n }\n }\n clr.toString = rgbtoString;\n return clr;\n};\n/*/\n * Snap.hsb2rgb\n [ method ]\n **\n * Converts HSB values to an RGB object\n - h (number) hue\n - s (number) saturation\n - v (number) value or brightness\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsb2rgb = function (h, s, v, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"b\" in h) {\n v = h.b;\n s = h.s;\n h = h.h;\n o = h.o;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = v * s;\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = v - C;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.hsl2rgb\n [ method ]\n **\n * Converts HSL values to an RGB object\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsl2rgb = function (h, s, l, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"l\" in h) {\n l = h.l;\n s = h.s;\n h = h.h;\n }\n if (h > 1 || s > 1 || l > 1) {\n h /= 360;\n s /= 100;\n l /= 100;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = 2 * s * (l < .5 ? l : 1 - l);\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = l - C / 2;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.rgb2hsb\n [ method ]\n **\n * Converts RGB values to an HSB object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSB object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o b (number) brightness\n o }\n/*/\nSnap.rgb2hsb = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, V, C;\n V = mmax(r, g, b);\n C = V - mmin(r, g, b);\n H = (C == 0 ? null :\n V == r ? (g - b) / C :\n V == g ? (b - r) / C + 2 :\n (r - g) / C + 4\n );\n H = ((H + 360) % 6) * 60 / 360;\n S = C == 0 ? 0 : C / V;\n return {h: H, s: S, b: V, toString: hsbtoString};\n};\n/*/\n * Snap.rgb2hsl\n [ method ]\n **\n * Converts RGB values to an HSL object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSL object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o l (number) luminosity\n o }\n/*/\nSnap.rgb2hsl = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, L, M, m, C;\n M = mmax(r, g, b);\n m = mmin(r, g, b);\n C = M - m;\n H = (C == 0 ? null :\n M == r ? (g - b) / C :\n M == g ? (b - r) / C + 2 :\n (r - g) / C + 4);\n H = ((H + 360) % 6) * 60 / 360;\n L = (M + m) / 2;\n S = (C == 0 ? 0 :\n L < .5 ? C / (2 * L) :\n C / (2 - 2 * L));\n return {h: H, s: S, l: L, toString: hsltoString};\n};\n\n// Transformations\n// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ [\"M10,10\",\"L90,90\"], [\"M90,10\",\"L10,90\"] ] Otherwise how is each command structured?\n/*/\n * Snap.parsePathString\n [ method ]\n **\n * Utility method\n **\n * Parses given path string into an array of arrays of path segments\n - pathString (string|array) path string or array of segments (in the last case it is returned straight away)\n = (array) array of segments\n/*/\nSnap.parsePathString = function (pathString) {\n if (!pathString) {\n return null;\n }\n var pth = Snap.path(pathString);\n if (pth.arr) {\n return Snap.path.clone(pth.arr);\n }\n\n var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},\n data = [];\n if (is(pathString, \"array\") && is(pathString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(pathString);\n }\n if (!data.length) {\n Str(pathString).replace(pathCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n if (name == \"m\" && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = \"l\";\n b = b == \"m\" ? \"l\" : \"L\";\n }\n if (name == \"o\" && params.length == 1) {\n data.push([b, params[0]]);\n }\n if (name == \"r\") {\n data.push([b].concat(params));\n } else while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n });\n }\n data.toString = Snap.path.toString;\n pth.arr = Snap.path.clone(data);\n return data;\n};\n/*/\n * Snap.parseTransformString\n [ method ]\n **\n * Utility method\n **\n * Parses given transform string into an array of transformations\n - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)\n = (array) array of transformations\n/*/\nvar parseTransformString = Snap.parseTransformString = function (TString) {\n if (!TString) {\n return null;\n }\n var paramCounts = {r: 3, s: 4, t: 2, m: 6},\n data = [];\n if (is(TString, \"array\") && is(TString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(TString);\n }\n if (!data.length) {\n Str(TString).replace(tCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n data.push([b].concat(params));\n });\n }\n data.toString = Snap.path.toString;\n return data;\n};\nfunction svgTransform2string(tstr) {\n var res = [];\n tstr = tstr.replace(/(?:^|/s)(/w+)/(([^)]+)/)/g, function (all, name, params) {\n params = params.split(//s*,/s*|/s+/);\n if (name == \"rotate\" && params.length == 1) {\n params.push(0, 0);\n }\n if (name == \"scale\") {\n if (params.length > 2) {\n params = params.slice(0, 2);\n } else if (params.length == 2) {\n params.push(0, 0);\n }\n if (params.length == 1) {\n params.push(params[0], 0, 0);\n }\n }\n if (name == \"skewX\") {\n res.push([\"m\", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);\n } else if (name == \"skewY\") {\n res.push([\"m\", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);\n } else {\n res.push([name.charAt(0)].concat(params));\n }\n return all;\n });\n return res;\n}\nSnap._.svgTransform2string = svgTransform2string;\nSnap._.rgTransform = /^[a-z][/s]*-?/.?/d/i;\nfunction transform2matrix(tstr, bbox) {\n var tdata = parseTransformString(tstr),\n m = new Snap.Matrix;\n if (tdata) {\n for (var i = 0, ii = tdata.length; i < ii; i++) {\n var t = tdata[i],\n tlen = t.length,\n command = Str(t[0]).toLowerCase(),\n absolute = t[0] != command,\n inver = absolute ? m.invert() : 0,\n x1,\n y1,\n x2,\n y2,\n bb;\n if (command == \"t\" && tlen == 2){\n m.translate(t[1], 0);\n } else if (command == \"t\" && tlen == 3) {\n if (absolute) {\n x1 = inver.x(0, 0);\n y1 = inver.y(0, 0);\n x2 = inver.x(t[1], t[2]);\n y2 = inver.y(t[1], t[2]);\n m.translate(x2 - x1, y2 - y1);\n } else {\n m.translate(t[1], t[2]);\n }\n } else if (command == \"r\") {\n if (tlen == 2) {\n bb = bb || bbox;\n m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.rotate(t[1], x2, y2);\n } else {\n m.rotate(t[1], t[2], t[3]);\n }\n }\n } else if (command == \"s\") {\n if (tlen == 2 || tlen == 3) {\n bb = bb || bbox;\n m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.scale(t[1], t[1], x2, y2);\n } else {\n m.scale(t[1], t[1], t[2], t[3]);\n }\n } else if (tlen == 5) {\n if (absolute) {\n x2 = inver.x(t[3], t[4]);\n y2 = inver.y(t[3], t[4]);\n m.scale(t[1], t[2], x2, y2);\n } else {\n m.scale(t[1], t[2], t[3], t[4]);\n }\n }\n } else if (command == \"m\" && tlen == 7) {\n m.add(t[1], t[2], t[3], t[4], t[5], t[6]);\n }\n }\n }\n return m;\n}\nSnap._.transform2matrix = transform2matrix;\nSnap._unit2px = unit2px;\nvar contains = glob.doc.contains || glob.doc.compareDocumentPosition ?\n function (a, b) {\n var adown = a.nodeType == 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a == bup || !!(bup && bup.nodeType == 1 && (\n adown.contains ?\n adown.contains(bup) :\n a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16\n ));\n } :\n function (a, b) {\n if (b) {\n while (b) {\n b = b.parentNode;\n if (b == a) {\n return true;\n }\n }\n }\n return false;\n };\nfunction getSomeDefs(el) {\n var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||\n (el.node.parentNode && wrap(el.node.parentNode)) ||\n Snap.select(\"svg\") ||\n Snap(0, 0),\n pdefs = p.select(\"defs\"),\n defs = pdefs == null ? false : pdefs.node;\n if (!defs) {\n defs = make(\"defs\", p.node).node;\n }\n return defs;\n}\nfunction getSomeSVG(el) {\n return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select(\"svg\");\n}\nSnap._.getSomeDefs = getSomeDefs;\nSnap._.getSomeSVG = getSomeSVG;\nfunction unit2px(el, name, value) {\n var svg = getSomeSVG(el).node,\n out = {},\n mgr = svg.querySelector(\".svg---mgr\");\n if (!mgr) {\n mgr = $(\"rect\");\n $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, \"class\": \"svg---mgr\", fill: \"none\"});\n svg.appendChild(mgr);\n }\n function getW(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {width: val});\n try {\n return mgr.getBBox().width;\n } catch (e) {\n return 0;\n }\n }\n function getH(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {height: val});\n try {\n return mgr.getBBox().height;\n } catch (e) {\n return 0;\n }\n }\n function set(nam, f) {\n if (name == null) {\n out[nam] = f(el.attr(nam) || 0);\n } else if (nam == name) {\n out = f(value == null ? el.attr(nam) || 0 : value);\n }\n }\n switch (el.type) {\n case \"rect\":\n set(\"rx\", getW);\n set(\"ry\", getH);\n case \"image\":\n set(\"width\", getW);\n set(\"height\", getH);\n case \"text\":\n set(\"x\", getW);\n set(\"y\", getH);\n break;\n case \"circle\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"r\", getW);\n break;\n case \"ellipse\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"rx\", getW);\n set(\"ry\", getH);\n break;\n case \"line\":\n set(\"x1\", getW);\n set(\"x2\", getW);\n set(\"y1\", getH);\n set(\"y2\", getH);\n break;\n case \"marker\":\n set(\"refX\", getW);\n set(\"markerWidth\", getW);\n set(\"refY\", getH);\n set(\"markerHeight\", getH);\n break;\n case \"radialGradient\":\n set(\"fx\", getW);\n set(\"fy\", getH);\n break;\n case \"tspan\":\n set(\"dx\", getW);\n set(\"dy\", getH);\n break;\n default:\n set(name, getW);\n }\n svg.removeChild(mgr);\n return out;\n}\n/*/\n * Snap.select\n [ method ]\n **\n * Wraps a DOM element specified by CSS selector as @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(glob.doc.querySelector(query));\n};\n/*/\n * Snap.selectAll\n [ method ]\n **\n * Wraps DOM elements specified by CSS selector as set or array of @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.selectAll = function (query) {\n var nodelist = glob.doc.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n};\n\nfunction add2group(list) {\n if (!is(list, \"array\")) {\n list = Array.prototype.slice.call(arguments, 0);\n }\n var i = 0,\n j = 0,\n node = this.node;\n while (this[i]) delete this[i++];\n for (i = 0; i < list.length; i++) {\n if (list[i].type == \"set\") {\n list[i].forEach(function (el) {\n node.appendChild(el.node);\n });\n } else {\n node.appendChild(list[i].node);\n }\n }\n var children = node.childNodes;\n for (i = 0; i < children.length; i++) {\n this[j++] = wrap(children[i]);\n }\n return this;\n}\n// Hub garbage collector every 10s\nsetInterval(function () {\n for (var key in hub) if (hub[has](key)) {\n var el = hub[key],\n node = el.node;\n if (el.type != \"svg\" && !node.ownerSVGElement || el.type == \"svg\" && (!node.parentNode || \"ownerSVGElement\" in node.parentNode && !node.ownerSVGElement)) {\n delete hub[key];\n }\n }\n}, 1e4);\nfunction Element(el) {\n if (el.snap in hub) {\n return hub[el.snap];\n }\n var svg;\n try {\n svg = el.ownerSVGElement;\n } catch(e) {}\n /*/\n * Element.node\n [ property (object) ]\n **\n * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.\n > Usage\n | // draw a circle at coordinate 10,10 with radius of 10\n | var c = paper.circle(10, 10, 10);\n | c.node.onclick = function () {\n | c.attr(\"fill\", \"red\");\n | };\n /*/\n this.node = el;\n if (svg) {\n this.paper = new Paper(svg);\n }\n /*/\n * Element.type\n [ property (string) ]\n **\n * SVG tag name of the given element.\n /*/\n this.type = el.tagName;\n var id = this.id = ID(this);\n this.anims = {};\n this._ = {\n transform: []\n };\n el.snap = id;\n hub[id] = this;\n if (this.type == \"g\") {\n this.add = add2group;\n }\n if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {\n for (var method in Paper.prototype) if (Paper.prototype[has](method)) {\n this[method] = Paper.prototype[method];\n }\n }\n}\n /*/\n * Element.attr\n [ method ]\n **\n * Gets or sets given attributes of the element.\n **\n - params (object) contains key-value pairs of attributes you want to set\n * or\n - param (string) name of the attribute\n = (Element) the current element\n * or\n = (string) value of attribute\n > Usage\n | el.attr({\n | fill: \"#fc0\",\n | stroke: \"#000\",\n | strokeWidth: 2, // CamelCase...\n | \"fill-opacity\": 0.5, // or dash-separated names\n | width: \"*=2\" // prefixed values\n | });\n | console.log(el.attr(\"fill\")); // #fc0\n * Prefixed values in format `\"+=10\"` supported. All four operations\n * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`\n * and `-`: `\"+=2em\"`.\n /*/\n Element.prototype.attr = function (params, value) {\n var el = this,\n node = el.node;\n if (!params) {\n return el;\n }\n if (is(params, \"string\")) {\n if (arguments.length > 1) {\n var json = {};\n json[params] = value;\n params = json;\n } else {\n return eve(\"snap.util.getattr.\" + params, el).firstDefined();\n }\n }\n for (var att in params) {\n if (params[has](att)) {\n eve(\"snap.util.attr.\" + att, el, params[att]);\n }\n }\n return el;\n };\n/*/\n * Snap.parse\n [ method ]\n **\n * Parses SVG fragment and converts it into a @Fragment\n **\n - svg (string) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.parse = function (svg) {\n var f = glob.doc.createDocumentFragment(),\n full = true,\n div = glob.doc.createElement(\"div\");\n svg = Str(svg);\n if (!svg.match(/^/s*</s*svg(?:/s|>)/)) {\n svg = \"<svg>\" + svg + \"</svg>\";\n full = false;\n }\n div.innerHTML = svg;\n svg = div.getElementsByTagName(\"svg\")[0];\n if (svg) {\n if (full) {\n f = svg;\n } else {\n while (svg.firstChild) {\n f.appendChild(svg.firstChild);\n }\n div.innerHTML = E;\n }\n }\n return new Fragment(f);\n};\nfunction Fragment(frag) {\n this.node = frag;\n}\n// SIERRA Snap.fragment() could especially use a code example\n/*/\n * Snap.fragment\n [ method ]\n **\n * Creates a DOM fragment from a given list of elements or strings\n **\n - varargs (…) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.fragment = function () {\n var args = Array.prototype.slice.call(arguments, 0),\n f = glob.doc.createDocumentFragment();\n for (var i = 0, ii = args.length; i < ii; i++) {\n var item = args[i];\n if (item.node && item.node.nodeType) {\n f.appendChild(item.node);\n }\n if (item.nodeType) {\n f.appendChild(item);\n }\n if (typeof item == \"string\") {\n f.appendChild(Snap.parse(item).node);\n }\n }\n return new Fragment(f);\n};\n\nfunction make(name, parent) {\n var res = $(name);\n parent.appendChild(res);\n var el = wrap(res);\n return el;\n}\nfunction Paper(w, h) {\n var res,\n desc,\n defs,\n proto = Paper.prototype;\n if (w && w.tagName == \"svg\") {\n if (w.snap in hub) {\n return hub[w.snap];\n }\n var doc = w.ownerDocument;\n res = new Element(w);\n desc = w.getElementsByTagName(\"desc\")[0];\n defs = w.getElementsByTagName(\"defs\")[0];\n if (!desc) {\n desc = $(\"desc\");\n desc.appendChild(doc.createTextNode(\"Created with Snap\"));\n res.node.appendChild(desc);\n }\n if (!defs) {\n defs = $(\"defs\");\n res.node.appendChild(defs);\n }\n res.defs = defs;\n for (var key in proto) if (proto[has](key)) {\n res[key] = proto[key];\n }\n res.paper = res.root = res;\n } else {\n res = make(\"svg\", glob.doc.body);\n $(res.node, {\n height: h,\n version: 1.1,\n width: w,\n xmlns: xmlns\n });\n }\n return res;\n}\nfunction wrap(dom) {\n if (!dom) {\n return dom;\n }\n if (dom instanceof Element || dom instanceof Fragment) {\n return dom;\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"svg\") {\n return new Paper(dom);\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"object\" && dom.type == \"image/svg+xml\") {\n return new Paper(dom.contentDocument.getElementsByTagName(\"svg\")[0]);\n }\n return new Element(dom);\n}\n\nSnap._.make = make;\nSnap._.wrap = wrap;\n/*/\n * Paper.el\n [ method ]\n **\n * Creates an element on paper with a given name and no attributes\n **\n - name (string) tag name\n - attr (object) attributes\n = (Element) the current element\n > Usage\n | var c = paper.circle(10, 10, 10); // is the same as...\n | var c = paper.el(\"circle\").attr({\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n | // and the same as\n | var c = paper.el(\"circle\", {\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n/*/\nPaper.prototype.el = function (name, attr) {\n var el = make(name, this.node);\n attr && el.attr(attr);\n return el;\n};\n// default\neve.on(\"snap.util.getattr\", function () {\n var att = eve.nt();\n att = att.substring(att.lastIndexOf(\".\") + 1);\n var css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);\n } else {\n return $(this.node, att);\n }\n});\nvar cssAttr = {\n \"alignment-baseline\": 0,\n \"baseline-shift\": 0,\n \"clip\": 0,\n \"clip-path\": 0,\n \"clip-rule\": 0,\n \"color\": 0,\n \"color-interpolation\": 0,\n \"color-interpolation-filters\": 0,\n \"color-profile\": 0,\n \"color-rendering\": 0,\n \"cursor\": 0,\n \"direction\": 0,\n \"display\": 0,\n \"dominant-baseline\": 0,\n \"enable-background\": 0,\n \"fill\": 0,\n \"fill-opacity\": 0,\n \"fill-rule\": 0,\n \"filter\": 0,\n \"flood-color\": 0,\n \"flood-opacity\": 0,\n \"font\": 0,\n \"font-family\": 0,\n \"font-size\": 0,\n \"font-size-adjust\": 0,\n \"font-stretch\": 0,\n \"font-style\": 0,\n \"font-variant\": 0,\n \"font-weight\": 0,\n \"glyph-orientation-horizontal\": 0,\n \"glyph-orientation-vertical\": 0,\n \"image-rendering\": 0,\n \"kerning\": 0,\n \"letter-spacing\": 0,\n \"lighting-color\": 0,\n \"marker\": 0,\n \"marker-end\": 0,\n \"marker-mid\": 0,\n \"marker-start\": 0,\n \"mask\": 0,\n \"opacity\": 0,\n \"overflow\": 0,\n \"pointer-events\": 0,\n \"shape-rendering\": 0,\n \"stop-color\": 0,\n \"stop-opacity\": 0,\n \"stroke\": 0,\n \"stroke-dasharray\": 0,\n \"stroke-dashoffset\": 0,\n \"stroke-linecap\": 0,\n \"stroke-linejoin\": 0,\n \"stroke-miterlimit\": 0,\n \"stroke-opacity\": 0,\n \"stroke-width\": 0,\n \"text-anchor\": 0,\n \"text-decoration\": 0,\n \"text-rendering\": 0,\n \"unicode-bidi\": 0,\n \"visibility\": 0,\n \"word-spacing\": 0,\n \"writing-mode\": 0\n};\n\neve.on(\"snap.util.attr\", function (value) {\n var att = eve.nt(),\n attr = {};\n att = att.substring(att.lastIndexOf(\".\") + 1);\n attr[att] = value;\n var style = att.replace(/-(/w)/gi, function (all, letter) {\n return letter.toUpperCase();\n }),\n css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n this.node.style[style] = value == null ? E : value;\n } else {\n $(this.node, attr);\n }\n});\n(function (proto) {}(Paper.prototype));\n\n// simple ajax\n/*/\n * Snap.ajax\n [ method ]\n **\n * Simple implementation of Ajax\n **\n - url (string) URL\n - postData (object|string) data for post request\n - callback (function) callback\n - scope (object) #optional scope of callback\n * or\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n = (XMLHttpRequest) the XMLHttpRequest object, just in case\n/*/\nSnap.ajax = function (url, postData, callback, scope){\n var req = new XMLHttpRequest,\n id = ID();\n if (req) {\n if (is(postData, \"function\")) {\n scope = callback;\n callback = postData;\n postData = null;\n } else if (is(postData, \"object\")) {\n var pd = [];\n for (var key in postData) if (postData.hasOwnProperty(key)) {\n pd.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(postData[key]));\n }\n postData = pd.join(\"&\");\n }\n req.open((postData ? \"POST\" : \"GET\"), url, true);\n if (postData) {\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n if (callback) {\n eve.once(\"snap.ajax.\" + id + \".0\", callback);\n eve.once(\"snap.ajax.\" + id + \".200\", callback);\n eve.once(\"snap.ajax.\" + id + \".304\", callback);\n }\n req.onreadystatechange = function() {\n if (req.readyState != 4) return;\n eve(\"snap.ajax.\" + id + \".\" + req.status, scope, req);\n };\n if (req.readyState == 4) {\n return req;\n }\n req.send(postData);\n return req;\n }\n};\n/*/\n * Snap.load\n [ method ]\n **\n * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)\n **\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n/*/\nSnap.load = function (url, callback, scope) {\n Snap.ajax(url, function (req) {\n var f = Snap.parse(req.responseText);\n scope ? callback.call(scope, f) : callback(f);\n });\n};\nvar getOffset = function (elem) {\n var box = elem.getBoundingClientRect(),\n doc = elem.ownerDocument,\n body = doc.body,\n docElem = doc.documentElement,\n clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,\n top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,\n left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;\n return {\n y: top,\n x: left\n };\n};\n/*/\n * Snap.getElementByPoint\n [ method ]\n **\n * Returns you topmost element under given point.\n **\n = (object) Snap element object\n - x (number) x coordinate from the top left corner of the window\n - y (number) y coordinate from the top left corner of the window\n > Usage\n | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: \"#f00\"});\n/*/\nSnap.getElementByPoint = function (x, y) {\n var paper = this,\n svg = paper.canvas,\n target = glob.doc.elementFromPoint(x, y);\n if (glob.win.opera && target.tagName == \"svg\") {\n var so = getOffset(target),\n sr = target.createSVGRect();\n sr.x = x - so.x;\n sr.y = y - so.y;\n sr.width = sr.height = 1;\n var hits = target.getIntersectionList(sr, null);\n if (hits.length) {\n target = hits[hits.length - 1];\n }\n }\n if (!target) {\n return null;\n }\n return wrap(target);\n};\n/*/\n * Snap.plugin\n [ method ]\n **\n * Let you write plugins. You pass in a function with four arguments, like this:\n | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {\n | Snap.newmethod = function () {};\n | Element.prototype.newmethod = function () {};\n | Paper.prototype.newmethod = function () {};\n | });\n * Inside the function you have access to all main objects (and their\n * prototypes). This allow you to extend anything you want.\n **\n - f (function) your plugin body\n/*/\nSnap.plugin = function (f) {\n f(Snap, Element, Paper, glob, Fragment);\n};\nglob.win.Snap = Snap;\nreturn Snap;\n}(window || this));\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var elproto = Element.prototype,\n is = Snap.is,\n Str = String,\n unit2px = Snap._unit2px,\n $ = Snap._.$,\n make = Snap._.make,\n getSomeDefs = Snap._.getSomeDefs,\n has = \"hasOwnProperty\",\n wrap = Snap._.wrap;\n /*/\n * Element.getBBox\n [ method ]\n **\n * Returns the bounding box descriptor for the given element\n **\n = (object) bounding box descriptor:\n o {\n o cx: (number) x of the center,\n o cy: (number) x of the center,\n o h: (number) height,\n o height: (number) height,\n o path: (string) path command for the box,\n o r0: (number) radius of a circle that fully encloses the box,\n o r1: (number) radius of the smallest circle that can be enclosed,\n o r2: (number) radius of the largest circle that can be enclosed,\n o vb: (string) box as a viewbox command,\n o w: (number) width,\n o width: (number) width,\n o x2: (number) x of the right side,\n o x: (number) x of the left side,\n o y2: (number) y of the bottom edge,\n o y: (number) y of the top edge\n o }\n /*/\n elproto.getBBox = function (isWithoutTransform) {\n if (!Snap.Matrix || !Snap.path) {\n return this.node.getBBox();\n }\n var el = this,\n m = new Snap.Matrix;\n if (el.removed) {\n return Snap._.box();\n }\n while (el.type == \"use\") {\n if (!isWithoutTransform) {\n m = m.add(el.transform().localMatrix.translate(el.attr(\"x\") || 0, el.attr(\"y\") || 0));\n }\n if (el.original) {\n el = el.original;\n } else {\n var href = el.attr(\"xlink:href\");\n el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf(\"#\") + 1));\n }\n }\n var _ = el._,\n pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;\n try {\n if (isWithoutTransform) {\n _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());\n return Snap._.box(_.bboxwt);\n } else {\n el.realPath = pathfinder(el);\n el.matrix = el.transform().localMatrix;\n _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));\n return Snap._.box(_.bbox);\n }\n } catch (e) {\n // Firefox doesn’t give you bbox of hidden element\n return Snap._.box();\n }\n };\n var propString = function () {\n return this.string;\n };\n function extractTransform(el, tstr) {\n if (tstr == null) {\n var doReturn = true;\n if (el.type == \"linearGradient\" || el.type == \"radialGradient\") {\n tstr = el.node.getAttribute(\"gradientTransform\");\n } else if (el.type == \"pattern\") {\n tstr = el.node.getAttribute(\"patternTransform\");\n } else {\n tstr = el.node.getAttribute(\"transform\");\n }\n if (!tstr) {\n return new Snap.Matrix;\n }\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n if (!Snap._.rgTransform.test(tstr)) {\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n tstr = Str(tstr).replace(//.{3}|/u2026/g, el._.transform || E);\n }\n if (is(tstr, \"array\")) {\n tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);\n }\n el._.transform = tstr;\n }\n var m = Snap._.transform2matrix(tstr, el.getBBox(1));\n if (doReturn) {\n return m;\n } else {\n el.matrix = m;\n }\n }\n /*/\n * Element.transform\n [ method ]\n **\n * Gets or sets transformation of the element\n **\n - tstr (string) transform string in Snap or SVG format\n = (Element) the current element\n * or\n = (object) transformation descriptor:\n o {\n o string (string) transform string,\n o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,\n o localMatrix (Matrix) matrix of transformations applied only to the element,\n o diffMatrix (Matrix) matrix of difference between global and local transformations,\n o global (string) global transformation as string,\n o local (string) local transformation as string,\n o toString (function) returns `string` property\n o }\n /*/\n elproto.transform = function (tstr) {\n var _ = this._;\n if (tstr == null) {\n var papa = this,\n global = new Snap.Matrix(this.node.getCTM()),\n local = extractTransform(this),\n ms = [local],\n m = new Snap.Matrix,\n i,\n localString = local.toTransformString(),\n string = Str(local) == Str(this.matrix) ?\n Str(_.transform) : localString;\n while (papa.type != \"svg\" && (papa = papa.parent())) {\n ms.push(extractTransform(papa));\n }\n i = ms.length;\n while (i--) {\n m.add(ms[i]);\n }\n return {\n string: string,\n globalMatrix: global,\n totalMatrix: m,\n localMatrix: local,\n diffMatrix: global.clone().add(local.invert()),\n global: global.toTransformString(),\n total: m.toTransformString(),\n local: localString,\n toString: propString\n };\n }\n if (tstr instanceof Snap.Matrix) {\n this.matrix = tstr;\n this._.transform = tstr.toTransformString();\n } else {\n extractTransform(this, tstr);\n }\n\n if (this.node) {\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\") {\n $(this.node, {gradientTransform: this.matrix});\n } else if (this.type == \"pattern\") {\n $(this.node, {patternTransform: this.matrix});\n } else {\n $(this.node, {transform: this.matrix});\n }\n }\n\n return this;\n };\n /*/\n * Element.parent\n [ method ]\n **\n * Returns the element's parent\n **\n = (Element) the parent element\n /*/\n elproto.parent = function () {\n return wrap(this.node.parentNode);\n };\n /*/\n * Element.append\n [ method ]\n **\n * Appends the given element to current one\n **\n - el (Element|Set) element to append\n = (Element) the parent element\n /*/\n /*/\n * Element.add\n [ method ]\n **\n * See @Element.append\n /*/\n elproto.append = elproto.add = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n it.add(el);\n });\n return this;\n }\n el = wrap(el);\n this.node.appendChild(el.node);\n el.paper = this.paper;\n }\n return this;\n };\n /*/\n * Element.appendTo\n [ method ]\n **\n * Appends the current element to the given one\n **\n - el (Element) parent element to append to\n = (Element) the child element\n /*/\n elproto.appendTo = function (el) {\n if (el) {\n el = wrap(el);\n el.append(this);\n }\n return this;\n };\n /*/\n * Element.prepend\n [ method ]\n **\n * Prepends the given element to the current one\n **\n - el (Element) element to prepend\n = (Element) the parent element\n /*/\n elproto.prepend = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this,\n first;\n el.forEach(function (el) {\n if (first) {\n first.after(el);\n } else {\n it.prepend(el);\n }\n first = el;\n });\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.insertBefore(el.node, this.node.firstChild);\n this.add && this.add();\n el.paper = this.paper;\n this.parent() && this.parent().add();\n parent && parent.add();\n }\n return this;\n };\n /*/\n * Element.prependTo\n [ method ]\n **\n * Prepends the current element to the given one\n **\n - el (Element) parent element to prepend to\n = (Element) the child element\n /*/\n elproto.prependTo = function (el) {\n el = wrap(el);\n el.prepend(this);\n return this;\n };\n /*/\n * Element.before\n [ method ]\n **\n * Inserts given element before the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.before = function (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n var parent = el.parent();\n it.node.parentNode.insertBefore(el.node, it.node);\n parent && parent.add();\n });\n this.parent().add();\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.parentNode.insertBefore(el.node, this.node);\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.after\n [ method ]\n **\n * Inserts given element after the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.after = function (el) {\n el = wrap(el);\n var parent = el.parent();\n if (this.node.nextSibling) {\n this.node.parentNode.insertBefore(el.node, this.node.nextSibling);\n } else {\n this.node.parentNode.appendChild(el.node);\n }\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.insertBefore\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertBefore = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.insertAfter\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertAfter = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node.nextSibling);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.remove\n [ method ]\n **\n * Removes element from the DOM\n = (Element) the detached element\n /*/\n elproto.remove = function () {\n var parent = this.parent();\n this.node.parentNode && this.node.parentNode.removeChild(this.node);\n delete this.paper;\n this.removed = true;\n parent && parent.add();\n return this;\n };\n /*/\n * Element.select\n [ method ]\n **\n * Gathers the nested @Element matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Element) result of query selection\n /*/\n elproto.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(this.node.querySelector(query));\n };\n /*/\n * Element.selectAll\n [ method ]\n **\n * Gathers nested @Element objects matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Set|array) result of query selection\n /*/\n elproto.selectAll = function (query) {\n var nodelist = this.node.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n };\n /*/\n * Element.asPX\n [ method ]\n **\n * Returns given attribute of the element as a `px` value (not %, em, etc.)\n **\n - attr (string) attribute name\n - value (string) #optional attribute value\n = (Element) result of query selection\n /*/\n elproto.asPX = function (attr, value) {\n if (value == null) {\n value = this.attr(attr);\n }\n return +unit2px(this, attr, value);\n };\n // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.\n /*/\n * Element.use\n [ method ]\n **\n * Creates a `<use>` element linked to the current element\n **\n = (Element) the `<use>` element\n /*/\n elproto.use = function () {\n var use,\n id = this.node.id;\n if (!id) {\n id = this.id;\n $(this.node, {\n id: id\n });\n }\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\" ||\n this.type == \"pattern\") {\n use = make(this.type, this.node.parentNode);\n } else {\n use = make(\"use\", this.node.parentNode);\n }\n $(use.node, {\n \"xlink:href\": \"#\" + id\n });\n use.original = this;\n return use;\n };\n function fixids(el) {\n var els = el.selectAll(\"*\"),\n it,\n url = /^/s*url/((\"|'|)(.*)/1/)/s*$/,\n ids = [],\n uses = {};\n function urltest(it, name) {\n var val = $(it.node, name);\n val = val && val.match(url);\n val = val && val[2];\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n var attr = {};\n attr[name] = URL(id);\n $(it.node, attr);\n });\n }\n }\n function linktest(it) {\n var val = $(it.node, \"xlink:href\");\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n it.attr(\"xlink:href\", \"#\" + id);\n });\n }\n }\n for (var i = 0, ii = els.length; i < ii; i++) {\n it = els[i];\n urltest(it, \"fill\");\n urltest(it, \"stroke\");\n urltest(it, \"filter\");\n urltest(it, \"mask\");\n urltest(it, \"clip-path\");\n linktest(it);\n var oldid = $(it.node, \"id\");\n if (oldid) {\n $(it.node, {id: it.id});\n ids.push({\n old: oldid,\n id: it.id\n });\n }\n }\n for (i = 0, ii = ids.length; i < ii; i++) {\n var fs = uses[ids[i].old];\n if (fs) {\n for (var j = 0, jj = fs.length; j < jj; j++) {\n fs[j](ids[i].id);\n }\n }\n }\n }\n /*/\n * Element.clone\n [ method ]\n **\n * Creates a clone of the element and inserts it after the element\n **\n = (Element) the clone\n /*/\n elproto.clone = function () {\n var clone = wrap(this.node.cloneNode(true));\n if ($(clone.node, \"id\")) {\n $(clone.node, {id: clone.id});\n }\n fixids(clone);\n clone.insertAfter(this);\n return clone;\n };\n /*/\n * Element.toDefs\n [ method ]\n **\n * Moves element to the shared `<defs>` area\n **\n = (Element) the element\n /*/\n elproto.toDefs = function () {\n var defs = getSomeDefs(this);\n defs.appendChild(this.node);\n return this;\n };\n /*/\n * Element.toPattern\n [ method ]\n **\n * Creates a `<pattern>` element from the current element\n **\n * To create a pattern you have to specify the pattern rect:\n - x (string|number)\n - y (string|number)\n - width (string|number)\n - height (string|number)\n = (Element) the `<pattern>` element\n * You can use pattern later on as an argument for `fill` attribute:\n | var p = paper.path(\"M10-5-10,15M15,0,0,15M0-5-20,15\").attr({\n | fill: \"none\",\n | stroke: \"#bada55\",\n | strokeWidth: 5\n | }).pattern(0, 0, 10, 10),\n | c = paper.circle(200, 200, 100);\n | c.attr({\n | fill: p\n | });\n /*/\n elproto.pattern = elproto.toPattern = function (x, y, width, height) {\n var p = make(\"pattern\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n $(p.node, {\n x: x,\n y: y,\n width: width,\n height: height,\n patternUnits: \"userSpaceOnUse\",\n id: p.id,\n viewBox: [x, y, width, height].join(\" \")\n });\n p.node.appendChild(this.node);\n return p;\n };\n// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.\n// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?\n /*/\n * Element.marker\n [ method ]\n **\n * Creates a `<marker>` element from the current element\n **\n * To create a marker you have to specify the bounding rect and reference point:\n - x (number)\n - y (number)\n - width (number)\n - height (number)\n - refX (number)\n - refY (number)\n = (Element) the `<marker>` element\n * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.\n /*/\n // TODO add usage for markers\n elproto.marker = function (x, y, width, height, refX, refY) {\n var p = make(\"marker\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n refX = x.refX || x.cx;\n refY = x.refY || x.cy;\n x = x.x;\n }\n $(p.node, {\n viewBox: [x, y, width, height].join(\" \"),\n markerWidth: width,\n markerHeight: height,\n orient: \"auto\",\n refX: refX || 0,\n refY: refY || 0,\n id: p.id\n });\n p.node.appendChild(this.node);\n return p;\n };\n // animation\n function slice(from, to, f) {\n return function (arr) {\n var res = arr.slice(from, to);\n if (res.length == 1) {\n res = res[0];\n }\n return f ? f(res) : res;\n };\n }\n var Animation = function (attr, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n this.attr = attr;\n this.dur = ms;\n easing && (this.easing = easing);\n callback && (this.callback = callback);\n };\n Snap._.Animation = Animation;\n /*/\n * Snap.animation\n [ method ]\n **\n * Creates an animation object\n **\n - attr (object) attributes of final destination\n - duration (number) duration of the animation, in milliseconds\n - easing (function) #optional one of easing functions of @mina or custom one\n - callback (function) #optional callback function that fires when animation ends\n = (object) animation object\n /*/\n Snap.animation = function (attr, ms, easing, callback) {\n return new Animation(attr, ms, easing, callback);\n };\n /*/\n * Element.inAnim\n [ method ]\n **\n * Returns a set of animations that may be able to manipulate the current element\n **\n = (object) in format:\n o {\n o anim (object) animation object,\n o mina (object) @mina object,\n o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n /*/\n elproto.inAnim = function () {\n var el = this,\n res = [];\n for (var id in el.anims) if (el.anims[has](id)) {\n (function (a) {\n res.push({\n anim: new Animation(a._attrs, a.dur, a.easing, a._callback),\n mina: a,\n curStatus: a.status(),\n status: function (val) {\n return a.status(val);\n },\n stop: function () {\n a.stop();\n }\n });\n }(el.anims[id]));\n }\n return res;\n };\n /*/\n * Snap.animate\n [ method ]\n **\n * Runs generic animation of one number into another with a caring function\n **\n - from (number|array) number or array of numbers\n - to (number|array) number or array of numbers\n - setter (function) caring function that accepts one number argument\n - duration (number) duration, in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function to execute when animation ends\n = (object) animation object in @mina format\n o {\n o id (string) animation id, consider it read-only,\n o duration (function) gets or sets the duration of the animation,\n o easing (function) easing,\n o speed (function) gets or sets the speed of the animation,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n | var rect = Snap().rect(0, 0, 10, 10);\n | Snap.animate(0, 10, function (val) {\n | rect.attr({\n | x: val\n | });\n | }, 1000);\n | // in given context is equivalent to\n | rect.animate({x: 10}, 1000);\n /*/\n Snap.animate = function (from, to, setter, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n var now = mina.time(),\n anim = mina(from, to, now, now + ms, mina.time, setter, easing);\n callback && eve.once(\"mina.finish.\" + anim.id, callback);\n return anim;\n };\n /*/\n * Element.stop\n [ method ]\n **\n * Stops all the animations for the current element\n **\n = (Element) the current element\n /*/\n elproto.stop = function () {\n var anims = this.inAnim();\n for (var i = 0, ii = anims.length; i < ii; i++) {\n anims[i].stop();\n }\n return this;\n };\n /*/\n * Element.animate\n [ method ]\n **\n * Animates the given attributes of the element\n **\n - attrs (object) key-value pairs of destination attributes\n - duration (number) duration of the animation in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function that executes when the animation ends\n = (Element) the current element\n /*/\n elproto.animate = function (attrs, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n if (attrs instanceof Animation) {\n callback = attrs.callback;\n easing = attrs.easing;\n ms = easing.dur;\n attrs = attrs.attr;\n }\n var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,\n el = this;\n for (var key in attrs) if (attrs[has](key)) {\n if (el.equal) {\n eq = el.equal(key, Str(attrs[key]));\n from = eq.from;\n to = eq.to;\n f = eq.f;\n } else {\n from = +el.attr(key);\n to = +attrs[key];\n }\n var len = is(from, \"array\") ? from.length : 1;\n keys[key] = slice(fkeys.length, fkeys.length + len, f);\n fkeys = fkeys.concat(from);\n tkeys = tkeys.concat(to);\n }\n var now = mina.time(),\n anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {\n var attr = {};\n for (var key in keys) if (keys[has](key)) {\n attr[key] = keys[key](val);\n }\n el.attr(attr);\n }, easing);\n el.anims[anim.id] = anim;\n anim._attrs = attrs;\n anim._callback = callback;\n eve(\"snap.animcreated.\" + el.id, anim);\n eve.once(\"mina.finish.\" + anim.id, function () {\n delete el.anims[anim.id];\n callback && callback.call(el);\n });\n eve.once(\"mina.stop.\" + anim.id, function () {\n delete el.anims[anim.id];\n });\n return el;\n };\n var eldata = {};\n /*/\n * Element.data\n [ method ]\n **\n * Adds or retrieves given value associated with given key. (Don’t confuse\n * with `data-` attributes)\n *\n * See also @Element.removeData\n - key (string) key to store data\n - value (any) #optional value to store\n = (object) @Element\n * or, if value is not specified:\n = (any) value\n > Usage\n | for (var i = 0, i < 5, i++) {\n | paper.circle(10 + 15 * i, 10, 10)\n | .attr({fill: \"#000\"})\n | .data(\"i\", i)\n | .click(function () {\n | alert(this.data(\"i\"));\n | });\n | }\n /*/\n elproto.data = function (key, value) {\n var data = eldata[this.id] = eldata[this.id] || {};\n if (arguments.length == 0){\n eve(\"snap.data.get.\" + this.id, this, data, null);\n return data;\n }\n if (arguments.length == 1) {\n if (Snap.is(key, \"object\")) {\n for (var i in key) if (key[has](i)) {\n this.data(i, key[i]);\n }\n return this;\n }\n eve(\"snap.data.get.\" + this.id, this, data[key], key);\n return data[key];\n }\n data[key] = value;\n eve(\"snap.data.set.\" + this.id, this, value, key);\n return this;\n };\n /*/\n * Element.removeData\n [ method ]\n **\n * Removes value associated with an element by given key.\n * If key is not provided, removes all the data of the element.\n - key (string) #optional key\n = (object) @Element\n /*/\n elproto.removeData = function (key) {\n if (key == null) {\n eldata[this.id] = {};\n } else {\n eldata[this.id] && delete eldata[this.id][key];\n }\n return this;\n };\n /*/\n * Element.outerSVG\n [ method ]\n **\n * Returns SVG code for the element, equivalent to HTML's `outerHTML`.\n *\n * See also @Element.innerSVG\n = (string) SVG code for the element\n /*/\n /*/\n * Element.toString\n [ method ]\n **\n * See @Element.outerSVG\n /*/\n elproto.outerSVG = elproto.toString = toString(1);\n /*/\n * Element.innerSVG\n [ method ]\n **\n * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`\n = (string) SVG code for the element\n /*/\n elproto.innerSVG = toString();\n function toString(type) {\n return function () {\n var res = type ? \"<\" + this.type : \"\",\n attr = this.node.attributes,\n chld = this.node.childNodes;\n if (type) {\n for (var i = 0, ii = attr.length; i < ii; i++) {\n res += \" \" + attr[i].name + '=\"' +\n attr[i].value.replace(/\"/g, '//\"') + '\"';\n }\n }\n if (chld.length) {\n type && (res += \">\");\n for (i = 0, ii = chld.length; i < ii; i++) {\n if (chld[i].nodeType == 3) {\n res += chld[i].nodeValue;\n } else if (chld[i].nodeType == 1) {\n res += wrap(chld[i]).toString();\n }\n }\n type && (res += \"</\" + this.type + \">\");\n } else {\n type && (res += \"/>\");\n }\n return res;\n };\n }\n elproto.toDataURL = function () {\n if (window && window.btoa) {\n var bb = this.getBBox(),\n svg = Snap.format('<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"{width}\" height=\"{height}\" viewBox=\"{x} {y} {width} {height}\">{contents}</svg>', {\n x: +bb.x.toFixed(3),\n y: +bb.y.toFixed(3),\n width: +bb.width.toFixed(3),\n height: +bb.height.toFixed(3),\n contents: this.outerSVG()\n });\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svg)));\n }\n };\n /*/\n * Fragment.select\n [ method ]\n **\n * See @Element.select\n /*/\n Fragment.prototype.select = elproto.select;\n /*/\n * Fragment.selectAll\n [ method ]\n **\n * See @Element.selectAll\n /*/\n Fragment.prototype.selectAll = elproto.selectAll;\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var objectToString = Object.prototype.toString,\n Str = String,\n math = Math,\n E = \"\";\n function Matrix(a, b, c, d, e, f) {\n if (b == null && objectToString.call(a) == \"[object SVGMatrix]\") {\n this.a = a.a;\n this.b = a.b;\n this.c = a.c;\n this.d = a.d;\n this.e = a.e;\n this.f = a.f;\n return;\n }\n if (a != null) {\n this.a = +a;\n this.b = +b;\n this.c = +c;\n this.d = +d;\n this.e = +e;\n this.f = +f;\n } else {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n }\n }\n (function (matrixproto) {\n /*/\n * Matrix.add\n [ method ]\n **\n * Adds the given matrix to existing one\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - matrix (object) @Matrix\n /*/\n matrixproto.add = function (a, b, c, d, e, f) {\n var out = [[], [], []],\n m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],\n matrix = [[a, c, e], [b, d, f], [0, 0, 1]],\n x, y, z, res;\n\n if (a && a instanceof Matrix) {\n matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];\n }\n\n for (x = 0; x < 3; x++) {\n for (y = 0; y < 3; y++) {\n res = 0;\n for (z = 0; z < 3; z++) {\n res += m[x][z] * matrix[z][y];\n }\n out[x][y] = res;\n }\n }\n this.a = out[0][0];\n this.b = out[1][0];\n this.c = out[0][1];\n this.d = out[1][1];\n this.e = out[0][2];\n this.f = out[1][2];\n return this;\n };\n /*/\n * Matrix.invert\n [ method ]\n **\n * Returns an inverted version of the matrix\n = (object) @Matrix\n /*/\n matrixproto.invert = function () {\n var me = this,\n x = me.a * me.d - me.b * me.c;\n return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);\n };\n /*/\n * Matrix.clone\n [ method ]\n **\n * Returns a copy of the matrix\n = (object) @Matrix\n /*/\n matrixproto.clone = function () {\n return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n };\n /*/\n * Matrix.translate\n [ method ]\n **\n * Translate the matrix\n - x (number) horizontal offset distance\n - y (number) vertical offset distance\n /*/\n matrixproto.translate = function (x, y) {\n return this.add(1, 0, 0, 1, x, y);\n };\n /*/\n * Matrix.scale\n [ method ]\n **\n * Scales the matrix\n - x (number) amount to be scaled, with `1` resulting in no change\n - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)\n - cx (number) #optional horizontal origin point from which to scale\n - cy (number) #optional vertical origin point from which to scale\n * Default cx, cy is the middle point of the element.\n /*/\n matrixproto.scale = function (x, y, cx, cy) {\n y == null && (y = x);\n (cx || cy) && this.add(1, 0, 0, 1, cx, cy);\n this.add(x, 0, 0, y, 0, 0);\n (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);\n return this;\n };\n /*/\n * Matrix.rotate\n [ method ]\n **\n * Rotates the matrix\n - a (number) angle of rotation, in degrees\n - x (number) horizontal origin point from which to rotate\n - y (number) vertical origin point from which to rotate\n /*/\n matrixproto.rotate = function (a, x, y) {\n a = Snap.rad(a);\n x = x || 0;\n y = y || 0;\n var cos = +math.cos(a).toFixed(9),\n sin = +math.sin(a).toFixed(9);\n this.add(cos, sin, -sin, cos, x, y);\n return this.add(1, 0, 0, 1, -x, -y);\n };\n /*/\n * Matrix.x\n [ method ]\n **\n * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y\n - x (number)\n - y (number)\n = (number) x\n /*/\n matrixproto.x = function (x, y) {\n return x * this.a + y * this.c + this.e;\n };\n /*/\n * Matrix.y\n [ method ]\n **\n * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x\n - x (number)\n - y (number)\n = (number) y\n /*/\n matrixproto.y = function (x, y) {\n return x * this.b + y * this.d + this.f;\n };\n matrixproto.get = function (i) {\n return +this[Str.fromCharCode(97 + i)].toFixed(4);\n };\n matrixproto.toString = function () {\n return \"matrix(\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + \")\";\n };\n matrixproto.offset = function () {\n return [this.e.toFixed(4), this.f.toFixed(4)];\n };\n function norm(a) {\n return a[0] * a[0] + a[1] * a[1];\n }\n function normalize(a) {\n var mag = math.sqrt(norm(a));\n a[0] && (a[0] /= mag);\n a[1] && (a[1] /= mag);\n }\n /*/\n * Matrix.determinant\n [ method ]\n **\n * Finds determinant of the given matrix.\n = (number) determinant\n /*/\n matrixproto.determinant = function () {\n return this.a * this.d - this.b * this.c;\n };\n /*/\n * Matrix.split\n [ method ]\n **\n * Splits matrix into primitive transformations\n = (object) in format:\n o dx (number) translation by x\n o dy (number) translation by y\n o scalex (number) scale by x\n o scaley (number) scale by y\n o shear (number) shear\n o rotate (number) rotation in deg\n o isSimple (boolean) could it be represented via simple transformations\n /*/\n matrixproto.split = function () {\n var out = {};\n // translation\n out.dx = this.e;\n out.dy = this.f;\n\n // scale and shear\n var row = [[this.a, this.c], [this.b, this.d]];\n out.scalex = math.sqrt(norm(row[0]));\n normalize(row[0]);\n\n out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];\n row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];\n\n out.scaley = math.sqrt(norm(row[1]));\n normalize(row[1]);\n out.shear /= out.scaley;\n\n if (this.determinant() < 0) {\n out.scalex = -out.scalex;\n }\n\n // rotation\n var sin = -row[0][1],\n cos = row[1][1];\n if (cos < 0) {\n out.rotate = Snap.deg(math.acos(cos));\n if (sin < 0) {\n out.rotate = 360 - out.rotate;\n }\n } else {\n out.rotate = Snap.deg(math.asin(sin));\n }\n\n out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);\n out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;\n out.noRotation = !+out.shear.toFixed(9) && !out.rotate;\n return out;\n };\n /*/\n * Matrix.toTransformString\n [ method ]\n **\n * Returns transform string that represents given matrix\n = (string) transform string\n /*/\n matrixproto.toTransformString = function (shorter) {\n var s = shorter || this.split();\n if (!+s.shear.toFixed(9)) {\n s.scalex = +s.scalex.toFixed(4);\n s.scaley = +s.scaley.toFixed(4);\n s.rotate = +s.rotate.toFixed(4);\n return (s.dx || s.dy ? \"t\" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) + \n (s.scalex != 1 || s.scaley != 1 ? \"s\" + [s.scalex, s.scaley, 0, 0] : E) +\n (s.rotate ? \"r\" + [+s.rotate.toFixed(4), 0, 0] : E);\n } else {\n return \"m\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];\n }\n };\n })(Matrix.prototype);\n /*/\n * Snap.Matrix\n [ method ]\n **\n * Matrix constructor, extend on your own risk.\n * To create matrices use @Snap.matrix.\n /*/\n Snap.Matrix = Matrix;\n /*/\n * Snap.matrix\n [ method ]\n **\n * Utility method\n **\n * Returns a matrix based on the given parameters\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - svgMatrix (SVGMatrix)\n = (object) @Matrix\n /*/\n Snap.matrix = function (a, b, c, d, e, f) {\n return new Matrix(a, b, c, d, e, f);\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var has = \"hasOwnProperty\",\n make = Snap._.make,\n wrap = Snap._.wrap,\n is = Snap.is,\n getSomeDefs = Snap._.getSomeDefs,\n reURLValue = /^url/(#?([^)]+)/)$/,\n $ = Snap._.$,\n URL = Snap.url,\n Str = String,\n separator = Snap._.separator,\n E = \"\";\n // Attributes event handlers\n eve.on(\"snap.util.attr.mask\", function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value.type == \"mask\") {\n var mask = value;\n } else {\n mask = make(\"mask\", getSomeDefs(this));\n mask.node.appendChild(value.node);\n }\n !mask.node.id && $(mask.node, {\n id: mask.id\n });\n $(this.node, {\n mask: URL(mask.id)\n });\n }\n });\n (function (clipIt) {\n eve.on(\"snap.util.attr.clip\", clipIt);\n eve.on(\"snap.util.attr.clip-path\", clipIt);\n eve.on(\"snap.util.attr.clipPath\", clipIt);\n }(function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value.type == \"clipPath\") {\n var clip = value;\n } else {\n clip = make(\"clipPath\", getSomeDefs(this));\n clip.node.appendChild(value.node);\n !clip.node.id && $(clip.node, {\n id: clip.id\n });\n }\n $(this.node, {\n \"clip-path\": URL(clip.node.id || clip.id)\n });\n }\n }));\n function fillStroke(name) {\n return function (value) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1 &&\n (value.node.firstChild.tagName == \"radialGradient\" ||\n value.node.firstChild.tagName == \"linearGradient\" ||\n value.node.firstChild.tagName == \"pattern\")) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value instanceof Element) {\n if (value.type == \"radialGradient\" || value.type == \"linearGradient\"\n || value.type == \"pattern\") {\n if (!value.node.id) {\n $(value.node, {\n id: value.id\n });\n }\n var fill = URL(value.node.id);\n } else {\n fill = value.attr(name);\n }\n } else {\n fill = Snap.color(value);\n if (fill.error) {\n var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);\n if (grad) {\n if (!grad.node.id) {\n $(grad.node, {\n id: grad.id\n });\n }\n fill = URL(grad.node.id);\n } else {\n fill = value;\n }\n } else {\n fill = Str(fill);\n }\n }\n var attrs = {};\n attrs[name] = fill;\n $(this.node, attrs);\n this.node.style[name] = E;\n };\n }\n eve.on(\"snap.util.attr.fill\", fillStroke(\"fill\"));\n eve.on(\"snap.util.attr.stroke\", fillStroke(\"stroke\"));\n var gradrg = /^([lr])(?:/(([^)]*)/))?(.*)$/i;\n eve.on(\"snap.util.grad.parse\", function parseGrad(string) {\n string = Str(string);\n var tokens = string.match(gradrg);\n if (!tokens) {\n return null;\n }\n var type = tokens[1],\n params = tokens[2],\n stops = tokens[3];\n params = params.split(//s*,/s*/).map(function (el) {\n return +el == el ? +el : el;\n });\n if (params.length == 1 && params[0] == 0) {\n params = [];\n }\n stops = stops.split(\"-\");\n stops = stops.map(function (el) {\n el = el.split(\":\");\n var out = {\n color: el[0]\n };\n if (el[1]) {\n out.offset = parseFloat(el[1]);\n }\n return out;\n });\n return {\n type: type,\n params: params,\n stops: stops\n };\n });\n\n eve.on(\"snap.util.attr.d\", function (value) {\n eve.stop();\n if (is(value, \"array\") && is(value[0], \"array\")) {\n value = Snap.path.toString.call(value);\n }\n value = Str(value);\n if (value.match(/[ruo]/i)) {\n value = Snap.path.toAbsolute(value);\n }\n $(this.node, {d: value});\n })(-1);\n eve.on(\"snap.util.attr.#text\", function (value) {\n eve.stop();\n value = Str(value);\n var txt = glob.doc.createTextNode(value);\n while (this.node.firstChild) {\n this.node.removeChild(this.node.firstChild);\n }\n this.node.appendChild(txt);\n })(-1);\n eve.on(\"snap.util.attr.path\", function (value) {\n eve.stop();\n this.attr({d: value});\n })(-1);\n eve.on(\"snap.util.attr.class\", function (value) {\n eve.stop();\n this.node.className.baseVal = value;\n })(-1);\n eve.on(\"snap.util.attr.viewBox\", function (value) {\n var vb;\n if (is(value, \"object\") && \"x\" in value) {\n vb = [value.x, value.y, value.width, value.height].join(\" \");\n } else if (is(value, \"array\")) {\n vb = value.join(\" \");\n } else {\n vb = value;\n }\n $(this.node, {\n viewBox: vb\n });\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.transform\", function (value) {\n this.transform(value);\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.r\", function (value) {\n if (this.type == \"rect\") {\n eve.stop();\n $(this.node, {\n rx: value,\n ry: value\n });\n }\n })(-1);\n eve.on(\"snap.util.attr.textpath\", function (value) {\n eve.stop();\n if (this.type == \"text\") {\n var id, tp, node;\n if (!value && this.textPath) {\n tp = this.textPath;\n while (tp.node.firstChild) {\n this.node.appendChild(tp.node.firstChild);\n }\n tp.remove();\n delete this.textPath;\n return;\n }\n if (is(value, \"string\")) {\n var defs = getSomeDefs(this),\n path = wrap(defs.parentNode).path(value);\n defs.appendChild(path.node);\n id = path.id;\n path.attr({id: id});\n } else {\n value = wrap(value);\n if (value instanceof Element) {\n id = value.attr(\"id\");\n if (!id) {\n id = value.id;\n value.attr({id: id});\n }\n }\n }\n if (id) {\n tp = this.textPath;\n node = this.node;\n if (tp) {\n tp.attr({\"xlink:href\": \"#\" + id});\n } else {\n tp = $(\"textPath\", {\n \"xlink:href\": \"#\" + id\n });\n while (node.firstChild) {\n tp.appendChild(node.firstChild);\n }\n node.appendChild(tp);\n this.textPath = wrap(tp);\n }\n }\n }\n })(-1);\n eve.on(\"snap.util.attr.text\", function (value) {\n if (this.type == \"text\") {\n var i = 0,\n node = this.node,\n tuner = function (chunk) {\n var out = $(\"tspan\");\n if (is(chunk, \"array\")) {\n for (var i = 0; i < chunk.length; i++) {\n out.appendChild(tuner(chunk[i]));\n }\n } else {\n out.appendChild(glob.doc.createTextNode(chunk));\n }\n out.normalize && out.normalize();\n return out;\n };\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n var tuned = tuner(value);\n while (tuned.firstChild) {\n node.appendChild(tuned.firstChild);\n }\n }\n eve.stop();\n })(-1);\n function setFontSize(value) {\n eve.stop();\n if (value == +value) {\n value += \"px\";\n }\n this.node.style.fontSize = value;\n }\n eve.on(\"snap.util.attr.fontSize\", setFontSize)(-1);\n eve.on(\"snap.util.attr.font-size\", setFontSize)(-1);\n\n\n eve.on(\"snap.util.getattr.transform\", function () {\n eve.stop();\n return this.transform();\n })(-1);\n eve.on(\"snap.util.getattr.textpath\", function () {\n eve.stop();\n return this.textPath;\n })(-1);\n // Markers\n (function () {\n function getter(end) {\n return function () {\n eve.stop();\n var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue(\"marker-\" + end);\n if (style == \"none\") {\n return style;\n } else {\n return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));\n }\n };\n }\n function setter(end) {\n return function (value) {\n eve.stop();\n var name = \"marker\" + end.charAt(0).toUpperCase() + end.substring(1);\n if (value == \"\" || !value) {\n this.node.style[name] = \"none\";\n return;\n }\n if (value.type == \"marker\") {\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n }\n this.node.style[name] = URL(id);\n return;\n }\n };\n }\n eve.on(\"snap.util.getattr.marker-end\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.markerEnd\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.marker-start\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.markerStart\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.marker-mid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.getattr.markerMid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.marker-end\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.markerEnd\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.marker-start\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.markerStart\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.marker-mid\", setter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.markerMid\", setter(\"mid\"))(-1);\n }());\n eve.on(\"snap.util.getattr.r\", function () {\n if (this.type == \"rect\" && $(this.node, \"rx\") == $(this.node, \"ry\")) {\n eve.stop();\n return $(this.node, \"rx\");\n }\n })(-1);\n function textExtract(node) {\n var out = [];\n var children = node.childNodes;\n for (var i = 0, ii = children.length; i < ii; i++) {\n var chi = children[i];\n if (chi.nodeType == 3) {\n out.push(chi.nodeValue);\n }\n if (chi.tagName == \"tspan\") {\n if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {\n out.push(chi.firstChild.nodeValue);\n } else {\n out.push(textExtract(chi));\n }\n }\n }\n return out;\n }\n eve.on(\"snap.util.getattr.text\", function () {\n if (this.type == \"text\" || this.type == \"tspan\") {\n eve.stop();\n var out = textExtract(this.node);\n return out.length == 1 ? out[0] : out;\n }\n })(-1);\n eve.on(\"snap.util.getattr.#text\", function () {\n return this.node.textContent;\n })(-1);\n eve.on(\"snap.util.getattr.viewBox\", function () {\n eve.stop();\n var vb = $(this.node, \"viewBox\");\n if (vb) {\n vb = vb.split(separator);\n return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.points\", function () {\n var p = $(this.node, \"points\");\n eve.stop();\n if (p) {\n return p.split(separator);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.path\", function () {\n var p = $(this.node, \"d\");\n eve.stop();\n return p;\n })(-1);\n eve.on(\"snap.util.getattr.class\", function () {\n return this.node.className.baseVal;\n })(-1);\n function getFontSize() {\n eve.stop();\n return this.node.style.fontSize;\n }\n eve.on(\"snap.util.getattr.fontSize\", getFontSize)(-1);\n eve.on(\"snap.util.getattr.font-size\", getFontSize)(-1);\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var proto = Paper.prototype,\n is = Snap.is;\n /*/\n * Paper.rect\n [ method ]\n *\n * Draws a rectangle\n **\n - x (number) x coordinate of the top left corner\n - y (number) y coordinate of the top left corner\n - width (number) width\n - height (number) height\n - rx (number) #optional horizontal radius for rounded corners, default is 0\n - ry (number) #optional vertical radius for rounded corners, default is rx or 0\n = (object) the `rect` element\n **\n > Usage\n | // regular rectangle\n | var c = paper.rect(10, 10, 50, 50);\n | // rectangle with rounded corners\n | var c = paper.rect(40, 40, 50, 50, 10);\n /*/\n proto.rect = function (x, y, w, h, rx, ry) {\n var attr;\n if (ry == null) {\n ry = rx;\n }\n if (is(x, \"object\") && x == \"[object Object]\") {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n width: w,\n height: h\n };\n if (rx != null) {\n attr.rx = rx;\n attr.ry = ry;\n }\n }\n return this.el(\"rect\", attr);\n };\n /*/\n * Paper.circle\n [ method ]\n **\n * Draws a circle\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - r (number) radius\n = (object) the `circle` element\n **\n > Usage\n | var c = paper.circle(50, 50, 40);\n /*/\n proto.circle = function (cx, cy, r) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr = {\n cx: cx,\n cy: cy,\n r: r\n };\n }\n return this.el(\"circle\", attr);\n };\n\n var preload = (function () {\n function onerror() {\n this.parentNode.removeChild(this);\n }\n return function (src, f) {\n var img = glob.doc.createElement(\"img\"),\n body = glob.doc.body;\n img.style.cssText = \"position:absolute;left:-9999em;top:-9999em\";\n img.onload = function () {\n f.call(img);\n img.onload = img.onerror = null;\n body.removeChild(img);\n };\n img.onerror = onerror;\n body.appendChild(img);\n img.src = src;\n };\n }());\n\n /*/\n * Paper.image\n [ method ]\n **\n * Places an image on the surface\n **\n - src (string) URI of the source image\n - x (number) x offset position\n - y (number) y offset position\n - width (number) width of the image\n - height (number) height of the image\n = (object) the `image` element\n * or\n = (object) Snap element object with type `image`\n **\n > Usage\n | var c = paper.image(\"apple.png\", 10, 10, 80, 80);\n /*/\n proto.image = function (src, x, y, width, height) {\n var el = this.el(\"image\");\n if (is(src, \"object\") && \"src\" in src) {\n el.attr(src);\n } else if (src != null) {\n var set = {\n \"xlink:href\": src,\n preserveAspectRatio: \"none\"\n };\n if (x != null && y != null) {\n set.x = x;\n set.y = y;\n }\n if (width != null && height != null) {\n set.width = width;\n set.height = height;\n } else {\n preload(src, function () {\n Snap._.$(el.node, {\n width: this.offsetWidth,\n height: this.offsetHeight\n });\n });\n }\n Snap._.$(el.node, set);\n }\n return el;\n };\n /*/\n * Paper.ellipse\n [ method ]\n **\n * Draws an ellipse\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - rx (number) horizontal radius\n - ry (number) vertical radius\n = (object) the `ellipse` element\n **\n > Usage\n | var c = paper.ellipse(50, 50, 40, 20);\n /*/\n proto.ellipse = function (cx, cy, rx, ry) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr ={\n cx: cx,\n cy: cy,\n rx: rx,\n ry: ry\n };\n }\n return this.el(\"ellipse\", attr);\n };\n // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.\n /*/\n * Paper.path\n [ method ]\n **\n * Creates a `<path>` element using the given string as the path's definition\n - pathString (string) #optional path string in SVG format\n * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:\n | \"M10,20L30,40\"\n * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.\n *\n # <p>Here is short list of commands available, for more details see <a href=\"http://www.w3.org/TR/SVG/paths.html#PathData\" title=\"Details of a path's data attribute's format are described in the SVG specification.\">SVG path string format</a> or <a href=\"https://developer.mozilla.org/en/SVG/Tutorial/Paths\">article about path strings at MDN</a>.</p>\n # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>\n # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>\n # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>\n # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>\n # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>\n # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>\n # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>\n # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>\n # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>\n # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>\n # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>\n # <tr><td>R</td><td><a href=\"http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline\">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>\n * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.\n * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.\n > Usage\n | var c = paper.path(\"M10 10L90 90\");\n | // draw a diagonal line:\n | // move to 10,10, line to 90,90\n /*/\n proto.path = function (d) {\n var attr;\n if (is(d, \"object\") && !is(d, \"array\")) {\n attr = d;\n } else if (d) {\n attr = {d: d};\n }\n return this.el(\"path\", attr);\n };\n /*/\n * Paper.g\n [ method ]\n **\n * Creates a group element\n **\n - varargs (…) #optional elements to nest within the group\n = (object) the `g` element\n **\n > Usage\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g(c2, c1); // note that the order of elements is different\n * or\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g();\n | g.add(c2, c1);\n /*/\n /*/\n * Paper.group\n [ method ]\n **\n * See @Paper.g\n /*/\n proto.group = proto.g = function (first) {\n var attr,\n el = this.el(\"g\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.svg\n [ method ]\n **\n * Creates a nested SVG element.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `svg` element\n **\n /*/\n proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {\n var attrs = {};\n if (is(x, \"object\") && y == null) {\n attrs = x;\n } else {\n if (x != null) {\n attrs.x = x;\n }\n if (y != null) {\n attrs.y = y;\n }\n if (width != null) {\n attrs.width = width;\n }\n if (height != null) {\n attrs.height = height;\n }\n if (vbx != null && vby != null && vbw != null && vbh != null) {\n attrs.viewBox = [vbx, vby, vbw, vbh];\n }\n }\n return this.el(\"svg\", attrs);\n };\n /*/\n * Paper.mask\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a mask.\n **\n = (object) the `mask` element\n **\n /*/\n proto.mask = function (first) {\n var attr,\n el = this.el(\"mask\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.ptrn\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a pattern.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `pattern` element\n **\n /*/\n proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {\n if (is(x, \"object\")) {\n var attr = x;\n } else {\n attr = {patternUnits: \"userSpaceOnUse\"};\n if (x) {\n attr.x = x;\n }\n if (y) {\n attr.y = y;\n }\n if (width != null) {\n attr.width = width;\n }\n if (height != null) {\n attr.height = height;\n }\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n }\n return this.el(\"pattern\", attr);\n };\n /*/\n * Paper.use\n [ method ]\n **\n * Creates a <use> element.\n - id (string) @optional id of element to link\n * or\n - id (Element) @optional element to link\n **\n = (object) the `use` element\n **\n /*/\n proto.use = function (id) {\n if (id != null) {\n if (id instanceof Element) {\n if (!id.attr(\"id\")) {\n id.attr({id: Snap._.id(id)});\n }\n id = id.attr(\"id\");\n }\n if (String(id).charAt() == \"#\") {\n id = id.substring(1);\n }\n return this.el(\"use\", {\"xlink:href\": \"#\" + id});\n } else {\n return Element.prototype.use.call(this);\n }\n };\n /*/\n * Paper.symbol\n [ method ]\n **\n * Creates a <symbol> element.\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n = (object) the `symbol` element\n **\n /*/\n proto.symbol = function (vx, vy, vw, vh) {\n var attr = {};\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n\n return this.el(\"symbol\", attr);\n };\n /*/\n * Paper.text\n [ method ]\n **\n * Draws a text string\n **\n - x (number) x coordinate position\n - y (number) y coordinate position\n - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements\n = (object) the `text` element\n **\n > Usage\n | var t1 = paper.text(50, 50, \"Snap\");\n | var t2 = paper.text(50, 50, [\"S\",\"n\",\"a\",\"p\"]);\n | // Text path usage\n | t1.attr({textpath: \"M10,10L100,100\"});\n | // or\n | var pth = paper.path(\"M10,10L100,100\");\n | t1.attr({textpath: pth});\n /*/\n proto.text = function (x, y, text) {\n var attr = {};\n if (is(x, \"object\")) {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n text: text || \"\"\n };\n }\n return this.el(\"text\", attr);\n };\n /*/\n * Paper.line\n [ method ]\n **\n * Draws a line\n **\n - x1 (number) x coordinate position of the start\n - y1 (number) y coordinate position of the start\n - x2 (number) x coordinate position of the end\n - y2 (number) y coordinate position of the end\n = (object) the `line` element\n **\n > Usage\n | var t1 = paper.line(50, 50, 100, 100);\n /*/\n proto.line = function (x1, y1, x2, y2) {\n var attr = {};\n if (is(x1, \"object\")) {\n attr = x1;\n } else if (x1 != null) {\n attr = {\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n }\n return this.el(\"line\", attr);\n };\n /*/\n * Paper.polyline\n [ method ]\n **\n * Draws a polyline\n **\n - points (array) array of points\n * or\n - varargs (…) points\n = (object) the `polyline` element\n **\n > Usage\n | var p1 = paper.polyline([10, 10, 100, 100]);\n | var p2 = paper.polyline(10, 10, 100, 100);\n /*/\n proto.polyline = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polyline\", attr);\n };\n /*/\n * Paper.polygon\n [ method ]\n **\n * Draws a polygon. See @Paper.polyline\n /*/\n proto.polygon = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polygon\", attr);\n };\n // gradients\n (function () {\n var $ = Snap._.$;\n // gradients' helpers\n function Gstops() {\n return this.selectAll(\"stop\");\n }\n function GaddStop(color, offset) {\n var stop = $(\"stop\"),\n attr = {\n offset: +offset + \"%\"\n };\n color = Snap.color(color);\n attr[\"stop-color\"] = color.hex;\n if (color.opacity < 1) {\n attr[\"stop-opacity\"] = color.opacity;\n }\n $(stop, attr);\n this.node.appendChild(stop);\n return this;\n }\n function GgetBBox() {\n if (this.type == \"linearGradient\") {\n var x1 = $(this.node, \"x1\") || 0,\n x2 = $(this.node, \"x2\") || 1,\n y1 = $(this.node, \"y1\") || 0,\n y2 = $(this.node, \"y2\") || 0;\n return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));\n } else {\n var cx = this.node.cx || .5,\n cy = this.node.cy || .5,\n r = this.node.r || 0;\n return Snap._.box(cx - r, cy - r, r * 2, r * 2);\n }\n }\n function gradient(defs, str) {\n var grad = eve(\"snap.util.grad.parse\", null, str).firstDefined(),\n el;\n if (!grad) {\n return null;\n }\n grad.params.unshift(defs);\n if (grad.type.toLowerCase() == \"l\") {\n el = gradientLinear.apply(0, grad.params);\n } else {\n el = gradientRadial.apply(0, grad.params);\n }\n if (grad.type != grad.type.toLowerCase()) {\n $(el.node, {\n gradientUnits: \"userSpaceOnUse\"\n });\n }\n var stops = grad.stops,\n len = stops.length,\n start = 0,\n j = 0;\n function seed(i, end) {\n var step = (end - start) / (i - j);\n for (var k = j; k < i; k++) {\n stops[k].offset = +(+start + step * (k - j)).toFixed(2);\n }\n j = i;\n start = end;\n }\n len--;\n for (var i = 0; i < len; i++) if (\"offset\" in stops[i]) {\n seed(i, stops[i].offset);\n }\n stops[len].offset = stops[len].offset || 100;\n seed(len, stops[len].offset);\n for (i = 0; i <= len; i++) {\n var stop = stops[i];\n el.addStop(stop.color, stop.offset);\n }\n return el;\n }\n function gradientLinear(defs, x1, y1, x2, y2) {\n var el = Snap._.make(\"linearGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (x1 != null) {\n $(el.node, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n }\n return el;\n }\n function gradientRadial(defs, cx, cy, r, fx, fy) {\n var el = Snap._.make(\"radialGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (cx != null) {\n $(el.node, {\n cx: cx,\n cy: cy,\n r: r\n });\n }\n if (fx != null && fy != null) {\n $(el.node, {\n fx: fx,\n fy: fy\n });\n }\n return el;\n }\n /*/\n * Paper.gradient\n [ method ]\n **\n * Creates a gradient element\n **\n - gradient (string) gradient descriptor\n > Gradient Descriptor\n * The gradient descriptor is an expression formatted as\n * follows: `<type>(<coords>)<colors>`. The `<type>` can be\n * either linear or radial. The uppercase `L` or `R` letters\n * indicate absolute coordinates offset from the SVG surface.\n * Lowercase `l` or `r` letters indicate coordinates\n * calculated relative to the element to which the gradient is\n * applied. Coordinates specify a linear gradient vector as\n * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,\n * `r` and optional `fx`, `fy` specifying a focal point away\n * from the center of the circle. Specify `<colors>` as a list\n * of dash-separated CSS color values. Each color may be\n * followed by a custom offset value, separated with a colon\n * character.\n > Examples\n * Linear gradient, relative from top-left corner to bottom-right\n * corner, from black through red to white:\n | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n * Linear gradient, absolute from (0, 0) to (100, 100), from black\n * through red at 25% to white:\n | var g = paper.gradient(\"L(0, 0, 100, 100)#000-#f00:25-#fff\");\n * Radial gradient, relative from the center of the element with radius\n * half the width, from black to white:\n | var g = paper.gradient(\"r(0.5, 0.5, 0.5)#000-#fff\");\n * To apply the gradient:\n | paper.circle(50, 50, 40).attr({\n | fill: g\n | });\n = (object) the `gradient` element\n /*/\n proto.gradient = function (str) {\n return gradient(this.defs, str);\n };\n proto.gradientLinear = function (x1, y1, x2, y2) {\n return gradientLinear(this.defs, x1, y1, x2, y2);\n };\n proto.gradientRadial = function (cx, cy, r, fx, fy) {\n return gradientRadial(this.defs, cx, cy, r, fx, fy);\n };\n /*/\n * Paper.toString\n [ method ]\n **\n * Returns SVG code for the @Paper\n = (string) SVG code for the @Paper\n /*/\n proto.toString = function () {\n var doc = this.node.ownerDocument,\n f = doc.createDocumentFragment(),\n d = doc.createElement(\"div\"),\n svg = this.node.cloneNode(true),\n res;\n f.appendChild(d);\n d.appendChild(svg);\n Snap._.$(svg, {xmlns: \"http://www.w3.org/2000/svg\"});\n res = d.innerHTML;\n f.removeChild(f.firstChild);\n return res;\n };\n /*/\n * Paper.toDataURL\n [ method ]\n **\n * Returns SVG code for the @Paper as Data URI string.\n = (string) Data URI string\n /*/\n proto.toDataURL = function () {\n if (window && window.btoa) {\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(this)));\n }\n };\n /*/\n * Paper.clear\n [ method ]\n **\n * Removes all child nodes of the paper, except <defs>.\n /*/\n proto.clear = function () {\n var node = this.node.firstChild,\n next;\n while (node) {\n next = node.nextSibling;\n if (node.tagName != \"defs\") {\n node.parentNode.removeChild(node);\n } else {\n proto.clear.call({node: node});\n }\n node = next;\n }\n };\n }());\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n is = Snap.is,\n clone = Snap._.clone,\n has = \"hasOwnProperty\",\n p2s = /,?([a-z]),?/gi,\n toFloat = parseFloat,\n math = Math,\n PI = math.PI,\n mmin = math.min,\n mmax = math.max,\n pow = math.pow,\n abs = math.abs;\n function paths(ps) {\n var p = paths.ps = paths.ps || {};\n if (p[ps]) {\n p[ps].sleep = 100;\n } else {\n p[ps] = {\n sleep: 100\n };\n }\n setTimeout(function () {\n for (var key in p) if (p[has](key) && key != ps) {\n p[key].sleep--;\n !p[key].sleep && delete p[key];\n }\n });\n return p[ps];\n }\n function box(x, y, width, height) {\n if (x == null) {\n x = y = width = height = 0;\n }\n if (y == null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: math.min(width, height) / 2,\n r2: math.max(width, height) / 2,\n r0: math.sqrt(width * width + height * height) / 2,\n path: rectPath(x, y, width, height),\n vb: [x, y, width, height].join(\" \")\n };\n }\n function toString() {\n return this.join(\",\").replace(p2s, \"$1\");\n }\n function pathClone(pathArray) {\n var res = clone(pathArray);\n res.toString = toString;\n return res;\n }\n function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {\n if (length == null) {\n return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);\n } else {\n return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,\n getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));\n }\n }\n function getLengthFactory(istotal, subpath) {\n function O(val) {\n return +(+val).toFixed(3);\n }\n return Snap._.cacher(function (path, length, onlystart) {\n if (path instanceof Element) {\n path = path.attr(\"d\");\n }\n path = path2curve(path);\n var x, y, p, l, sp = \"\", subpaths = {}, point,\n len = 0;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = +p[1];\n y = +p[2];\n } else {\n l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n if (len + l > length) {\n if (subpath && !subpaths.start) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n sp += [\n \"C\" + O(point.start.x),\n O(point.start.y),\n O(point.m.x),\n O(point.m.y),\n O(point.x),\n O(point.y)\n ];\n if (onlystart) {return sp;}\n subpaths.start = sp;\n sp = [\n \"M\" + O(point.x),\n O(point.y) + \"C\" + O(point.n.x),\n O(point.n.y),\n O(point.end.x),\n O(point.end.y),\n O(p[5]),\n O(p[6])\n ].join();\n len += l;\n x = +p[5];\n y = +p[6];\n continue;\n }\n if (!istotal && !subpath) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n return point;\n }\n }\n len += l;\n x = +p[5];\n y = +p[6];\n }\n sp += p.shift() + p;\n }\n subpaths.end = sp;\n point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);\n return point;\n }, null, Snap._.clone);\n }\n var getTotalLength = getLengthFactory(1),\n getPointAtLength = getLengthFactory(),\n getSubpathsAtLength = getLengthFactory(0, 1);\n function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t,\n t13 = pow(t1, 3),\n t12 = pow(t1, 2),\n t2 = t * t,\n t3 = t2 * t,\n x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,\n mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n ax = t1 * p1x + t * c1x,\n ay = t1 * p1y + t * c1y,\n cx = t1 * c2x + t * p2x,\n cy = t1 * c2y + t * p2y,\n alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);\n // (mx > nx || my < ny) && (alpha += 180);\n return {\n x: x,\n y: y,\n m: {x: mx, y: my},\n n: {x: nx, y: ny},\n start: {x: ax, y: ay},\n end: {x: cx, y: cy},\n alpha: alpha\n };\n }\n function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Snap.is(p1x, \"array\")) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n var bbox = curveDim.apply(null, p1x);\n return box(\n bbox.min.x,\n bbox.min.y,\n bbox.max.x - bbox.min.x,\n bbox.max.y - bbox.min.y\n );\n }\n function isPointInsideBBox(bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n }\n function isBBoxIntersect(bbox1, bbox2) {\n bbox1 = box(bbox1);\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)\n || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x\n || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)\n && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y\n || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n }\n function base3(t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n }\n function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z == null) {\n z = 1;\n }\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2,\n n = 12,\n Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],\n Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],\n sum = 0;\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2,\n xbase = base3(ct, x1, x2, x3, x4),\n ybase = base3(ct, y1, y2, y3, y4),\n comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * math.sqrt(comb);\n }\n return z2 * sum;\n }\n function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {\n if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {\n return;\n }\n var t = 1,\n step = t / 2,\n t2 = t - step,\n l,\n e = .01;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n while (abs(l - ll) > e) {\n step /= 2;\n t2 += (l < ll ? 1 : -1) * step;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n }\n return t2;\n }\n function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n if (\n mmax(x1, x2) < mmin(x3, x4) ||\n mmin(x1, x2) > mmax(x3, x4) ||\n mmax(y1, y2) < mmin(y3, y4) ||\n mmin(y1, y2) > mmax(y3, y4)\n ) {\n return;\n }\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (!denominator) {\n return;\n }\n var px = nx / denominator,\n py = ny / denominator,\n px2 = +px.toFixed(2),\n py2 = +py.toFixed(2);\n if (\n px2 < +mmin(x1, x2).toFixed(2) ||\n px2 > +mmax(x1, x2).toFixed(2) ||\n px2 < +mmin(x3, x4).toFixed(2) ||\n px2 > +mmax(x3, x4).toFixed(2) ||\n py2 < +mmin(y1, y2).toFixed(2) ||\n py2 > +mmax(y1, y2).toFixed(2) ||\n py2 < +mmin(y3, y4).toFixed(2) ||\n py2 > +mmax(y3, y4).toFixed(2)\n ) {\n return;\n }\n return {x: px, y: py};\n }\n function inter(bez1, bez2) {\n return interHelper(bez1, bez2);\n }\n function interCount(bez1, bez2) {\n return interHelper(bez1, bez2, 1);\n }\n function interHelper(bez1, bez2, justCount) {\n var bbox1 = bezierBBox(bez1),\n bbox2 = bezierBBox(bez2);\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n var l1 = bezlen.apply(0, bez1),\n l2 = bezlen.apply(0, bez2),\n n1 = ~~(l1 / 8),\n n2 = ~~(l2 / 8),\n dots1 = [],\n dots2 = [],\n xy = {},\n res = justCount ? 0 : [];\n for (var i = 0; i < n1 + 1; i++) {\n var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({x: p.x, y: p.y, t: i / n1});\n }\n for (i = 0; i < n2 + 1; i++) {\n p = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({x: p.x, y: p.y, t: i / n2});\n }\n for (i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i],\n di1 = dots1[i + 1],\n dj = dots2[j],\n dj1 = dots2[j + 1],\n ci = abs(di1.x - di.x) < .001 ? \"y\" : \"x\",\n cj = abs(dj1.x - dj.x) < .001 ? \"y\" : \"x\",\n is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n if (is) {\n if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {\n continue;\n }\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n res++;\n } else {\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2\n });\n }\n }\n }\n }\n }\n return res;\n }\n function pathIntersection(path1, path2) {\n return interPathHelper(path1, path2);\n }\n function pathIntersectionNumber(path1, path2) {\n return interPathHelper(path1, path2, 1);\n }\n function interPathHelper(path1, path2, justCount) {\n path1 = path2curve(path1);\n path2 = path2curve(path2);\n var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,\n res = justCount ? 0 : [];\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n if (pi[0] == \"M\") {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n } else {\n if (pi[0] == \"C\") {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n } else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n if (pj[0] == \"M\") {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n } else {\n if (pj[0] == \"C\") {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n } else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n var intr = interHelper(bez1, bez2, justCount);\n if (justCount) {\n res += intr;\n } else {\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n res = res.concat(intr);\n }\n }\n }\n }\n }\n return res;\n }\n function isPointInsidePath(path, x, y) {\n var bbox = pathBBox(path);\n return isPointInsideBBox(bbox, x, y) &&\n interPathHelper(path, [[\"M\", x, y], [\"H\", bbox.x2 + 10]], 1) % 2 == 1;\n }\n function pathBBox(path) {\n var pth = paths(path);\n if (pth.bbox) {\n return clone(pth.bbox);\n }\n if (!path) {\n return box();\n }\n path = path2curve(path);\n var x = 0, \n y = 0,\n X = [],\n Y = [],\n p;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = p[1];\n y = p[2];\n X.push(x);\n Y.push(y);\n } else {\n var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n X = X.concat(dim.min.x, dim.max.x);\n Y = Y.concat(dim.min.y, dim.max.y);\n x = p[5];\n y = p[6];\n }\n }\n var xmin = mmin.apply(0, X),\n ymin = mmin.apply(0, Y),\n xmax = mmax.apply(0, X),\n ymax = mmax.apply(0, Y),\n bb = box(xmin, ymin, xmax - xmin, ymax - ymin);\n pth.bbox = clone(bb);\n return bb;\n }\n function rectPath(x, y, w, h, r) {\n if (r) {\n return [\n [\"M\", +x + (+r), y],\n [\"l\", w - r * 2, 0],\n [\"a\", r, r, 0, 0, 1, r, r],\n [\"l\", 0, h - r * 2],\n [\"a\", r, r, 0, 0, 1, -r, r],\n [\"l\", r * 2 - w, 0],\n [\"a\", r, r, 0, 0, 1, -r, -r],\n [\"l\", 0, r * 2 - h],\n [\"a\", r, r, 0, 0, 1, r, -r],\n [\"z\"]\n ];\n }\n var res = [[\"M\", x, y], [\"l\", w, 0], [\"l\", 0, h], [\"l\", -w, 0], [\"z\"]];\n res.toString = toString;\n return res;\n }\n function ellipsePath(x, y, rx, ry, a) {\n if (a == null && ry == null) {\n ry = rx;\n }\n x = +x;\n y = +y;\n rx = +rx;\n ry = +ry;\n if (a != null) {\n var rad = Math.PI / 180,\n x1 = x + rx * Math.cos(-ry * rad),\n x2 = x + rx * Math.cos(-a * rad),\n y1 = y + rx * Math.sin(-ry * rad),\n y2 = y + rx * Math.sin(-a * rad),\n res = [[\"M\", x1, y1], [\"A\", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];\n } else {\n res = [\n [\"M\", x, y],\n [\"m\", 0, -ry],\n [\"a\", rx, ry, 0, 1, 1, 0, 2 * ry],\n [\"a\", rx, ry, 0, 1, 1, 0, -2 * ry],\n [\"z\"]\n ];\n }\n res.toString = toString;\n return res;\n }\n var unit2px = Snap._unit2px,\n getPath = {\n path: function (el) {\n return el.attr(\"path\");\n },\n circle: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx, attr.cy, attr.r);\n },\n ellipse: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);\n },\n rect: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);\n },\n image: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);\n },\n line: function (el) {\n return \"M\" + [el.attr(\"x1\") || 0, el.attr(\"y1\") || 0, el.attr(\"x2\"), el.attr(\"y2\")];\n },\n polyline: function (el) {\n return \"M\" + el.attr(\"points\");\n },\n polygon: function (el) {\n return \"M\" + el.attr(\"points\") + \"z\";\n },\n deflt: function (el) {\n var bbox = el.node.getBBox();\n return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);\n }\n };\n function pathToRelative(pathArray) {\n var pth = paths(pathArray),\n lowerCase = String.prototype.toLowerCase;\n if (pth.rel) {\n return pathClone(pth.rel);\n }\n if (!Snap.is(pathArray, \"array\") || !Snap.is(pathArray && pathArray[0], \"array\")) {\n pathArray = Snap.parsePathString(pathArray);\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0;\n if (pathArray[0][0] == \"M\") {\n x = pathArray[0][1];\n y = pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res.push([\"M\", x, y]);\n }\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var r = res[i] = [],\n pa = pathArray[i];\n if (pa[0] != lowerCase.call(pa[0])) {\n r[0] = lowerCase.call(pa[0]);\n switch (r[0]) {\n case \"a\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +(pa[6] - x).toFixed(3);\n r[7] = +(pa[7] - y).toFixed(3);\n break;\n case \"v\":\n r[1] = +(pa[1] - y).toFixed(3);\n break;\n case \"m\":\n mx = pa[1];\n my = pa[2];\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);\n }\n }\n } else {\n r = res[i] = [];\n if (pa[0] == \"m\") {\n mx = pa[1] + x;\n my = pa[2] + y;\n }\n for (var k = 0, kk = pa.length; k < kk; k++) {\n res[i][k] = pa[k];\n }\n }\n var len = res[i].length;\n switch (res[i][0]) {\n case \"z\":\n x = mx;\n y = my;\n break;\n case \"h\":\n x += +res[i][len - 1];\n break;\n case \"v\":\n y += +res[i][len - 1];\n break;\n default:\n x += +res[i][len - 2];\n y += +res[i][len - 1];\n }\n }\n res.toString = toString;\n pth.rel = pathClone(res);\n return res;\n }\n function pathToAbsolute(pathArray) {\n var pth = paths(pathArray);\n if (pth.abs) {\n return pathClone(pth.abs);\n }\n if (!is(pathArray, \"array\") || !is(pathArray && pathArray[0], \"array\")) { // rough assumption\n pathArray = Snap.parsePathString(pathArray);\n }\n if (!pathArray || !pathArray.length) {\n return [[\"M\", 0, 0]];\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0,\n pa0;\n if (pathArray[0][0] == \"M\") {\n x = +pathArray[0][1];\n y = +pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res[0] = [\"M\", x, y];\n }\n var crz = pathArray.length == 3 &&\n pathArray[0][0] == \"M\" &&\n pathArray[1][0].toUpperCase() == \"R\" &&\n pathArray[2][0].toUpperCase() == \"Z\";\n for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n res.push(r = []);\n pa = pathArray[i];\n pa0 = pa[0];\n if (pa0 != pa0.toUpperCase()) {\n r[0] = pa0.toUpperCase();\n switch (r[0]) {\n case \"A\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case \"V\":\n r[1] = +pa[1] + y;\n break;\n case \"H\":\n r[1] = +pa[1] + x;\n break;\n case \"R\":\n var dots = [x, y].concat(pa.slice(1));\n for (var j = 2, jj = dots.length; j < jj; j++) {\n dots[j] = +dots[j] + x;\n dots[++j] = +dots[j] + y;\n }\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n break;\n case \"O\":\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n break;\n case \"U\":\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n break;\n case \"M\":\n mx = +pa[1] + x;\n my = +pa[2] + y;\n default:\n for (j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n } else if (pa0 == \"R\") {\n dots = [x, y].concat(pa.slice(1));\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n r = [\"R\"].concat(pa.slice(-2));\n } else if (pa0 == \"O\") {\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n } else if (pa0 == \"U\") {\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n } else {\n for (var k = 0, kk = pa.length; k < kk; k++) {\n r[k] = pa[k];\n }\n }\n pa0 = pa0.toUpperCase();\n if (pa0 != \"O\") {\n switch (r[0]) {\n case \"Z\":\n x = +mx;\n y = +my;\n break;\n case \"H\":\n x = r[1];\n break;\n case \"V\":\n y = r[1];\n break;\n case \"M\":\n mx = r[r.length - 2];\n my = r[r.length - 1];\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n }\n }\n res.toString = toString;\n pth.abs = pathClone(res);\n return res;\n }\n function l2c(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n }\n function q2c(x1, y1, ax, ay, x2, y2) {\n var _13 = 1 / 3,\n _23 = 2 / 3;\n return [\n _13 * x1 + _23 * ax,\n _13 * y1 + _23 * ay,\n _13 * x2 + _23 * ax,\n _13 * y2 + _23 * ay,\n x2,\n y2\n ];\n }\n function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n // for more information of where this math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var _120 = PI * 120 / 180,\n rad = PI / 180 * (+angle || 0),\n res = [],\n xy,\n rotate = Snap._.cacher(function (x, y, rad) {\n var X = x * math.cos(rad) - y * math.sin(rad),\n Y = x * math.sin(rad) + y * math.cos(rad);\n return {x: X, y: Y};\n });\n if (!recursive) {\n xy = rotate(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotate(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var cos = math.cos(PI / 180 * angle),\n sin = math.sin(PI / 180 * angle),\n x = (x1 - x2) / 2,\n y = (y1 - y2) / 2;\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n if (h > 1) {\n h = math.sqrt(h);\n rx = h * rx;\n ry = h * ry;\n }\n var rx2 = rx * rx,\n ry2 = ry * ry,\n k = (large_arc_flag == sweep_flag ? -1 : 1) *\n math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n cx = k * rx * y / ry + (x1 + x2) / 2,\n cy = k * -ry * x / rx + (y1 + y2) / 2,\n f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n\n f1 = x1 < cx ? PI - f1 : f1;\n f2 = x2 < cx ? PI - f2 : f2;\n f1 < 0 && (f1 = PI * 2 + f1);\n f2 < 0 && (f2 = PI * 2 + f2);\n if (sweep_flag && f1 > f2) {\n f1 = f1 - PI * 2;\n }\n if (!sweep_flag && f2 > f1) {\n f2 = f2 - PI * 2;\n }\n } else {\n f1 = recursive[0];\n f2 = recursive[1];\n cx = recursive[2];\n cy = recursive[3];\n }\n var df = f2 - f1;\n if (abs(df) > _120) {\n var f2old = f2,\n x2old = x2,\n y2old = y2;\n f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n x2 = cx + rx * math.cos(f2);\n y2 = cy + ry * math.sin(f2);\n res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);\n }\n df = f2 - f1;\n var c1 = math.cos(f1),\n s1 = math.sin(f1),\n c2 = math.cos(f2),\n s2 = math.sin(f2),\n t = math.tan(df / 4),\n hx = 4 / 3 * rx * t,\n hy = 4 / 3 * ry * t,\n m1 = [x1, y1],\n m2 = [x1 + hx * s1, y1 - hy * c1],\n m3 = [x2 + hx * s2, y2 - hy * c2],\n m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n if (recursive) {\n return [m2, m3, m4].concat(res);\n } else {\n res = [m2, m3, m4].concat(res).join().split(\",\");\n var newres = [];\n for (var i = 0, ii = res.length; i < ii; i++) {\n newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n }\n return newres;\n }\n }\n function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n return {\n x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n };\n }\n \n // Returns bounding box of cubic bezier curve.\n // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n // Original version: NISHIO Hirokazu\n // Modifications: https://github.com/timo22345\n function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [[], []],\n a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (var i = 0; i < 2; ++i) {\n if (i == 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (abs(a) < 1e-12) {\n if (abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var x, y, j = tvalues.length,\n jlen = j,\n mt;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n\n return {\n min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},\n max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}\n };\n }\n\n function path2curve(path, path2) {\n var pth = !path2 && paths(path);\n if (!path2 && pth.curve) {\n return pathClone(pth.curve);\n }\n var p = pathToAbsolute(path),\n p2 = path2 && pathToAbsolute(path2),\n attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n processPath = function (path, d, pcom) {\n var nx, ny;\n if (!path) {\n return [\"C\", d.x, d.y, d.x, d.y, d.x, d.y];\n }\n !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);\n switch (path[0]) {\n case \"M\":\n d.X = path[1];\n d.Y = path[2];\n break;\n case \"A\":\n path = [\"C\"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));\n break;\n case \"S\":\n if (pcom == \"C\" || pcom == \"S\") { // In \"S\" case we have to take into account, if the previous command is C/S.\n nx = d.x * 2 - d.bx; // And reflect the previous\n ny = d.y * 2 - d.by; // command's control point relative to the current point.\n }\n else { // or some else or nothing\n nx = d.x;\n ny = d.y;\n }\n path = [\"C\", nx, ny].concat(path.slice(1));\n break;\n case \"T\":\n if (pcom == \"Q\" || pcom == \"T\") { // In \"T\" case we have to take into account, if the previous command is Q/T.\n d.qx = d.x * 2 - d.qx; // And make a reflection similar\n d.qy = d.y * 2 - d.qy; // to case \"S\".\n }\n else { // or something else or nothing\n d.qx = d.x;\n d.qy = d.y;\n }\n path = [\"C\"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));\n break;\n case \"Q\":\n d.qx = path[1];\n d.qy = path[2];\n path = [\"C\"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));\n break;\n case \"L\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], path[2]));\n break;\n case \"H\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], d.y));\n break;\n case \"V\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.x, path[1]));\n break;\n case \"Z\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.X, d.Y));\n break;\n }\n return path;\n },\n fixArc = function (pp, i) {\n if (pp[i].length > 7) {\n pp[i].shift();\n var pi = pp[i];\n while (pi.length) {\n pcoms1[i] = \"A\"; // if created multiple C:s, their original seg is saved\n p2 && (pcoms2[i] = \"A\"); // the same as above\n pp.splice(i++, 0, [\"C\"].concat(pi.splice(0, 6)));\n }\n pp.splice(i, 1);\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n fixM = function (path1, path2, a1, a2, i) {\n if (path1 && path2 && path1[i][0] == \"M\" && path2[i][0] != \"M\") {\n path2.splice(i, 0, [\"M\", a2.x, a2.y]);\n a1.bx = 0;\n a1.by = 0;\n a1.x = path1[i][1];\n a1.y = path1[i][2];\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n pcoms1 = [], // path commands of original path p\n pcoms2 = [], // path commands of original path p2\n pfirst = \"\", // temporary holder for original path command\n pcom = \"\"; // holder for previous path command of original path\n for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {\n p[i] && (pfirst = p[i][0]); // save current path command\n\n if (pfirst != \"C\") // C is not saved yet, because it may be result of conversion\n {\n pcoms1[i] = pfirst; // Save current path command\n i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom\n }\n p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath\n\n if (pcoms1[i] != \"A\" && pfirst == \"C\") pcoms1[i] = \"C\"; // A is the only command\n // which may produce multiple C:s\n // so we have to make sure that C is also C in original path\n\n fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1\n\n if (p2) { // the same procedures is done to p2\n p2[i] && (pfirst = p2[i][0]);\n if (pfirst != \"C\") {\n pcoms2[i] = pfirst;\n i && (pcom = pcoms2[i - 1]);\n }\n p2[i] = processPath(p2[i], attrs2, pcom);\n\n if (pcoms2[i] != \"A\" && pfirst == \"C\") {\n pcoms2[i] = \"C\";\n }\n\n fixArc(p2, i);\n }\n fixM(p, p2, attrs, attrs2, i);\n fixM(p2, p, attrs2, attrs, i);\n var seg = p[i],\n seg2 = p2 && p2[i],\n seglen = seg.length,\n seg2len = p2 && seg2.length;\n attrs.x = seg[seglen - 2];\n attrs.y = seg[seglen - 1];\n attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);\n attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);\n attrs2.x = p2 && seg2[seg2len - 2];\n attrs2.y = p2 && seg2[seg2len - 1];\n }\n if (!p2) {\n pth.curve = pathClone(p);\n }\n return p2 ? [p, p2] : p;\n }\n function mapPath(path, matrix) {\n if (!matrix) {\n return path;\n }\n var x, y, i, j, ii, jj, pathi;\n path = path2curve(path);\n for (i = 0, ii = path.length; i < ii; i++) {\n pathi = path[i];\n for (j = 1, jj = pathi.length; j < jj; j += 2) {\n x = matrix.x(pathi[j], pathi[j + 1]);\n y = matrix.y(pathi[j], pathi[j + 1]);\n pathi[j] = x;\n pathi[j + 1] = y;\n }\n }\n return path;\n }\n\n // http://schepers.cc/getting-to-the-point\n function catmullRom2bezier(crp, z) {\n var d = [];\n for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {\n var p = [\n {x: +crp[i - 2], y: +crp[i - 1]},\n {x: +crp[i], y: +crp[i + 1]},\n {x: +crp[i + 2], y: +crp[i + 3]},\n {x: +crp[i + 4], y: +crp[i + 5]}\n ];\n if (z) {\n if (!i) {\n p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};\n } else if (iLen - 4 == i) {\n p[3] = {x: +crp[0], y: +crp[1]};\n } else if (iLen - 2 == i) {\n p[2] = {x: +crp[0], y: +crp[1]};\n p[3] = {x: +crp[2], y: +crp[3]};\n }\n } else {\n if (iLen - 4 == i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {x: +crp[i], y: +crp[i + 1]};\n }\n }\n d.push([\"C\",\n (-p[0].x + 6 * p[1].x + p[2].x) / 6,\n (-p[0].y + 6 * p[1].y + p[2].y) / 6,\n (p[1].x + 6 * p[2].x - p[3].x) / 6,\n (p[1].y + 6*p[2].y - p[3].y) / 6,\n p[2].x,\n p[2].y\n ]);\n }\n\n return d;\n }\n\n // export\n Snap.path = paths;\n\n /*/\n * Snap.path.getTotalLength\n [ method ]\n **\n * Returns the length of the given path in pixels\n **\n - path (string) SVG path string\n **\n = (number) length\n /*/\n Snap.path.getTotalLength = getTotalLength;\n /*/\n * Snap.path.getPointAtLength\n [ method ]\n **\n * Returns the coordinates of the point located at the given length along the given path\n **\n - path (string) SVG path string\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n Snap.path.getPointAtLength = getPointAtLength;\n /*/\n * Snap.path.getSubpath\n [ method ]\n **\n * Returns the subpath of a given path between given start and end lengths\n **\n - path (string) SVG path string\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n Snap.path.getSubpath = function (path, from, to) {\n if (this.getTotalLength(path) - to < 1e-6) {\n return getSubpathsAtLength(path, from).end;\n }\n var a = getSubpathsAtLength(path, to, 1);\n return from ? getSubpathsAtLength(a, from).end : a;\n };\n /*/\n * Element.getTotalLength\n [ method ]\n **\n * Returns the length of the path in pixels (only works for `path` elements)\n = (number) length\n /*/\n elproto.getTotalLength = function () {\n if (this.node.getTotalLength) {\n return this.node.getTotalLength();\n }\n };\n // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?\n /*/\n * Element.getPointAtLength\n [ method ]\n **\n * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)\n **\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n elproto.getPointAtLength = function (length) {\n return getPointAtLength(this.attr(\"d\"), length);\n };\n // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.\n /*/\n * Element.getSubpath\n [ method ]\n **\n * Returns subpath of a given element from given start and end lengths (only works for `path` elements)\n **\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n elproto.getSubpath = function (from, to) {\n return Snap.path.getSubpath(this.attr(\"d\"), from, to);\n };\n Snap._.box = box;\n /*/\n * Snap.path.findDotsAtSegment\n [ method ]\n **\n * Utility method\n **\n * Finds dot coordinates on the given cubic beziér curve at the given t\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n - t (number) position on the curve (0..1)\n = (object) point information in format:\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o m: {\n o x: (number) x coordinate of the left anchor,\n o y: (number) y coordinate of the left anchor\n o },\n o n: {\n o x: (number) x coordinate of the right anchor,\n o y: (number) y coordinate of the right anchor\n o },\n o start: {\n o x: (number) x coordinate of the start of the curve,\n o y: (number) y coordinate of the start of the curve\n o },\n o end: {\n o x: (number) x coordinate of the end of the curve,\n o y: (number) y coordinate of the end of the curve\n o },\n o alpha: (number) angle of the curve derivative at the point\n o }\n /*/\n Snap.path.findDotsAtSegment = findDotsAtSegment;\n /*/\n * Snap.path.bezierBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given cubic beziér curve\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n * or\n - bez (array) array of six points for beziér curve\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.bezierBBox = bezierBBox;\n /*/\n * Snap.path.isPointInsideBBox\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside bounding box\n - bbox (string) bounding box\n - x (string) x coordinate of the point\n - y (string) y coordinate of the point\n = (boolean) `true` if point is inside\n /*/\n Snap.path.isPointInsideBBox = isPointInsideBBox;\n /*/\n * Snap.path.isBBoxIntersect\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if two bounding boxes intersect\n - bbox1 (string) first bounding box\n - bbox2 (string) second bounding box\n = (boolean) `true` if bounding boxes intersect\n /*/\n Snap.path.isBBoxIntersect = isBBoxIntersect;\n /*/\n * Snap.path.intersection\n [ method ]\n **\n * Utility method\n **\n * Finds intersections of two paths\n - path1 (string) path string\n - path2 (string) path string\n = (array) dots of intersection\n o [\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o t1: (number) t value for segment of path1,\n o t2: (number) t value for segment of path2,\n o segment1: (number) order number for segment of path1,\n o segment2: (number) order number for segment of path2,\n o bez1: (array) eight coordinates representing beziér curve for the segment of path1,\n o bez2: (array) eight coordinates representing beziér curve for the segment of path2\n o }\n o ]\n /*/\n Snap.path.intersection = pathIntersection;\n Snap.path.intersectionNumber = pathIntersectionNumber;\n /*/\n * Snap.path.isPointInside\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside a given closed path.\n *\n * Note: fill mode doesn’t affect the result of this method.\n - path (string) path string\n - x (number) x of the point\n - y (number) y of the point\n = (boolean) `true` if point is inside the path\n /*/\n Snap.path.isPointInside = isPointInsidePath;\n /*/\n * Snap.path.getBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given path\n - path (string) path string\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.getBBox = pathBBox;\n Snap.path.get = getPath;\n /*/\n * Snap.path.toRelative\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into relative values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toRelative = pathToRelative;\n /*/\n * Snap.path.toAbsolute\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into absolute values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toAbsolute = pathToAbsolute;\n /*/\n * Snap.path.toCubic\n [ method ]\n **\n * Utility method\n **\n * Converts path to a new path where all segments are cubic beziér curves\n - pathString (string|array) path string or array of segments\n = (array) array of segments\n /*/\n Snap.path.toCubic = path2curve;\n /*/\n * Snap.path.map\n [ method ]\n **\n * Transform the path string with the given matrix\n - path (string) path string\n - matrix (object) see @Matrix\n = (string) transformed path string\n /*/\n Snap.path.map = mapPath;\n Snap.path.toString = toString;\n Snap.path.clone = pathClone;\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n has = \"hasOwnProperty\",\n supportsTouch = \"createTouch\" in glob.doc,\n events = [\n \"click\", \"dblclick\", \"mousedown\", \"mousemove\", \"mouseout\",\n \"mouseover\", \"mouseup\", \"touchstart\", \"touchmove\", \"touchend\",\n \"touchcancel\"\n ],\n touchMap = {\n mousedown: \"touchstart\",\n mousemove: \"touchmove\",\n mouseup: \"touchend\"\n },\n getScroll = function (xy, el) {\n var name = xy == \"y\" ? \"scrollTop\" : \"scrollLeft\",\n doc = el && el.node ? el.node.ownerDocument : glob.doc;\n return doc[name in doc.documentElement ? \"documentElement\" : \"body\"][name];\n },\n preventDefault = function () {\n this.returnValue = false;\n },\n preventTouch = function () {\n return this.originalEvent.preventDefault();\n },\n stopPropagation = function () {\n this.cancelBubble = true;\n },\n stopTouch = function () {\n return this.originalEvent.stopPropagation();\n },\n addEvent = (function () {\n if (glob.doc.addEventListener) {\n return function (obj, type, fn, element) {\n var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,\n f = function (e) {\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element);\n if (supportsTouch && touchMap[has](type)) {\n for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {\n if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {\n var olde = e;\n e = e.targetTouches[i];\n e.originalEvent = olde;\n e.preventDefault = preventTouch;\n e.stopPropagation = stopTouch;\n break;\n }\n }\n }\n var x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n return fn.call(element, e, x, y);\n };\n\n if (type !== realName) {\n obj.addEventListener(type, f, false);\n }\n\n obj.addEventListener(realName, f, false);\n\n return function () {\n if (type !== realName) {\n obj.removeEventListener(type, f, false);\n }\n\n obj.removeEventListener(realName, f, false);\n return true;\n };\n };\n } else if (glob.doc.attachEvent) {\n return function (obj, type, fn, element) {\n var f = function (e) {\n e = e || element.node.ownerDocument.window.event;\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element),\n x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n e.preventDefault = e.preventDefault || preventDefault;\n e.stopPropagation = e.stopPropagation || stopPropagation;\n return fn.call(element, e, x, y);\n };\n obj.attachEvent(\"on\" + type, f);\n var detacher = function () {\n obj.detachEvent(\"on\" + type, f);\n return true;\n };\n return detacher;\n };\n }\n })(),\n drag = [],\n dragMove = function (e) {\n var x = e.clientX,\n y = e.clientY,\n scrollY = getScroll(\"y\"),\n scrollX = getScroll(\"x\"),\n dragi,\n j = drag.length;\n while (j--) {\n dragi = drag[j];\n if (supportsTouch) {\n var i = e.touches && e.touches.length,\n touch;\n while (i--) {\n touch = e.touches[i];\n if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {\n x = touch.clientX;\n y = touch.clientY;\n (e.originalEvent ? e.originalEvent : e).preventDefault();\n break;\n }\n }\n } else {\n e.preventDefault();\n }\n var node = dragi.el.node,\n o,\n next = node.nextSibling,\n parent = node.parentNode,\n display = node.style.display;\n // glob.win.opera && parent.removeChild(node);\n // node.style.display = \"none\";\n // o = dragi.el.paper.getElementByPoint(x, y);\n // node.style.display = display;\n // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));\n // o && eve(\"snap.drag.over.\" + dragi.el.id, dragi.el, o);\n x += scrollX;\n y += scrollY;\n eve(\"snap.drag.move.\" + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);\n }\n },\n dragUp = function (e) {\n Snap.unmousemove(dragMove).unmouseup(dragUp);\n var i = drag.length,\n dragi;\n while (i--) {\n dragi = drag[i];\n dragi.el._drag = {};\n eve(\"snap.drag.end.\" + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);\n }\n drag = [];\n };\n /*/\n * Element.click\n [ method ]\n **\n * Adds a click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unclick\n [ method ]\n **\n * Removes a click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.dblclick\n [ method ]\n **\n * Adds a double click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.undblclick\n [ method ]\n **\n * Removes a double click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousedown\n [ method ]\n **\n * Adds a mousedown event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousedown\n [ method ]\n **\n * Removes a mousedown event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousemove\n [ method ]\n **\n * Adds a mousemove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousemove\n [ method ]\n **\n * Removes a mousemove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseout\n [ method ]\n **\n * Adds a mouseout event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseout\n [ method ]\n **\n * Removes a mouseout event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseover\n [ method ]\n **\n * Adds a mouseover event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseover\n [ method ]\n **\n * Removes a mouseover event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseup\n [ method ]\n **\n * Adds a mouseup event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseup\n [ method ]\n **\n * Removes a mouseup event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchstart\n [ method ]\n **\n * Adds a touchstart event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchstart\n [ method ]\n **\n * Removes a touchstart event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchmove\n [ method ]\n **\n * Adds a touchmove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchmove\n [ method ]\n **\n * Removes a touchmove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchend\n [ method ]\n **\n * Adds a touchend event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchend\n [ method ]\n **\n * Removes a touchend event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchcancel\n [ method ]\n **\n * Adds a touchcancel event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchcancel\n [ method ]\n **\n * Removes a touchcancel event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n for (var i = events.length; i--;) {\n (function (eventName) {\n Snap[eventName] = elproto[eventName] = function (fn, scope) {\n if (Snap.is(fn, \"function\")) {\n this.events = this.events || [];\n this.events.push({\n name: eventName,\n f: fn,\n unbind: addEvent(this.node || document, eventName, fn, scope || this)\n });\n }\n return this;\n };\n Snap[\"un\" + eventName] =\n elproto[\"un\" + eventName] = function (fn) {\n var events = this.events || [],\n l = events.length;\n while (l--) if (events[l].name == eventName &&\n (events[l].f == fn || !fn)) {\n events[l].unbind();\n events.splice(l, 1);\n !events.length && delete this.events;\n return this;\n }\n return this;\n };\n })(events[i]);\n }\n /*/\n * Element.hover\n [ method ]\n **\n * Adds hover event handlers to the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n - icontext (object) #optional context for hover in handler\n - ocontext (object) #optional context for hover out handler\n = (object) @Element\n /*/\n elproto.hover = function (f_in, f_out, scope_in, scope_out) {\n return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);\n };\n /*/\n * Element.unhover\n [ method ]\n **\n * Removes hover event handlers from the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n = (object) @Element\n /*/\n elproto.unhover = function (f_in, f_out) {\n return this.unmouseover(f_in).unmouseout(f_out);\n };\n var draggable = [];\n // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.\n // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?\n // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.\n // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?\n /*/\n * Element.drag\n [ method ]\n **\n * Adds event handlers for an element's drag gesture\n **\n - onmove (function) handler for moving\n - onstart (function) handler for drag start\n - onend (function) handler for drag end\n - mcontext (object) #optional context for moving handler\n - scontext (object) #optional context for drag start handler\n - econtext (object) #optional context for drag end handler\n * Additionaly following `drag` events are triggered: `drag.start.<id>` on start, \n * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element \n * `drag.over.<id>` fires as well.\n *\n * Start event and start handler are called in specified context or in context of the element with following parameters:\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * Move event and move handler are called in specified context or in context of the element with following parameters:\n o dx (number) shift by x from the start point\n o dy (number) shift by y from the start point\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * End event and end handler are called in specified context or in context of the element with following parameters:\n o event (object) DOM event object\n = (object) @Element\n /*/\n elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {\n if (!arguments.length) {\n var origTransform;\n return this.drag(function (dx, dy) {\n this.attr({\n transform: origTransform + (origTransform ? \"T\" : \"t\") + [dx, dy]\n });\n }, function () {\n origTransform = this.transform().local;\n });\n }\n function start(e, x, y) {\n (e.originalEvent || e).preventDefault();\n this._drag.x = x;\n this._drag.y = y;\n this._drag.id = e.identifier;\n !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);\n drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});\n onstart && eve.on(\"snap.drag.start.\" + this.id, onstart);\n onmove && eve.on(\"snap.drag.move.\" + this.id, onmove);\n onend && eve.on(\"snap.drag.end.\" + this.id, onend);\n eve(\"snap.drag.start.\" + this.id, start_scope || move_scope || this, x, y, e);\n }\n this._drag = {};\n draggable.push({el: this, start: start});\n this.mousedown(start);\n return this;\n };\n /*\n * Element.onDragOver\n [ method ]\n **\n * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)\n - f (function) handler for event, first argument would be the element you are dragging over\n /*/\n // elproto.onDragOver = function (f) {\n // f ? eve.on(\"snap.drag.over.\" + this.id, f) : eve.unbind(\"snap.drag.over.\" + this.id);\n // };\n /*/\n * Element.undrag\n [ method ]\n **\n * Removes all drag event handlers from the given element\n /*/\n elproto.undrag = function () {\n var i = draggable.length;\n while (i--) if (draggable[i].el == this) {\n this.unmousedown(draggable[i].start);\n draggable.splice(i, 1);\n eve.unbind(\"snap.drag.*.\" + this.id);\n }\n !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);\n return this;\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n pproto = Paper.prototype,\n rgurl = /^/s*url/((.+)/)/,\n Str = String,\n $ = Snap._.$;\n Snap.filter = {};\n /*/\n * Paper.filter\n [ method ]\n **\n * Creates a `<filter>` element\n **\n - filstr (string) SVG fragment of filter provided as a string\n = (object) @Element\n * Note: It is recommended to use filters embedded into the page inside an empty SVG element.\n > Usage\n | var f = paper.filter('<feGaussianBlur stdDeviation=\"2\"/>'),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n pproto.filter = function (filstr) {\n var paper = this;\n if (paper.type != \"svg\") {\n paper = paper.paper;\n }\n var f = Snap.parse(Str(filstr)),\n id = Snap._.id(),\n width = paper.node.offsetWidth,\n height = paper.node.offsetHeight,\n filter = $(\"filter\");\n $(filter, {\n id: id,\n filterUnits: \"userSpaceOnUse\"\n });\n filter.appendChild(f.node);\n paper.defs.appendChild(filter);\n return new Element(filter);\n };\n \n eve.on(\"snap.util.getattr.filter\", function () {\n eve.stop();\n var p = $(this.node, \"filter\");\n if (p) {\n var match = Str(p).match(rgurl);\n return match && Snap.select(match[1]);\n }\n });\n eve.on(\"snap.util.attr.filter\", function (value) {\n if (value instanceof Element && value.type == \"filter\") {\n eve.stop();\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n id = value.id;\n }\n $(this.node, {\n filter: Snap.url(id)\n });\n }\n if (!value || value == \"none\") {\n eve.stop();\n this.node.removeAttribute(\"filter\");\n }\n });\n /*/\n * Snap.filter.blur\n [ method ]\n **\n * Returns an SVG markup string for the blur filter\n **\n - x (number) amount of horizontal blur, in pixels\n - y (number) #optional amount of vertical blur, in pixels\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.blur(5, 10)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.blur = function (x, y) {\n if (x == null) {\n x = 2;\n }\n var def = y == null ? x : [x, y];\n return Snap.format('/<feGaussianBlur stdDeviation=\"{def}\"/>', {\n def: def\n });\n };\n Snap.filter.blur.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.shadow\n [ method ]\n **\n * Returns an SVG markup string for the shadow filter\n **\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - blur (number) #optional amount of blur\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * which makes blur default to `4`. Or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - opacity (number) #optional `0..1` opacity of the shadow\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.shadow = function (dx, dy, blur, color, opacity) {\n if (typeof blur == \"string\") {\n color = blur;\n opacity = color;\n blur = 4;\n }\n if (typeof color != \"string\") {\n opacity = color;\n color = \"#000\";\n }\n color = color || \"#000\";\n if (blur == null) {\n blur = 4;\n }\n if (opacity == null) {\n opacity = 1;\n }\n if (dx == null) {\n dx = 0;\n dy = 2;\n }\n if (dy == null) {\n dy = dx;\n }\n color = Snap.color(color);\n return Snap.format('<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"{blur}\"/><feOffset dx=\"{dx}\" dy=\"{dy}\" result=\"offsetblur\"/><feFlood flood-color=\"{color}\"/><feComposite in2=\"offsetblur\" operator=\"in\"/><feComponentTransfer><feFuncA type=\"linear\" slope=\"{opacity}\"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge>', {\n color: color,\n dx: dx,\n dy: dy,\n blur: blur,\n opacity: opacity\n });\n };\n Snap.filter.shadow.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.grayscale\n [ method ]\n **\n * Returns an SVG markup string for the grayscale filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.grayscale = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0\"/>', {\n a: 0.2126 + 0.7874 * (1 - amount),\n b: 0.7152 - 0.7152 * (1 - amount),\n c: 0.0722 - 0.0722 * (1 - amount),\n d: 0.2126 - 0.2126 * (1 - amount),\n e: 0.7152 + 0.2848 * (1 - amount),\n f: 0.0722 - 0.0722 * (1 - amount),\n g: 0.2126 - 0.2126 * (1 - amount),\n h: 0.0722 + 0.9278 * (1 - amount)\n });\n };\n Snap.filter.grayscale.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.sepia\n [ method ]\n **\n * Returns an SVG markup string for the sepia filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.sepia = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0\"/>', {\n a: 0.393 + 0.607 * (1 - amount),\n b: 0.769 - 0.769 * (1 - amount),\n c: 0.189 - 0.189 * (1 - amount),\n d: 0.349 - 0.349 * (1 - amount),\n e: 0.686 + 0.314 * (1 - amount),\n f: 0.168 - 0.168 * (1 - amount),\n g: 0.272 - 0.272 * (1 - amount),\n h: 0.534 - 0.534 * (1 - amount),\n i: 0.131 + 0.869 * (1 - amount)\n });\n };\n Snap.filter.sepia.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.saturate\n [ method ]\n **\n * Returns an SVG markup string for the saturate filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.saturate = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"saturate\" values=\"{amount}\"/>', {\n amount: 1 - amount\n });\n };\n Snap.filter.saturate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.hueRotate\n [ method ]\n **\n * Returns an SVG markup string for the hue-rotate filter\n **\n - angle (number) angle of rotation\n = (string) filter representation\n /*/\n Snap.filter.hueRotate = function (angle) {\n angle = angle || 0;\n return Snap.format('<feColorMatrix type=\"hueRotate\" values=\"{angle}\"/>', {\n angle: angle\n });\n };\n Snap.filter.hueRotate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.invert\n [ method ]\n **\n * Returns an SVG markup string for the invert filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.invert = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncG type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncB type=\"table\" tableValues=\"{amount} {amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: 1 - amount\n });\n };\n Snap.filter.invert.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.brightness\n [ method ]\n **\n * Returns an SVG markup string for the brightness filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.brightness = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\"/><feFuncG type=\"linear\" slope=\"{amount}\"/><feFuncB type=\"linear\" slope=\"{amount}\"/></feComponentTransfer>', {\n amount: amount\n });\n };\n Snap.filter.brightness.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.contrast\n [ method ]\n **\n * Returns an SVG markup string for the contrast filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.contrast = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncG type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncB type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: .5 - amount / 2\n });\n };\n Snap.filter.contrast.toString = function () {\n return this();\n };\n});\n\nreturn Snap;\n}));","'use strict';\n\nvar snapsvg = module.exports = require(187);\n\nsnapsvg.plugin(function(Snap, Element) {\n\n /*/\n * Element.children\n [ method ]\n **\n * Returns array of all the children of the element.\n = (array) array of Elements\n /*/\n Element.prototype.children = function () {\n var out = [],\n ch = this.node.childNodes;\n for (var i = 0, ii = ch.length; i < ii; i++) {\n out[i] = new Snap(ch[i]);\n }\n return out;\n };\n});\n\n\n/**\n * @class ClassPlugin\n *\n * Extends snapsvg with methods to add and remove classes\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n function split(str) {\n return str.split(//s+/);\n }\n\n function join(array) {\n return array.join(' ');\n }\n\n function getClasses(e) {\n return split(e.attr('class') || '');\n }\n\n function setClasses(e, classes) {\n e.attr('class', join(classes));\n }\n\n /**\n * @method snapsvg.Element#addClass\n *\n * @example\n *\n * e.attr('class', 'selector');\n *\n * e.addClass('foo bar'); // adds classes foo and bar\n * e.attr('class'); // -> 'selector foo bar'\n *\n * e.addClass('fooBar');\n * e.attr('class'); // -> 'selector foo bar fooBar'\n *\n * @param {String} cls classes to be added to the element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.addClass = function(cls) {\n var current = getClasses(this),\n add = split(cls),\n i, e;\n\n for (i = 0, e; !!(e = add[i]); i++) {\n if (current.indexOf(e) === -1) {\n current.push(e);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n /**\n * @method snapsvg.Element#hasClass\n *\n * @param {String} cls the class to query for\n * @return {Boolean} returns true if the element has the given class\n */\n Element.prototype.hasClass = function(cls) {\n if (!cls) {\n throw new Error('[snapsvg] syntax: hasClass(clsStr)');\n }\n\n return getClasses(this).indexOf(cls) !== -1;\n };\n\n /**\n * @method snapsvg.Element#removeClass\n *\n * @example\n *\n * e.attr('class', 'foo bar');\n *\n * e.removeClass('foo');\n * e.attr('class'); // -> 'bar'\n *\n * e.removeClass('foo bar'); // removes classes foo and bar\n * e.attr('class'); // -> ''\n *\n * @param {String} cls classes to be removed from element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.removeClass = function(cls) {\n var current = getClasses(this),\n remove = split(cls),\n i, e, idx;\n\n for (i = 0, e; !!(e = remove[i]); i++) {\n idx = current.indexOf(e);\n\n if (idx !== -1) {\n // remove element from array\n current.splice(idx, 1);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n});\n\n/**\n * @class TranslatePlugin\n *\n * Extends snapsvg with methods to translate elements\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.Element#translate\n *\n * @example\n *\n * e.translate(10, 20);\n *\n * // sets transform matrix to translate(10, 20)\n *\n * @param {Number} x translation\n * @param {Number} y translation\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.translate = function(x, y) {\n var matrix = new Snap.Matrix();\n matrix.translate(x, y);\n return this.transform(matrix);\n };\n});\n\n\n/**\n * @class CreatePlugin\n *\n * Create an svg element without attaching it to the dom\n */\nsnapsvg.plugin(function(Snap) {\n\n Snap.create = function(name, attrs) {\n return Snap._.wrap(Snap._.$(name, attrs));\n };\n});\n\n\n/**\n * @class CreatSnapAtPlugin\n *\n * Extends snap.svg with a method to create a SVG element\n * at a specific position in the DOM.\n */\nsnapsvg.plugin(function(Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.createSnapAt\n *\n * @example\n *\n * snapsvg.createSnapAt(parentNode, 200, 200);\n *\n * @param {Number} width of svg\n * @param {Number} height of svg\n * @param {Object} parentNode svg Element will be child of this\n *\n * @return {snapsvg.Element} the newly created wrapped SVG element instance\n */\n Snap.createSnapAt = function(width, height, parentNode) {\n\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('width', width);\n svg.setAttribute('height', height);\n if (!parentNode) {\n parentNode = document.body;\n }\n parentNode.appendChild(svg);\n\n return new Snap(svg);\n };\n});","\r\nvar isArray = function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]';\r\n};\r\n\r\nvar annotate = function() {\r\n var args = Array.prototype.slice.call(arguments);\r\n \r\n if (args.length === 1 && isArray(args[0])) {\r\n args = args[0];\r\n }\r\n\r\n var fn = args.pop();\r\n\r\n fn.$inject = args;\r\n\r\n return fn;\r\n};\r\n\r\n\r\n// Current limitations:\r\n// - can't put into \"function arg\" comments\r\n// function /* (no parenthesis like this) */ (){}\r\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\r\n//\r\n// Just put the comment before function or inside:\r\n// /* (((this is fine))) */ function(a, b) {}\r\n// function abc(a) { /* (((this is fine))) */}\r\n\r\nvar FN_ARGS = /^function/s*[^/(]*/(/s*([^/)]*)/)/m;\r\nvar FN_ARG = ////*([^/*]*)/*///m;\r\n\r\nvar parse = function(fn) {\r\n if (typeof fn !== 'function') {\r\n throw new Error('Cannot annotate \"' + fn + '\". Expected a function!');\r\n }\r\n\r\n var match = fn.toString().match(FN_ARGS);\r\n return match[1] && match[1].split(',').map(function(arg) {\r\n match = arg.match(FN_ARG);\r\n return match ? match[1].trim() : arg.trim();\r\n }) || [];\r\n};\r\n\r\n\r\nexports.annotate = annotate;\r\nexports.parse = parse;\r\nexports.isArray = isArray;\r\n","module.exports = {\r\n annotate: require(189).annotate,\r\n Module: require(192),\r\n Injector: require(191)\r\n};\r\n","var Module = require(192);\r\nvar autoAnnotate = require(189).parse;\r\nvar annotate = require(189).annotate;\r\nvar isArray = require(189).isArray;\r\n\r\n\r\nvar Injector = function(modules, parent) {\r\n parent = parent || {\r\n get: function(name) {\r\n currentlyResolving.push(name);\r\n throw error('No provider for \"' + name + '\"!');\r\n }\r\n };\r\n\r\n var currentlyResolving = [];\r\n var providers = this._providers = Object.create(parent._providers || null);\r\n var instances = this._instances = Object.create(null);\r\n\r\n var self = instances.injector = this;\r\n\r\n var error = function(msg) {\r\n var stack = currentlyResolving.join(' -> ');\r\n currentlyResolving.length = 0;\r\n return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);\r\n };\r\n\r\n var get = function(name) {\r\n if (!providers[name] && name.indexOf('.') !== -1) {\r\n var parts = name.split('.');\r\n var pivot = get(parts.shift());\r\n\r\n while(parts.length) {\r\n pivot = pivot[parts.shift()];\r\n }\r\n\r\n return pivot;\r\n }\r\n\r\n if (Object.hasOwnProperty.call(instances, name)) {\r\n return instances[name];\r\n }\r\n\r\n if (Object.hasOwnProperty.call(providers, name)) {\r\n if (currentlyResolving.indexOf(name) !== -1) {\r\n currentlyResolving.push(name);\r\n throw error('Cannot resolve circular dependency!');\r\n }\r\n\r\n currentlyResolving.push(name);\r\n instances[name] = providers[name][0](providers[name][1]);\r\n currentlyResolving.pop();\r\n\r\n return instances[name];\r\n }\r\n\r\n return parent.get(name);\r\n };\r\n\r\n var instantiate = function(Type) {\r\n var instance = Object.create(Type.prototype);\r\n var returned = invoke(Type, instance);\r\n\r\n return typeof returned === 'object' ? returned : instance;\r\n };\r\n\r\n var invoke = function(fn, context) {\r\n if (typeof fn !== 'function') {\r\n if (isArray(fn)) {\r\n fn = annotate(fn.slice());\r\n } else {\r\n throw new Error('Cannot invoke \"' + fn + '\". Expected a function!');\r\n }\r\n }\r\n\r\n var inject = fn.$inject && fn.$inject || autoAnnotate(fn);\r\n var dependencies = inject.map(function(dep) {\r\n return get(dep);\r\n });\r\n\r\n // TODO(vojta): optimize without apply\r\n return fn.apply(context, dependencies);\r\n };\r\n\r\n\r\n var createPrivateInjectorFactory = function(privateChildInjector) {\r\n return annotate(function(key) {\r\n return privateChildInjector.get(key);\r\n });\r\n };\r\n\r\n var createChild = function(modules, forceNewInstances) {\r\n if (forceNewInstances && forceNewInstances.length) {\r\n var fromParentModule = Object.create(null);\r\n var matchedScopes = Object.create(null);\r\n\r\n var privateInjectorsCache = [];\r\n var privateChildInjectors = [];\r\n var privateChildFactories = [];\r\n\r\n var provider;\r\n var cacheIdx;\r\n var privateChildInjector;\r\n var privateChildInjectorFactory;\r\n for (var name in providers) {\r\n provider = providers[name];\r\n\r\n if (forceNewInstances.indexOf(name) !== -1) {\r\n if (provider[2] === 'private') {\r\n cacheIdx = privateInjectorsCache.indexOf(provider[3]);\r\n if (cacheIdx === -1) {\r\n privateChildInjector = provider[3].createChild([], forceNewInstances);\r\n privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\r\n privateInjectorsCache.push(provider[3]);\r\n privateChildInjectors.push(privateChildInjector);\r\n privateChildFactories.push(privateChildInjectorFactory);\r\n fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];\r\n } else {\r\n fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];\r\n }\r\n } else {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n }\r\n matchedScopes[name] = true;\r\n }\r\n\r\n if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\r\n forceNewInstances.forEach(function(scope) {\r\n if (provider[1].$scope.indexOf(scope) !== -1) {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n matchedScopes[scope] = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n forceNewInstances.forEach(function(scope) {\r\n if (!matchedScopes[scope]) {\r\n throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\r\n }\r\n });\r\n\r\n modules.unshift(fromParentModule);\r\n }\r\n\r\n return new Injector(modules, self);\r\n };\r\n\r\n var factoryMap = {\r\n factory: invoke,\r\n type: instantiate,\r\n value: function(value) {\r\n return value;\r\n }\r\n };\r\n\r\n modules.forEach(function(module) {\r\n\r\n function arrayUnwrap(type, value) {\r\n if (type !== 'value' && isArray(value)) {\r\n value = annotate(value.slice());\r\n }\r\n\r\n return value;\r\n }\r\n\r\n // TODO(vojta): handle wrong inputs (modules)\r\n if (module instanceof Module) {\r\n module.forEach(function(provider) {\r\n var name = provider[0];\r\n var type = provider[1];\r\n var value = provider[2];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n } else if (typeof module === 'object') {\r\n if (module.__exports__) {\r\n var clonedModule = Object.keys(module).reduce(function(m, key) {\r\n if (key.substring(0, 2) !== '__') {\r\n m[key] = module[key];\r\n }\r\n return m;\r\n }, Object.create(null));\r\n\r\n var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);\r\n var getFromPrivateInjector = annotate(function(key) {\r\n return privateInjector.get(key);\r\n });\r\n module.__exports__.forEach(function(key) {\r\n providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];\r\n });\r\n } else {\r\n Object.keys(module).forEach(function(name) {\r\n if (module[name][2] === 'private') {\r\n providers[name] = module[name];\r\n return;\r\n }\r\n\r\n var type = module[name][0];\r\n var value = module[name][1];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n }\r\n }\r\n });\r\n\r\n // public API\r\n this.get = get;\r\n this.invoke = invoke;\r\n this.instantiate = instantiate;\r\n this.createChild = createChild;\r\n};\r\n\r\nmodule.exports = Injector;\r\n","var Module = function() {\r\n var providers = [];\r\n\r\n this.factory = function(name, factory) {\r\n providers.push([name, 'factory', factory]);\r\n return this;\r\n };\r\n\r\n this.value = function(name, value) {\r\n providers.push([name, 'value', value]);\r\n return this;\r\n };\r\n\r\n this.type = function(name, type) {\r\n providers.push([name, 'type', type]);\r\n return this;\r\n };\r\n\r\n this.forEach = function(iterator) {\r\n providers.forEach(iterator);\r\n };\r\n};\r\n\r\nmodule.exports = Module;\r\n","'use strict';\n\nvar hat = require(194);\n\n\n/**\n * Create a new id generator / cache instance.\n *\n * You may optionally provide a seed that is used internally.\n *\n * @param {Seed} seed\n */\nfunction Ids(seed) {\n seed = seed || [ 128, 36, 1 ];\n this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;\n}\n\nmodule.exports = Ids;\n\n/**\n * Generate a next id.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.next = function(element) {\n return this._seed(element || true);\n};\n\n/**\n * Generate a next id with a given prefix.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.nextPrefixed = function(prefix, element) {\n var id;\n\n do {\n id = prefix + this.next(true);\n } while (this.assigned(id));\n\n // claim {prefix}{random}\n this.claim(id, element);\n\n // return\n return id;\n};\n\n/**\n * Manually claim an existing id.\n *\n * @param {String} id\n * @param {String} [element] element the id is claimed by\n */\nIds.prototype.claim = function(id, element) {\n this._seed.set(id, element || true);\n};\n\n/**\n * Returns true if the given id has already been assigned.\n *\n * @param {String} id\n * @return {Boolean}\n */\nIds.prototype.assigned = function(id) {\n return this._seed.get(id) || false;\n};","var hat = module.exports = function (bits, base) {\n if (!base) base = 16;\n if (bits === undefined) bits = 128;\n if (bits <= 0) return '0';\n \n var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n for (var i = 2; digits === Infinity; i *= 2) {\n digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n }\n \n var rem = digits - Math.floor(digits);\n \n var res = '';\n \n for (var i = 0; i < Math.floor(digits); i++) {\n var x = Math.floor(Math.random() * base).toString(base);\n res = x + res;\n }\n \n if (rem) {\n var b = Math.pow(base, rem);\n var x = Math.floor(Math.random() * b).toString(base);\n res = x + res;\n }\n \n var parsed = parseInt(res, base);\n if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {\n return hat(bits, base)\n }\n else return res;\n};\n\nhat.rack = function (bits, base, expandBy) {\n var fn = function (data) {\n var iters = 0;\n do {\n if (iters ++ > 10) {\n if (expandBy) bits += expandBy;\n else throw new Error('too many ID collisions, use more bits')\n }\n \n var id = hat(bits, base);\n } while (Object.hasOwnProperty.call(hats, id));\n \n hats[id] = data;\n return id;\n };\n var hats = fn.hats = {};\n \n fn.get = function (id) {\n return fn.hats[id];\n };\n \n fn.set = function (id, value) {\n fn.hats[id] = value;\n return fn;\n };\n \n fn.bits = bits || 128;\n fn.base = base || 16;\n return fn;\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","var baseFlatten = require(240),\n isIterateeCall = require(295);\n\n/**\n * Flattens a nested array. If `isDeep` is `true` the array is recursively\n * flattened, otherwise it is only flattened a single level.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, 3, [4]]]);\n * // => [1, 2, 3, [4]]\n *\n * // using `isDeep`\n * _.flatten([1, [2, 3, [4]]], true);\n * // => [1, 2, 3, 4]\n */\nfunction flatten(array, isDeep, guard) {\n var length = array ? array.length : 0;\n if (guard && isIterateeCall(array, isDeep, guard)) {\n isDeep = false;\n }\n return length ? baseFlatten(array, isDeep) : [];\n}\n\nmodule.exports = flatten;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","var baseCallback = require(229),\n baseUniq = require(264),\n isIterateeCall = require(295),\n sortedUniq = require(311);\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons, in which only the first occurence of each element\n * is kept. Providing `true` for `isSorted` performs a faster search algorithm\n * for sorted arrays. If an iteratee function is provided it is invoked for\n * each element in the array to generate the criterion by which uniqueness\n * is computed. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index, array).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias unique\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {boolean} [isSorted] Specify the array is sorted.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new duplicate-value-free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n *\n * // using `isSorted`\n * _.uniq([1, 1, 2], true);\n * // => [1, 2]\n *\n * // using an iteratee function\n * _.uniq([1, 2.5, 1.5, 2], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => [1, 2.5]\n *\n * // using the `_.property` callback shorthand\n * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nfunction uniq(array, isSorted, iteratee, thisArg) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (isSorted != null && typeof isSorted != 'boolean') {\n thisArg = iteratee;\n iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;\n isSorted = false;\n }\n iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);\n return (isSorted)\n ? sortedUniq(array, iteratee)\n : baseUniq(array, iteratee);\n}\n\nmodule.exports = uniq;\n","module.exports = require(198);\n","var LazyWrapper = require(217),\n LodashWrapper = require(218),\n baseLodash = require(250),\n isArray = require(316),\n isObjectLike = require(299),\n wrapperClone = require(314);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit chaining.\n * Methods that operate on and return arrays, collections, and functions can\n * be chained together. Methods that return a boolean or single value will\n * automatically end the chain returning the unwrapped value. Explicit chaining\n * may be enabled using `_.chain`. The execution of chained methods is lazy,\n * that is, execution is deferred until `_#value` is implicitly or explicitly\n * called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization that merges iteratees to avoid creating intermediate\n * arrays and reduce the number of iteratee executions.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,\n * `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,\n * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,\n * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,\n * and `where`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,\n * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,\n * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`,\n * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`,\n * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,\n * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,\n * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,\n * `keysIn`, `map`, `mapValues`, `matches`, `matchesProperty`, `memoize`,\n * `merge`, `mixin`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,\n * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,\n * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `reverse`,\n * `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`,\n * `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`,\n * `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`,\n * `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, `where`,\n * `without`, `wrap`, `xor`, `zip`, and `zipObject`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,\n * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,\n * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,\n * `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`,\n * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`\n * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`,\n * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`,\n * `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`,\n * `noop`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`,\n * `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`,\n * `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,\n * `uniqueId`, `value`, and `words`\n *\n * The wrapper method `sample` will return a wrapped value when `n` is provided,\n * otherwise an unwrapped value is returned.\n *\n * @name _\n * @constructor\n * @category Chain\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // returns an unwrapped value\n * wrapped.reduce(function(total, n) {\n * return total + n;\n * });\n * // => 6\n *\n * // returns a wrapped value\n * var squares = wrapped.map(function(n) {\n * return n * n;\n * });\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\n\nmodule.exports = lodash;\n","var arrayEvery = require(222),\n baseCallback = require(229),\n baseEvery = require(236),\n isArray = require(316),\n isIterateeCall = require(295);\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * The predicate is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias all\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.every(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = every;\n","var arrayFilter = require(223),\n baseCallback = require(229),\n baseFilter = require(237),\n isArray = require(316);\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias select\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.filter([4, 5, 6], function(n) {\n * return n % 2 == 0;\n * });\n * // => [4, 6]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.filter(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.filter(users, 'active'), 'user');\n * // => ['barney']\n */\nfunction filter(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n predicate = baseCallback(predicate, thisArg, 3);\n return func(collection, predicate);\n}\n\nmodule.exports = filter;\n","var baseEach = require(235),\n createFind = require(279);\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias detect\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.result(_.find(users, function(chr) {\n * return chr.age < 40;\n * }), 'user');\n * // => 'barney'\n *\n * // using the `_.matches` callback shorthand\n * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.result(_.find(users, 'active', false), 'user');\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.result(_.find(users, 'active'), 'user');\n * // => 'barney'\n */\nvar find = createFind(baseEach);\n\nmodule.exports = find;\n","var arrayEach = require(221),\n baseEach = require(235),\n createForEach = require(280);\n\n/**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection). Iteratee functions may exit iteration early\n * by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n * may be used for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(n) {\n * console.log(n);\n * }).value();\n * // => logs each value from left to right and returns the array\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n * console.log(n, key);\n * });\n * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n */\nvar forEach = createForEach(arrayEach, baseEach);\n\nmodule.exports = forEach;\n","var createAggregator = require(272);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is an array of the elements responsible for generating the key.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return Math.floor(n);\n * });\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * // using the `_.property` callback shorthand\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n});\n\nmodule.exports = groupBy;\n","var baseIndexOf = require(245),\n getLength = require(290),\n isArray = require(316),\n isIterateeCall = require(295),\n isLength = require(298),\n isString = require(322),\n values = require(331);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection` using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n * from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @alias contains, include\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {*} target The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n * // => true\n *\n * _.includes('pebbles', 'eb');\n * // => true\n */\nfunction includes(collection, target, fromIndex, guard) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n collection = values(collection);\n length = collection.length;\n }\n if (!length) {\n return false;\n }\n if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n fromIndex = 0;\n } else {\n fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n }\n return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)\n : (baseIndexOf(collection, target, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var arrayMap = require(224),\n baseCallback = require(229),\n baseMap = require(251),\n isArray = require(316);\n\n/**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n * `sum`, `uniq`, and `words`\n *\n * @static\n * @memberOf _\n * @alias collect\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function timesThree(n) {\n * return n * 3;\n * }\n *\n * _.map([1, 2], timesThree);\n * // => [3, 6]\n *\n * _.map({ 'a': 1, 'b': 2 }, timesThree);\n * // => [3, 6] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee, thisArg) {\n var func = isArray(collection) ? arrayMap : baseMap;\n iteratee = baseCallback(iteratee, thisArg, 3);\n return func(collection, iteratee);\n}\n\nmodule.exports = map;\n","var arrayReduce = require(225),\n baseEach = require(235),\n createReduce = require(283);\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` through `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not provided the first element of `collection` is used as the initial\n * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`\n *\n * @static\n * @memberOf _\n * @alias foldl, inject\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.reduce([1, 2], function(total, n) {\n * return total + n;\n * });\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n * result[key] = n * 3;\n * return result;\n * }, {});\n * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n */\nvar reduce = createReduce(arrayReduce, baseEach);\n\nmodule.exports = reduce;\n","var getLength = require(290),\n isLength = require(298),\n keys = require(326);\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable properties for objects.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the size of `collection`.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n var length = collection ? getLength(collection) : 0;\n return isLength(length) ? length : keys(collection).length;\n}\n\nmodule.exports = size;\n","var arraySome = require(226),\n baseCallback = require(229),\n baseSome = require(261),\n isArray = require(316),\n isIterateeCall = require(295);\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * The function returns as soon as it finds a passing value and does not iterate\n * over the entire collection. The predicate is bound to `thisArg` and invoked\n * with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias any\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.some(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, thisArg) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = some;\n","var baseCallback = require(229),\n baseMap = require(251),\n baseSortBy = require(262),\n compareAscending = require(269),\n isIterateeCall = require(295);\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection through `iteratee`. This method performs\n * a stable sort, that is, it preserves the original sort order of equal elements.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * _.sortBy([1, 2, 3], function(n) {\n * return Math.sin(n);\n * });\n * // => [3, 1, 2]\n *\n * _.sortBy([1, 2, 3], function(n) {\n * return this.sin(n);\n * }, Math);\n * // => [3, 1, 2]\n *\n * var users = [\n * { 'user': 'fred' },\n * { 'user': 'pebbles' },\n * { 'user': 'barney' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.sortBy(users, 'user'), 'user');\n * // => ['barney', 'fred', 'pebbles']\n */\nfunction sortBy(collection, iteratee, thisArg) {\n if (collection == null) {\n return [];\n }\n if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n iteratee = null;\n }\n var index = -1;\n iteratee = baseCallback(iteratee, thisArg, 3);\n\n var result = baseMap(collection, function(value, key, collection) {\n return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };\n });\n return baseSortBy(result, compareAscending);\n}\n\nmodule.exports = sortBy;\n","var isNative = require(318);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeNow = isNative(nativeNow = Date.now) && nativeNow;\n\n/**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = nativeNow || function() {\n return new Date().getTime();\n};\n\nmodule.exports = now;\n","var createWrapper = require(284),\n replaceHolders = require(307),\n restParam = require(216);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and prepends any additional `_.bind` arguments to those provided to the\n * bound function.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind` this method does not set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var greet = function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * };\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // using placeholders\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\nvar bind = restParam(function(func, thisArg, partials) {\n var bitmask = BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, bind.placeholder);\n bitmask |= PARTIAL_FLAG;\n }\n return createWrapper(func, bitmask, thisArg, partials, holders);\n});\n\n// Assign default placeholders.\nbind.placeholder = {};\n\nmodule.exports = bind;\n","var isObject = require(320),\n now = require(212);\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that delays invoking `func` until after `wait` milliseconds\n * have elapsed since the last time it was invoked. The created function comes\n * with a `cancel` method to cancel delayed invocations. Provide an options\n * object to indicate that `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it is invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n * 'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n * todoChanges.cancel();\n * }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\nfunction debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = wait < 0 ? 0 : (+wait || 0);\n if (options === true) {\n var leading = true;\n trailing = false;\n } else if (isObject(options)) {\n leading = options.leading;\n maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n trailing = 'trailing' in options ? options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n }\n\n function delayed() {\n var remaining = wait - (now() - stamp);\n if (remaining <= 0 || remaining > wait) {\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n var isCalled = trailingCall;\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n } else {\n timeoutId = setTimeout(delayed, remaining);\n }\n }\n\n function maxDelayed() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (trailing || (maxWait !== wait)) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n }\n\n function debounced() {\n args = arguments;\n stamp = now();\n thisArg = this;\n trailingCall = trailing && (timeoutId || !leading);\n\n if (maxWait === false) {\n var leadingCall = leading && !timeoutId;\n } else {\n if (!maxTimeoutId && !leading) {\n lastCalled = stamp;\n }\n var remaining = maxWait - (stamp - lastCalled),\n isCalled = remaining <= 0 || remaining > maxWait;\n\n if (isCalled) {\n if (maxTimeoutId) {\n maxTimeoutId = clearTimeout(maxTimeoutId);\n }\n lastCalled = stamp;\n result = func.apply(thisArg, args);\n }\n else if (!maxTimeoutId) {\n maxTimeoutId = setTimeout(maxDelayed, remaining);\n }\n }\n if (isCalled && timeoutId) {\n timeoutId = clearTimeout(timeoutId);\n }\n else if (!timeoutId && wait !== maxWait) {\n timeoutId = setTimeout(delayed, wait);\n }\n if (leadingCall) {\n isCalled = true;\n result = func.apply(thisArg, args);\n }\n if (isCalled && !timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n return result;\n }\n debounced.cancel = cancel;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var baseDelay = require(233),\n restParam = require(216);\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it is invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // logs 'deferred' after one or more milliseconds\n */\nvar defer = restParam(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n","var baseCreate = require(232),\n baseLodash = require(250);\n\n/** Used as references for `-Infinity` and `Infinity`. */\nvar POSITIVE_INFINITY = Number.POSITIVE_INFINITY;\n\n/**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @param {*} value The value to wrap.\n */\nfunction LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = null;\n this.__dir__ = 1;\n this.__dropCount__ = 0;\n this.__filtered__ = false;\n this.__iteratees__ = null;\n this.__takeCount__ = POSITIVE_INFINITY;\n this.__views__ = null;\n}\n\nLazyWrapper.prototype = baseCreate(baseLodash.prototype);\nLazyWrapper.prototype.constructor = LazyWrapper;\n\nmodule.exports = LazyWrapper;\n","var baseCreate = require(232),\n baseLodash = require(250);\n\n/**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable chaining for all wrapper methods.\n * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.\n */\nfunction LodashWrapper(value, chainAll, actions) {\n this.__wrapped__ = value;\n this.__actions__ = actions || [];\n this.__chain__ = !!chainAll;\n}\n\nLodashWrapper.prototype = baseCreate(baseLodash.prototype);\nLodashWrapper.prototype.constructor = LodashWrapper;\n\nmodule.exports = LodashWrapper;\n","var cachePush = require('./cachePush'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var length = values ? values.length : 0;\n\n this.data = { 'hash': nativeCreate(null), 'set': new Set };\n while (length--) {\n this.push(values[length]);\n }\n}\n\n// Add functions to the `Set` cache.\nSetCache.prototype.push = cachePush;\n\nmodule.exports = SetCache;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = arrayCopy;\n","/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n","/**\n * A specialized version of `_.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * A specialized version of `_.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * A specialized version of `_.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the first element of `array`\n * as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * A specialized version of `_.some` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var getSymbols = require(291),\n keys = require(326);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * A specialized version of `_.assign` for customizing assigned values without\n * support for argument juggling, multiple sources, and `this` binding `customizer`\n * functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n */\nfunction assignWith(object, source, customizer) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n value = object[key],\n result = customizer(value, source[key], key, object, source);\n\n if ((result === result ? (result !== value) : (value === value)) ||\n (value === undefined && !(key in object))) {\n object[key] = result;\n }\n }\n return object;\n}\n\nmodule.exports = assignWith;\n","var baseCopy = require(231),\n getSymbols = require(291),\n isNative = require(318),\n keys = require(326);\n\n/** Native method references. */\nvar preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;\n\n/** Used as `baseAssign`. */\nvar nativeAssign = (function() {\n // Avoid `Object.assign` in Firefox 34-37 which have an early implementation\n // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344\n // for more details.\n //\n // Use `Object.preventExtensions` on a plain object instead of simply using\n // `Object('x')` because Chrome and IE fail to throw an error when attempting\n // to assign values to readonly indexes of strings.\n var func = preventExtensions && isNative(func = Object.assign) && func;\n try {\n if (func) {\n var object = preventExtensions({ '1': 0 });\n object[0] = 1;\n }\n } catch(e) {\n // Only attempt in strict mode.\n try { func(object, 'xo'); } catch(e) {}\n return !object[1] && func;\n }\n return false;\n}());\n\n/**\n * The base implementation of `_.assign` without support for argument juggling,\n * multiple sources, and `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nvar baseAssign = nativeAssign || function(object, source) {\n return source == null\n ? object\n : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));\n};\n\nmodule.exports = baseAssign;\n","var baseMatches = require(252),\n baseMatchesProperty = require(253),\n bindCallback = require(266),\n identity = require(335),\n property = require(337);\n\n/**\n * The base implementation of `_.callback` which supports specifying the\n * number of arguments to provide to `func`.\n *\n * @private\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction baseCallback(func, thisArg, argCount) {\n var type = typeof func;\n if (type == 'function') {\n return thisArg === undefined\n ? func\n : bindCallback(func, thisArg, argCount);\n }\n if (func == null) {\n return identity;\n }\n if (type == 'object') {\n return baseMatches(func);\n }\n return thisArg === undefined\n ? property(func)\n : baseMatchesProperty(func, thisArg);\n}\n\nmodule.exports = baseCallback;\n","/**\n * The base implementation of `compareAscending` which compares values and\n * sorts them in ascending order without guaranteeing a stable sort.\n *\n * @private\n * @param {*} value The value to compare to `other`.\n * @param {*} other The value to compare to `value`.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction baseCompareAscending(value, other) {\n if (value !== other) {\n var valIsReflexive = value === value,\n othIsReflexive = other === other;\n\n if (value > other || !valIsReflexive || (value === undefined && othIsReflexive)) {\n return 1;\n }\n if (value < other || !othIsReflexive || (other === undefined && valIsReflexive)) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = baseCompareAscending;\n","/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n}\n\nmodule.exports = baseCopy;\n","var isObject = require('../lang/isObject');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function Object() {}\n return function(prototype) {\n if (isObject(prototype)) {\n Object.prototype = prototype;\n var result = new Object;\n Object.prototype = null;\n }\n return result || global.Object();\n };\n}());\n\nmodule.exports = baseCreate;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts an index\n * of where to slice the arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Object} args The arguments provide to `func`.\n * @returns {number} Returns the timer id.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","var baseIndexOf = require(245),\n cacheIndexOf = require(267),\n createCache = require(277);\n\n/**\n * The base implementation of `_.difference` which accepts a single array\n * of values to exclude.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values) {\n var length = array ? array.length : 0,\n result = [];\n\n if (!length) {\n return result;\n }\n var index = -1,\n indexOf = baseIndexOf,\n isCommon = true,\n cache = (isCommon && values.length >= 200) ? createCache(values) : null,\n valuesLength = values.length;\n\n if (cache) {\n indexOf = cacheIndexOf;\n isCommon = false;\n values = cache;\n }\n outer:\n while (++index < length) {\n var value = array[index];\n\n if (isCommon && value === value) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === value) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (indexOf(values, value, 0) < 0) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var baseForOwn = require(243),\n createBaseEach = require(274);\n\n/**\n * The base implementation of `_.forEach` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.every` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.filter` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n * without support for callback shorthands and `this` binding, which iterates\n * over `collection` using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @param {boolean} [retKey] Specify returning the key of the found element\n * instead of the element itself.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFind(collection, predicate, eachFunc, retKey) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = retKey ? key : value;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFind;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var isArguments = require(315),\n isArray = require(316),\n isArrayLike = require(293),\n isObjectLike = require(299);\n\n/**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, isDeep, isStrict) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (isObjectLike(value) && isArrayLike(value) &&\n (isStrict || isArray(value) || isArguments(value))) {\n if (isDeep) {\n // Recursively flatten arrays (susceptible to call stack limits).\n value = baseFlatten(value, isDeep, isStrict);\n }\n var valIndex = -1,\n valLength = value.length;\n\n while (++valIndex < valLength) {\n result[++resIndex] = value[valIndex];\n }\n } else if (!isStrict) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var createBaseFor = require(275);\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require(241),\n keysIn = require(327);\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n","var baseFor = require(241),\n keys = require(326);\n\n/**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var toObject = require(312);\n\n/**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path, pathKey) {\n if (object == null) {\n return;\n }\n if (pathKey !== undefined && pathKey in toObject(object)) {\n path = [pathKey];\n }\n var index = -1,\n length = path.length;\n\n while (object != null && ++index < length) {\n object = object[path[index]];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var indexOfNaN = require(292);\n\n/**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOf;\n","var baseIsEqualDeep = require(247);\n\n/**\n * The base implementation of `_.isEqual` without support for `this` binding\n * `customizer` functions.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n // Exit early for identical values.\n if (value === other) {\n return true;\n }\n var valType = typeof value,\n othType = typeof other;\n\n // Exit early for unlike primitive values.\n if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||\n value == null || other == null) {\n // Return `false` unless both values are `NaN`.\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n}\n\nmodule.exports = baseIsEqual;\n","var equalArrays = require(285),\n equalByTag = require(286),\n equalObjects = require(287),\n isArray = require(316),\n isTypedArray = require(323);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = objToString.call(object);\n if (objTag == argsTag) {\n objTag = objectTag;\n } else if (objTag != objectTag) {\n objIsArr = isTypedArray(object);\n }\n }\n if (!othIsArr) {\n othTag = objToString.call(other);\n if (othTag == argsTag) {\n othTag = objectTag;\n } else if (othTag != objectTag) {\n othIsArr = isTypedArray(other);\n }\n }\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && !(objIsArr || objIsObj)) {\n return equalByTag(object, other, objTag);\n }\n if (!isLoose) {\n var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (valWrapped || othWrapped) {\n return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n }\n }\n if (!isSameTag) {\n return false;\n }\n // Assume cyclic values are equal.\n // For more information on detecting circular references see https://es5.github.io/#JO.\n stackA || (stackA = []);\n stackB || (stackB = []);\n\n var length = stackA.length;\n while (length--) {\n if (stackA[length] == object) {\n return stackB[length] == other;\n }\n }\n // Add `object` and `other` to the stack of traversed objects.\n stackA.push(object);\n stackB.push(other);\n\n var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n stackA.pop();\n stackB.pop();\n\n return result;\n}\n\nmodule.exports = baseIsEqualDeep;\n","/**\n * The base implementation of `_.isFunction` without support for environments\n * with incorrect `typeof` results.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n */\nfunction baseIsFunction(value) {\n // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n return typeof value == 'function' || false;\n}\n\nmodule.exports = baseIsFunction;\n","var baseIsEqual = require(246);\n\n/**\n * The base implementation of `_.isMatch` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The source property names to match.\n * @param {Array} values The source values to match.\n * @param {Array} strictCompareFlags Strict comparison flags for source values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, props, values, strictCompareFlags, customizer) {\n var index = -1,\n length = props.length,\n noCustomizer = !customizer;\n\n while (++index < length) {\n if ((noCustomizer && strictCompareFlags[index])\n ? values[index] !== object[props[index]]\n : !(props[index] in object)\n ) {\n return false;\n }\n }\n index = -1;\n while (++index < length) {\n var key = props[index],\n objValue = object[key],\n srcValue = values[index];\n\n if (noCustomizer && strictCompareFlags[index]) {\n var result = objValue !== undefined || (key in object);\n } else {\n result = customizer ? customizer(objValue, srcValue, key) : undefined;\n if (result === undefined) {\n result = baseIsEqual(srcValue, objValue, customizer, true);\n }\n }\n if (!result) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","/**\n * The function whose prototype all chaining wrappers inherit from.\n *\n * @private\n */\nfunction baseLodash() {\n // No operation performed.\n}\n\nmodule.exports = baseLodash;\n","var baseEach = require(235),\n isArrayLike = require(293);\n\n/**\n * The base implementation of `_.map` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var baseIsMatch = require(249),\n constant = require(334),\n isStrictComparable = require(300),\n keys = require(326),\n toObject = require(312);\n\n/**\n * The base implementation of `_.matches` which does not clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatches(source) {\n var props = keys(source),\n length = props.length;\n\n if (!length) {\n return constant(true);\n }\n if (length == 1) {\n var key = props[0],\n value = source[key];\n\n if (isStrictComparable(value)) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value && (value !== undefined || (key in toObject(object)));\n };\n }\n }\n var values = Array(length),\n strictCompareFlags = Array(length);\n\n while (length--) {\n value = source[props[length]];\n values[length] = value;\n strictCompareFlags[length] = isStrictComparable(value);\n }\n return function(object) {\n return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require(244),\n baseIsEqual = require(246),\n baseSlice = require(260),\n isArray = require(316),\n isKey = require(296),\n isStrictComparable = require(300),\n last = require(197),\n toObject = require(312),\n toPath = require(313);\n\n/**\n * The base implementation of `_.matchesProperty` which does not which does\n * not clone `value`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} value The value to compare.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatchesProperty(path, value) {\n var isArr = isArray(path),\n isCommon = isKey(path) && isStrictComparable(value),\n pathKey = (path + '');\n\n path = toPath(path);\n return function(object) {\n if (object == null) {\n return false;\n }\n var key = pathKey;\n object = toObject(object);\n if ((isArr || !isCommon) && !(key in object)) {\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n if (object == null) {\n return false;\n }\n key = last(path);\n object = toObject(object);\n }\n return object[key] === value\n ? (value !== undefined || (key in object))\n : baseIsEqual(value, object[key], null, true);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var arrayEach = require(221),\n baseMergeDeep = require(255),\n getSymbols = require(291),\n isArray = require(316),\n isArrayLike = require(293),\n isObject = require(320),\n isObjectLike = require(299),\n isTypedArray = require(323),\n keys = require(326);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));\n if (!isSrcArr) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((isSrcArr || result !== undefined) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n}\n\nmodule.exports = baseMerge;\n","var arrayCopy = require(220),\n isArguments = require(315),\n isArray = require(316),\n isArrayLike = require(293),\n isPlainObject = require(321),\n isTypedArray = require(323),\n toPlainObject = require(324);\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n}\n\nmodule.exports = baseMergeDeep;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require(244),\n toPath = require(313);\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction basePropertyDeep(path) {\n var pathKey = (path + '');\n path = toPath(path);\n return function(object) {\n return baseGet(object, path, pathKey);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight` without support\n * for callback shorthands and `this` binding, which iterates over `collection`\n * using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initFromCollection Specify using the first or last element\n * of `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initFromCollection\n ? (initFromCollection = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var identity = require(335),\n metaMap = require(302);\n\n/**\n * The base implementation of `setData` without support for hot loop detection.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nmodule.exports = baseSetData;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n start = start == null ? 0 : (+start || 0);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : (+end || 0);\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.some` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define\n * the sort order of `array` and replaces criteria objects with their\n * corresponding values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","/**\n * Converts `value` to a string if it is not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n if (typeof value == 'string') {\n return value;\n }\n return value == null ? '' : (value + '');\n}\n\nmodule.exports = baseToString;\n","var baseIndexOf = require(245),\n cacheIndexOf = require(267),\n createCache = require(277);\n\n/**\n * The base implementation of `_.uniq` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate-value-free array.\n */\nfunction baseUniq(array, iteratee) {\n var index = -1,\n indexOf = baseIndexOf,\n length = array.length,\n isCommon = true,\n isLarge = isCommon && length >= 200,\n seen = isLarge ? createCache() : null,\n result = [];\n\n if (seen) {\n indexOf = cacheIndexOf;\n isCommon = false;\n } else {\n isLarge = false;\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value, index, array) : value;\n\n if (isCommon && value === value) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (indexOf(seen, computed, 0) < 0) {\n if (iteratee || isLarge) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n var index = -1,\n length = props.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = object[props[index]];\n }\n return result;\n}\n\nmodule.exports = baseValues;\n","var identity = require(335);\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\nmodule.exports = bindCallback;\n","var isObject = require(320);\n\n/**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\nfunction cacheIndexOf(cache, value) {\n var data = cache.data,\n result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n return result ? 0 : -1;\n}\n\nmodule.exports = cacheIndexOf;\n","var isObject = require(320);\n\n/**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\nfunction cachePush(value) {\n var data = this.data;\n if (typeof value == 'string' || isObject(value)) {\n data.set.add(value);\n } else {\n data.hash[value] = true;\n }\n}\n\nmodule.exports = cachePush;\n","var baseCompareAscending = require(230);\n\n/**\n * Used by `_.sortBy` to compare transformed elements of a collection and stable\n * sort them in ascending order.\n *\n * @private\n * @param {Object} object The object to compare to `other`.\n * @param {Object} other The object to compare to `object`.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareAscending(object, other) {\n return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);\n}\n\nmodule.exports = compareAscending;\n","/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders) {\n var holdersLength = holders.length,\n argsIndex = -1,\n argsLength = nativeMax(args.length - holdersLength, 0),\n leftIndex = -1,\n leftLength = partials.length,\n result = Array(argsLength + leftLength);\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n while (argsLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nmodule.exports = composeArgs;\n","/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders) {\n var holdersIndex = -1,\n holdersLength = holders.length,\n argsIndex = -1,\n argsLength = nativeMax(args.length - holdersLength, 0),\n rightIndex = -1,\n rightLength = partials.length,\n result = Array(argsLength + rightLength);\n\n while (++argsIndex < argsLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n return result;\n}\n\nmodule.exports = composeArgsRight;\n","var baseCallback = require(229),\n baseEach = require(235),\n isArray = require(316);\n\n/**\n * Creates a function that aggregates a collection, creating an accumulator\n * object composed from the results of running each element in the collection\n * through an iteratee.\n *\n * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,\n * and `_.partition`.\n *\n * @private\n * @param {Function} setter The function to set keys and values of the accumulator object.\n * @param {Function} [initializer] The function to initialize the accumulator object.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee, thisArg) {\n var result = initializer ? initializer() : {};\n iteratee = baseCallback(iteratee, thisArg, 3);\n\n if (isArray(collection)) {\n var index = -1,\n length = collection.length;\n\n while (++index < length) {\n var value = collection[index];\n setter(result, value, iteratee(value, index, collection), collection);\n }\n } else {\n baseEach(collection, function(value, key, collection) {\n setter(result, value, iteratee(value, key, collection), collection);\n });\n }\n return result;\n };\n}\n\nmodule.exports = createAggregator;\n","var bindCallback = require(266),\n isIterateeCall = require(295),\n restParam = require(216);\n\n/**\n * Creates a function that assigns properties of source object(s) to a given\n * destination object.\n *\n * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 && sources[length - 2],\n guard = length > 2 && sources[2],\n thisArg = length > 1 && sources[length - 1];\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : null;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? null : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var getLength = require(290),\n isLength = require(298),\n toObject = require(312);\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n return eachFunc(collection, iteratee);\n }\n var index = fromRight ? length : -1,\n iterable = toObject(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var toObject = require(312);\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createCtorWrapper = require('./createCtorWrapper');\n\n/**\n * Creates a function that wraps `func` and invokes it with the `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new bound function.\n */\nfunction createBindWrapper(func, thisArg) {\n var Ctor = createCtorWrapper(func);\n\n function wrapper() {\n var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;\n return fn.apply(thisArg, arguments);\n }\n return wrapper;\n}\n\nmodule.exports = createBindWrapper;\n","var SetCache = require('./SetCache'),\n constant = require('../utility/constant'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\nvar createCache = !(nativeCreate && Set) ? constant(null) : function(values) {\n return new SetCache(values);\n};\n\nmodule.exports = createCache;\n","var baseCreate = require(232),\n isObject = require(320);\n\n/**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCtorWrapper(Ctor) {\n return function() {\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, arguments);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n}\n\nmodule.exports = createCtorWrapper;\n","var baseCallback = require(229),\n baseFind = require(238),\n baseFindIndex = require(239),\n isArray = require(316);\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(eachFunc, fromRight) {\n return function(collection, predicate, thisArg) {\n predicate = baseCallback(predicate, thisArg, 3);\n if (isArray(collection)) {\n var index = baseFindIndex(collection, predicate, fromRight);\n return index > -1 ? collection[index] : undefined;\n }\n return baseFind(collection, predicate, eachFunc);\n };\n}\n\nmodule.exports = createFind;\n","var bindCallback = require(266),\n isArray = require(316);\n\n/**\n * Creates a function for `_.forEach` or `_.forEachRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createForEach(arrayFunc, eachFunc) {\n return function(collection, iteratee, thisArg) {\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee)\n : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n };\n}\n\nmodule.exports = createForEach;\n","var arrayCopy = require('./arrayCopy'),\n composeArgs = require('./composeArgs'),\n composeArgsRight = require('./composeArgsRight'),\n createCtorWrapper = require('./createCtorWrapper'),\n isLaziable = require('./isLaziable'),\n reorder = require('./reorder'),\n replaceHolders = require('./replaceHolders'),\n setData = require('./setData');\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n BIND_KEY_FLAG = 2,\n CURRY_BOUND_FLAG = 4,\n CURRY_FLAG = 8,\n CURRY_RIGHT_FLAG = 16,\n PARTIAL_FLAG = 32,\n PARTIAL_RIGHT_FLAG = 64,\n ARY_FLAG = 128;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that wraps `func` and invokes it with optional `this`\n * binding of, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & ARY_FLAG,\n isBind = bitmask & BIND_FLAG,\n isBindKey = bitmask & BIND_KEY_FLAG,\n isCurry = bitmask & CURRY_FLAG,\n isCurryBound = bitmask & CURRY_BOUND_FLAG,\n isCurryRight = bitmask & CURRY_RIGHT_FLAG;\n\n var Ctor = !isBindKey && createCtorWrapper(func),\n key = func;\n\n function wrapper() {\n // Avoid `arguments` object use disqualifying optimizations by\n // converting it to an array before providing it to other functions.\n var length = arguments.length,\n index = length,\n args = Array(length);\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (partials) {\n args = composeArgs(args, partials, holders);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight);\n }\n if (isCurry || isCurryRight) {\n var placeholder = wrapper.placeholder,\n argsHolders = replaceHolders(args, placeholder);\n\n length -= argsHolders.length;\n if (length < arity) {\n var newArgPos = argPos ? arrayCopy(argPos) : null,\n newArity = nativeMax(arity - length, 0),\n newsHolders = isCurry ? argsHolders : null,\n newHoldersRight = isCurry ? null : argsHolders,\n newPartials = isCurry ? args : null,\n newPartialsRight = isCurry ? null : args;\n\n bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);\n\n if (!isCurryBound) {\n bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);\n }\n var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],\n result = createHybridWrapper.apply(undefined, newData);\n\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return result;\n }\n }\n var thisBinding = isBind ? thisArg : this;\n if (isBindKey) {\n func = thisBinding[key];\n }\n if (argPos) {\n args = reorder(args, argPos);\n }\n if (isAry && ary < args.length) {\n args.length = ary;\n }\n var fn = (this && this !== global && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nmodule.exports = createHybridWrapper;\n","var createCtorWrapper = require('./createCtorWrapper');\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` and invokes it with the optional `this`\n * binding of `thisArg` and the `partials` prepended to those provided to\n * the wrapper.\n *\n * @private\n * @param {Function} func The function to partially apply arguments to.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to the new function.\n * @returns {Function} Returns the new bound function.\n */\nfunction createPartialWrapper(func, bitmask, thisArg, partials) {\n var isBind = bitmask & BIND_FLAG,\n Ctor = createCtorWrapper(func);\n\n function wrapper() {\n // Avoid `arguments` object use disqualifying optimizations by\n // converting it to an array before providing it `func`.\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(argsLength + leftLength);\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createPartialWrapper;\n","var baseCallback = require(229),\n baseReduce = require(258),\n isArray = require(316);\n\n/**\n * Creates a function for `_.reduce` or `_.reduceRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createReduce(arrayFunc, eachFunc) {\n return function(collection, iteratee, accumulator, thisArg) {\n var initFromArray = arguments.length < 3;\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n };\n}\n\nmodule.exports = createReduce;\n","var baseSetData = require(259),\n createBindWrapper = require(276),\n createHybridWrapper = require(281),\n createPartialWrapper = require(282),\n getData = require(288),\n mergeData = require(301),\n setData = require(308);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n BIND_KEY_FLAG = 2,\n PARTIAL_FLAG = 32,\n PARTIAL_RIGHT_FLAG = 64;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags.\n * The bitmask may be composed of the following flags:\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);\n partials = holders = null;\n }\n length -= (holders ? holders.length : 0);\n if (bitmask & PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = null;\n }\n var data = isBindKey ? null : getData(func),\n newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];\n\n if (data) {\n mergeData(newData, data);\n bitmask = newData[1];\n arity = newData[9];\n }\n newData[9] = arity == null\n ? (isBindKey ? 0 : func.length)\n : (nativeMax(arity - length, 0) || 0);\n\n if (bitmask == BIND_FLAG) {\n var result = createBindWrapper(newData[0], newData[2]);\n } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {\n result = createPartialWrapper.apply(undefined, newData);\n } else {\n result = createHybridWrapper.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setter(result, newData);\n}\n\nmodule.exports = createWrapper;\n","/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing arrays.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var index = -1,\n arrLength = array.length,\n othLength = other.length,\n result = true;\n\n if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (result && ++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, arrValue, index)\n : customizer(arrValue, othValue, index);\n }\n if (result === undefined) {\n // Recursively compare arrays (susceptible to call stack limits).\n if (isLoose) {\n var othIndex = othLength;\n while (othIndex--) {\n othValue = other[othIndex];\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n if (result) {\n break;\n }\n }\n } else {\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n }\n return !!result;\n}\n\nmodule.exports = equalArrays;\n","/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n stringTag = '[object String]';\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} value The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag) {\n switch (tag) {\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object)\n ? other != +other\n : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var keys = require(326);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isLoose) {\n return false;\n }\n var skipCtor = isLoose,\n index = -1;\n\n while (++index < objLength) {\n var key = objProps[index],\n result = isLoose ? key in other : hasOwnProperty.call(other, key);\n\n if (result) {\n var objValue = object[key],\n othValue = other[key];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, objValue, key)\n : customizer(objValue, othValue, key);\n }\n if (result === undefined) {\n // Recursively compare objects (susceptible to call stack limits).\n result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n if (!result) {\n return false;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (!skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = equalObjects;\n","var metaMap = require(302),\n noop = require(336);\n\n/**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\nvar getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n};\n\nmodule.exports = getData;\n","var baseProperty = require(256),\n constant = require(334),\n realNames = require(305),\n support = require(333);\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nvar getFuncName = (function() {\n if (!support.funcNames) {\n return constant('');\n }\n if (constant.name == 'constant') {\n return baseProperty('name');\n }\n return function(func) {\n var result = func.name,\n array = realNames[result],\n length = array ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n };\n}());\n\nmodule.exports = getFuncName;\n","var baseProperty = require(256);\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n","var constant = require(334),\n isNative = require(318),\n toObject = require(312);\n\n/** Native method references. */\nvar getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;\n\n/**\n * Creates an array of the own symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {\n return getOwnPropertySymbols(toObject(object));\n};\n\nmodule.exports = getSymbols;\n","/**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\nfunction indexOfNaN(array, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 0 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n var other = array[index];\n if (other !== other) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = indexOfNaN;\n","var getLength = require(290),\n isLength = require(298);\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = +value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n","var isArrayLike = require(293),\n isIndex = require(294),\n isObject = require(320);\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var isArray = require(316),\n toObject = require(312);\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = //.|/[(?:[^[/]]*|([\"'])(?:(?!/1)[^/n//]|//.)*?/1)/]/,\n reIsPlainProp = /^/w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n var type = typeof value;\n if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n return true;\n }\n if (isArray(value)) {\n return false;\n }\n var result = !reIsDeepProp.test(value);\n return result || (object != null && value in toObject(object));\n}\n\nmodule.exports = isKey;\n","var LazyWrapper = require(217),\n getFuncName = require(289),\n lodash = require(200);\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func);\n return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;\n}\n\nmodule.exports = isLaziable;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require(320);\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var arrayCopy = require(220),\n composeArgs = require(270),\n composeArgsRight = require(271),\n replaceHolders = require(307);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n CURRY_BOUND_FLAG = 4,\n CURRY_FLAG = 8,\n ARY_FLAG = 128,\n REARG_FLAG = 256;\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers required to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`\n * augment function arguments, making the order in which they are executed important,\n * preventing the merging of metadata. However, we make an exception for a safe\n * common case where curried functions have `_.ary` and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < ARY_FLAG;\n\n var isCombo =\n (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||\n (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||\n (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = arrayCopy(value);\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nmodule.exports = mergeData;\n","var isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar WeakMap = isNative(WeakMap = global.WeakMap) && WeakMap;\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nmodule.exports = metaMap;\n","var toObject = require(312);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties specified\n * by `props`.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property names to pick.\n * @returns {Object} Returns the new object.\n */\nfunction pickByArray(object, props) {\n object = toObject(object);\n\n var index = -1,\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index];\n if (key in object) {\n result[key] = object[key];\n }\n }\n return result;\n}\n\nmodule.exports = pickByArray;\n","var baseForIn = require(242);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties `predicate`\n * returns truthy for.\n *\n * @private\n * @param {Object} object The source object.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Object} Returns the new object.\n */\nfunction pickByCallback(object, predicate) {\n var result = {};\n baseForIn(object, function(value, key, object) {\n if (predicate(value, key, object)) {\n result[key] = value;\n }\n });\n return result;\n}\n\nmodule.exports = pickByCallback;\n","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n","var arrayCopy = require(220),\n isIndex = require(294);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = arrayCopy(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nmodule.exports = reorder;\n","/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\nfunction replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n if (array[index] === placeholder) {\n array[index] = PLACEHOLDER;\n result[++resIndex] = index;\n }\n }\n return result;\n}\n\nmodule.exports = replaceHolders;\n","var baseSetData = require(259),\n now = require(212);\n\n/** Used to detect when a function becomes hot. */\nvar HOT_COUNT = 150,\n HOT_SPAN = 16;\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity function\n * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = (function() {\n var count = 0,\n lastCalled = 0;\n\n return function(key, value) {\n var stamp = now(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return key;\n }\n } else {\n count = 0;\n }\n return baseSetData(key, value);\n };\n}());\n\nmodule.exports = setData;\n","var baseForIn = require(242),\n isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A fallback implementation of `_.isPlainObject` which checks if `value`\n * is an object created by the `Object` constructor or has a `[[Prototype]]`\n * of `null`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n */\nfunction shimIsPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||\n (!hasOwnProperty.call(value, 'constructor') &&\n (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = shimIsPlainObject;\n","var isArguments = require(315),\n isArray = require(316),\n isIndex = require(294),\n isLength = require(298),\n keysIn = require(327),\n support = require(333);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object)));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = shimKeys;\n","/**\n * An implementation of `_.uniq` optimized for sorted arrays without support\n * for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate-value-free array.\n */\nfunction sortedUniq(array, iteratee) {\n var seen,\n index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value, index, array) : value;\n\n if (!index || seen !== computed) {\n seen = computed;\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = sortedUniq;\n","var isObject = require(320);\n\n/**\n * Converts `value` to an object if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n","var baseToString = require(263),\n isArray = require(316);\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[/]]+|/[(?:(-?/d+(?:/./d+)?)|([\"'])((?:(?!/2)[^/n//]|//.)*?)/2)/]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = ///(//)?/g;\n\n/**\n * Converts `value` to property path array if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return value;\n }\n var result = [];\n baseToString(value).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n}\n\nmodule.exports = toPath;\n","var LazyWrapper = require(217),\n LodashWrapper = require(218),\n arrayCopy = require(220);\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n return wrapper instanceof LazyWrapper\n ? wrapper.clone()\n : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));\n}\n\nmodule.exports = wrapperClone;\n","var isArrayLike = require(293),\n isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;\n}\n\nmodule.exports = isArguments;\n","var isLength = require(298),\n isNative = require(318),\n isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n","var baseIsFunction = require('../internal/baseIsFunction'),\n isNative = require('./isNative');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nvar isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return objToString.call(value) == funcTag;\n};\n\nmodule.exports = isFunction;\n","var escapeRegExp = require(332),\n isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^/[object .+?Constructor/]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n escapeRegExp(objToString)\n .replace(/toString|(function).*?(?=///()| for .+?(?=///])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (objToString.call(value) == funcTag) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isNative;\n","var isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(8.4);\n * // => true\n *\n * _.isNumber(NaN);\n * // => true\n *\n * _.isNumber('8.4');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return type == 'function' || (!!value && type == 'object');\n}\n\nmodule.exports = isObject;\n","var isNative = require(318),\n shimIsPlainObject = require(309);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nvar isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {\n if (!(value && objToString.call(value) == objectTag)) {\n return false;\n }\n var valueOf = value.valueOf,\n objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);\n\n return objProto\n ? (value == objProto || getPrototypeOf(value) == objProto)\n : shimIsPlainObject(value);\n};\n\nmodule.exports = isPlainObject;\n","var isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var isLength = require(298),\n isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n","var baseCopy = require(231),\n keysIn = require(327);\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignWith = require(227),\n baseAssign = require(228),\n createAssigner = require(273);\n\n/**\n * Assigns own enumerable properties of source object(s) to the destination\n * object. Subsequent sources overwrite property assignments of previous sources.\n * If `customizer` is provided it is invoked to produce the assigned values.\n * The `customizer` is bound to `thisArg` and invoked with five arguments:\n * (objectValue, sourceValue, key, object, source).\n *\n * **Note:** This method mutates `object` and is based on\n * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).\n *\n * @static\n * @memberOf _\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using a customizer callback\n * var defaults = _.partialRight(_.assign, function(value, other) {\n * return _.isUndefined(value) ? other : value;\n * });\n *\n * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\nvar assign = createAssigner(function(object, source, customizer) {\n return customizer\n ? assignWith(object, source, customizer)\n : baseAssign(object, source);\n});\n\nmodule.exports = assign;\n","var isArrayLike = require(293),\n isNative = require(318),\n isObject = require(320),\n shimKeys = require(310);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object != null && object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n","var isArguments = require(315),\n isArray = require(316),\n isIndex = require(294),\n isLength = require(298),\n isObject = require(320),\n support = require(333);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keysIn;\n","var baseMerge = require(254),\n createAssigner = require(273);\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it is invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n","var arrayMap = require(224),\n baseDifference = require(234),\n baseFlatten = require(240),\n bindCallback = require(266),\n keysIn = require(327),\n pickByArray = require(303),\n pickByCallback = require(304),\n restParam = require(216);\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to omit, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.omit(object, 'age');\n * // => { 'user': 'fred' }\n *\n * _.omit(object, _.isNumber);\n * // => { 'user': 'fred' }\n */\nvar omit = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n if (typeof props[0] != 'function') {\n var props = arrayMap(baseFlatten(props), String);\n return pickByArray(object, baseDifference(keysIn(object), props));\n }\n var predicate = bindCallback(props[0], props[1], 3);\n return pickByCallback(object, function(value, key, object) {\n return !predicate(value, key, object);\n });\n});\n\nmodule.exports = omit;\n","var baseFlatten = require(240),\n bindCallback = require(266),\n pickByArray = require(303),\n pickByCallback = require(304),\n restParam = require(216);\n\n/**\n * Creates an object composed of the picked `object` properties. Property\n * names may be specified as individual arguments or as arrays of property\n * names. If `predicate` is provided it is invoked for each property of `object`\n * picking the properties `predicate` returns truthy for. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to pick, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.pick(object, 'user');\n * // => { 'user': 'fred' }\n *\n * _.pick(object, _.isString);\n * // => { 'user': 'fred' }\n */\nvar pick = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n return typeof props[0] == 'function'\n ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n : pickByArray(object, baseFlatten(props));\n});\n\nmodule.exports = pick;\n","var baseValues = require(265),\n keys = require(326);\n\n/**\n * Creates an array of the own enumerable property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseToString = require(263);\n\n/**\n * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).\n * In addition to special characters the forward slash is escaped to allow for\n * easier `eval` use and `Function` compilation.\n */\nvar reRegExpChars = /[.*+?^${}()|[/]////]/g,\n reHasRegExpChars = RegExp(reRegExpChars.source);\n\n/**\n * Escapes the `RegExp` special characters \"/\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '/[lodash/]/(https:////lodash/.com///)'\n */\nfunction escapeRegExp(string) {\n string = baseToString(string);\n return (string && reHasRegExpChars.test(string))\n ? string.replace(reRegExpChars, '//$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to detect DOM support. */\nvar document = (document = global.window) && document.document;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\nvar support = {};\n\n(function(x) {\n var Ctor = function() { this.x = x; },\n args = arguments,\n object = { '0': x, 'length': x },\n props = [];\n\n Ctor.prototype = { 'valueOf': x, 'y': x };\n for (var key in new Ctor) { props.push(key); }\n\n /**\n * Detect if functions can be decompiled by `Function#toString`\n * (all but Firefox OS certified apps, older Opera mobile browsers, and\n * the PlayStation 3; forced `false` for Windows 8 apps).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcDecomp = //bthis/b/.test(function() { return this; });\n\n /**\n * Detect if `Function#name` is supported (all but IE).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcNames = typeof Function.name == 'string';\n\n /**\n * Detect if the DOM is supported.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.dom = document.createDocumentFragment().nodeType === 11;\n } catch(e) {\n support.dom = false;\n }\n\n /**\n * Detect if `arguments` object indexes are non-enumerable.\n *\n * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object\n * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat\n * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`\n * checks for indexes that exceed the number of function parameters and\n * whose associated argument values are `0`.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);\n } catch(e) {\n support.nonEnumArgs = true;\n }\n}(1, 0));\n\nmodule.exports = support;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A no-operation function which returns `undefined` regardless of the\n * arguments it receives.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.noop(object) === undefined;\n * // => true\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var baseProperty = require(256),\n basePropertyDeep = require(257),\n isKey = require(296);\n\n/**\n * Creates a function which returns the property value at `path` on a\n * given object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * Set attribute `name` to `val`, or get attr `name`.\n *\n * @param {Element} el\n * @param {String} name\n * @param {String} [val]\n * @api public\n */\n\nmodule.exports = function(el, name, val) {\n // get\n if (arguments.length == 2) {\n return el.getAttribute(name);\n }\n\n // remove\n if (val === null) {\n return el.removeAttribute(name);\n }\n\n // set\n el.setAttribute(name, val);\n\n return el;\n};","module.exports = require(348);","module.exports = function(el) {\n\n var c;\n\n while (el.childNodes.length) {\n c = el.childNodes[0];\n el.removeChild(c);\n }\n\n return el;\n};","module.exports = require(350);","module.exports = require(351);","module.exports = require(355);","module.exports = require(352);","module.exports = require(353);","module.exports = require(354);","module.exports = function(el) {\n el.parentNode && el.parentNode.removeChild(el);\n};","/**\n * Module dependencies.\n */\n\nvar index = require(349);\n\n/**\n * Whitespace regexp.\n */\n\nvar re = //s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function(el){\n return new ClassList(el);\n};\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function(name){\n // classList\n if (this.list) {\n this.list.add(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (!~i) arr.push(name);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function(name){\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n // classList\n if (this.list) {\n this.list.remove(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (~i) arr.splice(i, 1);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function(re){\n var arr = this.array();\n for (var i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function(name, force){\n // classList\n if (this.list) {\n if (\"undefined\" !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n }\n\n // fallback\n if (\"undefined\" !== typeof force) {\n if (!force) {\n this.remove(name);\n } else {\n this.add(name);\n }\n } else {\n if (this.has(name)) {\n this.remove(name);\n } else {\n this.add(name);\n }\n }\n\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function(){\n var className = this.el.getAttribute('class') || '';\n var str = className.replace(/^/s+|/s+$/g, '');\n var arr = str.split(re);\n if ('' === arr[0]) arr.shift();\n return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has =\nClassList.prototype.contains = function(name){\n return this.list\n ? this.list.contains(name)\n : !! ~index(this.array(), name);\n};\n","module.exports = function(arr, obj){\n if (arr.indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};","var matches = require(353)\n\nmodule.exports = function (element, selector, checkYoSelf, root) {\n element = checkYoSelf ? {parentNode: element} : element\n\n root = root || document\n\n // Make sure `element !== document` and `element != null`\n // otherwise we get an illegal invocation\n while ((element = element.parentNode) && element !== document) {\n if (matches(element, selector))\n return element\n // After `matches` on the edge case that\n // the selector matches the root\n // (when the root is not the document)\n if (element === root)\n return\n }\n}\n","/**\n * Module dependencies.\n */\n\nvar closest = require(350)\n , event = require(352);\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, selector, type, fn, capture){\n return event.bind(el, type, function(e){\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true, el);\n if (e.delegateTarget) fn.call(el, e);\n }, capture);\n};\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n event.unbind(el, type, fn, capture);\n};\n","var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, type, fn, capture){\n el[bind](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n el[unbind](prefix + type, fn, capture || false);\n return fn;\n};","/**\n * Module dependencies.\n */\n\nvar query = require(354);\n\n/**\n * Element prototype.\n */\n\nvar proto = Element.prototype;\n\n/**\n * Vendor function.\n */\n\nvar vendor = proto.matches\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\n/**\n * Expose `match()`.\n */\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = query.all(selector, el.parentNode);\n for (var i = 0; i < nodes.length; ++i) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n","function one(selector, el) {\n return el.querySelector(selector);\n}\n\nexports = module.exports = function(selector, el){\n el = el || document;\n return one(selector, el);\n};\n\nexports.all = function(selector, el){\n el = el || document;\n return el.querySelectorAll(selector);\n};\n\nexports.engine = function(obj){\n if (!obj.one) throw new Error('.one callback required');\n if (!obj.all) throw new Error('.all callback required');\n one = obj.one;\n exports.all = obj.all;\n return exports;\n};\n","\n/**\n * Expose `parse`.\n */\n\nmodule.exports = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar div = document.createElement('div');\n// Setup\ndiv.innerHTML = ' <link/><table></table><a href=\"/a\">a</a><input type=\"checkbox\"/>';\n// Make sure that link elements get serialized correctly by innerHTML\n// This requires a wrapper element in IE\nvar innerHTMLBug = !div.getElementsByTagName('link').length;\ndiv = undefined;\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '<fieldset>', '</fieldset>'],\n tr: [2, '<table><tbody>', '</tbody></table>'],\n col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nmap.option =\nmap.optgroup = [1, '<select multiple=\"multiple\">', '</select>'];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '<table>', '</table>'];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">','</svg>'];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (<div> for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([/w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^/s+|/s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = map[tag] || map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n","module.exports = require(358);\r\n\r\nmodule.exports.Collection = require(357);","'use strict';\r\n\r\n/**\r\n * An empty collection stub. Use {@link RefsCollection.extend} to extend a\r\n * collection with ref semantics.\r\n *\r\n * @classdesc A change and inverse-reference aware collection with set semantics.\r\n *\r\n * @class RefsCollection\r\n */\r\nfunction RefsCollection() { }\r\n\r\n/**\r\n * Extends a collection with {@link Refs} aware methods\r\n *\r\n * @memberof RefsCollection\r\n * @static\r\n *\r\n * @param {Array<Object>} collection\r\n * @param {Refs} refs instance\r\n * @param {Object} property represented by the collection\r\n * @param {Object} target object the collection is attached to\r\n *\r\n * @return {RefsCollection<Object>} the extended array\r\n */\r\nfunction extend(collection, refs, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n /**\r\n * Removes the given element from the array and returns it.\r\n *\r\n * @method RefsCollection#remove\r\n *\r\n * @param {Object} element the element to remove\r\n */\r\n collection.remove = function(element) {\r\n var idx = this.indexOf(element);\r\n if (idx !== -1) {\r\n this.splice(idx, 1);\r\n\r\n // unset inverse\r\n refs.unset(element, inverseProperty, target);\r\n }\r\n\r\n return element;\r\n };\r\n\r\n /**\r\n * Returns true if the collection contains the given element\r\n *\r\n * @method RefsCollection#contains\r\n *\r\n * @param {Object} element the element to check for\r\n */\r\n collection.contains = function(element) {\r\n return this.indexOf(element) !== -1;\r\n };\r\n\r\n /**\r\n * Adds an element to the array, unless it exists already (set semantics).\r\n *\r\n * @method RefsCollection#add\r\n *\r\n * @param {Object} element the element to add\r\n */\r\n collection.add = function(element) {\r\n\r\n if (!this.contains(element)) {\r\n this.push(element);\r\n\r\n // set inverse\r\n refs.set(element, inverseProperty, target);\r\n }\r\n };\r\n\r\n return collection;\r\n}\r\n\r\n\r\nmodule.exports.extend = extend;","'use strict';\r\n\r\nvar Collection = require(357);\r\n\r\nfunction hasOwnProperty(e, property) {\r\n return Object.prototype.hasOwnProperty.call(e, property.name || property);\r\n}\r\n\r\n\r\nfunction defineCollectionProperty(ref, property, target) {\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n value: Collection.extend(target[property.name] || [], ref, property, target)\r\n });\r\n}\r\n\r\n\r\nfunction defineProperty(ref, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n var _value = target[property.name];\r\n\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n\r\n get: function() {\r\n return _value;\r\n },\r\n\r\n set: function(value) {\r\n\r\n // return if we already performed all changes\r\n if (value === _value) {\r\n return;\r\n }\r\n\r\n var old = _value;\r\n\r\n // temporary set null\r\n _value = null;\r\n\r\n if (old) {\r\n ref.unset(old, inverseProperty, target);\r\n }\r\n\r\n // set new value\r\n _value = value;\r\n\r\n // set inverse value\r\n ref.set(_value, inverseProperty, target);\r\n }\r\n });\r\n\r\n}\r\n\r\n/**\r\n * Creates a new references object defining two inversly related\r\n * attribute descriptors a and b.\r\n *\r\n * <p>\r\n * When bound to an object using {@link Refs#bind} the references\r\n * get activated and ensure that add and remove operations are applied\r\n * reversely, too.\r\n * </p>\r\n *\r\n * <p>\r\n * For attributes represented as collections {@link Refs} provides the\r\n * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\r\n * that must be used to properly hook into the inverse change mechanism.\r\n * </p>\r\n *\r\n * @class Refs\r\n *\r\n * @classdesc A bi-directional reference between two attributes.\r\n *\r\n * @param {Refs.AttributeDescriptor} a property descriptor\r\n * @param {Refs.AttributeDescriptor} b property descriptor\r\n *\r\n * @example\r\n *\r\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\r\n *\r\n * var car = { name: 'toyota' };\r\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\r\n *\r\n * refs.bind(car, 'wheels');\r\n *\r\n * car.wheels // []\r\n * car.wheels.add(wheels[0]);\r\n * car.wheels.add(wheels[1]);\r\n *\r\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\r\n *\r\n * wheels[0].car // { name: 'toyota' };\r\n * car.wheels.remove(wheels[0]);\r\n *\r\n * wheels[0].car // undefined\r\n */\r\nfunction Refs(a, b) {\r\n\r\n if (!(this instanceof Refs)) {\r\n return new Refs(a, b);\r\n }\r\n\r\n // link\r\n a.inverse = b;\r\n b.inverse = a;\r\n\r\n this.props = {};\r\n this.props[a.name] = a;\r\n this.props[b.name] = b;\r\n}\r\n\r\n/**\r\n * Binds one side of a bi-directional reference to a\r\n * target object.\r\n *\r\n * @memberOf Refs\r\n *\r\n * @param {Object} target\r\n * @param {String} property\r\n */\r\nRefs.prototype.bind = function(target, property) {\r\n if (typeof property === 'string') {\r\n if (!this.props[property]) {\r\n throw new Error('no property <' + property + '> in ref');\r\n }\r\n property = this.props[property];\r\n }\r\n\r\n if (property.collection) {\r\n defineCollectionProperty(this, property, target);\r\n } else {\r\n defineProperty(this, property, target);\r\n }\r\n};\r\n\r\nRefs.prototype.ensureBound = function(target, property) {\r\n if (!hasOwnProperty(target, property)) {\r\n this.bind(target, property);\r\n }\r\n};\r\n\r\nRefs.prototype.unset = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].remove(value);\r\n } else {\r\n target[property.name] = undefined;\r\n }\r\n }\r\n};\r\n\r\nRefs.prototype.set = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].add(value);\r\n } else {\r\n target[property.name] = value;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = Refs;\r\n\r\n\r\n/**\r\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\r\n *\r\n * @typedef {Object} Refs.AttributeDescriptor\r\n * @property {String} name\r\n * @property {boolean} [collection=false]\r\n * @property {boolean} [enumerable=false]\r\n */"]} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.min.js
new file mode 100644
index 0000000..80e1a2f
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.min.js
@@ -0,0 +1,14 @@
+/*! bpmn-js - bpmn-modeler v0.10.3 | (c) 2014, 2015 camunda Services GmbH | bpmn.io/license */
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.BpmnJS=t()}}(function(){var t;return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return r(n?n:e)},p,p.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,n){"use strict";function i(t){s.call(this,t)}var r=t(195),o=t(50),a=t(193),s=t(2),c='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';r(i,s),i.prototype.createDiagram=function(t){return this.importXML(c,t)},i.prototype.createModdle=function(){var t=s.prototype.createModdle.call(this);return o.extend(t,new a([32,36,1])),t},i.prototype._interactionModules=[t(14),t(173),t(170),t(171)],i.prototype._modelingModules=[t(131),t(91),t(144),t(158),t(107),t(10),t(39),t(30),t(8),t(34)],i.prototype._modules=[].concat(i.prototype._modules,i.prototype._interactionModules,i.prototype._modelingModules),e.exports=i},{10:10,107:107,131:131,14:14,144:144,158:158,170:170,171:171,173:173,193:193,195:195,2:2,30:30,34:34,39:39,50:50,8:8,91:91}],2:[function(t,e,n){"use strict";function i(t,e){var n=t.get("eventBus");e.forEach(function(t){n.on(t.event,t.handler)})}function r(t){var e=/unparsable content <([^>]+)> detected([\s\S]*)$/,n=e.exec(t.message);return n&&(t.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),t}function o(t){return t+(p(t)?"px":"")}function a(t){this.options=t=s({},v,t||{});var e=t.container;e.get&&(e=e.get(0)),u(e)&&(e=h(e));var n=this.container=l('<div class="bjs-container"></div>');e.appendChild(n),s(n.style,{width:o(t.width),height:o(t.height),position:t.position});var i="iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC",r='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100"><img src="data:image/png;base64,'+i+'"></a>';n.appendChild(l(r))}var s=t(325),c=t(329),u=t(322),p=t(319),l=t(343),h=t(346),f=t(347),d=t(73),m=t(48),y=t(42),v={width:"100%",height:"100%",position:"relative",container:"body"};a.prototype.importXML=function(t,e){var n=this;this.moddle=this.createModdle(),this.moddle.fromXML(t,"bpmn:Definitions",function(t,i,o){if(t)return t=r(t),e(t);var a=o.warnings;n.importDefinitions(i,function(t,n){return t?e(t):void e(null,a.concat(n||[]))})})},a.prototype.saveXML=function(t,e){e||(e=t,t={});var n=this.definitions;return n?void this.moddle.toXML(n,t,e):e(new Error("no definitions loaded"))},a.prototype.createModdle=function(){return new m(this.options.moddleExtensions)},a.prototype.saveSVG=function(t,e){e||(e=t,t={});var n=this.get("canvas"),i=n.getDefaultLayer(),r=n._svg.select("defs"),o=i.innerSVG(),a=r&&r.outerSVG()||"",s=i.getBBox(),c='<?xml version="1.0" encoding="utf-8"?>\n<!-- created with bpmn-js / http://bpmn.io -->\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>";e(null,c)},a.prototype.get=function(t){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.get(t)},a.prototype.invoke=function(t){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.invoke(t)},a.prototype.importDefinitions=function(t,e){try{this.diagram&&this.clear(),this.definitions=t;var n=this.diagram=this._createDiagram(this.options);this._init(n),y.importBpmnDiagram(n,t,e)}catch(i){e(i)}},a.prototype._init=function(t){i(t,this.__listeners||[])},a.prototype._createDiagram=function(t){var e=[].concat(t.modules||this.getModules(),t.additionalModules||[]);return e.unshift({bpmnjs:["value",this],moddle:["value",this.moddle]}),t=c(t,"additionalModules"),t=s(t,{canvas:{container:this.container},modules:e}),new d(t)},a.prototype.getModules=function(){return this._modules},a.prototype.clear=function(){var t=this.diagram;t&&t.destroy()},a.prototype.destroy=function(){this.clear(),f(this.container)},a.prototype.on=function(t,e){var n=this.diagram,i=this.__listeners=this.__listeners||[];i.push({event:t,handler:e}),n&&n.get("eventBus").on(t,e)},a.prototype._modules=[t(3),t(151),t(135)],e.exports=a},{135:135,151:151,3:3,319:319,322:322,325:325,329:329,343:343,346:346,347:347,42:42,48:48,73:73}],3:[function(t,e,n){e.exports={__depends__:[t(6),t(44)]}},{44:44,6:6}],4:[function(t,e,n){"use strict";function i(t,e,n){function i(t,e){K[t]=e}function r(t){return K[t]}function y(t){function e(t,e){var n=s({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},e.attrs),r=e.ref||{x:0,y:0},o=e.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=e.element.attr(n).marker(0,0,20,20,r.x,r.y).attr({markerWidth:20*o,markerHeight:20*o});return i(t,a)}e("sequenceflow-end",{element:t.path("M 1 5 L 11 10 L 1 15 Z"),ref:{x:11,y:10},scale:.5}),e("messageflow-start",{element:t.circle(6,6,3.5),attrs:{fill:"white",stroke:"black"},ref:{x:6,y:6}}),e("messageflow-end",{element:t.path("m 1 5 l 0 -3 l 7 3 l -7 3 z"),attrs:{fill:"white",stroke:"black",strokeLinecap:"butt"},ref:{x:8.5,y:5}}),e("data-association-end",{element:t.path("M 1 5 L 11 10 L 1 15"),attrs:{fill:"white",stroke:"black"},ref:{x:11,y:10},scale:.5}),e("conditional-flow-marker",{element:t.path("M 0 10 L 8 6 L 16 10 L 8 14 Z"),attrs:{fill:"white",stroke:"black"},ref:{x:-1,y:10},scale:.5}),e("conditional-default-flow-marker",{element:t.path("M 1 4 L 5 16"),attrs:{stroke:"black"},ref:{x:-5,y:10},scale:.5})}function v(t,n,i){return o(n)||(i=n,n=[]),e.style(n||[],s(i,t||{}))}function g(t,e,n,i,r){a(i)&&(r=i,i=0),i=i||0,r=v(r,{stroke:"black",strokeWidth:2,fill:"white"});var o=e/2,s=n/2;return t.circle(o,s,Math.round((e+n)/4-i)).attr(r)}function x(t,e,n,i,r,o){return a(r)&&(o=r,r=0),r=r||0,o=v(o,{stroke:"black",strokeWidth:2,fill:"white"}),t.rect(r,r,e-2*r,n-2*r,i).attr(o)}function b(t,e,n,i){var r=e/2,o=n/2,a=[r,0,e,o,r,n,0,o];return i=v(i,{stroke:"black",strokeWidth:2,fill:"white"}),t.polygon(a).attr(i)}function w(t,e,n){return n=v(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}),m(e,n).appendTo(t)}function E(t,e,n){return n=v(n,["no-fill"],{strokeWidth:2,stroke:"black"}),t.path(e).attr(n)}function _(t){return function(e,n){return Z[t](e,n)}}function S(t){return Z[t]}function T(t,e){var n=L(t),i=F(n);return j(n,"bpmn:MessageEventDefinition")?S("bpmn:MessageEventDefinition")(e,t,i):j(n,"bpmn:TimerEventDefinition")?S("bpmn:TimerEventDefinition")(e,t,i):j(n,"bpmn:ConditionalEventDefinition")?S("bpmn:ConditionalEventDefinition")(e,t):j(n,"bpmn:SignalEventDefinition")?S("bpmn:SignalEventDefinition")(e,t,i):j(n,"bpmn:CancelEventDefinition")&&j(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?S("bpmn:MultipleEventDefinition")(e,t,i):j(n,"bpmn:CancelEventDefinition")&&j(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?S("bpmn:ParallelMultipleEventDefinition")(e,t,i):j(n,"bpmn:EscalationEventDefinition")?S("bpmn:EscalationEventDefinition")(e,t,i):j(n,"bpmn:LinkEventDefinition")?S("bpmn:LinkEventDefinition")(e,t,i):j(n,"bpmn:ErrorEventDefinition")?S("bpmn:ErrorEventDefinition")(e,t,i):j(n,"bpmn:CancelEventDefinition")?S("bpmn:CancelEventDefinition")(e,t,i):j(n,"bpmn:CompensateEventDefinition")?S("bpmn:CompensateEventDefinition")(e,t,i):j(n,"bpmn:TerminateEventDefinition")?S("bpmn:TerminateEventDefinition")(e,t,i):null}function A(t,e,n){return X.createText(t,e||"",n).addClass("djs-label")}function C(t,e,n){var i=L(e);return A(t,i.name,{box:e,align:n,padding:5})}function M(t,e,n){var i=L(e);return i.name||(e.hidden=!0),A(t,i.name,{box:e,align:n,style:{fontSize:"11px"}})}function R(t,e,n){var i=A(t,e,{box:{height:30,width:n.height},align:"center-middle"}),r=-1*n.height;i.transform("rotate(270) translate("+r+",0)")}function N(t){for(var e=t.waypoints,n="m "+e[0].x+","+e[0].y,i=1;i<e.length;i++)n+="L"+e[i].x+","+e[i].y+" ";return n}function P(t,e,n){var i,r=L(e),o=p(n,"SubProcessMarker");return i=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},c(n,function(n){S(n)(t,e,i)}),"bpmn:AdHocSubProcess"===r.$type&&S("AdhocMarker")(t,e,i),r.loopCharacteristics&&void 0===r.loopCharacteristics.isSequential?void S("LoopMarker")(t,e,i):(r.loopCharacteristics&&void 0!==r.loopCharacteristics.isSequential&&!r.loopCharacteristics.isSequential&&S("ParallelMarker")(t,e,i),r.loopCharacteristics&&r.loopCharacteristics.isSequential&&S("SequentialMarker")(t,e,i),void(r.isForCompensation&&S("CompensationMarker")(t,e,i)))}function k(t,e){var n=e.type,i=Z[n];return i?i(t,e):h.prototype.drawShape.apply(this,[t,e])}function D(t,e){var n=e.type,i=Z[n];return i?i(t,e):h.prototype.drawConnection.apply(this,[t,e])}function O(t,e){var i=(e.height-16)/e.height,r=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.451,my:i}});E(t,r,{strokeWidth:2})}function B(t,e){return t.isCollection||t.elementObjectRef&&t.elementObjectRef.isCollection}function I(t){return t.businessObject.di}function L(t){return t.businessObject}function j(t,e,n){function i(t,e){return u(e,function(e,n){return t[n]==e})}return l(t.eventDefinitions,function(r){return r.$type===e&&i(t,n)})}function F(t){return"bpmn:IntermediateThrowEvent"===t.$type||"bpmn:EndEvent"===t.$type}function $(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function V(t){var e=t.x+t.width/2,n=t.y+t.height/2,i=t.width/2,r=[["M",e,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return $(r)}function G(t){var e=q,n=t.x,i=t.y,r=t.width,o=t.height,a=[["M",n+e,i],["l",r-2*e,0],["a",e,e,0,0,1,e,e],["l",0,o-2*e],["a",e,e,0,0,1,-e,e],["l",2*e-r,0],["a",e,e,0,0,1,-e,-e],["l",0,2*e-o],["a",e,e,0,0,1,e,-e],["z"]];return $(a)}function z(t){var e=t.width,n=t.height,i=t.x,r=t.y,o=e/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return $(s)}function W(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=[["M",e,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return $(o)}function U(t){var e=L(t);return e.$instanceOf("bpmn:Event")?V(t):e.$instanceOf("bpmn:Activity")?G(t):e.$instanceOf("bpmn:Gateway")?z(t):W(t)}h.call(this,e);var q=10,H=3,Y={fontFamily:"Arial, sans-serif",fontSize:"12px"},X=new f({style:Y,size:{width:100}}),K={},Z={"bpmn:Event":function(t,e,n){return g(t,e.width,e.height,n)},"bpmn:StartEvent":function(t,e){var n={},i=L(e);i.isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var r=S("bpmn:Event")(t,e,n);return T(e,t),r},"bpmn:MessageEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.235,my:.315}}),o=i?"black":"white",a=i?"white":"black",s=E(t,r,{strokeWidth:1,fill:o,stroke:a});return s},"bpmn:TimerEventDefinition":function(t,e){var i=g(t,e.width,e.height,.2*e.height,{strokeWidth:2}),r=n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}});E(t,r,{strokeWidth:2,strokeLinecap:"square"});for(var o=0;12>o;o++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.5}}),s=e.width/2,c=e.height/2;E(t,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+c+","+s+")"})}return i},"bpmn:EscalationEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.555}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:ConditionalEventDefinition":function(t,e){var i=n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.222}});return E(t,i,{strokeWidth:1})},"bpmn:LinkEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.57,my:.263}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:ErrorEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.2,my:.722}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:CancelEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.638,my:-.055}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o}).transform("rotate(45)")},"bpmn:CompensateEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.201,my:.472}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:SignalEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:e.width,containerHeight:e.height,position:{mx:.5,my:.2}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:MultipleEventDefinition":function(t,e,i){var r=n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:e.width,containerHeight:e.height,position:{mx:.222,my:.36}}),o=i?"black":"none";return E(t,r,{strokeWidth:1,fill:o})},"bpmn:ParallelMultipleEventDefinition":function(t,e){var i=n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:e.width,containerHeight:e.height,position:{mx:.458,my:.194}});return E(t,i,{strokeWidth:1})},"bpmn:EndEvent":function(t,e){var n=S("bpmn:Event")(t,e,{strokeWidth:4});return T(e,t,!0),n},"bpmn:TerminateEventDefinition":function(t,e){var n=g(t,e.width,e.height,8,{strokeWidth:4,fill:"black"});return n},"bpmn:IntermediateEvent":function(t,e){var n=S("bpmn:Event")(t,e,{strokeWidth:1});return g(t,e.width,e.height,H,{strokeWidth:1,fill:"none"}),T(e,t),n},"bpmn:IntermediateCatchEvent":_("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":_("bpmn:IntermediateEvent"),"bpmn:Activity":function(t,e,n){return x(t,e.width,e.height,q,n)},"bpmn:Task":function(t,e,n){var i=S("bpmn:Activity")(t,e,n);return C(t,e,"center-middle"),P(t,e),i},"bpmn:ServiceTask":function(t,e){var i=S("bpmn:Task")(t,e),r=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});E(t,r,{strokeWidth:1,fill:"none"});var o=n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});E(t,o,{strokeWidth:0,stroke:"none",fill:"white"});var a=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return E(t,a,{strokeWidth:1,fill:"white"}),i},"bpmn:UserTask":function(t,e){var i=S("bpmn:Task")(t,e),r=15,o=12,a=n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:r,y:o}});E(t,a,{strokeWidth:.5,fill:"none"});var s=n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:r,y:o}});E(t,s,{strokeWidth:.5,fill:"none"});var c=n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:r,y:o}});return E(t,c,{strokeWidth:.5,fill:"black"}),i},"bpmn:ManualTask":function(t,e){var i=S("bpmn:Task")(t,e),r=n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return E(t,r,{strokeWidth:.25,fill:"white",stroke:"black"}),i},"bpmn:SendTask":function(t,e){var i=S("bpmn:Task")(t,e),r=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return E(t,r,{strokeWidth:1,fill:"black",stroke:"white"}),i},"bpmn:ReceiveTask":function(t,e){var i,r=L(e),o=S("bpmn:Task")(t,e);return r.instantiate?(g(t,28,28,4.4,{strokeWidth:1}),i=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(t,i,{strokeWidth:1}),o},"bpmn:ScriptTask":function(t,e){var i=S("bpmn:Task")(t,e),r=n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return E(t,r,{strokeWidth:1}),i},"bpmn:BusinessRuleTask":function(t,e){var i=S("bpmn:Task")(t,e),r=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),o=E(t,r);o.attr({strokeWidth:1,fill:"AAA"});var a=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),s=E(t,a);return s.attr({strokeWidth:1}),i},"bpmn:SubProcess":function(t,e,n){var i=S("bpmn:Activity")(t,e,n),r=L(e),o=d.isExpanded(r),a=!!r.triggeredByEvent;return a&&i.attr({strokeDasharray:"1,2"}),C(t,e,o?"center-top":"center-middle"),o?P(t,e):P(t,e,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(t,e){return S("bpmn:SubProcess")(t,e)},"bpmn:Transaction":function(t,n){var i=S("bpmn:SubProcess")(t,n),r=e.style(["no-fill","no-events"]);return x(t,n.width,n.height,q-2,H,r),i},"bpmn:CallActivity":function(t,e){return S("bpmn:Task")(t,e,{strokeWidth:5})},"bpmn:Participant":function(t,e){var n=S("bpmn:Lane")(t,e,{fill:"White"}),i=d.isExpanded(e);if(i){w(t,[{x:30,y:0},{x:30,y:e.height}]);var r=L(e).name;R(t,r,e)}else{var o=L(e).name;A(t,o,{box:e,align:"center-middle"})}var a=!!L(e).participantMultiplicity;return a&&S("ParticipantMultiplicityMarker")(t,e),n},"bpmn:Lane":function(t,e,n){var i=x(t,e.width,e.height,0,n||{fill:"none"}),r=L(e);if("bpmn:Lane"===r.$type){var o=r.name;R(t,o,e)}return i},"bpmn:InclusiveGateway":function(t,e){var n=b(t,e.width,e.height);return g(t,e.width,e.height,.24*e.height,{strokeWidth:2.5,fill:"none"}),n},"bpmn:ExclusiveGateway":function(t,e){var i=b(t,e.width,e.height),r=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.32,my:.3}});return I(e).isMarkerVisible&&E(t,r,{strokeWidth:1,fill:"black"}),i},"bpmn:ComplexGateway":function(t,e){var i=b(t,e.width,e.height),r=n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.26}});return E(t,r,{strokeWidth:1,fill:"black"}),i},"bpmn:ParallelGateway":function(t,e){var i=b(t,e.width,e.height),r=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:e.width,containerHeight:e.height,position:{mx:.46,my:.2}});return E(t,r,{strokeWidth:1,fill:"black"}),i},"bpmn:EventBasedGateway":function(t,e){function i(){var i=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:e.width,containerHeight:e.height,position:{mx:.36,my:.44}});E(t,i,{strokeWidth:2,fill:"none"})}var r=L(e),o=b(t,e.width,e.height);g(t,e.width,e.height,.2*e.height,{strokeWidth:1,fill:"none"});var a=r.eventGatewayType,s=!!r.instantiate;if("Parallel"===a){var c=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}}),u=E(t,c);u.attr({strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!s){var p=g(t,e.width,e.height,.26*e.height);p.attr({strokeWidth:1,fill:"none"})}i()}return o},"bpmn:Gateway":function(t,e){return b(t,e.width,e.height)},"bpmn:SequenceFlow":function(t,e){var n=N(e),i=E(t,n,{strokeLinejoin:"round",markerEnd:r("sequenceflow-end")}),o=L(e),a=e.source.businessObject;return o.conditionExpression&&a.$instanceOf("bpmn:Task")&&i.attr({markerStart:r("conditional-flow-marker")}),a["default"]&&a.$instanceOf("bpmn:Gateway")&&a["default"]===o&&i.attr({markerStart:r("conditional-default-flow-marker")}),i},"bpmn:Association":function(t,e,n){return n=s({strokeDasharray:"1,6",strokeLinecap:"round",strokeLinejoin:"round"},n||{}),w(t,e.waypoints,n)},"bpmn:DataInputAssociation":function(t,e){return S("bpmn:Association")(t,e,{markerEnd:r("data-association-end")})},"bpmn:DataOutputAssociation":function(t,e){return S("bpmn:Association")(t,e,{markerEnd:r("data-association-end")})},"bpmn:MessageFlow":function(t,e){var i=L(e),o=I(e),a=N(e),s=E(t,a,{markerEnd:r("messageflow-end"),markerStart:r("messageflow-start"),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px"});if(i.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),u=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),p={strokeWidth:1};"initiating"===o.messageVisibleKind?(p.fill="white",p.stroke="black"):(p.fill="#888",p.stroke="white"),E(t,u,p)}return s},"bpmn:DataObject":function(t,e){var i=n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:.474,my:.296}}),r=E(t,i,{fill:"white"}),o=L(e);return B(o)&&O(t,e),r},"bpmn:DataObjectReference":_("bpmn:DataObject"),"bpmn:DataInput":function(t,e){var i=n.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(t,e);return E(t,i,{strokeWidth:1}),r},"bpmn:DataOutput":function(t,e){var i=n.getRawPath("DATA_ARROW"),r=S("bpmn:DataObject")(t,e);return E(t,i,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(t,e){var i=n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:.133}}),r=E(t,i,{strokeWidth:2,fill:"white"});return r},"bpmn:BoundaryEvent":function(t,e){var n=L(e),i=n.cancelActivity,r={strokeLinecap:"round",strokeWidth:1};i||(r.strokeDasharray="6");var o=S("bpmn:Event")(t,e,r);return g(t,e.width,e.height,H,r),T(e,t),o},"bpmn:Group":function(t,e){return x(t,e.width,e.height,q,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(t,e){return M(t,e,"")},"bpmn:TextAnnotation":function(t,e){var i={fill:"none",stroke:"none"},r=x(t,e.width,e.height,0,0,i),o=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:0,my:0}});E(t,o);var a=L(e).text||"";return A(t,a,{box:e,align:"left-middle",padding:5}),r},ParticipantMultiplicityMarker:function(t,e){var i=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:e.width/2/e.width,my:(e.height-15)/e.height}});E(t,i)},SubProcessMarker:function(t,e){var i=x(t,14,14,0,{strokeWidth:1});i.transform("translate("+(e.width/2-7.5)+","+(e.height-20)+")");var r=n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2-7.5)/e.width,my:(e.height-20)/e.height}});E(t,r)},ParallelMarker:function(t,e,i){var r=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+i.parallel)/e.width,my:(e.height-20)/e.height}});E(t,r)},SequentialMarker:function(t,e,i){var r=n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+i.seq)/e.width,my:(e.height-19)/e.height}});E(t,r)},CompensationMarker:function(t,e,i){var r=n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+i.compensation)/e.width,my:(e.height-13)/e.height}});E(t,r,{strokeWidth:1})},LoopMarker:function(t,e,i){var r=n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+i.loop)/e.width,my:(e.height-7)/e.height}});E(t,r,{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(t,e,i){var r=n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:e.width,containerHeight:e.height,position:{mx:(e.width/2+i.adhoc)/e.width,my:(e.height-15)/e.height}});E(t,r,{strokeWidth:1,fill:"black"})}};t.on("canvas.init",function(t){y(t.svg)}),this.drawShape=k,this.drawConnection=D,this.getShapePath=U}var r=t(195),o=t(316),a=t(320),s=t(325),c=t(204),u=t(201),p=t(206),l=t(210),h=t(84),f=t(184),d=t(45),m=h.createLine;r(i,h),i.$inject=["eventBus","styles","pathMap"],e.exports=i},{184:184,195:195,201:201,204:204,206:206,210:210,316:316,320:320,325:325,45:45,84:84}],5:[function(t,e,n){"use strict";function i(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"m {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} {e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z",height:36,width:36,heightElements:[2.382,4.764,4.926,6.589333,7.146,13.178667,19.768],widthElements:[2.463,2.808,4.926,5.616,7.389,8.424]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z",height:36,width:36,heightElements:[5,10],widthElements:[10]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",
+height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,o=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var a={};if(e.position){for(var s=e.containerHeight/o.height*e.yScaleFactor,c=e.containerWidth/o.width*e.xScaleFactor,u=0;u<o.heightElements.length;u++)a["y"+u]=o.heightElements[u]*s;for(var p=0;p<o.widthElements.length;p++)a["x"+p]=o.widthElements[p]*c}var l=r.format(o.d,{mx:n,my:i,e:a});return l}}var r=t(188);e.exports=i},{188:188}],6:[function(t,e,n){e.exports={renderer:["type",t(4)],pathMap:["type",t(5)]}},{4:4,5:5}],7:[function(t,e,n){"use strict";function i(t,e,n,i,r,o,a){t.registerProvider(this),this._contextPad=t,this._modeling=e,this._elementFactory=n,this._connect=i,this._create=r,this._bpmnReplace=o,this._canvas=a}function r(t,e,n){var i=t.$instanceOf(e),r=!1,o=t.eventDefinitions||[];return a(o,function(t){t.$type===n&&(r=!0)}),i&&r}var o=t(325),a=t(204);i.$inject=["contextPad","modeling","elementFactory","connect","create","bpmnReplace","canvas"],i.prototype.getContextPadEntries=function(t){function e(t,e,n){p.start(t,e,n)}function n(e){t.waypoints?c.removeConnection(t):c.removeShape(t)}function i(t){var e=5,n=f.getContainer(),i=s.getPad(t).html,r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),a=o.top-r.top,c=o.left-r.left,u={x:c,y:a+o.height+e};return u}function a(t,e,n){function i(e,i){var r=u.createShape(o({type:t},n));l.start(e,r,i)}var r=t.replace(/^bpmn\:/,"");return{group:"model",className:e,title:"Append "+r,action:{dragstart:i,click:i}}}var s=this._contextPad,c=this._modeling,u=this._elementFactory,p=this._connect,l=this._create,h=this._bpmnReplace,f=this._canvas,d={};if("label"===t.type)return d;var m=t.businessObject;return m.$instanceOf("bpmn:FlowNode")&&(m.$instanceOf("bpmn:EndEvent")||m.$instanceOf("bpmn:EventBasedGateway")||r(m,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||o(d,{"append.end-event":a("bpmn:EndEvent","icon-end-event-none"),"append.gateway":a("bpmn:ExclusiveGateway","icon-gateway-xor"),"append.append-task":a("bpmn:Task","icon-task"),"append.intermediate-event":a("bpmn:IntermediateThrowEvent","icon-intermediate-event-none")}),m.$instanceOf("bpmn:EventBasedGateway")&&o(d,{"append.receive-task":a("bpmn:ReceiveTask","icon-receive-task"),"append.message-intermediate-event":a("bpmn:IntermediateCatchEvent","icon-intermediate-event-catch-message",{_eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":a("bpmn:IntermediateCatchEvent","icon-intermediate-event-catch-timer",{_eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condtion-intermediate-event":a("bpmn:IntermediateCatchEvent","icon-intermediate-event-catch-condition",{_eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":a("bpmn:IntermediateCatchEvent","icon-intermediate-event-catch-signal",{_eventDefinitionType:"bpmn:SignalEventDefinition"})}),m.$instanceOf("bpmn:SubProcess")||o(d,{replace:{group:"edit",className:"icon-screw-wrench",title:"Change type",action:{click:function(t,e){h.openChooser(i(e),e)}}}})),(m.$instanceOf("bpmn:FlowNode")||m.$instanceOf("bpmn:InteractionNode"))&&o(d,{"append.text-annotation":a("bpmn:TextAnnotation","icon-text-annotation"),connect:{group:"connect",className:"icon-connection-multi",title:"Connect using Sequence/MessageFlow",action:{click:e,dragstart:e}}}),o(d,{"delete":{group:"edit",className:"icon-trash",title:"Remove",action:{click:n,dragstart:n}}}),d},e.exports=i},{204:204,325:325}],8:[function(t,e,n){e.exports={__depends__:[t(70),t(97),t(151),t(95),t(99),t(37)],__init__:["contextPadProvider"],contextPadProvider:["type",t(7)]}},{151:151,37:37,7:7,70:70,95:95,97:97,99:99}],9:[function(t,e,n){"use strict";function i(t,e,n,i,r){t.addListener(function(o,a){if(!t.hasModifier(a)){if(83===o)return e.activateSelection(),!0;if(108===o)return n.activateSelection(),!0;var s=r.get();return 69===o?(s.length&&i.activate(s[0]),!0):void 0}})}i.$inject=["keyboard","spaceTool","lassoTool","directEditing","selection"],e.exports=i},{}],10:[function(t,e,n){e.exports={__depends__:[t(105)],__init__:["bpmnKeyBindings"],bpmnKeyBindings:["type",t(9)]}},{105:105,9:9}],11:[function(t,e,n){"use strict";function i(t,e,n,i,o){n.registerProvider(this),i.registerHandler("element.updateLabel",r),t.on("element.dblclick",function(t){n.activate(t.element)}),t.on(["element.mousedown","drag.activate","canvas.viewbox.changed"],function(t){n.complete()}),t.on(["commandStack.changed"],function(){n.cancel()}),"ontouchstart"in document.documentElement||t.on("create.end",500,function(t){var e=t.shape,i=t.context.canExecute;i&&(a(e,"bpmn:Task")||a(e,"bpmn:TextAnnotation")||a(e,"bpmn:SubProcess")&&!s(e))&&n.activate(e)}),this._canvas=e,this._commandStack=i}var r=t(13),o=t(12),a=t(47).is,s=t(45).isExpanded,c={width:150,height:50};i.$inject=["eventBus","canvas","directEditing","commandStack","injector"],e.exports=i,i.prototype.activate=function(t){var e=o.getLabel(t);if(void 0!==e){var n=this.getEditingBBox(t);return(a(t,"bpmn:Participant")&&s(t)||a(t,"bpmn:Lane"))&&(n.width=c.width,n.height=c.height,n.x=n.x+10-n.width/2,n.y=n.mid.y-n.height/2),a(t,"bpmn:SubProcess")&&s(t)&&(n.height=c.height,n.x=n.mid.x-n.width/2,n.y=n.y+10-n.height/2),{bounds:n,text:e}}},i.prototype.getEditingBBox=function(t,e){var n=t.label||t,i=this._canvas.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2};return n.labelTarget&&(i.width=Math.max(i.width,c.width),i.height=Math.max(i.height,c.height),i.x=r.x-i.width/2),i.mid=r,i},i.prototype.update=function(t,e){this._commandStack.execute("element.updateLabel",{element:t,newLabel:e})}},{12:12,13:13,45:45,47:47}],12:[function(t,e,n){"use strict";function i(t){return t.$instanceOf("bpmn:FlowElement")||t.$instanceOf("bpmn:Participant")||t.$instanceOf("bpmn:Lane")||t.$instanceOf("bpmn:SequenceFlow")||t.$instanceOf("bpmn:MessageFlow")?"name":t.$instanceOf("bpmn:TextAnnotation")?"text":void 0}e.exports.getLabel=function(t){var e=t.businessObject,n=i(e);return n?e[n]||"":void 0},e.exports.setLabel=function(t,e){var n=t.businessObject,r=i(n);r&&(n[r]=e);var o=t.label||t;return o.hidden=!1,o}},{}],13:[function(t,e,n){"use strict";function i(t){function e(e,n){var i=r.setLabel(e,n);t.fire("element.changed",{element:i})}function n(t){return t.oldLabel=r.getLabel(t.element),e(t.element,t.newLabel)}function i(t){return e(t.element,t.oldLabel)}function o(t){return!0}this.execute=n,this.revert=i,this.canExecute=o}var r=t(12);i.$inject=["eventBus"],e.exports=i},{12:12}],14:[function(t,e,n){e.exports={__depends__:[t(77),t(93),t(70)],__init__:["labelEditingProvider"],labelEditingProvider:["type",t(11)]}},{11:11,70:70,77:77,93:93}],15:[function(t,e,n){"use strict";function i(t){this._model=t}var r=t(207),o=t(325),a=t(330);i.$inject=["moddle"],i.prototype._needsId=function(t){return t.$instanceOf("bpmn:RootElement")||t.$instanceOf("bpmn:FlowElement")||t.$instanceOf("bpmn:MessageFlow")||t.$instanceOf("bpmn:Artifact")||t.$instanceOf("bpmn:Participant")||t.$instanceOf("bpmn:Process")||t.$instanceOf("bpmn:Collaboration")||t.$instanceOf("bpmndi:BPMNShape")||t.$instanceOf("bpmndi:BPMNEdge")||t.$instanceOf("bpmndi:BPMNDiagram")||t.$instanceOf("bpmndi:BPMNPlane")},i.prototype._ensureId=function(t){var e=(t.$type||"").replace(/^[^:]*:/g,"")+"_";!t.id&&this._needsId(t)&&(t.id=this._model.ids.nextPrefixed(e,t))},i.prototype.create=function(t,e){var n=this._model.create(t,e||{});return this._ensureId(n),n},i.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},i.prototype.createDiShape=function(t,e,n){return this.create("bpmndi:BPMNShape",o({bpmnElement:t,bounds:this.createDiBounds(e)},n))},i.prototype.createDiBounds=function(t){return this.create("dc:Bounds",t)},i.prototype.createDiWaypoints=function(t){return r(t,function(t){return this.createDiWaypoint(t)},this)},i.prototype.createDiWaypoint=function(t){return this.create("dc:Point",a(t,["x","y"]))},i.prototype.createDiEdge=function(t,e,n){return this.create("bpmndi:BPMNEdge",o({bpmnElement:t},n))},i.prototype.createDiPlane=function(t){return this.create("bpmndi:BPMNPlane",{bpmnElement:t})},e.exports=i},{207:207,325:325,330:330}],16:[function(t,e,n){"use strict";function i(){}function r(t,e,n){var i=t&&t[e];return i?i.original||i:c.getMidPoint(n)}var o=t(195),a=t(325),s=t(164),c=t(166),u=t(167),p=t(47).is;o(i,s),e.exports=i,i.prototype.layoutConnection=function(t,e){var n,i,o,s,c=t.source,l=t.target,h=t.waypoints;return n=r(h,0,c),i=r(h,h&&h.length-1,l),p(t,"bpmn:MessageFlow")&&(o={preferStraight:!0,preferVertical:!0}),p(t,"bpmn:SequenceFlow")&&(o={}),o&&(o=a(o,e),s=u.repairConnection(c,l,n,i,h,o)),s||[n,i]}},{164:164,166:166,167:167,195:195,325:325,47:47}],17:[function(t,e,n){"use strict";function i(t,e,n){function i(t){var e,i=t.context;i.cropped||(e=i.connection,e.waypoints=n.getCroppedWaypoints(e),i.cropped=!0)}function r(t){l.updateParent(t.context.shape||t.context.connection)}function o(t){var e=t.context,n=e.oldRoot,i=n.children;a(i,function(t){l.updateParent(t)})}function s(t){l.updateBounds(t.context.shape)}function c(t){l.updateConnection(t.context.connection)}function u(t){l.updateConnectionWaypoints(t.context.connection)}p.call(this,t),this._bpmnFactory=e;var l=this;this.executed(["connection.layout","connection.create","connection.reconnectEnd","connection.reconnectStart"],i),this.reverted(["connection.layout"],function(t){delete t.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],r),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],r),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],s),this.reverted(["shape.move","shape.create","shape.resize"],s),this.executed(["connection.create","connection.move","connection.delete","connection.reconnectEnd","connection.reconnectStart"],c),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnectEnd","connection.reconnectStart"],c),this.executed(["connection.layout","connection.move","connection.updateWaypoints","connection.reconnectEnd","connection.reconnectStart"],u),this.reverted(["connection.layout","connection.move","connection.updateWaypoints","connection.reconnectEnd","connection.reconnectStart"],u)}function r(t){for(;t&&!t.$instanceOf("bpmn:Definitions");)t=t.$parent;return t}var o=t(325),a=t(204),s=t(195),c=t(175),u=t(168),p=t(75);s(i,p),e.exports=i,i.$inject=["eventBus","bpmnFactory","connectionDocking"],i.prototype.updateParent=function(t){if(!(t instanceof u.Label)){var e=t.parent,n=t.businessObject,i=e&&e.businessObject,r=i&&i.di;this.updateSemanticParent(n,i),this.updateDiParent(n.di,r)}},i.prototype.updateBounds=function(t){var e=t.businessObject.di,n=t instanceof u.Label?this._getLabel(e).bounds:e.bounds;o(n,{x:t.x,y:t.y,width:t.width,height:t.height})},i.prototype.updateDiParent=function(t,e){if(e&&!e.$instanceOf("bpmndi:BPMNPlane")&&(e=e.$parent),t.$parent!==e){var n=(e||t.$parent).get("planeElement");e?(n.push(t),t.$parent=e):(c.remove(n,t),t.$parent=null)}},i.prototype.updateSemanticParent=function(t,e){var n;if(t.$parent!==e){if(t.$instanceOf("bpmn:FlowElement"))e&&e.$instanceOf("bpmn:Participant")&&(e=e.processRef),n="flowElements";else if(t.$instanceOf("bpmn:Artifact")){for(;e&&!e.$instanceOf("bpmn:Process")&&!e.$instanceOf("bpmn:SubProcess")&&!e.$instanceOf("bpmn:Collaboration");){if(e.$instanceOf("bpmn:Participant")){e=e.processRef;break}e=e.$parent}n="artifacts"}else if(t.$instanceOf("bpmn:MessageFlow"))n="messageFlows";else if(t.$instanceOf("bpmn:Participant")){n="participants";var i,o=t.processRef;o&&(i=r(t.$parent||e),t.$parent&&(c.remove(i.get("rootElements"),o),o.$parent=null),e&&(c.add(i.get("rootElements"),o),o.$parent=i))}if(!n)throw new Error("no parent for ",t,e);var a;t.$parent&&(a=t.$parent.get(n),c.remove(a,t)),e?(a=e.get(n),a.push(t),t.$parent=e):t.$parent=null}},i.prototype.updateConnectionWaypoints=function(t){t.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},i.prototype.updateConnection=function(t){var e=t.businessObject,n=t.source&&t.source.businessObject,i=t.target&&t.target.businessObject,r=e.$instanceOf("bpmn:SequenceFlow");e.sourceRef!==n&&(r&&(c.remove(e.sourceRef&&e.sourceRef.get("outgoing"),e),n&&n.get("outgoing").push(e)),e.sourceRef=n),e.targetRef!==i&&(r&&(c.remove(e.targetRef&&e.targetRef.get("incoming"),e),i&&i.get("incoming").push(e)),e.targetRef=i),e.di.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},i.prototype._getLabel=function(t){return t.label||(t.label=this._bpmnFactory.createDiLabel()),t.label}},{168:168,175:175,195:195,204:204,325:325,75:75}],18:[function(t,e,n){"use strict";function i(t,e){a.call(this),this._bpmnFactory=t,this._moddle=e}var r=t(325),o=t(195),a=t(79),s=t(46);o(i,a),i.$inject=["bpmnFactory","moddle"],e.exports=i,i.prototype.baseCreate=a.prototype.create,i.prototype.create=function(t,e){if("label"===t)return this.baseCreate(t,r({type:"label"},s.DEFAULT_LABEL_SIZE,e));e=e||{};var n,i=e.businessObject;if(!i){if(!e.type)throw new Error("no shape type specified");i=this._bpmnFactory.create(e.type)}if(i.di||("root"===t?i.di=this._bpmnFactory.createDiPlane(i,[],{id:i.id+"_di"}):"connection"===t?i.di=this._bpmnFactory.createDiEdge(i,[],{id:i.id+"_di"}):i.di=this._bpmnFactory.createDiShape(i,{},{id:i.id+"_di"})),e.isExpanded&&(i.di.isExpanded=e.isExpanded),i.$instanceOf("bpmn:ExclusiveGateway")&&(i.di.isMarkerVisible=!0),e._eventDefinitionType){var o=i.get("eventDefinitions")||[],a=this._moddle.create(e._eventDefinitionType);o.push(a),i.eventDefinitions=o}return n=this._getDefaultSize(i),e=r({businessObject:i,id:i.id},n,e),this.baseCreate(t,e)},i.prototype._getDefaultSize=function(t){if(t.$instanceOf("bpmn:SubProcess")){var e=t.di.isExpanded===!0;return e?{width:350,height:200}:{width:100,height:80}}return t.$instanceOf("bpmn:Task")?{width:100,height:80}:t.$instanceOf("bpmn:Gateway")?{width:50,height:50}:t.$instanceOf("bpmn:Event")?{width:36,height:36}:t.$instanceOf("bpmn:Participant")?{width:600,height:250}:{width:100,height:80}},i.prototype.createParticipantShape=function(t){var e=this.createShape({type:"bpmn:Participant"});return t||(e.businessObject.processRef=this._bpmnFactory.create("bpmn:Process")),e}},{195:195,325:325,46:46,79:79}],19:[function(t,e,n){"use strict";function i(t,e,n){t.on(["commandStack.shape.create.postExecute","commandStack.connection.create.postExecute"],function(t){var n,i=t.context,r=i.shape||i.connection,o=r.businessObject;s(o)&&(n=c(r),e.createLabel(r,n,{id:o.id+"_label",businessObject:o}))}),t.on("shape.move.start",function(t){var e=t.context,n=e.shapes,i=[];o(n,function(t){var n=t.label;n&&!n.hidden&&-1===e.shapes.indexOf(n)&&i.push(n)}),o(i,function(t){n.push(t)})}),t.on(["commandStack.shapes.move.postExecute"],function(t){var n=t.context,i=n.closure,r=i.enclosedElements;o(r,function(t){t.label&&!r[t.label.id]&&e.moveShape(t.label,n.delta,t.parent)})}),t.on(["commandStack.label.create.executed","commandStack.shape.moved.executed"],function(t){var e=t.context.shape,i=e.businessObject,o=i.di;e.labelTarget&&(o.label||(o.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),r(o.label.bounds,{x:e.x,y:e.y,width:e.width,height:e.height}))})}var r=t(325),o=t(204),a=t(46),s=a.hasExternalLabel,c=a.getExternalLabelMid;i.$inject=["eventBus","modeling","bpmnFactory"],e.exports=i},{204:204,325:325,46:46}],20:[function(t,e,n){"use strict";function i(t,e,n,i){o.call(this,t,e,n),this._bpmnRules=i}var r=t(195),o=t(108),a=t(29),s=t(28);r(i,o),i.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],e.exports=i,i.prototype.getHandlers=function(){var t=o.prototype.getHandlers.call(this);return t["element.updateProperties"]=a,t["canvas.updateRoot"]=s,t},i.prototype.updateLabel=function(t,e){this._commandStack.execute("element.updateLabel",{element:t,newLabel:e})};var c=t(21).getSharedParent;i.prototype.connect=function(t,e,n){var i=this._bpmnRules;return n||(n=i.canConnectMessageFlow(t,e)?{type:"bpmn:MessageFlow"}:i.canConnectSequenceFlow(t,e)?{type:"bpmn:SequenceFlow"}:{type:"bpmn:Association"}),this.createConnection(t,e,n,c(t,e))},i.prototype.updateProperties=function(t,e){this._commandStack.execute("element.updateProperties",{element:t,properties:e})},i.prototype.makeCollaboration=function(){var t=this._create("root",{type:"bpmn:Collaboration"}),e={newRoot:t};return this._commandStack.execute("canvas.updateRoot",e),t},i.prototype.makeProcess=function(){var t=this._create("root",{type:"bpmn:Process"}),e={newRoot:t};this._commandStack.execute("canvas.updateRoot",e)}},{108:108,195:195,21:21,28:28,29:29}],21:[function(t,e,n){"use strict";function i(t){for(var e=[];t;)t=t.parent,t&&e.push(t);return e}function r(t,e){var n=i(t),r=i(e);return o(n,function(t){return-1!==r.indexOf(t)})}var o=t(203);e.exports.getParents=i,e.exports.getSharedParent=r},{203:203}],22:[function(t,e,n){"use strict";function i(t,e,n){a.call(this,t),this.preExecute("shape.append",function(t){var e=t.source,n=t.shape;t.position||(o(n,"bpmn:TextAnnotation")?t.position={x:e.x+e.width/2+75,y:e.y-50-n.height/2}:t.position={x:e.x+e.width+80+n.width/2,y:e.y+e.height/2})},!0)}var r=t(195),o=t(47).is,a=t(75);i.$inject=["eventBus","elementFactory","bpmnRules"],r(i,a),e.exports=i},{195:195,47:47,75:75}],23:[function(t,e,n){"use strict";function i(t,e){o.call(this,t),this.preExecute("shape.create",function(t){var n=t.parent,i=t.shape,r=t.position;if(a(n,"bpmn:Process")&&a(i,"bpmn:Participant")){var o=e.makeCollaboration();t.position=r,t.parent=o,t.processRoot=n}},!0),this.execute("shape.create",function(t){var e=t.processRoot,n=t.shape;e&&(t.oldProcessRef=n.businessObject.processRef,n.businessObject.processRef=e.businessObject)},!0),this.revert("shape.create",function(t){var e=t.processRoot,n=t.shape;e&&(n.businessObject.processRef=t.oldProcessRef)},!0),this.postExecute("shape.create",function(t){var n=t.processRoot,i=t.shape;if(n){var r=n.children.slice();e.moveShapes(r,{x:0,y:0},i)}},!0)}var r=t(195),o=t(75),a=t(47).is;i.$inject=["eventBus","modeling"],r(i,o),e.exports=i},{195:195,47:47,75:75}],24:[function(t,e,n){"use strict";function i(t,e,n){a.call(this,t),this.postExecute("shapes.move",function(t){var i=t.closure,o=i.allConnections;r(o,function(t){var i,r,o=t.source,a=t.target;s(t,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),s(t,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),s(t,"bpmn:Association")&&!n.canConnectAssociation(o,a)&&(r=!0),r&&e.removeConnection(t),i&&e.createConnection(o,a,{type:i,waypoints:t.waypoints.slice()},c(o,a))})},!0)}var r=t(204),o=t(195),a=t(75),s=t(47).is,c=t(21).getSharedParent;o(i,a),i.$inject=["eventBus","modeling","bpmnRules"],e.exports=i},{195:195,204:204,21:21,47:47,75:75}],25:[function(t,e,n){"use strict";function i(t,e){function n(t,n){e.add({position:{x:t.x+5,y:t.y+5},type:"error",timeout:2e3,html:"<div>"+n+"</div>"})}t.on(["shape.move.rejected","create.rejected"],function(t){var e=t.context,i=e.shape,o=e.target;r(o,"bpmn:Collaboration")&&r(i,"bpmn:FlowNode")&&n(t,"flow elements must be children of pools/participants")})}var r=t(47).is;i.$inject=["eventBus","tooltips"],e.exports=i},{47:47}],26:[function(t,e,n){"use strict";function i(t,e){o.call(this,t),this.preExecute("shape.delete",function(t){var e=t.shape,n=e.parent;a(e,"bpmn:Participant")&&(t.collaborationRoot=n)},!0),this.postExecute("shape.delete",function(t){var n=t.collaborationRoot;n&&!n.businessObject.participants.length&&e.makeProcess()},!0)}var r=t(195),o=t(75),a=t(47).is;i.$inject=["eventBus","modeling"],r(i,o),e.exports=i},{195:195,47:47,75:75}],27:[function(t,e,n){e.exports={__init__:["appendBehavior","createBehavior","dropBehavior","removeBehavior","modelingFeedback"],appendBehavior:["type",t(22)],dropBehavior:["type",t(24)],createBehavior:["type",t(23)],removeBehavior:["type",t(26)],modelingFeedback:["type",t(25)]}},{22:22,23:23,24:24,25:25,26:26}],28:[function(t,e,n){"use strict";function i(t,e){this._canvas=t,this._modeling=e}var r=t(175);i.$inject=["canvas","modeling"],e.exports=i,i.prototype.execute=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,o=e.getRootElement(),a=o.businessObject,s=a.$parent,c=a.di;e.setRootElement(n,!0),r.add(s.rootElements,i),i.$parent=s,r.remove(s.rootElements,a),a.$parent=null,a.di=null,c.bpmnElement=i,i.di=c,t.oldRoot=o},i.prototype.revert=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,o=t.oldRoot,a=o.businessObject,s=i.$parent,c=i.di;e.setRootElement(o,!0),r.remove(s.rootElements,i),i.$parent=null,r.add(s.rootElements,a),a.$parent=s,i.di=null,c.bpmnElement=a,a.di=c}},{175:175}],29:[function(t,e,n){"use strict";function i(t){this._elementRegistry=t}var r=t(325),o=t(330),a=t(326),s="default",c="name",u="id";i.$inject=["elementRegistry"],e.exports=i,i.prototype.execute=function(t){var e=t.element,n=[e];if(!e)throw new Error("element required");var i=this._elementRegistry,p=e.businessObject,l=t.properties,h=t.oldProperties||o(p,a(l));return u in l&&i.updateId(e,l[u]),s in l&&(l[s]&&n.push(i.get(l[s].id)),p[s]&&n.push(i.get(p[s].id))),c in l&&e.label&&n.push(e.label),r(p,l),t.oldProperties=h,t.changed=n,n},i.prototype.revert=function(t){var e=t.element,n=t.oldProperties,i=e.businessObject,o=this._elementRegistry;return r(i,t.oldProperties),u in n&&o.updateId(e,n[u]),t.changed}},{325:325,326:326,330:330}],30:[function(t,e,n){e.exports={__init__:["modeling","bpmnUpdater","labelSupport"],__depends__:[t(14),t(32),t(27),t(77),t(160),t(93)],bpmnFactory:["type",t(15)],bpmnUpdater:["type",t(17)],elementFactory:["type",t(18)],modeling:["type",t(20)],labelSupport:["type",t(19)],layouter:["type",t(16)],connectionDocking:["type",t(165)]}},{14:14,15:15,16:16,160:160,165:165,17:17,18:18,19:19,20:20,27:27,32:32,77:77,93:93}],31:[function(t,e,n){"use strict";function i(t){I.call(this,t)}function r(t){return!t||v(t)}function o(t,e){return t===e}function a(t){for(var e=O(t);e&&!D(e,"bpmn:Process");){if(D(e,"bpmn:Participant"))return e.processRef||e;e=e.$parent}return e}function s(t,e){var n=a(t),i=a(e);return n===i}function c(t){return D(t,"bpmn:InteractionNode")&&(!D(t,"bpmn:Event")||D(t,"bpmn:ThrowEvent")&&f(t,"bpmn:MessageEventDefinition"))}function u(t){return D(t,"bpmn:InteractionNode")&&(!D(t,"bpmn:Event")||D(t,"bpmn:CatchEvent")&&f(t,"bpmn:MessageEventDefinition"))}function p(t){var e=O(t);if(D(e,"bpmn:Participant"))return null;for(;e;)if(e=e.$parent,D(e,"bpmn:FlowElementsContainer"))return e;return e}function l(t,e){var n=p(t),i=p(e);return n&&n===i}function h(t,e){var n=O(t);return!!N(n.eventDefinitions||[],function(t){return D(t,e)})}function f(t,e){var n=O(t);return(n.eventDefinitions||[]).every(function(t){return D(t,e)})}function d(t){return D(t,"bpmn:FlowNode")&&!D(t,"bpmn:EndEvent")&&!(D(t,"bpmn:IntermediateThrowEvent")&&h(t,"bpmn:LinkEventDefinition"))}function m(t){return D(t,"bpmn:FlowNode")&&!D(t,"bpmn:StartEvent")&&!(D(t,"bpmn:IntermediateCatchEvent")&&h(t,"bpmn:LinkEventDefinition"))}function y(t){return D(t,"bpmn:ReceiveTask")||D(t,"bpmn:IntermediateCatchEvent")&&(h(t,"bpmn:MessageEventDefinition")||h(t,"bpmn:TimerEventDefinition")||h(t,"bpmn:ConditionalEventDefinition")||h(t,"bpmn:SignalEventDefinition"))}function v(t){return t.labelTarget}function g(t){return t.waypoints}function x(t,e){var n=k(e);return-1!==n.indexOf(t)}function b(t,e,n){return r(t)||r(e)?null:o(t,e)?!1:A(t,e)||C(t,e)?!0:D(n,"bpmn:Association")?T(t,e):!1}function w(t,e){return v(t)&&!g(e)?!0:D(t,"bpmn:Participant")?D(e,"bpmn:Process")||D(e,"bpmn:Collaboration"):D(t,"bpmn:FlowElement")?D(e,"bpmn:FlowElementsContainer")?B(e)!==!1:D(e,"bpmn:Participant"):D(t,"bpmn:Artifact")?D(e,"bpmn:Collaboration")||D(e,"bpmn:Participant")||D(e,"bpmn:Process"):D(t,"bpmn:MessageFlow")?D(e,"bpmn:Collaboration"):!1}function E(t,e){var n=1===R(M(t,function(t){return t.parent&&t.parent.id}));return n?e?t.every(function(t){return w(t,e)}):!0:!1}function _(t,e,n){return e?v(e)?null:o(n,e)?!1:n&&x(n,e)?!1:w(t,e):!1}function S(t,e){return D(t,"bpmn:SubProcess")?B(t)&&(!e||e.width>=100&&e.height>=80):D(t,"bpmn:Participant")?!e||e.width>=100&&e.height>=80:D(t,"bpmn:TextAnnotation")?!0:!1}function T(t,e){return g(t)||g(e)?!1:!x(e,t)&&!x(t,e)}function A(t,e){return c(t)&&u(e)&&!s(t,e)}function C(t,e){return d(t)&&m(e)&&l(t,e)&&!(D(t,"bpmn:EventBasedGateway")&&!y(e))}var M=t(205),R=t(209),N=t(203),P=t(195),k=t(21).getParents,D=t(47).is,O=t(47).getBusinessObject,B=t(45).isExpanded,I=t(145);P(i,I),i.$inject=["eventBus"],e.exports=i,i.prototype.init=function(){this.addRule("connection.create",function(t){var e=t.source,n=t.target;return b(e,n)}),this.addRule("connection.reconnectStart",function(t){var e=t.connection,n=t.hover||t.source,i=e.target;return b(n,i,e)}),this.addRule("connection.reconnectEnd",function(t){var e=t.connection,n=e.source,i=t.hover||t.target;return b(n,i,e)}),this.addRule("connection.updateWaypoints",function(t){return null}),this.addRule("shape.resize",function(t){var e=t.shape,n=t.newBounds;return S(e,n)}),this.addRule("shapes.move",function(t){var e=t.newParent,n=t.shapes;return E(n,e)}),this.addRule(["shape.create","shape.append"],function(t){var e=t.parent,n=t.shape,i=t.source;return _(n,e,i)})},i.prototype.canConnectMessageFlow=A,i.prototype.canConnectSequenceFlow=C,i.prototype.canConnectAssociation=T,i.prototype.canMove=E,i.prototype.canDrop=w,i.prototype.canCreate=_,i.prototype.canConnect=b,i.prototype.canResize=S},{145:145,195:195,203:203,205:205,209:209,21:21,45:45,47:47}],32:[function(t,e,n){e.exports={__depends__:[t(147)],__init__:["bpmnRules"],bpmnRules:["type",t(31)]}},{147:147,31:31}],33:[function(t,e,n){"use strict";function i(t,e,n,i,r){this._create=e,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,t.registerProvider(this)}var r=t(325);e.exports=i,i.$inject=["palette","create","elementFactory","spaceTool","lassoTool"],i.prototype.getPaletteEntries=function(t){function e(t,e,n,i,s){function c(e){var n=a.createShape(r({type:t},s));s&&(n.businessObject.di.isExpanded=s.isExpanded),o.start(e,n)}var u=t.replace(/^bpmn\:/,"");return{group:e,className:n,title:i||"Create "+u,action:{dragstart:c,click:c}}}function n(t,e){o.start(t,a.createParticipantShape(e))}var i={},o=this._create,a=this._elementFactory,s=this._spaceTool,c=this._lassoTool;return r(i,{"lasso-tool":{group:"tools",className:"icon-lasso-tool",title:"Activate the lasso tool",action:{click:function(t){c.activateSelection(t)}}},"space-tool":{group:"tools",className:"icon-space-tool",title:"Activate the create/remove space tool",action:{click:function(t){s.activateSelection(t)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":e("bpmn:StartEvent","event","icon-start-event-none"),"create.intermediate-event":e("bpmn:IntermediateThrowEvent","event","icon-intermediate-event-none"),"create.end-event":e("bpmn:EndEvent","event","icon-end-event-none"),"create.exclusive-gateway":e("bpmn:ExclusiveGateway","gateway","icon-gateway-xor"),"create.task":e("bpmn:Task","activity","icon-task"),"create.subprocess-collapsed":e("bpmn:SubProcess","activity","icon-subprocess-collapsed","Create collapsed Sub Process",{isExpanded:!1}),"create.subprocess-expanded":e("bpmn:SubProcess","activity","icon-subprocess-expanded","Create expanded SubProcess",{isExpanded:!0}),"create.participant-expanded":{group:"collaboration",className:"icon-participant",title:"Create Pool/Participant",action:{
+dragstart:n,click:n}}}),i}},{325:325}],34:[function(t,e,n){e.exports={__depends__:[t(137),t(99)],__init__:["paletteProvider"],paletteProvider:["type",t(33)]}},{137:137,33:33,99:99}],35:[function(t,e,n){"use strict";function i(t,e,n,i,a){function h(n,r){var o=r.type,s=n.businessObject,c=t.create(o),u={type:o,businessObject:c};if(r.eventDefinition){var p=c.get("eventDefinitions"),l=e.create(r.eventDefinition);p.push(l)}return void 0!==r.instantiate&&(c.instantiate=r.instantiate),void 0!==r.eventGatewayType&&(c.eventGatewayType=r.eventGatewayType),s.$instanceOf("bpmn:Activity")&&(u.width=n.width,u.height=n.height),c.name=s.name,u=i.replaceElement(n,u),a.select(u),u}function f(t){function e(t){var e=t.target,n=f.eventDefinitions&&f.eventDefinitions[0].$type,i=e.eventDefinition==n,r=f.$type==e.type;return!i&&r||!r||!(i&&r)}function n(t,e){var n=o(t,e);r(n,function(t){var e=i(t);a.push(e)})}function i(e){return{label:e.label,className:e.className,action:{name:e.actionName,handler:function(){h(t,e.target)}}}}var a=[],f=t.businessObject;return f.$instanceOf("bpmn:StartEvent")?n(s,e):f.$instanceOf("bpmn:IntermediateCatchEvent")||f.$instanceOf("bpmn:IntermediateThrowEvent")?n(c,e):f.$instanceOf("bpmn:EndEvent")?n(u,e):f.$instanceOf("bpmn:Gateway")?n(p,function(t){return t.target.type!==f.$type}):f.$instanceOf("bpmn:FlowNode")&&n(l,function(t){return t.target.type!==f.$type}),a}this.openChooser=function(t,e){var i=this.getReplaceOptions(e);n.open("replace-menu",t,i)},this.getReplaceOptions=f,this.replaceElement=h}var r=t(204),o=t(202),a=t(36),s=a.START_EVENT,c=a.INTERMEDIATE_EVENT,u=a.END_EVENT,p=a.GATEWAY,l=a.TASK;i.$inject=["bpmnFactory","moddle","popupMenu","replace","selection"],e.exports=i},{202:202,204:204,36:36}],36:[function(t,e,n){"use strict";e.exports.START_EVENT=[{label:"Start Event",actionName:"replace-with-none-start",className:"icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-intermediate-throwing",className:"icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-message-end",className:"icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinition:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinition:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinition:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinition:"bpmn:SignalEventDefinition"}}],e.exports.INTERMEDIATE_EVENT=[{label:"Start Event",actionName:"replace-with-none-start",className:"icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-message-end",className:"icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-intermediate-catch",className:"icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-intermediate-throw",className:"icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinition:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Catch Event",actionName:"replace-with-escalation-catch",className:"icon-intermediate-event-catch-escalation",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:LinkEventDefinition"}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinition:"bpmn:LinkEventDefinition"}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinition:"bpmn:CompensateEventDefinition"}},{label:"Signal Throw Catch Event",actionName:"replace-with-throw-intermediate-catch",className:"icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinition:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinition:"bpmn:SignalEventDefinition"}}],e.exports.END_EVENT=[{label:"Start Event",actionName:"replace-with-none-start",className:"icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinition:"bpmn:TerminateEventDefinition"}}],e.exports.GATEWAY=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],e.exports.TASK=[{label:"Task",actionName:"replace-with-task",className:"icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"icon-script",target:{type:"bpmn:ScriptTask"}}]},{}],37:[function(t,e,n){e.exports={__depends__:[t(139),t(141),t(151)],bpmnReplace:["type",t(35)]}},{139:139,141:141,151:151,35:35}],38:[function(t,e,n){"use strict";function i(t,e){function n(t,e,n){if(n.length){var i=a(n.filter(function(t){return!t.labelTarget&&!t.waypoints}));i.x-=50,i.y-=20,i.width+=70,i.height+=40,e.width=Math.max(e.width,i.width),e.height=Math.max(e.height,i.height),t.participantSnapBox=i}}function i(t,e,n){var i=e.width/2-30,r=e.height/2,o={x:n.x-i-30,y:n.y-r},a={x:n.x+i+30,y:n.y+r},s=t,c=h(t);o.x>=s.x?(n.x=s.x+30+i,n.snapped=!0):a.x<=c.x&&(n.x=c.x-30-i,n.snapped=!0),o.y>=s.y?(n.y=s.y+r,n.snapped=!0):a.y<=c.y&&(n.y=c.y-r,n.snapped=!0)}c.call(this,t,e),t.on("create.start",function(t){var i=t.context,r=i.shape,o=e.getRootElement();s(r,"bpmn:Participant")&&s(o,"bpmn:Process")&&n(i,r,o.children)}),t.on(["create.move","create.end"],1500,function(t){var e=t.context,n=e.shape,r=e.participantSnapBox;!t.snapped&&r&&i(r,n,t)}),t.on("resize.start",1500,function(t){var e=t.context,n=e.shape;s(n,"bpmn:SubProcess")&&(e.minDimensions={width:140,height:120}),s(n,"bpmn:Participant")&&(e.minDimensions={width:400,height:200}),s(n,"bpmn:TextAnnotation")&&(e.minDimensions={width:50,height:50})})}var r=t(195),o=t(204),a=t(177).getBBox,s=t(21).is,c=t(154),u=t(153),s=t(47).is,p=u.mid,l=u.topLeft,h=u.bottomRight,f=Math.round;r(i,c),i.$inject=["eventBus","canvas"],e.exports=i,i.prototype.initSnap=function(t){var e,n,i,r,a,u=t.context,d=u.shape;a=c.prototype.initSnap.call(this,t),s(d,"bpmn:Participant")&&a.setSnapLocations(["top-left","bottom-right","mid"]),d&&(e=p(d,t),n={width:d.width,height:d.height,x:isNaN(d.x)?f(e.x-d.width/2):d.x,y:isNaN(d.y)?f(e.y-d.height/2):d.y},i=l(n),r=h(n),a.setSnapOrigin("top-left",{x:i.x-t.x,y:i.y-t.y}),a.setSnapOrigin("bottom-right",{x:r.x-t.x,y:r.y-t.y}),o(d.outgoing,function(e){var n=e.waypoints[0];n=n.original||n,a.setSnapOrigin(e.id+"-docking",{x:n.x-t.x,y:n.y-t.y})}),o(d.incoming,function(e){var n=e.waypoints[e.waypoints.length-1];n=n.original||n,a.setSnapOrigin(e.id+"-docking",{x:n.x-t.x,y:n.y-t.y})}));var m=u.source;m&&a.addDefaultSnap("mid",p(m))},i.prototype.addTargetSnaps=function(t,e,n){var i=this.getSiblings(e,n);o(i,function(e){t.add("mid",p(e)),s(e,"bpmn:Participant")&&(t.add("top-left",l(e)),t.add("bottom-right",h(e)))}),o(e.incoming,function(e){if(-1===i.indexOf(e.source)){t.add("mid",p(e.source));var n=e.waypoints[0];t.add(e.id+"-docking",n.original||n)}}),o(e.outgoing,function(e){if(-1===i.indexOf(e.target)){t.add("mid",p(e.target));var n=e.waypoints[e.waypoints.length-1];t.add(e.id+"-docking",n.original||n)}})}},{153:153,154:154,177:177,195:195,204:204,21:21,47:47}],39:[function(t,e,n){e.exports={__init__:["snapping"],snapping:["type",t(38)]}},{38:38}],40:[function(t,e,n){"use strict";function i(t,e){return a({id:t.id,type:t.$type,businessObject:t},e)}function r(t){return s(t,function(t){return{x:t.x,y:t.y}})}function o(t,e,n,i){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i}var a=t(325),s=t(207),c=t(46),u=c.hasExternalLabel,p=c.getExternalLabelBounds,l=t(45).isExpanded,h=t(43).elementToString;o.$inject=["eventBus","canvas","elementFactory","elementRegistry"],e.exports=o,o.prototype.add=function(t,e){var n,o=t.di;if(o.$instanceOf("bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(i(t)),this._canvas.setRootElement(n);else if(o.$instanceOf("bpmndi:BPMNShape")){var a=!l(t),s=e&&(e.hidden||e.collapsed),c=t.di.bounds;n=this._elementFactory.createShape(i(t,{collapsed:a,hidden:s,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height)})),this._canvas.addShape(n,e)}else{if(!o.$instanceOf("bpmndi:BPMNEdge"))throw new Error("unknown di "+h(o)+" for element "+h(t));var p=this._getSource(t),f=this._getTarget(t);n=this._elementFactory.createConnection(i(t,{source:p,target:f,waypoints:r(t.di.waypoint)})),this._canvas.addConnection(n,e)}return u(t)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},o.prototype.addLabel=function(t,e){var n=p(t,e),r=this._elementFactory.createLabel(i(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}));return this._canvas.addShape(r,e.parent)},o.prototype._getEnd=function(t,e){var n,i,r=t.$type;if(i=t[e+"Ref"],"source"===e&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===e&&"bpmn:DataOutputAssociation"===r||"target"===e&&"bpmn:DataInputAssociation"===r)&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?new Error("element "+h(i)+" referenced by "+h(t)+"#"+e+"Ref not yet drawn"):new Error(h(t)+"#"+e+"Ref not specified")},o.prototype._getSource=function(t){return this._getEnd(t,"source")},o.prototype._getTarget=function(t){return this._getEnd(t,"target")},o.prototype._getElement=function(t){return this._elementRegistry.get(t.id)}},{207:207,325:325,43:43,45:45,46:46}],41:[function(t,e,n){"use strict";function i(t,e){return t.$instanceOf(e)}function r(t){return s(t.rootElements,function(t){return i(t,"bpmn:Process")||i(t,"bpmn:Collaboration")})}function o(t){function e(t,e){return function(n){t(n,e)}}function n(e,n){var i=e.gfx;if(i)throw new Error("already rendered "+p(e));return t.element(e,n)}function o(e,n){return t.root(e,n)}function s(t,e){try{return t.di&&n(t,e)}catch(i){u(i.message,{element:t,error:i}),console.error("failed to import "+p(t)),console.error(i)}}function u(e,n){t.error(e,n)}function h(t){var e=t.bpmnElement;e?e.di?u("multiple DI elements defined for "+p(e),{element:e}):(l.bind(e,"di"),e.di=t):u("no bpmnElement referenced in "+p(t),{element:t})}function f(t){d(t.plane)}function d(t){h(t),c(t.planeElement,m)}function m(t){h(t)}function y(t,e){var n=t.diagrams;if(e&&-1===n.indexOf(e))throw new Error("diagram not part of bpmn:Definitions");if(!e&&n&&n.length&&(e=n[0]),e){f(e);var a=e.plane;if(!a)throw new Error("no plane for "+p(e));var s=a.bpmnElement;if(!s){if(s=r(t),!s)return u("no process or collaboration present to display");u("correcting missing bpmnElement on "+p(a)+" to "+p(s)),a.bpmnElement=s,h(a)}var c=o(s,a);if(i(s,"bpmn:Process"))g(s,c);else{if(!i(s,"bpmn:Collaboration"))throw new Error("unsupported bpmnElement for "+p(a)+" : "+p(s));$(s,c),x(t.rootElements,c)}v(G)}}function v(t){c(t,function(t){t()})}function g(t,e){I(t,e),C(t.ioSpecification,e),A(t.artifacts,e),V.push(t)}function x(t){var n=a(t,function(t){return i(t,"bpmn:Process")&&t.laneSets&&-1===V.indexOf(t)});n.forEach(e(g))}function b(t,e){s(t,e)}function w(t,n){c(t,e(b,n))}function E(t,e){s(t,e)}function _(t,e){s(t,e)}function S(t,e){s(t,e)}function T(t,e){s(t,e)}function A(t,e){c(t,function(t){i(t,"bpmn:Association")?G.push(function(){T(t,e)}):T(t,e)})}function C(t,n){t&&(c(t.dataInputs,e(_,n)),c(t.dataOutputs,e(S,n)))}function M(t,e){I(t,e),A(t.artifacts,e)}function R(t,e){var n=s(t,e);i(t,"bpmn:SubProcess")&&M(t,n||e)}function N(t,e){s(t,e)}function P(t,e){s(t,e)}function k(t,e){s(t,e)}function D(t,e){var n=s(t,e);if(t.childLaneSet)O(t.childLaneSet,n||e);else{var i=a(t.flowNodeRef,function(t){return"bpmn:BoundaryEvent"!==t.$type});j(i,n||e)}}function O(t,n){c(t.lanes,e(D,n))}function B(t,n){c(t,e(O,n))}function I(t,e){t.laneSets?(B(t.laneSets,e),L(t.flowElements)):j(t.flowElements,e)}function L(t,e){c(t,function(t){i(t,"bpmn:SequenceFlow")?G.push(function(){N(t,e)}):i(t,"bpmn:BoundaryEvent")?G.unshift(function(){k(t,e)}):i(t,"bpmn:DataObject")||(i(t,"bpmn:DataStoreReference")?P(t,e):i(t,"bpmn:DataObjectReference")&&P(t,e))})}function j(t,n){c(t,function(t){i(t,"bpmn:SequenceFlow")?G.push(function(){N(t,n)}):i(t,"bpmn:BoundaryEvent")?G.unshift(function(){k(t,n)}):i(t,"bpmn:FlowNode")?(R(t,n),i(t,"bpmn:Activity")&&(C(t.ioSpecification,n),G.push(function(){c(t.dataInputAssociations,e(E,n)),c(t.dataOutputAssociations,e(E,n))}))):i(t,"bpmn:DataObject")||(i(t,"bpmn:DataStoreReference")?P(t,n):i(t,"bpmn:DataObjectReference")?P(t,n):u("unrecognized flowElement "+p(t)+" in context "+(n?p(n.businessObject):null),{element:t,context:n}))})}function F(t,e){var n=s(t,e),i=t.processRef;i&&g(i,n||e)}function $(t){c(t.participants,e(F)),A(t.artifacts),G.push(function(){w(t.messageFlows)})}var V=[],G=[];return{handleDefinitions:y}}var a=t(202),s=t(203),c=t(204),u=t(356),p=t(43).elementToString,l=new u({name:"bpmnElement",enumerable:!0},{name:"di"});e.exports=o},{202:202,203:203,204:204,356:356,43:43}],42:[function(t,e,n){"use strict";function i(t,e,n){function i(t){var e={root:function(t){return a.add(t)},element:function(t,e){return a.add(t,e)},error:function(t,e){c.push({message:t,context:e})}},n=new r(e);n.handleDefinitions(t)}var o,a=t.get("bpmnImporter"),s=t.get("eventBus"),c=[];s.fire("import.start");try{i(e)}catch(u){o=u}s.fire(o?"import.error":"import.success",{error:o,warnings:c}),n(o,c)}var r=t(41);e.exports.importBpmnDiagram=i},{41:41}],43:[function(t,e,n){"use strict";e.exports.elementToString=function(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}},{}],44:[function(t,e,n){e.exports={bpmnImporter:["type",t(40)]}},{40:40}],45:[function(t,e,n){"use strict";var i=t(47).is,r=t(47).getBusinessObject;e.exports.isExpanded=function(t){return i(t,"bpmn:CallActivity")?!1:i(t,"bpmn:SubProcess")?r(t).di.isExpanded:i(t,"bpmn:Participant")?!!r(t).processRef:!0}},{47:47}],46:[function(t,e,n){"use strict";var i=t(325),r=e.exports.DEFAULT_LABEL_SIZE={width:90,height:20};e.exports.hasExternalLabel=function(t){return t.$instanceOf("bpmn:Event")||t.$instanceOf("bpmn:Gateway")||t.$instanceOf("bpmn:DataStoreReference")||t.$instanceOf("bpmn:DataObjectReference")||t.$instanceOf("bpmn:SequenceFlow")||t.$instanceOf("bpmn:MessageFlow")};var o=e.exports.getWaypointsMid=function(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}},a=e.exports.getExternalLabelMid=function(t){return t.waypoints?o(t.waypoints):{x:t.x+t.width/2,y:t.y+t.height+r.height/2}};e.exports.getExternalLabelBounds=function(t,e){var n,o,s,c=t.di,u=c.label;return u&&u.bounds?(s=u.bounds,o={width:Math.max(r.width,s.width),height:s.height},n={x:s.x+s.width/2,y:s.y+s.height/2}):(n=a(e),o=r),i({x:n.x-o.width/2,y:n.y-o.height/2},o)}},{325:325}],47:[function(t,e,n){"use strict";function i(t,e){var n=r(t);return n&&n.$instanceOf(e)}function r(t){return t&&t.businessObject||t}e.exports.is=i,e.exports.getBusinessObject=r},{}],48:[function(t,e,n){e.exports=t(51)},{51:51}],49:[function(t,e,n){"use strict";function i(t,e){s.call(this,t,e)}var r=t(322),o=t(317),a=t(325),s=t(57),c=t(53),u=t(54);i.prototype=Object.create(s.prototype),e.exports=i,i.prototype.fromXML=function(t,e,n,i){r(e)||(i=n,n=e,e="bpmn:Definitions"),o(n)&&(i=n,n={});var s=new c(a({model:this,lax:!0},n)),u=s.handler(e);s.fromXML(t,u,i)},i.prototype.toXML=function(t,e,n){o(e)&&(n=e,e={});var i=new u(e);try{var r=i.toXML(t);n(null,r)}catch(a){n(a)}}},{317:317,322:322,325:325,53:53,54:54,57:57}],50:[function(t,e,n){"use strict";var i=/^(.*:)?id$/;e.exports.extend=function(t,e){var n=t.properties.set;return t.ids||(t.properties.set=function(e,r,o){if(i.test(r)){var a=t.ids.assigned(o);if(a&&a!==e)throw new Error("id <"+o+"> already used");t.ids.claim(o,e)}n.call(this,e,r,o)}),t.ids=e,t}},{}],51:[function(t,e,n){"use strict";var i=t(325),r=t(49),o={bpmn:t(66),bpmndi:t(67),dc:t(68),di:t(69)};e.exports=function(t,e){return new r(i({},o,t),e)}},{325:325,49:49,66:66,67:67,68:68,69:69}],52:[function(t,e,n){"use strict";function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function r(t){return t.charAt(0).toLowerCase()+t.slice(1)}function o(t){return t.xml&&"lowerCase"===t.xml.tagAlias}e.exports.aliasToName=function(t,e){return o(e)?i(t):t},e.exports.nameToAlias=function(t,e){return o(e)?r(t):t},e.exports.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"},e.exports.XSI_TYPE="xsi:type"},{}],53:[function(t,e,n){"use strict";function i(t){var e=t.attributes;return y(e,function(t,e,n){var i,r;return e.local?(r=S(e.name,e.prefix),i=r.name):i=e.prefix,t[i]=e.value,t},{})}function r(t,e,n){var i,r=S(e.value),o=t.ns[r.prefix||""],a=r.localName,s=o&&n.getPackage(o);s&&(i=s.xml&&s.xml.typePrefix,i&&0===a.indexOf(i)&&(a=a.slice(i.length)),e.value=s.prefix+":"+a)}function o(t,e,n){var i,a;if(i=t.uri||n){var s=e.getPackage(i);a=s?s.prefix:t.prefix,t.prefix=a,t.uri=i}v(t.attributes,function(n){n.uri===N&&"type"===n.local&&r(t,n,e),o(n,e,null)})}function a(t){x(this,t);var e=this.elementsById={},n=this.references=[],i=this.warnings=[];this.addReference=function(t){n.push(t)},this.addElement=function(t,n){if(!t||!n)throw new Error("[xml-reader] id or ctx must not be null");e[t]=n},this.addWarning=function(t){i.push(t)}}function s(){}function c(){}function u(){}function p(t,e){this.property=t,this.context=e}function l(t,e){this.element=e,this.propertyDesc=t}function h(){}function f(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function d(t,e,n){this.model=t,this.context=n}function m(t){t instanceof _&&(t={model:t}),x(this,{lax:!1},t)}var y=t(208),v=t(204),g=t(203),x=t(325),b=t(215),w=t(56),E=t(55).parser,_=t(57),S=t(62).parseName,T=t(65),A=T.coerceType,C=T.isSimple,M=t(52),R=M.XSI_TYPE,N=M.DEFAULT_NS_MAP.xsi,P=M.aliasToName;s.prototype.handleEnd=function(){},s.prototype.handleText=function(){},s.prototype.handleNode=function(){},c.prototype=new s,c.prototype.handleNode=function(){return this},u.prototype=new s,u.prototype.handleText=function(t){this.body=(this.body||"")+t},p.prototype=new u,p.prototype.handleNode=function(t){if(this.element)throw new Error("expected no sub nodes");return this.element=this.createReference(t),this},p.prototype.handleEnd=function(){this.element.id=this.body},p.prototype.createReference=function(){return{property:this.property.ns.name,id:""}},l.prototype=new u,l.prototype.handleEnd=function(){var t=this.body,e=this.element,n=this.propertyDesc;t=A(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},h.prototype=Object.create(u.prototype),h.prototype.handleNode=function(t){var e,n=this,i=this.element;return i?n=this.handleChild(t):(i=this.element=this.createElement(t),e=i.id,e&&this.context.addElement(e,i)),n},f.prototype=new h,f.prototype.addReference=function(t){this.context.addReference(t)},f.prototype.handleEnd=function(){var t=this.body,e=this.element,n=e.$descriptor,i=n.bodyProperty;i&&void 0!==t&&(t=A(i.type,t),e.set(i.name,t))},f.prototype.createElement=function(t){var e=i(t),n=this.type,r=n.$descriptor,o=this.context,a=new n({});return v(e,function(t,e){var n=r.propertiesByName[e];n&&n.isReference?o.addReference({element:a,property:n.ns.name,id:t}):(n&&(t=A(n.type,t)),a.set(e,t))}),a},f.prototype.getPropertyForNode=function(t){var e,n,i,r=S(t.local,t.prefix),o=this.type,a=this.model,s=o.$descriptor,c=r.name,u=s.propertiesByName[c];if(u)return u.serialize===R&&(i=t.attributes[R])?(e=i.value,n=a.getType(e),x({},u,{effectiveType:n.$descriptor.name})):u;var p=a.getPackage(r.prefix);if(p){if(e=r.prefix+":"+P(r.localName,s.$pkg),n=a.getType(e),u=g(s.properties,function(t){return!t.isVirtual&&!t.isReference&&!t.isAttribute&&n.hasType(t.type)}))return x({},u,{effectiveType:n.$descriptor.name})}else if(u=g(s.properties,function(t){return!t.isReference&&!t.isAttribute&&"Element"===t.type}))return u;throw new Error("unrecognized element <"+r.name+">")},f.prototype.toString=function(){return"ElementDescriptor["+this.type.$descriptor.name+"]"},f.prototype.valueHandler=function(t,e){return new l(t,e)},f.prototype.referenceHandler=function(t){return new p(t,this.context)},f.prototype.handler=function(t){return"Element"===t?new d(this.model,t,this.context):new f(this.model,t,this.context)},f.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,n=e.effectiveType||e.type,C(n))return this.valueHandler(e,i);r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t);var o=r.element;return void 0!==o&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(x(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},d.prototype=Object.create(h.prototype),d.prototype.createElement=function(t){var e=t.name,n=t.prefix,i=t.ns[n],r=t.attributes;return this.model.createAny(e,i,r)},d.prototype.handleChild=function(t){var e,n=new d(this.model,"Element",this.context).handleNode(t),i=this.element,r=n.element;return void 0!==r&&(e=i.$children=i.$children||[],e.push(r),r.$parent=i),n},d.prototype.handleText=function(t){this.body=this.body||""+t},d.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},m.prototype.fromXML=function(t,e,n){function i(){var t,e,n=h.elementsById,i=h.references;for(t=0;e=i[t];t++){var r=e.element,o=n[e.id],a=r.$descriptor.propertiesByName[e.property];if(o||h.addWarning({message:"unresolved reference <"+e.id+">",element:e.element,property:e.property,value:e.id}),a.isMany){var s=r.get(a.name),c=s.indexOf(e);o?s[c]=o:s.splice(c,1)}else r.set(a.name,o)}}function r(t){d.pop().handleEnd()}function s(t){var e=d.peek();o(t,p);try{d.push(e.handleNode(t))}catch(n){var i=this.line,r=this.column,a="unparsable content <"+t.name+"> detected\n line: "+i+"\n column: "+r+"\n nested error: "+n.message;if(!l)throw console.error("could not parse document"),console.error(n),new Error(a);h.addWarning({message:a,error:n}),console.warn("could not parse node"),console.warn(n),d.push(new c)}}function u(t){d.peek().handleText(t)}var p=this.model,l=this.lax,h=new a({parseRoot:e}),f=new E(!0,{xmlns:!0,trim:!0}),d=new w;e.context=h,d.push(e),f.onopentag=s,f.oncdata=f.ontext=u,f.onclosetag=r,f.onend=i,b(function(){var i;try{f.write(t).close()}catch(r){i=r}n(i,i?void 0:e.element,h)})},m.prototype.handler=function(t){return new f(this.model,t)},e.exports=m,e.exports.ElementHandler=f},{203:203,204:204,208:208,215:215,325:325,52:52,55:55,56:56,57:57,62:62,65:65}],54:[function(t,e,n){"use strict";function i(t){return b(t)?t:(t.prefix?t.prefix+":":"")+t.localName}function r(t,e){return e.isGeneric?e.name:E({localName:A(e.ns.localName,e.$pkg)},t)}function o(t,e){return E({localName:e.ns.localName},t)}function a(t){var e=t.$descriptor;return w(e.properties,function(e){var n=e.name;if(!t.hasOwnProperty(n))return!1;var i=t[n];return i===e["default"]?!1:e.isMany?i.length:!0})}function s(t){return t=b(t)?t:""+t,t.replace(M,function(t){return"&#"+P[t]+";"})}function c(t){return w(t,function(t){return t.isAttr})}function u(t){return w(t,function(t){return!t.isAttr})}function p(t,e){this.ns=e}function l(){}function h(t){this.ns=t}function f(t,e){this.body=[],this.attrs=[],this.parent=t,this.ns=e}function d(t,e){f.call(this,t,e)}function m(){this.value="",this.write=function(t){this.value+=t}}function y(t,e){var n=[""];this.append=function(e){return t.write(e),this},this.appendNewLine=function(){return e&&t.write("\n"),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function v(t){function e(e,n){var i=n||new m,r=new y(i,t.format);return t.preamble&&r.append(C),(new f).build(e).serializeTo(r),n?void 0:i.value}return t=E({format:!1,preamble:!0},t||{}),{toXML:e}}var g=t(207),x=t(204),b=t(322),w=t(202),E=t(325),_=t(65),S=t(62).parseName,T=t(52),A=T.nameToAlias,C='<?xml version="1.0" encoding="UTF-8"?>\n',M=/(<|>|'|"|&|\n\r|\n)/g,R=T.DEFAULT_NS_MAP,N=T.XSI_TYPE,P={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};p.prototype.build=function(t){return this.element=t,this},p.prototype.serializeTo=function(t){t.appendIndent().append("<"+i(this.ns)+">"+this.element.id+"</"+i(this.ns)+">").appendNewLine()},l.prototype.serializeValue=l.prototype.serializeTo=function(t){var e=this.escape;e&&t.append("<![CDATA["),t.append(this.value),e&&t.append("]]>")},l.prototype.build=function(t,e){return this.value=e,"String"===t.type&&M.test(e)&&(this.escape=!0),this},h.prototype=new l,h.prototype.serializeTo=function(t){t.appendIndent().append("<"+i(this.ns)+">"),this.serializeValue(t),t.append("</"+i(this.ns)+">").appendNewLine()},f.prototype.build=function(t){this.element=t;var e=this.parseNsAttributes(t);if(this.ns||(this.ns=this.nsTagName(t.$descriptor)),t.$descriptor.isGeneric)this.parseGeneric(t);else{var n=a(t);this.parseAttributes(c(n)),this.parseContainments(u(n)),this.parseGenericAttributes(t,e)}return this},f.prototype.nsTagName=function(t){var e=this.logNamespaceUsed(t.ns);return r(e,t)},f.prototype.nsPropertyTagName=function(t){var e=this.logNamespaceUsed(t.ns);return o(e,t)},f.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},f.prototype.nsAttributeName=function(t){var e;b(t)?e=S(t):t.ns&&(e=t.ns);var n=this.logNamespaceUsed(e);return this.isLocalNs(n)?{localName:e.localName}:E({localName:e.localName},n)},f.prototype.parseGeneric=function(t){var e=this,n=this.body,i=this.attrs;x(t,function(t,r){"$body"===r?n.push((new l).build({type:"String"},t)):"$children"===r?x(t,function(t){n.push(new f(e).build(t))}):0!==r.indexOf("$")&&i.push({name:r,value:s(t)})})},f.prototype.parseNsAttributes=function(t){var e=this,n=t.$attrs,i=[];return x(n,function(t,n){var r=S(n);"xmlns"===r.prefix?e.logNamespace({prefix:r.localName,uri:t}):r.prefix||"xmlns"!==r.localName?i.push({name:n,value:t}):e.logNamespace({uri:t})}),i},f.prototype.parseGenericAttributes=function(t,e){var n=this;x(e,function(e){if(e.name!==N)try{n.addAttribute(n.nsAttributeName(e.name),e.value)}catch(i){console.warn("[writer] missing namespace information for ",e.name,"=",e.value,"on",t,i)}})},f.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;x(t,function(t){var r=i.get(t.name),o=t.isReference,a=t.isMany,s=e.nsPropertyTagName(t);if(a||(r=[r]),t.isBody)n.push((new l).build(t,r[0]));else if(_.isSimple(t.type))x(r,function(e){n.push(new h(s).build(t,e))});else if(o)x(r,function(t){n.push(new p(e,s).build(t))});else{var c=t.serialize===N;x(r,function(t){var i;i=c?new d(e,s):new f(e),n.push(i.build(t))})}})},f.prototype.getNamespaces=function(){return this.parent?this.namespaces=this.parent.getNamespaces():this.namespaces||(this.namespaces={prefixMap:{},uriMap:{},used:{}}),this.namespaces},f.prototype.logNamespace=function(t){var e=this.getNamespaces(),n=e.uriMap[t.uri];return n||(e.uriMap[t.uri]=t),e.prefixMap[t.prefix]=t.uri,t},f.prototype.logNamespaceUsed=function(t){var e=this.element,n=e.$model,i=this.getNamespaces(),r=t.prefix,o=t.uri||R[r]||i.prefixMap[r]||(n?(n.getPackage(r)||{}).uri:null);if(!o)throw new Error("no namespace uri given for prefix <"+t.prefix+">");return t=i.uriMap[o],t||(t=this.logNamespace({prefix:r,uri:o})),i.used[t.uri]||(i.used[t.uri]=t),t},f.prototype.parseAttributes=function(t){var e=this,n=this.element;x(t,function(t){e.logNamespaceUsed(t.ns);var i=n.get(t.name);t.isReference&&(i=i.id),e.addAttribute(e.nsAttributeName(t),i)})},f.prototype.addAttribute=function(t,e){var n=this.attrs;b(e)&&(e=s(e)),
+n.push({name:t,value:e})},f.prototype.serializeAttributes=function(t){function e(){return g(o.used,function(t){var e="xmlns"+(t.prefix?":"+t.prefix:"");return{name:e,value:t.uri}})}var n=this.attrs,r=!this.parent,o=this.namespaces;r&&(n=e().concat(n)),x(n,function(e){t.append(" ").append(i(e.name)).append('="').append(e.value).append('"')})},f.prototype.serializeTo=function(t){var e=this.body.length,n=!(1===this.body.length&&this.body[0]instanceof l);t.appendIndent().append("<"+i(this.ns)),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),x(this.body,function(e){e.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+i(this.ns)+">")),t.appendNewLine()},d.prototype=new f,d.prototype.build=function(t){var e=t.$descriptor;this.element=t,this.typeNs=this.nsTagName(e);var n=this.typeNs,i=t.$model.getPackage(n.uri),r=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(N),(n.prefix?n.prefix+":":"")+r+e.ns.localName),f.prototype.build.call(this,t)},d.prototype.isLocalNs=function(t){return t.uri===this.typeNs.uri},e.exports=v},{202:202,204:204,207:207,322:322,325:325,52:52,62:62,65:65}],55:[function(t,e,n){(function(e){!function(n){function i(t,e){if(!(this instanceof i))return new i(t,e);var r=this;o(r),r.q=r.c="",r.bufferCheckPosition=n.MAX_BUFFER_LENGTH,r.opt=e||{},r.opt.lowercase=r.opt.lowercase||r.opt.lowercasetags,r.looseCase=r.opt.lowercase?"toLowerCase":"toUpperCase",r.tags=[],r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.strict=!!t,r.noscript=!(!t&&!r.opt.noscript),r.state=W.BEGIN,r.ENTITIES=Object.create(n.ENTITIES),r.attribList=[],r.opt.xmlns&&(r.ns=Object.create(V)),r.trackPosition=r.opt.position!==!1,r.trackPosition&&(r.position=r.line=r.column=0),f(r,"onready")}function r(t){for(var e=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,r=0,o=C.length;o>r;r++){var a=t[C[r]].length;if(a>e)switch(C[r]){case"textNode":m(t);break;case"cdata":d(t,"oncdata",t.cdata),t.cdata="";break;case"script":d(t,"onscript",t.script),t.script="";break;default:v(t,"Max buffer length exceeded: "+C[r])}i=Math.max(i,a)}t.bufferCheckPosition=n.MAX_BUFFER_LENGTH-i+t.position}function o(t){for(var e=0,n=C.length;n>e;e++)t[C[e]]=""}function a(t){m(t),""!==t.cdata&&(d(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(d(t,"onscript",t.script),t.script="")}function s(t,e){return new c(t,e)}function c(t,e){if(!(this instanceof c))return new c(t,e);M.apply(this),this._parser=new i(t,e),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(t){n.emit("error",t),n._parser.error=null},this._decoder=null,N.forEach(function(t){Object.defineProperty(n,"on"+t,{get:function(){return n._parser["on"+t]},set:function(e){return e?void n.on(t,e):(n.removeAllListeners(t),n._parser["on"+t]=e)},enumerable:!0,configurable:!1})})}function u(t){return t.split("").reduce(function(t,e){return t[e]=!0,t},{})}function p(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function l(t,e){return p(t)?!!e.match(t):t[e]}function h(t,e){return!l(t,e)}function f(t,e,n){t[e]&&t[e](n)}function d(t,e,n){t.textNode&&m(t),f(t,e,n)}function m(t){t.textNode=y(t.opt,t.textNode),t.textNode&&f(t,"ontext",t.textNode),t.textNode=""}function y(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function v(t,e){return m(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,f(t,"onerror",e),t}function g(t){return t.closedRoot||x(t,"Unclosed root tag"),t.state!==W.BEGIN&&t.state!==W.TEXT&&v(t,"Unexpected end"),m(t),t.c="",t.closed=!0,f(t,"onend"),i.call(t,t.strict,t.opt),t}function x(t,e){if("object"!=typeof t||!(t instanceof i))throw new Error("bad call to strictFail");t.strict&&v(t,e)}function b(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0}function w(t,e){var n=t.indexOf(":"),i=0>n?["",t]:t.split(":"),r=i[0],o=i[1];return e&&"xmlns"===t&&(r="xmlns",o=""),{prefix:r,local:o}}function E(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))return t.attribName=t.attribValue="";if(t.opt.xmlns){var e=w(t.attribName,!0),n=e.prefix,i=e.local;if("xmlns"===n)if("xml"===i&&t.attribValue!==F)x(t,"xml: prefix must be bound to "+F+"\nActual: "+t.attribValue);else if("xmlns"===i&&t.attribValue!==$)x(t,"xmlns: prefix must be bound to "+$+"\nActual: "+t.attribValue);else{var r=t.tag,o=t.tags[t.tags.length-1]||t;r.ns===o.ns&&(r.ns=Object.create(o.ns)),r.ns[i]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,d(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}function _(t,e){if(t.opt.xmlns){var n=t.tag,i=w(t.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(x(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=i.prefix);var r=t.tags[t.tags.length-1]||t;n.ns&&r.ns!==n.ns&&Object.keys(n.ns).forEach(function(e){d(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var o=0,a=t.attribList.length;a>o;o++){var s=t.attribList[o],c=s[0],u=s[1],p=w(c,!0),l=p.prefix,h=p.local,f=""==l?"":n.ns[l]||"",m={name:c,value:u,prefix:l,local:h,uri:f};l&&"xmlns"!=l&&!f&&(x(t,"Unbound namespace prefix: "+JSON.stringify(l)),m.uri=l),t.tag.attributes[c]=m,d(t,"onattribute",m)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),d(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=W.TEXT:t.state=W.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function S(t){if(!t.tagName)return x(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=W.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=W.SCRIPT);d(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var i=n;e--;){var r=t.tags[e];if(r.name===i)break;x(t,"Unexpected close tag")}if(0>e)return x(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=W.TEXT);t.tagName=n;for(var o=t.tags.length;o-->e;){var a=t.tag=t.tags.pop();t.tagName=t.tag.name,d(t,"onclosetag",t.tagName);var s={};for(var c in a.ns)s[c]=a.ns[c];var u=t.tags[t.tags.length-1]||t;t.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach(function(e){var n=a.ns[e];d(t,"onclosenamespace",{prefix:e,uri:n})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=W.TEXT}function T(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:(n=i,"#"===n.charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),e=parseInt(n,16),r=e.toString(16)):(n=n.slice(1),e=parseInt(n,10),r=e.toString(10))),n=n.replace(/^0+/,""),r.toLowerCase()!==n?(x(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function A(t){var e=this;if(this.error)throw this.error;if(e.closed)return v(e,"Cannot write after close. Assign an onready handler.");if(null===t)return g(e);for(var n=0,i="";e.c=i=t.charAt(n++);)switch(e.trackPosition&&(e.position++,"\n"===i?(e.line++,e.column=0):e.column++),e.state){case W.BEGIN:"<"===i?(e.state=W.OPEN_WAKA,e.startTagPosition=e.position):h(P,i)&&(x(e,"Non-whitespace before first tag."),e.textNode=i,e.state=W.TEXT);continue;case W.TEXT:if(e.sawRoot&&!e.closedRoot){for(var o=n-1;i&&"<"!==i&&"&"!==i;)i=t.charAt(n++),i&&e.trackPosition&&(e.position++,"\n"===i?(e.line++,e.column=0):e.column++);e.textNode+=t.substring(o,n-1)}"<"===i?(e.state=W.OPEN_WAKA,e.startTagPosition=e.position):(!h(P,i)||e.sawRoot&&!e.closedRoot||x(e,"Text data outside of root node."),"&"===i?e.state=W.TEXT_ENTITY:e.textNode+=i);continue;case W.SCRIPT:"<"===i?e.state=W.SCRIPT_ENDING:e.script+=i;continue;case W.SCRIPT_ENDING:"/"===i?e.state=W.CLOSE_TAG:(e.script+="<"+i,e.state=W.SCRIPT);continue;case W.OPEN_WAKA:if("!"===i)e.state=W.SGML_DECL,e.sgmlDecl="";else if(l(P,i));else if(l(G,i))e.state=W.OPEN_TAG,e.tagName=i;else if("/"===i)e.state=W.CLOSE_TAG,e.tagName="";else if("?"===i)e.state=W.PROC_INST,e.procInstName=e.procInstBody="";else{if(x(e,"Unencoded <"),e.startTagPosition+1<e.position){var a=e.position-e.startTagPosition;i=new Array(a).join(" ")+i}e.textNode+="<"+i,e.state=W.TEXT}continue;case W.SGML_DECL:(e.sgmlDecl+i).toUpperCase()===L?(d(e,"onopencdata"),e.state=W.CDATA,e.sgmlDecl="",e.cdata=""):e.sgmlDecl+i==="--"?(e.state=W.COMMENT,e.comment="",e.sgmlDecl=""):(e.sgmlDecl+i).toUpperCase()===j?(e.state=W.DOCTYPE,(e.doctype||e.sawRoot)&&x(e,"Inappropriately located doctype declaration"),e.doctype="",e.sgmlDecl=""):">"===i?(d(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=W.TEXT):l(O,i)?(e.state=W.SGML_DECL_QUOTED,e.sgmlDecl+=i):e.sgmlDecl+=i;continue;case W.SGML_DECL_QUOTED:i===e.q&&(e.state=W.SGML_DECL,e.q=""),e.sgmlDecl+=i;continue;case W.DOCTYPE:">"===i?(e.state=W.TEXT,d(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=i,"["===i?e.state=W.DOCTYPE_DTD:l(O,i)&&(e.state=W.DOCTYPE_QUOTED,e.q=i));continue;case W.DOCTYPE_QUOTED:e.doctype+=i,i===e.q&&(e.q="",e.state=W.DOCTYPE);continue;case W.DOCTYPE_DTD:e.doctype+=i,"]"===i?e.state=W.DOCTYPE:l(O,i)&&(e.state=W.DOCTYPE_DTD_QUOTED,e.q=i);continue;case W.DOCTYPE_DTD_QUOTED:e.doctype+=i,i===e.q&&(e.state=W.DOCTYPE_DTD,e.q="");continue;case W.COMMENT:"-"===i?e.state=W.COMMENT_ENDING:e.comment+=i;continue;case W.COMMENT_ENDING:"-"===i?(e.state=W.COMMENT_ENDED,e.comment=y(e.opt,e.comment),e.comment&&d(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+i,e.state=W.COMMENT);continue;case W.COMMENT_ENDED:">"!==i?(x(e,"Malformed comment"),e.comment+="--"+i,e.state=W.COMMENT):e.state=W.TEXT;continue;case W.CDATA:"]"===i?e.state=W.CDATA_ENDING:e.cdata+=i;continue;case W.CDATA_ENDING:"]"===i?e.state=W.CDATA_ENDING_2:(e.cdata+="]"+i,e.state=W.CDATA);continue;case W.CDATA_ENDING_2:">"===i?(e.cdata&&d(e,"oncdata",e.cdata),d(e,"onclosecdata"),e.cdata="",e.state=W.TEXT):"]"===i?e.cdata+="]":(e.cdata+="]]"+i,e.state=W.CDATA);continue;case W.PROC_INST:"?"===i?e.state=W.PROC_INST_ENDING:l(P,i)?e.state=W.PROC_INST_BODY:e.procInstName+=i;continue;case W.PROC_INST_BODY:if(!e.procInstBody&&l(P,i))continue;"?"===i?e.state=W.PROC_INST_ENDING:e.procInstBody+=i;continue;case W.PROC_INST_ENDING:">"===i?(d(e,"onprocessinginstruction",{name:e.procInstName,body:e.procInstBody}),e.procInstName=e.procInstBody="",e.state=W.TEXT):(e.procInstBody+="?"+i,e.state=W.PROC_INST_BODY);continue;case W.OPEN_TAG:l(z,i)?e.tagName+=i:(b(e),">"===i?_(e):"/"===i?e.state=W.OPEN_TAG_SLASH:(h(P,i)&&x(e,"Invalid character in tag name"),e.state=W.ATTRIB));continue;case W.OPEN_TAG_SLASH:">"===i?(_(e,!0),S(e)):(x(e,"Forward-slash in opening tag not followed by >"),e.state=W.ATTRIB);continue;case W.ATTRIB:if(l(P,i))continue;">"===i?_(e):"/"===i?e.state=W.OPEN_TAG_SLASH:l(G,i)?(e.attribName=i,e.attribValue="",e.state=W.ATTRIB_NAME):x(e,"Invalid attribute name");continue;case W.ATTRIB_NAME:"="===i?e.state=W.ATTRIB_VALUE:">"===i?(x(e,"Attribute without value"),e.attribValue=e.attribName,E(e),_(e)):l(P,i)?e.state=W.ATTRIB_NAME_SAW_WHITE:l(z,i)?e.attribName+=i:x(e,"Invalid attribute name");continue;case W.ATTRIB_NAME_SAW_WHITE:if("="===i)e.state=W.ATTRIB_VALUE;else{if(l(P,i))continue;x(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",d(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",">"===i?_(e):l(G,i)?(e.attribName=i,e.state=W.ATTRIB_NAME):(x(e,"Invalid attribute name"),e.state=W.ATTRIB)}continue;case W.ATTRIB_VALUE:if(l(P,i))continue;l(O,i)?(e.q=i,e.state=W.ATTRIB_VALUE_QUOTED):(x(e,"Unquoted attribute value"),e.state=W.ATTRIB_VALUE_UNQUOTED,e.attribValue=i);continue;case W.ATTRIB_VALUE_QUOTED:if(i!==e.q){"&"===i?e.state=W.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=i;continue}E(e),e.q="",e.state=W.ATTRIB_VALUE_CLOSED;continue;case W.ATTRIB_VALUE_CLOSED:l(P,i)?e.state=W.ATTRIB:">"===i?_(e):"/"===i?e.state=W.OPEN_TAG_SLASH:l(G,i)?(x(e,"No whitespace between attributes"),e.attribName=i,e.attribValue="",e.state=W.ATTRIB_NAME):x(e,"Invalid attribute name");continue;case W.ATTRIB_VALUE_UNQUOTED:if(h(I,i)){"&"===i?e.state=W.ATTRIB_VALUE_ENTITY_U:e.attribValue+=i;continue}E(e),">"===i?_(e):e.state=W.ATTRIB;continue;case W.CLOSE_TAG:if(e.tagName)">"===i?S(e):l(z,i)?e.tagName+=i:e.script?(e.script+="</"+e.tagName,e.tagName="",e.state=W.SCRIPT):(h(P,i)&&x(e,"Invalid tagname in closing tag"),e.state=W.CLOSE_TAG_SAW_WHITE);else{if(l(P,i))continue;h(G,i)?e.script?(e.script+="</"+i,e.state=W.SCRIPT):x(e,"Invalid tagname in closing tag."):e.tagName=i}continue;case W.CLOSE_TAG_SAW_WHITE:if(l(P,i))continue;">"===i?S(e):x(e,"Invalid characters in closing tag");continue;case W.TEXT_ENTITY:case W.ATTRIB_VALUE_ENTITY_Q:case W.ATTRIB_VALUE_ENTITY_U:switch(e.state){case W.TEXT_ENTITY:var s=W.TEXT,c="textNode";break;case W.ATTRIB_VALUE_ENTITY_Q:var s=W.ATTRIB_VALUE_QUOTED,c="attribValue";break;case W.ATTRIB_VALUE_ENTITY_U:var s=W.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===i?(e[c]+=T(e),e.entity="",e.state=s):l(B,i)?e.entity+=i:(x(e,"Invalid character entity"),e[c]+="&"+e.entity+i,e.entity="",e.state=s);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&r(e),e}n.parser=function(t,e){return new i(t,e)},n.SAXParser=i,n.SAXStream=c,n.createStream=s,n.MAX_BUFFER_LENGTH=65536;var C=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];n.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){this.__proto__=t}return e.prototype=t,new e}),Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__}),Object.keys||(Object.keys=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}),i.prototype={end:function(){g(this)},write:A,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};try{var M=t("stream").Stream}catch(R){var M=function(){}}var N=n.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});c.prototype=Object.create(M.prototype,{constructor:{value:c}}),c.prototype.write=function(n){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(n)){if(!this._decoder){var i=t("string_decoder").StringDecoder;this._decoder=new i("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},c.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},c.prototype.on=function(t,e){var n=this;return n._parser["on"+t]||-1===N.indexOf(t)||(n._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),n.emit.apply(n,e)}),M.prototype.on.call(n,t,e)};var P="\r\n ",k="0124356789",D="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",O="'\"",B=k+D+"#",I=P+">",L="[CDATA[",j="DOCTYPE",F="http://www.w3.org/XML/1998/namespace",$="http://www.w3.org/2000/xmlns/",V={xml:F,xmlns:$};P=u(P),k=u(k),D=u(D);var G=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,z=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;O=u(O),B=u(B),I=u(I);var W=0;n.STATE={BEGIN:W++,TEXT:W++,TEXT_ENTITY:W++,OPEN_WAKA:W++,SGML_DECL:W++,SGML_DECL_QUOTED:W++,DOCTYPE:W++,DOCTYPE_QUOTED:W++,DOCTYPE_DTD:W++,DOCTYPE_DTD_QUOTED:W++,COMMENT_STARTING:W++,COMMENT:W++,COMMENT_ENDING:W++,COMMENT_ENDED:W++,CDATA:W++,CDATA_ENDING:W++,CDATA_ENDING_2:W++,PROC_INST:W++,PROC_INST_BODY:W++,PROC_INST_ENDING:W++,OPEN_TAG:W++,OPEN_TAG_SLASH:W++,ATTRIB:W++,ATTRIB_NAME:W++,ATTRIB_NAME_SAW_WHITE:W++,ATTRIB_VALUE:W++,ATTRIB_VALUE_QUOTED:W++,ATTRIB_VALUE_CLOSED:W++,ATTRIB_VALUE_UNQUOTED:W++,ATTRIB_VALUE_ENTITY_Q:W++,ATTRIB_VALUE_ENTITY_U:W++,CLOSE_TAG:W++,CLOSE_TAG_SAW_WHITE:W++,SCRIPT:W++,SCRIPT_ENDING:W++},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(t){var e=n.ENTITIES[t],i="number"==typeof e?String.fromCharCode(e):e;n.ENTITIES[t]=i});for(var W in n.STATE)n.STATE[n.STATE[W]]=W;W=n.STATE,String.fromCodePoint||!function(){var t=String.fromCharCode,e=Math.floor,n=function(){var n,i,r=16384,o=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++a<s;){var u=Number(arguments[a]);if(!isFinite(u)||0>u||u>1114111||e(u)!=u)throw RangeError("Invalid code point: "+u);65535>=u?o.push(u):(u-=65536,n=(u>>10)+55296,i=u%1024+56320,o.push(n,i)),(a+1==s||o.length>r)&&(c+=t.apply(null,o),o.length=0)}return c};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n}()}("undefined"==typeof n?sax={}:n)}).call(this,void 0)},{undefined:void 0}],56:[function(e,n,i){!function(e){"use strict";function r(){this.data=[null],this.top=0}function o(){return new r}r.prototype.clear=function(){return this.data=[null],this.top=0,this},r.prototype.length=function(){return this.top},r.prototype.peek=function(){return this.data[this.top]},r.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},r.prototype.push=function(t){return this.data[++this.top]=t,this},"undefined"!=typeof i?n.exports=o:"function"==typeof t?t(function(){return o}):e.stack=o}(this)},{}],57:[function(t,e,n){e.exports=t(61)},{61:61}],58:[function(t,e,n){"use strict";function i(){}i.prototype.get=function(t){return this.$model.properties.get(this,t)},i.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},e.exports=i},{}],59:[function(t,e,n){"use strict";function i(t){this.ns=t,this.name=t.name,this.allTypes=[],this.properties=[],this.propertiesByName={}}var r=t(330),o=t(325),a=t(204),s=t(62).parseName;e.exports=i,i.prototype.build=function(){return r(this,["ns","name","allTypes","properties","propertiesByName","bodyProperty"])},i.prototype.addProperty=function(t,e){this.addNamedProperty(t,!0);var n=this.properties;void 0!==e?n.splice(e,0,t):n.push(t)},i.prototype.replaceProperty=function(t,e){var n=t.ns,i=this.properties,r=this.propertiesByName,o=t.name!==e.name;if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}this.addNamedProperty(e,o);var a=i.indexOf(t);if(-1===a)throw new Error("property <"+n.name+"> not found in property list");i[a]=e,r[n.name]=r[n.localName]=e},i.prototype.redefineProperty=function(t){var e=t.ns.prefix,n=t.redefines.split("#"),i=s(n[0],e),r=s(n[1],i.prefix).name,o=this.propertiesByName[r];if(!o)throw new Error("refined property <"+r+"> not found");this.replaceProperty(o,t),delete t.redefines},i.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},i.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},i.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},i.prototype.addIdProperty=function(t){var e=s(t,this.ns.prefix),n={name:e.localName,type:"String",isAttr:!0,ns:e};this.addProperty(n,0)},i.prototype.assertNotDefined=function(t,e){var n=t.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},i.prototype.hasProperty=function(t){return this.propertiesByName[t]},i.prototype.addTrait=function(t){var e=this.allTypes;-1===e.indexOf(t)&&(a(t.properties,function(e){e=o({},e,{name:e.ns.localName}),Object.defineProperty(e,"definedBy",{value:t}),e.redefines?this.redefineProperty(e):(e.isBody&&this.setBodyProperty(e),this.addProperty(e))},this),e.push(t))}},{204:204,325:325,330:330,62:62}],60:[function(t,e,n){"use strict";function i(t,e){this.model=t,this.properties=e}var r=t(204),o=t(58);e.exports=i,i.prototype.createType=function(t){function e(t){i.define(this,"$type",{value:s,enumerable:!0}),i.define(this,"$attrs",{value:{}}),i.define(this,"$parent",{writable:!0}),r(t,function(t,e){this.set(e,t)},this)}var n=this.model,i=this.properties,a=Object.create(o.prototype);r(t.properties,function(t){t.isMany||void 0===t["default"]||(a[t.name]=t["default"])}),i.defineModel(a,n),i.defineDescriptor(a,t);var s=t.ns.name;return e.prototype=a,e.hasType=a.$instanceOf=this.model.hasType,i.defineModel(e,n),i.defineDescriptor(e,t),e}},{204:204,58:58}],61:[function(t,e,n){"use strict";function i(t,e){e=e||{},this.properties=new p(this),this.factory=new c(this,this.properties),this.registry=new u(t,this.properties,e),this.typeCache={}}var r=t(322),o=t(320),a=t(204),s=t(203),c=t(60),u=t(64),p=t(63),l=t(62).parseName;e.exports=i,i.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},i.prototype.getType=function(t){var e=this.typeCache,n=r(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},i.prototype.createAny=function(t,e,n){var i=l(t),r={$type:t},s={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,s),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),a(n,function(t,e){o(t)&&void 0!==t.value?r[t.name]=t.value:r[e]=t}),r},i.prototype.getPackage=function(t){return this.registry.getPackage(t)},i.prototype.getPackages=function(){return this.registry.getPackages()},i.prototype.getElementDescriptor=function(t){return t.$descriptor},i.prototype.hasType=function(t,e){void 0===e&&(e=t,t=this);var n=t.$model.getElementDescriptor(t);return!!s(n.allTypes,function(t){return t.name===e})},i.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]}},{203:203,204:204,320:320,322:322,60:60,62:62,63:63,64:64}],62:[function(t,e,n){"use strict";e.exports.parseName=function(t,e){var n,i,r=t.split(/:/);if(1===r.length)n=t,i=e;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+t);n=r[1],i=r[0]}return t=(i?i+":":"")+n,{name:t,prefix:i,localName:n}}},{}],63:[function(t,e,n){"use strict";function i(t){this.model=t}e.exports=i,i.prototype.set=function(t,e,n){var i=this.model.getPropertyDescriptor(t,e);i?Object.defineProperty(t,i.name,{enumerable:!i.isReference,writable:!0,value:n}):t.$attrs[e]=n},i.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&Object.defineProperty(t,i,{enumerable:!n.isReference,writable:!0,value:[]}),t[i]},i.prototype.define=function(t,e,n){Object.defineProperty(t,e,n)},i.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},i.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})}},{}],64:[function(t,e,n){"use strict";function i(t,e,n){this.options=r({generateId:"id"},n||{}),this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,o(t,this.registerPackage,this)}var r=t(325),o=t(204),a=t(65),s=t(59),c=t(62).parseName,u=a.isBuiltIn;e.exports=i,i.prototype.getPackage=function(t){return this.packageMap[t]},i.prototype.getPackages=function(){return this.packages},i.prototype.registerPackage=function(t){t=r({},t),o(t.types,function(e){this.registerType(e,t)},this),this.packageMap[t.uri]=this.packageMap[t.prefix]=t,this.packages.push(t)},i.prototype.registerType=function(t,e){t=r({},t,{superClass:(t.superClass||[]).slice(),"extends":(t["extends"]||[]).slice(),properties:(t.properties||[]).slice()});var n=c(t.name,e.prefix),i=n.name,a={};o(t.properties,function(t){var e=c(t.name,n.prefix),i=e.name;u(t.type)||(t.type=c(t.type,e.prefix).name),r(t,{ns:e,name:i}),a[i]=t}),r(t,{ns:n,name:i,propertiesByName:a}),o(t["extends"],function(t){var e=this.typeMap[t];e.traits=e.traits||[],e.traits.push(i)},this),this.definePackage(t,e),this.typeMap[i]=t},i.prototype.mapTypes=function(t,e){function n(n){var i=c(n,u(n)?"":t.prefix);r.mapTypes(i,e)}var i=u(t.name)?{name:t.name}:this.typeMap[t.name],r=this;if(!i)throw new Error("unknown type <"+t.name+">");o(i.superClass,n),e(i),o(i.traits,n)},i.prototype.getEffectiveDescriptor=function(t){var e=c(t),n=new s(e);this.mapTypes(e,function(t){n.addTrait(t)});var i=this.options.generateId;i&&!n.hasProperty(i)&&n.addIdProperty(i);var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},i.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})}},{204:204,325:325,59:59,62:62,65:65}],65:[function(t,e,n){"use strict";var i={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},r={String:function(t){return t},Boolean:function(t){return"true"===t},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t,10)}};e.exports.coerceType=function(t,e){var n=r[t];return n?n(e):e},e.exports.isBuiltIn=function(t){return!!i[t]},e.exports.isSimple=function(t){return!!r[t]}},{}],66:[function(t,e,n){e.exports={name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"outMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"errorRefs",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"childLaneSet",type:"LaneSet",serialize:"xsi:type"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection","default":"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,"default":"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",serialize:"xsi:type"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String"},{name:"documentation",type:"Documentation",
+isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand","default":!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition"}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference","default":!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting","default":!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"inputSet",type:"InputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataInputAssociation",type:"DataInputAssociation",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean","default":!1},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataOutputAssociation",type:"DataOutputAssociation",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity","default":!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean"},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",serialize:"xsi:type"},{name:"timeCycle",type:"Expression",serialize:"xsi:type"},{name:"timeDuration",type:"Expression",serialize:"xsi:type"}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",serialize:"xsi:type"}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"transformation",type:"FormalExpression"},{name:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"inputSetRefs",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"outputSetRefs",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",serialize:"xsi:type"},{name:"to",type:"Expression",serialize:"xsi:type"}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited","default":!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!0},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"body",type:"String",isBody:!0},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",type:"String",isAttr:!0},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",serialize:"xsi:type"},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"supportedInterfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum","default":0,isAttr:!0,type:"Integer"},{name:"maximum","default":1,isAttr:!0,type:"Integer"}]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType","default":"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["FlowElementsContainer","Collaboration"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isVirtual:!0,isMany:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCharacteristics",type:"LoopCharacteristics"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity","default":1,isAttr:!0,type:"Integer"},{name:"completionQuantity","default":1,isAttr:!0,type:"Integer"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent","default":!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential","default":!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior","default":"All",isAttr:!0},{name:"loopCardinality",type:"Expression",serialize:"xsi:type"},{name:"loopDataInputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"inputDataItem",type:"DataInput"},{name:"outputDataItem",type:"DataOutput"},{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",serialize:"xsi:type"},{name:"loopMaximum",type:"Expression",serialize:"xsi:type"}]},{name:"CallActivity",superClass:["Activity"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances","default":!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"}]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage","default":"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage","default":"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],emumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}}},{}],67:[function(t,e,n){e.exports={name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,"default":"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],emumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[],prefix:"bpmndi"}},{}],68:[function(t,e,n){e.exports={name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]}},{}],69:[function(t,e,n){e.exports={name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",serialize:"xsi:type"}]},{name:"Diagram",isAbstract:!0,properties:[{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",xml:{tagAlias:"lowerCase"}}},{}],70:[function(t,e,n){e.exports={__depends__:[t(103)],__init__:["directEditing"],directEditing:["type",t(71)]}},{103:103,71:71}],71:[function(t,e,n){"use strict";function i(t,e){this._eventBus=t,this._providers=[],this._textbox=new a({container:e.getContainer(),keyHandler:r(this._handleKey,this)})}var r=t(213),o=t(203),a=t(72);i.$inject=["eventBus","canvas"],i.prototype.registerProvider=function(t){this._providers.push(t)},i.prototype.isActive=function(){return!!this._active},i.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},i.prototype._fire=function(t){this._eventBus.fire("directEditing."+t,{active:this._active})},i.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null},i.prototype.complete=function(){var t=this._active;if(t){var e=this.getValue();e!==t.context.text&&t.provider.update(t.element,e,t.context.text),this._fire("complete"),this.close()}},i.prototype.getValue=function(){return this._textbox.getValue()},i.prototype._handleKey=function(t){t.stopPropagation();var e=t.keyCode||t.charCode;return 27===e?(t.preventDefault(),this.cancel()):13!==e||t.shiftKey?void 0:(t.preventDefault(),this.complete())},i.prototype.activate=function(t){this.isActive()&&this.cancel();var e,n=o(this._providers,function(n){return(e=n.activate(t))?n:null});return e&&(this._textbox.create(e.bounds,e.style,e.text),this._active={element:t,context:e,provider:n},this._fire("activate")),!!e},e.exports=i},{203:203,213:213,72:72}],72:[function(t,e,n){"use strict";function i(t){t.stopPropagation()}function r(t){this.container=t.container,this.textarea=document.createElement("textarea"),this.keyHandler=t.keyHandler||function(){}}var o=t(325),a=t(344),s=t(347);e.exports=r,r.prototype.create=function(t,e,n){var r=this.textarea,s=this.container;o(r.style,{width:t.width+"px",height:t.height+"px",left:t.x+"px",top:t.y+"px",position:"absolute",textAlign:"center",boxSizing:"border-box"},e||{}),r.value=n,r.title="Press SHIFT+Enter for line feed",a.bind(r,"keydown",this.keyHandler),a.bind(r,"mousedown",i),s.appendChild(r),setTimeout(function(){r.select(),r.focus()},100)},r.prototype.destroy=function(){var t=this.textarea;t.value="",a.unbind(t,"keydown",this.keyHandler),a.unbind(t,"mousedown",i),s(t)},r.prototype.getValue=function(){return this.textarea.value}},{325:325,344:344,347:347}],73:[function(t,e,n){e.exports=t(74)},{74:74}],74:[function(t,e,n){"use strict";function i(t){function e(t){return r.indexOf(t)>=0}function n(t){r.push(t)}function i(t){e(t)||((t.__depends__||[]).forEach(i),e(t)||(n(t),(t.__init__||[]).forEach(function(t){o.push(t)})))}var r=[],o=[];t.forEach(i);var s=new a.Injector(r);return o.forEach(function(t){try{s["string"==typeof t?"get":"invoke"](t)}catch(e){throw console.error("Failed to instantiate component"),
+console.error(e.stack),e}}),s}function r(e){e=e||{};var n={config:["value",e]},r=t(83),o=[n,r].concat(e.modules||[]);return i(o)}function o(t,e){this.injector=e=e||r(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}var a=t(190);e.exports=o,o.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")}},{190:190,83:83}],75:[function(t,e,n){"use strict";function i(t){this._eventBus=t}function r(t){return function(e){return t(e.context,e.command,e)}}var o=t(204),a=t(317),s=t(316);i.$inject=["eventBus"],e.exports=i,i.prototype.on=function(t,e,n,i){if(a(e)&&(i=n,n=e,e=null),!a(n))throw new Error("handlerFn must be a function");s(t)||(t=[t]);var c=this._eventBus;o(t,function(t){var o=["commandStack",t,e].filter(function(t){return t}).join(".");c.on(o,i?r(n):n)})};var c=["canExecute","preExecute","execute","executed","postExecute","revert","reverted"];o(c,function(t){i.prototype[t]=function(e,n,i){a(e)&&(i=n,n=e,e=null),this.on(e,t,n,i)}})},{204:204,316:316,317:317}],76:[function(t,e,n){"use strict";function i(t,e){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[]},this._injector=e,this._eventBus=t,this._uid=1}var r=t(199),o=t(316),a=t(325),s=t(81).Event;i.$inject=["eventBus","injector"],e.exports=i,i.prototype.execute=function(t,e){if(!t)throw new Error("command required");var n={command:t,context:e};this._pushAction(n),this._internalExecute(n),this._popAction(n)},i.prototype.canExecute=function(t,e){var n={command:t,context:e},i=this._getHandler(t);if(!i)return!1;var r=this._fire(t,"canExecute",n);return void 0===r&&i.canExecute&&(r=i.canExecute(e)),r},i.prototype.clear=function(){this._stack.length=0,this._stackIdx=-1,this._fire("changed")},i.prototype.undo=function(){var t,e=this._getUndoAction();if(e){for(this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),t&&t.id===e.id);)e=t;this._popAction()}},i.prototype.redo=function(){var t,e=this._getRedoAction();if(e){for(this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),t&&t.id===e.id);)e=t;this._popAction()}},i.prototype.register=function(t,e){this._setHandler(t,e)},i.prototype.registerHandler=function(t,e){if(!t||!e)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(e);this.register(t,n)},i.prototype.canUndo=function(){return!!this._getUndoAction()},i.prototype.canRedo=function(){return!!this._getRedoAction()},i.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},i.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},i.prototype._internalUndo=function(t){var e=t.command,n=t.context,i=this._getHandler(e);this._fire(e,"revert",t),this._markDirty(i.revert(n)),this._revertedAction(t),this._fire(e,"reverted",t)},i.prototype._fire=function(t,e,n){arguments.length<3&&(n=e,e=null);var i,r,o,c=e?[t+"."+e,e]:[t];for(n=a(new s,n),i=0;(r=c[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},i.prototype._createId=function(){return this._uid++},i.prototype._internalExecute=function(t,e){var n=t.command,i=t.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(t),e||(this._fire(n,"preExecute",t),r.preExecute&&r.preExecute(i)),this._fire(n,"execute",t),this._markDirty(r.execute(i)),this._executedAction(t,e),this._fire(n,"executed",t),e||(r.postExecute&&r.postExecute(i),this._fire(n,"postExecute",t)),this._popAction(t)},i.prototype._pushAction=function(t){var e=this._currentExecution,n=e.actions,i=n[0];t.id||(t.id=i&&i.id||this._createId()),n.push(t)},i.prototype._popAction=function(){var t=this._currentExecution,e=t.actions,n=t.dirty;e.pop(),e.length||(this._eventBus.fire("elements.changed",{elements:r(n)}),n.length=0,this._fire("changed"))},i.prototype._markDirty=function(t){var e=this._currentExecution;t&&(t=o(t)?t:[t],e.dirty=e.dirty.concat(t))},i.prototype._executedAction=function(t,e){var n=++this._stackIdx;e||this._stack.splice(n,this._stack.length,t)},i.prototype._revertedAction=function(t){this._stackIdx--},i.prototype._getHandler=function(t){return this._handlerMap[t]},i.prototype._setHandler=function(t,e){if(!t||!e)throw new Error("command and handler required");if(this._handlerMap[t])throw new Error("overriding handler for command <"+t+">");this._handlerMap[t]=e}},{199:199,316:316,325:325,81:81}],77:[function(t,e,n){e.exports={__depends__:[t(83)],commandStack:["type",t(76)]}},{76:76,83:83}],78:[function(t,e,n){"use strict";function i(t,e){return Math.round(t*e)/e}function r(t){return u(t)?t+"px":t}function o(t){t=p({},{width:"100%",height:"100%"},t);var e=t.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),p(n.style,{position:"relative",overflow:"hidden",width:r(t.width),height:r(t.height)}),e.appendChild(n),n}function a(t,e){return t.group().attr({"class":e})}function s(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function c(t,e){var n="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";t.setAttribute("transform",n)}var u=t(319),p=t(325),l=t(204),h=t(175),f=t(188),d="base";s.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],e.exports=s,s.prototype._init=function(t){var e=this._eventBus,n=o(t),i=f.createSnapAt("100%","100%",n),r=a(i,"viewport"),s=this;this._container=n,this._svg=i,this._viewport=r,this._layers={},e.on("diagram.init",function(t){e.fire("canvas.init",{svg:i,viewport:r})}),e.on("diagram.destroy",function(){var t=s._container.parentNode;t&&t.removeChild(n),e.fire("canvas.destroy",{svg:s._svg,viewport:s._viewport}),s._svg.remove(),s._svg=s._container=s._layers=s._viewport=null})},s.prototype.getDefaultLayer=function(){return this.getLayer(d)},s.prototype.getLayer=function(t){if(!t)throw new Error("must specify a name");var e=this._layers[t];return e||(e=this._layers[t]=a(this._viewport,"layer-"+t)),e},s.prototype.getContainer=function(){return this._container},s.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),i=this._elementRegistry._elements[t.id],i&&(l([i.gfx,i.secondaryGfx],function(t){t&&t[n?"addClass":"removeClass"](e)}),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},s.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},s.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},s.prototype.hasMarker=function(t,e){t.id||(t=this._elementRegistry.get(t));var n=this.getGraphics(t);return n&&n.hasClass(e)},s.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},s.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot"}),this._rootElement},s.prototype.setRootElement=function(t,e){this._ensureValidId(t);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!e)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}var o=this.getDefaultLayer();return r.fire("root.add",{element:t}),i.add(t,o,this._svg),r.fire("root.added",{element:t,gfx:o}),this._rootElement=t,t},s.prototype._ensureValidId=function(t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists")},s.prototype._setParent=function(t,e){h.add(e.children,t),t.parent=e},s.prototype._addElement=function(t,e,n){n=n||this.getRootElement();var i=this._eventBus,r=this._graphicsFactory;this._ensureValidId(e),i.fire(t+".add",{element:e,parent:n}),this._setParent(e,n);var o=r.create(t,e);return this._elementRegistry.add(e,o),r.update(t,e,o),i.fire(t+".added",{element:e,gfx:o}),e},s.prototype.addShape=function(t,e){return this._addElement("shape",t,e)},s.prototype.addConnection=function(t,e){return this._addElement("connection",t,e)},s.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;return(t=n.get(t.id||t))?(r.fire(e+".remove",{element:t}),i.remove(t),h.remove(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t):void 0},s.prototype.removeShape=function(t){return this._removeElement(t,"shape")},s.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},s.prototype.sendToFront=function(t,e){e!==!1&&(e=!0),e&&t.parent&&this.sendToFront(t.parent),l(t.children,function(t){this.sendToFront(t,!1)},this);var n=this.getGraphics(t),i=n.parent();n.remove().appendTo(i)},s.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},s.prototype._fireViewboxChange=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox(!1)})},s.prototype.viewbox=function(t){if(void 0===t&&this._cachedViewbox)return this._cachedViewbox;var e,n,r,o,a,s=this._viewport,c=this.getSize();return t?(r=Math.min(c.width/t.width,c.height/t.height),n=(new f.Matrix).scale(r).translate(-t.x,-t.y),s.transform(n),this._fireViewboxChange(),t):(e=this.getDefaultLayer().getBBox(!0),n=s.transform().localMatrix,r=i(n.a,1e3),o=i(-n.e||0,1e3),a=i(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:c.width/r,height:c.height/r,scale:r,inner:{width:e.width,height:e.height,x:e.x,y:e.y},outer:c})},s.prototype.scroll=function(t){var e=this._viewport.node,n=e.getCTM();return t&&(t=p({dx:0,dy:0},t||{}),n=this._svg.node.createSVGMatrix().translate(t.dx,t.dy).multiply(n),c(e,n),this._fireViewboxChange()),{x:n.e,y:n.f}},s.prototype.zoom=function(t,e){if("fit-viewport"===t)return this._fitViewport(e);var n=this.viewbox();if(void 0===t)return n.scale;var r=n.outer;"auto"===e&&(e={x:r.width/2,y:r.height/2});var o=this._setZoom(t,e);return this._fireViewboxChange(),i(o.a,1e3)},s.prototype._fitViewport=function(t){var e,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!t?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(e=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(t?o.width/2-r.width/e/2:0),y:o.y+(t?o.height/2-r.height/e/2:0),width:r.width/e,height:r.height/e}),this.viewbox(n),this.viewbox().scale},s.prototype._setZoom=function(t,e){var n,i,r,o,a,s=this._svg.node,u=this._viewport.node,l=s.createSVGMatrix(),h=s.createSVGPoint();r=u.getCTM();var f=r.a;return e?(n=p(h,e),i=n.matrixTransform(r.inverse()),o=l.translate(i.x,i.y).scale(1/f*t).translate(-i.x,-i.y),a=r.multiply(o)):a=l.scale(t),c(this._viewport.node,a),a},s.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},s.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();if(t.waypoints){var i=this.getGraphics(t),r=i.getBBox(!0);e=i.getBBox(),e.x-=r.x,e.y-=r.y,e.width+=2*r.x,e.height+=2*r.y}else e=t;var o=e.x*n.scale-n.x*n.scale,a=e.y*n.scale-n.y*n.scale,s=e.width*n.scale,c=e.height*n.scale;return{x:o,y:a,width:s,height:c}}},{175:175,188:188,204:204,319:319,325:325}],79:[function(t,e,n){"use strict";function i(){this._uid=12}var r=t(168);e.exports=i,i.prototype.createRoot=function(t){return this.create("root",t)},i.prototype.createLabel=function(t){return this.create("label",t)},i.prototype.createShape=function(t){return this.create("shape",t)},i.prototype.createConnection=function(t){return this.create("connection",t)},i.prototype.create=function(t,e){return e=e||{},e.id||(e.id=t+"_"+this._uid++),r.create(t,e)}},{168:168}],80:[function(t,e,n){"use strict";function i(){this._elements={}}var r="data-element-id";e.exports=i,i.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),e.attr(r,i),n&&n.attr(r,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},i.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(i.gfx.attr(r,null),i.secondaryGfx&&i.secondaryGfx.attr(r,null),delete e[n])},i.prototype.updateId=function(t,e){this._validateId(e),"string"==typeof t&&(t=this.get(t));var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},i.prototype.get=function(t){var e;e="string"==typeof t?t:t&&t.attr(r);var n=this._elements[e];return n&&n.element},i.prototype.filter=function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(n)}),e},i.prototype.forEach=function(t){var e=this._elements;Object.keys(e).forEach(function(n){var i=e[n],r=i.element,o=i.gfx;return t(r,o)})},i.prototype.getGraphics=function(t,e){var n=t.id||t,i=this._elements[n];return i&&(e?i.secondaryGfx:i.gfx)},i.prototype._validateId=function(t){if(!t)throw new Error("element must have an id");if(this._elements[t])throw new Error("element with id "+t+" already added")}},{}],81:[function(t,e,n){"use strict";function i(){this._listeners={};var t=this;this.on("diagram.destroy",1,function(){t._listeners=null})}function r(){}var o=t(317),a=t(316),s=t(319),c=t(325),u=1e3;e.exports=i,i.prototype.on=function(t,e,n){if(t=a(t)?t:[t],o(e)&&(n=e,e=u),!s(e))throw new Error("priority must be a number");var i=this,r={priority:e,callback:n};t.forEach(function(t){i._addListener(t,r)})},i.prototype.once=function(t,e){function n(){e.apply(i,arguments),i.off(t,n)}var i=this;this.on(t,n)},i.prototype.off=function(t,e){var n,i,r=this._getListeners(t);if(e)for(i=r.length-1;n=r[i];i--)n.callback===e&&r.splice(i,1);else r.length=0},i.prototype.fire=function(t,e){var n,i,o,a,s,c,u;if(u=Array.prototype.slice.call(arguments),"object"==typeof t&&(n=t,t=n.type),!t)throw new Error("no event type specified");if(o=this._listeners[t]){e instanceof r?n=e:(n=new r,n.init(e)),u[0]=n,i=n.type;try{for(t!==i&&(n.type=t),a=0;(s=o[a])&&!n.cancelBubble;a++)try{c=n.returnValue=s.callback.apply(null,u),void 0!==c&&n.stopPropagation(),c===!1&&n.preventDefault()}catch(p){if(!this.handleError(p))throw console.error("unhandled error in event listener"),console.error(p.stack),p}}finally{t!==i&&(n.type=i)}return void 0===c&&n.defaultPrevented&&(c=!1),c}},i.prototype.handleError=function(t){return this.fire("error",{error:t})===!1},i.prototype._addListener=function(t,e){var n,i,r=this._getListeners(t);for(i=0;n=r[i];i++)if(n.priority<e.priority)return void r.splice(i,0,e);r.push(e)},i.prototype._getListeners=function(t){var e=this._listeners[t];return e||(this._listeners[t]=e=[]),e},e.exports.Event=r,r.prototype.stopPropagation=function(){this.cancelBubble=!0},r.prototype.preventDefault=function(){this.defaultPrevented=!0},r.prototype.init=function(t){c(this,t||{})}},{316:316,317:317,319:319,325:325}],82:[function(t,e,n){"use strict";function i(t,e){this._renderer=t,this._elementRegistry=e}var r=t(204),o=t(208),a=t(180),s=t(340);i.$inject=["renderer","elementRegistry"],e.exports=i,i.prototype._getChildren=function(t){var e,n=this._elementRegistry.getGraphics(t);return t.parent?(e=a.getChildren(n),e||(e=n.parent().group().attr("class","djs-children"))):e=n,e},i.prototype._clear=function(t){var e=a.getVisual(t);return s(e.node),e},i.prototype._createContainer=function(t,e){var n=e.group().attr("class","djs-group"),i=n.group().attr("class","djs-element djs-"+t);return i.group().attr("class","djs-visual"),i},i.prototype.create=function(t,e){var n=this._getChildren(e.parent);return this._createContainer(t,n)},i.prototype.updateContainments=function(t){var e,n=this,i=this._elementRegistry;e=o(t,function(t,e){return e.parent&&(t[e.parent.id]=e.parent),t},{}),r(e,function(t){var e=n._getChildren(t),o=t.children;o&&r(o.slice().reverse(),function(t){var n=i.getGraphics(t);n.parent().prependTo(e)})})},i.prototype.update=function(t,e,n){if(e.parent){var i=this._clear(n);if("shape"===t)this._renderer.drawShape(i,e),n.translate(e.x,e.y);else{if("connection"!==t)throw new Error("unknown type: "+t);this._renderer.drawConnection(i,e)}n.attr("display",e.hidden?"none":"block")}},i.prototype.remove=function(t){var e=this._elementRegistry.getGraphics(t);e.parent().remove()}},{180:180,204:204,208:208,340:340}],83:[function(t,e,n){e.exports={__depends__:[t(86)],__init__:["canvas"],canvas:["type",t(78)],elementRegistry:["type",t(80)],elementFactory:["type",t(79)],eventBus:["type",t(81)],graphicsFactory:["type",t(82)]}},{78:78,79:79,80:80,81:81,82:82,86:86}],84:[function(t,e,n){"use strict";function i(t){this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}function r(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function o(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function a(t,e){return c.create("polyline",{points:o(t)}).attr(e||{})}function s(t,e){return t.attr({points:o(e)})}var c=t(188);e.exports=i,i.$inject=["styles"],i.prototype.drawShape=function(t,e){return t.rect(0,0,e.width||0,e.height||0).attr(this.SHAPE_STYLE)},i.prototype.drawConnection=function(t,e){return a(e.waypoints,this.CONNECTION_STYLE).appendTo(t)},i.prototype.getShapePath=function(t){var e=t.x,n=t.y,i=t.width,o=t.height,a=[["M",e,n],["l",i,0],["l",0,o],["l",-i,0],["z"]];return r(a)},i.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,o=[];for(e=0;n=i[e];e++)n=n.original||n,o.push([0===e?"M":"L",n.x,n.y]);return r(o)},e.exports.createLine=a,e.exports.updateLine=s},{188:188}],85:[function(t,e,n){"use strict";function i(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}};this.cls=function(t,e,n){var i=this.style(e,n);return o(i,{"class":t})},this.style=function(e,n){r(e)||n||(n=e,e=[]);var i=a(e,function(e,n){return o(e,t[n]||{})},{});return n?o(i,n):i}}var r=t(316),o=t(325),a=t(208);e.exports=i},{208:208,316:316,325:325}],86:[function(t,e,n){e.exports={renderer:["type",t(84)],styles:["type",t(85)]}},{84:84,85:85}],87:[function(t,e,n){"use strict";function i(t,e,n,i,d,m,y){function v(t){d.update("connection",t.connection,t.connectionGfx)}function g(t){return t.filter(function(e,n){return!r.pointsOnLine(t[n-1],t[n+1],e)})}var x;try{x=t.get("connectionDocking")}catch(b){}this.start=function(t,e,r,o){var a,s,c=e.waypoints,u=n.getGraphics(e);a=o||0!==r?o||r!==c.length-1?p:h:l,s={connection:e,bendpointIndex:r,insert:o,type:a},i.activate(t,"bendpoint.move",{data:{connection:e,connectionGfx:u,context:s}})},e.on("bendpoint.move.start",function(t){var e=t.context,i=e.connection,r=i.waypoints,a=r.slice(),s=e.insert,c=e.bendpointIndex;e.originalWaypoints=r,s&&a.splice(c,0,null),i.waypoints=a,e.draggerGfx=o.addBendpoint(n.getLayer("overlays")),e.draggerGfx.addClass("djs-dragging"),n.addMarker(i,u)}),e.on("bendpoint.move.hover",function(t){t.context.hover=t.hover,n.addMarker(t.hover,c)}),e.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(t){var e=t.context.hover;e&&(n.removeMarker(e,c),n.removeMarker(e,t.context.target?a:s))}),e.on("bendpoint.move.move",function(t){var e,i,r=t.context,o=r.type,c=t.connection;c.waypoints[r.bendpointIndex]={x:t.x,y:t.y},x&&(r.hover&&(o===l&&(e=r.hover),o===h&&(i=r.hover)),c.waypoints=x.getCroppedWaypoints(c,e,i));var u=r.allowed=m.allowed(r.type,r);u?r.hover&&(n.removeMarker(r.hover,s),n.addMarker(r.hover,a),r.target=r.hover):u===!1&&r.hover&&(n.removeMarker(r.hover,a),n.addMarker(r.hover,s),r.target=null),r.draggerGfx.translate(t.x,t.y),v(t)}),e.on(["bendpoint.move.end","bendpoint.move.cancel"],function(t){var e=t.context,i=e.connection;e.draggerGfx.remove(),e.newWaypoints=i.waypoints.slice(),i.waypoints=e.originalWaypoints,n.removeMarker(i,u)}),e.on("bendpoint.move.end",function(t){var e=t.context,n=e.newWaypoints,i=e.bendpointIndex,r=n[i],o=e.allowed;if(r.x=f(r.x),r.y=f(r.y),o===!0&&e.type===l)y.reconnectStart(e.connection,e.target,r);else if(o===!0&&e.type===h)y.reconnectEnd(e.connection,e.target,r);else{if(o===!1||e.type!==p)return v(t),!1;y.updateWaypoints(e.connection,g(n))}}),e.on("bendpoint.move.cancel",function(t){v(t)})}var r=t(179),o=t(90),a="connect-ok",s="connect-not-ok",c="connect-hover",u="djs-updating",p="connection.updateWaypoints",l="connection.reconnectStart",h="connection.reconnectEnd",f=Math.round;i.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","rules","modeling"],e.exports=i},{179:179,90:90}],88:[function(t,e,n){"use strict";function i(t){function e(t,e){return s.snapTo(t,e)}function n(t){return o(t,["x","y"])}function i(t){return t.width?{x:c(t.width/2+t.x),y:c(t.height/2+t.y)}:void 0}function u(t){var e=t.snapPoints,n=t.connection.waypoints,i=t.bendpointIndex,r=[n[i-1],n[i+1]];return e||(t.snapPoints=e={horizontal:[],vertical:[]},a(r,function(t){t&&(t=t.original||t,e.horizontal.push(t.y),e.vertical.push(t.x))})),e}t.on("bendpoint.move.start",function(t){t.context.snapStart=n(t)}),t.on("bendpoint.move.move",1500,function(t){var n,o,a=t.context,s=u(a),c=a.snapStart,p=a.target,l=p&&i(p),h=c.x+t.dx,f=c.y+t.dy;if(s){n=e(l?s.vertical.concat([l.x]):s.vertical,h),o=e(l?s.horizontal.concat([l.y]):s.horizontal,f);var d=h-n,m=f-o;r(t,{dx:t.dx-d,dy:t.dy-m,x:t.x-d,y:t.y-m})}})}var r=t(325),o=t(330),a=t(204),s=t(188),c=Math.round;i.$inject=["eventBus"],e.exports=i},{188:188,204:204,325:325,330:330}],89:[function(t,e,n){"use strict";function i(t,e,n,i,s){function c(t,e){var i=o.toCanvasCoordinates(n,e);return o.getApproxIntersection(t,i)}function u(t,e){var n=e.waypoints,i=c(n,t);i&&s.start(t,e,i.index,!i.bendpoint)}function p(t,e){var i=n.getLayer("overlays"),o=i.select(".djs-bendpoints[data-element-id="+t.id+"]");return!o&&e&&(o=i.group().addClass("djs-bendpoints").attr("data-element-id",t.id),r.bind(o.node,"mousedown",function(e){u(e,t)})),o}function l(t,e){e.waypoints.forEach(function(e,n){o.addBendpoint(t).translate(e.x,e.y)}),o.addBendpoint(t).addClass("floating")}function h(t){t.selectAll("."+a).forEach(function(t){t.remove()})}function f(t){var e=p(t);return e||(e=p(t,!0),l(e,t)),e}function d(t){var e=p(t);e&&(h(e),l(e,t))}e.on("connection.changed",function(t){d(t.element)}),e.on("connection.remove",function(t){var e=p(t.element);e&&e.remove()}),e.on("element.marker.update",function(t){var e,n=t.element;n.waypoints&&(e=f(n),e[t.add?"addClass":"removeClass"](t.marker))}),e.on("element.mousemove",function(t){var e,n,i,r=t.element,o=r.waypoints;if(o){if(e=p(r,!0),n=e.select(".floating"),!n)return;i=c(o,t.originalEvent),i&&n.translate(i.point.x,i.point.y)}}),e.on("element.mousedown",function(t){var e=t.originalEvent,n=t.element,i=n.waypoints;i&&u(e,n,i)}),e.on("selection.changed",function(t){var e=t.newSelection,n=e[0];n&&n.waypoints&&f(n)}),e.on("element.hover",function(t){var e=t.element;e.waypoints&&(f(e),i.registerEvent(t.gfx.node,"mousemove","element.mousemove"))}),e.on("element.out",function(t){i.unregisterEvent(t.gfx.node,"mousemove","element.mousemove")})}var r=t(344),o=t(90),a=o.BENDPOINT_CLS;i.$inject=["injector","eventBus","canvas","interactionEvents","bendpointMove"],e.exports=i},{344:344,90:90}],90:[function(t,e,n){"use strict";function i(t,e){var n=t.x,i=t.y;return[["M",n,i],["m",0,-e],["a",e,e,0,1,1,0,2*e],["a",e,e,0,1,1,0,-2*e],["z"]]}function r(t){var e=[];return t.forEach(function(t,n){e.push([0===n?"M":"L",t.x,t.y])}),e}function o(t,e){var n,i;for(n=0;i=t[n];n++)if(u.distance(i,e)<=l)return{point:t[n],bendpoint:!0,index:n};return null}function a(t,e){var n,o=s.path.intersection(i(e,l),r(t)),a=o[0],c=o[o.length-1];return a?a!==c?a.segment2!==c.segment2?(n=Math.max(a.segment2,c.segment2)-1,{point:t[n],bendpoint:!0,index:n}):{point:{x:Math.round(a.x+c.x)/2,y:Math.round(a.y+c.y)/2},index:a.segment2}:{point:{x:Math.round(a.x),y:Math.round(a.y)},index:a.segment2}:null}var s=t(188),c=t(178),u=t(179),p=e.exports.BENDPOINT_CLS="djs-bendpoint";e.exports.toCanvasCoordinates=function(t,e){var n,i=c.toPoint(e),r=t._container.getBoundingClientRect();n={x:r.left,y:r.top};var o=t.viewbox();return{x:o.x+(i.x-n.x)/o.scale,y:o.y+(i.y-n.y)/o.scale}},e.exports.addBendpoint=function(t){var e=t.group().addClass(p);return e.circle(0,0,4).addClass("djs-visual"),e.circle(0,0,10).addClass("djs-hit"),e};var l=10;e.exports.getApproxIntersection=function(t,e){return o(t,e)||a(t,e)}},{178:178,179:179,188:188}],91:[function(t,e,n){e.exports={__depends__:[t(101),t(147)],__init__:["bendpoints","bendpointSnapping"],bendpoints:["type",t(89)],bendpointMove:["type",t(87)],bendpointSnapping:["type",t(88)]}},{101:101,147:147,87:87,88:88,89:89}],92:[function(t,e,n){"use strict";function i(t,e,n){t.on("element.changed",function(n){var i=n.element;n.gfx||(n.gfx=e.getGraphics(i)),n.gfx&&(i.waypoints?t.fire("connection.changed",n):t.fire("shape.changed",n))}),t.on("elements.changed",function(e){var i=e.elements;i.forEach(function(e){t.fire("element.changed",{element:e})}),n.updateContainments(i)}),t.on("shape.changed",function(t){n.update("shape",t.element,t.gfx)}),t.on("connection.changed",function(t){n.update("connection",t.element,t.gfx)})}i.$inject=["eventBus","elementRegistry","graphicsFactory"],e.exports=i},{}],93:[function(t,e,n){e.exports={__init__:["changeSupport"],changeSupport:["type",t(92)]}},{92:92}],94:[function(t,e,n){"use strict";function i(t,e,n,i,s,c){function u(t,e){return i.allowed("connection.create",{source:t,target:e})}function p(t,e,n,i){var o=c.getShapePath(n),a=i&&c.getShapePath(i),s=c.getConnectionPath({waypoints:[t,e]});return t=r.getElementLineIntersection(o,s,!0)||t,e=i&&r.getElementLineIntersection(a,s,!1)||e,[t,e]}t.on("connect.move",function(t){var e,n,i,o=t.context,a=o.source,s=o.target,c=o.visual;e=r.getMidPoint(a),n={x:t.x,y:t.y},i=p(e,n,a,s),c.attr("points",[i[0].x,i[0].y,i[1].x,i[1].y])}),t.on("connect.hover",function(t){var e,n=t.context,i=n.source,r=t.hover;e=n.canExecute=u(i,r),null!==e&&(n.target=r,s.addMarker(r,e?o:a))}),t.on(["connect.out","connect.cleanup"],function(t){var e=t.context;e.target&&s.removeMarker(e.target,e.canExecute?o:a),e.target=null}),t.on("connect.cleanup",function(t){var e=t.context;e.visual&&e.visual.remove()}),t.on("connect.start",function(t){var e,n=t.context;e=s.getDefaultLayer().polyline().attr({stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),n.visual=e}),t.on("connect.end",function(t){var e=t.context,i=e.source,r=e.target,o=e.canExecute||u(i,r);return o?void n.connect(i,r):!1}),this.start=function(t,n,i){e.activate(t,"connect",{autoActivate:i,data:{shape:n,context:{source:n}}})}}var r=t(166),o="connect-ok",a="connect-not-ok";i.$inject=["eventBus","dragging","modeling","rules","canvas","renderer"],e.exports=i},{166:166}],95:[function(t,e,n){e.exports={__depends__:[t(151),t(147),t(101)],connect:["type",t(94)]}},{101:101,147:147,151:151,94:94}],96:[function(t,e,n){"use strict";function i(t,e){this._providers=[],this._eventBus=t,this._overlays=e,this._current=null,this._init()}var r=t(317),o=t(204),a=t(342),s=t(340),c=t(344),u=t(338),p=t(346),l=t(339),h=t(343),f=".entry";i.$inject=["eventBus","overlays"],i.prototype._init=function(){var t=this._eventBus,e=this;t.on("selection.changed",function(t){var n=t.newSelection;1===n.length?e.open(n[0]):e.close()})},i.prototype.registerProvider=function(t){this._providers.push(t)},i.prototype.getEntries=function(t){var e={};return o(this._providers,function(n){var i=n.getContextPadEntries(t);o(i,function(t,n){e[n]=t})}),e},i.prototype.trigger=function(t,e,n){var i,o,a,s=this._current,c=s.element,p=s.entries,l=e.delegateTarget||e.target;if(!l)return e.preventDefault();if(i=p[u(l,"data-action")],o=i.action,a=e.originalEvent||e,r(o)){if("click"===t)return o(a,c,n)}else if(o[t])return o[t](a,c,n);e.preventDefault()},i.prototype.open=function(t){if(this._current&&this._current.open){if(this._current.element===t)return;this.close()}this._updateAndOpen(t)},i.prototype._updateAndOpen=function(t){var e=this.getEntries(t),n=this.getPad(t),i=n.html;s(i),o(e,function(t,e){var n,r=t.group||"default",o=h(t.html||'<div class="entry" draggable="true"></div>');u(o,"data-action",e),n=p("[data-group="+r+"]",i),n||(n=h('<div class="group" data-group="'+r+'"></div>'),i.appendChild(n)),n.appendChild(o),t.className&&l(o).add(t.className),t.title&&u(o,"title",t.title),t.imageUrl&&o.appendChild(h('<img src="'+t.imageUrl+'">'))}),l(i).add("open"),this._current={element:t,pad:n,entries:e,open:!0},this._eventBus.fire("contextPad.open",{current:this._current})},i.prototype.getPad=function(t){var e=this,n=this._overlays,i=n.get({element:t,type:"context-pad"});if(!i.length){var r=h('<div class="djs-context-pad"></div>');a.bind(r,f,"click",function(t){e.trigger("click",t)}),a.bind(r,f,"dragstart",function(t){e.trigger("dragstart",t)}),c.bind(r,"mousedown",function(t){t.stopPropagation()}),n.add(t,"context-pad",{position:{right:-9,top:-6},html:r}),i=n.get({element:t,type:"context-pad"}),this._eventBus.fire("contextPad.create",{element:t,pad:i[0]})}return i[0]},i.prototype.close=function(){var t;this._current&&(this._current.open&&(t=this._current.pad.html,l(t).remove("open")),this._current.open=!1,this._eventBus.fire("contextPad.close",{current:this._current}))},i.prototype.isOpen=function(){return this._current&&this._current.open},e.exports=i},{204:204,317:317,338:338,339:339,340:340,342:342,343:343,344:344,346:346}],97:[function(t,e,n){e.exports={__depends__:[t(103),t(135)],contextPad:["type",t(96)]}},{103:103,135:135,96:96}],98:[function(t,e,n){"use strict";function i(t,e,n,i,a,s,c,u){function p(t,e,i){return i?n.allowed("shape.append",{source:i,shape:t,parent:e}):n.allowed("shape.create",{shape:t,parent:e})}function l(t){var e,n,i;return e=a.getDefaultLayer().group().attr(u.cls("djs-drag-group",["no-events"])),n=e.group().addClass("djs-dragger"),n.translate(t.width/-2,t.height/-2),i=n.group().addClass("djs-visual"),c.drawShape(i,t),e}t.on("create.move",function(t){var e=t.context,n=e.shape,i=e.visual;i||(i=e.visual=l(n)),i.translate(t.x,t.y);var s,c=t.hover;s=e.canExecute=c&&p(e.shape,c,e.source),c&&null!==s&&(e.target=c,a.addMarker(c,s?r:o))}),t.on(["create.end","create.out","create.cleanup"],function(t){var e=t.context;e.target&&a.removeMarker(e.target,e.canExecute?r:o)}),t.on("create.end",function(t){var e=t.context,n=e.source,r=e.shape,o=e.target,a=e.canExecute,s={x:t.x,y:t.y};return a?void(n?i.appendShape(n,r,s,o):i.createShape(r,s,o)):!1}),t.on("create.cleanup",function(t){var e=t.context;e.visual&&e.visual.remove()}),this.start=function(t,n,i){e.activate(t,"create",{cursor:"grabbing",autoActivate:!0,data:{shape:n,context:{shape:n,source:i}}})}}var r="drop-ok",o="drop-not-ok";i.$inject=["eventBus","dragging","rules","modeling","canvas","elementFactory","renderer","styles"],e.exports=i},{}],99:[function(t,e,n){e.exports={__depends__:[t(101),t(151)],create:["type",t(98)]}},{101:101,151:151,98:98}],100:[function(t,e,n){"use strict";function i(t){t instanceof MouseEvent?u.stopEvent(t,!0):u.preventDefault(t)}function r(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function o(t,e){return{x:t.x-e.x,y:t.y-e.y}}function a(e,n,a){function h(n){var i=t(81).Event,r=s(new i,_.payload,_.data);return e.fire("drag."+n,r)===!1?!1:e.fire(_.prefix+"."+n,r)}function f(t,e){var c,p=_.payload,f=_.start,d=u.toPoint(t),m=o(d,f),y=n._container.getBoundingClientRect();c={x:y.left,y:y.top};var v=n.viewbox(),g={x:v.x+(d.x-c.x)/v.scale,y:v.y+(d.y-c.y)/v.scale,dx:m.x/v.scale,dy:m.y/v.scale};if(!_.active&&(e||r(m)>_.threshold)){if(s(p,{x:g.x-g.dx,y:g.y-g.dy,dx:0,dy:0},{originalEvent:t}),!1===h("start"))return b();_.active=!0,_.keepSelection||(_.previousSelection=a.get(),a.select(null)),_.cursor&&l.set(_.cursor)}i(t),_.active&&(s(p,g,{originalEvent:t}),h("move"))}function d(t){var e=!0;_.active&&(t&&(_.payload.originalEvent=t,i(t)),e=h("end")),e===!1&&h("rejected"),w(e!==!0)}function m(t){27===t.which&&(t.preventDefault(),b())}function y(t){var e;_.active&&(e=p.install(),setTimeout(e,400)),d(t)}function v(t){f(t)}function g(t){var e=_.payload;e.hoverGfx=t.gfx,e.hover=t.element,h("hover")}function x(t){h("out");var e=_.payload;e.hoverGfx=null,e.hover=null}function b(t){_&&(_.active&&h("cancel"),w(t))}function w(t){h("cleanup"),l.unset(),c.unbind(document,"mousemove",f),c.unbind(document,"mousedown",y,!0),c.unbind(document,"mouseup",y,!0),
+c.unbind(document,"keyup",m),c.unbind(document,"touchstart",v,!0),c.unbind(document,"touchcancel",b,!0),c.unbind(document,"touchmove",f,!0),c.unbind(document,"touchend",d,!0),e.off("element.hover",g),e.off("element.out",x),t!==!1&&_.previousSelection&&!a.get().length&&a.select(_.previousSelection),_=null}function E(t,n,r){_&&b(!1),r=s({},S,r||{});var o,a,p=r.data||{};t?(o=u.getOriginal(t)||t,a=u.toPoint(t),i(t)):(o=null,a={x:0,y:0}),_=s({prefix:n,data:p,payload:{},start:a},r),r.manual||("undefined"!=typeof TouchEvent&&o instanceof TouchEvent?(c.bind(document,"touchstart",v,!0),c.bind(document,"touchcancel",b,!0),c.bind(document,"touchmove",f,!0),c.bind(document,"touchend",d,!0)):(c.bind(document,"mousemove",f),c.bind(document,"mousedown",y,!0),c.bind(document,"mouseup",y,!0)),c.bind(document,"keyup",m),e.on("element.hover",g),e.on("element.out",x)),h("activate"),r.autoActivate&&f(t,!0)}var _,S={threshold:5};e.on("diagram.destroy",b),this.activate=E,this.move=f,this.hover=g,this.out=x,this.end=d,this.cancel=b,this.active=function(){return _},this.setOptions=function(t){s(S,t)}}var s=t(325),c=t(344),u=t(178),p=t(174),l=t(176);a.$inject=["eventBus","canvas","selection"],e.exports=a},{174:174,176:176,178:178,325:325,344:344,81:81}],101:[function(t,e,n){e.exports={__depends__:[t(151)],dragging:["type",t(100)]}},{100:100,151:151}],102:[function(t,e,n){"use strict";function i(t,e,n){function i(n,i){var r,o=i.delegateTarget||i.target,a=o&&new p(o),s=e.get(a);a&&s&&(r=t.fire(n,{element:s,gfx:a,originalEvent:i}),r===!1&&(i.stopPropagation(),i.preventDefault()))}function a(t){var e=y[t];return e||(e=y[t]=function(e){u(e)&&i(t,e)}),e}function l(t,e,n){var i=a(n);i.$delegate=o.bind(t,g,e,i)}function h(t,e,n){o.unbind(t,e,a(n).$delegate)}function f(t){r(v,function(e,n){l(t.node,n,e)})}function d(t){r(v,function(e,n){h(t.node,n,e)})}var m=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15}),y={},v={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup"},g="svg, .djs-element";t.on("canvas.destroy",function(t){d(t.svg)}),t.on("canvas.init",function(t){f(t.svg)}),t.on(["shape.added","connection.added"],function(t){var e,n,i=t.element,r=t.gfx;i.waypoints?(e=s(i.waypoints),n="connection"):(e=p.create("rect",{x:0,y:0,width:i.width,height:i.height}),n="shape"),e.attr(m).appendTo(r.node)}),t.on("shape.changed",function(t){var e=t.element,n=t.gfx,i=n.select(".djs-hit");i.attr({width:e.width,height:e.height})}),t.on("connection.changed",function(t){var e=t.element,n=t.gfx,i=n.select(".djs-hit");c(i,e.waypoints)}),this.fire=i,this.mouseHandler=a,this.registerEvent=l,this.unregisterEvent=h}var r=t(204),o=t(342),a=t(84),s=a.createLine,c=a.updateLine,u=t(182).isPrimaryButton,p=t(188);i.$inject=["eventBus","elementRegistry","styles"],e.exports=i},{182:182,188:188,204:204,342:342,84:84}],103:[function(t,e,n){e.exports={__init__:["interactionEvents"],interactionEvents:["type",t(102)]}},{102:102}],104:[function(t,e,n){"use strict";function i(t,e,n,i,r){var o=this;this._commandStack=n,this._modeling=i,this._selection=r,this._eventBus=e,this._listeners=[],this._keyHandler=function(t){var e,n,i=t.target,r=o._listeners,a=t.keyCode||t.charCode||-1;if(!c(i,"input, textarea"))for(e=0;n=r[e];e++)n(a,t)&&t.stopPropagation()},e.on("diagram.destroy",function(){o._fire("destroy"),o.unbind(),o._listeners=null}),e.on("diagram.init",function(){o._fire("init"),t&&t.bindTo&&o.bind(t.bindTo)}),this._init()}function r(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function o(t){return t.ctrlKey||t.metaKey}function a(t){return t.shiftKey}var s=t(344),c=t(345);i.$inject=["config.keyboard","eventBus","commandStack","modeling","selection"],e.exports=i,i.prototype.bind=function(t){this._node=t,s.bind(t,"keydown",this._keyHandler,!0),this._fire("bind")},i.prototype.getBinding=function(){return this._node},i.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),s.unbind(t,"keydown",this._keyHandler,!0)),this._node=null},i.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node,listeners:this._listeners})},i.prototype._init=function(){function t(t,e){return o(e)&&!a(e)&&90===t?(r.undo(),!0):void 0}function e(t,e){return o(e)&&(89===t||90===t&&a(e))?(r.redo(),!0):void 0}function n(t,e){if(46===t){var n=c.get();return n.length&&s.removeElements(n.slice()),!0}}var i=this._listeners,r=this._commandStack,s=this._modeling,c=this._selection;i.push(t),i.push(e),i.push(n)},i.prototype.addListener=function(t){this._listeners.push(t)},i.prototype.hasModifier=r,i.prototype.isCmd=o,i.prototype.isShift=a},{344:344,345:345}],105:[function(t,e,n){e.exports={__init__:["keyboard"],keyboard:["type",t(104)]}},{104:104}],106:[function(t,e,n){"use strict";function i(t,e,n,i,o){this._selection=o,this._dragging=n;var a=this,u={create:function(t){var n,i=e.getDefaultLayer();n=t.frame=c.create("rect",{"class":"djs-lasso-overlay",width:1,height:1,x:0,y:0}),n.appendTo(i)},update:function(t){var e=t.frame,n=t.bbox;e.attr({x:n.x,y:n.y,width:n.width,height:n.height})},remove:function(t){t.frame&&t.frame.remove()}};t.on("lasso.selection.end",function(t){setTimeout(function(){a.activateLasso(t.originalEvent,!0)})}),t.on("lasso.end",function(t){var e=r(t),n=i.filter(function(t){return t});a.select(n,e)}),t.on("lasso.start",function(t){var e=t.context;e.bbox=r(t),u.create(e)}),t.on("lasso.move",function(t){var e=t.context;e.bbox=r(t),u.update(e)}),t.on("lasso.end",function(t){var e=t.context;u.remove(e)}),t.on("lasso.cleanup",function(t){var e=t.context;u.remove(e)}),t.on("element.mousedown",1500,function(t){s(t)&&(a.activateLasso(t.originalEvent),t.stopPropagation())})}function r(t){var e,n={x:t.x-t.dx,y:t.y-t.dy},i={x:t.x,y:t.y};return e=n.x<=i.x&&n.y<i.y||n.x<i.x&&n.y<=i.y?{x:n.x,y:n.y,width:i.x-n.x,height:i.y-n.y}:n.x>=i.x&&n.y<i.y||n.x>i.x&&n.y<=i.y?{x:i.x,y:n.y,width:n.x-i.x,height:i.y-n.y}:n.x<=i.x&&n.y>i.y||n.x<i.x&&n.y>=i.y?{x:n.x,y:i.y,width:i.x-n.x,height:n.y-i.y}:n.x>=i.x&&n.y>i.y||n.x>i.x&&n.y>=i.y?{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}:{x:i.x,y:i.y,width:0,height:0}}var o=t(331),a=t(177).getEnclosedElements,s=t(182).hasPrimaryModifier,c=t(188);i.$inject=["eventBus","canvas","dragging","elementRegistry","selection"],e.exports=i,i.prototype.activateLasso=function(t,e){this._dragging.activate(t,"lasso",{autoActivate:e,cursor:"crosshair",data:{context:{}}})},i.prototype.activateSelection=function(t){this._dragging.activate(t,"lasso.selection",{cursor:"crosshair"})},i.prototype.select=function(t,e){var n=a(t,e);this._selection.select(o(n))}},{177:177,182:182,188:188,331:331}],107:[function(t,e,n){"use strict";e.exports={__init__:["lassoTool"],lassoTool:["type",t(106)]}},{106:106}],108:[function(t,e,n){"use strict";function i(t,e,n){this._eventBus=t,this._elementFactory=e,this._commandStack=n;var i=this;t.on("diagram.init",function(){i.registerHandlers(n)})}var r=t(204),o=t(168);i.$inject=["eventBus","elementFactory","commandStack"],e.exports=i,i.prototype.getHandlers=function(){return{"shape.append":t(109),"shape.create":t(112),"shape.delete":t(115),"shape.move":t(118),"shapes.move":t(119),"shape.resize":t(123),"shape.replace":t(122),spaceTool:t(124),"label.create":t(111),"connection.create":t(110),"connection.delete":t(113),"connection.move":t(117),"connection.layout":t(116),"connection.updateWaypoints":t(126),"connection.reconnectStart":t(121),"connection.reconnectEnd":t(121),"elements.delete":t(114),"element.updateAnchors":t(125)}},i.prototype.registerHandlers=function(t){r(this.getHandlers(),function(e,n){t.registerHandler(n,e)})},i.prototype.moveShape=function(t,e,n,i){var r={shape:t,delta:e,newParent:n,hints:i||{}};this._commandStack.execute("shape.move",r)},i.prototype.moveShapes=function(t,e,n,i){var r={shapes:t,delta:e,newParent:n,hints:i||{}};this._commandStack.execute("shapes.move",r)},i.prototype.updateAnchors=function(t,e){var n={element:t,delta:e};this._commandStack.execute("element.updateAnchors",n)},i.prototype.moveConnection=function(t,e,n,i){var r={connection:t,delta:e,newParent:n,hints:i||{}};this._commandStack.execute("connection.move",r)},i.prototype.layoutConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.layout",n)},i.prototype.createConnection=function(t,e,n,i){n=this._create("connection",n);var r={source:t,target:e,parent:i,connection:n};return this._commandStack.execute("connection.create",r),r.connection},i.prototype.createShape=function(t,e,n){t=this._create("shape",t);var i={position:e,parent:n,shape:t};return this._commandStack.execute("shape.create",i),i.shape},i.prototype.createLabel=function(t,e,n,i){n=this._create("label",n);var r={labelTarget:t,position:e,parent:i,shape:n};return this._commandStack.execute("label.create",r),r.shape},i.prototype.appendShape=function(t,e,n,i,r,o){e=this._create("shape",e);var a={source:t,position:n,parent:i,shape:e,connection:r,connectionParent:o};return this._commandStack.execute("shape.append",a),a.shape},i.prototype.removeElements=function(t){var e={elements:t};this._commandStack.execute("elements.delete",e)},i.prototype.removeShape=function(t){var e={shape:t};this._commandStack.execute("shape.delete",e)},i.prototype.removeConnection=function(t){var e={connection:t};this._commandStack.execute("connection.delete",e)},i.prototype.replaceShape=function(t,e,n){var i={oldShape:t,newData:e,options:n};return this._commandStack.execute("shape.replace",i),i.newShape},i.prototype.resizeShape=function(t,e){var n={shape:t,newBounds:e};this._commandStack.execute("shape.resize",n)},i.prototype.createSpace=function(t,e,n,i){var r={movingShapes:t,resizingShapes:e,delta:n,direction:i};this._commandStack.execute("spaceTool",r)},i.prototype.updateWaypoints=function(t,e){var n={connection:t,newWaypoints:e};this._commandStack.execute("connection.updateWaypoints",n)},i.prototype.reconnectStart=function(t,e,n){var i={connection:t,newSource:e,dockingPoint:n};this._commandStack.execute("connection.reconnectStart",i)},i.prototype.reconnectEnd=function(t,e,n){var i={connection:t,newTarget:e,dockingPoint:n};this._commandStack.execute("connection.reconnectEnd",i)},i.prototype.connect=function(t,e,n){return this.createConnection(t,e,n||{},t.parent)},i.prototype._create=function(t,e){return e instanceof o.Base?e:this._elementFactory.create(t,e)}},{109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,121:121,122:122,123:123,124:124,125:125,126:126,168:168,204:204}],109:[function(t,e,n){"use strict";function i(t){this._modeling=t}var r=t(195);r(i,t(120)),i.$inject=["modeling"],e.exports=i,i.prototype.preExecute=function(t){if(!t.source)throw new Error("source required");var e=t.parent||t.source.parent,n=this._modeling.createShape(t.shape,t.position,e);t.shape=n},i.prototype.postExecute=function(t){var e=t.connectionParent||t.shape.parent;this._modeling.connect(t.source,t.shape,t.connection,e)}},{120:120,195:195}],110:[function(t,e,n){"use strict";function i(t,e){this._canvas=t,this._layouter=e}i.$inject=["canvas","layouter"],e.exports=i,i.prototype.execute=function(t){var e=t.source,n=t.target,i=t.parent;if(!e||!n)throw new Error("source and target required");if(!i)throw new Error("parent required");var r=t.connection;return r.source=e,r.target=n,r.waypoints||(r.waypoints=this._layouter.layoutConnection(r)),this._canvas.addConnection(r,i),r},i.prototype.revert=function(t){var e=t.connection;this._canvas.removeConnection(e),e.source=null,e.target=null}},{}],111:[function(t,e,n){"use strict";function i(t){o.call(this,t)}var r=t(195),o=t(112);r(i,o),i.$inject=["canvas"],e.exports=i,i.prototype.revert=function(t){t.shape.labelTarget=null,this._canvas.removeShape(t.shape)},i.prototype.getParent=function(t){return t.parent||t.labelTarget&&t.labelTarget.parent},i.prototype.addElement=function(t,e,n){t.labelTarget=n.labelTarget,this._canvas.addShape(t,e,!0)}},{112:112,195:195}],112:[function(t,e,n){"use strict";function i(t){this._canvas=t}var r=t(325);i.$inject=["canvas"],e.exports=i,i.prototype.execute=function(t){var e=this.getParent(t),n=t.shape;return this.setPosition(n,t),this.addElement(n,e,t),n},i.prototype.revert=function(t){this._canvas.removeShape(t.shape)},i.prototype.getParent=function(t){var e=t.parent;if(!e)throw new Error("parent required");return e},i.prototype.getPosition=function(t){if(!t.position)throw new Error("no position given");return t.position},i.prototype.addElement=function(t,e){this._canvas.addShape(t,e)},i.prototype.setPosition=function(t,e){var n=this.getPosition(e);r(t,{x:n.x-t.width/2,y:n.y-t.height/2})}},{325:325}],113:[function(t,e,n){"use strict";function i(t,e){this._canvas=t,this._modeling=e}var r=t(175);i.$inject=["canvas","modeling"],e.exports=i,i.prototype.preExecute=function(t){var e=t.connection;e.label&&this._modeling.removeShape(e.label)},i.prototype.execute=function(t){var e=t.connection,n=e.parent;t.parent=n,t.parentIndex=r.indexOf(n.children,e),t.source=e.source,t.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e.label=null},i.prototype.revert=function(t){var e=t.connection,n=t.parent,i=t.parentIndex;e.source=t.source,e.target=t.target,r.add(n.children,e,i),this._canvas.addConnection(e,n)}},{175:175}],114:[function(t,e,n){"use strict";function i(t,e){this._modeling=t,this._elementRegistry=e}var r=t(204),o=t(195);o(i,t(120)),i.$inject=["modeling","elementRegistry"],e.exports=i,i.prototype.postExecute=function(t){var e=this._modeling,n=this._elementRegistry,i=t.elements;r(i,function(t){n.get(t.id)&&(t.waypoints?e.removeConnection(t):e.removeShape(t))})}},{120:120,195:195,204:204}],115:[function(t,e,n){"use strict";function i(t,e){this._canvas=t,this._modeling=e}var r=t(175);i.$inject=["canvas","modeling"],e.exports=i,i.prototype.preExecute=function(t){var e=t.shape,n=e.label,i=this._modeling;e.labelTarget&&(t.labelTarget=e.labelTarget,e.labelTarget=null),n&&this._modeling.removeShape(n),this._saveClear(e.incoming,function(t){i.removeConnection(t)}),this._saveClear(e.outgoing,function(t){i.removeConnection(t)}),this._saveClear(e.children,function(t){i.removeShape(t)})},i.prototype._saveClear=function(t,e){for(var n;n=t[0];)e(n)},i.prototype.execute=function(t){var e=t.shape,n=e.parent;t.parent=n,t.parentIndex=r.indexOf(n.children,e),e.label=null,this._canvas.removeShape(e)},i.prototype.revert=function(t){var e=t.shape,n=t.parent,i=t.parentIndex,o=t.labelTarget;r.add(n.children,e,i),o&&(o.label=e),this._canvas.addShape(e,n)}},{175:175}],116:[function(t,e,n){"use strict";function i(t,e){this._layouter=t,this._canvas=e}function r(t){function e(t,n){var i=t.indexOf(n);if(0>i&&n){var r=n.parent;i=e(t,r)}return i}var n=t.parent.children,i=n.indexOf(t),r=e(n,t.source),o=e(n,t.target),a=Math.max(r+1,o+1,i);return a>i&&(n.splice(a,0,t),n.splice(i,1)),a}var o=t(325);i.$inject=["layouter","canvas"],e.exports=i,i.prototype.execute=function(t){var e=t.connection,n=e.parent,i=n.children,a=i.indexOf(e);return o(t,{oldWaypoints:e.waypoints,oldIndex:a}),r(e),e.waypoints=this._layouter.layoutConnection(e,t.hints),e},i.prototype.revert=function(t){var e=t.connection,n=e.parent,i=n.children,r=i.indexOf(e),o=t.oldIndex;return e.waypoints=t.oldWaypoints,o!==r&&(i.splice(r,1),i.splice(o,0,e)),e}},{325:325}],117:[function(t,e,n){"use strict";function i(){}var r=t(204),o=t(175);e.exports=i,i.prototype.execute=function(t){var e=t.hints.updateAnchors!==!1,n=t.connection,i=t.delta,a=this.getNewParent(n,t),s=n.parent;return t.oldParent=s,t.oldParentIndex=o.indexOf(s.children,n),r(n.waypoints,function(t){t.x+=i.x,t.y+=i.y,e&&t.original&&(t.original.x+=i.x,t.original.y+=i.y)}),n.parent=a,n},i.prototype.revert=function(t){var e=t.hints.updateAnchors!==!1,n=t.connection,i=t.oldParent,a=t.oldParentIndex,s=t.delta;return o.add(i.children,n,a),n.parent=i,r(n.waypoints,function(t){t.x-=s.x,t.y-=s.y,e&&t.original&&(t.original.x-=s.x,t.original.y-=s.y)}),n},i.prototype.getNewParent=function(t,e){return e.newParent||t.parent}},{175:175,204:204}],118:[function(t,e,n){"use strict";function i(t){this._modeling=t,this._helper=new a(t)}var r=t(325),o=t(204),a=t(127),s=t(175);i.$inject=["modeling"],e.exports=i,i.prototype.execute=function(t){var e=t.shape,n=t.delta,i=this.getNewParent(t),o=e.parent;return t.oldParent=o,t.oldParentIndex=s.indexOf(o.children,e),r(e,{parent:i,x:e.x+n.x,y:e.y+n.y}),e},i.prototype.postExecute=function(t){var e=t.shape,n=t.delta,i=this._modeling;t.hints.updateAnchors!==!1&&i.updateAnchors(e,n),t.hints.layout!==!1&&(o(e.incoming,function(t){i.layoutConnection(t,{endChanged:!0})}),o(e.outgoing,function(t){i.layoutConnection(t,{startChanged:!0})})),t.hints.recurse!==!1&&this.moveChildren(t)},i.prototype.revert=function(t){var e=t.shape,n=t.oldParent,i=t.oldParentIndex,o=t.delta;return s.add(n.children,e,i),r(e,{parent:n,x:e.x-o.x,y:e.y-o.y}),e},i.prototype.moveChildren=function(t){var e=t.delta,n=t.shape;this._helper.moveRecursive(n.children,e,null)},i.prototype.getNewParent=function(t){return t.newParent||t.shape.parent}},{127:127,175:175,204:204,325:325}],119:[function(t,e,n){"use strict";function i(t){this._helper=new r(t)}var r=t(127);i.$inject=["modeling"],e.exports=i,i.prototype.preExecute=function(t){t.closure=this._helper.getClosure(t.shapes)},i.prototype.postExecute=function(t){this._helper.moveClosure(t.closure,t.delta,t.newParent)},i.prototype.execute=function(t){},i.prototype.revert=function(t){}},{127:127}],120:[function(t,e,n){"use strict";function i(){}e.exports=i,i.prototype.execute=function(){},i.prototype.revert=function(){}},{}],121:[function(t,e,n){"use strict";function i(t){}i.$inject=["layouter"],e.exports=i,i.prototype.execute=function(t){var e=t.newSource,n=t.newTarget,i=t.connection;if(!e&&!n)throw new Error("newSource or newTarget are required");if(e&&n)throw new Error("must specify either newSource or newTarget");return e&&(t.oldSource=i.source,i.source=e,t.oldDockingPoint=i.waypoints[0],i.waypoints[0]=t.dockingPoint),n&&(t.oldTarget=i.target,i.target=n,t.oldDockingPoint=i.waypoints[i.waypoints.length-1],i.waypoints[i.waypoints.length-1]=t.dockingPoint),i},i.prototype.revert=function(t){var e=t.newSource,n=t.newTarget,i=t.connection;return e&&(i.source=t.oldSource,i.waypoints[0]=t.oldDockingPoint),n&&(i.target=t.oldTarget,i.waypoints[i.waypoints.length-1]=t.oldDockingPoint),i}},{}],122:[function(t,e,n){"use strict";function i(t,e){this._modeling=t,this._rules=e}var r=t(204);i.$inject=["modeling","rules"],e.exports=i,i.prototype.preExecute=function(t){var e,n=this._modeling,i=this._rules,o=t.oldShape,a=t.newData,s={x:a.x,y:a.y};e=t.newShape=t.newShape||n.createShape(a,s,o.parent);var c=o.incoming.slice(),u=o.outgoing.slice();r(c,function(t){var r=t.waypoints,o=r[r.length-1],a=i.allowed("connection.reconnectEnd",{source:t.source,target:e,connection:t});a&&n.reconnectEnd(t,e,o)}),r(u,function(t){var r=t.waypoints,o=r[0],a=i.allowed("connection.reconnectStart",{source:e,target:t.target,connection:t});a&&n.reconnectStart(t,e,o)})},i.prototype.postExecute=function(t){var e=this._modeling,n=t.oldShape;e.removeShape(n)},i.prototype.execute=function(t){},i.prototype.revert=function(t){}},{204:204}],123:[function(t,e,n){"use strict";function i(t){this._modeling=t}var r=t(325),o=t(204);i.$inject=["modeling"],e.exports=i,i.prototype.execute=function(t){var e=t.shape,n=t.newBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw new Error("newBounds must have {x, y, width, height} properties");if(n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return t.oldBounds={width:e.width,height:e.height,x:e.x,y:e.y},r(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e},i.prototype.postExecute=function(t){var e=t.shape,n=this._modeling;o(e.incoming,function(t){n.layoutConnection(t,{endChanged:!0})}),o(e.outgoing,function(t){n.layoutConnection(t,{startChanged:!0})})},i.prototype.revert=function(t){var e=t.shape,n=t.oldBounds;return r(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e}},{204:204,325:325}],124:[function(t,e,n){"use strict";function i(t){this._modeling=t}var r=t(204),o=t(157);i.$inject=["modeling"],e.exports=i,i.prototype.preExecute=function(t){var e=this._modeling,n=t.resizingShapes,i=t.delta,a=t.direction;r(n,function(t){var n=o.resizeBounds(t,a,i);e.resizeShape(t,n)})},i.prototype.postExecute=function(t){var e=this._modeling,n=t.movingShapes,i=t.delta;e.moveShapes(n,i)},i.prototype.execute=function(t){},i.prototype.revert=function(t){}},{157:157,204:204}],125:[function(t,e,n){"use strict";function i(){}var r=t(204),o=t(325);e.exports=i,i.prototype.execute=function(t){return this.updateAnchors(t.element,t.delta)},i.prototype.revert=function(t){var e=t.delta,n={x:-1*e.x,y:-1*e.y};return this.updateAnchors(t.element,n)},i.prototype.updateAnchors=function(t,e){function n(t,e){return{x:t.x+e.x,y:t.y+e.y}}function i(t){var i=t.original;t.original=o(i||{},n(i||t,e))}var a=[];return r(t.incoming,function(t){var e=t.waypoints;i(e[e.length-1]),a.push(t)}),r(t.outgoing,function(t){var e=t.waypoints;i(e[0]),a.push(t)}),a}},{204:204,325:325}],126:[function(t,e,n){"use strict";function i(){}e.exports=i,i.prototype.execute=function(t){var e=t.connection,n=t.newWaypoints;return t.oldWaypoints=e.waypoints,e.waypoints=n,e},i.prototype.revert=function(t){var e=t.connection,n=t.oldWaypoints;return e.waypoints=n,e}},{}],127:[function(t,e,n){"use strict";function i(t){this._modeling=t}var r=t(204),o=t(177);e.exports=i,i.prototype.moveRecursive=function(t,e,n){return this.moveClosure(this.getClosure(t),e,n)},i.prototype.moveClosure=function(t,e,n){var i=this._modeling,o=t.allShapes,a=t.allConnections,s=t.enclosedConnections,c=t.topLevel;r(o,function(t){i.moveShape(t,e,c[t.id]&&n,{recurse:!1,layout:!1})}),r(a,function(t){var r=!!o[t.source.id],a=!!o[t.target.id];s[t.id]&&r&&a?i.moveConnection(t,e,c[t.id]&&n,{updateAnchors:!1}):i.layoutConnection(t,{startChanged:r,endChanged:a})})},i.prototype.getClosure=function(t){return o.getClosure(t)}},{177:177,204:204}],128:[function(t,e,n){e.exports={__depends__:[t(77),t(93),t(147)],__init__:["modeling"],modeling:["type",t(108)],layouter:["type",t(164)]}},{108:108,147:147,164:164,77:77,93:93}],129:[function(t,e,n){"use strict";function i(t){var e=s(t,"id");return a(t,function(t){for(;t=t.parent;)if(e[t.id])return!1;return!0})}function r(t,e,n,r,a){function s(t,e,n){return a.allowed("shapes.move",{shapes:t,delta:e,newParent:n})}function h(t,n,i){!n.waypoints&&n.parent&&e.activate(t,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:{}}})}t.on("shape.move.start",u,function(t){var e=t.context,n=t.shape,a=r.get().slice();return-1===a.indexOf(n)&&(a=[n]),a=i(a),o(e,{shapes:a,shape:n}),s(a)?void 0:(t.stopPropagation(),!1)}),t.on("shape.move.move",c,function(t){var e,n=t.context,i=n.shapes,r=t.hover,o={x:t.dx,y:t.dy};return e=s(i,o,r),n.delta=o,n.canExecute=e,null===e?void(n.target=null):void(n.target=r)}),t.on("shape.move.end",function(t){var e=t.context,i=e.delta,r=e.canExecute;return r?(i.x=l(i.x),i.y=l(i.y),void n.moveShapes(e.shapes,i,e.target)):!1}),t.on("element.mousedown",function(t){var e=p(t);if(!e)throw new Error("must supply DOM mousedown event");h(e,t.element)}),this.start=h}var o=t(325),a=t(202),s=t(205),c=500,u=1500,p=t(178).getOriginal,l=Math.round;r.$inject=["eventBus","dragging","modeling","selection","rules"],e.exports=r},{178:178,202:202,205:205,325:325}],130:[function(t,e,n){"use strict";function i(t,e,n,i){function s(t){return e.getGraphics(t)}function c(t){var e=p.selfAndDirectChildren(t,!0),n=r(e);return n}function m(t){var e=p.selfAndAllChildren(t,!0),n=u(e,function(t){return(t.incoming||[]).concat(t.outgoing||[])});return o(e.concat(n),!0)}function y(t,e){var n=s(t),r=n.clone(),o=n.getBBox();r.attr(i.cls("djs-dragger",[],{x:o.x,y:o.y})),e.add(r)}t.on("shape.move.start",l,function(t){var e=t.context,r=e.shapes,o=n.getDefaultLayer().group().attr(i.cls("djs-drag-group",["no-events"])),s=c(r);s.forEach(function(t){y(t,o)});var u=e.allDraggedElements=m(r);a(u,function(t){n.addMarker(t,h)}),e.dragGroup=o}),t.on("shape.move.move",l,function(t){var e=t.context,i=e.dragGroup,r=e.target;r&&n.addMarker(r,e.canExecute?f:d),i.translate(t.dx,t.dy)}),t.on(["shape.move.out","shape.move.cleanup"],function(t){var e=t.context;e.target&&n.removeMarker(e.target,e.canExecute?f:d)}),t.on("shape.move.cleanup",function(t){var e=t.context,i=e.allDraggedElements,r=e.dragGroup;a(i,function(t){n.removeMarker(t,h)}),r&&r.remove()})}function r(t){var e=s(t,function(e){if(e.waypoints){var n=c(t,e.source),i=c(t,e.target);return n&&i}return!0});return e}var o=t(196),a=t(204),s=t(202),c=t(203),u=t(207),p=t(177),l=500,h="djs-dragging",f="drop-ok",d="drop-not-ok";i.$inject=["eventBus","elementRegistry","canvas","styles"],e.exports=i},{177:177,196:196,202:202,203:203,204:204,207:207}],131:[function(t,e,n){e.exports={__depends__:[t(103),t(151),t(133),t(147),t(101)],__init__:["move","moveVisuals"],move:["type",t(129)],moveVisuals:["type",t(130)]}},{101:101,103:103,129:129,130:130,133:133,147:147,151:151}],132:[function(t,e,n){"use strict";function i(t,e,n){function i(t,e){return r.create("rect",u).prependTo(t)}function a(t,e){t.attr({x:-c,y:-c,width:e.width+2*c,height:e.height+2*c})}function s(t,e){var n=o(e);t.attr({x:n.x-c,y:n.y-c,width:n.width+2*c,height:n.height+2*c})}var c=6,u=e.cls("djs-outline",["no-fill"]);t.on(["shape.added","shape.changed"],function(t){var e=t.element,n=t.gfx,r=n.select(".djs-outline");r||(r=i(n,e)),a(r,e)}),t.on(["connection.added","connection.changed"],function(t){var e=t.element,n=t.gfx,r=n.select(".djs-outline");r||(r=i(n,e)),s(r,e)})}var r=t(188),o=t(177).getBBox;i.$inject=["eventBus","styles","elementRegistry"],e.exports=i},{177:177,188:188}],133:[function(t,e,n){"use strict";e.exports={__init__:["outline"],outline:["type",t(132)]}},{132:132}],134:[function(t,e,n){"use strict";function i(t){var e=d('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');return t.insertBefore(e,t.firstChild),e}function r(t,e,n){p(t.style,{left:e+"px",top:n+"px"})}function o(t,e){t.style.display=e===!1?"none":""}function a(t,e,n,r){this._eventBus=e,this._canvas=n,this._elementRegistry=r,this._ids=g,this._overlayDefaults={show:{minZoom:.7,maxZoom:5}},this._overlays={},this._overlayContainers={},this._overlayRoot=i(n.getContainer()),this._init(t)}var s=t(316),c=t(322),u=t(320),p=t(325),l=t(204),h=t(202),f=t(214),d=t(343),m=t(339),y=t(347),v=t(177).getBBox,g=new(t(181))("ov");a.$inject=["config.overlays","eventBus","canvas","elementRegistry"],e.exports=a,a.prototype.get=function(t){if(c(t)&&(t={id:t}),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?h(e.overlays,{type:t.type}):e.overlays.slice():[]}return t.type?h(this._overlays,{type:t.type}):t.id?this._overlays[t.id]:null},a.prototype.add=function(t,e,n){if(u(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=p({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},a.prototype.remove=function(t){var e=this.get(t)||[];s(e)||(e=[e]);var n=this;l(e,function(t){var e=n._getOverlayContainer(t.element,!0);if(t&&(y(t.html),y(t.htmlContainer),delete t.htmlContainer,delete t.element,delete n._overlays[t.id]),e){var i=e.overlays.indexOf(t);-1!==i&&e.overlays.splice(i,1)}})},a.prototype.show=function(){o(this._overlayRoot)},a.prototype.hide=function(){o(this._overlayRoot,!1)},a.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,o=e.y;if(e.waypoints){var a=v(e);i=a.x,o=a.y}r(n,i,o)},a.prototype._updateOverlay=function(t){var e=t.position,n=t.htmlContainer,i=t.element,o=e.left,a=e.top;if(void 0!==e.right){var s;s=i.waypoints?v(i).width:i.width,o=-1*e.right+s}if(void 0!==e.bottom){var c;c=i.waypoints?v(i).height:i.height,a=-1*e.bottom+c}r(n,o||0,a||0)},a.prototype._createOverlayContainer=function(t){var e=d('<div class="djs-overlays djs-overlays-'+t.id+'" style="position: absolute" />');this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),n},a.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._overlayRoot.style.transform=i,this._overlayRoot.style["-ms-transform"]=i},a.prototype._getOverlayContainer=function(t,e){var n=t&&t.id||t,i=this._overlayContainers[n];return i||e||(i=this._overlayContainers[n]=this._createOverlayContainer(t)),i},a.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&(o=o.get(0)),c(o)&&(o=d(o)),n=this._getOverlayContainer(r),e=d('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">'),e.appendChild(o),t.type&&m(e).add("djs-overlay-"+t.type),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t)},a.prototype._updateOverlayVisibilty=function(t){l(this._overlays,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoom<t.scale)&&(r=!1),o(i,r))})},a.prototype._init=function(t){var e=this._eventBus,n=this,i=function(t){n._updateRoot(t),n._updateOverlayVisibilty(t),n.show()};t&&t.deferUpdate===!1||(i=f(i,300)),e.on("canvas.viewbox.changed",function(t){n.hide(),i(t.viewbox)}),e.on(["shape.remove","connection.remove"],function(t){var e=n.get({element:t.element});l(e,function(t){n.remove(t.id)})}),e.on(["element.changed"],function(t){var e=t.element,i=n._getOverlayContainer(e,!0);i&&(l(i.overlays,function(t){n._updateOverlay(t)}),n._updateOverlayContainer(i))}),e.on("element.marker.update",function(t){var e=n._getOverlayContainer(t.element,!0);e&&m(e.html)[t.add?"add":"remove"](t.marker)})}},{177:177,181:181,202:202,204:204,214:214,316:316,320:320,322:322,325:325,339:339,343:343,347:347}],135:[function(t,e,n){e.exports={__init__:["overlays"],overlays:["type",t(134)]}},{134:134}],136:[function(t,e,n){"use strict";function i(t,e){this._eventBus=t,this._canvas=e,this._providers=[]}var r=t(317),o=t(204),a=t(343),s=t(346),c=t(338),u=t(340),p=t(339),l=t(345),h=t(342),f=t(344),d=".djs-palette-toggle",m=".entry",y=d+", "+m;i.$inject=["eventBus","canvas"],e.exports=i,i.prototype.registerProvider=function(t){this._providers.push(t),this._container||this._init(),this._update()},i.prototype.getEntries=function(){var t={};return o(this._providers,function(e){var n=e.getPaletteEntries();o(n,function(e,n){t[n]=e})}),t},i.prototype._init=function(){var t=this._canvas.getContainer(),e=this._container=a(i.HTML_MARKUP),n=this;t.appendChild(e),h.bind(e,y,"click",function(t){var e=t.delegateTarget;return l(e,d)?n.toggle():void n.trigger("click",t)}),f.bind(e,"mousedown",function(t){t.stopPropagation()}),h.bind(e,m,"dragstart",function(t){n.trigger("dragstart",t)}),this._eventBus.fire("palette.create",{html:e})},i.prototype._update=function(){var t=s(".djs-palette-entries",this._container),e=this._entries=this.getEntries();u(t),o(e,function(e,n){var i=e.group||"default",r=s("[data-group="+i+"]",t);r||(r=a('<div class="group" data-group="'+i+'"></div>'),t.appendChild(r));var o=e.html||(e.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),u=a(o);r.appendChild(u),e.separator||(c(u,"data-action",n),e.title&&c(u,"title",e.title),e.className&&p(u).add(e.className),e.imageUrl&&u.appendChild(a('<img src="'+e.imageUrl+'">')))}),this.open(!0)},i.prototype.trigger=function(t,e,n){var i,o,a,s=this._entries,u=e.delegateTarget||e.target;if(!u)return e.preventDefault();if(i=s[c(u,"data-action")],o=i.action,a=e.originalEvent||e,r(o)){if("click"===t)return o(a,n)}else if(o[t])return o[t](a,n);e.preventDefault()},i.prototype.close=function(){p(this._container).remove("open")},i.prototype.open=function(){p(this._container).add("open")},i.prototype.toggle=function(t){
+this.isOpen()?this.close():this.open()},i.prototype.isOpen=function(){return this._container&&p(this._container).has("open")},i.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>'},{204:204,317:317,338:338,339:339,340:340,342:342,343:343,344:344,345:345,346:346}],137:[function(t,e,n){e.exports={__init__:["palette"],palette:["type",t(136)]}},{136:136}],138:[function(t,e,n){"use strict";function i(t,e){this._eventBus=t,this._canvas=e,this._instances={}}var r=t(204),o=t(325),a=t(344),s=t(343),c=t(339),u=t(338),p=t(347);i.$inject=["eventBus","canvas"],e.exports=i,i.prototype.open=function(t,e,n,i){function l(){var p=this;p._actions={},p.name=t||"popup-menu";var l={entryClassName:"entry"};o(l,i);var h=this._container=s('<div class="djs-popup">');o(h.style,{position:"absolute",left:e.x+"px",top:e.y+"px"}),c(h).add(t),r(n,function(t){var e=s("<div>");c(e).add(t.className||l.entryClassName),c(e).add("djs-popup-entry"),t.style&&u(e,"style",t.style),t.action&&(u(e,"data-action",t.action.name),p._actions[t.action.name]=t.action.handler);var n=s("<span>");n.textContent=t.label,e.appendChild(n),h.appendChild(e)}),a.bind(h,"click",function(t){p.trigger(t)});var d=f.zoom();h.style.transformOrigin="top left",h.style.transform="scale("+d+")",m.appendChild(h),this.bindHandlers()}var h=this,f=this._canvas,d=h._instances;if(d[t])return d[t];var m=f.getContainer();l.prototype.close=function(){this.unbindHandlers(),p(this._container),delete h._instances[this.name]},l.prototype.bindHandlers=function(){var t=this,e=h._eventBus;this._closeHandler=function(){t.close()},e.once("contextPad.close",this._closeHandler),e.once("canvas.viewbox.changed",this._closeHandler)},l.prototype.unbindHandlers=function(){var t=h._eventBus;t.off("contextPad.close",this._closeHandler),t.off("canvas.viewbox.changed",this._closeHandler)},l.prototype.trigger=function(t){var e=t.target,n=e.getAttribute("data-action")||e.parentNode.getAttribute("data-action"),i=this._actions[n];i&&i(),t.preventDefault()};var y=h._instances[t]=new l(e,n,m,i);return y}},{204:204,325:325,338:338,339:339,343:343,344:344,347:347}],139:[function(t,e,n){"use strict";e.exports={__init__:["popupMenu"],popupMenu:["type",t(138)]}},{138:138}],140:[function(t,e,n){"use strict";function i(t){this._modeling=t}e.exports=i,i.$inject=["modeling"],i.prototype.replaceElement=function(t,e,n){var i=this._modeling,r=null;return t.waypoints||(e.x=t.x+(e.width||t.width)/2,e.y=t.y+(e.height||t.height)/2,r=i.replaceShape(t,e,n)),r}},{}],141:[function(t,e,n){"use strict";e.exports={__init__:["replace"],replace:["type",t(140)]}},{140:140}],142:[function(t,e,n){"use strict";function i(t,e,n,i,x,b,w){function E(t){var e=a(t,["newBounds","shape","delta","direction"]);return n.allowed("shape.resize",e)}function _(t){var e,n,i=t.shape,r=t.direction,a=t.minDimensions||{},c=t.childrenBoxPadding||20;return e=o(i.children,function(t){return t.waypoints?!1:"label"===t.type?!1:!0}),e.length?(n=u.getBBox(e),n.width+=2*c,n.height+=2*c,n.x-=c,n.y-=c):n=s.getMinResizeBounds(r,i,{width:a.width||10,height:a.height||10}),n}function S(t,e,n){w.activate(t,"resize",{autoActivate:!0,cursor:"resize-"+(/nw|se/.test(n)?"nwse":"nesw"),data:{shape:e,context:{direction:n,shape:e}}})}function T(t,e,n){function i(e){p(e)&&S(e,t,n)}c.bind(e.node,"mousedown",i),c.bind(e.node,"touchstart",i)}function A(t,e,n,i,r){var o=t.group().addClass(g).addClass(g+"-"+r),a=-d+f;o.rect(a,a,d,d).addClass(g+"-visual"),o.rect(a,a,m,m).addClass(g+"-hit");var s=(new h.Matrix).translate(e,n).rotate(i,0,0);return o.transform(s),o}function C(t,e,n){var i;i="nw"===n?A(e,0,0,0,n):"ne"===n?A(e,t.width,0,90,n):"se"===n?A(e,t.width,t.height,180,n):A(e,0,t.height,270,n),T(t,i,n)}function M(t){if(E({shape:t})){var n=e.getGraphics(t);C(t,n,"nw"),C(t,n,"ne"),C(t,n,"se"),C(t,n,"sw")}}function R(t){var n=e.getGraphics(t),i=n.selectAll("."+g);r(i,function(t){t.remove()})}var N={create:function(t){var e,n=x.getDefaultLayer(),i=t.shape;e=t.frame=h.create("rect",{"class":"djs-resize-overlay",width:i.width+10,height:i.height+10,x:i.x-5,y:i.y-5}),e.appendTo(n)},update:function(t){var e=t.frame,n=t.newBounds;n.width>5&&e.attr({x:n.x,width:n.width}),n.height>5&&e.attr({y:n.y,height:n.height}),e[t.canExecute?"removeClass":"addClass"](v)},remove:function(t){t.frame&&t.frame.remove()}};t.on("resize.start",function(t){var e=t.context,n=e.shape,i=e.minBoundaryBox;void 0===i&&(e.minBoundaryBox=_(e)),x.addMarker(n,y),N.create(e)}),t.on("resize.move",function(t){var e,n=t.context,i=n.shape,r=n.direction,o=n.minBoundaryBox;e={x:t.dx,y:t.dy},n.delta=e,n.newBounds=s.resizeBounds(i,r,e),o&&(n.newBounds=s.ensureMinBounds(n.newBounds,o)),n.canExecute=E(n),N.update(n)}),t.on("resize.end",function(t){var e=t.context,n=e.shape,r=e.newBounds;r.x=l(r.x),r.y=l(r.y),r.width=l(r.width),r.height=l(r.height),e.canExecute&&i.resizeShape(n,e.newBounds)}),t.on("resize.cleanup",function(t){var e=t.context,n=e.shape;x.removeMarker(n,y),N.remove(e)}),t.on("selection.changed",function(t){var e=t.oldSelection,n=t.newSelection;r(e,R),1===n.length&&r(n,M)}),t.on("shape.changed",function(t){var e=t.element;R(e),b.isSelected(e)&&M(e)}),this.activate=S}var r=t(204),o=t(202),a=t(330),s=t(143),c=t(344),u=t(177),p=t(182).isPrimaryButton,l=Math.round,h=t(188),f=-2,d=5,m=20,y="djs-resizing",v="resize-not-ok",g="djs-resizer";i.$inject=["eventBus","elementRegistry","rules","modeling","canvas","selection","dragging"],e.exports=i},{143:143,177:177,182:182,188:188,202:202,204:204,330:330,344:344}],143:[function(t,e,n){"use strict";e.exports.resizeBounds=function(t,e,n){var i=n.x,r=n.y;switch(e){case"nw":return{x:t.x+i,y:t.y+r,width:t.width-i,height:t.height-r};case"sw":return{x:t.x+i,y:t.y,width:t.width-i,height:t.height+r};case"ne":return{x:t.x,y:t.y+r,width:t.width+i,height:t.height-r};case"se":return{x:t.x,y:t.y,width:t.width+i,height:t.height+r};default:throw new Error("unrecognized direction: "+e)}},e.exports.reattachPoint=function(t,e,n){var i=t.width/e.width,r=t.height/e.height;return{x:Math.round(e.x+e.width/2)-Math.floor((t.x+t.width/2-n.x)/i),y:Math.round(e.y+e.height/2)-Math.floor((t.y+t.height/2-n.y)/r)}},e.exports.ensureMinBounds=function(t,e){var n={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y)},i={x:Math.max(t.x+t.width,e.x+e.width),y:Math.max(t.y+t.height,e.y+e.height)};return{x:n.x,y:n.y,width:i.x-n.x,height:i.y-n.y}},e.exports.getMinResizeBounds=function(t,e,n){switch(t){case"nw":return{x:e.x+e.width-n.width,y:e.y+e.height-n.height,width:n.width,height:n.height};case"sw":return{x:e.x+e.width-n.width,y:e.y,width:n.width,height:n.height};case"ne":return{x:e.x,y:e.y+e.height-n.height,width:n.width,height:n.height};case"se":return{x:e.x,y:e.y,width:n.width,height:n.height};default:throw new Error("unrecognized direction: "+t)}}},{}],144:[function(t,e,n){e.exports={__depends__:[t(128),t(147),t(101)],__init__:["resize"],resize:["type",t(142)]}},{101:101,128:128,142:142,147:147}],145:[function(t,e,n){"use strict";function i(t){o.call(this,t),this.init()}var r=t(195),o=t(75);i.$inject=["eventBus"],r(i,o),e.exports=i,i.prototype.addRule=function(t,e){var n=this;"string"==typeof t&&(t=[t]),t.forEach(function(t){n.canExecute(t,function(t,n,i){return e(t)},!0)})}},{195:195,75:75}],146:[function(t,e,n){"use strict";function i(t){this._commandStack=t}i.$inject=["commandStack"],e.exports=i,i.prototype.allowed=function(t,e){var n=this._commandStack.canExecute(t,e);return void 0===n?!0:n}},{}],147:[function(t,e,n){e.exports={__depends__:[t(77)],__init__:["rules"],rules:["type",t(146)]}},{146:146,77:77}],148:[function(t,e,n){"use strict";function i(t){this._eventBus=t,this._selectedElements=[];var e=this;t.on(["shape.remove","connection.remove"],function(t){var n=t.element;e.deselect(n)})}var r=t(316),o=t(204);i.$inject=["eventBus"],e.exports=i,i.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(-1!==n){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},i.prototype.get=function(){return this._selectedElements},i.prototype.isSelected=function(t){return-1!==this._selectedElements.indexOf(t)},i.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();r(t)||(t=t?[t]:[]),e?o(t,function(t){-1===n.indexOf(t)&&n.push(t)}):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})}},{204:204,316:316}],149:[function(t,e,n){"use strict";function i(t,e,n){t.on("create.end",500,function(t){t.context.canExecute&&e.select(t.shape)}),t.on("connect.end",500,function(t){t.context.canExecute&&t.context.target&&e.select(t.context.target)}),t.on("shape.move.end",500,function(t){e.select(t.context.shapes)}),t.on("element.click",function(t){var i=t.element;i===n.getRootElement()&&(i=null);var o=e.isSelected(i),a=e.get().length>1,s=r(t);return o&&a?s?e.deselect(i):e.select(i):void(o?e.deselect(i):e.select(i,s))})}var r=t(182).hasPrimaryModifier;i.$inject=["eventBus","selection","canvas"],e.exports=i},{182:182}],150:[function(t,e,n){"use strict";function i(t,e,n,i,s){function c(t,n){e.addMarker(t,n)}function u(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",function(t){c(t.element,o)}),t.on("element.out",function(t){u(t.element,o)}),t.on("selection.changed",function(t){function e(t){u(t,a)}function n(t){c(t,a)}var i=t.oldSelection,o=t.newSelection;r(i,function(t){-1===o.indexOf(t)&&e(t)}),r(o,function(t){-1===i.indexOf(t)&&n(t)})})}var r=t(204),o="hover",a="selected";i.$inject=["eventBus","canvas","selection","graphicsFactory","styles"],e.exports=i},{204:204}],151:[function(t,e,n){e.exports={__init__:["selectionVisuals","selectionBehavior"],__depends__:[t(103),t(133)],selection:["type",t(148)],selectionVisuals:["type",t(150)],selectionBehavior:["type",t(149)]}},{103:103,133:133,148:148,149:149,150:150}],152:[function(t,e,n){"use strict";function i(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function r(t){this._snapValues={}}var o=t(204),a=t(153).snapTo;i.prototype.getSnapOrigin=function(t){return this._snapOrigins[t]},i.prototype.setSnapOrigin=function(t,e){this._snapOrigins[t]=e,-1===this._snapLocations.indexOf(t)&&this._snapLocations.push(t)},i.prototype.addDefaultSnap=function(t,e){var n=this._defaultSnaps[t];n||(n=this._defaultSnaps[t]=[]),n.push(e)},i.prototype.getSnapLocations=function(){return this._snapLocations},i.prototype.setSnapLocations=function(t){this._snapLocations=t},i.prototype.pointsForTarget=function(t){var e=t.id||t,n=this._targets[e];return n||(n=this._targets[e]=new r,n.initDefaults(this._defaultSnaps)),n},e.exports=i,r.prototype.add=function(t,e){var n=this._snapValues[t];n||(n=this._snapValues[t]={x:[],y:[]}),-1===n.x.indexOf(e.x)&&n.x.push(e.x),-1===n.y.indexOf(e.y)&&n.y.push(e.y)},r.prototype.snap=function(t,e,n,i){var r=this._snapValues[e];return r&&a(t[n],r[n],i)},r.prototype.initDefaults=function(t){var e=this;o(t||{},function(t,n){o(t,function(t){e.add(n,t)})})}},{153:153,204:204}],153:[function(t,e,n){"use strict";function i(t,e,n){n=void 0===n?10:n;var i,r;for(i=0;i<e.length;i++)if(r=e[i],s(r-t)<=n)return r}function r(t){return{x:t.x,y:t.y}}function o(t,e){return!t||isNaN(t.x)||isNaN(t.y)?e:{x:c(t.x+t.width/2),y:c(t.y+t.height/2)}}function a(t){return{x:t.x+t.width,y:t.y+t.height}}var s=Math.abs,c=Math.round;e.exports.snapTo=i,e.exports.topLeft=r,e.exports.mid=o,e.exports.bottomRight=a},{}],154:[function(t,e,n){"use strict";function i(t,e){this._canvas=e;var n=this;t.on(["shape.move.start","create.start"],function(t){n.initSnap(t)}),t.on(["shape.move.move","shape.move.end","create.move","create.end"],function(t){t.snapped||n.snap(t)}),t.on(["shape.move.cleanup","create.cleanup"],function(t){n.hide()}),this._asyncHide=a(this.hide,1e3)}var r=t(202),o=t(204),a=t(214),s=t(153).mid,c=t(152);i.$inject=["eventBus","canvas"],e.exports=i,i.prototype.initSnap=function(t){var e=t.context,n=e.shape,i=e.snapContext;i||(i=e.snapContext=new c);var r=s(n,t);return i.setSnapOrigin("mid",{x:r.x-t.x,y:r.y-t.y}),i},i.prototype.snap=function(t){var e=t.context,n=e.snapContext,i=e.shape,r=e.target,a=n.getSnapLocations();if(r){var s=n.pointsForTarget(r);s.initialized||(this.addTargetSnaps(s,i,r),s.initialized=!0);var c={};o(a,function(e){var i=n.getSnapOrigin(e),r={x:t.x+i.x,y:t.y+i.y};return o(["x","y"],function(t){var n;c[t]||(n=s.snap(r,e,t,7),void 0!==n&&(c[t]={value:n,originValue:n-i[t]}))}),c.x&&c.y?!1:void 0}),this.showSnapLine("vertical",c.x&&c.x.value),this.showSnapLine("horizontal",c.y&&c.y.value);var u,p;c.x&&(u=t.x-c.x.originValue,t.x=c.x.originValue,t.dx=t.dx-u,t.snapped=!0),c.y&&(p=t.y-c.y.originValue,t.y=c.y.originValue,t.dy=t.dy-p,t.snapped=!0)}},i.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=e.path("M0,0 L0,0").addClass("djs-snap-line");return{update:function(e){void 0===e?n.attr({display:"none"}):"horizontal"===t?n.attr({path:"M-100000,"+e+" L+100000,"+e,display:""}):n.attr({path:"M "+e+",-100000 L "+e+", +100000",display:""})}}},i.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},i.prototype.showSnapLine=function(t,e){var n=this.getSnapLine(t);n&&n.update(e),this._asyncHide()},i.prototype.getSnapLine=function(t){return this._snapLines||this._createSnapLines(),this._snapLines[t]},i.prototype.hide=function(){o(this._snapLines,function(t){t.update()})},i.prototype.addTargetSnaps=function(t,e,n){var i=this.getSiblings(e,n);o(i,function(e){t.add("mid",s(e))})},i.prototype.getSiblings=function(t,e){return e&&r(e.children,function(e){return!e.hidden&&!e.labelTarget&&!e.waypoints&&e!==t})}},{152:152,153:153,202:202,204:204,214:214}],155:[function(t,e,n){"use strict";function i(t,e,n,i,p){function l(t){var e={shape:t};return p.allowed("shape.resize",e)}function h(t,n){e.activate(t,"spaceTool.selection",{cursor:"crosshair",autoActivate:n,data:{context:{crosshair:{}}}})}function f(t){e.activate(t,"spaceTool",{autoActivate:!0,cursor:"crosshair",data:{context:{}}})}function d(t,e){var i=s(t.dx)>s(t.dy)?"x":"y",c=t["d"+i],u=t[i]-c,p=[],h=[];return s(c)<5?!1:(a(t)&&(c*=-1),n.forEach(function(t){var e=t[[i]],n=e+t[m[i]];if(t.parent&&!t.waypoints)return c>0&&e>u?p.push(t):0>c&&u>n?p.push(t):u>e&&n>u&&l(t)?h.push(t):void 0}),e.axis=i,e.direction=r.getDirection(i,c),e.movingShapes=p,e.resizingShapes=h,o.set("resize-"+("x"===i?"ew":"ns")),!0)}t.on("spaceTool.selection.end",function(t){setTimeout(function(){f(t.originalEvent)})});var m={x:"width",y:"height"},y={x:"y",y:"x"};t.on("spaceTool.move",u,function(t){var e=t.context;e.initialized||(e.initialized=d(t,e))}),t.on("spaceTool.end",function(t){var e=t.context,n=e.axis,r=e.direction,o=e.movingShapes,a=e.resizingShapes;if(e.initialized){var s={x:c(t.dx),y:c(t.dy)};return s[y[n]]=0,i.createSpace(o,a,s,r)}}),this.activateSelection=h,this.activateMakeSpace=f}var r=t(157),o=t(176),a=t(182).hasPrimaryModifier,s=Math.abs,c=Math.round,u=1500;i.$inject=["eventBus","dragging","elementRegistry","modeling","rules"],e.exports=i},{157:157,176:176,182:182}],156:[function(t,e,n){"use strict";function i(t,e,n,i){function a(t){return e.getGraphics(t)}function s(t,e){var n=a(t),r=n.clone(),o=n.getBBox();r.attr(i.cls("djs-dragger",[],{x:o.x,y:o.y})),e.add(r)}t.on("spaceTool.selection.start",function(t){var e=n.getLayer("space"),r=t.context,o={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},a=e.group().attr(i.cls("djs-crosshair-group",["no-events"]));a.path(o.x).addClass("djs-crosshair"),a.path(o.y).addClass("djs-crosshair"),r.crosshairGroup=a}),t.on("spaceTool.selection.move",function(t){var e=t.context.crosshairGroup;e.translate(t.x,t.y)}),t.on("spaceTool.selection.cleanup",function(t){var e=t.context,n=e.crosshairGroup;n&&n.remove()}),t.on("spaceTool.move",function(t){var e=t.context,a=e.line,c=e.axis,u=e.movingShapes;if(e.initialized){if(!e.dragGroup){var p=n.getLayer("space");a=p.path("M0,0 L0,0").addClass("djs-crosshair"),e.line=a;var l=n.getDefaultLayer().group().attr(i.cls("djs-drag-group",["no-events"]));r(u,function(t){s(t,l),n.addMarker(t,o)}),e.dragGroup=l}var h={x:"M"+t.x+", -10000 L"+t.x+", 10000",y:"M -10000, "+t.y+" L 10000, "+t.y};a.attr({path:h[c],display:""});var f={x:"y",y:"x"},d={x:t.dx,y:t.dy};d[f[e.axis]]=0,e.dragGroup.translate(d.x,d.y)}}),t.on("spaceTool.cleanup",function(t){var e=t.context,i=e.movingShapes,a=e.line,s=e.dragGroup;r(i,function(t){n.removeMarker(t,o)}),s&&(a.remove(),s.remove())})}var r=t(204),o="djs-dragging";i.$inject=["eventBus","elementRegistry","canvas","styles"],e.exports=i},{204:204}],157:[function(t,e,n){"use strict";function i(t,e){if("x"===t){if(e>0)return"e";if(0>e)return"w"}if("y"===t){if(e>0)return"s";if(0>e)return"n"}return null}e.exports.getDirection=i,e.exports.resizeBounds=function(t,e,n){var i=n.x,r=n.y;switch(e){case"n":return{x:t.x,y:t.y+r,width:t.width,height:t.height-r};case"s":return{x:t.x,y:t.y,width:t.width,height:t.height+r};case"w":return{x:t.x+i,y:t.y,width:t.width-i,height:t.height};case"e":return{x:t.x,y:t.y,width:t.width+i,height:t.height};default:throw new Error("unrecognized direction: "+e)}}},{}],158:[function(t,e,n){e.exports={__init__:["spaceToolVisuals"],__depends__:[t(101),t(128),t(147)],spaceTool:["type",t(155)],spaceToolVisuals:["type",t(156)]}},{101:101,128:128,147:147,155:155,156:156}],159:[function(t,e,n){"use strict";function i(t){var e=l('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');return t.insertBefore(e,t.firstChild),e}function r(t,e,n){c(t.style,{left:e+"px",top:n+"px"})}function o(t,e){t.style.display=e===!1?"none":""}function a(t,e,n){this._eventBus=e,this._canvas=n,this._ids=y,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=i(n.getContainer());var r=this;m.bind(this._tooltipRoot,g,"mousedown",function(t){t.stopPropagation()}),m.bind(this._tooltipRoot,g,"mouseover",function(t){r.trigger("mouseover",t)}),m.bind(this._tooltipRoot,g,"mouseout",function(t){r.trigger("mouseout",t)}),this._init(t)}var s=t(322),c=t(325),u=t(204),p=t(214),l=t(343),h=t(338),f=t(339),d=t(347),m=t(342),y=new(t(181))("tt"),v="djs-tooltip",g="."+v;a.$inject=["config.tooltips","eventBus","canvas"],e.exports=a,a.prototype.add=function(t){if(!t.position)throw new Error("must specifiy tooltip position");if(!t.html)throw new Error("must specifiy tooltip html");var e=this._ids.next();return t=c({},this._tooltipDefaults,t,{id:e}),this._addTooltip(t),t.timeout&&this.setTimeout(t),e},a.prototype.trigger=function(t,e){var n=e.delegateTarget||e.target,i=this.get(h(n,"data-tooltip-id"));i&&("mouseover"===t&&i.timeout&&this.clearTimeout(i),"mouseout"===t&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)),console.log("mouse leave",e))},a.prototype.get=function(t){return"string"!=typeof t&&(t=t.id),this._tooltips[t]},a.prototype.clearTimeout=function(t){if(t=this.get(t)){var e=t.removeTimer;e&&(clearTimeout(e),t.removeTimer=null)}},a.prototype.setTimeout=function(t){if(t=this.get(t)){this.clearTimeout(t);var e=this;t.removeTimer=setTimeout(function(){e.remove(t)},t.timeout)}},a.prototype.remove=function(t){var e=this.get(t);e&&(d(e.html),d(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},a.prototype.show=function(){o(this._tooltipRoot)},a.prototype.hide=function(){o(this._tooltipRoot,!1)},a.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},a.prototype._addTooltip=function(t){var e,n=t.id,i=t.html,r=this._tooltipRoot;i.get&&(i=i.get(0)),s(i)&&(i=l(i)),e=l('<div data-tooltip-id="'+n+'" class="'+v+'" style="position: absolute">'),e.appendChild(i),t.type&&f(e).add("djs-tooltip-"+t.type),t.className&&f(e).add(t.className),t.htmlContainer=e,r.appendChild(e),this._tooltips[n]=t,this._updateTooltip(t)},a.prototype._updateTooltip=function(t){var e=t.position,n=t.htmlContainer;r(n,e.x,e.y)},a.prototype._updateTooltipVisibilty=function(t){u(this._tooltips,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoom<t.scale)&&(r=!1),o(i,r))})},a.prototype._init=function(t){var e=this,n=function(t){e._updateRoot(t),e._updateTooltipVisibilty(t),e.show()};t&&t.deferUpdate===!1||(n=p(n,300)),this._eventBus.on("canvas.viewbox.changed",function(t){e.hide(),n(t.viewbox)})}},{181:181,204:204,214:214,322:322,325:325,338:338,339:339,342:342,343:343,347:347}],160:[function(t,e,n){e.exports={__init__:["tooltips"],tooltips:["type",t(159)]}},{159:159}],161:[function(t,e,n){"use strict";function i(t,e){var n=this;e.on("canvas.init",function(t){n.addBBoxMarker(t.svg)})}i.$inject=["canvas","eventBus"],e.exports=i,i.prototype.addBBoxMarker=function(t){var e={fill:"none","class":"outer-bound-marker"};t.rect(-1e4,-1e4,10,10).attr(e),t.rect(1e4,1e4,10,10).attr(e)}},{}],162:[function(t,e,n){"use strict";function i(){}function r(t,e){try{return e.get(t)}catch(n){return null}}function o(t){function e(t){h.stopEvent(t,!0)}function n(n){s(m,function(n){c.bind(t,n,e,!0)})}function r(n){setTimeout(function(){s(m,function(n){c.unbind(t,n,e,!0)})},500)}c.bind(t,"touchstart",n,!0),c.bind(t,"touchend",r,!0),c.bind(t,"touchcancel",r,!0);var o=new p.Manager(t,{inputClass:p.TouchInput,recognizers:[]}),a=new p.Tap,u=new p.Pan({threshold:10}),l=new p.Press,f=new p.Pinch,d=new p.Tap({event:"doubletap",taps:2});return f.requireFailure(u),f.requireFailure(l),o.add([u,l,f,d,a]),o.reset=function(t){var e=this.recognizers,n=this.session;n.stopped||(i("recognizer","stop"),o.stop(t),setTimeout(function(){var t,r;for(i("recognizer","reset"),t=0;r=e[t];t++)r.reset(),r.state=8;n.curRecognizer=null},0))},o.on("hammer.input",function(t){t.srcEvent.defaultPrevented&&o.reset(!0)}),o}function a(t,e,n,a,s,c){function p(t){return function(e){i("element",t,e),s.fire(t,e)}}function m(t){var e=u(t,"svg, .djs-element",!0);return e&&new l(e)}function y(t){function n(t){function n(t){var n=t.deltaX-o,i=t.deltaY-a;e.scroll({dx:n,dy:i}),o=t.deltaX,a=t.deltaY}function r(t){v.off("panmove",n),v.off("panend",r),v.off("pancancel",r),i("canvas","grab end")}i("canvas","grab start");var o=0,a=0;v.on("panmove",n),v.on("panend",r),v.on("pancancel",r)}function r(t){var r=m(t.target),o=r&&a.get(r);return x&&e.getRootElement()!==o?(i("element","move start",o,t,!0),x.start(t,o,!0)):void n(t)}function s(t){function n(t){var n=1-(1-t.scale)/1.5,i=Math.max(f,Math.min(d,n*o));e.zoom(i,a),h.stopEvent(t,!0)}function r(t){v.off("pinchmove",n),v.off("pinchend",r),v.off("pinchcancel",r),v.reset(!0),i("canvas","zoom end")}i("canvas","zoom start");var o=e.zoom(),a=t.center;v.on("pinchmove",n),v.on("pinchend",r),v.on("pinchcancel",r)}v=o(t),v.on("doubletap",p("element.dblclick")),v.on("tap",p("element.click")),v.on("panstart",r),v.on("press",r),v.on("pinchstart",s)}var v,g=r("dragging",t),x=r("move",t),b=r("contextPad",t),w=r("palette",t);g&&n.on("drag.move",function(t){var e=h.toPoint(t.originalEvent),n=document.elementFromPoint(e.x,e.y),i=m(n),r=i&&a.get(i);r!==t.hover&&(t.hover&&g.out(t),r&&(g.hover({element:r,gfx:i}),t.hover=r,t.hoverGfx=i))}),b&&n.on("contextPad.create",function(t){var e=t.pad.html,n=o(e);n.on("panstart",function(t){i("context-pad","panstart",t),b.trigger("dragstart",t,!0)}),n.on("press",function(t){i("context-pad","press",t),b.trigger("dragstart",t,!0)}),n.on("tap",function(t){i("context-pad","tap",t),b.trigger("click",t)})}),w&&n.on("palette.create",function(t){var e=t.html,n=o(e);n.on("panstart",function(t){i("palette","panstart",t),w.trigger("dragstart",t,!0)}),n.on("press",function(t){i("palette","press",t),w.trigger("dragstart",t,!0)}),n.on("tap",function(t){i("palette","tap",t),w.trigger("click",t)})}),n.on("canvas.init",function(t){y(t.svg.node)})}var s=t(204),c=t(344),u=t(341),p=t(186),l=t(188),h=t(178),f=.2,d=4,m=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];a.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],e.exports=a},{178:178,186:186,188:188,204:204,341:341,344:344}],163:[function(t,e,n){e.exports={__depends__:[t(103)],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",t(162)],touchFix:["type",t(161)]}},{103:103,161:161,162:162}],164:[function(t,e,n){"use strict";function i(){}var r=t(166);e.exports=i,i.prototype.layoutConnection=function(t,e){return[r.getMidPoint(t.source),r.getMidPoint(t.target)]}},{166:166}],165:[function(t,e,n){"use strict";function i(t){return o({original:t.point.original||t.point},t.actual)}function r(t,e){this._elementRegistry=t,this._renderer=e}var o=t(325),a=t(166);r.$inject=["elementRegistry","renderer"],e.exports=r,r.prototype.getCroppedWaypoints=function(t,e,n){e=e||t.source,n=n||t.target;var r=this.getDockingPoint(t,e,!0),o=this.getDockingPoint(t,n),a=t.waypoints.slice(r.idx+1,o.idx);return a.unshift(i(r)),a.push(i(o)),a},r.prototype.getDockingPoint=function(t,e,n){var i,r,o,a=t.waypoints;return i=n?0:a.length-1,r=a[i],o=this._getIntersection(e,t,n),{point:r,actual:o||r,idx:i}},r.prototype._getIntersection=function(t,e,n){var i=this._getShapePath(t),r=this._getConnectionPath(e);return a.getElementLineIntersection(i,r,n)},r.prototype._getConnectionPath=function(t){return this._renderer.getConnectionPath(t)},r.prototype._getShapePath=function(t){return this._renderer.getShapePath(t)},r.prototype._getGfx=function(t){return this._elementRegistry.getGraphics(t)}},{166:166,325:325}],166:[function(t,e,n){"use strict";function i(t,e){switch(!0){case t.x===e.x:return"h";case t.y===e.y:return"v"}return!1}function r(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function o(t,e){return t.x===e.x&&t.y===e.y}function a(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function c(t){return r({x:t.x+t.width/2,y:t.y+t.height/2})}function u(t,e,n){n=n||0;var i=s(t),r=s(e),o=i.bottom+n<=r.top,a=i.left-n>=r.right,c=i.top-n>=r.bottom,u=i.right+n<=r.left,p=o?"top":c?"bottom":null,l=u?"left":a?"right":null;return l&&p?p+"-"+l:l||p?l||p:"intersect"}function p(t,e,n,i){f(n)&&(i=n,n=0);var r=u(t,e,n);return-1!==i.indexOf(r)}function l(t,e,n){var i=h(t,e);return 1===i.length?r(i[0]):2===i.length&&a(i[0],i[1])<1?r(i[0]):i.length>1?(i=d(i,function(t){var e=Math.floor(100*t.t2)||1;return e=100-e,e=(10>e?"0":"")+e,t.segment2+"#"+e}),r(i[n?0:i.length-1])):null}function h(t,e){return m.path.intersection(t,e)}var f=t(316),d=t(211),m=t(188);e.exports.pointsAligned=i,e.exports.roundPoint=r,e.exports.pointsEqual=o,e.exports.pointDistance=a,e.exports.asTRBL=s,e.exports.getMidPoint=c,e.exports.getOrientation=u,e.exports.hasAnyOrientation=p,e.exports.getElementLineIntersection=l,e.exports.getIntersections=h},{188:188,211:211,316:316}],167:[function(t,e,n){"use strict";function i(t,e){return Math.max(t,e)}function r(t,e){return Math.min(t,e)}function o(t,e,n){return t>=e&&n>=t}var a=t(316),s=t(203),c=t(166),u=t(179),p=20;e.exports.getMidPoints=function(t,e,n){n=n||"h:h";var i,r;if("h:v"===n)return[{x:e.x,y:t.y}];if("v:h"===n)return[{x:t.x,y:e.y}];if("h:h"===n)return i=Math.round((e.x-t.x)/2+t.x),[{x:i,y:t.y},{x:i,y:e.y}];if("v:v"===n)return r=Math.round((e.y-t.y)/2+t.y),[{x:t.x,y:r},{x:e.x,y:r}];throw new Error("unknown directions: <"+n+">: directions must be specified as {a direction}:{b direction} (direction in h|v)")},e.exports.connectPoints=function(t,e,n){var i=[];return c.pointsAligned(t,e)||(i=this.getMidPoints(t,e,n)),i.unshift(t),i.push(e),i},e.exports.connectRectangles=function(t,e,n,i,r){r=r||{};var o=c.getOrientation(t,e,p),a=this.getDirections(t,e,r.preferVertical);if(n=n||c.getMidPoint(t),i=i||c.getMidPoint(e),a){if("h:h"===a)switch(o){case"top-right":case"right":case"bottom-right":n={original:n,x:t.x,y:n.y},i={original:i,x:e.x+e.width,y:i.y};break;case"top-left":case"left":case"bottom-left":n={original:n,x:t.x+t.width,y:n.y},i={original:i,x:e.x,y:i.y}}if("v:v"===a)switch(o){case"top-left":case"top":case"top-right":n={original:n,x:n.x,y:t.y+t.height},i={original:i,x:i.x,y:e.y};break;case"bottom-left":case"bottom":case"bottom-right":n={original:n,x:n.x,y:t.y},i={original:i,x:i.x,y:e.y+e.height}}return this.connectPoints(n,i,a)}},e.exports.repairConnection=function(t,e,n,i,r,o){a(n)&&(r=n,o=i,n=c.getMidPoint(t),i=c.getMidPoint(e)),o=o||{};var s;return!r||r.length<3?o.preferStraight&&(s=this.layoutStraight(t,e,n,i,o)):o.endChanged?(s=this._repairConnectionSide(e,t,i,r.slice().reverse()),s=s&&s.reverse()):s=o.startChanged?this._repairConnectionSide(t,e,n,r):r,s?s:this.connectRectangles(t,e,n,i,o)},e.exports.layoutStraight=function(t,e,n,a,s){var c,u,p,l,h,f;return c=i(t.x+10,e.x+10),u=r(t.x+t.width-10,e.x+e.width-10),u>c&&(t.width===e.width&&(s.endChanged&&o(a.x,c,u)?p=a.x:o(n.x,c,u)&&(p=n.x)),void 0===p&&(p=t.width<e.width&&o(n.x,c,u)?n.x:t.width>e.width&&o(a.x,c,u)?a.x:(c+u)/2)),l=i(t.y+10,e.y+10),h=r(t.y+t.height-10,e.y+e.height-10),h>l&&(t.height===e.height&&(s.endChanged&&o(a.y,l,h)?f=a.y:o(n.y,l,h)&&(f=n.y)),void 0===f&&(f=t.height<=e.height&&o(n.y,l,h)?n.y:e.height<=t.height&&o(a.y,l,h)?a.y:(l+h)/2)),void 0===p&&void 0===f?null:[{x:void 0!==p?p:n.x,y:void 0!==f?f:n.y},{x:void 0!==p?p:a.x,y:void 0!==f?f:a.y}]},e.exports._repairConnectionSide=function(t,e,n,i){function r(t,e,n){return n.length<3?!0:n.length>4?!1:!!s(n,function(t,e){var i=n[e-1];return i&&u.distance(t,i)<3})}function o(t,e,n){var i=c.pointsAligned(e,t);switch(i){case"v":return{x:t.x,y:n.y};case"h":return{x:n.x,y:t.y}}return{x:t.x,y:t.y}}function a(t,e,n){var i;for(i=t.length-2;0!==i;i--)if(u.pointInRect(t[i],e,p)||u.pointInRect(t[i],n,p))return t.slice(i);return t}if(r(t,e,i))return null;var l,h=i[0],f=i.slice();return f[0]=n,f[1]=o(f[1],h,n),l=a(f,t,e),l!==f?this._repairConnectionSide(t,e,n,l):f},e.exports.getDirections=function(t,e,n){var i=c.getOrientation(t,e,p);switch(i){case"intersect":return null;case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return n?"v:v":"h:h"}}},{166:166,179:179,203:203,316:316}],168:[function(t,e,n){"use strict";function i(){Object.defineProperty(this,"businessObject",{writable:!0}),l.bind(this,"parent"),h.bind(this,"label"),f.bind(this,"outgoing"),d.bind(this,"incoming")}function r(){i.call(this),l.bind(this,"children")}function o(){r.call(this)}function a(){r.call(this),h.bind(this,"labelTarget")}function s(){i.call(this),f.bind(this,"source"),d.bind(this,"target")}var c=t(325),u=t(195),p=t(356),l=new p({name:"children",enumerable:!0,collection:!0},{name:"parent"}),h=new p({name:"label",enumerable:!0},{name:"labelTarget"}),f=new p({name:"outgoing",collection:!0},{name:"source"}),d=new p({name:"incoming",collection:!0},{name:"target"});u(r,i),u(o,r),u(a,r),u(s,i);var m={connection:s,shape:r,label:a,root:o};e.exports.create=function(t,e){var n=m[t];if(!n)throw new Error("unknown type: <"+t+">");return c(new n,e)},e.exports.Base=i,e.exports.Root=o,e.exports.Shape=r,e.exports.Connection=s,e.exports.Label=a},{195:195,325:325,356:356}],169:[function(t,e,n){"use strict";function i(t,e){return{x:t.x-e.x,y:t.y-e.y}}function r(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function o(t,e){function n(t){var n=h.start,o=u.toPoint(t),c=i(o,n);if(!h.dragging&&r(c)>p&&(h.dragging=!0,s.install(),a.set("move")),h.dragging){var l=h.last||h.start;c=i(o,l),e.scroll({dx:c.x,dy:c.y}),h.last=o}t.preventDefault()}function o(t){c.unbind(document,"mousemove",n),c.unbind(document,"mouseup",o),h=null,a.unset(),u.stopEvent(t)}function l(t){t.button||t.ctrlKey||t.shiftKey||t.altKey||(h={start:u.toPoint(t)},c.bind(document,"mousemove",n),c.bind(document,"mouseup",o),u.stopEvent(t))}var h,f=e._container;c.bind(f,"mousedown",l)}var a=t(176),s=t(174),c=t(344),u=t(178),p=15;o.$inject=["eventBus","canvas"],e.exports=o},{174:174,176:176,178:178,344:344}],170:[function(t,e,n){e.exports={__init__:["moveCanvas"],moveCanvas:["type",t(169)]}},{169:169}],171:[function(t,e,n){
+e.exports={__depends__:[t(163)]}},{163:163}],172:[function(t,e,n){"use strict";function i(t,e){function n(t){return Math.max(l.min,Math.min(l.max,t))}function i(){e.zoom("fit-viewport")}function c(t,i){var r=e.zoom(),o=Math.pow(1+Math.abs(t),t>0?1:-1);e.zoom(n(r*o),i)}function u(t){e.scroll(t)}function p(t){r.bind(t,"wheel",function(e){e.preventDefault();var n,i=o(e),r=a(e);if(i||r){n=s?0===e.deltaMode?1.25:50:0===e.deltaMode?.025:.5;var p={};r?p.dx=n*(e.deltaX||e.deltaY):p.dy=n*e.deltaY,u(p)}else{n=0===e.deltaMode?.025:.5;var l=t.getBoundingClientRect(),h={x:e.clientX-l.left,y:e.clientY-l.top};c(e.deltaY*n/-5,h)}})}var l={min:.2,max:4};t.on("canvas.init",function(t){p(e._container)}),this.zoom=c,this.reset=i}var r=t(344),o=t(182).hasPrimaryModifier,a=t(182).hasSecondaryModifier,s=t(183).isMac;i.$inject=["eventBus","canvas"],e.exports=i},{182:182,183:183,344:344}],173:[function(t,e,n){e.exports={__init__:["zoomScroll"],zoomScroll:["type",t(172)]}},{172:172}],174:[function(t,e,n){"use strict";function i(t){s(t),r(!1)}function r(t){a[t?"bind":"unbind"](document.body,"click",i,!0)}function o(){return r(!0),function(){r(!1)}}var a=t(344),s=t(178).stopEvent;e.exports.install=o},{178:178,344:344}],175:[function(t,e,n){"use strict";e.exports.remove=function(t,e){if(t&&e){var n=t.indexOf(e);if(-1!==n)return t.splice(n,1),e}},e.exports.add=function(t,e,n){if(t&&e){isNaN(n)&&(n=-1);var i=t.indexOf(e);if(-1!==i){if(i===n)return;if(-1===n)return;t.splice(i,1)}-1!==n?t.splice(n,0,e):t.push(e)}},e.exports.indexOf=function(t,e){return t&&e?t.indexOf(e):-1}},{}],176:[function(t,e,n){"use strict";var i=t(339),r=/^djs-cursor-.*$/;e.exports.set=function(t){var e=i(document.body);e.removeMatching(r),t&&e.add("djs-cursor-"+t)},e.exports.unset=function(){this.set(null)}},{339:339}],177:[function(t,e,n){"use strict";function i(t,e,n){var i=!n||-1===t.indexOf(e);return i&&t.push(e),i}function r(t,e,n){n=n||0,d(t,function(t,i){var o=e(t,i,n);l(o)&&o.length&&r(o,e,n+1)})}function o(t,e,n){var o=[],a=[];return r(t,function(t,r,s){i(o,t,e);var c=t.children;return(-1===n||n>s)&&c&&i(a,c,e)?c:void 0}),o}function a(t,e){return o(t,!e,1)}function s(t,e){return o(t,!e,-1)}function c(t){function e(t){i[t.source.id]&&i[t.target.id]&&(i[t.id]=t),o[t.source.id]&&o[t.target.id]&&(c[t.id]=s[t.id]=t),a[t.id]=t}function n(t){return s[t.id]=t,t.waypoints?void(c[t.id]=a[t.id]=t):(o[t.id]=t,d(t.incoming,e),d(t.outgoing,e),t.children)}var i=f(t,function(t){return t.id}),o={},a={},s={},c={};return r(t,n),{allShapes:o,allConnections:a,topLevel:i,enclosedConnections:c,enclosedElements:s}}function u(t,e){e=!!e,l(t)||(t=[t]);var n,i,r,o;return d(t,function(t){var a=t;t.waypoints&&!e&&(a=u(t.waypoints,!0));var s=a.x,c=a.y,p=a.height||0,l=a.width||0;(n>s||void 0===n)&&(n=s),(i>c||void 0===i)&&(i=c),(s+l>r||void 0===r)&&(r=s+l),(c+p>o||void 0===o)&&(o=c+p)}),{x:n,y:i,height:o-i,width:r-n}}function p(t,e){var n={};return d(t,function(t){var i=t;i.waypoints&&(i=u(i)),!h(e.y)&&i.x>e.x&&(n[t.id]=t),!h(e.x)&&i.y>e.y&&(n[t.id]=t),i.x>e.x&&i.y>e.y&&(h(e.width)&&h(e.height)&&i.width+i.x<e.width+e.x&&i.height+i.y<e.height+e.y?n[t.id]=t:h(e.width)&&h(e.height)||(n[t.id]=t))}),n}var l=t(316),h=t(319),f=t(205),d=t(204);e.exports.eachElement=r,e.exports.selfAndDirectChildren=a,e.exports.selfAndAllChildren=s,e.exports.getBBox=u,e.exports.getEnclosedElements=p,e.exports.getClosure=c},{204:204,205:205,316:316,319:319}],178:[function(t,e,n){"use strict";function i(t){return t&&t.preventDefault()}function r(t,e){t&&(t.stopPropagation&&t.stopPropagation(),e&&t.stopImmediatePropagation&&t.stopImmediatePropagation())}function o(t){return t.originalEvent||t.srcEvent}function a(t,e){c(t,e),s(t)}function s(t){i(t),i(o(t))}function c(t,e){r(t,e),r(o(t),e)}function u(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}e.exports.getOriginal=o,e.exports.stopEvent=a,e.exports.preventDefault=s,e.exports.stopPropagation=c,e.exports.toPoint=u},{}],179:[function(t,e,n){"use strict";var i=e.exports.distance=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))};e.exports.pointsOnLine=function(t,e,n){if(!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=i(t,e);return Math.abs(r/o)<5},e.exports.pointInRect=function(t,e,n){return n=n||0,t.x>e.x-n&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}},{}],180:[function(t,e,n){"use strict";function i(t){return t.select(".djs-visual")}function r(t){return t.parent().children()[1]}function o(t){return i(t).select("*").getBBox()}e.exports.getVisual=i,e.exports.getChildren=r,e.exports.getBBox=o},{}],181:[function(t,e,n){"use strict";function i(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}e.exports=i,i.prototype.next=function(){return this._prefix+ ++this._counter}},{}],182:[function(t,e,n){"use strict";function i(t){return!(r(t)||t).button}var r=t(178).getOriginal,o=t(183).isMac;e.exports.isPrimaryButton=i,e.exports.isMac=o,e.exports.hasPrimaryModifier=function(t){var e=r(t)||t;return i(t)?o()?e.altKey:e.ctrlKey:!1},e.exports.hasSecondaryModifier=function(t){var e=r(t)||t;return i(t)&&e.shiftKey}},{178:178,183:183}],183:[function(t,e,n){"use strict";e.exports.isMac=function(){return/mac/i.test(navigator.platform)}},{}],184:[function(t,e,n){"use strict";function i(t){var e=t.split("-");return{horizontal:e[0]||"center",vertical:e[1]||"top"}}function r(t){return l(t)?h({top:0,left:0,right:0,bottom:0},t):{top:t,left:t,right:t,bottom:t}}function o(t,e){return e.textContent=t,e.getBBox()}function a(t,e,n){for(var i,r=t.shift(),a=r;;){if(i=o(a,n),i.width=a?i.width:0," "===a||""===a||i.width<Math.round(e)||a.length<4)return s(t,a,r,i);a=u(a,i.width,e)}}function s(t,e,n,i){if(e.length<n.length){var r=t[0]||"",o=n.slice(e.length).trim();r=/-\s*$/.test(o)?o.replace(/-\s*$/,"")+r.replace(/^\s+/,""):o+" "+r,t[0]=r}return{width:i.width,height:i.height,text:e}}function c(t,e){var n,i=t.split(/(\s|-)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<e)){"-"===n&&r.pop();break}r.push(n),o+=n.length}return r.join("")}function u(t,e,n){var i=Math.max(t.length*(n/e),1),r=c(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function p(t){this._config=h({},{size:g,padding:v,style:{},align:"center-top"},t||{})}var l=t(320),h=t(325),f=t(204),d=t(208),m=t(328),y=t(188),v=0,g={width:150,height:50};p.prototype.createText=function(t,e,n){for(var o=m({},this._config.size,n.box||{}),s=m({},this._config.style,n.style||{}),c=i(n.align||this._config.align),u=r(void 0!==n.padding?n.padding:this._config.padding),p=e.split(/\r?\n/g),l=[],h=o.width-u.left-u.right,v=t.paper.text(0,0,"").attr(s).node;p.length;)l.push(a(p,h,v));var g,x,b=d(l,function(t,e,n){return t+e.height},0);switch(c.vertical){case"middle":g=(o.height-b)/2-l[0].height/4;break;default:g=u.top}var w=t.text().attr(s);return f(l,function(t){switch(g+=t.height,c.horizontal){case"left":x=u.left;break;case"right":x=h-u.right-t.width;break;default:x=Math.max((h-t.width)/2+u.left,0)}var e=y.create("tspan",{x:x,y:g}).node;e.textContent=t.text,w.append(e)}),v.parentNode.removeChild(v),w},e.exports=p},{188:188,204:204,208:208,320:320,325:325,328:328}],185:[function(e,n,i){!function(e){var i,r,o="0.4.2",a="hasOwnProperty",s=/[\.\/]/,c=/\s*,\s*/,u="*",p=function(t,e){return t-e},l={n:{}},h=function(){for(var t=0,e=this.length;e>t;t++)if("undefined"!=typeof this[t])return this[t]},f=function(){for(var t=this.length;--t;)if("undefined"!=typeof this[t])return this[t]},d=function(t,e){t=String(t);var n,o=r,a=Array.prototype.slice.call(arguments,2),s=d.listeners(t),c=0,u=[],l={},m=[],y=i;m.firstDefined=h,m.lastDefined=f,i=t,r=0;for(var v=0,g=s.length;g>v;v++)"zIndex"in s[v]&&(u.push(s[v].zIndex),s[v].zIndex<0&&(l[s[v].zIndex]=s[v]));for(u.sort(p);u[c]<0;)if(n=l[u[c++]],m.push(n.apply(e,a)),r)return r=o,m;for(v=0;g>v;v++)if(n=s[v],"zIndex"in n)if(n.zIndex==u[c]){if(m.push(n.apply(e,a)),r)break;do if(c++,n=l[u[c]],n&&m.push(n.apply(e,a)),r)break;while(n)}else l[n.zIndex]=n;else if(m.push(n.apply(e,a)),r)break;return r=o,i=y,m};d._events=l,d.listeners=function(t){var e,n,i,r,o,a,c,p,h=t.split(s),f=l,d=[f],m=[];for(r=0,o=h.length;o>r;r++){for(p=[],a=0,c=d.length;c>a;a++)for(f=d[a].n,n=[f[h[r]],f[u]],i=2;i--;)e=n[i],e&&(p.push(e),m=m.concat(e.f||[]));d=p}return m},d.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(c),i=0,r=n.length;r>i;i++)!function(t){for(var n,i=t.split(s),r=l,o=0,a=i.length;a>o;o++)r=r.n,r=r.hasOwnProperty(i[o])&&r[i[o]]||(r[i[o]]={n:{}});for(r.f=r.f||[],o=0,a=r.f.length;a>o;o++)if(r.f[o]==e){n=!0;break}!n&&r.f.push(e)}(n[i]);return function(t){+t==+t&&(e.zIndex=+t)}},d.f=function(t){var e=[].slice.call(arguments,1);return function(){d.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},d.stop=function(){r=1},d.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(i):i},d.nts=function(){return i.split(s)},d.off=d.unbind=function(t,e){if(!t)return void(d._events=l={n:{}});var n=t.split(c);if(n.length>1)for(var i=0,r=n.length;r>i;i++)d.off(n[i],e);else{n=t.split(s);var o,p,h,i,r,f,m,y=[l];for(i=0,r=n.length;r>i;i++)for(f=0;f<y.length;f+=h.length-2){if(h=[f,1],o=y[f].n,n[i]!=u)o[n[i]]&&h.push(o[n[i]]);else for(p in o)o[a](p)&&h.push(o[p]);y.splice.apply(y,h)}for(i=0,r=y.length;r>i;i++)for(o=y[i];o.n;){if(e){if(o.f){for(f=0,m=o.f.length;m>f;f++)if(o.f[f]==e){o.f.splice(f,1);break}!o.f.length&&delete o.f}for(p in o.n)if(o.n[a](p)&&o.n[p].f){var v=o.n[p].f;for(f=0,m=v.length;m>f;f++)if(v[f]==e){v.splice(f,1);break}!v.length&&delete o.n[p].f}}else{delete o.f;for(p in o.n)o.n[a](p)&&o.n[p].f&&delete o.n[p].f}o=o.n}}},d.once=function(t,e){var n=function(){return d.unbind(t,n),e.apply(this,arguments)};return d.on(t,n)},d.version=o,d.toString=function(){return"You are running Eve "+o},"undefined"!=typeof n&&n.exports?n.exports=d:"function"==typeof t&&t.amd?t("eve",[],function(){return d}):e.eve=d}(this)},{}],186:[function(e,n,i){!function(e,i,r,o){"use strict";function a(t,e,n){return setTimeout(h(t,n),e)}function s(t,e,n){return Array.isArray(t)?(c(t,n[e],n),!0):!1}function c(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==o)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function u(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&t[i[r]]===o)&&(t[i[r]]=e[i[r]]),r++;return t}function p(t,e){return u(t,e,!0)}function l(t,e,n){var i,r=e.prototype;i=t.prototype=Object.create(r),i.constructor=t,i._super=r,n&&u(i,n)}function h(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==ht?t.apply(e?e[0]||o:o,e):t}function d(t,e){return t===o?e:t}function m(t,e,n){c(x(e),function(e){t.addEventListener(e,n,!1)})}function y(t,e,n){c(x(e),function(e){t.removeEventListener(e,n,!1)})}function v(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function g(t,e){return t.indexOf(e)>-1}function x(t){return t.trim().split(/\s+/g)}function b(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function E(t,e,n){for(var i=[],r=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];b(r,a)<0&&i.push(t[o]),r[o]=a,o++}return n&&(i=e?i.sort(function(t,n){return t[e]>n[e]}):i.sort()),i}function _(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),a=0;a<pt.length;){if(n=pt[a],i=n?n+r:e,i in t)return i;a++}return o}function S(){return yt++}function T(t){var e=t.ownerDocument;return e.defaultView||e.parentWindow}function A(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){f(t.options.enable,[t])&&n.handler(e)},this.init()}function C(t){var e,n=t.options.inputClass;return new(e=n?n:xt?V:bt?W:gt?q:$)(t,M)}function M(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,o=e&At&&i-r===0,a=e&(Mt|Rt)&&i-r===0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,R(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function R(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=k(e)),r>1&&!n.firstMultiple?n.firstMultiple=k(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=D(i);e.timeStamp=mt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=L(s,c),e.distance=I(s,c),N(n,e),e.offsetDirection=B(e.deltaX,e.deltaY),e.scale=a?F(a.pointers,i):1,e.rotation=a?j(a.pointers,i):0,P(n,e);var u=t.element;v(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function N(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};(e.eventType===At||o.eventType===Mt)&&(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function P(t,e){var n,i,r,a,s=t.lastInterval||e,c=e.timeStamp-s.timeStamp;if(e.eventType!=Rt&&(c>Tt||s.velocity===o)){var u=s.deltaX-e.deltaX,p=s.deltaY-e.deltaY,l=O(c,u,p);i=l.x,r=l.y,n=dt(l.x)>dt(l.y)?l.x:l.y,a=B(u,p),t.lastInterval=e}else n=s.velocity,i=s.velocityX,r=s.velocityY,a=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=a}function k(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:ft(t.pointers[n].clientX),clientY:ft(t.pointers[n].clientY)},n++;return{timeStamp:mt(),pointers:e,center:D(e),deltaX:t.deltaX,deltaY:t.deltaY}}function D(t){var e=t.length;if(1===e)return{x:ft(t[0].clientX),y:ft(t[0].clientY)};for(var n=0,i=0,r=0;e>r;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:ft(n/e),y:ft(i/e)}}function O(t,e,n){return{x:e/t||0,y:n/t||0}}function B(t,e){return t===e?Nt:dt(t)>=dt(e)?t>0?Pt:kt:e>0?Dt:Ot}function I(t,e,n){n||(n=jt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function L(t,e,n){n||(n=jt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function j(t,e){return L(e[1],e[0],Ft)-L(t[1],t[0],Ft)}function F(t,e){return I(e[0],e[1],Ft)/I(t[0],t[1],Ft)}function $(){this.evEl=Vt,this.evWin=Gt,this.allow=!0,this.pressed=!1,A.apply(this,arguments)}function V(){this.evEl=Ut,this.evWin=qt,A.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function G(){this.evTarget=Yt,this.evWin=Xt,this.started=!1,A.apply(this,arguments)}function z(t,e){var n=w(t.touches),i=w(t.changedTouches);return e&(Mt|Rt)&&(n=E(n.concat(i),"identifier",!0)),[n,i]}function W(){this.evTarget=Zt,this.targetIds={},A.apply(this,arguments)}function U(t,e){var n=w(t.touches),i=this.targetIds;if(e&(At|Ct)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=w(t.changedTouches),s=[],c=this.target;if(o=n.filter(function(t){return v(t.target,c)}),e===At)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<a.length;)i[a[r].identifier]&&s.push(a[r]),e&(Mt|Rt)&&delete i[a[r].identifier],r++;return s.length?[E(o.concat(s),"identifier",!0),s]:void 0}function q(){A.apply(this,arguments);var t=h(this.handler,this);this.touch=new W(this.manager,t),this.mouse=new $(this.manager,t)}function H(t,e){this.manager=t,this.set(e)}function Y(t){if(g(t,ie))return ie;var e=g(t,re),n=g(t,oe);return e&&n?re+" "+oe:e||n?e?re:oe:g(t,ne)?ne:ee}function X(t){this.id=S(),this.manager=null,this.options=p(t||{},this.defaults),this.options.enable=d(this.options.enable,!0),this.state=ae,this.simultaneous={},this.requireFail=[]}function K(t){return t&le?"cancel":t&ue?"end":t&ce?"move":t&se?"start":""}function Z(t){return t==Ot?"down":t==Dt?"up":t==Pt?"left":t==kt?"right":""}function Q(t,e){var n=e.manager;return n?n.get(t):t}function J(){X.apply(this,arguments)}function tt(){J.apply(this,arguments),this.pX=null,this.pY=null}function et(){J.apply(this,arguments)}function nt(){X.apply(this,arguments),this._timer=null,this._input=null}function it(){J.apply(this,arguments)}function rt(){J.apply(this,arguments)}function ot(){X.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function at(t,e){return e=e||{},e.recognizers=d(e.recognizers,at.defaults.preset),new st(t,e)}function st(t,e){e=e||{},this.options=p(e,at.defaults),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.element=t,this.input=C(this),this.touchAction=new H(this,this.options.touchAction),ct(this,!0),c(e.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ct(t,e){var n=t.element;c(t.options.cssProps,function(t,i){n.style[_(n.style,i)]=e?t:""})}function ut(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var pt=["","webkit","moz","MS","ms","o"],lt=i.createElement("div"),ht="function",ft=Math.round,dt=Math.abs,mt=Date.now,yt=1,vt=/mobile|tablet|ip(ad|hone|od)|android/i,gt="ontouchstart"in e,xt=_(e,"PointerEvent")!==o,bt=gt&&vt.test(navigator.userAgent),wt="touch",Et="pen",_t="mouse",St="kinect",Tt=25,At=1,Ct=2,Mt=4,Rt=8,Nt=1,Pt=2,kt=4,Dt=8,Ot=16,Bt=Pt|kt,It=Dt|Ot,Lt=Bt|It,jt=["x","y"],Ft=["clientX","clientY"];A.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(T(this.element),this.evWin,this.domHandler)}};var $t={mousedown:At,mousemove:Ct,mouseup:Mt},Vt="mousedown",Gt="mousemove mouseup";l($,A,{handler:function(t){var e=$t[t.type];e&At&&0===t.button&&(this.pressed=!0),e&Ct&&1!==t.which&&(e=Mt),this.pressed&&this.allow&&(e&Mt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:_t,srcEvent:t}))}});var zt={pointerdown:At,pointermove:Ct,pointerup:Mt,pointercancel:Rt,pointerout:Rt},Wt={2:wt,3:Et,4:_t,5:St},Ut="pointerdown",qt="pointermove pointerup pointercancel";e.MSPointerEvent&&(Ut="MSPointerDown",qt="MSPointerMove MSPointerUp MSPointerCancel"),l(V,A,{handler:function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=zt[i],o=Wt[t.pointerType]||t.pointerType,a=o==wt,s=b(e,t.pointerId,"pointerId");r&At&&(0===t.button||a)?0>s&&(e.push(t),s=e.length-1):r&(Mt|Rt)&&(n=!0),0>s||(e[s]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var Ht={touchstart:At,touchmove:Ct,touchend:Mt,touchcancel:Rt},Yt="touchstart",Xt="touchstart touchmove touchend touchcancel";l(G,A,{handler:function(t){var e=Ht[t.type];if(e===At&&(this.started=!0),this.started){var n=z.call(this,t,e);e&(Mt|Rt)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:wt,srcEvent:t})}}});var Kt={touchstart:At,touchmove:Ct,touchend:Mt,touchcancel:Rt},Zt="touchstart touchmove touchend touchcancel";l(W,A,{handler:function(t){var e=Kt[t.type],n=U.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:wt,srcEvent:t})}}),l(q,A,{handler:function(t,e,n){var i=n.pointerType==wt,r=n.pointerType==_t;if(i)this.mouse.allow=!1;else if(r&&!this.mouse.allow)return;e&(Mt|Rt)&&(this.mouse.allow=!0),this.callback(t,e,n)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Qt=_(lt.style,"touchAction"),Jt=Qt!==o,te="compute",ee="auto",ne="manipulation",ie="none",re="pan-x",oe="pan-y";H.prototype={set:function(t){t==te&&(t=this.compute()),Jt&&(this.manager.element.style[Qt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return c(this.manager.recognizers,function(e){f(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Y(t.join(" "))},preventDefaults:function(t){if(!Jt){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var i=this.actions,r=g(i,ie),o=g(i,oe),a=g(i,re);return r||o&&n&Bt||a&&n&It?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ae=1,se=2,ce=4,ue=8,pe=ue,le=16,he=32;X.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(s(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=Q(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return s(t,"dropRecognizeWith",this)?this:(t=Q(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(s(t,"requireFailure",this))return this;var e=this.requireFail;return t=Q(t,this),-1===b(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(s(t,"dropRequireFailure",this))return this;t=Q(t,this);var e=b(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(n.options.event+(e?K(i):""),t)}var n=this,i=this.state;ue>i&&e(!0),e(),i>=ue&&e(!0)},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=he)},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(he|ae)))return!1;t++}return!0},recognize:function(t){var e=u({},t);return f(this.options.enable,[this,e])?(this.state&(pe|le|he)&&(this.state=ae),this.state=this.process(e),void(this.state&(se|ce|ue|le)&&this.tryEmit(e))):(this.reset(),void(this.state=he))},process:function(t){},getTouchAction:function(){},reset:function(){}},l(J,X,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,i=e&(se|ce),r=this.attrTest(t);return i&&(n&Rt||!r)?e|le:i||r?n&Mt?e|ue:e&se?e|ce:se:he}}),l(tt,J,{defaults:{event:"pan",threshold:10,pointers:1,direction:Lt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Bt&&e.push(oe),t&It&&e.push(re),e},directionTest:function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,o=t.deltaX,a=t.deltaY;return r&e.direction||(e.direction&Bt?(r=0===o?Nt:0>o?Pt:kt,n=o!=this.pX,i=Math.abs(t.deltaX)):(r=0===a?Nt:0>a?Dt:Ot,n=a!=this.pY,i=Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},attrTest:function(t){return J.prototype.attrTest.call(this,t)&&(this.state&se||!(this.state&se)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Z(t.direction);e&&this.manager.emit(this.options.event+e,t),this._super.emit.call(this,t)}}),l(et,J,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&se)},emit:function(t){if(this._super.emit.call(this,t),1!==t.scale){var e=t.scale<1?"in":"out";this.manager.emit(this.options.event+e,t)}}}),l(nt,X,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[ee]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!i||!n||t.eventType&(Mt|Rt)&&!r)this.reset();else if(t.eventType&At)this.reset(),this._timer=a(function(){this.state=pe,this.tryEmit()},e.time,this);else if(t.eventType&Mt)return pe;return he},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===pe&&(t&&t.eventType&Mt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=mt(),this.manager.emit(this.options.event,this._input)))}}),l(it,J,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&se)}}),l(rt,J,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Bt|It,pointers:1},getTouchAction:function(){return tt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Bt|It)?e=t.velocity:n&Bt?e=t.velocityX:n&It&&(e=t.velocityY),this._super.attrTest.call(this,t)&&n&t.direction&&t.distance>this.options.threshold&&dt(e)>this.options.velocity&&t.eventType&Mt},emit:function(t){var e=Z(t.direction);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),l(ot,X,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ne]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&At&&0===this.count)return this.failTimeout();if(i&&r&&n){if(t.eventType!=Mt)return this.failTimeout();var o=this.pTime?t.timeStamp-this.pTime<e.interval:!0,s=!this.pCenter||I(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t;var c=this.count%e.taps;if(0===c)return this.hasRequireFailures()?(this._timer=a(function(){this.state=pe,this.tryEmit()},e.interval,this),se):pe}return he},failTimeout:function(){return this._timer=a(function(){this.state=he},this.options.interval,this),he},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==pe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),at.VERSION="2.0.4",at.defaults={domEvents:!1,touchAction:te,enable:!0,inputTarget:null,inputClass:null,preset:[[it,{enable:!1}],[et,{enable:!1},["rotate"]],[rt,{direction:Bt}],[tt,{direction:Bt},["swipe"]],[ot],[ot,{event:"doubletap",taps:2},["tap"]],[nt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fe=1,de=2;st.prototype={set:function(t){return u(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?de:fe},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,i=this.recognizers,r=e.curRecognizer;(!r||r&&r.state&pe)&&(r=e.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],e.stopped===de||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(t),!r&&n.state&(se|ce|ue)&&(r=e.curRecognizer=n),o++}},get:function(t){if(t instanceof X)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(s(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(s(t,"remove",this))return this;var e=this.recognizers;return t=this.get(t),e.splice(b(e,t),1),this.touchAction.update(),this},on:function(t,e){var n=this.handlers;return c(x(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},off:function(t,e){var n=this.handlers;return c(x(t),function(t){e?n[t].splice(b(n[t],e),1):delete n[t]}),this},emit:function(t,e){this.options.domEvents&&ut(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var i=0;i<n.length;)n[i](e),i++}},destroy:function(){this.element&&ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(at,{INPUT_START:At,INPUT_MOVE:Ct,INPUT_END:Mt,INPUT_CANCEL:Rt,STATE_POSSIBLE:ae,STATE_BEGAN:se,STATE_CHANGED:ce,STATE_ENDED:ue,STATE_RECOGNIZED:pe,STATE_CANCELLED:le,STATE_FAILED:he,DIRECTION_NONE:Nt,DIRECTION_LEFT:Pt,DIRECTION_RIGHT:kt,DIRECTION_UP:Dt,DIRECTION_DOWN:Ot,DIRECTION_HORIZONTAL:Bt,DIRECTION_VERTICAL:It,DIRECTION_ALL:Lt,Manager:st,Input:A,TouchAction:H,TouchInput:W,MouseInput:$,PointerEventInput:V,TouchMouseInput:q,SingleTouchInput:G,Recognizer:X,AttrRecognizer:J,Tap:ot,Pan:tt,Swipe:rt,Pinch:et,Rotate:it,Press:nt,on:m,off:y,each:c,merge:p,extend:u,inherit:l,bindFn:h,prefixed:_}),typeof t==ht&&t.amd?t(function(){return at}):"undefined"!=typeof n&&n.exports?n.exports=at:e[r]=at}(window,document,"Hammer")},{}],187:[function(e,n,i){!function(r,o){if("function"==typeof t&&t.amd)t(["eve"],function(t){return o(r,t)});else if("undefined"!=typeof i){var a=e(185);n.exports=o(r,a)}else o(r,r.eve)}(window||this,function(t,e){var n=function(e){var n={},i=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,16)},r=Array.isArray||function(t){return t instanceof Array||"[object Array]"==Object.prototype.toString.call(t)},o=0,a="M"+(+new Date).toString(36),s=function(){return a+(o++).toString(36)},c=Date.now||function(){return+new Date},u=function(t){var e=this;if(null==t)return e.s;var n=e.s-t;e.b+=e.dur*n,e.B+=e.dur*n,e.s=t},p=function(t){var e=this;return null==t?e.spd:void(e.spd=t)},l=function(t){var e=this;return null==t?e.dur:(e.s=e.s*t/e.dur,void(e.dur=t))},h=function(){var t=this;delete n[t.id],t.update(),e("mina.stop."+t.id,t)},f=function(){var t=this;t.pdif||(delete n[t.id],t.update(),t.pdif=t.get()-t.b)},d=function(){var t=this;t.pdif&&(t.b=t.get()-t.pdif,delete t.pdif,n[t.id]=t)},m=function(){var t,e=this;if(r(e.start)){t=[];for(var n=0,i=e.start.length;i>n;n++)t[n]=+e.start[n]+(e.end[n]-e.start[n])*e.easing(e.s)}else t=+e.start+(e.end-e.start)*e.easing(e.s);e.set(t)},y=function(){var t=0;for(var r in n)if(n.hasOwnProperty(r)){var o=n[r],a=o.get();t++,o.s=(a-o.b)/(o.dur/o.spd),o.s>=1&&(delete n[r],o.s=1,t--,function(t){setTimeout(function(){e("mina.finish."+t.id,t)})}(o)),o.update()}t&&i(y)},v=function(t,e,r,o,a,c,g){var x={id:s(),start:t,end:e,b:r,s:0,dur:o-r,spd:1,get:a,set:c,easing:g||v.linear,status:u,speed:p,duration:l,stop:h,pause:f,resume:d,update:m};n[x.id]=x;var b,w=0;for(b in n)if(n.hasOwnProperty(b)&&(w++,2==w))break;return 1==w&&i(y),x};return v.time=c,v.getById=function(t){return n[t]||null},v.linear=function(t){return t},v.easeout=function(t){return Math.pow(t,1.7)},v.easein=function(t){return Math.pow(t,.48)},v.easeinout=function(t){if(1==t)return 1;if(0==t)return 0;var e=.48-t/1.04,n=Math.sqrt(.1734+e*e),i=n-e,r=Math.pow(Math.abs(i),1/3)*(0>i?-1:1),o=-n-e,a=Math.pow(Math.abs(o),1/3)*(0>o?-1:1),s=r+a+.5;return 3*(1-s)*s*s+s*s*s},v.backin=function(t){if(1==t)return 1;var e=1.70158;return t*t*((e+1)*t-e)},v.backout=function(t){if(0==t)return 0;t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},v.elastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin(2*(t-.075)*Math.PI/.3)+1},v.bounce=function(t){var e,n=7.5625,i=2.75;return 1/i>t?e=n*t*t:2/i>t?(t-=1.5/i,e=n*t*t+.75):2.5/i>t?(t-=2.25/i,e=n*t*t+.9375):(t-=2.625/i,e=n*t*t+.984375),e},t.mina=v,v}("undefined"==typeof e?function(){}:e),i=function(t){function n(t,e){if(t){if(t.tagName)return E(t);if(r(t,"array")&&n.set)return n.set.apply(n,t);if(t instanceof v)return t;if(null==e)return t=_.doc.querySelector(t),E(t)}return t=null==t?"100%":t,e=null==e?"100%":e,new w(t,e)}function i(t,e){if(e){if("#text"==t&&(t=_.doc.createTextNode(e.text||"")),"string"==typeof t&&(t=i(t)),"string"==typeof e)return"xlink:"==e.substring(0,6)?t.getAttributeNS(W,e.substring(6)):"xml:"==e.substring(0,4)?t.getAttributeNS(U,e.substring(4)):t.getAttribute(e);for(var n in e)if(e[S](n)){var r=T(e[n]);r?"xlink:"==n.substring(0,6)?t.setAttributeNS(W,n.substring(6),r):"xml:"==n.substring(0,4)?t.setAttributeNS(U,n.substring(4),r):t.setAttribute(n,r):t.removeAttribute(n)}}else t=_.doc.createElementNS(U,t);return t}function r(t,e){return e=T.prototype.toLowerCase.call(e),"finite"==e?isFinite(t):"array"==e&&(t instanceof Array||Array.isArray&&Array.isArray(t))?!0:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||O.call(t).slice(8,-1).toLowerCase()==e}function o(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[S](n)&&(e[n]=o(t[n]));return e}function a(t,e){
+for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function s(t,e,n){function i(){var r=Array.prototype.slice.call(arguments,0),o=r.join("␀"),s=i.cache=i.cache||{},c=i.count=i.count||[];return s[S](o)?(a(c,o),n?n(s[o]):s[o]):(c.length>=1e3&&delete s[c.shift()],c.push(o),s[o]=t.apply(e,r),n?n(s[o]):s[o])}return i}function c(t,e,n,i,r,o){if(null==r){var a=t-n,s=e-i;return a||s?(180+180*M.atan2(-s,-a)/k+360)%360:0}return c(t,e,r,o)-c(n,i,r,o)}function u(t){return t%360*k/180}function p(t){return 180*t/k%360}function l(t){var e=[];return t=t.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(t,n,i){return i=i.split(/\s*,\s*|\s+/),"rotate"==n&&1==i.length&&i.push(0,0),"scale"==n&&(i.length>2?i=i.slice(0,2):2==i.length&&i.push(0,0),1==i.length&&i.push(i[0],0,0)),"skewX"==n?e.push(["m",1,0,M.tan(u(i[0])),1,0,0]):"skewY"==n?e.push(["m",1,M.tan(u(i[0])),0,1,0,0]):e.push([n.charAt(0)].concat(i)),t}),e}function h(t,e){var i=J(t),r=new n.Matrix;if(i)for(var o=0,a=i.length;a>o;o++){var s,c,u,p,l,h=i[o],f=h.length,d=T(h[0]).toLowerCase(),m=h[0]!=d,y=m?r.invert():0;"t"==d&&2==f?r.translate(h[1],0):"t"==d&&3==f?m?(s=y.x(0,0),c=y.y(0,0),u=y.x(h[1],h[2]),p=y.y(h[1],h[2]),r.translate(u-s,p-c)):r.translate(h[1],h[2]):"r"==d?2==f?(l=l||e,r.rotate(h[1],l.x+l.width/2,l.y+l.height/2)):4==f&&(m?(u=y.x(h[2],h[3]),p=y.y(h[2],h[3]),r.rotate(h[1],u,p)):r.rotate(h[1],h[2],h[3])):"s"==d?2==f||3==f?(l=l||e,r.scale(h[1],h[f-1],l.x+l.width/2,l.y+l.height/2)):4==f?m?(u=y.x(h[2],h[3]),p=y.y(h[2],h[3]),r.scale(h[1],h[1],u,p)):r.scale(h[1],h[1],h[2],h[3]):5==f&&(m?(u=y.x(h[3],h[4]),p=y.y(h[3],h[4]),r.scale(h[1],h[2],u,p)):r.scale(h[1],h[2],h[3],h[4])):"m"==d&&7==f&&r.add(h[1],h[2],h[3],h[4],h[5],h[6])}return r}function f(t){var e=t.node.ownerSVGElement&&E(t.node.ownerSVGElement)||t.node.parentNode&&E(t.node.parentNode)||n.select("svg")||n(0,0),i=e.select("defs"),r=null==i?!1:i.node;return r||(r=b("defs",e.node).node),r}function d(t){return t.node.ownerSVGElement&&E(t.node.ownerSVGElement)||n.select("svg")}function m(t,e,n){function r(t){if(null==t)return D;if(t==+t)return t;i(u,{width:t});try{return u.getBBox().width}catch(e){return 0}}function o(t){if(null==t)return D;if(t==+t)return t;i(u,{height:t});try{return u.getBBox().height}catch(e){return 0}}function a(i,r){null==e?c[i]=r(t.attr(i)||0):i==e&&(c=r(null==n?t.attr(i)||0:n))}var s=d(t).node,c={},u=s.querySelector(".svg---mgr");switch(u||(u=i("rect"),i(u,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),s.appendChild(u)),t.type){case"rect":a("rx",r),a("ry",o);case"image":a("width",r),a("height",o);case"text":a("x",r),a("y",o);break;case"circle":a("cx",r),a("cy",o),a("r",r);break;case"ellipse":a("cx",r),a("cy",o),a("rx",r),a("ry",o);break;case"line":a("x1",r),a("x2",r),a("y1",o),a("y2",o);break;case"marker":a("refX",r),a("markerWidth",r),a("refY",o),a("markerHeight",o);break;case"radialGradient":a("fx",r),a("fy",o);break;case"tspan":a("dx",r),a("dy",o);break;default:a(e,r)}return s.removeChild(u),c}function y(t){r(t,"array")||(t=Array.prototype.slice.call(arguments,0));for(var e=0,n=0,i=this.node;this[e];)delete this[e++];for(e=0;e<t.length;e++)"set"==t[e].type?t[e].forEach(function(t){i.appendChild(t.node)}):i.appendChild(t[e].node);var o=i.childNodes;for(e=0;e<o.length;e++)this[n++]=E(o[e]);return this}function v(t){if(t.snap in q)return q[t.snap];var e;try{e=t.ownerSVGElement}catch(n){}this.node=t,e&&(this.paper=new w(e)),this.type=t.tagName;var i=this.id=z(this);if(this.anims={},this._={transform:[]},t.snap=i,q[i]=this,"g"==this.type&&(this.add=y),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var r in w.prototype)w.prototype[S](r)&&(this[r]=w.prototype[r])}function x(t){this.node=t}function b(t,e){var n=i(t);e.appendChild(n);var r=E(n);return r}function w(t,e){var n,r,o,a=w.prototype;if(t&&"svg"==t.tagName){if(t.snap in q)return q[t.snap];var s=t.ownerDocument;n=new v(t),r=t.getElementsByTagName("desc")[0],o=t.getElementsByTagName("defs")[0],r||(r=i("desc"),r.appendChild(s.createTextNode("Created with Snap")),n.node.appendChild(r)),o||(o=i("defs"),n.node.appendChild(o)),n.defs=o;for(var c in a)a[S](c)&&(n[c]=a[c]);n.paper=n.root=n}else n=b("svg",_.doc.body),i(n.node,{height:e,version:1.1,width:t,xmlns:U});return n}function E(t){return t?t instanceof v||t instanceof x?t:t.tagName&&"svg"==t.tagName.toLowerCase()?new w(t):t.tagName&&"object"==t.tagName.toLowerCase()&&"image/svg+xml"==t.type?new w(t.contentDocument.getElementsByTagName("svg")[0]):new v(t):t}n.version="0.3.0",n.toString=function(){return"Snap v"+this.version},n._={};var _={win:t.window,doc:t.window.document};n._.glob=_;var S="hasOwnProperty",T=String,A=parseFloat,C=parseInt,M=Math,R=M.max,N=M.min,P=M.abs,k=(M.pow,M.PI),D=(M.round,""),O=Object.prototype.toString,B=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,I=(n._.separator=/[,\s]+/,/[\s]*,[\s]*/),L={hs:1,rg:1},j=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,F=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,$=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,V=0,G="S"+(+new Date).toString(36),z=function(t){return(t&&t.type?t.type:D)+G+(V++).toString(36)},W="http://www.w3.org/1999/xlink",U="http://www.w3.org/2000/svg",q={};n.url=function(t){return"url('#"+t+"')"};n._.$=i,n._.id=z,n.format=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,i){var r=i;return n.replace(e,function(t,e,n,i,o){e=e||i,r&&(e in r&&(r=r[e]),"function"==typeof r&&o&&(r=r()))}),r=(null==r||r==i?t:r)+""};return function(e,i){return T(e).replace(t,function(t,e){return n(t,e,i)})}}(),n._.clone=o,n._.cacher=s,n.rad=u,n.deg=p,n.angle=c,n.is=r,n.snapTo=function(t,e,n){if(n=r(n,"finite")?n:10,r(t,"array")){for(var i=t.length;i--;)if(P(t[i]-e)<=n)return t[i]}else{t=+t;var o=e%t;if(n>o)return e-o;if(o>t-n)return e-o+t}return e},n.getRGB=s(function(t){if(!t||(t=T(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:K};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:K};if(!(L[S](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=H(t)),!t)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:K};var e,i,o,a,s,c,u=t.match(B);return u?(u[2]&&(o=C(u[2].substring(5),16),i=C(u[2].substring(3,5),16),e=C(u[2].substring(1,3),16)),u[3]&&(o=C((s=u[3].charAt(3))+s,16),i=C((s=u[3].charAt(2))+s,16),e=C((s=u[3].charAt(1))+s,16)),u[4]&&(c=u[4].split(I),e=A(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),i=A(c[1]),"%"==c[1].slice(-1)&&(i*=2.55),o=A(c[2]),"%"==c[2].slice(-1)&&(o*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(a=A(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100)),u[5]?(c=u[5].split(I),e=A(c[0]),"%"==c[0].slice(-1)&&(e/=100),i=A(c[1]),"%"==c[1].slice(-1)&&(i/=100),o=A(c[2]),"%"==c[2].slice(-1)&&(o/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(a=A(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),n.hsb2rgb(e,i,o,a)):u[6]?(c=u[6].split(I),e=A(c[0]),"%"==c[0].slice(-1)&&(e/=100),i=A(c[1]),"%"==c[1].slice(-1)&&(i/=100),o=A(c[2]),"%"==c[2].slice(-1)&&(o/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(a=A(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),n.hsl2rgb(e,i,o,a)):(e=N(M.round(e),255),i=N(M.round(i),255),o=N(M.round(o),255),a=N(R(a,0),1),u={r:e,g:i,b:o,toString:K},u.hex="#"+(16777216|o|i<<8|e<<16).toString(16).slice(1),u.opacity=r(a,"finite")?a:1,u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:K}},n),n.hsb=s(function(t,e,i){return n.hsb2rgb(t,e,i).hex}),n.hsl=s(function(t,e,i){return n.hsl2rgb(t,e,i).hex}),n.rgb=s(function(t,e,n,i){if(r(i,"finite")){var o=M.round;return"rgba("+[o(t),o(e),o(n),+i.toFixed(2)]+")"}return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)});var H=function(t){var e=_.doc.getElementsByTagName("head")[0]||_.doc.getElementsByTagName("svg")[0],n="rgb(255, 0, 0)";return(H=s(function(t){if("red"==t.toLowerCase())return n;e.style.color=n,e.style.color=t;var i=_.doc.defaultView.getComputedStyle(e,D).getPropertyValue("color");return i==n?null:i}))(t)},Y=function(){return"hsb("+[this.h,this.s,this.b]+")"},X=function(){return"hsl("+[this.h,this.s,this.l]+")"},K=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},Z=function(t,e,i){if(null==e&&r(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,e=t.g,t=t.r),null==e&&r(t,string)){var o=n.getRGB(t);t=o.r,e=o.g,i=o.b}return(t>1||e>1||i>1)&&(t/=255,e/=255,i/=255),[t,e,i]},Q=function(t,e,i,o){t=M.round(255*t),e=M.round(255*e),i=M.round(255*i);var a={r:t,g:e,b:i,opacity:r(o,"finite")?o:1,hex:n.rgb(t,e,i),toString:K};return r(o,"finite")&&(a.opacity=o),a};n.color=function(t){var e;return r(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=n.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):r(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=n.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):(r(t,"string")&&(t=n.getRGB(t)),r(t,"object")&&"r"in t&&"g"in t&&"b"in t&&!("error"in t)?(e=n.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=n.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1,t.error=1)),t.toString=K,t},n.hsb2rgb=function(t,e,n,i){r(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,t=t.h,i=t.o),t*=360;var o,a,s,c,u;return t=t%360/60,u=n*e,c=u*(1-P(t%2-1)),o=a=s=n-u,t=~~t,o+=[u,c,0,0,c,u][t],a+=[c,u,u,c,0,0][t],s+=[0,0,c,u,u,c][t],Q(o,a,s,i)},n.hsl2rgb=function(t,e,n,i){r(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),t*=360;var o,a,s,c,u;return t=t%360/60,u=2*e*(.5>n?n:1-n),c=u*(1-P(t%2-1)),o=a=s=n-u/2,t=~~t,o+=[u,c,0,0,c,u][t],a+=[c,u,u,c,0,0][t],s+=[0,0,c,u,u,c][t],Q(o,a,s,i)},n.rgb2hsb=function(t,e,n){n=Z(t,e,n),t=n[0],e=n[1],n=n[2];var i,r,o,a;return o=R(t,e,n),a=o-N(t,e,n),i=0==a?null:o==t?(e-n)/a:o==e?(n-t)/a+2:(t-e)/a+4,i=(i+360)%6*60/360,r=0==a?0:a/o,{h:i,s:r,b:o,toString:Y}},n.rgb2hsl=function(t,e,n){n=Z(t,e,n),t=n[0],e=n[1],n=n[2];var i,r,o,a,s,c;return a=R(t,e,n),s=N(t,e,n),c=a-s,i=0==c?null:a==t?(e-n)/c:a==e?(n-t)/c+2:(t-e)/c+4,i=(i+360)%6*60/360,o=(a+s)/2,r=0==c?0:.5>o?c/(2*o):c/(2-2*o),{h:i,s:r,l:o,toString:X}},n.parsePathString=function(t){if(!t)return null;var e=n.path(t);if(e.arr)return n.path.clone(e.arr);var i={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},o=[];return r(t,"array")&&r(t[0],"array")&&(o=n.path.clone(t)),o.length||T(t).replace(j,function(t,e,n){var r=[],a=e.toLowerCase();if(n.replace($,function(t,e){e&&r.push(+e)}),"m"==a&&r.length>2&&(o.push([e].concat(r.splice(0,2))),a="l",e="m"==e?"l":"L"),"o"==a&&1==r.length&&o.push([e,r[0]]),"r"==a)o.push([e].concat(r));else for(;r.length>=i[a]&&(o.push([e].concat(r.splice(0,i[a]))),i[a]););}),o.toString=n.path.toString,e.arr=n.path.clone(o),o};var J=n.parseTransformString=function(t){if(!t)return null;var e=[];return r(t,"array")&&r(t[0],"array")&&(e=n.path.clone(t)),e.length||T(t).replace(F,function(t,n,i){var r=[];n.toLowerCase();i.replace($,function(t,e){e&&r.push(+e)}),e.push([n].concat(r))}),e.toString=n.path.toString,e};n._.svgTransform2string=l,n._.rgTransform=/^[a-z][\s]*-?\.?\d/i,n._.transform2matrix=h,n._unit2px=m;_.doc.contains||_.doc.compareDocumentPosition?function(t,e){var n=9==t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t==i||!(!i||1!=i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e;)if(e=e.parentNode,e==t)return!0;return!1};n._.getSomeDefs=f,n._.getSomeSVG=d,n.select=function(t){return t=T(t).replace(/([^\\]):/g,"$1\\:"),E(_.doc.querySelector(t))},n.selectAll=function(t){for(var e=_.doc.querySelectorAll(t),i=(n.set||Array)(),r=0;r<e.length;r++)i.push(E(e[r]));return i},setInterval(function(){for(var t in q)if(q[S](t)){var e=q[t],n=e.node;("svg"!=e.type&&!n.ownerSVGElement||"svg"==e.type&&(!n.parentNode||"ownerSVGElement"in n.parentNode&&!n.ownerSVGElement))&&delete q[t]}},1e4),v.prototype.attr=function(t,n){var i=this;i.node;if(!t)return i;if(r(t,"string")){if(!(arguments.length>1))return e("snap.util.getattr."+t,i).firstDefined();var o={};o[t]=n,t=o}for(var a in t)t[S](a)&&e("snap.util.attr."+a,i,t[a]);return i},n.parse=function(t){var e=_.doc.createDocumentFragment(),n=!0,i=_.doc.createElement("div");if(t=T(t),t.match(/^\s*<\s*svg(?:\s|>)/)||(t="<svg>"+t+"</svg>",n=!1),i.innerHTML=t,t=i.getElementsByTagName("svg")[0])if(n)e=t;else{for(;t.firstChild;)e.appendChild(t.firstChild);i.innerHTML=D}return new x(e)},n.fragment=function(){for(var t=Array.prototype.slice.call(arguments,0),e=_.doc.createDocumentFragment(),i=0,r=t.length;r>i;i++){var o=t[i];o.node&&o.node.nodeType&&e.appendChild(o.node),o.nodeType&&e.appendChild(o),"string"==typeof o&&e.appendChild(n.parse(o).node)}return new x(e)},n._.make=b,n._.wrap=E,w.prototype.el=function(t,e){var n=b(t,this.node);return e&&n.attr(e),n},e.on("snap.util.getattr",function(){var t=e.nt();t=t.substring(t.lastIndexOf(".")+1);var n=t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});return tt[S](n)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(n):i(this.node,t)});var tt={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};e.on("snap.util.attr",function(t){var n=e.nt(),r={};n=n.substring(n.lastIndexOf(".")+1),r[n]=t;var o=n.replace(/-(\w)/gi,function(t,e){return e.toUpperCase()}),a=n.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});tt[S](a)?this.node.style[o]=null==t?D:t:i(this.node,r)}),function(t){}(w.prototype),n.ajax=function(t,n,i,o){var a=new XMLHttpRequest,s=z();if(a){if(r(n,"function"))o=i,i=n,n=null;else if(r(n,"object")){var c=[];for(var u in n)n.hasOwnProperty(u)&&c.push(encodeURIComponent(u)+"="+encodeURIComponent(n[u]));n=c.join("&")}return a.open(n?"POST":"GET",t,!0),n&&(a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("Content-type","application/x-www-form-urlencoded")),i&&(e.once("snap.ajax."+s+".0",i),e.once("snap.ajax."+s+".200",i),e.once("snap.ajax."+s+".304",i)),a.onreadystatechange=function(){4==a.readyState&&e("snap.ajax."+s+"."+a.status,o,a)},4==a.readyState?a:(a.send(n),a)}},n.load=function(t,e,i){n.ajax(t,function(t){var r=n.parse(t.responseText);i?e.call(i,r):e(r)})};var et=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,i=n.body,r=n.documentElement,o=r.clientTop||i.clientTop||0,a=r.clientLeft||i.clientLeft||0,s=e.top+(g.win.pageYOffset||r.scrollTop||i.scrollTop)-o,c=e.left+(g.win.pageXOffset||r.scrollLeft||i.scrollLeft)-a;return{y:s,x:c}};return n.getElementByPoint=function(t,e){var n=this,i=(n.canvas,_.doc.elementFromPoint(t,e));if(_.win.opera&&"svg"==i.tagName){var r=et(i),o=i.createSVGRect();o.x=t-r.x,o.y=e-r.y,o.width=o.height=1;var a=i.getIntersectionList(o,null);a.length&&(i=a[a.length-1])}return i?E(i):null},n.plugin=function(t){t(n,v,w,_,x)},_.win.Snap=n,n}(t||this);return i.plugin(function(i,r,o,a,s){function c(t,e){if(null==e){var n=!0;if(e="linearGradient"==t.type||"radialGradient"==t.type?t.node.getAttribute("gradientTransform"):"pattern"==t.type?t.node.getAttribute("patternTransform"):t.node.getAttribute("transform"),!e)return new i.Matrix;e=i._.svgTransform2string(e)}else e=i._.rgTransform.test(e)?d(e).replace(/\.{3}|\u2026/g,t._.transform||E):i._.svgTransform2string(e),f(e,"array")&&(e=i.path?i.path.toString.call(e):d(e)),t._.transform=e;var r=i._.transform2matrix(e,t.getBBox(1));return n?r:void(t.matrix=r)}function u(t){function e(t,e){var n=y(t.node,e);n=n&&n.match(o),n=n&&n[2],n&&"#"==n.charAt()&&(n=n.substring(1),n&&(s[n]=(s[n]||[]).concat(function(n){var i={};i[e]=URL(n),y(t.node,i)})))}function n(t){var e=y(t.node,"xlink:href");e&&"#"==e.charAt()&&(e=e.substring(1),e&&(s[e]=(s[e]||[]).concat(function(e){t.attr("xlink:href","#"+e)})))}for(var i,r=t.selectAll("*"),o=/^\s*url\(("|'|)(.*)\1\)\s*$/,a=[],s={},c=0,u=r.length;u>c;c++){i=r[c],e(i,"fill"),e(i,"stroke"),e(i,"filter"),e(i,"mask"),e(i,"clip-path"),n(i);var p=y(i.node,"id");p&&(y(i.node,{id:i.id}),a.push({old:p,id:i.id}))}for(c=0,u=a.length;u>c;c++){var l=s[a[c].old];if(l)for(var h=0,f=l.length;f>h;h++)l[h](a[c].id)}}function p(t,e,n){return function(i){var r=i.slice(t,e);return 1==r.length&&(r=r[0]),n?n(r):r}}function l(t){return function(){var e=t?"<"+this.type:"",n=this.node.attributes,i=this.node.childNodes;if(t)for(var r=0,o=n.length;o>r;r++)e+=" "+n[r].name+'="'+n[r].value.replace(/"/g,'\\"')+'"';if(i.length){for(t&&(e+=">"),r=0,o=i.length;o>r;r++)3==i[r].nodeType?e+=i[r].nodeValue:1==i[r].nodeType&&(e+=b(i[r]).toString());t&&(e+="</"+this.type+">")}else t&&(e+="/>");return e}}var h=r.prototype,f=i.is,d=String,m=i._unit2px,y=i._.$,v=i._.make,g=i._.getSomeDefs,x="hasOwnProperty",b=i._.wrap;h.getBBox=function(t){if(!i.Matrix||!i.path)return this.node.getBBox();var e=this,n=new i.Matrix;if(e.removed)return i._.box();for(;"use"==e.type;)if(t||(n=n.add(e.transform().localMatrix.translate(e.attr("x")||0,e.attr("y")||0))),e.original)e=e.original;else{var r=e.attr("xlink:href");e=e.original=e.node.ownerDocument.getElementById(r.substring(r.indexOf("#")+1))}var o=e._,a=i.path.get[e.type]||i.path.get.deflt;try{return t?(o.bboxwt=a?i.path.getBBox(e.realPath=a(e)):i._.box(e.node.getBBox()),i._.box(o.bboxwt)):(e.realPath=a(e),e.matrix=e.transform().localMatrix,o.bbox=i.path.getBBox(i.path.map(e.realPath,n.add(e.matrix))),i._.box(o.bbox))}catch(s){return i._.box()}};var w=function(){return this.string};h.transform=function(t){var e=this._;if(null==t){for(var n,r=this,o=new i.Matrix(this.node.getCTM()),a=c(this),s=[a],u=new i.Matrix,p=a.toTransformString(),l=d(a)==d(this.matrix)?d(e.transform):p;"svg"!=r.type&&(r=r.parent());)s.push(c(r));for(n=s.length;n--;)u.add(s[n]);return{string:l,globalMatrix:o,totalMatrix:u,localMatrix:a,diffMatrix:o.clone().add(a.invert()),global:o.toTransformString(),total:u.toTransformString(),local:p,toString:w}}return t instanceof i.Matrix?(this.matrix=t,this._.transform=t.toTransformString()):c(this,t),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?y(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?y(this.node,{patternTransform:this.matrix}):y(this.node,{transform:this.matrix})),this},h.parent=function(){return b(this.node.parentNode)},h.append=h.add=function(t){if(t){if("set"==t.type){var e=this;return t.forEach(function(t){e.add(t)}),this}t=b(t),this.node.appendChild(t.node),t.paper=this.paper}return this},h.appendTo=function(t){return t&&(t=b(t),t.append(this)),this},h.prepend=function(t){if(t){if("set"==t.type){var e,n=this;return t.forEach(function(t){e?e.after(t):n.prepend(t),e=t}),this}t=b(t);var i=t.parent();this.node.insertBefore(t.node,this.node.firstChild),this.add&&this.add(),t.paper=this.paper,this.parent()&&this.parent().add(),i&&i.add()}return this},h.prependTo=function(t){return t=b(t),t.prepend(this),this},h.before=function(t){if("set"==t.type){var e=this;return t.forEach(function(t){var n=t.parent();e.node.parentNode.insertBefore(t.node,e.node),n&&n.add()}),this.parent().add(),this}t=b(t);var n=t.parent();return this.node.parentNode.insertBefore(t.node,this.node),this.parent()&&this.parent().add(),n&&n.add(),t.paper=this.paper,this},h.after=function(t){t=b(t);var e=t.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(t.node,this.node.nextSibling):this.node.parentNode.appendChild(t.node),this.parent()&&this.parent().add(),e&&e.add(),t.paper=this.paper,this},h.insertBefore=function(t){t=b(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},h.insertAfter=function(t){t=b(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node.nextSibling),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},h.remove=function(){var t=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,t&&t.add(),this},h.select=function(t){return t=d(t).replace(/([^\\]):/g,"$1\\:"),b(this.node.querySelector(t))},h.selectAll=function(t){for(var e=this.node.querySelectorAll(t),n=(i.set||Array)(),r=0;r<e.length;r++)n.push(b(e[r]));return n},h.asPX=function(t,e){return null==e&&(e=this.attr(t)),+m(this,t,e)},h.use=function(){var t,e=this.node.id;return e||(e=this.id,y(this.node,{id:e})),t="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?v(this.type,this.node.parentNode):v("use",this.node.parentNode),y(t.node,{"xlink:href":"#"+e}),t.original=this,t},h.clone=function(){var t=b(this.node.cloneNode(!0));return y(t.node,"id")&&y(t.node,{id:t.id}),u(t),t.insertAfter(this),t},h.toDefs=function(){var t=g(this);return t.appendChild(this.node),this},h.pattern=h.toPattern=function(t,e,n,i){var r=v("pattern",g(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,n=t.width,i=t.height,t=t.x),y(r.node,{x:t,y:e,width:n,height:i,patternUnits:"userSpaceOnUse",id:r.id,viewBox:[t,e,n,i].join(" ")}),r.node.appendChild(this.node),r},h.marker=function(t,e,n,i,r,o){var a=v("marker",g(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,n=t.width,i=t.height,r=t.refX||t.cx,o=t.refY||t.cy,t=t.x),y(a.node,{viewBox:[t,e,n,i].join(" "),markerWidth:n,markerHeight:i,orient:"auto",refX:r||0,refY:o||0,id:a.id}),a.node.appendChild(this.node),a};var _=function(t,e,i,r){"function"!=typeof i||i.length||(r=i,i=n.linear),this.attr=t,this.dur=e,i&&(this.easing=i),r&&(this.callback=r)};i._.Animation=_,i.animation=function(t,e,n,i){return new _(t,e,n,i)},h.inAnim=function(){var t=this,e=[];for(var n in t.anims)t.anims[x](n)&&!function(t){e.push({anim:new _(t._attrs,t.dur,t.easing,t._callback),mina:t,curStatus:t.status(),status:function(e){return t.status(e)},stop:function(){t.stop()}})}(t.anims[n]);return e},i.animate=function(t,i,r,o,a,s){"function"!=typeof a||a.length||(s=a,a=n.linear);var c=n.time(),u=n(t,i,c,c+o,n.time,r,a);return s&&e.once("mina.finish."+u.id,s),u},h.stop=function(){for(var t=this.inAnim(),e=0,n=t.length;n>e;e++)t[e].stop();return this},h.animate=function(t,i,r,o){"function"!=typeof r||r.length||(o=r,r=n.linear),t instanceof _&&(o=t.callback,r=t.easing,i=r.dur,t=t.attr);var a,s,c,u,l=[],h=[],m={},y=this;for(var v in t)if(t[x](v)){y.equal?(u=y.equal(v,d(t[v])),a=u.from,s=u.to,c=u.f):(a=+y.attr(v),s=+t[v]);var g=f(a,"array")?a.length:1;m[v]=p(l.length,l.length+g,c),l=l.concat(a),h=h.concat(s)}var b=n.time(),w=n(l,h,b,b+i,n.time,function(t){var e={};for(var n in m)m[x](n)&&(e[n]=m[n](t));y.attr(e)},r);return y.anims[w.id]=w,w._attrs=t,w._callback=o,e("snap.animcreated."+y.id,w),e.once("mina.finish."+w.id,function(){delete y.anims[w.id],o&&o.call(y)}),e.once("mina.stop."+w.id,function(){delete y.anims[w.id]}),y};var S={};h.data=function(t,n){var r=S[this.id]=S[this.id]||{};if(0==arguments.length)return e("snap.data.get."+this.id,this,r,null),r;if(1==arguments.length){if(i.is(t,"object")){for(var o in t)t[x](o)&&this.data(o,t[o]);return this}return e("snap.data.get."+this.id,this,r[t],t),r[t]}return r[t]=n,e("snap.data.set."+this.id,this,n,t),this},h.removeData=function(t){return null==t?S[this.id]={}:S[this.id]&&delete S[this.id][t],this},h.outerSVG=h.toString=l(1),h.innerSVG=l(),h.toDataURL=function(){if(t&&t.btoa){var e=this.getBBox(),n=i.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+e.x.toFixed(3),y:+e.y.toFixed(3),width:+e.width.toFixed(3),height:+e.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))}},s.prototype.select=h.select,s.prototype.selectAll=h.selectAll}),i.plugin(function(t,e,n,i,r){function o(t,e,n,i,r,o){return null==e&&"[object SVGMatrix]"==a.call(t)?(this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,void(this.f=t.f)):void(null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+i,this.e=+r,this.f=+o):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var a=Object.prototype.toString,s=String,c=Math,u="";!function(e){function n(t){return t[0]*t[0]+t[1]*t[1]}function i(t){var e=c.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}e.add=function(t,e,n,i,r,a){var s,c,u,p,l=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,r],[e,i,a],[0,0,1]];for(t&&t instanceof o&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),s=0;3>s;s++)for(c=0;3>c;c++){for(p=0,u=0;3>u;u++)p+=h[s][u]*f[u][c];l[s][c]=p}return this.a=l[0][0],this.b=l[1][0],this.c=l[0][1],this.d=l[1][1],this.e=l[0][2],this.f=l[1][2],this},e.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new o(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},e.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(t,e){return this.add(1,0,0,1,t,e)},e.scale=function(t,e,n,i){return null==e&&(e=t),(n||i)&&this.add(1,0,0,1,n,i),this.add(t,0,0,e,0,0),(n||i)&&this.add(1,0,0,1,-n,-i),this},e.rotate=function(e,n,i){e=t.rad(e),n=n||0,i=i||0;var r=+c.cos(e).toFixed(9),o=+c.sin(e).toFixed(9);return this.add(r,o,-o,r,n,i),this.add(1,0,0,1,-n,-i)},e.x=function(t,e){return t*this.a+e*this.c+this.e},e.y=function(t,e){return t*this.b+e*this.d+this.f},e.get=function(t){return+this[s.fromCharCode(97+t)].toFixed(4)},e.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.determinant=function(){return this.a*this.d-this.b*this.c},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var r=[[this.a,this.c],[this.b,this.d]];e.scalex=c.sqrt(n(r[0])),i(r[0]),e.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*e.shear,r[1][1]-r[0][1]*e.shear],e.scaley=c.sqrt(n(r[1])),i(r[1]),e.shear/=e.scaley,this.determinant()<0&&(e.scalex=-e.scalex);var o=-r[0][1],a=r[1][1];return 0>a?(e.rotate=t.deg(c.acos(a)),0>o&&(e.rotate=360-e.rotate)):e.rotate=t.deg(c.asin(o)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(t){var e=t||this.split();return+e.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[+e.dx.toFixed(4),+e.dy.toFixed(4)]:u)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:u)+(e.rotate?"r"+[+e.rotate.toFixed(4),0,0]:u))}}(o.prototype),t.Matrix=o,t.matrix=function(t,e,n,i,r,a){return new o(t,e,n,i,r,a)}}),i.plugin(function(t,n,i,r,o){function a(i){return function(r){if(e.stop(),r instanceof o&&1==r.node.childNodes.length&&("radialGradient"==r.node.firstChild.tagName||"linearGradient"==r.node.firstChild.tagName||"pattern"==r.node.firstChild.tagName)&&(r=r.node.firstChild,f(this).appendChild(r),r=l(r)),r instanceof n)if("radialGradient"==r.type||"linearGradient"==r.type||"pattern"==r.type){r.node.id||m(r.node,{id:r.id});var a=y(r.node.id)}else a=r.attr(i);else if(a=t.color(r),a.error){var s=t(f(this).ownerSVGElement).gradient(r);s?(s.node.id||m(s.node,{id:s.id}),a=y(s.node.id)):a=r}else a=v(a);var c={};c[i]=a,m(this.node,c),this.node.style[i]=x}}function s(t){e.stop(),t==+t&&(t+="px"),this.node.style.fontSize=t}function c(t){for(var e=[],n=t.childNodes,i=0,r=n.length;r>i;i++){var o=n[i];3==o.nodeType&&e.push(o.nodeValue),"tspan"==o.tagName&&(1==o.childNodes.length&&3==o.firstChild.nodeType?e.push(o.firstChild.nodeValue):e.push(c(o)))}return e}function u(){return e.stop(),this.node.style.fontSize}var p=t._.make,l=t._.wrap,h=t.is,f=t._.getSomeDefs,d=/^url\(#?([^)]+)\)$/,m=t._.$,y=t.url,v=String,g=t._.separator,x="";e.on("snap.util.attr.mask",function(t){if(t instanceof n||t instanceof o){if(e.stop(),t instanceof o&&1==t.node.childNodes.length&&(t=t.node.firstChild,f(this).appendChild(t),t=l(t)),"mask"==t.type)var i=t;else i=p("mask",f(this)),i.node.appendChild(t.node);!i.node.id&&m(i.node,{id:i.id}),m(this.node,{mask:y(i.id)})}}),function(t){e.on("snap.util.attr.clip",t),e.on("snap.util.attr.clip-path",t),e.on("snap.util.attr.clipPath",t)}(function(t){if(t instanceof n||t instanceof o){if(e.stop(),"clipPath"==t.type)var i=t;else i=p("clipPath",f(this)),i.node.appendChild(t.node),!i.node.id&&m(i.node,{id:i.id});m(this.node,{"clip-path":y(i.node.id||i.id)})}}),e.on("snap.util.attr.fill",a("fill")),e.on("snap.util.attr.stroke",a("stroke"));var b=/^([lr])(?:\(([^)]*)\))?(.*)$/i;e.on("snap.util.grad.parse",function(t){t=v(t);var e=t.match(b);if(!e)return null;var n=e[1],i=e[2],r=e[3];return i=i.split(/\s*,\s*/).map(function(t){return+t==t?+t:t}),1==i.length&&0==i[0]&&(i=[]),r=r.split("-"),r=r.map(function(t){t=t.split(":");var e={color:t[0]};return t[1]&&(e.offset=parseFloat(t[1])),e}),{type:n,params:i,stops:r}}),e.on("snap.util.attr.d",function(n){e.stop(),h(n,"array")&&h(n[0],"array")&&(n=t.path.toString.call(n)),n=v(n),n.match(/[ruo]/i)&&(n=t.path.toAbsolute(n)),m(this.node,{d:n})})(-1),e.on("snap.util.attr.#text",function(t){e.stop(),t=v(t);for(var n=r.doc.createTextNode(t);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(n)})(-1),e.on("snap.util.attr.path",function(t){e.stop(),this.attr({d:t})})(-1),e.on("snap.util.attr.class",function(t){e.stop(),this.node.className.baseVal=t})(-1),e.on("snap.util.attr.viewBox",function(t){var n;n=h(t,"object")&&"x"in t?[t.x,t.y,t.width,t.height].join(" "):h(t,"array")?t.join(" "):t,m(this.node,{viewBox:n}),e.stop()})(-1),e.on("snap.util.attr.transform",function(t){this.transform(t),e.stop()})(-1),e.on("snap.util.attr.r",function(t){"rect"==this.type&&(e.stop(),m(this.node,{rx:t,ry:t}))})(-1),e.on("snap.util.attr.textpath",function(t){if(e.stop(),"text"==this.type){var i,r,o;if(!t&&this.textPath){for(r=this.textPath;r.node.firstChild;)this.node.appendChild(r.node.firstChild);return r.remove(),void delete this.textPath}if(h(t,"string")){var a=f(this),s=l(a.parentNode).path(t);a.appendChild(s.node),i=s.id,s.attr({id:i})}else t=l(t),t instanceof n&&(i=t.attr("id"),i||(i=t.id,t.attr({id:i})));if(i)if(r=this.textPath,o=this.node,r)r.attr({"xlink:href":"#"+i});else{for(r=m("textPath",{"xlink:href":"#"+i});o.firstChild;)r.appendChild(o.firstChild);o.appendChild(r),this.textPath=l(r)}}})(-1),e.on("snap.util.attr.text",function(t){if("text"==this.type){for(var n=this.node,i=function(t){var e=m("tspan");if(h(t,"array"))for(var n=0;n<t.length;n++)e.appendChild(i(t[n]));else e.appendChild(r.doc.createTextNode(t));return e.normalize&&e.normalize(),e};n.firstChild;)n.removeChild(n.firstChild);for(var o=i(t);o.firstChild;)n.appendChild(o.firstChild)}e.stop()})(-1),e.on("snap.util.attr.fontSize",s)(-1),e.on("snap.util.attr.font-size",s)(-1),
+e.on("snap.util.getattr.transform",function(){return e.stop(),this.transform()})(-1),e.on("snap.util.getattr.textpath",function(){return e.stop(),this.textPath})(-1),function(){function n(n){return function(){e.stop();var i=r.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+n);return"none"==i?i:t(r.doc.getElementById(i.match(d)[1]))}}function i(t){return function(n){e.stop();var i="marker"+t.charAt(0).toUpperCase()+t.substring(1);if(""==n||!n)return void(this.node.style[i]="none");if("marker"==n.type){var r=n.node.id;return r||m(n.node,{id:n.id}),void(this.node.style[i]=y(r))}}}e.on("snap.util.getattr.marker-end",n("end"))(-1),e.on("snap.util.getattr.markerEnd",n("end"))(-1),e.on("snap.util.getattr.marker-start",n("start"))(-1),e.on("snap.util.getattr.markerStart",n("start"))(-1),e.on("snap.util.getattr.marker-mid",n("mid"))(-1),e.on("snap.util.getattr.markerMid",n("mid"))(-1),e.on("snap.util.attr.marker-end",i("end"))(-1),e.on("snap.util.attr.markerEnd",i("end"))(-1),e.on("snap.util.attr.marker-start",i("start"))(-1),e.on("snap.util.attr.markerStart",i("start"))(-1),e.on("snap.util.attr.marker-mid",i("mid"))(-1),e.on("snap.util.attr.markerMid",i("mid"))(-1)}(),e.on("snap.util.getattr.r",function(){return"rect"==this.type&&m(this.node,"rx")==m(this.node,"ry")?(e.stop(),m(this.node,"rx")):void 0})(-1),e.on("snap.util.getattr.text",function(){if("text"==this.type||"tspan"==this.type){e.stop();var t=c(this.node);return 1==t.length?t[0]:t}})(-1),e.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),e.on("snap.util.getattr.viewBox",function(){e.stop();var n=m(this.node,"viewBox");return n?(n=n.split(g),t._.box(+n[0],+n[1],+n[2],+n[3])):void 0})(-1),e.on("snap.util.getattr.points",function(){var t=m(this.node,"points");return e.stop(),t?t.split(g):void 0})(-1),e.on("snap.util.getattr.path",function(){var t=m(this.node,"d");return e.stop(),t})(-1),e.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),e.on("snap.util.getattr.fontSize",u)(-1),e.on("snap.util.getattr.font-size",u)(-1)}),i.plugin(function(n,i,r,o,a){var s=r.prototype,c=n.is;s.rect=function(t,e,n,i,r,o){var a;return null==o&&(o=r),c(t,"object")&&"[object Object]"==t?a=t:null!=t&&(a={x:t,y:e,width:n,height:i},null!=r&&(a.rx=r,a.ry=o)),this.el("rect",a)},s.circle=function(t,e,n){var i;return c(t,"object")&&"[object Object]"==t?i=t:null!=t&&(i={cx:t,cy:e,r:n}),this.el("circle",i)};var u=function(){function t(){this.parentNode.removeChild(this)}return function(e,n){var i=o.doc.createElement("img"),r=o.doc.body;i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){n.call(i),i.onload=i.onerror=null,r.removeChild(i)},i.onerror=t,r.appendChild(i),i.src=e}}();s.image=function(t,e,i,r,o){var a=this.el("image");if(c(t,"object")&&"src"in t)a.attr(t);else if(null!=t){var s={"xlink:href":t,preserveAspectRatio:"none"};null!=e&&null!=i&&(s.x=e,s.y=i),null!=r&&null!=o?(s.width=r,s.height=o):u(t,function(){n._.$(a.node,{width:this.offsetWidth,height:this.offsetHeight})}),n._.$(a.node,s)}return a},s.ellipse=function(t,e,n,i){var r;return c(t,"object")&&"[object Object]"==t?r=t:null!=t&&(r={cx:t,cy:e,rx:n,ry:i}),this.el("ellipse",r)},s.path=function(t){var e;return c(t,"object")&&!c(t,"array")?e=t:t&&(e={d:t}),this.el("path",e)},s.group=s.g=function(t){var e=this.el("g");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},s.svg=function(t,e,n,i,r,o,a,s){var u={};return c(t,"object")&&null==e?u=t:(null!=t&&(u.x=t),null!=e&&(u.y=e),null!=n&&(u.width=n),null!=i&&(u.height=i),null!=r&&null!=o&&null!=a&&null!=s&&(u.viewBox=[r,o,a,s])),this.el("svg",u)},s.mask=function(t){var e=this.el("mask");return 1==arguments.length&&t&&!t.type?e.attr(t):arguments.length&&e.add(Array.prototype.slice.call(arguments,0)),e},s.ptrn=function(t,e,n,i,r,o,a,s){if(c(t,"object"))var u=t;else u={patternUnits:"userSpaceOnUse"},t&&(u.x=t),e&&(u.y=e),null!=n&&(u.width=n),null!=i&&(u.height=i),null!=r&&null!=o&&null!=a&&null!=s&&(u.viewBox=[r,o,a,s]);return this.el("pattern",u)},s.use=function(t){return null!=t?(t instanceof i&&(t.attr("id")||t.attr({id:n._.id(t)}),t=t.attr("id")),"#"==String(t).charAt()&&(t=t.substring(1)),this.el("use",{"xlink:href":"#"+t})):i.prototype.use.call(this)},s.symbol=function(t,e,n,i){var r={};return null!=t&&null!=e&&null!=n&&null!=i&&(r.viewBox=[t,e,n,i]),this.el("symbol",r)},s.text=function(t,e,n){var i={};return c(t,"object")?i=t:null!=t&&(i={x:t,y:e,text:n||""}),this.el("text",i)},s.line=function(t,e,n,i){var r={};return c(t,"object")?r=t:null!=t&&(r={x1:t,x2:n,y1:e,y2:i}),this.el("line",r)},s.polyline=function(t){arguments.length>1&&(t=Array.prototype.slice.call(arguments,0));var e={};return c(t,"object")&&!c(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polyline",e)},s.polygon=function(t){arguments.length>1&&(t=Array.prototype.slice.call(arguments,0));var e={};return c(t,"object")&&!c(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polygon",e)},function(){function i(){return this.selectAll("stop")}function r(t,e){var i=p("stop"),r={offset:+e+"%"};return t=n.color(t),r["stop-color"]=t.hex,t.opacity<1&&(r["stop-opacity"]=t.opacity),p(i,r),this.node.appendChild(i),this}function o(){if("linearGradient"==this.type){var t=p(this.node,"x1")||0,e=p(this.node,"x2")||1,i=p(this.node,"y1")||0,r=p(this.node,"y2")||0;return n._.box(t,i,math.abs(e-t),math.abs(r-i))}var o=this.node.cx||.5,a=this.node.cy||.5,s=this.node.r||0;return n._.box(o-s,a-s,2*s,2*s)}function a(t,n){function i(t,e){for(var n=(e-l)/(t-h),i=h;t>i;i++)a[i].offset=+(+l+n*(i-h)).toFixed(2);h=t,l=e}var r,o=e("snap.util.grad.parse",null,n).firstDefined();if(!o)return null;o.params.unshift(t),r="l"==o.type.toLowerCase()?c.apply(0,o.params):u.apply(0,o.params),o.type!=o.type.toLowerCase()&&p(r.node,{gradientUnits:"userSpaceOnUse"});var a=o.stops,s=a.length,l=0,h=0;s--;for(var f=0;s>f;f++)"offset"in a[f]&&i(f,a[f].offset);for(a[s].offset=a[s].offset||100,i(s,a[s].offset),f=0;s>=f;f++){var d=a[f];r.addStop(d.color,d.offset)}return r}function c(t,e,a,s,c){var u=n._.make("linearGradient",t);return u.stops=i,u.addStop=r,u.getBBox=o,null!=e&&p(u.node,{x1:e,y1:a,x2:s,y2:c}),u}function u(t,e,a,s,c,u){var l=n._.make("radialGradient",t);return l.stops=i,l.addStop=r,l.getBBox=o,null!=e&&p(l.node,{cx:e,cy:a,r:s}),null!=c&&null!=u&&p(l.node,{fx:c,fy:u}),l}var p=n._.$;s.gradient=function(t){return a(this.defs,t)},s.gradientLinear=function(t,e,n,i){return c(this.defs,t,e,n,i)},s.gradientRadial=function(t,e,n,i,r){return u(this.defs,t,e,n,i,r)},s.toString=function(){var t,e=this.node.ownerDocument,i=e.createDocumentFragment(),r=e.createElement("div"),o=this.node.cloneNode(!0);return i.appendChild(r),r.appendChild(o),n._.$(o,{xmlns:"http://www.w3.org/2000/svg"}),t=r.innerHTML,i.removeChild(i.firstChild),t},s.toDataURL=function(){return t&&t.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},s.clear=function(){for(var t,e=this.node.firstChild;e;)t=e.nextSibling,"defs"!=e.tagName?e.parentNode.removeChild(e):s.clear.call({node:e}),e=t}}()}),i.plugin(function(t,e,n,i){function r(t){var e=r.ps=r.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)e[j](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]}function o(t,e,n,i){return null==t&&(t=e=n=i=0),null==e&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:i,h:i,x2:t+n,y2:e+i,cx:t+n/2,cy:e+i/2,r1:V.min(n,i)/2,r2:V.max(n,i)/2,r0:V.sqrt(n*n+i*i)/2,path:S(t,e,n,i),vb:[t,e,n,i].join(" ")}}function a(){return this.join(",").replace(F,"$1")}function s(t){var e=L(t);return e.toString=a,e}function c(t,e,n,i,r,o,a,s,c){return null==c?m(t,e,n,i,r,o,a,s):p(t,e,n,i,r,o,a,s,y(t,e,n,i,r,o,a,s,c))}function u(n,i){function r(t){return+(+t).toFixed(3)}return t._.cacher(function(t,o,a){t instanceof e&&(t=t.attr("d")),t=k(t);for(var s,u,l,h,f,d="",m={},y=0,v=0,g=t.length;g>v;v++){if(l=t[v],"M"==l[0])s=+l[1],u=+l[2];else{if(h=c(s,u,l[1],l[2],l[3],l[4],l[5],l[6]),y+h>o){if(i&&!m.start){if(f=c(s,u,l[1],l[2],l[3],l[4],l[5],l[6],o-y),d+=["C"+r(f.start.x),r(f.start.y),r(f.m.x),r(f.m.y),r(f.x),r(f.y)],a)return d;m.start=d,d=["M"+r(f.x),r(f.y)+"C"+r(f.n.x),r(f.n.y),r(f.end.x),r(f.end.y),r(l[5]),r(l[6])].join(),y+=h,s=+l[5],u=+l[6];continue}if(!n&&!i)return f=c(s,u,l[1],l[2],l[3],l[4],l[5],l[6],o-y)}y+=h,s=+l[5],u=+l[6]}d+=l.shift()+l}return m.end=d,f=n?y:i?m:p(s,u,l[0],l[1],l[2],l[3],l[4],l[5],1)},null,t._.clone)}function p(t,e,n,i,r,o,a,s,c){var u=1-c,p=U(u,3),l=U(u,2),h=c*c,f=h*c,d=p*t+3*l*c*n+3*u*c*c*r+f*a,m=p*e+3*l*c*i+3*u*c*c*o+f*s,y=t+2*c*(n-t)+h*(r-2*n+t),v=e+2*c*(i-e)+h*(o-2*i+e),g=n+2*c*(r-n)+h*(a-2*r+n),x=i+2*c*(o-i)+h*(s-2*o+i),b=u*t+c*n,w=u*e+c*i,E=u*r+c*a,_=u*o+c*s,S=90-180*V.atan2(y-g,v-x)/G;return{x:d,y:m,m:{x:y,y:v},n:{x:g,y:x},start:{x:b,y:w},end:{x:E,y:_},alpha:S}}function l(e,n,i,r,a,s,c,u){t.is(e,"array")||(e=[e,n,i,r,a,s,c,u]);var p=P.apply(null,e);return o(p.min.x,p.min.y,p.max.x-p.min.x,p.max.y-p.min.y)}function h(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function f(t,e){return t=o(t),e=o(e),h(e,t.x,t.y)||h(e,t.x2,t.y)||h(e,t.x,t.y2)||h(e,t.x2,t.y2)||h(t,e.x,e.y)||h(t,e.x2,e.y)||h(t,e.x,e.y2)||h(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}function d(t,e,n,i,r){var o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}function m(t,e,n,i,r,o,a,s,c){null==c&&(c=1),c=c>1?1:0>c?0:c;for(var u=c/2,p=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,m=0;p>m;m++){var y=u*l[m]+u,v=d(y,t,n,r,a),g=d(y,e,i,o,s),x=v*v+g*g;f+=h[m]*V.sqrt(x)}return u*f}function y(t,e,n,i,r,o,a,s,c){if(!(0>c||m(t,e,n,i,r,o,a,s)<c)){var u,p=1,l=p/2,h=p-l,f=.01;for(u=m(t,e,n,i,r,o,a,s,h);q(u-c)>f;)l/=2,h+=(c>u?1:-1)*l,u=m(t,e,n,i,r,o,a,s,h);return h}}function v(t,e,n,i,r,o,a,s){if(!(W(t,n)<z(r,a)||z(t,n)>W(r,a)||W(e,i)<z(o,s)||z(e,i)>W(o,s))){var c=(t*i-e*n)*(r-a)-(t-n)*(r*s-o*a),u=(t*i-e*n)*(o-s)-(e-i)*(r*s-o*a),p=(t-n)*(o-s)-(e-i)*(r-a);if(p){var l=c/p,h=u/p,f=+l.toFixed(2),d=+h.toFixed(2);if(!(f<+z(t,n).toFixed(2)||f>+W(t,n).toFixed(2)||f<+z(r,a).toFixed(2)||f>+W(r,a).toFixed(2)||d<+z(e,i).toFixed(2)||d>+W(e,i).toFixed(2)||d<+z(o,s).toFixed(2)||d>+W(o,s).toFixed(2)))return{x:l,y:h}}}}function g(t,e,n){var i=l(t),r=l(e);if(!f(i,r))return n?0:[];for(var o=m.apply(0,t),a=m.apply(0,e),s=~~(o/8),c=~~(a/8),u=[],h=[],d={},y=n?0:[],g=0;s+1>g;g++){var x=p.apply(0,t.concat(g/s));u.push({x:x.x,y:x.y,t:g/s})}for(g=0;c+1>g;g++)x=p.apply(0,e.concat(g/c)),h.push({x:x.x,y:x.y,t:g/c});for(g=0;s>g;g++)for(var b=0;c>b;b++){var w=u[g],E=u[g+1],_=h[b],S=h[b+1],T=q(E.x-w.x)<.001?"y":"x",A=q(S.x-_.x)<.001?"y":"x",C=v(w.x,w.y,E.x,E.y,_.x,_.y,S.x,S.y);if(C){if(d[C.x.toFixed(4)]==C.y.toFixed(4))continue;d[C.x.toFixed(4)]=C.y.toFixed(4);var M=w.t+q((C[T]-w[T])/(E[T]-w[T]))*(E.t-w.t),R=_.t+q((C[A]-_[A])/(S[A]-_[A]))*(S.t-_.t);M>=0&&1>=M&&R>=0&&1>=R&&(n?y++:y.push({x:C.x,y:C.y,t1:M,t2:R}))}}return y}function x(t,e){return w(t,e)}function b(t,e){return w(t,e,1)}function w(t,e,n){t=k(t),e=k(e);for(var i,r,o,a,s,c,u,p,l,h,f=n?0:[],d=0,m=t.length;m>d;d++){var y=t[d];if("M"==y[0])i=s=y[1],r=c=y[2];else{"C"==y[0]?(l=[i,r].concat(y.slice(1)),i=l[6],r=l[7]):(l=[i,r,i,r,s,c,s,c],i=s,r=c);for(var v=0,x=e.length;x>v;v++){var b=e[v];if("M"==b[0])o=u=b[1],a=p=b[2];else{"C"==b[0]?(h=[o,a].concat(b.slice(1)),o=h[6],a=h[7]):(h=[o,a,o,a,u,p,u,p],o=u,a=p);var w=g(l,h,n);if(n)f+=w;else{for(var E=0,_=w.length;_>E;E++)w[E].segment1=d,w[E].segment2=v,w[E].bez1=l,w[E].bez2=h;f=f.concat(w)}}}}}return f}function E(t,e,n){var i=_(t);return h(i,e,n)&&w(t,[["M",e,n],["H",i.x2+10]],1)%2==1}function _(t){var e=r(t);if(e.bbox)return L(e.bbox);if(!t)return o();t=k(t);for(var n,i=0,a=0,s=[],c=[],u=0,p=t.length;p>u;u++)if(n=t[u],"M"==n[0])i=n[1],a=n[2],s.push(i),c.push(a);else{var l=P(i,a,n[1],n[2],n[3],n[4],n[5],n[6]);s=s.concat(l.min.x,l.max.x),c=c.concat(l.min.y,l.max.y),i=n[5],a=n[6]}var h=z.apply(0,s),f=z.apply(0,c),d=W.apply(0,s),m=W.apply(0,c),y=o(h,f,d-h,m-f);return e.bbox=L(y),y}function S(t,e,n,i,r){if(r)return[["M",+t+ +r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]];var o=[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]];return o.toString=a,o}function T(t,e,n,i,r){if(null==r&&null==i&&(i=n),t=+t,e=+e,n=+n,i=+i,null!=r)var o=Math.PI/180,s=t+n*Math.cos(-i*o),c=t+n*Math.cos(-r*o),u=e+n*Math.sin(-i*o),p=e+n*Math.sin(-r*o),l=[["M",s,u],["A",n,n,0,+(r-i>180),0,c,p]];else l=[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return l.toString=a,l}function A(e){var n=r(e),i=String.prototype.toLowerCase;if(n.rel)return s(n.rel);t.is(e,"array")&&t.is(e&&e[0],"array")||(e=t.parsePathString(e));var o=[],c=0,u=0,p=0,l=0,h=0;"M"==e[0][0]&&(c=e[0][1],u=e[0][2],p=c,l=u,h++,o.push(["M",c,u]));for(var f=h,d=e.length;d>f;f++){var m=o[f]=[],y=e[f];if(y[0]!=i.call(y[0]))switch(m[0]=i.call(y[0]),m[0]){case"a":m[1]=y[1],m[2]=y[2],m[3]=y[3],m[4]=y[4],m[5]=y[5],m[6]=+(y[6]-c).toFixed(3),m[7]=+(y[7]-u).toFixed(3);break;case"v":m[1]=+(y[1]-u).toFixed(3);break;case"m":p=y[1],l=y[2];default:for(var v=1,g=y.length;g>v;v++)m[v]=+(y[v]-(v%2?c:u)).toFixed(3)}else{m=o[f]=[],"m"==y[0]&&(p=y[1]+c,l=y[2]+u);for(var x=0,b=y.length;b>x;x++)o[f][x]=y[x]}var w=o[f].length;switch(o[f][0]){case"z":c=p,u=l;break;case"h":c+=+o[f][w-1];break;case"v":u+=+o[f][w-1];break;default:c+=+o[f][w-2],u+=+o[f][w-1]}}return o.toString=a,n.rel=s(o),o}function C(e){var n=r(e);if(n.abs)return s(n.abs);if(I(e,"array")&&I(e&&e[0],"array")||(e=t.parsePathString(e)),!e||!e.length)return[["M",0,0]];var i,o=[],c=0,u=0,p=0,l=0,h=0;"M"==e[0][0]&&(c=+e[0][1],u=+e[0][2],p=c,l=u,h++,o[0]=["M",c,u]);for(var f,d,m=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),y=h,v=e.length;v>y;y++){if(o.push(f=[]),d=e[y],i=d[0],i!=i.toUpperCase())switch(f[0]=i.toUpperCase(),f[0]){case"A":f[1]=d[1],f[2]=d[2],f[3]=d[3],f[4]=d[4],f[5]=d[5],f[6]=+d[6]+c,f[7]=+d[7]+u;break;case"V":f[1]=+d[1]+u;break;case"H":f[1]=+d[1]+c;break;case"R":for(var g=[c,u].concat(d.slice(1)),x=2,b=g.length;b>x;x++)g[x]=+g[x]+c,g[++x]=+g[x]+u;o.pop(),o=o.concat(O(g,m));break;case"O":o.pop(),g=T(c,u,d[1],d[2]),g.push(g[0]),o=o.concat(g);break;case"U":o.pop(),o=o.concat(T(c,u,d[1],d[2],d[3])),f=["U"].concat(o[o.length-1].slice(-2));break;case"M":p=+d[1]+c,l=+d[2]+u;default:for(x=1,b=d.length;b>x;x++)f[x]=+d[x]+(x%2?c:u)}else if("R"==i)g=[c,u].concat(d.slice(1)),o.pop(),o=o.concat(O(g,m)),f=["R"].concat(d.slice(-2));else if("O"==i)o.pop(),g=T(c,u,d[1],d[2]),g.push(g[0]),o=o.concat(g);else if("U"==i)o.pop(),o=o.concat(T(c,u,d[1],d[2],d[3])),f=["U"].concat(o[o.length-1].slice(-2));else for(var w=0,E=d.length;E>w;w++)f[w]=d[w];if(i=i.toUpperCase(),"O"!=i)switch(f[0]){case"Z":c=+p,u=+l;break;case"H":c=f[1];break;case"V":u=f[1];break;case"M":p=f[f.length-2],l=f[f.length-1];default:c=f[f.length-2],u=f[f.length-1]}}return o.toString=a,n.abs=s(o),o}function M(t,e,n,i){return[t,e,n,i,n,i]}function R(t,e,n,i,r,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*i,a*r+s*n,a*o+s*i,r,o]}function N(e,n,i,r,o,a,s,c,u,p){var l,h=120*G/180,f=G/180*(+o||0),d=[],m=t._.cacher(function(t,e,n){var i=t*V.cos(n)-e*V.sin(n),r=t*V.sin(n)+e*V.cos(n);return{x:i,y:r}});if(p)S=p[0],T=p[1],E=p[2],_=p[3];else{l=m(e,n,-f),e=l.x,n=l.y,l=m(c,u,-f),c=l.x,u=l.y;var y=(V.cos(G/180*o),V.sin(G/180*o),(e-c)/2),v=(n-u)/2,g=y*y/(i*i)+v*v/(r*r);g>1&&(g=V.sqrt(g),i=g*i,r=g*r);var x=i*i,b=r*r,w=(a==s?-1:1)*V.sqrt(q((x*b-x*v*v-b*y*y)/(x*v*v+b*y*y))),E=w*i*v/r+(e+c)/2,_=w*-r*y/i+(n+u)/2,S=V.asin(((n-_)/r).toFixed(9)),T=V.asin(((u-_)/r).toFixed(9));S=E>e?G-S:S,T=E>c?G-T:T,0>S&&(S=2*G+S),0>T&&(T=2*G+T),s&&S>T&&(S-=2*G),!s&&T>S&&(T-=2*G)}var A=T-S;if(q(A)>h){var C=T,M=c,R=u;T=S+h*(s&&T>S?1:-1),c=E+i*V.cos(T),u=_+r*V.sin(T),d=N(c,u,i,r,o,0,s,M,R,[T,C,E,_])}A=T-S;var P=V.cos(S),k=V.sin(S),D=V.cos(T),O=V.sin(T),B=V.tan(A/4),I=4/3*i*B,L=4/3*r*B,j=[e,n],F=[e+I*k,n-L*P],$=[c+I*O,u-L*D],z=[c,u];if(F[0]=2*j[0]-F[0],F[1]=2*j[1]-F[1],p)return[F,$,z].concat(d);d=[F,$,z].concat(d).join().split(",");for(var W=[],U=0,H=d.length;H>U;U++)W[U]=U%2?m(d[U-1],d[U],f).y:m(d[U],d[U+1],f).x;return W}function P(t,e,n,i,r,o,a,s){for(var c,u,p,l,h,f,d,m,y=[],v=[[],[]],g=0;2>g;++g)if(0==g?(u=6*t-12*n+6*r,c=-3*t+9*n-9*r+3*a,p=3*n-3*t):(u=6*e-12*i+6*o,c=-3*e+9*i-9*o+3*s,p=3*i-3*e),q(c)<1e-12){if(q(u)<1e-12)continue;l=-p/u,l>0&&1>l&&y.push(l)}else d=u*u-4*p*c,m=V.sqrt(d),0>d||(h=(-u+m)/(2*c),h>0&&1>h&&y.push(h),f=(-u-m)/(2*c),f>0&&1>f&&y.push(f));for(var x,b=y.length,w=b;b--;)l=y[b],x=1-l,v[0][b]=x*x*x*t+3*x*x*l*n+3*x*l*l*r+l*l*l*a,v[1][b]=x*x*x*e+3*x*x*l*i+3*x*l*l*o+l*l*l*s;return v[0][w]=t,v[1][w]=e,v[0][w+1]=a,v[1][w+1]=s,v[0].length=v[1].length=w+2,{min:{x:z.apply(0,v[0]),y:z.apply(0,v[1])},max:{x:W.apply(0,v[0]),y:W.apply(0,v[1])}}}function k(t,e){var n=!e&&r(t);if(!e&&n.curve)return s(n.curve);for(var i=C(t),o=e&&C(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u=(function(t,e,n){var i,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(N.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"==n||"S"==n?(i=2*e.x-e.bx,r=2*e.y-e.by):(i=e.x,r=e.y),t=["C",i,r].concat(t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(R(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(R(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(M(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(M(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(M(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(M(e.x,e.y,e.X,e.Y))}return t}),p=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)h[e]="A",o&&(f[e]="A"),t.splice(e++,0,["C"].concat(n.splice(0,6)));t.splice(e,1),v=W(i.length,o&&o.length||0)}},l=function(t,e,n,r,a){t&&e&&"M"==t[a][0]&&"M"!=e[a][0]&&(e.splice(a,0,["M",r.x,r.y]),n.bx=0,n.by=0,n.x=t[a][1],n.y=t[a][2],v=W(i.length,o&&o.length||0))},h=[],f=[],d="",m="",y=0,v=W(i.length,o&&o.length||0);v>y;y++){i[y]&&(d=i[y][0]),"C"!=d&&(h[y]=d,y&&(m=h[y-1])),i[y]=u(i[y],a,m),"A"!=h[y]&&"C"==d&&(h[y]="C"),p(i,y),o&&(o[y]&&(d=o[y][0]),"C"!=d&&(f[y]=d,y&&(m=f[y-1])),o[y]=u(o[y],c,m),"A"!=f[y]&&"C"==d&&(f[y]="C"),p(o,y)),l(i,o,a,c,y),l(o,i,c,a,y);var g=i[y],x=o&&o[y],b=g.length,w=o&&x.length;a.x=g[b-2],a.y=g[b-1],a.bx=$(g[b-4])||a.x,a.by=$(g[b-3])||a.y,c.bx=o&&($(x[w-4])||c.x),c.by=o&&($(x[w-3])||c.y),c.x=o&&x[w-2],c.y=o&&x[w-1]}return o||(n.curve=s(i)),o?[i,o]:i}function D(t,e){if(!e)return t;var n,i,r,o,a,s,c;for(t=k(t),r=0,a=t.length;a>r;r++)for(c=t[r],o=1,s=c.length;s>o;o+=2)n=e.x(c[o],c[o+1]),i=e.y(c[o],c[o+1]),c[o]=n,c[o+1]=i;return t}function O(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var o=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4==i?o[3]={x:+t[0],y:+t[1]}:r-2==i&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[r-2],y:+t[r-1]}:r-4==i?o[3]=o[2]:i||(o[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}var B=e.prototype,I=t.is,L=t._.clone,j="hasOwnProperty",F=/,?([a-z]),?/gi,$=parseFloat,V=Math,G=V.PI,z=V.min,W=V.max,U=V.pow,q=V.abs,H=u(1),Y=u(),X=u(0,1),K=t._unit2px,Z={path:function(t){return t.attr("path")},circle:function(t){var e=K(t);return T(e.cx,e.cy,e.r)},ellipse:function(t){var e=K(t);return T(e.cx||0,e.cy||0,e.rx,e.ry)},rect:function(t){var e=K(t);return S(e.x||0,e.y||0,e.width,e.height,e.rx,e.ry)},image:function(t){var e=K(t);return S(e.x||0,e.y||0,e.width,e.height)},line:function(t){return"M"+[t.attr("x1")||0,t.attr("y1")||0,t.attr("x2"),t.attr("y2")]},polyline:function(t){return"M"+t.attr("points")},polygon:function(t){return"M"+t.attr("points")+"z"},deflt:function(t){var e=t.node.getBBox();return S(e.x,e.y,e.width,e.height)}};t.path=r,t.path.getTotalLength=H,t.path.getPointAtLength=Y,t.path.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return X(t,e).end;var i=X(t,n,1);return e?X(i,e).end:i},B.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},B.getPointAtLength=function(t){return Y(this.attr("d"),t)},B.getSubpath=function(e,n){return t.path.getSubpath(this.attr("d"),e,n)},t._.box=o,t.path.findDotsAtSegment=p,t.path.bezierBBox=l,t.path.isPointInsideBBox=h,t.path.isBBoxIntersect=f,t.path.intersection=x,t.path.intersectionNumber=b,t.path.isPointInside=E,t.path.getBBox=_,t.path.get=Z,t.path.toRelative=A,t.path.toAbsolute=C,t.path.toCubic=k,t.path.map=D,t.path.toString=a,t.path.clone=s}),i.plugin(function(t,n,i,r){for(var o=n.prototype,a="hasOwnProperty",s=("createTouch"in r.doc),c=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},p=(function(t,e){var n="y"==t?"scrollTop":"scrollLeft",i=e&&e.node?e.node.ownerDocument:r.doc;return i[n in i.documentElement?"documentElement":"body"][n]}),l=function(){this.returnValue=!1},h=function(){return this.originalEvent.preventDefault()},f=function(){this.cancelBubble=!0},d=function(){return this.originalEvent.stopPropagation()},m=function(){return r.doc.addEventListener?function(t,e,n,i){var r=s&&u[e]?u[e]:e,o=function(r){var o=p("y",i),c=p("x",i);if(s&&u[a](e))for(var l=0,f=r.targetTouches&&r.targetTouches.length;f>l;l++)if(r.targetTouches[l].target==t||t.contains(r.targetTouches[l].target)){var m=r;r=r.targetTouches[l],r.originalEvent=m,r.preventDefault=h,r.stopPropagation=d;break}var y=r.clientX+c,v=r.clientY+o;return n.call(i,r,y,v)};return e!==r&&t.addEventListener(e,o,!1),t.addEventListener(r,o,!1),function(){return e!==r&&t.removeEventListener(e,o,!1),t.removeEventListener(r,o,!1),!0}}:r.doc.attachEvent?function(t,e,n,i){var r=function(t){t=t||i.node.ownerDocument.window.event;var e=p("y",i),r=p("x",i),o=t.clientX+r,a=t.clientY+e;return t.preventDefault=t.preventDefault||l,t.stopPropagation=t.stopPropagation||f,n.call(i,t,o,a)};t.attachEvent("on"+e,r);var o=function(){return t.detachEvent("on"+e,r),!0};return o}:void 0}(),y=[],v=function(t){for(var n,i=t.clientX,r=t.clientY,o=p("y"),a=p("x"),c=y.length;c--;){if(n=y[c],s){for(var u,l=t.touches&&t.touches.length;l--;)if(u=t.touches[l],u.identifier==n.el._drag.id||n.el.node.contains(u.target)){i=u.clientX,r=u.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var h=n.el.node;h.nextSibling,h.parentNode,h.style.display;i+=a,r+=o,e("snap.drag.move."+n.el.id,n.move_scope||n.el,i-n.el._drag.x,r-n.el._drag.y,i,r,t)}},g=function(n){t.unmousemove(v).unmouseup(g);for(var i,r=y.length;r--;)i=y[r],i.el._drag={},e("snap.drag.end."+i.el.id,i.end_scope||i.start_scope||i.move_scope||i.el,n);y=[]},x=c.length;x--;)!function(e){t[e]=o[e]=function(n,i){return t.is(n,"function")&&(this.events=this.events||[],this.events.push({name:e,f:n,unbind:m(this.node||document,e,n,i||this)})),this},t["un"+e]=o["un"+e]=function(t){for(var n=this.events||[],i=n.length;i--;)if(n[i].name==e&&(n[i].f==t||!t))return n[i].unbind(),n.splice(i,1),!n.length&&delete this.events,this;return this}}(c[x]);o.hover=function(t,e,n,i){return this.mouseover(t,n).mouseout(e,i||n)},o.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var b=[];o.drag=function(n,i,r,o,a,s){function c(c,u,p){(c.originalEvent||c).preventDefault(),this._drag.x=u,this._drag.y=p,this._drag.id=c.identifier,!y.length&&t.mousemove(v).mouseup(g),y.push({el:this,move_scope:o,start_scope:a,end_scope:s}),i&&e.on("snap.drag.start."+this.id,i),n&&e.on("snap.drag.move."+this.id,n),r&&e.on("snap.drag.end."+this.id,r),e("snap.drag.start."+this.id,a||o||this,u,p,c)}if(!arguments.length){var u;return this.drag(function(t,e){this.attr({transform:u+(u?"T":"t")+[t,e]})},function(){u=this.transform().local})}return this._drag={},b.push({el:this,start:c}),this.mousedown(c),this},o.undrag=function(){for(var n=b.length;n--;)b[n].el==this&&(this.unmousedown(b[n].start),b.splice(n,1),e.unbind("snap.drag.*."+this.id));return!b.length&&t.unmousemove(v).unmouseup(g),this}}),i.plugin(function(t,n,i,r){var o=(n.prototype,i.prototype),a=/^\s*url\((.+)\)/,s=String,c=t._.$;t.filter={},o.filter=function(e){var i=this;"svg"!=i.type&&(i=i.paper);var r=t.parse(s(e)),o=t._.id(),a=(i.node.offsetWidth,i.node.offsetHeight,c("filter"));return c(a,{id:o,filterUnits:"userSpaceOnUse"}),a.appendChild(r.node),i.defs.appendChild(a),new n(a)},e.on("snap.util.getattr.filter",function(){e.stop();var n=c(this.node,"filter");if(n){var i=s(n).match(a);return i&&t.select(i[1])}}),e.on("snap.util.attr.filter",function(i){if(i instanceof n&&"filter"==i.type){e.stop();var r=i.node.id;r||(c(i.node,{id:i.id}),r=i.id),c(this.node,{filter:t.url(r)})}i&&"none"!=i||(e.stop(),this.node.removeAttribute("filter"))}),t.filter.blur=function(e,n){null==e&&(e=2);var i=null==n?e:[e,n];return t.format('<feGaussianBlur stdDeviation="{def}"/>',{def:i})},t.filter.blur.toString=function(){return this()},t.filter.shadow=function(e,n,i,r,o){return"string"==typeof i&&(r=i,o=r,i=4),"string"!=typeof r&&(o=r,r="#000"),r=r||"#000",null==i&&(i=4),null==o&&(o=1),null==e&&(e=0,n=2),null==n&&(n=e),r=t.color(r),t.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:r,dx:e,dy:n,blur:i,opacity:o})},t.filter.shadow.toString=function(){return this()},t.filter.grayscale=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-e),b:.7152-.7152*(1-e),c:.0722-.0722*(1-e),d:.2126-.2126*(1-e),e:.7152+.2848*(1-e),f:.0722-.0722*(1-e),g:.2126-.2126*(1-e),h:.0722+.9278*(1-e)})},t.filter.grayscale.toString=function(){return this()},t.filter.sepia=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-e),b:.769-.769*(1-e),c:.189-.189*(1-e),d:.349-.349*(1-e),e:.686+.314*(1-e),f:.168-.168*(1-e),g:.272-.272*(1-e),h:.534-.534*(1-e),i:.131+.869*(1-e)})},t.filter.sepia.toString=function(){return this()},t.filter.saturate=function(e){return null==e&&(e=1),t.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-e})},t.filter.saturate.toString=function(){return this()},t.filter.hueRotate=function(e){return e=e||0,t.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:e})},t.filter.hueRotate.toString=function(){return this()},t.filter.invert=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:e,amount2:1-e})},t.filter.invert.toString=function(){return this()},t.filter.brightness=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:e})},t.filter.brightness.toString=function(){return this()},t.filter.contrast=function(e){return null==e&&(e=1),t.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:e,amount2:.5-e/2})},t.filter.contrast.toString=function(){return this()}}),i})},{185:185}],188:[function(t,e,n){"use strict";var i=e.exports=t(187);i.plugin(function(t,e){e.prototype.children=function(){for(var e=[],n=this.node.childNodes,i=0,r=n.length;r>i;i++)e[i]=new t(n[i]);return e}}),i.plugin(function(t,e,n,i){function r(t){return t.split(/\s+/)}function o(t){return t.join(" ")}function a(t){return r(t.attr("class")||"")}function s(t,e){t.attr("class",o(e))}e.prototype.addClass=function(t){var e,n,i=a(this),o=r(t);for(e=0,n;n=o[e];e++)-1===i.indexOf(n)&&i.push(n);return s(this,i),this},e.prototype.hasClass=function(t){if(!t)throw new Error("[snapsvg] syntax: hasClass(clsStr)");return-1!==a(this).indexOf(t)},e.prototype.removeClass=function(t){var e,n,i,o=a(this),c=r(t);for(e=0,n;n=c[e];e++)i=o.indexOf(n),-1!==i&&o.splice(i,1);return s(this,o),this}}),i.plugin(function(t,e,n,i){e.prototype.translate=function(e,n){var i=new t.Matrix;return i.translate(e,n),this.transform(i)}}),i.plugin(function(t){t.create=function(e,n){return t._.wrap(t._.$(e,n))}}),i.plugin(function(t,e,n,i){t.createSnapAt=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("width",e),r.setAttribute("height",n),i||(i=document.body),i.appendChild(r),new t(r)}})},{187:187}],189:[function(t,e,n){var i=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=function(){var t=Array.prototype.slice.call(arguments);1===t.length&&i(t[0])&&(t=t[0]);var e=t.pop();return e.$inject=t,e},o=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,a=/\/\*([^\*]*)\*\//m,s=function(t){if("function"!=typeof t)throw new Error('Cannot annotate "'+t+'". Expected a function!');var e=t.toString().match(o);return e[1]&&e[1].split(",").map(function(t){return e=t.match(a),e?e[1].trim():t.trim()})||[]};n.annotate=r,n.parse=s,n.isArray=i},{}],190:[function(t,e,n){e.exports={annotate:t(189).annotate,Module:t(192),Injector:t(191)}},{189:189,191:191,192:192}],191:[function(t,e,n){var i=t(192),r=t(189).parse,o=t(189).annotate,a=t(189).isArray,s=function(t,e){e=e||{get:function(t){throw n.push(t),l('No provider for "'+t+'"!')}};var n=[],c=this._providers=Object.create(e._providers||null),u=this._instances=Object.create(null),p=u.injector=this,l=function(t){var e=n.join(" -> ");return n.length=0,new Error(e?t+" (Resolving: "+e+")":t)},h=function(t){if(!c[t]&&-1!==t.indexOf(".")){for(var i=t.split("."),r=h(i.shift());i.length;)r=r[i.shift()];return r}if(Object.hasOwnProperty.call(u,t))return u[t];if(Object.hasOwnProperty.call(c,t)){if(-1!==n.indexOf(t))throw n.push(t),l("Cannot resolve circular dependency!");return n.push(t),u[t]=c[t][0](c[t][1]),n.pop(),u[t]}return e.get(t)},f=function(t){var e=Object.create(t.prototype),n=d(t,e);return"object"==typeof n?n:e},d=function(t,e){if("function"!=typeof t){if(!a(t))throw new Error('Cannot invoke "'+t+'". Expected a function!');t=o(t.slice())}var n=t.$inject&&t.$inject||r(t),i=n.map(function(t){return h(t)});return t.apply(e,i)},m=function(t){return o(function(e){return t.get(e)})},y=function(t,e){if(e&&e.length){var n,i,r,o,a=Object.create(null),u=Object.create(null),l=[],h=[],f=[];for(var d in c)n=c[d],-1!==e.indexOf(d)&&("private"===n[2]?(i=l.indexOf(n[3]),-1===i?(r=n[3].createChild([],e),o=m(r),l.push(n[3]),h.push(r),f.push(o),a[d]=[o,d,"private",r]):a[d]=[f[i],d,"private",h[i]]):a[d]=[n[2],n[1]],u[d]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||e.forEach(function(t){-1!==n[1].$scope.indexOf(t)&&(a[d]=[n[2],n[1]],u[t]=!0)});e.forEach(function(t){if(!u[t])throw new Error('No provider for "'+t+'". Cannot use provider from the parent!')}),t.unshift(a)}return new s(t,p)},v={factory:d,type:f,value:function(t){return t}};t.forEach(function(t){function e(t,e){return"value"!==t&&a(e)&&(e=o(e.slice())),e}if(t instanceof i)t.forEach(function(t){var n=t[0],i=t[1],r=t[2];c[n]=[v[i],e(i,r),i]});else if("object"==typeof t)if(t.__exports__){var n=Object.keys(t).reduce(function(e,n){
+return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),r=new s((t.__modules__||[]).concat([n]),p),u=o(function(t){return r.get(t)});t.__exports__.forEach(function(t){c[t]=[u,t,"private",r]})}else Object.keys(t).forEach(function(n){if("private"===t[n][2])return void(c[n]=t[n]);var i=t[n][0],r=t[n][1];c[n]=[v[i],e(i,r),i]})}),this.get=h,this.invoke=d,this.instantiate=f,this.createChild=y};e.exports=s},{189:189,192:192}],192:[function(t,e,n){var i=function(){var t=[];this.factory=function(e,n){return t.push([e,"factory",n]),this},this.value=function(e,n){return t.push([e,"value",n]),this},this.type=function(e,n){return t.push([e,"type",n]),this},this.forEach=function(e){t.forEach(e)}};e.exports=i},{}],193:[function(t,e,n){"use strict";function i(t){t=t||[128,36,1],this._seed=t.length?r.rack(t[0],t[1],t[2]):t}var r=t(194);e.exports=i,i.prototype.next=function(t){return this._seed(t||!0)},i.prototype.nextPrefixed=function(t,e){var n;do n=t+this.next(!0);while(this.assigned(n));return this.claim(n,e),n},i.prototype.claim=function(t,e){this._seed.set(t,e||!0)},i.prototype.assigned=function(t){return this._seed.get(t)||!1}},{194:194}],194:[function(t,e,n){var i=e.exports=function(t,e){if(e||(e=16),void 0===t&&(t=128),0>=t)return"0";for(var n=Math.log(Math.pow(2,t))/Math.log(e),r=2;n===1/0;r*=2)n=Math.log(Math.pow(2,t/r))/Math.log(e)*r;for(var o=n-Math.floor(n),a="",r=0;r<Math.floor(n);r++){var s=Math.floor(Math.random()*e).toString(e);a=s+a}if(o){var c=Math.pow(e,o),s=Math.floor(Math.random()*c).toString(e);a=s+a}var u=parseInt(a,e);return u!==1/0&&u>=Math.pow(2,t)?i(t,e):a};i.rack=function(t,e,n){var r=function(r){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");t+=n}var s=i(t,e)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=e||16,r}},{}],195:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],196:[function(t,e,n){function i(t,e,n){var i=t?t.length:0;return n&&o(t,e,n)&&(e=!1),i?r(t,e):[]}var r=t(240),o=t(295);e.exports=i},{240:240,295:295}],197:[function(t,e,n){function i(t){var e=t?t.length:0;return e?t[e-1]:void 0}e.exports=i},{}],198:[function(t,e,n){function i(t,e,n,i){var c=t?t.length:0;return c?(null!=e&&"boolean"!=typeof e&&(i=n,n=a(t,e,i)?null:e,e=!1),n=null==n?n:r(n,i,3),e?s(t,n):o(t,n)):[]}var r=t(229),o=t(264),a=t(295),s=t(311);e.exports=i},{229:229,264:264,295:295,311:311}],199:[function(t,e,n){e.exports=t(198)},{198:198}],200:[function(t,e,n){function i(t){if(c(t)&&!s(t)&&!(t instanceof r)){if(t instanceof o)return t;if(l.call(t,"__chain__")&&l.call(t,"__wrapped__"))return u(t)}return new o(t)}var r=t(217),o=t(218),a=t(250),s=t(316),c=t(299),u=t(314),p=Object.prototype,l=p.hasOwnProperty;i.prototype=a.prototype,e.exports=i},{217:217,218:218,250:250,299:299,314:314,316:316}],201:[function(t,e,n){function i(t,e,n){var i=s(t)?r:a;return n&&c(t,e,n)&&(e=null),("function"!=typeof e||void 0!==n)&&(e=o(e,n,3)),i(t,e)}var r=t(222),o=t(229),a=t(236),s=t(316),c=t(295);e.exports=i},{222:222,229:229,236:236,295:295,316:316}],202:[function(t,e,n){function i(t,e,n){var i=s(t)?r:a;return e=o(e,n,3),i(t,e)}var r=t(223),o=t(229),a=t(237),s=t(316);e.exports=i},{223:223,229:229,237:237,316:316}],203:[function(t,e,n){var i=t(235),r=t(279),o=r(i);e.exports=o},{235:235,279:279}],204:[function(t,e,n){var i=t(221),r=t(235),o=t(280),a=o(i,r);e.exports=a},{221:221,235:235,280:280}],205:[function(t,e,n){var i=t(272),r=Object.prototype,o=r.hasOwnProperty,a=i(function(t,e,n){o.call(t,n)?t[n].push(e):t[n]=[e]});e.exports=a},{272:272}],206:[function(t,e,n){function i(t,e,n,i){var h=t?o(t):0;return c(h)||(t=p(t),h=t.length),h?(n="number"!=typeof n||i&&s(e,n,i)?0:0>n?l(h+n,0):n||0,"string"==typeof t||!a(t)&&u(t)?h>n&&t.indexOf(e,n)>-1:r(t,e,n)>-1):!1}var r=t(245),o=t(290),a=t(316),s=t(295),c=t(298),u=t(322),p=t(331),l=Math.max;e.exports=i},{245:245,290:290,295:295,298:298,316:316,322:322,331:331}],207:[function(t,e,n){function i(t,e,n){var i=s(t)?r:a;return e=o(e,n,3),i(t,e)}var r=t(224),o=t(229),a=t(251),s=t(316);e.exports=i},{224:224,229:229,251:251,316:316}],208:[function(t,e,n){var i=t(225),r=t(235),o=t(283),a=o(i,r);e.exports=a},{225:225,235:235,283:283}],209:[function(t,e,n){function i(t){var e=t?r(t):0;return o(e)?e:a(t).length}var r=t(290),o=t(298),a=t(326);e.exports=i},{290:290,298:298,326:326}],210:[function(t,e,n){function i(t,e,n){var i=s(t)?r:a;return n&&c(t,e,n)&&(e=null),("function"!=typeof e||void 0!==n)&&(e=o(e,n,3)),i(t,e)}var r=t(226),o=t(229),a=t(261),s=t(316),c=t(295);e.exports=i},{226:226,229:229,261:261,295:295,316:316}],211:[function(t,e,n){function i(t,e,n){if(null==t)return[];n&&c(t,e,n)&&(e=null);var i=-1;e=r(e,n,3);var u=o(t,function(t,n,r){return{criteria:e(t,n,r),index:++i,value:t}});return a(u,s)}var r=t(229),o=t(251),a=t(262),s=t(269),c=t(295);e.exports=i},{229:229,251:251,262:262,269:269,295:295}],212:[function(t,e,n){var i=t(318),r=i(r=Date.now)&&r,o=r||function(){return(new Date).getTime()};e.exports=o},{318:318}],213:[function(t,e,n){var i=t(284),r=t(307),o=t(216),a=1,s=32,c=o(function(t,e,n){var o=a;if(n.length){var u=r(n,c.placeholder);o|=s}return i(t,o,e,n,u)});c.placeholder={},e.exports=c},{216:216,284:284,307:307}],214:[function(t,e,n){function i(t,e,n){function i(){y&&clearTimeout(y),h&&clearTimeout(h),h=y=v=void 0}function c(){var n=e-(o()-d);if(0>=n||n>e){h&&clearTimeout(h);var i=v;h=y=v=void 0,i&&(g=o(),f=t.apply(m,l),y||h||(l=m=null))}else y=setTimeout(c,n)}function u(){y&&clearTimeout(y),h=y=v=void 0,(b||x!==e)&&(g=o(),f=t.apply(m,l),y||h||(l=m=null))}function p(){if(l=arguments,d=o(),m=this,v=b&&(y||!w),x===!1)var n=w&&!y;else{h||w||(g=d);var i=x-(d-g),r=0>=i||i>x;r?(h&&(h=clearTimeout(h)),g=d,f=t.apply(m,l)):h||(h=setTimeout(u,i))}return r&&y?y=clearTimeout(y):y||e===x||(y=setTimeout(c,e)),n&&(r=!0,f=t.apply(m,l)),!r||y||h||(l=m=null),f}var l,h,f,d,m,y,v,g=0,x=!1,b=!0;if("function"!=typeof t)throw new TypeError(a);if(e=0>e?0:+e||0,n===!0){var w=!0;b=!1}else r(n)&&(w=n.leading,x="maxWait"in n&&s(+n.maxWait||0,e),b="trailing"in n?n.trailing:b);return p.cancel=i,p}var r=t(320),o=t(212),a="Expected a function",s=Math.max;e.exports=i},{212:212,320:320}],215:[function(t,e,n){var i=t(233),r=t(216),o=r(function(t,e){return i(t,1,e)});e.exports=o},{216:216,233:233}],216:[function(t,e,n){function i(t,e){if("function"!=typeof t)throw new TypeError(r);return e=o(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,i=-1,r=o(n.length-e,0),a=Array(r);++i<r;)a[i]=n[e+i];switch(e){case 0:return t.call(this,a);case 1:return t.call(this,n[0],a);case 2:return t.call(this,n[0],n[1],a)}var s=Array(e+1);for(i=-1;++i<e;)s[i]=n[i];return s[e]=a,t.apply(this,s)}}var r="Expected a function",o=Math.max;e.exports=i},{}],217:[function(t,e,n){function i(t){this.__wrapped__=t,this.__actions__=null,this.__dir__=1,this.__dropCount__=0,this.__filtered__=!1,this.__iteratees__=null,this.__takeCount__=a,this.__views__=null}var r=t(232),o=t(250),a=Number.POSITIVE_INFINITY;i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},{232:232,250:250}],218:[function(t,e,n){function i(t,e,n){this.__wrapped__=t,this.__actions__=n||[],this.__chain__=!!e}var r=t(232),o=t(250);i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},{232:232,250:250}],219:[function(t,e,n){(function(n){function i(t){var e=t?t.length:0;for(this.data={hash:s(null),set:new a};e--;)this.push(t[e])}var r=t(268),o=t(318),a=o(a=n.Set)&&a,s=o(s=Object.create)&&s;i.prototype.push=r,e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{268:268,318:318}],220:[function(t,e,n){function i(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}e.exports=i},{}],221:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length;++n<i&&e(t[n],n,t)!==!1;);return t}e.exports=i},{}],222:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}e.exports=i},{}],223:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length,r=-1,o=[];++n<i;){var a=t[n];e(a,n,t)&&(o[++r]=a)}return o}e.exports=i},{}],224:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}e.exports=i},{}],225:[function(t,e,n){function i(t,e,n,i){var r=-1,o=t.length;for(i&&o&&(n=t[++r]);++r<o;)n=e(n,t[r],r,t);return n}e.exports=i},{}],226:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}e.exports=i},{}],227:[function(t,e,n){function i(t,e,n){var i=o(e);s.apply(i,r(e));for(var a=-1,c=i.length;++a<c;){var u=i[a],p=t[u],l=n(p,e[u],u,t,e);(l===l?l===p:p!==p)&&(void 0!==p||u in t)||(t[u]=l)}return t}var r=t(291),o=t(326),a=Array.prototype,s=a.push;e.exports=i},{291:291,326:326}],228:[function(t,e,n){var i=t(231),r=t(291),o=t(318),a=t(326),s=o(s=Object.preventExtensions)&&s,c=function(){var t=s&&o(t=Object.assign)&&t;try{if(t){var e=s({1:0});e[0]=1}}catch(n){try{t(e,"xo")}catch(n){}return!e[1]&&t}return!1}(),u=c||function(t,e){return null==e?t:i(e,r(e),i(e,a(e),t))};e.exports=u},{231:231,291:291,318:318,326:326}],229:[function(t,e,n){function i(t,e,n){var i=typeof t;return"function"==i?void 0===e?t:a(t,e,n):null==t?s:"object"==i?r(t):void 0===e?c(t):o(t,e)}var r=t(252),o=t(253),a=t(266),s=t(335),c=t(337);e.exports=i},{252:252,253:253,266:266,335:335,337:337}],230:[function(t,e,n){function i(t,e){if(t!==e){var n=t===t,i=e===e;if(t>e||!n||void 0===t&&i)return 1;if(e>t||!i||void 0===e&&n)return-1}return 0}e.exports=i},{}],231:[function(t,e,n){function i(t,e,n){n||(n={});for(var i=-1,r=e.length;++i<r;){var o=e[i];n[o]=t[o]}return n}e.exports=i},{}],232:[function(t,e,n){(function(n){var i=t(320),r=function(){function t(){}return function(e){if(i(e)){t.prototype=e;var r=new t;t.prototype=null}return r||n.Object()}}();e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{320:320}],233:[function(t,e,n){function i(t,e,n){if("function"!=typeof t)throw new TypeError(r);return setTimeout(function(){t.apply(void 0,n)},e)}var r="Expected a function";e.exports=i},{}],234:[function(t,e,n){function i(t,e){var n=t?t.length:0,i=[];if(!n)return i;var s=-1,c=r,u=!0,p=u&&e.length>=200?a(e):null,l=e.length;p&&(c=o,u=!1,e=p);t:for(;++s<n;){var h=t[s];if(u&&h===h){for(var f=l;f--;)if(e[f]===h)continue t;i.push(h)}else c(e,h,0)<0&&i.push(h)}return i}var r=t(245),o=t(267),a=t(277);e.exports=i},{245:245,267:267,277:277}],235:[function(t,e,n){var i=t(243),r=t(274),o=r(i);e.exports=o},{243:243,274:274}],236:[function(t,e,n){function i(t,e){var n=!0;return r(t,function(t,i,r){return n=!!e(t,i,r)}),n}var r=t(235);e.exports=i},{235:235}],237:[function(t,e,n){function i(t,e){var n=[];return r(t,function(t,i,r){e(t,i,r)&&n.push(t)}),n}var r=t(235);e.exports=i},{235:235}],238:[function(t,e,n){function i(t,e,n,i){var r;return n(t,function(t,n,o){return e(t,n,o)?(r=i?n:t,!1):void 0}),r}e.exports=i},{}],239:[function(t,e,n){function i(t,e,n){for(var i=t.length,r=n?i:-1;n?r--:++r<i;)if(e(t[r],r,t))return r;return-1}e.exports=i},{}],240:[function(t,e,n){function i(t,e,n){for(var c=-1,u=t.length,p=-1,l=[];++c<u;){var h=t[c];if(s(h)&&a(h)&&(n||o(h)||r(h))){e&&(h=i(h,e,n));for(var f=-1,d=h.length;++f<d;)l[++p]=h[f]}else n||(l[++p]=h)}return l}var r=t(315),o=t(316),a=t(293),s=t(299);e.exports=i},{293:293,299:299,315:315,316:316}],241:[function(t,e,n){var i=t(275),r=i();e.exports=r},{275:275}],242:[function(t,e,n){function i(t,e){return r(t,e,o)}var r=t(241),o=t(327);e.exports=i},{241:241,327:327}],243:[function(t,e,n){function i(t,e){return r(t,e,o)}var r=t(241),o=t(326);e.exports=i},{241:241,326:326}],244:[function(t,e,n){function i(t,e,n){if(null!=t){void 0!==n&&n in r(t)&&(e=[n]);for(var i=-1,o=e.length;null!=t&&++i<o;)t=t[e[i]];return i&&i==o?t:void 0}}var r=t(312);e.exports=i},{312:312}],245:[function(t,e,n){function i(t,e,n){if(e!==e)return r(t,n);for(var i=n-1,o=t.length;++i<o;)if(t[i]===e)return i;return-1}var r=t(292);e.exports=i},{292:292}],246:[function(t,e,n){function i(t,e,n,o,a,s){if(t===e)return!0;var c=typeof t,u=typeof e;return"function"!=c&&"object"!=c&&"function"!=u&&"object"!=u||null==t||null==e?t!==t&&e!==e:r(t,e,i,n,o,a,s)}var r=t(247);e.exports=i},{247:247}],247:[function(t,e,n){function i(t,e,n,i,h,m,y){var v=s(t),g=s(e),x=p,b=p;v||(x=d.call(t),x==u?x=l:x!=l&&(v=c(t))),g||(b=d.call(e),b==u?b=l:b!=l&&(g=c(e)));var w=x==l,E=b==l,_=x==b;if(_&&!v&&!w)return o(t,e,x);if(!h){var S=w&&f.call(t,"__wrapped__"),T=E&&f.call(e,"__wrapped__");if(S||T)return n(S?t.value():t,T?e.value():e,i,h,m,y)}if(!_)return!1;m||(m=[]),y||(y=[]);for(var A=m.length;A--;)if(m[A]==t)return y[A]==e;m.push(t),y.push(e);var C=(v?r:a)(t,e,n,i,h,m,y);return m.pop(),y.pop(),C}var r=t(285),o=t(286),a=t(287),s=t(316),c=t(323),u="[object Arguments]",p="[object Array]",l="[object Object]",h=Object.prototype,f=h.hasOwnProperty,d=h.toString;e.exports=i},{285:285,286:286,287:287,316:316,323:323}],248:[function(t,e,n){function i(t){return"function"==typeof t||!1}e.exports=i},{}],249:[function(t,e,n){function i(t,e,n,i,o){for(var a=-1,s=e.length,c=!o;++a<s;)if(c&&i[a]?n[a]!==t[e[a]]:!(e[a]in t))return!1;for(a=-1;++a<s;){var u=e[a],p=t[u],l=n[a];if(c&&i[a])var h=void 0!==p||u in t;else h=o?o(p,l,u):void 0,void 0===h&&(h=r(l,p,o,!0));if(!h)return!1}return!0}var r=t(246);e.exports=i},{246:246}],250:[function(t,e,n){function i(){}e.exports=i},{}],251:[function(t,e,n){function i(t,e){var n=-1,i=o(t)?Array(t.length):[];return r(t,function(t,r,o){i[++n]=e(t,r,o)}),i}var r=t(235),o=t(293);e.exports=i},{235:235,293:293}],252:[function(t,e,n){function i(t){var e=s(t),n=e.length;if(!n)return o(!0);if(1==n){var i=e[0],u=t[i];if(a(u))return function(t){return null==t?!1:t[i]===u&&(void 0!==u||i in c(t))}}for(var p=Array(n),l=Array(n);n--;)u=t[e[n]],p[n]=u,l[n]=a(u);return function(t){return null!=t&&r(c(t),e,p,l)}}var r=t(249),o=t(334),a=t(300),s=t(326),c=t(312);e.exports=i},{249:249,300:300,312:312,326:326,334:334}],253:[function(t,e,n){function i(t,e){var n=s(t),i=c(t)&&u(e),f=t+"";return t=h(t),function(s){if(null==s)return!1;var c=f;if(s=l(s),!(!n&&i||c in s)){if(s=1==t.length?s:r(s,a(t,0,-1)),null==s)return!1;c=p(t),s=l(s)}return s[c]===e?void 0!==e||c in s:o(e,s[c],null,!0)}}var r=t(244),o=t(246),a=t(260),s=t(316),c=t(296),u=t(300),p=t(197),l=t(312),h=t(313);e.exports=i},{197:197,244:244,246:246,260:260,296:296,300:300,312:312,313:313,316:316}],254:[function(t,e,n){function i(t,e,n,f,m){if(!u(t))return t;var y=c(e)&&(s(e)||l(e));if(!y){var v=h(e);d.apply(v,a(e))}return r(v||e,function(r,a){if(v&&(a=r,r=e[a]),p(r))f||(f=[]),m||(m=[]),o(t,e,a,i,n,f,m);else{var s=t[a],c=n?n(s,r,a,t,e):void 0,u=void 0===c;u&&(c=r),!y&&void 0===c||!u&&(c===c?c===s:s!==s)||(t[a]=c)}}),t}var r=t(221),o=t(255),a=t(291),s=t(316),c=t(293),u=t(320),p=t(299),l=t(323),h=t(326),f=Array.prototype,d=f.push;e.exports=i},{221:221,255:255,291:291,293:293,299:299,316:316,320:320,323:323,326:326}],255:[function(t,e,n){function i(t,e,n,i,l,h,f){for(var d=h.length,m=e[n];d--;)if(h[d]==m)return void(t[n]=f[d]);var y=t[n],v=l?l(y,m,n,t,e):void 0,g=void 0===v;g&&(v=m,s(m)&&(a(m)||u(m))?v=a(y)?y:s(y)?r(y):[]:c(m)||o(m)?v=o(y)?p(y):c(y)?y:{}:g=!1),h.push(m),f.push(v),g?t[n]=i(v,m,l,h,f):(v===v?v!==y:y===y)&&(t[n]=v)}var r=t(220),o=t(315),a=t(316),s=t(293),c=t(321),u=t(323),p=t(324);e.exports=i},{220:220,293:293,315:315,316:316,321:321,323:323,324:324}],256:[function(t,e,n){function i(t){return function(e){return null==e?void 0:e[t]}}e.exports=i},{}],257:[function(t,e,n){function i(t){var e=t+"";return t=o(t),function(n){return r(n,t,e)}}var r=t(244),o=t(313);e.exports=i},{244:244,313:313}],258:[function(t,e,n){function i(t,e,n,i,r){return r(t,function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)}),n}e.exports=i},{}],259:[function(t,e,n){var i=t(335),r=t(302),o=r?function(t,e){return r.set(t,e),t}:i;e.exports=o},{302:302,335:335}],260:[function(t,e,n){function i(t,e,n){var i=-1,r=t.length;e=null==e?0:+e||0,0>e&&(e=-e>r?0:r+e),n=void 0===n||n>r?r:+n||0,0>n&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i<r;)o[i]=t[i+e];return o}e.exports=i},{}],261:[function(t,e,n){function i(t,e){var n;return r(t,function(t,i,r){return n=e(t,i,r),!n}),!!n}var r=t(235);e.exports=i},{235:235}],262:[function(t,e,n){function i(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}e.exports=i},{}],263:[function(t,e,n){function i(t){return"string"==typeof t?t:null==t?"":t+""}e.exports=i},{}],264:[function(t,e,n){function i(t,e){var n=-1,i=r,s=t.length,c=!0,u=c&&s>=200,p=u?a():null,l=[];p?(i=o,c=!1):(u=!1,p=e?[]:l);t:for(;++n<s;){var h=t[n],f=e?e(h,n,t):h;if(c&&h===h){for(var d=p.length;d--;)if(p[d]===f)continue t;e&&p.push(f),l.push(h)}else i(p,f,0)<0&&((e||u)&&p.push(f),l.push(h))}return l}var r=t(245),o=t(267),a=t(277);e.exports=i},{245:245,267:267,277:277}],265:[function(t,e,n){function i(t,e){for(var n=-1,i=e.length,r=Array(i);++n<i;)r[n]=t[e[n]];return r}e.exports=i},{}],266:[function(t,e,n){function i(t,e,n){if("function"!=typeof t)return r;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)};case 5:return function(n,i,r,o,a){return t.call(e,n,i,r,o,a)}}return function(){return t.apply(e,arguments)}}var r=t(335);e.exports=i},{335:335}],267:[function(t,e,n){function i(t,e){var n=t.data,i="string"==typeof e||r(e)?n.set.has(e):n.hash[e];return i?0:-1}var r=t(320);e.exports=i},{320:320}],268:[function(t,e,n){function i(t){var e=this.data;"string"==typeof t||r(t)?e.set.add(t):e.hash[t]=!0}var r=t(320);e.exports=i},{320:320}],269:[function(t,e,n){function i(t,e){return r(t.criteria,e.criteria)||t.index-e.index}var r=t(230);e.exports=i},{230:230}],270:[function(t,e,n){function i(t,e,n){for(var i=n.length,o=-1,a=r(t.length-i,0),s=-1,c=e.length,u=Array(a+c);++s<c;)u[s]=e[s];for(;++o<i;)u[n[o]]=t[o];for(;a--;)u[s++]=t[o++];return u}var r=Math.max;e.exports=i},{}],271:[function(t,e,n){function i(t,e,n){for(var i=-1,o=n.length,a=-1,s=r(t.length-o,0),c=-1,u=e.length,p=Array(s+u);++a<s;)p[a]=t[a];for(var l=a;++c<u;)p[l+c]=e[c];for(;++i<o;)p[l+n[i]]=t[a++];return p}var r=Math.max;e.exports=i},{}],272:[function(t,e,n){function i(t,e){return function(n,i,s){var c=e?e():{};if(i=r(i,s,3),a(n))for(var u=-1,p=n.length;++u<p;){var l=n[u];t(c,l,i(l,u,n),n)}else o(n,function(e,n,r){t(c,e,i(e,n,r),r)});return c}}var r=t(229),o=t(235),a=t(316);e.exports=i},{229:229,235:235,316:316}],273:[function(t,e,n){function i(t){return a(function(e,n){var i=-1,a=null==e?0:n.length,s=a>2&&n[a-2],c=a>2&&n[2],u=a>1&&n[a-1];for("function"==typeof s?(s=r(s,u,5),a-=2):(s="function"==typeof u?u:null,a-=s?1:0),c&&o(n[0],n[1],c)&&(s=3>a?null:s,a=1);++i<a;){var p=n[i];p&&t(e,p,s)}return e})}var r=t(266),o=t(295),a=t(216);e.exports=i},{216:216,266:266,295:295}],274:[function(t,e,n){function i(t,e){return function(n,i){var s=n?r(n):0;if(!o(s))return t(n,i);for(var c=e?s:-1,u=a(n);(e?c--:++c<s)&&i(u[c],c,u)!==!1;);return n}}var r=t(290),o=t(298),a=t(312);e.exports=i},{290:290,298:298,312:312}],275:[function(t,e,n){function i(t){return function(e,n,i){for(var o=r(e),a=i(e),s=a.length,c=t?s:-1;t?c--:++c<s;){var u=a[c];if(n(o[u],u,o)===!1)break}return e}}var r=t(312);e.exports=i},{312:312}],276:[function(t,e,n){(function(n){function i(t,e){function i(){var r=this&&this!==n&&this instanceof i?o:t;return r.apply(e,arguments)}var o=r(t);return i}var r=t(278);e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{278:278}],277:[function(t,e,n){(function(n){var i=t(219),r=t(334),o=t(318),a=o(a=n.Set)&&a,s=o(s=Object.create)&&s,c=s&&a?function(t){return new i(t)}:r(null);e.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{219:219,318:318,334:334}],278:[function(t,e,n){function i(t){return function(){var e=r(t.prototype),n=t.apply(e,arguments);return o(n)?n:e}}var r=t(232),o=t(320);e.exports=i},{232:232,320:320}],279:[function(t,e,n){function i(t,e){return function(n,i,c){if(i=r(i,c,3),s(n)){var u=a(n,i,e);return u>-1?n[u]:void 0}return o(n,i,t)}}var r=t(229),o=t(238),a=t(239),s=t(316);e.exports=i},{229:229,238:238,239:239,316:316}],280:[function(t,e,n){function i(t,e){return function(n,i,a){return"function"==typeof i&&void 0===a&&o(n)?t(n,i):e(n,r(i,a,3))}}var r=t(266),o=t(316);e.exports=i},{266:266,316:316}],281:[function(t,e,n){(function(n){function i(t,e,w,E,_,S,T,A,C,M){function R(){for(var d=arguments.length,m=d,y=Array(d);m--;)y[m]=arguments[m];if(E&&(y=o(y,E,_)),S&&(y=a(y,S,T)),D||B){var x=R.placeholder,j=p(y,x);if(d-=j.length,M>d){var F=A?r(A):null,$=b(M-d,0),V=D?j:null,G=D?null:j,z=D?y:null,W=D?null:y;e|=D?v:g,e&=~(D?g:v),O||(e&=~(h|f));var U=[t,e,w,z,V,W,G,F,C,$],q=i.apply(void 0,U);return c(t)&&l(q,U),q.placeholder=x,q}}var H=P?w:this;k&&(t=H[L]),A&&(y=u(y,A)),N&&C<y.length&&(y.length=C);var Y=this&&this!==n&&this instanceof R?I||s(t):t;return Y.apply(H,y)}var N=e&x,P=e&h,k=e&f,D=e&m,O=e&d,B=e&y,I=!k&&s(t),L=t;return R}var r=t(220),o=t(270),a=t(271),s=t(278),c=t(297),u=t(306),p=t(307),l=t(308),h=1,f=2,d=4,m=8,y=16,v=32,g=64,x=128,b=Math.max;e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{220:220,270:270,271:271,278:278,297:297,306:306,307:307,308:308}],282:[function(t,e,n){(function(n){function i(t,e,i,a){function s(){for(var e=-1,r=arguments.length,o=-1,p=a.length,l=Array(r+p);++o<p;)l[o]=a[o];for(;r--;)l[o++]=arguments[++e];var h=this&&this!==n&&this instanceof s?u:t;return h.apply(c?i:this,l)}var c=e&o,u=r(t);return s}var r=t(278),o=1;e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{278:278}],283:[function(t,e,n){function i(t,e){return function(n,i,s,c){var u=arguments.length<3;return"function"==typeof i&&void 0===c&&a(n)?t(n,i,s,u):o(n,r(i,c,4),s,u,e)}}var r=t(229),o=t(258),a=t(316);e.exports=i},{229:229,258:258,316:316}],284:[function(t,e,n){function i(t,e,n,i,v,g,x,b){var w=e&h;if(!w&&"function"!=typeof t)throw new TypeError(m);var E=i?i.length:0;if(E||(e&=~(f|d),i=v=null),E-=v?v.length:0,e&d){var _=i,S=v;i=v=null}var T=w?null:c(t),A=[t,e,n,i,v,_,S,g,x,b];if(T&&(u(A,T),e=A[1],b=A[9]),A[9]=null==b?w?0:t.length:y(b-E,0)||0,e==l)var C=o(A[0],A[2]);else C=e!=f&&e!=(l|f)||A[4].length?a.apply(void 0,A):s.apply(void 0,A);var M=T?r:p;return M(C,A)}var r=t(259),o=t(276),a=t(281),s=t(282),c=t(288),u=t(301),p=t(308),l=1,h=2,f=32,d=64,m="Expected a function",y=Math.max;e.exports=i},{259:259,276:276,281:281,282:282,288:288,301:301,308:308}],285:[function(t,e,n){function i(t,e,n,i,r,o,a){var s=-1,c=t.length,u=e.length,p=!0;if(c!=u&&!(r&&u>c))return!1;for(;p&&++s<c;){var l=t[s],h=e[s];if(p=void 0,i&&(p=r?i(h,l,s):i(l,h,s)),void 0===p)if(r)for(var f=u;f--&&(h=e[f],!(p=l&&l===h||n(l,h,i,r,o,a))););else p=l&&l===h||n(l,h,i,r,o,a)}return!!p}e.exports=i},{}],286:[function(t,e,n){function i(t,e,n){switch(n){case r:case o:return+t==+e;case a:return t.name==e.name&&t.message==e.message;case s:return t!=+t?e!=+e:t==+e;case c:case u:return t==e+""}return!1}var r="[object Boolean]",o="[object Date]",a="[object Error]",s="[object Number]",c="[object RegExp]",u="[object String]";e.exports=i},{}],287:[function(t,e,n){function i(t,e,n,i,o,s,c){var u=r(t),p=u.length,l=r(e),h=l.length;if(p!=h&&!o)return!1;for(var f=o,d=-1;++d<p;){var m=u[d],y=o?m in e:a.call(e,m);if(y){var v=t[m],g=e[m];y=void 0,i&&(y=o?i(g,v,m):i(v,g,m)),void 0===y&&(y=v&&v===g||n(v,g,i,o,s,c))}if(!y)return!1;f||(f="constructor"==m)}if(!f){var x=t.constructor,b=e.constructor;if(x!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b))return!1}return!0}var r=t(326),o=Object.prototype,a=o.hasOwnProperty;e.exports=i},{326:326}],288:[function(t,e,n){var i=t(302),r=t(336),o=i?function(t){return i.get(t)}:r;e.exports=o},{302:302,336:336}],289:[function(t,e,n){var i=t(256),r=t(334),o=t(305),a=t(333),s=function(){return a.funcNames?"constant"==r.name?i("name"):function(t){for(var e=t.name,n=o[e],i=n?n.length:0;i--;){var r=n[i],a=r.func;if(null==a||a==t)return r.name}return e}:r("")}();e.exports=s},{256:256,305:305,333:333,334:334}],290:[function(t,e,n){var i=t(256),r=i("length");e.exports=r},{256:256}],291:[function(t,e,n){var i=t(334),r=t(318),o=t(312),a=r(a=Object.getOwnPropertySymbols)&&a,s=a?function(t){return a(o(t))}:i([]);e.exports=s},{312:312,318:318,334:334}],292:[function(t,e,n){function i(t,e,n){for(var i=t.length,r=e+(n?0:-1);n?r--:++r<i;){var o=t[r];if(o!==o)return r}return-1}e.exports=i},{}],293:[function(t,e,n){function i(t){return null!=t&&o(r(t))}var r=t(290),o=t(298);e.exports=i},{290:290,298:298}],294:[function(t,e,n){function i(t,e){return t=+t,e=null==e?r:e,t>-1&&t%1==0&&e>t}var r=Math.pow(2,53)-1;e.exports=i},{}],295:[function(t,e,n){function i(t,e,n){if(!a(n))return!1;var i=typeof e;if("number"==i?r(n)&&o(e,n.length):"string"==i&&e in n){var s=n[e];return t===t?t===s:s!==s}return!1}var r=t(293),o=t(294),a=t(320);e.exports=i},{293:293,294:294,320:320}],296:[function(t,e,n){function i(t,e){var n=typeof t;if("string"==n&&s.test(t)||"number"==n)return!0;if(r(t))return!1;var i=!a.test(t);return i||null!=e&&t in o(e)}var r=t(316),o=t(312),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=i},{312:312,316:316}],297:[function(t,e,n){function i(t){var e=o(t);return!!e&&t===a[e]&&e in r.prototype}var r=t(217),o=t(289),a=t(200);e.exports=i},{200:200,217:217,289:289}],298:[function(t,e,n){function i(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}var r=Math.pow(2,53)-1;e.exports=i},{}],299:[function(t,e,n){function i(t){return!!t&&"object"==typeof t}e.exports=i},{}],300:[function(t,e,n){function i(t){return t===t&&!r(t)}var r=t(320);e.exports=i},{320:320}],301:[function(t,e,n){function i(t,e){var n=t[1],i=e[1],m=n|i,y=l>m,v=i==l&&n==p||i==l&&n==h&&t[7].length<=e[8]||i==(l|h)&&n==p;if(!y&&!v)return t;i&c&&(t[2]=e[2],m|=n&c?0:u);var g=e[3];if(g){var x=t[3];t[3]=x?o(x,g,e[4]):r(g),t[4]=x?s(t[3],f):r(e[4])}return g=e[5],g&&(x=t[5],t[5]=x?a(x,g,e[6]):r(g),t[6]=x?s(t[5],f):r(e[6])),g=e[7],g&&(t[7]=r(g)),i&l&&(t[8]=null==t[8]?e[8]:d(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=m,t}var r=t(220),o=t(270),a=t(271),s=t(307),c=1,u=4,p=8,l=128,h=256,f="__lodash_placeholder__",d=Math.min;e.exports=i},{220:220,270:270,271:271,307:307}],302:[function(t,e,n){(function(n){var i=t(318),r=i(r=n.WeakMap)&&r,o=r&&new r;e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{318:318}],303:[function(t,e,n){function i(t,e){t=r(t);for(var n=-1,i=e.length,o={};++n<i;){var a=e[n];a in t&&(o[a]=t[a])}return o}var r=t(312);e.exports=i},{312:312}],304:[function(t,e,n){function i(t,e){var n={};return r(t,function(t,i,r){e(t,i,r)&&(n[i]=t)}),n}var r=t(242);e.exports=i},{242:242}],305:[function(t,e,n){var i={};e.exports=i},{}],306:[function(t,e,n){function i(t,e){for(var n=t.length,i=a(e.length,n),s=r(t);i--;){var c=e[i];t[i]=o(c,n)?s[c]:void 0}return t}var r=t(220),o=t(294),a=Math.min;e.exports=i},{220:220,294:294}],307:[function(t,e,n){function i(t,e){for(var n=-1,i=t.length,o=-1,a=[];++n<i;)t[n]===e&&(t[n]=r,a[++o]=n);return a}var r="__lodash_placeholder__";e.exports=i},{}],308:[function(t,e,n){var i=t(259),r=t(212),o=150,a=16,s=function(){var t=0,e=0;return function(n,s){var c=r(),u=a-(c-e);if(e=c,u>0){if(++t>=o)return n}else t=0;return i(n,s)}}();e.exports=s},{212:212,259:259}],309:[function(t,e,n){function i(t){var e;if(!o(t)||u.call(t)!=a||!c.call(t,"constructor")&&(e=t.constructor,"function"==typeof e&&!(e instanceof e)))return!1;var n;return r(t,function(t,e){n=e}),void 0===n||c.call(t,n)}var r=t(242),o=t(299),a="[object Object]",s=Object.prototype,c=s.hasOwnProperty,u=s.toString;e.exports=i},{242:242,299:299}],310:[function(t,e,n){function i(t){for(var e=c(t),n=e.length,i=n&&t.length,p=i&&s(i)&&(o(t)||u.nonEnumArgs&&r(t)),h=-1,f=[];++h<n;){var d=e[h];(p&&a(d,i)||l.call(t,d))&&f.push(d)}return f}var r=t(315),o=t(316),a=t(294),s=t(298),c=t(327),u=t(333),p=Object.prototype,l=p.hasOwnProperty;e.exports=i},{294:294,298:298,315:315,316:316,327:327,333:333}],311:[function(t,e,n){function i(t,e){for(var n,i=-1,r=t.length,o=-1,a=[];++i<r;){var s=t[i],c=e?e(s,i,t):s;i&&n===c||(n=c,a[++o]=s)}return a}e.exports=i},{}],312:[function(t,e,n){function i(t){return r(t)?t:Object(t)}var r=t(320);e.exports=i},{320:320}],313:[function(t,e,n){function i(t){if(o(t))return t;var e=[];return r(t).replace(a,function(t,n,i,r){e.push(i?r.replace(s,"$1"):n||t)}),e}var r=t(263),o=t(316),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;e.exports=i},{263:263,316:316}],314:[function(t,e,n){function i(t){return t instanceof r?t.clone():new o(t.__wrapped__,t.__chain__,a(t.__actions__))}var r=t(217),o=t(218),a=t(220);e.exports=i},{217:217,218:218,220:220}],315:[function(t,e,n){function i(t){return o(t)&&r(t)&&c.call(t)==a}var r=t(293),o=t(299),a="[object Arguments]",s=Object.prototype,c=s.toString;e.exports=i},{293:293,299:299}],316:[function(t,e,n){var i=t(298),r=t(318),o=t(299),a="[object Array]",s=Object.prototype,c=s.toString,u=r(u=Array.isArray)&&u,p=u||function(t){return o(t)&&i(t.length)&&c.call(t)==a};e.exports=p},{298:298,299:299,318:318}],317:[function(t,e,n){(function(n){var i=t(248),r=t(318),o="[object Function]",a=Object.prototype,s=a.toString,c=r(c=n.Uint8Array)&&c,u=i(/x/)||c&&!i(c)?function(t){return s.call(t)==o}:i;e.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{248:248,318:318}],318:[function(t,e,n){function i(t){return null==t?!1:p.call(t)==a?l.test(u.call(t)):o(t)&&s.test(t)}var r=t(332),o=t(299),a="[object Function]",s=/^\[object .+?Constructor\]$/,c=Object.prototype,u=Function.prototype.toString,p=c.toString,l=RegExp("^"+r(p).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{299:299,332:332}],319:[function(t,e,n){function i(t){return"number"==typeof t||r(t)&&s.call(t)==o}var r=t(299),o="[object Number]",a=Object.prototype,s=a.toString;e.exports=i},{299:299}],320:[function(t,e,n){function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}e.exports=i},{}],321:[function(t,e,n){var i=t(318),r=t(309),o="[object Object]",a=Object.prototype,s=a.toString,c=i(c=Object.getPrototypeOf)&&c,u=c?function(t){if(!t||s.call(t)!=o)return!1;var e=t.valueOf,n=i(e)&&(n=c(e))&&c(n);return n?t==n||c(t)==n:r(t)}:r;e.exports=u},{309:309,318:318}],322:[function(t,e,n){function i(t){return"string"==typeof t||r(t)&&s.call(t)==o}var r=t(299),o="[object String]",a=Object.prototype,s=a.toString;e.exports=i},{299:299}],323:[function(t,e,n){function i(t){return o(t)&&r(t.length)&&!!R[P.call(t)]}var r=t(298),o=t(299),a="[object Arguments]",s="[object Array]",c="[object Boolean]",u="[object Date]",p="[object Error]",l="[object Function]",h="[object Map]",f="[object Number]",d="[object Object]",m="[object RegExp]",y="[object Set]",v="[object String]",g="[object WeakMap]",x="[object ArrayBuffer]",b="[object Float32Array]",w="[object Float64Array]",E="[object Int8Array]",_="[object Int16Array]",S="[object Int32Array]",T="[object Uint8Array]",A="[object Uint8ClampedArray]",C="[object Uint16Array]",M="[object Uint32Array]",R={};R[b]=R[w]=R[E]=R[_]=R[S]=R[T]=R[A]=R[C]=R[M]=!0,R[a]=R[s]=R[x]=R[c]=R[u]=R[p]=R[l]=R[h]=R[f]=R[d]=R[m]=R[y]=R[v]=R[g]=!1;var N=Object.prototype,P=N.toString;e.exports=i;
+},{298:298,299:299}],324:[function(t,e,n){function i(t){return r(t,o(t))}var r=t(231),o=t(327);e.exports=i},{231:231,327:327}],325:[function(t,e,n){var i=t(227),r=t(228),o=t(273),a=o(function(t,e,n){return n?i(t,e,n):r(t,e)});e.exports=a},{227:227,228:228,273:273}],326:[function(t,e,n){var i=t(293),r=t(318),o=t(320),a=t(310),s=r(s=Object.keys)&&s,c=s?function(t){var e=null!=t&&t.constructor;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&i(t)?a(t):o(t)?s(t):[]}:a;e.exports=c},{293:293,310:310,318:318,320:320}],327:[function(t,e,n){function i(t){if(null==t)return[];c(t)||(t=Object(t));var e=t.length;e=e&&s(e)&&(o(t)||u.nonEnumArgs&&r(t))&&e||0;for(var n=t.constructor,i=-1,p="function"==typeof n&&n.prototype===t,h=Array(e),f=e>0;++i<e;)h[i]=i+"";for(var d in t)f&&a(d,e)||"constructor"==d&&(p||!l.call(t,d))||h.push(d);return h}var r=t(315),o=t(316),a=t(294),s=t(298),c=t(320),u=t(333),p=Object.prototype,l=p.hasOwnProperty;e.exports=i},{294:294,298:298,315:315,316:316,320:320,333:333}],328:[function(t,e,n){var i=t(254),r=t(273),o=r(i);e.exports=o},{254:254,273:273}],329:[function(t,e,n){var i=t(224),r=t(234),o=t(240),a=t(266),s=t(327),c=t(303),u=t(304),p=t(216),l=p(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=i(o(e),String);return c(t,r(s(t),e))}var n=a(e[0],e[1],3);return u(t,function(t,e,i){return!n(t,e,i)})});e.exports=l},{216:216,224:224,234:234,240:240,266:266,303:303,304:304,327:327}],330:[function(t,e,n){var i=t(240),r=t(266),o=t(303),a=t(304),s=t(216),c=s(function(t,e){return null==t?{}:"function"==typeof e[0]?a(t,r(e[0],e[1],3)):o(t,i(e))});e.exports=c},{216:216,240:240,266:266,303:303,304:304}],331:[function(t,e,n){function i(t){return r(t,o(t))}var r=t(265),o=t(326);e.exports=i},{265:265,326:326}],332:[function(t,e,n){function i(t){return t=r(t),t&&a.test(t)?t.replace(o,"\\$&"):t}var r=t(263),o=/[.*+?^${}()|[\]\/\\]/g,a=RegExp(o.source);e.exports=i},{263:263}],333:[function(t,e,n){(function(t){var n=Object.prototype,i=(i=t.window)&&i.document,r=n.propertyIsEnumerable,o={};!function(t){var e=function(){this.x=t},n=arguments,a=[];e.prototype={valueOf:t,y:t};for(var s in new e)a.push(s);o.funcDecomp=/\bthis\b/.test(function(){return this}),o.funcNames="string"==typeof Function.name;try{o.dom=11===i.createDocumentFragment().nodeType}catch(c){o.dom=!1}try{o.nonEnumArgs=!r.call(n,1)}catch(c){o.nonEnumArgs=!0}}(1,0),e.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],334:[function(t,e,n){function i(t){return function(){return t}}e.exports=i},{}],335:[function(t,e,n){function i(t){return t}e.exports=i},{}],336:[function(t,e,n){function i(){}e.exports=i},{}],337:[function(t,e,n){function i(t){return a(t)?r(t):o(t)}var r=t(256),o=t(257),a=t(296);e.exports=i},{256:256,257:257,296:296}],338:[function(t,e,n){e.exports=function(t,e,n){return 2==arguments.length?t.getAttribute(e):null===n?t.removeAttribute(e):(t.setAttribute(e,n),t)}},{}],339:[function(t,e,n){e.exports=t(348)},{348:348}],340:[function(t,e,n){e.exports=function(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t}},{}],341:[function(t,e,n){e.exports=t(350)},{350:350}],342:[function(t,e,n){e.exports=t(351)},{351:351}],343:[function(t,e,n){e.exports=t(355)},{355:355}],344:[function(t,e,n){e.exports=t(352)},{352:352}],345:[function(t,e,n){e.exports=t(353)},{353:353}],346:[function(t,e,n){e.exports=t(354)},{354:354}],347:[function(t,e,n){e.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},{}],348:[function(t,e,n){function i(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}var r=t(349),o=/\s+/,a=Object.prototype.toString;e.exports=function(t){return new i(t)},i.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array(),n=r(e,t);return~n||e.push(t),this.el.className=e.join(" "),this},i.prototype.remove=function(t){if("[object RegExp]"==a.call(t))return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=r(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},i.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},i.prototype.toggle=function(t,e){return this.list?("undefined"!=typeof e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):("undefined"!=typeof e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},i.prototype.array=function(){var t=this.el.getAttribute("class")||"",e=t.replace(/^\s+|\s+$/g,""),n=e.split(o);return""===n[0]&&n.shift(),n},i.prototype.has=i.prototype.contains=function(t){return this.list?this.list.contains(t):!!~r(this.array(),t)}},{349:349}],349:[function(t,e,n){e.exports=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},{}],350:[function(t,e,n){var i=t(353);e.exports=function(t,e,n,r){for(t=n?{parentNode:t}:t,r=r||document;(t=t.parentNode)&&t!==document;){if(i(t,e))return t;if(t===r)return}}},{353:353}],351:[function(t,e,n){var i=t(350),r=t(352);n.bind=function(t,e,n,o,a){return r.bind(t,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=i(r,e,!0,t),n.delegateTarget&&o.call(t,n)},a)},n.unbind=function(t,e,n,i){r.unbind(t,e,n,i)}},{350:350,352:352}],352:[function(t,e,n){var i=window.addEventListener?"addEventListener":"attachEvent",r=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==i?"on":"";n.bind=function(t,e,n,r){return t[i](o+e,n,r||!1),n},n.unbind=function(t,e,n,i){return t[r](o+e,n,i||!1),n}},{}],353:[function(t,e,n){function i(t,e){if(!t||1!==t.nodeType)return!1;if(a)return a.call(t,e);for(var n=r.all(e,t.parentNode),i=0;i<n.length;++i)if(n[i]==t)return!0;return!1}var r=t(354),o=Element.prototype,a=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;e.exports=i},{354:354}],354:[function(t,e,n){function i(t,e){return e.querySelector(t)}n=e.exports=function(t,e){return e=e||document,i(t,e)},n.all=function(t,e){return e=e||document,e.querySelectorAll(t)},n.engine=function(t){if(!t.one)throw new Error(".one callback required");if(!t.all)throw new Error(".all callback required");return i=t.one,n.all=t.all,n}},{}],355:[function(t,e,n){function i(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){var r=e.createElement("html");return r.innerHTML=t,r.removeChild(r.lastChild)}var o=a[i]||a._default,s=o[0],c=o[1],u=o[2],r=e.createElement("div");for(r.innerHTML=c+t+u;s--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var p=e.createDocumentFragment();r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p}e.exports=i;var r=document.createElement("div");r.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var o=!r.getElementsByTagName("link").length;r=void 0;var a={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:o?[1,"X<div>","</div>"]:[0,"",""]};a.td=a.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],a.option=a.optgroup=[1,'<select multiple="multiple">',"</select>"],a.thead=a.tbody=a.colgroup=a.caption=a.tfoot=[1,"<table>","</table>"],a.polyline=a.ellipse=a.polygon=a.circle=a.text=a.line=a.path=a.rect=a.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],356:[function(t,e,n){e.exports=t(358),e.exports.Collection=t(357)},{357:357,358:358}],357:[function(t,e,n){"use strict";function i(t,e,n,i){var r=n.inverse;return t.remove=function(t){var n=this.indexOf(t);return-1!==n&&(this.splice(n,1),e.unset(t,r,i)),t},t.contains=function(t){return-1!==this.indexOf(t)},t.add=function(t){this.contains(t)||(this.push(t),e.set(t,r,i))},t}e.exports.extend=i},{}],358:[function(t,e,n){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e.name||e)}function r(t,e,n){Object.defineProperty(n,e.name,{enumerable:e.enumerable,value:s.extend(n[e.name]||[],t,e,n)})}function o(t,e,n){var i=e.inverse,r=n[e.name];Object.defineProperty(n,e.name,{enumerable:e.enumerable,get:function(){return r},set:function(e){if(e!==r){var o=r;r=null,o&&t.unset(o,i,n),r=e,t.set(r,i,n)}}})}function a(t,e){return this instanceof a?(t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,void(this.props[e.name]=e)):new a(t,e)}var s=t(357);a.prototype.bind=function(t,e){if("string"==typeof e){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?r(this,e,t):o(this,e,t)},a.prototype.ensureBound=function(t,e){i(t,e)||this.bind(t,e)},a.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?t[e.name].remove(n):t[e.name]=void 0)},a.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?t[e.name].add(n):t[e.name]=n)},e.exports=a},{357:357}]},{},[1])(1)}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js
new file mode 100644
index 0000000..ea0861c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js
@@ -0,0 +1,27371 @@
+/*!
+ * bpmn-js - bpmn-navigated-viewer v0.10.3
+
+ * Copyright 2014, 2015 camunda Services GmbH and other contributors
+ *
+ * Released under the bpmn.io license
+ * http://bpmn.io/license
+ *
+ * Source Code: https://github.com/bpmn-io/bpmn-js
+ *
+ * Date: 2015-05-18
+ */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.BpmnJS=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(79);
+
+var Viewer = _dereq_(2);
+
+
+/**
+ * A viewer that includes mouse navigation facilities
+ *
+ * @param {Object} options
+ */
+function NavigatedViewer(options) {
+ Viewer.call(this, options);
+}
+
+inherits(NavigatedViewer, Viewer);
+
+module.exports = NavigatedViewer;
+
+NavigatedViewer.prototype._navigationModules = [
+ _dereq_(61),
+ _dereq_(59)
+];
+
+NavigatedViewer.prototype._modules = [].concat(
+ NavigatedViewer.prototype._modules,
+ NavigatedViewer.prototype._navigationModules);
+},{"2":2,"59":59,"61":61,"79":79}],2:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175),
+ omit = _dereq_(179),
+ isString = _dereq_(172),
+ isNumber = _dereq_(169);
+
+var domify = _dereq_(190),
+ domQuery = _dereq_(192),
+ domRemove = _dereq_(193);
+
+var Diagram = _dereq_(36),
+ BpmnModdle = _dereq_(15);
+
+var Importer = _dereq_(9);
+
+
+function initListeners(diagram, listeners) {
+ var events = diagram.get('eventBus');
+
+ listeners.forEach(function(l) {
+ events.on(l.event, l.handler);
+ });
+}
+
+function checkValidationError(err) {
+
+ // check if we can help the user by indicating wrong BPMN 2.0 xml
+ // (in case he or the exporting tool did not get that right)
+
+ var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
+ var match = pattern.exec(err.message);
+
+ if (match) {
+ err.message =
+ 'unparsable content <' + match[1] + '> detected; ' +
+ 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
+ }
+
+ return err;
+}
+
+var DEFAULT_OPTIONS = {
+ width: '100%',
+ height: '100%',
+ position: 'relative',
+ container: 'body'
+};
+
+
+/**
+ * Ensure the passed argument is a proper unit (defaulting to px)
+ */
+function ensureUnit(val) {
+ return val + (isNumber(val) ? 'px' : '');
+}
+
+/**
+ * A viewer for BPMN 2.0 diagrams.
+ *
+ * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include
+ * additional features.
+ *
+ *
+ * ## Extending the Viewer
+ *
+ * In order to extend the viewer pass extension modules to bootstrap via the
+ * `additionalModules` option. An extension module is an object that exposes
+ * named services.
+ *
+ * The following example depicts the integration of a simple
+ * logging component that integrates with interaction events:
+ *
+ *
+ * ```javascript
+ *
+ * // logging component
+ * function InteractionLogger(eventBus) {
+ * eventBus.on('element.hover', function(event) {
+ * console.log()
+ * })
+ * }
+ *
+ * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
+ *
+ * // extension module
+ * var extensionModule = {
+ * __init__: [ 'interactionLogger' ],
+ * interactionLogger: [ 'type', InteractionLogger ]
+ * };
+ *
+ * // extend the viewer
+ * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });
+ * bpmnViewer.importXML(...);
+ * ```
+ *
+ * @param {Object} [options] configuration options to pass to the viewer
+ * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
+ * @param {String|Number} [options.width] the width of the viewer
+ * @param {String|Number} [options.height] the height of the viewer
+ * @param {Object} [options.moddleExtensions] extension packages to provide
+ * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules
+ * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules
+ */
+function Viewer(options) {
+
+ this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
+
+ var parent = options.container;
+
+ // support jquery element
+ // unwrap it if passed
+ if (parent.get) {
+ parent = parent.get(0);
+ }
+
+ // support selector
+ if (isString(parent)) {
+ parent = domQuery(parent);
+ }
+
+ var container = this.container = domify('<div class="bjs-container"></div>');
+ parent.appendChild(container);
+
+ assign(container.style, {
+ width: ensureUnit(options.width),
+ height: ensureUnit(options.height),
+ position: options.position
+ });
+
+ /**
+ * The code in the <project-logo></project-logo> area
+ * must not be changed, see http://bpmn.io/license for more information
+ *
+ * <project-logo>
+ */
+
+ /* jshint -W101 */
+
+ // inlined ../resources/bpmnjs.png
+ var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
+
+ /* jshint +W101 */
+
+ var linkMarkup =
+ '<a href="http://bpmn.io" ' +
+ 'target="_blank" ' +
+ 'class="bjs-powered-by" ' +
+ 'title="Powered by bpmn.io" ' +
+ 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
+ '<img src="data:image/png;base64,' + logoData + '">' +
+ '</a>';
+
+ container.appendChild(domify(linkMarkup));
+
+ /* </project-logo> */
+}
+
+Viewer.prototype.importXML = function(xml, done) {
+
+ var self = this;
+
+ this.moddle = this.createModdle();
+
+ this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
+
+ if (err) {
+ err = checkValidationError(err);
+ return done(err);
+ }
+
+ var parseWarnings = context.warnings;
+
+ self.importDefinitions(definitions, function(err, importWarnings) {
+ if (err) {
+ return done(err);
+ }
+
+ done(null, parseWarnings.concat(importWarnings || []));
+ });
+ });
+};
+
+Viewer.prototype.saveXML = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var definitions = this.definitions;
+
+ if (!definitions) {
+ return done(new Error('no definitions loaded'));
+ }
+
+ this.moddle.toXML(definitions, options, done);
+};
+
+Viewer.prototype.createModdle = function() {
+ return new BpmnModdle(this.options.moddleExtensions);
+};
+
+Viewer.prototype.saveSVG = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var canvas = this.get('canvas');
+
+ var contentNode = canvas.getDefaultLayer(),
+ defsNode = canvas._svg.select('defs');
+
+ var contents = contentNode.innerSVG(),
+ defs = (defsNode && defsNode.outerSVG()) || '';
+
+ var bbox = contentNode.getBBox();
+
+ var svg =
+ '<?xml version="1.0" encoding="utf-8"?>\n' +
+ '<!-- created with bpmn-js / http://bpmn.io -->\n' +
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
+ '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
+ 'width="' + bbox.width + '" height="' + bbox.height + '" ' +
+ 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
+ defs + contents +
+ '</svg>';
+
+ done(null, svg);
+};
+
+Viewer.prototype.get = function(name) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.get(name);
+};
+
+Viewer.prototype.invoke = function(fn) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.invoke(fn);
+};
+
+Viewer.prototype.importDefinitions = function(definitions, done) {
+
+ // use try/catch to not swallow synchronous exceptions
+ // that may be raised during model parsing
+ try {
+ if (this.diagram) {
+ this.clear();
+ }
+
+ this.definitions = definitions;
+
+ var diagram = this.diagram = this._createDiagram(this.options);
+
+ this._init(diagram);
+
+ Importer.importBpmnDiagram(diagram, definitions, done);
+ } catch (e) {
+ done(e);
+ }
+};
+
+Viewer.prototype._init = function(diagram) {
+ initListeners(diagram, this.__listeners || []);
+};
+
+Viewer.prototype._createDiagram = function(options) {
+
+ var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
+
+ // add self as an available service
+ modules.unshift({
+ bpmnjs: [ 'value', this ],
+ moddle: [ 'value', this.moddle ]
+ });
+
+ options = omit(options, 'additionalModules');
+
+ options = assign(options, {
+ canvas: { container: this.container },
+ modules: modules
+ });
+
+ return new Diagram(options);
+};
+
+
+Viewer.prototype.getModules = function() {
+ return this._modules;
+};
+
+/**
+ * Remove all drawn elements from the viewer.
+ *
+ * After calling this method the viewer can still
+ * be reused for opening another diagram.
+ */
+Viewer.prototype.clear = function() {
+ var diagram = this.diagram;
+
+ if (diagram) {
+ diagram.destroy();
+ }
+};
+
+/**
+ * Destroy the viewer instance and remove all its remainders
+ * from the document tree.
+ */
+Viewer.prototype.destroy = function() {
+ // clear underlying diagram
+ this.clear();
+
+ // remove container
+ domRemove(this.container);
+};
+
+/**
+ * Register an event listener on the viewer
+ *
+ * @param {String} event
+ * @param {Function} handler
+ */
+Viewer.prototype.on = function(event, handler) {
+ var diagram = this.diagram,
+ listeners = this.__listeners = this.__listeners || [];
+
+ listeners.push({ event: event, handler: handler });
+
+ if (diagram) {
+ diagram.get('eventBus').on(event, handler);
+ }
+};
+
+// modules the viewer is composed of
+Viewer.prototype._modules = [
+ _dereq_(3),
+ _dereq_(56),
+ _dereq_(52)
+];
+
+module.exports = Viewer;
+
+},{"15":15,"169":169,"172":172,"175":175,"179":179,"190":190,"192":192,"193":193,"3":3,"36":36,"52":52,"56":56,"9":9}],3:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(6),
+ _dereq_(11)
+ ]
+};
+},{"11":11,"6":6}],4:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(79),
+ isArray = _dereq_(166),
+ isObject = _dereq_(170),
+ assign = _dereq_(175),
+ forEach = _dereq_(84),
+ every = _dereq_(81),
+ includes = _dereq_(86),
+ some = _dereq_(89);
+
+var DefaultRenderer = _dereq_(44),
+ TextUtil = _dereq_(71),
+ DiUtil = _dereq_(12);
+
+var createLine = DefaultRenderer.createLine;
+
+
+function BpmnRenderer(events, styles, pathMap) {
+
+ DefaultRenderer.call(this, styles);
+
+ var TASK_BORDER_RADIUS = 10;
+ var INNER_OUTER_DIST = 3;
+
+ var LABEL_STYLE = {
+ fontFamily: 'Arial, sans-serif',
+ fontSize: '12px'
+ };
+
+ var textUtil = new TextUtil({
+ style: LABEL_STYLE,
+ size: { width: 100 }
+ });
+
+ var markers = {};
+
+ function addMarker(id, element) {
+ markers[id] = element;
+ }
+
+ function marker(id) {
+ return markers[id];
+ }
+
+ function initMarkers(svg) {
+
+ function createMarker(id, options) {
+ var attrs = assign({
+ fill: 'black',
+ strokeWidth: 1,
+ strokeLinecap: 'round',
+ strokeDasharray: 'none'
+ }, options.attrs);
+
+ var ref = options.ref || { x: 0, y: 0 };
+
+ var scale = options.scale || 1;
+
+ // fix for safari / chrome / firefox bug not correctly
+ // resetting stroke dash array
+ if (attrs.strokeDasharray === 'none') {
+ attrs.strokeDasharray = [10000, 1];
+ }
+
+ var marker = options.element
+ .attr(attrs)
+ .marker(0, 0, 20, 20, ref.x, ref.y)
+ .attr({
+ markerWidth: 20 * scale,
+ markerHeight: 20 * scale
+ });
+
+ return addMarker(id, marker);
+ }
+
+
+ createMarker('sequenceflow-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('messageflow-start', {
+ element: svg.circle(6, 6, 3.5),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 6, y: 6 }
+ });
+
+ createMarker('messageflow-end', {
+ element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black',
+ strokeLinecap: 'butt'
+ },
+ ref: { x: 8.5, y: 5 }
+ });
+
+ createMarker('data-association-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-flow-marker', {
+ element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: -1, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-default-flow-marker', {
+ element: svg.path('M 1 4 L 5 16'),
+ attrs: {
+ stroke: 'black'
+ },
+ ref: { x: -5, y: 10 },
+ scale: 0.5
+ });
+ }
+
+ function computeStyle(custom, traits, defaultStyles) {
+ if (!isArray(traits)) {
+ defaultStyles = traits;
+ traits = [];
+ }
+
+ return styles.style(traits || [], assign(defaultStyles, custom || {}));
+ }
+
+ function drawCircle(p, width, height, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ var cx = width / 2,
+ cy = height / 2;
+
+ return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
+ }
+
+ function drawRect(p, width, height, r, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
+ }
+
+ function drawDiamond(p, width, height, attrs) {
+
+ var x_2 = width / 2;
+ var y_2 = height / 2;
+
+ var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.polygon(points).attr(attrs);
+ }
+
+ function drawLine(p, waypoints, attrs) {
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'none'
+ });
+
+ return createLine(waypoints, attrs).appendTo(p);
+ }
+
+ function drawPath(p, d, attrs) {
+
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ strokeWidth: 2,
+ stroke: 'black'
+ });
+
+ return p.path(d).attr(attrs);
+ }
+
+ function as(type) {
+ return function(p, element) {
+ return handlers[type](p, element);
+ };
+ }
+
+ function renderer(type) {
+ return handlers[type];
+ }
+
+ function renderEventContent(element, p) {
+
+ var event = getSemantic(element);
+ var isThrowing = isThrowEvent(event);
+
+ if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
+ return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
+ return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
+ return renderer('bpmn:ConditionalEventDefinition')(p, element);
+ }
+
+ if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
+ return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {
+ return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {
+ return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
+ return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
+ return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
+ return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
+ return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
+ return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
+ return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
+ }
+
+ return null;
+ }
+
+ function renderLabel(p, label, options) {
+ return textUtil.createText(p, label || '', options).addClass('djs-label');
+ }
+
+ function renderEmbeddedLabel(p, element, align) {
+ var semantic = getSemantic(element);
+ return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });
+ }
+
+ function renderExternalLabel(p, element, align) {
+ var semantic = getSemantic(element);
+
+ if (!semantic.name) {
+ element.hidden = true;
+ }
+
+ return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });
+ }
+
+ function renderLaneLabel(p, text, element) {
+ var textBox = renderLabel(p, text, {
+ box: { height: 30, width: element.height },
+ align: 'center-middle'
+ });
+
+ var top = -1 * element.height;
+ textBox.transform(
+ 'rotate(270) ' +
+ 'translate(' + top + ',' + 0 + ')'
+ );
+ }
+
+ function createPathFromConnection(connection) {
+ var waypoints = connection.waypoints;
+
+ var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;
+ for (var i = 1; i < waypoints.length; i++) {
+ pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
+ }
+ return pathData;
+ }
+
+ var handlers = {
+ 'bpmn:Event': function(p, element, attrs) {
+ return drawCircle(p, element.width, element.height, attrs);
+ },
+ 'bpmn:StartEvent': function(p, element) {
+ var attrs = {};
+ var semantic = getSemantic(element);
+
+ if (!semantic.isInterrupting) {
+ attrs = {
+ strokeDasharray: '6',
+ strokeLinecap: 'round'
+ };
+ }
+
+ var circle = renderer('bpmn:Event')(p, element, attrs);
+
+ renderEventContent(element, p);
+
+ return circle;
+ },
+ 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.235,
+ my: 0.315
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'white';
+ var stroke = isThrowing ? 'white' : 'black';
+
+ var messagePath = drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill,
+ stroke: stroke
+ });
+
+ return messagePath;
+ },
+ 'bpmn:TimerEventDefinition': function(p, element) {
+
+ var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
+ strokeWidth: 2
+ });
+
+ var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ drawPath(p, pathData, {
+ strokeWidth: 2,
+ strokeLinecap: 'square'
+ });
+
+ for(var i = 0;i < 12;i++) {
+
+ var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ var width = element.width / 2;
+ var height = element.height / 2;
+
+ drawPath(p, linePathData, {
+ strokeWidth: 1,
+ strokeLinecap: 'square',
+ transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
+ });
+ }
+
+ return circle;
+ },
+ 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.555
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ConditionalEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.222
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_LINK', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.57,
+ my: 0.263
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ERROR', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.2,
+ my: 0.722
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
+ xScaleFactor: 1.0,
+ yScaleFactor: 1.0,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.638,
+ my: -0.055
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ }).transform('rotate(45)');
+ },
+ 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.201,
+ my: 0.472
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.2
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.222,
+ my: 0.36
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
+ xScaleFactor: 1.2,
+ yScaleFactor: 1.2,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.458,
+ my: 0.194
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:EndEvent': function(p, element) {
+ var circle = renderer('bpmn:Event')(p, element, {
+ strokeWidth: 4
+ });
+
+ renderEventContent(element, p, true);
+
+ return circle;
+ },
+ 'bpmn:TerminateEventDefinition': function(p, element) {
+ var circle = drawCircle(p, element.width, element.height, 8, {
+ strokeWidth: 4,
+ fill: 'black'
+ });
+
+ return circle;
+ },
+ 'bpmn:IntermediateEvent': function(p, element) {
+ var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });
+ /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
+ 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
+
+ 'bpmn:Activity': function(p, element, attrs) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
+ },
+
+ 'bpmn:Task': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+ renderEmbeddedLabel(p, element, 'center-middle');
+ attachTaskMarkers(p, element);
+ return rect;
+ },
+ 'bpmn:ServiceTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 12,
+ y: 18
+ }
+ });
+
+ /* service bg */ drawPath(p, pathDataBG, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
+ abspos: {
+ x: 17.2,
+ y: 18
+ }
+ });
+
+ /* service fill */ drawPath(p, fillPathData, {
+ strokeWidth: 0,
+ stroke: 'none',
+ fill: 'white'
+ });
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 17,
+ y: 22
+ }
+ });
+
+ /* service */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:UserTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var x = 15;
+ var y = 12;
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user path */ drawPath(p, pathData, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user2 path */ drawPath(p, pathData2, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user3 path */ drawPath(p, pathData3, {
+ strokeWidth: 0.5,
+ fill: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:ManualTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
+ abspos: {
+ x: 17,
+ y: 15
+ }
+ });
+
+ /* manual path */ drawPath(p, pathData, {
+ strokeWidth: 0.25,
+ fill: 'white',
+ stroke: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:SendTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.285,
+ my: 0.357
+ }
+ });
+
+ /* send path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black',
+ stroke: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:ReceiveTask' : function(p, element) {
+ var semantic = getSemantic(element);
+
+ var task = renderer('bpmn:Task')(p, element);
+ var pathData;
+
+ if (semantic.instantiate) {
+ drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
+ abspos: {
+ x: 7.77,
+ y: 9.52
+ }
+ });
+ } else {
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.3,
+ my: 0.4
+ }
+ });
+ }
+
+ /* receive path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:ScriptTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
+ abspos: {
+ x: 15,
+ y: 20
+ }
+ });
+
+ /* script path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:BusinessRuleTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessHeaderPath = drawPath(p, headerPathData);
+ businessHeaderPath.attr({
+ strokeWidth: 1,
+ fill: 'AAA'
+ });
+
+ var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessPath = drawPath(p, headerData);
+ businessPath.attr({
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:SubProcess': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+
+ var semantic = getSemantic(element);
+
+ var expanded = DiUtil.isExpanded(semantic);
+
+ var isEventSubProcess = !!semantic.triggeredByEvent;
+ if (isEventSubProcess) {
+ rect.attr({
+ strokeDasharray: '1,2'
+ });
+ }
+
+ renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
+
+ if (expanded) {
+ attachTaskMarkers(p, element);
+ } else {
+ attachTaskMarkers(p, element, ['SubProcessMarker']);
+ }
+
+ return rect;
+ },
+ 'bpmn:AdHocSubProcess': function(p, element) {
+ return renderer('bpmn:SubProcess')(p, element);
+ },
+ 'bpmn:Transaction': function(p, element) {
+ var outer = renderer('bpmn:SubProcess')(p, element);
+
+ var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);
+
+ /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
+
+ return outer;
+ },
+ 'bpmn:CallActivity': function(p, element) {
+ return renderer('bpmn:Task')(p, element, {
+ strokeWidth: 5
+ });
+ },
+ 'bpmn:Participant': function(p, element) {
+
+ var lane = renderer('bpmn:Lane')(p, element, {
+ fill: 'White'
+ });
+
+ var expandedPool = DiUtil.isExpanded(element);
+
+ if (expandedPool) {
+ drawLine(p, [
+ { x: 30, y: 0 },
+ { x: 30, y: element.height }
+ ]);
+ var text = getSemantic(element).name;
+ renderLaneLabel(p, text, element);
+ } else {
+ // Collapsed pool draw text inline
+ var text2 = getSemantic(element).name;
+ renderLabel(p, text2, { box: element, align: 'center-middle' });
+ }
+
+ var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
+
+ if(participantMultiplicity) {
+ renderer('ParticipantMultiplicityMarker')(p, element);
+ }
+
+ return lane;
+ },
+ 'bpmn:Lane': function(p, element, attrs) {
+ var rect = drawRect(p, element.width, element.height, 0, attrs || {
+ fill: 'none'
+ });
+
+ var semantic = getSemantic(element);
+
+ if (semantic.$type === 'bpmn:Lane') {
+ var text = semantic.name;
+ renderLaneLabel(p, text, element);
+ }
+
+ return rect;
+ },
+ 'bpmn:InclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* circle path */
+ drawCircle(p, element.width, element.height, element.height * 0.24, {
+ strokeWidth: 2.5,
+ fill: 'none'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ExclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
+ xScaleFactor: 0.4,
+ yScaleFactor: 0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.32,
+ my: 0.3
+ }
+ });
+
+ if (!!(getDi(element).isMarkerVisible)) {
+ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+
+ return diamond;
+ },
+ 'bpmn:ComplexGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
+ xScaleFactor: 0.5,
+ yScaleFactor:0.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.26
+ }
+ });
+
+ /* complex path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ParallelGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.6,
+ yScaleFactor:0.6,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.2
+ }
+ });
+
+ /* parallel path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:EventBasedGateway': function(p, element) {
+
+ var semantic = getSemantic(element);
+
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var type = semantic.eventGatewayType;
+ var instantiate = !!semantic.instantiate;
+
+ function drawEvent() {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
+ xScaleFactor: 0.18,
+ yScaleFactor: 0.18,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.36,
+ my: 0.44
+ }
+ });
+
+ /* event path */ drawPath(p, pathData, {
+ strokeWidth: 2,
+ fill: 'none'
+ });
+ }
+
+ if (type === 'Parallel') {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.4,
+ yScaleFactor:0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var parallelPath = drawPath(p, pathData);
+ parallelPath.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ } else if (type === 'Exclusive') {
+
+ if (!instantiate) {
+ var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
+ innerCircle.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ }
+
+ drawEvent();
+ }
+
+
+ return diamond;
+ },
+ 'bpmn:Gateway': function(p, element) {
+ return drawDiamond(p, element.width, element.height);
+ },
+ 'bpmn:SequenceFlow': function(p, element) {
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ strokeLinejoin: 'round',
+ markerEnd: marker('sequenceflow-end')
+ });
+
+ var sequenceFlow = getSemantic(element);
+ var source = element.source.businessObject;
+
+ // conditional flow marker
+ if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
+ path.attr({
+ markerStart: marker('conditional-flow-marker')
+ });
+ }
+
+ // default marker
+ if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
+ path.attr({
+ markerStart: marker('conditional-default-flow-marker')
+ });
+ }
+
+ return path;
+ },
+ 'bpmn:Association': function(p, element, attrs) {
+
+ attrs = assign({
+ strokeDasharray: '1,6',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round'
+ }, attrs || {});
+
+ // TODO(nre): style according to directed state
+ return drawLine(p, element.waypoints, attrs);
+ },
+ 'bpmn:DataInputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:DataOutputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:MessageFlow': function(p, element) {
+
+ var semantic = getSemantic(element),
+ di = getDi(element);
+
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ markerEnd: marker('messageflow-end'),
+ markerStart: marker('messageflow-start'),
+ strokeDasharray: '10, 12',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round',
+ strokeWidth: '1.5px'
+ });
+
+ if (semantic.messageRef) {
+ var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
+
+ var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
+ abspos: {
+ x: midPoint.x,
+ y: midPoint.y
+ }
+ });
+
+ var messageAttrs = { strokeWidth: 1 };
+
+ if (di.messageVisibleKind === 'initiating') {
+ messageAttrs.fill = 'white';
+ messageAttrs.stroke = 'black';
+ } else {
+ messageAttrs.fill = '#888';
+ messageAttrs.stroke = 'white';
+ }
+
+ drawPath(p, markerPathData, messageAttrs);
+ }
+
+ return path;
+ },
+ 'bpmn:DataObject': function(p, element) {
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var elementObject = drawPath(p, pathData, { fill: 'white' });
+
+ var semantic = getSemantic(element);
+
+ if (isCollection(semantic)) {
+ renderDataItemCollection(p, element);
+ }
+
+ return elementObject;
+ },
+ 'bpmn:DataObjectReference': as('bpmn:DataObject'),
+ 'bpmn:DataInput': function(p, element) {
+
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });
+
+ return elementObject;
+ },
+ 'bpmn:DataOutput': function(p, element) {
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* output arrow path */ drawPath(p, arrowPathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return elementObject;
+ },
+ 'bpmn:DataStoreReference': function(p, element) {
+ var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0,
+ my: 0.133
+ }
+ });
+
+ var elementStore = drawPath(p, DATA_STORE_PATH, {
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return elementStore;
+ },
+ 'bpmn:BoundaryEvent': function(p, element) {
+
+ var semantic = getSemantic(element),
+ cancel = semantic.cancelActivity;
+
+ var attrs = {
+ strokeLinecap: 'round',
+ strokeWidth: 1
+ };
+
+ if (!cancel) {
+ attrs.strokeDasharray = '6';
+ }
+
+ var outer = renderer('bpmn:Event')(p, element, attrs);
+ /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:Group': function(p, element) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
+ strokeWidth: 1,
+ strokeDasharray: '8,3,1,3',
+ fill: 'none',
+ pointerEvents: 'none'
+ });
+ },
+ 'label': function(p, element) {
+ return renderExternalLabel(p, element, '');
+ },
+ 'bpmn:TextAnnotation': function(p, element) {
+ var style = {
+ 'fill': 'none',
+ 'stroke': 'none'
+ };
+ var textElement = drawRect(p, element.width, element.height, 0, 0, style);
+ var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.0,
+ my: 0.0
+ }
+ });
+ drawPath(p, textPathData);
+
+ var text = getSemantic(element).text || '';
+ renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });
+
+ return textElement;
+ },
+ 'ParticipantMultiplicityMarker': function(p, element) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'SubProcessMarker': function(p, element) {
+ var markerRect = drawRect(p, 14, 14, 0, {
+ strokeWidth: 1
+ });
+
+ // Process marker is placed in the middle of the box
+ // therefore fixed values can be used here
+ markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
+
+ var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
+ xScaleFactor: 1.5,
+ yScaleFactor: 1.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: (element.width / 2 - 7.5) / element.width,
+ my: (element.height - 20) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'ParallelMarker': function(p, element, position) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.parallel) / element.width),
+ my: (element.height - 20) / element.height
+ }
+ });
+ drawPath(p, subProcessPath);
+ },
+ 'SequentialMarker': function(p, element, position) {
+ var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.seq) / element.width),
+ my: (element.height - 19) / element.height
+ }
+ });
+ drawPath(p, sequentialPath);
+ },
+ 'CompensationMarker': function(p, element, position) {
+ var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.compensation) / element.width),
+ my: (element.height - 13) / element.height
+ }
+ });
+ drawPath(p, compensationPath, { strokeWidth: 1 });
+ },
+ 'LoopMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.loop) / element.width),
+ my: (element.height - 7) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'none',
+ strokeLinecap: 'round',
+ strokeMiterlimit: 0.5
+ });
+ },
+ 'AdhocMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.adhoc) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+ };
+
+ function attachTaskMarkers(p, element, taskMarkers) {
+ var obj = getSemantic(element);
+
+ var subprocess = includes(taskMarkers, 'SubProcessMarker');
+ var position;
+
+ if (subprocess) {
+ position = {
+ seq: -21,
+ parallel: -22,
+ compensation: -42,
+ loop: -18,
+ adhoc: 10
+ };
+ } else {
+ position = {
+ seq: -3,
+ parallel: -6,
+ compensation: -27,
+ loop: 0,
+ adhoc: 10
+ };
+ }
+
+ forEach(taskMarkers, function(marker) {
+ renderer(marker)(p, element, position);
+ });
+
+ if (obj.$type === 'bpmn:AdHocSubProcess') {
+ renderer('AdhocMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
+ renderer('LoopMarker')(p, element, position);
+ return;
+ }
+ if (obj.loopCharacteristics &&
+ obj.loopCharacteristics.isSequential !== undefined &&
+ !obj.loopCharacteristics.isSequential) {
+ renderer('ParallelMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
+ renderer('SequentialMarker')(p, element, position);
+ }
+ if (!!obj.isForCompensation) {
+ renderer('CompensationMarker')(p, element, position);
+ }
+ }
+
+ function drawShape(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function drawConnection(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function renderDataItemCollection(p, element) {
+
+ var yPosition = (element.height - 16) / element.height;
+
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.451,
+ my: yPosition
+ }
+ });
+
+ /* collection path */ drawPath(p, pathData, {
+ strokeWidth: 2
+ });
+ }
+
+ function isCollection(element, filter) {
+ return element.isCollection ||
+ (element.elementObjectRef && element.elementObjectRef.isCollection);
+ }
+
+ function getDi(element) {
+ return element.businessObject.di;
+ }
+
+ function getSemantic(element) {
+ return element.businessObject;
+ }
+
+ /**
+ * Checks if eventDefinition of the given element matches with semantic type.
+ *
+ * @return {boolean} true if element is of the given semantic type
+ */
+ function isTypedEvent(event, eventDefinitionType, filter) {
+
+ function matches(definition, filter) {
+ return every(filter, function(val, key) {
+
+ // we want a == conversion here, to be able to catch
+ // undefined == false and friends
+ /* jshint -W116 */
+ return definition[key] == val;
+ });
+ }
+
+ return some(event.eventDefinitions, function(definition) {
+ return definition.$type === eventDefinitionType && matches(event, filter);
+ });
+ }
+
+ function isThrowEvent(event) {
+ return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
+ }
+
+
+ /////// cropping path customizations /////////////////////////
+
+ function componentsToPath(elements) {
+ return elements.join(',').replace(/,?([A-z]),?/g, '$1');
+ }
+
+ function getCirclePath(shape) {
+
+ var cx = shape.x + shape.width / 2,
+ cy = shape.y + shape.height / 2,
+ radius = shape.width / 2;
+
+ var circlePath = [
+ ['M', cx, cy],
+ ['m', 0, -radius],
+ ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
+ ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
+ ['z']
+ ];
+
+ return componentsToPath(circlePath);
+ }
+
+ function getRoundRectPath(shape) {
+
+ var radius = TASK_BORDER_RADIUS,
+ x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var roundRectPath = [
+ ['M', x + radius, y],
+ ['l', width - radius * 2, 0],
+ ['a', radius, radius, 0, 0, 1, radius, radius],
+ ['l', 0, height - radius * 2],
+ ['a', radius, radius, 0, 0, 1, -radius, radius],
+ ['l', radius * 2 - width, 0],
+ ['a', radius, radius, 0, 0, 1, -radius, -radius],
+ ['l', 0, radius * 2 - height],
+ ['a', radius, radius, 0, 0, 1, radius, -radius],
+ ['z']
+ ];
+
+ return componentsToPath(roundRectPath);
+ }
+
+ function getDiamondPath(shape) {
+
+ var width = shape.width,
+ height = shape.height,
+ x = shape.x,
+ y = shape.y,
+ halfWidth = width / 2,
+ halfHeight = height / 2;
+
+ var diamondPath = [
+ ['M', x + halfWidth, y],
+ ['l', halfWidth, halfHeight],
+ ['l', -halfWidth, halfHeight],
+ ['l', -halfWidth, -halfHeight],
+ ['z']
+ ];
+
+ return componentsToPath(diamondPath);
+ }
+
+ function getRectPath(shape) {
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var rectPath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(rectPath);
+ }
+
+ function getShapePath(element) {
+ var obj = getSemantic(element);
+
+ if (obj.$instanceOf('bpmn:Event')) {
+ return getCirclePath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Activity')) {
+ return getRoundRectPath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Gateway')) {
+ return getDiamondPath(element);
+ }
+
+ return getRectPath(element);
+ }
+
+
+ // hook onto canvas init event to initialize
+ // connection start/end markers on svg
+ events.on('canvas.init', function(event) {
+ initMarkers(event.svg);
+ });
+
+ this.drawShape = drawShape;
+ this.drawConnection = drawConnection;
+
+ this.getShapePath = getShapePath;
+}
+
+inherits(BpmnRenderer, DefaultRenderer);
+
+
+BpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];
+
+module.exports = BpmnRenderer;
+
+},{"12":12,"166":166,"170":170,"175":175,"44":44,"71":71,"79":79,"81":81,"84":84,"86":86,"89":89}],5:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(74);
+
+/**
+ * Map containing SVG paths needed by BpmnRenderer.
+ */
+
+function PathMap() {
+
+ /**
+ * Contains a map of path elements
+ *
+ * <h1>Path definition</h1>
+ * A parameterized path is defined like this:
+ * <pre>
+ * 'GATEWAY_PARALLEL': {
+ * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ * height: 17.5,
+ * width: 17.5,
+ * heightElements: [2.5, 7.5],
+ * widthElements: [2.5, 7.5]
+ * }
+ * </pre>
+ * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
+ * is based on the ratio between the specified height and width in this object and the
+ * height and width that is set as scale target (Note x,y coordinates will be scaled with
+ * individual ratios).</p>
+ * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
+ * The scaling is based on the computed ratios.
+ * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
+ * the computed ratio coefficient.
+ * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
+ * <ul>
+ * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
+ * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
+ * </ul>
+ * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
+ * </p>
+ */
+ this.pathMap = {
+ 'EVENT_MESSAGE': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 36,
+ width: 36,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'EVENT_SIGNAL': {
+ d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
+ height: 36,
+ width: 36,
+ heightElements: [18],
+ widthElements: [10, 20]
+ },
+ 'EVENT_ESCALATION': {
+ d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +
+ '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',
+ height: 36,
+ width: 36,
+ heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
+ widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
+ },
+ 'EVENT_CONDITIONAL': {
+ d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
+ 'M {e.x2},{e.y3} l {e.x0},0 ' +
+ 'M {e.x2},{e.y4} l {e.x0},0 ' +
+ 'M {e.x2},{e.y5} l {e.x0},0 ' +
+ 'M {e.x2},{e.y6} l {e.x0},0 ' +
+ 'M {e.x2},{e.y7} l {e.x0},0 ' +
+ 'M {e.x2},{e.y8} l {e.x0},0 ',
+ height: 36,
+ width: 36,
+ heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
+ widthElements: [10.5, 14.5, 12.5]
+ },
+ 'EVENT_LINK': {
+ d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
+ height: 36,
+ width: 36,
+ heightElements: [4.4375, 6.75, 7.8125],
+ widthElements: [9.84375, 13.5]
+ },
+ 'EVENT_ERROR': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
+ height: 36,
+ width: 36,
+ heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
+ widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
+ },
+ 'EVENT_CANCEL_45': {
+ d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [4.75, 8.5],
+ widthElements: [4.75, 8.5]
+ },
+ 'EVENT_COMPENSATION': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
+ height: 36,
+ width: 36,
+ heightElements: [5, 10],
+ widthElements: [10]
+ },
+ 'EVENT_TIMER_WH': {
+ d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 2],
+ widthElements: [3, 7]
+ },
+ 'EVENT_TIMER_LINE': {
+ d: 'M {mx},{my} ' +
+ 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 3],
+ widthElements: [0, 0]
+ },
+ 'EVENT_MULTIPLE': {
+ d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [6.28099, 12.56199],
+ widthElements: [3.1405, 9.42149, 12.56198]
+ },
+ 'EVENT_PARALLEL_MULTIPLE': {
+ d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [2.56228, 7.68683],
+ widthElements: [2.56228, 7.68683]
+ },
+ 'GATEWAY_EXCLUSIVE': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
+ '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
+ '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
+ height: 17.5,
+ width: 17.5,
+ heightElements: [8.5, 6.5312, -6.5312, -8.5],
+ widthElements: [6.5, -6.5, 3, -3, 5, -5]
+ },
+ 'GATEWAY_PARALLEL': {
+ d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 30,
+ width: 30,
+ heightElements: [5, 12.5],
+ widthElements: [5, 12.5]
+ },
+ 'GATEWAY_EVENT_BASED': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
+ height: 11,
+ width: 11,
+ heightElements: [-6, 6, 12, -12],
+ widthElements: [9, -3, -12]
+ },
+ 'GATEWAY_COMPLEX': {
+ d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
+ '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
+ '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
+ '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
+ height: 17.125,
+ width: 17.125,
+ heightElements: [4.875, 3.4375, 2.125, 3],
+ widthElements: [3.4375, 2.125, 4.875, 3]
+ },
+ 'DATA_OBJECT_PATH': {
+ d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
+ height: 61,
+ width: 51,
+ heightElements: [10, 50, 60],
+ widthElements: [10, 40, 50, 60]
+ },
+ 'DATA_OBJECT_COLLECTION_PATH': {
+ d:'m {mx}, {my} ' +
+ 'm 0 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ',
+ height: 61,
+ width: 51,
+ heightElements: [12],
+ widthElements: [1, 6, 12, 15]
+ },
+ 'DATA_ARROW': {
+ d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
+ height: 61,
+ width: 51,
+ heightElements: [],
+ widthElements: []
+ },
+ 'DATA_STORE': {
+ d:'m {mx},{my} ' +
+ 'l 0,{e.y2} ' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'l 0,-{e.y2} ' +
+ 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
+ height: 61,
+ width: 61,
+ heightElements: [7, 10, 45],
+ widthElements: [2, 58, 60]
+ },
+ 'TEXT_ANNOTATION': {
+ d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
+ height: 30,
+ width: 10,
+ heightElements: [30],
+ widthElements: [10]
+ },
+ 'MARKER_SUB_PROCESS': {
+ d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_PARALLEL': {
+ d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_SEQUENTIAL': {
+ d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_COMPENSATION': {
+ d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
+ height: 10,
+ width: 21,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_LOOP': {
+ d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
+ '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
+ '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
+ 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
+ height: 13.9,
+ width: 13.7,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_ADHOC': {
+ d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
+ '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
+ '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
+ '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
+ '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
+ height: 4,
+ width: 15,
+ heightElements: [],
+ widthElements: []
+ },
+ 'TASK_TYPE_SEND': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 14,
+ width: 21,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_SCRIPT': {
+ d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
+ 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
+ 'm -7,-12 l 5,0 ' +
+ 'm -4.5,3 l 4.5,0 ' +
+ 'm -3,3 l 5,0' +
+ 'm -4,3 l 5,0',
+ height: 15,
+ width: 12.6,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_USER_1': {
+ d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
+ '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
+ '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
+ 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
+ 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
+ },
+ 'TASK_TYPE_USER_2': {
+ d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
+ '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
+ },
+ 'TASK_TYPE_USER_3': {
+ d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
+ '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
+ '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
+ },
+ 'TASK_TYPE_MANUAL': {
+ d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
+ '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
+ '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
+ '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
+ '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
+ '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
+ '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
+ '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
+ '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
+ '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
+ '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
+ '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
+ },
+ 'TASK_TYPE_INSTANTIATING_SEND': {
+ d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
+ },
+ 'TASK_TYPE_SERVICE': {
+ d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
+ '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
+ '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
+ 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
+ '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
+ '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
+ 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
+ '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
+ 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
+ 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
+ '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
+ 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
+ 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_SERVICE_FILL': {
+ d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_HEADER': {
+ d: 'm {mx},{my} 0,4 20,0 0,-4 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_MAIN': {
+ d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
+ 'm 0,8 l 20,0 ' +
+ 'm -13,-4 l 0,8'
+ },
+ 'MESSAGE_FLOW_MARKER': {
+ d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
+ }
+ };
+
+ this.getRawPath = function getRawPath(pathId) {
+ return this.pathMap[pathId].d;
+ };
+
+ /**
+ * Scales the path to the given height and width.
+ * <h1>Use case</h1>
+ * <p>Use case is to scale the content of elements (event, gateways) based
+ * on the element bounding box's size.
+ * </p>
+ * <h1>Why not transform</h1>
+ * <p>Scaling a path with transform() will also scale the stroke and IE does not support
+ * the option 'non-scaling-stroke' to prevent this.
+ * Also there are use cases where only some parts of a path should be
+ * scaled.</p>
+ *
+ * @param {String} pathId The ID of the path.
+ * @param {Object} param <p>
+ * Example param object scales the path to 60% size of the container (data.width, data.height).
+ * <pre>
+ * {
+ * xScaleFactor: 0.6,
+ * yScaleFactor:0.6,
+ * containerWidth: data.width,
+ * containerHeight: data.height,
+ * position: {
+ * mx: 0.46,
+ * my: 0.2,
+ * }
+ * }
+ * </pre>
+ * <ul>
+ * <li>targetpathwidth = xScaleFactor * containerWidth</li>
+ * <li>targetpathheight = yScaleFactor * containerHeight</li>
+ * <li>Position is used to set the starting coordinate of the path. M is computed:
+ * <ul>
+ * <li>position.x * containerWidth</li>
+ * <li>position.y * containerHeight</li>
+ * </ul>
+ * Center of the container <pre> position: {
+ * mx: 0.5,
+ * my: 0.5,
+ * }</pre>
+ * Upper left corner of the container
+ * <pre> position: {
+ * mx: 0.0,
+ * my: 0.0,
+ * }</pre>
+ * </li>
+ * </ul>
+ * </p>
+ *
+ */
+ this.getScaledPath = function getScaledPath(pathId, param) {
+ var rawPath = this.pathMap[pathId];
+
+ // positioning
+ // compute the start point of the path
+ var mx, my;
+
+ if(!!param.abspos) {
+ mx = param.abspos.x;
+ my = param.abspos.y;
+ } else {
+ mx = param.containerWidth * param.position.mx;
+ my = param.containerHeight * param.position.my;
+ }
+
+ var coordinates = {}; //map for the scaled coordinates
+ if(param.position) {
+
+ // path
+ var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
+ var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
+
+
+ //Apply height ratio
+ for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
+ coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
+ }
+
+ //Apply width ratio
+ for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
+ coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
+ }
+ }
+
+ //Apply value to raw path
+ var path = Snap.format(
+ rawPath.d, {
+ mx: mx,
+ my: my,
+ e: coordinates
+ }
+ );
+ return path;
+ };
+}
+
+module.exports = PathMap;
+
+},{"74":74}],6:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(4) ],
+ pathMap: [ 'type', _dereq_(5) ]
+};
+},{"4":4,"5":5}],7:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175),
+ map = _dereq_(87);
+
+var LabelUtil = _dereq_(13);
+
+var hasExternalLabel = LabelUtil.hasExternalLabel,
+ getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
+ isExpanded = _dereq_(12).isExpanded,
+ elementToString = _dereq_(10).elementToString;
+
+
+function elementData(semantic, attrs) {
+ return assign({
+ id: semantic.id,
+ type: semantic.$type,
+ businessObject: semantic
+ }, attrs);
+}
+
+function collectWaypoints(waypoints) {
+ return map(waypoints, function(p) {
+ return { x: p.x, y: p.y };
+ });
+}
+
+
+/**
+ * An importer that adds bpmn elements to the canvas
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementFactory} elementFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+
+ this._elementFactory = elementFactory;
+ this._elementRegistry = elementRegistry;
+}
+
+BpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];
+
+module.exports = BpmnImporter;
+
+
+/**
+ * Add bpmn element (semantic) to the canvas onto the
+ * specified parent shape.
+ */
+BpmnImporter.prototype.add = function(semantic, parentElement) {
+
+ var di = semantic.di,
+ element;
+
+ // ROOT ELEMENT
+ // handle the special case that we deal with a
+ // invisible root element (process or collaboration)
+ if (di.$instanceOf('bpmndi:BPMNPlane')) {
+
+ // add a virtual element (not being drawn)
+ element = this._elementFactory.createRoot(elementData(semantic));
+
+ this._canvas.setRootElement(element);
+ }
+
+ // SHAPE
+ else if (di.$instanceOf('bpmndi:BPMNShape')) {
+
+ var collapsed = !isExpanded(semantic);
+ var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
+
+ var bounds = semantic.di.bounds;
+
+ element = this._elementFactory.createShape(elementData(semantic, {
+ collapsed: collapsed,
+ hidden: hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ this._canvas.addShape(element, parentElement);
+ }
+
+ // CONNECTION
+ else if (di.$instanceOf('bpmndi:BPMNEdge')) {
+
+ var source = this._getSource(semantic),
+ target = this._getTarget(semantic);
+
+ element = this._elementFactory.createConnection(elementData(semantic, {
+ source: source,
+ target: target,
+ waypoints: collectWaypoints(semantic.di.waypoint)
+ }));
+
+ this._canvas.addConnection(element, parentElement);
+ } else {
+ throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
+ }
+
+ // (optional) LABEL
+ if (hasExternalLabel(semantic)) {
+ this.addLabel(semantic, element);
+ }
+
+
+ this._eventBus.fire('bpmnElement.added', { element: element });
+
+ return element;
+};
+
+
+/**
+ * add label for an element
+ */
+BpmnImporter.prototype.addLabel = function(semantic, element) {
+ var bounds = getExternalLabelBounds(semantic, element);
+
+ var label = this._elementFactory.createLabel(elementData(semantic, {
+ id: semantic.id + '_label',
+ labelTarget: element,
+ type: 'label',
+ hidden: element.hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ return this._canvas.addShape(label, element.parent);
+};
+
+/**
+ * Return the drawn connection end based on the given side.
+ *
+ * @throws {Error} if the end is not yet drawn
+ */
+BpmnImporter.prototype._getEnd = function(semantic, side) {
+
+ var element,
+ refSemantic,
+ type = semantic.$type;
+
+ refSemantic = semantic[side + 'Ref'];
+
+ // handle mysterious isMany DataAssociation#sourceRef
+ if (side === 'source' && type === 'bpmn:DataInputAssociation') {
+ refSemantic = refSemantic && refSemantic[0];
+ }
+
+ // fix source / target for DataInputAssociation / DataOutputAssociation
+ if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
+ side === 'target' && type === 'bpmn:DataInputAssociation') {
+
+ refSemantic = semantic.$parent;
+ }
+
+ element = refSemantic && this._getElement(refSemantic);
+
+ if (element) {
+ return element;
+ }
+
+ if (refSemantic) {
+ throw new Error(
+ 'element ' + elementToString(refSemantic) + ' referenced by ' +
+ elementToString(semantic) + '#' + side + 'Ref not yet drawn');
+ } else {
+ throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
+ }
+};
+
+BpmnImporter.prototype._getSource = function(semantic) {
+ return this._getEnd(semantic, 'source');
+};
+
+BpmnImporter.prototype._getTarget = function(semantic) {
+ return this._getEnd(semantic, 'target');
+};
+
+
+BpmnImporter.prototype._getElement = function(semantic) {
+ return this._elementRegistry.get(semantic.id);
+};
+
+},{"10":10,"12":12,"13":13,"175":175,"87":87}],8:[function(_dereq_,module,exports){
+'use strict';
+
+var filter = _dereq_(82),
+ find = _dereq_(83),
+ forEach = _dereq_(84);
+
+var Refs = _dereq_(202);
+
+var elementToString = _dereq_(10).elementToString;
+
+var diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });
+
+/**
+ * Returns true if an element has the given meta-model type
+ *
+ * @param {ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ return element.$instanceOf(type);
+}
+
+
+/**
+ * Find a suitable display candidate for definitions where the DI does not
+ * correctly specify one.
+ */
+function findDisplayCandidate(definitions) {
+ return find(definitions.rootElements, function(e) {
+ return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
+ });
+}
+
+
+function BpmnTreeWalker(handler) {
+
+ // list of containers already walked
+ var handledProcesses = [];
+
+ // list of elements to handle deferred to ensure
+ // prerequisites are drawn
+ var deferred = [];
+
+ ///// Helpers /////////////////////////////////
+
+ function contextual(fn, ctx) {
+ return function(e) {
+ fn(e, ctx);
+ };
+ }
+
+ function visit(element, ctx) {
+
+ var gfx = element.gfx;
+
+ // avoid multiple rendering of elements
+ if (gfx) {
+ throw new Error('already rendered ' + elementToString(element));
+ }
+
+ // call handler
+ return handler.element(element, ctx);
+ }
+
+ function visitRoot(element, diagram) {
+ return handler.root(element, diagram);
+ }
+
+ function visitIfDi(element, ctx) {
+ try {
+ return element.di && visit(element, ctx);
+ } catch (e) {
+ logError(e.message, { element: element, error: e });
+
+ console.error('failed to import ' + elementToString(element));
+ console.error(e);
+ }
+ }
+
+ function logError(message, context) {
+ handler.error(message, context);
+ }
+
+ ////// DI handling ////////////////////////////
+
+ function registerDi(di) {
+ var bpmnElement = di.bpmnElement;
+
+ if (bpmnElement) {
+ if (bpmnElement.di) {
+ logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });
+ } else {
+ diRefs.bind(bpmnElement, 'di');
+ bpmnElement.di = di;
+ }
+ } else {
+ logError('no bpmnElement referenced in ' + elementToString(di), { element: di });
+ }
+ }
+
+ function handleDiagram(diagram) {
+ handlePlane(diagram.plane);
+ }
+
+ function handlePlane(plane) {
+ registerDi(plane);
+
+ forEach(plane.planeElement, handlePlaneElement);
+ }
+
+ function handlePlaneElement(planeElement) {
+ registerDi(planeElement);
+ }
+
+
+ ////// Semantic handling //////////////////////
+
+ function handleDefinitions(definitions, diagram) {
+ // make sure we walk the correct bpmnElement
+
+ var diagrams = definitions.diagrams;
+
+ if (diagram && diagrams.indexOf(diagram) === -1) {
+ throw new Error('diagram not part of bpmn:Definitions');
+ }
+
+ if (!diagram && diagrams && diagrams.length) {
+ diagram = diagrams[0];
+ }
+
+ // no diagram -> nothing to import
+ if (!diagram) {
+ return;
+ }
+
+ // load DI from selected diagram only
+ handleDiagram(diagram);
+
+
+ var plane = diagram.plane;
+
+ if (!plane) {
+ throw new Error('no plane for ' + elementToString(diagram));
+ }
+
+
+ var rootElement = plane.bpmnElement;
+
+ // ensure we default to a suitable display candidate (process or collaboration),
+ // even if non is specified in DI
+ if (!rootElement) {
+ rootElement = findDisplayCandidate(definitions);
+
+ if (!rootElement) {
+ return logError('no process or collaboration present to display');
+ } else {
+
+ logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
+
+ // correct DI on the fly
+ plane.bpmnElement = rootElement;
+ registerDi(plane);
+ }
+ }
+
+
+ var ctx = visitRoot(rootElement, plane);
+
+ if (is(rootElement, 'bpmn:Process')) {
+ handleProcess(rootElement, ctx);
+ } else if (is(rootElement, 'bpmn:Collaboration')) {
+ handleCollaboration(rootElement, ctx);
+
+ // force drawing of everything not yet drawn that is part of the target DI
+ handleUnhandledProcesses(definitions.rootElements, ctx);
+ } else {
+ throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
+ }
+
+ // handle all deferred elements
+ handleDeferred(deferred);
+ }
+
+ function handleDeferred(deferred) {
+ forEach(deferred, function(d) { d(); });
+ }
+
+ function handleProcess(process, context) {
+ handleFlowElementsContainer(process, context);
+ handleIoSpecification(process.ioSpecification, context);
+
+ handleArtifacts(process.artifacts, context);
+
+ // log process handled
+ handledProcesses.push(process);
+ }
+
+ function handleUnhandledProcesses(rootElements) {
+
+ // walk through all processes that have not yet been drawn and draw them
+ // if they contain lanes with DI information.
+ // we do this to pass the free-floating lane test cases in the MIWG test suite
+ var processes = filter(rootElements, function(e) {
+ return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
+ });
+
+ processes.forEach(contextual(handleProcess));
+ }
+
+ function handleMessageFlow(messageFlow, context) {
+ visitIfDi(messageFlow, context);
+ }
+
+ function handleMessageFlows(messageFlows, context) {
+ forEach(messageFlows, contextual(handleMessageFlow, context));
+ }
+
+ function handleDataAssociation(association, context) {
+ visitIfDi(association, context);
+ }
+
+ function handleDataInput(dataInput, context) {
+ visitIfDi(dataInput, context);
+ }
+
+ function handleDataOutput(dataOutput, context) {
+ visitIfDi(dataOutput, context);
+ }
+
+ function handleArtifact(artifact, context) {
+
+ // bpmn:TextAnnotation
+ // bpmn:Group
+ // bpmn:Association
+
+ visitIfDi(artifact, context);
+ }
+
+ function handleArtifacts(artifacts, context) {
+
+ forEach(artifacts, function(e) {
+ if (is(e, 'bpmn:Association')) {
+ deferred.push(function() {
+ handleArtifact(e, context);
+ });
+ } else {
+ handleArtifact(e, context);
+ }
+ });
+ }
+
+ function handleIoSpecification(ioSpecification, context) {
+
+ if (!ioSpecification) {
+ return;
+ }
+
+ forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
+ forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
+ }
+
+ function handleSubProcess(subProcess, context) {
+ handleFlowElementsContainer(subProcess, context);
+ handleArtifacts(subProcess.artifacts, context);
+ }
+
+ function handleFlowNode(flowNode, context) {
+ var childCtx = visitIfDi(flowNode, context);
+
+ if (is(flowNode, 'bpmn:SubProcess')) {
+ handleSubProcess(flowNode, childCtx || context);
+ }
+ }
+
+ function handleSequenceFlow(sequenceFlow, context) {
+ visitIfDi(sequenceFlow, context);
+ }
+
+ function handleDataElement(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleBoundaryEvent(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleLane(lane, context) {
+ var newContext = visitIfDi(lane, context);
+
+ if (lane.childLaneSet) {
+ handleLaneSet(lane.childLaneSet, newContext || context);
+ } else {
+ var filterList = filter(lane.flowNodeRef, function(e) {
+ return e.$type !== 'bpmn:BoundaryEvent';
+ });
+ handleFlowElements(filterList, newContext || context);
+ }
+ }
+
+ function handleLaneSet(laneSet, context) {
+ forEach(laneSet.lanes, contextual(handleLane, context));
+ }
+
+ function handleLaneSets(laneSets, context) {
+ forEach(laneSets, contextual(handleLaneSet, context));
+ }
+
+ function handleFlowElementsContainer(container, context) {
+
+ if (container.laneSets) {
+ handleLaneSets(container.laneSets, context);
+ handleNonFlowNodes(container.flowElements);
+ } else {
+ handleFlowElements(container.flowElements, context);
+ }
+ }
+
+ function handleNonFlowNodes(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ }
+ });
+ }
+
+ function handleFlowElements(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:FlowNode')) {
+ handleFlowNode(e, context);
+
+ if (is(e, 'bpmn:Activity')) {
+
+ handleIoSpecification(e.ioSpecification, context);
+
+ // defer handling of associations
+ deferred.push(function() {
+ forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
+ forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
+ });
+ }
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ } else {
+ logError(
+ 'unrecognized flowElement ' + elementToString(e) + ' in context ' +
+ (context ? elementToString(context.businessObject) : null),
+ { element: e, context: context });
+ }
+ });
+ }
+
+ function handleParticipant(participant, context) {
+ var newCtx = visitIfDi(participant, context);
+
+ var process = participant.processRef;
+ if (process) {
+ handleProcess(process, newCtx || context);
+ }
+ }
+
+ function handleCollaboration(collaboration) {
+
+ forEach(collaboration.participants, contextual(handleParticipant));
+
+ handleArtifacts(collaboration.artifacts);
+
+ // handle message flows latest in the process
+ deferred.push(function() {
+ handleMessageFlows(collaboration.messageFlows);
+ });
+ }
+
+
+ ///// API ////////////////////////////////
+
+ return {
+ handleDefinitions: handleDefinitions
+ };
+}
+
+module.exports = BpmnTreeWalker;
+},{"10":10,"202":202,"82":82,"83":83,"84":84}],9:[function(_dereq_,module,exports){
+'use strict';
+
+var BpmnTreeWalker = _dereq_(8);
+
+
+/**
+ * Import the definitions into a diagram.
+ *
+ * Errors and warnings are reported through the specified callback.
+ *
+ * @param {Diagram} diagram
+ * @param {ModdleElement} definitions
+ * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done
+ */
+function importBpmnDiagram(diagram, definitions, done) {
+
+ var importer = diagram.get('bpmnImporter'),
+ eventBus = diagram.get('eventBus');
+
+ var error,
+ warnings = [];
+
+ function parse(definitions) {
+
+ var visitor = {
+
+ root: function(element) {
+ return importer.add(element);
+ },
+
+ element: function(element, parentShape) {
+ return importer.add(element, parentShape);
+ },
+
+ error: function(message, context) {
+ warnings.push({ message: message, context: context });
+ }
+ };
+
+ var walker = new BpmnTreeWalker(visitor);
+
+ // import
+ walker.handleDefinitions(definitions);
+ }
+
+ eventBus.fire('import.start');
+
+ try {
+ parse(definitions);
+ } catch (e) {
+ error = e;
+ }
+
+ eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });
+ done(error, warnings);
+}
+
+module.exports.importBpmnDiagram = importBpmnDiagram;
+},{"8":8}],10:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.elementToString = function(e) {
+ if (!e) {
+ return '<null>';
+ }
+
+ return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
+};
+},{}],11:[function(_dereq_,module,exports){
+module.exports = {
+ bpmnImporter: [ 'type', _dereq_(7) ]
+};
+},{"7":7}],12:[function(_dereq_,module,exports){
+'use strict';
+
+var is = _dereq_(14).is,
+ getBusinessObject = _dereq_(14).getBusinessObject;
+
+module.exports.isExpanded = function(element) {
+
+ if (is(element, 'bpmn:CallActivity')) {
+ return false;
+ }
+
+ if (is(element, 'bpmn:SubProcess')) {
+ return getBusinessObject(element).di.isExpanded;
+ }
+
+ if (is(element, 'bpmn:Participant')) {
+ return !!getBusinessObject(element).processRef;
+ }
+
+ return true;
+};
+
+},{"14":14}],13:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175);
+
+
+var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
+ width: 90,
+ height: 20
+};
+
+
+/**
+ * Returns true if the given semantic has an external label
+ *
+ * @param {BpmnElement} semantic
+ * @return {Boolean} true if has label
+ */
+module.exports.hasExternalLabel = function(semantic) {
+
+ return semantic.$instanceOf('bpmn:Event') ||
+ semantic.$instanceOf('bpmn:Gateway') ||
+ semantic.$instanceOf('bpmn:DataStoreReference') ||
+ semantic.$instanceOf('bpmn:DataObjectReference') ||
+ semantic.$instanceOf('bpmn:SequenceFlow') ||
+ semantic.$instanceOf('bpmn:MessageFlow');
+};
+
+
+/**
+ * Get the middle of a number of waypoints
+ *
+ * @param {Array<Point>} waypoints
+ * @return {Point} the mid point
+ */
+var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
+
+ var mid = waypoints.length / 2 - 1;
+
+ var first = waypoints[Math.floor(mid)];
+ var second = waypoints[Math.ceil(mid + 0.01)];
+
+ return {
+ x: first.x + (second.x - first.x) / 2,
+ y: first.y + (second.y - first.y) / 2
+ };
+};
+
+
+var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
+
+ if (element.waypoints) {
+ return getWaypointsMid(element.waypoints);
+ } else {
+ return {
+ x: element.x + element.width / 2,
+ y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
+ };
+ }
+};
+
+/**
+ * Returns the bounds of an elements label, parsed from the elements DI or
+ * generated from its bounds.
+ *
+ * @param {BpmnElement} semantic
+ * @param {djs.model.Base} element
+ */
+module.exports.getExternalLabelBounds = function(semantic, element) {
+
+ var mid,
+ size,
+ bounds,
+ di = semantic.di,
+ label = di.label;
+
+ if (label && label.bounds) {
+ bounds = label.bounds;
+
+ size = {
+ width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
+ height: bounds.height
+ };
+
+ mid = {
+ x: bounds.x + bounds.width / 2,
+ y: bounds.y + bounds.height / 2
+ };
+ } else {
+
+ mid = getExternalLabelMid(element);
+
+ size = DEFAULT_LABEL_SIZE;
+ }
+
+ return assign({
+ x: mid.x - size.width / 2,
+ y: mid.y - size.height / 2
+ }, size);
+};
+},{"175":175}],14:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Is an element of the given BPMN type?
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ var bo = getBusinessObject(element);
+
+ return bo && bo.$instanceOf(type);
+}
+
+module.exports.is = is;
+
+
+/**
+ * Return the business object for a given element.
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ *
+ * @return {ModdleElement}
+ */
+function getBusinessObject(element) {
+ return (element && element.businessObject) || element;
+}
+
+module.exports.getBusinessObject = getBusinessObject;
+
+},{}],15:[function(_dereq_,module,exports){
+module.exports = _dereq_(17);
+},{"17":17}],16:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(172),
+ isFunction = _dereq_(167),
+ assign = _dereq_(175);
+
+var Moddle = _dereq_(23),
+ XmlReader = _dereq_(19),
+ XmlWriter = _dereq_(20);
+
+/**
+ * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.
+ *
+ * @class BpmnModdle
+ * @extends Moddle
+ *
+ * @param {Object|Array} packages to use for instantiating the model
+ * @param {Object} [options] additional options to pass over
+ */
+function BpmnModdle(packages, options) {
+ Moddle.call(this, packages, options);
+}
+
+BpmnModdle.prototype = Object.create(Moddle.prototype);
+
+module.exports = BpmnModdle;
+
+
+/**
+ * Instantiates a BPMN model tree from a given xml string.
+ *
+ * @param {String} xmlStr
+ * @param {String} [typeName='bpmn:Definitions'] name of the root element
+ * @param {Object} [options] options to pass to the underlying reader
+ * @param {Function} done callback that is invoked with (err, result, parseContext)
+ * once the import completes
+ */
+BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
+
+ if (!isString(typeName)) {
+ done = options;
+ options = typeName;
+ typeName = 'bpmn:Definitions';
+ }
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var reader = new XmlReader(assign({ model: this, lax: true }, options));
+ var rootHandler = reader.handler(typeName);
+
+ reader.fromXML(xmlStr, rootHandler, done);
+};
+
+
+/**
+ * Serializes a BPMN 2.0 object tree to XML.
+ *
+ * @param {String} element the root element, typically an instance of `bpmn:Definitions`
+ * @param {Object} [options] to pass to the underlying writer
+ * @param {Function} done callback invoked with (err, xmlStr) once the import completes
+ */
+BpmnModdle.prototype.toXML = function(element, options, done) {
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var writer = new XmlWriter(options);
+ try {
+ var result = writer.toXML(element);
+ done(null, result);
+ } catch (e) {
+ done(e);
+ }
+};
+
+},{"167":167,"172":172,"175":175,"19":19,"20":20,"23":23}],17:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175);
+
+var BpmnModdle = _dereq_(16);
+
+var packages = {
+ bpmn: _dereq_(32),
+ bpmndi: _dereq_(33),
+ dc: _dereq_(34),
+ di: _dereq_(35)
+};
+
+module.exports = function(additionalPackages, options) {
+ return new BpmnModdle(assign({}, packages, additionalPackages), options);
+};
+},{"16":16,"175":175,"32":32,"33":33,"34":34,"35":35}],18:[function(_dereq_,module,exports){
+'use strict';
+
+function capitalize(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+}
+
+function lower(string) {
+ return string.charAt(0).toLowerCase() + string.slice(1);
+}
+
+function hasLowerCaseAlias(pkg) {
+ return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
+}
+
+
+module.exports.aliasToName = function(alias, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return capitalize(alias);
+ } else {
+ return alias;
+ }
+};
+
+module.exports.nameToAlias = function(name, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return lower(name);
+ } else {
+ return name;
+ }
+};
+
+module.exports.DEFAULT_NS_MAP = {
+ 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
+};
+
+module.exports.XSI_TYPE = 'xsi:type';
+},{}],19:[function(_dereq_,module,exports){
+'use strict';
+
+var reduce = _dereq_(88),
+ forEach = _dereq_(84),
+ find = _dereq_(83),
+ assign = _dereq_(175),
+ defer = _dereq_(92);
+
+var Stack = _dereq_(22),
+ SaxParser = _dereq_(21).parser,
+ Moddle = _dereq_(23),
+ parseNameNs = _dereq_(28).parseName,
+ Types = _dereq_(31),
+ coerceType = Types.coerceType,
+ isSimpleType = Types.isSimple,
+ common = _dereq_(18),
+ XSI_TYPE = common.XSI_TYPE,
+ XSI_URI = common.DEFAULT_NS_MAP.xsi,
+ aliasToName = common.aliasToName;
+
+function parseNodeAttributes(node) {
+ var nodeAttrs = node.attributes;
+
+ return reduce(nodeAttrs, function(result, v, k) {
+ var name, ns;
+
+ if (!v.local) {
+ name = v.prefix;
+ } else {
+ ns = parseNameNs(v.name, v.prefix);
+ name = ns.name;
+ }
+
+ result[name] = v.value;
+ return result;
+ }, {});
+}
+
+function normalizeType(node, attr, model) {
+ var nameNs = parseNameNs(attr.value);
+
+ var uri = node.ns[nameNs.prefix || ''],
+ localName = nameNs.localName,
+ pkg = uri && model.getPackage(uri),
+ typePrefix;
+
+ if (pkg) {
+ typePrefix = pkg.xml && pkg.xml.typePrefix;
+
+ if (typePrefix && localName.indexOf(typePrefix) === 0) {
+ localName = localName.slice(typePrefix.length);
+ }
+
+ attr.value = pkg.prefix + ':' + localName;
+ }
+}
+
+/**
+ * Normalizes namespaces for a node given an optional default namespace and a
+ * number of mappings from uris to default prefixes.
+ *
+ * @param {XmlNode} node
+ * @param {Model} model the model containing all registered namespaces
+ * @param {Uri} defaultNsUri
+ */
+function normalizeNamespaces(node, model, defaultNsUri) {
+ var uri, prefix;
+
+ uri = node.uri || defaultNsUri;
+
+ if (uri) {
+ var pkg = model.getPackage(uri);
+
+ if (pkg) {
+ prefix = pkg.prefix;
+ } else {
+ prefix = node.prefix;
+ }
+
+ node.prefix = prefix;
+ node.uri = uri;
+ }
+
+ forEach(node.attributes, function(attr) {
+
+ // normalize xsi:type attributes because the
+ // assigned type may or may not be namespace prefixed
+ if (attr.uri === XSI_URI && attr.local === 'type') {
+ normalizeType(node, attr, model);
+ }
+
+ normalizeNamespaces(attr, model, null);
+ });
+}
+
+
+/**
+ * A parse context.
+ *
+ * @class
+ *
+ * @param {Object} options
+ * @param {ElementHandler} options.parseRoot the root handler for parsing a document
+ * @param {boolean} [options.lax=false] whether or not to ignore invalid elements
+ */
+function Context(options) {
+
+ /**
+ * @property {ElementHandler} parseRoot
+ */
+
+ /**
+ * @property {Boolean} lax
+ */
+
+ assign(this, options);
+
+ var elementsById = this.elementsById = {};
+ var references = this.references = [];
+ var warnings = this.warnings = [];
+
+ this.addReference = function(reference) {
+ references.push(reference);
+ };
+
+ this.addElement = function(id, element) {
+
+ if (!id || !element) {
+ throw new Error('[xml-reader] id or ctx must not be null');
+ }
+
+ elementsById[id] = element;
+ };
+
+ this.addWarning = function (w) {
+ warnings.push(w);
+ };
+}
+
+function BaseHandler() {}
+
+BaseHandler.prototype.handleEnd = function() {};
+BaseHandler.prototype.handleText = function() {};
+BaseHandler.prototype.handleNode = function() {};
+
+
+/**
+ * A simple pass through handler that does nothing except for
+ * ignoring all input it receives.
+ *
+ * This is used to ignore unknown elements and
+ * attributes.
+ */
+function NoopHandler() { }
+
+NoopHandler.prototype = new BaseHandler();
+
+NoopHandler.prototype.handleNode = function() {
+ return this;
+};
+
+function BodyHandler() {}
+
+BodyHandler.prototype = new BaseHandler();
+
+BodyHandler.prototype.handleText = function(text) {
+ this.body = (this.body || '') + text;
+};
+
+function ReferenceHandler(property, context) {
+ this.property = property;
+ this.context = context;
+}
+
+ReferenceHandler.prototype = new BodyHandler();
+
+ReferenceHandler.prototype.handleNode = function(node) {
+
+ if (this.element) {
+ throw new Error('expected no sub nodes');
+ } else {
+ this.element = this.createReference(node);
+ }
+
+ return this;
+};
+
+ReferenceHandler.prototype.handleEnd = function() {
+ this.element.id = this.body;
+};
+
+ReferenceHandler.prototype.createReference = function() {
+ return {
+ property: this.property.ns.name,
+ id: ''
+ };
+};
+
+function ValueHandler(propertyDesc, element) {
+ this.element = element;
+ this.propertyDesc = propertyDesc;
+}
+
+ValueHandler.prototype = new BodyHandler();
+
+ValueHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ propertyDesc = this.propertyDesc;
+
+ value = coerceType(propertyDesc.type, value);
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(value);
+ } else {
+ element.set(propertyDesc.name, value);
+ }
+};
+
+
+function BaseElementHandler() {}
+
+BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
+
+BaseElementHandler.prototype.handleNode = function(node) {
+ var parser = this,
+ element = this.element,
+ id;
+
+ if (!element) {
+ element = this.element = this.createElement(node);
+ id = element.id;
+
+ if (id) {
+ this.context.addElement(id, element);
+ }
+ } else {
+ parser = this.handleChild(node);
+ }
+
+ return parser;
+};
+
+/**
+ * @class XMLReader.ElementHandler
+ *
+ */
+function ElementHandler(model, type, context) {
+ this.model = model;
+ this.type = model.getType(type);
+ this.context = context;
+}
+
+ElementHandler.prototype = new BaseElementHandler();
+
+ElementHandler.prototype.addReference = function(reference) {
+ this.context.addReference(reference);
+};
+
+ElementHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ descriptor = element.$descriptor,
+ bodyProperty = descriptor.bodyProperty;
+
+ if (bodyProperty && value !== undefined) {
+ value = coerceType(bodyProperty.type, value);
+ element.set(bodyProperty.name, value);
+ }
+};
+
+/**
+ * Create an instance of the model from the given node.
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.createElement = function(node) {
+ var attributes = parseNodeAttributes(node),
+ Type = this.type,
+ descriptor = Type.$descriptor,
+ context = this.context,
+ instance = new Type({});
+
+ forEach(attributes, function(value, name) {
+
+ var prop = descriptor.propertiesByName[name];
+
+ if (prop && prop.isReference) {
+ context.addReference({
+ element: instance,
+ property: prop.ns.name,
+ id: value
+ });
+ } else {
+ if (prop) {
+ value = coerceType(prop.type, value);
+ }
+
+ instance.set(name, value);
+ }
+ });
+
+ return instance;
+};
+
+ElementHandler.prototype.getPropertyForNode = function(node) {
+
+ var nameNs = parseNameNs(node.local, node.prefix);
+
+ var type = this.type,
+ model = this.model,
+ descriptor = type.$descriptor;
+
+ var propertyName = nameNs.name,
+ property = descriptor.propertiesByName[propertyName],
+ elementTypeName,
+ elementType,
+ typeAnnotation;
+
+ // search for properties by name first
+
+ if (property) {
+
+ if (property.serialize === XSI_TYPE) {
+ typeAnnotation = node.attributes[XSI_TYPE];
+
+ // xsi type is optional, if it does not exists the
+ // default type is assumed
+ if (typeAnnotation) {
+
+ elementTypeName = typeAnnotation.value;
+
+ // TODO: extract real name from attribute
+ elementType = model.getType(elementTypeName);
+
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ }
+
+ // search for properties by name first
+ return property;
+ }
+
+
+ var pkg = model.getPackage(nameNs.prefix);
+
+ if (pkg) {
+ elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
+ elementType = model.getType(elementTypeName);
+
+ // search for collection members later
+ property = find(descriptor.properties, function(p) {
+ return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
+ });
+
+ if (property) {
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ } else {
+ // parse unknown element (maybe extension)
+ property = find(descriptor.properties, function(p) {
+ return !p.isReference && !p.isAttribute && p.type === 'Element';
+ });
+
+ if (property) {
+ return property;
+ }
+ }
+
+ throw new Error('unrecognized element <' + nameNs.name + '>');
+};
+
+ElementHandler.prototype.toString = function() {
+ return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
+};
+
+ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
+ return new ValueHandler(propertyDesc, element);
+};
+
+ElementHandler.prototype.referenceHandler = function(propertyDesc) {
+ return new ReferenceHandler(propertyDesc, this.context);
+};
+
+ElementHandler.prototype.handler = function(type) {
+ if (type === 'Element') {
+ return new GenericElementHandler(this.model, type, this.context);
+ } else {
+ return new ElementHandler(this.model, type, this.context);
+ }
+};
+
+/**
+ * Handle the child element parsing
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.handleChild = function(node) {
+ var propertyDesc, type, element, childHandler;
+
+ propertyDesc = this.getPropertyForNode(node);
+ element = this.element;
+
+ type = propertyDesc.effectiveType || propertyDesc.type;
+
+ if (isSimpleType(type)) {
+ return this.valueHandler(propertyDesc, element);
+ }
+
+ if (propertyDesc.isReference) {
+ childHandler = this.referenceHandler(propertyDesc).handleNode(node);
+ } else {
+ childHandler = this.handler(type).handleNode(node);
+ }
+
+ var newElement = childHandler.element;
+
+ // child handles may decide to skip elements
+ // by not returning anything
+ if (newElement !== undefined) {
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(newElement);
+ } else {
+ element.set(propertyDesc.name, newElement);
+ }
+
+ if (propertyDesc.isReference) {
+ assign(newElement, {
+ element: element
+ });
+
+ this.context.addReference(newElement);
+ } else {
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+ }
+
+ return childHandler;
+};
+
+
+function GenericElementHandler(model, type, context) {
+ this.model = model;
+ this.context = context;
+}
+
+GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
+
+GenericElementHandler.prototype.createElement = function(node) {
+
+ var name = node.name,
+ prefix = node.prefix,
+ uri = node.ns[prefix],
+ attributes = node.attributes;
+
+ return this.model.createAny(name, uri, attributes);
+};
+
+GenericElementHandler.prototype.handleChild = function(node) {
+
+ var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
+ element = this.element;
+
+ var newElement = handler.element,
+ children;
+
+ if (newElement !== undefined) {
+ children = element.$children = element.$children || [];
+ children.push(newElement);
+
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+
+ return handler;
+};
+
+GenericElementHandler.prototype.handleText = function(text) {
+ this.body = this.body || '' + text;
+};
+
+GenericElementHandler.prototype.handleEnd = function() {
+ if (this.body) {
+ this.element.$body = this.body;
+ }
+};
+
+/**
+ * A reader for a meta-model
+ *
+ * @param {Object} options
+ * @param {Model} options.model used to read xml files
+ * @param {Boolean} options.lax whether to make parse errors warnings
+ */
+function XMLReader(options) {
+
+ if (options instanceof Moddle) {
+ options = {
+ model: options
+ };
+ }
+
+ assign(this, { lax: false }, options);
+}
+
+
+XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
+
+ var model = this.model,
+ lax = this.lax,
+ context = new Context({
+ parseRoot: rootHandler
+ });
+
+ var parser = new SaxParser(true, { xmlns: true, trim: true }),
+ stack = new Stack();
+
+ rootHandler.context = context;
+
+ // push root handler
+ stack.push(rootHandler);
+
+
+ function resolveReferences() {
+
+ var elementsById = context.elementsById;
+ var references = context.references;
+
+ var i, r;
+
+ for (i = 0; !!(r = references[i]); i++) {
+ var element = r.element;
+ var reference = elementsById[r.id];
+ var property = element.$descriptor.propertiesByName[r.property];
+
+ if (!reference) {
+ context.addWarning({
+ message: 'unresolved reference <' + r.id + '>',
+ element: r.element,
+ property: r.property,
+ value: r.id
+ });
+ }
+
+ if (property.isMany) {
+ var collection = element.get(property.name),
+ idx = collection.indexOf(r);
+
+ if (!reference) {
+ // remove unresolvable reference
+ collection.splice(idx, 1);
+ } else {
+ // update reference
+ collection[idx] = reference;
+ }
+ } else {
+ element.set(property.name, reference);
+ }
+ }
+ }
+
+ function handleClose(tagName) {
+ stack.pop().handleEnd();
+ }
+
+ function handleOpen(node) {
+ var handler = stack.peek();
+
+ normalizeNamespaces(node, model);
+
+ try {
+ stack.push(handler.handleNode(node));
+ } catch (e) {
+
+ var line = this.line,
+ column = this.column;
+
+ var message =
+ 'unparsable content <' + node.name + '> detected\n\t' +
+ 'line: ' + line + '\n\t' +
+ 'column: ' + column + '\n\t' +
+ 'nested error: ' + e.message;
+
+ if (lax) {
+ context.addWarning({
+ message: message,
+ error: e
+ });
+
+ console.warn('could not parse node');
+ console.warn(e);
+
+ stack.push(new NoopHandler());
+ } else {
+ console.error('could not parse document');
+ console.error(e);
+
+ throw new Error(message);
+ }
+ }
+ }
+
+ function handleText(text) {
+ stack.peek().handleText(text);
+ }
+
+ parser.onopentag = handleOpen;
+ parser.oncdata = parser.ontext = handleText;
+ parser.onclosetag = handleClose;
+ parser.onend = resolveReferences;
+
+ // deferred parse XML to make loading really ascnchronous
+ // this ensures the execution environment (node or browser)
+ // is kept responsive and that certain optimization strategies
+ // can kick in
+ defer(function() {
+ var error;
+
+ try {
+ parser.write(xml).close();
+ } catch (e) {
+ error = e;
+ }
+
+ done(error, error ? undefined : rootHandler.element, context);
+ });
+};
+
+XMLReader.prototype.handler = function(name) {
+ return new ElementHandler(this.model, name);
+};
+
+module.exports = XMLReader;
+module.exports.ElementHandler = ElementHandler;
+},{"175":175,"18":18,"21":21,"22":22,"23":23,"28":28,"31":31,"83":83,"84":84,"88":88,"92":92}],20:[function(_dereq_,module,exports){
+'use strict';
+
+var map = _dereq_(87),
+ forEach = _dereq_(84),
+ isString = _dereq_(172),
+ filter = _dereq_(82),
+ assign = _dereq_(175);
+
+var Types = _dereq_(31),
+ parseNameNs = _dereq_(28).parseName,
+ common = _dereq_(18),
+ nameToAlias = common.nameToAlias;
+
+var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
+ ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
+ DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
+ XSI_TYPE = common.XSI_TYPE;
+
+
+function nsName(ns) {
+ if (isString(ns)) {
+ return ns;
+ } else {
+ return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
+ }
+}
+
+function getElementNs(ns, descriptor) {
+ if (descriptor.isGeneric) {
+ return descriptor.name;
+ } else {
+ return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
+ }
+}
+
+function getPropertyNs(ns, descriptor) {
+ return assign({ localName: descriptor.ns.localName }, ns);
+}
+
+function getSerializableProperties(element) {
+ var descriptor = element.$descriptor;
+
+ return filter(descriptor.properties, function(p) {
+ var name = p.name;
+
+ // do not serialize defaults
+ if (!element.hasOwnProperty(name)) {
+ return false;
+ }
+
+ var value = element[name];
+
+ // do not serialize default equals
+ if (value === p.default) {
+ return false;
+ }
+
+ return p.isMany ? value.length : true;
+ });
+}
+
+var ESCAPE_MAP = {
+ '\n': '10',
+ '\n\r': '10',
+ '"': '34',
+ '\'': '39',
+ '<': '60',
+ '>': '62',
+ '&': '38'
+};
+
+/**
+ * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
+ *
+ * @param {String} str the string to escape
+ * @return {String} the escaped string
+ */
+function escapeAttr(str) {
+
+ // ensure we are handling strings here
+ str = isString(str) ? str : '' + str;
+
+ return str.replace(ESCAPE_CHARS, function(str) {
+ return '&#' + ESCAPE_MAP[str] + ';';
+ });
+}
+
+function filterAttributes(props) {
+ return filter(props, function(p) { return p.isAttr; });
+}
+
+function filterContained(props) {
+ return filter(props, function(p) { return !p.isAttr; });
+}
+
+
+function ReferenceSerializer(parent, ns) {
+ this.ns = ns;
+}
+
+ReferenceSerializer.prototype.build = function(element) {
+ this.element = element;
+ return this;
+};
+
+ReferenceSerializer.prototype.serializeTo = function(writer) {
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function BodySerializer() {}
+
+BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
+ var escape = this.escape;
+
+ if (escape) {
+ writer.append('<![CDATA[');
+ }
+
+ writer.append(this.value);
+
+ if (escape) {
+ writer.append(']]>');
+ }
+};
+
+BodySerializer.prototype.build = function(prop, value) {
+ this.value = value;
+
+ if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
+ this.escape = true;
+ }
+
+ return this;
+};
+
+function ValueSerializer(ns) {
+ this.ns = ns;
+}
+
+ValueSerializer.prototype = new BodySerializer();
+
+ValueSerializer.prototype.serializeTo = function(writer) {
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>');
+
+ this.serializeValue(writer);
+
+ writer
+ .append( '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function ElementSerializer(parent, ns) {
+ this.body = [];
+ this.attrs = [];
+
+ this.parent = parent;
+ this.ns = ns;
+}
+
+ElementSerializer.prototype.build = function(element) {
+ this.element = element;
+
+ var otherAttrs = this.parseNsAttributes(element);
+
+ if (!this.ns) {
+ this.ns = this.nsTagName(element.$descriptor);
+ }
+
+ if (element.$descriptor.isGeneric) {
+ this.parseGeneric(element);
+ } else {
+ var properties = getSerializableProperties(element);
+
+ this.parseAttributes(filterAttributes(properties));
+ this.parseContainments(filterContained(properties));
+
+ this.parseGenericAttributes(element, otherAttrs);
+ }
+
+ return this;
+};
+
+ElementSerializer.prototype.nsTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getElementNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getPropertyNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.ns.uri;
+};
+
+ElementSerializer.prototype.nsAttributeName = function(element) {
+
+ var ns;
+
+ if (isString(element)) {
+ ns = parseNameNs(element);
+ } else
+ if (element.ns) {
+ ns = element.ns;
+ }
+
+ var effectiveNs = this.logNamespaceUsed(ns);
+
+ // strip prefix if same namespace like parent
+ if (this.isLocalNs(effectiveNs)) {
+ return { localName: ns.localName };
+ } else {
+ return assign({ localName: ns.localName }, effectiveNs);
+ }
+};
+
+ElementSerializer.prototype.parseGeneric = function(element) {
+
+ var self = this,
+ body = this.body,
+ attrs = this.attrs;
+
+ forEach(element, function(val, key) {
+
+ if (key === '$body') {
+ body.push(new BodySerializer().build({ type: 'String' }, val));
+ } else
+ if (key === '$children') {
+ forEach(val, function(child) {
+ body.push(new ElementSerializer(self).build(child));
+ });
+ } else
+ if (key.indexOf('$') !== 0) {
+ attrs.push({ name: key, value: escapeAttr(val) });
+ }
+ });
+};
+
+/**
+ * Parse namespaces and return a list of left over generic attributes
+ *
+ * @param {Object} element
+ * @return {Array<Object>}
+ */
+ElementSerializer.prototype.parseNsAttributes = function(element) {
+ var self = this;
+
+ var genericAttrs = element.$attrs;
+
+ var attributes = [];
+
+ // parse namespace attributes first
+ // and log them. push non namespace attributes to a list
+ // and process them later
+ forEach(genericAttrs, function(value, name) {
+ var nameNs = parseNameNs(name);
+
+ if (nameNs.prefix === 'xmlns') {
+ self.logNamespace({ prefix: nameNs.localName, uri: value });
+ } else
+ if (!nameNs.prefix && nameNs.localName === 'xmlns') {
+ self.logNamespace({ uri: value });
+ } else {
+ attributes.push({ name: name, value: value });
+ }
+ });
+
+ return attributes;
+};
+
+ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
+
+ var self = this;
+
+ forEach(attributes, function(attr) {
+
+ // do not serialize xsi:type attribute
+ // it is set manually based on the actual implementation type
+ if (attr.name === XSI_TYPE) {
+ return;
+ }
+
+ try {
+ self.addAttribute(self.nsAttributeName(attr.name), attr.value);
+ } catch (e) {
+ console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
+ }
+ });
+};
+
+ElementSerializer.prototype.parseContainments = function(properties) {
+
+ var self = this,
+ body = this.body,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ var value = element.get(p.name),
+ isReference = p.isReference,
+ isMany = p.isMany;
+
+ var ns = self.nsPropertyTagName(p);
+
+ if (!isMany) {
+ value = [ value ];
+ }
+
+ if (p.isBody) {
+ body.push(new BodySerializer().build(p, value[0]));
+ } else
+ if (Types.isSimple(p.type)) {
+ forEach(value, function(v) {
+ body.push(new ValueSerializer(ns).build(p, v));
+ });
+ } else
+ if (isReference) {
+ forEach(value, function(v) {
+ body.push(new ReferenceSerializer(self, ns).build(v));
+ });
+ } else {
+ // allow serialization via type
+ // rather than element name
+ var asType = p.serialize === XSI_TYPE;
+
+ forEach(value, function(v) {
+ var serializer;
+
+ if (asType) {
+ serializer = new TypeSerializer(self, ns);
+ } else {
+ serializer = new ElementSerializer(self);
+ }
+
+ body.push(serializer.build(v));
+ });
+ }
+ });
+};
+
+ElementSerializer.prototype.getNamespaces = function() {
+ if (!this.parent) {
+ if (!this.namespaces) {
+ this.namespaces = {
+ prefixMap: {},
+ uriMap: {},
+ used: {}
+ };
+ }
+ } else {
+ this.namespaces = this.parent.getNamespaces();
+ }
+
+ return this.namespaces;
+};
+
+ElementSerializer.prototype.logNamespace = function(ns) {
+ var namespaces = this.getNamespaces();
+
+ var existing = namespaces.uriMap[ns.uri];
+
+ if (!existing) {
+ namespaces.uriMap[ns.uri] = ns;
+ }
+
+ namespaces.prefixMap[ns.prefix] = ns.uri;
+
+ return ns;
+};
+
+ElementSerializer.prototype.logNamespaceUsed = function(ns) {
+ var element = this.element,
+ model = element.$model,
+ namespaces = this.getNamespaces();
+
+ // ns may be
+ //
+ // * prefix only
+ // * prefix:uri
+
+ var prefix = ns.prefix;
+ var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
+ namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
+
+ if (!uri) {
+ throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
+ }
+
+ ns = namespaces.uriMap[uri];
+
+ if (!ns) {
+ ns = this.logNamespace({ prefix: prefix, uri: uri });
+ }
+
+ if (!namespaces.used[ns.uri]) {
+ namespaces.used[ns.uri] = ns;
+ }
+
+ return ns;
+};
+
+ElementSerializer.prototype.parseAttributes = function(properties) {
+ var self = this,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ self.logNamespaceUsed(p.ns);
+
+ var value = element.get(p.name);
+
+ if (p.isReference) {
+ value = value.id;
+ }
+
+ self.addAttribute(self.nsAttributeName(p), value);
+ });
+};
+
+ElementSerializer.prototype.addAttribute = function(name, value) {
+ var attrs = this.attrs;
+
+ if (isString(value)) {
+ value = escapeAttr(value);
+ }
+
+ attrs.push({ name: name, value: value });
+};
+
+ElementSerializer.prototype.serializeAttributes = function(writer) {
+ var attrs = this.attrs,
+ root = !this.parent,
+ namespaces = this.namespaces;
+
+ function collectNsAttrs() {
+ return map(namespaces.used, function(ns) {
+ var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
+ return { name: name, value: ns.uri };
+ });
+ }
+
+ if (root) {
+ attrs = collectNsAttrs().concat(attrs);
+ }
+
+ forEach(attrs, function(a) {
+ writer
+ .append(' ')
+ .append(nsName(a.name)).append('="').append(a.value).append('"');
+ });
+};
+
+ElementSerializer.prototype.serializeTo = function(writer) {
+ var hasBody = this.body.length,
+ indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns));
+
+ this.serializeAttributes(writer);
+
+ writer.append(hasBody ? '>' : ' />');
+
+ if (hasBody) {
+
+ if (indent) {
+ writer
+ .appendNewLine()
+ .indent();
+ }
+
+ forEach(this.body, function(b) {
+ b.serializeTo(writer);
+ });
+
+ if (indent) {
+ writer
+ .unindent()
+ .appendIndent();
+ }
+
+ writer.append('</' + nsName(this.ns) + '>');
+ }
+
+ writer.appendNewLine();
+};
+
+/**
+ * A serializer for types that handles serialization of data types
+ */
+function TypeSerializer(parent, ns) {
+ ElementSerializer.call(this, parent, ns);
+}
+
+TypeSerializer.prototype = new ElementSerializer();
+
+TypeSerializer.prototype.build = function(element) {
+ var descriptor = element.$descriptor;
+
+ this.element = element;
+
+ this.typeNs = this.nsTagName(descriptor);
+
+ // add xsi:type attribute to represent the elements
+ // actual type
+
+ var typeNs = this.typeNs,
+ pkg = element.$model.getPackage(typeNs.uri),
+ typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
+
+ this.addAttribute(this.nsAttributeName(XSI_TYPE),
+ (typeNs.prefix ? typeNs.prefix + ':' : '') +
+ typePrefix + descriptor.ns.localName);
+
+ // do the usual stuff
+ return ElementSerializer.prototype.build.call(this, element);
+};
+
+TypeSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.typeNs.uri;
+};
+
+function SavingWriter() {
+ this.value = '';
+
+ this.write = function(str) {
+ this.value += str;
+ };
+}
+
+function FormatingWriter(out, format) {
+
+ var indent = [''];
+
+ this.append = function(str) {
+ out.write(str);
+
+ return this;
+ };
+
+ this.appendNewLine = function() {
+ if (format) {
+ out.write('\n');
+ }
+
+ return this;
+ };
+
+ this.appendIndent = function() {
+ if (format) {
+ out.write(indent.join(' '));
+ }
+
+ return this;
+ };
+
+ this.indent = function() {
+ indent.push('');
+ return this;
+ };
+
+ this.unindent = function() {
+ indent.pop();
+ return this;
+ };
+}
+
+/**
+ * A writer for meta-model backed document trees
+ *
+ * @param {Object} options output options to pass into the writer
+ */
+function XMLWriter(options) {
+
+ options = assign({ format: false, preamble: true }, options || {});
+
+ function toXML(tree, writer) {
+ var internalWriter = writer || new SavingWriter();
+ var formatingWriter = new FormatingWriter(internalWriter, options.format);
+
+ if (options.preamble) {
+ formatingWriter.append(XML_PREAMBLE);
+ }
+
+ new ElementSerializer().build(tree).serializeTo(formatingWriter);
+
+ if (!writer) {
+ return internalWriter.value;
+ }
+ }
+
+ return {
+ toXML: toXML
+ };
+}
+
+module.exports = XMLWriter;
+},{"172":172,"175":175,"18":18,"28":28,"31":31,"82":82,"84":84,"87":87}],21:[function(_dereq_,module,exports){
+(function (Buffer){
+// wrapper for non-node envs
+;(function (sax) {
+
+sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+sax.SAXParser = SAXParser
+sax.SAXStream = SAXStream
+sax.createStream = createStream
+
+// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+// since that's the earliest that a buffer overrun could occur. This way, checks are
+// as rare as required, but as often as necessary to ensure never crossing this bound.
+// Furthermore, buffers are only tested at most once per write(), so passing a very
+// large string into write() might have undesirable effects, but this is manageable by
+// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+// edge case, result in creating at most one complete copy of the string passed in.
+// Set to Infinity to have unlimited buffers.
+sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+var buffers = [
+ "comment", "sgmlDecl", "textNode", "tagName", "doctype",
+ "procInstName", "procInstBody", "entity", "attribName",
+ "attribValue", "cdata", "script"
+]
+
+sax.EVENTS = // for discoverability.
+ [ "text"
+ , "processinginstruction"
+ , "sgmldeclaration"
+ , "doctype"
+ , "comment"
+ , "attribute"
+ , "opentag"
+ , "closetag"
+ , "opencdata"
+ , "cdata"
+ , "closecdata"
+ , "error"
+ , "end"
+ , "ready"
+ , "script"
+ , "opennamespace"
+ , "closenamespace"
+ ]
+
+function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ""
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.ENTITIES = Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, "onready")
+}
+
+if (!Object.create) Object.create = function (o) {
+ function f () { this.__proto__ = o }
+ f.prototype = o
+ return new f
+}
+
+if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {
+ return o.__proto__
+}
+
+if (!Object.keys) Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+}
+
+function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ , maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case "textNode":
+ closeText(parser)
+ break
+
+ case "cdata":
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ break
+
+ case "script":
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ break
+
+ default:
+ error(parser, "Max buffer length exceeded: "+buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)
+ + parser.position
+}
+
+function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ parser[buffers[i]] = ""
+ }
+}
+
+function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== "") {
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ }
+ if (parser.script !== "") {
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+}
+
+SAXParser.prototype =
+ { end: function () { end(this) }
+ , write: write
+ , resume: function () { this.error = null; return this }
+ , close: function () { return this.write(null) }
+ , flush: function () { flushBuffers(this) }
+ }
+
+try {
+ var Stream = _dereq_("stream").Stream
+} catch (ex) {
+ var Stream = function () {}
+}
+
+
+var streamWraps = sax.EVENTS.filter(function (ev) {
+ return ev !== "error" && ev !== "end"
+})
+
+function createStream (strict, opt) {
+ return new SAXStream(strict, opt)
+}
+
+function SAXStream (strict, opt) {
+ if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
+
+ Stream.apply(this)
+
+ this._parser = new SAXParser(strict, opt)
+ this.writable = true
+ this.readable = true
+
+
+ var me = this
+
+ this._parser.onend = function () {
+ me.emit("end")
+ }
+
+ this._parser.onerror = function (er) {
+ me.emit("error", er)
+
+ // if didn't throw, then means error was handled.
+ // go ahead and clear error, so we can write again.
+ me._parser.error = null
+ }
+
+ this._decoder = null;
+
+ streamWraps.forEach(function (ev) {
+ Object.defineProperty(me, "on" + ev, {
+ get: function () { return me._parser["on" + ev] },
+ set: function (h) {
+ if (!h) {
+ me.removeAllListeners(ev)
+ return me._parser["on"+ev] = h
+ }
+ me.on(ev, h)
+ },
+ enumerable: true,
+ configurable: false
+ })
+ })
+}
+
+SAXStream.prototype = Object.create(Stream.prototype,
+ { constructor: { value: SAXStream } })
+
+SAXStream.prototype.write = function (data) {
+ if (typeof Buffer === 'function' &&
+ typeof Buffer.isBuffer === 'function' &&
+ Buffer.isBuffer(data)) {
+ if (!this._decoder) {
+ var SD = _dereq_('string_decoder').StringDecoder
+ this._decoder = new SD('utf8')
+ }
+ data = this._decoder.write(data);
+ }
+
+ this._parser.write(data.toString())
+ this.emit("data", data)
+ return true
+}
+
+SAXStream.prototype.end = function (chunk) {
+ if (chunk && chunk.length) this.write(chunk)
+ this._parser.end()
+ return true
+}
+
+SAXStream.prototype.on = function (ev, handler) {
+ var me = this
+ if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) {
+ me._parser["on"+ev] = function () {
+ var args = arguments.length === 1 ? [arguments[0]]
+ : Array.apply(null, arguments)
+ args.splice(0, 0, ev)
+ me.emit.apply(me, args)
+ }
+ }
+
+ return Stream.prototype.on.call(me, ev, handler)
+}
+
+
+
+// character classes and tokens
+var whitespace = "\r\n\t "
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ , number = "0124356789"
+ , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ // (Letter | "_" | ":")
+ , quote = "'\""
+ , entity = number+letter+"#"
+ , attribEnd = whitespace + ">"
+ , CDATA = "[CDATA["
+ , DOCTYPE = "DOCTYPE"
+ , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
+ , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
+ , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+// turn all the string character sets into character class objects.
+whitespace = charClass(whitespace)
+number = charClass(number)
+letter = charClass(letter)
+
+// http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+// This implementation works on strings, a single character at a time
+// as such, it cannot ever support astral-plane characters (10000-EFFFF)
+// without a significant breaking change to either this parser, or the
+// JavaScript language. Implementation of an emoji-capable xml parser
+// is left as an exercise for the reader.
+var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
+
+quote = charClass(quote)
+entity = charClass(entity)
+attribEnd = charClass(attribEnd)
+
+function charClass (str) {
+ return str.split("").reduce(function (s, c) {
+ s[c] = true
+ return s
+ }, {})
+}
+
+function isRegExp (c) {
+ return Object.prototype.toString.call(c) === '[object RegExp]'
+}
+
+function is (charclass, c) {
+ return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
+}
+
+function not (charclass, c) {
+ return !is(charclass, c)
+}
+
+var S = 0
+sax.STATE =
+{ BEGIN : S++
+, TEXT : S++ // general stuff
+, TEXT_ENTITY : S++ // &amp and such.
+, OPEN_WAKA : S++ // <
+, SGML_DECL : S++ // <!BLARG
+, SGML_DECL_QUOTED : S++ // <!BLARG foo "bar
+, DOCTYPE : S++ // <!DOCTYPE
+, DOCTYPE_QUOTED : S++ // <!DOCTYPE "//blah
+, DOCTYPE_DTD : S++ // <!DOCTYPE "//blah" [ ...
+, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE "//blah" [ "foo
+, COMMENT_STARTING : S++ // <!-
+, COMMENT : S++ // <!--
+, COMMENT_ENDING : S++ // <!-- blah -
+, COMMENT_ENDED : S++ // <!-- blah --
+, CDATA : S++ // <![CDATA[ something
+, CDATA_ENDING : S++ // ]
+, CDATA_ENDING_2 : S++ // ]]
+, PROC_INST : S++ // <?hi
+, PROC_INST_BODY : S++ // <?hi there
+, PROC_INST_ENDING : S++ // <?hi "there" ?
+, OPEN_TAG : S++ // <strong
+, OPEN_TAG_SLASH : S++ // <strong /
+, ATTRIB : S++ // <a
+, ATTRIB_NAME : S++ // <a foo
+, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _
+, ATTRIB_VALUE : S++ // <a foo=
+, ATTRIB_VALUE_QUOTED : S++ // <a foo="bar
+, ATTRIB_VALUE_CLOSED : S++ // <a foo="bar"
+, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar
+, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar="&quot;"
+, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;
+, CLOSE_TAG : S++ // </a
+, CLOSE_TAG_SAW_WHITE : S++ // </a >
+, SCRIPT : S++ // <script> ...
+, SCRIPT_ENDING : S++ // <script> ... <
+}
+
+sax.ENTITIES =
+{ "amp" : "&"
+, "gt" : ">"
+, "lt" : "<"
+, "quot" : "\""
+, "apos" : "'"
+, "AElig" : 198
+, "Aacute" : 193
+, "Acirc" : 194
+, "Agrave" : 192
+, "Aring" : 197
+, "Atilde" : 195
+, "Auml" : 196
+, "Ccedil" : 199
+, "ETH" : 208
+, "Eacute" : 201
+, "Ecirc" : 202
+, "Egrave" : 200
+, "Euml" : 203
+, "Iacute" : 205
+, "Icirc" : 206
+, "Igrave" : 204
+, "Iuml" : 207
+, "Ntilde" : 209
+, "Oacute" : 211
+, "Ocirc" : 212
+, "Ograve" : 210
+, "Oslash" : 216
+, "Otilde" : 213
+, "Ouml" : 214
+, "THORN" : 222
+, "Uacute" : 218
+, "Ucirc" : 219
+, "Ugrave" : 217
+, "Uuml" : 220
+, "Yacute" : 221
+, "aacute" : 225
+, "acirc" : 226
+, "aelig" : 230
+, "agrave" : 224
+, "aring" : 229
+, "atilde" : 227
+, "auml" : 228
+, "ccedil" : 231
+, "eacute" : 233
+, "ecirc" : 234
+, "egrave" : 232
+, "eth" : 240
+, "euml" : 235
+, "iacute" : 237
+, "icirc" : 238
+, "igrave" : 236
+, "iuml" : 239
+, "ntilde" : 241
+, "oacute" : 243
+, "ocirc" : 244
+, "ograve" : 242
+, "oslash" : 248
+, "otilde" : 245
+, "ouml" : 246
+, "szlig" : 223
+, "thorn" : 254
+, "uacute" : 250
+, "ucirc" : 251
+, "ugrave" : 249
+, "uuml" : 252
+, "yacute" : 253
+, "yuml" : 255
+, "copy" : 169
+, "reg" : 174
+, "nbsp" : 160
+, "iexcl" : 161
+, "cent" : 162
+, "pound" : 163
+, "curren" : 164
+, "yen" : 165
+, "brvbar" : 166
+, "sect" : 167
+, "uml" : 168
+, "ordf" : 170
+, "laquo" : 171
+, "not" : 172
+, "shy" : 173
+, "macr" : 175
+, "deg" : 176
+, "plusmn" : 177
+, "sup1" : 185
+, "sup2" : 178
+, "sup3" : 179
+, "acute" : 180
+, "micro" : 181
+, "para" : 182
+, "middot" : 183
+, "cedil" : 184
+, "ordm" : 186
+, "raquo" : 187
+, "frac14" : 188
+, "frac12" : 189
+, "frac34" : 190
+, "iquest" : 191
+, "times" : 215
+, "divide" : 247
+, "OElig" : 338
+, "oelig" : 339
+, "Scaron" : 352
+, "scaron" : 353
+, "Yuml" : 376
+, "fnof" : 402
+, "circ" : 710
+, "tilde" : 732
+, "Alpha" : 913
+, "Beta" : 914
+, "Gamma" : 915
+, "Delta" : 916
+, "Epsilon" : 917
+, "Zeta" : 918
+, "Eta" : 919
+, "Theta" : 920
+, "Iota" : 921
+, "Kappa" : 922
+, "Lambda" : 923
+, "Mu" : 924
+, "Nu" : 925
+, "Xi" : 926
+, "Omicron" : 927
+, "Pi" : 928
+, "Rho" : 929
+, "Sigma" : 931
+, "Tau" : 932
+, "Upsilon" : 933
+, "Phi" : 934
+, "Chi" : 935
+, "Psi" : 936
+, "Omega" : 937
+, "alpha" : 945
+, "beta" : 946
+, "gamma" : 947
+, "delta" : 948
+, "epsilon" : 949
+, "zeta" : 950
+, "eta" : 951
+, "theta" : 952
+, "iota" : 953
+, "kappa" : 954
+, "lambda" : 955
+, "mu" : 956
+, "nu" : 957
+, "xi" : 958
+, "omicron" : 959
+, "pi" : 960
+, "rho" : 961
+, "sigmaf" : 962
+, "sigma" : 963
+, "tau" : 964
+, "upsilon" : 965
+, "phi" : 966
+, "chi" : 967
+, "psi" : 968
+, "omega" : 969
+, "thetasym" : 977
+, "upsih" : 978
+, "piv" : 982
+, "ensp" : 8194
+, "emsp" : 8195
+, "thinsp" : 8201
+, "zwnj" : 8204
+, "zwj" : 8205
+, "lrm" : 8206
+, "rlm" : 8207
+, "ndash" : 8211
+, "mdash" : 8212
+, "lsquo" : 8216
+, "rsquo" : 8217
+, "sbquo" : 8218
+, "ldquo" : 8220
+, "rdquo" : 8221
+, "bdquo" : 8222
+, "dagger" : 8224
+, "Dagger" : 8225
+, "bull" : 8226
+, "hellip" : 8230
+, "permil" : 8240
+, "prime" : 8242
+, "Prime" : 8243
+, "lsaquo" : 8249
+, "rsaquo" : 8250
+, "oline" : 8254
+, "frasl" : 8260
+, "euro" : 8364
+, "image" : 8465
+, "weierp" : 8472
+, "real" : 8476
+, "trade" : 8482
+, "alefsym" : 8501
+, "larr" : 8592
+, "uarr" : 8593
+, "rarr" : 8594
+, "darr" : 8595
+, "harr" : 8596
+, "crarr" : 8629
+, "lArr" : 8656
+, "uArr" : 8657
+, "rArr" : 8658
+, "dArr" : 8659
+, "hArr" : 8660
+, "forall" : 8704
+, "part" : 8706
+, "exist" : 8707
+, "empty" : 8709
+, "nabla" : 8711
+, "isin" : 8712
+, "notin" : 8713
+, "ni" : 8715
+, "prod" : 8719
+, "sum" : 8721
+, "minus" : 8722
+, "lowast" : 8727
+, "radic" : 8730
+, "prop" : 8733
+, "infin" : 8734
+, "ang" : 8736
+, "and" : 8743
+, "or" : 8744
+, "cap" : 8745
+, "cup" : 8746
+, "int" : 8747
+, "there4" : 8756
+, "sim" : 8764
+, "cong" : 8773
+, "asymp" : 8776
+, "ne" : 8800
+, "equiv" : 8801
+, "le" : 8804
+, "ge" : 8805
+, "sub" : 8834
+, "sup" : 8835
+, "nsub" : 8836
+, "sube" : 8838
+, "supe" : 8839
+, "oplus" : 8853
+, "otimes" : 8855
+, "perp" : 8869
+, "sdot" : 8901
+, "lceil" : 8968
+, "rceil" : 8969
+, "lfloor" : 8970
+, "rfloor" : 8971
+, "lang" : 9001
+, "rang" : 9002
+, "loz" : 9674
+, "spades" : 9824
+, "clubs" : 9827
+, "hearts" : 9829
+, "diams" : 9830
+}
+
+Object.keys(sax.ENTITIES).forEach(function (key) {
+ var e = sax.ENTITIES[key]
+ var s = typeof e === 'number' ? String.fromCharCode(e) : e
+ sax.ENTITIES[key] = s
+})
+
+for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
+
+// shorthand
+S = sax.STATE
+
+function emit (parser, event, data) {
+ parser[event] && parser[event](data)
+}
+
+function emitNode (parser, nodeType, data) {
+ if (parser.textNode) closeText(parser)
+ emit(parser, nodeType, data)
+}
+
+function closeText (parser) {
+ parser.textNode = textopts(parser.opt, parser.textNode)
+ if (parser.textNode) emit(parser, "ontext", parser.textNode)
+ parser.textNode = ""
+}
+
+function textopts (opt, text) {
+ if (opt.trim) text = text.trim()
+ if (opt.normalize) text = text.replace(/\s+/g, " ")
+ return text
+}
+
+function error (parser, er) {
+ closeText(parser)
+ if (parser.trackPosition) {
+ er += "\nLine: "+parser.line+
+ "\nColumn: "+parser.column+
+ "\nChar: "+parser.c
+ }
+ er = new Error(er)
+ parser.error = er
+ emit(parser, "onerror", er)
+ return parser
+}
+
+function end (parser) {
+ if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
+ if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
+ closeText(parser)
+ parser.c = ""
+ parser.closed = true
+ emit(parser, "onend")
+ SAXParser.call(parser, parser.strict, parser.opt)
+ return parser
+}
+
+function strictFail (parser, message) {
+ if (typeof parser !== 'object' || !(parser instanceof SAXParser))
+ throw new Error('bad call to strictFail');
+ if (parser.strict) error(parser, message)
+}
+
+function newTag (parser) {
+ if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ , tag = parser.tag = { name : parser.tagName, attributes : {} }
+
+ // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+ if (parser.opt.xmlns) tag.ns = parent.ns
+ parser.attribList.length = 0
+}
+
+function qname (name, attribute) {
+ var i = name.indexOf(":")
+ , qualName = i < 0 ? [ "", name ] : name.split(":")
+ , prefix = qualName[0]
+ , local = qualName[1]
+
+ // <x "xmlns"="http://foo">
+ if (attribute && name === "xmlns") {
+ prefix = "xmlns"
+ local = ""
+ }
+
+ return { prefix: prefix, local: local }
+}
+
+function attrib (parser) {
+ if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
+
+ if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+ parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+ return parser.attribName = parser.attribValue = ""
+ }
+
+ if (parser.opt.xmlns) {
+ var qn = qname(parser.attribName, true)
+ , prefix = qn.prefix
+ , local = qn.local
+
+ if (prefix === "xmlns") {
+ // namespace binding attribute; push the binding into scope
+ if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
+ strictFail( parser
+ , "xml: prefix must be bound to " + XML_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
+ strictFail( parser
+ , "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else {
+ var tag = parser.tag
+ , parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns === parent.ns) {
+ tag.ns = Object.create(parent.ns)
+ }
+ tag.ns[local] = parser.attribValue
+ }
+ }
+
+ // defer onattribute events until all attributes have been seen
+ // so any new bindings can take effect; preserve attribute order
+ // so deferred events can be emitted in document order
+ parser.attribList.push([parser.attribName, parser.attribValue])
+ } else {
+ // in non-xmlns mode, we can emit the event right away
+ parser.tag.attributes[parser.attribName] = parser.attribValue
+ emitNode( parser
+ , "onattribute"
+ , { name: parser.attribName
+ , value: parser.attribValue } )
+ }
+
+ parser.attribName = parser.attribValue = ""
+}
+
+function openTag (parser, selfClosing) {
+ if (parser.opt.xmlns) {
+ // emit namespace binding events
+ var tag = parser.tag
+
+ // add namespace info to tag
+ var qn = qname(parser.tagName)
+ tag.prefix = qn.prefix
+ tag.local = qn.local
+ tag.uri = tag.ns[qn.prefix] || ""
+
+ if (tag.prefix && !tag.uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(parser.tagName))
+ tag.uri = qn.prefix
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns && parent.ns !== tag.ns) {
+ Object.keys(tag.ns).forEach(function (p) {
+ emitNode( parser
+ , "onopennamespace"
+ , { prefix: p , uri: tag.ns[p] } )
+ })
+ }
+
+ // handle deferred onattribute events
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (var i = 0, l = parser.attribList.length; i < l; i ++) {
+ var nv = parser.attribList[i]
+ var name = nv[0]
+ , value = nv[1]
+ , qualName = qname(name, true)
+ , prefix = qualName.prefix
+ , local = qualName.local
+ , uri = prefix == "" ? "" : (tag.ns[prefix] || "")
+ , a = { name: name
+ , value: value
+ , prefix: prefix
+ , local: local
+ , uri: uri
+ }
+
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (prefix && prefix != "xmlns" && !uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(prefix))
+ a.uri = prefix
+ }
+ parser.tag.attributes[name] = a
+ emitNode(parser, "onattribute", a)
+ }
+ parser.attribList.length = 0
+ }
+
+ parser.tag.isSelfClosing = !!selfClosing
+
+ // process the tag
+ parser.sawRoot = true
+ parser.tags.push(parser.tag)
+ emitNode(parser, "onopentag", parser.tag)
+ if (!selfClosing) {
+ // special case for <script> in non-strict mode.
+ if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
+ parser.state = S.SCRIPT
+ } else {
+ parser.state = S.TEXT
+ }
+ parser.tag = null
+ parser.tagName = ""
+ }
+ parser.attribName = parser.attribValue = ""
+ parser.attribList.length = 0
+}
+
+function closeTag (parser) {
+ if (!parser.tagName) {
+ strictFail(parser, "Weird empty close tag.")
+ parser.textNode += "</>"
+ parser.state = S.TEXT
+ return
+ }
+
+ if (parser.script) {
+ if (parser.tagName !== "script") {
+ parser.script += "</" + parser.tagName + ">"
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ return
+ }
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = parser.tags.length
+ var tagName = parser.tagName
+ if (!parser.strict) tagName = tagName[parser.looseCase]()
+ var closeTo = tagName
+ while (t --) {
+ var close = parser.tags[t]
+ if (close.name !== closeTo) {
+ // fail the first time in strict mode
+ strictFail(parser, "Unexpected close tag")
+ } else break
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0) {
+ strictFail(parser, "Unmatched closing tag: "+parser.tagName)
+ parser.textNode += "</" + parser.tagName + ">"
+ parser.state = S.TEXT
+ return
+ }
+ parser.tagName = tagName
+ var s = parser.tags.length
+ while (s --> t) {
+ var tag = parser.tag = parser.tags.pop()
+ parser.tagName = parser.tag.name
+ emitNode(parser, "onclosetag", parser.tagName)
+
+ var x = {}
+ for (var i in tag.ns) x[i] = tag.ns[i]
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (parser.opt.xmlns && tag.ns !== parent.ns) {
+ // remove namespace bindings introduced by tag
+ Object.keys(tag.ns).forEach(function (p) {
+ var n = tag.ns[p]
+ emitNode(parser, "onclosenamespace", { prefix: p, uri: n })
+ })
+ }
+ }
+ if (t === 0) parser.closedRoot = true
+ parser.tagName = parser.attribValue = parser.attribName = ""
+ parser.attribList.length = 0
+ parser.state = S.TEXT
+}
+
+function parseEntity (parser) {
+ var entity = parser.entity
+ , entityLC = entity.toLowerCase()
+ , num
+ , numStr = ""
+ if (parser.ENTITIES[entity])
+ return parser.ENTITIES[entity]
+ if (parser.ENTITIES[entityLC])
+ return parser.ENTITIES[entityLC]
+ entity = entityLC
+ if (entity.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2)
+ num = parseInt(entity, 16)
+ numStr = num.toString(16)
+ } else {
+ entity = entity.slice(1)
+ num = parseInt(entity, 10)
+ numStr = num.toString(10)
+ }
+ }
+ entity = entity.replace(/^0+/, "")
+ if (numStr.toLowerCase() !== entity) {
+ strictFail(parser, "Invalid character entity")
+ return "&"+parser.entity + ";"
+ }
+
+ return String.fromCodePoint(num)
+}
+
+function write (chunk) {
+ var parser = this
+ if (this.error) throw this.error
+ if (parser.closed) return error(parser,
+ "Cannot write after close. Assign an onready handler.")
+ if (chunk === null) return end(parser)
+ var i = 0, c = ""
+ while (parser.c = c = chunk.charAt(i++)) {
+ if (parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ switch (parser.state) {
+
+ case S.BEGIN:
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else if (not(whitespace,c)) {
+ // have to process this as a text node.
+ // weird, but happens.
+ strictFail(parser, "Non-whitespace before first tag.")
+ parser.textNode = c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.TEXT:
+ if (parser.sawRoot && !parser.closedRoot) {
+ var starti = i-1
+ while (c && c!=="<" && c!=="&") {
+ c = chunk.charAt(i++)
+ if (c && parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ }
+ parser.textNode += chunk.substring(starti, i-1)
+ }
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else {
+ if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
+ strictFail(parser, "Text data outside of root node.")
+ if (c === "&") parser.state = S.TEXT_ENTITY
+ else parser.textNode += c
+ }
+ continue
+
+ case S.SCRIPT:
+ // only non-strict
+ if (c === "<") {
+ parser.state = S.SCRIPT_ENDING
+ } else parser.script += c
+ continue
+
+ case S.SCRIPT_ENDING:
+ if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ } else {
+ parser.script += "<" + c
+ parser.state = S.SCRIPT
+ }
+ continue
+
+ case S.OPEN_WAKA:
+ // either a /, ?, !, or text is coming next.
+ if (c === "!") {
+ parser.state = S.SGML_DECL
+ parser.sgmlDecl = ""
+ } else if (is(whitespace, c)) {
+ // wait for it...
+ } else if (is(nameStart,c)) {
+ parser.state = S.OPEN_TAG
+ parser.tagName = c
+ } else if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ parser.tagName = ""
+ } else if (c === "?") {
+ parser.state = S.PROC_INST
+ parser.procInstName = parser.procInstBody = ""
+ } else {
+ strictFail(parser, "Unencoded <")
+ // if there was some whitespace, then add that in.
+ if (parser.startTagPosition + 1 < parser.position) {
+ var pad = parser.position - parser.startTagPosition
+ c = new Array(pad).join(" ") + c
+ }
+ parser.textNode += "<" + c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.SGML_DECL:
+ if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {
+ emitNode(parser, "onopencdata")
+ parser.state = S.CDATA
+ parser.sgmlDecl = ""
+ parser.cdata = ""
+ } else if (parser.sgmlDecl+c === "--") {
+ parser.state = S.COMMENT
+ parser.comment = ""
+ parser.sgmlDecl = ""
+ } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {
+ parser.state = S.DOCTYPE
+ if (parser.doctype || parser.sawRoot) strictFail(parser,
+ "Inappropriately located doctype declaration")
+ parser.doctype = ""
+ parser.sgmlDecl = ""
+ } else if (c === ">") {
+ emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
+ parser.sgmlDecl = ""
+ parser.state = S.TEXT
+ } else if (is(quote, c)) {
+ parser.state = S.SGML_DECL_QUOTED
+ parser.sgmlDecl += c
+ } else parser.sgmlDecl += c
+ continue
+
+ case S.SGML_DECL_QUOTED:
+ if (c === parser.q) {
+ parser.state = S.SGML_DECL
+ parser.q = ""
+ }
+ parser.sgmlDecl += c
+ continue
+
+ case S.DOCTYPE:
+ if (c === ">") {
+ parser.state = S.TEXT
+ emitNode(parser, "ondoctype", parser.doctype)
+ parser.doctype = true // just remember that we saw it.
+ } else {
+ parser.doctype += c
+ if (c === "[") parser.state = S.DOCTYPE_DTD
+ else if (is(quote, c)) {
+ parser.state = S.DOCTYPE_QUOTED
+ parser.q = c
+ }
+ }
+ continue
+
+ case S.DOCTYPE_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.q = ""
+ parser.state = S.DOCTYPE
+ }
+ continue
+
+ case S.DOCTYPE_DTD:
+ parser.doctype += c
+ if (c === "]") parser.state = S.DOCTYPE
+ else if (is(quote,c)) {
+ parser.state = S.DOCTYPE_DTD_QUOTED
+ parser.q = c
+ }
+ continue
+
+ case S.DOCTYPE_DTD_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.state = S.DOCTYPE_DTD
+ parser.q = ""
+ }
+ continue
+
+ case S.COMMENT:
+ if (c === "-") parser.state = S.COMMENT_ENDING
+ else parser.comment += c
+ continue
+
+ case S.COMMENT_ENDING:
+ if (c === "-") {
+ parser.state = S.COMMENT_ENDED
+ parser.comment = textopts(parser.opt, parser.comment)
+ if (parser.comment) emitNode(parser, "oncomment", parser.comment)
+ parser.comment = ""
+ } else {
+ parser.comment += "-" + c
+ parser.state = S.COMMENT
+ }
+ continue
+
+ case S.COMMENT_ENDED:
+ if (c !== ">") {
+ strictFail(parser, "Malformed comment")
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ parser.comment += "--" + c
+ parser.state = S.COMMENT
+ } else parser.state = S.TEXT
+ continue
+
+ case S.CDATA:
+ if (c === "]") parser.state = S.CDATA_ENDING
+ else parser.cdata += c
+ continue
+
+ case S.CDATA_ENDING:
+ if (c === "]") parser.state = S.CDATA_ENDING_2
+ else {
+ parser.cdata += "]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.CDATA_ENDING_2:
+ if (c === ">") {
+ if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
+ emitNode(parser, "onclosecdata")
+ parser.cdata = ""
+ parser.state = S.TEXT
+ } else if (c === "]") {
+ parser.cdata += "]"
+ } else {
+ parser.cdata += "]]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.PROC_INST:
+ if (c === "?") parser.state = S.PROC_INST_ENDING
+ else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
+ else parser.procInstName += c
+ continue
+
+ case S.PROC_INST_BODY:
+ if (!parser.procInstBody && is(whitespace, c)) continue
+ else if (c === "?") parser.state = S.PROC_INST_ENDING
+ else parser.procInstBody += c
+ continue
+
+ case S.PROC_INST_ENDING:
+ if (c === ">") {
+ emitNode(parser, "onprocessinginstruction", {
+ name : parser.procInstName,
+ body : parser.procInstBody
+ })
+ parser.procInstName = parser.procInstBody = ""
+ parser.state = S.TEXT
+ } else {
+ parser.procInstBody += "?" + c
+ parser.state = S.PROC_INST_BODY
+ }
+ continue
+
+ case S.OPEN_TAG:
+ if (is(nameBody, c)) parser.tagName += c
+ else {
+ newTag(parser)
+ if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else {
+ if (not(whitespace, c)) strictFail(
+ parser, "Invalid character in tag name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.OPEN_TAG_SLASH:
+ if (c === ">") {
+ openTag(parser, true)
+ closeTag(parser)
+ } else {
+ strictFail(parser, "Forward-slash in opening tag not followed by >")
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.ATTRIB:
+ // haven't read the attribute name yet.
+ if (is(whitespace, c)) continue
+ else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (c === ">") {
+ strictFail(parser, "Attribute without value")
+ parser.attribValue = parser.attribName
+ attrib(parser)
+ openTag(parser)
+ }
+ else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
+ else if (is(nameBody, c)) parser.attribName += c
+ else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME_SAW_WHITE:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (is(whitespace, c)) continue
+ else {
+ strictFail(parser, "Attribute without value")
+ parser.tag.attributes[parser.attribName] = ""
+ parser.attribValue = ""
+ emitNode(parser, "onattribute",
+ { name : parser.attribName, value : "" })
+ parser.attribName = ""
+ if (c === ">") openTag(parser)
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, "Invalid attribute name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.ATTRIB_VALUE:
+ if (is(whitespace, c)) continue
+ else if (is(quote, c)) {
+ parser.q = c
+ parser.state = S.ATTRIB_VALUE_QUOTED
+ } else {
+ strictFail(parser, "Unquoted attribute value")
+ parser.state = S.ATTRIB_VALUE_UNQUOTED
+ parser.attribValue = c
+ }
+ continue
+
+ case S.ATTRIB_VALUE_QUOTED:
+ if (c !== parser.q) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ parser.q = ""
+ parser.state = S.ATTRIB_VALUE_CLOSED
+ continue
+
+ case S.ATTRIB_VALUE_CLOSED:
+ if (is(whitespace, c)) {
+ parser.state = S.ATTRIB
+ } else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ strictFail(parser, "No whitespace between attributes")
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_VALUE_UNQUOTED:
+ if (not(attribEnd,c)) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ if (c === ">") openTag(parser)
+ else parser.state = S.ATTRIB
+ continue
+
+ case S.CLOSE_TAG:
+ if (!parser.tagName) {
+ if (is(whitespace, c)) continue
+ else if (not(nameStart, c)) {
+ if (parser.script) {
+ parser.script += "</" + c
+ parser.state = S.SCRIPT
+ } else {
+ strictFail(parser, "Invalid tagname in closing tag.")
+ }
+ } else parser.tagName = c
+ }
+ else if (c === ">") closeTag(parser)
+ else if (is(nameBody, c)) parser.tagName += c
+ else if (parser.script) {
+ parser.script += "</" + parser.tagName
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ } else {
+ if (not(whitespace, c)) strictFail(parser,
+ "Invalid tagname in closing tag")
+ parser.state = S.CLOSE_TAG_SAW_WHITE
+ }
+ continue
+
+ case S.CLOSE_TAG_SAW_WHITE:
+ if (is(whitespace, c)) continue
+ if (c === ">") closeTag(parser)
+ else strictFail(parser, "Invalid characters in closing tag")
+ continue
+
+ case S.TEXT_ENTITY:
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ case S.ATTRIB_VALUE_ENTITY_U:
+ switch(parser.state) {
+ case S.TEXT_ENTITY:
+ var returnState = S.TEXT, buffer = "textNode"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_U:
+ var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"
+ break
+ }
+ if (c === ";") {
+ parser[buffer] += parseEntity(parser)
+ parser.entity = ""
+ parser.state = returnState
+ }
+ else if (is(entity, c)) parser.entity += c
+ else {
+ strictFail(parser, "Invalid character entity")
+ parser[buffer] += "&" + parser.entity + c
+ parser.entity = ""
+ parser.state = returnState
+ }
+ continue
+
+ default:
+ throw new Error(parser, "Unknown state: " + parser.state)
+ }
+ } // while
+ // cdata blocks can get very big under normal conditions. emit and move on.
+ // if (parser.state === S.CDATA && parser.cdata) {
+ // emitNode(parser, "oncdata", parser.cdata)
+ // parser.cdata = ""
+ // }
+ if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
+ return parser
+}
+
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+if (!String.fromCodePoint) {
+ (function() {
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function() {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (Object.defineProperty) {
+ Object.defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
+
+})(typeof exports === "undefined" ? sax = {} : exports);
+
+}).call(this,undefined)
+
+},{"undefined":undefined}],22:[function(_dereq_,module,exports){
+/**
+ * Tiny stack for browser or server
+ *
+ * @author Jason Mulligan <jason.mulligan@avoidwork.com>
+ * @copyright 2014 Jason Mulligan
+ * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
+ * @link http://avoidwork.github.io/tiny-stack
+ * @module tiny-stack
+ * @version 0.1.0
+ */
+
+( function ( global ) {
+
+"use strict";
+
+/**
+ * TinyStack
+ *
+ * @constructor
+ */
+function TinyStack () {
+ this.data = [null];
+ this.top = 0;
+}
+
+/**
+ * Clears the stack
+ *
+ * @method clear
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.clear = function clear () {
+ this.data = [null];
+ this.top = 0;
+
+ return this;
+};
+
+/**
+ * Gets the size of the stack
+ *
+ * @method length
+ * @memberOf TinyStack
+ * @return {Number} Size of stack
+ */
+TinyStack.prototype.length = function length () {
+ return this.top;
+};
+
+/**
+ * Gets the item at the top of the stack
+ *
+ * @method peek
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.peek = function peek () {
+ return this.data[this.top];
+};
+
+/**
+ * Gets & removes the item at the top of the stack
+ *
+ * @method pop
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.pop = function pop () {
+ if ( this.top > 0 ) {
+ this.top--;
+
+ return this.data.pop();
+ }
+ else {
+ return undefined;
+ }
+};
+
+/**
+ * Pushes an item onto the stack
+ *
+ * @method push
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.push = function push ( arg ) {
+ this.data[++this.top] = arg;
+
+ return this;
+};
+
+/**
+ * TinyStack factory
+ *
+ * @method factory
+ * @return {Object} {@link TinyStack}
+ */
+function factory () {
+ return new TinyStack();
+}
+
+// Node, AMD & window supported
+if ( typeof exports != "undefined" ) {
+ module.exports = factory;
+}
+else if ( typeof define == "function" ) {
+ define( function () {
+ return factory;
+ } );
+}
+else {
+ global.stack = factory;
+}
+} )( this );
+
+},{}],23:[function(_dereq_,module,exports){
+module.exports = _dereq_(27);
+},{"27":27}],24:[function(_dereq_,module,exports){
+'use strict';
+
+function Base() { }
+
+Base.prototype.get = function(name) {
+ return this.$model.properties.get(this, name);
+};
+
+Base.prototype.set = function(name, value) {
+ this.$model.properties.set(this, name, value);
+};
+
+
+module.exports = Base;
+},{}],25:[function(_dereq_,module,exports){
+'use strict';
+
+var pick = _dereq_(180),
+ assign = _dereq_(175),
+ forEach = _dereq_(84);
+
+var parseNameNs = _dereq_(28).parseName;
+
+
+function DescriptorBuilder(nameNs) {
+ this.ns = nameNs;
+ this.name = nameNs.name;
+ this.allTypes = [];
+ this.properties = [];
+ this.propertiesByName = {};
+}
+
+module.exports = DescriptorBuilder;
+
+
+DescriptorBuilder.prototype.build = function() {
+ return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);
+};
+
+DescriptorBuilder.prototype.addProperty = function(p, idx) {
+ this.addNamedProperty(p, true);
+
+ var properties = this.properties;
+
+ if (idx !== undefined) {
+ properties.splice(idx, 0, p);
+ } else {
+ properties.push(p);
+ }
+};
+
+
+DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
+ var oldNameNs = oldProperty.ns;
+
+ var props = this.properties,
+ propertiesByName = this.propertiesByName,
+ rename = oldProperty.name !== newProperty.name;
+
+ if (oldProperty.isBody) {
+
+ if (!newProperty.isBody) {
+ throw new Error(
+ 'property <' + newProperty.ns.name + '> must be body property ' +
+ 'to refine <' + oldProperty.ns.name + '>');
+ }
+
+ // TODO: Check compatibility
+ this.setBodyProperty(newProperty, false);
+ }
+
+ // replacing the named property is intentional
+ // thus, validate only if this is a "rename" operation
+ this.addNamedProperty(newProperty, rename);
+
+ // replace old property at index with new one
+ var idx = props.indexOf(oldProperty);
+ if (idx === -1) {
+ throw new Error('property <' + oldNameNs.name + '> not found in property list');
+ }
+
+ props[idx] = newProperty;
+
+ // replace propertiesByName entry with new property
+ propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
+};
+
+
+DescriptorBuilder.prototype.redefineProperty = function(p) {
+
+ var nsPrefix = p.ns.prefix;
+ var parts = p.redefines.split('#');
+
+ var name = parseNameNs(parts[0], nsPrefix);
+ var attrName = parseNameNs(parts[1], name.prefix).name;
+
+ var redefinedProperty = this.propertiesByName[attrName];
+ if (!redefinedProperty) {
+ throw new Error('refined property <' + attrName + '> not found');
+ } else {
+ this.replaceProperty(redefinedProperty, p);
+ }
+
+ delete p.redefines;
+};
+
+DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ if (validate) {
+ this.assertNotDefined(p, ns.name);
+ this.assertNotDefined(p, ns.localName);
+ }
+
+ propsByName[ns.name] = propsByName[ns.localName] = p;
+};
+
+DescriptorBuilder.prototype.removeNamedProperty = function(p) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ delete propsByName[ns.name];
+ delete propsByName[ns.localName];
+};
+
+DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
+
+ if (validate && this.bodyProperty) {
+ throw new Error(
+ 'body property defined multiple times ' +
+ '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
+ }
+
+ this.bodyProperty = p;
+};
+
+DescriptorBuilder.prototype.addIdProperty = function(name) {
+ var nameNs = parseNameNs(name, this.ns.prefix);
+
+ var p = {
+ name: nameNs.localName,
+ type: 'String',
+ isAttr: true,
+ ns: nameNs
+ };
+
+ // ensure that id is always the first attribute (if present)
+ this.addProperty(p, 0);
+};
+
+DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
+ var propertyName = p.name,
+ definedProperty = this.propertiesByName[propertyName];
+
+ if (definedProperty) {
+ throw new Error(
+ 'property <' + propertyName + '> already defined; ' +
+ 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
+ '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
+ }
+};
+
+DescriptorBuilder.prototype.hasProperty = function(name) {
+ return this.propertiesByName[name];
+};
+
+DescriptorBuilder.prototype.addTrait = function(t) {
+
+ var allTypes = this.allTypes;
+
+ if (allTypes.indexOf(t) !== -1) {
+ return;
+ }
+
+ forEach(t.properties, function(p) {
+
+ // clone property to allow extensions
+ p = assign({}, p, {
+ name: p.ns.localName
+ });
+
+ Object.defineProperty(p, 'definedBy', {
+ value: t
+ });
+
+ // add redefine support
+ if (p.redefines) {
+ this.redefineProperty(p);
+ } else {
+ if (p.isBody) {
+ this.setBodyProperty(p);
+ }
+ this.addProperty(p);
+ }
+ }, this);
+
+ allTypes.push(t);
+};
+
+},{"175":175,"180":180,"28":28,"84":84}],26:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(84);
+
+var Base = _dereq_(24);
+
+
+function Factory(model, properties) {
+ this.model = model;
+ this.properties = properties;
+}
+
+module.exports = Factory;
+
+
+Factory.prototype.createType = function(descriptor) {
+
+ var model = this.model;
+
+ var props = this.properties,
+ prototype = Object.create(Base.prototype);
+
+ // initialize default values
+ forEach(descriptor.properties, function(p) {
+ if (!p.isMany && p.default !== undefined) {
+ prototype[p.name] = p.default;
+ }
+ });
+
+ props.defineModel(prototype, model);
+ props.defineDescriptor(prototype, descriptor);
+
+ var name = descriptor.ns.name;
+
+ /**
+ * The new type constructor
+ */
+ function ModdleElement(attrs) {
+ props.define(this, '$type', { value: name, enumerable: true });
+ props.define(this, '$attrs', { value: {} });
+ props.define(this, '$parent', { writable: true });
+
+ forEach(attrs, function(val, key) {
+ this.set(key, val);
+ }, this);
+ }
+
+ ModdleElement.prototype = prototype;
+
+ ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
+
+ // static links
+ props.defineModel(ModdleElement, model);
+ props.defineDescriptor(ModdleElement, descriptor);
+
+ return ModdleElement;
+};
+},{"24":24,"84":84}],27:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(172),
+ isObject = _dereq_(170),
+ forEach = _dereq_(84),
+ find = _dereq_(83);
+
+
+var Factory = _dereq_(26),
+ Registry = _dereq_(30),
+ Properties = _dereq_(29);
+
+var parseNameNs = _dereq_(28).parseName;
+
+
+//// Moddle implementation /////////////////////////////////////////////////
+
+/**
+ * @class Moddle
+ *
+ * A model that can be used to create elements of a specific type.
+ *
+ * @example
+ *
+ * var Moddle = require('moddle');
+ *
+ * var pkg = {
+ * name: 'mypackage',
+ * prefix: 'my',
+ * types: [
+ * { name: 'Root' }
+ * ]
+ * };
+ *
+ * var moddle = new Moddle([pkg]);
+ *
+ * @param {Array<Package>} packages the packages to contain
+ * @param {Object} options additional options to pass to the model
+ */
+function Moddle(packages, options) {
+
+ options = options || {};
+
+ this.properties = new Properties(this);
+
+ this.factory = new Factory(this, this.properties);
+ this.registry = new Registry(packages, this.properties, options);
+
+ this.typeCache = {};
+}
+
+module.exports = Moddle;
+
+
+/**
+ * Create an instance of the specified type.
+ *
+ * @method Moddle#create
+ *
+ * @example
+ *
+ * var foo = moddle.create('my:Foo');
+ * var bar = moddle.create('my:Bar', { id: 'BAR_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @param {Object} attrs a number of attributes to initialize the model instance with
+ * @return {Object} model instance
+ */
+Moddle.prototype.create = function(descriptor, attrs) {
+ var Type = this.getType(descriptor);
+
+ if (!Type) {
+ throw new Error('unknown type <' + descriptor + '>');
+ }
+
+ return new Type(attrs);
+};
+
+
+/**
+ * Returns the type representing a given descriptor
+ *
+ * @method Moddle#getType
+ *
+ * @example
+ *
+ * var Foo = moddle.getType('my:Foo');
+ * var foo = new Foo({ 'id' : 'FOO_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @return {Object} the type representing the descriptor
+ */
+Moddle.prototype.getType = function(descriptor) {
+
+ var cache = this.typeCache;
+
+ var name = isString(descriptor) ? descriptor : descriptor.ns.name;
+
+ var type = cache[name];
+
+ if (!type) {
+ descriptor = this.registry.getEffectiveDescriptor(name);
+ type = cache[name] = this.factory.createType(descriptor);
+ }
+
+ return type;
+};
+
+
+/**
+ * Creates an any-element type to be used within model instances.
+ *
+ * This can be used to create custom elements that lie outside the meta-model.
+ * The created element contains all the meta-data required to serialize it
+ * as part of meta-model elements.
+ *
+ * @method Moddle#createAny
+ *
+ * @example
+ *
+ * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {
+ * value: 'bar'
+ * });
+ *
+ * var container = moddle.create('my:Container', 'http://my', {
+ * any: [ foo ]
+ * });
+ *
+ * // go ahead and serialize the stuff
+ *
+ *
+ * @param {String} name the name of the element
+ * @param {String} nsUri the namespace uri of the element
+ * @param {Object} [properties] a map of properties to initialize the instance with
+ * @return {Object} the any type instance
+ */
+Moddle.prototype.createAny = function(name, nsUri, properties) {
+
+ var nameNs = parseNameNs(name);
+
+ var element = {
+ $type: name
+ };
+
+ var descriptor = {
+ name: name,
+ isGeneric: true,
+ ns: {
+ prefix: nameNs.prefix,
+ localName: nameNs.localName,
+ uri: nsUri
+ }
+ };
+
+ this.properties.defineDescriptor(element, descriptor);
+ this.properties.defineModel(element, this);
+ this.properties.define(element, '$parent', { enumerable: false, writable: true });
+
+ forEach(properties, function(a, key) {
+ if (isObject(a) && a.value !== undefined) {
+ element[a.name] = a.value;
+ } else {
+ element[key] = a;
+ }
+ });
+
+ return element;
+};
+
+/**
+ * Returns a registered package by uri or prefix
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackage = function(uriOrPrefix) {
+ return this.registry.getPackage(uriOrPrefix);
+};
+
+/**
+ * Returns a snapshot of all known packages
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackages = function() {
+ return this.registry.getPackages();
+};
+
+/**
+ * Returns the descriptor for an element
+ */
+Moddle.prototype.getElementDescriptor = function(element) {
+ return element.$descriptor;
+};
+
+/**
+ * Returns true if the given descriptor or instance
+ * represents the given type.
+ *
+ * May be applied to this, if element is omitted.
+ */
+Moddle.prototype.hasType = function(element, type) {
+ if (type === undefined) {
+ type = element;
+ element = this;
+ }
+
+ var descriptor = element.$model.getElementDescriptor(element);
+
+ return !!find(descriptor.allTypes, function(t) {
+ return t.name === type;
+ });
+};
+
+
+/**
+ * Returns the descriptor of an elements named property
+ */
+Moddle.prototype.getPropertyDescriptor = function(element, property) {
+ return this.getElementDescriptor(element).propertiesByName[property];
+};
+
+},{"170":170,"172":172,"26":26,"28":28,"29":29,"30":30,"83":83,"84":84}],28:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Parses a namespaced attribute name of the form (ns:)localName to an object,
+ * given a default prefix to assume in case no explicit namespace is given.
+ *
+ * @param {String} name
+ * @param {String} [defaultPrefix] the default prefix to take, if none is present.
+ *
+ * @return {Object} the parsed name
+ */
+module.exports.parseName = function(name, defaultPrefix) {
+ var parts = name.split(/:/),
+ localName, prefix;
+
+ // no prefix (i.e. only local name)
+ if (parts.length === 1) {
+ localName = name;
+ prefix = defaultPrefix;
+ } else
+ // prefix + local name
+ if (parts.length === 2) {
+ localName = parts[1];
+ prefix = parts[0];
+ } else {
+ throw new Error('expected <prefix:localName> or <localName>, got ' + name);
+ }
+
+ name = (prefix ? prefix + ':' : '') + localName;
+
+ return {
+ name: name,
+ prefix: prefix,
+ localName: localName
+ };
+};
+},{}],29:[function(_dereq_,module,exports){
+'use strict';
+
+
+/**
+ * A utility that gets and sets properties of model elements.
+ *
+ * @param {Model} model
+ */
+function Properties(model) {
+ this.model = model;
+}
+
+module.exports = Properties;
+
+
+/**
+ * Sets a named property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} value
+ */
+Properties.prototype.set = function(target, name, value) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ target.$attrs[name] = value;
+ } else {
+ Object.defineProperty(target, property.name, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: value
+ });
+ }
+};
+
+/**
+ * Returns the named property of the given element
+ *
+ * @param {Object} target
+ * @param {String} name
+ *
+ * @return {Object}
+ */
+Properties.prototype.get = function(target, name) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ return target.$attrs[name];
+ }
+
+ var propertyName = property.name;
+
+ // check if access to collection property and lazily initialize it
+ if (!target[propertyName] && property.isMany) {
+ Object.defineProperty(target, propertyName, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: []
+ });
+ }
+
+ return target[propertyName];
+};
+
+
+/**
+ * Define a property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} options
+ */
+Properties.prototype.define = function(target, name, options) {
+ Object.defineProperty(target, name, options);
+};
+
+
+/**
+ * Define the descriptor for an element
+ */
+Properties.prototype.defineDescriptor = function(target, descriptor) {
+ this.define(target, '$descriptor', { value: descriptor });
+};
+
+/**
+ * Define the model for an element
+ */
+Properties.prototype.defineModel = function(target, model) {
+ this.define(target, '$model', { value: model });
+};
+},{}],30:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175),
+ forEach = _dereq_(84);
+
+var Types = _dereq_(31),
+ DescriptorBuilder = _dereq_(25);
+
+var parseNameNs = _dereq_(28).parseName,
+ isBuiltInType = Types.isBuiltIn;
+
+
+function Registry(packages, properties, options) {
+ this.options = assign({ generateId: 'id' }, options || {});
+
+ this.packageMap = {};
+ this.typeMap = {};
+
+ this.packages = [];
+
+ this.properties = properties;
+
+ forEach(packages, this.registerPackage, this);
+}
+
+module.exports = Registry;
+
+
+Registry.prototype.getPackage = function(uriOrPrefix) {
+ return this.packageMap[uriOrPrefix];
+};
+
+Registry.prototype.getPackages = function() {
+ return this.packages;
+};
+
+
+Registry.prototype.registerPackage = function(pkg) {
+
+ // copy package
+ pkg = assign({}, pkg);
+
+ // register types
+ forEach(pkg.types, function(descriptor) {
+ this.registerType(descriptor, pkg);
+ }, this);
+
+ this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
+ this.packages.push(pkg);
+};
+
+
+/**
+ * Register a type from a specific package with us
+ */
+Registry.prototype.registerType = function(type, pkg) {
+
+ type = assign({}, type, {
+ superClass: (type.superClass || []).slice(),
+ extends: (type.extends || []).slice(),
+ properties: (type.properties || []).slice()
+ });
+
+ var ns = parseNameNs(type.name, pkg.prefix),
+ name = ns.name,
+ propertiesByName = {};
+
+ // parse properties
+ forEach(type.properties, function(p) {
+
+ // namespace property names
+ var propertyNs = parseNameNs(p.name, ns.prefix),
+ propertyName = propertyNs.name;
+
+ // namespace property types
+ if (!isBuiltInType(p.type)) {
+ p.type = parseNameNs(p.type, propertyNs.prefix).name;
+ }
+
+ assign(p, {
+ ns: propertyNs,
+ name: propertyName
+ });
+
+ propertiesByName[propertyName] = p;
+ });
+
+ // update ns + name
+ assign(type, {
+ ns: ns,
+ name: name,
+ propertiesByName: propertiesByName
+ });
+
+ forEach(type.extends, function(extendsName) {
+ var extended = this.typeMap[extendsName];
+
+ extended.traits = extended.traits || [];
+ extended.traits.push(name);
+ }, this);
+
+ // link to package
+ this.definePackage(type, pkg);
+
+ // register
+ this.typeMap[name] = type;
+};
+
+
+/**
+ * Traverse the type hierarchy from bottom to top.
+ */
+Registry.prototype.mapTypes = function(nsName, iterator) {
+
+ var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];
+
+ var self = this;
+
+ /**
+ * Traverse the selected super type or trait
+ *
+ * @param {String} cls
+ */
+ function traverseSuper(cls) {
+ var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
+ self.mapTypes(parentNs, iterator);
+ }
+
+ if (!type) {
+ throw new Error('unknown type <' + nsName.name + '>');
+ }
+
+ forEach(type.superClass, traverseSuper);
+
+ iterator(type);
+
+ forEach(type.traits, traverseSuper);
+};
+
+
+/**
+ * Returns the effective descriptor for a type.
+ *
+ * @param {String} type the namespaced name (ns:localName) of the type
+ *
+ * @return {Descriptor} the resulting effective descriptor
+ */
+Registry.prototype.getEffectiveDescriptor = function(name) {
+
+ var nsName = parseNameNs(name);
+
+ var builder = new DescriptorBuilder(nsName);
+
+ this.mapTypes(nsName, function(type) {
+ builder.addTrait(type);
+ });
+
+ // check we have an id assigned
+ var id = this.options.generateId;
+ if (id && !builder.hasProperty(id)) {
+ builder.addIdProperty(id);
+ }
+
+ var descriptor = builder.build();
+
+ // define package link
+ this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
+
+ return descriptor;
+};
+
+
+Registry.prototype.definePackage = function(target, pkg) {
+ this.properties.define(target, '$pkg', { value: pkg });
+};
+},{"175":175,"25":25,"28":28,"31":31,"84":84}],31:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Built-in moddle types
+ */
+var BUILTINS = {
+ String: true,
+ Boolean: true,
+ Integer: true,
+ Real: true,
+ Element: true
+};
+
+/**
+ * Converters for built in types from string representations
+ */
+var TYPE_CONVERTERS = {
+ String: function(s) { return s; },
+ Boolean: function(s) { return s === 'true'; },
+ Integer: function(s) { return parseInt(s, 10); },
+ Real: function(s) { return parseFloat(s, 10); }
+};
+
+/**
+ * Convert a type to its real representation
+ */
+module.exports.coerceType = function(type, value) {
+
+ var converter = TYPE_CONVERTERS[type];
+
+ if (converter) {
+ return converter(value);
+ } else {
+ return value;
+ }
+};
+
+/**
+ * Return whether the given type is built-in
+ */
+module.exports.isBuiltIn = function(type) {
+ return !!BUILTINS[type];
+};
+
+/**
+ * Return whether the given type is simple
+ */
+module.exports.isSimple = function(type) {
+ return !!TYPE_CONVERTERS[type];
+};
+},{}],32:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMN20",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
+ "associations": [],
+ "types": [
+ {
+ "name": "Interface",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operations",
+ "type": "Operation",
+ "isMany": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Operation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "errorRefs",
+ "type": "Error",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EndPoint",
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "Auditing",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "GlobalTask",
+ "superClass": [
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Monitoring",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Performer",
+ "superClass": [
+ "ResourceRole"
+ ]
+ },
+ {
+ "name": "Process",
+ "superClass": [
+ "FlowElementsContainer",
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "processType",
+ "type": "ProcessType",
+ "isAttr": true
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "supports",
+ "type": "Process",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "definitionalCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "isExecutable",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "correlationSubscriptions",
+ "type": "CorrelationSubscription",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LaneSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Lane",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "childLaneSet",
+ "type": "LaneSet",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "partitionElementRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "flowNodeRef",
+ "type": "FlowNode",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "partitionElement",
+ "type": "BaseElement"
+ }
+ ]
+ },
+ {
+ "name": "GlobalManualTask",
+ "superClass": [
+ "GlobalTask"
+ ]
+ },
+ {
+ "name": "ManualTask",
+ "superClass": [
+ "Task"
+ ]
+ },
+ {
+ "name": "UserTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ },
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Rendering",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "HumanPerformer",
+ "superClass": [
+ "Performer"
+ ]
+ },
+ {
+ "name": "PotentialOwner",
+ "superClass": [
+ "HumanPerformer"
+ ]
+ },
+ {
+ "name": "GlobalUserTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Gateway",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "gatewayDirection",
+ "type": "GatewayDirection",
+ "default": "Unspecified",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "eventGatewayType",
+ "type": "EventBasedGatewayType",
+ "isAttr": true,
+ "default": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "ComplexGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "activationCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParallelGateway",
+ "superClass": [
+ "Gateway"
+ ]
+ },
+ {
+ "name": "RootElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Relationship",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "direction",
+ "type": "RelationshipDirection",
+ "isAttr": true
+ },
+ {
+ "name": "source",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "target",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ }
+ ]
+ },
+ {
+ "name": "BaseElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "id",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "type": "Documentation",
+ "isMany": true
+ },
+ {
+ "name": "extensionDefinitions",
+ "type": "ExtensionDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "extensionElements",
+ "type": "ExtensionElements"
+ }
+ ]
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "mustUnderstand",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "definition",
+ "type": "ExtensionDefinition"
+ }
+ ]
+ },
+ {
+ "name": "ExtensionDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "extensionAttributeDefinitions",
+ "type": "ExtensionAttributeDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionAttributeDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isReference",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "extensionDefinition",
+ "type": "ExtensionDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionElements",
+ "properties": [
+ {
+ "name": "valueRef",
+ "isAttr": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ },
+ {
+ "name": "extensionAttributeDefinition",
+ "type": "ExtensionAttributeDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Documentation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Event",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "IntermediateCatchEvent",
+ "superClass": [
+ "CatchEvent"
+ ]
+ },
+ {
+ "name": "IntermediateThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "EndEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "StartEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "isInterrupting",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "ThrowEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "inputSet",
+ "type": "InputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociation",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CatchEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "parallelMultiple",
+ "isAttr": true,
+ "type": "Boolean",
+ "default": false
+ },
+ {
+ "name": "outputSet",
+ "type": "OutputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataOutputAssociation",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "BoundaryEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "cancelActivity",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "attachedToRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "EventDefinition",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CancelEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "ErrorEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "errorRef",
+ "type": "Error",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TerminateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "EscalationEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "escalationRef",
+ "type": "Escalation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Escalation",
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "escalationCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ],
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CompensateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "waitForCompletion",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "activityRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TimerEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "timeDate",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeCycle",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeDuration",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "LinkEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "target",
+ "type": "LinkEventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "source",
+ "type": "LinkEventDefinition",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConditionalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "SignalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "signalRef",
+ "type": "Signal",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Signal",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ImplicitThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "DataState",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ItemAwareElement",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "itemSubjectRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "dataState",
+ "type": "DataState"
+ }
+ ]
+ },
+ {
+ "name": "DataAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "transformation",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "assignment",
+ "type": "Assignment",
+ "isMany": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "ItemAwareElement",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "ItemAwareElement",
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataInput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithOptional",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithWhileExecuting",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataOutput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithOptional",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithWhileExecuting",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "dataInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "OutputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Property",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "DataInputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "DataOutputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "InputOutputSpecification",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "inputSets",
+ "type": "InputSet",
+ "isMany": true
+ },
+ {
+ "name": "outputSets",
+ "type": "OutputSet",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "DataObject",
+ "superClass": [
+ "FlowElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "InputOutputBinding",
+ "properties": [
+ {
+ "name": "inputDataRef",
+ "type": "InputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outputDataRef",
+ "type": "OutputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Assignment",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "from",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "to",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "DataStore",
+ "superClass": [
+ "RootElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "capacity",
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "isUnlimited",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "DataStoreReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataStoreRef",
+ "type": "DataStore",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataObjectReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataObjectRef",
+ "type": "DataObject",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationLink",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ConversationAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CallConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "calledCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Conversation",
+ "superClass": [
+ "ConversationNode"
+ ]
+ },
+ {
+ "name": "SubConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "conversationNodes",
+ "type": "ConversationNode",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationNode",
+ "isAbstract": true,
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "messageFlowRefs",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "GlobalConversation",
+ "superClass": [
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "PartnerEntity",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "PartnerRole",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationProperty",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRetrievalExpression",
+ "type": "CorrelationPropertyRetrievalExpression",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Error",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "errorCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "CorrelationKey",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Expression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "isAbstract": true
+ },
+ {
+ "name": "FormalExpression",
+ "superClass": [
+ "Expression"
+ ],
+ "properties": [
+ {
+ "name": "language",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "body",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "evaluatesToTypeRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Message",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "itemRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ItemDefinition",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "itemKind",
+ "type": "ItemKind",
+ "isAttr": true
+ },
+ {
+ "name": "structureRef",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "import",
+ "type": "Import",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SequenceFlow",
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "isImmediate",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "conditionExpression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "sourceRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElementsContainer",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "laneSets",
+ "type": "LaneSet",
+ "isMany": true
+ },
+ {
+ "name": "flowElements",
+ "type": "FlowElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CallableElement",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "supportedInterfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "ioBinding",
+ "type": "InputOutputBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "FlowNode",
+ "isAbstract": true,
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "incoming",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoing",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyRetrievalExpression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "messagePath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyBinding",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataPath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Resource",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resourceParameters",
+ "type": "ResourceParameter",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameter",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isRequired",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationSubscription",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationKeyRef",
+ "type": "CorrelationKey",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationPropertyBinding",
+ "type": "CorrelationPropertyBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlow",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlowAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InteractionNode",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "incomingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Participant",
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "interfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "participantMultiplicity",
+ "type": "ParticipantMultiplicity"
+ },
+ {
+ "name": "endPointRefs",
+ "type": "EndPoint",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "processRef",
+ "type": "Process",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantMultiplicity",
+ "properties": [
+ {
+ "name": "minimum",
+ "default": 0,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "maximum",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "Collaboration",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "choreographyRef",
+ "type": "Choreography",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ },
+ {
+ "name": "messageFlowAssociations",
+ "type": "MessageFlowAssociation",
+ "isMany": true
+ },
+ {
+ "name": "conversationAssociations",
+ "type": "ConversationAssociation"
+ },
+ {
+ "name": "participants",
+ "type": "Participant",
+ "isMany": true
+ },
+ {
+ "name": "messageFlows",
+ "type": "MessageFlow",
+ "isMany": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "conversations",
+ "type": "ConversationNode",
+ "isMany": true
+ },
+ {
+ "name": "conversationLinks",
+ "type": "ConversationLink",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyActivity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "loopType",
+ "type": "ChoreographyLoopType",
+ "default": "None",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "CallChoreography",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "calledChoreographyRef",
+ "type": "Choreography",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "SubChoreography",
+ "superClass": [
+ "ChoreographyActivity",
+ "FlowElementsContainer"
+ ],
+ "properties": [
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyTask",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "messageFlowRef",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Choreography",
+ "superClass": [
+ "FlowElementsContainer",
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "GlobalChoreographyTask",
+ "superClass": [
+ "Choreography"
+ ],
+ "properties": [
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TextAnnotation",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String"
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Group",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Association",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "associationDirection",
+ "type": "AssociationDirection",
+ "isAttr": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Category",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "categoryValue",
+ "type": "CategoryValue",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Artifact",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "CategoryValue",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "categorizedFlowElements",
+ "type": "FlowElement",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "value",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Activity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "isForCompensation",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCharacteristics",
+ "type": "LoopCharacteristics"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "boundaryEventRefs",
+ "type": "BoundaryEvent",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociations",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputAssociations",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "startQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "completionQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "ServiceTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SubProcess",
+ "superClass": [
+ "Activity",
+ "FlowElementsContainer",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "triggeredByEvent",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LoopCharacteristics",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "MultiInstanceLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "isSequential",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "behavior",
+ "type": "MultiInstanceBehavior",
+ "default": "All",
+ "isAttr": true
+ },
+ {
+ "name": "loopCardinality",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopDataInputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "loopDataOutputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "inputDataItem",
+ "type": "DataInput"
+ },
+ {
+ "name": "outputDataItem",
+ "type": "DataOutput"
+ },
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "complexBehaviorDefinition",
+ "type": "ComplexBehaviorDefinition",
+ "isMany": true
+ },
+ {
+ "name": "oneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "noneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "StandardLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "testBefore",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopMaximum",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "CallActivity",
+ "superClass": [
+ "Activity"
+ ],
+ "properties": [
+ {
+ "name": "calledElement",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Task",
+ "superClass": [
+ "Activity",
+ "InteractionNode"
+ ]
+ },
+ {
+ "name": "SendTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ReceiveTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ScriptTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "scriptFormat",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "BusinessRuleTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "AdHocSubProcess",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "ordering",
+ "type": "AdHocOrdering",
+ "isAttr": true
+ },
+ {
+ "name": "cancelRemainingInstances",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "Transaction",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "protocol",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "method",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalScriptTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "scriptLanguage",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalBusinessRuleTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ComplexBehaviorDefinition",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "event",
+ "type": "ImplicitThrowEvent"
+ }
+ ]
+ },
+ {
+ "name": "ResourceRole",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "resourceRef",
+ "type": "Resource",
+ "isReference": true
+ },
+ {
+ "name": "resourceParameterBindings",
+ "type": "ResourceParameterBinding",
+ "isMany": true
+ },
+ {
+ "name": "resourceAssignmentExpression",
+ "type": "ResourceAssignmentExpression"
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameterBinding",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "parameterRef",
+ "type": "ResourceParameter",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceAssignmentExpression",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Import",
+ "properties": [
+ {
+ "name": "importType",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "location",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "namespace",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Definitions",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "targetNamespace",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "expressionLanguage",
+ "default": "http://www.w3.org/1999/XPath",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "typeLanguage",
+ "default": "http://www.w3.org/2001/XMLSchema",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "imports",
+ "type": "Import",
+ "isMany": true
+ },
+ {
+ "name": "extensions",
+ "type": "Extension",
+ "isMany": true
+ },
+ {
+ "name": "rootElements",
+ "type": "RootElement",
+ "isMany": true
+ },
+ {
+ "name": "diagrams",
+ "isMany": true,
+ "type": "bpmndi:BPMNDiagram"
+ },
+ {
+ "name": "exporter",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "relationships",
+ "type": "Relationship",
+ "isMany": true
+ },
+ {
+ "name": "exporterVersion",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ProcessType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Public"
+ },
+ {
+ "name": "Private"
+ }
+ ]
+ },
+ {
+ "name": "GatewayDirection",
+ "literalValues": [
+ {
+ "name": "Unspecified"
+ },
+ {
+ "name": "Converging"
+ },
+ {
+ "name": "Diverging"
+ },
+ {
+ "name": "Mixed"
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGatewayType",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "RelationshipDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Forward"
+ },
+ {
+ "name": "Backward"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "ItemKind",
+ "literalValues": [
+ {
+ "name": "Physical"
+ },
+ {
+ "name": "Information"
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyLoopType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Standard"
+ },
+ {
+ "name": "MultiInstanceSequential"
+ },
+ {
+ "name": "MultiInstanceParallel"
+ }
+ ]
+ },
+ {
+ "name": "AssociationDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "MultiInstanceBehavior",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "All"
+ },
+ {
+ "name": "Complex"
+ }
+ ]
+ },
+ {
+ "name": "AdHocOrdering",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Sequential"
+ }
+ ]
+ }
+ ],
+ "prefix": "bpmn",
+ "xml": {
+ "tagAlias": "lowerCase",
+ "typePrefix": "t"
+ }
+}
+},{}],33:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMNDI",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
+ "types": [
+ {
+ "name": "BPMNDiagram",
+ "properties": [
+ {
+ "name": "plane",
+ "type": "BPMNPlane",
+ "redefines": "di:Diagram#rootElement"
+ },
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isMany": true
+ }
+ ],
+ "superClass": [
+ "di:Diagram"
+ ]
+ },
+ {
+ "name": "BPMNPlane",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ }
+ ],
+ "superClass": [
+ "di:Plane"
+ ]
+ },
+ {
+ "name": "BPMNShape",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "isHorizontal",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isExpanded",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isMarkerVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "isMessageVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "participantBandKind",
+ "type": "ParticipantBandKind",
+ "isAttr": true
+ },
+ {
+ "name": "choreographyActivityShape",
+ "type": "BPMNShape",
+ "isAttr": true,
+ "isReference": true
+ }
+ ],
+ "superClass": [
+ "di:LabeledShape"
+ ]
+ },
+ {
+ "name": "BPMNEdge",
+ "properties": [
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "sourceElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#source"
+ },
+ {
+ "name": "targetElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#target"
+ },
+ {
+ "name": "messageVisibleKind",
+ "type": "MessageVisibleKind",
+ "isAttr": true,
+ "default": "initiating"
+ }
+ ],
+ "superClass": [
+ "di:LabeledEdge"
+ ]
+ },
+ {
+ "name": "BPMNLabel",
+ "properties": [
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isAttr": true,
+ "isReference": true,
+ "redefines": "di:DiagramElement#style"
+ }
+ ],
+ "superClass": [
+ "di:Label"
+ ]
+ },
+ {
+ "name": "BPMNLabelStyle",
+ "properties": [
+ {
+ "name": "font",
+ "type": "dc:Font"
+ }
+ ],
+ "superClass": [
+ "di:Style"
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ParticipantBandKind",
+ "literalValues": [
+ {
+ "name": "top_initiating"
+ },
+ {
+ "name": "middle_initiating"
+ },
+ {
+ "name": "bottom_initiating"
+ },
+ {
+ "name": "top_non_initiating"
+ },
+ {
+ "name": "middle_non_initiating"
+ },
+ {
+ "name": "bottom_non_initiating"
+ }
+ ]
+ },
+ {
+ "name": "MessageVisibleKind",
+ "literalValues": [
+ {
+ "name": "initiating"
+ },
+ {
+ "name": "non_initiating"
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "bpmndi"
+}
+},{}],34:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DC",
+ "uri": "http://www.omg.org/spec/DD/20100524/DC",
+ "types": [
+ {
+ "name": "Boolean"
+ },
+ {
+ "name": "Integer"
+ },
+ {
+ "name": "Real"
+ },
+ {
+ "name": "String"
+ },
+ {
+ "name": "Font",
+ "properties": [
+ {
+ "name": "name",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "size",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "isBold",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isItalic",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isUnderline",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isStrikeThrough",
+ "type": "Boolean",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Point",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Bounds",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "width",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "height",
+ "type": "Real",
+ "isAttr": true
+ }
+ ]
+ }
+ ],
+ "prefix": "dc",
+ "associations": []
+}
+},{}],35:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DI",
+ "uri": "http://www.omg.org/spec/DD/20100524/DI",
+ "types": [
+ {
+ "name": "DiagramElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "extension",
+ "type": "Extension"
+ },
+ {
+ "name": "owningDiagram",
+ "type": "Diagram",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "owningElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "modelElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "style",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "ownedElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Node",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ]
+ },
+ {
+ "name": "Edge",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ],
+ "properties": [
+ {
+ "name": "source",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "target",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "waypoint",
+ "isUnique": false,
+ "isMany": true,
+ "type": "dc:Point",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Diagram",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "rootElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resolution",
+ "isAttr": true,
+ "type": "Real"
+ },
+ {
+ "name": "ownedStyle",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Shape",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Plane",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "planeElement",
+ "type": "DiagramElement",
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledEdge",
+ "isAbstract": true,
+ "superClass": [
+ "Edge"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledShape",
+ "isAbstract": true,
+ "superClass": [
+ "Shape"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Label",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Style",
+ "isAbstract": true
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "di",
+ "xml": {
+ "tagAlias": "lowerCase"
+ }
+}
+},{}],36:[function(_dereq_,module,exports){
+module.exports = _dereq_(37);
+},{"37":37}],37:[function(_dereq_,module,exports){
+'use strict';
+
+var di = _dereq_(76);
+
+
+/**
+ * Bootstrap an injector from a list of modules, instantiating a number of default components
+ *
+ * @ignore
+ * @param {Array<didi.Module>} bootstrapModules
+ *
+ * @return {didi.Injector} a injector to use to access the components
+ */
+function bootstrap(bootstrapModules) {
+
+ var modules = [],
+ components = [];
+
+ function hasModule(m) {
+ return modules.indexOf(m) >= 0;
+ }
+
+ function addModule(m) {
+ modules.push(m);
+ }
+
+ function visit(m) {
+ if (hasModule(m)) {
+ return;
+ }
+
+ (m.__depends__ || []).forEach(visit);
+
+ if (hasModule(m)) {
+ return;
+ }
+
+ addModule(m);
+
+ (m.__init__ || []).forEach(function(c) {
+ components.push(c);
+ });
+ }
+
+ bootstrapModules.forEach(visit);
+
+ var injector = new di.Injector(modules);
+
+ components.forEach(function(c) {
+
+ try {
+ // eagerly resolve component (fn or string)
+ injector[typeof c === 'string' ? 'get' : 'invoke'](c);
+ } catch (e) {
+ console.error('Failed to instantiate component');
+ console.error(e.stack);
+
+ throw e;
+ }
+ });
+
+ return injector;
+}
+
+/**
+ * Creates an injector from passed options.
+ *
+ * @ignore
+ * @param {Object} options
+ * @return {didi.Injector}
+ */
+function createInjector(options) {
+
+ options = options || {};
+
+ var configModule = {
+ 'config': ['value', options]
+ };
+
+ var coreModule = _dereq_(43);
+
+ var modules = [ configModule, coreModule ].concat(options.modules || []);
+
+ return bootstrap(modules);
+}
+
+
+/**
+ * The main diagram-js entry point that bootstraps the diagram with the given
+ * configuration.
+ *
+ * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.
+ *
+ * @class djs.Diagram
+ * @memberOf djs
+ * @constructor
+ *
+ * @example
+ *
+ * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>
+ *
+ * // plug-in implemenentation
+ * function MyLoggingPlugin(eventBus) {
+ * eventBus.on('shape.added', function(event) {
+ * console.log('shape ', event.shape, ' was added to the diagram');
+ * });
+ * }
+ *
+ * // export as module
+ * module.exports = {
+ * __init__: [ 'myLoggingPlugin' ],
+ * myLoggingPlugin: [ 'type', MyLoggingPlugin ]
+ * };
+ *
+ *
+ * // instantiate the diagram with the new plug-in
+ *
+ * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });
+ *
+ * diagram.invoke([ 'canvas', function(canvas) {
+ * // add shape to drawing canvas
+ * canvas.addShape({ x: 10, y: 10 });
+ * });
+ *
+ * // 'shape ... was added to the diagram' logged to console
+ *
+ * @param {Object} options
+ * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram
+ * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with
+ */
+function Diagram(options, injector) {
+
+ // create injector unless explicitly specified
+ this.injector = injector = injector || createInjector(options);
+
+ // API
+
+ /**
+ * Resolves a diagram service
+ *
+ * @method Diagram#get
+ *
+ * @param {String} name the name of the diagram service to be retrieved
+ * @param {Object} [locals] a number of locals to use to resolve certain dependencies
+ */
+ this.get = injector.get;
+
+ /**
+ * Executes a function into which diagram services are injected
+ *
+ * @method Diagram#invoke
+ *
+ * @param {Function|Object[]} fn the function to resolve
+ * @param {Object} locals a number of locals to use to resolve certain dependencies
+ */
+ this.invoke = injector.invoke;
+
+ // init
+
+ // indicate via event
+
+
+ /**
+ * An event indicating that all plug-ins are loaded.
+ *
+ * Use this event to fire other events to interested plug-ins
+ *
+ * @memberOf Diagram
+ *
+ * @event diagram.init
+ *
+ * @example
+ *
+ * eventBus.on('diagram.init', function() {
+ * eventBus.fire('my-custom-event', { foo: 'BAR' });
+ * });
+ *
+ * @type {Object}
+ */
+ this.get('eventBus').fire('diagram.init');
+}
+
+module.exports = Diagram;
+
+
+/**
+ * Destroys the diagram
+ *
+ * @method Diagram#destroy
+ */
+Diagram.prototype.destroy = function() {
+ this.get('eventBus').fire('diagram.destroy');
+};
+},{"43":43,"76":76}],38:[function(_dereq_,module,exports){
+'use strict';
+
+var isNumber = _dereq_(169),
+ assign = _dereq_(175),
+ forEach = _dereq_(84);
+
+var Collections = _dereq_(63);
+
+var Snap = _dereq_(74);
+
+function round(number, resolution) {
+ return Math.round(number * resolution) / resolution;
+}
+
+function ensurePx(number) {
+ return isNumber(number) ? number + 'px' : number;
+}
+
+/**
+ * Creates a HTML container element for a SVG element with
+ * the given configuration
+ *
+ * @param {Object} options
+ * @return {HTMLElement} the container element
+ */
+function createContainer(options) {
+
+ options = assign({}, { width: '100%', height: '100%' }, options);
+
+ var container = options.container || document.body;
+
+ // create a <div> around the svg element with the respective size
+ // this way we can always get the correct container size
+ // (this is impossible for <svg> elements at the moment)
+ var parent = document.createElement('div');
+ parent.setAttribute('class', 'djs-container');
+
+ assign(parent.style, {
+ position: 'relative',
+ overflow: 'hidden',
+ width: ensurePx(options.width),
+ height: ensurePx(options.height)
+ });
+
+ container.appendChild(parent);
+
+ return parent;
+}
+
+function createGroup(parent, cls) {
+ return parent.group().attr({ 'class' : cls });
+}
+
+var BASE_LAYER = 'base';
+
+
+/**
+ * The main drawing canvas.
+ *
+ * @class
+ * @constructor
+ *
+ * @emits Canvas#canvas.init
+ *
+ * @param {Object} config
+ * @param {EventBus} eventBus
+ * @param {GraphicsFactory} graphicsFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._elementRegistry = elementRegistry;
+ this._graphicsFactory = graphicsFactory;
+
+ this._init(config || {});
+}
+
+Canvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];
+
+module.exports = Canvas;
+
+
+Canvas.prototype._init = function(config) {
+
+ // Creates a <svg> element that is wrapped into a <div>.
+ // This way we are always able to correctly figure out the size of the svg element
+ // by querying the parent node.
+ //
+ // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
+ //
+ // <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
+ // <svg width="100%" height="100%">
+ // ...
+ // </svg>
+ // </div>
+
+ // html container
+ var eventBus = this._eventBus,
+
+ container = createContainer(config),
+ svg = Snap.createSnapAt('100%', '100%', container),
+ viewport = createGroup(svg, 'viewport'),
+
+ self = this;
+
+ this._container = container;
+ this._svg = svg;
+ this._viewport = viewport;
+ this._layers = {};
+
+ eventBus.on('diagram.init', function(event) {
+
+ /**
+ * An event indicating that the canvas is ready to be drawn on.
+ *
+ * @memberOf Canvas
+ *
+ * @event canvas.init
+ *
+ * @type {Object}
+ * @property {Snap<SVGSVGElement>} svg the created svg element
+ * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes
+ */
+ eventBus.fire('canvas.init', { svg: svg, viewport: viewport });
+ });
+
+ eventBus.on('diagram.destroy', function() {
+
+ var parent = self._container.parentNode;
+
+ if (parent) {
+ parent.removeChild(container);
+ }
+
+ eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });
+
+ self._svg.remove();
+
+ self._svg = self._container = self._layers = self._viewport = null;
+ });
+
+};
+
+/**
+ * Returns the default layer on which
+ * all elements are drawn.
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getDefaultLayer = function() {
+ return this.getLayer(BASE_LAYER);
+};
+
+/**
+ * Returns a layer that is used to draw elements
+ * or annotations on it.
+ *
+ * @param {String} name
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getLayer = function(name) {
+
+ if (!name) {
+ throw new Error('must specify a name');
+ }
+
+ var layer = this._layers[name];
+ if (!layer) {
+ layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
+ }
+
+ return layer;
+};
+
+
+/**
+ * Returns the html element that encloses the
+ * drawing canvas.
+ *
+ * @return {DOMNode}
+ */
+Canvas.prototype.getContainer = function() {
+ return this._container;
+};
+
+
+/////////////// markers ///////////////////////////////////
+
+Canvas.prototype._updateMarker = function(element, marker, add) {
+ var container;
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ // we need to access all
+ container = this._elementRegistry._elements[element.id];
+
+ if (!container) {
+ return;
+ }
+
+ forEach([ container.gfx, container.secondaryGfx ], function(gfx) {
+ if (gfx) {
+ // invoke either addClass or removeClass based on mode
+ gfx[add ? 'addClass' : 'removeClass'](marker);
+ }
+ });
+
+ /**
+ * An event indicating that a marker has been updated for an element
+ *
+ * @event element.marker.update
+ * @type {Object}
+ * @property {djs.model.Element} element the shape
+ * @property {Object} gfx the graphical representation of the shape
+ * @property {String} marker
+ * @property {Boolean} add true if the marker was added, false if it got removed
+ */
+ this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });
+};
+
+
+/**
+ * Adds a marker to an element (basically a css class).
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @example
+ * canvas.addMarker('foo', 'some-marker');
+ *
+ * var fooGfx = canvas.getGraphics('foo');
+ *
+ * fooGfx; // <g class="... some-marker"> ... </g>
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.addMarker = function(element, marker) {
+ this._updateMarker(element, marker, true);
+};
+
+
+/**
+ * Remove a marker from an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.removeMarker = function(element, marker) {
+ this._updateMarker(element, marker, false);
+};
+
+/**
+ * Check the existence of a marker on element.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.hasMarker = function(element, marker) {
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ var gfx = this.getGraphics(element);
+
+ return gfx && gfx.hasClass(marker);
+};
+
+/**
+ * Toggles a marker on an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.toggleMarker = function(element, marker) {
+ if(this.hasMarker(element, marker)) {
+ this.removeMarker(element, marker);
+ } else {
+ this.addMarker(element, marker);
+ }
+};
+
+Canvas.prototype.getRootElement = function() {
+ if (!this._rootElement) {
+ this.setRootElement({ id: '__implicitroot' });
+ }
+
+ return this._rootElement;
+};
+
+
+
+//////////////// root element handling ///////////////////////////
+
+/**
+ * Sets a given element as the new root element for the canvas
+ * and returns the new root element.
+ *
+ * @param {Object|djs.model.Root} element
+ * @param {Boolean} [override] whether to override the current root element, if any
+ *
+ * @return {Object|djs.model.Root} new root element
+ */
+Canvas.prototype.setRootElement = function(element, override) {
+
+ this._ensureValidId(element);
+
+ var oldRoot = this._rootElement,
+ elementRegistry = this._elementRegistry,
+ eventBus = this._eventBus;
+
+ if (oldRoot) {
+ if (!override) {
+ throw new Error('rootElement already set, need to specify override');
+ }
+
+ // simulate element remove event sequence
+ eventBus.fire('root.remove', { element: oldRoot });
+ eventBus.fire('root.removed', { element: oldRoot });
+
+ elementRegistry.remove(oldRoot);
+ }
+
+ var gfx = this.getDefaultLayer();
+
+ // resemble element add event sequence
+ eventBus.fire('root.add', { element: element });
+
+ elementRegistry.add(element, gfx, this._svg);
+
+ eventBus.fire('root.added', { element: element, gfx: gfx });
+
+ this._rootElement = element;
+
+ return element;
+};
+
+
+
+///////////// add functionality ///////////////////////////////
+
+Canvas.prototype._ensureValidId = function(element) {
+ if (!element.id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elementRegistry.get(element.id)) {
+ throw new Error('element with id ' + element.id + ' already exists');
+ }
+};
+
+Canvas.prototype._setParent = function(element, parent) {
+ Collections.add(parent.children, element);
+ element.parent = parent;
+};
+
+/**
+ * Adds an element to the canvas.
+ *
+ * This wires the parent <-> child relationship between the element and
+ * a explicitly specified parent or an implicit root element.
+ *
+ * During add it emits the events
+ *
+ * * <{type}.add> (element, parent)
+ * * <{type}.added> (element, gfx)
+ *
+ * Extensions may hook into these events to perform their magic.
+ *
+ * @param {String} type
+ * @param {Object|djs.model.Base} element
+ * @param {Object|djs.model.Base} [parent]
+ *
+ * @return {Object|djs.model.Base} the added element
+ */
+Canvas.prototype._addElement = function(type, element, parent) {
+
+ parent = parent || this.getRootElement();
+
+ var eventBus = this._eventBus,
+ graphicsFactory = this._graphicsFactory;
+
+ this._ensureValidId(element);
+
+ eventBus.fire(type + '.add', { element: element, parent: parent });
+
+ this._setParent(element, parent);
+
+ // create graphics
+ var gfx = graphicsFactory.create(type, element);
+
+ this._elementRegistry.add(element, gfx);
+
+ // update its visual
+ graphicsFactory.update(type, element, gfx);
+
+ eventBus.fire(type + '.added', { element: element, gfx: gfx });
+
+ return element;
+};
+
+/**
+ * Adds a shape to the canvas
+ *
+ * @param {Object|djs.model.Shape} shape to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Shape} the added shape
+ */
+Canvas.prototype.addShape = function(shape, parent) {
+ return this._addElement('shape', shape, parent);
+};
+
+/**
+ * Adds a connection to the canvas
+ *
+ * @param {Object|djs.model.Connection} connection to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Connection} the added connection
+ */
+Canvas.prototype.addConnection = function(connection, parent) {
+ return this._addElement('connection', connection, parent);
+};
+
+
+/**
+ * Internal remove element
+ */
+Canvas.prototype._removeElement = function(element, type) {
+
+ var elementRegistry = this._elementRegistry,
+ graphicsFactory = this._graphicsFactory,
+ eventBus = this._eventBus;
+
+ element = elementRegistry.get(element.id || element);
+
+ if (!element) {
+ // element was removed already
+ return;
+ }
+
+ eventBus.fire(type + '.remove', { element: element });
+
+ graphicsFactory.remove(element);
+
+ // unset parent <-> child relationship
+ Collections.remove(element.parent && element.parent.children, element);
+ element.parent = null;
+
+ eventBus.fire(type + '.removed', { element: element });
+
+ elementRegistry.remove(element);
+
+ return element;
+};
+
+
+/**
+ * Removes a shape from the canvas
+ *
+ * @param {String|djs.model.Shape} shape or shape id to be removed
+ *
+ * @return {djs.model.Shape} the removed shape
+ */
+Canvas.prototype.removeShape = function(shape) {
+
+ /**
+ * An event indicating that a shape is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.remove
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+
+ /**
+ * An event indicating that a shape has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.removed
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+ return this._removeElement(shape, 'shape');
+};
+
+
+/**
+ * Removes a connection from the canvas
+ *
+ * @param {String|djs.model.Connection} connection or connection id to be removed
+ *
+ * @return {djs.model.Connection} the removed connection
+ */
+Canvas.prototype.removeConnection = function(connection) {
+
+ /**
+ * An event indicating that a connection is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.remove
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+
+ /**
+ * An event indicating that a connection has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.removed
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+ return this._removeElement(connection, 'connection');
+};
+
+
+/**
+ * Sends a shape to the front.
+ *
+ * This method takes parent / child relationships between shapes into account
+ * and makes sure that children are properly handled, too.
+ *
+ * @param {djs.model.Shape} shape descriptor of the shape to be sent to front
+ * @param {boolean} [bubble=true] whether to send parent shapes to front, too
+ */
+Canvas.prototype.sendToFront = function(shape, bubble) {
+
+ if (bubble !== false) {
+ bubble = true;
+ }
+
+ if (bubble && shape.parent) {
+ this.sendToFront(shape.parent);
+ }
+
+ forEach(shape.children, function(child) {
+ this.sendToFront(child, false);
+ }, this);
+
+ var gfx = this.getGraphics(shape),
+ gfxParent = gfx.parent();
+
+ gfx.remove().appendTo(gfxParent);
+};
+
+
+/**
+ * Return the graphical object underlaying a certain diagram element
+ *
+ * @param {String|djs.model.Base} element descriptor of the element
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+Canvas.prototype.getGraphics = function(element, secondary) {
+ return this._elementRegistry.getGraphics(element, secondary);
+};
+
+
+Canvas.prototype._fireViewboxChange = function() {
+ this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });
+};
+
+
+/**
+ * Gets or sets the view box of the canvas, i.e. the area that is currently displayed
+ *
+ * @param {Object} [box] the new view box to set
+ * @param {Number} box.x the top left X coordinate of the canvas visible in view box
+ * @param {Number} box.y the top left Y coordinate of the canvas visible in view box
+ * @param {Number} box.width the visible width
+ * @param {Number} box.height
+ *
+ * @example
+ *
+ * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
+ *
+ * // sets the visible area of the diagram to (100|100) -> (600|100)
+ * // and and scales it according to the diagram width
+ *
+ * @return {Object} the current view box
+ */
+Canvas.prototype.viewbox = function(box) {
+
+ if (box === undefined && this._cachedViewbox) {
+ return this._cachedViewbox;
+ }
+
+ var viewport = this._viewport,
+ innerBox,
+ outerBox = this.getSize(),
+ matrix,
+ scale,
+ x, y;
+
+ if (!box) {
+ // compute the inner box based on the
+ // diagrams default layer. This allows us to exclude
+ // external components, such as overlays
+ innerBox = this.getDefaultLayer().getBBox(true);
+
+ matrix = viewport.transform().localMatrix;
+ scale = round(matrix.a, 1000);
+
+ x = round(-matrix.e || 0, 1000);
+ y = round(-matrix.f || 0, 1000);
+
+ box = this._cachedViewbox = {
+ x: x ? x / scale : 0,
+ y: y ? y / scale : 0,
+ width: outerBox.width / scale,
+ height: outerBox.height / scale,
+ scale: scale,
+ inner: {
+ width: innerBox.width,
+ height: innerBox.height,
+ x: innerBox.x,
+ y: innerBox.y
+ },
+ outer: outerBox
+ };
+
+ return box;
+ } else {
+ scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
+
+ matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
+ viewport.transform(matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return box;
+};
+
+
+/**
+ * Gets or sets the scroll of the canvas.
+ *
+ * @param {Object} [delta] the new scroll to apply.
+ *
+ * @param {Number} [delta.dx]
+ * @param {Number} [delta.dy]
+ */
+Canvas.prototype.scroll = function(delta) {
+
+ var node = this._viewport.node;
+ var matrix = node.getCTM();
+
+ if (delta) {
+ delta = assign({ dx: 0, dy: 0 }, delta || {});
+
+ matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
+
+ setCTM(node, matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return { x: matrix.e, y: matrix.f };
+};
+
+
+/**
+ * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.
+ *
+ * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,
+ * or `fit-viewport` to adjust the size to fit the current viewport
+ * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null
+ *
+ * @return {Number} the current scale
+ */
+Canvas.prototype.zoom = function(newScale, center) {
+
+ if (newScale === 'fit-viewport') {
+ return this._fitViewport(center);
+ }
+
+ var vbox = this.viewbox();
+
+ if (newScale === undefined) {
+ return vbox.scale;
+ }
+
+ var outer = vbox.outer;
+
+ if (center === 'auto') {
+ center = {
+ x: outer.width / 2,
+ y: outer.height / 2
+ };
+ }
+
+ var matrix = this._setZoom(newScale, center);
+
+ this._fireViewboxChange();
+
+ return round(matrix.a, 1000);
+};
+
+function setCTM(node, m) {
+ var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
+ node.setAttribute('transform', mstr);
+}
+
+Canvas.prototype._fitViewport = function(center) {
+
+ var vbox = this.viewbox(),
+ outer = vbox.outer,
+ inner = vbox.inner,
+ newScale,
+ newViewbox;
+
+ // display the complete diagram without zooming in.
+ // instead of relying on internal zoom, we perform a
+ // hard reset on the canvas viewbox to realize this
+ //
+ // if diagram does not need to be zoomed in, we focus it around
+ // the diagram origin instead
+
+ if (inner.x >= 0 &&
+ inner.y >= 0 &&
+ inner.x + inner.width <= outer.width &&
+ inner.y + inner.height <= outer.height &&
+ !center) {
+
+ newViewbox = {
+ x: 0,
+ y: 0,
+ width: Math.max(inner.width + inner.x, outer.width),
+ height: Math.max(inner.height + inner.y, outer.height)
+ };
+ } else {
+
+ newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
+ newViewbox = {
+ x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
+ y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
+ width: outer.width / newScale,
+ height: outer.height / newScale
+ };
+ }
+
+ this.viewbox(newViewbox);
+
+ return this.viewbox().scale;
+};
+
+
+Canvas.prototype._setZoom = function(scale, center) {
+
+ var svg = this._svg.node,
+ viewport = this._viewport.node;
+
+ var matrix = svg.createSVGMatrix();
+ var point = svg.createSVGPoint();
+
+ var centerPoint,
+ originalPoint,
+ currentMatrix,
+ scaleMatrix,
+ newMatrix;
+
+ currentMatrix = viewport.getCTM();
+
+
+ var currentScale = currentMatrix.a;
+
+ if (center) {
+ centerPoint = assign(point, center);
+
+ // revert applied viewport transformations
+ originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
+
+ // create scale matrix
+ scaleMatrix = matrix
+ .translate(originalPoint.x, originalPoint.y)
+ .scale(1 / currentScale * scale)
+ .translate(-originalPoint.x, -originalPoint.y);
+
+ newMatrix = currentMatrix.multiply(scaleMatrix);
+ } else {
+ newMatrix = matrix.scale(scale);
+ }
+
+ setCTM(this._viewport.node, newMatrix);
+
+ return newMatrix;
+};
+
+
+/**
+ * Returns the size of the canvas
+ *
+ * @return {Dimensions}
+ */
+Canvas.prototype.getSize = function () {
+ return {
+ width: this._container.clientWidth,
+ height: this._container.clientHeight
+ };
+};
+
+
+/**
+ * Return the absolute bounding box for the given element
+ *
+ * The absolute bounding box may be used to display overlays in the
+ * callers (browser) coordinate system rather than the zoomed in/out
+ * canvas coordinates.
+ *
+ * @param {ElementDescriptor} element
+ * @return {Bounds} the absolute bounding box
+ */
+Canvas.prototype.getAbsoluteBBox = function(element) {
+ var vbox = this.viewbox();
+ var bbox;
+
+ // connection
+ // use svg bbox
+ if (element.waypoints) {
+ var gfx = this.getGraphics(element);
+
+ var transformBBox = gfx.getBBox(true);
+ bbox = gfx.getBBox();
+
+ bbox.x -= transformBBox.x;
+ bbox.y -= transformBBox.y;
+
+ bbox.width += 2 * transformBBox.x;
+ bbox.height += 2 * transformBBox.y;
+ }
+ // shapes
+ // use data
+ else {
+ bbox = element;
+ }
+
+ var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
+ var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
+
+ var width = bbox.width * vbox.scale;
+ var height = bbox.height * vbox.scale;
+
+ return {
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ };
+};
+
+},{"169":169,"175":175,"63":63,"74":74,"84":84}],39:[function(_dereq_,module,exports){
+'use strict';
+
+var Model = _dereq_(57);
+
+
+/**
+ * A factory for diagram-js shapes
+ */
+function ElementFactory() {
+ this._uid = 12;
+}
+
+module.exports = ElementFactory;
+
+
+ElementFactory.prototype.createRoot = function(attrs) {
+ return this.create('root', attrs);
+};
+
+ElementFactory.prototype.createLabel = function(attrs) {
+ return this.create('label', attrs);
+};
+
+ElementFactory.prototype.createShape = function(attrs) {
+ return this.create('shape', attrs);
+};
+
+ElementFactory.prototype.createConnection = function(attrs) {
+ return this.create('connection', attrs);
+};
+
+/**
+ * Create a model element with the given type and
+ * a number of pre-set attributes.
+ *
+ * @param {String} type
+ * @param {Object} attrs
+ * @return {djs.model.Base} the newly created model instance
+ */
+ElementFactory.prototype.create = function(type, attrs) {
+
+ attrs = attrs || {};
+
+ if (!attrs.id) {
+ attrs.id = type + '_' + (this._uid++);
+ }
+
+ return Model.create(type, attrs);
+};
+},{"57":57}],40:[function(_dereq_,module,exports){
+'use strict';
+
+var ELEMENT_ID = 'data-element-id';
+
+
+/**
+ * @class
+ *
+ * A registry that keeps track of all shapes in the diagram.
+ */
+function ElementRegistry() {
+ this._elements = {};
+}
+
+module.exports = ElementRegistry;
+
+/**
+ * Register a pair of (element, gfx, (secondaryGfx)).
+ *
+ * @param {djs.model.Base} element
+ * @param {Snap<SVGElement>} gfx
+ * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too
+ */
+ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
+
+ var id = element.id;
+
+ this._validateId(id);
+
+ // associate dom node with element
+ gfx.attr(ELEMENT_ID, id);
+
+ if (secondaryGfx) {
+ secondaryGfx.attr(ELEMENT_ID, id);
+ }
+
+ this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
+};
+
+/**
+ * Removes an element from the registry.
+ *
+ * @param {djs.model.Base} element
+ */
+ElementRegistry.prototype.remove = function(element) {
+ var elements = this._elements,
+ id = element.id || element,
+ container = id && elements[id];
+
+ if (container) {
+
+ // unset element id on gfx
+ container.gfx.attr(ELEMENT_ID, null);
+
+ if (container.secondaryGfx) {
+ container.secondaryGfx.attr(ELEMENT_ID, null);
+ }
+
+ delete elements[id];
+ }
+};
+
+/**
+ * Update the id of an element
+ *
+ * @param {djs.model.Base} element
+ * @param {String} newId
+ */
+ElementRegistry.prototype.updateId = function(element, newId) {
+
+ this._validateId(newId);
+
+ if (typeof element === 'string') {
+ element = this.get(element);
+ }
+
+ var gfx = this.getGraphics(element),
+ secondaryGfx = this.getGraphics(element, true);
+
+ this.remove(element);
+
+ element.id = newId;
+
+ this.add(element, gfx, secondaryGfx);
+};
+
+/**
+ * Return the model element for a given id or graphics.
+ *
+ * @example
+ *
+ * elementRegistry.get('SomeElementId_1');
+ * elementRegistry.get(gfx);
+ *
+ *
+ * @param {String|SVGElement} filter for selecting the element
+ *
+ * @return {djs.model.Base}
+ */
+ElementRegistry.prototype.get = function(filter) {
+ var id;
+
+ if (typeof filter === 'string') {
+ id = filter;
+ } else {
+ id = filter && filter.attr(ELEMENT_ID);
+ }
+
+ var container = this._elements[id];
+ return container && container.element;
+};
+
+/**
+ * Return all elements that match a given filter function.
+ *
+ * @param {Function} fn
+ *
+ * @return {Array<djs.model.Base>}
+ */
+ElementRegistry.prototype.filter = function(fn) {
+
+ var filtered = [];
+
+ this.forEach(function(element, gfx) {
+ if(fn(element, gfx)) {
+ filtered.push(element);
+ }
+ });
+
+ return filtered;
+};
+
+/**
+ * Iterate over all diagram elements.
+ *
+ * @param {Function} fn
+ */
+ElementRegistry.prototype.forEach = function(fn) {
+
+ var map = this._elements;
+
+ Object.keys(map).forEach(function(id) {
+ var container = map[id],
+ element = container.element,
+ gfx = container.gfx;
+
+ return fn(element, gfx);
+ });
+};
+
+/**
+ * Return the graphical representation of an element or its id.
+ *
+ * @example
+ * elementRegistry.getGraphics('SomeElementId_1');
+ * elementRegistry.getGraphics(rootElement); // <g ...>
+ *
+ * elementRegistry.getGraphics(rootElement, true); // <svg ...>
+ *
+ *
+ * @param {String|djs.model.Base} filter
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+ElementRegistry.prototype.getGraphics = function(filter, secondary) {
+ var id = filter.id || filter;
+
+ var container = this._elements[id];
+ return container && (secondary ? container.secondaryGfx : container.gfx);
+};
+
+/**
+ * Validate the suitability of the given id and signals a problem
+ * with an exception.
+ *
+ * @param {String} id
+ *
+ * @throws {Error} if id is empty or already assigned
+ */
+ElementRegistry.prototype._validateId = function(id) {
+ if (!id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elements[id]) {
+ throw new Error('element with id ' + id + ' already added');
+ }
+};
+},{}],41:[function(_dereq_,module,exports){
+'use strict';
+
+var isFunction = _dereq_(167),
+ isArray = _dereq_(166),
+ isNumber = _dereq_(169),
+ assign = _dereq_(175);
+
+var DEFAULT_PRIORITY = 1000;
+
+
+/**
+ * A general purpose event bus.
+ *
+ * This component is used to communicate across a diagram instance.
+ * Other parts of a diagram can use it to listen to and broadcast events.
+ *
+ *
+ * ## Registering for Events
+ *
+ * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
+ * methods to register for events. {@link EventBus#off} can be used to
+ * remove event registrations. Listeners receive an instance of {@link Event}
+ * as the first argument. It allows them to hook into the event execution.
+ *
+ * ```javascript
+ *
+ * // listen for event
+ * eventBus.on('foo', function(event) {
+ *
+ * // access event type
+ * event.type; // 'foo'
+ *
+ * // stop propagation to other listeners
+ * event.stopPropagation();
+ *
+ * // prevent event default
+ * event.preventDefault();
+ * });
+ *
+ * // listen for event with custom payload
+ * eventBus.on('bar', function(event, payload) {
+ * console.log(payload);
+ * });
+ *
+ * // listen for event returning value
+ * eventBus.on('foobar', function(event) {
+ *
+ * // stop event propagation + prevent default
+ * return false;
+ *
+ * // stop event propagation + return custom result
+ * return {
+ * complex: 'listening result'
+ * };
+ * });
+ *
+ *
+ * // listen with custom priority (default=1000, higher is better)
+ * eventBus.on('priorityfoo', 1500, function(event) {
+ * console.log('invoked first!');
+ * });
+ * ```
+ *
+ *
+ * ## Emitting Events
+ *
+ * Events can be emitted via the event bus using {@link EventBus#fire}.
+ *
+ * ```javascript
+ *
+ * // false indicates that the default action
+ * // was prevented by listeners
+ * if (eventBus.fire('foo') === false) {
+ * console.log('default has been prevented!');
+ * };
+ *
+ *
+ * // custom args + return value listener
+ * eventBus.on('sum', function(event, a, b) {
+ * return a + b;
+ * });
+ *
+ * // you can pass custom arguments + retrieve result values.
+ * var sum = eventBus.fire('sum', 1, 2);
+ * console.log(sum); // 3
+ * ```
+ */
+function EventBus() {
+ this._listeners = {};
+
+ // cleanup on destroy
+
+ var self = this;
+
+ // destroy on lowest priority to allow
+ // message passing until the bitter end
+ this.on('diagram.destroy', 1, function() {
+ self._listeners = null;
+ });
+}
+
+module.exports = EventBus;
+
+
+/**
+ * Register an event listener for events with the given name.
+ *
+ * The callback will be invoked with `event, ...additionalArguments`
+ * that have been passed to {@link EventBus#fire}.
+ *
+ * Returning false from a listener will prevent the events default action
+ * (if any is specified). To stop an event from being processed further in
+ * other listeners execute {@link Event#stopPropagation}.
+ *
+ * Returning anything but `undefined` from a listener will stop the listener propagation.
+ *
+ * @param {String|Array<String>} events
+ * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher
+ * @param {Function} callback
+ */
+EventBus.prototype.on = function(events, priority, callback) {
+
+ events = isArray(events) ? events : [ events ];
+
+ if (isFunction(priority)) {
+ callback = priority;
+ priority = DEFAULT_PRIORITY;
+ }
+
+ if (!isNumber(priority)) {
+ throw new Error('priority must be a number');
+ }
+
+ var self = this,
+ listener = { priority: priority, callback: callback };
+
+ events.forEach(function(e) {
+ self._addListener(e, listener);
+ });
+};
+
+
+/**
+ * Register an event listener that is executed only once.
+ *
+ * @param {String} event the event name to register for
+ * @param {Function} callback the callback to execute
+ */
+EventBus.prototype.once = function(event, callback) {
+
+ var self = this;
+
+ function wrappedCallback() {
+ callback.apply(self, arguments);
+ self.off(event, wrappedCallback);
+ }
+
+ this.on(event, wrappedCallback);
+};
+
+
+/**
+ * Removes event listeners by event and callback.
+ *
+ * If no callback is given, all listeners for a given event name are being removed.
+ *
+ * @param {String} event
+ * @param {Function} [callback]
+ */
+EventBus.prototype.off = function(event, callback) {
+ var listeners = this._getListeners(event),
+ listener, idx;
+
+ if (callback) {
+
+ // move through listeners from back to front
+ // and remove matching listeners
+ for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
+ if (listener.callback === callback) {
+ listeners.splice(idx, 1);
+ }
+ }
+ } else {
+ // clear listeners
+ listeners.length = 0;
+ }
+};
+
+
+/**
+ * Fires a named event.
+ *
+ * @example
+ *
+ * // fire event by name
+ * events.fire('foo');
+ *
+ * // fire event object with nested type
+ * var event = { type: 'foo' };
+ * events.fire(event);
+ *
+ * // fire event with explicit type
+ * var event = { x: 10, y: 20 };
+ * events.fire('element.moved', event);
+ *
+ * // pass additional arguments to the event
+ * events.on('foo', function(event, bar) {
+ * alert(bar);
+ * });
+ *
+ * events.fire({ type: 'foo' }, 'I am bar!');
+ *
+ * @param {String} [name] the optional event name
+ * @param {Object} [event] the event object
+ * @param {...Object} additional arguments to be passed to the callback functions
+ *
+ * @return {Boolean} the events return value, if specified or false if the
+ * default action was prevented by listeners
+ */
+EventBus.prototype.fire = function(type, data) {
+
+ var event,
+ originalType,
+ listeners, idx, listener,
+ returnValue,
+ args;
+
+ args = Array.prototype.slice.call(arguments);
+
+ if (typeof type === 'object') {
+ event = type;
+ type = event.type;
+ }
+
+ if (!type) {
+ throw new Error('no event type specified');
+ }
+
+ listeners = this._listeners[type];
+
+ if (!listeners) {
+ return;
+ }
+
+ // we make sure we fire instances of our home made
+ // events here. We wrap them only once, though
+ if (data instanceof Event) {
+ // we are fine, we alread have an event
+ event = data;
+ } else {
+ event = new Event();
+ event.init(data);
+ }
+
+ // ensure we pass the event as the first parameter
+ args[0] = event;
+
+ // original event type (in case we delegate)
+ originalType = event.type;
+
+ try {
+
+ // update event type before delegation
+ if (type !== originalType) {
+ event.type = type;
+ }
+
+ for (idx = 0; !!(listener = listeners[idx]); idx++) {
+
+ // handle stopped propagation
+ if (event.cancelBubble) {
+ break;
+ }
+
+ try {
+ // returning false prevents the default action
+ returnValue = event.returnValue = listener.callback.apply(null, args);
+
+ // stop propagation on return value
+ if (returnValue !== undefined) {
+ event.stopPropagation();
+ }
+
+ // prevent default on return false
+ if (returnValue === false) {
+ event.preventDefault();
+ }
+ } catch (e) {
+ if (!this.handleError(e)) {
+ console.error('unhandled error in event listener');
+ console.error(e.stack);
+
+ throw e;
+ }
+ }
+ }
+ } finally {
+ // reset event type after delegation
+ if (type !== originalType) {
+ event.type = originalType;
+ }
+ }
+
+ // set the return value to false if the event default
+ // got prevented and no other return value exists
+ if (returnValue === undefined && event.defaultPrevented) {
+ returnValue = false;
+ }
+
+ return returnValue;
+};
+
+
+EventBus.prototype.handleError = function(error) {
+ return this.fire('error', { error: error }) === false;
+};
+
+
+/*
+ * Add new listener with a certain priority to the list
+ * of listeners (for the given event).
+ *
+ * The semantics of listener registration / listener execution are
+ * first register, first serve: New listeners will always be inserted
+ * after existing listeners with the same priority.
+ *
+ * Example: Inserting two listeners with priority 1000 and 1300
+ *
+ * * before: [ 1500, 1500, 1000, 1000 ]
+ * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
+ *
+ * @param {String} event
+ * @param {Object} listener { priority, callback }
+ */
+EventBus.prototype._addListener = function(event, newListener) {
+
+ var listeners = this._getListeners(event),
+ existingListener,
+ idx;
+
+ // ensure we order listeners by priority from
+ // 0 (high) to n > 0 (low)
+ for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
+ if (existingListener.priority < newListener.priority) {
+
+ // prepend newListener at before existingListener
+ listeners.splice(idx, 0, newListener);
+ return;
+ }
+ }
+
+ listeners.push(newListener);
+};
+
+
+EventBus.prototype._getListeners = function(name) {
+ var listeners = this._listeners[name];
+
+ if (!listeners) {
+ this._listeners[name] = listeners = [];
+ }
+
+ return listeners;
+};
+
+
+/**
+ * A event that is emitted via the event bus.
+ */
+function Event() { }
+
+module.exports.Event = Event;
+
+Event.prototype.stopPropagation = function() {
+ this.cancelBubble = true;
+};
+
+Event.prototype.preventDefault = function() {
+ this.defaultPrevented = true;
+};
+
+Event.prototype.init = function(data) {
+ assign(this, data || {});
+};
+
+},{"166":166,"167":167,"169":169,"175":175}],42:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(84),
+ reduce = _dereq_(88);
+
+var GraphicsUtil = _dereq_(67),
+ domClear = _dereq_(188);
+
+/**
+ * A factory that creates graphical elements
+ *
+ * @param {Renderer} renderer
+ */
+function GraphicsFactory(renderer, elementRegistry) {
+ this._renderer = renderer;
+ this._elementRegistry = elementRegistry;
+}
+
+GraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];
+
+module.exports = GraphicsFactory;
+
+
+GraphicsFactory.prototype._getChildren = function(element) {
+
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ var childrenGfx;
+
+ // root element
+ if (!element.parent) {
+ childrenGfx = gfx;
+ } else {
+ childrenGfx = GraphicsUtil.getChildren(gfx);
+ if (!childrenGfx) {
+ childrenGfx = gfx.parent().group().attr('class', 'djs-children');
+ }
+ }
+
+ return childrenGfx;
+};
+
+/**
+ * Clears the graphical representation of the element and returns the
+ * cleared visual (the <g class="djs-visual" /> element).
+ */
+GraphicsFactory.prototype._clear = function(gfx) {
+ var visual = GraphicsUtil.getVisual(gfx);
+
+ domClear(visual.node);
+
+ return visual;
+};
+
+/**
+ * Creates a gfx container for shapes and connections
+ *
+ * The layout is as follows:
+ *
+ * <g class="djs-group">
+ *
+ * <!-- the gfx -->
+ * <g class="djs-element djs-(shape|connection)">
+ * <g class="djs-visual">
+ * <!-- the renderer draws in here -->
+ * </g>
+ *
+ * <!-- extensions (overlays, click box, ...) goes here
+ * </g>
+ *
+ * <!-- the gfx child nodes -->
+ * <g class="djs-children"></g>
+ * </g>
+ *
+ * @param {Object} parent
+ * @param {String} type the type of the element, i.e. shape | connection
+ */
+GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
+ var outerGfx = parentGfx.group().attr('class', 'djs-group'),
+ gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
+
+ // create visual
+ gfx.group().attr('class', 'djs-visual');
+
+ return gfx;
+};
+
+GraphicsFactory.prototype.create = function(type, element) {
+ var childrenGfx = this._getChildren(element.parent);
+ return this._createContainer(type, childrenGfx);
+};
+
+
+GraphicsFactory.prototype.updateContainments = function(elements) {
+
+ var self = this,
+ elementRegistry = this._elementRegistry,
+ parents;
+
+
+ parents = reduce(elements, function(map, e) {
+
+ if (e.parent) {
+ map[e.parent.id] = e.parent;
+ }
+
+ return map;
+ }, {});
+
+ // update all parents of changed and reorganized their children
+ // in the correct order (as indicated in our model)
+ forEach(parents, function(parent) {
+
+ var childGfx = self._getChildren(parent),
+ children = parent.children;
+
+ if (!children) {
+ return;
+ }
+
+ forEach(children.slice().reverse(), function(c) {
+ var gfx = elementRegistry.getGraphics(c);
+ gfx.parent().prependTo(childGfx);
+ });
+ });
+
+};
+
+GraphicsFactory.prototype.update = function(type, element, gfx) {
+
+ // Do not update root element
+ if (!element.parent) {
+ return;
+ }
+
+ var visual = this._clear(gfx);
+
+ // redraw
+ if (type === 'shape') {
+ this._renderer.drawShape(visual, element);
+
+ // update positioning
+ gfx.translate(element.x, element.y);
+ } else
+ if (type === 'connection') {
+ this._renderer.drawConnection(visual, element);
+ } else {
+ throw new Error('unknown type: ' + type);
+ }
+
+ gfx.attr('display', element.hidden ? 'none' : 'block');
+};
+
+
+GraphicsFactory.prototype.remove = function(element) {
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ // remove
+ gfx.parent().remove();
+};
+
+},{"188":188,"67":67,"84":84,"88":88}],43:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(46) ],
+ __init__: [ 'canvas' ],
+ canvas: [ 'type', _dereq_(38) ],
+ elementRegistry: [ 'type', _dereq_(40) ],
+ elementFactory: [ 'type', _dereq_(39) ],
+ eventBus: [ 'type', _dereq_(41) ],
+ graphicsFactory: [ 'type', _dereq_(42) ]
+};
+},{"38":38,"39":39,"40":40,"41":41,"42":42,"46":46}],44:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(74);
+
+
+/**
+ * The default renderer used for shapes and connections.
+ *
+ * @param {Styles} styles
+ */
+function Renderer(styles) {
+ this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });
+ this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });
+}
+
+module.exports = Renderer;
+
+Renderer.$inject = ['styles'];
+
+
+Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
+ return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
+};
+
+Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
+ return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
+};
+
+function componentsToPath(components) {
+ return components.join(',').replace(/,?([A-z]),?/g, '$1');
+}
+
+/**
+ * Gets the default SVG path of a shape that represents it's visual bounds.
+ *
+ * @param {djs.model.Shape} shape
+ * @return {string} svg path
+ */
+Renderer.prototype.getShapePath = function getShapePath(shape) {
+
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var shapePath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(shapePath);
+};
+
+/**
+ * Gets the default SVG path of a connection that represents it's visual bounds.
+ *
+ * @param {djs.model.Connection} connection
+ * @return {string} svg path
+ */
+Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
+ var waypoints = connection.waypoints;
+
+ var idx, point, connectionPath = [];
+
+ for (idx = 0; !!(point = waypoints[idx]); idx++) {
+
+ // take invisible docking into account
+ // when creating the path
+ point = point.original || point;
+
+ connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);
+ }
+
+ return componentsToPath(connectionPath);
+};
+
+
+function toSVGPoints(points) {
+ var result = '';
+
+ for (var i = 0, p; !!(p = points[i]); i++) {
+ result += p.x + ',' + p.y + ' ';
+ }
+
+ return result;
+}
+
+function createLine(points, attrs) {
+ return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});
+}
+
+function updateLine(gfx, points) {
+ return gfx.attr({ points: toSVGPoints(points) });
+}
+
+module.exports.createLine = createLine;
+module.exports.updateLine = updateLine;
+},{"74":74}],45:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(166),
+ assign = _dereq_(175),
+ reduce = _dereq_(88);
+
+
+/**
+ * A component that manages shape styles
+ */
+function Styles() {
+
+ var defaultTraits = {
+
+ 'no-fill': {
+ fill: 'none'
+ },
+ 'no-border': {
+ strokeOpacity: 0.0
+ },
+ 'no-events': {
+ pointerEvents: 'none'
+ }
+ };
+
+ /**
+ * Builds a style definition from a className, a list of traits and an object of additional attributes.
+ *
+ * @param {String} className
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.cls = function(className, traits, additionalAttrs) {
+ var attrs = this.style(traits, additionalAttrs);
+
+ return assign(attrs, { 'class': className });
+ };
+
+ /**
+ * Builds a style definition from a list of traits and an object of additional attributes.
+ *
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.style = function(traits, additionalAttrs) {
+
+ if (!isArray(traits) && !additionalAttrs) {
+ additionalAttrs = traits;
+ traits = [];
+ }
+
+ var attrs = reduce(traits, function(attrs, t) {
+ return assign(attrs, defaultTraits[t] || {});
+ }, {});
+
+ return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
+ };
+}
+
+module.exports = Styles;
+},{"166":166,"175":175,"88":88}],46:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(44) ],
+ styles: [ 'type', _dereq_(45) ]
+};
+},{"44":44,"45":45}],47:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(84),
+ domDelegate = _dereq_(189),
+ Renderer = _dereq_(44),
+ createLine = Renderer.createLine,
+ updateLine = Renderer.updateLine;
+
+
+var isPrimaryButton = _dereq_(69).isPrimaryButton;
+
+var Snap = _dereq_(74);
+
+/**
+ * A plugin that provides interaction events for diagram elements.
+ *
+ * It emits the following events:
+ *
+ * * element.hover
+ * * element.out
+ * * element.click
+ * * element.dblclick
+ * * element.mousedown
+ *
+ * Each event is a tuple { element, gfx, originalEvent }.
+ *
+ * Canceling the event via Event#preventDefault() prevents the original DOM operation.
+ *
+ * @param {EventBus} eventBus
+ */
+function InteractionEvents(eventBus, elementRegistry, styles) {
+
+ var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {
+ stroke: 'white',
+ strokeWidth: 15
+ });
+
+ function fire(type, event) {
+ var target = event.delegateTarget || event.target,
+ gfx = target && new Snap(target),
+ element = elementRegistry.get(gfx),
+ returnValue;
+
+ if (!gfx || !element) {
+ return;
+ }
+
+ returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });
+
+ if (returnValue === false) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+
+ var handlers = {};
+
+ function mouseHandler(type) {
+
+ var fn = handlers[type];
+
+ if (!fn) {
+ fn = handlers[type] = function(event) {
+ // only indicate left mouse button interactions
+ if (isPrimaryButton(event)) {
+ fire(type, event);
+ }
+ };
+ }
+
+ return fn;
+ }
+
+ var bindings = {
+ mouseover: 'element.hover',
+ mouseout: 'element.out',
+ click: 'element.click',
+ dblclick: 'element.dblclick',
+ mousedown: 'element.mousedown',
+ mouseup: 'element.mouseup'
+ };
+
+ var elementSelector = 'svg, .djs-element';
+
+ ///// event registration
+
+ function registerEvent(node, event, localEvent) {
+ var handler = mouseHandler(localEvent);
+ handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
+ }
+
+ function unregisterEvent(node, event, localEvent) {
+ domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
+ }
+
+ function registerEvents(svg) {
+ forEach(bindings, function(val, key) {
+ registerEvent(svg.node, key, val);
+ });
+ }
+
+ function unregisterEvents(svg) {
+ forEach(bindings, function(val, key) {
+ unregisterEvent(svg.node, key, val);
+ });
+ }
+
+ eventBus.on('canvas.destroy', function(event) {
+ unregisterEvents(event.svg);
+ });
+
+ eventBus.on('canvas.init', function(event) {
+ registerEvents(event.svg);
+ });
+
+
+ eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx,
+ hit,
+ type;
+
+ if (element.waypoints) {
+ hit = createLine(element.waypoints);
+ type = 'connection';
+ } else {
+ hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });
+ type = 'shape';
+ }
+
+ hit.attr(HIT_STYLE).appendTo(gfx.node);
+ });
+
+ // update djs-hit on change
+
+ eventBus.on('shape.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ hit.attr({
+ width: element.width,
+ height: element.height
+ });
+ });
+
+ eventBus.on('connection.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ updateLine(hit, element.waypoints);
+ });
+
+
+ // API
+
+ this.fire = fire;
+
+ this.mouseHandler = mouseHandler;
+
+ this.registerEvent = registerEvent;
+ this.unregisterEvent = unregisterEvent;
+}
+
+
+InteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];
+
+module.exports = InteractionEvents;
+
+
+/**
+ * An event indicating that the mouse hovered over an element
+ *
+ * @event element.hover
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has left an element
+ *
+ * @event element.out
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has clicked an element
+ *
+ * @event element.click
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has double clicked an element
+ *
+ * @event element.dblclick
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone down on an element.
+ *
+ * @event element.mousedown
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone up on an element.
+ *
+ * @event element.mouseup
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+},{"189":189,"44":44,"69":69,"74":74,"84":84}],48:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'interactionEvents' ],
+ interactionEvents: [ 'type', _dereq_(47) ]
+};
+},{"47":47}],49:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(74);
+var getBBox = _dereq_(65).getBBox;
+
+
+/**
+ * @class
+ *
+ * A plugin that adds an outline to shapes and connections that may be activated and styled
+ * via CSS classes.
+ *
+ * @param {EventBus} events the event bus
+ */
+function Outline(eventBus, styles, elementRegistry) {
+
+ var OUTLINE_OFFSET = 6;
+
+ var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
+
+ function createOutline(gfx, bounds) {
+ return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
+ }
+
+ function updateShapeOutline(outline, bounds) {
+
+ outline.attr({
+ x: -OUTLINE_OFFSET,
+ y: -OUTLINE_OFFSET,
+ width: bounds.width + OUTLINE_OFFSET * 2,
+ height: bounds.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ function updateConnectionOutline(outline, connection) {
+
+ var bbox = getBBox(connection);
+
+ outline.attr({
+ x: bbox.x - OUTLINE_OFFSET,
+ y: bbox.y - OUTLINE_OFFSET,
+ width: bbox.width + OUTLINE_OFFSET * 2,
+ height: bbox.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateShapeOutline(outline, element);
+ });
+
+ eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateConnectionOutline(outline, element);
+ });
+
+
+}
+
+
+Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
+
+module.exports = Outline;
+
+},{"65":65,"74":74}],50:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'outline' ],
+ outline: [ 'type', _dereq_(49) ]
+};
+},{"49":49}],51:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(166),
+ isString = _dereq_(172),
+ isObject = _dereq_(170),
+ assign = _dereq_(175),
+ forEach = _dereq_(84),
+ filter = _dereq_(82),
+ debounce = _dereq_(91);
+
+var domify = _dereq_(190),
+ domClasses = _dereq_(187),
+ domRemove = _dereq_(193);
+
+var getBBox = _dereq_(65).getBBox;
+
+// document wide unique overlay ids
+var ids = new (_dereq_(68))('ov');
+
+
+function createRoot(parent) {
+ var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
+ parent.insertBefore(root, parent.firstChild);
+
+ return root;
+}
+
+
+function setPosition(el, x, y) {
+ assign(el.style, { left: x + 'px', top: y + 'px' });
+}
+
+function setVisible(el, visible) {
+ el.style.display = visible === false ? 'none' : '';
+}
+
+/**
+ * A service that allows users to attach overlays to diagram elements.
+ *
+ * The overlay service will take care of overlay positioning during updates.
+ *
+ * @example
+ *
+ * // add a pink badge on the top left of the shape
+ * overlays.add(someShape, {
+ * position: {
+ * top: -5,
+ * left: -5
+ * },
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add via shape id
+ *
+ * overlays.add('some-element-id', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add with optional type
+ *
+ * overlays.add(someShape, 'badge', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ *
+ * // remove an overlay
+ *
+ * var id = overlays.add(...);
+ * overlays.remove(id);
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementRegistry} elementRegistry
+ */
+function Overlays(config, eventBus, canvas, elementRegistry) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+ this._elementRegistry = elementRegistry;
+
+ this._ids = ids;
+
+ this._overlayDefaults = {
+ show: {
+ minZoom: 0.7,
+ maxZoom: 5.0
+ }
+ };
+
+ /**
+ * Mapping overlayId -> overlay
+ */
+ this._overlays = {};
+
+ /**
+ * Mapping elementId -> overlay container
+ */
+ this._overlayContainers = {};
+
+ // root html element for all overlays
+ this._overlayRoot = createRoot(canvas.getContainer());
+
+ this._init(config);
+}
+
+
+Overlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];
+
+module.exports = Overlays;
+
+
+/**
+ * Returns the overlay with the specified id or a list of overlays
+ * for an element with a given type.
+ *
+ * @example
+ *
+ * // return the single overlay with the given id
+ * overlays.get('some-id');
+ *
+ * // return all overlays for the shape
+ * overlays.get({ element: someShape });
+ *
+ * // return all overlays on shape with type 'badge'
+ * overlays.get({ element: someShape, type: 'badge' });
+ *
+ * // shape can also be specified as id
+ * overlays.get({ element: 'element-id', type: 'badge' });
+ *
+ *
+ * @param {Object} search
+ * @param {String} [search.id]
+ * @param {String|djs.model.Base} [search.element]
+ * @param {String} [search.type]
+ *
+ * @return {Object|Array<Object>} the overlay(s)
+ */
+Overlays.prototype.get = function(search) {
+
+ if (isString(search)) {
+ search = { id: search };
+ }
+
+ if (search.element) {
+ var container = this._getOverlayContainer(search.element, true);
+
+ // return a list of overlays when searching by element (+type)
+ if (container) {
+ return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();
+ } else {
+ return [];
+ }
+ } else
+ if (search.type) {
+ return filter(this._overlays, { type: search.type });
+ } else {
+ // return single element when searching by id
+ return search.id ? this._overlays[search.id] : null;
+ }
+};
+
+/**
+ * Adds a HTML overlay to an element.
+ *
+ * @param {String|djs.model.Base} element attach overlay to this shape
+ * @param {String} [type] optional type to assign to the overlay
+ * @param {Object} overlay the overlay configuration
+ *
+ * @param {String|DOMElement} overlay.html html element to use as an overlay
+ * @param {Object} [overlay.show] show configuration
+ * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay
+ * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay
+ * @param {Object} overlay.position where to attach the overlay
+ * @param {Number} [overlay.position.left] relative to element bbox left attachment
+ * @param {Number} [overlay.position.top] relative to element bbox top attachment
+ * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment
+ * @param {Number} [overlay.position.right] relative to element bbox right attachment
+ *
+ * @return {String} id that may be used to reference the overlay for update or removal
+ */
+Overlays.prototype.add = function(element, type, overlay) {
+
+ if (isObject(type)) {
+ overlay = type;
+ type = null;
+ }
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ if (!overlay.position) {
+ throw new Error('must specifiy overlay position');
+ }
+
+ if (!overlay.html) {
+ throw new Error('must specifiy overlay html');
+ }
+
+ if (!element) {
+ throw new Error('invalid element specified');
+ }
+
+ var id = this._ids.next();
+
+ overlay = assign({}, this._overlayDefaults, overlay, {
+ id: id,
+ type: type,
+ element: element,
+ html: overlay.html
+ });
+
+ this._addOverlay(overlay);
+
+ return id;
+};
+
+
+/**
+ * Remove an overlay with the given id or all overlays matching the given filter.
+ *
+ * @see Overlays#get for filter options.
+ *
+ * @param {String} [id]
+ * @param {Object} [filter]
+ */
+Overlays.prototype.remove = function(filter) {
+
+ var overlays = this.get(filter) || [];
+
+ if (!isArray(overlays)) {
+ overlays = [ overlays ];
+ }
+
+ var self = this;
+
+ forEach(overlays, function(overlay) {
+
+ var container = self._getOverlayContainer(overlay.element, true);
+
+ if (overlay) {
+ domRemove(overlay.html);
+ domRemove(overlay.htmlContainer);
+
+ delete overlay.htmlContainer;
+ delete overlay.element;
+
+ delete self._overlays[overlay.id];
+ }
+
+ if (container) {
+ var idx = container.overlays.indexOf(overlay);
+ if (idx !== -1) {
+ container.overlays.splice(idx, 1);
+ }
+ }
+ });
+
+};
+
+
+Overlays.prototype.show = function() {
+ setVisible(this._overlayRoot);
+};
+
+
+Overlays.prototype.hide = function() {
+ setVisible(this._overlayRoot, false);
+};
+
+
+Overlays.prototype._updateOverlayContainer = function(container) {
+ var element = container.element,
+ html = container.html;
+
+ // update container left,top according to the elements x,y coordinates
+ // this ensures we can attach child elements relative to this container
+
+ var x = element.x,
+ y = element.y;
+
+ if (element.waypoints) {
+ var bbox = getBBox(element);
+ x = bbox.x;
+ y = bbox.y;
+ }
+
+ setPosition(html, x, y);
+};
+
+
+Overlays.prototype._updateOverlay = function(overlay) {
+
+ var position = overlay.position,
+ htmlContainer = overlay.htmlContainer,
+ element = overlay.element;
+
+ // update overlay html relative to shape because
+ // it is already positioned on the element
+
+ // update relative
+ var left = position.left,
+ top = position.top;
+
+ if (position.right !== undefined) {
+
+ var width;
+
+ if (element.waypoints) {
+ width = getBBox(element).width;
+ } else {
+ width = element.width;
+ }
+
+ left = position.right * -1 + width;
+ }
+
+ if (position.bottom !== undefined) {
+
+ var height;
+
+ if (element.waypoints) {
+ height = getBBox(element).height;
+ } else {
+ height = element.height;
+ }
+
+ top = position.bottom * -1 + height;
+ }
+
+ setPosition(htmlContainer, left || 0, top || 0);
+};
+
+
+Overlays.prototype._createOverlayContainer = function(element) {
+ var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
+
+ this._overlayRoot.appendChild(html);
+
+ var container = {
+ html: html,
+ element: element,
+ overlays: []
+ };
+
+ this._updateOverlayContainer(container);
+
+ return container;
+};
+
+
+Overlays.prototype._updateRoot = function(viewbox) {
+ var a = viewbox.scale || 1;
+ var d = viewbox.scale || 1;
+
+ var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
+
+ this._overlayRoot.style.transform = matrix;
+ this._overlayRoot.style['-ms-transform'] = matrix;
+};
+
+
+Overlays.prototype._getOverlayContainer = function(element, raw) {
+ var id = (element && element.id) || element;
+
+ var container = this._overlayContainers[id];
+ if (!container && !raw) {
+ container = this._overlayContainers[id] = this._createOverlayContainer(element);
+ }
+
+ return container;
+};
+
+
+Overlays.prototype._addOverlay = function(overlay) {
+
+ var id = overlay.id,
+ element = overlay.element,
+ html = overlay.html,
+ htmlContainer,
+ overlayContainer;
+
+ // unwrap jquery (for those who need it)
+ if (html.get) {
+ html = html.get(0);
+ }
+
+ // create proper html elements from
+ // overlay HTML strings
+ if (isString(html)) {
+ html = domify(html);
+ }
+
+ overlayContainer = this._getOverlayContainer(element);
+
+ htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
+
+ htmlContainer.appendChild(html);
+
+ if (overlay.type) {
+ domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
+ }
+
+ overlay.htmlContainer = htmlContainer;
+
+ overlayContainer.overlays.push(overlay);
+ overlayContainer.html.appendChild(htmlContainer);
+
+ this._overlays[id] = overlay;
+
+ this._updateOverlay(overlay);
+};
+
+Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
+
+ forEach(this._overlays, function(overlay) {
+ var show = overlay.show,
+ htmlContainer = overlay.htmlContainer,
+ visible = true;
+
+ if (show) {
+ if (show.minZoom > viewbox.scale ||
+ show.maxZoom < viewbox.scale) {
+ visible = false;
+ }
+
+ setVisible(htmlContainer, visible);
+ }
+ });
+};
+
+Overlays.prototype._init = function(config) {
+
+ var eventBus = this._eventBus;
+
+ var self = this;
+
+
+ // scroll/zoom integration
+
+ var updateViewbox = function(viewbox) {
+ self._updateRoot(viewbox);
+ self._updateOverlayVisibilty(viewbox);
+
+ self.show();
+ };
+
+ if (!config || config.deferUpdate !== false) {
+ updateViewbox = debounce(updateViewbox, 300);
+ }
+
+ eventBus.on('canvas.viewbox.changed', function(event) {
+ self.hide();
+ updateViewbox(event.viewbox);
+ });
+
+
+ // remove integration
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var overlays = self.get({ element: e.element });
+
+ forEach(overlays, function(o) {
+ self.remove(o.id);
+ });
+ });
+
+
+ // move integration
+
+ eventBus.on([
+ 'element.changed'
+ ], function(e) {
+ var element = e.element;
+
+ var container = self._getOverlayContainer(element, true);
+
+ if (container) {
+ forEach(container.overlays, function(overlay) {
+ self._updateOverlay(overlay);
+ });
+
+ self._updateOverlayContainer(container);
+ }
+ });
+
+
+ // marker integration, simply add them on the overlays as classes, too.
+
+ eventBus.on('element.marker.update', function(e) {
+ var container = self._getOverlayContainer(e.element, true);
+ if (container) {
+ domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
+ }
+ });
+};
+
+},{"166":166,"170":170,"172":172,"175":175,"187":187,"190":190,"193":193,"65":65,"68":68,"82":82,"84":84,"91":91}],52:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'overlays' ],
+ overlays: [ 'type', _dereq_(51) ]
+};
+},{"51":51}],53:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(166),
+ forEach = _dereq_(84);
+
+
+/**
+ * A service that offers the current selection in a diagram.
+ * Offers the api to control the selection, too.
+ *
+ * @class
+ *
+ * @param {EventBus} eventBus the event bus
+ */
+function Selection(eventBus) {
+
+ this._eventBus = eventBus;
+
+ this._selectedElements = [];
+
+ var self = this;
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var element = e.element;
+ self.deselect(element);
+ });
+}
+
+Selection.$inject = [ 'eventBus' ];
+
+module.exports = Selection;
+
+
+Selection.prototype.deselect = function(element) {
+ var selectedElements = this._selectedElements;
+
+ var idx = selectedElements.indexOf(element);
+
+ if (idx !== -1) {
+ var oldSelection = selectedElements.slice();
+
+ selectedElements.splice(idx, 1);
+
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+ }
+};
+
+
+Selection.prototype.get = function() {
+ return this._selectedElements;
+};
+
+Selection.prototype.isSelected = function(element) {
+ return this._selectedElements.indexOf(element) !== -1;
+};
+
+
+/**
+ * This method selects one or more elements on the diagram.
+ *
+ * By passing an additional add parameter you can decide whether or not the element(s)
+ * should be added to the already existing selection or not.
+ *
+ * @method Selection#select
+ *
+ * @param {Object|Object[]} elements element or array of elements to be selected
+ * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false
+ */
+Selection.prototype.select = function(elements, add) {
+ var selectedElements = this._selectedElements,
+ oldSelection = selectedElements.slice();
+
+ if (!isArray(elements)) {
+ elements = elements ? [ elements ] : [];
+ }
+
+ // selection may be cleared by passing an empty array or null
+ // to the method
+ if (add) {
+ forEach(elements, function(element) {
+ if (selectedElements.indexOf(element) !== -1) {
+ // already selected
+ return;
+ } else {
+ selectedElements.push(element);
+ }
+ });
+ } else {
+ this._selectedElements = selectedElements = elements.slice();
+ }
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+};
+
+},{"166":166,"84":84}],54:[function(_dereq_,module,exports){
+'use strict';
+
+var hasPrimaryModifier = _dereq_(69).hasPrimaryModifier;
+
+
+function SelectionBehavior(eventBus, selection, canvas) {
+
+ eventBus.on('create.end', 500, function(e) {
+ if (e.context.canExecute) {
+ selection.select(e.shape);
+ }
+ });
+
+ eventBus.on('connect.end', 500, function(e) {
+ if (e.context.canExecute && e.context.target) {
+ selection.select(e.context.target);
+ }
+ });
+
+ eventBus.on('shape.move.end', 500, function(e) {
+ selection.select(e.context.shapes);
+ });
+
+
+ // Shift + click selection
+ eventBus.on('element.click', function(event) {
+
+ var element = event.element;
+
+ // do not select the root element
+ // or connections
+ if (element === canvas.getRootElement()) {
+ element = null;
+ }
+
+ var isSelected = selection.isSelected(element),
+ isMultiSelect = selection.get().length > 1;
+
+ // mouse-event: SELECTION_KEY
+ var add = hasPrimaryModifier(event);
+
+ // select OR deselect element in multi selection
+ if (isSelected && isMultiSelect) {
+ if (add) {
+ return selection.deselect(element);
+ } else {
+ return selection.select(element);
+ }
+ } else
+ if (!isSelected) {
+ selection.select(element, add);
+ } else {
+ selection.deselect(element);
+ }
+ });
+}
+
+SelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];
+
+module.exports = SelectionBehavior;
+
+},{"69":69}],55:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(84);
+
+var MARKER_HOVER = 'hover',
+ MARKER_SELECTED = 'selected';
+
+
+/**
+ * A plugin that adds a visible selection UI to shapes and connections
+ * by appending the <code>hover</code> and <code>selected</code> classes to them.
+ *
+ * @class
+ *
+ * Makes elements selectable, too.
+ *
+ * @param {EventBus} events
+ * @param {SelectionService} selection
+ * @param {Canvas} canvas
+ */
+function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
+
+ this._multiSelectionBox = null;
+
+ function addMarker(e, cls) {
+ canvas.addMarker(e, cls);
+ }
+
+ function removeMarker(e, cls) {
+ canvas.removeMarker(e, cls);
+ }
+
+ events.on('element.hover', function(event) {
+ addMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('element.out', function(event) {
+ removeMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('selection.changed', function(event) {
+
+ function deselect(s) {
+ removeMarker(s, MARKER_SELECTED);
+ }
+
+ function select(s) {
+ addMarker(s, MARKER_SELECTED);
+ }
+
+ var oldSelection = event.oldSelection,
+ newSelection = event.newSelection;
+
+ forEach(oldSelection, function(e) {
+ if (newSelection.indexOf(e) === -1) {
+ deselect(e);
+ }
+ });
+
+ forEach(newSelection, function(e) {
+ if (oldSelection.indexOf(e) === -1) {
+ select(e);
+ }
+ });
+ });
+}
+
+SelectionVisuals.$inject = [
+ 'eventBus',
+ 'canvas',
+ 'selection',
+ 'graphicsFactory',
+ 'styles'
+];
+
+module.exports = SelectionVisuals;
+
+},{"84":84}],56:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'selectionVisuals', 'selectionBehavior' ],
+ __depends__: [
+ _dereq_(48),
+ _dereq_(50)
+ ],
+ selection: [ 'type', _dereq_(53) ],
+ selectionVisuals: [ 'type', _dereq_(55) ],
+ selectionBehavior: [ 'type', _dereq_(54) ]
+};
+
+},{"48":48,"50":50,"53":53,"54":54,"55":55}],57:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(175),
+ inherits = _dereq_(79);
+
+var Refs = _dereq_(202);
+
+var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
+ labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),
+ outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),
+ incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });
+
+/**
+ * @namespace djs.model
+ */
+
+/**
+ * @memberOf djs.model
+ */
+
+/**
+ * The basic graphical representation
+ *
+ * @class
+ *
+ * @abstract
+ */
+function Base() {
+
+ /**
+ * The object that backs up the shape
+ *
+ * @name Base#businessObject
+ * @type Object
+ */
+ Object.defineProperty(this, 'businessObject', {
+ writable: true
+ });
+
+ /**
+ * The parent shape
+ *
+ * @name Base#parent
+ * @type Shape
+ */
+ parentRefs.bind(this, 'parent');
+
+ /**
+ * @name Base#label
+ * @type Label
+ */
+ labelRefs.bind(this, 'label');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#outgoing
+ * @type Array<Connection>
+ */
+ outgoingRefs.bind(this, 'outgoing');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#incoming
+ * @type Array<Connection>
+ */
+ incomingRefs.bind(this, 'incoming');
+}
+
+
+/**
+ * A graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Shape() {
+ Base.call(this);
+
+ /**
+ * The list of children
+ *
+ * @name Shape#children
+ * @type Array<Base>
+ */
+ parentRefs.bind(this, 'children');
+}
+
+inherits(Shape, Base);
+
+
+/**
+ * A root graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Root() {
+ Shape.call(this);
+}
+
+inherits(Root, Shape);
+
+
+/**
+ * A label for an element
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Label() {
+ Shape.call(this);
+
+ /**
+ * The labeled element
+ *
+ * @name Label#labelTarget
+ * @type Base
+ */
+ labelRefs.bind(this, 'labelTarget');
+}
+
+inherits(Label, Shape);
+
+
+/**
+ * A connection between two elements
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Connection() {
+ Base.call(this);
+
+ /**
+ * The element this connection originates from
+ *
+ * @name Connection#source
+ * @type Base
+ */
+ outgoingRefs.bind(this, 'source');
+
+ /**
+ * The element this connection points to
+ *
+ * @name Connection#target
+ * @type Base
+ */
+ incomingRefs.bind(this, 'target');
+}
+
+inherits(Connection, Base);
+
+
+var types = {
+ connection: Connection,
+ shape: Shape,
+ label: Label,
+ root: Root
+};
+
+/**
+ * Creates a new model element of the specified type
+ *
+ * @method create
+ *
+ * @example
+ *
+ * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });
+ * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });
+ *
+ * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });
+ *
+ * @param {String} type lower-cased model name
+ * @param {Object} attrs attributes to initialize the new model instance with
+ *
+ * @return {Base} the new model instance
+ */
+module.exports.create = function(type, attrs) {
+ var Type = types[type];
+ if (!Type) {
+ throw new Error('unknown type: <' + type + '>');
+ }
+ return assign(new Type(), attrs);
+};
+
+
+module.exports.Base = Base;
+module.exports.Root = Root;
+module.exports.Shape = Shape;
+module.exports.Connection = Connection;
+module.exports.Label = Label;
+},{"175":175,"202":202,"79":79}],58:[function(_dereq_,module,exports){
+'use strict';
+
+var Cursor = _dereq_(64),
+ ClickTrap = _dereq_(62),
+ domEvent = _dereq_(191),
+ Event = _dereq_(66);
+
+function substract(p1, p2) {
+ return {
+ x: p1.x - p2.x,
+ y: p1.y - p2.y
+ };
+}
+
+function length(point) {
+ return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
+}
+
+
+var THRESHOLD = 15;
+
+
+function MoveCanvas(eventBus, canvas) {
+
+ var container = canvas._container,
+ context;
+
+
+ function handleMove(event) {
+
+ var start = context.start,
+ position = Event.toPoint(event),
+ delta = substract(position, start);
+
+ if (!context.dragging && length(delta) > THRESHOLD) {
+ context.dragging = true;
+
+ // prevent mouse click in this
+ // interaction sequence
+ ClickTrap.install();
+
+ Cursor.set('move');
+ }
+
+ if (context.dragging) {
+
+ var lastPosition = context.last || context.start;
+
+ delta = substract(position, lastPosition);
+
+ canvas.scroll({
+ dx: delta.x,
+ dy: delta.y
+ });
+
+ context.last = position;
+ }
+
+ // prevent select
+ event.preventDefault();
+ }
+
+
+ function handleEnd(event) {
+ domEvent.unbind(document, 'mousemove', handleMove);
+ domEvent.unbind(document, 'mouseup', handleEnd);
+
+ context = null;
+
+ Cursor.unset();
+
+ // prevent select
+ Event.stopEvent(event);
+ }
+
+ function handleStart(event) {
+
+ // reject non-left left mouse button or modifier key
+ if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
+ return;
+ }
+
+ context = {
+ start: Event.toPoint(event)
+ };
+
+ domEvent.bind(document, 'mousemove', handleMove);
+ domEvent.bind(document, 'mouseup', handleEnd);
+
+ // prevent select
+ Event.stopEvent(event);
+ }
+
+ domEvent.bind(container, 'mousedown', handleStart);
+}
+
+
+MoveCanvas.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = MoveCanvas;
+
+},{"191":191,"62":62,"64":64,"66":66}],59:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'moveCanvas' ],
+ moveCanvas: [ 'type', _dereq_(58) ]
+};
+},{"58":58}],60:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(191);
+
+var hasPrimaryModifier = _dereq_(69).hasPrimaryModifier,
+ hasSecondaryModifier = _dereq_(69).hasSecondaryModifier;
+
+var isMac = _dereq_(70).isMac;
+
+
+function ZoomScroll(events, canvas) {
+
+ var RANGE = { min: 0.2, max: 4 };
+
+ function cap(scale) {
+ return Math.max(RANGE.min, Math.min(RANGE.max, scale));
+ }
+
+ function reset() {
+ canvas.zoom('fit-viewport');
+ }
+
+ function zoom(direction, position) {
+
+ var currentZoom = canvas.zoom();
+ var factor = Math.pow(1 + Math.abs(direction) , direction > 0 ? 1 : -1);
+
+ canvas.zoom(cap(currentZoom * factor), position);
+ }
+
+ function scroll(delta) {
+ canvas.scroll(delta);
+ }
+
+ function init(element) {
+
+ domEvent.bind(element, 'wheel', function(event) {
+
+ event.preventDefault();
+
+ // mouse-event: SELECTION_KEY
+ // mouse-event: AND_KEY
+ var isVerticalScroll = hasPrimaryModifier(event),
+ isHorizontalScroll = hasSecondaryModifier(event);
+
+ var factor;
+
+ if (isVerticalScroll || isHorizontalScroll) {
+
+ if (isMac) {
+ factor = event.deltaMode === 0 ? 1.25 : 50;
+ } else {
+ factor = event.deltaMode === 0 ? 1/40 : 1/2;
+ }
+
+ var delta = {};
+
+ if (isHorizontalScroll) {
+ delta.dx = (factor * (event.deltaX || event.deltaY));
+ } else {
+ delta.dy = (factor * event.deltaY);
+ }
+
+ scroll(delta);
+ } else {
+ factor = (event.deltaMode === 0 ? 1/40 : 1/2);
+
+ var elementRect = element.getBoundingClientRect();
+
+ var offset = {
+ x: event.clientX - elementRect.left,
+ y: event.clientY - elementRect.top
+ };
+
+ // zoom in relative to diagram {x,y} coordinates
+ zoom(event.deltaY * factor / (-5), offset);
+ }
+ });
+ }
+
+ events.on('canvas.init', function(e) {
+ init(canvas._container);
+ });
+
+ // API
+ this.zoom = zoom;
+ this.reset = reset;
+}
+
+
+ZoomScroll.$inject = [ 'eventBus', 'canvas' ];
+
+module.exports = ZoomScroll;
+
+
+},{"191":191,"69":69,"70":70}],61:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'zoomScroll' ],
+ zoomScroll: [ 'type', _dereq_(60) ]
+};
+},{"60":60}],62:[function(_dereq_,module,exports){
+'use strict';
+
+var domEvent = _dereq_(191),
+ stopEvent = _dereq_(66).stopEvent;
+
+function trap(event) {
+ stopEvent(event);
+
+ toggle(false);
+}
+
+function toggle(active) {
+ domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
+}
+
+/**
+ * Installs a click trap that prevents a ghost click following a dragging operation.
+ *
+ * @return {Function} a function to immediately remove the installed trap.
+ */
+function install() {
+
+ toggle(true);
+
+ return function() {
+ toggle(false);
+ };
+}
+
+module.exports.install = install;
+},{"191":191,"66":66}],63:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Failsafe remove an element from a collection
+ *
+ * @param {Array<Object>} [collection]
+ * @param {Object} [element]
+ *
+ * @return {Object} the element that got removed or undefined
+ */
+module.exports.remove = function(collection, element) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ var idx = collection.indexOf(element);
+ if (idx === -1) {
+ return;
+ }
+
+ collection.splice(idx, 1);
+
+ return element;
+};
+
+/**
+ * Fail save add an element to the given connection, ensuring
+ * it does not yet exist.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ * @param {Number} idx
+ */
+module.exports.add = function(collection, element, idx) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ if (isNaN(idx)) {
+ idx = -1;
+ }
+
+ var currentIdx = collection.indexOf(element);
+
+ if (currentIdx !== -1) {
+
+ if (currentIdx === idx) {
+ // nothing to do, position has not changed
+ return;
+ } else {
+
+ if (idx !== -1) {
+ // remove from current position
+ collection.splice(currentIdx, 1);
+ } else {
+ // already exists in collection
+ return;
+ }
+ }
+ }
+
+ if (idx !== -1) {
+ // insert at specified position
+ collection.splice(idx, 0, element);
+ } else {
+ // push to end
+ collection.push(element);
+ }
+};
+
+
+/**
+ * Fail get the index of an element in a collection.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ *
+ * @return {Number} the index or -1 if collection or element do
+ * not exist or the element is not contained.
+ */
+module.exports.indexOf = function(collection, element) {
+
+ if (!collection || !element) {
+ return -1;
+ }
+
+ return collection.indexOf(element);
+};
+
+},{}],64:[function(_dereq_,module,exports){
+'use strict';
+
+var domClasses = _dereq_(187);
+
+var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
+
+
+module.exports.set = function(mode) {
+ var classes = domClasses(document.body);
+
+ classes.removeMatching(CURSOR_CLS_PATTERN);
+
+ if (mode) {
+ classes.add('djs-cursor-' + mode);
+ }
+};
+
+module.exports.unset = function() {
+ this.set(null);
+};
+},{"187":187}],65:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(166),
+ isNumber = _dereq_(169),
+ groupBy = _dereq_(85),
+ forEach = _dereq_(84);
+
+/**
+ * Adds an element to a collection and returns true if the
+ * element was added.
+ *
+ * @param {Array<Object>} elements
+ * @param {Object} e
+ * @param {Boolean} unique
+ */
+function add(elements, e, unique) {
+ var canAdd = !unique || elements.indexOf(e) === -1;
+
+ if (canAdd) {
+ elements.push(e);
+ }
+
+ return canAdd;
+}
+
+function eachElement(elements, fn, depth) {
+
+ depth = depth || 0;
+
+ forEach(elements, function(s, i) {
+ var filter = fn(s, i, depth);
+
+ if (isArray(filter) && filter.length) {
+ eachElement(filter, fn, depth + 1);
+ }
+ });
+}
+
+/**
+ * Collects self + child elements up to a given depth from a list of elements.
+ *
+ * @param {Array<djs.model.Base>} elements the elements to select the children from
+ * @param {Boolean} unique whether to return a unique result set (no duplicates)
+ * @param {Number} maxDepth the depth to search through or -1 for infinite
+ *
+ * @return {Array<djs.model.Base>} found elements
+ */
+function selfAndChildren(elements, unique, maxDepth) {
+ var result = [],
+ processedChildren = [];
+
+ eachElement(elements, function(element, i, depth) {
+ add(result, element, unique);
+
+ var children = element.children;
+
+ // max traversal depth not reached yet
+ if (maxDepth === -1 || depth < maxDepth) {
+
+ // children exist && children not yet processed
+ if (children && add(processedChildren, children, unique)) {
+ return children;
+ }
+ }
+ });
+
+ return result;
+}
+
+/**
+ * Return self + direct children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndDirectChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, 1);
+}
+
+/**
+ * Return self + ALL children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndAllChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, -1);
+}
+
+/**
+ * Gets the the closure fo all selected elements,
+ * their connections and
+ *
+ * @param {Array<djs.model.Base>} elements
+ * @return {Object} enclosure
+ */
+function getClosure(elements) {
+
+ // original elements passed to this function
+ var topLevel = groupBy(elements, function(e) { return e.id; });
+
+ var allShapes = {},
+ allConnections = {},
+ enclosedElements = {},
+ enclosedConnections = {};
+
+ function handleConnection(c) {
+ if (topLevel[c.source.id] && topLevel[c.target.id]) {
+ topLevel[c.id] = c;
+ }
+
+ // not enclosed as a child, but maybe logically
+ // (connecting two moved elements?)
+ if (allShapes[c.source.id] && allShapes[c.target.id]) {
+ enclosedConnections[c.id] = enclosedElements[c.id] = c;
+ }
+
+ allConnections[c.id] = c;
+ }
+
+ function handleElement(element) {
+
+ enclosedElements[element.id] = element;
+
+ if (element.waypoints) {
+ // remember connection
+ enclosedConnections[element.id] = allConnections[element.id] = element;
+ } else {
+ // remember shape
+ allShapes[element.id] = element;
+
+ // remember all connections
+ forEach(element.incoming, handleConnection);
+
+ forEach(element.outgoing, handleConnection);
+
+ // recurse into children
+ return element.children;
+ }
+ }
+
+ eachElement(elements, handleElement);
+
+ return {
+ allShapes: allShapes,
+ allConnections: allConnections,
+ topLevel: topLevel,
+ enclosedConnections: enclosedConnections,
+ enclosedElements: enclosedElements
+ };
+}
+
+/**
+ * Returns the surrounding bbox for all elements in the array or the element primitive.
+ */
+function getBBox(elements, stopRecursion) {
+
+ stopRecursion = !!stopRecursion;
+ if (!isArray(elements)) {
+ elements = [elements];
+ }
+
+ var minX,
+ minY,
+ maxX,
+ maxY;
+
+ forEach(elements, function(element) {
+
+ // If element is a connection the bbox must be computed first
+ var bbox = element;
+ if (element.waypoints && !stopRecursion) {
+ bbox = getBBox(element.waypoints, true);
+ }
+
+ var x = bbox.x,
+ y = bbox.y,
+ height = bbox.height || 0,
+ width = bbox.width || 0;
+
+ if (x < minX || minX === undefined) {
+ minX = x;
+ }
+ if (y < minY || minY === undefined) {
+ minY = y;
+ }
+
+ if ((x + width) > maxX || maxX === undefined) {
+ maxX = x + width;
+ }
+ if ((y + height) > maxY || maxY === undefined) {
+ maxY = y + height;
+ }
+ });
+
+ return {
+ x: minX,
+ y: minY,
+ height: maxY - minY,
+ width: maxX - minX
+ };
+}
+
+
+/**
+ * Returns all elements that are enclosed from the bounding box.
+ *
+ * @param {Array<Object>} elements List of Elements to search through
+ * @param {Object} bbox the enclosing bbox.
+ * <ul>
+ * <li>If bbox.(width|height) is not specified
+ * the method returns all elements with element.x/y &gt; bbox.x/y
+ * </li>
+ * <li>If only bbox.x or bbox.y is specified, method return all elements with
+ * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
+ * </ul>
+ *
+ */
+function getEnclosedElements(elements, bbox) {
+
+ var filteredElements = {};
+
+ forEach(elements, function(element) {
+
+ var e = element;
+
+ if (e.waypoints) {
+ e = getBBox(e);
+ }
+
+ if (!isNumber(bbox.y) && (e.x > bbox.x)) {
+ filteredElements[element.id] = element;
+ }
+ if (!isNumber(bbox.x) && (e.y > bbox.y)) {
+ filteredElements[element.id] = element;
+ }
+ if (e.x > bbox.x && e.y > bbox.y) {
+ if (isNumber(bbox.width) && isNumber(bbox.height) &&
+ e.width + e.x < bbox.width + bbox.x &&
+ e.height + e.y < bbox.height + bbox.y) {
+
+ filteredElements[element.id] = element;
+ } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
+ filteredElements[element.id] = element;
+ }
+ }
+ });
+
+ return filteredElements;
+}
+
+
+
+module.exports.eachElement = eachElement;
+module.exports.selfAndDirectChildren = selfAndDirectChildren;
+module.exports.selfAndAllChildren = selfAndAllChildren;
+module.exports.getBBox = getBBox;
+module.exports.getEnclosedElements = getEnclosedElements;
+
+module.exports.getClosure = getClosure;
+
+},{"166":166,"169":169,"84":84,"85":85}],66:[function(_dereq_,module,exports){
+'use strict';
+
+function __preventDefault(event) {
+ return event && event.preventDefault();
+}
+
+function __stopPropagation(event, immediate) {
+ if (!event) {
+ return;
+ }
+
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
+ if (immediate && event.stopImmediatePropagation) {
+ event.stopImmediatePropagation();
+ }
+}
+
+
+function getOriginal(event) {
+ return event.originalEvent || event.srcEvent;
+}
+
+module.exports.getOriginal = getOriginal;
+
+
+function stopEvent(event, immediate) {
+ stopPropagation(event, immediate);
+ preventDefault(event);
+}
+
+module.exports.stopEvent = stopEvent;
+
+
+function preventDefault(event) {
+ __preventDefault(event);
+ __preventDefault(getOriginal(event));
+}
+
+module.exports.preventDefault = preventDefault;
+
+
+function stopPropagation(event, immediate) {
+ __stopPropagation(event, immediate);
+ __stopPropagation(getOriginal(event), immediate);
+}
+
+module.exports.stopPropagation = stopPropagation;
+
+
+function toPoint(event) {
+
+ if (event.pointers && event.pointers.length) {
+ event = event.pointers[0];
+ }
+
+ if (event.touches && event.touches.length) {
+ event = event.touches[0];
+ }
+
+ return event ? {
+ x: event.clientX,
+ y: event.clientY
+ } : null;
+}
+
+module.exports.toPoint = toPoint;
+
+},{}],67:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * SVGs for elements are generated by the {@link GraphicsFactory}.
+ *
+ * This utility gives quick access to the important semantic
+ * parts of an element.
+ */
+
+/**
+ * Returns the visual part of a diagram element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Snap<SVGElement>}
+ */
+function getVisual(gfx) {
+ return gfx.select('.djs-visual');
+}
+
+/**
+ * Returns the children for a given diagram element.
+ *
+ * @param {Snap<SVGElement>} gfx
+ * @return {Snap<SVGElement>}
+ */
+function getChildren(gfx) {
+ return gfx.parent().children()[1];
+}
+
+/**
+ * Returns the visual bbox of an element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Bounds}
+ */
+function getBBox(gfx) {
+ return getVisual(gfx).select('*').getBBox();
+}
+
+
+module.exports.getVisual = getVisual;
+module.exports.getChildren = getChildren;
+module.exports.getBBox = getBBox;
+},{}],68:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Util that provides unique IDs.
+ *
+ * @class djs.util.IdGenerator
+ * @constructor
+ * @memberOf djs.util
+ *
+ * The ids can be customized via a given prefix and contain a random value to avoid collisions.
+ *
+ * @param {String} prefix a prefix to prepend to generated ids (for better readability)
+ */
+function IdGenerator(prefix) {
+
+ this._counter = 0;
+ this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
+}
+
+module.exports = IdGenerator;
+
+/**
+ * Returns a next unique ID.
+ *
+ * @method djs.util.IdGenerator#next
+ *
+ * @returns {String} the id
+ */
+IdGenerator.prototype.next = function() {
+ return this._prefix + (++this._counter);
+};
+
+},{}],69:[function(_dereq_,module,exports){
+'use strict';
+
+var getOriginalEvent = _dereq_(66).getOriginal;
+
+var isMac = _dereq_(70).isMac;
+
+
+function isPrimaryButton(event) {
+ // button === 0 -> left áka primary mouse button
+ return !(getOriginalEvent(event) || event).button;
+}
+
+module.exports.isPrimaryButton = isPrimaryButton;
+
+module.exports.isMac = isMac;
+
+module.exports.hasPrimaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ if (!isPrimaryButton(event)) {
+ return false;
+ }
+
+ // Use alt as primary modifier key for mac OS
+ if (isMac()) {
+ return originalEvent.altKey;
+ } else {
+ return originalEvent.ctrlKey;
+ }
+};
+
+
+module.exports.hasSecondaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ return isPrimaryButton(event) && originalEvent.shiftKey;
+};
+
+},{"66":66,"70":70}],70:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.isMac = function isMac() {
+ return (/mac/i).test(navigator.platform);
+};
+},{}],71:[function(_dereq_,module,exports){
+'use strict';
+
+var isObject = _dereq_(170),
+ assign = _dereq_(175),
+ forEach = _dereq_(84),
+ reduce = _dereq_(88),
+ merge = _dereq_(178);
+
+var Snap = _dereq_(74);
+
+var DEFAULT_BOX_PADDING = 0;
+
+var DEFAULT_LABEL_SIZE = {
+ width: 150,
+ height: 50
+};
+
+
+function parseAlign(align) {
+
+ var parts = align.split('-');
+
+ return {
+ horizontal: parts[0] || 'center',
+ vertical: parts[1] || 'top'
+ };
+}
+
+function parsePadding(padding) {
+
+ if (isObject(padding)) {
+ return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
+ } else {
+ return {
+ top: padding,
+ left: padding,
+ right: padding,
+ bottom: padding
+ };
+ }
+}
+
+function getTextBBox(text, fakeText) {
+ fakeText.textContent = text;
+ return fakeText.getBBox();
+}
+
+
+/**
+ * Layout the next line and return the layouted element.
+ *
+ * Alters the lines passed.
+ *
+ * @param {Array<String>} lines
+ * @return {Object} the line descriptor, an object { width, height, text }
+ */
+function layoutNext(lines, maxWidth, fakeText) {
+
+ var originalLine = lines.shift(),
+ fitLine = originalLine;
+
+ var textBBox;
+
+ while (true) {
+ textBBox = getTextBBox(fitLine, fakeText);
+
+ textBBox.width = fitLine ? textBBox.width : 0;
+
+ // try to fit
+ if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
+ return fit(lines, fitLine, originalLine, textBBox);
+ }
+
+
+ fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
+ }
+}
+
+function fit(lines, fitLine, originalLine, textBBox) {
+ if (fitLine.length < originalLine.length) {
+ var nextLine = lines[0] || '',
+ remainder = originalLine.slice(fitLine.length).trim();
+
+ if (/-\s*$/.test(remainder)) {
+ nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
+ } else {
+ nextLine = remainder + ' ' + nextLine;
+ }
+
+ lines[0] = nextLine;
+ }
+ return { width: textBBox.width, height: textBBox.height, text: fitLine };
+}
+
+
+/**
+ * Shortens a line based on spacing and hyphens.
+ * Returns the shortened result on success.
+ *
+ * @param {String} line
+ * @param {Number} maxLength the maximum characters of the string
+ * @return {String} the shortened string
+ */
+function semanticShorten(line, maxLength) {
+ var parts = line.split(/(\s|-)/g),
+ part,
+ shortenedParts = [],
+ length = 0;
+
+ // try to shorten via spaces + hyphens
+ if (parts.length > 1) {
+ while ((part = parts.shift())) {
+ if (part.length + length < maxLength) {
+ shortenedParts.push(part);
+ length += part.length;
+ } else {
+ // remove previous part, too if hyphen does not fit anymore
+ if (part === '-') {
+ shortenedParts.pop();
+ }
+
+ break;
+ }
+ }
+ }
+
+ return shortenedParts.join('');
+}
+
+
+function shortenLine(line, width, maxWidth) {
+ var length = Math.max(line.length * (maxWidth / width), 1);
+
+ // try to shorten semantically (i.e. based on spaces and hyphens)
+ var shortenedLine = semanticShorten(line, length);
+
+ if (!shortenedLine) {
+
+ // force shorten by cutting the long word
+ shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
+ }
+
+ return shortenedLine;
+}
+
+
+/**
+ * Creates a new label utility
+ *
+ * @param {Object} config
+ * @param {Dimensions} config.size
+ * @param {Number} config.padding
+ * @param {Object} config.style
+ * @param {String} config.align
+ */
+function Text(config) {
+
+ this._config = assign({}, {
+ size: DEFAULT_LABEL_SIZE,
+ padding: DEFAULT_BOX_PADDING,
+ style: {},
+ align: 'center-top'
+ }, config || {});
+}
+
+
+/**
+ * Create a label in the parent node.
+ *
+ * @method Text#createText
+ *
+ * @param {SVGElement} parent the parent to draw the label on
+ * @param {String} text the text to render on the label
+ * @param {Object} options
+ * @param {String} options.align how to align in the bounding box.
+ * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.
+ * @param {String} options.style style to be applied to the text
+ *
+ * @return {SVGText} the text element created
+ */
+Text.prototype.createText = function(parent, text, options) {
+
+ var box = merge({}, this._config.size, options.box || {}),
+ style = merge({}, this._config.style, options.style || {}),
+ align = parseAlign(options.align || this._config.align),
+ padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
+
+ var lines = text.split(/\r?\n/g),
+ layouted = [];
+
+ var maxWidth = box.width - padding.left - padding.right;
+
+ // FF regression: ensure text is shown during rendering
+ // by attaching it directly to the body
+ var fakeText = parent.paper.text(0, 0, '').attr(style).node;
+
+ while (lines.length) {
+ layouted.push(layoutNext(lines, maxWidth, fakeText));
+ }
+
+ var totalHeight = reduce(layouted, function(sum, line, idx) {
+ return sum + line.height;
+ }, 0);
+
+ // the y position of the next line
+ var y, x;
+
+ switch (align.vertical) {
+ case 'middle':
+ y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
+ break;
+
+ default:
+ y = padding.top;
+ }
+
+ var textElement = parent.text().attr(style);
+
+ forEach(layouted, function(line) {
+ y += line.height;
+
+ switch (align.horizontal) {
+ case 'left':
+ x = padding.left;
+ break;
+
+ case 'right':
+ x = (maxWidth - padding.right - line.width);
+ break;
+
+ default:
+ // aka center
+ x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
+ }
+
+
+ var tspan = Snap.create('tspan', { x: x, y: y }).node;
+ tspan.textContent = line.text;
+
+ textElement.append(tspan);
+ });
+
+ // remove fake text
+ fakeText.parentNode.removeChild(fakeText);
+
+ return textElement;
+};
+
+
+module.exports = Text;
+},{"170":170,"175":175,"178":178,"74":74,"84":84,"88":88}],72:[function(_dereq_,module,exports){
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ┌────────────────────────────────────────────────────────────┐ \\
+// │ Eve 0.4.2 - JavaScript Events Library │ \\
+// ├────────────────────────────────────────────────────────────┤ \\
+// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
+// └────────────────────────────────────────────────────────────┘ \\
+
+(function (glob) {
+ var version = "0.4.2",
+ has = "hasOwnProperty",
+ separator = /[\.\/]/,
+ comaseparator = /\s*,\s*/,
+ wildcard = "*",
+ fun = function () {},
+ numsort = function (a, b) {
+ return a - b;
+ },
+ current_event,
+ stop,
+ events = {n: {}},
+ firstDefined = function () {
+ for (var i = 0, ii = this.length; i < ii; i++) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ lastDefined = function () {
+ var i = this.length;
+ while (--i) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ /*\
+ * eve
+ [ method ]
+
+ * Fires event with given `name`, given scope and other parameters.
+
+ > Arguments
+
+ - name (string) name of the *event*, dot (`.`) or slash (`/`) separated
+ - scope (object) context for the event handlers
+ - varargs (...) the rest of arguments will be sent to event handlers
+
+ = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
+ \*/
+ eve = function (name, scope) {
+ name = String(name);
+ var e = events,
+ oldstop = stop,
+ args = Array.prototype.slice.call(arguments, 2),
+ listeners = eve.listeners(name),
+ z = 0,
+ f = false,
+ l,
+ indexed = [],
+ queue = {},
+ out = [],
+ ce = current_event,
+ errors = [];
+ out.firstDefined = firstDefined;
+ out.lastDefined = lastDefined;
+ current_event = name;
+ stop = 0;
+ for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
+ indexed.push(listeners[i].zIndex);
+ if (listeners[i].zIndex < 0) {
+ queue[listeners[i].zIndex] = listeners[i];
+ }
+ }
+ indexed.sort(numsort);
+ while (indexed[z] < 0) {
+ l = queue[indexed[z++]];
+ out.push(l.apply(scope, args));
+ if (stop) {
+ stop = oldstop;
+ return out;
+ }
+ }
+ for (i = 0; i < ii; i++) {
+ l = listeners[i];
+ if ("zIndex" in l) {
+ if (l.zIndex == indexed[z]) {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ do {
+ z++;
+ l = queue[indexed[z]];
+ l && out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ } while (l)
+ } else {
+ queue[l.zIndex] = l;
+ }
+ } else {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ }
+ }
+ stop = oldstop;
+ current_event = ce;
+ return out;
+ };
+ // Undocumented. Debug only.
+ eve._events = events;
+ /*\
+ * eve.listeners
+ [ method ]
+
+ * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
+
+ > Arguments
+
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated
+
+ = (array) array of event handlers
+ \*/
+ eve.listeners = function (name) {
+ var names = name.split(separator),
+ e = events,
+ item,
+ items,
+ k,
+ i,
+ ii,
+ j,
+ jj,
+ nes,
+ es = [e],
+ out = [];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ nes = [];
+ for (j = 0, jj = es.length; j < jj; j++) {
+ e = es[j].n;
+ items = [e[names[i]], e[wildcard]];
+ k = 2;
+ while (k--) {
+ item = items[k];
+ if (item) {
+ nes.push(item);
+ out = out.concat(item.f || []);
+ }
+ }
+ }
+ es = nes;
+ }
+ return out;
+ };
+
+ /*\
+ * eve.on
+ [ method ]
+ **
+ * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
+ | eve.on("*.under.*", f);
+ | eve("mouse.under.floor"); // triggers f
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
+ > Example:
+ | eve.on("mouse", eatIt)(2);
+ | eve.on("mouse", scream);
+ | eve.on("mouse", catchIt)(1);
+ * This will ensure that `catchIt` function will be called before `eatIt`.
+ *
+ * If you want to put your handler before non-indexed handlers, specify a negative value.
+ * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
+ \*/
+ eve.on = function (name, f) {
+ name = String(name);
+ if (typeof f != "function") {
+ return function () {};
+ }
+ var names = name.split(comaseparator);
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ (function (name) {
+ var names = name.split(separator),
+ e = events,
+ exist;
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ e = e.n;
+ e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
+ }
+ e.f = e.f || [];
+ for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
+ exist = true;
+ break;
+ }
+ !exist && e.f.push(f);
+ }(names[i]));
+ }
+ return function (zIndex) {
+ if (+zIndex == +zIndex) {
+ f.zIndex = +zIndex;
+ }
+ };
+ };
+ /*\
+ * eve.f
+ [ method ]
+ **
+ * Returns function that will fire given event with optional arguments.
+ * Arguments that will be passed to the result function will be also
+ * concated to the list of final arguments.
+ | el.onclick = eve.f("click", 1, 2);
+ | eve.on("click", function (a, b, c) {
+ | console.log(a, b, c); // 1, 2, [event object]
+ | });
+ > Arguments
+ - event (string) event name
+ - varargs (…) and any other arguments
+ = (function) possible event handler function
+ \*/
+ eve.f = function (event) {
+ var attrs = [].slice.call(arguments, 1);
+ return function () {
+ eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
+ };
+ };
+ /*\
+ * eve.stop
+ [ method ]
+ **
+ * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
+ \*/
+ eve.stop = function () {
+ stop = 1;
+ };
+ /*\
+ * eve.nt
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ > Arguments
+ **
+ - subname (string) #optional subname of the event
+ **
+ = (string) name of the event, if `subname` is not specified
+ * or
+ = (boolean) `true`, if current event’s name contains `subname`
+ \*/
+ eve.nt = function (subname) {
+ if (subname) {
+ return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
+ }
+ return current_event;
+ };
+ /*\
+ * eve.nts
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ **
+ = (array) names of the event
+ \*/
+ eve.nts = function () {
+ return current_event.split(separator);
+ };
+ /*\
+ * eve.off
+ [ method ]
+ **
+ * Removes given function from the list of event listeners assigned to given name.
+ * If no arguments specified all the events will be cleared.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ \*/
+ /*\
+ * eve.unbind
+ [ method ]
+ **
+ * See @eve.off
+ \*/
+ eve.off = eve.unbind = function (name, f) {
+ if (!name) {
+ eve._events = events = {n: {}};
+ return;
+ }
+ var names = name.split(comaseparator);
+ if (names.length > 1) {
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ eve.off(names[i], f);
+ }
+ return;
+ }
+ names = name.split(separator);
+ var e,
+ key,
+ splice,
+ i, ii, j, jj,
+ cur = [events];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ for (j = 0; j < cur.length; j += splice.length - 2) {
+ splice = [j, 1];
+ e = cur[j].n;
+ if (names[i] != wildcard) {
+ if (e[names[i]]) {
+ splice.push(e[names[i]]);
+ }
+ } else {
+ for (key in e) if (e[has](key)) {
+ splice.push(e[key]);
+ }
+ }
+ cur.splice.apply(cur, splice);
+ }
+ }
+ for (i = 0, ii = cur.length; i < ii; i++) {
+ e = cur[i];
+ while (e.n) {
+ if (f) {
+ if (e.f) {
+ for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
+ e.f.splice(j, 1);
+ break;
+ }
+ !e.f.length && delete e.f;
+ }
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ var funcs = e.n[key].f;
+ for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
+ funcs.splice(j, 1);
+ break;
+ }
+ !funcs.length && delete e.n[key].f;
+ }
+ } else {
+ delete e.f;
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ delete e.n[key].f;
+ }
+ }
+ e = e.n;
+ }
+ }
+ };
+ /*\
+ * eve.once
+ [ method ]
+ **
+ * Binds given event handler with a given name to only run once then unbind itself.
+ | eve.once("login", f);
+ | eve("login"); // triggers f
+ | eve("login"); // no listeners
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) same return function as @eve.on
+ \*/
+ eve.once = function (name, f) {
+ var f2 = function () {
+ eve.unbind(name, f2);
+ return f.apply(this, arguments);
+ };
+ return eve.on(name, f2);
+ };
+ /*\
+ * eve.version
+ [ property (string) ]
+ **
+ * Current version of the library.
+ \*/
+ eve.version = version;
+ eve.toString = function () {
+ return "You are running Eve " + version;
+ };
+ (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() { return eve; })) : (glob.eve = eve));
+})(this);
+
+},{}],73:[function(_dereq_,module,exports){
+// Snap.svg 0.3.0
+//
+// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// build: 2014-09-08
+
+(function (glob, factory) {
+ // AMD support
+ if (typeof define === "function" && define.amd) {
+ // Define as an anonymous module
+ define(["eve"], function( eve ) {
+ return factory(glob, eve);
+ });
+ } else if (typeof exports !== 'undefined') {
+ // Next for Node.js or CommonJS
+ var eve = _dereq_(72);
+ module.exports = factory(glob, eve);
+ } else {
+ // Browser globals (glob is window)
+ // Snap adds itself to window
+ factory(glob, glob.eve);
+ }
+}(window || this, function (window, eve) {
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+var mina = (function (eve) {
+ var animations = {},
+ requestAnimFrame = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function (callback) {
+ setTimeout(callback, 16);
+ },
+ isArray = Array.isArray || function (a) {
+ return a instanceof Array ||
+ Object.prototype.toString.call(a) == "[object Array]";
+ },
+ idgen = 0,
+ idprefix = "M" + (+new Date).toString(36),
+ ID = function () {
+ return idprefix + (idgen++).toString(36);
+ },
+ diff = function (a, b, A, B) {
+ if (isArray(a)) {
+ res = [];
+ for (var i = 0, ii = a.length; i < ii; i++) {
+ res[i] = diff(a[i], b, A[i], B);
+ }
+ return res;
+ }
+ var dif = (A - a) / (B - b);
+ return function (bb) {
+ return a + dif * (bb - b);
+ };
+ },
+ timer = Date.now || function () {
+ return +new Date;
+ },
+ sta = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.s;
+ }
+ var ds = a.s - val;
+ a.b += a.dur * ds;
+ a.B += a.dur * ds;
+ a.s = val;
+ },
+ speed = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.spd;
+ }
+ a.spd = val;
+ },
+ duration = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.dur;
+ }
+ a.s = a.s * val / a.dur;
+ a.dur = val;
+ },
+ stopit = function () {
+ var a = this;
+ delete animations[a.id];
+ a.update();
+ eve("mina.stop." + a.id, a);
+ },
+ pause = function () {
+ var a = this;
+ if (a.pdif) {
+ return;
+ }
+ delete animations[a.id];
+ a.update();
+ a.pdif = a.get() - a.b;
+ },
+ resume = function () {
+ var a = this;
+ if (!a.pdif) {
+ return;
+ }
+ a.b = a.get() - a.pdif;
+ delete a.pdif;
+ animations[a.id] = a;
+ },
+ update = function () {
+ var a = this,
+ res;
+ if (isArray(a.start)) {
+ res = [];
+ for (var j = 0, jj = a.start.length; j < jj; j++) {
+ res[j] = +a.start[j] +
+ (a.end[j] - a.start[j]) * a.easing(a.s);
+ }
+ } else {
+ res = +a.start + (a.end - a.start) * a.easing(a.s);
+ }
+ a.set(res);
+ },
+ frame = function () {
+ var len = 0;
+ for (var i in animations) if (animations.hasOwnProperty(i)) {
+ var a = animations[i],
+ b = a.get(),
+ res;
+ len++;
+ a.s = (b - a.b) / (a.dur / a.spd);
+ if (a.s >= 1) {
+ delete animations[i];
+ a.s = 1;
+ len--;
+ (function (a) {
+ setTimeout(function () {
+ eve("mina.finish." + a.id, a);
+ });
+ }(a));
+ }
+ a.update();
+ }
+ len && requestAnimFrame(frame);
+ },
+ /*\
+ * mina
+ [ method ]
+ **
+ * Generic animation of numbers
+ **
+ - a (number) start _slave_ number
+ - A (number) end _slave_ number
+ - b (number) start _master_ number (start time in general case)
+ - B (number) end _master_ number (end time in gereal case)
+ - get (function) getter of _master_ number (see @mina.time)
+ - set (function) setter of _slave_ number
+ - easing (function) #optional easing function, default is @mina.linear
+ = (object) animation descriptor
+ o {
+ o id (string) animation id,
+ o start (number) start _slave_ number,
+ o end (number) end _slave_ number,
+ o b (number) start _master_ number,
+ o s (number) animation status (0..1),
+ o dur (number) animation duration,
+ o spd (number) animation speed,
+ o get (function) getter of _master_ number (see @mina.time),
+ o set (function) setter of _slave_ number,
+ o easing (function) easing function, default is @mina.linear,
+ o status (function) status getter/setter,
+ o speed (function) speed getter/setter,
+ o duration (function) duration getter/setter,
+ o stop (function) animation stopper
+ o pause (function) pauses the animation
+ o resume (function) resumes the animation
+ o update (function) calles setter with the right value of the animation
+ o }
+ \*/
+ mina = function (a, A, b, B, get, set, easing) {
+ var anim = {
+ id: ID(),
+ start: a,
+ end: A,
+ b: b,
+ s: 0,
+ dur: B - b,
+ spd: 1,
+ get: get,
+ set: set,
+ easing: easing || mina.linear,
+ status: sta,
+ speed: speed,
+ duration: duration,
+ stop: stopit,
+ pause: pause,
+ resume: resume,
+ update: update
+ };
+ animations[anim.id] = anim;
+ var len = 0, i;
+ for (i in animations) if (animations.hasOwnProperty(i)) {
+ len++;
+ if (len == 2) {
+ break;
+ }
+ }
+ len == 1 && requestAnimFrame(frame);
+ return anim;
+ };
+ /*\
+ * mina.time
+ [ method ]
+ **
+ * Returns the current time. Equivalent to:
+ | function () {
+ | return (new Date).getTime();
+ | }
+ \*/
+ mina.time = timer;
+ /*\
+ * mina.getById
+ [ method ]
+ **
+ * Returns an animation by its id
+ - id (string) animation's id
+ = (object) See @mina
+ \*/
+ mina.getById = function (id) {
+ return animations[id] || null;
+ };
+
+ /*\
+ * mina.linear
+ [ method ]
+ **
+ * Default linear easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.linear = function (n) {
+ return n;
+ };
+ /*\
+ * mina.easeout
+ [ method ]
+ **
+ * Easeout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeout = function (n) {
+ return Math.pow(n, 1.7);
+ };
+ /*\
+ * mina.easein
+ [ method ]
+ **
+ * Easein easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easein = function (n) {
+ return Math.pow(n, .48);
+ };
+ /*\
+ * mina.easeinout
+ [ method ]
+ **
+ * Easeinout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeinout = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ if (n == 0) {
+ return 0;
+ }
+ var q = .48 - n / 1.04,
+ Q = Math.sqrt(.1734 + q * q),
+ x = Q - q,
+ X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
+ y = -Q - q,
+ Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
+ t = X + Y + .5;
+ return (1 - t) * 3 * t * t + t * t * t;
+ };
+ /*\
+ * mina.backin
+ [ method ]
+ **
+ * Backin easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backin = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ var s = 1.70158;
+ return n * n * ((s + 1) * n - s);
+ };
+ /*\
+ * mina.backout
+ [ method ]
+ **
+ * Backout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backout = function (n) {
+ if (n == 0) {
+ return 0;
+ }
+ n = n - 1;
+ var s = 1.70158;
+ return n * n * ((s + 1) * n + s) + 1;
+ };
+ /*\
+ * mina.elastic
+ [ method ]
+ **
+ * Elastic easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.elastic = function (n) {
+ if (n == !!n) {
+ return n;
+ }
+ return Math.pow(2, -10 * n) * Math.sin((n - .075) *
+ (2 * Math.PI) / .3) + 1;
+ };
+ /*\
+ * mina.bounce
+ [ method ]
+ **
+ * Bounce easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.bounce = function (n) {
+ var s = 7.5625,
+ p = 2.75,
+ l;
+ if (n < (1 / p)) {
+ l = s * n * n;
+ } else {
+ if (n < (2 / p)) {
+ n -= (1.5 / p);
+ l = s * n * n + .75;
+ } else {
+ if (n < (2.5 / p)) {
+ n -= (2.25 / p);
+ l = s * n * n + .9375;
+ } else {
+ n -= (2.625 / p);
+ l = s * n * n + .984375;
+ }
+ }
+ }
+ return l;
+ };
+ window.mina = mina;
+ return mina;
+})(typeof eve == "undefined" ? function () {} : eve);
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+var Snap = (function(root) {
+Snap.version = "0.3.0";
+/*\
+ * Snap
+ [ method ]
+ **
+ * Creates a drawing surface or wraps existing SVG element.
+ **
+ - width (number|string) width of surface
+ - height (number|string) height of surface
+ * or
+ - DOM (SVGElement) element to be wrapped into Snap structure
+ * or
+ - array (array) array of elements (will return set of elements)
+ * or
+ - query (string) CSS query selector
+ = (object) @Element
+\*/
+function Snap(w, h) {
+ if (w) {
+ if (w.tagName) {
+ return wrap(w);
+ }
+ if (is(w, "array") && Snap.set) {
+ return Snap.set.apply(Snap, w);
+ }
+ if (w instanceof Element) {
+ return w;
+ }
+ if (h == null) {
+ w = glob.doc.querySelector(w);
+ return wrap(w);
+ }
+ }
+ w = w == null ? "100%" : w;
+ h = h == null ? "100%" : h;
+ return new Paper(w, h);
+}
+Snap.toString = function () {
+ return "Snap v" + this.version;
+};
+Snap._ = {};
+var glob = {
+ win: root.window,
+ doc: root.window.document
+};
+Snap._.glob = glob;
+var has = "hasOwnProperty",
+ Str = String,
+ toFloat = parseFloat,
+ toInt = parseInt,
+ math = Math,
+ mmax = math.max,
+ mmin = math.min,
+ abs = math.abs,
+ pow = math.pow,
+ PI = math.PI,
+ round = math.round,
+ E = "",
+ S = " ",
+ objectToString = Object.prototype.toString,
+ ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
+ colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
+ bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ separator = Snap._.separator = /[,\s]+/,
+ whitespace = /[\s]/g,
+ commaSpaces = /[\s]*,[\s]*/,
+ hsrg = {hs: 1, rg: 1},
+ pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
+ idgen = 0,
+ idprefix = "S" + (+new Date).toString(36),
+ ID = function (el) {
+ return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
+ },
+ xlink = "http://www.w3.org/1999/xlink",
+ xmlns = "http://www.w3.org/2000/svg",
+ hub = {},
+ URL = Snap.url = function (url) {
+ return "url('#" + url + "')";
+ };
+
+function $(el, attr) {
+ if (attr) {
+ if (el == "#text") {
+ el = glob.doc.createTextNode(attr.text || "");
+ }
+ if (typeof el == "string") {
+ el = $(el);
+ }
+ if (typeof attr == "string") {
+ if (attr.substring(0, 6) == "xlink:") {
+ return el.getAttributeNS(xlink, attr.substring(6));
+ }
+ if (attr.substring(0, 4) == "xml:") {
+ return el.getAttributeNS(xmlns, attr.substring(4));
+ }
+ return el.getAttribute(attr);
+ }
+ for (var key in attr) if (attr[has](key)) {
+ var val = Str(attr[key]);
+ if (val) {
+ if (key.substring(0, 6) == "xlink:") {
+ el.setAttributeNS(xlink, key.substring(6), val);
+ } else if (key.substring(0, 4) == "xml:") {
+ el.setAttributeNS(xmlns, key.substring(4), val);
+ } else {
+ el.setAttribute(key, val);
+ }
+ } else {
+ el.removeAttribute(key);
+ }
+ }
+ } else {
+ el = glob.doc.createElementNS(xmlns, el);
+ }
+ return el;
+}
+Snap._.$ = $;
+Snap._.id = ID;
+function getAttrs(el) {
+ var attrs = el.attributes,
+ name,
+ out = {};
+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].namespaceURI == xlink) {
+ name = "xlink:";
+ } else {
+ name = "";
+ }
+ name += attrs[i].name;
+ out[name] = attrs[i].textContent;
+ }
+ return out;
+}
+function is(o, type) {
+ type = Str.prototype.toLowerCase.call(type);
+ if (type == "finite") {
+ return isFinite(o);
+ }
+ if (type == "array" &&
+ (o instanceof Array || Array.isArray && Array.isArray(o))) {
+ return true;
+ }
+ return (type == "null" && o === null) ||
+ (type == typeof o && o !== null) ||
+ (type == "object" && o === Object(o)) ||
+ objectToString.call(o).slice(8, -1).toLowerCase() == type;
+}
+/*\
+ * Snap.format
+ [ method ]
+ **
+ * Replaces construction of type `{<name>}` to the corresponding argument
+ **
+ - token (string) string to format
+ - json (object) object which properties are used as a replacement
+ = (string) formatted string
+ > Usage
+ | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+ | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
+ | x: 10,
+ | y: 20,
+ | dim: {
+ | width: 40,
+ | height: 50,
+ | "negative width": -40
+ | }
+ | }));
+\*/
+Snap.format = (function () {
+ var tokenRegex = /\{([^\}]+)\}/g,
+ objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
+ replacer = function (all, key, obj) {
+ var res = obj;
+ key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
+ name = name || quotedName;
+ if (res) {
+ if (name in res) {
+ res = res[name];
+ }
+ typeof res == "function" && isFunc && (res = res());
+ }
+ });
+ res = (res == null || res == obj ? all : res) + "";
+ return res;
+ };
+ return function (str, obj) {
+ return Str(str).replace(tokenRegex, function (all, key) {
+ return replacer(all, key, obj);
+ });
+ };
+})();
+function clone(obj) {
+ if (typeof obj == "function" || Object(obj) !== obj) {
+ return obj;
+ }
+ var res = new obj.constructor;
+ for (var key in obj) if (obj[has](key)) {
+ res[key] = clone(obj[key]);
+ }
+ return res;
+}
+Snap._.clone = clone;
+function repush(array, item) {
+ for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
+ return array.push(array.splice(i, 1)[0]);
+ }
+}
+function cacher(f, scope, postprocessor) {
+ function newf() {
+ var arg = Array.prototype.slice.call(arguments, 0),
+ args = arg.join("\u2400"),
+ cache = newf.cache = newf.cache || {},
+ count = newf.count = newf.count || [];
+ if (cache[has](args)) {
+ repush(count, args);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ count.length >= 1e3 && delete cache[count.shift()];
+ count.push(args);
+ cache[args] = f.apply(scope, arg);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ return newf;
+}
+Snap._.cacher = cacher;
+function angle(x1, y1, x2, y2, x3, y3) {
+ if (x3 == null) {
+ var x = x1 - x2,
+ y = y1 - y2;
+ if (!x && !y) {
+ return 0;
+ }
+ return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
+ } else {
+ return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
+ }
+}
+function rad(deg) {
+ return deg % 360 * PI / 180;
+}
+function deg(rad) {
+ return rad * 180 / PI % 360;
+}
+function x_y() {
+ return this.x + S + this.y;
+}
+function x_y_w_h() {
+ return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
+}
+
+/*\
+ * Snap.rad
+ [ method ]
+ **
+ * Transform angle to radians
+ - deg (number) angle in degrees
+ = (number) angle in radians
+\*/
+Snap.rad = rad;
+/*\
+ * Snap.deg
+ [ method ]
+ **
+ * Transform angle to degrees
+ - rad (number) angle in radians
+ = (number) angle in degrees
+\*/
+Snap.deg = deg;
+/*\
+ * Snap.angle
+ [ method ]
+ **
+ * Returns an angle between two or three points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ - x3 (number) #optional x coord of third point
+ - y3 (number) #optional y coord of third point
+ = (number) angle in degrees
+\*/
+Snap.angle = angle;
+/*\
+ * Snap.is
+ [ method ]
+ **
+ * Handy replacement for the `typeof` operator
+ - o (…) any object or primitive
+ - type (string) name of the type, e.g., `string`, `function`, `number`, etc.
+ = (boolean) `true` if given value is of given type
+\*/
+Snap.is = is;
+/*\
+ * Snap.snapTo
+ [ method ]
+ **
+ * Snaps given value to given grid
+ - values (array|number) given array of values or step of the grid
+ - value (number) value to adjust
+ - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.
+ = (number) adjusted value
+\*/
+Snap.snapTo = function (values, value, tolerance) {
+ tolerance = is(tolerance, "finite") ? tolerance : 10;
+ if (is(values, "array")) {
+ var i = values.length;
+ while (i--) if (abs(values[i] - value) <= tolerance) {
+ return values[i];
+ }
+ } else {
+ values = +values;
+ var rem = value % values;
+ if (rem < tolerance) {
+ return value - rem;
+ }
+ if (rem > values - tolerance) {
+ return value - rem + values;
+ }
+ }
+ return value;
+};
+// Colour
+/*\
+ * Snap.getRGB
+ [ method ]
+ **
+ * Parses color string as RGB object
+ - color (string) color string in one of the following formats:
+ # <ul>
+ # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
+ # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
+ # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
+ # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>
+ # <li>rgba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>
+ # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>
+ # <li>hsba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>
+ # <li>hsla(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # </ul>
+ * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) true if string can't be parsed
+ o }
+\*/
+Snap.getRGB = cacher(function (colour) {
+ if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ if (colour == "none") {
+ return {r: -1, g: -1, b: -1, hex: "none", toString: rgbtoString};
+ }
+ !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
+ if (!colour) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ var res,
+ red,
+ green,
+ blue,
+ opacity,
+ t,
+ values,
+ rgb = colour.match(colourRegExp);
+ if (rgb) {
+ if (rgb[2]) {
+ blue = toInt(rgb[2].substring(5), 16);
+ green = toInt(rgb[2].substring(3, 5), 16);
+ red = toInt(rgb[2].substring(1, 3), 16);
+ }
+ if (rgb[3]) {
+ blue = toInt((t = rgb[3].charAt(3)) + t, 16);
+ green = toInt((t = rgb[3].charAt(2)) + t, 16);
+ red = toInt((t = rgb[3].charAt(1)) + t, 16);
+ }
+ if (rgb[4]) {
+ values = rgb[4].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ }
+ if (rgb[5]) {
+ values = rgb[5].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsb2rgb(red, green, blue, opacity);
+ }
+ if (rgb[6]) {
+ values = rgb[6].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsl2rgb(red, green, blue, opacity);
+ }
+ red = mmin(math.round(red), 255);
+ green = mmin(math.round(green), 255);
+ blue = mmin(math.round(blue), 255);
+ opacity = mmin(mmax(opacity, 0), 1);
+ rgb = {r: red, g: green, b: blue, toString: rgbtoString};
+ rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
+ rgb.opacity = is(opacity, "finite") ? opacity : 1;
+ return rgb;
+ }
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+}, Snap);
+// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.
+/*\
+ * Snap.hsb
+ [ method ]
+ **
+ * Converts HSB values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - b (number) value or brightness
+ = (string) hex representation of the color
+\*/
+Snap.hsb = cacher(function (h, s, b) {
+ return Snap.hsb2rgb(h, s, b).hex;
+});
+/*\
+ * Snap.hsl
+ [ method ]
+ **
+ * Converts HSL values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (string) hex representation of the color
+\*/
+Snap.hsl = cacher(function (h, s, l) {
+ return Snap.hsl2rgb(h, s, l).hex;
+});
+/*\
+ * Snap.rgb
+ [ method ]
+ **
+ * Converts RGB values to a hex representation of the color
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (string) hex representation of the color
+\*/
+Snap.rgb = cacher(function (r, g, b, o) {
+ if (is(o, "finite")) {
+ var round = math.round;
+ return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
+ }
+ return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
+});
+var toHex = function (color) {
+ var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
+ red = "rgb(255, 0, 0)";
+ toHex = cacher(function (color) {
+ if (color.toLowerCase() == "red") {
+ return red;
+ }
+ i.style.color = red;
+ i.style.color = color;
+ var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
+ return out == red ? null : out;
+ });
+ return toHex(color);
+},
+hsbtoString = function () {
+ return "hsb(" + [this.h, this.s, this.b] + ")";
+},
+hsltoString = function () {
+ return "hsl(" + [this.h, this.s, this.l] + ")";
+},
+rgbtoString = function () {
+ return this.opacity == 1 || this.opacity == null ?
+ this.hex :
+ "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
+},
+prepareRGB = function (r, g, b) {
+ if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
+ b = r.b;
+ g = r.g;
+ r = r.r;
+ }
+ if (g == null && is(r, string)) {
+ var clr = Snap.getRGB(r);
+ r = clr.r;
+ g = clr.g;
+ b = clr.b;
+ }
+ if (r > 1 || g > 1 || b > 1) {
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ }
+
+ return [r, g, b];
+},
+packageRGB = function (r, g, b, o) {
+ r = math.round(r * 255);
+ g = math.round(g * 255);
+ b = math.round(b * 255);
+ var rgb = {
+ r: r,
+ g: g,
+ b: b,
+ opacity: is(o, "finite") ? o : 1,
+ hex: Snap.rgb(r, g, b),
+ toString: rgbtoString
+ };
+ is(o, "finite") && (rgb.opacity = o);
+ return rgb;
+};
+// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?
+/*\
+ * Snap.color
+ [ method ]
+ **
+ * Parses the color string and returns an object featuring the color's component values
+ - clr (string) color string in one of the supported formats (see @Snap.getRGB)
+ = (object) Combined RGB/HSB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) `true` if string can't be parsed,
+ o h (number) hue,
+ o s (number) saturation,
+ o v (number) value (brightness),
+ o l (number) lightness
+ o }
+\*/
+Snap.color = function (clr) {
+ var rgb;
+ if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
+ rgb = Snap.hsb2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
+ rgb = Snap.hsl2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else {
+ if (is(clr, "string")) {
+ clr = Snap.getRGB(clr);
+ }
+ if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
+ rgb = Snap.rgb2hsl(clr);
+ clr.h = rgb.h;
+ clr.s = rgb.s;
+ clr.l = rgb.l;
+ rgb = Snap.rgb2hsb(clr);
+ clr.v = rgb.b;
+ } else {
+ clr = {hex: "none"};
+ clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
+ clr.error = 1;
+ }
+ }
+ clr.toString = rgbtoString;
+ return clr;
+};
+/*\
+ * Snap.hsb2rgb
+ [ method ]
+ **
+ * Converts HSB values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - v (number) value or brightness
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsb2rgb = function (h, s, v, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
+ v = h.b;
+ s = h.s;
+ h = h.h;
+ o = h.o;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = v * s;
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = v - C;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.hsl2rgb
+ [ method ]
+ **
+ * Converts HSL values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsl2rgb = function (h, s, l, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
+ l = h.l;
+ s = h.s;
+ h = h.h;
+ }
+ if (h > 1 || s > 1 || l > 1) {
+ h /= 360;
+ s /= 100;
+ l /= 100;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = 2 * s * (l < .5 ? l : 1 - l);
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = l - C / 2;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.rgb2hsb
+ [ method ]
+ **
+ * Converts RGB values to an HSB object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSB object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o b (number) brightness
+ o }
+\*/
+Snap.rgb2hsb = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, V, C;
+ V = mmax(r, g, b);
+ C = V - mmin(r, g, b);
+ H = (C == 0 ? null :
+ V == r ? (g - b) / C :
+ V == g ? (b - r) / C + 2 :
+ (r - g) / C + 4
+ );
+ H = ((H + 360) % 6) * 60 / 360;
+ S = C == 0 ? 0 : C / V;
+ return {h: H, s: S, b: V, toString: hsbtoString};
+};
+/*\
+ * Snap.rgb2hsl
+ [ method ]
+ **
+ * Converts RGB values to an HSL object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSL object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o l (number) luminosity
+ o }
+\*/
+Snap.rgb2hsl = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, L, M, m, C;
+ M = mmax(r, g, b);
+ m = mmin(r, g, b);
+ C = M - m;
+ H = (C == 0 ? null :
+ M == r ? (g - b) / C :
+ M == g ? (b - r) / C + 2 :
+ (r - g) / C + 4);
+ H = ((H + 360) % 6) * 60 / 360;
+ L = (M + m) / 2;
+ S = (C == 0 ? 0 :
+ L < .5 ? C / (2 * L) :
+ C / (2 - 2 * L));
+ return {h: H, s: S, l: L, toString: hsltoString};
+};
+
+// Transformations
+// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured?
+/*\
+ * Snap.parsePathString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given path string into an array of arrays of path segments
+ - pathString (string|array) path string or array of segments (in the last case it is returned straight away)
+ = (array) array of segments
+\*/
+Snap.parsePathString = function (pathString) {
+ if (!pathString) {
+ return null;
+ }
+ var pth = Snap.path(pathString);
+ if (pth.arr) {
+ return Snap.path.clone(pth.arr);
+ }
+
+ var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
+ data = [];
+ if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
+ data = Snap.path.clone(pathString);
+ }
+ if (!data.length) {
+ Str(pathString).replace(pathCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ if (name == "m" && params.length > 2) {
+ data.push([b].concat(params.splice(0, 2)));
+ name = "l";
+ b = b == "m" ? "l" : "L";
+ }
+ if (name == "o" && params.length == 1) {
+ data.push([b, params[0]]);
+ }
+ if (name == "r") {
+ data.push([b].concat(params));
+ } else while (params.length >= paramCounts[name]) {
+ data.push([b].concat(params.splice(0, paramCounts[name])));
+ if (!paramCounts[name]) {
+ break;
+ }
+ }
+ });
+ }
+ data.toString = Snap.path.toString;
+ pth.arr = Snap.path.clone(data);
+ return data;
+};
+/*\
+ * Snap.parseTransformString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given transform string into an array of transformations
+ - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)
+ = (array) array of transformations
+\*/
+var parseTransformString = Snap.parseTransformString = function (TString) {
+ if (!TString) {
+ return null;
+ }
+ var paramCounts = {r: 3, s: 4, t: 2, m: 6},
+ data = [];
+ if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
+ data = Snap.path.clone(TString);
+ }
+ if (!data.length) {
+ Str(TString).replace(tCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ data.push([b].concat(params));
+ });
+ }
+ data.toString = Snap.path.toString;
+ return data;
+};
+function svgTransform2string(tstr) {
+ var res = [];
+ tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function (all, name, params) {
+ params = params.split(/\s*,\s*|\s+/);
+ if (name == "rotate" && params.length == 1) {
+ params.push(0, 0);
+ }
+ if (name == "scale") {
+ if (params.length > 2) {
+ params = params.slice(0, 2);
+ } else if (params.length == 2) {
+ params.push(0, 0);
+ }
+ if (params.length == 1) {
+ params.push(params[0], 0, 0);
+ }
+ }
+ if (name == "skewX") {
+ res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
+ } else if (name == "skewY") {
+ res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
+ } else {
+ res.push([name.charAt(0)].concat(params));
+ }
+ return all;
+ });
+ return res;
+}
+Snap._.svgTransform2string = svgTransform2string;
+Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
+function transform2matrix(tstr, bbox) {
+ var tdata = parseTransformString(tstr),
+ m = new Snap.Matrix;
+ if (tdata) {
+ for (var i = 0, ii = tdata.length; i < ii; i++) {
+ var t = tdata[i],
+ tlen = t.length,
+ command = Str(t[0]).toLowerCase(),
+ absolute = t[0] != command,
+ inver = absolute ? m.invert() : 0,
+ x1,
+ y1,
+ x2,
+ y2,
+ bb;
+ if (command == "t" && tlen == 2){
+ m.translate(t[1], 0);
+ } else if (command == "t" && tlen == 3) {
+ if (absolute) {
+ x1 = inver.x(0, 0);
+ y1 = inver.y(0, 0);
+ x2 = inver.x(t[1], t[2]);
+ y2 = inver.y(t[1], t[2]);
+ m.translate(x2 - x1, y2 - y1);
+ } else {
+ m.translate(t[1], t[2]);
+ }
+ } else if (command == "r") {
+ if (tlen == 2) {
+ bb = bb || bbox;
+ m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.rotate(t[1], x2, y2);
+ } else {
+ m.rotate(t[1], t[2], t[3]);
+ }
+ }
+ } else if (command == "s") {
+ if (tlen == 2 || tlen == 3) {
+ bb = bb || bbox;
+ m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.scale(t[1], t[1], x2, y2);
+ } else {
+ m.scale(t[1], t[1], t[2], t[3]);
+ }
+ } else if (tlen == 5) {
+ if (absolute) {
+ x2 = inver.x(t[3], t[4]);
+ y2 = inver.y(t[3], t[4]);
+ m.scale(t[1], t[2], x2, y2);
+ } else {
+ m.scale(t[1], t[2], t[3], t[4]);
+ }
+ }
+ } else if (command == "m" && tlen == 7) {
+ m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
+ }
+ }
+ }
+ return m;
+}
+Snap._.transform2matrix = transform2matrix;
+Snap._unit2px = unit2px;
+var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
+ function (a, b) {
+ var adown = a.nodeType == 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a == bup || !!(bup && bup.nodeType == 1 && (
+ adown.contains ?
+ adown.contains(bup) :
+ a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
+ ));
+ } :
+ function (a, b) {
+ if (b) {
+ while (b) {
+ b = b.parentNode;
+ if (b == a) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+function getSomeDefs(el) {
+ var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
+ (el.node.parentNode && wrap(el.node.parentNode)) ||
+ Snap.select("svg") ||
+ Snap(0, 0),
+ pdefs = p.select("defs"),
+ defs = pdefs == null ? false : pdefs.node;
+ if (!defs) {
+ defs = make("defs", p.node).node;
+ }
+ return defs;
+}
+function getSomeSVG(el) {
+ return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
+}
+Snap._.getSomeDefs = getSomeDefs;
+Snap._.getSomeSVG = getSomeSVG;
+function unit2px(el, name, value) {
+ var svg = getSomeSVG(el).node,
+ out = {},
+ mgr = svg.querySelector(".svg---mgr");
+ if (!mgr) {
+ mgr = $("rect");
+ $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, "class": "svg---mgr", fill: "none"});
+ svg.appendChild(mgr);
+ }
+ function getW(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {width: val});
+ try {
+ return mgr.getBBox().width;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function getH(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {height: val});
+ try {
+ return mgr.getBBox().height;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function set(nam, f) {
+ if (name == null) {
+ out[nam] = f(el.attr(nam) || 0);
+ } else if (nam == name) {
+ out = f(value == null ? el.attr(nam) || 0 : value);
+ }
+ }
+ switch (el.type) {
+ case "rect":
+ set("rx", getW);
+ set("ry", getH);
+ case "image":
+ set("width", getW);
+ set("height", getH);
+ case "text":
+ set("x", getW);
+ set("y", getH);
+ break;
+ case "circle":
+ set("cx", getW);
+ set("cy", getH);
+ set("r", getW);
+ break;
+ case "ellipse":
+ set("cx", getW);
+ set("cy", getH);
+ set("rx", getW);
+ set("ry", getH);
+ break;
+ case "line":
+ set("x1", getW);
+ set("x2", getW);
+ set("y1", getH);
+ set("y2", getH);
+ break;
+ case "marker":
+ set("refX", getW);
+ set("markerWidth", getW);
+ set("refY", getH);
+ set("markerHeight", getH);
+ break;
+ case "radialGradient":
+ set("fx", getW);
+ set("fy", getH);
+ break;
+ case "tspan":
+ set("dx", getW);
+ set("dy", getH);
+ break;
+ default:
+ set(name, getW);
+ }
+ svg.removeChild(mgr);
+ return out;
+}
+/*\
+ * Snap.select
+ [ method ]
+ **
+ * Wraps a DOM element specified by CSS selector as @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(glob.doc.querySelector(query));
+};
+/*\
+ * Snap.selectAll
+ [ method ]
+ **
+ * Wraps DOM elements specified by CSS selector as set or array of @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.selectAll = function (query) {
+ var nodelist = glob.doc.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+};
+
+function add2group(list) {
+ if (!is(list, "array")) {
+ list = Array.prototype.slice.call(arguments, 0);
+ }
+ var i = 0,
+ j = 0,
+ node = this.node;
+ while (this[i]) delete this[i++];
+ for (i = 0; i < list.length; i++) {
+ if (list[i].type == "set") {
+ list[i].forEach(function (el) {
+ node.appendChild(el.node);
+ });
+ } else {
+ node.appendChild(list[i].node);
+ }
+ }
+ var children = node.childNodes;
+ for (i = 0; i < children.length; i++) {
+ this[j++] = wrap(children[i]);
+ }
+ return this;
+}
+// Hub garbage collector every 10s
+setInterval(function () {
+ for (var key in hub) if (hub[has](key)) {
+ var el = hub[key],
+ node = el.node;
+ if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
+ delete hub[key];
+ }
+ }
+}, 1e4);
+function Element(el) {
+ if (el.snap in hub) {
+ return hub[el.snap];
+ }
+ var svg;
+ try {
+ svg = el.ownerSVGElement;
+ } catch(e) {}
+ /*\
+ * Element.node
+ [ property (object) ]
+ **
+ * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
+ > Usage
+ | // draw a circle at coordinate 10,10 with radius of 10
+ | var c = paper.circle(10, 10, 10);
+ | c.node.onclick = function () {
+ | c.attr("fill", "red");
+ | };
+ \*/
+ this.node = el;
+ if (svg) {
+ this.paper = new Paper(svg);
+ }
+ /*\
+ * Element.type
+ [ property (string) ]
+ **
+ * SVG tag name of the given element.
+ \*/
+ this.type = el.tagName;
+ var id = this.id = ID(this);
+ this.anims = {};
+ this._ = {
+ transform: []
+ };
+ el.snap = id;
+ hub[id] = this;
+ if (this.type == "g") {
+ this.add = add2group;
+ }
+ if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
+ for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
+ this[method] = Paper.prototype[method];
+ }
+ }
+}
+ /*\
+ * Element.attr
+ [ method ]
+ **
+ * Gets or sets given attributes of the element.
+ **
+ - params (object) contains key-value pairs of attributes you want to set
+ * or
+ - param (string) name of the attribute
+ = (Element) the current element
+ * or
+ = (string) value of attribute
+ > Usage
+ | el.attr({
+ | fill: "#fc0",
+ | stroke: "#000",
+ | strokeWidth: 2, // CamelCase...
+ | "fill-opacity": 0.5, // or dash-separated names
+ | width: "*=2" // prefixed values
+ | });
+ | console.log(el.attr("fill")); // #fc0
+ * Prefixed values in format `"+=10"` supported. All four operations
+ * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`
+ * and `-`: `"+=2em"`.
+ \*/
+ Element.prototype.attr = function (params, value) {
+ var el = this,
+ node = el.node;
+ if (!params) {
+ return el;
+ }
+ if (is(params, "string")) {
+ if (arguments.length > 1) {
+ var json = {};
+ json[params] = value;
+ params = json;
+ } else {
+ return eve("snap.util.getattr." + params, el).firstDefined();
+ }
+ }
+ for (var att in params) {
+ if (params[has](att)) {
+ eve("snap.util.attr." + att, el, params[att]);
+ }
+ }
+ return el;
+ };
+/*\
+ * Snap.parse
+ [ method ]
+ **
+ * Parses SVG fragment and converts it into a @Fragment
+ **
+ - svg (string) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.parse = function (svg) {
+ var f = glob.doc.createDocumentFragment(),
+ full = true,
+ div = glob.doc.createElement("div");
+ svg = Str(svg);
+ if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
+ svg = "<svg>" + svg + "</svg>";
+ full = false;
+ }
+ div.innerHTML = svg;
+ svg = div.getElementsByTagName("svg")[0];
+ if (svg) {
+ if (full) {
+ f = svg;
+ } else {
+ while (svg.firstChild) {
+ f.appendChild(svg.firstChild);
+ }
+ div.innerHTML = E;
+ }
+ }
+ return new Fragment(f);
+};
+function Fragment(frag) {
+ this.node = frag;
+}
+// SIERRA Snap.fragment() could especially use a code example
+/*\
+ * Snap.fragment
+ [ method ]
+ **
+ * Creates a DOM fragment from a given list of elements or strings
+ **
+ - varargs (…) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.fragment = function () {
+ var args = Array.prototype.slice.call(arguments, 0),
+ f = glob.doc.createDocumentFragment();
+ for (var i = 0, ii = args.length; i < ii; i++) {
+ var item = args[i];
+ if (item.node && item.node.nodeType) {
+ f.appendChild(item.node);
+ }
+ if (item.nodeType) {
+ f.appendChild(item);
+ }
+ if (typeof item == "string") {
+ f.appendChild(Snap.parse(item).node);
+ }
+ }
+ return new Fragment(f);
+};
+
+function make(name, parent) {
+ var res = $(name);
+ parent.appendChild(res);
+ var el = wrap(res);
+ return el;
+}
+function Paper(w, h) {
+ var res,
+ desc,
+ defs,
+ proto = Paper.prototype;
+ if (w && w.tagName == "svg") {
+ if (w.snap in hub) {
+ return hub[w.snap];
+ }
+ var doc = w.ownerDocument;
+ res = new Element(w);
+ desc = w.getElementsByTagName("desc")[0];
+ defs = w.getElementsByTagName("defs")[0];
+ if (!desc) {
+ desc = $("desc");
+ desc.appendChild(doc.createTextNode("Created with Snap"));
+ res.node.appendChild(desc);
+ }
+ if (!defs) {
+ defs = $("defs");
+ res.node.appendChild(defs);
+ }
+ res.defs = defs;
+ for (var key in proto) if (proto[has](key)) {
+ res[key] = proto[key];
+ }
+ res.paper = res.root = res;
+ } else {
+ res = make("svg", glob.doc.body);
+ $(res.node, {
+ height: h,
+ version: 1.1,
+ width: w,
+ xmlns: xmlns
+ });
+ }
+ return res;
+}
+function wrap(dom) {
+ if (!dom) {
+ return dom;
+ }
+ if (dom instanceof Element || dom instanceof Fragment) {
+ return dom;
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
+ return new Paper(dom);
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
+ return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
+ }
+ return new Element(dom);
+}
+
+Snap._.make = make;
+Snap._.wrap = wrap;
+/*\
+ * Paper.el
+ [ method ]
+ **
+ * Creates an element on paper with a given name and no attributes
+ **
+ - name (string) tag name
+ - attr (object) attributes
+ = (Element) the current element
+ > Usage
+ | var c = paper.circle(10, 10, 10); // is the same as...
+ | var c = paper.el("circle").attr({
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+ | // and the same as
+ | var c = paper.el("circle", {
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+\*/
+Paper.prototype.el = function (name, attr) {
+ var el = make(name, this.node);
+ attr && el.attr(attr);
+ return el;
+};
+// default
+eve.on("snap.util.getattr", function () {
+ var att = eve.nt();
+ att = att.substring(att.lastIndexOf(".") + 1);
+ var css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
+ } else {
+ return $(this.node, att);
+ }
+});
+var cssAttr = {
+ "alignment-baseline": 0,
+ "baseline-shift": 0,
+ "clip": 0,
+ "clip-path": 0,
+ "clip-rule": 0,
+ "color": 0,
+ "color-interpolation": 0,
+ "color-interpolation-filters": 0,
+ "color-profile": 0,
+ "color-rendering": 0,
+ "cursor": 0,
+ "direction": 0,
+ "display": 0,
+ "dominant-baseline": 0,
+ "enable-background": 0,
+ "fill": 0,
+ "fill-opacity": 0,
+ "fill-rule": 0,
+ "filter": 0,
+ "flood-color": 0,
+ "flood-opacity": 0,
+ "font": 0,
+ "font-family": 0,
+ "font-size": 0,
+ "font-size-adjust": 0,
+ "font-stretch": 0,
+ "font-style": 0,
+ "font-variant": 0,
+ "font-weight": 0,
+ "glyph-orientation-horizontal": 0,
+ "glyph-orientation-vertical": 0,
+ "image-rendering": 0,
+ "kerning": 0,
+ "letter-spacing": 0,
+ "lighting-color": 0,
+ "marker": 0,
+ "marker-end": 0,
+ "marker-mid": 0,
+ "marker-start": 0,
+ "mask": 0,
+ "opacity": 0,
+ "overflow": 0,
+ "pointer-events": 0,
+ "shape-rendering": 0,
+ "stop-color": 0,
+ "stop-opacity": 0,
+ "stroke": 0,
+ "stroke-dasharray": 0,
+ "stroke-dashoffset": 0,
+ "stroke-linecap": 0,
+ "stroke-linejoin": 0,
+ "stroke-miterlimit": 0,
+ "stroke-opacity": 0,
+ "stroke-width": 0,
+ "text-anchor": 0,
+ "text-decoration": 0,
+ "text-rendering": 0,
+ "unicode-bidi": 0,
+ "visibility": 0,
+ "word-spacing": 0,
+ "writing-mode": 0
+};
+
+eve.on("snap.util.attr", function (value) {
+ var att = eve.nt(),
+ attr = {};
+ att = att.substring(att.lastIndexOf(".") + 1);
+ attr[att] = value;
+ var style = att.replace(/-(\w)/gi, function (all, letter) {
+ return letter.toUpperCase();
+ }),
+ css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ this.node.style[style] = value == null ? E : value;
+ } else {
+ $(this.node, attr);
+ }
+});
+(function (proto) {}(Paper.prototype));
+
+// simple ajax
+/*\
+ * Snap.ajax
+ [ method ]
+ **
+ * Simple implementation of Ajax
+ **
+ - url (string) URL
+ - postData (object|string) data for post request
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ * or
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ = (XMLHttpRequest) the XMLHttpRequest object, just in case
+\*/
+Snap.ajax = function (url, postData, callback, scope){
+ var req = new XMLHttpRequest,
+ id = ID();
+ if (req) {
+ if (is(postData, "function")) {
+ scope = callback;
+ callback = postData;
+ postData = null;
+ } else if (is(postData, "object")) {
+ var pd = [];
+ for (var key in postData) if (postData.hasOwnProperty(key)) {
+ pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
+ }
+ postData = pd.join("&");
+ }
+ req.open((postData ? "POST" : "GET"), url, true);
+ if (postData) {
+ req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ }
+ if (callback) {
+ eve.once("snap.ajax." + id + ".0", callback);
+ eve.once("snap.ajax." + id + ".200", callback);
+ eve.once("snap.ajax." + id + ".304", callback);
+ }
+ req.onreadystatechange = function() {
+ if (req.readyState != 4) return;
+ eve("snap.ajax." + id + "." + req.status, scope, req);
+ };
+ if (req.readyState == 4) {
+ return req;
+ }
+ req.send(postData);
+ return req;
+ }
+};
+/*\
+ * Snap.load
+ [ method ]
+ **
+ * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
+ **
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+\*/
+Snap.load = function (url, callback, scope) {
+ Snap.ajax(url, function (req) {
+ var f = Snap.parse(req.responseText);
+ scope ? callback.call(scope, f) : callback(f);
+ });
+};
+var getOffset = function (elem) {
+ var box = elem.getBoundingClientRect(),
+ doc = elem.ownerDocument,
+ body = doc.body,
+ docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return {
+ y: top,
+ x: left
+ };
+};
+/*\
+ * Snap.getElementByPoint
+ [ method ]
+ **
+ * Returns you topmost element under given point.
+ **
+ = (object) Snap element object
+ - x (number) x coordinate from the top left corner of the window
+ - y (number) y coordinate from the top left corner of the window
+ > Usage
+ | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
+\*/
+Snap.getElementByPoint = function (x, y) {
+ var paper = this,
+ svg = paper.canvas,
+ target = glob.doc.elementFromPoint(x, y);
+ if (glob.win.opera && target.tagName == "svg") {
+ var so = getOffset(target),
+ sr = target.createSVGRect();
+ sr.x = x - so.x;
+ sr.y = y - so.y;
+ sr.width = sr.height = 1;
+ var hits = target.getIntersectionList(sr, null);
+ if (hits.length) {
+ target = hits[hits.length - 1];
+ }
+ }
+ if (!target) {
+ return null;
+ }
+ return wrap(target);
+};
+/*\
+ * Snap.plugin
+ [ method ]
+ **
+ * Let you write plugins. You pass in a function with four arguments, like this:
+ | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+ | Snap.newmethod = function () {};
+ | Element.prototype.newmethod = function () {};
+ | Paper.prototype.newmethod = function () {};
+ | });
+ * Inside the function you have access to all main objects (and their
+ * prototypes). This allow you to extend anything you want.
+ **
+ - f (function) your plugin body
+\*/
+Snap.plugin = function (f) {
+ f(Snap, Element, Paper, glob, Fragment);
+};
+glob.win.Snap = Snap;
+return Snap;
+}(window || this));
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ Str = String,
+ unit2px = Snap._unit2px,
+ $ = Snap._.$,
+ make = Snap._.make,
+ getSomeDefs = Snap._.getSomeDefs,
+ has = "hasOwnProperty",
+ wrap = Snap._.wrap;
+ /*\
+ * Element.getBBox
+ [ method ]
+ **
+ * Returns the bounding box descriptor for the given element
+ **
+ = (object) bounding box descriptor:
+ o {
+ o cx: (number) x of the center,
+ o cy: (number) x of the center,
+ o h: (number) height,
+ o height: (number) height,
+ o path: (string) path command for the box,
+ o r0: (number) radius of a circle that fully encloses the box,
+ o r1: (number) radius of the smallest circle that can be enclosed,
+ o r2: (number) radius of the largest circle that can be enclosed,
+ o vb: (string) box as a viewbox command,
+ o w: (number) width,
+ o width: (number) width,
+ o x2: (number) x of the right side,
+ o x: (number) x of the left side,
+ o y2: (number) y of the bottom edge,
+ o y: (number) y of the top edge
+ o }
+ \*/
+ elproto.getBBox = function (isWithoutTransform) {
+ if (!Snap.Matrix || !Snap.path) {
+ return this.node.getBBox();
+ }
+ var el = this,
+ m = new Snap.Matrix;
+ if (el.removed) {
+ return Snap._.box();
+ }
+ while (el.type == "use") {
+ if (!isWithoutTransform) {
+ m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
+ }
+ if (el.original) {
+ el = el.original;
+ } else {
+ var href = el.attr("xlink:href");
+ el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
+ }
+ }
+ var _ = el._,
+ pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
+ try {
+ if (isWithoutTransform) {
+ _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
+ return Snap._.box(_.bboxwt);
+ } else {
+ el.realPath = pathfinder(el);
+ el.matrix = el.transform().localMatrix;
+ _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
+ return Snap._.box(_.bbox);
+ }
+ } catch (e) {
+ // Firefox doesn’t give you bbox of hidden element
+ return Snap._.box();
+ }
+ };
+ var propString = function () {
+ return this.string;
+ };
+ function extractTransform(el, tstr) {
+ if (tstr == null) {
+ var doReturn = true;
+ if (el.type == "linearGradient" || el.type == "radialGradient") {
+ tstr = el.node.getAttribute("gradientTransform");
+ } else if (el.type == "pattern") {
+ tstr = el.node.getAttribute("patternTransform");
+ } else {
+ tstr = el.node.getAttribute("transform");
+ }
+ if (!tstr) {
+ return new Snap.Matrix;
+ }
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ if (!Snap._.rgTransform.test(tstr)) {
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
+ }
+ if (is(tstr, "array")) {
+ tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
+ }
+ el._.transform = tstr;
+ }
+ var m = Snap._.transform2matrix(tstr, el.getBBox(1));
+ if (doReturn) {
+ return m;
+ } else {
+ el.matrix = m;
+ }
+ }
+ /*\
+ * Element.transform
+ [ method ]
+ **
+ * Gets or sets transformation of the element
+ **
+ - tstr (string) transform string in Snap or SVG format
+ = (Element) the current element
+ * or
+ = (object) transformation descriptor:
+ o {
+ o string (string) transform string,
+ o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,
+ o localMatrix (Matrix) matrix of transformations applied only to the element,
+ o diffMatrix (Matrix) matrix of difference between global and local transformations,
+ o global (string) global transformation as string,
+ o local (string) local transformation as string,
+ o toString (function) returns `string` property
+ o }
+ \*/
+ elproto.transform = function (tstr) {
+ var _ = this._;
+ if (tstr == null) {
+ var papa = this,
+ global = new Snap.Matrix(this.node.getCTM()),
+ local = extractTransform(this),
+ ms = [local],
+ m = new Snap.Matrix,
+ i,
+ localString = local.toTransformString(),
+ string = Str(local) == Str(this.matrix) ?
+ Str(_.transform) : localString;
+ while (papa.type != "svg" && (papa = papa.parent())) {
+ ms.push(extractTransform(papa));
+ }
+ i = ms.length;
+ while (i--) {
+ m.add(ms[i]);
+ }
+ return {
+ string: string,
+ globalMatrix: global,
+ totalMatrix: m,
+ localMatrix: local,
+ diffMatrix: global.clone().add(local.invert()),
+ global: global.toTransformString(),
+ total: m.toTransformString(),
+ local: localString,
+ toString: propString
+ };
+ }
+ if (tstr instanceof Snap.Matrix) {
+ this.matrix = tstr;
+ this._.transform = tstr.toTransformString();
+ } else {
+ extractTransform(this, tstr);
+ }
+
+ if (this.node) {
+ if (this.type == "linearGradient" || this.type == "radialGradient") {
+ $(this.node, {gradientTransform: this.matrix});
+ } else if (this.type == "pattern") {
+ $(this.node, {patternTransform: this.matrix});
+ } else {
+ $(this.node, {transform: this.matrix});
+ }
+ }
+
+ return this;
+ };
+ /*\
+ * Element.parent
+ [ method ]
+ **
+ * Returns the element's parent
+ **
+ = (Element) the parent element
+ \*/
+ elproto.parent = function () {
+ return wrap(this.node.parentNode);
+ };
+ /*\
+ * Element.append
+ [ method ]
+ **
+ * Appends the given element to current one
+ **
+ - el (Element|Set) element to append
+ = (Element) the parent element
+ \*/
+ /*\
+ * Element.add
+ [ method ]
+ **
+ * See @Element.append
+ \*/
+ elproto.append = elproto.add = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ it.add(el);
+ });
+ return this;
+ }
+ el = wrap(el);
+ this.node.appendChild(el.node);
+ el.paper = this.paper;
+ }
+ return this;
+ };
+ /*\
+ * Element.appendTo
+ [ method ]
+ **
+ * Appends the current element to the given one
+ **
+ - el (Element) parent element to append to
+ = (Element) the child element
+ \*/
+ elproto.appendTo = function (el) {
+ if (el) {
+ el = wrap(el);
+ el.append(this);
+ }
+ return this;
+ };
+ /*\
+ * Element.prepend
+ [ method ]
+ **
+ * Prepends the given element to the current one
+ **
+ - el (Element) element to prepend
+ = (Element) the parent element
+ \*/
+ elproto.prepend = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this,
+ first;
+ el.forEach(function (el) {
+ if (first) {
+ first.after(el);
+ } else {
+ it.prepend(el);
+ }
+ first = el;
+ });
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.insertBefore(el.node, this.node.firstChild);
+ this.add && this.add();
+ el.paper = this.paper;
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ }
+ return this;
+ };
+ /*\
+ * Element.prependTo
+ [ method ]
+ **
+ * Prepends the current element to the given one
+ **
+ - el (Element) parent element to prepend to
+ = (Element) the child element
+ \*/
+ elproto.prependTo = function (el) {
+ el = wrap(el);
+ el.prepend(this);
+ return this;
+ };
+ /*\
+ * Element.before
+ [ method ]
+ **
+ * Inserts given element before the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.before = function (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ var parent = el.parent();
+ it.node.parentNode.insertBefore(el.node, it.node);
+ parent && parent.add();
+ });
+ this.parent().add();
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.parentNode.insertBefore(el.node, this.node);
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.after
+ [ method ]
+ **
+ * Inserts given element after the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.after = function (el) {
+ el = wrap(el);
+ var parent = el.parent();
+ if (this.node.nextSibling) {
+ this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
+ } else {
+ this.node.parentNode.appendChild(el.node);
+ }
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.insertBefore
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertBefore = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.insertAfter
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertAfter = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.remove
+ [ method ]
+ **
+ * Removes element from the DOM
+ = (Element) the detached element
+ \*/
+ elproto.remove = function () {
+ var parent = this.parent();
+ this.node.parentNode && this.node.parentNode.removeChild(this.node);
+ delete this.paper;
+ this.removed = true;
+ parent && parent.add();
+ return this;
+ };
+ /*\
+ * Element.select
+ [ method ]
+ **
+ * Gathers the nested @Element matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Element) result of query selection
+ \*/
+ elproto.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(this.node.querySelector(query));
+ };
+ /*\
+ * Element.selectAll
+ [ method ]
+ **
+ * Gathers nested @Element objects matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Set|array) result of query selection
+ \*/
+ elproto.selectAll = function (query) {
+ var nodelist = this.node.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+ };
+ /*\
+ * Element.asPX
+ [ method ]
+ **
+ * Returns given attribute of the element as a `px` value (not %, em, etc.)
+ **
+ - attr (string) attribute name
+ - value (string) #optional attribute value
+ = (Element) result of query selection
+ \*/
+ elproto.asPX = function (attr, value) {
+ if (value == null) {
+ value = this.attr(attr);
+ }
+ return +unit2px(this, attr, value);
+ };
+ // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
+ /*\
+ * Element.use
+ [ method ]
+ **
+ * Creates a `<use>` element linked to the current element
+ **
+ = (Element) the `<use>` element
+ \*/
+ elproto.use = function () {
+ var use,
+ id = this.node.id;
+ if (!id) {
+ id = this.id;
+ $(this.node, {
+ id: id
+ });
+ }
+ if (this.type == "linearGradient" || this.type == "radialGradient" ||
+ this.type == "pattern") {
+ use = make(this.type, this.node.parentNode);
+ } else {
+ use = make("use", this.node.parentNode);
+ }
+ $(use.node, {
+ "xlink:href": "#" + id
+ });
+ use.original = this;
+ return use;
+ };
+ function fixids(el) {
+ var els = el.selectAll("*"),
+ it,
+ url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
+ ids = [],
+ uses = {};
+ function urltest(it, name) {
+ var val = $(it.node, name);
+ val = val && val.match(url);
+ val = val && val[2];
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ var attr = {};
+ attr[name] = URL(id);
+ $(it.node, attr);
+ });
+ }
+ }
+ function linktest(it) {
+ var val = $(it.node, "xlink:href");
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ it.attr("xlink:href", "#" + id);
+ });
+ }
+ }
+ for (var i = 0, ii = els.length; i < ii; i++) {
+ it = els[i];
+ urltest(it, "fill");
+ urltest(it, "stroke");
+ urltest(it, "filter");
+ urltest(it, "mask");
+ urltest(it, "clip-path");
+ linktest(it);
+ var oldid = $(it.node, "id");
+ if (oldid) {
+ $(it.node, {id: it.id});
+ ids.push({
+ old: oldid,
+ id: it.id
+ });
+ }
+ }
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ var fs = uses[ids[i].old];
+ if (fs) {
+ for (var j = 0, jj = fs.length; j < jj; j++) {
+ fs[j](ids[i].id);
+ }
+ }
+ }
+ }
+ /*\
+ * Element.clone
+ [ method ]
+ **
+ * Creates a clone of the element and inserts it after the element
+ **
+ = (Element) the clone
+ \*/
+ elproto.clone = function () {
+ var clone = wrap(this.node.cloneNode(true));
+ if ($(clone.node, "id")) {
+ $(clone.node, {id: clone.id});
+ }
+ fixids(clone);
+ clone.insertAfter(this);
+ return clone;
+ };
+ /*\
+ * Element.toDefs
+ [ method ]
+ **
+ * Moves element to the shared `<defs>` area
+ **
+ = (Element) the element
+ \*/
+ elproto.toDefs = function () {
+ var defs = getSomeDefs(this);
+ defs.appendChild(this.node);
+ return this;
+ };
+ /*\
+ * Element.toPattern
+ [ method ]
+ **
+ * Creates a `<pattern>` element from the current element
+ **
+ * To create a pattern you have to specify the pattern rect:
+ - x (string|number)
+ - y (string|number)
+ - width (string|number)
+ - height (string|number)
+ = (Element) the `<pattern>` element
+ * You can use pattern later on as an argument for `fill` attribute:
+ | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+ | fill: "none",
+ | stroke: "#bada55",
+ | strokeWidth: 5
+ | }).pattern(0, 0, 10, 10),
+ | c = paper.circle(200, 200, 100);
+ | c.attr({
+ | fill: p
+ | });
+ \*/
+ elproto.pattern = elproto.toPattern = function (x, y, width, height) {
+ var p = make("pattern", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ $(p.node, {
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ patternUnits: "userSpaceOnUse",
+ id: p.id,
+ viewBox: [x, y, width, height].join(" ")
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
+// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
+ /*\
+ * Element.marker
+ [ method ]
+ **
+ * Creates a `<marker>` element from the current element
+ **
+ * To create a marker you have to specify the bounding rect and reference point:
+ - x (number)
+ - y (number)
+ - width (number)
+ - height (number)
+ - refX (number)
+ - refY (number)
+ = (Element) the `<marker>` element
+ * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
+ \*/
+ // TODO add usage for markers
+ elproto.marker = function (x, y, width, height, refX, refY) {
+ var p = make("marker", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ refX = x.refX || x.cx;
+ refY = x.refY || x.cy;
+ x = x.x;
+ }
+ $(p.node, {
+ viewBox: [x, y, width, height].join(" "),
+ markerWidth: width,
+ markerHeight: height,
+ orient: "auto",
+ refX: refX || 0,
+ refY: refY || 0,
+ id: p.id
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+ // animation
+ function slice(from, to, f) {
+ return function (arr) {
+ var res = arr.slice(from, to);
+ if (res.length == 1) {
+ res = res[0];
+ }
+ return f ? f(res) : res;
+ };
+ }
+ var Animation = function (attr, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ this.attr = attr;
+ this.dur = ms;
+ easing && (this.easing = easing);
+ callback && (this.callback = callback);
+ };
+ Snap._.Animation = Animation;
+ /*\
+ * Snap.animation
+ [ method ]
+ **
+ * Creates an animation object
+ **
+ - attr (object) attributes of final destination
+ - duration (number) duration of the animation, in milliseconds
+ - easing (function) #optional one of easing functions of @mina or custom one
+ - callback (function) #optional callback function that fires when animation ends
+ = (object) animation object
+ \*/
+ Snap.animation = function (attr, ms, easing, callback) {
+ return new Animation(attr, ms, easing, callback);
+ };
+ /*\
+ * Element.inAnim
+ [ method ]
+ **
+ * Returns a set of animations that may be able to manipulate the current element
+ **
+ = (object) in format:
+ o {
+ o anim (object) animation object,
+ o mina (object) @mina object,
+ o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ \*/
+ elproto.inAnim = function () {
+ var el = this,
+ res = [];
+ for (var id in el.anims) if (el.anims[has](id)) {
+ (function (a) {
+ res.push({
+ anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
+ mina: a,
+ curStatus: a.status(),
+ status: function (val) {
+ return a.status(val);
+ },
+ stop: function () {
+ a.stop();
+ }
+ });
+ }(el.anims[id]));
+ }
+ return res;
+ };
+ /*\
+ * Snap.animate
+ [ method ]
+ **
+ * Runs generic animation of one number into another with a caring function
+ **
+ - from (number|array) number or array of numbers
+ - to (number|array) number or array of numbers
+ - setter (function) caring function that accepts one number argument
+ - duration (number) duration, in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function to execute when animation ends
+ = (object) animation object in @mina format
+ o {
+ o id (string) animation id, consider it read-only,
+ o duration (function) gets or sets the duration of the animation,
+ o easing (function) easing,
+ o speed (function) gets or sets the speed of the animation,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ | var rect = Snap().rect(0, 0, 10, 10);
+ | Snap.animate(0, 10, function (val) {
+ | rect.attr({
+ | x: val
+ | });
+ | }, 1000);
+ | // in given context is equivalent to
+ | rect.animate({x: 10}, 1000);
+ \*/
+ Snap.animate = function (from, to, setter, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ var now = mina.time(),
+ anim = mina(from, to, now, now + ms, mina.time, setter, easing);
+ callback && eve.once("mina.finish." + anim.id, callback);
+ return anim;
+ };
+ /*\
+ * Element.stop
+ [ method ]
+ **
+ * Stops all the animations for the current element
+ **
+ = (Element) the current element
+ \*/
+ elproto.stop = function () {
+ var anims = this.inAnim();
+ for (var i = 0, ii = anims.length; i < ii; i++) {
+ anims[i].stop();
+ }
+ return this;
+ };
+ /*\
+ * Element.animate
+ [ method ]
+ **
+ * Animates the given attributes of the element
+ **
+ - attrs (object) key-value pairs of destination attributes
+ - duration (number) duration of the animation in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function that executes when the animation ends
+ = (Element) the current element
+ \*/
+ elproto.animate = function (attrs, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ if (attrs instanceof Animation) {
+ callback = attrs.callback;
+ easing = attrs.easing;
+ ms = easing.dur;
+ attrs = attrs.attr;
+ }
+ var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,
+ el = this;
+ for (var key in attrs) if (attrs[has](key)) {
+ if (el.equal) {
+ eq = el.equal(key, Str(attrs[key]));
+ from = eq.from;
+ to = eq.to;
+ f = eq.f;
+ } else {
+ from = +el.attr(key);
+ to = +attrs[key];
+ }
+ var len = is(from, "array") ? from.length : 1;
+ keys[key] = slice(fkeys.length, fkeys.length + len, f);
+ fkeys = fkeys.concat(from);
+ tkeys = tkeys.concat(to);
+ }
+ var now = mina.time(),
+ anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {
+ var attr = {};
+ for (var key in keys) if (keys[has](key)) {
+ attr[key] = keys[key](val);
+ }
+ el.attr(attr);
+ }, easing);
+ el.anims[anim.id] = anim;
+ anim._attrs = attrs;
+ anim._callback = callback;
+ eve("snap.animcreated." + el.id, anim);
+ eve.once("mina.finish." + anim.id, function () {
+ delete el.anims[anim.id];
+ callback && callback.call(el);
+ });
+ eve.once("mina.stop." + anim.id, function () {
+ delete el.anims[anim.id];
+ });
+ return el;
+ };
+ var eldata = {};
+ /*\
+ * Element.data
+ [ method ]
+ **
+ * Adds or retrieves given value associated with given key. (Don’t confuse
+ * with `data-` attributes)
+ *
+ * See also @Element.removeData
+ - key (string) key to store data
+ - value (any) #optional value to store
+ = (object) @Element
+ * or, if value is not specified:
+ = (any) value
+ > Usage
+ | for (var i = 0, i < 5, i++) {
+ | paper.circle(10 + 15 * i, 10, 10)
+ | .attr({fill: "#000"})
+ | .data("i", i)
+ | .click(function () {
+ | alert(this.data("i"));
+ | });
+ | }
+ \*/
+ elproto.data = function (key, value) {
+ var data = eldata[this.id] = eldata[this.id] || {};
+ if (arguments.length == 0){
+ eve("snap.data.get." + this.id, this, data, null);
+ return data;
+ }
+ if (arguments.length == 1) {
+ if (Snap.is(key, "object")) {
+ for (var i in key) if (key[has](i)) {
+ this.data(i, key[i]);
+ }
+ return this;
+ }
+ eve("snap.data.get." + this.id, this, data[key], key);
+ return data[key];
+ }
+ data[key] = value;
+ eve("snap.data.set." + this.id, this, value, key);
+ return this;
+ };
+ /*\
+ * Element.removeData
+ [ method ]
+ **
+ * Removes value associated with an element by given key.
+ * If key is not provided, removes all the data of the element.
+ - key (string) #optional key
+ = (object) @Element
+ \*/
+ elproto.removeData = function (key) {
+ if (key == null) {
+ eldata[this.id] = {};
+ } else {
+ eldata[this.id] && delete eldata[this.id][key];
+ }
+ return this;
+ };
+ /*\
+ * Element.outerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element, equivalent to HTML's `outerHTML`.
+ *
+ * See also @Element.innerSVG
+ = (string) SVG code for the element
+ \*/
+ /*\
+ * Element.toString
+ [ method ]
+ **
+ * See @Element.outerSVG
+ \*/
+ elproto.outerSVG = elproto.toString = toString(1);
+ /*\
+ * Element.innerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`
+ = (string) SVG code for the element
+ \*/
+ elproto.innerSVG = toString();
+ function toString(type) {
+ return function () {
+ var res = type ? "<" + this.type : "",
+ attr = this.node.attributes,
+ chld = this.node.childNodes;
+ if (type) {
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ res += " " + attr[i].name + '="' +
+ attr[i].value.replace(/"/g, '\\"') + '"';
+ }
+ }
+ if (chld.length) {
+ type && (res += ">");
+ for (i = 0, ii = chld.length; i < ii; i++) {
+ if (chld[i].nodeType == 3) {
+ res += chld[i].nodeValue;
+ } else if (chld[i].nodeType == 1) {
+ res += wrap(chld[i]).toString();
+ }
+ }
+ type && (res += "</" + this.type + ">");
+ } else {
+ type && (res += "/>");
+ }
+ return res;
+ };
+ }
+ elproto.toDataURL = function () {
+ if (window && window.btoa) {
+ var bb = this.getBBox(),
+ svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
+ x: +bb.x.toFixed(3),
+ y: +bb.y.toFixed(3),
+ width: +bb.width.toFixed(3),
+ height: +bb.height.toFixed(3),
+ contents: this.outerSVG()
+ });
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
+ }
+ };
+ /*\
+ * Fragment.select
+ [ method ]
+ **
+ * See @Element.select
+ \*/
+ Fragment.prototype.select = elproto.select;
+ /*\
+ * Fragment.selectAll
+ [ method ]
+ **
+ * See @Element.selectAll
+ \*/
+ Fragment.prototype.selectAll = elproto.selectAll;
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var objectToString = Object.prototype.toString,
+ Str = String,
+ math = Math,
+ E = "";
+ function Matrix(a, b, c, d, e, f) {
+ if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
+ this.a = a.a;
+ this.b = a.b;
+ this.c = a.c;
+ this.d = a.d;
+ this.e = a.e;
+ this.f = a.f;
+ return;
+ }
+ if (a != null) {
+ this.a = +a;
+ this.b = +b;
+ this.c = +c;
+ this.d = +d;
+ this.e = +e;
+ this.f = +f;
+ } else {
+ this.a = 1;
+ this.b = 0;
+ this.c = 0;
+ this.d = 1;
+ this.e = 0;
+ this.f = 0;
+ }
+ }
+ (function (matrixproto) {
+ /*\
+ * Matrix.add
+ [ method ]
+ **
+ * Adds the given matrix to existing one
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - matrix (object) @Matrix
+ \*/
+ matrixproto.add = function (a, b, c, d, e, f) {
+ var out = [[], [], []],
+ m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
+ matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
+ x, y, z, res;
+
+ if (a && a instanceof Matrix) {
+ matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
+ }
+
+ for (x = 0; x < 3; x++) {
+ for (y = 0; y < 3; y++) {
+ res = 0;
+ for (z = 0; z < 3; z++) {
+ res += m[x][z] * matrix[z][y];
+ }
+ out[x][y] = res;
+ }
+ }
+ this.a = out[0][0];
+ this.b = out[1][0];
+ this.c = out[0][1];
+ this.d = out[1][1];
+ this.e = out[0][2];
+ this.f = out[1][2];
+ return this;
+ };
+ /*\
+ * Matrix.invert
+ [ method ]
+ **
+ * Returns an inverted version of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.invert = function () {
+ var me = this,
+ x = me.a * me.d - me.b * me.c;
+ return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
+ };
+ /*\
+ * Matrix.clone
+ [ method ]
+ **
+ * Returns a copy of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.clone = function () {
+ return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
+ };
+ /*\
+ * Matrix.translate
+ [ method ]
+ **
+ * Translate the matrix
+ - x (number) horizontal offset distance
+ - y (number) vertical offset distance
+ \*/
+ matrixproto.translate = function (x, y) {
+ return this.add(1, 0, 0, 1, x, y);
+ };
+ /*\
+ * Matrix.scale
+ [ method ]
+ **
+ * Scales the matrix
+ - x (number) amount to be scaled, with `1` resulting in no change
+ - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)
+ - cx (number) #optional horizontal origin point from which to scale
+ - cy (number) #optional vertical origin point from which to scale
+ * Default cx, cy is the middle point of the element.
+ \*/
+ matrixproto.scale = function (x, y, cx, cy) {
+ y == null && (y = x);
+ (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
+ this.add(x, 0, 0, y, 0, 0);
+ (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
+ return this;
+ };
+ /*\
+ * Matrix.rotate
+ [ method ]
+ **
+ * Rotates the matrix
+ - a (number) angle of rotation, in degrees
+ - x (number) horizontal origin point from which to rotate
+ - y (number) vertical origin point from which to rotate
+ \*/
+ matrixproto.rotate = function (a, x, y) {
+ a = Snap.rad(a);
+ x = x || 0;
+ y = y || 0;
+ var cos = +math.cos(a).toFixed(9),
+ sin = +math.sin(a).toFixed(9);
+ this.add(cos, sin, -sin, cos, x, y);
+ return this.add(1, 0, 0, 1, -x, -y);
+ };
+ /*\
+ * Matrix.x
+ [ method ]
+ **
+ * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y
+ - x (number)
+ - y (number)
+ = (number) x
+ \*/
+ matrixproto.x = function (x, y) {
+ return x * this.a + y * this.c + this.e;
+ };
+ /*\
+ * Matrix.y
+ [ method ]
+ **
+ * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x
+ - x (number)
+ - y (number)
+ = (number) y
+ \*/
+ matrixproto.y = function (x, y) {
+ return x * this.b + y * this.d + this.f;
+ };
+ matrixproto.get = function (i) {
+ return +this[Str.fromCharCode(97 + i)].toFixed(4);
+ };
+ matrixproto.toString = function () {
+ return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
+ };
+ matrixproto.offset = function () {
+ return [this.e.toFixed(4), this.f.toFixed(4)];
+ };
+ function norm(a) {
+ return a[0] * a[0] + a[1] * a[1];
+ }
+ function normalize(a) {
+ var mag = math.sqrt(norm(a));
+ a[0] && (a[0] /= mag);
+ a[1] && (a[1] /= mag);
+ }
+ /*\
+ * Matrix.determinant
+ [ method ]
+ **
+ * Finds determinant of the given matrix.
+ = (number) determinant
+ \*/
+ matrixproto.determinant = function () {
+ return this.a * this.d - this.b * this.c;
+ };
+ /*\
+ * Matrix.split
+ [ method ]
+ **
+ * Splits matrix into primitive transformations
+ = (object) in format:
+ o dx (number) translation by x
+ o dy (number) translation by y
+ o scalex (number) scale by x
+ o scaley (number) scale by y
+ o shear (number) shear
+ o rotate (number) rotation in deg
+ o isSimple (boolean) could it be represented via simple transformations
+ \*/
+ matrixproto.split = function () {
+ var out = {};
+ // translation
+ out.dx = this.e;
+ out.dy = this.f;
+
+ // scale and shear
+ var row = [[this.a, this.c], [this.b, this.d]];
+ out.scalex = math.sqrt(norm(row[0]));
+ normalize(row[0]);
+
+ out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
+ row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
+
+ out.scaley = math.sqrt(norm(row[1]));
+ normalize(row[1]);
+ out.shear /= out.scaley;
+
+ if (this.determinant() < 0) {
+ out.scalex = -out.scalex;
+ }
+
+ // rotation
+ var sin = -row[0][1],
+ cos = row[1][1];
+ if (cos < 0) {
+ out.rotate = Snap.deg(math.acos(cos));
+ if (sin < 0) {
+ out.rotate = 360 - out.rotate;
+ }
+ } else {
+ out.rotate = Snap.deg(math.asin(sin));
+ }
+
+ out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
+ out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
+ out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
+ return out;
+ };
+ /*\
+ * Matrix.toTransformString
+ [ method ]
+ **
+ * Returns transform string that represents given matrix
+ = (string) transform string
+ \*/
+ matrixproto.toTransformString = function (shorter) {
+ var s = shorter || this.split();
+ if (!+s.shear.toFixed(9)) {
+ s.scalex = +s.scalex.toFixed(4);
+ s.scaley = +s.scaley.toFixed(4);
+ s.rotate = +s.rotate.toFixed(4);
+ return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
+ (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
+ (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
+ } else {
+ return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
+ }
+ };
+ })(Matrix.prototype);
+ /*\
+ * Snap.Matrix
+ [ method ]
+ **
+ * Matrix constructor, extend on your own risk.
+ * To create matrices use @Snap.matrix.
+ \*/
+ Snap.Matrix = Matrix;
+ /*\
+ * Snap.matrix
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns a matrix based on the given parameters
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - svgMatrix (SVGMatrix)
+ = (object) @Matrix
+ \*/
+ Snap.matrix = function (a, b, c, d, e, f) {
+ return new Matrix(a, b, c, d, e, f);
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var has = "hasOwnProperty",
+ make = Snap._.make,
+ wrap = Snap._.wrap,
+ is = Snap.is,
+ getSomeDefs = Snap._.getSomeDefs,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ $ = Snap._.$,
+ URL = Snap.url,
+ Str = String,
+ separator = Snap._.separator,
+ E = "";
+ // Attributes event handlers
+ eve.on("snap.util.attr.mask", function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value.type == "mask") {
+ var mask = value;
+ } else {
+ mask = make("mask", getSomeDefs(this));
+ mask.node.appendChild(value.node);
+ }
+ !mask.node.id && $(mask.node, {
+ id: mask.id
+ });
+ $(this.node, {
+ mask: URL(mask.id)
+ });
+ }
+ });
+ (function (clipIt) {
+ eve.on("snap.util.attr.clip", clipIt);
+ eve.on("snap.util.attr.clip-path", clipIt);
+ eve.on("snap.util.attr.clipPath", clipIt);
+ }(function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value.type == "clipPath") {
+ var clip = value;
+ } else {
+ clip = make("clipPath", getSomeDefs(this));
+ clip.node.appendChild(value.node);
+ !clip.node.id && $(clip.node, {
+ id: clip.id
+ });
+ }
+ $(this.node, {
+ "clip-path": URL(clip.node.id || clip.id)
+ });
+ }
+ }));
+ function fillStroke(name) {
+ return function (value) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1 &&
+ (value.node.firstChild.tagName == "radialGradient" ||
+ value.node.firstChild.tagName == "linearGradient" ||
+ value.node.firstChild.tagName == "pattern")) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value instanceof Element) {
+ if (value.type == "radialGradient" || value.type == "linearGradient"
+ || value.type == "pattern") {
+ if (!value.node.id) {
+ $(value.node, {
+ id: value.id
+ });
+ }
+ var fill = URL(value.node.id);
+ } else {
+ fill = value.attr(name);
+ }
+ } else {
+ fill = Snap.color(value);
+ if (fill.error) {
+ var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
+ if (grad) {
+ if (!grad.node.id) {
+ $(grad.node, {
+ id: grad.id
+ });
+ }
+ fill = URL(grad.node.id);
+ } else {
+ fill = value;
+ }
+ } else {
+ fill = Str(fill);
+ }
+ }
+ var attrs = {};
+ attrs[name] = fill;
+ $(this.node, attrs);
+ this.node.style[name] = E;
+ };
+ }
+ eve.on("snap.util.attr.fill", fillStroke("fill"));
+ eve.on("snap.util.attr.stroke", fillStroke("stroke"));
+ var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
+ eve.on("snap.util.grad.parse", function parseGrad(string) {
+ string = Str(string);
+ var tokens = string.match(gradrg);
+ if (!tokens) {
+ return null;
+ }
+ var type = tokens[1],
+ params = tokens[2],
+ stops = tokens[3];
+ params = params.split(/\s*,\s*/).map(function (el) {
+ return +el == el ? +el : el;
+ });
+ if (params.length == 1 && params[0] == 0) {
+ params = [];
+ }
+ stops = stops.split("-");
+ stops = stops.map(function (el) {
+ el = el.split(":");
+ var out = {
+ color: el[0]
+ };
+ if (el[1]) {
+ out.offset = parseFloat(el[1]);
+ }
+ return out;
+ });
+ return {
+ type: type,
+ params: params,
+ stops: stops
+ };
+ });
+
+ eve.on("snap.util.attr.d", function (value) {
+ eve.stop();
+ if (is(value, "array") && is(value[0], "array")) {
+ value = Snap.path.toString.call(value);
+ }
+ value = Str(value);
+ if (value.match(/[ruo]/i)) {
+ value = Snap.path.toAbsolute(value);
+ }
+ $(this.node, {d: value});
+ })(-1);
+ eve.on("snap.util.attr.#text", function (value) {
+ eve.stop();
+ value = Str(value);
+ var txt = glob.doc.createTextNode(value);
+ while (this.node.firstChild) {
+ this.node.removeChild(this.node.firstChild);
+ }
+ this.node.appendChild(txt);
+ })(-1);
+ eve.on("snap.util.attr.path", function (value) {
+ eve.stop();
+ this.attr({d: value});
+ })(-1);
+ eve.on("snap.util.attr.class", function (value) {
+ eve.stop();
+ this.node.className.baseVal = value;
+ })(-1);
+ eve.on("snap.util.attr.viewBox", function (value) {
+ var vb;
+ if (is(value, "object") && "x" in value) {
+ vb = [value.x, value.y, value.width, value.height].join(" ");
+ } else if (is(value, "array")) {
+ vb = value.join(" ");
+ } else {
+ vb = value;
+ }
+ $(this.node, {
+ viewBox: vb
+ });
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.transform", function (value) {
+ this.transform(value);
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.r", function (value) {
+ if (this.type == "rect") {
+ eve.stop();
+ $(this.node, {
+ rx: value,
+ ry: value
+ });
+ }
+ })(-1);
+ eve.on("snap.util.attr.textpath", function (value) {
+ eve.stop();
+ if (this.type == "text") {
+ var id, tp, node;
+ if (!value && this.textPath) {
+ tp = this.textPath;
+ while (tp.node.firstChild) {
+ this.node.appendChild(tp.node.firstChild);
+ }
+ tp.remove();
+ delete this.textPath;
+ return;
+ }
+ if (is(value, "string")) {
+ var defs = getSomeDefs(this),
+ path = wrap(defs.parentNode).path(value);
+ defs.appendChild(path.node);
+ id = path.id;
+ path.attr({id: id});
+ } else {
+ value = wrap(value);
+ if (value instanceof Element) {
+ id = value.attr("id");
+ if (!id) {
+ id = value.id;
+ value.attr({id: id});
+ }
+ }
+ }
+ if (id) {
+ tp = this.textPath;
+ node = this.node;
+ if (tp) {
+ tp.attr({"xlink:href": "#" + id});
+ } else {
+ tp = $("textPath", {
+ "xlink:href": "#" + id
+ });
+ while (node.firstChild) {
+ tp.appendChild(node.firstChild);
+ }
+ node.appendChild(tp);
+ this.textPath = wrap(tp);
+ }
+ }
+ }
+ })(-1);
+ eve.on("snap.util.attr.text", function (value) {
+ if (this.type == "text") {
+ var i = 0,
+ node = this.node,
+ tuner = function (chunk) {
+ var out = $("tspan");
+ if (is(chunk, "array")) {
+ for (var i = 0; i < chunk.length; i++) {
+ out.appendChild(tuner(chunk[i]));
+ }
+ } else {
+ out.appendChild(glob.doc.createTextNode(chunk));
+ }
+ out.normalize && out.normalize();
+ return out;
+ };
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ var tuned = tuner(value);
+ while (tuned.firstChild) {
+ node.appendChild(tuned.firstChild);
+ }
+ }
+ eve.stop();
+ })(-1);
+ function setFontSize(value) {
+ eve.stop();
+ if (value == +value) {
+ value += "px";
+ }
+ this.node.style.fontSize = value;
+ }
+ eve.on("snap.util.attr.fontSize", setFontSize)(-1);
+ eve.on("snap.util.attr.font-size", setFontSize)(-1);
+
+
+ eve.on("snap.util.getattr.transform", function () {
+ eve.stop();
+ return this.transform();
+ })(-1);
+ eve.on("snap.util.getattr.textpath", function () {
+ eve.stop();
+ return this.textPath;
+ })(-1);
+ // Markers
+ (function () {
+ function getter(end) {
+ return function () {
+ eve.stop();
+ var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
+ if (style == "none") {
+ return style;
+ } else {
+ return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
+ }
+ };
+ }
+ function setter(end) {
+ return function (value) {
+ eve.stop();
+ var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
+ if (value == "" || !value) {
+ this.node.style[name] = "none";
+ return;
+ }
+ if (value.type == "marker") {
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ }
+ this.node.style[name] = URL(id);
+ return;
+ }
+ };
+ }
+ eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
+ eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
+ eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
+ eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
+ eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
+ eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
+ eve.on("snap.util.attr.marker-end", setter("end"))(-1);
+ eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
+ eve.on("snap.util.attr.marker-start", setter("start"))(-1);
+ eve.on("snap.util.attr.markerStart", setter("start"))(-1);
+ eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
+ eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
+ }());
+ eve.on("snap.util.getattr.r", function () {
+ if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
+ eve.stop();
+ return $(this.node, "rx");
+ }
+ })(-1);
+ function textExtract(node) {
+ var out = [];
+ var children = node.childNodes;
+ for (var i = 0, ii = children.length; i < ii; i++) {
+ var chi = children[i];
+ if (chi.nodeType == 3) {
+ out.push(chi.nodeValue);
+ }
+ if (chi.tagName == "tspan") {
+ if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
+ out.push(chi.firstChild.nodeValue);
+ } else {
+ out.push(textExtract(chi));
+ }
+ }
+ }
+ return out;
+ }
+ eve.on("snap.util.getattr.text", function () {
+ if (this.type == "text" || this.type == "tspan") {
+ eve.stop();
+ var out = textExtract(this.node);
+ return out.length == 1 ? out[0] : out;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.#text", function () {
+ return this.node.textContent;
+ })(-1);
+ eve.on("snap.util.getattr.viewBox", function () {
+ eve.stop();
+ var vb = $(this.node, "viewBox");
+ if (vb) {
+ vb = vb.split(separator);
+ return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.points", function () {
+ var p = $(this.node, "points");
+ eve.stop();
+ if (p) {
+ return p.split(separator);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.path", function () {
+ var p = $(this.node, "d");
+ eve.stop();
+ return p;
+ })(-1);
+ eve.on("snap.util.getattr.class", function () {
+ return this.node.className.baseVal;
+ })(-1);
+ function getFontSize() {
+ eve.stop();
+ return this.node.style.fontSize;
+ }
+ eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
+ eve.on("snap.util.getattr.font-size", getFontSize)(-1);
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var proto = Paper.prototype,
+ is = Snap.is;
+ /*\
+ * Paper.rect
+ [ method ]
+ *
+ * Draws a rectangle
+ **
+ - x (number) x coordinate of the top left corner
+ - y (number) y coordinate of the top left corner
+ - width (number) width
+ - height (number) height
+ - rx (number) #optional horizontal radius for rounded corners, default is 0
+ - ry (number) #optional vertical radius for rounded corners, default is rx or 0
+ = (object) the `rect` element
+ **
+ > Usage
+ | // regular rectangle
+ | var c = paper.rect(10, 10, 50, 50);
+ | // rectangle with rounded corners
+ | var c = paper.rect(40, 40, 50, 50, 10);
+ \*/
+ proto.rect = function (x, y, w, h, rx, ry) {
+ var attr;
+ if (ry == null) {
+ ry = rx;
+ }
+ if (is(x, "object") && x == "[object Object]") {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ width: w,
+ height: h
+ };
+ if (rx != null) {
+ attr.rx = rx;
+ attr.ry = ry;
+ }
+ }
+ return this.el("rect", attr);
+ };
+ /*\
+ * Paper.circle
+ [ method ]
+ **
+ * Draws a circle
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - r (number) radius
+ = (object) the `circle` element
+ **
+ > Usage
+ | var c = paper.circle(50, 50, 40);
+ \*/
+ proto.circle = function (cx, cy, r) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr = {
+ cx: cx,
+ cy: cy,
+ r: r
+ };
+ }
+ return this.el("circle", attr);
+ };
+
+ var preload = (function () {
+ function onerror() {
+ this.parentNode.removeChild(this);
+ }
+ return function (src, f) {
+ var img = glob.doc.createElement("img"),
+ body = glob.doc.body;
+ img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
+ img.onload = function () {
+ f.call(img);
+ img.onload = img.onerror = null;
+ body.removeChild(img);
+ };
+ img.onerror = onerror;
+ body.appendChild(img);
+ img.src = src;
+ };
+ }());
+
+ /*\
+ * Paper.image
+ [ method ]
+ **
+ * Places an image on the surface
+ **
+ - src (string) URI of the source image
+ - x (number) x offset position
+ - y (number) y offset position
+ - width (number) width of the image
+ - height (number) height of the image
+ = (object) the `image` element
+ * or
+ = (object) Snap element object with type `image`
+ **
+ > Usage
+ | var c = paper.image("apple.png", 10, 10, 80, 80);
+ \*/
+ proto.image = function (src, x, y, width, height) {
+ var el = this.el("image");
+ if (is(src, "object") && "src" in src) {
+ el.attr(src);
+ } else if (src != null) {
+ var set = {
+ "xlink:href": src,
+ preserveAspectRatio: "none"
+ };
+ if (x != null && y != null) {
+ set.x = x;
+ set.y = y;
+ }
+ if (width != null && height != null) {
+ set.width = width;
+ set.height = height;
+ } else {
+ preload(src, function () {
+ Snap._.$(el.node, {
+ width: this.offsetWidth,
+ height: this.offsetHeight
+ });
+ });
+ }
+ Snap._.$(el.node, set);
+ }
+ return el;
+ };
+ /*\
+ * Paper.ellipse
+ [ method ]
+ **
+ * Draws an ellipse
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - rx (number) horizontal radius
+ - ry (number) vertical radius
+ = (object) the `ellipse` element
+ **
+ > Usage
+ | var c = paper.ellipse(50, 50, 40, 20);
+ \*/
+ proto.ellipse = function (cx, cy, rx, ry) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr ={
+ cx: cx,
+ cy: cy,
+ rx: rx,
+ ry: ry
+ };
+ }
+ return this.el("ellipse", attr);
+ };
+ // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
+ /*\
+ * Paper.path
+ [ method ]
+ **
+ * Creates a `<path>` element using the given string as the path's definition
+ - pathString (string) #optional path string in SVG format
+ * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
+ | "M10,20L30,40"
+ * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
+ *
+ # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
+ # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
+ # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
+ # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
+ # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
+ # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
+ # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
+ # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
+ # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
+ # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
+ # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
+ # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
+ # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
+ * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
+ * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.
+ > Usage
+ | var c = paper.path("M10 10L90 90");
+ | // draw a diagonal line:
+ | // move to 10,10, line to 90,90
+ \*/
+ proto.path = function (d) {
+ var attr;
+ if (is(d, "object") && !is(d, "array")) {
+ attr = d;
+ } else if (d) {
+ attr = {d: d};
+ }
+ return this.el("path", attr);
+ };
+ /*\
+ * Paper.g
+ [ method ]
+ **
+ * Creates a group element
+ **
+ - varargs (…) #optional elements to nest within the group
+ = (object) the `g` element
+ **
+ > Usage
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g(c2, c1); // note that the order of elements is different
+ * or
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g();
+ | g.add(c2, c1);
+ \*/
+ /*\
+ * Paper.group
+ [ method ]
+ **
+ * See @Paper.g
+ \*/
+ proto.group = proto.g = function (first) {
+ var attr,
+ el = this.el("g");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.svg
+ [ method ]
+ **
+ * Creates a nested SVG element.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `svg` element
+ **
+ \*/
+ proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {
+ var attrs = {};
+ if (is(x, "object") && y == null) {
+ attrs = x;
+ } else {
+ if (x != null) {
+ attrs.x = x;
+ }
+ if (y != null) {
+ attrs.y = y;
+ }
+ if (width != null) {
+ attrs.width = width;
+ }
+ if (height != null) {
+ attrs.height = height;
+ }
+ if (vbx != null && vby != null && vbw != null && vbh != null) {
+ attrs.viewBox = [vbx, vby, vbw, vbh];
+ }
+ }
+ return this.el("svg", attrs);
+ };
+ /*\
+ * Paper.mask
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a mask.
+ **
+ = (object) the `mask` element
+ **
+ \*/
+ proto.mask = function (first) {
+ var attr,
+ el = this.el("mask");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.ptrn
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a pattern.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `pattern` element
+ **
+ \*/
+ proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
+ if (is(x, "object")) {
+ var attr = x;
+ } else {
+ attr = {patternUnits: "userSpaceOnUse"};
+ if (x) {
+ attr.x = x;
+ }
+ if (y) {
+ attr.y = y;
+ }
+ if (width != null) {
+ attr.width = width;
+ }
+ if (height != null) {
+ attr.height = height;
+ }
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+ }
+ return this.el("pattern", attr);
+ };
+ /*\
+ * Paper.use
+ [ method ]
+ **
+ * Creates a <use> element.
+ - id (string) @optional id of element to link
+ * or
+ - id (Element) @optional element to link
+ **
+ = (object) the `use` element
+ **
+ \*/
+ proto.use = function (id) {
+ if (id != null) {
+ if (id instanceof Element) {
+ if (!id.attr("id")) {
+ id.attr({id: Snap._.id(id)});
+ }
+ id = id.attr("id");
+ }
+ if (String(id).charAt() == "#") {
+ id = id.substring(1);
+ }
+ return this.el("use", {"xlink:href": "#" + id});
+ } else {
+ return Element.prototype.use.call(this);
+ }
+ };
+ /*\
+ * Paper.symbol
+ [ method ]
+ **
+ * Creates a <symbol> element.
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ = (object) the `symbol` element
+ **
+ \*/
+ proto.symbol = function (vx, vy, vw, vh) {
+ var attr = {};
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+
+ return this.el("symbol", attr);
+ };
+ /*\
+ * Paper.text
+ [ method ]
+ **
+ * Draws a text string
+ **
+ - x (number) x coordinate position
+ - y (number) y coordinate position
+ - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements
+ = (object) the `text` element
+ **
+ > Usage
+ | var t1 = paper.text(50, 50, "Snap");
+ | var t2 = paper.text(50, 50, ["S","n","a","p"]);
+ | // Text path usage
+ | t1.attr({textpath: "M10,10L100,100"});
+ | // or
+ | var pth = paper.path("M10,10L100,100");
+ | t1.attr({textpath: pth});
+ \*/
+ proto.text = function (x, y, text) {
+ var attr = {};
+ if (is(x, "object")) {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ text: text || ""
+ };
+ }
+ return this.el("text", attr);
+ };
+ /*\
+ * Paper.line
+ [ method ]
+ **
+ * Draws a line
+ **
+ - x1 (number) x coordinate position of the start
+ - y1 (number) y coordinate position of the start
+ - x2 (number) x coordinate position of the end
+ - y2 (number) y coordinate position of the end
+ = (object) the `line` element
+ **
+ > Usage
+ | var t1 = paper.line(50, 50, 100, 100);
+ \*/
+ proto.line = function (x1, y1, x2, y2) {
+ var attr = {};
+ if (is(x1, "object")) {
+ attr = x1;
+ } else if (x1 != null) {
+ attr = {
+ x1: x1,
+ x2: x2,
+ y1: y1,
+ y2: y2
+ };
+ }
+ return this.el("line", attr);
+ };
+ /*\
+ * Paper.polyline
+ [ method ]
+ **
+ * Draws a polyline
+ **
+ - points (array) array of points
+ * or
+ - varargs (…) points
+ = (object) the `polyline` element
+ **
+ > Usage
+ | var p1 = paper.polyline([10, 10, 100, 100]);
+ | var p2 = paper.polyline(10, 10, 100, 100);
+ \*/
+ proto.polyline = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polyline", attr);
+ };
+ /*\
+ * Paper.polygon
+ [ method ]
+ **
+ * Draws a polygon. See @Paper.polyline
+ \*/
+ proto.polygon = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polygon", attr);
+ };
+ // gradients
+ (function () {
+ var $ = Snap._.$;
+ // gradients' helpers
+ function Gstops() {
+ return this.selectAll("stop");
+ }
+ function GaddStop(color, offset) {
+ var stop = $("stop"),
+ attr = {
+ offset: +offset + "%"
+ };
+ color = Snap.color(color);
+ attr["stop-color"] = color.hex;
+ if (color.opacity < 1) {
+ attr["stop-opacity"] = color.opacity;
+ }
+ $(stop, attr);
+ this.node.appendChild(stop);
+ return this;
+ }
+ function GgetBBox() {
+ if (this.type == "linearGradient") {
+ var x1 = $(this.node, "x1") || 0,
+ x2 = $(this.node, "x2") || 1,
+ y1 = $(this.node, "y1") || 0,
+ y2 = $(this.node, "y2") || 0;
+ return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
+ } else {
+ var cx = this.node.cx || .5,
+ cy = this.node.cy || .5,
+ r = this.node.r || 0;
+ return Snap._.box(cx - r, cy - r, r * 2, r * 2);
+ }
+ }
+ function gradient(defs, str) {
+ var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
+ el;
+ if (!grad) {
+ return null;
+ }
+ grad.params.unshift(defs);
+ if (grad.type.toLowerCase() == "l") {
+ el = gradientLinear.apply(0, grad.params);
+ } else {
+ el = gradientRadial.apply(0, grad.params);
+ }
+ if (grad.type != grad.type.toLowerCase()) {
+ $(el.node, {
+ gradientUnits: "userSpaceOnUse"
+ });
+ }
+ var stops = grad.stops,
+ len = stops.length,
+ start = 0,
+ j = 0;
+ function seed(i, end) {
+ var step = (end - start) / (i - j);
+ for (var k = j; k < i; k++) {
+ stops[k].offset = +(+start + step * (k - j)).toFixed(2);
+ }
+ j = i;
+ start = end;
+ }
+ len--;
+ for (var i = 0; i < len; i++) if ("offset" in stops[i]) {
+ seed(i, stops[i].offset);
+ }
+ stops[len].offset = stops[len].offset || 100;
+ seed(len, stops[len].offset);
+ for (i = 0; i <= len; i++) {
+ var stop = stops[i];
+ el.addStop(stop.color, stop.offset);
+ }
+ return el;
+ }
+ function gradientLinear(defs, x1, y1, x2, y2) {
+ var el = Snap._.make("linearGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (x1 != null) {
+ $(el.node, {
+ x1: x1,
+ y1: y1,
+ x2: x2,
+ y2: y2
+ });
+ }
+ return el;
+ }
+ function gradientRadial(defs, cx, cy, r, fx, fy) {
+ var el = Snap._.make("radialGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (cx != null) {
+ $(el.node, {
+ cx: cx,
+ cy: cy,
+ r: r
+ });
+ }
+ if (fx != null && fy != null) {
+ $(el.node, {
+ fx: fx,
+ fy: fy
+ });
+ }
+ return el;
+ }
+ /*\
+ * Paper.gradient
+ [ method ]
+ **
+ * Creates a gradient element
+ **
+ - gradient (string) gradient descriptor
+ > Gradient Descriptor
+ * The gradient descriptor is an expression formatted as
+ * follows: `<type>(<coords>)<colors>`. The `<type>` can be
+ * either linear or radial. The uppercase `L` or `R` letters
+ * indicate absolute coordinates offset from the SVG surface.
+ * Lowercase `l` or `r` letters indicate coordinates
+ * calculated relative to the element to which the gradient is
+ * applied. Coordinates specify a linear gradient vector as
+ * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
+ * `r` and optional `fx`, `fy` specifying a focal point away
+ * from the center of the circle. Specify `<colors>` as a list
+ * of dash-separated CSS color values. Each color may be
+ * followed by a custom offset value, separated with a colon
+ * character.
+ > Examples
+ * Linear gradient, relative from top-left corner to bottom-right
+ * corner, from black through red to white:
+ | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
+ * Linear gradient, absolute from (0, 0) to (100, 100), from black
+ * through red at 25% to white:
+ | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
+ * Radial gradient, relative from the center of the element with radius
+ * half the width, from black to white:
+ | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
+ * To apply the gradient:
+ | paper.circle(50, 50, 40).attr({
+ | fill: g
+ | });
+ = (object) the `gradient` element
+ \*/
+ proto.gradient = function (str) {
+ return gradient(this.defs, str);
+ };
+ proto.gradientLinear = function (x1, y1, x2, y2) {
+ return gradientLinear(this.defs, x1, y1, x2, y2);
+ };
+ proto.gradientRadial = function (cx, cy, r, fx, fy) {
+ return gradientRadial(this.defs, cx, cy, r, fx, fy);
+ };
+ /*\
+ * Paper.toString
+ [ method ]
+ **
+ * Returns SVG code for the @Paper
+ = (string) SVG code for the @Paper
+ \*/
+ proto.toString = function () {
+ var doc = this.node.ownerDocument,
+ f = doc.createDocumentFragment(),
+ d = doc.createElement("div"),
+ svg = this.node.cloneNode(true),
+ res;
+ f.appendChild(d);
+ d.appendChild(svg);
+ Snap._.$(svg, {xmlns: "http://www.w3.org/2000/svg"});
+ res = d.innerHTML;
+ f.removeChild(f.firstChild);
+ return res;
+ };
+ /*\
+ * Paper.toDataURL
+ [ method ]
+ **
+ * Returns SVG code for the @Paper as Data URI string.
+ = (string) Data URI string
+ \*/
+ proto.toDataURL = function () {
+ if (window && window.btoa) {
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
+ }
+ };
+ /*\
+ * Paper.clear
+ [ method ]
+ **
+ * Removes all child nodes of the paper, except <defs>.
+ \*/
+ proto.clear = function () {
+ var node = this.node.firstChild,
+ next;
+ while (node) {
+ next = node.nextSibling;
+ if (node.tagName != "defs") {
+ node.parentNode.removeChild(node);
+ } else {
+ proto.clear.call({node: node});
+ }
+ node = next;
+ }
+ };
+ }());
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ clone = Snap._.clone,
+ has = "hasOwnProperty",
+ p2s = /,?([a-z]),?/gi,
+ toFloat = parseFloat,
+ math = Math,
+ PI = math.PI,
+ mmin = math.min,
+ mmax = math.max,
+ pow = math.pow,
+ abs = math.abs;
+ function paths(ps) {
+ var p = paths.ps = paths.ps || {};
+ if (p[ps]) {
+ p[ps].sleep = 100;
+ } else {
+ p[ps] = {
+ sleep: 100
+ };
+ }
+ setTimeout(function () {
+ for (var key in p) if (p[has](key) && key != ps) {
+ p[key].sleep--;
+ !p[key].sleep && delete p[key];
+ }
+ });
+ return p[ps];
+ }
+ function box(x, y, width, height) {
+ if (x == null) {
+ x = y = width = height = 0;
+ }
+ if (y == null) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ return {
+ x: x,
+ y: y,
+ width: width,
+ w: width,
+ height: height,
+ h: height,
+ x2: x + width,
+ y2: y + height,
+ cx: x + width / 2,
+ cy: y + height / 2,
+ r1: math.min(width, height) / 2,
+ r2: math.max(width, height) / 2,
+ r0: math.sqrt(width * width + height * height) / 2,
+ path: rectPath(x, y, width, height),
+ vb: [x, y, width, height].join(" ")
+ };
+ }
+ function toString() {
+ return this.join(",").replace(p2s, "$1");
+ }
+ function pathClone(pathArray) {
+ var res = clone(pathArray);
+ res.toString = toString;
+ return res;
+ }
+ function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
+ if (length == null) {
+ return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
+ } else {
+ return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
+ getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
+ }
+ }
+ function getLengthFactory(istotal, subpath) {
+ function O(val) {
+ return +(+val).toFixed(3);
+ }
+ return Snap._.cacher(function (path, length, onlystart) {
+ if (path instanceof Element) {
+ path = path.attr("d");
+ }
+ path = path2curve(path);
+ var x, y, p, l, sp = "", subpaths = {}, point,
+ len = 0;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = +p[1];
+ y = +p[2];
+ } else {
+ l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ if (len + l > length) {
+ if (subpath && !subpaths.start) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ sp += [
+ "C" + O(point.start.x),
+ O(point.start.y),
+ O(point.m.x),
+ O(point.m.y),
+ O(point.x),
+ O(point.y)
+ ];
+ if (onlystart) {return sp;}
+ subpaths.start = sp;
+ sp = [
+ "M" + O(point.x),
+ O(point.y) + "C" + O(point.n.x),
+ O(point.n.y),
+ O(point.end.x),
+ O(point.end.y),
+ O(p[5]),
+ O(p[6])
+ ].join();
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ continue;
+ }
+ if (!istotal && !subpath) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ return point;
+ }
+ }
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ }
+ sp += p.shift() + p;
+ }
+ subpaths.end = sp;
+ point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
+ return point;
+ }, null, Snap._.clone);
+ }
+ var getTotalLength = getLengthFactory(1),
+ getPointAtLength = getLengthFactory(),
+ getSubpathsAtLength = getLengthFactory(0, 1);
+ function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t,
+ t13 = pow(t1, 3),
+ t12 = pow(t1, 2),
+ t2 = t * t,
+ t3 = t2 * t,
+ x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
+ y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
+ mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
+ my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
+ nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
+ ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
+ ax = t1 * p1x + t * c1x,
+ ay = t1 * p1y + t * c1y,
+ cx = t1 * c2x + t * p2x,
+ cy = t1 * c2y + t * p2y,
+ alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
+ // (mx > nx || my < ny) && (alpha += 180);
+ return {
+ x: x,
+ y: y,
+ m: {x: mx, y: my},
+ n: {x: nx, y: ny},
+ start: {x: ax, y: ay},
+ end: {x: cx, y: cy},
+ alpha: alpha
+ };
+ }
+ function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
+ if (!Snap.is(p1x, "array")) {
+ p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
+ }
+ var bbox = curveDim.apply(null, p1x);
+ return box(
+ bbox.min.x,
+ bbox.min.y,
+ bbox.max.x - bbox.min.x,
+ bbox.max.y - bbox.min.y
+ );
+ }
+ function isPointInsideBBox(bbox, x, y) {
+ return x >= bbox.x &&
+ x <= bbox.x + bbox.width &&
+ y >= bbox.y &&
+ y <= bbox.y + bbox.height;
+ }
+ function isBBoxIntersect(bbox1, bbox2) {
+ bbox1 = box(bbox1);
+ bbox2 = box(bbox2);
+ return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)
+ || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
+ || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
+ && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y
+ || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
+ }
+ function base3(t, p1, p2, p3, p4) {
+ var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
+ t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
+ return t * t2 - 3 * p1 + 3 * p2;
+ }
+ function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
+ if (z == null) {
+ z = 1;
+ }
+ z = z > 1 ? 1 : z < 0 ? 0 : z;
+ var z2 = z / 2,
+ n = 12,
+ Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
+ Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],
+ sum = 0;
+ for (var i = 0; i < n; i++) {
+ var ct = z2 * Tvalues[i] + z2,
+ xbase = base3(ct, x1, x2, x3, x4),
+ ybase = base3(ct, y1, y2, y3, y4),
+ comb = xbase * xbase + ybase * ybase;
+ sum += Cvalues[i] * math.sqrt(comb);
+ }
+ return z2 * sum;
+ }
+ function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
+ if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
+ return;
+ }
+ var t = 1,
+ step = t / 2,
+ t2 = t - step,
+ l,
+ e = .01;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ while (abs(l - ll) > e) {
+ step /= 2;
+ t2 += (l < ll ? 1 : -1) * step;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ }
+ return t2;
+ }
+ function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
+ if (
+ mmax(x1, x2) < mmin(x3, x4) ||
+ mmin(x1, x2) > mmax(x3, x4) ||
+ mmax(y1, y2) < mmin(y3, y4) ||
+ mmin(y1, y2) > mmax(y3, y4)
+ ) {
+ return;
+ }
+ var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
+ ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
+ denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
+
+ if (!denominator) {
+ return;
+ }
+ var px = nx / denominator,
+ py = ny / denominator,
+ px2 = +px.toFixed(2),
+ py2 = +py.toFixed(2);
+ if (
+ px2 < +mmin(x1, x2).toFixed(2) ||
+ px2 > +mmax(x1, x2).toFixed(2) ||
+ px2 < +mmin(x3, x4).toFixed(2) ||
+ px2 > +mmax(x3, x4).toFixed(2) ||
+ py2 < +mmin(y1, y2).toFixed(2) ||
+ py2 > +mmax(y1, y2).toFixed(2) ||
+ py2 < +mmin(y3, y4).toFixed(2) ||
+ py2 > +mmax(y3, y4).toFixed(2)
+ ) {
+ return;
+ }
+ return {x: px, y: py};
+ }
+ function inter(bez1, bez2) {
+ return interHelper(bez1, bez2);
+ }
+ function interCount(bez1, bez2) {
+ return interHelper(bez1, bez2, 1);
+ }
+ function interHelper(bez1, bez2, justCount) {
+ var bbox1 = bezierBBox(bez1),
+ bbox2 = bezierBBox(bez2);
+ if (!isBBoxIntersect(bbox1, bbox2)) {
+ return justCount ? 0 : [];
+ }
+ var l1 = bezlen.apply(0, bez1),
+ l2 = bezlen.apply(0, bez2),
+ n1 = ~~(l1 / 8),
+ n2 = ~~(l2 / 8),
+ dots1 = [],
+ dots2 = [],
+ xy = {},
+ res = justCount ? 0 : [];
+ for (var i = 0; i < n1 + 1; i++) {
+ var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
+ dots1.push({x: p.x, y: p.y, t: i / n1});
+ }
+ for (i = 0; i < n2 + 1; i++) {
+ p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
+ dots2.push({x: p.x, y: p.y, t: i / n2});
+ }
+ for (i = 0; i < n1; i++) {
+ for (var j = 0; j < n2; j++) {
+ var di = dots1[i],
+ di1 = dots1[i + 1],
+ dj = dots2[j],
+ dj1 = dots2[j + 1],
+ ci = abs(di1.x - di.x) < .001 ? "y" : "x",
+ cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
+ is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
+ if (is) {
+ if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
+ continue;
+ }
+ xy[is.x.toFixed(4)] = is.y.toFixed(4);
+ var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
+ t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
+ if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
+ if (justCount) {
+ res++;
+ } else {
+ res.push({
+ x: is.x,
+ y: is.y,
+ t1: t1,
+ t2: t2
+ });
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function pathIntersection(path1, path2) {
+ return interPathHelper(path1, path2);
+ }
+ function pathIntersectionNumber(path1, path2) {
+ return interPathHelper(path1, path2, 1);
+ }
+ function interPathHelper(path1, path2, justCount) {
+ path1 = path2curve(path1);
+ path2 = path2curve(path2);
+ var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
+ res = justCount ? 0 : [];
+ for (var i = 0, ii = path1.length; i < ii; i++) {
+ var pi = path1[i];
+ if (pi[0] == "M") {
+ x1 = x1m = pi[1];
+ y1 = y1m = pi[2];
+ } else {
+ if (pi[0] == "C") {
+ bez1 = [x1, y1].concat(pi.slice(1));
+ x1 = bez1[6];
+ y1 = bez1[7];
+ } else {
+ bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
+ x1 = x1m;
+ y1 = y1m;
+ }
+ for (var j = 0, jj = path2.length; j < jj; j++) {
+ var pj = path2[j];
+ if (pj[0] == "M") {
+ x2 = x2m = pj[1];
+ y2 = y2m = pj[2];
+ } else {
+ if (pj[0] == "C") {
+ bez2 = [x2, y2].concat(pj.slice(1));
+ x2 = bez2[6];
+ y2 = bez2[7];
+ } else {
+ bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
+ x2 = x2m;
+ y2 = y2m;
+ }
+ var intr = interHelper(bez1, bez2, justCount);
+ if (justCount) {
+ res += intr;
+ } else {
+ for (var k = 0, kk = intr.length; k < kk; k++) {
+ intr[k].segment1 = i;
+ intr[k].segment2 = j;
+ intr[k].bez1 = bez1;
+ intr[k].bez2 = bez2;
+ }
+ res = res.concat(intr);
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function isPointInsidePath(path, x, y) {
+ var bbox = pathBBox(path);
+ return isPointInsideBBox(bbox, x, y) &&
+ interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1;
+ }
+ function pathBBox(path) {
+ var pth = paths(path);
+ if (pth.bbox) {
+ return clone(pth.bbox);
+ }
+ if (!path) {
+ return box();
+ }
+ path = path2curve(path);
+ var x = 0,
+ y = 0,
+ X = [],
+ Y = [],
+ p;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = p[1];
+ y = p[2];
+ X.push(x);
+ Y.push(y);
+ } else {
+ var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ X = X.concat(dim.min.x, dim.max.x);
+ Y = Y.concat(dim.min.y, dim.max.y);
+ x = p[5];
+ y = p[6];
+ }
+ }
+ var xmin = mmin.apply(0, X),
+ ymin = mmin.apply(0, Y),
+ xmax = mmax.apply(0, X),
+ ymax = mmax.apply(0, Y),
+ bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
+ pth.bbox = clone(bb);
+ return bb;
+ }
+ function rectPath(x, y, w, h, r) {
+ if (r) {
+ return [
+ ["M", +x + (+r), y],
+ ["l", w - r * 2, 0],
+ ["a", r, r, 0, 0, 1, r, r],
+ ["l", 0, h - r * 2],
+ ["a", r, r, 0, 0, 1, -r, r],
+ ["l", r * 2 - w, 0],
+ ["a", r, r, 0, 0, 1, -r, -r],
+ ["l", 0, r * 2 - h],
+ ["a", r, r, 0, 0, 1, r, -r],
+ ["z"]
+ ];
+ }
+ var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
+ res.toString = toString;
+ return res;
+ }
+ function ellipsePath(x, y, rx, ry, a) {
+ if (a == null && ry == null) {
+ ry = rx;
+ }
+ x = +x;
+ y = +y;
+ rx = +rx;
+ ry = +ry;
+ if (a != null) {
+ var rad = Math.PI / 180,
+ x1 = x + rx * Math.cos(-ry * rad),
+ x2 = x + rx * Math.cos(-a * rad),
+ y1 = y + rx * Math.sin(-ry * rad),
+ y2 = y + rx * Math.sin(-a * rad),
+ res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
+ } else {
+ res = [
+ ["M", x, y],
+ ["m", 0, -ry],
+ ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
+ ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
+ ["z"]
+ ];
+ }
+ res.toString = toString;
+ return res;
+ }
+ var unit2px = Snap._unit2px,
+ getPath = {
+ path: function (el) {
+ return el.attr("path");
+ },
+ circle: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx, attr.cy, attr.r);
+ },
+ ellipse: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
+ },
+ rect: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
+ },
+ image: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
+ },
+ line: function (el) {
+ return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
+ },
+ polyline: function (el) {
+ return "M" + el.attr("points");
+ },
+ polygon: function (el) {
+ return "M" + el.attr("points") + "z";
+ },
+ deflt: function (el) {
+ var bbox = el.node.getBBox();
+ return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
+ }
+ };
+ function pathToRelative(pathArray) {
+ var pth = paths(pathArray),
+ lowerCase = String.prototype.toLowerCase;
+ if (pth.rel) {
+ return pathClone(pth.rel);
+ }
+ if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = pathArray[0][1];
+ y = pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res.push(["M", x, y]);
+ }
+ for (var i = start, ii = pathArray.length; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != lowerCase.call(pa[0])) {
+ r[0] = lowerCase.call(pa[0]);
+ switch (r[0]) {
+ case "a":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] - x).toFixed(3);
+ r[7] = +(pa[7] - y).toFixed(3);
+ break;
+ case "v":
+ r[1] = +(pa[1] - y).toFixed(3);
+ break;
+ case "m":
+ mx = pa[1];
+ my = pa[2];
+ default:
+ for (var j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
+ }
+ }
+ } else {
+ r = res[i] = [];
+ if (pa[0] == "m") {
+ mx = pa[1] + x;
+ my = pa[2] + y;
+ }
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ var len = res[i].length;
+ switch (res[i][0]) {
+ case "z":
+ x = mx;
+ y = my;
+ break;
+ case "h":
+ x += +res[i][len - 1];
+ break;
+ case "v":
+ y += +res[i][len - 1];
+ break;
+ default:
+ x += +res[i][len - 2];
+ y += +res[i][len - 1];
+ }
+ }
+ res.toString = toString;
+ pth.rel = pathClone(res);
+ return res;
+ }
+ function pathToAbsolute(pathArray) {
+ var pth = paths(pathArray);
+ if (pth.abs) {
+ return pathClone(pth.abs);
+ }
+ if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough assumption
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ if (!pathArray || !pathArray.length) {
+ return [["M", 0, 0]];
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0,
+ pa0;
+ if (pathArray[0][0] == "M") {
+ x = +pathArray[0][1];
+ y = +pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[0] = ["M", x, y];
+ }
+ var crz = pathArray.length == 3 &&
+ pathArray[0][0] == "M" &&
+ pathArray[1][0].toUpperCase() == "R" &&
+ pathArray[2][0].toUpperCase() == "Z";
+ for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
+ res.push(r = []);
+ pa = pathArray[i];
+ pa0 = pa[0];
+ if (pa0 != pa0.toUpperCase()) {
+ r[0] = pa0.toUpperCase();
+ switch (r[0]) {
+ case "A":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +pa[6] + x;
+ r[7] = +pa[7] + y;
+ break;
+ case "V":
+ r[1] = +pa[1] + y;
+ break;
+ case "H":
+ r[1] = +pa[1] + x;
+ break;
+ case "R":
+ var dots = [x, y].concat(pa.slice(1));
+ for (var j = 2, jj = dots.length; j < jj; j++) {
+ dots[j] = +dots[j] + x;
+ dots[++j] = +dots[j] + y;
+ }
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ break;
+ case "O":
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ break;
+ case "U":
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ break;
+ case "M":
+ mx = +pa[1] + x;
+ my = +pa[2] + y;
+ default:
+ for (j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +pa[j] + ((j % 2) ? x : y);
+ }
+ }
+ } else if (pa0 == "R") {
+ dots = [x, y].concat(pa.slice(1));
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ r = ["R"].concat(pa.slice(-2));
+ } else if (pa0 == "O") {
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ } else if (pa0 == "U") {
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ } else {
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ r[k] = pa[k];
+ }
+ }
+ pa0 = pa0.toUpperCase();
+ if (pa0 != "O") {
+ switch (r[0]) {
+ case "Z":
+ x = +mx;
+ y = +my;
+ break;
+ case "H":
+ x = r[1];
+ break;
+ case "V":
+ y = r[1];
+ break;
+ case "M":
+ mx = r[r.length - 2];
+ my = r[r.length - 1];
+ default:
+ x = r[r.length - 2];
+ y = r[r.length - 1];
+ }
+ }
+ }
+ res.toString = toString;
+ pth.abs = pathClone(res);
+ return res;
+ }
+ function l2c(x1, y1, x2, y2) {
+ return [x1, y1, x2, y2, x2, y2];
+ }
+ function q2c(x1, y1, ax, ay, x2, y2) {
+ var _13 = 1 / 3,
+ _23 = 2 / 3;
+ return [
+ _13 * x1 + _23 * ax,
+ _13 * y1 + _23 * ay,
+ _13 * x2 + _23 * ax,
+ _13 * y2 + _23 * ay,
+ x2,
+ y2
+ ];
+ }
+ function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ var _120 = PI * 120 / 180,
+ rad = PI / 180 * (+angle || 0),
+ res = [],
+ xy,
+ rotate = Snap._.cacher(function (x, y, rad) {
+ var X = x * math.cos(rad) - y * math.sin(rad),
+ Y = x * math.sin(rad) + y * math.cos(rad);
+ return {x: X, y: Y};
+ });
+ if (!recursive) {
+ xy = rotate(x1, y1, -rad);
+ x1 = xy.x;
+ y1 = xy.y;
+ xy = rotate(x2, y2, -rad);
+ x2 = xy.x;
+ y2 = xy.y;
+ var cos = math.cos(PI / 180 * angle),
+ sin = math.sin(PI / 180 * angle),
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2;
+ var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
+ if (h > 1) {
+ h = math.sqrt(h);
+ rx = h * rx;
+ ry = h * ry;
+ }
+ var rx2 = rx * rx,
+ ry2 = ry * ry,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
+ f2 = math.asin(((y2 - cy) / ry).toFixed(9));
+
+ f1 = x1 < cx ? PI - f1 : f1;
+ f2 = x2 < cx ? PI - f2 : f2;
+ f1 < 0 && (f1 = PI * 2 + f1);
+ f2 < 0 && (f2 = PI * 2 + f2);
+ if (sweep_flag && f1 > f2) {
+ f1 = f1 - PI * 2;
+ }
+ if (!sweep_flag && f2 > f1) {
+ f2 = f2 - PI * 2;
+ }
+ } else {
+ f1 = recursive[0];
+ f2 = recursive[1];
+ cx = recursive[2];
+ cy = recursive[3];
+ }
+ var df = f2 - f1;
+ if (abs(df) > _120) {
+ var f2old = f2,
+ x2old = x2,
+ y2old = y2;
+ f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
+ x2 = cx + rx * math.cos(f2);
+ y2 = cy + ry * math.sin(f2);
+ res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
+ }
+ df = f2 - f1;
+ var c1 = math.cos(f1),
+ s1 = math.sin(f1),
+ c2 = math.cos(f2),
+ s2 = math.sin(f2),
+ t = math.tan(df / 4),
+ hx = 4 / 3 * rx * t,
+ hy = 4 / 3 * ry * t,
+ m1 = [x1, y1],
+ m2 = [x1 + hx * s1, y1 - hy * c1],
+ m3 = [x2 + hx * s2, y2 - hy * c2],
+ m4 = [x2, y2];
+ m2[0] = 2 * m1[0] - m2[0];
+ m2[1] = 2 * m1[1] - m2[1];
+ if (recursive) {
+ return [m2, m3, m4].concat(res);
+ } else {
+ res = [m2, m3, m4].concat(res).join().split(",");
+ var newres = [];
+ for (var i = 0, ii = res.length; i < ii; i++) {
+ newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
+ }
+ return newres;
+ }
+ }
+ function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t;
+ return {
+ x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
+ };
+ }
+
+ // Returns bounding box of cubic bezier curve.
+ // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
+ // Original version: NISHIO Hirokazu
+ // Modifications: https://github.com/timo22345
+ function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var tvalues = [],
+ bounds = [[], []],
+ a, b, c, t, t1, t2, b2ac, sqrtb2ac;
+ for (var i = 0; i < 2; ++i) {
+ if (i == 0) {
+ b = 6 * x0 - 12 * x1 + 6 * x2;
+ a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
+ c = 3 * x1 - 3 * x0;
+ } else {
+ b = 6 * y0 - 12 * y1 + 6 * y2;
+ a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
+ c = 3 * y1 - 3 * y0;
+ }
+ if (abs(a) < 1e-12) {
+ if (abs(b) < 1e-12) {
+ continue;
+ }
+ t = -c / b;
+ if (0 < t && t < 1) {
+ tvalues.push(t);
+ }
+ continue;
+ }
+ b2ac = b * b - 4 * c * a;
+ sqrtb2ac = math.sqrt(b2ac);
+ if (b2ac < 0) {
+ continue;
+ }
+ t1 = (-b + sqrtb2ac) / (2 * a);
+ if (0 < t1 && t1 < 1) {
+ tvalues.push(t1);
+ }
+ t2 = (-b - sqrtb2ac) / (2 * a);
+ if (0 < t2 && t2 < 1) {
+ tvalues.push(t2);
+ }
+ }
+
+ var x, y, j = tvalues.length,
+ jlen = j,
+ mt;
+ while (j--) {
+ t = tvalues[j];
+ mt = 1 - t;
+ bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
+ bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
+ }
+
+ bounds[0][jlen] = x0;
+ bounds[1][jlen] = y0;
+ bounds[0][jlen + 1] = x3;
+ bounds[1][jlen + 1] = y3;
+ bounds[0].length = bounds[1].length = jlen + 2;
+
+
+ return {
+ min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},
+ max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}
+ };
+ }
+
+ function path2curve(path, path2) {
+ var pth = !path2 && paths(path);
+ if (!path2 && pth.curve) {
+ return pathClone(pth.curve);
+ }
+ var p = pathToAbsolute(path),
+ p2 = path2 && pathToAbsolute(path2),
+ attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ processPath = function (path, d, pcom) {
+ var nx, ny;
+ if (!path) {
+ return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
+ }
+ !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);
+ switch (path[0]) {
+ case "M":
+ d.X = path[1];
+ d.Y = path[2];
+ break;
+ case "A":
+ path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
+ break;
+ case "S":
+ if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
+ nx = d.x * 2 - d.bx; // And reflect the previous
+ ny = d.y * 2 - d.by; // command's control point relative to the current point.
+ }
+ else { // or some else or nothing
+ nx = d.x;
+ ny = d.y;
+ }
+ path = ["C", nx, ny].concat(path.slice(1));
+ break;
+ case "T":
+ if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
+ d.qx = d.x * 2 - d.qx; // And make a reflection similar
+ d.qy = d.y * 2 - d.qy; // to case "S".
+ }
+ else { // or something else or nothing
+ d.qx = d.x;
+ d.qy = d.y;
+ }
+ path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
+ break;
+ case "Q":
+ d.qx = path[1];
+ d.qy = path[2];
+ path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
+ break;
+ case "L":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
+ break;
+ case "H":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
+ break;
+ case "V":
+ path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
+ break;
+ case "Z":
+ path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
+ break;
+ }
+ return path;
+ },
+ fixArc = function (pp, i) {
+ if (pp[i].length > 7) {
+ pp[i].shift();
+ var pi = pp[i];
+ while (pi.length) {
+ pcoms1[i] = "A"; // if created multiple C:s, their original seg is saved
+ p2 && (pcoms2[i] = "A"); // the same as above
+ pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
+ }
+ pp.splice(i, 1);
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ fixM = function (path1, path2, a1, a2, i) {
+ if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
+ path2.splice(i, 0, ["M", a2.x, a2.y]);
+ a1.bx = 0;
+ a1.by = 0;
+ a1.x = path1[i][1];
+ a1.y = path1[i][2];
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ pcoms1 = [], // path commands of original path p
+ pcoms2 = [], // path commands of original path p2
+ pfirst = "", // temporary holder for original path command
+ pcom = ""; // holder for previous path command of original path
+ for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
+ p[i] && (pfirst = p[i][0]); // save current path command
+
+ if (pfirst != "C") // C is not saved yet, because it may be result of conversion
+ {
+ pcoms1[i] = pfirst; // Save current path command
+ i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom
+ }
+ p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
+
+ if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
+ // which may produce multiple C:s
+ // so we have to make sure that C is also C in original path
+
+ fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
+
+ if (p2) { // the same procedures is done to p2
+ p2[i] && (pfirst = p2[i][0]);
+ if (pfirst != "C") {
+ pcoms2[i] = pfirst;
+ i && (pcom = pcoms2[i - 1]);
+ }
+ p2[i] = processPath(p2[i], attrs2, pcom);
+
+ if (pcoms2[i] != "A" && pfirst == "C") {
+ pcoms2[i] = "C";
+ }
+
+ fixArc(p2, i);
+ }
+ fixM(p, p2, attrs, attrs2, i);
+ fixM(p2, p, attrs2, attrs, i);
+ var seg = p[i],
+ seg2 = p2 && p2[i],
+ seglen = seg.length,
+ seg2len = p2 && seg2.length;
+ attrs.x = seg[seglen - 2];
+ attrs.y = seg[seglen - 1];
+ attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
+ attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
+ attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
+ attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
+ attrs2.x = p2 && seg2[seg2len - 2];
+ attrs2.y = p2 && seg2[seg2len - 1];
+ }
+ if (!p2) {
+ pth.curve = pathClone(p);
+ }
+ return p2 ? [p, p2] : p;
+ }
+ function mapPath(path, matrix) {
+ if (!matrix) {
+ return path;
+ }
+ var x, y, i, j, ii, jj, pathi;
+ path = path2curve(path);
+ for (i = 0, ii = path.length; i < ii; i++) {
+ pathi = path[i];
+ for (j = 1, jj = pathi.length; j < jj; j += 2) {
+ x = matrix.x(pathi[j], pathi[j + 1]);
+ y = matrix.y(pathi[j], pathi[j + 1]);
+ pathi[j] = x;
+ pathi[j + 1] = y;
+ }
+ }
+ return path;
+ }
+
+ // http://schepers.cc/getting-to-the-point
+ function catmullRom2bezier(crp, z) {
+ var d = [];
+ for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
+ var p = [
+ {x: +crp[i - 2], y: +crp[i - 1]},
+ {x: +crp[i], y: +crp[i + 1]},
+ {x: +crp[i + 2], y: +crp[i + 3]},
+ {x: +crp[i + 4], y: +crp[i + 5]}
+ ];
+ if (z) {
+ if (!i) {
+ p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};
+ } else if (iLen - 4 == i) {
+ p[3] = {x: +crp[0], y: +crp[1]};
+ } else if (iLen - 2 == i) {
+ p[2] = {x: +crp[0], y: +crp[1]};
+ p[3] = {x: +crp[2], y: +crp[3]};
+ }
+ } else {
+ if (iLen - 4 == i) {
+ p[3] = p[2];
+ } else if (!i) {
+ p[0] = {x: +crp[i], y: +crp[i + 1]};
+ }
+ }
+ d.push(["C",
+ (-p[0].x + 6 * p[1].x + p[2].x) / 6,
+ (-p[0].y + 6 * p[1].y + p[2].y) / 6,
+ (p[1].x + 6 * p[2].x - p[3].x) / 6,
+ (p[1].y + 6*p[2].y - p[3].y) / 6,
+ p[2].x,
+ p[2].y
+ ]);
+ }
+
+ return d;
+ }
+
+ // export
+ Snap.path = paths;
+
+ /*\
+ * Snap.path.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the given path in pixels
+ **
+ - path (string) SVG path string
+ **
+ = (number) length
+ \*/
+ Snap.path.getTotalLength = getTotalLength;
+ /*\
+ * Snap.path.getPointAtLength
+ [ method ]
+ **
+ * Returns the coordinates of the point located at the given length along the given path
+ **
+ - path (string) SVG path string
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ Snap.path.getPointAtLength = getPointAtLength;
+ /*\
+ * Snap.path.getSubpath
+ [ method ]
+ **
+ * Returns the subpath of a given path between given start and end lengths
+ **
+ - path (string) SVG path string
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ Snap.path.getSubpath = function (path, from, to) {
+ if (this.getTotalLength(path) - to < 1e-6) {
+ return getSubpathsAtLength(path, from).end;
+ }
+ var a = getSubpathsAtLength(path, to, 1);
+ return from ? getSubpathsAtLength(a, from).end : a;
+ };
+ /*\
+ * Element.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the path in pixels (only works for `path` elements)
+ = (number) length
+ \*/
+ elproto.getTotalLength = function () {
+ if (this.node.getTotalLength) {
+ return this.node.getTotalLength();
+ }
+ };
+ // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?
+ /*\
+ * Element.getPointAtLength
+ [ method ]
+ **
+ * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)
+ **
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ elproto.getPointAtLength = function (length) {
+ return getPointAtLength(this.attr("d"), length);
+ };
+ // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.
+ /*\
+ * Element.getSubpath
+ [ method ]
+ **
+ * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
+ **
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ elproto.getSubpath = function (from, to) {
+ return Snap.path.getSubpath(this.attr("d"), from, to);
+ };
+ Snap._.box = box;
+ /*\
+ * Snap.path.findDotsAtSegment
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds dot coordinates on the given cubic beziér curve at the given t
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ - t (number) position on the curve (0..1)
+ = (object) point information in format:
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o m: {
+ o x: (number) x coordinate of the left anchor,
+ o y: (number) y coordinate of the left anchor
+ o },
+ o n: {
+ o x: (number) x coordinate of the right anchor,
+ o y: (number) y coordinate of the right anchor
+ o },
+ o start: {
+ o x: (number) x coordinate of the start of the curve,
+ o y: (number) y coordinate of the start of the curve
+ o },
+ o end: {
+ o x: (number) x coordinate of the end of the curve,
+ o y: (number) y coordinate of the end of the curve
+ o },
+ o alpha: (number) angle of the curve derivative at the point
+ o }
+ \*/
+ Snap.path.findDotsAtSegment = findDotsAtSegment;
+ /*\
+ * Snap.path.bezierBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given cubic beziér curve
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ * or
+ - bez (array) array of six points for beziér curve
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.bezierBBox = bezierBBox;
+ /*\
+ * Snap.path.isPointInsideBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside bounding box
+ - bbox (string) bounding box
+ - x (string) x coordinate of the point
+ - y (string) y coordinate of the point
+ = (boolean) `true` if point is inside
+ \*/
+ Snap.path.isPointInsideBBox = isPointInsideBBox;
+ /*\
+ * Snap.path.isBBoxIntersect
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if two bounding boxes intersect
+ - bbox1 (string) first bounding box
+ - bbox2 (string) second bounding box
+ = (boolean) `true` if bounding boxes intersect
+ \*/
+ Snap.path.isBBoxIntersect = isBBoxIntersect;
+ /*\
+ * Snap.path.intersection
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds intersections of two paths
+ - path1 (string) path string
+ - path2 (string) path string
+ = (array) dots of intersection
+ o [
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o t1: (number) t value for segment of path1,
+ o t2: (number) t value for segment of path2,
+ o segment1: (number) order number for segment of path1,
+ o segment2: (number) order number for segment of path2,
+ o bez1: (array) eight coordinates representing beziér curve for the segment of path1,
+ o bez2: (array) eight coordinates representing beziér curve for the segment of path2
+ o }
+ o ]
+ \*/
+ Snap.path.intersection = pathIntersection;
+ Snap.path.intersectionNumber = pathIntersectionNumber;
+ /*\
+ * Snap.path.isPointInside
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside a given closed path.
+ *
+ * Note: fill mode doesn’t affect the result of this method.
+ - path (string) path string
+ - x (number) x of the point
+ - y (number) y of the point
+ = (boolean) `true` if point is inside the path
+ \*/
+ Snap.path.isPointInside = isPointInsidePath;
+ /*\
+ * Snap.path.getBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given path
+ - path (string) path string
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.getBBox = pathBBox;
+ Snap.path.get = getPath;
+ /*\
+ * Snap.path.toRelative
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into relative values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toRelative = pathToRelative;
+ /*\
+ * Snap.path.toAbsolute
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into absolute values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toAbsolute = pathToAbsolute;
+ /*\
+ * Snap.path.toCubic
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path to a new path where all segments are cubic beziér curves
+ - pathString (string|array) path string or array of segments
+ = (array) array of segments
+ \*/
+ Snap.path.toCubic = path2curve;
+ /*\
+ * Snap.path.map
+ [ method ]
+ **
+ * Transform the path string with the given matrix
+ - path (string) path string
+ - matrix (object) see @Matrix
+ = (string) transformed path string
+ \*/
+ Snap.path.map = mapPath;
+ Snap.path.toString = toString;
+ Snap.path.clone = pathClone;
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ has = "hasOwnProperty",
+ supportsTouch = "createTouch" in glob.doc,
+ events = [
+ "click", "dblclick", "mousedown", "mousemove", "mouseout",
+ "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
+ "touchcancel"
+ ],
+ touchMap = {
+ mousedown: "touchstart",
+ mousemove: "touchmove",
+ mouseup: "touchend"
+ },
+ getScroll = function (xy, el) {
+ var name = xy == "y" ? "scrollTop" : "scrollLeft",
+ doc = el && el.node ? el.node.ownerDocument : glob.doc;
+ return doc[name in doc.documentElement ? "documentElement" : "body"][name];
+ },
+ preventDefault = function () {
+ this.returnValue = false;
+ },
+ preventTouch = function () {
+ return this.originalEvent.preventDefault();
+ },
+ stopPropagation = function () {
+ this.cancelBubble = true;
+ },
+ stopTouch = function () {
+ return this.originalEvent.stopPropagation();
+ },
+ addEvent = (function () {
+ if (glob.doc.addEventListener) {
+ return function (obj, type, fn, element) {
+ var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
+ f = function (e) {
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element);
+ if (supportsTouch && touchMap[has](type)) {
+ for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
+ if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
+ var olde = e;
+ e = e.targetTouches[i];
+ e.originalEvent = olde;
+ e.preventDefault = preventTouch;
+ e.stopPropagation = stopTouch;
+ break;
+ }
+ }
+ }
+ var x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ return fn.call(element, e, x, y);
+ };
+
+ if (type !== realName) {
+ obj.addEventListener(type, f, false);
+ }
+
+ obj.addEventListener(realName, f, false);
+
+ return function () {
+ if (type !== realName) {
+ obj.removeEventListener(type, f, false);
+ }
+
+ obj.removeEventListener(realName, f, false);
+ return true;
+ };
+ };
+ } else if (glob.doc.attachEvent) {
+ return function (obj, type, fn, element) {
+ var f = function (e) {
+ e = e || element.node.ownerDocument.window.event;
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element),
+ x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ e.preventDefault = e.preventDefault || preventDefault;
+ e.stopPropagation = e.stopPropagation || stopPropagation;
+ return fn.call(element, e, x, y);
+ };
+ obj.attachEvent("on" + type, f);
+ var detacher = function () {
+ obj.detachEvent("on" + type, f);
+ return true;
+ };
+ return detacher;
+ };
+ }
+ })(),
+ drag = [],
+ dragMove = function (e) {
+ var x = e.clientX,
+ y = e.clientY,
+ scrollY = getScroll("y"),
+ scrollX = getScroll("x"),
+ dragi,
+ j = drag.length;
+ while (j--) {
+ dragi = drag[j];
+ if (supportsTouch) {
+ var i = e.touches && e.touches.length,
+ touch;
+ while (i--) {
+ touch = e.touches[i];
+ if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
+ x = touch.clientX;
+ y = touch.clientY;
+ (e.originalEvent ? e.originalEvent : e).preventDefault();
+ break;
+ }
+ }
+ } else {
+ e.preventDefault();
+ }
+ var node = dragi.el.node,
+ o,
+ next = node.nextSibling,
+ parent = node.parentNode,
+ display = node.style.display;
+ // glob.win.opera && parent.removeChild(node);
+ // node.style.display = "none";
+ // o = dragi.el.paper.getElementByPoint(x, y);
+ // node.style.display = display;
+ // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
+ // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
+ x += scrollX;
+ y += scrollY;
+ eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
+ }
+ },
+ dragUp = function (e) {
+ Snap.unmousemove(dragMove).unmouseup(dragUp);
+ var i = drag.length,
+ dragi;
+ while (i--) {
+ dragi = drag[i];
+ dragi.el._drag = {};
+ eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
+ }
+ drag = [];
+ };
+ /*\
+ * Element.click
+ [ method ]
+ **
+ * Adds a click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unclick
+ [ method ]
+ **
+ * Removes a click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.dblclick
+ [ method ]
+ **
+ * Adds a double click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.undblclick
+ [ method ]
+ **
+ * Removes a double click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousedown
+ [ method ]
+ **
+ * Adds a mousedown event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousedown
+ [ method ]
+ **
+ * Removes a mousedown event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousemove
+ [ method ]
+ **
+ * Adds a mousemove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousemove
+ [ method ]
+ **
+ * Removes a mousemove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseout
+ [ method ]
+ **
+ * Adds a mouseout event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseout
+ [ method ]
+ **
+ * Removes a mouseout event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseover
+ [ method ]
+ **
+ * Adds a mouseover event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseover
+ [ method ]
+ **
+ * Removes a mouseover event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseup
+ [ method ]
+ **
+ * Adds a mouseup event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseup
+ [ method ]
+ **
+ * Removes a mouseup event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchstart
+ [ method ]
+ **
+ * Adds a touchstart event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchstart
+ [ method ]
+ **
+ * Removes a touchstart event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchmove
+ [ method ]
+ **
+ * Adds a touchmove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchmove
+ [ method ]
+ **
+ * Removes a touchmove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchend
+ [ method ]
+ **
+ * Adds a touchend event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchend
+ [ method ]
+ **
+ * Removes a touchend event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchcancel
+ [ method ]
+ **
+ * Adds a touchcancel event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchcancel
+ [ method ]
+ **
+ * Removes a touchcancel event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ for (var i = events.length; i--;) {
+ (function (eventName) {
+ Snap[eventName] = elproto[eventName] = function (fn, scope) {
+ if (Snap.is(fn, "function")) {
+ this.events = this.events || [];
+ this.events.push({
+ name: eventName,
+ f: fn,
+ unbind: addEvent(this.node || document, eventName, fn, scope || this)
+ });
+ }
+ return this;
+ };
+ Snap["un" + eventName] =
+ elproto["un" + eventName] = function (fn) {
+ var events = this.events || [],
+ l = events.length;
+ while (l--) if (events[l].name == eventName &&
+ (events[l].f == fn || !fn)) {
+ events[l].unbind();
+ events.splice(l, 1);
+ !events.length && delete this.events;
+ return this;
+ }
+ return this;
+ };
+ })(events[i]);
+ }
+ /*\
+ * Element.hover
+ [ method ]
+ **
+ * Adds hover event handlers to the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ - icontext (object) #optional context for hover in handler
+ - ocontext (object) #optional context for hover out handler
+ = (object) @Element
+ \*/
+ elproto.hover = function (f_in, f_out, scope_in, scope_out) {
+ return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
+ };
+ /*\
+ * Element.unhover
+ [ method ]
+ **
+ * Removes hover event handlers from the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ = (object) @Element
+ \*/
+ elproto.unhover = function (f_in, f_out) {
+ return this.unmouseover(f_in).unmouseout(f_out);
+ };
+ var draggable = [];
+ // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.
+ // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?
+ // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.
+ // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
+ /*\
+ * Element.drag
+ [ method ]
+ **
+ * Adds event handlers for an element's drag gesture
+ **
+ - onmove (function) handler for moving
+ - onstart (function) handler for drag start
+ - onend (function) handler for drag end
+ - mcontext (object) #optional context for moving handler
+ - scontext (object) #optional context for drag start handler
+ - econtext (object) #optional context for drag end handler
+ * Additionaly following `drag` events are triggered: `drag.start.<id>` on start,
+ * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element
+ * `drag.over.<id>` fires as well.
+ *
+ * Start event and start handler are called in specified context or in context of the element with following parameters:
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * Move event and move handler are called in specified context or in context of the element with following parameters:
+ o dx (number) shift by x from the start point
+ o dy (number) shift by y from the start point
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * End event and end handler are called in specified context or in context of the element with following parameters:
+ o event (object) DOM event object
+ = (object) @Element
+ \*/
+ elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
+ if (!arguments.length) {
+ var origTransform;
+ return this.drag(function (dx, dy) {
+ this.attr({
+ transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
+ });
+ }, function () {
+ origTransform = this.transform().local;
+ });
+ }
+ function start(e, x, y) {
+ (e.originalEvent || e).preventDefault();
+ this._drag.x = x;
+ this._drag.y = y;
+ this._drag.id = e.identifier;
+ !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
+ drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
+ onstart && eve.on("snap.drag.start." + this.id, onstart);
+ onmove && eve.on("snap.drag.move." + this.id, onmove);
+ onend && eve.on("snap.drag.end." + this.id, onend);
+ eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
+ }
+ this._drag = {};
+ draggable.push({el: this, start: start});
+ this.mousedown(start);
+ return this;
+ };
+ /*
+ * Element.onDragOver
+ [ method ]
+ **
+ * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)
+ - f (function) handler for event, first argument would be the element you are dragging over
+ \*/
+ // elproto.onDragOver = function (f) {
+ // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over." + this.id);
+ // };
+ /*\
+ * Element.undrag
+ [ method ]
+ **
+ * Removes all drag event handlers from the given element
+ \*/
+ elproto.undrag = function () {
+ var i = draggable.length;
+ while (i--) if (draggable[i].el == this) {
+ this.unmousedown(draggable[i].start);
+ draggable.splice(i, 1);
+ eve.unbind("snap.drag.*." + this.id);
+ }
+ !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
+ return this;
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ pproto = Paper.prototype,
+ rgurl = /^\s*url\((.+)\)/,
+ Str = String,
+ $ = Snap._.$;
+ Snap.filter = {};
+ /*\
+ * Paper.filter
+ [ method ]
+ **
+ * Creates a `<filter>` element
+ **
+ - filstr (string) SVG fragment of filter provided as a string
+ = (object) @Element
+ * Note: It is recommended to use filters embedded into the page inside an empty SVG element.
+ > Usage
+ | var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ pproto.filter = function (filstr) {
+ var paper = this;
+ if (paper.type != "svg") {
+ paper = paper.paper;
+ }
+ var f = Snap.parse(Str(filstr)),
+ id = Snap._.id(),
+ width = paper.node.offsetWidth,
+ height = paper.node.offsetHeight,
+ filter = $("filter");
+ $(filter, {
+ id: id,
+ filterUnits: "userSpaceOnUse"
+ });
+ filter.appendChild(f.node);
+ paper.defs.appendChild(filter);
+ return new Element(filter);
+ };
+
+ eve.on("snap.util.getattr.filter", function () {
+ eve.stop();
+ var p = $(this.node, "filter");
+ if (p) {
+ var match = Str(p).match(rgurl);
+ return match && Snap.select(match[1]);
+ }
+ });
+ eve.on("snap.util.attr.filter", function (value) {
+ if (value instanceof Element && value.type == "filter") {
+ eve.stop();
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ id = value.id;
+ }
+ $(this.node, {
+ filter: Snap.url(id)
+ });
+ }
+ if (!value || value == "none") {
+ eve.stop();
+ this.node.removeAttribute("filter");
+ }
+ });
+ /*\
+ * Snap.filter.blur
+ [ method ]
+ **
+ * Returns an SVG markup string for the blur filter
+ **
+ - x (number) amount of horizontal blur, in pixels
+ - y (number) #optional amount of vertical blur, in pixels
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.blur(5, 10)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.blur = function (x, y) {
+ if (x == null) {
+ x = 2;
+ }
+ var def = y == null ? x : [x, y];
+ return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
+ def: def
+ });
+ };
+ Snap.filter.blur.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.shadow
+ [ method ]
+ **
+ * Returns an SVG markup string for the shadow filter
+ **
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - blur (number) #optional amount of blur
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * which makes blur default to `4`. Or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - opacity (number) #optional `0..1` opacity of the shadow
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
+ if (typeof blur == "string") {
+ color = blur;
+ opacity = color;
+ blur = 4;
+ }
+ if (typeof color != "string") {
+ opacity = color;
+ color = "#000";
+ }
+ color = color || "#000";
+ if (blur == null) {
+ blur = 4;
+ }
+ if (opacity == null) {
+ opacity = 1;
+ }
+ if (dx == null) {
+ dx = 0;
+ dy = 2;
+ }
+ if (dy == null) {
+ dy = dx;
+ }
+ color = Snap.color(color);
+ return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
+ color: color,
+ dx: dx,
+ dy: dy,
+ blur: blur,
+ opacity: opacity
+ });
+ };
+ Snap.filter.shadow.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.grayscale
+ [ method ]
+ **
+ * Returns an SVG markup string for the grayscale filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.grayscale = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
+ a: 0.2126 + 0.7874 * (1 - amount),
+ b: 0.7152 - 0.7152 * (1 - amount),
+ c: 0.0722 - 0.0722 * (1 - amount),
+ d: 0.2126 - 0.2126 * (1 - amount),
+ e: 0.7152 + 0.2848 * (1 - amount),
+ f: 0.0722 - 0.0722 * (1 - amount),
+ g: 0.2126 - 0.2126 * (1 - amount),
+ h: 0.0722 + 0.9278 * (1 - amount)
+ });
+ };
+ Snap.filter.grayscale.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.sepia
+ [ method ]
+ **
+ * Returns an SVG markup string for the sepia filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.sepia = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
+ a: 0.393 + 0.607 * (1 - amount),
+ b: 0.769 - 0.769 * (1 - amount),
+ c: 0.189 - 0.189 * (1 - amount),
+ d: 0.349 - 0.349 * (1 - amount),
+ e: 0.686 + 0.314 * (1 - amount),
+ f: 0.168 - 0.168 * (1 - amount),
+ g: 0.272 - 0.272 * (1 - amount),
+ h: 0.534 - 0.534 * (1 - amount),
+ i: 0.131 + 0.869 * (1 - amount)
+ });
+ };
+ Snap.filter.sepia.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.saturate
+ [ method ]
+ **
+ * Returns an SVG markup string for the saturate filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.saturate = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
+ amount: 1 - amount
+ });
+ };
+ Snap.filter.saturate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.hueRotate
+ [ method ]
+ **
+ * Returns an SVG markup string for the hue-rotate filter
+ **
+ - angle (number) angle of rotation
+ = (string) filter representation
+ \*/
+ Snap.filter.hueRotate = function (angle) {
+ angle = angle || 0;
+ return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
+ angle: angle
+ });
+ };
+ Snap.filter.hueRotate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.invert
+ [ method ]
+ **
+ * Returns an SVG markup string for the invert filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.invert = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: 1 - amount
+ });
+ };
+ Snap.filter.invert.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.brightness
+ [ method ]
+ **
+ * Returns an SVG markup string for the brightness filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.brightness = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
+ amount: amount
+ });
+ };
+ Snap.filter.brightness.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.contrast
+ [ method ]
+ **
+ * Returns an SVG markup string for the contrast filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.contrast = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: .5 - amount / 2
+ });
+ };
+ Snap.filter.contrast.toString = function () {
+ return this();
+ };
+});
+
+return Snap;
+}));
+},{"72":72}],74:[function(_dereq_,module,exports){
+'use strict';
+
+var snapsvg = module.exports = _dereq_(73);
+
+snapsvg.plugin(function(Snap, Element) {
+
+ /*\
+ * Element.children
+ [ method ]
+ **
+ * Returns array of all the children of the element.
+ = (array) array of Elements
+ \*/
+ Element.prototype.children = function () {
+ var out = [],
+ ch = this.node.childNodes;
+ for (var i = 0, ii = ch.length; i < ii; i++) {
+ out[i] = new Snap(ch[i]);
+ }
+ return out;
+ };
+});
+
+
+/**
+ * @class ClassPlugin
+ *
+ * Extends snapsvg with methods to add and remove classes
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ function split(str) {
+ return str.split(/\s+/);
+ }
+
+ function join(array) {
+ return array.join(' ');
+ }
+
+ function getClasses(e) {
+ return split(e.attr('class') || '');
+ }
+
+ function setClasses(e, classes) {
+ e.attr('class', join(classes));
+ }
+
+ /**
+ * @method snapsvg.Element#addClass
+ *
+ * @example
+ *
+ * e.attr('class', 'selector');
+ *
+ * e.addClass('foo bar'); // adds classes foo and bar
+ * e.attr('class'); // -> 'selector foo bar'
+ *
+ * e.addClass('fooBar');
+ * e.attr('class'); // -> 'selector foo bar fooBar'
+ *
+ * @param {String} cls classes to be added to the element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.addClass = function(cls) {
+ var current = getClasses(this),
+ add = split(cls),
+ i, e;
+
+ for (i = 0, e; !!(e = add[i]); i++) {
+ if (current.indexOf(e) === -1) {
+ current.push(e);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+ /**
+ * @method snapsvg.Element#hasClass
+ *
+ * @param {String} cls the class to query for
+ * @return {Boolean} returns true if the element has the given class
+ */
+ Element.prototype.hasClass = function(cls) {
+ if (!cls) {
+ throw new Error('[snapsvg] syntax: hasClass(clsStr)');
+ }
+
+ return getClasses(this).indexOf(cls) !== -1;
+ };
+
+ /**
+ * @method snapsvg.Element#removeClass
+ *
+ * @example
+ *
+ * e.attr('class', 'foo bar');
+ *
+ * e.removeClass('foo');
+ * e.attr('class'); // -> 'bar'
+ *
+ * e.removeClass('foo bar'); // removes classes foo and bar
+ * e.attr('class'); // -> ''
+ *
+ * @param {String} cls classes to be removed from element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.removeClass = function(cls) {
+ var current = getClasses(this),
+ remove = split(cls),
+ i, e, idx;
+
+ for (i = 0, e; !!(e = remove[i]); i++) {
+ idx = current.indexOf(e);
+
+ if (idx !== -1) {
+ // remove element from array
+ current.splice(idx, 1);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+});
+
+/**
+ * @class TranslatePlugin
+ *
+ * Extends snapsvg with methods to translate elements
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.Element#translate
+ *
+ * @example
+ *
+ * e.translate(10, 20);
+ *
+ * // sets transform matrix to translate(10, 20)
+ *
+ * @param {Number} x translation
+ * @param {Number} y translation
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.translate = function(x, y) {
+ var matrix = new Snap.Matrix();
+ matrix.translate(x, y);
+ return this.transform(matrix);
+ };
+});
+
+
+/**
+ * @class CreatePlugin
+ *
+ * Create an svg element without attaching it to the dom
+ */
+snapsvg.plugin(function(Snap) {
+
+ Snap.create = function(name, attrs) {
+ return Snap._.wrap(Snap._.$(name, attrs));
+ };
+});
+
+
+/**
+ * @class CreatSnapAtPlugin
+ *
+ * Extends snap.svg with a method to create a SVG element
+ * at a specific position in the DOM.
+ */
+snapsvg.plugin(function(Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.createSnapAt
+ *
+ * @example
+ *
+ * snapsvg.createSnapAt(parentNode, 200, 200);
+ *
+ * @param {Number} width of svg
+ * @param {Number} height of svg
+ * @param {Object} parentNode svg Element will be child of this
+ *
+ * @return {snapsvg.Element} the newly created wrapped SVG element instance
+ */
+ Snap.createSnapAt = function(width, height, parentNode) {
+
+ var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ svg.setAttribute('width', width);
+ svg.setAttribute('height', height);
+ if (!parentNode) {
+ parentNode = document.body;
+ }
+ parentNode.appendChild(svg);
+
+ return new Snap(svg);
+ };
+});
+},{"73":73}],75:[function(_dereq_,module,exports){
+
+var isArray = function(obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+};
+
+var annotate = function() {
+ var args = Array.prototype.slice.call(arguments);
+
+ if (args.length === 1 && isArray(args[0])) {
+ args = args[0];
+ }
+
+ var fn = args.pop();
+
+ fn.$inject = args;
+
+ return fn;
+};
+
+
+// Current limitations:
+// - can't put into "function arg" comments
+// function /* (no parenthesis like this) */ (){}
+// function abc( /* xx (no parenthesis like this) */ a, b) {}
+//
+// Just put the comment before function or inside:
+// /* (((this is fine))) */ function(a, b) {}
+// function abc(a) { /* (((this is fine))) */}
+
+var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG = /\/\*([^\*]*)\*\//m;
+
+var parse = function(fn) {
+ if (typeof fn !== 'function') {
+ throw new Error('Cannot annotate "' + fn + '". Expected a function!');
+ }
+
+ var match = fn.toString().match(FN_ARGS);
+ return match[1] && match[1].split(',').map(function(arg) {
+ match = arg.match(FN_ARG);
+ return match ? match[1].trim() : arg.trim();
+ }) || [];
+};
+
+
+exports.annotate = annotate;
+exports.parse = parse;
+exports.isArray = isArray;
+
+},{}],76:[function(_dereq_,module,exports){
+module.exports = {
+ annotate: _dereq_(75).annotate,
+ Module: _dereq_(78),
+ Injector: _dereq_(77)
+};
+
+},{"75":75,"77":77,"78":78}],77:[function(_dereq_,module,exports){
+var Module = _dereq_(78);
+var autoAnnotate = _dereq_(75).parse;
+var annotate = _dereq_(75).annotate;
+var isArray = _dereq_(75).isArray;
+
+
+var Injector = function(modules, parent) {
+ parent = parent || {
+ get: function(name) {
+ currentlyResolving.push(name);
+ throw error('No provider for "' + name + '"!');
+ }
+ };
+
+ var currentlyResolving = [];
+ var providers = this._providers = Object.create(parent._providers || null);
+ var instances = this._instances = Object.create(null);
+
+ var self = instances.injector = this;
+
+ var error = function(msg) {
+ var stack = currentlyResolving.join(' -> ');
+ currentlyResolving.length = 0;
+ return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
+ };
+
+ var get = function(name) {
+ if (!providers[name] && name.indexOf('.') !== -1) {
+ var parts = name.split('.');
+ var pivot = get(parts.shift());
+
+ while(parts.length) {
+ pivot = pivot[parts.shift()];
+ }
+
+ return pivot;
+ }
+
+ if (Object.hasOwnProperty.call(instances, name)) {
+ return instances[name];
+ }
+
+ if (Object.hasOwnProperty.call(providers, name)) {
+ if (currentlyResolving.indexOf(name) !== -1) {
+ currentlyResolving.push(name);
+ throw error('Cannot resolve circular dependency!');
+ }
+
+ currentlyResolving.push(name);
+ instances[name] = providers[name][0](providers[name][1]);
+ currentlyResolving.pop();
+
+ return instances[name];
+ }
+
+ return parent.get(name);
+ };
+
+ var instantiate = function(Type) {
+ var instance = Object.create(Type.prototype);
+ var returned = invoke(Type, instance);
+
+ return typeof returned === 'object' ? returned : instance;
+ };
+
+ var invoke = function(fn, context) {
+ if (typeof fn !== 'function') {
+ if (isArray(fn)) {
+ fn = annotate(fn.slice());
+ } else {
+ throw new Error('Cannot invoke "' + fn + '". Expected a function!');
+ }
+ }
+
+ var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
+ var dependencies = inject.map(function(dep) {
+ return get(dep);
+ });
+
+ // TODO(vojta): optimize without apply
+ return fn.apply(context, dependencies);
+ };
+
+
+ var createPrivateInjectorFactory = function(privateChildInjector) {
+ return annotate(function(key) {
+ return privateChildInjector.get(key);
+ });
+ };
+
+ var createChild = function(modules, forceNewInstances) {
+ if (forceNewInstances && forceNewInstances.length) {
+ var fromParentModule = Object.create(null);
+ var matchedScopes = Object.create(null);
+
+ var privateInjectorsCache = [];
+ var privateChildInjectors = [];
+ var privateChildFactories = [];
+
+ var provider;
+ var cacheIdx;
+ var privateChildInjector;
+ var privateChildInjectorFactory;
+ for (var name in providers) {
+ provider = providers[name];
+
+ if (forceNewInstances.indexOf(name) !== -1) {
+ if (provider[2] === 'private') {
+ cacheIdx = privateInjectorsCache.indexOf(provider[3]);
+ if (cacheIdx === -1) {
+ privateChildInjector = provider[3].createChild([], forceNewInstances);
+ privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
+ privateInjectorsCache.push(provider[3]);
+ privateChildInjectors.push(privateChildInjector);
+ privateChildFactories.push(privateChildInjectorFactory);
+ fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
+ } else {
+ fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
+ }
+ } else {
+ fromParentModule[name] = [provider[2], provider[1]];
+ }
+ matchedScopes[name] = true;
+ }
+
+ if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
+ forceNewInstances.forEach(function(scope) {
+ if (provider[1].$scope.indexOf(scope) !== -1) {
+ fromParentModule[name] = [provider[2], provider[1]];
+ matchedScopes[scope] = true;
+ }
+ });
+ }
+ }
+
+ forceNewInstances.forEach(function(scope) {
+ if (!matchedScopes[scope]) {
+ throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
+ }
+ });
+
+ modules.unshift(fromParentModule);
+ }
+
+ return new Injector(modules, self);
+ };
+
+ var factoryMap = {
+ factory: invoke,
+ type: instantiate,
+ value: function(value) {
+ return value;
+ }
+ };
+
+ modules.forEach(function(module) {
+
+ function arrayUnwrap(type, value) {
+ if (type !== 'value' && isArray(value)) {
+ value = annotate(value.slice());
+ }
+
+ return value;
+ }
+
+ // TODO(vojta): handle wrong inputs (modules)
+ if (module instanceof Module) {
+ module.forEach(function(provider) {
+ var name = provider[0];
+ var type = provider[1];
+ var value = provider[2];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ } else if (typeof module === 'object') {
+ if (module.__exports__) {
+ var clonedModule = Object.keys(module).reduce(function(m, key) {
+ if (key.substring(0, 2) !== '__') {
+ m[key] = module[key];
+ }
+ return m;
+ }, Object.create(null));
+
+ var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
+ var getFromPrivateInjector = annotate(function(key) {
+ return privateInjector.get(key);
+ });
+ module.__exports__.forEach(function(key) {
+ providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
+ });
+ } else {
+ Object.keys(module).forEach(function(name) {
+ if (module[name][2] === 'private') {
+ providers[name] = module[name];
+ return;
+ }
+
+ var type = module[name][0];
+ var value = module[name][1];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ }
+ }
+ });
+
+ // public API
+ this.get = get;
+ this.invoke = invoke;
+ this.instantiate = instantiate;
+ this.createChild = createChild;
+};
+
+module.exports = Injector;
+
+},{"75":75,"78":78}],78:[function(_dereq_,module,exports){
+var Module = function() {
+ var providers = [];
+
+ this.factory = function(name, factory) {
+ providers.push([name, 'factory', factory]);
+ return this;
+ };
+
+ this.value = function(name, value) {
+ providers.push([name, 'value', value]);
+ return this;
+ };
+
+ this.type = function(name, type) {
+ providers.push([name, 'type', type]);
+ return this;
+ };
+
+ this.forEach = function(iterator) {
+ providers.forEach(iterator);
+ };
+};
+
+module.exports = Module;
+
+},{}],79:[function(_dereq_,module,exports){
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+
+},{}],80:[function(_dereq_,module,exports){
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
+
+},{}],81:[function(_dereq_,module,exports){
+var arrayEvery = _dereq_(97),
+ baseCallback = _dereq_(104),
+ baseEvery = _dereq_(109),
+ isArray = _dereq_(166),
+ isIterateeCall = _dereq_(154);
+
+/**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = every;
+
+},{"104":104,"109":109,"154":154,"166":166,"97":97}],82:[function(_dereq_,module,exports){
+var arrayFilter = _dereq_(98),
+ baseCallback = _dereq_(104),
+ baseFilter = _dereq_(110),
+ isArray = _dereq_(166);
+
+/**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = baseCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+}
+
+module.exports = filter;
+
+},{"104":104,"110":110,"166":166,"98":98}],83:[function(_dereq_,module,exports){
+var baseEach = _dereq_(108),
+ createFind = _dereq_(143);
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
+
+},{"108":108,"143":143}],84:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(96),
+ baseEach = _dereq_(108),
+ createForEach = _dereq_(144);
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
+
+},{"108":108,"144":144,"96":96}],85:[function(_dereq_,module,exports){
+var createAggregator = _dereq_(138);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+});
+
+module.exports = groupBy;
+
+},{"138":138}],86:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(118),
+ getLength = _dereq_(149),
+ isArray = _dereq_(166),
+ isIterateeCall = _dereq_(154),
+ isLength = _dereq_(156),
+ isString = _dereq_(172),
+ values = _dereq_(181);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (!length) {
+ return false;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
+ : (baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+},{"118":118,"149":149,"154":154,"156":156,"166":166,"172":172,"181":181}],87:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(99),
+ baseCallback = _dereq_(104),
+ baseMap = _dereq_(123),
+ isArray = _dereq_(166);
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
+
+},{"104":104,"123":123,"166":166,"99":99}],88:[function(_dereq_,module,exports){
+var arrayReduce = _dereq_(100),
+ baseEach = _dereq_(108),
+ createReduce = _dereq_(145);
+
+/**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+var reduce = createReduce(arrayReduce, baseEach);
+
+module.exports = reduce;
+
+},{"100":100,"108":108,"145":145}],89:[function(_dereq_,module,exports){
+var arraySome = _dereq_(101),
+ baseCallback = _dereq_(104),
+ baseSome = _dereq_(132),
+ isArray = _dereq_(166),
+ isIterateeCall = _dereq_(154);
+
+/**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = some;
+
+},{"101":101,"104":104,"132":132,"154":154,"166":166}],90:[function(_dereq_,module,exports){
+var isNative = _dereq_(168);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = isNative(nativeNow = Date.now) && nativeNow;
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
+
+},{"168":168}],91:[function(_dereq_,module,exports){
+var isObject = _dereq_(170),
+ now = _dereq_(90);
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that delays invoking `func` until after `wait` milliseconds
+ * have elapsed since the last time it was invoked. The created function comes
+ * with a `cancel` method to cancel delayed invocations. Provide an options
+ * object to indicate that `func` should be invoked on the leading and/or
+ * trailing edge of the `wait` timeout. Subsequent calls to the debounced
+ * function return the result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ var isCalled = trailingCall;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (trailing || (maxWait !== wait)) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+}
+
+module.exports = debounce;
+
+},{"170":170,"90":90}],92:[function(_dereq_,module,exports){
+var baseDelay = _dereq_(106),
+ restParam = _dereq_(93);
+
+/**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+});
+
+module.exports = defer;
+
+},{"106":106,"93":93}],93:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],94:[function(_dereq_,module,exports){
+(function (global){
+var cachePush = _dereq_(137),
+ isNative = _dereq_(168);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+}
+
+// Add functions to the `Set` cache.
+SetCache.prototype.push = cachePush;
+
+module.exports = SetCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"137":137,"168":168}],95:[function(_dereq_,module,exports){
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
+
+},{}],96:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+},{}],97:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = arrayEvery;
+
+},{}],98:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayFilter;
+
+},{}],99:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+},{}],100:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+}
+
+module.exports = arrayReduce;
+
+},{}],101:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+},{}],102:[function(_dereq_,module,exports){
+var getSymbols = _dereq_(150),
+ keys = _dereq_(176);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+function assignWith(object, source, customizer) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+}
+
+module.exports = assignWith;
+
+},{"150":150,"176":176}],103:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(105),
+ getSymbols = _dereq_(150),
+ isNative = _dereq_(168),
+ keys = _dereq_(176);
+
+/** Native method references. */
+var preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;
+
+/** Used as `baseAssign`. */
+var nativeAssign = (function() {
+ // Avoid `Object.assign` in Firefox 34-37 which have an early implementation
+ // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
+ // for more details.
+ //
+ // Use `Object.preventExtensions` on a plain object instead of simply using
+ // `Object('x')` because Chrome and IE fail to throw an error when attempting
+ // to assign values to readonly indexes of strings.
+ var func = preventExtensions && isNative(func = Object.assign) && func;
+ try {
+ if (func) {
+ var object = preventExtensions({ '1': 0 });
+ object[0] = 1;
+ }
+ } catch(e) {
+ // Only attempt in strict mode.
+ try { func(object, 'xo'); } catch(e) {}
+ return !object[1] && func;
+ }
+ return false;
+}());
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+var baseAssign = nativeAssign || function(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
+};
+
+module.exports = baseAssign;
+
+},{"105":105,"150":150,"168":168,"176":176}],104:[function(_dereq_,module,exports){
+var baseMatches = _dereq_(124),
+ baseMatchesProperty = _dereq_(125),
+ bindCallback = _dereq_(135),
+ identity = _dereq_(185),
+ property = _dereq_(186);
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
+
+},{"124":124,"125":125,"135":135,"185":185,"186":186}],105:[function(_dereq_,module,exports){
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],106:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+}
+
+module.exports = baseDelay;
+
+},{}],107:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(118),
+ cacheIndexOf = _dereq_(136),
+ createCache = _dereq_(142);
+
+/**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = baseIndexOf,
+ isCommon = true,
+ cache = (isCommon && values.length >= 200) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseDifference;
+
+},{"118":118,"136":136,"142":142}],108:[function(_dereq_,module,exports){
+var baseForOwn = _dereq_(116),
+ createBaseEach = _dereq_(140);
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
+
+},{"116":116,"140":140}],109:[function(_dereq_,module,exports){
+var baseEach = _dereq_(108);
+
+/**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+}
+
+module.exports = baseEvery;
+
+},{"108":108}],110:[function(_dereq_,module,exports){
+var baseEach = _dereq_(108);
+
+/**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+}
+
+module.exports = baseFilter;
+
+},{"108":108}],111:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
+
+},{}],112:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+},{}],113:[function(_dereq_,module,exports){
+var isArguments = _dereq_(165),
+ isArray = _dereq_(166),
+ isArrayLike = _dereq_(152),
+ isObjectLike = _dereq_(157);
+
+/**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = baseFlatten;
+
+},{"152":152,"157":157,"165":165,"166":166}],114:[function(_dereq_,module,exports){
+var createBaseFor = _dereq_(141);
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
+
+},{"141":141}],115:[function(_dereq_,module,exports){
+var baseFor = _dereq_(114),
+ keysIn = _dereq_(177);
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
+
+},{"114":114,"177":177}],116:[function(_dereq_,module,exports){
+var baseFor = _dereq_(114),
+ keys = _dereq_(176);
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
+
+},{"114":114,"176":176}],117:[function(_dereq_,module,exports){
+var toObject = _dereq_(163);
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = -1,
+ length = path.length;
+
+ while (object != null && ++index < length) {
+ object = object[path[index]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+},{"163":163}],118:[function(_dereq_,module,exports){
+var indexOfNaN = _dereq_(151);
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
+
+},{"151":151}],119:[function(_dereq_,module,exports){
+var baseIsEqualDeep = _dereq_(120);
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ // Exit early for identical values.
+ if (value === other) {
+ return true;
+ }
+ var valType = typeof value,
+ othType = typeof other;
+
+ // Exit early for unlike primitive values.
+ if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||
+ value == null || other == null) {
+ // Return `false` unless both values are `NaN`.
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
+
+},{"120":120}],120:[function(_dereq_,module,exports){
+var equalArrays = _dereq_(146),
+ equalByTag = _dereq_(147),
+ equalObjects = _dereq_(148),
+ isArray = _dereq_(166),
+ isTypedArray = _dereq_(173);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (valWrapped || othWrapped) {
+ return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
+
+},{"146":146,"147":147,"148":148,"166":166,"173":173}],121:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+}
+
+module.exports = baseIsFunction;
+
+},{}],122:[function(_dereq_,module,exports){
+var baseIsEqual = _dereq_(119);
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The source property names to match.
+ * @param {Array} values The source values to match.
+ * @param {Array} strictCompareFlags Strict comparison flags for source values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
+ var index = -1,
+ length = props.length,
+ noCustomizer = !customizer;
+
+ while (++index < length) {
+ if ((noCustomizer && strictCompareFlags[index])
+ ? values[index] !== object[props[index]]
+ : !(props[index] in object)
+ ) {
+ return false;
+ }
+ }
+ index = -1;
+ while (++index < length) {
+ var key = props[index],
+ objValue = object[key],
+ srcValue = values[index];
+
+ if (noCustomizer && strictCompareFlags[index]) {
+ var result = objValue !== undefined || (key in object);
+ } else {
+ result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (result === undefined) {
+ result = baseIsEqual(srcValue, objValue, customizer, true);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+},{"119":119}],123:[function(_dereq_,module,exports){
+var baseEach = _dereq_(108),
+ isArrayLike = _dereq_(152);
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
+
+},{"108":108,"152":152}],124:[function(_dereq_,module,exports){
+var baseIsMatch = _dereq_(122),
+ constant = _dereq_(184),
+ isStrictComparable = _dereq_(158),
+ keys = _dereq_(176),
+ toObject = _dereq_(163);
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var props = keys(source),
+ length = props.length;
+
+ if (!length) {
+ return constant(true);
+ }
+ if (length == 1) {
+ var key = props[0],
+ value = source[key];
+
+ if (isStrictComparable(value)) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ }
+ var values = Array(length),
+ strictCompareFlags = Array(length);
+
+ while (length--) {
+ value = source[props[length]];
+ values[length] = value;
+ strictCompareFlags[length] = isStrictComparable(value);
+ }
+ return function(object) {
+ return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
+ };
+}
+
+module.exports = baseMatches;
+
+},{"122":122,"158":158,"163":163,"176":176,"184":184}],125:[function(_dereq_,module,exports){
+var baseGet = _dereq_(117),
+ baseIsEqual = _dereq_(119),
+ baseSlice = _dereq_(131),
+ isArray = _dereq_(166),
+ isKey = _dereq_(155),
+ isStrictComparable = _dereq_(158),
+ last = _dereq_(80),
+ toObject = _dereq_(163),
+ toPath = _dereq_(164);
+
+/**
+ * The base implementation of `_.matchesProperty` which does not which does
+ * not clone `value`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} value The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, value) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(value),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === value
+ ? (value !== undefined || (key in object))
+ : baseIsEqual(value, object[key], null, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+},{"117":117,"119":119,"131":131,"155":155,"158":158,"163":163,"164":164,"166":166,"80":80}],126:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(96),
+ baseMergeDeep = _dereq_(127),
+ getSymbols = _dereq_(150),
+ isArray = _dereq_(166),
+ isArrayLike = _dereq_(152),
+ isObject = _dereq_(170),
+ isObjectLike = _dereq_(157),
+ isTypedArray = _dereq_(173),
+ keys = _dereq_(176);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));
+ if (!isSrcArr) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+ }
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((isSrcArr || result !== undefined) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+}
+
+module.exports = baseMerge;
+
+},{"127":127,"150":150,"152":152,"157":157,"166":166,"170":170,"173":173,"176":176,"96":96}],127:[function(_dereq_,module,exports){
+var arrayCopy = _dereq_(95),
+ isArguments = _dereq_(165),
+ isArray = _dereq_(166),
+ isArrayLike = _dereq_(152),
+ isPlainObject = _dereq_(171),
+ isTypedArray = _dereq_(173),
+ toPlainObject = _dereq_(174);
+
+/**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+}
+
+module.exports = baseMergeDeep;
+
+},{"152":152,"165":165,"166":166,"171":171,"173":173,"174":174,"95":95}],128:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+module.exports = baseProperty;
+
+},{}],129:[function(_dereq_,module,exports){
+var baseGet = _dereq_(117),
+ toPath = _dereq_(164);
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+},{"117":117,"164":164}],130:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+}
+
+module.exports = baseReduce;
+
+},{}],131:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
+
+},{}],132:[function(_dereq_,module,exports){
+var baseEach = _dereq_(108);
+
+/**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+}
+
+module.exports = baseSome;
+
+},{"108":108}],133:[function(_dereq_,module,exports){
+/**
+ * Converts `value` to a string if it is not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
+
+},{}],134:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
+
+},{}],135:[function(_dereq_,module,exports){
+var identity = _dereq_(185);
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
+
+},{"185":185}],136:[function(_dereq_,module,exports){
+var isObject = _dereq_(170);
+
+/**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+}
+
+module.exports = cacheIndexOf;
+
+},{"170":170}],137:[function(_dereq_,module,exports){
+var isObject = _dereq_(170);
+
+/**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+}
+
+module.exports = cachePush;
+
+},{"170":170}],138:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(104),
+ baseEach = _dereq_(108),
+ isArray = _dereq_(166);
+
+/**
+ * Creates a function that aggregates a collection, creating an accumulator
+ * object composed from the results of running each element in the collection
+ * through an iteratee.
+ *
+ * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
+ * and `_.partition`.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+}
+
+module.exports = createAggregator;
+
+},{"104":104,"108":108,"166":166}],139:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(135),
+ isIterateeCall = _dereq_(154),
+ restParam = _dereq_(93);
+
+/**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 && sources[length - 2],
+ guard = length > 2 && sources[2],
+ thisArg = length > 1 && sources[length - 1];
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : null;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? null : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+}
+
+module.exports = createAssigner;
+
+},{"135":135,"154":154,"93":93}],140:[function(_dereq_,module,exports){
+var getLength = _dereq_(149),
+ isLength = _dereq_(156),
+ toObject = _dereq_(163);
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
+
+},{"149":149,"156":156,"163":163}],141:[function(_dereq_,module,exports){
+var toObject = _dereq_(163);
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
+
+},{"163":163}],142:[function(_dereq_,module,exports){
+(function (global){
+var SetCache = _dereq_(94),
+ constant = _dereq_(184),
+ isNative = _dereq_(168);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
+ return new SetCache(values);
+};
+
+module.exports = createCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"168":168,"184":184,"94":94}],143:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(104),
+ baseFind = _dereq_(111),
+ baseFindIndex = _dereq_(112),
+ isArray = _dereq_(166);
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
+
+},{"104":104,"111":111,"112":112,"166":166}],144:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(135),
+ isArray = _dereq_(166);
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
+
+},{"135":135,"166":166}],145:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(104),
+ baseReduce = _dereq_(130),
+ isArray = _dereq_(166);
+
+/**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+}
+
+module.exports = createReduce;
+
+},{"104":104,"130":130,"166":166}],146:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length,
+ result = true;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (result && ++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, arrValue, index)
+ : customizer(arrValue, othValue, index);
+ }
+ if (result === undefined) {
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ var othIndex = othLength;
+ while (othIndex--) {
+ othValue = other[othIndex];
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ if (result) {
+ break;
+ }
+ }
+ } else {
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ }
+ return !!result;
+}
+
+module.exports = equalArrays;
+
+},{}],147:[function(_dereq_,module,exports){
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} value The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+},{}],148:[function(_dereq_,module,exports){
+var keys = _dereq_(176);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var skipCtor = isLoose,
+ index = -1;
+
+ while (++index < objLength) {
+ var key = objProps[index],
+ result = isLoose ? key in other : hasOwnProperty.call(other, key);
+
+ if (result) {
+ var objValue = object[key],
+ othValue = other[key];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, objValue, key)
+ : customizer(objValue, othValue, key);
+ }
+ if (result === undefined) {
+ // Recursively compare objects (susceptible to call stack limits).
+ result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
+
+},{"176":176}],149:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(128);
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
+
+},{"128":128}],150:[function(_dereq_,module,exports){
+var constant = _dereq_(184),
+ isNative = _dereq_(168),
+ toObject = _dereq_(163);
+
+/** Native method references. */
+var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
+ return getOwnPropertySymbols(toObject(object));
+};
+
+module.exports = getSymbols;
+
+},{"163":163,"168":168,"184":184}],151:[function(_dereq_,module,exports){
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
+
+},{}],152:[function(_dereq_,module,exports){
+var getLength = _dereq_(149),
+ isLength = _dereq_(156);
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
+
+},{"149":149,"156":156}],153:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = +value;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
+
+},{}],154:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(152),
+ isIndex = _dereq_(153),
+ isObject = _dereq_(170);
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+},{"152":152,"153":153,"170":170}],155:[function(_dereq_,module,exports){
+var isArray = _dereq_(166),
+ toObject = _dereq_(163);
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
+
+},{"163":163,"166":166}],156:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+},{}],157:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+},{}],158:[function(_dereq_,module,exports){
+var isObject = _dereq_(170);
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+},{"170":170}],159:[function(_dereq_,module,exports){
+var toObject = _dereq_(163);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+
+module.exports = pickByArray;
+
+},{"163":163}],160:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(115);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+}
+
+module.exports = pickByCallback;
+
+},{"115":115}],161:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(115),
+ isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+function shimIsPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = shimIsPlainObject;
+
+},{"115":115,"157":157}],162:[function(_dereq_,module,exports){
+var isArguments = _dereq_(165),
+ isArray = _dereq_(166),
+ isIndex = _dereq_(153),
+ isLength = _dereq_(156),
+ keysIn = _dereq_(177),
+ support = _dereq_(183);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object)));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
+
+},{"153":153,"156":156,"165":165,"166":166,"177":177,"183":183}],163:[function(_dereq_,module,exports){
+var isObject = _dereq_(170);
+
+/**
+ * Converts `value` to an object if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
+
+},{"170":170}],164:[function(_dereq_,module,exports){
+var baseToString = _dereq_(133),
+ isArray = _dereq_(166);
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
+
+},{"133":133,"166":166}],165:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(152),
+ isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+}
+
+module.exports = isArguments;
+
+},{"152":152,"157":157}],166:[function(_dereq_,module,exports){
+var isLength = _dereq_(156),
+ isNative = _dereq_(168),
+ isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
+
+},{"156":156,"157":157,"168":168}],167:[function(_dereq_,module,exports){
+(function (global){
+var baseIsFunction = _dereq_(121),
+ isNative = _dereq_(168);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+};
+
+module.exports = isFunction;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"121":121,"168":168}],168:[function(_dereq_,module,exports){
+var escapeRegExp = _dereq_(182),
+ isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(objToString)
+ .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+module.exports = isNative;
+
+},{"157":157,"182":182}],169:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+}
+
+module.exports = isNumber;
+
+},{"157":157}],170:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return type == 'function' || (!!value && type == 'object');
+}
+
+module.exports = isObject;
+
+},{}],171:[function(_dereq_,module,exports){
+var isNative = _dereq_(168),
+ shimIsPlainObject = _dereq_(161);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = value.valueOf,
+ objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+};
+
+module.exports = isPlainObject;
+
+},{"161":161,"168":168}],172:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
+
+},{"157":157}],173:[function(_dereq_,module,exports){
+var isLength = _dereq_(156),
+ isObjectLike = _dereq_(157);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
+
+},{"156":156,"157":157}],174:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(105),
+ keysIn = _dereq_(177);
+
+/**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+}
+
+module.exports = toPlainObject;
+
+},{"105":105,"177":177}],175:[function(_dereq_,module,exports){
+var assignWith = _dereq_(102),
+ baseAssign = _dereq_(103),
+ createAssigner = _dereq_(139);
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+});
+
+module.exports = assign;
+
+},{"102":102,"103":103,"139":139}],176:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(152),
+ isNative = _dereq_(168),
+ isObject = _dereq_(170),
+ shimKeys = _dereq_(162);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object != null && object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
+
+},{"152":152,"162":162,"168":168,"170":170}],177:[function(_dereq_,module,exports){
+var isArguments = _dereq_(165),
+ isArray = _dereq_(166),
+ isIndex = _dereq_(153),
+ isLength = _dereq_(156),
+ isObject = _dereq_(170),
+ support = _dereq_(183);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"153":153,"156":156,"165":165,"166":166,"170":170,"183":183}],178:[function(_dereq_,module,exports){
+var baseMerge = _dereq_(126),
+ createAssigner = _dereq_(139);
+
+/**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+var merge = createAssigner(baseMerge);
+
+module.exports = merge;
+
+},{"126":126,"139":139}],179:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(99),
+ baseDifference = _dereq_(107),
+ baseFlatten = _dereq_(113),
+ bindCallback = _dereq_(135),
+ keysIn = _dereq_(177),
+ pickByArray = _dereq_(159),
+ pickByCallback = _dereq_(160),
+ restParam = _dereq_(93);
+
+/**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+});
+
+module.exports = omit;
+
+},{"107":107,"113":113,"135":135,"159":159,"160":160,"177":177,"93":93,"99":99}],180:[function(_dereq_,module,exports){
+var baseFlatten = _dereq_(113),
+ bindCallback = _dereq_(135),
+ pickByArray = _dereq_(159),
+ pickByCallback = _dereq_(160),
+ restParam = _dereq_(93);
+
+/**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+});
+
+module.exports = pick;
+
+},{"113":113,"135":135,"159":159,"160":160,"93":93}],181:[function(_dereq_,module,exports){
+var baseValues = _dereq_(134),
+ keys = _dereq_(176);
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
+
+},{"134":134,"176":176}],182:[function(_dereq_,module,exports){
+var baseToString = _dereq_(133);
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = escapeRegExp;
+
+},{"133":133}],183:[function(_dereq_,module,exports){
+(function (global){
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to detect DOM support. */
+var document = (document = global.window) && document.document;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ args = arguments,
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if functions can be decompiled by `Function#toString`
+ * (all but Firefox OS certified apps, older Opera mobile browsers, and
+ * the PlayStation 3; forced `false` for Windows 8 apps).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcDecomp = /\bthis\b/.test(function() { return this; });
+
+ /**
+ * Detect if `Function#name` is supported (all but IE).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcNames = typeof Function.name == 'string';
+
+ /**
+ * Detect if the DOM is supported.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.dom = document.createDocumentFragment().nodeType === 11;
+ } catch(e) {
+ support.dom = false;
+ }
+
+ /**
+ * Detect if `arguments` object indexes are non-enumerable.
+ *
+ * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object
+ * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat
+ * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`
+ * checks for indexes that exceed the number of function parameters and
+ * whose associated argument values are `0`.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
+ } catch(e) {
+ support.nonEnumArgs = true;
+ }
+}(1, 0));
+
+module.exports = support;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],184:[function(_dereq_,module,exports){
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+function constant(value) {
+ return function() {
+ return value;
+ };
+}
+
+module.exports = constant;
+
+},{}],185:[function(_dereq_,module,exports){
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+},{}],186:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(128),
+ basePropertyDeep = _dereq_(129),
+ isKey = _dereq_(155);
+
+/**
+ * Creates a function which returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+},{"128":128,"129":129,"155":155}],187:[function(_dereq_,module,exports){
+module.exports = _dereq_(194);
+},{"194":194}],188:[function(_dereq_,module,exports){
+module.exports = function(el) {
+
+ var c;
+
+ while (el.childNodes.length) {
+ c = el.childNodes[0];
+ el.removeChild(c);
+ }
+
+ return el;
+};
+},{}],189:[function(_dereq_,module,exports){
+module.exports = _dereq_(197);
+},{"197":197}],190:[function(_dereq_,module,exports){
+module.exports = _dereq_(201);
+},{"201":201}],191:[function(_dereq_,module,exports){
+module.exports = _dereq_(198);
+},{"198":198}],192:[function(_dereq_,module,exports){
+module.exports = _dereq_(200);
+},{"200":200}],193:[function(_dereq_,module,exports){
+module.exports = function(el) {
+ el.parentNode && el.parentNode.removeChild(el);
+};
+},{}],194:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var index = _dereq_(195);
+
+/**
+ * Whitespace regexp.
+ */
+
+var re = /\s+/;
+
+/**
+ * toString reference.
+ */
+
+var toString = Object.prototype.toString;
+
+/**
+ * Wrap `el` in a `ClassList`.
+ *
+ * @param {Element} el
+ * @return {ClassList}
+ * @api public
+ */
+
+module.exports = function(el){
+ return new ClassList(el);
+};
+
+/**
+ * Initialize a new ClassList for `el`.
+ *
+ * @param {Element} el
+ * @api private
+ */
+
+function ClassList(el) {
+ if (!el || !el.nodeType) {
+ throw new Error('A DOM element reference is required');
+ }
+ this.el = el;
+ this.list = el.classList;
+}
+
+/**
+ * Add class `name` if not already present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.add = function(name){
+ // classList
+ if (this.list) {
+ this.list.add(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (!~i) arr.push(name);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove class `name` when present, or
+ * pass a regular expression to remove
+ * any which match.
+ *
+ * @param {String|RegExp} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.remove = function(name){
+ if ('[object RegExp]' == toString.call(name)) {
+ return this.removeMatching(name);
+ }
+
+ // classList
+ if (this.list) {
+ this.list.remove(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (~i) arr.splice(i, 1);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove all classes matching `re`.
+ *
+ * @param {RegExp} re
+ * @return {ClassList}
+ * @api private
+ */
+
+ClassList.prototype.removeMatching = function(re){
+ var arr = this.array();
+ for (var i = 0; i < arr.length; i++) {
+ if (re.test(arr[i])) {
+ this.remove(arr[i]);
+ }
+ }
+ return this;
+};
+
+/**
+ * Toggle class `name`, can force state via `force`.
+ *
+ * For browsers that support classList, but do not support `force` yet,
+ * the mistake will be detected and corrected.
+ *
+ * @param {String} name
+ * @param {Boolean} force
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.toggle = function(name, force){
+ // classList
+ if (this.list) {
+ if ("undefined" !== typeof force) {
+ if (force !== this.list.toggle(name, force)) {
+ this.list.toggle(name); // toggle again to correct
+ }
+ } else {
+ this.list.toggle(name);
+ }
+ return this;
+ }
+
+ // fallback
+ if ("undefined" !== typeof force) {
+ if (!force) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ } else {
+ if (this.has(name)) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an array of classes.
+ *
+ * @return {Array}
+ * @api public
+ */
+
+ClassList.prototype.array = function(){
+ var className = this.el.getAttribute('class') || '';
+ var str = className.replace(/^\s+|\s+$/g, '');
+ var arr = str.split(re);
+ if ('' === arr[0]) arr.shift();
+ return arr;
+};
+
+/**
+ * Check if class `name` is present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.has =
+ClassList.prototype.contains = function(name){
+ return this.list
+ ? this.list.contains(name)
+ : !! ~index(this.array(), name);
+};
+
+},{"195":195}],195:[function(_dereq_,module,exports){
+module.exports = function(arr, obj){
+ if (arr.indexOf) return arr.indexOf(obj);
+ for (var i = 0; i < arr.length; ++i) {
+ if (arr[i] === obj) return i;
+ }
+ return -1;
+};
+},{}],196:[function(_dereq_,module,exports){
+var matches = _dereq_(199)
+
+module.exports = function (element, selector, checkYoSelf, root) {
+ element = checkYoSelf ? {parentNode: element} : element
+
+ root = root || document
+
+ // Make sure `element !== document` and `element != null`
+ // otherwise we get an illegal invocation
+ while ((element = element.parentNode) && element !== document) {
+ if (matches(element, selector))
+ return element
+ // After `matches` on the edge case that
+ // the selector matches the root
+ // (when the root is not the document)
+ if (element === root)
+ return
+ }
+}
+
+},{"199":199}],197:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var closest = _dereq_(196)
+ , event = _dereq_(198);
+
+/**
+ * Delegate event `type` to `selector`
+ * and invoke `fn(e)`. A callback function
+ * is returned which may be passed to `.unbind()`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, selector, type, fn, capture){
+ return event.bind(el, type, function(e){
+ var target = e.target || e.srcElement;
+ e.delegateTarget = closest(target, selector, true, el);
+ if (e.delegateTarget) fn.call(el, e);
+ }, capture);
+};
+
+/**
+ * Unbind event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ event.unbind(el, type, fn, capture);
+};
+
+},{"196":196,"198":198}],198:[function(_dereq_,module,exports){
+var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
+ unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
+ prefix = bind !== 'addEventListener' ? 'on' : '';
+
+/**
+ * Bind `el` event `type` to `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, type, fn, capture){
+ el[bind](prefix + type, fn, capture || false);
+ return fn;
+};
+
+/**
+ * Unbind `el` event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ el[unbind](prefix + type, fn, capture || false);
+ return fn;
+};
+},{}],199:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var query = _dereq_(200);
+
+/**
+ * Element prototype.
+ */
+
+var proto = Element.prototype;
+
+/**
+ * Vendor function.
+ */
+
+var vendor = proto.matches
+ || proto.webkitMatchesSelector
+ || proto.mozMatchesSelector
+ || proto.msMatchesSelector
+ || proto.oMatchesSelector;
+
+/**
+ * Expose `match()`.
+ */
+
+module.exports = match;
+
+/**
+ * Match `el` to `selector`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @return {Boolean}
+ * @api public
+ */
+
+function match(el, selector) {
+ if (!el || el.nodeType !== 1) return false;
+ if (vendor) return vendor.call(el, selector);
+ var nodes = query.all(selector, el.parentNode);
+ for (var i = 0; i < nodes.length; ++i) {
+ if (nodes[i] == el) return true;
+ }
+ return false;
+}
+
+},{"200":200}],200:[function(_dereq_,module,exports){
+function one(selector, el) {
+ return el.querySelector(selector);
+}
+
+exports = module.exports = function(selector, el){
+ el = el || document;
+ return one(selector, el);
+};
+
+exports.all = function(selector, el){
+ el = el || document;
+ return el.querySelectorAll(selector);
+};
+
+exports.engine = function(obj){
+ if (!obj.one) throw new Error('.one callback required');
+ if (!obj.all) throw new Error('.all callback required');
+ one = obj.one;
+ exports.all = obj.all;
+ return exports;
+};
+
+},{}],201:[function(_dereq_,module,exports){
+
+/**
+ * Expose `parse`.
+ */
+
+module.exports = parse;
+
+/**
+ * Tests for browser support.
+ */
+
+var div = document.createElement('div');
+// Setup
+div.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
+// Make sure that link elements get serialized correctly by innerHTML
+// This requires a wrapper element in IE
+var innerHTMLBug = !div.getElementsByTagName('link').length;
+div = undefined;
+
+/**
+ * Wrap map from jquery.
+ */
+
+var map = {
+ legend: [1, '<fieldset>', '</fieldset>'],
+ tr: [2, '<table><tbody>', '</tbody></table>'],
+ col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
+ // for script/link/style tags to work in IE6-8, you have to wrap
+ // in a div with a non-whitespace character in front, ha!
+ _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
+};
+
+map.td =
+map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
+
+map.option =
+map.optgroup = [1, '<select multiple="multiple">', '</select>'];
+
+map.thead =
+map.tbody =
+map.colgroup =
+map.caption =
+map.tfoot = [1, '<table>', '</table>'];
+
+map.polyline =
+map.ellipse =
+map.polygon =
+map.circle =
+map.text =
+map.line =
+map.path =
+map.rect =
+map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
+
+/**
+ * Parse `html` and return a DOM Node instance, which could be a TextNode,
+ * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
+ * instance, depending on the contents of the `html` string.
+ *
+ * @param {String} html - HTML string to "domify"
+ * @param {Document} doc - The `document` instance to create the Node for
+ * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
+ * @api private
+ */
+
+function parse(html, doc) {
+ if ('string' != typeof html) throw new TypeError('String expected');
+
+ // default to the global `document` object
+ if (!doc) doc = document;
+
+ // tag name
+ var m = /<([\w:]+)/.exec(html);
+ if (!m) return doc.createTextNode(html);
+
+ html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
+
+ var tag = m[1];
+
+ // body support
+ if (tag == 'body') {
+ var el = doc.createElement('html');
+ el.innerHTML = html;
+ return el.removeChild(el.lastChild);
+ }
+
+ // wrap map
+ var wrap = map[tag] || map._default;
+ var depth = wrap[0];
+ var prefix = wrap[1];
+ var suffix = wrap[2];
+ var el = doc.createElement('div');
+ el.innerHTML = prefix + html + suffix;
+ while (depth--) el = el.lastChild;
+
+ // one element
+ if (el.firstChild == el.lastChild) {
+ return el.removeChild(el.firstChild);
+ }
+
+ // several elements
+ var fragment = doc.createDocumentFragment();
+ while (el.firstChild) {
+ fragment.appendChild(el.removeChild(el.firstChild));
+ }
+
+ return fragment;
+}
+
+},{}],202:[function(_dereq_,module,exports){
+module.exports = _dereq_(204);
+
+module.exports.Collection = _dereq_(203);
+},{"203":203,"204":204}],203:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * An empty collection stub. Use {@link RefsCollection.extend} to extend a
+ * collection with ref semantics.
+ *
+ * @classdesc A change and inverse-reference aware collection with set semantics.
+ *
+ * @class RefsCollection
+ */
+function RefsCollection() { }
+
+/**
+ * Extends a collection with {@link Refs} aware methods
+ *
+ * @memberof RefsCollection
+ * @static
+ *
+ * @param {Array<Object>} collection
+ * @param {Refs} refs instance
+ * @param {Object} property represented by the collection
+ * @param {Object} target object the collection is attached to
+ *
+ * @return {RefsCollection<Object>} the extended array
+ */
+function extend(collection, refs, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ /**
+ * Removes the given element from the array and returns it.
+ *
+ * @method RefsCollection#remove
+ *
+ * @param {Object} element the element to remove
+ */
+ collection.remove = function(element) {
+ var idx = this.indexOf(element);
+ if (idx !== -1) {
+ this.splice(idx, 1);
+
+ // unset inverse
+ refs.unset(element, inverseProperty, target);
+ }
+
+ return element;
+ };
+
+ /**
+ * Returns true if the collection contains the given element
+ *
+ * @method RefsCollection#contains
+ *
+ * @param {Object} element the element to check for
+ */
+ collection.contains = function(element) {
+ return this.indexOf(element) !== -1;
+ };
+
+ /**
+ * Adds an element to the array, unless it exists already (set semantics).
+ *
+ * @method RefsCollection#add
+ *
+ * @param {Object} element the element to add
+ */
+ collection.add = function(element) {
+
+ if (!this.contains(element)) {
+ this.push(element);
+
+ // set inverse
+ refs.set(element, inverseProperty, target);
+ }
+ };
+
+ return collection;
+}
+
+
+module.exports.extend = extend;
+},{}],204:[function(_dereq_,module,exports){
+'use strict';
+
+var Collection = _dereq_(203);
+
+function hasOwnProperty(e, property) {
+ return Object.prototype.hasOwnProperty.call(e, property.name || property);
+}
+
+
+function defineCollectionProperty(ref, property, target) {
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+ value: Collection.extend(target[property.name] || [], ref, property, target)
+ });
+}
+
+
+function defineProperty(ref, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ var _value = target[property.name];
+
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+
+ get: function() {
+ return _value;
+ },
+
+ set: function(value) {
+
+ // return if we already performed all changes
+ if (value === _value) {
+ return;
+ }
+
+ var old = _value;
+
+ // temporary set null
+ _value = null;
+
+ if (old) {
+ ref.unset(old, inverseProperty, target);
+ }
+
+ // set new value
+ _value = value;
+
+ // set inverse value
+ ref.set(_value, inverseProperty, target);
+ }
+ });
+
+}
+
+/**
+ * Creates a new references object defining two inversly related
+ * attribute descriptors a and b.
+ *
+ * <p>
+ * When bound to an object using {@link Refs#bind} the references
+ * get activated and ensure that add and remove operations are applied
+ * reversely, too.
+ * </p>
+ *
+ * <p>
+ * For attributes represented as collections {@link Refs} provides the
+ * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions
+ * that must be used to properly hook into the inverse change mechanism.
+ * </p>
+ *
+ * @class Refs
+ *
+ * @classdesc A bi-directional reference between two attributes.
+ *
+ * @param {Refs.AttributeDescriptor} a property descriptor
+ * @param {Refs.AttributeDescriptor} b property descriptor
+ *
+ * @example
+ *
+ * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });
+ *
+ * var car = { name: 'toyota' };
+ * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];
+ *
+ * refs.bind(car, 'wheels');
+ *
+ * car.wheels // []
+ * car.wheels.add(wheels[0]);
+ * car.wheels.add(wheels[1]);
+ *
+ * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
+ *
+ * wheels[0].car // { name: 'toyota' };
+ * car.wheels.remove(wheels[0]);
+ *
+ * wheels[0].car // undefined
+ */
+function Refs(a, b) {
+
+ if (!(this instanceof Refs)) {
+ return new Refs(a, b);
+ }
+
+ // link
+ a.inverse = b;
+ b.inverse = a;
+
+ this.props = {};
+ this.props[a.name] = a;
+ this.props[b.name] = b;
+}
+
+/**
+ * Binds one side of a bi-directional reference to a
+ * target object.
+ *
+ * @memberOf Refs
+ *
+ * @param {Object} target
+ * @param {String} property
+ */
+Refs.prototype.bind = function(target, property) {
+ if (typeof property === 'string') {
+ if (!this.props[property]) {
+ throw new Error('no property <' + property + '> in ref');
+ }
+ property = this.props[property];
+ }
+
+ if (property.collection) {
+ defineCollectionProperty(this, property, target);
+ } else {
+ defineProperty(this, property, target);
+ }
+};
+
+Refs.prototype.ensureBound = function(target, property) {
+ if (!hasOwnProperty(target, property)) {
+ this.bind(target, property);
+ }
+};
+
+Refs.prototype.unset = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].remove(value);
+ } else {
+ target[property.name] = undefined;
+ }
+ }
+};
+
+Refs.prototype.set = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].add(value);
+ } else {
+ target[property.name] = value;
+ }
+ }
+};
+
+module.exports = Refs;
+
+
+/**
+ * An attribute descriptor to be used specify an attribute in a {@link Refs} instance
+ *
+ * @typedef {Object} Refs.AttributeDescriptor
+ * @property {String} name
+ * @property {boolean} [collection=false]
+ * @property {boolean} [enumerable=false]
+ */
+},{"203":203}]},{},[1])(1)
+});
+//# sourceMappingURL=bpmn-navigated-viewer.js.map \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js.map b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js.map
new file mode 100644
index 0000000..01d8950
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","lib/NavigatedViewer.js","lib/Viewer.js","lib/core/index.js","lib/draw/BpmnRenderer.js","lib/draw/PathMap.js","lib/draw/index.js","lib/import/BpmnImporter.js","lib/import/BpmnTreeWalker.js","lib/import/Importer.js","lib/import/Util.js","lib/import/index.js","lib/util/DiUtil.js","lib/util/LabelUtil.js","lib/util/ModelUtil.js","node_modules/bpmn-moddle/index.js","node_modules/bpmn-moddle/lib/bpmn-moddle.js","node_modules/bpmn-moddle/lib/simple.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/common.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/reader.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/writer.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/sax/lib/sax.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/tiny-stack/lib/tiny-stack.js","node_modules/bpmn-moddle/node_modules/moddle/index.js","node_modules/bpmn-moddle/node_modules/moddle/lib/base.js","node_modules/bpmn-moddle/node_modules/moddle/lib/descriptor-builder.js","node_modules/bpmn-moddle/node_modules/moddle/lib/factory.js","node_modules/bpmn-moddle/node_modules/moddle/lib/moddle.js","node_modules/bpmn-moddle/node_modules/moddle/lib/ns.js","node_modules/bpmn-moddle/node_modules/moddle/lib/properties.js","node_modules/bpmn-moddle/node_modules/moddle/lib/registry.js","node_modules/bpmn-moddle/node_modules/moddle/lib/types.js","node_modules/bpmn-moddle/resources/bpmn/json/bpmn.json","node_modules/bpmn-moddle/resources/bpmn/json/bpmndi.json","node_modules/bpmn-moddle/resources/bpmn/json/dc.json","node_modules/bpmn-moddle/resources/bpmn/json/di.json","node_modules/diagram-js/index.js","node_modules/diagram-js/lib/Diagram.js","node_modules/diagram-js/lib/core/Canvas.js","node_modules/diagram-js/lib/core/ElementFactory.js","node_modules/diagram-js/lib/core/ElementRegistry.js","node_modules/diagram-js/lib/core/EventBus.js","node_modules/diagram-js/lib/core/GraphicsFactory.js","node_modules/diagram-js/lib/core/index.js","node_modules/diagram-js/lib/draw/Renderer.js","node_modules/diagram-js/lib/draw/Styles.js","node_modules/diagram-js/lib/draw/index.js","node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js","node_modules/diagram-js/lib/features/interaction-events/index.js","node_modules/diagram-js/lib/features/outline/Outline.js","node_modules/diagram-js/lib/features/outline/index.js","node_modules/diagram-js/lib/features/overlays/Overlays.js","node_modules/diagram-js/lib/features/overlays/index.js","node_modules/diagram-js/lib/features/selection/Selection.js","node_modules/diagram-js/lib/features/selection/SelectionBehavior.js","node_modules/diagram-js/lib/features/selection/SelectionVisuals.js","node_modules/diagram-js/lib/features/selection/index.js","node_modules/diagram-js/lib/model/index.js","node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js","node_modules/diagram-js/lib/navigation/movecanvas/index.js","node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js","node_modules/diagram-js/lib/navigation/zoomscroll/index.js","node_modules/diagram-js/lib/util/ClickTrap.js","node_modules/diagram-js/lib/util/Collections.js","node_modules/diagram-js/lib/util/Cursor.js","node_modules/diagram-js/lib/util/Elements.js","node_modules/diagram-js/lib/util/Event.js","node_modules/diagram-js/lib/util/GraphicsUtil.js","node_modules/diagram-js/lib/util/IdGenerator.js","node_modules/diagram-js/lib/util/Mouse.js","node_modules/diagram-js/lib/util/Platform.js","node_modules/diagram-js/lib/util/Text.js","node_modules/diagram-js/node_modules/eve/eve.js","node_modules/diagram-js/node_modules/snapsvg/dist/snap.svg.js","node_modules/diagram-js/vendor/snapsvg.js","node_modules/didi/lib/annotation.js","node_modules/didi/lib/index.js","node_modules/didi/lib/injector.js","node_modules/didi/lib/module.js","node_modules/inherits/inherits_browser.js","node_modules/lodash/array/last.js","node_modules/lodash/collection/every.js","node_modules/lodash/collection/filter.js","node_modules/lodash/collection/find.js","node_modules/lodash/collection/forEach.js","node_modules/lodash/collection/groupBy.js","node_modules/lodash/collection/includes.js","node_modules/lodash/collection/map.js","node_modules/lodash/collection/reduce.js","node_modules/lodash/collection/some.js","node_modules/lodash/date/now.js","node_modules/lodash/function/debounce.js","node_modules/lodash/function/defer.js","node_modules/lodash/function/restParam.js","node_modules/lodash/internal/SetCache.js","node_modules/lodash/internal/arrayCopy.js","node_modules/lodash/internal/arrayEach.js","node_modules/lodash/internal/arrayEvery.js","node_modules/lodash/internal/arrayFilter.js","node_modules/lodash/internal/arrayMap.js","node_modules/lodash/internal/arrayReduce.js","node_modules/lodash/internal/arraySome.js","node_modules/lodash/internal/assignWith.js","node_modules/lodash/internal/baseAssign.js","node_modules/lodash/internal/baseCallback.js","node_modules/lodash/internal/baseCopy.js","node_modules/lodash/internal/baseDelay.js","node_modules/lodash/internal/baseDifference.js","node_modules/lodash/internal/baseEach.js","node_modules/lodash/internal/baseEvery.js","node_modules/lodash/internal/baseFilter.js","node_modules/lodash/internal/baseFind.js","node_modules/lodash/internal/baseFindIndex.js","node_modules/lodash/internal/baseFlatten.js","node_modules/lodash/internal/baseFor.js","node_modules/lodash/internal/baseForIn.js","node_modules/lodash/internal/baseForOwn.js","node_modules/lodash/internal/baseGet.js","node_modules/lodash/internal/baseIndexOf.js","node_modules/lodash/internal/baseIsEqual.js","node_modules/lodash/internal/baseIsEqualDeep.js","node_modules/lodash/internal/baseIsFunction.js","node_modules/lodash/internal/baseIsMatch.js","node_modules/lodash/internal/baseMap.js","node_modules/lodash/internal/baseMatches.js","node_modules/lodash/internal/baseMatchesProperty.js","node_modules/lodash/internal/baseMerge.js","node_modules/lodash/internal/baseMergeDeep.js","node_modules/lodash/internal/baseProperty.js","node_modules/lodash/internal/basePropertyDeep.js","node_modules/lodash/internal/baseReduce.js","node_modules/lodash/internal/baseSlice.js","node_modules/lodash/internal/baseSome.js","node_modules/lodash/internal/baseToString.js","node_modules/lodash/internal/baseValues.js","node_modules/lodash/internal/bindCallback.js","node_modules/lodash/internal/cacheIndexOf.js","node_modules/lodash/internal/cachePush.js","node_modules/lodash/internal/createAggregator.js","node_modules/lodash/internal/createAssigner.js","node_modules/lodash/internal/createBaseEach.js","node_modules/lodash/internal/createBaseFor.js","node_modules/lodash/internal/createCache.js","node_modules/lodash/internal/createFind.js","node_modules/lodash/internal/createForEach.js","node_modules/lodash/internal/createReduce.js","node_modules/lodash/internal/equalArrays.js","node_modules/lodash/internal/equalByTag.js","node_modules/lodash/internal/equalObjects.js","node_modules/lodash/internal/getLength.js","node_modules/lodash/internal/getSymbols.js","node_modules/lodash/internal/indexOfNaN.js","node_modules/lodash/internal/isArrayLike.js","node_modules/lodash/internal/isIndex.js","node_modules/lodash/internal/isIterateeCall.js","node_modules/lodash/internal/isKey.js","node_modules/lodash/internal/isLength.js","node_modules/lodash/internal/isObjectLike.js","node_modules/lodash/internal/isStrictComparable.js","node_modules/lodash/internal/pickByArray.js","node_modules/lodash/internal/pickByCallback.js","node_modules/lodash/internal/shimIsPlainObject.js","node_modules/lodash/internal/shimKeys.js","node_modules/lodash/internal/toObject.js","node_modules/lodash/internal/toPath.js","node_modules/lodash/lang/isArguments.js","node_modules/lodash/lang/isArray.js","node_modules/lodash/lang/isFunction.js","node_modules/lodash/lang/isNative.js","node_modules/lodash/lang/isNumber.js","node_modules/lodash/lang/isObject.js","node_modules/lodash/lang/isPlainObject.js","node_modules/lodash/lang/isString.js","node_modules/lodash/lang/isTypedArray.js","node_modules/lodash/lang/toPlainObject.js","node_modules/lodash/object/assign.js","node_modules/lodash/object/keys.js","node_modules/lodash/object/keysIn.js","node_modules/lodash/object/merge.js","node_modules/lodash/object/omit.js","node_modules/lodash/object/pick.js","node_modules/lodash/object/values.js","node_modules/lodash/string/escapeRegExp.js","node_modules/lodash/support.js","node_modules/lodash/utility/constant.js","node_modules/lodash/utility/identity.js","node_modules/lodash/utility/property.js","node_modules/min-dom/lib/classes.js","node_modules/min-dom/lib/clear.js","node_modules/min-dom/lib/delegate.js","node_modules/min-dom/lib/domify.js","node_modules/min-dom/lib/event.js","node_modules/min-dom/lib/query.js","node_modules/min-dom/lib/remove.js","node_modules/min-dom/node_modules/component-classes/index.js","node_modules/min-dom/node_modules/component-classes/node_modules/component-indexof/index.js","node_modules/min-dom/node_modules/component-closest/index.js","node_modules/min-dom/node_modules/component-delegate/index.js","node_modules/min-dom/node_modules/component-event/index.js","node_modules/min-dom/node_modules/component-matches-selector/index.js","node_modules/min-dom/node_modules/component-query/index.js","node_modules/min-dom/node_modules/domify/index.js","node_modules/object-refs/index.js","node_modules/object-refs/lib/collection.js","node_modules/object-refs/lib/refs.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChWA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACl4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt0FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvNA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7OA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxfA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;ACAA;;ACAA;;ACAA;;ACAA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","'use strict';\n\nvar inherits = require(79);\n\nvar Viewer = require(2);\n\n\n/**\n * A viewer that includes mouse navigation facilities\n *\n * @param {Object} options\n */\nfunction NavigatedViewer(options) {\n Viewer.call(this, options);\n}\n\ninherits(NavigatedViewer, Viewer);\n\nmodule.exports = NavigatedViewer;\n\nNavigatedViewer.prototype._navigationModules = [\n require(61),\n require(59)\n];\n\nNavigatedViewer.prototype._modules = [].concat(\n NavigatedViewer.prototype._modules,\n NavigatedViewer.prototype._navigationModules);","'use strict';\n\nvar assign = require(175),\n omit = require(179),\n isString = require(172),\n isNumber = require(169);\n\nvar domify = require(190),\n domQuery = require(192),\n domRemove = require(193);\n\nvar Diagram = require(36),\n BpmnModdle = require(15);\n\nvar Importer = require(9);\n\n\nfunction initListeners(diagram, listeners) {\n var events = diagram.get('eventBus');\n\n listeners.forEach(function(l) {\n events.on(l.event, l.handler);\n });\n}\n\nfunction checkValidationError(err) {\n\n // check if we can help the user by indicating wrong BPMN 2.0 xml\n // (in case he or the exporting tool did not get that right)\n\n var pattern = /unparsable content <([^>]+)> detected([/s/S]*)$/;\n var match = pattern.exec(err.message);\n\n if (match) {\n err.message =\n 'unparsable content <' + match[1] + '> detected; ' +\n 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];\n }\n\n return err;\n}\n\nvar DEFAULT_OPTIONS = {\n width: '100%',\n height: '100%',\n position: 'relative',\n container: 'body'\n};\n\n\n/**\n * Ensure the passed argument is a proper unit (defaulting to px)\n */\nfunction ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}\n\n/**\n * A viewer for BPMN 2.0 diagrams.\n *\n * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include\n * additional features.\n *\n *\n * ## Extending the Viewer\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n * eventBus.on('element.hover', function(event) {\n * console.log()\n * })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n * __init__: [ 'interactionLogger' ],\n * interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });\n * bpmnViewer.importXML(...);\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Viewer(options) {\n\n this.options = options = assign({}, DEFAULT_OPTIONS, options || {});\n\n var parent = options.container;\n\n // support jquery element\n // unwrap it if passed\n if (parent.get) {\n parent = parent.get(0);\n }\n\n // support selector\n if (isString(parent)) {\n parent = domQuery(parent);\n }\n\n var container = this.container = domify('<div class=\"bjs-container\"></div>');\n parent.appendChild(container);\n\n assign(container.style, {\n width: ensureUnit(options.width),\n height: ensureUnit(options.height),\n position: options.position\n });\n\n /**\n * The code in the <project-logo></project-logo> area\n * must not be changed, see http://bpmn.io/license for more information\n *\n * <project-logo>\n */\n\n /* jshint -W101 */\n\n // inlined ../resources/bpmnjs.png\n var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';\n\n /* jshint +W101 */\n\n var linkMarkup =\n '<a href=\"http://bpmn.io\" ' +\n 'target=\"_blank\" ' +\n 'class=\"bjs-powered-by\" ' +\n 'title=\"Powered by bpmn.io\" ' +\n 'style=\"position: absolute; bottom: 15px; right: 15px; z-index: 100\">' +\n '<img src=\"data:image/png;base64,' + logoData + '\">' +\n '</a>';\n\n container.appendChild(domify(linkMarkup));\n\n /* </project-logo> */\n}\n\nViewer.prototype.importXML = function(xml, done) {\n\n var self = this;\n\n this.moddle = this.createModdle();\n\n this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {\n\n if (err) {\n err = checkValidationError(err);\n return done(err);\n }\n\n var parseWarnings = context.warnings;\n\n self.importDefinitions(definitions, function(err, importWarnings) {\n if (err) {\n return done(err);\n }\n\n done(null, parseWarnings.concat(importWarnings || []));\n });\n });\n};\n\nViewer.prototype.saveXML = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var definitions = this.definitions;\n\n if (!definitions) {\n return done(new Error('no definitions loaded'));\n }\n\n this.moddle.toXML(definitions, options, done);\n};\n\nViewer.prototype.createModdle = function() {\n return new BpmnModdle(this.options.moddleExtensions);\n};\n\nViewer.prototype.saveSVG = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var canvas = this.get('canvas');\n\n var contentNode = canvas.getDefaultLayer(),\n defsNode = canvas._svg.select('defs');\n\n var contents = contentNode.innerSVG(),\n defs = (defsNode && defsNode.outerSVG()) || '';\n\n var bbox = contentNode.getBBox();\n\n var svg =\n '<?xml version=\"1.0\" encoding=\"utf-8\"?>/n' +\n '<!-- created with bpmn-js / http://bpmn.io -->/n' +\n '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">/n' +\n '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ' +\n 'width=\"' + bbox.width + '\" height=\"' + bbox.height + '\" ' +\n 'viewBox=\"' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '\" version=\"1.1\">' +\n defs + contents +\n '</svg>';\n\n done(null, svg);\n};\n\nViewer.prototype.get = function(name) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.get(name);\n};\n\nViewer.prototype.invoke = function(fn) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.invoke(fn);\n};\n\nViewer.prototype.importDefinitions = function(definitions, done) {\n\n // use try/catch to not swallow synchronous exceptions\n // that may be raised during model parsing\n try {\n if (this.diagram) {\n this.clear();\n }\n\n this.definitions = definitions;\n\n var diagram = this.diagram = this._createDiagram(this.options);\n\n this._init(diagram);\n\n Importer.importBpmnDiagram(diagram, definitions, done);\n } catch (e) {\n done(e);\n }\n};\n\nViewer.prototype._init = function(diagram) {\n initListeners(diagram, this.__listeners || []);\n};\n\nViewer.prototype._createDiagram = function(options) {\n\n var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);\n\n // add self as an available service\n modules.unshift({\n bpmnjs: [ 'value', this ],\n moddle: [ 'value', this.moddle ]\n });\n\n options = omit(options, 'additionalModules');\n\n options = assign(options, {\n canvas: { container: this.container },\n modules: modules\n });\n\n return new Diagram(options);\n};\n\n\nViewer.prototype.getModules = function() {\n return this._modules;\n};\n\n/**\n * Remove all drawn elements from the viewer.\n *\n * After calling this method the viewer can still\n * be reused for opening another diagram.\n */\nViewer.prototype.clear = function() {\n var diagram = this.diagram;\n\n if (diagram) {\n diagram.destroy();\n }\n};\n\n/**\n * Destroy the viewer instance and remove all its remainders\n * from the document tree.\n */\nViewer.prototype.destroy = function() {\n // clear underlying diagram\n this.clear();\n\n // remove container\n domRemove(this.container);\n};\n\n/**\n * Register an event listener on the viewer\n *\n * @param {String} event\n * @param {Function} handler\n */\nViewer.prototype.on = function(event, handler) {\n var diagram = this.diagram,\n listeners = this.__listeners = this.__listeners || [];\n\n listeners.push({ event: event, handler: handler });\n\n if (diagram) {\n diagram.get('eventBus').on(event, handler);\n }\n};\n\n// modules the viewer is composed of\nViewer.prototype._modules = [\n require(3),\n require(56),\n require(52)\n];\n\nmodule.exports = Viewer;\n","module.exports = {\n __depends__: [\n require(6),\n require(11)\n ]\n};","'use strict';\n\nvar inherits = require(79),\n isArray = require(166),\n isObject = require(170),\n assign = require(175),\n forEach = require(84),\n every = require(81),\n includes = require(86),\n some = require(89);\n\nvar DefaultRenderer = require(44),\n TextUtil = require(71),\n DiUtil = require(12);\n\nvar createLine = DefaultRenderer.createLine;\n\n\nfunction BpmnRenderer(events, styles, pathMap) {\n\n DefaultRenderer.call(this, styles);\n\n var TASK_BORDER_RADIUS = 10;\n var INNER_OUTER_DIST = 3;\n\n var LABEL_STYLE = {\n fontFamily: 'Arial, sans-serif',\n fontSize: '12px'\n };\n\n var textUtil = new TextUtil({\n style: LABEL_STYLE,\n size: { width: 100 }\n });\n\n var markers = {};\n\n function addMarker(id, element) {\n markers[id] = element;\n }\n\n function marker(id) {\n return markers[id];\n }\n\n function initMarkers(svg) {\n\n function createMarker(id, options) {\n var attrs = assign({\n fill: 'black',\n strokeWidth: 1,\n strokeLinecap: 'round',\n strokeDasharray: 'none'\n }, options.attrs);\n\n var ref = options.ref || { x: 0, y: 0 };\n\n var scale = options.scale || 1;\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n if (attrs.strokeDasharray === 'none') {\n attrs.strokeDasharray = [10000, 1];\n }\n\n var marker = options.element\n .attr(attrs)\n .marker(0, 0, 20, 20, ref.x, ref.y)\n .attr({\n markerWidth: 20 * scale,\n markerHeight: 20 * scale\n });\n\n return addMarker(id, marker);\n }\n\n\n createMarker('sequenceflow-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15 Z'),\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('messageflow-start', {\n element: svg.circle(6, 6, 3.5),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 6, y: 6 }\n });\n\n createMarker('messageflow-end', {\n element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),\n attrs: {\n fill: 'white',\n stroke: 'black',\n strokeLinecap: 'butt'\n },\n ref: { x: 8.5, y: 5 }\n });\n\n createMarker('data-association-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-flow-marker', {\n element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: -1, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-default-flow-marker', {\n element: svg.path('M 1 4 L 5 16'),\n attrs: {\n stroke: 'black'\n },\n ref: { x: -5, y: 10 },\n scale: 0.5\n });\n }\n\n function computeStyle(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return styles.style(traits || [], assign(defaultStyles, custom || {}));\n }\n\n function drawCircle(p, width, height, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n var cx = width / 2,\n cy = height / 2;\n\n return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);\n }\n\n function drawRect(p, width, height, r, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);\n }\n\n function drawDiamond(p, width, height, attrs) {\n\n var x_2 = width / 2;\n var y_2 = height / 2;\n\n var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.polygon(points).attr(attrs);\n }\n\n function drawLine(p, waypoints, attrs) {\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'none'\n });\n\n return createLine(waypoints, attrs).appendTo(p);\n }\n\n function drawPath(p, d, attrs) {\n\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n strokeWidth: 2,\n stroke: 'black'\n });\n\n return p.path(d).attr(attrs);\n }\n\n function as(type) {\n return function(p, element) {\n return handlers[type](p, element);\n };\n }\n\n function renderer(type) {\n return handlers[type];\n }\n\n function renderEventContent(element, p) {\n\n var event = getSemantic(element);\n var isThrowing = isThrowEvent(event);\n\n if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {\n return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {\n return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {\n return renderer('bpmn:ConditionalEventDefinition')(p, element);\n }\n\n if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {\n return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {\n return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {\n return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {\n return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {\n return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {\n return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {\n return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {\n return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {\n return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);\n }\n\n return null;\n }\n\n function renderLabel(p, label, options) {\n return textUtil.createText(p, label || '', options).addClass('djs-label');\n }\n\n function renderEmbeddedLabel(p, element, align) {\n var semantic = getSemantic(element);\n return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });\n }\n\n function renderExternalLabel(p, element, align) {\n var semantic = getSemantic(element);\n\n if (!semantic.name) {\n element.hidden = true;\n }\n\n return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });\n }\n\n function renderLaneLabel(p, text, element) {\n var textBox = renderLabel(p, text, {\n box: { height: 30, width: element.height },\n align: 'center-middle'\n });\n\n var top = -1 * element.height;\n textBox.transform(\n 'rotate(270) ' +\n 'translate(' + top + ',' + 0 + ')'\n );\n }\n\n function createPathFromConnection(connection) {\n var waypoints = connection.waypoints;\n\n var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;\n for (var i = 1; i < waypoints.length; i++) {\n pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';\n }\n return pathData;\n }\n\n var handlers = {\n 'bpmn:Event': function(p, element, attrs) {\n return drawCircle(p, element.width, element.height, attrs);\n },\n 'bpmn:StartEvent': function(p, element) {\n var attrs = {};\n var semantic = getSemantic(element);\n\n if (!semantic.isInterrupting) {\n attrs = {\n strokeDasharray: '6',\n strokeLinecap: 'round'\n };\n }\n\n var circle = renderer('bpmn:Event')(p, element, attrs);\n\n renderEventContent(element, p);\n\n return circle;\n },\n 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.235,\n my: 0.315\n }\n });\n\n var fill = isThrowing ? 'black' : 'white';\n var stroke = isThrowing ? 'white' : 'black';\n\n var messagePath = drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill,\n stroke: stroke\n });\n\n return messagePath;\n },\n 'bpmn:TimerEventDefinition': function(p, element) {\n\n var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {\n strokeWidth: 2\n });\n\n var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n drawPath(p, pathData, {\n strokeWidth: 2,\n strokeLinecap: 'square'\n });\n\n for(var i = 0;i < 12;i++) {\n\n var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n var width = element.width / 2;\n var height = element.height / 2;\n\n drawPath(p, linePathData, {\n strokeWidth: 1,\n strokeLinecap: 'square',\n transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'\n });\n }\n\n return circle;\n },\n 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.555\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ConditionalEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.222\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_LINK', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.57,\n my: 0.263\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ERROR', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.2,\n my: 0.722\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {\n xScaleFactor: 1.0,\n yScaleFactor: 1.0,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.638,\n my: -0.055\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n }).transform('rotate(45)');\n },\n 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.201,\n my: 0.472\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.2\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.222,\n my: 0.36\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ParallelMultipleEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {\n xScaleFactor: 1.2,\n yScaleFactor: 1.2,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.458,\n my: 0.194\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:EndEvent': function(p, element) {\n var circle = renderer('bpmn:Event')(p, element, {\n strokeWidth: 4\n });\n\n renderEventContent(element, p, true);\n\n return circle;\n },\n 'bpmn:TerminateEventDefinition': function(p, element) {\n var circle = drawCircle(p, element.width, element.height, 8, {\n strokeWidth: 4,\n fill: 'black'\n });\n\n return circle;\n },\n 'bpmn:IntermediateEvent': function(p, element) {\n var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });\n /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),\n 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),\n\n 'bpmn:Activity': function(p, element, attrs) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);\n },\n\n 'bpmn:Task': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n renderEmbeddedLabel(p, element, 'center-middle');\n attachTaskMarkers(p, element);\n return rect;\n },\n 'bpmn:ServiceTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 12,\n y: 18\n }\n });\n\n /* service bg */ drawPath(p, pathDataBG, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {\n abspos: {\n x: 17.2,\n y: 18\n }\n });\n\n /* service fill */ drawPath(p, fillPathData, {\n strokeWidth: 0,\n stroke: 'none',\n fill: 'white'\n });\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 17,\n y: 22\n }\n });\n\n /* service */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'white'\n });\n\n return task;\n },\n 'bpmn:UserTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var x = 15;\n var y = 12;\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user path */ drawPath(p, pathData, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user2 path */ drawPath(p, pathData2, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user3 path */ drawPath(p, pathData3, {\n strokeWidth: 0.5,\n fill: 'black'\n });\n\n return task;\n },\n 'bpmn:ManualTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {\n abspos: {\n x: 17,\n y: 15\n }\n });\n\n /* manual path */ drawPath(p, pathData, {\n strokeWidth: 0.25,\n fill: 'white',\n stroke: 'black'\n });\n\n return task;\n },\n 'bpmn:SendTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.285,\n my: 0.357\n }\n });\n\n /* send path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black',\n stroke: 'white'\n });\n\n return task;\n },\n 'bpmn:ReceiveTask' : function(p, element) {\n var semantic = getSemantic(element);\n\n var task = renderer('bpmn:Task')(p, element);\n var pathData;\n\n if (semantic.instantiate) {\n drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });\n\n pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {\n abspos: {\n x: 7.77,\n y: 9.52\n }\n });\n } else {\n\n pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.3,\n my: 0.4\n }\n });\n }\n\n /* receive path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:ScriptTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {\n abspos: {\n x: 15,\n y: 20\n }\n });\n\n /* script path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:BusinessRuleTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessHeaderPath = drawPath(p, headerPathData);\n businessHeaderPath.attr({\n strokeWidth: 1,\n fill: 'AAA'\n });\n\n var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessPath = drawPath(p, headerData);\n businessPath.attr({\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:SubProcess': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n\n var semantic = getSemantic(element);\n\n var expanded = DiUtil.isExpanded(semantic);\n\n var isEventSubProcess = !!semantic.triggeredByEvent;\n if (isEventSubProcess) {\n rect.attr({\n strokeDasharray: '1,2'\n });\n }\n\n renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');\n\n if (expanded) {\n attachTaskMarkers(p, element);\n } else {\n attachTaskMarkers(p, element, ['SubProcessMarker']);\n }\n\n return rect;\n },\n 'bpmn:AdHocSubProcess': function(p, element) {\n return renderer('bpmn:SubProcess')(p, element);\n },\n 'bpmn:Transaction': function(p, element) {\n var outer = renderer('bpmn:SubProcess')(p, element);\n\n var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);\n\n /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);\n\n return outer;\n },\n 'bpmn:CallActivity': function(p, element) {\n return renderer('bpmn:Task')(p, element, {\n strokeWidth: 5\n });\n },\n 'bpmn:Participant': function(p, element) {\n\n var lane = renderer('bpmn:Lane')(p, element, {\n fill: 'White'\n });\n\n var expandedPool = DiUtil.isExpanded(element);\n\n if (expandedPool) {\n drawLine(p, [\n { x: 30, y: 0 },\n { x: 30, y: element.height }\n ]);\n var text = getSemantic(element).name;\n renderLaneLabel(p, text, element);\n } else {\n // Collapsed pool draw text inline\n var text2 = getSemantic(element).name;\n renderLabel(p, text2, { box: element, align: 'center-middle' });\n }\n\n var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);\n\n if(participantMultiplicity) {\n renderer('ParticipantMultiplicityMarker')(p, element);\n }\n\n return lane;\n },\n 'bpmn:Lane': function(p, element, attrs) {\n var rect = drawRect(p, element.width, element.height, 0, attrs || {\n fill: 'none'\n });\n\n var semantic = getSemantic(element);\n\n if (semantic.$type === 'bpmn:Lane') {\n var text = semantic.name;\n renderLaneLabel(p, text, element);\n }\n\n return rect;\n },\n 'bpmn:InclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* circle path */\n drawCircle(p, element.width, element.height, element.height * 0.24, {\n strokeWidth: 2.5,\n fill: 'none'\n });\n\n return diamond;\n },\n 'bpmn:ExclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {\n xScaleFactor: 0.4,\n yScaleFactor: 0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.32,\n my: 0.3\n }\n });\n\n if (!!(getDi(element).isMarkerVisible)) {\n drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n\n return diamond;\n },\n 'bpmn:ComplexGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {\n xScaleFactor: 0.5,\n yScaleFactor:0.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.26\n }\n });\n\n /* complex path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:ParallelGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.6,\n yScaleFactor:0.6,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.2\n }\n });\n\n /* parallel path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:EventBasedGateway': function(p, element) {\n\n var semantic = getSemantic(element);\n\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var type = semantic.eventGatewayType;\n var instantiate = !!semantic.instantiate;\n\n function drawEvent() {\n\n var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {\n xScaleFactor: 0.18,\n yScaleFactor: 0.18,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.36,\n my: 0.44\n }\n });\n\n /* event path */ drawPath(p, pathData, {\n strokeWidth: 2,\n fill: 'none'\n });\n }\n\n if (type === 'Parallel') {\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.4,\n yScaleFactor:0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var parallelPath = drawPath(p, pathData);\n parallelPath.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n } else if (type === 'Exclusive') {\n\n if (!instantiate) {\n var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);\n innerCircle.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n }\n\n drawEvent();\n }\n\n\n return diamond;\n },\n 'bpmn:Gateway': function(p, element) {\n return drawDiamond(p, element.width, element.height);\n },\n 'bpmn:SequenceFlow': function(p, element) {\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n strokeLinejoin: 'round',\n markerEnd: marker('sequenceflow-end')\n });\n\n var sequenceFlow = getSemantic(element);\n var source = element.source.businessObject;\n\n // conditional flow marker\n if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {\n path.attr({\n markerStart: marker('conditional-flow-marker')\n });\n }\n\n // default marker\n if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {\n path.attr({\n markerStart: marker('conditional-default-flow-marker')\n });\n }\n\n return path;\n },\n 'bpmn:Association': function(p, element, attrs) {\n\n attrs = assign({\n strokeDasharray: '1,6',\n strokeLinecap: 'round',\n strokeLinejoin: 'round'\n }, attrs || {});\n\n // TODO(nre): style according to directed state\n return drawLine(p, element.waypoints, attrs);\n },\n 'bpmn:DataInputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:DataOutputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:MessageFlow': function(p, element) {\n\n var semantic = getSemantic(element),\n di = getDi(element);\n\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n markerEnd: marker('messageflow-end'),\n markerStart: marker('messageflow-start'),\n strokeDasharray: '10, 12',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: '1.5px'\n });\n\n if (semantic.messageRef) {\n var midPoint = path.getPointAtLength(path.getTotalLength() / 2);\n\n var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {\n abspos: {\n x: midPoint.x,\n y: midPoint.y\n }\n });\n\n var messageAttrs = { strokeWidth: 1 };\n\n if (di.messageVisibleKind === 'initiating') {\n messageAttrs.fill = 'white';\n messageAttrs.stroke = 'black';\n } else {\n messageAttrs.fill = '#888';\n messageAttrs.stroke = 'white';\n }\n\n drawPath(p, markerPathData, messageAttrs);\n }\n\n return path;\n },\n 'bpmn:DataObject': function(p, element) {\n var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var elementObject = drawPath(p, pathData, { fill: 'white' });\n\n var semantic = getSemantic(element);\n\n if (isCollection(semantic)) {\n renderDataItemCollection(p, element);\n }\n\n return elementObject;\n },\n 'bpmn:DataObjectReference': as('bpmn:DataObject'),\n 'bpmn:DataInput': function(p, element) {\n\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });\n\n return elementObject;\n },\n 'bpmn:DataOutput': function(p, element) {\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* output arrow path */ drawPath(p, arrowPathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return elementObject;\n },\n 'bpmn:DataStoreReference': function(p, element) {\n var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0,\n my: 0.133\n }\n });\n\n var elementStore = drawPath(p, DATA_STORE_PATH, {\n strokeWidth: 2,\n fill: 'white'\n });\n\n return elementStore;\n },\n 'bpmn:BoundaryEvent': function(p, element) {\n\n var semantic = getSemantic(element),\n cancel = semantic.cancelActivity;\n\n var attrs = {\n strokeLinecap: 'round',\n strokeWidth: 1\n };\n\n if (!cancel) {\n attrs.strokeDasharray = '6';\n }\n\n var outer = renderer('bpmn:Event')(p, element, attrs);\n /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:Group': function(p, element) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {\n strokeWidth: 1,\n strokeDasharray: '8,3,1,3',\n fill: 'none',\n pointerEvents: 'none'\n });\n },\n 'label': function(p, element) {\n return renderExternalLabel(p, element, '');\n },\n 'bpmn:TextAnnotation': function(p, element) {\n var style = {\n 'fill': 'none',\n 'stroke': 'none'\n };\n var textElement = drawRect(p, element.width, element.height, 0, 0, style);\n var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.0,\n my: 0.0\n }\n });\n drawPath(p, textPathData);\n\n var text = getSemantic(element).text || '';\n renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });\n\n return textElement;\n },\n 'ParticipantMultiplicityMarker': function(p, element) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'SubProcessMarker': function(p, element) {\n var markerRect = drawRect(p, 14, 14, 0, {\n strokeWidth: 1\n });\n\n // Process marker is placed in the middle of the box\n // therefore fixed values can be used here\n markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');\n\n var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {\n xScaleFactor: 1.5,\n yScaleFactor: 1.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: (element.width / 2 - 7.5) / element.width,\n my: (element.height - 20) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'ParallelMarker': function(p, element, position) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.parallel) / element.width),\n my: (element.height - 20) / element.height\n }\n });\n drawPath(p, subProcessPath);\n },\n 'SequentialMarker': function(p, element, position) {\n var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.seq) / element.width),\n my: (element.height - 19) / element.height\n }\n });\n drawPath(p, sequentialPath);\n },\n 'CompensationMarker': function(p, element, position) {\n var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.compensation) / element.width),\n my: (element.height - 13) / element.height\n }\n });\n drawPath(p, compensationPath, { strokeWidth: 1 });\n },\n 'LoopMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_LOOP', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.loop) / element.width),\n my: (element.height - 7) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'none',\n strokeLinecap: 'round',\n strokeMiterlimit: 0.5\n });\n },\n 'AdhocMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.adhoc) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n };\n\n function attachTaskMarkers(p, element, taskMarkers) {\n var obj = getSemantic(element);\n\n var subprocess = includes(taskMarkers, 'SubProcessMarker');\n var position;\n\n if (subprocess) {\n position = {\n seq: -21,\n parallel: -22,\n compensation: -42,\n loop: -18,\n adhoc: 10\n };\n } else {\n position = {\n seq: -3,\n parallel: -6,\n compensation: -27,\n loop: 0,\n adhoc: 10\n };\n }\n\n forEach(taskMarkers, function(marker) {\n renderer(marker)(p, element, position);\n });\n\n if (obj.$type === 'bpmn:AdHocSubProcess') {\n renderer('AdhocMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {\n renderer('LoopMarker')(p, element, position);\n return;\n }\n if (obj.loopCharacteristics &&\n obj.loopCharacteristics.isSequential !== undefined &&\n !obj.loopCharacteristics.isSequential) {\n renderer('ParallelMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {\n renderer('SequentialMarker')(p, element, position);\n }\n if (!!obj.isForCompensation) {\n renderer('CompensationMarker')(p, element, position);\n }\n }\n\n function drawShape(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function drawConnection(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function renderDataItemCollection(p, element) {\n\n var yPosition = (element.height - 16) / element.height;\n\n var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.451,\n my: yPosition\n }\n });\n\n /* collection path */ drawPath(p, pathData, {\n strokeWidth: 2\n });\n }\n\n function isCollection(element, filter) {\n return element.isCollection ||\n (element.elementObjectRef && element.elementObjectRef.isCollection);\n }\n\n function getDi(element) {\n return element.businessObject.di;\n }\n\n function getSemantic(element) {\n return element.businessObject;\n }\n\n /**\n * Checks if eventDefinition of the given element matches with semantic type.\n *\n * @return {boolean} true if element is of the given semantic type\n */\n function isTypedEvent(event, eventDefinitionType, filter) {\n\n function matches(definition, filter) {\n return every(filter, function(val, key) {\n\n // we want a == conversion here, to be able to catch\n // undefined == false and friends\n /* jshint -W116 */\n return definition[key] == val;\n });\n }\n\n return some(event.eventDefinitions, function(definition) {\n return definition.$type === eventDefinitionType && matches(event, filter);\n });\n }\n\n function isThrowEvent(event) {\n return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');\n }\n\n\n /////// cropping path customizations /////////////////////////\n\n function componentsToPath(elements) {\n return elements.join(',').replace(/,?([A-z]),?/g, '$1');\n }\n\n function getCirclePath(shape) {\n\n var cx = shape.x + shape.width / 2,\n cy = shape.y + shape.height / 2,\n radius = shape.width / 2;\n\n var circlePath = [\n ['M', cx, cy],\n ['m', 0, -radius],\n ['a', radius, radius, 0, 1, 1, 0, 2 * radius],\n ['a', radius, radius, 0, 1, 1, 0, -2 * radius],\n ['z']\n ];\n\n return componentsToPath(circlePath);\n }\n\n function getRoundRectPath(shape) {\n\n var radius = TASK_BORDER_RADIUS,\n x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var roundRectPath = [\n ['M', x + radius, y],\n ['l', width - radius * 2, 0],\n ['a', radius, radius, 0, 0, 1, radius, radius],\n ['l', 0, height - radius * 2],\n ['a', radius, radius, 0, 0, 1, -radius, radius],\n ['l', radius * 2 - width, 0],\n ['a', radius, radius, 0, 0, 1, -radius, -radius],\n ['l', 0, radius * 2 - height],\n ['a', radius, radius, 0, 0, 1, radius, -radius],\n ['z']\n ];\n\n return componentsToPath(roundRectPath);\n }\n\n function getDiamondPath(shape) {\n\n var width = shape.width,\n height = shape.height,\n x = shape.x,\n y = shape.y,\n halfWidth = width / 2,\n halfHeight = height / 2;\n\n var diamondPath = [\n ['M', x + halfWidth, y],\n ['l', halfWidth, halfHeight],\n ['l', -halfWidth, halfHeight],\n ['l', -halfWidth, -halfHeight],\n ['z']\n ];\n\n return componentsToPath(diamondPath);\n }\n\n function getRectPath(shape) {\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var rectPath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(rectPath);\n }\n\n function getShapePath(element) {\n var obj = getSemantic(element);\n\n if (obj.$instanceOf('bpmn:Event')) {\n return getCirclePath(element);\n }\n\n if (obj.$instanceOf('bpmn:Activity')) {\n return getRoundRectPath(element);\n }\n\n if (obj.$instanceOf('bpmn:Gateway')) {\n return getDiamondPath(element);\n }\n\n return getRectPath(element);\n }\n\n\n // hook onto canvas init event to initialize\n // connection start/end markers on svg\n events.on('canvas.init', function(event) {\n initMarkers(event.svg);\n });\n\n this.drawShape = drawShape;\n this.drawConnection = drawConnection;\n\n this.getShapePath = getShapePath;\n}\n\ninherits(BpmnRenderer, DefaultRenderer);\n\n\nBpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];\n\nmodule.exports = BpmnRenderer;\n","'use strict';\n\nvar Snap = require(74);\n\n/**\n * Map containing SVG paths needed by BpmnRenderer.\n */\n\nfunction PathMap() {\n\n /**\n * Contains a map of path elements\n *\n * <h1>Path definition</h1>\n * A parameterized path is defined like this:\n * <pre>\n * 'GATEWAY_PARALLEL': {\n * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n * height: 17.5,\n * width: 17.5,\n * heightElements: [2.5, 7.5],\n * widthElements: [2.5, 7.5]\n * }\n * </pre>\n * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling\n * is based on the ratio between the specified height and width in this object and the\n * height and width that is set as scale target (Note x,y coordinates will be scaled with\n * individual ratios).</p>\n * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.\n * The scaling is based on the computed ratios.\n * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using\n * the computed ratio coefficient.\n * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.\n * <ul>\n * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>\n * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>\n * </ul>\n * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.\n * </p>\n */\n this.pathMap = {\n 'EVENT_MESSAGE': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 36,\n width: 36,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'EVENT_SIGNAL': {\n d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',\n height: 36,\n width: 36,\n heightElements: [18],\n widthElements: [10, 20]\n },\n 'EVENT_ESCALATION': {\n d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +\n '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',\n height: 36,\n width: 36,\n heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],\n widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]\n },\n 'EVENT_CONDITIONAL': {\n d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +\n 'M {e.x2},{e.y3} l {e.x0},0 ' +\n 'M {e.x2},{e.y4} l {e.x0},0 ' +\n 'M {e.x2},{e.y5} l {e.x0},0 ' +\n 'M {e.x2},{e.y6} l {e.x0},0 ' +\n 'M {e.x2},{e.y7} l {e.x0},0 ' +\n 'M {e.x2},{e.y8} l {e.x0},0 ',\n height: 36,\n width: 36,\n heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],\n widthElements: [10.5, 14.5, 12.5]\n },\n 'EVENT_LINK': {\n d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',\n height: 36,\n width: 36,\n heightElements: [4.4375, 6.75, 7.8125],\n widthElements: [9.84375, 13.5]\n },\n 'EVENT_ERROR': {\n d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',\n height: 36,\n width: 36,\n heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],\n widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]\n },\n 'EVENT_CANCEL_45': {\n d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 36,\n width: 36,\n heightElements: [4.75, 8.5],\n widthElements: [4.75, 8.5]\n },\n 'EVENT_COMPENSATION': {\n d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',\n height: 36,\n width: 36,\n heightElements: [5, 10],\n widthElements: [10]\n },\n 'EVENT_TIMER_WH': {\n d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 2],\n widthElements: [3, 7]\n },\n 'EVENT_TIMER_LINE': {\n d: 'M {mx},{my} ' +\n 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 3],\n widthElements: [0, 0]\n },\n 'EVENT_MULTIPLE': {\n d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',\n height: 36,\n width: 36,\n heightElements: [6.28099, 12.56199],\n widthElements: [3.1405, 9.42149, 12.56198]\n },\n 'EVENT_PARALLEL_MULTIPLE': {\n d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n height: 36,\n width: 36,\n heightElements: [2.56228, 7.68683],\n widthElements: [2.56228, 7.68683]\n },\n 'GATEWAY_EXCLUSIVE': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +\n '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +\n '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',\n height: 17.5,\n width: 17.5,\n heightElements: [8.5, 6.5312, -6.5312, -8.5],\n widthElements: [6.5, -6.5, 3, -3, 5, -5]\n },\n 'GATEWAY_PARALLEL': {\n d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 30,\n width: 30,\n heightElements: [5, 12.5],\n widthElements: [5, 12.5]\n },\n 'GATEWAY_EVENT_BASED': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',\n height: 11,\n width: 11,\n heightElements: [-6, 6, 12, -12],\n widthElements: [9, -3, -12]\n },\n 'GATEWAY_COMPLEX': {\n d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +\n '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +\n '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +\n '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',\n height: 17.125,\n width: 17.125,\n heightElements: [4.875, 3.4375, 2.125, 3],\n widthElements: [3.4375, 2.125, 4.875, 3]\n },\n 'DATA_OBJECT_PATH': {\n d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',\n height: 61,\n width: 51,\n heightElements: [10, 50, 60],\n widthElements: [10, 40, 50, 60]\n },\n 'DATA_OBJECT_COLLECTION_PATH': {\n d:'m {mx}, {my} ' +\n 'm 0 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ',\n height: 61,\n width: 51,\n heightElements: [12],\n widthElements: [1, 6, 12, 15]\n },\n 'DATA_ARROW': {\n d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',\n height: 61,\n width: 51,\n heightElements: [],\n widthElements: []\n },\n 'DATA_STORE': {\n d:'m {mx},{my} ' +\n 'l 0,{e.y2} ' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'l 0,-{e.y2} ' +\n 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',\n height: 61,\n width: 61,\n heightElements: [7, 10, 45],\n widthElements: [2, 58, 60]\n },\n 'TEXT_ANNOTATION': {\n d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',\n height: 30,\n width: 10,\n heightElements: [30],\n widthElements: [10]\n },\n 'MARKER_SUB_PROCESS': {\n d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_PARALLEL': {\n d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_SEQUENTIAL': {\n d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_COMPENSATION': {\n d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',\n height: 10,\n width: 21,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_LOOP': {\n d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +\n '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +\n '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +\n 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',\n height: 13.9,\n width: 13.7,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_ADHOC': {\n d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +\n '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +\n '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +\n '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +\n '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',\n height: 4,\n width: 15,\n heightElements: [],\n widthElements: []\n },\n 'TASK_TYPE_SEND': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 14,\n width: 21,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_SCRIPT': {\n d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +\n 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +\n 'm -7,-12 l 5,0 ' +\n 'm -4.5,3 l 4.5,0 ' +\n 'm -3,3 l 5,0' +\n 'm -4,3 l 5,0',\n height: 15,\n width: 12.6,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_USER_1': {\n d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +\n '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +\n '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +\n 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +\n 'm -8,6 l 0,5.5 m 11,0 l 0,-5'\n },\n 'TASK_TYPE_USER_2': {\n d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +\n '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '\n },\n 'TASK_TYPE_USER_3': {\n d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +\n '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +\n '-4.20799998,3.36699999 -4.20699998,4.34799999 z'\n },\n 'TASK_TYPE_MANUAL': {\n d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +\n '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +\n '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +\n '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +\n '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +\n '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +\n '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +\n '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +\n '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +\n '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +\n '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +\n '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'\n },\n 'TASK_TYPE_INSTANTIATING_SEND': {\n d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'\n },\n 'TASK_TYPE_SERVICE': {\n d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +\n '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +\n '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +\n 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +\n '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +\n '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +\n 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +\n '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +\n 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +\n 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +\n '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +\n 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +\n 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_SERVICE_FILL': {\n d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_HEADER': {\n d: 'm {mx},{my} 0,4 20,0 0,-4 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_MAIN': {\n d: 'm {mx},{my} 0,12 20,0 0,-12 z' +\n 'm 0,8 l 20,0 ' +\n 'm -13,-4 l 0,8'\n },\n 'MESSAGE_FLOW_MARKER': {\n d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'\n }\n };\n\n this.getRawPath = function getRawPath(pathId) {\n return this.pathMap[pathId].d;\n };\n\n /**\n * Scales the path to the given height and width.\n * <h1>Use case</h1>\n * <p>Use case is to scale the content of elements (event, gateways) based\n * on the element bounding box's size.\n * </p>\n * <h1>Why not transform</h1>\n * <p>Scaling a path with transform() will also scale the stroke and IE does not support\n * the option 'non-scaling-stroke' to prevent this.\n * Also there are use cases where only some parts of a path should be\n * scaled.</p>\n *\n * @param {String} pathId The ID of the path.\n * @param {Object} param <p>\n * Example param object scales the path to 60% size of the container (data.width, data.height).\n * <pre>\n * {\n * xScaleFactor: 0.6,\n * yScaleFactor:0.6,\n * containerWidth: data.width,\n * containerHeight: data.height,\n * position: {\n * mx: 0.46,\n * my: 0.2,\n * }\n * }\n * </pre>\n * <ul>\n * <li>targetpathwidth = xScaleFactor * containerWidth</li>\n * <li>targetpathheight = yScaleFactor * containerHeight</li>\n * <li>Position is used to set the starting coordinate of the path. M is computed:\n * <ul>\n * <li>position.x * containerWidth</li>\n * <li>position.y * containerHeight</li>\n * </ul>\n * Center of the container <pre> position: {\n * mx: 0.5,\n * my: 0.5,\n * }</pre>\n * Upper left corner of the container\n * <pre> position: {\n * mx: 0.0,\n * my: 0.0,\n * }</pre>\n * </li>\n * </ul>\n * </p>\n *\n */\n this.getScaledPath = function getScaledPath(pathId, param) {\n var rawPath = this.pathMap[pathId];\n\n // positioning\n // compute the start point of the path\n var mx, my;\n\n if(!!param.abspos) {\n mx = param.abspos.x;\n my = param.abspos.y;\n } else {\n mx = param.containerWidth * param.position.mx;\n my = param.containerHeight * param.position.my;\n }\n\n var coordinates = {}; //map for the scaled coordinates\n if(param.position) {\n\n // path\n var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;\n var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;\n\n\n //Apply height ratio\n for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {\n coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;\n }\n\n //Apply width ratio\n for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {\n coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;\n }\n }\n\n //Apply value to raw path\n var path = Snap.format(\n rawPath.d, {\n mx: mx,\n my: my,\n e: coordinates\n }\n );\n return path;\n };\n}\n\nmodule.exports = PathMap;\n","module.exports = {\n renderer: [ 'type', require(4) ],\n pathMap: [ 'type', require(5) ]\n};","'use strict';\n\nvar assign = require(175),\n map = require(87);\n\nvar LabelUtil = require(13);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n getExternalLabelBounds = LabelUtil.getExternalLabelBounds,\n isExpanded = require(12).isExpanded,\n elementToString = require(10).elementToString;\n\n\nfunction elementData(semantic, attrs) {\n return assign({\n id: semantic.id,\n type: semantic.$type,\n businessObject: semantic\n }, attrs);\n}\n\nfunction collectWaypoints(waypoints) {\n return map(waypoints, function(p) {\n return { x: p.x, y: p.y };\n });\n}\n\n\n/**\n * An importer that adds bpmn elements to the canvas\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementFactory} elementFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n this._elementFactory = elementFactory;\n this._elementRegistry = elementRegistry;\n}\n\nBpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];\n\nmodule.exports = BpmnImporter;\n\n\n/**\n * Add bpmn element (semantic) to the canvas onto the\n * specified parent shape.\n */\nBpmnImporter.prototype.add = function(semantic, parentElement) {\n\n var di = semantic.di,\n element;\n\n // ROOT ELEMENT\n // handle the special case that we deal with a\n // invisible root element (process or collaboration)\n if (di.$instanceOf('bpmndi:BPMNPlane')) {\n\n // add a virtual element (not being drawn)\n element = this._elementFactory.createRoot(elementData(semantic));\n\n this._canvas.setRootElement(element);\n }\n\n // SHAPE\n else if (di.$instanceOf('bpmndi:BPMNShape')) {\n\n var collapsed = !isExpanded(semantic);\n var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n var bounds = semantic.di.bounds;\n\n element = this._elementFactory.createShape(elementData(semantic, {\n collapsed: collapsed,\n hidden: hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n this._canvas.addShape(element, parentElement);\n }\n\n // CONNECTION\n else if (di.$instanceOf('bpmndi:BPMNEdge')) {\n\n var source = this._getSource(semantic),\n target = this._getTarget(semantic);\n\n element = this._elementFactory.createConnection(elementData(semantic, {\n source: source,\n target: target,\n waypoints: collectWaypoints(semantic.di.waypoint)\n }));\n\n this._canvas.addConnection(element, parentElement);\n } else {\n throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));\n }\n\n // (optional) LABEL\n if (hasExternalLabel(semantic)) {\n this.addLabel(semantic, element);\n }\n\n\n this._eventBus.fire('bpmnElement.added', { element: element });\n\n return element;\n};\n\n\n/**\n * add label for an element\n */\nBpmnImporter.prototype.addLabel = function(semantic, element) {\n var bounds = getExternalLabelBounds(semantic, element);\n\n var label = this._elementFactory.createLabel(elementData(semantic, {\n id: semantic.id + '_label',\n labelTarget: element,\n type: 'label',\n hidden: element.hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n return this._canvas.addShape(label, element.parent);\n};\n\n/**\n * Return the drawn connection end based on the given side.\n *\n * @throws {Error} if the end is not yet drawn\n */\nBpmnImporter.prototype._getEnd = function(semantic, side) {\n\n var element,\n refSemantic,\n type = semantic.$type;\n\n refSemantic = semantic[side + 'Ref'];\n\n // handle mysterious isMany DataAssociation#sourceRef\n if (side === 'source' && type === 'bpmn:DataInputAssociation') {\n refSemantic = refSemantic && refSemantic[0];\n }\n\n // fix source / target for DataInputAssociation / DataOutputAssociation\n if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||\n side === 'target' && type === 'bpmn:DataInputAssociation') {\n\n refSemantic = semantic.$parent;\n }\n\n element = refSemantic && this._getElement(refSemantic);\n\n if (element) {\n return element;\n }\n\n if (refSemantic) {\n throw new Error(\n 'element ' + elementToString(refSemantic) + ' referenced by ' +\n elementToString(semantic) + '#' + side + 'Ref not yet drawn');\n } else {\n throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');\n }\n};\n\nBpmnImporter.prototype._getSource = function(semantic) {\n return this._getEnd(semantic, 'source');\n};\n\nBpmnImporter.prototype._getTarget = function(semantic) {\n return this._getEnd(semantic, 'target');\n};\n\n\nBpmnImporter.prototype._getElement = function(semantic) {\n return this._elementRegistry.get(semantic.id);\n};\n","'use strict';\n\nvar filter = require(82),\n find = require(83),\n forEach = require(84);\n\nvar Refs = require(202);\n\nvar elementToString = require(10).elementToString;\n\nvar diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });\n\n/**\n * Returns true if an element has the given meta-model type\n *\n * @param {ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n return element.$instanceOf(type);\n}\n\n\n/**\n * Find a suitable display candidate for definitions where the DI does not\n * correctly specify one.\n */\nfunction findDisplayCandidate(definitions) {\n return find(definitions.rootElements, function(e) {\n return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');\n });\n}\n\n\nfunction BpmnTreeWalker(handler) {\n\n // list of containers already walked\n var handledProcesses = [];\n\n // list of elements to handle deferred to ensure\n // prerequisites are drawn\n var deferred = [];\n\n ///// Helpers /////////////////////////////////\n\n function contextual(fn, ctx) {\n return function(e) {\n fn(e, ctx);\n };\n }\n\n function visit(element, ctx) {\n\n var gfx = element.gfx;\n\n // avoid multiple rendering of elements\n if (gfx) {\n throw new Error('already rendered ' + elementToString(element));\n }\n\n // call handler\n return handler.element(element, ctx);\n }\n\n function visitRoot(element, diagram) {\n return handler.root(element, diagram);\n }\n\n function visitIfDi(element, ctx) {\n try {\n return element.di && visit(element, ctx);\n } catch (e) {\n logError(e.message, { element: element, error: e });\n\n console.error('failed to import ' + elementToString(element));\n console.error(e);\n }\n }\n\n function logError(message, context) {\n handler.error(message, context);\n }\n\n ////// DI handling ////////////////////////////\n\n function registerDi(di) {\n var bpmnElement = di.bpmnElement;\n\n if (bpmnElement) {\n if (bpmnElement.di) {\n logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });\n } else {\n diRefs.bind(bpmnElement, 'di');\n bpmnElement.di = di;\n }\n } else {\n logError('no bpmnElement referenced in ' + elementToString(di), { element: di });\n }\n }\n\n function handleDiagram(diagram) {\n handlePlane(diagram.plane);\n }\n\n function handlePlane(plane) {\n registerDi(plane);\n\n forEach(plane.planeElement, handlePlaneElement);\n }\n\n function handlePlaneElement(planeElement) {\n registerDi(planeElement);\n }\n\n\n ////// Semantic handling //////////////////////\n\n function handleDefinitions(definitions, diagram) {\n // make sure we walk the correct bpmnElement\n\n var diagrams = definitions.diagrams;\n\n if (diagram && diagrams.indexOf(diagram) === -1) {\n throw new Error('diagram not part of bpmn:Definitions');\n }\n\n if (!diagram && diagrams && diagrams.length) {\n diagram = diagrams[0];\n }\n\n // no diagram -> nothing to import\n if (!diagram) {\n return;\n }\n\n // load DI from selected diagram only\n handleDiagram(diagram);\n\n\n var plane = diagram.plane;\n\n if (!plane) {\n throw new Error('no plane for ' + elementToString(diagram));\n }\n\n\n var rootElement = plane.bpmnElement;\n\n // ensure we default to a suitable display candidate (process or collaboration),\n // even if non is specified in DI\n if (!rootElement) {\n rootElement = findDisplayCandidate(definitions);\n\n if (!rootElement) {\n return logError('no process or collaboration present to display');\n } else {\n\n logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));\n\n // correct DI on the fly\n plane.bpmnElement = rootElement;\n registerDi(plane);\n }\n }\n\n\n var ctx = visitRoot(rootElement, plane);\n\n if (is(rootElement, 'bpmn:Process')) {\n handleProcess(rootElement, ctx);\n } else if (is(rootElement, 'bpmn:Collaboration')) {\n handleCollaboration(rootElement, ctx);\n\n // force drawing of everything not yet drawn that is part of the target DI\n handleUnhandledProcesses(definitions.rootElements, ctx);\n } else {\n throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));\n }\n\n // handle all deferred elements\n handleDeferred(deferred);\n }\n\n function handleDeferred(deferred) {\n forEach(deferred, function(d) { d(); });\n }\n\n function handleProcess(process, context) {\n handleFlowElementsContainer(process, context);\n handleIoSpecification(process.ioSpecification, context);\n\n handleArtifacts(process.artifacts, context);\n\n // log process handled\n handledProcesses.push(process);\n }\n\n function handleUnhandledProcesses(rootElements) {\n\n // walk through all processes that have not yet been drawn and draw them\n // if they contain lanes with DI information.\n // we do this to pass the free-floating lane test cases in the MIWG test suite\n var processes = filter(rootElements, function(e) {\n return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;\n });\n\n processes.forEach(contextual(handleProcess));\n }\n\n function handleMessageFlow(messageFlow, context) {\n visitIfDi(messageFlow, context);\n }\n\n function handleMessageFlows(messageFlows, context) {\n forEach(messageFlows, contextual(handleMessageFlow, context));\n }\n\n function handleDataAssociation(association, context) {\n visitIfDi(association, context);\n }\n\n function handleDataInput(dataInput, context) {\n visitIfDi(dataInput, context);\n }\n\n function handleDataOutput(dataOutput, context) {\n visitIfDi(dataOutput, context);\n }\n\n function handleArtifact(artifact, context) {\n\n // bpmn:TextAnnotation\n // bpmn:Group\n // bpmn:Association\n\n visitIfDi(artifact, context);\n }\n\n function handleArtifacts(artifacts, context) {\n\n forEach(artifacts, function(e) {\n if (is(e, 'bpmn:Association')) {\n deferred.push(function() {\n handleArtifact(e, context);\n });\n } else {\n handleArtifact(e, context);\n }\n });\n }\n\n function handleIoSpecification(ioSpecification, context) {\n\n if (!ioSpecification) {\n return;\n }\n\n forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));\n forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));\n }\n\n function handleSubProcess(subProcess, context) {\n handleFlowElementsContainer(subProcess, context);\n handleArtifacts(subProcess.artifacts, context);\n }\n\n function handleFlowNode(flowNode, context) {\n var childCtx = visitIfDi(flowNode, context);\n\n if (is(flowNode, 'bpmn:SubProcess')) {\n handleSubProcess(flowNode, childCtx || context);\n }\n }\n\n function handleSequenceFlow(sequenceFlow, context) {\n visitIfDi(sequenceFlow, context);\n }\n\n function handleDataElement(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleBoundaryEvent(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleLane(lane, context) {\n var newContext = visitIfDi(lane, context);\n\n if (lane.childLaneSet) {\n handleLaneSet(lane.childLaneSet, newContext || context);\n } else {\n var filterList = filter(lane.flowNodeRef, function(e) {\n return e.$type !== 'bpmn:BoundaryEvent';\n });\n handleFlowElements(filterList, newContext || context);\n }\n }\n\n function handleLaneSet(laneSet, context) {\n forEach(laneSet.lanes, contextual(handleLane, context));\n }\n\n function handleLaneSets(laneSets, context) {\n forEach(laneSets, contextual(handleLaneSet, context));\n }\n\n function handleFlowElementsContainer(container, context) {\n\n if (container.laneSets) {\n handleLaneSets(container.laneSets, context);\n handleNonFlowNodes(container.flowElements);\n } else {\n handleFlowElements(container.flowElements, context);\n }\n }\n\n function handleNonFlowNodes(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n }\n });\n }\n\n function handleFlowElements(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:FlowNode')) {\n handleFlowNode(e, context);\n\n if (is(e, 'bpmn:Activity')) {\n\n handleIoSpecification(e.ioSpecification, context);\n\n // defer handling of associations\n deferred.push(function() {\n forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));\n forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));\n });\n }\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n } else {\n logError(\n 'unrecognized flowElement ' + elementToString(e) + ' in context ' +\n (context ? elementToString(context.businessObject) : null),\n { element: e, context: context });\n }\n });\n }\n\n function handleParticipant(participant, context) {\n var newCtx = visitIfDi(participant, context);\n\n var process = participant.processRef;\n if (process) {\n handleProcess(process, newCtx || context);\n }\n }\n\n function handleCollaboration(collaboration) {\n\n forEach(collaboration.participants, contextual(handleParticipant));\n\n handleArtifacts(collaboration.artifacts);\n\n // handle message flows latest in the process\n deferred.push(function() {\n handleMessageFlows(collaboration.messageFlows);\n });\n }\n\n\n ///// API ////////////////////////////////\n\n return {\n handleDefinitions: handleDefinitions\n };\n}\n\nmodule.exports = BpmnTreeWalker;","'use strict';\n\nvar BpmnTreeWalker = require(8);\n\n\n/**\n * Import the definitions into a diagram.\n *\n * Errors and warnings are reported through the specified callback.\n *\n * @param {Diagram} diagram\n * @param {ModdleElement} definitions\n * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done\n */\nfunction importBpmnDiagram(diagram, definitions, done) {\n\n var importer = diagram.get('bpmnImporter'),\n eventBus = diagram.get('eventBus');\n\n var error,\n warnings = [];\n\n function parse(definitions) {\n\n var visitor = {\n\n root: function(element) {\n return importer.add(element);\n },\n\n element: function(element, parentShape) {\n return importer.add(element, parentShape);\n },\n\n error: function(message, context) {\n warnings.push({ message: message, context: context });\n }\n };\n\n var walker = new BpmnTreeWalker(visitor);\n\n // import\n walker.handleDefinitions(definitions);\n }\n\n eventBus.fire('import.start');\n\n try {\n parse(definitions);\n } catch (e) {\n error = e;\n }\n\n eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });\n done(error, warnings);\n}\n\nmodule.exports.importBpmnDiagram = importBpmnDiagram;","'use strict';\n\nmodule.exports.elementToString = function(e) {\n if (!e) {\n return '<null>';\n }\n\n return '<' + e.$type + (e.id ? ' id=\"' + e.id : '') + '\" />';\n};","module.exports = {\n bpmnImporter: [ 'type', require(7) ]\n};","'use strict';\n\nvar is = require(14).is,\n getBusinessObject = require(14).getBusinessObject;\n\nmodule.exports.isExpanded = function(element) {\n\n if (is(element, 'bpmn:CallActivity')) {\n return false;\n }\n\n if (is(element, 'bpmn:SubProcess')) {\n return getBusinessObject(element).di.isExpanded;\n }\n\n if (is(element, 'bpmn:Participant')) {\n return !!getBusinessObject(element).processRef;\n }\n\n return true;\n};\n","'use strict';\n\nvar assign = require(175);\n\n\nvar DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {\n width: 90,\n height: 20\n};\n\n\n/**\n * Returns true if the given semantic has an external label\n *\n * @param {BpmnElement} semantic\n * @return {Boolean} true if has label\n */\nmodule.exports.hasExternalLabel = function(semantic) {\n\n return semantic.$instanceOf('bpmn:Event') ||\n semantic.$instanceOf('bpmn:Gateway') ||\n semantic.$instanceOf('bpmn:DataStoreReference') ||\n semantic.$instanceOf('bpmn:DataObjectReference') ||\n semantic.$instanceOf('bpmn:SequenceFlow') ||\n semantic.$instanceOf('bpmn:MessageFlow');\n};\n\n\n/**\n * Get the middle of a number of waypoints\n *\n * @param {Array<Point>} waypoints\n * @return {Point} the mid point\n */\nvar getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {\n\n var mid = waypoints.length / 2 - 1;\n\n var first = waypoints[Math.floor(mid)];\n var second = waypoints[Math.ceil(mid + 0.01)];\n\n return {\n x: first.x + (second.x - first.x) / 2,\n y: first.y + (second.y - first.y) / 2\n };\n};\n\n\nvar getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {\n\n if (element.waypoints) {\n return getWaypointsMid(element.waypoints);\n } else {\n return {\n x: element.x + element.width / 2,\n y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2\n };\n }\n};\n\n/**\n * Returns the bounds of an elements label, parsed from the elements DI or\n * generated from its bounds.\n *\n * @param {BpmnElement} semantic\n * @param {djs.model.Base} element\n */\nmodule.exports.getExternalLabelBounds = function(semantic, element) {\n\n var mid,\n size,\n bounds,\n di = semantic.di,\n label = di.label;\n\n if (label && label.bounds) {\n bounds = label.bounds;\n\n size = {\n width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),\n height: bounds.height\n };\n\n mid = {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n };\n } else {\n\n mid = getExternalLabelMid(element);\n\n size = DEFAULT_LABEL_SIZE;\n }\n\n return assign({\n x: mid.x - size.width / 2,\n y: mid.y - size.height / 2\n }, size);\n};","'use strict';\n\n/**\n * Is an element of the given BPMN type?\n *\n * @param {djs.model.Base|ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n var bo = getBusinessObject(element);\n\n return bo && bo.$instanceOf(type);\n}\n\nmodule.exports.is = is;\n\n\n/**\n * Return the business object for a given element.\n *\n * @param {djs.model.Base|ModdleElement} element\n *\n * @return {ModdleElement}\n */\nfunction getBusinessObject(element) {\n return (element && element.businessObject) || element;\n}\n\nmodule.exports.getBusinessObject = getBusinessObject;\n","module.exports = require(17);","'use strict';\n\nvar isString = require(172),\n isFunction = require(167),\n assign = require(175);\n\nvar Moddle = require(23),\n XmlReader = require(19),\n XmlWriter = require(20);\n\n/**\n * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.\n *\n * @class BpmnModdle\n * @extends Moddle\n *\n * @param {Object|Array} packages to use for instantiating the model\n * @param {Object} [options] additional options to pass over\n */\nfunction BpmnModdle(packages, options) {\n Moddle.call(this, packages, options);\n}\n\nBpmnModdle.prototype = Object.create(Moddle.prototype);\n\nmodule.exports = BpmnModdle;\n\n\n/**\n * Instantiates a BPMN model tree from a given xml string.\n *\n * @param {String} xmlStr\n * @param {String} [typeName='bpmn:Definitions'] name of the root element\n * @param {Object} [options] options to pass to the underlying reader\n * @param {Function} done callback that is invoked with (err, result, parseContext)\n * once the import completes\n */\nBpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {\n\n if (!isString(typeName)) {\n done = options;\n options = typeName;\n typeName = 'bpmn:Definitions';\n }\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var reader = new XmlReader(assign({ model: this, lax: true }, options));\n var rootHandler = reader.handler(typeName);\n\n reader.fromXML(xmlStr, rootHandler, done);\n};\n\n\n/**\n * Serializes a BPMN 2.0 object tree to XML.\n *\n * @param {String} element the root element, typically an instance of `bpmn:Definitions`\n * @param {Object} [options] to pass to the underlying writer\n * @param {Function} done callback invoked with (err, xmlStr) once the import completes\n */\nBpmnModdle.prototype.toXML = function(element, options, done) {\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var writer = new XmlWriter(options);\n try {\n var result = writer.toXML(element);\n done(null, result);\n } catch (e) {\n done(e);\n }\n};\n","'use strict';\n\nvar assign = require(175);\n\nvar BpmnModdle = require(16);\n\nvar packages = {\n bpmn: require(32),\n bpmndi: require(33),\n dc: require(34),\n di: require(35)\n};\n\nmodule.exports = function(additionalPackages, options) {\n return new BpmnModdle(assign({}, packages, additionalPackages), options);\n};","'use strict';\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction lower(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n}\n\nfunction hasLowerCaseAlias(pkg) {\n return pkg.xml && pkg.xml.tagAlias === 'lowerCase';\n}\n\n\nmodule.exports.aliasToName = function(alias, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return capitalize(alias);\n } else {\n return alias;\n }\n};\n\nmodule.exports.nameToAlias = function(name, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return lower(name);\n } else {\n return name;\n }\n};\n\nmodule.exports.DEFAULT_NS_MAP = {\n 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'\n};\n\nmodule.exports.XSI_TYPE = 'xsi:type';","'use strict';\n\nvar reduce = require(88),\n forEach = require(84),\n find = require(83),\n assign = require(175),\n defer = require(92);\n\nvar Stack = require(22),\n SaxParser = require(21).parser,\n Moddle = require(23),\n parseNameNs = require(28).parseName,\n Types = require(31),\n coerceType = Types.coerceType,\n isSimpleType = Types.isSimple,\n common = require(18),\n XSI_TYPE = common.XSI_TYPE,\n XSI_URI = common.DEFAULT_NS_MAP.xsi,\n aliasToName = common.aliasToName;\n\nfunction parseNodeAttributes(node) {\n var nodeAttrs = node.attributes;\n\n return reduce(nodeAttrs, function(result, v, k) {\n var name, ns;\n\n if (!v.local) {\n name = v.prefix;\n } else {\n ns = parseNameNs(v.name, v.prefix);\n name = ns.name;\n }\n\n result[name] = v.value;\n return result;\n }, {});\n}\n\nfunction normalizeType(node, attr, model) {\n var nameNs = parseNameNs(attr.value);\n\n var uri = node.ns[nameNs.prefix || ''],\n localName = nameNs.localName,\n pkg = uri && model.getPackage(uri),\n typePrefix;\n\n if (pkg) {\n typePrefix = pkg.xml && pkg.xml.typePrefix;\n\n if (typePrefix && localName.indexOf(typePrefix) === 0) {\n localName = localName.slice(typePrefix.length);\n }\n\n attr.value = pkg.prefix + ':' + localName;\n }\n}\n\n/**\n * Normalizes namespaces for a node given an optional default namespace and a\n * number of mappings from uris to default prefixes.\n *\n * @param {XmlNode} node\n * @param {Model} model the model containing all registered namespaces\n * @param {Uri} defaultNsUri\n */\nfunction normalizeNamespaces(node, model, defaultNsUri) {\n var uri, prefix;\n\n uri = node.uri || defaultNsUri;\n\n if (uri) {\n var pkg = model.getPackage(uri);\n\n if (pkg) {\n prefix = pkg.prefix;\n } else {\n prefix = node.prefix;\n }\n\n node.prefix = prefix;\n node.uri = uri;\n }\n\n forEach(node.attributes, function(attr) {\n\n // normalize xsi:type attributes because the\n // assigned type may or may not be namespace prefixed\n if (attr.uri === XSI_URI && attr.local === 'type') {\n normalizeType(node, attr, model);\n }\n\n normalizeNamespaces(attr, model, null);\n });\n}\n\n\n/**\n * A parse context.\n *\n * @class\n *\n * @param {Object} options\n * @param {ElementHandler} options.parseRoot the root handler for parsing a document\n * @param {boolean} [options.lax=false] whether or not to ignore invalid elements\n */\nfunction Context(options) {\n\n /**\n * @property {ElementHandler} parseRoot\n */\n\n /**\n * @property {Boolean} lax\n */\n\n assign(this, options);\n\n var elementsById = this.elementsById = {};\n var references = this.references = [];\n var warnings = this.warnings = [];\n\n this.addReference = function(reference) {\n references.push(reference);\n };\n\n this.addElement = function(id, element) {\n\n if (!id || !element) {\n throw new Error('[xml-reader] id or ctx must not be null');\n }\n\n elementsById[id] = element;\n };\n\n this.addWarning = function (w) {\n warnings.push(w);\n };\n}\n\nfunction BaseHandler() {}\n\nBaseHandler.prototype.handleEnd = function() {};\nBaseHandler.prototype.handleText = function() {};\nBaseHandler.prototype.handleNode = function() {};\n\n\n/**\n * A simple pass through handler that does nothing except for\n * ignoring all input it receives.\n *\n * This is used to ignore unknown elements and\n * attributes.\n */\nfunction NoopHandler() { }\n\nNoopHandler.prototype = new BaseHandler();\n\nNoopHandler.prototype.handleNode = function() {\n return this;\n};\n\nfunction BodyHandler() {}\n\nBodyHandler.prototype = new BaseHandler();\n\nBodyHandler.prototype.handleText = function(text) {\n this.body = (this.body || '') + text;\n};\n\nfunction ReferenceHandler(property, context) {\n this.property = property;\n this.context = context;\n}\n\nReferenceHandler.prototype = new BodyHandler();\n\nReferenceHandler.prototype.handleNode = function(node) {\n\n if (this.element) {\n throw new Error('expected no sub nodes');\n } else {\n this.element = this.createReference(node);\n }\n\n return this;\n};\n\nReferenceHandler.prototype.handleEnd = function() {\n this.element.id = this.body;\n};\n\nReferenceHandler.prototype.createReference = function() {\n return {\n property: this.property.ns.name,\n id: ''\n };\n};\n\nfunction ValueHandler(propertyDesc, element) {\n this.element = element;\n this.propertyDesc = propertyDesc;\n}\n\nValueHandler.prototype = new BodyHandler();\n\nValueHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n propertyDesc = this.propertyDesc;\n\n value = coerceType(propertyDesc.type, value);\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(value);\n } else {\n element.set(propertyDesc.name, value);\n }\n};\n\n\nfunction BaseElementHandler() {}\n\nBaseElementHandler.prototype = Object.create(BodyHandler.prototype);\n\nBaseElementHandler.prototype.handleNode = function(node) {\n var parser = this,\n element = this.element,\n id;\n\n if (!element) {\n element = this.element = this.createElement(node);\n id = element.id;\n\n if (id) {\n this.context.addElement(id, element);\n }\n } else {\n parser = this.handleChild(node);\n }\n\n return parser;\n};\n\n/**\n * @class XMLReader.ElementHandler\n *\n */\nfunction ElementHandler(model, type, context) {\n this.model = model;\n this.type = model.getType(type);\n this.context = context;\n}\n\nElementHandler.prototype = new BaseElementHandler();\n\nElementHandler.prototype.addReference = function(reference) {\n this.context.addReference(reference);\n};\n\nElementHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n descriptor = element.$descriptor,\n bodyProperty = descriptor.bodyProperty;\n\n if (bodyProperty && value !== undefined) {\n value = coerceType(bodyProperty.type, value);\n element.set(bodyProperty.name, value);\n }\n};\n\n/**\n * Create an instance of the model from the given node.\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.createElement = function(node) {\n var attributes = parseNodeAttributes(node),\n Type = this.type,\n descriptor = Type.$descriptor,\n context = this.context,\n instance = new Type({});\n\n forEach(attributes, function(value, name) {\n\n var prop = descriptor.propertiesByName[name];\n\n if (prop && prop.isReference) {\n context.addReference({\n element: instance,\n property: prop.ns.name,\n id: value\n });\n } else {\n if (prop) {\n value = coerceType(prop.type, value);\n }\n\n instance.set(name, value);\n }\n });\n\n return instance;\n};\n\nElementHandler.prototype.getPropertyForNode = function(node) {\n\n var nameNs = parseNameNs(node.local, node.prefix);\n\n var type = this.type,\n model = this.model,\n descriptor = type.$descriptor;\n\n var propertyName = nameNs.name,\n property = descriptor.propertiesByName[propertyName],\n elementTypeName,\n elementType,\n typeAnnotation;\n\n // search for properties by name first\n\n if (property) {\n\n if (property.serialize === XSI_TYPE) {\n typeAnnotation = node.attributes[XSI_TYPE];\n\n // xsi type is optional, if it does not exists the\n // default type is assumed\n if (typeAnnotation) {\n\n elementTypeName = typeAnnotation.value;\n\n // TODO: extract real name from attribute\n elementType = model.getType(elementTypeName);\n\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n }\n\n // search for properties by name first\n return property;\n }\n\n\n var pkg = model.getPackage(nameNs.prefix);\n\n if (pkg) {\n elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);\n elementType = model.getType(elementTypeName);\n\n // search for collection members later\n property = find(descriptor.properties, function(p) {\n return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);\n });\n\n if (property) {\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n } else {\n // parse unknown element (maybe extension)\n property = find(descriptor.properties, function(p) {\n return !p.isReference && !p.isAttribute && p.type === 'Element';\n });\n\n if (property) {\n return property;\n }\n }\n\n throw new Error('unrecognized element <' + nameNs.name + '>');\n};\n\nElementHandler.prototype.toString = function() {\n return 'ElementDescriptor[' + this.type.$descriptor.name + ']';\n};\n\nElementHandler.prototype.valueHandler = function(propertyDesc, element) {\n return new ValueHandler(propertyDesc, element);\n};\n\nElementHandler.prototype.referenceHandler = function(propertyDesc) {\n return new ReferenceHandler(propertyDesc, this.context);\n};\n\nElementHandler.prototype.handler = function(type) {\n if (type === 'Element') {\n return new GenericElementHandler(this.model, type, this.context);\n } else {\n return new ElementHandler(this.model, type, this.context);\n }\n};\n\n/**\n * Handle the child element parsing\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.handleChild = function(node) {\n var propertyDesc, type, element, childHandler;\n\n propertyDesc = this.getPropertyForNode(node);\n element = this.element;\n\n type = propertyDesc.effectiveType || propertyDesc.type;\n\n if (isSimpleType(type)) {\n return this.valueHandler(propertyDesc, element);\n }\n\n if (propertyDesc.isReference) {\n childHandler = this.referenceHandler(propertyDesc).handleNode(node);\n } else {\n childHandler = this.handler(type).handleNode(node);\n }\n\n var newElement = childHandler.element;\n\n // child handles may decide to skip elements\n // by not returning anything\n if (newElement !== undefined) {\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(newElement);\n } else {\n element.set(propertyDesc.name, newElement);\n }\n\n if (propertyDesc.isReference) {\n assign(newElement, {\n element: element\n });\n\n this.context.addReference(newElement);\n } else {\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n }\n\n return childHandler;\n};\n\n\nfunction GenericElementHandler(model, type, context) {\n this.model = model;\n this.context = context;\n}\n\nGenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);\n\nGenericElementHandler.prototype.createElement = function(node) {\n\n var name = node.name,\n prefix = node.prefix,\n uri = node.ns[prefix],\n attributes = node.attributes;\n\n return this.model.createAny(name, uri, attributes);\n};\n\nGenericElementHandler.prototype.handleChild = function(node) {\n\n var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),\n element = this.element;\n\n var newElement = handler.element,\n children;\n\n if (newElement !== undefined) {\n children = element.$children = element.$children || [];\n children.push(newElement);\n\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n\n return handler;\n};\n\nGenericElementHandler.prototype.handleText = function(text) {\n this.body = this.body || '' + text;\n};\n\nGenericElementHandler.prototype.handleEnd = function() {\n if (this.body) {\n this.element.$body = this.body;\n }\n};\n\n/**\n * A reader for a meta-model\n *\n * @param {Object} options\n * @param {Model} options.model used to read xml files\n * @param {Boolean} options.lax whether to make parse errors warnings\n */\nfunction XMLReader(options) {\n\n if (options instanceof Moddle) {\n options = {\n model: options\n };\n }\n\n assign(this, { lax: false }, options);\n}\n\n\nXMLReader.prototype.fromXML = function(xml, rootHandler, done) {\n\n var model = this.model,\n lax = this.lax,\n context = new Context({\n parseRoot: rootHandler\n });\n\n var parser = new SaxParser(true, { xmlns: true, trim: true }),\n stack = new Stack();\n\n rootHandler.context = context;\n\n // push root handler\n stack.push(rootHandler);\n\n\n function resolveReferences() {\n\n var elementsById = context.elementsById;\n var references = context.references;\n\n var i, r;\n\n for (i = 0; !!(r = references[i]); i++) {\n var element = r.element;\n var reference = elementsById[r.id];\n var property = element.$descriptor.propertiesByName[r.property];\n\n if (!reference) {\n context.addWarning({\n message: 'unresolved reference <' + r.id + '>',\n element: r.element,\n property: r.property,\n value: r.id\n });\n }\n\n if (property.isMany) {\n var collection = element.get(property.name),\n idx = collection.indexOf(r);\n\n if (!reference) {\n // remove unresolvable reference\n collection.splice(idx, 1);\n } else {\n // update reference\n collection[idx] = reference;\n }\n } else {\n element.set(property.name, reference);\n }\n }\n }\n\n function handleClose(tagName) {\n stack.pop().handleEnd();\n }\n\n function handleOpen(node) {\n var handler = stack.peek();\n\n normalizeNamespaces(node, model);\n\n try {\n stack.push(handler.handleNode(node));\n } catch (e) {\n\n var line = this.line,\n column = this.column;\n\n var message =\n 'unparsable content <' + node.name + '> detected/n/t' +\n 'line: ' + line + '/n/t' +\n 'column: ' + column + '/n/t' +\n 'nested error: ' + e.message;\n\n if (lax) {\n context.addWarning({\n message: message,\n error: e\n });\n\n console.warn('could not parse node');\n console.warn(e);\n\n stack.push(new NoopHandler());\n } else {\n console.error('could not parse document');\n console.error(e);\n\n throw new Error(message);\n }\n }\n }\n\n function handleText(text) {\n stack.peek().handleText(text);\n }\n\n parser.onopentag = handleOpen;\n parser.oncdata = parser.ontext = handleText;\n parser.onclosetag = handleClose;\n parser.onend = resolveReferences;\n\n // deferred parse XML to make loading really ascnchronous\n // this ensures the execution environment (node or browser)\n // is kept responsive and that certain optimization strategies\n // can kick in\n defer(function() {\n var error;\n\n try {\n parser.write(xml).close();\n } catch (e) {\n error = e;\n }\n\n done(error, error ? undefined : rootHandler.element, context);\n });\n};\n\nXMLReader.prototype.handler = function(name) {\n return new ElementHandler(this.model, name);\n};\n\nmodule.exports = XMLReader;\nmodule.exports.ElementHandler = ElementHandler;","'use strict';\n\nvar map = require(87),\n forEach = require(84),\n isString = require(172),\n filter = require(82),\n assign = require(175);\n\nvar Types = require(31),\n parseNameNs = require(28).parseName,\n common = require(18),\n nameToAlias = common.nameToAlias;\n\nvar XML_PREAMBLE = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>/n',\n ESCAPE_CHARS = /(<|>|'|\"|&|/n/r|/n)/g,\n DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,\n XSI_TYPE = common.XSI_TYPE;\n\n\nfunction nsName(ns) {\n if (isString(ns)) {\n return ns;\n } else {\n return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;\n }\n}\n\nfunction getElementNs(ns, descriptor) {\n if (descriptor.isGeneric) {\n return descriptor.name;\n } else {\n return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);\n }\n}\n\nfunction getPropertyNs(ns, descriptor) {\n return assign({ localName: descriptor.ns.localName }, ns);\n}\n\nfunction getSerializableProperties(element) {\n var descriptor = element.$descriptor;\n\n return filter(descriptor.properties, function(p) {\n var name = p.name;\n\n // do not serialize defaults\n if (!element.hasOwnProperty(name)) {\n return false;\n }\n\n var value = element[name];\n\n // do not serialize default equals\n if (value === p.default) {\n return false;\n }\n\n return p.isMany ? value.length : true;\n });\n}\n\nvar ESCAPE_MAP = {\n '/n': '10',\n '/n/r': '10',\n '\"': '34',\n '/'': '39',\n '<': '60',\n '>': '62',\n '&': '38'\n};\n\n/**\n * Escape a string attribute to not contain any bad values (line breaks, '\"', ...)\n *\n * @param {String} str the string to escape\n * @return {String} the escaped string\n */\nfunction escapeAttr(str) {\n\n // ensure we are handling strings here\n str = isString(str) ? str : '' + str;\n\n return str.replace(ESCAPE_CHARS, function(str) {\n return '&#' + ESCAPE_MAP[str] + ';';\n });\n}\n\nfunction filterAttributes(props) {\n return filter(props, function(p) { return p.isAttr; });\n}\n\nfunction filterContained(props) {\n return filter(props, function(p) { return !p.isAttr; });\n}\n\n\nfunction ReferenceSerializer(parent, ns) {\n this.ns = ns;\n}\n\nReferenceSerializer.prototype.build = function(element) {\n this.element = element;\n return this;\n};\n\nReferenceSerializer.prototype.serializeTo = function(writer) {\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction BodySerializer() {}\n\nBodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {\n var escape = this.escape;\n\n if (escape) {\n writer.append('<![CDATA[');\n }\n\n writer.append(this.value);\n\n if (escape) {\n writer.append(']]>');\n }\n};\n\nBodySerializer.prototype.build = function(prop, value) {\n this.value = value;\n\n if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {\n this.escape = true;\n }\n\n return this;\n};\n\nfunction ValueSerializer(ns) {\n this.ns = ns;\n}\n\nValueSerializer.prototype = new BodySerializer();\n\nValueSerializer.prototype.serializeTo = function(writer) {\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>');\n\n this.serializeValue(writer);\n\n writer\n .append( '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction ElementSerializer(parent, ns) {\n this.body = [];\n this.attrs = [];\n\n this.parent = parent;\n this.ns = ns;\n}\n\nElementSerializer.prototype.build = function(element) {\n this.element = element;\n\n var otherAttrs = this.parseNsAttributes(element);\n\n if (!this.ns) {\n this.ns = this.nsTagName(element.$descriptor);\n }\n\n if (element.$descriptor.isGeneric) {\n this.parseGeneric(element);\n } else {\n var properties = getSerializableProperties(element);\n\n this.parseAttributes(filterAttributes(properties));\n this.parseContainments(filterContained(properties));\n\n this.parseGenericAttributes(element, otherAttrs);\n }\n\n return this;\n};\n\nElementSerializer.prototype.nsTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getElementNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.nsPropertyTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getPropertyNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.ns.uri;\n};\n\nElementSerializer.prototype.nsAttributeName = function(element) {\n\n var ns;\n\n if (isString(element)) {\n ns = parseNameNs(element);\n } else\n if (element.ns) {\n ns = element.ns;\n }\n\n var effectiveNs = this.logNamespaceUsed(ns);\n\n // strip prefix if same namespace like parent\n if (this.isLocalNs(effectiveNs)) {\n return { localName: ns.localName };\n } else {\n return assign({ localName: ns.localName }, effectiveNs);\n }\n};\n\nElementSerializer.prototype.parseGeneric = function(element) {\n\n var self = this,\n body = this.body,\n attrs = this.attrs;\n\n forEach(element, function(val, key) {\n\n if (key === '$body') {\n body.push(new BodySerializer().build({ type: 'String' }, val));\n } else\n if (key === '$children') {\n forEach(val, function(child) {\n body.push(new ElementSerializer(self).build(child));\n });\n } else\n if (key.indexOf('$') !== 0) {\n attrs.push({ name: key, value: escapeAttr(val) });\n }\n });\n};\n\n/**\n * Parse namespaces and return a list of left over generic attributes\n *\n * @param {Object} element\n * @return {Array<Object>}\n */\nElementSerializer.prototype.parseNsAttributes = function(element) {\n var self = this;\n\n var genericAttrs = element.$attrs;\n\n var attributes = [];\n\n // parse namespace attributes first\n // and log them. push non namespace attributes to a list\n // and process them later\n forEach(genericAttrs, function(value, name) {\n var nameNs = parseNameNs(name);\n\n if (nameNs.prefix === 'xmlns') {\n self.logNamespace({ prefix: nameNs.localName, uri: value });\n } else\n if (!nameNs.prefix && nameNs.localName === 'xmlns') {\n self.logNamespace({ uri: value });\n } else {\n attributes.push({ name: name, value: value });\n }\n });\n\n return attributes;\n};\n\nElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {\n\n var self = this;\n\n forEach(attributes, function(attr) {\n\n // do not serialize xsi:type attribute\n // it is set manually based on the actual implementation type\n if (attr.name === XSI_TYPE) {\n return;\n }\n\n try {\n self.addAttribute(self.nsAttributeName(attr.name), attr.value);\n } catch (e) {\n console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);\n }\n });\n};\n\nElementSerializer.prototype.parseContainments = function(properties) {\n\n var self = this,\n body = this.body,\n element = this.element;\n\n forEach(properties, function(p) {\n var value = element.get(p.name),\n isReference = p.isReference,\n isMany = p.isMany;\n\n var ns = self.nsPropertyTagName(p);\n\n if (!isMany) {\n value = [ value ];\n }\n\n if (p.isBody) {\n body.push(new BodySerializer().build(p, value[0]));\n } else\n if (Types.isSimple(p.type)) {\n forEach(value, function(v) {\n body.push(new ValueSerializer(ns).build(p, v));\n });\n } else\n if (isReference) {\n forEach(value, function(v) {\n body.push(new ReferenceSerializer(self, ns).build(v));\n });\n } else {\n // allow serialization via type\n // rather than element name\n var asType = p.serialize === XSI_TYPE;\n\n forEach(value, function(v) {\n var serializer;\n\n if (asType) {\n serializer = new TypeSerializer(self, ns);\n } else {\n serializer = new ElementSerializer(self);\n }\n\n body.push(serializer.build(v));\n });\n }\n });\n};\n\nElementSerializer.prototype.getNamespaces = function() {\n if (!this.parent) {\n if (!this.namespaces) {\n this.namespaces = {\n prefixMap: {},\n uriMap: {},\n used: {}\n };\n }\n } else {\n this.namespaces = this.parent.getNamespaces();\n }\n\n return this.namespaces;\n};\n\nElementSerializer.prototype.logNamespace = function(ns) {\n var namespaces = this.getNamespaces();\n\n var existing = namespaces.uriMap[ns.uri];\n\n if (!existing) {\n namespaces.uriMap[ns.uri] = ns;\n }\n\n namespaces.prefixMap[ns.prefix] = ns.uri;\n\n return ns;\n};\n\nElementSerializer.prototype.logNamespaceUsed = function(ns) {\n var element = this.element,\n model = element.$model,\n namespaces = this.getNamespaces();\n\n // ns may be\n //\n // * prefix only\n // * prefix:uri\n\n var prefix = ns.prefix;\n var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||\n namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);\n\n if (!uri) {\n throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');\n }\n\n ns = namespaces.uriMap[uri];\n\n if (!ns) {\n ns = this.logNamespace({ prefix: prefix, uri: uri });\n }\n\n if (!namespaces.used[ns.uri]) {\n namespaces.used[ns.uri] = ns;\n }\n\n return ns;\n};\n\nElementSerializer.prototype.parseAttributes = function(properties) {\n var self = this,\n element = this.element;\n\n forEach(properties, function(p) {\n self.logNamespaceUsed(p.ns);\n\n var value = element.get(p.name);\n\n if (p.isReference) {\n value = value.id;\n }\n\n self.addAttribute(self.nsAttributeName(p), value);\n });\n};\n\nElementSerializer.prototype.addAttribute = function(name, value) {\n var attrs = this.attrs;\n\n if (isString(value)) {\n value = escapeAttr(value);\n }\n\n attrs.push({ name: name, value: value });\n};\n\nElementSerializer.prototype.serializeAttributes = function(writer) {\n var attrs = this.attrs,\n root = !this.parent,\n namespaces = this.namespaces;\n\n function collectNsAttrs() {\n return map(namespaces.used, function(ns) {\n var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');\n return { name: name, value: ns.uri };\n });\n }\n\n if (root) {\n attrs = collectNsAttrs().concat(attrs);\n }\n\n forEach(attrs, function(a) {\n writer\n .append(' ')\n .append(nsName(a.name)).append('=\"').append(a.value).append('\"');\n });\n};\n\nElementSerializer.prototype.serializeTo = function(writer) {\n var hasBody = this.body.length,\n indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns));\n\n this.serializeAttributes(writer);\n\n writer.append(hasBody ? '>' : ' />');\n\n if (hasBody) {\n\n if (indent) {\n writer\n .appendNewLine()\n .indent();\n }\n\n forEach(this.body, function(b) {\n b.serializeTo(writer);\n });\n\n if (indent) {\n writer\n .unindent()\n .appendIndent();\n }\n\n writer.append('</' + nsName(this.ns) + '>');\n }\n\n writer.appendNewLine();\n};\n\n/**\n * A serializer for types that handles serialization of data types\n */\nfunction TypeSerializer(parent, ns) {\n ElementSerializer.call(this, parent, ns);\n}\n\nTypeSerializer.prototype = new ElementSerializer();\n\nTypeSerializer.prototype.build = function(element) {\n var descriptor = element.$descriptor;\n\n this.element = element;\n\n this.typeNs = this.nsTagName(descriptor);\n\n // add xsi:type attribute to represent the elements\n // actual type\n\n var typeNs = this.typeNs,\n pkg = element.$model.getPackage(typeNs.uri),\n typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';\n\n this.addAttribute(this.nsAttributeName(XSI_TYPE),\n (typeNs.prefix ? typeNs.prefix + ':' : '') +\n typePrefix + descriptor.ns.localName);\n\n // do the usual stuff\n return ElementSerializer.prototype.build.call(this, element);\n};\n\nTypeSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.typeNs.uri;\n};\n\nfunction SavingWriter() {\n this.value = '';\n\n this.write = function(str) {\n this.value += str;\n };\n}\n\nfunction FormatingWriter(out, format) {\n\n var indent = [''];\n\n this.append = function(str) {\n out.write(str);\n\n return this;\n };\n\n this.appendNewLine = function() {\n if (format) {\n out.write('/n');\n }\n\n return this;\n };\n\n this.appendIndent = function() {\n if (format) {\n out.write(indent.join(' '));\n }\n\n return this;\n };\n\n this.indent = function() {\n indent.push('');\n return this;\n };\n\n this.unindent = function() {\n indent.pop();\n return this;\n };\n}\n\n/**\n * A writer for meta-model backed document trees\n *\n * @param {Object} options output options to pass into the writer\n */\nfunction XMLWriter(options) {\n\n options = assign({ format: false, preamble: true }, options || {});\n\n function toXML(tree, writer) {\n var internalWriter = writer || new SavingWriter();\n var formatingWriter = new FormatingWriter(internalWriter, options.format);\n\n if (options.preamble) {\n formatingWriter.append(XML_PREAMBLE);\n }\n\n new ElementSerializer().build(tree).serializeTo(formatingWriter);\n\n if (!writer) {\n return internalWriter.value;\n }\n }\n\n return {\n toXML: toXML\n };\n}\n\nmodule.exports = XMLWriter;","// wrapper for non-node envs\n;(function (sax) {\n\nsax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\nsax.SAXParser = SAXParser\nsax.SAXStream = SAXStream\nsax.createStream = createStream\n\n// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n// since that's the earliest that a buffer overrun could occur. This way, checks are\n// as rare as required, but as often as necessary to ensure never crossing this bound.\n// Furthermore, buffers are only tested at most once per write(), so passing a very\n// large string into write() might have undesirable effects, but this is manageable by\n// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n// edge case, result in creating at most one complete copy of the string passed in.\n// Set to Infinity to have unlimited buffers.\nsax.MAX_BUFFER_LENGTH = 64 * 1024\n\nvar buffers = [\n \"comment\", \"sgmlDecl\", \"textNode\", \"tagName\", \"doctype\",\n \"procInstName\", \"procInstBody\", \"entity\", \"attribName\",\n \"attribValue\", \"cdata\", \"script\"\n]\n\nsax.EVENTS = // for discoverability.\n [ \"text\"\n , \"processinginstruction\"\n , \"sgmldeclaration\"\n , \"doctype\"\n , \"comment\"\n , \"attribute\"\n , \"opentag\"\n , \"closetag\"\n , \"opencdata\"\n , \"cdata\"\n , \"closecdata\"\n , \"error\"\n , \"end\"\n , \"ready\"\n , \"script\"\n , \"opennamespace\"\n , \"closenamespace\"\n ]\n\nfunction SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = \"\"\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\"\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.ENTITIES = Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) parser.ns = Object.create(rootNS)\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, \"onready\")\n}\n\nif (!Object.create) Object.create = function (o) {\n function f () { this.__proto__ = o }\n f.prototype = o\n return new f\n}\n\nif (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {\n return o.__proto__\n}\n\nif (!Object.keys) Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n}\n\nfunction checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n , maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i ++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case \"textNode\":\n closeText(parser)\n break\n\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n break\n\n case \"script\":\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n break\n\n default:\n error(parser, \"Max buffer length exceeded: \"+buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)\n + parser.position\n}\n\nfunction clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i ++) {\n parser[buffers[i]] = \"\"\n }\n}\n\nfunction flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n}\n\nSAXParser.prototype =\n { end: function () { end(this) }\n , write: write\n , resume: function () { this.error = null; return this }\n , close: function () { return this.write(null) }\n , flush: function () { flushBuffers(this) }\n }\n\ntry {\n var Stream = require(\"stream\").Stream\n} catch (ex) {\n var Stream = function () {}\n}\n\n\nvar streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== \"error\" && ev !== \"end\"\n})\n\nfunction createStream (strict, opt) {\n return new SAXStream(strict, opt)\n}\n\nfunction SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n\n var me = this\n\n this._parser.onend = function () {\n me.emit(\"end\")\n }\n\n this._parser.onerror = function (er) {\n me.emit(\"error\", er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null;\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function () { return me._parser[\"on\" + ev] },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n return me._parser[\"on\"+ev] = h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n}\n\nSAXStream.prototype = Object.create(Stream.prototype,\n { constructor: { value: SAXStream } })\n\nSAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data);\n }\n\n this._parser.write(data.toString())\n this.emit(\"data\", data)\n return true\n}\n\nSAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) this.write(chunk)\n this._parser.end()\n return true\n}\n\nSAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser[\"on\"+ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\"+ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]]\n : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n}\n\n\n\n// character classes and tokens\nvar whitespace = \"/r/n/t \"\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n , number = \"0124356789\"\n , letter = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n // (Letter | \"_\" | \":\")\n , quote = \"'/\"\"\n , entity = number+letter+\"#\"\n , attribEnd = whitespace + \">\"\n , CDATA = \"[CDATA[\"\n , DOCTYPE = \"DOCTYPE\"\n , XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\"\n , XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\"\n , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n// turn all the string character sets into character class objects.\nwhitespace = charClass(whitespace)\nnumber = charClass(number)\nletter = charClass(letter)\n\n// http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n// This implementation works on strings, a single character at a time\n// as such, it cannot ever support astral-plane characters (10000-EFFFF)\n// without a significant breaking change to either this parser, or the\n// JavaScript language. Implementation of an emoji-capable xml parser\n// is left as an exercise for the reader.\nvar nameStart = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD]/\n\nvar nameBody = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD/u00B7/u0300-/u036F/u203F-/u2040/./d-]/\n\nquote = charClass(quote)\nentity = charClass(entity)\nattribEnd = charClass(attribEnd)\n\nfunction charClass (str) {\n return str.split(\"\").reduce(function (s, c) {\n s[c] = true\n return s\n }, {})\n}\n\nfunction isRegExp (c) {\n return Object.prototype.toString.call(c) === '[object RegExp]'\n}\n\nfunction is (charclass, c) {\n return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]\n}\n\nfunction not (charclass, c) {\n return !is(charclass, c)\n}\n\nvar S = 0\nsax.STATE =\n{ BEGIN : S++\n, TEXT : S++ // general stuff\n, TEXT_ENTITY : S++ // &amp and such.\n, OPEN_WAKA : S++ // <\n, SGML_DECL : S++ // <!BLARG\n, SGML_DECL_QUOTED : S++ // <!BLARG foo \"bar\n, DOCTYPE : S++ // <!DOCTYPE\n, DOCTYPE_QUOTED : S++ // <!DOCTYPE \"//blah\n, DOCTYPE_DTD : S++ // <!DOCTYPE \"//blah\" [ ...\n, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE \"//blah\" [ \"foo\n, COMMENT_STARTING : S++ // <!-\n, COMMENT : S++ // <!--\n, COMMENT_ENDING : S++ // <!-- blah -\n, COMMENT_ENDED : S++ // <!-- blah --\n, CDATA : S++ // <![CDATA[ something\n, CDATA_ENDING : S++ // ]\n, CDATA_ENDING_2 : S++ // ]]\n, PROC_INST : S++ // <?hi\n, PROC_INST_BODY : S++ // <?hi there\n, PROC_INST_ENDING : S++ // <?hi \"there\" ?\n, OPEN_TAG : S++ // <strong\n, OPEN_TAG_SLASH : S++ // <strong /\n, ATTRIB : S++ // <a\n, ATTRIB_NAME : S++ // <a foo\n, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _\n, ATTRIB_VALUE : S++ // <a foo=\n, ATTRIB_VALUE_QUOTED : S++ // <a foo=\"bar\n, ATTRIB_VALUE_CLOSED : S++ // <a foo=\"bar\"\n, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar\n, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar=\"&quot;\"\n, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;\n, CLOSE_TAG : S++ // </a\n, CLOSE_TAG_SAW_WHITE : S++ // </a >\n, SCRIPT : S++ // <script> ...\n, SCRIPT_ENDING : S++ // <script> ... <\n}\n\nsax.ENTITIES =\n{ \"amp\" : \"&\"\n, \"gt\" : \">\"\n, \"lt\" : \"<\"\n, \"quot\" : \"/\"\"\n, \"apos\" : \"'\"\n, \"AElig\" : 198\n, \"Aacute\" : 193\n, \"Acirc\" : 194\n, \"Agrave\" : 192\n, \"Aring\" : 197\n, \"Atilde\" : 195\n, \"Auml\" : 196\n, \"Ccedil\" : 199\n, \"ETH\" : 208\n, \"Eacute\" : 201\n, \"Ecirc\" : 202\n, \"Egrave\" : 200\n, \"Euml\" : 203\n, \"Iacute\" : 205\n, \"Icirc\" : 206\n, \"Igrave\" : 204\n, \"Iuml\" : 207\n, \"Ntilde\" : 209\n, \"Oacute\" : 211\n, \"Ocirc\" : 212\n, \"Ograve\" : 210\n, \"Oslash\" : 216\n, \"Otilde\" : 213\n, \"Ouml\" : 214\n, \"THORN\" : 222\n, \"Uacute\" : 218\n, \"Ucirc\" : 219\n, \"Ugrave\" : 217\n, \"Uuml\" : 220\n, \"Yacute\" : 221\n, \"aacute\" : 225\n, \"acirc\" : 226\n, \"aelig\" : 230\n, \"agrave\" : 224\n, \"aring\" : 229\n, \"atilde\" : 227\n, \"auml\" : 228\n, \"ccedil\" : 231\n, \"eacute\" : 233\n, \"ecirc\" : 234\n, \"egrave\" : 232\n, \"eth\" : 240\n, \"euml\" : 235\n, \"iacute\" : 237\n, \"icirc\" : 238\n, \"igrave\" : 236\n, \"iuml\" : 239\n, \"ntilde\" : 241\n, \"oacute\" : 243\n, \"ocirc\" : 244\n, \"ograve\" : 242\n, \"oslash\" : 248\n, \"otilde\" : 245\n, \"ouml\" : 246\n, \"szlig\" : 223\n, \"thorn\" : 254\n, \"uacute\" : 250\n, \"ucirc\" : 251\n, \"ugrave\" : 249\n, \"uuml\" : 252\n, \"yacute\" : 253\n, \"yuml\" : 255\n, \"copy\" : 169\n, \"reg\" : 174\n, \"nbsp\" : 160\n, \"iexcl\" : 161\n, \"cent\" : 162\n, \"pound\" : 163\n, \"curren\" : 164\n, \"yen\" : 165\n, \"brvbar\" : 166\n, \"sect\" : 167\n, \"uml\" : 168\n, \"ordf\" : 170\n, \"laquo\" : 171\n, \"not\" : 172\n, \"shy\" : 173\n, \"macr\" : 175\n, \"deg\" : 176\n, \"plusmn\" : 177\n, \"sup1\" : 185\n, \"sup2\" : 178\n, \"sup3\" : 179\n, \"acute\" : 180\n, \"micro\" : 181\n, \"para\" : 182\n, \"middot\" : 183\n, \"cedil\" : 184\n, \"ordm\" : 186\n, \"raquo\" : 187\n, \"frac14\" : 188\n, \"frac12\" : 189\n, \"frac34\" : 190\n, \"iquest\" : 191\n, \"times\" : 215\n, \"divide\" : 247\n, \"OElig\" : 338\n, \"oelig\" : 339\n, \"Scaron\" : 352\n, \"scaron\" : 353\n, \"Yuml\" : 376\n, \"fnof\" : 402\n, \"circ\" : 710\n, \"tilde\" : 732\n, \"Alpha\" : 913\n, \"Beta\" : 914\n, \"Gamma\" : 915\n, \"Delta\" : 916\n, \"Epsilon\" : 917\n, \"Zeta\" : 918\n, \"Eta\" : 919\n, \"Theta\" : 920\n, \"Iota\" : 921\n, \"Kappa\" : 922\n, \"Lambda\" : 923\n, \"Mu\" : 924\n, \"Nu\" : 925\n, \"Xi\" : 926\n, \"Omicron\" : 927\n, \"Pi\" : 928\n, \"Rho\" : 929\n, \"Sigma\" : 931\n, \"Tau\" : 932\n, \"Upsilon\" : 933\n, \"Phi\" : 934\n, \"Chi\" : 935\n, \"Psi\" : 936\n, \"Omega\" : 937\n, \"alpha\" : 945\n, \"beta\" : 946\n, \"gamma\" : 947\n, \"delta\" : 948\n, \"epsilon\" : 949\n, \"zeta\" : 950\n, \"eta\" : 951\n, \"theta\" : 952\n, \"iota\" : 953\n, \"kappa\" : 954\n, \"lambda\" : 955\n, \"mu\" : 956\n, \"nu\" : 957\n, \"xi\" : 958\n, \"omicron\" : 959\n, \"pi\" : 960\n, \"rho\" : 961\n, \"sigmaf\" : 962\n, \"sigma\" : 963\n, \"tau\" : 964\n, \"upsilon\" : 965\n, \"phi\" : 966\n, \"chi\" : 967\n, \"psi\" : 968\n, \"omega\" : 969\n, \"thetasym\" : 977\n, \"upsih\" : 978\n, \"piv\" : 982\n, \"ensp\" : 8194\n, \"emsp\" : 8195\n, \"thinsp\" : 8201\n, \"zwnj\" : 8204\n, \"zwj\" : 8205\n, \"lrm\" : 8206\n, \"rlm\" : 8207\n, \"ndash\" : 8211\n, \"mdash\" : 8212\n, \"lsquo\" : 8216\n, \"rsquo\" : 8217\n, \"sbquo\" : 8218\n, \"ldquo\" : 8220\n, \"rdquo\" : 8221\n, \"bdquo\" : 8222\n, \"dagger\" : 8224\n, \"Dagger\" : 8225\n, \"bull\" : 8226\n, \"hellip\" : 8230\n, \"permil\" : 8240\n, \"prime\" : 8242\n, \"Prime\" : 8243\n, \"lsaquo\" : 8249\n, \"rsaquo\" : 8250\n, \"oline\" : 8254\n, \"frasl\" : 8260\n, \"euro\" : 8364\n, \"image\" : 8465\n, \"weierp\" : 8472\n, \"real\" : 8476\n, \"trade\" : 8482\n, \"alefsym\" : 8501\n, \"larr\" : 8592\n, \"uarr\" : 8593\n, \"rarr\" : 8594\n, \"darr\" : 8595\n, \"harr\" : 8596\n, \"crarr\" : 8629\n, \"lArr\" : 8656\n, \"uArr\" : 8657\n, \"rArr\" : 8658\n, \"dArr\" : 8659\n, \"hArr\" : 8660\n, \"forall\" : 8704\n, \"part\" : 8706\n, \"exist\" : 8707\n, \"empty\" : 8709\n, \"nabla\" : 8711\n, \"isin\" : 8712\n, \"notin\" : 8713\n, \"ni\" : 8715\n, \"prod\" : 8719\n, \"sum\" : 8721\n, \"minus\" : 8722\n, \"lowast\" : 8727\n, \"radic\" : 8730\n, \"prop\" : 8733\n, \"infin\" : 8734\n, \"ang\" : 8736\n, \"and\" : 8743\n, \"or\" : 8744\n, \"cap\" : 8745\n, \"cup\" : 8746\n, \"int\" : 8747\n, \"there4\" : 8756\n, \"sim\" : 8764\n, \"cong\" : 8773\n, \"asymp\" : 8776\n, \"ne\" : 8800\n, \"equiv\" : 8801\n, \"le\" : 8804\n, \"ge\" : 8805\n, \"sub\" : 8834\n, \"sup\" : 8835\n, \"nsub\" : 8836\n, \"sube\" : 8838\n, \"supe\" : 8839\n, \"oplus\" : 8853\n, \"otimes\" : 8855\n, \"perp\" : 8869\n, \"sdot\" : 8901\n, \"lceil\" : 8968\n, \"rceil\" : 8969\n, \"lfloor\" : 8970\n, \"rfloor\" : 8971\n, \"lang\" : 9001\n, \"rang\" : 9002\n, \"loz\" : 9674\n, \"spades\" : 9824\n, \"clubs\" : 9827\n, \"hearts\" : 9829\n, \"diams\" : 9830\n}\n\nObject.keys(sax.ENTITIES).forEach(function (key) {\n var e = sax.ENTITIES[key]\n var s = typeof e === 'number' ? String.fromCharCode(e) : e\n sax.ENTITIES[key] = s\n})\n\nfor (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S\n\n// shorthand\nS = sax.STATE\n\nfunction emit (parser, event, data) {\n parser[event] && parser[event](data)\n}\n\nfunction emitNode (parser, nodeType, data) {\n if (parser.textNode) closeText(parser)\n emit(parser, nodeType, data)\n}\n\nfunction closeText (parser) {\n parser.textNode = textopts(parser.opt, parser.textNode)\n if (parser.textNode) emit(parser, \"ontext\", parser.textNode)\n parser.textNode = \"\"\n}\n\nfunction textopts (opt, text) {\n if (opt.trim) text = text.trim()\n if (opt.normalize) text = text.replace(//s+/g, \" \")\n return text\n}\n\nfunction error (parser, er) {\n closeText(parser)\n if (parser.trackPosition) {\n er += \"/nLine: \"+parser.line+\n \"/nColumn: \"+parser.column+\n \"/nChar: \"+parser.c\n }\n er = new Error(er)\n parser.error = er\n emit(parser, \"onerror\", er)\n return parser\n}\n\nfunction end (parser) {\n if (!parser.closedRoot) strictFail(parser, \"Unclosed root tag\")\n if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, \"Unexpected end\")\n closeText(parser)\n parser.c = \"\"\n parser.closed = true\n emit(parser, \"onend\")\n SAXParser.call(parser, parser.strict, parser.opt)\n return parser\n}\n\nfunction strictFail (parser, message) {\n if (typeof parser !== 'object' || !(parser instanceof SAXParser))\n throw new Error('bad call to strictFail');\n if (parser.strict) error(parser, message)\n}\n\nfunction newTag (parser) {\n if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()\n var parent = parser.tags[parser.tags.length - 1] || parser\n , tag = parser.tag = { name : parser.tagName, attributes : {} }\n\n // will be overridden if tag contails an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (parser.opt.xmlns) tag.ns = parent.ns\n parser.attribList.length = 0\n}\n\nfunction qname (name, attribute) {\n var i = name.indexOf(\":\")\n , qualName = i < 0 ? [ \"\", name ] : name.split(\":\")\n , prefix = qualName[0]\n , local = qualName[1]\n\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === \"xmlns\") {\n prefix = \"xmlns\"\n local = \"\"\n }\n\n return { prefix: prefix, local: local }\n}\n\nfunction attrib (parser) {\n if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()\n\n if (parser.attribList.indexOf(parser.attribName) !== -1 ||\n parser.tag.attributes.hasOwnProperty(parser.attribName)) {\n return parser.attribName = parser.attribValue = \"\"\n }\n\n if (parser.opt.xmlns) {\n var qn = qname(parser.attribName, true)\n , prefix = qn.prefix\n , local = qn.local\n\n if (prefix === \"xmlns\") {\n // namespace binding attribute; push the binding into scope\n if (local === \"xml\" && parser.attribValue !== XML_NAMESPACE) {\n strictFail( parser\n , \"xml: prefix must be bound to \" + XML_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else if (local === \"xmlns\" && parser.attribValue !== XMLNS_NAMESPACE) {\n strictFail( parser\n , \"xmlns: prefix must be bound to \" + XMLNS_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else {\n var tag = parser.tag\n , parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns)\n }\n tag.ns[local] = parser.attribValue\n }\n }\n\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect; preserve attribute order\n // so deferred events can be emitted in document order\n parser.attribList.push([parser.attribName, parser.attribValue])\n } else {\n // in non-xmlns mode, we can emit the event right away\n parser.tag.attributes[parser.attribName] = parser.attribValue\n emitNode( parser\n , \"onattribute\"\n , { name: parser.attribName\n , value: parser.attribValue } )\n }\n\n parser.attribName = parser.attribValue = \"\"\n}\n\nfunction openTag (parser, selfClosing) {\n if (parser.opt.xmlns) {\n // emit namespace binding events\n var tag = parser.tag\n\n // add namespace info to tag\n var qn = qname(parser.tagName)\n tag.prefix = qn.prefix\n tag.local = qn.local\n tag.uri = tag.ns[qn.prefix] || \"\"\n\n if (tag.prefix && !tag.uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(parser.tagName))\n tag.uri = qn.prefix\n }\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns && parent.ns !== tag.ns) {\n Object.keys(tag.ns).forEach(function (p) {\n emitNode( parser\n , \"onopennamespace\"\n , { prefix: p , uri: tag.ns[p] } )\n })\n }\n\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (var i = 0, l = parser.attribList.length; i < l; i ++) {\n var nv = parser.attribList[i]\n var name = nv[0]\n , value = nv[1]\n , qualName = qname(name, true)\n , prefix = qualName.prefix\n , local = qualName.local\n , uri = prefix == \"\" ? \"\" : (tag.ns[prefix] || \"\")\n , a = { name: name\n , value: value\n , prefix: prefix\n , local: local\n , uri: uri\n }\n\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix != \"xmlns\" && !uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(prefix))\n a.uri = prefix\n }\n parser.tag.attributes[name] = a\n emitNode(parser, \"onattribute\", a)\n }\n parser.attribList.length = 0\n }\n\n parser.tag.isSelfClosing = !!selfClosing\n\n // process the tag\n parser.sawRoot = true\n parser.tags.push(parser.tag)\n emitNode(parser, \"onopentag\", parser.tag)\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!parser.noscript && parser.tagName.toLowerCase() === \"script\") {\n parser.state = S.SCRIPT\n } else {\n parser.state = S.TEXT\n }\n parser.tag = null\n parser.tagName = \"\"\n }\n parser.attribName = parser.attribValue = \"\"\n parser.attribList.length = 0\n}\n\nfunction closeTag (parser) {\n if (!parser.tagName) {\n strictFail(parser, \"Weird empty close tag.\")\n parser.textNode += \"</>\"\n parser.state = S.TEXT\n return\n }\n\n if (parser.script) {\n if (parser.tagName !== \"script\") {\n parser.script += \"</\" + parser.tagName + \">\"\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n return\n }\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n var t = parser.tags.length\n var tagName = parser.tagName\n if (!parser.strict) tagName = tagName[parser.looseCase]()\n var closeTo = tagName\n while (t --) {\n var close = parser.tags[t]\n if (close.name !== closeTo) {\n // fail the first time in strict mode\n strictFail(parser, \"Unexpected close tag\")\n } else break\n }\n\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n strictFail(parser, \"Unmatched closing tag: \"+parser.tagName)\n parser.textNode += \"</\" + parser.tagName + \">\"\n parser.state = S.TEXT\n return\n }\n parser.tagName = tagName\n var s = parser.tags.length\n while (s --> t) {\n var tag = parser.tag = parser.tags.pop()\n parser.tagName = parser.tag.name\n emitNode(parser, \"onclosetag\", parser.tagName)\n\n var x = {}\n for (var i in tag.ns) x[i] = tag.ns[i]\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (parser.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n Object.keys(tag.ns).forEach(function (p) {\n var n = tag.ns[p]\n emitNode(parser, \"onclosenamespace\", { prefix: p, uri: n })\n })\n }\n }\n if (t === 0) parser.closedRoot = true\n parser.tagName = parser.attribValue = parser.attribName = \"\"\n parser.attribList.length = 0\n parser.state = S.TEXT\n}\n\nfunction parseEntity (parser) {\n var entity = parser.entity\n , entityLC = entity.toLowerCase()\n , num\n , numStr = \"\"\n if (parser.ENTITIES[entity])\n return parser.ENTITIES[entity]\n if (parser.ENTITIES[entityLC])\n return parser.ENTITIES[entityLC]\n entity = entityLC\n if (entity.charAt(0) === \"#\") {\n if (entity.charAt(1) === \"x\") {\n entity = entity.slice(2)\n num = parseInt(entity, 16)\n numStr = num.toString(16)\n } else {\n entity = entity.slice(1)\n num = parseInt(entity, 10)\n numStr = num.toString(10)\n }\n }\n entity = entity.replace(/^0+/, \"\")\n if (numStr.toLowerCase() !== entity) {\n strictFail(parser, \"Invalid character entity\")\n return \"&\"+parser.entity + \";\"\n }\n\n return String.fromCodePoint(num)\n}\n\nfunction write (chunk) {\n var parser = this\n if (this.error) throw this.error\n if (parser.closed) return error(parser,\n \"Cannot write after close. Assign an onready handler.\")\n if (chunk === null) return end(parser)\n var i = 0, c = \"\"\n while (parser.c = c = chunk.charAt(i++)) {\n if (parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n switch (parser.state) {\n\n case S.BEGIN:\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else if (not(whitespace,c)) {\n // have to process this as a text node.\n // weird, but happens.\n strictFail(parser, \"Non-whitespace before first tag.\")\n parser.textNode = c\n parser.state = S.TEXT\n }\n continue\n\n case S.TEXT:\n if (parser.sawRoot && !parser.closedRoot) {\n var starti = i-1\n while (c && c!==\"<\" && c!==\"&\") {\n c = chunk.charAt(i++)\n if (c && parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n }\n parser.textNode += chunk.substring(starti, i-1)\n }\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else {\n if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))\n strictFail(parser, \"Text data outside of root node.\")\n if (c === \"&\") parser.state = S.TEXT_ENTITY\n else parser.textNode += c\n }\n continue\n\n case S.SCRIPT:\n // only non-strict\n if (c === \"<\") {\n parser.state = S.SCRIPT_ENDING\n } else parser.script += c\n continue\n\n case S.SCRIPT_ENDING:\n if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n } else {\n parser.script += \"<\" + c\n parser.state = S.SCRIPT\n }\n continue\n\n case S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === \"!\") {\n parser.state = S.SGML_DECL\n parser.sgmlDecl = \"\"\n } else if (is(whitespace, c)) {\n // wait for it...\n } else if (is(nameStart,c)) {\n parser.state = S.OPEN_TAG\n parser.tagName = c\n } else if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n parser.tagName = \"\"\n } else if (c === \"?\") {\n parser.state = S.PROC_INST\n parser.procInstName = parser.procInstBody = \"\"\n } else {\n strictFail(parser, \"Unencoded <\")\n // if there was some whitespace, then add that in.\n if (parser.startTagPosition + 1 < parser.position) {\n var pad = parser.position - parser.startTagPosition\n c = new Array(pad).join(\" \") + c\n }\n parser.textNode += \"<\" + c\n parser.state = S.TEXT\n }\n continue\n\n case S.SGML_DECL:\n if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {\n emitNode(parser, \"onopencdata\")\n parser.state = S.CDATA\n parser.sgmlDecl = \"\"\n parser.cdata = \"\"\n } else if (parser.sgmlDecl+c === \"--\") {\n parser.state = S.COMMENT\n parser.comment = \"\"\n parser.sgmlDecl = \"\"\n } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {\n parser.state = S.DOCTYPE\n if (parser.doctype || parser.sawRoot) strictFail(parser,\n \"Inappropriately located doctype declaration\")\n parser.doctype = \"\"\n parser.sgmlDecl = \"\"\n } else if (c === \">\") {\n emitNode(parser, \"onsgmldeclaration\", parser.sgmlDecl)\n parser.sgmlDecl = \"\"\n parser.state = S.TEXT\n } else if (is(quote, c)) {\n parser.state = S.SGML_DECL_QUOTED\n parser.sgmlDecl += c\n } else parser.sgmlDecl += c\n continue\n\n case S.SGML_DECL_QUOTED:\n if (c === parser.q) {\n parser.state = S.SGML_DECL\n parser.q = \"\"\n }\n parser.sgmlDecl += c\n continue\n\n case S.DOCTYPE:\n if (c === \">\") {\n parser.state = S.TEXT\n emitNode(parser, \"ondoctype\", parser.doctype)\n parser.doctype = true // just remember that we saw it.\n } else {\n parser.doctype += c\n if (c === \"[\") parser.state = S.DOCTYPE_DTD\n else if (is(quote, c)) {\n parser.state = S.DOCTYPE_QUOTED\n parser.q = c\n }\n }\n continue\n\n case S.DOCTYPE_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.q = \"\"\n parser.state = S.DOCTYPE\n }\n continue\n\n case S.DOCTYPE_DTD:\n parser.doctype += c\n if (c === \"]\") parser.state = S.DOCTYPE\n else if (is(quote,c)) {\n parser.state = S.DOCTYPE_DTD_QUOTED\n parser.q = c\n }\n continue\n\n case S.DOCTYPE_DTD_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.state = S.DOCTYPE_DTD\n parser.q = \"\"\n }\n continue\n\n case S.COMMENT:\n if (c === \"-\") parser.state = S.COMMENT_ENDING\n else parser.comment += c\n continue\n\n case S.COMMENT_ENDING:\n if (c === \"-\") {\n parser.state = S.COMMENT_ENDED\n parser.comment = textopts(parser.opt, parser.comment)\n if (parser.comment) emitNode(parser, \"oncomment\", parser.comment)\n parser.comment = \"\"\n } else {\n parser.comment += \"-\" + c\n parser.state = S.COMMENT\n }\n continue\n\n case S.COMMENT_ENDED:\n if (c !== \">\") {\n strictFail(parser, \"Malformed comment\")\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n parser.comment += \"--\" + c\n parser.state = S.COMMENT\n } else parser.state = S.TEXT\n continue\n\n case S.CDATA:\n if (c === \"]\") parser.state = S.CDATA_ENDING\n else parser.cdata += c\n continue\n\n case S.CDATA_ENDING:\n if (c === \"]\") parser.state = S.CDATA_ENDING_2\n else {\n parser.cdata += \"]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.CDATA_ENDING_2:\n if (c === \">\") {\n if (parser.cdata) emitNode(parser, \"oncdata\", parser.cdata)\n emitNode(parser, \"onclosecdata\")\n parser.cdata = \"\"\n parser.state = S.TEXT\n } else if (c === \"]\") {\n parser.cdata += \"]\"\n } else {\n parser.cdata += \"]]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.PROC_INST:\n if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY\n else parser.procInstName += c\n continue\n\n case S.PROC_INST_BODY:\n if (!parser.procInstBody && is(whitespace, c)) continue\n else if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else parser.procInstBody += c\n continue\n\n case S.PROC_INST_ENDING:\n if (c === \">\") {\n emitNode(parser, \"onprocessinginstruction\", {\n name : parser.procInstName,\n body : parser.procInstBody\n })\n parser.procInstName = parser.procInstBody = \"\"\n parser.state = S.TEXT\n } else {\n parser.procInstBody += \"?\" + c\n parser.state = S.PROC_INST_BODY\n }\n continue\n\n case S.OPEN_TAG:\n if (is(nameBody, c)) parser.tagName += c\n else {\n newTag(parser)\n if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else {\n if (not(whitespace, c)) strictFail(\n parser, \"Invalid character in tag name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.OPEN_TAG_SLASH:\n if (c === \">\") {\n openTag(parser, true)\n closeTag(parser)\n } else {\n strictFail(parser, \"Forward-slash in opening tag not followed by >\")\n parser.state = S.ATTRIB\n }\n continue\n\n case S.ATTRIB:\n // haven't read the attribute name yet.\n if (is(whitespace, c)) continue\n else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (c === \">\") {\n strictFail(parser, \"Attribute without value\")\n parser.attribValue = parser.attribName\n attrib(parser)\n openTag(parser)\n }\n else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE\n else if (is(nameBody, c)) parser.attribName += c\n else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME_SAW_WHITE:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (is(whitespace, c)) continue\n else {\n strictFail(parser, \"Attribute without value\")\n parser.tag.attributes[parser.attribName] = \"\"\n parser.attribValue = \"\"\n emitNode(parser, \"onattribute\",\n { name : parser.attribName, value : \"\" })\n parser.attribName = \"\"\n if (c === \">\") openTag(parser)\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.state = S.ATTRIB_NAME\n } else {\n strictFail(parser, \"Invalid attribute name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.ATTRIB_VALUE:\n if (is(whitespace, c)) continue\n else if (is(quote, c)) {\n parser.q = c\n parser.state = S.ATTRIB_VALUE_QUOTED\n } else {\n strictFail(parser, \"Unquoted attribute value\")\n parser.state = S.ATTRIB_VALUE_UNQUOTED\n parser.attribValue = c\n }\n continue\n\n case S.ATTRIB_VALUE_QUOTED:\n if (c !== parser.q) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_Q\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n parser.q = \"\"\n parser.state = S.ATTRIB_VALUE_CLOSED\n continue\n\n case S.ATTRIB_VALUE_CLOSED:\n if (is(whitespace, c)) {\n parser.state = S.ATTRIB\n } else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n strictFail(parser, \"No whitespace between attributes\")\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_VALUE_UNQUOTED:\n if (not(attribEnd,c)) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_U\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n if (c === \">\") openTag(parser)\n else parser.state = S.ATTRIB\n continue\n\n case S.CLOSE_TAG:\n if (!parser.tagName) {\n if (is(whitespace, c)) continue\n else if (not(nameStart, c)) {\n if (parser.script) {\n parser.script += \"</\" + c\n parser.state = S.SCRIPT\n } else {\n strictFail(parser, \"Invalid tagname in closing tag.\")\n }\n } else parser.tagName = c\n }\n else if (c === \">\") closeTag(parser)\n else if (is(nameBody, c)) parser.tagName += c\n else if (parser.script) {\n parser.script += \"</\" + parser.tagName\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n } else {\n if (not(whitespace, c)) strictFail(parser,\n \"Invalid tagname in closing tag\")\n parser.state = S.CLOSE_TAG_SAW_WHITE\n }\n continue\n\n case S.CLOSE_TAG_SAW_WHITE:\n if (is(whitespace, c)) continue\n if (c === \">\") closeTag(parser)\n else strictFail(parser, \"Invalid characters in closing tag\")\n continue\n\n case S.TEXT_ENTITY:\n case S.ATTRIB_VALUE_ENTITY_Q:\n case S.ATTRIB_VALUE_ENTITY_U:\n switch(parser.state) {\n case S.TEXT_ENTITY:\n var returnState = S.TEXT, buffer = \"textNode\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_Q:\n var returnState = S.ATTRIB_VALUE_QUOTED, buffer = \"attribValue\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_U:\n var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = \"attribValue\"\n break\n }\n if (c === \";\") {\n parser[buffer] += parseEntity(parser)\n parser.entity = \"\"\n parser.state = returnState\n }\n else if (is(entity, c)) parser.entity += c\n else {\n strictFail(parser, \"Invalid character entity\")\n parser[buffer] += \"&\" + parser.entity + c\n parser.entity = \"\"\n parser.state = returnState\n }\n continue\n\n default:\n throw new Error(parser, \"Unknown state: \" + parser.state)\n }\n } // while\n // cdata blocks can get very big under normal conditions. emit and move on.\n // if (parser.state === S.CDATA && parser.cdata) {\n // emitNode(parser, \"oncdata\", parser.cdata)\n // parser.cdata = \"\"\n // }\n if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)\n return parser\n}\n\n/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n (function() {\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n if (Object.defineProperty) {\n Object.defineProperty(String, 'fromCodePoint', {\n 'value': fromCodePoint,\n 'configurable': true,\n 'writable': true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n }());\n}\n\n})(typeof exports === \"undefined\" ? sax = {} : exports);\n","/**\n * Tiny stack for browser or server\n *\n * @author Jason Mulligan <jason.mulligan@avoidwork.com>\n * @copyright 2014 Jason Mulligan\n * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>\n * @link http://avoidwork.github.io/tiny-stack\n * @module tiny-stack\n * @version 0.1.0\n */\n\n( function ( global ) {\n\n\"use strict\";\n\n/**\n * TinyStack\n *\n * @constructor\n */\nfunction TinyStack () {\n\tthis.data = [null];\n\tthis.top = 0;\n}\n\n/**\n * Clears the stack\n *\n * @method clear\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.clear = function clear () {\n\tthis.data = [null];\n\tthis.top = 0;\n\n\treturn this;\n};\n\n/**\n * Gets the size of the stack\n *\n * @method length\n * @memberOf TinyStack\n * @return {Number} Size of stack\n */\nTinyStack.prototype.length = function length () {\n\treturn this.top;\n};\n\n/**\n * Gets the item at the top of the stack\n *\n * @method peek\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.peek = function peek () {\n\treturn this.data[this.top];\n};\n\n/**\n * Gets & removes the item at the top of the stack\n *\n * @method pop\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.pop = function pop () {\n\tif ( this.top > 0 ) {\n\t\tthis.top--;\n\n\t\treturn this.data.pop();\n\t}\n\telse {\n\t\treturn undefined;\n\t}\n};\n\n/**\n * Pushes an item onto the stack\n *\n * @method push\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.push = function push ( arg ) {\n\tthis.data[++this.top] = arg;\n\n\treturn this;\n};\n\n/**\n * TinyStack factory\n *\n * @method factory\n * @return {Object} {@link TinyStack}\n */\nfunction factory () {\n\treturn new TinyStack();\n}\n\n// Node, AMD & window supported\nif ( typeof exports != \"undefined\" ) {\n\tmodule.exports = factory;\n}\nelse if ( typeof define == \"function\" ) {\n\tdefine( function () {\n\t\treturn factory;\n\t} );\n}\nelse {\n\tglobal.stack = factory;\n}\n} )( this );\n","module.exports = require(27);","'use strict';\n\nfunction Base() { }\n\nBase.prototype.get = function(name) {\n return this.$model.properties.get(this, name);\n};\n\nBase.prototype.set = function(name, value) {\n this.$model.properties.set(this, name, value);\n};\n\n\nmodule.exports = Base;","'use strict';\n\nvar pick = require(180),\n assign = require(175),\n forEach = require(84);\n\nvar parseNameNs = require(28).parseName;\n\n\nfunction DescriptorBuilder(nameNs) {\n this.ns = nameNs;\n this.name = nameNs.name;\n this.allTypes = [];\n this.properties = [];\n this.propertiesByName = {};\n}\n\nmodule.exports = DescriptorBuilder;\n\n\nDescriptorBuilder.prototype.build = function() {\n return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);\n};\n\nDescriptorBuilder.prototype.addProperty = function(p, idx) {\n this.addNamedProperty(p, true);\n\n var properties = this.properties;\n\n if (idx !== undefined) {\n properties.splice(idx, 0, p);\n } else {\n properties.push(p);\n }\n};\n\n\nDescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {\n var oldNameNs = oldProperty.ns;\n\n var props = this.properties,\n propertiesByName = this.propertiesByName,\n rename = oldProperty.name !== newProperty.name;\n\n if (oldProperty.isBody) {\n\n if (!newProperty.isBody) {\n throw new Error(\n 'property <' + newProperty.ns.name + '> must be body property ' +\n 'to refine <' + oldProperty.ns.name + '>');\n }\n\n // TODO: Check compatibility\n this.setBodyProperty(newProperty, false);\n }\n\n // replacing the named property is intentional\n // thus, validate only if this is a \"rename\" operation\n this.addNamedProperty(newProperty, rename);\n\n // replace old property at index with new one\n var idx = props.indexOf(oldProperty);\n if (idx === -1) {\n throw new Error('property <' + oldNameNs.name + '> not found in property list');\n }\n\n props[idx] = newProperty;\n\n // replace propertiesByName entry with new property\n propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;\n};\n\n\nDescriptorBuilder.prototype.redefineProperty = function(p) {\n\n var nsPrefix = p.ns.prefix;\n var parts = p.redefines.split('#');\n\n var name = parseNameNs(parts[0], nsPrefix);\n var attrName = parseNameNs(parts[1], name.prefix).name;\n\n var redefinedProperty = this.propertiesByName[attrName];\n if (!redefinedProperty) {\n throw new Error('refined property <' + attrName + '> not found');\n } else {\n this.replaceProperty(redefinedProperty, p);\n }\n\n delete p.redefines;\n};\n\nDescriptorBuilder.prototype.addNamedProperty = function(p, validate) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n if (validate) {\n this.assertNotDefined(p, ns.name);\n this.assertNotDefined(p, ns.localName);\n }\n\n propsByName[ns.name] = propsByName[ns.localName] = p;\n};\n\nDescriptorBuilder.prototype.removeNamedProperty = function(p) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n delete propsByName[ns.name];\n delete propsByName[ns.localName];\n};\n\nDescriptorBuilder.prototype.setBodyProperty = function(p, validate) {\n\n if (validate && this.bodyProperty) {\n throw new Error(\n 'body property defined multiple times ' +\n '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');\n }\n\n this.bodyProperty = p;\n};\n\nDescriptorBuilder.prototype.addIdProperty = function(name) {\n var nameNs = parseNameNs(name, this.ns.prefix);\n\n var p = {\n name: nameNs.localName,\n type: 'String',\n isAttr: true,\n ns: nameNs\n };\n\n // ensure that id is always the first attribute (if present)\n this.addProperty(p, 0);\n};\n\nDescriptorBuilder.prototype.assertNotDefined = function(p, name) {\n var propertyName = p.name,\n definedProperty = this.propertiesByName[propertyName];\n\n if (definedProperty) {\n throw new Error(\n 'property <' + propertyName + '> already defined; ' +\n 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +\n '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');\n }\n};\n\nDescriptorBuilder.prototype.hasProperty = function(name) {\n return this.propertiesByName[name];\n};\n\nDescriptorBuilder.prototype.addTrait = function(t) {\n\n var allTypes = this.allTypes;\n\n if (allTypes.indexOf(t) !== -1) {\n return;\n }\n\n forEach(t.properties, function(p) {\n\n // clone property to allow extensions\n p = assign({}, p, {\n name: p.ns.localName\n });\n\n Object.defineProperty(p, 'definedBy', {\n value: t\n });\n\n // add redefine support\n if (p.redefines) {\n this.redefineProperty(p);\n } else {\n if (p.isBody) {\n this.setBodyProperty(p);\n }\n this.addProperty(p);\n }\n }, this);\n\n allTypes.push(t);\n};\n","'use strict';\n\nvar forEach = require(84);\n\nvar Base = require(24);\n\n\nfunction Factory(model, properties) {\n this.model = model;\n this.properties = properties;\n}\n\nmodule.exports = Factory;\n\n\nFactory.prototype.createType = function(descriptor) {\n\n var model = this.model;\n\n var props = this.properties,\n prototype = Object.create(Base.prototype);\n\n // initialize default values\n forEach(descriptor.properties, function(p) {\n if (!p.isMany && p.default !== undefined) {\n prototype[p.name] = p.default;\n }\n });\n\n props.defineModel(prototype, model);\n props.defineDescriptor(prototype, descriptor);\n\n var name = descriptor.ns.name;\n\n /**\n * The new type constructor\n */\n function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, function(val, key) {\n this.set(key, val);\n }, this);\n }\n\n ModdleElement.prototype = prototype;\n\n ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;\n\n // static links\n props.defineModel(ModdleElement, model);\n props.defineDescriptor(ModdleElement, descriptor);\n\n return ModdleElement;\n};","'use strict';\n\nvar isString = require(172),\n isObject = require(170),\n forEach = require(84),\n find = require(83);\n\n\nvar Factory = require(26),\n Registry = require(30),\n Properties = require(29);\n\nvar parseNameNs = require(28).parseName;\n\n\n//// Moddle implementation /////////////////////////////////////////////////\n\n/**\n * @class Moddle\n *\n * A model that can be used to create elements of a specific type.\n *\n * @example\n *\n * var Moddle = require('moddle');\n *\n * var pkg = {\n * name: 'mypackage',\n * prefix: 'my',\n * types: [\n * { name: 'Root' }\n * ]\n * };\n *\n * var moddle = new Moddle([pkg]);\n *\n * @param {Array<Package>} packages the packages to contain\n * @param {Object} options additional options to pass to the model\n */\nfunction Moddle(packages, options) {\n\n options = options || {};\n\n this.properties = new Properties(this);\n\n this.factory = new Factory(this, this.properties);\n this.registry = new Registry(packages, this.properties, options);\n\n this.typeCache = {};\n}\n\nmodule.exports = Moddle;\n\n\n/**\n * Create an instance of the specified type.\n *\n * @method Moddle#create\n *\n * @example\n *\n * var foo = moddle.create('my:Foo');\n * var bar = moddle.create('my:Bar', { id: 'BAR_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @param {Object} attrs a number of attributes to initialize the model instance with\n * @return {Object} model instance\n */\nModdle.prototype.create = function(descriptor, attrs) {\n var Type = this.getType(descriptor);\n\n if (!Type) {\n throw new Error('unknown type <' + descriptor + '>');\n }\n\n return new Type(attrs);\n};\n\n\n/**\n * Returns the type representing a given descriptor\n *\n * @method Moddle#getType\n *\n * @example\n *\n * var Foo = moddle.getType('my:Foo');\n * var foo = new Foo({ 'id' : 'FOO_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @return {Object} the type representing the descriptor\n */\nModdle.prototype.getType = function(descriptor) {\n\n var cache = this.typeCache;\n\n var name = isString(descriptor) ? descriptor : descriptor.ns.name;\n\n var type = cache[name];\n\n if (!type) {\n descriptor = this.registry.getEffectiveDescriptor(name);\n type = cache[name] = this.factory.createType(descriptor);\n }\n\n return type;\n};\n\n\n/**\n * Creates an any-element type to be used within model instances.\n *\n * This can be used to create custom elements that lie outside the meta-model.\n * The created element contains all the meta-data required to serialize it\n * as part of meta-model elements.\n *\n * @method Moddle#createAny\n *\n * @example\n *\n * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {\n * value: 'bar'\n * });\n *\n * var container = moddle.create('my:Container', 'http://my', {\n * any: [ foo ]\n * });\n *\n * // go ahead and serialize the stuff\n *\n *\n * @param {String} name the name of the element\n * @param {String} nsUri the namespace uri of the element\n * @param {Object} [properties] a map of properties to initialize the instance with\n * @return {Object} the any type instance\n */\nModdle.prototype.createAny = function(name, nsUri, properties) {\n\n var nameNs = parseNameNs(name);\n\n var element = {\n $type: name\n };\n\n var descriptor = {\n name: name,\n isGeneric: true,\n ns: {\n prefix: nameNs.prefix,\n localName: nameNs.localName,\n uri: nsUri\n }\n };\n\n this.properties.defineDescriptor(element, descriptor);\n this.properties.defineModel(element, this);\n this.properties.define(element, '$parent', { enumerable: false, writable: true });\n\n forEach(properties, function(a, key) {\n if (isObject(a) && a.value !== undefined) {\n element[a.name] = a.value;\n } else {\n element[key] = a;\n }\n });\n\n return element;\n};\n\n/**\n * Returns a registered package by uri or prefix\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackage = function(uriOrPrefix) {\n return this.registry.getPackage(uriOrPrefix);\n};\n\n/**\n * Returns a snapshot of all known packages\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackages = function() {\n return this.registry.getPackages();\n};\n\n/**\n * Returns the descriptor for an element\n */\nModdle.prototype.getElementDescriptor = function(element) {\n return element.$descriptor;\n};\n\n/**\n * Returns true if the given descriptor or instance\n * represents the given type.\n *\n * May be applied to this, if element is omitted.\n */\nModdle.prototype.hasType = function(element, type) {\n if (type === undefined) {\n type = element;\n element = this;\n }\n\n var descriptor = element.$model.getElementDescriptor(element);\n\n return !!find(descriptor.allTypes, function(t) {\n return t.name === type;\n });\n};\n\n\n/**\n * Returns the descriptor of an elements named property\n */\nModdle.prototype.getPropertyDescriptor = function(element, property) {\n return this.getElementDescriptor(element).propertiesByName[property];\n};\n","'use strict';\n\n/**\n * Parses a namespaced attribute name of the form (ns:)localName to an object,\n * given a default prefix to assume in case no explicit namespace is given.\n *\n * @param {String} name\n * @param {String} [defaultPrefix] the default prefix to take, if none is present.\n *\n * @return {Object} the parsed name\n */\nmodule.exports.parseName = function(name, defaultPrefix) {\n var parts = name.split(/:/),\n localName, prefix;\n\n // no prefix (i.e. only local name)\n if (parts.length === 1) {\n localName = name;\n prefix = defaultPrefix;\n } else\n // prefix + local name\n if (parts.length === 2) {\n localName = parts[1];\n prefix = parts[0];\n } else {\n throw new Error('expected <prefix:localName> or <localName>, got ' + name);\n }\n\n name = (prefix ? prefix + ':' : '') + localName;\n\n return {\n name: name,\n prefix: prefix,\n localName: localName\n };\n};","'use strict';\n\n\n/**\n * A utility that gets and sets properties of model elements.\n *\n * @param {Model} model\n */\nfunction Properties(model) {\n this.model = model;\n}\n\nmodule.exports = Properties;\n\n\n/**\n * Sets a named property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} value\n */\nProperties.prototype.set = function(target, name, value) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n target.$attrs[name] = value;\n } else {\n Object.defineProperty(target, property.name, {\n enumerable: !property.isReference,\n writable: true,\n value: value\n });\n }\n};\n\n/**\n * Returns the named property of the given element\n *\n * @param {Object} target\n * @param {String} name\n *\n * @return {Object}\n */\nProperties.prototype.get = function(target, name) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n return target.$attrs[name];\n }\n\n var propertyName = property.name;\n\n // check if access to collection property and lazily initialize it\n if (!target[propertyName] && property.isMany) {\n Object.defineProperty(target, propertyName, {\n enumerable: !property.isReference,\n writable: true,\n value: []\n });\n }\n\n return target[propertyName];\n};\n\n\n/**\n * Define a property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} options\n */\nProperties.prototype.define = function(target, name, options) {\n Object.defineProperty(target, name, options);\n};\n\n\n/**\n * Define the descriptor for an element\n */\nProperties.prototype.defineDescriptor = function(target, descriptor) {\n this.define(target, '$descriptor', { value: descriptor });\n};\n\n/**\n * Define the model for an element\n */\nProperties.prototype.defineModel = function(target, model) {\n this.define(target, '$model', { value: model });\n};","'use strict';\n\nvar assign = require(175),\n forEach = require(84);\n\nvar Types = require(31),\n DescriptorBuilder = require(25);\n\nvar parseNameNs = require(28).parseName,\n isBuiltInType = Types.isBuiltIn;\n\n\nfunction Registry(packages, properties, options) {\n this.options = assign({ generateId: 'id' }, options || {});\n\n this.packageMap = {};\n this.typeMap = {};\n\n this.packages = [];\n\n this.properties = properties;\n\n forEach(packages, this.registerPackage, this);\n}\n\nmodule.exports = Registry;\n\n\nRegistry.prototype.getPackage = function(uriOrPrefix) {\n return this.packageMap[uriOrPrefix];\n};\n\nRegistry.prototype.getPackages = function() {\n return this.packages;\n};\n\n\nRegistry.prototype.registerPackage = function(pkg) {\n\n // copy package\n pkg = assign({}, pkg);\n\n // register types\n forEach(pkg.types, function(descriptor) {\n this.registerType(descriptor, pkg);\n }, this);\n\n this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;\n this.packages.push(pkg);\n};\n\n\n/**\n * Register a type from a specific package with us\n */\nRegistry.prototype.registerType = function(type, pkg) {\n\n type = assign({}, type, {\n superClass: (type.superClass || []).slice(),\n extends: (type.extends || []).slice(),\n properties: (type.properties || []).slice()\n });\n\n var ns = parseNameNs(type.name, pkg.prefix),\n name = ns.name,\n propertiesByName = {};\n\n // parse properties\n forEach(type.properties, function(p) {\n\n // namespace property names\n var propertyNs = parseNameNs(p.name, ns.prefix),\n propertyName = propertyNs.name;\n\n // namespace property types\n if (!isBuiltInType(p.type)) {\n p.type = parseNameNs(p.type, propertyNs.prefix).name;\n }\n\n assign(p, {\n ns: propertyNs,\n name: propertyName\n });\n\n propertiesByName[propertyName] = p;\n });\n\n // update ns + name\n assign(type, {\n ns: ns,\n name: name,\n propertiesByName: propertiesByName\n });\n\n forEach(type.extends, function(extendsName) {\n var extended = this.typeMap[extendsName];\n\n extended.traits = extended.traits || [];\n extended.traits.push(name);\n }, this);\n\n // link to package\n this.definePackage(type, pkg);\n\n // register\n this.typeMap[name] = type;\n};\n\n\n/**\n * Traverse the type hierarchy from bottom to top.\n */\nRegistry.prototype.mapTypes = function(nsName, iterator) {\n\n var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];\n\n var self = this;\n\n /**\n * Traverse the selected super type or trait\n *\n * @param {String} cls\n */\n function traverseSuper(cls) {\n var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);\n self.mapTypes(parentNs, iterator);\n }\n\n if (!type) {\n throw new Error('unknown type <' + nsName.name + '>');\n }\n\n forEach(type.superClass, traverseSuper);\n\n iterator(type);\n\n forEach(type.traits, traverseSuper);\n};\n\n\n/**\n * Returns the effective descriptor for a type.\n *\n * @param {String} type the namespaced name (ns:localName) of the type\n *\n * @return {Descriptor} the resulting effective descriptor\n */\nRegistry.prototype.getEffectiveDescriptor = function(name) {\n\n var nsName = parseNameNs(name);\n\n var builder = new DescriptorBuilder(nsName);\n\n this.mapTypes(nsName, function(type) {\n builder.addTrait(type);\n });\n\n // check we have an id assigned\n var id = this.options.generateId;\n if (id && !builder.hasProperty(id)) {\n builder.addIdProperty(id);\n }\n\n var descriptor = builder.build();\n\n // define package link\n this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);\n\n return descriptor;\n};\n\n\nRegistry.prototype.definePackage = function(target, pkg) {\n this.properties.define(target, '$pkg', { value: pkg });\n};","'use strict';\n\n/**\n * Built-in moddle types\n */\nvar BUILTINS = {\n String: true,\n Boolean: true,\n Integer: true,\n Real: true,\n Element: true\n};\n\n/**\n * Converters for built in types from string representations\n */\nvar TYPE_CONVERTERS = {\n String: function(s) { return s; },\n Boolean: function(s) { return s === 'true'; },\n Integer: function(s) { return parseInt(s, 10); },\n Real: function(s) { return parseFloat(s, 10); }\n};\n\n/**\n * Convert a type to its real representation\n */\nmodule.exports.coerceType = function(type, value) {\n\n var converter = TYPE_CONVERTERS[type];\n\n if (converter) {\n return converter(value);\n } else {\n return value;\n }\n};\n\n/**\n * Return whether the given type is built-in\n */\nmodule.exports.isBuiltIn = function(type) {\n return !!BUILTINS[type];\n};\n\n/**\n * Return whether the given type is simple\n */\nmodule.exports.isSimple = function(type) {\n return !!TYPE_CONVERTERS[type];\n};","module.exports={\n \"name\": \"BPMN20\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/MODEL\",\n \"associations\": [],\n \"types\": [\n {\n \"name\": \"Interface\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operations\",\n \"type\": \"Operation\",\n \"isMany\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Operation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"errorRefs\",\n \"type\": \"Error\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EndPoint\",\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"Auditing\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"GlobalTask\",\n \"superClass\": [\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Monitoring\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Performer\",\n \"superClass\": [\n \"ResourceRole\"\n ]\n },\n {\n \"name\": \"Process\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"processType\",\n \"type\": \"ProcessType\",\n \"isAttr\": true\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"supports\",\n \"type\": \"Process\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"definitionalCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"isExecutable\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationSubscriptions\",\n \"type\": \"CorrelationSubscription\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LaneSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Lane\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"childLaneSet\",\n \"type\": \"LaneSet\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"partitionElementRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"flowNodeRef\",\n \"type\": \"FlowNode\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"partitionElement\",\n \"type\": \"BaseElement\"\n }\n ]\n },\n {\n \"name\": \"GlobalManualTask\",\n \"superClass\": [\n \"GlobalTask\"\n ]\n },\n {\n \"name\": \"ManualTask\",\n \"superClass\": [\n \"Task\"\n ]\n },\n {\n \"name\": \"UserTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n },\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Rendering\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"HumanPerformer\",\n \"superClass\": [\n \"Performer\"\n ]\n },\n {\n \"name\": \"PotentialOwner\",\n \"superClass\": [\n \"HumanPerformer\"\n ]\n },\n {\n \"name\": \"GlobalUserTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Gateway\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"gatewayDirection\",\n \"type\": \"GatewayDirection\",\n \"default\": \"Unspecified\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EventBasedGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"eventGatewayType\",\n \"type\": \"EventBasedGatewayType\",\n \"isAttr\": true,\n \"default\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"ComplexGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"activationCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParallelGateway\",\n \"superClass\": [\n \"Gateway\"\n ]\n },\n {\n \"name\": \"RootElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Relationship\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"direction\",\n \"type\": \"RelationshipDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"source\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"target\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n }\n ]\n },\n {\n \"name\": \"BaseElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"id\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"type\": \"Documentation\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionDefinitions\",\n \"type\": \"ExtensionDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"extensionElements\",\n \"type\": \"ExtensionElements\"\n }\n ]\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"mustUnderstand\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"definition\",\n \"type\": \"ExtensionDefinition\"\n }\n ]\n },\n {\n \"name\": \"ExtensionDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"extensionAttributeDefinitions\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionAttributeDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isReference\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"extensionDefinition\",\n \"type\": \"ExtensionDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionElements\",\n \"properties\": [\n {\n \"name\": \"valueRef\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionAttributeDefinition\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Documentation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Event\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"IntermediateCatchEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ]\n },\n {\n \"name\": \"IntermediateThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"EndEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"StartEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"isInterrupting\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"ThrowEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSet\",\n \"type\": \"InputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociation\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CatchEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"parallelMultiple\",\n \"isAttr\": true,\n \"type\": \"Boolean\",\n \"default\": false\n },\n {\n \"name\": \"outputSet\",\n \"type\": \"OutputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataOutputAssociation\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"BoundaryEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"cancelActivity\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"attachedToRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"EventDefinition\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CancelEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"ErrorEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"errorRef\",\n \"type\": \"Error\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TerminateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"EscalationEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"escalationRef\",\n \"type\": \"Escalation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Escalation\",\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"escalationCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ],\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CompensateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"waitForCompletion\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"activityRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TimerEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"timeDate\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeCycle\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeDuration\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"LinkEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"target\",\n \"type\": \"LinkEventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"source\",\n \"type\": \"LinkEventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConditionalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"SignalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"signalRef\",\n \"type\": \"Signal\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Signal\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ImplicitThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"DataState\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ItemAwareElement\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemSubjectRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataState\",\n \"type\": \"DataState\"\n }\n ]\n },\n {\n \"name\": \"DataAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"transformation\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"assignment\",\n \"type\": \"Assignment\",\n \"isMany\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"ItemAwareElement\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"ItemAwareElement\",\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataInput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithOptional\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithWhileExecuting\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataOutput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithOptional\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithWhileExecuting\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"dataInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"OutputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Property\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"DataInputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"DataOutputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"InputOutputSpecification\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSets\",\n \"type\": \"InputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"outputSets\",\n \"type\": \"OutputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"DataObject\",\n \"superClass\": [\n \"FlowElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"InputOutputBinding\",\n \"properties\": [\n {\n \"name\": \"inputDataRef\",\n \"type\": \"InputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputDataRef\",\n \"type\": \"OutputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Assignment\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"from\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"to\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"DataStore\",\n \"superClass\": [\n \"RootElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"capacity\",\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"isUnlimited\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"DataStoreReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataStoreRef\",\n \"type\": \"DataStore\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataObjectReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataObjectRef\",\n \"type\": \"DataObject\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConversationLink\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ConversationAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CallConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"calledCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Conversation\",\n \"superClass\": [\n \"ConversationNode\"\n ]\n },\n {\n \"name\": \"SubConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"conversationNodes\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ConversationNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageFlowRefs\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"GlobalConversation\",\n \"superClass\": [\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"PartnerEntity\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"PartnerRole\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationProperty\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRetrievalExpression\",\n \"type\": \"CorrelationPropertyRetrievalExpression\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Error\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"errorCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"CorrelationKey\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Expression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"isAbstract\": true\n },\n {\n \"name\": \"FormalExpression\",\n \"superClass\": [\n \"Expression\"\n ],\n \"properties\": [\n {\n \"name\": \"language\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"body\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"evaluatesToTypeRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Message\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"itemRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ItemDefinition\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemKind\",\n \"type\": \"ItemKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"structureRef\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"import\",\n \"type\": \"Import\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SequenceFlow\",\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isImmediate\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"conditionExpression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElementsContainer\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"laneSets\",\n \"type\": \"LaneSet\",\n \"isMany\": true\n },\n {\n \"name\": \"flowElements\",\n \"type\": \"FlowElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CallableElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"supportedInterfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ioBinding\",\n \"type\": \"InputOutputBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"FlowNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"incoming\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoing\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyRetrievalExpression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"messagePath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyBinding\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataPath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Resource\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resourceParameters\",\n \"type\": \"ResourceParameter\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ResourceParameter\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isRequired\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationSubscription\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationKeyRef\",\n \"type\": \"CorrelationKey\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationPropertyBinding\",\n \"type\": \"CorrelationPropertyBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlow\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlowAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InteractionNode\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"incomingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Participant\",\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"interfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantMultiplicity\",\n \"type\": \"ParticipantMultiplicity\"\n },\n {\n \"name\": \"endPointRefs\",\n \"type\": \"EndPoint\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"processRef\",\n \"type\": \"Process\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantMultiplicity\",\n \"properties\": [\n {\n \"name\": \"minimum\",\n \"default\": 0,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"maximum\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"Collaboration\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"choreographyRef\",\n \"type\": \"Choreography\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlowAssociations\",\n \"type\": \"MessageFlowAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationAssociations\",\n \"type\": \"ConversationAssociation\"\n },\n {\n \"name\": \"participants\",\n \"type\": \"Participant\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlows\",\n \"type\": \"MessageFlow\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"conversations\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationLinks\",\n \"type\": \"ConversationLink\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyActivity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"loopType\",\n \"type\": \"ChoreographyLoopType\",\n \"default\": \"None\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"CallChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledChoreographyRef\",\n \"type\": \"Choreography\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"SubChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\",\n \"FlowElementsContainer\"\n ],\n \"properties\": [\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyTask\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"messageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Choreography\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"GlobalChoreographyTask\",\n \"superClass\": [\n \"Choreography\"\n ],\n \"properties\": [\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TextAnnotation\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\"\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Group\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Association\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"associationDirection\",\n \"type\": \"AssociationDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Category\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValue\",\n \"type\": \"CategoryValue\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Artifact\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"CategoryValue\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categorizedFlowElements\",\n \"type\": \"FlowElement\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"value\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Activity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"isForCompensation\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCharacteristics\",\n \"type\": \"LoopCharacteristics\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"boundaryEventRefs\",\n \"type\": \"BoundaryEvent\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociations\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputAssociations\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"startQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"completionQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"ServiceTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SubProcess\",\n \"superClass\": [\n \"Activity\",\n \"FlowElementsContainer\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"triggeredByEvent\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LoopCharacteristics\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"MultiInstanceLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"isSequential\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"behavior\",\n \"type\": \"MultiInstanceBehavior\",\n \"default\": \"All\",\n \"isAttr\": true\n },\n {\n \"name\": \"loopCardinality\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopDataInputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"loopDataOutputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputDataItem\",\n \"type\": \"DataInput\"\n },\n {\n \"name\": \"outputDataItem\",\n \"type\": \"DataOutput\"\n },\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"complexBehaviorDefinition\",\n \"type\": \"ComplexBehaviorDefinition\",\n \"isMany\": true\n },\n {\n \"name\": \"oneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"noneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"StandardLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"testBefore\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopMaximum\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"CallActivity\",\n \"superClass\": [\n \"Activity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledElement\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Task\",\n \"superClass\": [\n \"Activity\",\n \"InteractionNode\"\n ]\n },\n {\n \"name\": \"SendTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ReceiveTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ScriptTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptFormat\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"BusinessRuleTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"AdHocSubProcess\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"ordering\",\n \"type\": \"AdHocOrdering\",\n \"isAttr\": true\n },\n {\n \"name\": \"cancelRemainingInstances\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"Transaction\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"protocol\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"method\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalScriptTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptLanguage\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalBusinessRuleTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ComplexBehaviorDefinition\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"event\",\n \"type\": \"ImplicitThrowEvent\"\n }\n ]\n },\n {\n \"name\": \"ResourceRole\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resourceRef\",\n \"type\": \"Resource\",\n \"isReference\": true\n },\n {\n \"name\": \"resourceParameterBindings\",\n \"type\": \"ResourceParameterBinding\",\n \"isMany\": true\n },\n {\n \"name\": \"resourceAssignmentExpression\",\n \"type\": \"ResourceAssignmentExpression\"\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ResourceParameterBinding\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"parameterRef\",\n \"type\": \"ResourceParameter\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ResourceAssignmentExpression\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Import\",\n \"properties\": [\n {\n \"name\": \"importType\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"location\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"namespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Definitions\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"targetNamespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"expressionLanguage\",\n \"default\": \"http://www.w3.org/1999/XPath\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"typeLanguage\",\n \"default\": \"http://www.w3.org/2001/XMLSchema\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"imports\",\n \"type\": \"Import\",\n \"isMany\": true\n },\n {\n \"name\": \"extensions\",\n \"type\": \"Extension\",\n \"isMany\": true\n },\n {\n \"name\": \"rootElements\",\n \"type\": \"RootElement\",\n \"isMany\": true\n },\n {\n \"name\": \"diagrams\",\n \"isMany\": true,\n \"type\": \"bpmndi:BPMNDiagram\"\n },\n {\n \"name\": \"exporter\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"relationships\",\n \"type\": \"Relationship\",\n \"isMany\": true\n },\n {\n \"name\": \"exporterVersion\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ProcessType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Public\"\n },\n {\n \"name\": \"Private\"\n }\n ]\n },\n {\n \"name\": \"GatewayDirection\",\n \"literalValues\": [\n {\n \"name\": \"Unspecified\"\n },\n {\n \"name\": \"Converging\"\n },\n {\n \"name\": \"Diverging\"\n },\n {\n \"name\": \"Mixed\"\n }\n ]\n },\n {\n \"name\": \"EventBasedGatewayType\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"RelationshipDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Forward\"\n },\n {\n \"name\": \"Backward\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"ItemKind\",\n \"literalValues\": [\n {\n \"name\": \"Physical\"\n },\n {\n \"name\": \"Information\"\n }\n ]\n },\n {\n \"name\": \"ChoreographyLoopType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Standard\"\n },\n {\n \"name\": \"MultiInstanceSequential\"\n },\n {\n \"name\": \"MultiInstanceParallel\"\n }\n ]\n },\n {\n \"name\": \"AssociationDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"MultiInstanceBehavior\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"All\"\n },\n {\n \"name\": \"Complex\"\n }\n ]\n },\n {\n \"name\": \"AdHocOrdering\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Sequential\"\n }\n ]\n }\n ],\n \"prefix\": \"bpmn\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\",\n \"typePrefix\": \"t\"\n }\n}","module.exports={\n \"name\": \"BPMNDI\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/DI\",\n \"types\": [\n {\n \"name\": \"BPMNDiagram\",\n \"properties\": [\n {\n \"name\": \"plane\",\n \"type\": \"BPMNPlane\",\n \"redefines\": \"di:Diagram#rootElement\"\n },\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isMany\": true\n }\n ],\n \"superClass\": [\n \"di:Diagram\"\n ]\n },\n {\n \"name\": \"BPMNPlane\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n }\n ],\n \"superClass\": [\n \"di:Plane\"\n ]\n },\n {\n \"name\": \"BPMNShape\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"isHorizontal\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isExpanded\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isMarkerVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"isMessageVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"participantBandKind\",\n \"type\": \"ParticipantBandKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"choreographyActivityShape\",\n \"type\": \"BPMNShape\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ],\n \"superClass\": [\n \"di:LabeledShape\"\n ]\n },\n {\n \"name\": \"BPMNEdge\",\n \"properties\": [\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"sourceElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#source\"\n },\n {\n \"name\": \"targetElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#target\"\n },\n {\n \"name\": \"messageVisibleKind\",\n \"type\": \"MessageVisibleKind\",\n \"isAttr\": true,\n \"default\": \"initiating\"\n }\n ],\n \"superClass\": [\n \"di:LabeledEdge\"\n ]\n },\n {\n \"name\": \"BPMNLabel\",\n \"properties\": [\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isAttr\": true,\n \"isReference\": true,\n \"redefines\": \"di:DiagramElement#style\"\n }\n ],\n \"superClass\": [\n \"di:Label\"\n ]\n },\n {\n \"name\": \"BPMNLabelStyle\",\n \"properties\": [\n {\n \"name\": \"font\",\n \"type\": \"dc:Font\"\n }\n ],\n \"superClass\": [\n \"di:Style\"\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ParticipantBandKind\",\n \"literalValues\": [\n {\n \"name\": \"top_initiating\"\n },\n {\n \"name\": \"middle_initiating\"\n },\n {\n \"name\": \"bottom_initiating\"\n },\n {\n \"name\": \"top_non_initiating\"\n },\n {\n \"name\": \"middle_non_initiating\"\n },\n {\n \"name\": \"bottom_non_initiating\"\n }\n ]\n },\n {\n \"name\": \"MessageVisibleKind\",\n \"literalValues\": [\n {\n \"name\": \"initiating\"\n },\n {\n \"name\": \"non_initiating\"\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"bpmndi\"\n}","module.exports={\n \"name\": \"DC\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DC\",\n \"types\": [\n {\n \"name\": \"Boolean\"\n },\n {\n \"name\": \"Integer\"\n },\n {\n \"name\": \"Real\"\n },\n {\n \"name\": \"String\"\n },\n {\n \"name\": \"Font\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"size\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"isBold\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isItalic\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isUnderline\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isStrikeThrough\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Point\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Bounds\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"width\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"height\",\n \"type\": \"Real\",\n \"isAttr\": true\n }\n ]\n }\n ],\n \"prefix\": \"dc\",\n \"associations\": []\n}","module.exports={\n \"name\": \"DI\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DI\",\n \"types\": [\n {\n \"name\": \"DiagramElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"extension\",\n \"type\": \"Extension\"\n },\n {\n \"name\": \"owningDiagram\",\n \"type\": \"Diagram\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"owningElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"modelElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"style\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ownedElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Node\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ]\n },\n {\n \"name\": \"Edge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ],\n \"properties\": [\n {\n \"name\": \"source\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"target\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"waypoint\",\n \"isUnique\": false,\n \"isMany\": true,\n \"type\": \"dc:Point\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Diagram\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"rootElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resolution\",\n \"isAttr\": true,\n \"type\": \"Real\"\n },\n {\n \"name\": \"ownedStyle\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Shape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Plane\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"planeElement\",\n \"type\": \"DiagramElement\",\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledEdge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Edge\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledShape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Shape\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Label\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Style\",\n \"isAbstract\": true\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"di\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\"\n }\n}","module.exports = require(37);","'use strict';\n\nvar di = require(76);\n\n\n/**\n * Bootstrap an injector from a list of modules, instantiating a number of default components\n *\n * @ignore\n * @param {Array<didi.Module>} bootstrapModules\n *\n * @return {didi.Injector} a injector to use to access the components\n */\nfunction bootstrap(bootstrapModules) {\n\n var modules = [],\n components = [];\n\n function hasModule(m) {\n return modules.indexOf(m) >= 0;\n }\n\n function addModule(m) {\n modules.push(m);\n }\n\n function visit(m) {\n if (hasModule(m)) {\n return;\n }\n\n (m.__depends__ || []).forEach(visit);\n\n if (hasModule(m)) {\n return;\n }\n\n addModule(m);\n\n (m.__init__ || []).forEach(function(c) {\n components.push(c);\n });\n }\n\n bootstrapModules.forEach(visit);\n\n var injector = new di.Injector(modules);\n\n components.forEach(function(c) {\n\n try {\n // eagerly resolve component (fn or string)\n injector[typeof c === 'string' ? 'get' : 'invoke'](c);\n } catch (e) {\n console.error('Failed to instantiate component');\n console.error(e.stack);\n\n throw e;\n }\n });\n\n return injector;\n}\n\n/**\n * Creates an injector from passed options.\n *\n * @ignore\n * @param {Object} options\n * @return {didi.Injector}\n */\nfunction createInjector(options) {\n\n options = options || {};\n\n var configModule = {\n 'config': ['value', options]\n };\n\n var coreModule = require(43);\n\n var modules = [ configModule, coreModule ].concat(options.modules || []);\n\n return bootstrap(modules);\n}\n\n\n/**\n * The main diagram-js entry point that bootstraps the diagram with the given\n * configuration.\n *\n * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.\n *\n * @class djs.Diagram\n * @memberOf djs\n * @constructor\n *\n * @example\n *\n * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>\n *\n * // plug-in implemenentation\n * function MyLoggingPlugin(eventBus) {\n * eventBus.on('shape.added', function(event) {\n * console.log('shape ', event.shape, ' was added to the diagram');\n * });\n * }\n *\n * // export as module\n * module.exports = {\n * __init__: [ 'myLoggingPlugin' ],\n * myLoggingPlugin: [ 'type', MyLoggingPlugin ]\n * };\n *\n *\n * // instantiate the diagram with the new plug-in\n *\n * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });\n *\n * diagram.invoke([ 'canvas', function(canvas) {\n * // add shape to drawing canvas\n * canvas.addShape({ x: 10, y: 10 });\n * });\n *\n * // 'shape ... was added to the diagram' logged to console\n *\n * @param {Object} options\n * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram\n * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with\n */\nfunction Diagram(options, injector) {\n\n // create injector unless explicitly specified\n this.injector = injector = injector || createInjector(options);\n\n // API\n\n /**\n * Resolves a diagram service\n *\n * @method Diagram#get\n *\n * @param {String} name the name of the diagram service to be retrieved\n * @param {Object} [locals] a number of locals to use to resolve certain dependencies\n */\n this.get = injector.get;\n\n /**\n * Executes a function into which diagram services are injected\n *\n * @method Diagram#invoke\n *\n * @param {Function|Object[]} fn the function to resolve\n * @param {Object} locals a number of locals to use to resolve certain dependencies\n */\n this.invoke = injector.invoke;\n\n // init\n\n // indicate via event\n\n\n /**\n * An event indicating that all plug-ins are loaded.\n *\n * Use this event to fire other events to interested plug-ins\n *\n * @memberOf Diagram\n *\n * @event diagram.init\n *\n * @example\n *\n * eventBus.on('diagram.init', function() {\n * eventBus.fire('my-custom-event', { foo: 'BAR' });\n * });\n *\n * @type {Object}\n */\n this.get('eventBus').fire('diagram.init');\n}\n\nmodule.exports = Diagram;\n\n\n/**\n * Destroys the diagram\n *\n * @method Diagram#destroy\n */\nDiagram.prototype.destroy = function() {\n this.get('eventBus').fire('diagram.destroy');\n};","'use strict';\n\nvar isNumber = require(169),\n assign = require(175),\n forEach = require(84);\n\nvar Collections = require(63);\n\nvar Snap = require(74);\n\nfunction round(number, resolution) {\n return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n return isNumber(number) ? number + 'px' : number;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param {Object} options\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n options = assign({}, { width: '100%', height: '100%' }, options);\n\n var container = options.container || document.body;\n\n // create a <div> around the svg element with the respective size\n // this way we can always get the correct container size\n // (this is impossible for <svg> elements at the moment)\n var parent = document.createElement('div');\n parent.setAttribute('class', 'djs-container');\n\n assign(parent.style, {\n position: 'relative',\n overflow: 'hidden',\n width: ensurePx(options.width),\n height: ensurePx(options.height)\n });\n\n container.appendChild(parent);\n\n return parent;\n}\n\nfunction createGroup(parent, cls) {\n return parent.group().attr({ 'class' : cls });\n}\n\nvar BASE_LAYER = 'base';\n\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._graphicsFactory = graphicsFactory;\n\n this._init(config || {});\n}\n\nCanvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];\n\nmodule.exports = Canvas;\n\n\nCanvas.prototype._init = function(config) {\n\n // Creates a <svg> element that is wrapped into a <div>.\n // This way we are always able to correctly figure out the size of the svg element\n // by querying the parent node.\n //\n // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n //\n // <div class=\"djs-container\" style=\"width: {desired-width}, height: {desired-height}\">\n // <svg width=\"100%\" height=\"100%\">\n // ...\n // </svg>\n // </div>\n\n // html container\n var eventBus = this._eventBus,\n\n container = createContainer(config),\n svg = Snap.createSnapAt('100%', '100%', container),\n viewport = createGroup(svg, 'viewport'),\n\n self = this;\n\n this._container = container;\n this._svg = svg;\n this._viewport = viewport;\n this._layers = {};\n\n eventBus.on('diagram.init', function(event) {\n\n /**\n * An event indicating that the canvas is ready to be drawn on.\n *\n * @memberOf Canvas\n *\n * @event canvas.init\n *\n * @type {Object}\n * @property {Snap<SVGSVGElement>} svg the created svg element\n * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes\n */\n eventBus.fire('canvas.init', { svg: svg, viewport: viewport });\n });\n\n eventBus.on('diagram.destroy', function() {\n\n var parent = self._container.parentNode;\n\n if (parent) {\n parent.removeChild(container);\n }\n\n eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });\n\n self._svg.remove();\n\n self._svg = self._container = self._layers = self._viewport = null;\n });\n\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getDefaultLayer = function() {\n return this.getLayer(BASE_LAYER);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * @param {String} name\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n var layer = this._layers[name];\n if (!layer) {\n layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);\n }\n\n return layer;\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {DOMNode}\n */\nCanvas.prototype.getContainer = function() {\n return this._container;\n};\n\n\n/////////////// markers ///////////////////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n var container;\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n // we need to access all\n container = this._elementRegistry._elements[element.id];\n\n if (!container) {\n return;\n }\n\n forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n if (gfx) {\n // invoke either addClass or removeClass based on mode\n gfx[add ? 'addClass' : 'removeClass'](marker);\n }\n });\n\n /**\n * An event indicating that a marker has been updated for an element\n *\n * @event element.marker.update\n * @type {Object}\n * @property {djs.model.Element} element the shape\n * @property {Object} gfx the graphical representation of the shape\n * @property {String} marker\n * @property {Boolean} add true if the marker was added, false if it got removed\n */\n this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n * canvas.addMarker('foo', 'some-marker');\n *\n * var fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; // <g class=\"... some-marker\"> ... </g>\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.addMarker = function(element, marker) {\n this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n this._updateMarker(element, marker, false);\n};\n\n/**\n * Check the existence of a marker on element.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n var gfx = this.getGraphics(element);\n\n return gfx && gfx.hasClass(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n if(this.hasMarker(element, marker)) {\n this.removeMarker(element, marker);\n } else {\n this.addMarker(element, marker);\n }\n};\n\nCanvas.prototype.getRootElement = function() {\n if (!this._rootElement) {\n this.setRootElement({ id: '__implicitroot' });\n }\n\n return this._rootElement;\n};\n\n\n\n//////////////// root element handling ///////////////////////////\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {Object|djs.model.Root} element\n * @param {Boolean} [override] whether to override the current root element, if any\n *\n * @return {Object|djs.model.Root} new root element\n */\nCanvas.prototype.setRootElement = function(element, override) {\n\n this._ensureValidId(element);\n\n var oldRoot = this._rootElement,\n elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n if (oldRoot) {\n if (!override) {\n throw new Error('rootElement already set, need to specify override');\n }\n\n // simulate element remove event sequence\n eventBus.fire('root.remove', { element: oldRoot });\n eventBus.fire('root.removed', { element: oldRoot });\n\n elementRegistry.remove(oldRoot);\n }\n\n var gfx = this.getDefaultLayer();\n\n // resemble element add event sequence\n eventBus.fire('root.add', { element: element });\n\n elementRegistry.add(element, gfx, this._svg);\n\n eventBus.fire('root.added', { element: element, gfx: gfx });\n\n this._rootElement = element;\n\n return element;\n};\n\n\n\n///////////// add functionality ///////////////////////////////\n\nCanvas.prototype._ensureValidId = function(element) {\n if (!element.id) {\n throw new Error('element must have an id');\n }\n\n if (this._elementRegistry.get(element.id)) {\n throw new Error('element with id ' + element.id + ' already exists');\n }\n};\n\nCanvas.prototype._setParent = function(element, parent) {\n Collections.add(parent.children, element);\n element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n * * <{type}.add> (element, parent)\n * * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {String} type\n * @param {Object|djs.model.Base} element\n * @param {Object|djs.model.Base} [parent]\n *\n * @return {Object|djs.model.Base} the added element\n */\nCanvas.prototype._addElement = function(type, element, parent) {\n\n parent = parent || this.getRootElement();\n\n var eventBus = this._eventBus,\n graphicsFactory = this._graphicsFactory;\n\n this._ensureValidId(element);\n\n eventBus.fire(type + '.add', { element: element, parent: parent });\n\n this._setParent(element, parent);\n\n // create graphics\n var gfx = graphicsFactory.create(type, element);\n\n this._elementRegistry.add(element, gfx);\n\n // update its visual\n graphicsFactory.update(type, element, gfx);\n\n eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n return element;\n};\n\n/**\n * Adds a shape to the canvas\n *\n * @param {Object|djs.model.Shape} shape to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Shape} the added shape\n */\nCanvas.prototype.addShape = function(shape, parent) {\n return this._addElement('shape', shape, parent);\n};\n\n/**\n * Adds a connection to the canvas\n *\n * @param {Object|djs.model.Connection} connection to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Connection} the added connection\n */\nCanvas.prototype.addConnection = function(connection, parent) {\n return this._addElement('connection', connection, parent);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n var elementRegistry = this._elementRegistry,\n graphicsFactory = this._graphicsFactory,\n eventBus = this._eventBus;\n\n element = elementRegistry.get(element.id || element);\n\n if (!element) {\n // element was removed already\n return;\n }\n\n eventBus.fire(type + '.remove', { element: element });\n\n graphicsFactory.remove(element);\n\n // unset parent <-> child relationship\n Collections.remove(element.parent && element.parent.children, element);\n element.parent = null;\n\n eventBus.fire(type + '.removed', { element: element });\n\n elementRegistry.remove(element);\n\n return element;\n};\n\n\n/**\n * Removes a shape from the canvas\n *\n * @param {String|djs.model.Shape} shape or shape id to be removed\n *\n * @return {djs.model.Shape} the removed shape\n */\nCanvas.prototype.removeShape = function(shape) {\n\n /**\n * An event indicating that a shape is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.remove\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n\n /**\n * An event indicating that a shape has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.removed\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas\n *\n * @param {String|djs.model.Connection} connection or connection id to be removed\n *\n * @return {djs.model.Connection} the removed connection\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n /**\n * An event indicating that a connection is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.remove\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n\n /**\n * An event indicating that a connection has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.removed\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Sends a shape to the front.\n *\n * This method takes parent / child relationships between shapes into account\n * and makes sure that children are properly handled, too.\n *\n * @param {djs.model.Shape} shape descriptor of the shape to be sent to front\n * @param {boolean} [bubble=true] whether to send parent shapes to front, too\n */\nCanvas.prototype.sendToFront = function(shape, bubble) {\n\n if (bubble !== false) {\n bubble = true;\n }\n\n if (bubble && shape.parent) {\n this.sendToFront(shape.parent);\n }\n\n forEach(shape.children, function(child) {\n this.sendToFront(child, false);\n }, this);\n\n var gfx = this.getGraphics(shape),\n gfxParent = gfx.parent();\n\n gfx.remove().appendTo(gfxParent);\n};\n\n\n/**\n * Return the graphical object underlaying a certain diagram element\n *\n * @param {String|djs.model.Base} element descriptor of the element\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\nCanvas.prototype._fireViewboxChange = function() {\n this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the area that is currently displayed\n *\n * @param {Object} [box] the new view box to set\n * @param {Number} box.x the top left X coordinate of the canvas visible in view box\n * @param {Number} box.y the top left Y coordinate of the canvas visible in view box\n * @param {Number} box.width the visible width\n * @param {Number} box.height\n *\n * @example\n *\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * @return {Object} the current view box\n */\nCanvas.prototype.viewbox = function(box) {\n\n if (box === undefined && this._cachedViewbox) {\n return this._cachedViewbox;\n }\n\n var viewport = this._viewport,\n innerBox,\n outerBox = this.getSize(),\n matrix,\n scale,\n x, y;\n\n if (!box) {\n // compute the inner box based on the\n // diagrams default layer. This allows us to exclude\n // external components, such as overlays\n innerBox = this.getDefaultLayer().getBBox(true);\n\n matrix = viewport.transform().localMatrix;\n scale = round(matrix.a, 1000);\n\n x = round(-matrix.e || 0, 1000);\n y = round(-matrix.f || 0, 1000);\n\n box = this._cachedViewbox = {\n x: x ? x / scale : 0,\n y: y ? y / scale : 0,\n width: outerBox.width / scale,\n height: outerBox.height / scale,\n scale: scale,\n inner: {\n width: innerBox.width,\n height: innerBox.height,\n x: innerBox.x,\n y: innerBox.y\n },\n outer: outerBox\n };\n\n return box;\n } else {\n scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);\n viewport.transform(matrix);\n\n this._fireViewboxChange();\n }\n\n return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {Object} [delta] the new scroll to apply.\n *\n * @param {Number} [delta.dx]\n * @param {Number} [delta.dy]\n */\nCanvas.prototype.scroll = function(delta) {\n\n var node = this._viewport.node;\n var matrix = node.getCTM();\n\n if (delta) {\n delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n setCTM(node, matrix);\n\n this._fireViewboxChange();\n }\n\n return { x: matrix.e, y: matrix.f };\n};\n\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.\n *\n * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,\n * or `fit-viewport` to adjust the size to fit the current viewport\n * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null\n *\n * @return {Number} the current scale\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n if (newScale === 'fit-viewport') {\n return this._fitViewport(center);\n }\n\n var vbox = this.viewbox();\n\n if (newScale === undefined) {\n return vbox.scale;\n }\n\n var outer = vbox.outer;\n\n if (center === 'auto') {\n center = {\n x: outer.width / 2,\n y: outer.height / 2\n };\n }\n\n var matrix = this._setZoom(newScale, center);\n\n this._fireViewboxChange();\n\n return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n var vbox = this.viewbox(),\n outer = vbox.outer,\n inner = vbox.inner,\n newScale,\n newViewbox;\n\n // display the complete diagram without zooming in.\n // instead of relying on internal zoom, we perform a\n // hard reset on the canvas viewbox to realize this\n //\n // if diagram does not need to be zoomed in, we focus it around\n // the diagram origin instead\n\n if (inner.x >= 0 &&\n inner.y >= 0 &&\n inner.x + inner.width <= outer.width &&\n inner.y + inner.height <= outer.height &&\n !center) {\n\n newViewbox = {\n x: 0,\n y: 0,\n width: Math.max(inner.width + inner.x, outer.width),\n height: Math.max(inner.height + inner.y, outer.height)\n };\n } else {\n\n newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n newViewbox = {\n x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n width: outer.width / newScale,\n height: outer.height / newScale\n };\n }\n\n this.viewbox(newViewbox);\n\n return this.viewbox().scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n var svg = this._svg.node,\n viewport = this._viewport.node;\n\n var matrix = svg.createSVGMatrix();\n var point = svg.createSVGPoint();\n\n var centerPoint,\n originalPoint,\n currentMatrix,\n scaleMatrix,\n newMatrix;\n\n currentMatrix = viewport.getCTM();\n\n\n var currentScale = currentMatrix.a;\n\n if (center) {\n centerPoint = assign(point, center);\n\n // revert applied viewport transformations\n originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n // create scale matrix\n scaleMatrix = matrix\n .translate(originalPoint.x, originalPoint.y)\n .scale(1 / currentScale * scale)\n .translate(-originalPoint.x, -originalPoint.y);\n\n newMatrix = currentMatrix.multiply(scaleMatrix);\n } else {\n newMatrix = matrix.scale(scale);\n }\n\n setCTM(this._viewport.node, newMatrix);\n\n return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas\n *\n * @return {Dimensions}\n */\nCanvas.prototype.getSize = function () {\n return {\n width: this._container.clientWidth,\n height: this._container.clientHeight\n };\n};\n\n\n/**\n * Return the absolute bounding box for the given element\n *\n * The absolute bounding box may be used to display overlays in the\n * callers (browser) coordinate system rather than the zoomed in/out\n * canvas coordinates.\n *\n * @param {ElementDescriptor} element\n * @return {Bounds} the absolute bounding box\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n var vbox = this.viewbox();\n var bbox;\n\n // connection\n // use svg bbox\n if (element.waypoints) {\n var gfx = this.getGraphics(element);\n\n var transformBBox = gfx.getBBox(true);\n bbox = gfx.getBBox();\n\n bbox.x -= transformBBox.x;\n bbox.y -= transformBBox.y;\n\n bbox.width += 2 * transformBBox.x;\n bbox.height += 2 * transformBBox.y;\n }\n // shapes\n // use data\n else {\n bbox = element;\n }\n\n var x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n var y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n var width = bbox.width * vbox.scale;\n var height = bbox.height * vbox.scale;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n};\n","'use strict';\n\nvar Model = require(57);\n\n\n/**\n * A factory for diagram-js shapes\n */\nfunction ElementFactory() {\n this._uid = 12;\n}\n\nmodule.exports = ElementFactory;\n\n\nElementFactory.prototype.createRoot = function(attrs) {\n return this.create('root', attrs);\n};\n\nElementFactory.prototype.createLabel = function(attrs) {\n return this.create('label', attrs);\n};\n\nElementFactory.prototype.createShape = function(attrs) {\n return this.create('shape', attrs);\n};\n\nElementFactory.prototype.createConnection = function(attrs) {\n return this.create('connection', attrs);\n};\n\n/**\n * Create a model element with the given type and\n * a number of pre-set attributes.\n *\n * @param {String} type\n * @param {Object} attrs\n * @return {djs.model.Base} the newly created model instance\n */\nElementFactory.prototype.create = function(type, attrs) {\n\n attrs = attrs || {};\n\n if (!attrs.id) {\n attrs.id = type + '_' + (this._uid++);\n }\n\n return Model.create(type, attrs);\n};","'use strict';\n\nvar ELEMENT_ID = 'data-element-id';\n\n\n/**\n * @class\n *\n * A registry that keeps track of all shapes in the diagram.\n */\nfunction ElementRegistry() {\n this._elements = {};\n}\n\nmodule.exports = ElementRegistry;\n\n/**\n * Register a pair of (element, gfx, (secondaryGfx)).\n *\n * @param {djs.model.Base} element\n * @param {Snap<SVGElement>} gfx\n * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n var id = element.id;\n\n this._validateId(id);\n\n // associate dom node with element\n gfx.attr(ELEMENT_ID, id);\n\n if (secondaryGfx) {\n secondaryGfx.attr(ELEMENT_ID, id);\n }\n\n this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Removes an element from the registry.\n *\n * @param {djs.model.Base} element\n */\nElementRegistry.prototype.remove = function(element) {\n var elements = this._elements,\n id = element.id || element,\n container = id && elements[id];\n\n if (container) {\n\n // unset element id on gfx\n container.gfx.attr(ELEMENT_ID, null);\n\n if (container.secondaryGfx) {\n container.secondaryGfx.attr(ELEMENT_ID, null);\n }\n\n delete elements[id];\n }\n};\n\n/**\n * Update the id of an element\n *\n * @param {djs.model.Base} element\n * @param {String} newId\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n this._validateId(newId);\n\n if (typeof element === 'string') {\n element = this.get(element);\n }\n\n var gfx = this.getGraphics(element),\n secondaryGfx = this.getGraphics(element, true);\n\n this.remove(element);\n\n element.id = newId;\n\n this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Return the model element for a given id or graphics.\n *\n * @example\n *\n * elementRegistry.get('SomeElementId_1');\n * elementRegistry.get(gfx);\n *\n *\n * @param {String|SVGElement} filter for selecting the element\n *\n * @return {djs.model.Base}\n */\nElementRegistry.prototype.get = function(filter) {\n var id;\n\n if (typeof filter === 'string') {\n id = filter;\n } else {\n id = filter && filter.attr(ELEMENT_ID);\n }\n\n var container = this._elements[id];\n return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {Function} fn\n *\n * @return {Array<djs.model.Base>}\n */\nElementRegistry.prototype.filter = function(fn) {\n\n var filtered = [];\n\n this.forEach(function(element, gfx) {\n if(fn(element, gfx)) {\n filtered.push(element);\n }\n });\n\n return filtered;\n};\n\n/**\n * Iterate over all diagram elements.\n *\n * @param {Function} fn\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n var map = this._elements;\n\n Object.keys(map).forEach(function(id) {\n var container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n return fn(element, gfx);\n });\n};\n\n/**\n * Return the graphical representation of an element or its id.\n *\n * @example\n * elementRegistry.getGraphics('SomeElementId_1');\n * elementRegistry.getGraphics(rootElement); // <g ...>\n *\n * elementRegistry.getGraphics(rootElement, true); // <svg ...>\n *\n *\n * @param {String|djs.model.Base} filter\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate the suitability of the given id and signals a problem\n * with an exception.\n *\n * @param {String} id\n *\n * @throws {Error} if id is empty or already assigned\n */\nElementRegistry.prototype._validateId = function(id) {\n if (!id) {\n throw new Error('element must have an id');\n }\n\n if (this._elements[id]) {\n throw new Error('element with id ' + id + ' already added');\n }\n};","'use strict';\n\nvar isFunction = require(167),\n isArray = require(166),\n isNumber = require(169),\n assign = require(175);\n\nvar DEFAULT_PRIORITY = 1000;\n\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nfunction EventBus() {\n this._listeners = {};\n\n // cleanup on destroy\n\n var self = this;\n\n // destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, function() {\n self._listeners = null;\n });\n}\n\nmodule.exports = EventBus;\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {String|Array<String>} events\n * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n */\nEventBus.prototype.on = function(events, priority, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var self = this,\n listener = { priority: priority, callback: callback };\n\n events.forEach(function(e) {\n self._addListener(e, listener);\n });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {String} event the event name to register for\n * @param {Function} callback the callback to execute\n */\nEventBus.prototype.once = function(event, callback) {\n\n var self = this;\n\n function wrappedCallback() {\n callback.apply(self, arguments);\n self.off(event, wrappedCallback);\n }\n\n this.on(event, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {String} event\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(event, callback) {\n var listeners = this._getListeners(event),\n listener, idx;\n\n if (callback) {\n\n // move through listeners from back to front\n // and remove matching listeners\n for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {\n if (listener.callback === callback) {\n listeners.splice(idx, 1);\n }\n }\n } else {\n // clear listeners\n listeners.length = 0;\n }\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {String} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {Boolean} the events return value, if specified or false if the\n * default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n\n var event,\n originalType,\n listeners, idx, listener,\n returnValue,\n args;\n\n args = Array.prototype.slice.call(arguments);\n\n if (typeof type === 'object') {\n event = type;\n type = event.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n listeners = this._listeners[type];\n\n if (!listeners) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof Event) {\n // we are fine, we alread have an event\n event = data;\n } else {\n event = new Event();\n event.init(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n originalType = event.type;\n\n try {\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n for (idx = 0; !!(listener = listeners[idx]); idx++) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n try {\n // returning false prevents the default action\n returnValue = event.returnValue = listener.callback.apply(null, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (e) {\n if (!this.handleError(e)) {\n console.error('unhandled error in event listener');\n console.error(e.stack);\n\n throw e;\n }\n }\n }\n } finally {\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {String} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listeners = this._getListeners(event),\n existingListener,\n idx;\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n for (idx = 0; !!(existingListener = listeners[idx]); idx++) {\n if (existingListener.priority < newListener.priority) {\n\n // prepend newListener at before existingListener\n listeners.splice(idx, 0, newListener);\n return;\n }\n }\n\n listeners.push(newListener);\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n var listeners = this._listeners[name];\n\n if (!listeners) {\n this._listeners[name] = listeners = [];\n }\n\n return listeners;\n};\n\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction Event() { }\n\nmodule.exports.Event = Event;\n\nEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n","'use strict';\n\nvar forEach = require(84),\n reduce = require(88);\n\nvar GraphicsUtil = require(67),\n domClear = require(188);\n\n/**\n * A factory that creates graphical elements\n *\n * @param {Renderer} renderer\n */\nfunction GraphicsFactory(renderer, elementRegistry) {\n this._renderer = renderer;\n this._elementRegistry = elementRegistry;\n}\n\nGraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];\n\nmodule.exports = GraphicsFactory;\n\n\nGraphicsFactory.prototype._getChildren = function(element) {\n\n var gfx = this._elementRegistry.getGraphics(element);\n\n var childrenGfx;\n\n // root element\n if (!element.parent) {\n childrenGfx = gfx;\n } else {\n childrenGfx = GraphicsUtil.getChildren(gfx);\n if (!childrenGfx) {\n childrenGfx = gfx.parent().group().attr('class', 'djs-children');\n }\n }\n\n return childrenGfx;\n};\n\n/**\n * Clears the graphical representation of the element and returns the\n * cleared visual (the <g class=\"djs-visual\" /> element).\n */\nGraphicsFactory.prototype._clear = function(gfx) {\n var visual = GraphicsUtil.getVisual(gfx);\n\n domClear(visual.node);\n\n return visual;\n};\n\n/**\n * Creates a gfx container for shapes and connections\n *\n * The layout is as follows:\n *\n * <g class=\"djs-group\">\n *\n * <!-- the gfx -->\n * <g class=\"djs-element djs-(shape|connection)\">\n * <g class=\"djs-visual\">\n * <!-- the renderer draws in here -->\n * </g>\n *\n * <!-- extensions (overlays, click box, ...) goes here\n * </g>\n *\n * <!-- the gfx child nodes -->\n * <g class=\"djs-children\"></g>\n * </g>\n *\n * @param {Object} parent\n * @param {String} type the type of the element, i.e. shape | connection\n */\nGraphicsFactory.prototype._createContainer = function(type, parentGfx) {\n var outerGfx = parentGfx.group().attr('class', 'djs-group'),\n gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);\n\n // create visual\n gfx.group().attr('class', 'djs-visual');\n\n return gfx;\n};\n\nGraphicsFactory.prototype.create = function(type, element) {\n var childrenGfx = this._getChildren(element.parent);\n return this._createContainer(type, childrenGfx);\n};\n\n\nGraphicsFactory.prototype.updateContainments = function(elements) {\n\n var self = this,\n elementRegistry = this._elementRegistry,\n parents;\n\n\n parents = reduce(elements, function(map, e) {\n\n if (e.parent) {\n map[e.parent.id] = e.parent;\n }\n\n return map;\n }, {});\n\n // update all parents of changed and reorganized their children\n // in the correct order (as indicated in our model)\n forEach(parents, function(parent) {\n\n var childGfx = self._getChildren(parent),\n children = parent.children;\n\n if (!children) {\n return;\n }\n\n forEach(children.slice().reverse(), function(c) {\n var gfx = elementRegistry.getGraphics(c);\n gfx.parent().prependTo(childGfx);\n });\n });\n\n};\n\nGraphicsFactory.prototype.update = function(type, element, gfx) {\n\n // Do not update root element\n if (!element.parent) {\n return;\n }\n\n var visual = this._clear(gfx);\n\n // redraw\n if (type === 'shape') {\n this._renderer.drawShape(visual, element);\n\n // update positioning\n gfx.translate(element.x, element.y);\n } else\n if (type === 'connection') {\n this._renderer.drawConnection(visual, element);\n } else {\n throw new Error('unknown type: ' + type);\n }\n\n gfx.attr('display', element.hidden ? 'none' : 'block');\n};\n\n\nGraphicsFactory.prototype.remove = function(element) {\n var gfx = this._elementRegistry.getGraphics(element);\n\n // remove\n gfx.parent().remove();\n};\n","module.exports = {\n __depends__: [ require(46) ],\n __init__: [ 'canvas' ],\n canvas: [ 'type', require(38) ],\n elementRegistry: [ 'type', require(40) ],\n elementFactory: [ 'type', require(39) ],\n eventBus: [ 'type', require(41) ],\n graphicsFactory: [ 'type', require(42) ]\n};","'use strict';\n\nvar Snap = require(74);\n\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {Styles} styles\n */\nfunction Renderer(styles) {\n this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n}\n\nmodule.exports = Renderer;\n\nRenderer.$inject = ['styles'];\n\n\nRenderer.prototype.drawShape = function drawShape(gfxGroup, data) {\n return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);\n};\n\nRenderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {\n return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);\n};\n\nfunction componentsToPath(components) {\n return components.join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * Gets the default SVG path of a shape that represents it's visual bounds.\n *\n * @param {djs.model.Shape} shape\n * @return {string} svg path\n */\nRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var shapePath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(shapePath);\n};\n\n/**\n * Gets the default SVG path of a connection that represents it's visual bounds.\n *\n * @param {djs.model.Connection} connection\n * @return {string} svg path\n */\nRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n var waypoints = connection.waypoints;\n\n var idx, point, connectionPath = [];\n\n for (idx = 0; !!(point = waypoints[idx]); idx++) {\n\n // take invisible docking into account\n // when creating the path\n point = point.original || point;\n\n connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n }\n\n return componentsToPath(connectionPath);\n};\n\n\nfunction toSVGPoints(points) {\n var result = '';\n\n for (var i = 0, p; !!(p = points[i]); i++) {\n result += p.x + ',' + p.y + ' ';\n }\n\n return result;\n}\n\nfunction createLine(points, attrs) {\n return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});\n}\n\nfunction updateLine(gfx, points) {\n return gfx.attr({ points: toSVGPoints(points) });\n}\n\nmodule.exports.createLine = createLine;\nmodule.exports.updateLine = updateLine;","'use strict';\n\nvar isArray = require(166),\n assign = require(175),\n reduce = require(88);\n\n\n/**\n * A component that manages shape styles\n */\nfunction Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n}\n\nmodule.exports = Styles;","module.exports = {\n renderer: [ 'type', require(44) ],\n styles: [ 'type', require(45) ]\n};","'use strict';\n\nvar forEach = require(84),\n domDelegate = require(189),\n Renderer = require(44),\n createLine = Renderer.createLine,\n updateLine = Renderer.updateLine;\n\n\nvar isPrimaryButton = require(69).isPrimaryButton;\n\nvar Snap = require(74);\n\n/**\n * A plugin that provides interaction events for diagram elements.\n *\n * It emits the following events:\n *\n * * element.hover\n * * element.out\n * * element.click\n * * element.dblclick\n * * element.mousedown\n *\n * Each event is a tuple { element, gfx, originalEvent }.\n *\n * Canceling the event via Event#preventDefault() prevents the original DOM operation.\n *\n * @param {EventBus} eventBus\n */\nfunction InteractionEvents(eventBus, elementRegistry, styles) {\n\n var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {\n stroke: 'white',\n strokeWidth: 15\n });\n\n function fire(type, event) {\n var target = event.delegateTarget || event.target,\n gfx = target && new Snap(target),\n element = elementRegistry.get(gfx),\n returnValue;\n\n if (!gfx || !element) {\n return;\n }\n\n returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });\n\n if (returnValue === false) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n var handlers = {};\n\n function mouseHandler(type) {\n\n var fn = handlers[type];\n\n if (!fn) {\n fn = handlers[type] = function(event) {\n // only indicate left mouse button interactions\n if (isPrimaryButton(event)) {\n fire(type, event);\n }\n };\n }\n\n return fn;\n }\n\n var bindings = {\n mouseover: 'element.hover',\n mouseout: 'element.out',\n click: 'element.click',\n dblclick: 'element.dblclick',\n mousedown: 'element.mousedown',\n mouseup: 'element.mouseup'\n };\n\n var elementSelector = 'svg, .djs-element';\n\n ///// event registration\n\n function registerEvent(node, event, localEvent) {\n var handler = mouseHandler(localEvent);\n handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);\n }\n\n function unregisterEvent(node, event, localEvent) {\n domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);\n }\n\n function registerEvents(svg) {\n forEach(bindings, function(val, key) {\n registerEvent(svg.node, key, val);\n });\n }\n\n function unregisterEvents(svg) {\n forEach(bindings, function(val, key) {\n unregisterEvent(svg.node, key, val);\n });\n }\n\n eventBus.on('canvas.destroy', function(event) {\n unregisterEvents(event.svg);\n });\n\n eventBus.on('canvas.init', function(event) {\n registerEvents(event.svg);\n });\n\n\n eventBus.on([ 'shape.added', 'connection.added' ], function(event) {\n var element = event.element,\n gfx = event.gfx,\n hit,\n type;\n\n if (element.waypoints) {\n hit = createLine(element.waypoints);\n type = 'connection';\n } else {\n hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });\n type = 'shape';\n }\n\n hit.attr(HIT_STYLE).appendTo(gfx.node);\n });\n\n // update djs-hit on change\n\n eventBus.on('shape.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n hit.attr({\n width: element.width,\n height: element.height\n });\n });\n\n eventBus.on('connection.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n updateLine(hit, element.waypoints);\n });\n\n\n // API\n\n this.fire = fire;\n\n this.mouseHandler = mouseHandler;\n\n this.registerEvent = registerEvent;\n this.unregisterEvent = unregisterEvent;\n}\n\n\nInteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];\n\nmodule.exports = InteractionEvents;\n\n\n/**\n * An event indicating that the mouse hovered over an element\n *\n * @event element.hover\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has left an element\n *\n * @event element.out\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has clicked an element\n *\n * @event element.click\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has double clicked an element\n *\n * @event element.dblclick\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone down on an element.\n *\n * @event element.mousedown\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone up on an element.\n *\n * @event element.mouseup\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */","module.exports = {\n __init__: [ 'interactionEvents' ],\n interactionEvents: [ 'type', require(47) ]\n};","'use strict';\n\nvar Snap = require(74);\nvar getBBox = require(65).getBBox;\n\n\n/**\n * @class\n *\n * A plugin that adds an outline to shapes and connections that may be activated and styled\n * via CSS classes.\n *\n * @param {EventBus} events the event bus\n */\nfunction Outline(eventBus, styles, elementRegistry) {\n\n var OUTLINE_OFFSET = 6;\n\n var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);\n\n function createOutline(gfx, bounds) {\n return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);\n }\n\n function updateShapeOutline(outline, bounds) {\n\n outline.attr({\n x: -OUTLINE_OFFSET,\n y: -OUTLINE_OFFSET,\n width: bounds.width + OUTLINE_OFFSET * 2,\n height: bounds.height + OUTLINE_OFFSET * 2\n });\n }\n\n function updateConnectionOutline(outline, connection) {\n\n var bbox = getBBox(connection);\n\n outline.attr({\n x: bbox.x - OUTLINE_OFFSET,\n y: bbox.y - OUTLINE_OFFSET,\n width: bbox.width + OUTLINE_OFFSET * 2,\n height: bbox.height + OUTLINE_OFFSET * 2\n });\n }\n\n eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateShapeOutline(outline, element);\n });\n\n eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateConnectionOutline(outline, element);\n });\n\n\n}\n\n\nOutline.$inject = ['eventBus', 'styles', 'elementRegistry'];\n\nmodule.exports = Outline;\n","'use strict';\n\nmodule.exports = {\n __init__: [ 'outline' ],\n outline: [ 'type', require(49) ]\n};","'use strict';\n\nvar isArray = require(166),\n isString = require(172),\n isObject = require(170),\n assign = require(175),\n forEach = require(84),\n filter = require(82),\n debounce = require(91);\n\nvar domify = require(190),\n domClasses = require(187),\n domRemove = require(193);\n\nvar getBBox = require(65).getBBox;\n\n// document wide unique overlay ids\nvar ids = new (require(68))('ov');\n\n\nfunction createRoot(parent) {\n var root = domify('<div class=\"djs-overlay-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n parent.insertBefore(root, parent.firstChild);\n\n return root;\n}\n\n\nfunction setPosition(el, x, y) {\n assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n el.style.display = visible === false ? 'none' : '';\n}\n\n/**\n * A service that allows users to attach overlays to diagram elements.\n *\n * The overlay service will take care of overlay positioning during updates.\n *\n * @example\n *\n * // add a pink badge on the top left of the shape\n * overlays.add(someShape, {\n * position: {\n * top: -5,\n * left: -5\n * },\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add via shape id\n *\n * overlays.add('some-element-id', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add with optional type\n *\n * overlays.add(someShape, 'badge', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n *\n * // remove an overlay\n *\n * var id = overlays.add(...);\n * overlays.remove(id);\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nfunction Overlays(config, eventBus, canvas, elementRegistry) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._elementRegistry = elementRegistry;\n\n this._ids = ids;\n\n this._overlayDefaults = {\n show: {\n minZoom: 0.7,\n maxZoom: 5.0\n }\n };\n\n /**\n * Mapping overlayId -> overlay\n */\n this._overlays = {};\n\n /**\n * Mapping elementId -> overlay container\n */\n this._overlayContainers = {};\n\n // root html element for all overlays\n this._overlayRoot = createRoot(canvas.getContainer());\n\n this._init(config);\n}\n\n\nOverlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];\n\nmodule.exports = Overlays;\n\n\n/**\n * Returns the overlay with the specified id or a list of overlays\n * for an element with a given type.\n *\n * @example\n *\n * // return the single overlay with the given id\n * overlays.get('some-id');\n *\n * // return all overlays for the shape\n * overlays.get({ element: someShape });\n *\n * // return all overlays on shape with type 'badge'\n * overlays.get({ element: someShape, type: 'badge' });\n *\n * // shape can also be specified as id\n * overlays.get({ element: 'element-id', type: 'badge' });\n *\n *\n * @param {Object} search\n * @param {String} [search.id]\n * @param {String|djs.model.Base} [search.element]\n * @param {String} [search.type]\n *\n * @return {Object|Array<Object>} the overlay(s)\n */\nOverlays.prototype.get = function(search) {\n\n if (isString(search)) {\n search = { id: search };\n }\n\n if (search.element) {\n var container = this._getOverlayContainer(search.element, true);\n\n // return a list of overlays when searching by element (+type)\n if (container) {\n return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();\n } else {\n return [];\n }\n } else\n if (search.type) {\n return filter(this._overlays, { type: search.type });\n } else {\n // return single element when searching by id\n return search.id ? this._overlays[search.id] : null;\n }\n};\n\n/**\n * Adds a HTML overlay to an element.\n *\n * @param {String|djs.model.Base} element attach overlay to this shape\n * @param {String} [type] optional type to assign to the overlay\n * @param {Object} overlay the overlay configuration\n *\n * @param {String|DOMElement} overlay.html html element to use as an overlay\n * @param {Object} [overlay.show] show configuration\n * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay\n * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay\n * @param {Object} overlay.position where to attach the overlay\n * @param {Number} [overlay.position.left] relative to element bbox left attachment\n * @param {Number} [overlay.position.top] relative to element bbox top attachment\n * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment\n * @param {Number} [overlay.position.right] relative to element bbox right attachment\n *\n * @return {String} id that may be used to reference the overlay for update or removal\n */\nOverlays.prototype.add = function(element, type, overlay) {\n\n if (isObject(type)) {\n overlay = type;\n type = null;\n }\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n if (!overlay.position) {\n throw new Error('must specifiy overlay position');\n }\n\n if (!overlay.html) {\n throw new Error('must specifiy overlay html');\n }\n\n if (!element) {\n throw new Error('invalid element specified');\n }\n\n var id = this._ids.next();\n\n overlay = assign({}, this._overlayDefaults, overlay, {\n id: id,\n type: type,\n element: element,\n html: overlay.html\n });\n\n this._addOverlay(overlay);\n\n return id;\n};\n\n\n/**\n * Remove an overlay with the given id or all overlays matching the given filter.\n *\n * @see Overlays#get for filter options.\n *\n * @param {String} [id]\n * @param {Object} [filter]\n */\nOverlays.prototype.remove = function(filter) {\n\n var overlays = this.get(filter) || [];\n\n if (!isArray(overlays)) {\n overlays = [ overlays ];\n }\n\n var self = this;\n\n forEach(overlays, function(overlay) {\n\n var container = self._getOverlayContainer(overlay.element, true);\n\n if (overlay) {\n domRemove(overlay.html);\n domRemove(overlay.htmlContainer);\n\n delete overlay.htmlContainer;\n delete overlay.element;\n\n delete self._overlays[overlay.id];\n }\n\n if (container) {\n var idx = container.overlays.indexOf(overlay);\n if (idx !== -1) {\n container.overlays.splice(idx, 1);\n }\n }\n });\n\n};\n\n\nOverlays.prototype.show = function() {\n setVisible(this._overlayRoot);\n};\n\n\nOverlays.prototype.hide = function() {\n setVisible(this._overlayRoot, false);\n};\n\n\nOverlays.prototype._updateOverlayContainer = function(container) {\n var element = container.element,\n html = container.html;\n\n // update container left,top according to the elements x,y coordinates\n // this ensures we can attach child elements relative to this container\n\n var x = element.x,\n y = element.y;\n\n if (element.waypoints) {\n var bbox = getBBox(element);\n x = bbox.x;\n y = bbox.y;\n }\n\n setPosition(html, x, y);\n};\n\n\nOverlays.prototype._updateOverlay = function(overlay) {\n\n var position = overlay.position,\n htmlContainer = overlay.htmlContainer,\n element = overlay.element;\n\n // update overlay html relative to shape because\n // it is already positioned on the element\n\n // update relative\n var left = position.left,\n top = position.top;\n\n if (position.right !== undefined) {\n\n var width;\n\n if (element.waypoints) {\n width = getBBox(element).width;\n } else {\n width = element.width;\n }\n\n left = position.right * -1 + width;\n }\n\n if (position.bottom !== undefined) {\n\n var height;\n\n if (element.waypoints) {\n height = getBBox(element).height;\n } else {\n height = element.height;\n }\n\n top = position.bottom * -1 + height;\n }\n\n setPosition(htmlContainer, left || 0, top || 0);\n};\n\n\nOverlays.prototype._createOverlayContainer = function(element) {\n var html = domify('<div class=\"djs-overlays djs-overlays-' + element.id + '\" style=\"position: absolute\" />');\n\n this._overlayRoot.appendChild(html);\n\n var container = {\n html: html,\n element: element,\n overlays: []\n };\n\n this._updateOverlayContainer(container);\n\n return container;\n};\n\n\nOverlays.prototype._updateRoot = function(viewbox) {\n var a = viewbox.scale || 1;\n var d = viewbox.scale || 1;\n\n var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n this._overlayRoot.style.transform = matrix;\n this._overlayRoot.style['-ms-transform'] = matrix;\n};\n\n\nOverlays.prototype._getOverlayContainer = function(element, raw) {\n var id = (element && element.id) || element;\n\n var container = this._overlayContainers[id];\n if (!container && !raw) {\n container = this._overlayContainers[id] = this._createOverlayContainer(element);\n }\n\n return container;\n};\n\n\nOverlays.prototype._addOverlay = function(overlay) {\n\n var id = overlay.id,\n element = overlay.element,\n html = overlay.html,\n htmlContainer,\n overlayContainer;\n\n // unwrap jquery (for those who need it)\n if (html.get) {\n html = html.get(0);\n }\n\n // create proper html elements from\n // overlay HTML strings\n if (isString(html)) {\n html = domify(html);\n }\n\n overlayContainer = this._getOverlayContainer(element);\n\n htmlContainer = domify('<div class=\"djs-overlay\" data-overlay-id=\"' + id + '\" style=\"position: absolute\">');\n\n htmlContainer.appendChild(html);\n\n if (overlay.type) {\n domClasses(htmlContainer).add('djs-overlay-' + overlay.type);\n }\n\n overlay.htmlContainer = htmlContainer;\n\n overlayContainer.overlays.push(overlay);\n overlayContainer.html.appendChild(htmlContainer);\n\n this._overlays[id] = overlay;\n\n this._updateOverlay(overlay);\n};\n\nOverlays.prototype._updateOverlayVisibilty = function(viewbox) {\n\n forEach(this._overlays, function(overlay) {\n var show = overlay.show,\n htmlContainer = overlay.htmlContainer,\n visible = true;\n\n if (show) {\n if (show.minZoom > viewbox.scale ||\n show.maxZoom < viewbox.scale) {\n visible = false;\n }\n\n setVisible(htmlContainer, visible);\n }\n });\n};\n\nOverlays.prototype._init = function(config) {\n\n var eventBus = this._eventBus;\n\n var self = this;\n\n\n // scroll/zoom integration\n\n var updateViewbox = function(viewbox) {\n self._updateRoot(viewbox);\n self._updateOverlayVisibilty(viewbox);\n\n self.show();\n };\n\n if (!config || config.deferUpdate !== false) {\n updateViewbox = debounce(updateViewbox, 300);\n }\n\n eventBus.on('canvas.viewbox.changed', function(event) {\n self.hide();\n updateViewbox(event.viewbox);\n });\n\n\n // remove integration\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var overlays = self.get({ element: e.element });\n\n forEach(overlays, function(o) {\n self.remove(o.id);\n });\n });\n\n\n // move integration\n\n eventBus.on([\n 'element.changed'\n ], function(e) {\n var element = e.element;\n\n var container = self._getOverlayContainer(element, true);\n\n if (container) {\n forEach(container.overlays, function(overlay) {\n self._updateOverlay(overlay);\n });\n\n self._updateOverlayContainer(container);\n }\n });\n\n\n // marker integration, simply add them on the overlays as classes, too.\n\n eventBus.on('element.marker.update', function(e) {\n var container = self._getOverlayContainer(e.element, true);\n if (container) {\n domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);\n }\n });\n};\n","module.exports = {\n __init__: [ 'overlays' ],\n overlays: [ 'type', require(51) ]\n};","'use strict';\n\nvar isArray = require(166),\n forEach = require(84);\n\n\n/**\n * A service that offers the current selection in a diagram.\n * Offers the api to control the selection, too.\n *\n * @class\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction Selection(eventBus) {\n\n this._eventBus = eventBus;\n\n this._selectedElements = [];\n\n var self = this;\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var element = e.element;\n self.deselect(element);\n });\n}\n\nSelection.$inject = [ 'eventBus' ];\n\nmodule.exports = Selection;\n\n\nSelection.prototype.deselect = function(element) {\n var selectedElements = this._selectedElements;\n\n var idx = selectedElements.indexOf(element);\n\n if (idx !== -1) {\n var oldSelection = selectedElements.slice();\n\n selectedElements.splice(idx, 1);\n\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n }\n};\n\n\nSelection.prototype.get = function() {\n return this._selectedElements;\n};\n\nSelection.prototype.isSelected = function(element) {\n return this._selectedElements.indexOf(element) !== -1;\n};\n\n\n/**\n * This method selects one or more elements on the diagram.\n *\n * By passing an additional add parameter you can decide whether or not the element(s)\n * should be added to the already existing selection or not.\n *\n * @method Selection#select\n *\n * @param {Object|Object[]} elements element or array of elements to be selected\n * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false\n */\nSelection.prototype.select = function(elements, add) {\n var selectedElements = this._selectedElements,\n oldSelection = selectedElements.slice();\n\n if (!isArray(elements)) {\n elements = elements ? [ elements ] : [];\n }\n\n // selection may be cleared by passing an empty array or null\n // to the method\n if (add) {\n forEach(elements, function(element) {\n if (selectedElements.indexOf(element) !== -1) {\n // already selected\n return;\n } else {\n selectedElements.push(element);\n }\n });\n } else {\n this._selectedElements = selectedElements = elements.slice();\n }\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n};\n","'use strict';\n\nvar hasPrimaryModifier = require(69).hasPrimaryModifier;\n\n\nfunction SelectionBehavior(eventBus, selection, canvas) {\n\n eventBus.on('create.end', 500, function(e) {\n if (e.context.canExecute) {\n selection.select(e.shape);\n }\n });\n\n eventBus.on('connect.end', 500, function(e) {\n if (e.context.canExecute && e.context.target) {\n selection.select(e.context.target);\n }\n });\n\n eventBus.on('shape.move.end', 500, function(e) {\n selection.select(e.context.shapes);\n });\n\n\n // Shift + click selection\n eventBus.on('element.click', function(event) {\n\n var element = event.element;\n\n // do not select the root element\n // or connections\n if (element === canvas.getRootElement()) {\n element = null;\n }\n\n var isSelected = selection.isSelected(element),\n isMultiSelect = selection.get().length > 1;\n\n // mouse-event: SELECTION_KEY\n var add = hasPrimaryModifier(event);\n\n // select OR deselect element in multi selection\n if (isSelected && isMultiSelect) {\n if (add) {\n return selection.deselect(element);\n } else {\n return selection.select(element);\n }\n } else\n if (!isSelected) {\n selection.select(element, add);\n } else {\n selection.deselect(element);\n }\n });\n}\n\nSelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];\n\nmodule.exports = SelectionBehavior;\n","'use strict';\n\nvar forEach = require(84);\n\nvar MARKER_HOVER = 'hover',\n MARKER_SELECTED = 'selected';\n\n\n/**\n * A plugin that adds a visible selection UI to shapes and connections\n * by appending the <code>hover</code> and <code>selected</code> classes to them.\n *\n * @class\n *\n * Makes elements selectable, too.\n *\n * @param {EventBus} events\n * @param {SelectionService} selection\n * @param {Canvas} canvas\n */\nfunction SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {\n\n this._multiSelectionBox = null;\n\n function addMarker(e, cls) {\n canvas.addMarker(e, cls);\n }\n\n function removeMarker(e, cls) {\n canvas.removeMarker(e, cls);\n }\n\n events.on('element.hover', function(event) {\n addMarker(event.element, MARKER_HOVER);\n });\n\n events.on('element.out', function(event) {\n removeMarker(event.element, MARKER_HOVER);\n });\n\n events.on('selection.changed', function(event) {\n\n function deselect(s) {\n removeMarker(s, MARKER_SELECTED);\n }\n\n function select(s) {\n addMarker(s, MARKER_SELECTED);\n }\n\n var oldSelection = event.oldSelection,\n newSelection = event.newSelection;\n\n forEach(oldSelection, function(e) {\n if (newSelection.indexOf(e) === -1) {\n deselect(e);\n }\n });\n\n forEach(newSelection, function(e) {\n if (oldSelection.indexOf(e) === -1) {\n select(e);\n }\n });\n });\n}\n\nSelectionVisuals.$inject = [\n 'eventBus',\n 'canvas',\n 'selection',\n 'graphicsFactory',\n 'styles'\n];\n\nmodule.exports = SelectionVisuals;\n","module.exports = {\n __init__: [ 'selectionVisuals', 'selectionBehavior' ],\n __depends__: [\n require(48),\n require(50)\n ],\n selection: [ 'type', require(53) ],\n selectionVisuals: [ 'type', require(55) ],\n selectionBehavior: [ 'type', require(54) ]\n};\n","'use strict';\n\nvar assign = require(175),\n inherits = require(79);\n\nvar Refs = require(202);\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),\n outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @namespace djs.model\n */\n\n/**\n * @memberOf djs.model\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n *\n * @abstract\n */\nfunction Base() {\n\n /**\n * The object that backs up the shape\n *\n * @name Base#businessObject\n * @type Object\n */\n Object.defineProperty(this, 'businessObject', {\n writable: true\n });\n\n /**\n * The parent shape\n *\n * @name Base#parent\n * @type Shape\n */\n parentRefs.bind(this, 'parent');\n\n /**\n * @name Base#label\n * @type Label\n */\n labelRefs.bind(this, 'label');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#outgoing\n * @type Array<Connection>\n */\n outgoingRefs.bind(this, 'outgoing');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#incoming\n * @type Array<Connection>\n */\n incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Shape() {\n Base.call(this);\n\n /**\n * The list of children\n *\n * @name Shape#children\n * @type Array<Base>\n */\n parentRefs.bind(this, 'children');\n}\n\ninherits(Shape, Base);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Root() {\n Shape.call(this);\n}\n\ninherits(Root, Shape);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(Label, Shape);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Connection() {\n Base.call(this);\n\n /**\n * The element this connection originates from\n *\n * @name Connection#source\n * @type Base\n */\n outgoingRefs.bind(this, 'source');\n\n /**\n * The element this connection points to\n *\n * @name Connection#target\n * @type Base\n */\n incomingRefs.bind(this, 'target');\n}\n\ninherits(Connection, Base);\n\n\nvar types = {\n connection: Connection,\n shape: Shape,\n label: Label,\n root: Root\n};\n\n/**\n * Creates a new model element of the specified type\n *\n * @method create\n *\n * @example\n *\n * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });\n * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });\n *\n * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });\n *\n * @param {String} type lower-cased model name\n * @param {Object} attrs attributes to initialize the new model instance with\n *\n * @return {Base} the new model instance\n */\nmodule.exports.create = function(type, attrs) {\n var Type = types[type];\n if (!Type) {\n throw new Error('unknown type: <' + type + '>');\n }\n return assign(new Type(), attrs);\n};\n\n\nmodule.exports.Base = Base;\nmodule.exports.Root = Root;\nmodule.exports.Shape = Shape;\nmodule.exports.Connection = Connection;\nmodule.exports.Label = Label;","'use strict';\n\nvar Cursor = require(64),\n ClickTrap = require(62),\n domEvent = require(191),\n Event = require(66);\n\nfunction substract(p1, p2) {\n return {\n x: p1.x - p2.x,\n y: p1.y - p2.y\n };\n}\n\nfunction length(point) {\n return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));\n}\n\n\nvar THRESHOLD = 15;\n\n\nfunction MoveCanvas(eventBus, canvas) {\n\n var container = canvas._container,\n context;\n\n\n function handleMove(event) {\n\n var start = context.start,\n position = Event.toPoint(event),\n delta = substract(position, start);\n\n if (!context.dragging && length(delta) > THRESHOLD) {\n context.dragging = true;\n\n // prevent mouse click in this\n // interaction sequence\n ClickTrap.install();\n\n Cursor.set('move');\n }\n\n if (context.dragging) {\n\n var lastPosition = context.last || context.start;\n\n delta = substract(position, lastPosition);\n\n canvas.scroll({\n dx: delta.x,\n dy: delta.y\n });\n\n context.last = position;\n }\n\n // prevent select\n event.preventDefault();\n }\n\n\n function handleEnd(event) {\n domEvent.unbind(document, 'mousemove', handleMove);\n domEvent.unbind(document, 'mouseup', handleEnd);\n\n context = null;\n\n Cursor.unset();\n\n // prevent select\n Event.stopEvent(event);\n }\n\n function handleStart(event) {\n\n // reject non-left left mouse button or modifier key\n if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n context = {\n start: Event.toPoint(event)\n };\n\n domEvent.bind(document, 'mousemove', handleMove);\n domEvent.bind(document, 'mouseup', handleEnd);\n\n // prevent select\n Event.stopEvent(event);\n }\n\n domEvent.bind(container, 'mousedown', handleStart);\n}\n\n\nMoveCanvas.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = MoveCanvas;\n","module.exports = {\n __init__: [ 'moveCanvas' ],\n moveCanvas: [ 'type', require(58) ]\n};","'use strict';\n\nvar domEvent = require(191);\n\nvar hasPrimaryModifier = require(69).hasPrimaryModifier,\n hasSecondaryModifier = require(69).hasSecondaryModifier;\n\nvar isMac = require(70).isMac;\n\n\nfunction ZoomScroll(events, canvas) {\n\n var RANGE = { min: 0.2, max: 4 };\n\n function cap(scale) {\n return Math.max(RANGE.min, Math.min(RANGE.max, scale));\n }\n\n function reset() {\n canvas.zoom('fit-viewport');\n }\n\n function zoom(direction, position) {\n\n var currentZoom = canvas.zoom();\n var factor = Math.pow(1 + Math.abs(direction) , direction > 0 ? 1 : -1);\n\n canvas.zoom(cap(currentZoom * factor), position);\n }\n\n function scroll(delta) {\n canvas.scroll(delta);\n }\n\n function init(element) {\n\n domEvent.bind(element, 'wheel', function(event) {\n\n event.preventDefault();\n\n // mouse-event: SELECTION_KEY\n // mouse-event: AND_KEY\n var isVerticalScroll = hasPrimaryModifier(event),\n isHorizontalScroll = hasSecondaryModifier(event);\n\n var factor;\n\n if (isVerticalScroll || isHorizontalScroll) {\n\n if (isMac) {\n factor = event.deltaMode === 0 ? 1.25 : 50;\n } else {\n factor = event.deltaMode === 0 ? 1/40 : 1/2;\n }\n\n var delta = {};\n\n if (isHorizontalScroll) {\n delta.dx = (factor * (event.deltaX || event.deltaY));\n } else {\n delta.dy = (factor * event.deltaY);\n }\n\n scroll(delta);\n } else {\n factor = (event.deltaMode === 0 ? 1/40 : 1/2);\n\n var elementRect = element.getBoundingClientRect();\n\n var offset = {\n x: event.clientX - elementRect.left,\n y: event.clientY - elementRect.top\n };\n\n // zoom in relative to diagram {x,y} coordinates\n zoom(event.deltaY * factor / (-5), offset);\n }\n });\n }\n\n events.on('canvas.init', function(e) {\n init(canvas._container);\n });\n\n // API\n this.zoom = zoom;\n this.reset = reset;\n}\n\n\nZoomScroll.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = ZoomScroll;\n\n","module.exports = {\n __init__: [ 'zoomScroll' ],\n zoomScroll: [ 'type', require(60) ]\n};","'use strict';\n\nvar domEvent = require(191),\n stopEvent = require(66).stopEvent;\n\nfunction trap(event) {\n stopEvent(event);\n\n toggle(false);\n}\n\nfunction toggle(active) {\n domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);\n}\n\n/**\n * Installs a click trap that prevents a ghost click following a dragging operation.\n *\n * @return {Function} a function to immediately remove the installed trap.\n */\nfunction install() {\n\n toggle(true);\n\n return function() {\n toggle(false);\n };\n}\n\nmodule.exports.install = install;","'use strict';\n\n/**\n * Failsafe remove an element from a collection\n *\n * @param {Array<Object>} [collection]\n * @param {Object} [element]\n *\n * @return {Object} the element that got removed or undefined\n */\nmodule.exports.remove = function(collection, element) {\n\n if (!collection || !element) {\n return;\n }\n\n var idx = collection.indexOf(element);\n if (idx === -1) {\n return;\n }\n\n collection.splice(idx, 1);\n\n return element;\n};\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n * @param {Number} idx\n */\nmodule.exports.add = function(collection, element, idx) {\n\n if (!collection || !element) {\n return;\n }\n\n if (isNaN(idx)) {\n idx = -1;\n }\n\n var currentIdx = collection.indexOf(element);\n\n if (currentIdx !== -1) {\n\n if (currentIdx === idx) {\n // nothing to do, position has not changed\n return;\n } else {\n\n if (idx !== -1) {\n // remove from current position\n collection.splice(currentIdx, 1);\n } else {\n // already exists in collection\n return;\n }\n }\n }\n\n if (idx !== -1) {\n // insert at specified position\n collection.splice(idx, 0, element);\n } else {\n // push to end\n collection.push(element);\n }\n};\n\n\n/**\n * Fail get the index of an element in a collection.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n *\n * @return {Number} the index or -1 if collection or element do\n * not exist or the element is not contained.\n */\nmodule.exports.indexOf = function(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n return collection.indexOf(element);\n};\n","'use strict';\n\nvar domClasses = require(187);\n\nvar CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;\n\n\nmodule.exports.set = function(mode) {\n var classes = domClasses(document.body);\n\n classes.removeMatching(CURSOR_CLS_PATTERN);\n\n if (mode) {\n classes.add('djs-cursor-' + mode);\n }\n};\n\nmodule.exports.unset = function() {\n this.set(null);\n};","'use strict';\n\nvar isArray = require(166),\n isNumber = require(169),\n groupBy = require(85),\n forEach = require(84);\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Array<Object>} elements\n * @param {Object} e\n * @param {Boolean} unique\n */\nfunction add(elements, e, unique) {\n var canAdd = !unique || elements.indexOf(e) === -1;\n\n if (canAdd) {\n elements.push(e);\n }\n\n return canAdd;\n}\n\nfunction eachElement(elements, fn, depth) {\n\n depth = depth || 0;\n\n forEach(elements, function(s, i) {\n var filter = fn(s, i, depth);\n\n if (isArray(filter) && filter.length) {\n eachElement(filter, fn, depth + 1);\n }\n });\n}\n\n/**\n * Collects self + child elements up to a given depth from a list of elements.\n *\n * @param {Array<djs.model.Base>} elements the elements to select the children from\n * @param {Boolean} unique whether to return a unique result set (no duplicates)\n * @param {Number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Array<djs.model.Base>} found elements\n */\nfunction selfAndChildren(elements, unique, maxDepth) {\n var result = [],\n processedChildren = [];\n\n eachElement(elements, function(element, i, depth) {\n add(result, element, unique);\n\n var children = element.children;\n\n // max traversal depth not reached yet\n if (maxDepth === -1 || depth < maxDepth) {\n\n // children exist && children not yet processed\n if (children && add(processedChildren, children, unique)) {\n return children;\n }\n }\n });\n\n return result;\n}\n\n/**\n * Return self + direct children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndDirectChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, 1);\n}\n\n/**\n * Return self + ALL children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndAllChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, -1);\n}\n\n/**\n * Gets the the closure fo all selected elements,\n * their connections and\n *\n * @param {Array<djs.model.Base>} elements\n * @return {Object} enclosure\n */\nfunction getClosure(elements) {\n\n // original elements passed to this function\n var topLevel = groupBy(elements, function(e) { return e.id; });\n\n var allShapes = {},\n allConnections = {},\n enclosedElements = {},\n enclosedConnections = {};\n\n function handleConnection(c) {\n if (topLevel[c.source.id] && topLevel[c.target.id]) {\n topLevel[c.id] = c;\n }\n\n // not enclosed as a child, but maybe logically\n // (connecting two moved elements?)\n if (allShapes[c.source.id] && allShapes[c.target.id]) {\n enclosedConnections[c.id] = enclosedElements[c.id] = c;\n }\n\n allConnections[c.id] = c;\n }\n\n function handleElement(element) {\n\n enclosedElements[element.id] = element;\n\n if (element.waypoints) {\n // remember connection\n enclosedConnections[element.id] = allConnections[element.id] = element;\n } else {\n // remember shape\n allShapes[element.id] = element;\n\n // remember all connections\n forEach(element.incoming, handleConnection);\n\n forEach(element.outgoing, handleConnection);\n\n // recurse into children\n return element.children;\n }\n }\n\n eachElement(elements, handleElement);\n\n return {\n allShapes: allShapes,\n allConnections: allConnections,\n topLevel: topLevel,\n enclosedConnections: enclosedConnections,\n enclosedElements: enclosedElements\n };\n}\n\n/**\n * Returns the surrounding bbox for all elements in the array or the element primitive.\n */\nfunction getBBox(elements, stopRecursion) {\n\n stopRecursion = !!stopRecursion;\n if (!isArray(elements)) {\n elements = [elements];\n }\n\n var minX,\n minY,\n maxX,\n maxY;\n\n forEach(elements, function(element) {\n\n // If element is a connection the bbox must be computed first\n var bbox = element;\n if (element.waypoints && !stopRecursion) {\n bbox = getBBox(element.waypoints, true);\n }\n\n var x = bbox.x,\n y = bbox.y,\n height = bbox.height || 0,\n width = bbox.width || 0;\n\n if (x < minX || minX === undefined) {\n minX = x;\n }\n if (y < minY || minY === undefined) {\n minY = y;\n }\n\n if ((x + width) > maxX || maxX === undefined) {\n maxX = x + width;\n }\n if ((y + height) > maxY || maxY === undefined) {\n maxY = y + height;\n }\n });\n\n return {\n x: minX,\n y: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n}\n\n\n/**\n * Returns all elements that are enclosed from the bounding box.\n *\n * @param {Array<Object>} elements List of Elements to search through\n * @param {Object} bbox the enclosing bbox.\n * <ul>\n * <li>If bbox.(width|height) is not specified\n * the method returns all elements with element.x/y &gt; bbox.x/y\n * </li>\n * <li>If only bbox.x or bbox.y is specified, method return all elements with\n * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>\n * </ul>\n *\n */\nfunction getEnclosedElements(elements, bbox) {\n\n var filteredElements = {};\n\n forEach(elements, function(element) {\n\n var e = element;\n\n if (e.waypoints) {\n e = getBBox(e);\n }\n\n if (!isNumber(bbox.y) && (e.x > bbox.x)) {\n filteredElements[element.id] = element;\n }\n if (!isNumber(bbox.x) && (e.y > bbox.y)) {\n filteredElements[element.id] = element;\n }\n if (e.x > bbox.x && e.y > bbox.y) {\n if (isNumber(bbox.width) && isNumber(bbox.height) &&\n e.width + e.x < bbox.width + bbox.x &&\n e.height + e.y < bbox.height + bbox.y) {\n\n filteredElements[element.id] = element;\n } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {\n filteredElements[element.id] = element;\n }\n }\n });\n\n return filteredElements;\n}\n\n\n\nmodule.exports.eachElement = eachElement;\nmodule.exports.selfAndDirectChildren = selfAndDirectChildren;\nmodule.exports.selfAndAllChildren = selfAndAllChildren;\nmodule.exports.getBBox = getBBox;\nmodule.exports.getEnclosedElements = getEnclosedElements;\n\nmodule.exports.getClosure = getClosure;\n","'use strict';\n\nfunction __preventDefault(event) {\n return event && event.preventDefault();\n}\n\nfunction __stopPropagation(event, immediate) {\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (immediate && event.stopImmediatePropagation) {\n event.stopImmediatePropagation();\n }\n}\n\n\nfunction getOriginal(event) {\n return event.originalEvent || event.srcEvent;\n}\n\nmodule.exports.getOriginal = getOriginal;\n\n\nfunction stopEvent(event, immediate) {\n stopPropagation(event, immediate);\n preventDefault(event);\n}\n\nmodule.exports.stopEvent = stopEvent;\n\n\nfunction preventDefault(event) {\n __preventDefault(event);\n __preventDefault(getOriginal(event));\n}\n\nmodule.exports.preventDefault = preventDefault;\n\n\nfunction stopPropagation(event, immediate) {\n __stopPropagation(event, immediate);\n __stopPropagation(getOriginal(event), immediate);\n}\n\nmodule.exports.stopPropagation = stopPropagation;\n\n\nfunction toPoint(event) {\n\n if (event.pointers && event.pointers.length) {\n event = event.pointers[0];\n }\n\n if (event.touches && event.touches.length) {\n event = event.touches[0];\n }\n\n return event ? {\n x: event.clientX,\n y: event.clientY\n } : null;\n}\n\nmodule.exports.toPoint = toPoint;\n","'use strict';\n\n/**\n * SVGs for elements are generated by the {@link GraphicsFactory}.\n *\n * This utility gives quick access to the important semantic\n * parts of an element.\n */\n\n/**\n * Returns the visual part of a diagram element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Snap<SVGElement>}\n */\nfunction getVisual(gfx) {\n return gfx.select('.djs-visual');\n}\n\n/**\n * Returns the children for a given diagram element.\n *\n * @param {Snap<SVGElement>} gfx\n * @return {Snap<SVGElement>}\n */\nfunction getChildren(gfx) {\n return gfx.parent().children()[1];\n}\n\n/**\n * Returns the visual bbox of an element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Bounds}\n */\nfunction getBBox(gfx) {\n return getVisual(gfx).select('*').getBBox();\n}\n\n\nmodule.exports.getVisual = getVisual;\nmodule.exports.getChildren = getChildren;\nmodule.exports.getBBox = getBBox;","'use strict';\n\n/**\n * Util that provides unique IDs.\n *\n * @class djs.util.IdGenerator\n * @constructor\n * @memberOf djs.util\n *\n * The ids can be customized via a given prefix and contain a random value to avoid collisions.\n *\n * @param {String} prefix a prefix to prepend to generated ids (for better readability)\n */\nfunction IdGenerator(prefix) {\n\n this._counter = 0;\n this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';\n}\n\nmodule.exports = IdGenerator;\n\n/**\n * Returns a next unique ID.\n *\n * @method djs.util.IdGenerator#next\n *\n * @returns {String} the id\n */\nIdGenerator.prototype.next = function() {\n return this._prefix + (++this._counter);\n};\n","'use strict';\n\nvar getOriginalEvent = require(66).getOriginal;\n\nvar isMac = require(70).isMac;\n\n\nfunction isPrimaryButton(event) {\n // button === 0 -> left áka primary mouse button\n return !(getOriginalEvent(event) || event).button;\n}\n\nmodule.exports.isPrimaryButton = isPrimaryButton;\n\nmodule.exports.isMac = isMac;\n\nmodule.exports.hasPrimaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n if (!isPrimaryButton(event)) {\n return false;\n }\n\n // Use alt as primary modifier key for mac OS\n if (isMac()) {\n return originalEvent.altKey;\n } else {\n return originalEvent.ctrlKey;\n }\n};\n\n\nmodule.exports.hasSecondaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n return isPrimaryButton(event) && originalEvent.shiftKey;\n};\n","'use strict';\n\nmodule.exports.isMac = function isMac() {\n return (/mac/i).test(navigator.platform);\n};","'use strict';\n\nvar isObject = require(170),\n assign = require(175),\n forEach = require(84),\n reduce = require(88),\n merge = require(178);\n\nvar Snap = require(74);\n\nvar DEFAULT_BOX_PADDING = 0;\n\nvar DEFAULT_LABEL_SIZE = {\n width: 150,\n height: 50\n};\n\n\nfunction parseAlign(align) {\n\n var parts = align.split('-');\n\n return {\n horizontal: parts[0] || 'center',\n vertical: parts[1] || 'top'\n };\n}\n\nfunction parsePadding(padding) {\n\n if (isObject(padding)) {\n return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);\n } else {\n return {\n top: padding,\n left: padding,\n right: padding,\n bottom: padding\n };\n }\n}\n\nfunction getTextBBox(text, fakeText) {\n fakeText.textContent = text;\n return fakeText.getBBox();\n}\n\n\n/**\n * Layout the next line and return the layouted element.\n *\n * Alters the lines passed.\n *\n * @param {Array<String>} lines\n * @return {Object} the line descriptor, an object { width, height, text }\n */\nfunction layoutNext(lines, maxWidth, fakeText) {\n\n var originalLine = lines.shift(),\n fitLine = originalLine;\n\n var textBBox;\n\n while (true) {\n textBBox = getTextBBox(fitLine, fakeText);\n\n textBBox.width = fitLine ? textBBox.width : 0;\n\n // try to fit\n if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {\n return fit(lines, fitLine, originalLine, textBBox);\n }\n\n\n fitLine = shortenLine(fitLine, textBBox.width, maxWidth);\n }\n}\n\nfunction fit(lines, fitLine, originalLine, textBBox) {\n if (fitLine.length < originalLine.length) {\n var nextLine = lines[0] || '',\n remainder = originalLine.slice(fitLine.length).trim();\n\n if (/-/s*$/.test(remainder)) {\n nextLine = remainder.replace(/-/s*$/, '') + nextLine.replace(/^/s+/, '');\n } else {\n nextLine = remainder + ' ' + nextLine;\n }\n\n lines[0] = nextLine;\n }\n return { width: textBBox.width, height: textBBox.height, text: fitLine };\n}\n\n\n/**\n * Shortens a line based on spacing and hyphens.\n * Returns the shortened result on success.\n *\n * @param {String} line\n * @param {Number} maxLength the maximum characters of the string\n * @return {String} the shortened string\n */\nfunction semanticShorten(line, maxLength) {\n var parts = line.split(/(/s|-)/g),\n part,\n shortenedParts = [],\n length = 0;\n\n // try to shorten via spaces + hyphens\n if (parts.length > 1) {\n while ((part = parts.shift())) {\n if (part.length + length < maxLength) {\n shortenedParts.push(part);\n length += part.length;\n } else {\n // remove previous part, too if hyphen does not fit anymore\n if (part === '-') {\n shortenedParts.pop();\n }\n\n break;\n }\n }\n }\n\n return shortenedParts.join('');\n}\n\n\nfunction shortenLine(line, width, maxWidth) {\n var length = Math.max(line.length * (maxWidth / width), 1);\n\n // try to shorten semantically (i.e. based on spaces and hyphens)\n var shortenedLine = semanticShorten(line, length);\n\n if (!shortenedLine) {\n\n // force shorten by cutting the long word\n shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));\n }\n\n return shortenedLine;\n}\n\n\n/**\n * Creates a new label utility\n *\n * @param {Object} config\n * @param {Dimensions} config.size\n * @param {Number} config.padding\n * @param {Object} config.style\n * @param {String} config.align\n */\nfunction Text(config) {\n\n this._config = assign({}, {\n size: DEFAULT_LABEL_SIZE,\n padding: DEFAULT_BOX_PADDING,\n style: {},\n align: 'center-top'\n }, config || {});\n}\n\n\n/**\n * Create a label in the parent node.\n *\n * @method Text#createText\n *\n * @param {SVGElement} parent the parent to draw the label on\n * @param {String} text the text to render on the label\n * @param {Object} options\n * @param {String} options.align how to align in the bounding box.\n * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.\n * @param {String} options.style style to be applied to the text\n *\n * @return {SVGText} the text element created\n */\nText.prototype.createText = function(parent, text, options) {\n\n var box = merge({}, this._config.size, options.box || {}),\n style = merge({}, this._config.style, options.style || {}),\n align = parseAlign(options.align || this._config.align),\n padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);\n\n var lines = text.split(//r?/n/g),\n layouted = [];\n\n var maxWidth = box.width - padding.left - padding.right;\n\n // FF regression: ensure text is shown during rendering\n // by attaching it directly to the body\n var fakeText = parent.paper.text(0, 0, '').attr(style).node;\n\n while (lines.length) {\n layouted.push(layoutNext(lines, maxWidth, fakeText));\n }\n\n var totalHeight = reduce(layouted, function(sum, line, idx) {\n return sum + line.height;\n }, 0);\n\n // the y position of the next line\n var y, x;\n\n switch (align.vertical) {\n case 'middle':\n y = (box.height - totalHeight) / 2 - layouted[0].height / 4;\n break;\n\n default:\n y = padding.top;\n }\n\n var textElement = parent.text().attr(style);\n\n forEach(layouted, function(line) {\n y += line.height;\n\n switch (align.horizontal) {\n case 'left':\n x = padding.left;\n break;\n\n case 'right':\n x = (maxWidth - padding.right - line.width);\n break;\n\n default:\n // aka center\n x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);\n }\n\n\n var tspan = Snap.create('tspan', { x: x, y: y }).node;\n tspan.textContent = line.text;\n\n textElement.append(tspan);\n });\n\n // remove fake text\n fakeText.parentNode.removeChild(fakeText);\n\n return textElement;\n};\n\n\nmodule.exports = Text;","// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ┌────────────────────────────────────────────────────────────┐ //\n// │ Eve 0.4.2 - JavaScript Events Library │ //\n// ├────────────────────────────────────────────────────────────┤ //\n// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ //\n// └────────────────────────────────────────────────────────────┘ //\n\n(function (glob) {\n var version = \"0.4.2\",\n has = \"hasOwnProperty\",\n separator = /[/.//]/,\n comaseparator = //s*,/s*/,\n wildcard = \"*\",\n fun = function () {},\n numsort = function (a, b) {\n return a - b;\n },\n current_event,\n stop,\n events = {n: {}},\n firstDefined = function () {\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n lastDefined = function () {\n var i = this.length;\n while (--i) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n /*/\n * eve\n [ method ]\n\n * Fires event with given `name`, given scope and other parameters.\n\n > Arguments\n\n - name (string) name of the *event*, dot (`.`) or slash (`/`) separated\n - scope (object) context for the event handlers\n - varargs (...) the rest of arguments will be sent to event handlers\n\n = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.\n /*/\n eve = function (name, scope) {\n name = String(name);\n var e = events,\n oldstop = stop,\n args = Array.prototype.slice.call(arguments, 2),\n listeners = eve.listeners(name),\n z = 0,\n f = false,\n l,\n indexed = [],\n queue = {},\n out = [],\n ce = current_event,\n errors = [];\n out.firstDefined = firstDefined;\n out.lastDefined = lastDefined;\n current_event = name;\n stop = 0;\n for (var i = 0, ii = listeners.length; i < ii; i++) if (\"zIndex\" in listeners[i]) {\n indexed.push(listeners[i].zIndex);\n if (listeners[i].zIndex < 0) {\n queue[listeners[i].zIndex] = listeners[i];\n }\n }\n indexed.sort(numsort);\n while (indexed[z] < 0) {\n l = queue[indexed[z++]];\n out.push(l.apply(scope, args));\n if (stop) {\n stop = oldstop;\n return out;\n }\n }\n for (i = 0; i < ii; i++) {\n l = listeners[i];\n if (\"zIndex\" in l) {\n if (l.zIndex == indexed[z]) {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n do {\n z++;\n l = queue[indexed[z]];\n l && out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n } while (l)\n } else {\n queue[l.zIndex] = l;\n }\n } else {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n }\n }\n stop = oldstop;\n current_event = ce;\n return out;\n };\n // Undocumented. Debug only.\n eve._events = events;\n /*/\n * eve.listeners\n [ method ]\n\n * Internal method which gives you array of all event handlers that will be triggered by the given `name`.\n\n > Arguments\n\n - name (string) name of the event, dot (`.`) or slash (`/`) separated\n\n = (array) array of event handlers\n /*/\n eve.listeners = function (name) {\n var names = name.split(separator),\n e = events,\n item,\n items,\n k,\n i,\n ii,\n j,\n jj,\n nes,\n es = [e],\n out = [];\n for (i = 0, ii = names.length; i < ii; i++) {\n nes = [];\n for (j = 0, jj = es.length; j < jj; j++) {\n e = es[j].n;\n items = [e[names[i]], e[wildcard]];\n k = 2;\n while (k--) {\n item = items[k];\n if (item) {\n nes.push(item);\n out = out.concat(item.f || []);\n }\n }\n }\n es = nes;\n }\n return out;\n };\n \n /*/\n * eve.on\n [ method ]\n **\n * Binds given event handler with a given name. You can use wildcards “`*`” for the names:\n | eve.on(\"*.under.*\", f);\n | eve(\"mouse.under.floor\"); // triggers f\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. \n > Example:\n | eve.on(\"mouse\", eatIt)(2);\n | eve.on(\"mouse\", scream);\n | eve.on(\"mouse\", catchIt)(1);\n * This will ensure that `catchIt` function will be called before `eatIt`.\n *\n * If you want to put your handler before non-indexed handlers, specify a negative value.\n * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.\n /*/\n eve.on = function (name, f) {\n name = String(name);\n if (typeof f != \"function\") {\n return function () {};\n }\n var names = name.split(comaseparator);\n for (var i = 0, ii = names.length; i < ii; i++) {\n (function (name) {\n var names = name.split(separator),\n e = events,\n exist;\n for (var i = 0, ii = names.length; i < ii; i++) {\n e = e.n;\n e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});\n }\n e.f = e.f || [];\n for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {\n exist = true;\n break;\n }\n !exist && e.f.push(f);\n }(names[i]));\n }\n return function (zIndex) {\n if (+zIndex == +zIndex) {\n f.zIndex = +zIndex;\n }\n };\n };\n /*/\n * eve.f\n [ method ]\n **\n * Returns function that will fire given event with optional arguments.\n * Arguments that will be passed to the result function will be also\n * concated to the list of final arguments.\n | el.onclick = eve.f(\"click\", 1, 2);\n | eve.on(\"click\", function (a, b, c) {\n | console.log(a, b, c); // 1, 2, [event object]\n | });\n > Arguments\n - event (string) event name\n - varargs (…) and any other arguments\n = (function) possible event handler function\n /*/\n eve.f = function (event) {\n var attrs = [].slice.call(arguments, 1);\n return function () {\n eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));\n };\n };\n /*/\n * eve.stop\n [ method ]\n **\n * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.\n /*/\n eve.stop = function () {\n stop = 1;\n };\n /*/\n * eve.nt\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n > Arguments\n **\n - subname (string) #optional subname of the event\n **\n = (string) name of the event, if `subname` is not specified\n * or\n = (boolean) `true`, if current event’s name contains `subname`\n /*/\n eve.nt = function (subname) {\n if (subname) {\n return new RegExp(\"(?://.|///|^)\" + subname + \"(?://.|///|$)\").test(current_event);\n }\n return current_event;\n };\n /*/\n * eve.nts\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n **\n = (array) names of the event\n /*/\n eve.nts = function () {\n return current_event.split(separator);\n };\n /*/\n * eve.off\n [ method ]\n **\n * Removes given function from the list of event listeners assigned to given name.\n * If no arguments specified all the events will be cleared.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n /*/\n /*/\n * eve.unbind\n [ method ]\n **\n * See @eve.off\n /*/\n eve.off = eve.unbind = function (name, f) {\n if (!name) {\n eve._events = events = {n: {}};\n return;\n }\n var names = name.split(comaseparator);\n if (names.length > 1) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n eve.off(names[i], f);\n }\n return;\n }\n names = name.split(separator);\n var e,\n key,\n splice,\n i, ii, j, jj,\n cur = [events];\n for (i = 0, ii = names.length; i < ii; i++) {\n for (j = 0; j < cur.length; j += splice.length - 2) {\n splice = [j, 1];\n e = cur[j].n;\n if (names[i] != wildcard) {\n if (e[names[i]]) {\n splice.push(e[names[i]]);\n }\n } else {\n for (key in e) if (e[has](key)) {\n splice.push(e[key]);\n }\n }\n cur.splice.apply(cur, splice);\n }\n }\n for (i = 0, ii = cur.length; i < ii; i++) {\n e = cur[i];\n while (e.n) {\n if (f) {\n if (e.f) {\n for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {\n e.f.splice(j, 1);\n break;\n }\n !e.f.length && delete e.f;\n }\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n var funcs = e.n[key].f;\n for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {\n funcs.splice(j, 1);\n break;\n }\n !funcs.length && delete e.n[key].f;\n }\n } else {\n delete e.f;\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n delete e.n[key].f;\n }\n }\n e = e.n;\n }\n }\n };\n /*/\n * eve.once\n [ method ]\n **\n * Binds given event handler with a given name to only run once then unbind itself.\n | eve.once(\"login\", f);\n | eve(\"login\"); // triggers f\n | eve(\"login\"); // no listeners\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) same return function as @eve.on\n /*/\n eve.once = function (name, f) {\n var f2 = function () {\n eve.unbind(name, f2);\n return f.apply(this, arguments);\n };\n return eve.on(name, f2);\n };\n /*/\n * eve.version\n [ property (string) ]\n **\n * Current version of the library.\n /*/\n eve.version = version;\n eve.toString = function () {\n return \"You are running Eve \" + version;\n };\n (typeof module != \"undefined\" && module.exports) ? (module.exports = eve) : (typeof define === \"function\" && define.amd ? (define(\"eve\", [], function() { return eve; })) : (glob.eve = eve));\n})(this);\n","// Snap.svg 0.3.0\n// \n// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// \n// build: 2014-09-08\n\n(function (glob, factory) {\n // AMD support\n if (typeof define === \"function\" && define.amd) {\n // Define as an anonymous module\n define([\"eve\"], function( eve ) {\n return factory(glob, eve);\n });\n } else if (typeof exports !== 'undefined') {\n // Next for Node.js or CommonJS\n var eve = require(72);\n module.exports = factory(glob, eve);\n } else {\n // Browser globals (glob is window)\n // Snap adds itself to window\n factory(glob, glob.eve);\n }\n}(window || this, function (window, eve) {\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar mina = (function (eve) {\n var animations = {},\n requestAnimFrame = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n },\n isArray = Array.isArray || function (a) {\n return a instanceof Array ||\n Object.prototype.toString.call(a) == \"[object Array]\";\n },\n idgen = 0,\n idprefix = \"M\" + (+new Date).toString(36),\n ID = function () {\n return idprefix + (idgen++).toString(36);\n },\n diff = function (a, b, A, B) {\n if (isArray(a)) {\n res = [];\n for (var i = 0, ii = a.length; i < ii; i++) {\n res[i] = diff(a[i], b, A[i], B);\n }\n return res;\n }\n var dif = (A - a) / (B - b);\n return function (bb) {\n return a + dif * (bb - b);\n };\n },\n timer = Date.now || function () {\n return +new Date;\n },\n sta = function (val) {\n var a = this;\n if (val == null) {\n return a.s;\n }\n var ds = a.s - val;\n a.b += a.dur * ds;\n a.B += a.dur * ds;\n a.s = val;\n },\n speed = function (val) {\n var a = this;\n if (val == null) {\n return a.spd;\n }\n a.spd = val;\n },\n duration = function (val) {\n var a = this;\n if (val == null) {\n return a.dur;\n }\n a.s = a.s * val / a.dur;\n a.dur = val;\n },\n stopit = function () {\n var a = this;\n delete animations[a.id];\n a.update();\n eve(\"mina.stop.\" + a.id, a);\n },\n pause = function () {\n var a = this;\n if (a.pdif) {\n return;\n }\n delete animations[a.id];\n a.update();\n a.pdif = a.get() - a.b;\n },\n resume = function () {\n var a = this;\n if (!a.pdif) {\n return;\n }\n a.b = a.get() - a.pdif;\n delete a.pdif;\n animations[a.id] = a;\n },\n update = function () {\n var a = this,\n res;\n if (isArray(a.start)) {\n res = [];\n for (var j = 0, jj = a.start.length; j < jj; j++) {\n res[j] = +a.start[j] +\n (a.end[j] - a.start[j]) * a.easing(a.s);\n }\n } else {\n res = +a.start + (a.end - a.start) * a.easing(a.s);\n }\n a.set(res);\n },\n frame = function () {\n var len = 0;\n for (var i in animations) if (animations.hasOwnProperty(i)) {\n var a = animations[i],\n b = a.get(),\n res;\n len++;\n a.s = (b - a.b) / (a.dur / a.spd);\n if (a.s >= 1) {\n delete animations[i];\n a.s = 1;\n len--;\n (function (a) {\n setTimeout(function () {\n eve(\"mina.finish.\" + a.id, a);\n });\n }(a));\n }\n a.update();\n }\n len && requestAnimFrame(frame);\n },\n /*/\n * mina\n [ method ]\n **\n * Generic animation of numbers\n **\n - a (number) start _slave_ number\n - A (number) end _slave_ number\n - b (number) start _master_ number (start time in general case)\n - B (number) end _master_ number (end time in gereal case)\n - get (function) getter of _master_ number (see @mina.time)\n - set (function) setter of _slave_ number\n - easing (function) #optional easing function, default is @mina.linear\n = (object) animation descriptor\n o {\n o id (string) animation id,\n o start (number) start _slave_ number,\n o end (number) end _slave_ number,\n o b (number) start _master_ number,\n o s (number) animation status (0..1),\n o dur (number) animation duration,\n o spd (number) animation speed,\n o get (function) getter of _master_ number (see @mina.time),\n o set (function) setter of _slave_ number,\n o easing (function) easing function, default is @mina.linear,\n o status (function) status getter/setter,\n o speed (function) speed getter/setter,\n o duration (function) duration getter/setter,\n o stop (function) animation stopper\n o pause (function) pauses the animation\n o resume (function) resumes the animation\n o update (function) calles setter with the right value of the animation\n o }\n /*/\n mina = function (a, A, b, B, get, set, easing) {\n var anim = {\n id: ID(),\n start: a,\n end: A,\n b: b,\n s: 0,\n dur: B - b,\n spd: 1,\n get: get,\n set: set,\n easing: easing || mina.linear,\n status: sta,\n speed: speed,\n duration: duration,\n stop: stopit,\n pause: pause,\n resume: resume,\n update: update\n };\n animations[anim.id] = anim;\n var len = 0, i;\n for (i in animations) if (animations.hasOwnProperty(i)) {\n len++;\n if (len == 2) {\n break;\n }\n }\n len == 1 && requestAnimFrame(frame);\n return anim;\n };\n /*/\n * mina.time\n [ method ]\n **\n * Returns the current time. Equivalent to:\n | function () {\n | return (new Date).getTime();\n | }\n /*/\n mina.time = timer;\n /*/\n * mina.getById\n [ method ]\n **\n * Returns an animation by its id\n - id (string) animation's id\n = (object) See @mina\n /*/\n mina.getById = function (id) {\n return animations[id] || null;\n };\n\n /*/\n * mina.linear\n [ method ]\n **\n * Default linear easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.linear = function (n) {\n return n;\n };\n /*/\n * mina.easeout\n [ method ]\n **\n * Easeout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeout = function (n) {\n return Math.pow(n, 1.7);\n };\n /*/\n * mina.easein\n [ method ]\n **\n * Easein easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easein = function (n) {\n return Math.pow(n, .48);\n };\n /*/\n * mina.easeinout\n [ method ]\n **\n * Easeinout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeinout = function (n) {\n if (n == 1) {\n return 1;\n }\n if (n == 0) {\n return 0;\n }\n var q = .48 - n / 1.04,\n Q = Math.sqrt(.1734 + q * q),\n x = Q - q,\n X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),\n y = -Q - q,\n Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),\n t = X + Y + .5;\n return (1 - t) * 3 * t * t + t * t * t;\n };\n /*/\n * mina.backin\n [ method ]\n **\n * Backin easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backin = function (n) {\n if (n == 1) {\n return 1;\n }\n var s = 1.70158;\n return n * n * ((s + 1) * n - s);\n };\n /*/\n * mina.backout\n [ method ]\n **\n * Backout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backout = function (n) {\n if (n == 0) {\n return 0;\n }\n n = n - 1;\n var s = 1.70158;\n return n * n * ((s + 1) * n + s) + 1;\n };\n /*/\n * mina.elastic\n [ method ]\n **\n * Elastic easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.elastic = function (n) {\n if (n == !!n) {\n return n;\n }\n return Math.pow(2, -10 * n) * Math.sin((n - .075) *\n (2 * Math.PI) / .3) + 1;\n };\n /*/\n * mina.bounce\n [ method ]\n **\n * Bounce easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.bounce = function (n) {\n var s = 7.5625,\n p = 2.75,\n l;\n if (n < (1 / p)) {\n l = s * n * n;\n } else {\n if (n < (2 / p)) {\n n -= (1.5 / p);\n l = s * n * n + .75;\n } else {\n if (n < (2.5 / p)) {\n n -= (2.25 / p);\n l = s * n * n + .9375;\n } else {\n n -= (2.625 / p);\n l = s * n * n + .984375;\n }\n }\n }\n return l;\n };\n window.mina = mina;\n return mina;\n})(typeof eve == \"undefined\" ? function () {} : eve);\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nvar Snap = (function(root) {\nSnap.version = \"0.3.0\";\n/*/\n * Snap\n [ method ]\n **\n * Creates a drawing surface or wraps existing SVG element.\n **\n - width (number|string) width of surface\n - height (number|string) height of surface\n * or\n - DOM (SVGElement) element to be wrapped into Snap structure\n * or\n - array (array) array of elements (will return set of elements)\n * or\n - query (string) CSS query selector\n = (object) @Element\n/*/\nfunction Snap(w, h) {\n if (w) {\n if (w.tagName) {\n return wrap(w);\n }\n if (is(w, \"array\") && Snap.set) {\n return Snap.set.apply(Snap, w);\n }\n if (w instanceof Element) {\n return w;\n }\n if (h == null) {\n w = glob.doc.querySelector(w);\n return wrap(w);\n }\n }\n w = w == null ? \"100%\" : w;\n h = h == null ? \"100%\" : h;\n return new Paper(w, h);\n}\nSnap.toString = function () {\n return \"Snap v\" + this.version;\n};\nSnap._ = {};\nvar glob = {\n win: root.window,\n doc: root.window.document\n};\nSnap._.glob = glob;\nvar has = \"hasOwnProperty\",\n Str = String,\n toFloat = parseFloat,\n toInt = parseInt,\n math = Math,\n mmax = math.max,\n mmin = math.min,\n abs = math.abs,\n pow = math.pow,\n PI = math.PI,\n round = math.round,\n E = \"\",\n S = \" \",\n objectToString = Object.prototype.toString,\n ISURL = /^url/(['\"]?([^/)]+?)['\"]?/)$/i,\n colourRegExp = /^/s*((#[a-f/d]{6})|(#[a-f/d]{3})|rgba?/(/s*([/d/.]+%?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+%?(?:/s*,/s*[/d/.]+%?)?)/s*/)|hsba?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/)|hsla?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/))/s*$/i,\n bezierrg = /^(?:cubic-)?bezier/(([^,]+),([^,]+),([^,]+),([^/)]+)/)/,\n reURLValue = /^url/(#?([^)]+)/)$/,\n separator = Snap._.separator = /[,/s]+/,\n whitespace = /[/s]/g,\n commaSpaces = /[/s]*,[/s]*/,\n hsrg = {hs: 1, rg: 1},\n pathCommand = /([a-z])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n tCommand = /([rstm])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n pathValues = /(-?/d*/.?/d*(?:e[/-+]?//d+)?)[/s]*,?[/s]*/ig,\n idgen = 0,\n idprefix = \"S\" + (+new Date).toString(36),\n ID = function (el) {\n return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);\n },\n xlink = \"http://www.w3.org/1999/xlink\",\n xmlns = \"http://www.w3.org/2000/svg\",\n hub = {},\n URL = Snap.url = function (url) {\n return \"url('#\" + url + \"')\";\n };\n\nfunction $(el, attr) {\n if (attr) {\n if (el == \"#text\") {\n el = glob.doc.createTextNode(attr.text || \"\");\n }\n if (typeof el == \"string\") {\n el = $(el);\n }\n if (typeof attr == \"string\") {\n if (attr.substring(0, 6) == \"xlink:\") {\n return el.getAttributeNS(xlink, attr.substring(6));\n }\n if (attr.substring(0, 4) == \"xml:\") {\n return el.getAttributeNS(xmlns, attr.substring(4));\n }\n return el.getAttribute(attr);\n }\n for (var key in attr) if (attr[has](key)) {\n var val = Str(attr[key]);\n if (val) {\n if (key.substring(0, 6) == \"xlink:\") {\n el.setAttributeNS(xlink, key.substring(6), val);\n } else if (key.substring(0, 4) == \"xml:\") {\n el.setAttributeNS(xmlns, key.substring(4), val);\n } else {\n el.setAttribute(key, val);\n }\n } else {\n el.removeAttribute(key);\n }\n }\n } else {\n el = glob.doc.createElementNS(xmlns, el);\n }\n return el;\n}\nSnap._.$ = $;\nSnap._.id = ID;\nfunction getAttrs(el) {\n var attrs = el.attributes,\n name,\n out = {};\n for (var i = 0; i < attrs.length; i++) {\n if (attrs[i].namespaceURI == xlink) {\n name = \"xlink:\";\n } else {\n name = \"\";\n }\n name += attrs[i].name;\n out[name] = attrs[i].textContent;\n }\n return out;\n}\nfunction is(o, type) {\n type = Str.prototype.toLowerCase.call(type);\n if (type == \"finite\") {\n return isFinite(o);\n }\n if (type == \"array\" &&\n (o instanceof Array || Array.isArray && Array.isArray(o))) {\n return true;\n }\n return (type == \"null\" && o === null) ||\n (type == typeof o && o !== null) ||\n (type == \"object\" && o === Object(o)) ||\n objectToString.call(o).slice(8, -1).toLowerCase() == type;\n}\n/*/\n * Snap.format\n [ method ]\n **\n * Replaces construction of type `{<name>}` to the corresponding argument\n **\n - token (string) string to format\n - json (object) object which properties are used as a replacement\n = (string) formatted string\n > Usage\n | // this draws a rectangular shape equivalent to \"M10,20h40v50h-40z\"\n | paper.path(Snap.format(\"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z\", {\n | x: 10,\n | y: 20,\n | dim: {\n | width: 40,\n | height: 50,\n | \"negative width\": -40\n | }\n | }));\n/*/\nSnap.format = (function () {\n var tokenRegex = //{([^/}]+)/}/g,\n objNotationRegex = /(?:(?:^|/.)(.+?)(?=/[|/.|$|/()|/[('|\")(.+?)/2/])(/(/))?/g, // matches .xxxxx or [\"xxxxx\"] to run over object properties\n replacer = function (all, key, obj) {\n var res = obj;\n key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {\n name = name || quotedName;\n if (res) {\n if (name in res) {\n res = res[name];\n }\n typeof res == \"function\" && isFunc && (res = res());\n }\n });\n res = (res == null || res == obj ? all : res) + \"\";\n return res;\n };\n return function (str, obj) {\n return Str(str).replace(tokenRegex, function (all, key) {\n return replacer(all, key, obj);\n });\n };\n})();\nfunction clone(obj) {\n if (typeof obj == \"function\" || Object(obj) !== obj) {\n return obj;\n }\n var res = new obj.constructor;\n for (var key in obj) if (obj[has](key)) {\n res[key] = clone(obj[key]);\n }\n return res;\n}\nSnap._.clone = clone;\nfunction repush(array, item) {\n for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {\n return array.push(array.splice(i, 1)[0]);\n }\n}\nfunction cacher(f, scope, postprocessor) {\n function newf() {\n var arg = Array.prototype.slice.call(arguments, 0),\n args = arg.join(\"/u2400\"),\n cache = newf.cache = newf.cache || {},\n count = newf.count = newf.count || [];\n if (cache[has](args)) {\n repush(count, args);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n count.length >= 1e3 && delete cache[count.shift()];\n count.push(args);\n cache[args] = f.apply(scope, arg);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n return newf;\n}\nSnap._.cacher = cacher;\nfunction angle(x1, y1, x2, y2, x3, y3) {\n if (x3 == null) {\n var x = x1 - x2,\n y = y1 - y2;\n if (!x && !y) {\n return 0;\n }\n return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;\n } else {\n return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);\n }\n}\nfunction rad(deg) {\n return deg % 360 * PI / 180;\n}\nfunction deg(rad) {\n return rad * 180 / PI % 360;\n}\nfunction x_y() {\n return this.x + S + this.y;\n}\nfunction x_y_w_h() {\n return this.x + S + this.y + S + this.width + \" /xd7 \" + this.height;\n}\n\n/*/\n * Snap.rad\n [ method ]\n **\n * Transform angle to radians\n - deg (number) angle in degrees\n = (number) angle in radians\n/*/\nSnap.rad = rad;\n/*/\n * Snap.deg\n [ method ]\n **\n * Transform angle to degrees\n - rad (number) angle in radians\n = (number) angle in degrees\n/*/\nSnap.deg = deg;\n/*/\n * Snap.angle\n [ method ]\n **\n * Returns an angle between two or three points\n > Parameters\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n - x3 (number) #optional x coord of third point\n - y3 (number) #optional y coord of third point\n = (number) angle in degrees\n/*/\nSnap.angle = angle;\n/*/\n * Snap.is\n [ method ]\n **\n * Handy replacement for the `typeof` operator\n - o (…) any object or primitive\n - type (string) name of the type, e.g., `string`, `function`, `number`, etc.\n = (boolean) `true` if given value is of given type\n/*/\nSnap.is = is;\n/*/\n * Snap.snapTo\n [ method ]\n **\n * Snaps given value to given grid\n - values (array|number) given array of values or step of the grid\n - value (number) value to adjust\n - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.\n = (number) adjusted value\n/*/\nSnap.snapTo = function (values, value, tolerance) {\n tolerance = is(tolerance, \"finite\") ? tolerance : 10;\n if (is(values, \"array\")) {\n var i = values.length;\n while (i--) if (abs(values[i] - value) <= tolerance) {\n return values[i];\n }\n } else {\n values = +values;\n var rem = value % values;\n if (rem < tolerance) {\n return value - rem;\n }\n if (rem > values - tolerance) {\n return value - rem + values;\n }\n }\n return value;\n};\n// Colour\n/*/\n * Snap.getRGB\n [ method ]\n **\n * Parses color string as RGB object\n - color (string) color string in one of the following formats:\n # <ul>\n # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>\n # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>\n # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>\n # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>\n # <li>rgba(•••, •••, •••, •••) — also with opacity</li>\n # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>\n # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>\n # <li>hsba(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>\n # <li>hsla(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>\n # </ul>\n * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) true if string can't be parsed\n o }\n/*/\nSnap.getRGB = cacher(function (colour) {\n if (!colour || !!((colour = Str(colour)).indexOf(\"-\") + 1)) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n if (colour == \"none\") {\n return {r: -1, g: -1, b: -1, hex: \"none\", toString: rgbtoString};\n }\n !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == \"#\") && (colour = toHex(colour));\n if (!colour) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n var res,\n red,\n green,\n blue,\n opacity,\n t,\n values,\n rgb = colour.match(colourRegExp);\n if (rgb) {\n if (rgb[2]) {\n blue = toInt(rgb[2].substring(5), 16);\n green = toInt(rgb[2].substring(3, 5), 16);\n red = toInt(rgb[2].substring(1, 3), 16);\n }\n if (rgb[3]) {\n blue = toInt((t = rgb[3].charAt(3)) + t, 16);\n green = toInt((t = rgb[3].charAt(2)) + t, 16);\n red = toInt((t = rgb[3].charAt(1)) + t, 16);\n }\n if (rgb[4]) {\n values = rgb[4].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red *= 2.55);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green *= 2.55);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue *= 2.55);\n rgb[1].toLowerCase().slice(0, 4) == \"rgba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n }\n if (rgb[5]) {\n values = rgb[5].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsb2rgb(red, green, blue, opacity);\n }\n if (rgb[6]) {\n values = rgb[6].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsla\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsl2rgb(red, green, blue, opacity);\n }\n red = mmin(math.round(red), 255);\n green = mmin(math.round(green), 255);\n blue = mmin(math.round(blue), 255);\n opacity = mmin(mmax(opacity, 0), 1);\n rgb = {r: red, g: green, b: blue, toString: rgbtoString};\n rgb.hex = \"#\" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);\n rgb.opacity = is(opacity, \"finite\") ? opacity : 1;\n return rgb;\n }\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n}, Snap);\n// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.\n/*/\n * Snap.hsb\n [ method ]\n **\n * Converts HSB values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - b (number) value or brightness\n = (string) hex representation of the color\n/*/\nSnap.hsb = cacher(function (h, s, b) {\n return Snap.hsb2rgb(h, s, b).hex;\n});\n/*/\n * Snap.hsl\n [ method ]\n **\n * Converts HSL values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (string) hex representation of the color\n/*/\nSnap.hsl = cacher(function (h, s, l) {\n return Snap.hsl2rgb(h, s, l).hex;\n});\n/*/\n * Snap.rgb\n [ method ]\n **\n * Converts RGB values to a hex representation of the color\n - r (number) red\n - g (number) green\n - b (number) blue\n = (string) hex representation of the color\n/*/\nSnap.rgb = cacher(function (r, g, b, o) {\n if (is(o, \"finite\")) {\n var round = math.round;\n return \"rgba(\" + [round(r), round(g), round(b), +o.toFixed(2)] + \")\";\n }\n return \"#\" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);\n});\nvar toHex = function (color) {\n var i = glob.doc.getElementsByTagName(\"head\")[0] || glob.doc.getElementsByTagName(\"svg\")[0],\n red = \"rgb(255, 0, 0)\";\n toHex = cacher(function (color) {\n if (color.toLowerCase() == \"red\") {\n return red;\n }\n i.style.color = red;\n i.style.color = color;\n var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue(\"color\");\n return out == red ? null : out;\n });\n return toHex(color);\n},\nhsbtoString = function () {\n return \"hsb(\" + [this.h, this.s, this.b] + \")\";\n},\nhsltoString = function () {\n return \"hsl(\" + [this.h, this.s, this.l] + \")\";\n},\nrgbtoString = function () {\n return this.opacity == 1 || this.opacity == null ?\n this.hex :\n \"rgba(\" + [this.r, this.g, this.b, this.opacity] + \")\";\n},\nprepareRGB = function (r, g, b) {\n if (g == null && is(r, \"object\") && \"r\" in r && \"g\" in r && \"b\" in r) {\n b = r.b;\n g = r.g;\n r = r.r;\n }\n if (g == null && is(r, string)) {\n var clr = Snap.getRGB(r);\n r = clr.r;\n g = clr.g;\n b = clr.b;\n }\n if (r > 1 || g > 1 || b > 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n }\n\n return [r, g, b];\n},\npackageRGB = function (r, g, b, o) {\n r = math.round(r * 255);\n g = math.round(g * 255);\n b = math.round(b * 255);\n var rgb = {\n r: r,\n g: g,\n b: b,\n opacity: is(o, \"finite\") ? o : 1,\n hex: Snap.rgb(r, g, b),\n toString: rgbtoString\n };\n is(o, \"finite\") && (rgb.opacity = o);\n return rgb;\n};\n// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?\n/*/\n * Snap.color\n [ method ]\n **\n * Parses the color string and returns an object featuring the color's component values\n - clr (string) color string in one of the supported formats (see @Snap.getRGB)\n = (object) Combined RGB/HSB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) `true` if string can't be parsed,\n o h (number) hue,\n o s (number) saturation,\n o v (number) value (brightness),\n o l (number) lightness\n o }\n/*/\nSnap.color = function (clr) {\n var rgb;\n if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"b\" in clr) {\n rgb = Snap.hsb2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"l\" in clr) {\n rgb = Snap.hsl2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else {\n if (is(clr, \"string\")) {\n clr = Snap.getRGB(clr);\n }\n if (is(clr, \"object\") && \"r\" in clr && \"g\" in clr && \"b\" in clr && !(\"error\" in clr)) {\n rgb = Snap.rgb2hsl(clr);\n clr.h = rgb.h;\n clr.s = rgb.s;\n clr.l = rgb.l;\n rgb = Snap.rgb2hsb(clr);\n clr.v = rgb.b;\n } else {\n clr = {hex: \"none\"};\n clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;\n clr.error = 1;\n }\n }\n clr.toString = rgbtoString;\n return clr;\n};\n/*/\n * Snap.hsb2rgb\n [ method ]\n **\n * Converts HSB values to an RGB object\n - h (number) hue\n - s (number) saturation\n - v (number) value or brightness\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsb2rgb = function (h, s, v, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"b\" in h) {\n v = h.b;\n s = h.s;\n h = h.h;\n o = h.o;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = v * s;\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = v - C;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.hsl2rgb\n [ method ]\n **\n * Converts HSL values to an RGB object\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsl2rgb = function (h, s, l, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"l\" in h) {\n l = h.l;\n s = h.s;\n h = h.h;\n }\n if (h > 1 || s > 1 || l > 1) {\n h /= 360;\n s /= 100;\n l /= 100;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = 2 * s * (l < .5 ? l : 1 - l);\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = l - C / 2;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.rgb2hsb\n [ method ]\n **\n * Converts RGB values to an HSB object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSB object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o b (number) brightness\n o }\n/*/\nSnap.rgb2hsb = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, V, C;\n V = mmax(r, g, b);\n C = V - mmin(r, g, b);\n H = (C == 0 ? null :\n V == r ? (g - b) / C :\n V == g ? (b - r) / C + 2 :\n (r - g) / C + 4\n );\n H = ((H + 360) % 6) * 60 / 360;\n S = C == 0 ? 0 : C / V;\n return {h: H, s: S, b: V, toString: hsbtoString};\n};\n/*/\n * Snap.rgb2hsl\n [ method ]\n **\n * Converts RGB values to an HSL object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSL object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o l (number) luminosity\n o }\n/*/\nSnap.rgb2hsl = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, L, M, m, C;\n M = mmax(r, g, b);\n m = mmin(r, g, b);\n C = M - m;\n H = (C == 0 ? null :\n M == r ? (g - b) / C :\n M == g ? (b - r) / C + 2 :\n (r - g) / C + 4);\n H = ((H + 360) % 6) * 60 / 360;\n L = (M + m) / 2;\n S = (C == 0 ? 0 :\n L < .5 ? C / (2 * L) :\n C / (2 - 2 * L));\n return {h: H, s: S, l: L, toString: hsltoString};\n};\n\n// Transformations\n// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ [\"M10,10\",\"L90,90\"], [\"M90,10\",\"L10,90\"] ] Otherwise how is each command structured?\n/*/\n * Snap.parsePathString\n [ method ]\n **\n * Utility method\n **\n * Parses given path string into an array of arrays of path segments\n - pathString (string|array) path string or array of segments (in the last case it is returned straight away)\n = (array) array of segments\n/*/\nSnap.parsePathString = function (pathString) {\n if (!pathString) {\n return null;\n }\n var pth = Snap.path(pathString);\n if (pth.arr) {\n return Snap.path.clone(pth.arr);\n }\n\n var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},\n data = [];\n if (is(pathString, \"array\") && is(pathString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(pathString);\n }\n if (!data.length) {\n Str(pathString).replace(pathCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n if (name == \"m\" && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = \"l\";\n b = b == \"m\" ? \"l\" : \"L\";\n }\n if (name == \"o\" && params.length == 1) {\n data.push([b, params[0]]);\n }\n if (name == \"r\") {\n data.push([b].concat(params));\n } else while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n });\n }\n data.toString = Snap.path.toString;\n pth.arr = Snap.path.clone(data);\n return data;\n};\n/*/\n * Snap.parseTransformString\n [ method ]\n **\n * Utility method\n **\n * Parses given transform string into an array of transformations\n - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)\n = (array) array of transformations\n/*/\nvar parseTransformString = Snap.parseTransformString = function (TString) {\n if (!TString) {\n return null;\n }\n var paramCounts = {r: 3, s: 4, t: 2, m: 6},\n data = [];\n if (is(TString, \"array\") && is(TString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(TString);\n }\n if (!data.length) {\n Str(TString).replace(tCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n data.push([b].concat(params));\n });\n }\n data.toString = Snap.path.toString;\n return data;\n};\nfunction svgTransform2string(tstr) {\n var res = [];\n tstr = tstr.replace(/(?:^|/s)(/w+)/(([^)]+)/)/g, function (all, name, params) {\n params = params.split(//s*,/s*|/s+/);\n if (name == \"rotate\" && params.length == 1) {\n params.push(0, 0);\n }\n if (name == \"scale\") {\n if (params.length > 2) {\n params = params.slice(0, 2);\n } else if (params.length == 2) {\n params.push(0, 0);\n }\n if (params.length == 1) {\n params.push(params[0], 0, 0);\n }\n }\n if (name == \"skewX\") {\n res.push([\"m\", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);\n } else if (name == \"skewY\") {\n res.push([\"m\", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);\n } else {\n res.push([name.charAt(0)].concat(params));\n }\n return all;\n });\n return res;\n}\nSnap._.svgTransform2string = svgTransform2string;\nSnap._.rgTransform = /^[a-z][/s]*-?/.?/d/i;\nfunction transform2matrix(tstr, bbox) {\n var tdata = parseTransformString(tstr),\n m = new Snap.Matrix;\n if (tdata) {\n for (var i = 0, ii = tdata.length; i < ii; i++) {\n var t = tdata[i],\n tlen = t.length,\n command = Str(t[0]).toLowerCase(),\n absolute = t[0] != command,\n inver = absolute ? m.invert() : 0,\n x1,\n y1,\n x2,\n y2,\n bb;\n if (command == \"t\" && tlen == 2){\n m.translate(t[1], 0);\n } else if (command == \"t\" && tlen == 3) {\n if (absolute) {\n x1 = inver.x(0, 0);\n y1 = inver.y(0, 0);\n x2 = inver.x(t[1], t[2]);\n y2 = inver.y(t[1], t[2]);\n m.translate(x2 - x1, y2 - y1);\n } else {\n m.translate(t[1], t[2]);\n }\n } else if (command == \"r\") {\n if (tlen == 2) {\n bb = bb || bbox;\n m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.rotate(t[1], x2, y2);\n } else {\n m.rotate(t[1], t[2], t[3]);\n }\n }\n } else if (command == \"s\") {\n if (tlen == 2 || tlen == 3) {\n bb = bb || bbox;\n m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.scale(t[1], t[1], x2, y2);\n } else {\n m.scale(t[1], t[1], t[2], t[3]);\n }\n } else if (tlen == 5) {\n if (absolute) {\n x2 = inver.x(t[3], t[4]);\n y2 = inver.y(t[3], t[4]);\n m.scale(t[1], t[2], x2, y2);\n } else {\n m.scale(t[1], t[2], t[3], t[4]);\n }\n }\n } else if (command == \"m\" && tlen == 7) {\n m.add(t[1], t[2], t[3], t[4], t[5], t[6]);\n }\n }\n }\n return m;\n}\nSnap._.transform2matrix = transform2matrix;\nSnap._unit2px = unit2px;\nvar contains = glob.doc.contains || glob.doc.compareDocumentPosition ?\n function (a, b) {\n var adown = a.nodeType == 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a == bup || !!(bup && bup.nodeType == 1 && (\n adown.contains ?\n adown.contains(bup) :\n a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16\n ));\n } :\n function (a, b) {\n if (b) {\n while (b) {\n b = b.parentNode;\n if (b == a) {\n return true;\n }\n }\n }\n return false;\n };\nfunction getSomeDefs(el) {\n var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||\n (el.node.parentNode && wrap(el.node.parentNode)) ||\n Snap.select(\"svg\") ||\n Snap(0, 0),\n pdefs = p.select(\"defs\"),\n defs = pdefs == null ? false : pdefs.node;\n if (!defs) {\n defs = make(\"defs\", p.node).node;\n }\n return defs;\n}\nfunction getSomeSVG(el) {\n return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select(\"svg\");\n}\nSnap._.getSomeDefs = getSomeDefs;\nSnap._.getSomeSVG = getSomeSVG;\nfunction unit2px(el, name, value) {\n var svg = getSomeSVG(el).node,\n out = {},\n mgr = svg.querySelector(\".svg---mgr\");\n if (!mgr) {\n mgr = $(\"rect\");\n $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, \"class\": \"svg---mgr\", fill: \"none\"});\n svg.appendChild(mgr);\n }\n function getW(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {width: val});\n try {\n return mgr.getBBox().width;\n } catch (e) {\n return 0;\n }\n }\n function getH(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {height: val});\n try {\n return mgr.getBBox().height;\n } catch (e) {\n return 0;\n }\n }\n function set(nam, f) {\n if (name == null) {\n out[nam] = f(el.attr(nam) || 0);\n } else if (nam == name) {\n out = f(value == null ? el.attr(nam) || 0 : value);\n }\n }\n switch (el.type) {\n case \"rect\":\n set(\"rx\", getW);\n set(\"ry\", getH);\n case \"image\":\n set(\"width\", getW);\n set(\"height\", getH);\n case \"text\":\n set(\"x\", getW);\n set(\"y\", getH);\n break;\n case \"circle\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"r\", getW);\n break;\n case \"ellipse\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"rx\", getW);\n set(\"ry\", getH);\n break;\n case \"line\":\n set(\"x1\", getW);\n set(\"x2\", getW);\n set(\"y1\", getH);\n set(\"y2\", getH);\n break;\n case \"marker\":\n set(\"refX\", getW);\n set(\"markerWidth\", getW);\n set(\"refY\", getH);\n set(\"markerHeight\", getH);\n break;\n case \"radialGradient\":\n set(\"fx\", getW);\n set(\"fy\", getH);\n break;\n case \"tspan\":\n set(\"dx\", getW);\n set(\"dy\", getH);\n break;\n default:\n set(name, getW);\n }\n svg.removeChild(mgr);\n return out;\n}\n/*/\n * Snap.select\n [ method ]\n **\n * Wraps a DOM element specified by CSS selector as @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(glob.doc.querySelector(query));\n};\n/*/\n * Snap.selectAll\n [ method ]\n **\n * Wraps DOM elements specified by CSS selector as set or array of @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.selectAll = function (query) {\n var nodelist = glob.doc.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n};\n\nfunction add2group(list) {\n if (!is(list, \"array\")) {\n list = Array.prototype.slice.call(arguments, 0);\n }\n var i = 0,\n j = 0,\n node = this.node;\n while (this[i]) delete this[i++];\n for (i = 0; i < list.length; i++) {\n if (list[i].type == \"set\") {\n list[i].forEach(function (el) {\n node.appendChild(el.node);\n });\n } else {\n node.appendChild(list[i].node);\n }\n }\n var children = node.childNodes;\n for (i = 0; i < children.length; i++) {\n this[j++] = wrap(children[i]);\n }\n return this;\n}\n// Hub garbage collector every 10s\nsetInterval(function () {\n for (var key in hub) if (hub[has](key)) {\n var el = hub[key],\n node = el.node;\n if (el.type != \"svg\" && !node.ownerSVGElement || el.type == \"svg\" && (!node.parentNode || \"ownerSVGElement\" in node.parentNode && !node.ownerSVGElement)) {\n delete hub[key];\n }\n }\n}, 1e4);\nfunction Element(el) {\n if (el.snap in hub) {\n return hub[el.snap];\n }\n var svg;\n try {\n svg = el.ownerSVGElement;\n } catch(e) {}\n /*/\n * Element.node\n [ property (object) ]\n **\n * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.\n > Usage\n | // draw a circle at coordinate 10,10 with radius of 10\n | var c = paper.circle(10, 10, 10);\n | c.node.onclick = function () {\n | c.attr(\"fill\", \"red\");\n | };\n /*/\n this.node = el;\n if (svg) {\n this.paper = new Paper(svg);\n }\n /*/\n * Element.type\n [ property (string) ]\n **\n * SVG tag name of the given element.\n /*/\n this.type = el.tagName;\n var id = this.id = ID(this);\n this.anims = {};\n this._ = {\n transform: []\n };\n el.snap = id;\n hub[id] = this;\n if (this.type == \"g\") {\n this.add = add2group;\n }\n if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {\n for (var method in Paper.prototype) if (Paper.prototype[has](method)) {\n this[method] = Paper.prototype[method];\n }\n }\n}\n /*/\n * Element.attr\n [ method ]\n **\n * Gets or sets given attributes of the element.\n **\n - params (object) contains key-value pairs of attributes you want to set\n * or\n - param (string) name of the attribute\n = (Element) the current element\n * or\n = (string) value of attribute\n > Usage\n | el.attr({\n | fill: \"#fc0\",\n | stroke: \"#000\",\n | strokeWidth: 2, // CamelCase...\n | \"fill-opacity\": 0.5, // or dash-separated names\n | width: \"*=2\" // prefixed values\n | });\n | console.log(el.attr(\"fill\")); // #fc0\n * Prefixed values in format `\"+=10\"` supported. All four operations\n * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`\n * and `-`: `\"+=2em\"`.\n /*/\n Element.prototype.attr = function (params, value) {\n var el = this,\n node = el.node;\n if (!params) {\n return el;\n }\n if (is(params, \"string\")) {\n if (arguments.length > 1) {\n var json = {};\n json[params] = value;\n params = json;\n } else {\n return eve(\"snap.util.getattr.\" + params, el).firstDefined();\n }\n }\n for (var att in params) {\n if (params[has](att)) {\n eve(\"snap.util.attr.\" + att, el, params[att]);\n }\n }\n return el;\n };\n/*/\n * Snap.parse\n [ method ]\n **\n * Parses SVG fragment and converts it into a @Fragment\n **\n - svg (string) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.parse = function (svg) {\n var f = glob.doc.createDocumentFragment(),\n full = true,\n div = glob.doc.createElement(\"div\");\n svg = Str(svg);\n if (!svg.match(/^/s*</s*svg(?:/s|>)/)) {\n svg = \"<svg>\" + svg + \"</svg>\";\n full = false;\n }\n div.innerHTML = svg;\n svg = div.getElementsByTagName(\"svg\")[0];\n if (svg) {\n if (full) {\n f = svg;\n } else {\n while (svg.firstChild) {\n f.appendChild(svg.firstChild);\n }\n div.innerHTML = E;\n }\n }\n return new Fragment(f);\n};\nfunction Fragment(frag) {\n this.node = frag;\n}\n// SIERRA Snap.fragment() could especially use a code example\n/*/\n * Snap.fragment\n [ method ]\n **\n * Creates a DOM fragment from a given list of elements or strings\n **\n - varargs (…) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.fragment = function () {\n var args = Array.prototype.slice.call(arguments, 0),\n f = glob.doc.createDocumentFragment();\n for (var i = 0, ii = args.length; i < ii; i++) {\n var item = args[i];\n if (item.node && item.node.nodeType) {\n f.appendChild(item.node);\n }\n if (item.nodeType) {\n f.appendChild(item);\n }\n if (typeof item == \"string\") {\n f.appendChild(Snap.parse(item).node);\n }\n }\n return new Fragment(f);\n};\n\nfunction make(name, parent) {\n var res = $(name);\n parent.appendChild(res);\n var el = wrap(res);\n return el;\n}\nfunction Paper(w, h) {\n var res,\n desc,\n defs,\n proto = Paper.prototype;\n if (w && w.tagName == \"svg\") {\n if (w.snap in hub) {\n return hub[w.snap];\n }\n var doc = w.ownerDocument;\n res = new Element(w);\n desc = w.getElementsByTagName(\"desc\")[0];\n defs = w.getElementsByTagName(\"defs\")[0];\n if (!desc) {\n desc = $(\"desc\");\n desc.appendChild(doc.createTextNode(\"Created with Snap\"));\n res.node.appendChild(desc);\n }\n if (!defs) {\n defs = $(\"defs\");\n res.node.appendChild(defs);\n }\n res.defs = defs;\n for (var key in proto) if (proto[has](key)) {\n res[key] = proto[key];\n }\n res.paper = res.root = res;\n } else {\n res = make(\"svg\", glob.doc.body);\n $(res.node, {\n height: h,\n version: 1.1,\n width: w,\n xmlns: xmlns\n });\n }\n return res;\n}\nfunction wrap(dom) {\n if (!dom) {\n return dom;\n }\n if (dom instanceof Element || dom instanceof Fragment) {\n return dom;\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"svg\") {\n return new Paper(dom);\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"object\" && dom.type == \"image/svg+xml\") {\n return new Paper(dom.contentDocument.getElementsByTagName(\"svg\")[0]);\n }\n return new Element(dom);\n}\n\nSnap._.make = make;\nSnap._.wrap = wrap;\n/*/\n * Paper.el\n [ method ]\n **\n * Creates an element on paper with a given name and no attributes\n **\n - name (string) tag name\n - attr (object) attributes\n = (Element) the current element\n > Usage\n | var c = paper.circle(10, 10, 10); // is the same as...\n | var c = paper.el(\"circle\").attr({\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n | // and the same as\n | var c = paper.el(\"circle\", {\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n/*/\nPaper.prototype.el = function (name, attr) {\n var el = make(name, this.node);\n attr && el.attr(attr);\n return el;\n};\n// default\neve.on(\"snap.util.getattr\", function () {\n var att = eve.nt();\n att = att.substring(att.lastIndexOf(\".\") + 1);\n var css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);\n } else {\n return $(this.node, att);\n }\n});\nvar cssAttr = {\n \"alignment-baseline\": 0,\n \"baseline-shift\": 0,\n \"clip\": 0,\n \"clip-path\": 0,\n \"clip-rule\": 0,\n \"color\": 0,\n \"color-interpolation\": 0,\n \"color-interpolation-filters\": 0,\n \"color-profile\": 0,\n \"color-rendering\": 0,\n \"cursor\": 0,\n \"direction\": 0,\n \"display\": 0,\n \"dominant-baseline\": 0,\n \"enable-background\": 0,\n \"fill\": 0,\n \"fill-opacity\": 0,\n \"fill-rule\": 0,\n \"filter\": 0,\n \"flood-color\": 0,\n \"flood-opacity\": 0,\n \"font\": 0,\n \"font-family\": 0,\n \"font-size\": 0,\n \"font-size-adjust\": 0,\n \"font-stretch\": 0,\n \"font-style\": 0,\n \"font-variant\": 0,\n \"font-weight\": 0,\n \"glyph-orientation-horizontal\": 0,\n \"glyph-orientation-vertical\": 0,\n \"image-rendering\": 0,\n \"kerning\": 0,\n \"letter-spacing\": 0,\n \"lighting-color\": 0,\n \"marker\": 0,\n \"marker-end\": 0,\n \"marker-mid\": 0,\n \"marker-start\": 0,\n \"mask\": 0,\n \"opacity\": 0,\n \"overflow\": 0,\n \"pointer-events\": 0,\n \"shape-rendering\": 0,\n \"stop-color\": 0,\n \"stop-opacity\": 0,\n \"stroke\": 0,\n \"stroke-dasharray\": 0,\n \"stroke-dashoffset\": 0,\n \"stroke-linecap\": 0,\n \"stroke-linejoin\": 0,\n \"stroke-miterlimit\": 0,\n \"stroke-opacity\": 0,\n \"stroke-width\": 0,\n \"text-anchor\": 0,\n \"text-decoration\": 0,\n \"text-rendering\": 0,\n \"unicode-bidi\": 0,\n \"visibility\": 0,\n \"word-spacing\": 0,\n \"writing-mode\": 0\n};\n\neve.on(\"snap.util.attr\", function (value) {\n var att = eve.nt(),\n attr = {};\n att = att.substring(att.lastIndexOf(\".\") + 1);\n attr[att] = value;\n var style = att.replace(/-(/w)/gi, function (all, letter) {\n return letter.toUpperCase();\n }),\n css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n this.node.style[style] = value == null ? E : value;\n } else {\n $(this.node, attr);\n }\n});\n(function (proto) {}(Paper.prototype));\n\n// simple ajax\n/*/\n * Snap.ajax\n [ method ]\n **\n * Simple implementation of Ajax\n **\n - url (string) URL\n - postData (object|string) data for post request\n - callback (function) callback\n - scope (object) #optional scope of callback\n * or\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n = (XMLHttpRequest) the XMLHttpRequest object, just in case\n/*/\nSnap.ajax = function (url, postData, callback, scope){\n var req = new XMLHttpRequest,\n id = ID();\n if (req) {\n if (is(postData, \"function\")) {\n scope = callback;\n callback = postData;\n postData = null;\n } else if (is(postData, \"object\")) {\n var pd = [];\n for (var key in postData) if (postData.hasOwnProperty(key)) {\n pd.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(postData[key]));\n }\n postData = pd.join(\"&\");\n }\n req.open((postData ? \"POST\" : \"GET\"), url, true);\n if (postData) {\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n if (callback) {\n eve.once(\"snap.ajax.\" + id + \".0\", callback);\n eve.once(\"snap.ajax.\" + id + \".200\", callback);\n eve.once(\"snap.ajax.\" + id + \".304\", callback);\n }\n req.onreadystatechange = function() {\n if (req.readyState != 4) return;\n eve(\"snap.ajax.\" + id + \".\" + req.status, scope, req);\n };\n if (req.readyState == 4) {\n return req;\n }\n req.send(postData);\n return req;\n }\n};\n/*/\n * Snap.load\n [ method ]\n **\n * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)\n **\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n/*/\nSnap.load = function (url, callback, scope) {\n Snap.ajax(url, function (req) {\n var f = Snap.parse(req.responseText);\n scope ? callback.call(scope, f) : callback(f);\n });\n};\nvar getOffset = function (elem) {\n var box = elem.getBoundingClientRect(),\n doc = elem.ownerDocument,\n body = doc.body,\n docElem = doc.documentElement,\n clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,\n top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,\n left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;\n return {\n y: top,\n x: left\n };\n};\n/*/\n * Snap.getElementByPoint\n [ method ]\n **\n * Returns you topmost element under given point.\n **\n = (object) Snap element object\n - x (number) x coordinate from the top left corner of the window\n - y (number) y coordinate from the top left corner of the window\n > Usage\n | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: \"#f00\"});\n/*/\nSnap.getElementByPoint = function (x, y) {\n var paper = this,\n svg = paper.canvas,\n target = glob.doc.elementFromPoint(x, y);\n if (glob.win.opera && target.tagName == \"svg\") {\n var so = getOffset(target),\n sr = target.createSVGRect();\n sr.x = x - so.x;\n sr.y = y - so.y;\n sr.width = sr.height = 1;\n var hits = target.getIntersectionList(sr, null);\n if (hits.length) {\n target = hits[hits.length - 1];\n }\n }\n if (!target) {\n return null;\n }\n return wrap(target);\n};\n/*/\n * Snap.plugin\n [ method ]\n **\n * Let you write plugins. You pass in a function with four arguments, like this:\n | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {\n | Snap.newmethod = function () {};\n | Element.prototype.newmethod = function () {};\n | Paper.prototype.newmethod = function () {};\n | });\n * Inside the function you have access to all main objects (and their\n * prototypes). This allow you to extend anything you want.\n **\n - f (function) your plugin body\n/*/\nSnap.plugin = function (f) {\n f(Snap, Element, Paper, glob, Fragment);\n};\nglob.win.Snap = Snap;\nreturn Snap;\n}(window || this));\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var elproto = Element.prototype,\n is = Snap.is,\n Str = String,\n unit2px = Snap._unit2px,\n $ = Snap._.$,\n make = Snap._.make,\n getSomeDefs = Snap._.getSomeDefs,\n has = \"hasOwnProperty\",\n wrap = Snap._.wrap;\n /*/\n * Element.getBBox\n [ method ]\n **\n * Returns the bounding box descriptor for the given element\n **\n = (object) bounding box descriptor:\n o {\n o cx: (number) x of the center,\n o cy: (number) x of the center,\n o h: (number) height,\n o height: (number) height,\n o path: (string) path command for the box,\n o r0: (number) radius of a circle that fully encloses the box,\n o r1: (number) radius of the smallest circle that can be enclosed,\n o r2: (number) radius of the largest circle that can be enclosed,\n o vb: (string) box as a viewbox command,\n o w: (number) width,\n o width: (number) width,\n o x2: (number) x of the right side,\n o x: (number) x of the left side,\n o y2: (number) y of the bottom edge,\n o y: (number) y of the top edge\n o }\n /*/\n elproto.getBBox = function (isWithoutTransform) {\n if (!Snap.Matrix || !Snap.path) {\n return this.node.getBBox();\n }\n var el = this,\n m = new Snap.Matrix;\n if (el.removed) {\n return Snap._.box();\n }\n while (el.type == \"use\") {\n if (!isWithoutTransform) {\n m = m.add(el.transform().localMatrix.translate(el.attr(\"x\") || 0, el.attr(\"y\") || 0));\n }\n if (el.original) {\n el = el.original;\n } else {\n var href = el.attr(\"xlink:href\");\n el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf(\"#\") + 1));\n }\n }\n var _ = el._,\n pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;\n try {\n if (isWithoutTransform) {\n _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());\n return Snap._.box(_.bboxwt);\n } else {\n el.realPath = pathfinder(el);\n el.matrix = el.transform().localMatrix;\n _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));\n return Snap._.box(_.bbox);\n }\n } catch (e) {\n // Firefox doesn’t give you bbox of hidden element\n return Snap._.box();\n }\n };\n var propString = function () {\n return this.string;\n };\n function extractTransform(el, tstr) {\n if (tstr == null) {\n var doReturn = true;\n if (el.type == \"linearGradient\" || el.type == \"radialGradient\") {\n tstr = el.node.getAttribute(\"gradientTransform\");\n } else if (el.type == \"pattern\") {\n tstr = el.node.getAttribute(\"patternTransform\");\n } else {\n tstr = el.node.getAttribute(\"transform\");\n }\n if (!tstr) {\n return new Snap.Matrix;\n }\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n if (!Snap._.rgTransform.test(tstr)) {\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n tstr = Str(tstr).replace(//.{3}|/u2026/g, el._.transform || E);\n }\n if (is(tstr, \"array\")) {\n tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);\n }\n el._.transform = tstr;\n }\n var m = Snap._.transform2matrix(tstr, el.getBBox(1));\n if (doReturn) {\n return m;\n } else {\n el.matrix = m;\n }\n }\n /*/\n * Element.transform\n [ method ]\n **\n * Gets or sets transformation of the element\n **\n - tstr (string) transform string in Snap or SVG format\n = (Element) the current element\n * or\n = (object) transformation descriptor:\n o {\n o string (string) transform string,\n o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,\n o localMatrix (Matrix) matrix of transformations applied only to the element,\n o diffMatrix (Matrix) matrix of difference between global and local transformations,\n o global (string) global transformation as string,\n o local (string) local transformation as string,\n o toString (function) returns `string` property\n o }\n /*/\n elproto.transform = function (tstr) {\n var _ = this._;\n if (tstr == null) {\n var papa = this,\n global = new Snap.Matrix(this.node.getCTM()),\n local = extractTransform(this),\n ms = [local],\n m = new Snap.Matrix,\n i,\n localString = local.toTransformString(),\n string = Str(local) == Str(this.matrix) ?\n Str(_.transform) : localString;\n while (papa.type != \"svg\" && (papa = papa.parent())) {\n ms.push(extractTransform(papa));\n }\n i = ms.length;\n while (i--) {\n m.add(ms[i]);\n }\n return {\n string: string,\n globalMatrix: global,\n totalMatrix: m,\n localMatrix: local,\n diffMatrix: global.clone().add(local.invert()),\n global: global.toTransformString(),\n total: m.toTransformString(),\n local: localString,\n toString: propString\n };\n }\n if (tstr instanceof Snap.Matrix) {\n this.matrix = tstr;\n this._.transform = tstr.toTransformString();\n } else {\n extractTransform(this, tstr);\n }\n\n if (this.node) {\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\") {\n $(this.node, {gradientTransform: this.matrix});\n } else if (this.type == \"pattern\") {\n $(this.node, {patternTransform: this.matrix});\n } else {\n $(this.node, {transform: this.matrix});\n }\n }\n\n return this;\n };\n /*/\n * Element.parent\n [ method ]\n **\n * Returns the element's parent\n **\n = (Element) the parent element\n /*/\n elproto.parent = function () {\n return wrap(this.node.parentNode);\n };\n /*/\n * Element.append\n [ method ]\n **\n * Appends the given element to current one\n **\n - el (Element|Set) element to append\n = (Element) the parent element\n /*/\n /*/\n * Element.add\n [ method ]\n **\n * See @Element.append\n /*/\n elproto.append = elproto.add = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n it.add(el);\n });\n return this;\n }\n el = wrap(el);\n this.node.appendChild(el.node);\n el.paper = this.paper;\n }\n return this;\n };\n /*/\n * Element.appendTo\n [ method ]\n **\n * Appends the current element to the given one\n **\n - el (Element) parent element to append to\n = (Element) the child element\n /*/\n elproto.appendTo = function (el) {\n if (el) {\n el = wrap(el);\n el.append(this);\n }\n return this;\n };\n /*/\n * Element.prepend\n [ method ]\n **\n * Prepends the given element to the current one\n **\n - el (Element) element to prepend\n = (Element) the parent element\n /*/\n elproto.prepend = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this,\n first;\n el.forEach(function (el) {\n if (first) {\n first.after(el);\n } else {\n it.prepend(el);\n }\n first = el;\n });\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.insertBefore(el.node, this.node.firstChild);\n this.add && this.add();\n el.paper = this.paper;\n this.parent() && this.parent().add();\n parent && parent.add();\n }\n return this;\n };\n /*/\n * Element.prependTo\n [ method ]\n **\n * Prepends the current element to the given one\n **\n - el (Element) parent element to prepend to\n = (Element) the child element\n /*/\n elproto.prependTo = function (el) {\n el = wrap(el);\n el.prepend(this);\n return this;\n };\n /*/\n * Element.before\n [ method ]\n **\n * Inserts given element before the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.before = function (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n var parent = el.parent();\n it.node.parentNode.insertBefore(el.node, it.node);\n parent && parent.add();\n });\n this.parent().add();\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.parentNode.insertBefore(el.node, this.node);\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.after\n [ method ]\n **\n * Inserts given element after the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.after = function (el) {\n el = wrap(el);\n var parent = el.parent();\n if (this.node.nextSibling) {\n this.node.parentNode.insertBefore(el.node, this.node.nextSibling);\n } else {\n this.node.parentNode.appendChild(el.node);\n }\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.insertBefore\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertBefore = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.insertAfter\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertAfter = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node.nextSibling);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.remove\n [ method ]\n **\n * Removes element from the DOM\n = (Element) the detached element\n /*/\n elproto.remove = function () {\n var parent = this.parent();\n this.node.parentNode && this.node.parentNode.removeChild(this.node);\n delete this.paper;\n this.removed = true;\n parent && parent.add();\n return this;\n };\n /*/\n * Element.select\n [ method ]\n **\n * Gathers the nested @Element matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Element) result of query selection\n /*/\n elproto.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(this.node.querySelector(query));\n };\n /*/\n * Element.selectAll\n [ method ]\n **\n * Gathers nested @Element objects matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Set|array) result of query selection\n /*/\n elproto.selectAll = function (query) {\n var nodelist = this.node.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n };\n /*/\n * Element.asPX\n [ method ]\n **\n * Returns given attribute of the element as a `px` value (not %, em, etc.)\n **\n - attr (string) attribute name\n - value (string) #optional attribute value\n = (Element) result of query selection\n /*/\n elproto.asPX = function (attr, value) {\n if (value == null) {\n value = this.attr(attr);\n }\n return +unit2px(this, attr, value);\n };\n // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.\n /*/\n * Element.use\n [ method ]\n **\n * Creates a `<use>` element linked to the current element\n **\n = (Element) the `<use>` element\n /*/\n elproto.use = function () {\n var use,\n id = this.node.id;\n if (!id) {\n id = this.id;\n $(this.node, {\n id: id\n });\n }\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\" ||\n this.type == \"pattern\") {\n use = make(this.type, this.node.parentNode);\n } else {\n use = make(\"use\", this.node.parentNode);\n }\n $(use.node, {\n \"xlink:href\": \"#\" + id\n });\n use.original = this;\n return use;\n };\n function fixids(el) {\n var els = el.selectAll(\"*\"),\n it,\n url = /^/s*url/((\"|'|)(.*)/1/)/s*$/,\n ids = [],\n uses = {};\n function urltest(it, name) {\n var val = $(it.node, name);\n val = val && val.match(url);\n val = val && val[2];\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n var attr = {};\n attr[name] = URL(id);\n $(it.node, attr);\n });\n }\n }\n function linktest(it) {\n var val = $(it.node, \"xlink:href\");\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n it.attr(\"xlink:href\", \"#\" + id);\n });\n }\n }\n for (var i = 0, ii = els.length; i < ii; i++) {\n it = els[i];\n urltest(it, \"fill\");\n urltest(it, \"stroke\");\n urltest(it, \"filter\");\n urltest(it, \"mask\");\n urltest(it, \"clip-path\");\n linktest(it);\n var oldid = $(it.node, \"id\");\n if (oldid) {\n $(it.node, {id: it.id});\n ids.push({\n old: oldid,\n id: it.id\n });\n }\n }\n for (i = 0, ii = ids.length; i < ii; i++) {\n var fs = uses[ids[i].old];\n if (fs) {\n for (var j = 0, jj = fs.length; j < jj; j++) {\n fs[j](ids[i].id);\n }\n }\n }\n }\n /*/\n * Element.clone\n [ method ]\n **\n * Creates a clone of the element and inserts it after the element\n **\n = (Element) the clone\n /*/\n elproto.clone = function () {\n var clone = wrap(this.node.cloneNode(true));\n if ($(clone.node, \"id\")) {\n $(clone.node, {id: clone.id});\n }\n fixids(clone);\n clone.insertAfter(this);\n return clone;\n };\n /*/\n * Element.toDefs\n [ method ]\n **\n * Moves element to the shared `<defs>` area\n **\n = (Element) the element\n /*/\n elproto.toDefs = function () {\n var defs = getSomeDefs(this);\n defs.appendChild(this.node);\n return this;\n };\n /*/\n * Element.toPattern\n [ method ]\n **\n * Creates a `<pattern>` element from the current element\n **\n * To create a pattern you have to specify the pattern rect:\n - x (string|number)\n - y (string|number)\n - width (string|number)\n - height (string|number)\n = (Element) the `<pattern>` element\n * You can use pattern later on as an argument for `fill` attribute:\n | var p = paper.path(\"M10-5-10,15M15,0,0,15M0-5-20,15\").attr({\n | fill: \"none\",\n | stroke: \"#bada55\",\n | strokeWidth: 5\n | }).pattern(0, 0, 10, 10),\n | c = paper.circle(200, 200, 100);\n | c.attr({\n | fill: p\n | });\n /*/\n elproto.pattern = elproto.toPattern = function (x, y, width, height) {\n var p = make(\"pattern\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n $(p.node, {\n x: x,\n y: y,\n width: width,\n height: height,\n patternUnits: \"userSpaceOnUse\",\n id: p.id,\n viewBox: [x, y, width, height].join(\" \")\n });\n p.node.appendChild(this.node);\n return p;\n };\n// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.\n// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?\n /*/\n * Element.marker\n [ method ]\n **\n * Creates a `<marker>` element from the current element\n **\n * To create a marker you have to specify the bounding rect and reference point:\n - x (number)\n - y (number)\n - width (number)\n - height (number)\n - refX (number)\n - refY (number)\n = (Element) the `<marker>` element\n * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.\n /*/\n // TODO add usage for markers\n elproto.marker = function (x, y, width, height, refX, refY) {\n var p = make(\"marker\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n refX = x.refX || x.cx;\n refY = x.refY || x.cy;\n x = x.x;\n }\n $(p.node, {\n viewBox: [x, y, width, height].join(\" \"),\n markerWidth: width,\n markerHeight: height,\n orient: \"auto\",\n refX: refX || 0,\n refY: refY || 0,\n id: p.id\n });\n p.node.appendChild(this.node);\n return p;\n };\n // animation\n function slice(from, to, f) {\n return function (arr) {\n var res = arr.slice(from, to);\n if (res.length == 1) {\n res = res[0];\n }\n return f ? f(res) : res;\n };\n }\n var Animation = function (attr, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n this.attr = attr;\n this.dur = ms;\n easing && (this.easing = easing);\n callback && (this.callback = callback);\n };\n Snap._.Animation = Animation;\n /*/\n * Snap.animation\n [ method ]\n **\n * Creates an animation object\n **\n - attr (object) attributes of final destination\n - duration (number) duration of the animation, in milliseconds\n - easing (function) #optional one of easing functions of @mina or custom one\n - callback (function) #optional callback function that fires when animation ends\n = (object) animation object\n /*/\n Snap.animation = function (attr, ms, easing, callback) {\n return new Animation(attr, ms, easing, callback);\n };\n /*/\n * Element.inAnim\n [ method ]\n **\n * Returns a set of animations that may be able to manipulate the current element\n **\n = (object) in format:\n o {\n o anim (object) animation object,\n o mina (object) @mina object,\n o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n /*/\n elproto.inAnim = function () {\n var el = this,\n res = [];\n for (var id in el.anims) if (el.anims[has](id)) {\n (function (a) {\n res.push({\n anim: new Animation(a._attrs, a.dur, a.easing, a._callback),\n mina: a,\n curStatus: a.status(),\n status: function (val) {\n return a.status(val);\n },\n stop: function () {\n a.stop();\n }\n });\n }(el.anims[id]));\n }\n return res;\n };\n /*/\n * Snap.animate\n [ method ]\n **\n * Runs generic animation of one number into another with a caring function\n **\n - from (number|array) number or array of numbers\n - to (number|array) number or array of numbers\n - setter (function) caring function that accepts one number argument\n - duration (number) duration, in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function to execute when animation ends\n = (object) animation object in @mina format\n o {\n o id (string) animation id, consider it read-only,\n o duration (function) gets or sets the duration of the animation,\n o easing (function) easing,\n o speed (function) gets or sets the speed of the animation,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n | var rect = Snap().rect(0, 0, 10, 10);\n | Snap.animate(0, 10, function (val) {\n | rect.attr({\n | x: val\n | });\n | }, 1000);\n | // in given context is equivalent to\n | rect.animate({x: 10}, 1000);\n /*/\n Snap.animate = function (from, to, setter, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n var now = mina.time(),\n anim = mina(from, to, now, now + ms, mina.time, setter, easing);\n callback && eve.once(\"mina.finish.\" + anim.id, callback);\n return anim;\n };\n /*/\n * Element.stop\n [ method ]\n **\n * Stops all the animations for the current element\n **\n = (Element) the current element\n /*/\n elproto.stop = function () {\n var anims = this.inAnim();\n for (var i = 0, ii = anims.length; i < ii; i++) {\n anims[i].stop();\n }\n return this;\n };\n /*/\n * Element.animate\n [ method ]\n **\n * Animates the given attributes of the element\n **\n - attrs (object) key-value pairs of destination attributes\n - duration (number) duration of the animation in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function that executes when the animation ends\n = (Element) the current element\n /*/\n elproto.animate = function (attrs, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n if (attrs instanceof Animation) {\n callback = attrs.callback;\n easing = attrs.easing;\n ms = easing.dur;\n attrs = attrs.attr;\n }\n var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,\n el = this;\n for (var key in attrs) if (attrs[has](key)) {\n if (el.equal) {\n eq = el.equal(key, Str(attrs[key]));\n from = eq.from;\n to = eq.to;\n f = eq.f;\n } else {\n from = +el.attr(key);\n to = +attrs[key];\n }\n var len = is(from, \"array\") ? from.length : 1;\n keys[key] = slice(fkeys.length, fkeys.length + len, f);\n fkeys = fkeys.concat(from);\n tkeys = tkeys.concat(to);\n }\n var now = mina.time(),\n anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {\n var attr = {};\n for (var key in keys) if (keys[has](key)) {\n attr[key] = keys[key](val);\n }\n el.attr(attr);\n }, easing);\n el.anims[anim.id] = anim;\n anim._attrs = attrs;\n anim._callback = callback;\n eve(\"snap.animcreated.\" + el.id, anim);\n eve.once(\"mina.finish.\" + anim.id, function () {\n delete el.anims[anim.id];\n callback && callback.call(el);\n });\n eve.once(\"mina.stop.\" + anim.id, function () {\n delete el.anims[anim.id];\n });\n return el;\n };\n var eldata = {};\n /*/\n * Element.data\n [ method ]\n **\n * Adds or retrieves given value associated with given key. (Don’t confuse\n * with `data-` attributes)\n *\n * See also @Element.removeData\n - key (string) key to store data\n - value (any) #optional value to store\n = (object) @Element\n * or, if value is not specified:\n = (any) value\n > Usage\n | for (var i = 0, i < 5, i++) {\n | paper.circle(10 + 15 * i, 10, 10)\n | .attr({fill: \"#000\"})\n | .data(\"i\", i)\n | .click(function () {\n | alert(this.data(\"i\"));\n | });\n | }\n /*/\n elproto.data = function (key, value) {\n var data = eldata[this.id] = eldata[this.id] || {};\n if (arguments.length == 0){\n eve(\"snap.data.get.\" + this.id, this, data, null);\n return data;\n }\n if (arguments.length == 1) {\n if (Snap.is(key, \"object\")) {\n for (var i in key) if (key[has](i)) {\n this.data(i, key[i]);\n }\n return this;\n }\n eve(\"snap.data.get.\" + this.id, this, data[key], key);\n return data[key];\n }\n data[key] = value;\n eve(\"snap.data.set.\" + this.id, this, value, key);\n return this;\n };\n /*/\n * Element.removeData\n [ method ]\n **\n * Removes value associated with an element by given key.\n * If key is not provided, removes all the data of the element.\n - key (string) #optional key\n = (object) @Element\n /*/\n elproto.removeData = function (key) {\n if (key == null) {\n eldata[this.id] = {};\n } else {\n eldata[this.id] && delete eldata[this.id][key];\n }\n return this;\n };\n /*/\n * Element.outerSVG\n [ method ]\n **\n * Returns SVG code for the element, equivalent to HTML's `outerHTML`.\n *\n * See also @Element.innerSVG\n = (string) SVG code for the element\n /*/\n /*/\n * Element.toString\n [ method ]\n **\n * See @Element.outerSVG\n /*/\n elproto.outerSVG = elproto.toString = toString(1);\n /*/\n * Element.innerSVG\n [ method ]\n **\n * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`\n = (string) SVG code for the element\n /*/\n elproto.innerSVG = toString();\n function toString(type) {\n return function () {\n var res = type ? \"<\" + this.type : \"\",\n attr = this.node.attributes,\n chld = this.node.childNodes;\n if (type) {\n for (var i = 0, ii = attr.length; i < ii; i++) {\n res += \" \" + attr[i].name + '=\"' +\n attr[i].value.replace(/\"/g, '//\"') + '\"';\n }\n }\n if (chld.length) {\n type && (res += \">\");\n for (i = 0, ii = chld.length; i < ii; i++) {\n if (chld[i].nodeType == 3) {\n res += chld[i].nodeValue;\n } else if (chld[i].nodeType == 1) {\n res += wrap(chld[i]).toString();\n }\n }\n type && (res += \"</\" + this.type + \">\");\n } else {\n type && (res += \"/>\");\n }\n return res;\n };\n }\n elproto.toDataURL = function () {\n if (window && window.btoa) {\n var bb = this.getBBox(),\n svg = Snap.format('<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"{width}\" height=\"{height}\" viewBox=\"{x} {y} {width} {height}\">{contents}</svg>', {\n x: +bb.x.toFixed(3),\n y: +bb.y.toFixed(3),\n width: +bb.width.toFixed(3),\n height: +bb.height.toFixed(3),\n contents: this.outerSVG()\n });\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svg)));\n }\n };\n /*/\n * Fragment.select\n [ method ]\n **\n * See @Element.select\n /*/\n Fragment.prototype.select = elproto.select;\n /*/\n * Fragment.selectAll\n [ method ]\n **\n * See @Element.selectAll\n /*/\n Fragment.prototype.selectAll = elproto.selectAll;\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var objectToString = Object.prototype.toString,\n Str = String,\n math = Math,\n E = \"\";\n function Matrix(a, b, c, d, e, f) {\n if (b == null && objectToString.call(a) == \"[object SVGMatrix]\") {\n this.a = a.a;\n this.b = a.b;\n this.c = a.c;\n this.d = a.d;\n this.e = a.e;\n this.f = a.f;\n return;\n }\n if (a != null) {\n this.a = +a;\n this.b = +b;\n this.c = +c;\n this.d = +d;\n this.e = +e;\n this.f = +f;\n } else {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n }\n }\n (function (matrixproto) {\n /*/\n * Matrix.add\n [ method ]\n **\n * Adds the given matrix to existing one\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - matrix (object) @Matrix\n /*/\n matrixproto.add = function (a, b, c, d, e, f) {\n var out = [[], [], []],\n m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],\n matrix = [[a, c, e], [b, d, f], [0, 0, 1]],\n x, y, z, res;\n\n if (a && a instanceof Matrix) {\n matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];\n }\n\n for (x = 0; x < 3; x++) {\n for (y = 0; y < 3; y++) {\n res = 0;\n for (z = 0; z < 3; z++) {\n res += m[x][z] * matrix[z][y];\n }\n out[x][y] = res;\n }\n }\n this.a = out[0][0];\n this.b = out[1][0];\n this.c = out[0][1];\n this.d = out[1][1];\n this.e = out[0][2];\n this.f = out[1][2];\n return this;\n };\n /*/\n * Matrix.invert\n [ method ]\n **\n * Returns an inverted version of the matrix\n = (object) @Matrix\n /*/\n matrixproto.invert = function () {\n var me = this,\n x = me.a * me.d - me.b * me.c;\n return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);\n };\n /*/\n * Matrix.clone\n [ method ]\n **\n * Returns a copy of the matrix\n = (object) @Matrix\n /*/\n matrixproto.clone = function () {\n return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n };\n /*/\n * Matrix.translate\n [ method ]\n **\n * Translate the matrix\n - x (number) horizontal offset distance\n - y (number) vertical offset distance\n /*/\n matrixproto.translate = function (x, y) {\n return this.add(1, 0, 0, 1, x, y);\n };\n /*/\n * Matrix.scale\n [ method ]\n **\n * Scales the matrix\n - x (number) amount to be scaled, with `1` resulting in no change\n - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)\n - cx (number) #optional horizontal origin point from which to scale\n - cy (number) #optional vertical origin point from which to scale\n * Default cx, cy is the middle point of the element.\n /*/\n matrixproto.scale = function (x, y, cx, cy) {\n y == null && (y = x);\n (cx || cy) && this.add(1, 0, 0, 1, cx, cy);\n this.add(x, 0, 0, y, 0, 0);\n (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);\n return this;\n };\n /*/\n * Matrix.rotate\n [ method ]\n **\n * Rotates the matrix\n - a (number) angle of rotation, in degrees\n - x (number) horizontal origin point from which to rotate\n - y (number) vertical origin point from which to rotate\n /*/\n matrixproto.rotate = function (a, x, y) {\n a = Snap.rad(a);\n x = x || 0;\n y = y || 0;\n var cos = +math.cos(a).toFixed(9),\n sin = +math.sin(a).toFixed(9);\n this.add(cos, sin, -sin, cos, x, y);\n return this.add(1, 0, 0, 1, -x, -y);\n };\n /*/\n * Matrix.x\n [ method ]\n **\n * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y\n - x (number)\n - y (number)\n = (number) x\n /*/\n matrixproto.x = function (x, y) {\n return x * this.a + y * this.c + this.e;\n };\n /*/\n * Matrix.y\n [ method ]\n **\n * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x\n - x (number)\n - y (number)\n = (number) y\n /*/\n matrixproto.y = function (x, y) {\n return x * this.b + y * this.d + this.f;\n };\n matrixproto.get = function (i) {\n return +this[Str.fromCharCode(97 + i)].toFixed(4);\n };\n matrixproto.toString = function () {\n return \"matrix(\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + \")\";\n };\n matrixproto.offset = function () {\n return [this.e.toFixed(4), this.f.toFixed(4)];\n };\n function norm(a) {\n return a[0] * a[0] + a[1] * a[1];\n }\n function normalize(a) {\n var mag = math.sqrt(norm(a));\n a[0] && (a[0] /= mag);\n a[1] && (a[1] /= mag);\n }\n /*/\n * Matrix.determinant\n [ method ]\n **\n * Finds determinant of the given matrix.\n = (number) determinant\n /*/\n matrixproto.determinant = function () {\n return this.a * this.d - this.b * this.c;\n };\n /*/\n * Matrix.split\n [ method ]\n **\n * Splits matrix into primitive transformations\n = (object) in format:\n o dx (number) translation by x\n o dy (number) translation by y\n o scalex (number) scale by x\n o scaley (number) scale by y\n o shear (number) shear\n o rotate (number) rotation in deg\n o isSimple (boolean) could it be represented via simple transformations\n /*/\n matrixproto.split = function () {\n var out = {};\n // translation\n out.dx = this.e;\n out.dy = this.f;\n\n // scale and shear\n var row = [[this.a, this.c], [this.b, this.d]];\n out.scalex = math.sqrt(norm(row[0]));\n normalize(row[0]);\n\n out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];\n row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];\n\n out.scaley = math.sqrt(norm(row[1]));\n normalize(row[1]);\n out.shear /= out.scaley;\n\n if (this.determinant() < 0) {\n out.scalex = -out.scalex;\n }\n\n // rotation\n var sin = -row[0][1],\n cos = row[1][1];\n if (cos < 0) {\n out.rotate = Snap.deg(math.acos(cos));\n if (sin < 0) {\n out.rotate = 360 - out.rotate;\n }\n } else {\n out.rotate = Snap.deg(math.asin(sin));\n }\n\n out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);\n out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;\n out.noRotation = !+out.shear.toFixed(9) && !out.rotate;\n return out;\n };\n /*/\n * Matrix.toTransformString\n [ method ]\n **\n * Returns transform string that represents given matrix\n = (string) transform string\n /*/\n matrixproto.toTransformString = function (shorter) {\n var s = shorter || this.split();\n if (!+s.shear.toFixed(9)) {\n s.scalex = +s.scalex.toFixed(4);\n s.scaley = +s.scaley.toFixed(4);\n s.rotate = +s.rotate.toFixed(4);\n return (s.dx || s.dy ? \"t\" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) + \n (s.scalex != 1 || s.scaley != 1 ? \"s\" + [s.scalex, s.scaley, 0, 0] : E) +\n (s.rotate ? \"r\" + [+s.rotate.toFixed(4), 0, 0] : E);\n } else {\n return \"m\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];\n }\n };\n })(Matrix.prototype);\n /*/\n * Snap.Matrix\n [ method ]\n **\n * Matrix constructor, extend on your own risk.\n * To create matrices use @Snap.matrix.\n /*/\n Snap.Matrix = Matrix;\n /*/\n * Snap.matrix\n [ method ]\n **\n * Utility method\n **\n * Returns a matrix based on the given parameters\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - svgMatrix (SVGMatrix)\n = (object) @Matrix\n /*/\n Snap.matrix = function (a, b, c, d, e, f) {\n return new Matrix(a, b, c, d, e, f);\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var has = \"hasOwnProperty\",\n make = Snap._.make,\n wrap = Snap._.wrap,\n is = Snap.is,\n getSomeDefs = Snap._.getSomeDefs,\n reURLValue = /^url/(#?([^)]+)/)$/,\n $ = Snap._.$,\n URL = Snap.url,\n Str = String,\n separator = Snap._.separator,\n E = \"\";\n // Attributes event handlers\n eve.on(\"snap.util.attr.mask\", function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value.type == \"mask\") {\n var mask = value;\n } else {\n mask = make(\"mask\", getSomeDefs(this));\n mask.node.appendChild(value.node);\n }\n !mask.node.id && $(mask.node, {\n id: mask.id\n });\n $(this.node, {\n mask: URL(mask.id)\n });\n }\n });\n (function (clipIt) {\n eve.on(\"snap.util.attr.clip\", clipIt);\n eve.on(\"snap.util.attr.clip-path\", clipIt);\n eve.on(\"snap.util.attr.clipPath\", clipIt);\n }(function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value.type == \"clipPath\") {\n var clip = value;\n } else {\n clip = make(\"clipPath\", getSomeDefs(this));\n clip.node.appendChild(value.node);\n !clip.node.id && $(clip.node, {\n id: clip.id\n });\n }\n $(this.node, {\n \"clip-path\": URL(clip.node.id || clip.id)\n });\n }\n }));\n function fillStroke(name) {\n return function (value) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1 &&\n (value.node.firstChild.tagName == \"radialGradient\" ||\n value.node.firstChild.tagName == \"linearGradient\" ||\n value.node.firstChild.tagName == \"pattern\")) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value instanceof Element) {\n if (value.type == \"radialGradient\" || value.type == \"linearGradient\"\n || value.type == \"pattern\") {\n if (!value.node.id) {\n $(value.node, {\n id: value.id\n });\n }\n var fill = URL(value.node.id);\n } else {\n fill = value.attr(name);\n }\n } else {\n fill = Snap.color(value);\n if (fill.error) {\n var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);\n if (grad) {\n if (!grad.node.id) {\n $(grad.node, {\n id: grad.id\n });\n }\n fill = URL(grad.node.id);\n } else {\n fill = value;\n }\n } else {\n fill = Str(fill);\n }\n }\n var attrs = {};\n attrs[name] = fill;\n $(this.node, attrs);\n this.node.style[name] = E;\n };\n }\n eve.on(\"snap.util.attr.fill\", fillStroke(\"fill\"));\n eve.on(\"snap.util.attr.stroke\", fillStroke(\"stroke\"));\n var gradrg = /^([lr])(?:/(([^)]*)/))?(.*)$/i;\n eve.on(\"snap.util.grad.parse\", function parseGrad(string) {\n string = Str(string);\n var tokens = string.match(gradrg);\n if (!tokens) {\n return null;\n }\n var type = tokens[1],\n params = tokens[2],\n stops = tokens[3];\n params = params.split(//s*,/s*/).map(function (el) {\n return +el == el ? +el : el;\n });\n if (params.length == 1 && params[0] == 0) {\n params = [];\n }\n stops = stops.split(\"-\");\n stops = stops.map(function (el) {\n el = el.split(\":\");\n var out = {\n color: el[0]\n };\n if (el[1]) {\n out.offset = parseFloat(el[1]);\n }\n return out;\n });\n return {\n type: type,\n params: params,\n stops: stops\n };\n });\n\n eve.on(\"snap.util.attr.d\", function (value) {\n eve.stop();\n if (is(value, \"array\") && is(value[0], \"array\")) {\n value = Snap.path.toString.call(value);\n }\n value = Str(value);\n if (value.match(/[ruo]/i)) {\n value = Snap.path.toAbsolute(value);\n }\n $(this.node, {d: value});\n })(-1);\n eve.on(\"snap.util.attr.#text\", function (value) {\n eve.stop();\n value = Str(value);\n var txt = glob.doc.createTextNode(value);\n while (this.node.firstChild) {\n this.node.removeChild(this.node.firstChild);\n }\n this.node.appendChild(txt);\n })(-1);\n eve.on(\"snap.util.attr.path\", function (value) {\n eve.stop();\n this.attr({d: value});\n })(-1);\n eve.on(\"snap.util.attr.class\", function (value) {\n eve.stop();\n this.node.className.baseVal = value;\n })(-1);\n eve.on(\"snap.util.attr.viewBox\", function (value) {\n var vb;\n if (is(value, \"object\") && \"x\" in value) {\n vb = [value.x, value.y, value.width, value.height].join(\" \");\n } else if (is(value, \"array\")) {\n vb = value.join(\" \");\n } else {\n vb = value;\n }\n $(this.node, {\n viewBox: vb\n });\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.transform\", function (value) {\n this.transform(value);\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.r\", function (value) {\n if (this.type == \"rect\") {\n eve.stop();\n $(this.node, {\n rx: value,\n ry: value\n });\n }\n })(-1);\n eve.on(\"snap.util.attr.textpath\", function (value) {\n eve.stop();\n if (this.type == \"text\") {\n var id, tp, node;\n if (!value && this.textPath) {\n tp = this.textPath;\n while (tp.node.firstChild) {\n this.node.appendChild(tp.node.firstChild);\n }\n tp.remove();\n delete this.textPath;\n return;\n }\n if (is(value, \"string\")) {\n var defs = getSomeDefs(this),\n path = wrap(defs.parentNode).path(value);\n defs.appendChild(path.node);\n id = path.id;\n path.attr({id: id});\n } else {\n value = wrap(value);\n if (value instanceof Element) {\n id = value.attr(\"id\");\n if (!id) {\n id = value.id;\n value.attr({id: id});\n }\n }\n }\n if (id) {\n tp = this.textPath;\n node = this.node;\n if (tp) {\n tp.attr({\"xlink:href\": \"#\" + id});\n } else {\n tp = $(\"textPath\", {\n \"xlink:href\": \"#\" + id\n });\n while (node.firstChild) {\n tp.appendChild(node.firstChild);\n }\n node.appendChild(tp);\n this.textPath = wrap(tp);\n }\n }\n }\n })(-1);\n eve.on(\"snap.util.attr.text\", function (value) {\n if (this.type == \"text\") {\n var i = 0,\n node = this.node,\n tuner = function (chunk) {\n var out = $(\"tspan\");\n if (is(chunk, \"array\")) {\n for (var i = 0; i < chunk.length; i++) {\n out.appendChild(tuner(chunk[i]));\n }\n } else {\n out.appendChild(glob.doc.createTextNode(chunk));\n }\n out.normalize && out.normalize();\n return out;\n };\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n var tuned = tuner(value);\n while (tuned.firstChild) {\n node.appendChild(tuned.firstChild);\n }\n }\n eve.stop();\n })(-1);\n function setFontSize(value) {\n eve.stop();\n if (value == +value) {\n value += \"px\";\n }\n this.node.style.fontSize = value;\n }\n eve.on(\"snap.util.attr.fontSize\", setFontSize)(-1);\n eve.on(\"snap.util.attr.font-size\", setFontSize)(-1);\n\n\n eve.on(\"snap.util.getattr.transform\", function () {\n eve.stop();\n return this.transform();\n })(-1);\n eve.on(\"snap.util.getattr.textpath\", function () {\n eve.stop();\n return this.textPath;\n })(-1);\n // Markers\n (function () {\n function getter(end) {\n return function () {\n eve.stop();\n var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue(\"marker-\" + end);\n if (style == \"none\") {\n return style;\n } else {\n return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));\n }\n };\n }\n function setter(end) {\n return function (value) {\n eve.stop();\n var name = \"marker\" + end.charAt(0).toUpperCase() + end.substring(1);\n if (value == \"\" || !value) {\n this.node.style[name] = \"none\";\n return;\n }\n if (value.type == \"marker\") {\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n }\n this.node.style[name] = URL(id);\n return;\n }\n };\n }\n eve.on(\"snap.util.getattr.marker-end\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.markerEnd\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.marker-start\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.markerStart\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.marker-mid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.getattr.markerMid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.marker-end\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.markerEnd\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.marker-start\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.markerStart\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.marker-mid\", setter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.markerMid\", setter(\"mid\"))(-1);\n }());\n eve.on(\"snap.util.getattr.r\", function () {\n if (this.type == \"rect\" && $(this.node, \"rx\") == $(this.node, \"ry\")) {\n eve.stop();\n return $(this.node, \"rx\");\n }\n })(-1);\n function textExtract(node) {\n var out = [];\n var children = node.childNodes;\n for (var i = 0, ii = children.length; i < ii; i++) {\n var chi = children[i];\n if (chi.nodeType == 3) {\n out.push(chi.nodeValue);\n }\n if (chi.tagName == \"tspan\") {\n if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {\n out.push(chi.firstChild.nodeValue);\n } else {\n out.push(textExtract(chi));\n }\n }\n }\n return out;\n }\n eve.on(\"snap.util.getattr.text\", function () {\n if (this.type == \"text\" || this.type == \"tspan\") {\n eve.stop();\n var out = textExtract(this.node);\n return out.length == 1 ? out[0] : out;\n }\n })(-1);\n eve.on(\"snap.util.getattr.#text\", function () {\n return this.node.textContent;\n })(-1);\n eve.on(\"snap.util.getattr.viewBox\", function () {\n eve.stop();\n var vb = $(this.node, \"viewBox\");\n if (vb) {\n vb = vb.split(separator);\n return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.points\", function () {\n var p = $(this.node, \"points\");\n eve.stop();\n if (p) {\n return p.split(separator);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.path\", function () {\n var p = $(this.node, \"d\");\n eve.stop();\n return p;\n })(-1);\n eve.on(\"snap.util.getattr.class\", function () {\n return this.node.className.baseVal;\n })(-1);\n function getFontSize() {\n eve.stop();\n return this.node.style.fontSize;\n }\n eve.on(\"snap.util.getattr.fontSize\", getFontSize)(-1);\n eve.on(\"snap.util.getattr.font-size\", getFontSize)(-1);\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var proto = Paper.prototype,\n is = Snap.is;\n /*/\n * Paper.rect\n [ method ]\n *\n * Draws a rectangle\n **\n - x (number) x coordinate of the top left corner\n - y (number) y coordinate of the top left corner\n - width (number) width\n - height (number) height\n - rx (number) #optional horizontal radius for rounded corners, default is 0\n - ry (number) #optional vertical radius for rounded corners, default is rx or 0\n = (object) the `rect` element\n **\n > Usage\n | // regular rectangle\n | var c = paper.rect(10, 10, 50, 50);\n | // rectangle with rounded corners\n | var c = paper.rect(40, 40, 50, 50, 10);\n /*/\n proto.rect = function (x, y, w, h, rx, ry) {\n var attr;\n if (ry == null) {\n ry = rx;\n }\n if (is(x, \"object\") && x == \"[object Object]\") {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n width: w,\n height: h\n };\n if (rx != null) {\n attr.rx = rx;\n attr.ry = ry;\n }\n }\n return this.el(\"rect\", attr);\n };\n /*/\n * Paper.circle\n [ method ]\n **\n * Draws a circle\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - r (number) radius\n = (object) the `circle` element\n **\n > Usage\n | var c = paper.circle(50, 50, 40);\n /*/\n proto.circle = function (cx, cy, r) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr = {\n cx: cx,\n cy: cy,\n r: r\n };\n }\n return this.el(\"circle\", attr);\n };\n\n var preload = (function () {\n function onerror() {\n this.parentNode.removeChild(this);\n }\n return function (src, f) {\n var img = glob.doc.createElement(\"img\"),\n body = glob.doc.body;\n img.style.cssText = \"position:absolute;left:-9999em;top:-9999em\";\n img.onload = function () {\n f.call(img);\n img.onload = img.onerror = null;\n body.removeChild(img);\n };\n img.onerror = onerror;\n body.appendChild(img);\n img.src = src;\n };\n }());\n\n /*/\n * Paper.image\n [ method ]\n **\n * Places an image on the surface\n **\n - src (string) URI of the source image\n - x (number) x offset position\n - y (number) y offset position\n - width (number) width of the image\n - height (number) height of the image\n = (object) the `image` element\n * or\n = (object) Snap element object with type `image`\n **\n > Usage\n | var c = paper.image(\"apple.png\", 10, 10, 80, 80);\n /*/\n proto.image = function (src, x, y, width, height) {\n var el = this.el(\"image\");\n if (is(src, \"object\") && \"src\" in src) {\n el.attr(src);\n } else if (src != null) {\n var set = {\n \"xlink:href\": src,\n preserveAspectRatio: \"none\"\n };\n if (x != null && y != null) {\n set.x = x;\n set.y = y;\n }\n if (width != null && height != null) {\n set.width = width;\n set.height = height;\n } else {\n preload(src, function () {\n Snap._.$(el.node, {\n width: this.offsetWidth,\n height: this.offsetHeight\n });\n });\n }\n Snap._.$(el.node, set);\n }\n return el;\n };\n /*/\n * Paper.ellipse\n [ method ]\n **\n * Draws an ellipse\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - rx (number) horizontal radius\n - ry (number) vertical radius\n = (object) the `ellipse` element\n **\n > Usage\n | var c = paper.ellipse(50, 50, 40, 20);\n /*/\n proto.ellipse = function (cx, cy, rx, ry) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr ={\n cx: cx,\n cy: cy,\n rx: rx,\n ry: ry\n };\n }\n return this.el(\"ellipse\", attr);\n };\n // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.\n /*/\n * Paper.path\n [ method ]\n **\n * Creates a `<path>` element using the given string as the path's definition\n - pathString (string) #optional path string in SVG format\n * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:\n | \"M10,20L30,40\"\n * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.\n *\n # <p>Here is short list of commands available, for more details see <a href=\"http://www.w3.org/TR/SVG/paths.html#PathData\" title=\"Details of a path's data attribute's format are described in the SVG specification.\">SVG path string format</a> or <a href=\"https://developer.mozilla.org/en/SVG/Tutorial/Paths\">article about path strings at MDN</a>.</p>\n # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>\n # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>\n # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>\n # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>\n # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>\n # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>\n # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>\n # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>\n # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>\n # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>\n # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>\n # <tr><td>R</td><td><a href=\"http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline\">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>\n * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.\n * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.\n > Usage\n | var c = paper.path(\"M10 10L90 90\");\n | // draw a diagonal line:\n | // move to 10,10, line to 90,90\n /*/\n proto.path = function (d) {\n var attr;\n if (is(d, \"object\") && !is(d, \"array\")) {\n attr = d;\n } else if (d) {\n attr = {d: d};\n }\n return this.el(\"path\", attr);\n };\n /*/\n * Paper.g\n [ method ]\n **\n * Creates a group element\n **\n - varargs (…) #optional elements to nest within the group\n = (object) the `g` element\n **\n > Usage\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g(c2, c1); // note that the order of elements is different\n * or\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g();\n | g.add(c2, c1);\n /*/\n /*/\n * Paper.group\n [ method ]\n **\n * See @Paper.g\n /*/\n proto.group = proto.g = function (first) {\n var attr,\n el = this.el(\"g\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.svg\n [ method ]\n **\n * Creates a nested SVG element.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `svg` element\n **\n /*/\n proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {\n var attrs = {};\n if (is(x, \"object\") && y == null) {\n attrs = x;\n } else {\n if (x != null) {\n attrs.x = x;\n }\n if (y != null) {\n attrs.y = y;\n }\n if (width != null) {\n attrs.width = width;\n }\n if (height != null) {\n attrs.height = height;\n }\n if (vbx != null && vby != null && vbw != null && vbh != null) {\n attrs.viewBox = [vbx, vby, vbw, vbh];\n }\n }\n return this.el(\"svg\", attrs);\n };\n /*/\n * Paper.mask\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a mask.\n **\n = (object) the `mask` element\n **\n /*/\n proto.mask = function (first) {\n var attr,\n el = this.el(\"mask\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.ptrn\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a pattern.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `pattern` element\n **\n /*/\n proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {\n if (is(x, \"object\")) {\n var attr = x;\n } else {\n attr = {patternUnits: \"userSpaceOnUse\"};\n if (x) {\n attr.x = x;\n }\n if (y) {\n attr.y = y;\n }\n if (width != null) {\n attr.width = width;\n }\n if (height != null) {\n attr.height = height;\n }\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n }\n return this.el(\"pattern\", attr);\n };\n /*/\n * Paper.use\n [ method ]\n **\n * Creates a <use> element.\n - id (string) @optional id of element to link\n * or\n - id (Element) @optional element to link\n **\n = (object) the `use` element\n **\n /*/\n proto.use = function (id) {\n if (id != null) {\n if (id instanceof Element) {\n if (!id.attr(\"id\")) {\n id.attr({id: Snap._.id(id)});\n }\n id = id.attr(\"id\");\n }\n if (String(id).charAt() == \"#\") {\n id = id.substring(1);\n }\n return this.el(\"use\", {\"xlink:href\": \"#\" + id});\n } else {\n return Element.prototype.use.call(this);\n }\n };\n /*/\n * Paper.symbol\n [ method ]\n **\n * Creates a <symbol> element.\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n = (object) the `symbol` element\n **\n /*/\n proto.symbol = function (vx, vy, vw, vh) {\n var attr = {};\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n\n return this.el(\"symbol\", attr);\n };\n /*/\n * Paper.text\n [ method ]\n **\n * Draws a text string\n **\n - x (number) x coordinate position\n - y (number) y coordinate position\n - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements\n = (object) the `text` element\n **\n > Usage\n | var t1 = paper.text(50, 50, \"Snap\");\n | var t2 = paper.text(50, 50, [\"S\",\"n\",\"a\",\"p\"]);\n | // Text path usage\n | t1.attr({textpath: \"M10,10L100,100\"});\n | // or\n | var pth = paper.path(\"M10,10L100,100\");\n | t1.attr({textpath: pth});\n /*/\n proto.text = function (x, y, text) {\n var attr = {};\n if (is(x, \"object\")) {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n text: text || \"\"\n };\n }\n return this.el(\"text\", attr);\n };\n /*/\n * Paper.line\n [ method ]\n **\n * Draws a line\n **\n - x1 (number) x coordinate position of the start\n - y1 (number) y coordinate position of the start\n - x2 (number) x coordinate position of the end\n - y2 (number) y coordinate position of the end\n = (object) the `line` element\n **\n > Usage\n | var t1 = paper.line(50, 50, 100, 100);\n /*/\n proto.line = function (x1, y1, x2, y2) {\n var attr = {};\n if (is(x1, \"object\")) {\n attr = x1;\n } else if (x1 != null) {\n attr = {\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n }\n return this.el(\"line\", attr);\n };\n /*/\n * Paper.polyline\n [ method ]\n **\n * Draws a polyline\n **\n - points (array) array of points\n * or\n - varargs (…) points\n = (object) the `polyline` element\n **\n > Usage\n | var p1 = paper.polyline([10, 10, 100, 100]);\n | var p2 = paper.polyline(10, 10, 100, 100);\n /*/\n proto.polyline = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polyline\", attr);\n };\n /*/\n * Paper.polygon\n [ method ]\n **\n * Draws a polygon. See @Paper.polyline\n /*/\n proto.polygon = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polygon\", attr);\n };\n // gradients\n (function () {\n var $ = Snap._.$;\n // gradients' helpers\n function Gstops() {\n return this.selectAll(\"stop\");\n }\n function GaddStop(color, offset) {\n var stop = $(\"stop\"),\n attr = {\n offset: +offset + \"%\"\n };\n color = Snap.color(color);\n attr[\"stop-color\"] = color.hex;\n if (color.opacity < 1) {\n attr[\"stop-opacity\"] = color.opacity;\n }\n $(stop, attr);\n this.node.appendChild(stop);\n return this;\n }\n function GgetBBox() {\n if (this.type == \"linearGradient\") {\n var x1 = $(this.node, \"x1\") || 0,\n x2 = $(this.node, \"x2\") || 1,\n y1 = $(this.node, \"y1\") || 0,\n y2 = $(this.node, \"y2\") || 0;\n return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));\n } else {\n var cx = this.node.cx || .5,\n cy = this.node.cy || .5,\n r = this.node.r || 0;\n return Snap._.box(cx - r, cy - r, r * 2, r * 2);\n }\n }\n function gradient(defs, str) {\n var grad = eve(\"snap.util.grad.parse\", null, str).firstDefined(),\n el;\n if (!grad) {\n return null;\n }\n grad.params.unshift(defs);\n if (grad.type.toLowerCase() == \"l\") {\n el = gradientLinear.apply(0, grad.params);\n } else {\n el = gradientRadial.apply(0, grad.params);\n }\n if (grad.type != grad.type.toLowerCase()) {\n $(el.node, {\n gradientUnits: \"userSpaceOnUse\"\n });\n }\n var stops = grad.stops,\n len = stops.length,\n start = 0,\n j = 0;\n function seed(i, end) {\n var step = (end - start) / (i - j);\n for (var k = j; k < i; k++) {\n stops[k].offset = +(+start + step * (k - j)).toFixed(2);\n }\n j = i;\n start = end;\n }\n len--;\n for (var i = 0; i < len; i++) if (\"offset\" in stops[i]) {\n seed(i, stops[i].offset);\n }\n stops[len].offset = stops[len].offset || 100;\n seed(len, stops[len].offset);\n for (i = 0; i <= len; i++) {\n var stop = stops[i];\n el.addStop(stop.color, stop.offset);\n }\n return el;\n }\n function gradientLinear(defs, x1, y1, x2, y2) {\n var el = Snap._.make(\"linearGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (x1 != null) {\n $(el.node, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n }\n return el;\n }\n function gradientRadial(defs, cx, cy, r, fx, fy) {\n var el = Snap._.make(\"radialGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (cx != null) {\n $(el.node, {\n cx: cx,\n cy: cy,\n r: r\n });\n }\n if (fx != null && fy != null) {\n $(el.node, {\n fx: fx,\n fy: fy\n });\n }\n return el;\n }\n /*/\n * Paper.gradient\n [ method ]\n **\n * Creates a gradient element\n **\n - gradient (string) gradient descriptor\n > Gradient Descriptor\n * The gradient descriptor is an expression formatted as\n * follows: `<type>(<coords>)<colors>`. The `<type>` can be\n * either linear or radial. The uppercase `L` or `R` letters\n * indicate absolute coordinates offset from the SVG surface.\n * Lowercase `l` or `r` letters indicate coordinates\n * calculated relative to the element to which the gradient is\n * applied. Coordinates specify a linear gradient vector as\n * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,\n * `r` and optional `fx`, `fy` specifying a focal point away\n * from the center of the circle. Specify `<colors>` as a list\n * of dash-separated CSS color values. Each color may be\n * followed by a custom offset value, separated with a colon\n * character.\n > Examples\n * Linear gradient, relative from top-left corner to bottom-right\n * corner, from black through red to white:\n | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n * Linear gradient, absolute from (0, 0) to (100, 100), from black\n * through red at 25% to white:\n | var g = paper.gradient(\"L(0, 0, 100, 100)#000-#f00:25-#fff\");\n * Radial gradient, relative from the center of the element with radius\n * half the width, from black to white:\n | var g = paper.gradient(\"r(0.5, 0.5, 0.5)#000-#fff\");\n * To apply the gradient:\n | paper.circle(50, 50, 40).attr({\n | fill: g\n | });\n = (object) the `gradient` element\n /*/\n proto.gradient = function (str) {\n return gradient(this.defs, str);\n };\n proto.gradientLinear = function (x1, y1, x2, y2) {\n return gradientLinear(this.defs, x1, y1, x2, y2);\n };\n proto.gradientRadial = function (cx, cy, r, fx, fy) {\n return gradientRadial(this.defs, cx, cy, r, fx, fy);\n };\n /*/\n * Paper.toString\n [ method ]\n **\n * Returns SVG code for the @Paper\n = (string) SVG code for the @Paper\n /*/\n proto.toString = function () {\n var doc = this.node.ownerDocument,\n f = doc.createDocumentFragment(),\n d = doc.createElement(\"div\"),\n svg = this.node.cloneNode(true),\n res;\n f.appendChild(d);\n d.appendChild(svg);\n Snap._.$(svg, {xmlns: \"http://www.w3.org/2000/svg\"});\n res = d.innerHTML;\n f.removeChild(f.firstChild);\n return res;\n };\n /*/\n * Paper.toDataURL\n [ method ]\n **\n * Returns SVG code for the @Paper as Data URI string.\n = (string) Data URI string\n /*/\n proto.toDataURL = function () {\n if (window && window.btoa) {\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(this)));\n }\n };\n /*/\n * Paper.clear\n [ method ]\n **\n * Removes all child nodes of the paper, except <defs>.\n /*/\n proto.clear = function () {\n var node = this.node.firstChild,\n next;\n while (node) {\n next = node.nextSibling;\n if (node.tagName != \"defs\") {\n node.parentNode.removeChild(node);\n } else {\n proto.clear.call({node: node});\n }\n node = next;\n }\n };\n }());\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n is = Snap.is,\n clone = Snap._.clone,\n has = \"hasOwnProperty\",\n p2s = /,?([a-z]),?/gi,\n toFloat = parseFloat,\n math = Math,\n PI = math.PI,\n mmin = math.min,\n mmax = math.max,\n pow = math.pow,\n abs = math.abs;\n function paths(ps) {\n var p = paths.ps = paths.ps || {};\n if (p[ps]) {\n p[ps].sleep = 100;\n } else {\n p[ps] = {\n sleep: 100\n };\n }\n setTimeout(function () {\n for (var key in p) if (p[has](key) && key != ps) {\n p[key].sleep--;\n !p[key].sleep && delete p[key];\n }\n });\n return p[ps];\n }\n function box(x, y, width, height) {\n if (x == null) {\n x = y = width = height = 0;\n }\n if (y == null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: math.min(width, height) / 2,\n r2: math.max(width, height) / 2,\n r0: math.sqrt(width * width + height * height) / 2,\n path: rectPath(x, y, width, height),\n vb: [x, y, width, height].join(\" \")\n };\n }\n function toString() {\n return this.join(\",\").replace(p2s, \"$1\");\n }\n function pathClone(pathArray) {\n var res = clone(pathArray);\n res.toString = toString;\n return res;\n }\n function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {\n if (length == null) {\n return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);\n } else {\n return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,\n getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));\n }\n }\n function getLengthFactory(istotal, subpath) {\n function O(val) {\n return +(+val).toFixed(3);\n }\n return Snap._.cacher(function (path, length, onlystart) {\n if (path instanceof Element) {\n path = path.attr(\"d\");\n }\n path = path2curve(path);\n var x, y, p, l, sp = \"\", subpaths = {}, point,\n len = 0;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = +p[1];\n y = +p[2];\n } else {\n l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n if (len + l > length) {\n if (subpath && !subpaths.start) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n sp += [\n \"C\" + O(point.start.x),\n O(point.start.y),\n O(point.m.x),\n O(point.m.y),\n O(point.x),\n O(point.y)\n ];\n if (onlystart) {return sp;}\n subpaths.start = sp;\n sp = [\n \"M\" + O(point.x),\n O(point.y) + \"C\" + O(point.n.x),\n O(point.n.y),\n O(point.end.x),\n O(point.end.y),\n O(p[5]),\n O(p[6])\n ].join();\n len += l;\n x = +p[5];\n y = +p[6];\n continue;\n }\n if (!istotal && !subpath) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n return point;\n }\n }\n len += l;\n x = +p[5];\n y = +p[6];\n }\n sp += p.shift() + p;\n }\n subpaths.end = sp;\n point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);\n return point;\n }, null, Snap._.clone);\n }\n var getTotalLength = getLengthFactory(1),\n getPointAtLength = getLengthFactory(),\n getSubpathsAtLength = getLengthFactory(0, 1);\n function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t,\n t13 = pow(t1, 3),\n t12 = pow(t1, 2),\n t2 = t * t,\n t3 = t2 * t,\n x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,\n mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n ax = t1 * p1x + t * c1x,\n ay = t1 * p1y + t * c1y,\n cx = t1 * c2x + t * p2x,\n cy = t1 * c2y + t * p2y,\n alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);\n // (mx > nx || my < ny) && (alpha += 180);\n return {\n x: x,\n y: y,\n m: {x: mx, y: my},\n n: {x: nx, y: ny},\n start: {x: ax, y: ay},\n end: {x: cx, y: cy},\n alpha: alpha\n };\n }\n function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Snap.is(p1x, \"array\")) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n var bbox = curveDim.apply(null, p1x);\n return box(\n bbox.min.x,\n bbox.min.y,\n bbox.max.x - bbox.min.x,\n bbox.max.y - bbox.min.y\n );\n }\n function isPointInsideBBox(bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n }\n function isBBoxIntersect(bbox1, bbox2) {\n bbox1 = box(bbox1);\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)\n || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x\n || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)\n && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y\n || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n }\n function base3(t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n }\n function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z == null) {\n z = 1;\n }\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2,\n n = 12,\n Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],\n Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],\n sum = 0;\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2,\n xbase = base3(ct, x1, x2, x3, x4),\n ybase = base3(ct, y1, y2, y3, y4),\n comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * math.sqrt(comb);\n }\n return z2 * sum;\n }\n function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {\n if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {\n return;\n }\n var t = 1,\n step = t / 2,\n t2 = t - step,\n l,\n e = .01;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n while (abs(l - ll) > e) {\n step /= 2;\n t2 += (l < ll ? 1 : -1) * step;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n }\n return t2;\n }\n function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n if (\n mmax(x1, x2) < mmin(x3, x4) ||\n mmin(x1, x2) > mmax(x3, x4) ||\n mmax(y1, y2) < mmin(y3, y4) ||\n mmin(y1, y2) > mmax(y3, y4)\n ) {\n return;\n }\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (!denominator) {\n return;\n }\n var px = nx / denominator,\n py = ny / denominator,\n px2 = +px.toFixed(2),\n py2 = +py.toFixed(2);\n if (\n px2 < +mmin(x1, x2).toFixed(2) ||\n px2 > +mmax(x1, x2).toFixed(2) ||\n px2 < +mmin(x3, x4).toFixed(2) ||\n px2 > +mmax(x3, x4).toFixed(2) ||\n py2 < +mmin(y1, y2).toFixed(2) ||\n py2 > +mmax(y1, y2).toFixed(2) ||\n py2 < +mmin(y3, y4).toFixed(2) ||\n py2 > +mmax(y3, y4).toFixed(2)\n ) {\n return;\n }\n return {x: px, y: py};\n }\n function inter(bez1, bez2) {\n return interHelper(bez1, bez2);\n }\n function interCount(bez1, bez2) {\n return interHelper(bez1, bez2, 1);\n }\n function interHelper(bez1, bez2, justCount) {\n var bbox1 = bezierBBox(bez1),\n bbox2 = bezierBBox(bez2);\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n var l1 = bezlen.apply(0, bez1),\n l2 = bezlen.apply(0, bez2),\n n1 = ~~(l1 / 8),\n n2 = ~~(l2 / 8),\n dots1 = [],\n dots2 = [],\n xy = {},\n res = justCount ? 0 : [];\n for (var i = 0; i < n1 + 1; i++) {\n var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({x: p.x, y: p.y, t: i / n1});\n }\n for (i = 0; i < n2 + 1; i++) {\n p = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({x: p.x, y: p.y, t: i / n2});\n }\n for (i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i],\n di1 = dots1[i + 1],\n dj = dots2[j],\n dj1 = dots2[j + 1],\n ci = abs(di1.x - di.x) < .001 ? \"y\" : \"x\",\n cj = abs(dj1.x - dj.x) < .001 ? \"y\" : \"x\",\n is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n if (is) {\n if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {\n continue;\n }\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n res++;\n } else {\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2\n });\n }\n }\n }\n }\n }\n return res;\n }\n function pathIntersection(path1, path2) {\n return interPathHelper(path1, path2);\n }\n function pathIntersectionNumber(path1, path2) {\n return interPathHelper(path1, path2, 1);\n }\n function interPathHelper(path1, path2, justCount) {\n path1 = path2curve(path1);\n path2 = path2curve(path2);\n var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,\n res = justCount ? 0 : [];\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n if (pi[0] == \"M\") {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n } else {\n if (pi[0] == \"C\") {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n } else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n if (pj[0] == \"M\") {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n } else {\n if (pj[0] == \"C\") {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n } else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n var intr = interHelper(bez1, bez2, justCount);\n if (justCount) {\n res += intr;\n } else {\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n res = res.concat(intr);\n }\n }\n }\n }\n }\n return res;\n }\n function isPointInsidePath(path, x, y) {\n var bbox = pathBBox(path);\n return isPointInsideBBox(bbox, x, y) &&\n interPathHelper(path, [[\"M\", x, y], [\"H\", bbox.x2 + 10]], 1) % 2 == 1;\n }\n function pathBBox(path) {\n var pth = paths(path);\n if (pth.bbox) {\n return clone(pth.bbox);\n }\n if (!path) {\n return box();\n }\n path = path2curve(path);\n var x = 0, \n y = 0,\n X = [],\n Y = [],\n p;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = p[1];\n y = p[2];\n X.push(x);\n Y.push(y);\n } else {\n var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n X = X.concat(dim.min.x, dim.max.x);\n Y = Y.concat(dim.min.y, dim.max.y);\n x = p[5];\n y = p[6];\n }\n }\n var xmin = mmin.apply(0, X),\n ymin = mmin.apply(0, Y),\n xmax = mmax.apply(0, X),\n ymax = mmax.apply(0, Y),\n bb = box(xmin, ymin, xmax - xmin, ymax - ymin);\n pth.bbox = clone(bb);\n return bb;\n }\n function rectPath(x, y, w, h, r) {\n if (r) {\n return [\n [\"M\", +x + (+r), y],\n [\"l\", w - r * 2, 0],\n [\"a\", r, r, 0, 0, 1, r, r],\n [\"l\", 0, h - r * 2],\n [\"a\", r, r, 0, 0, 1, -r, r],\n [\"l\", r * 2 - w, 0],\n [\"a\", r, r, 0, 0, 1, -r, -r],\n [\"l\", 0, r * 2 - h],\n [\"a\", r, r, 0, 0, 1, r, -r],\n [\"z\"]\n ];\n }\n var res = [[\"M\", x, y], [\"l\", w, 0], [\"l\", 0, h], [\"l\", -w, 0], [\"z\"]];\n res.toString = toString;\n return res;\n }\n function ellipsePath(x, y, rx, ry, a) {\n if (a == null && ry == null) {\n ry = rx;\n }\n x = +x;\n y = +y;\n rx = +rx;\n ry = +ry;\n if (a != null) {\n var rad = Math.PI / 180,\n x1 = x + rx * Math.cos(-ry * rad),\n x2 = x + rx * Math.cos(-a * rad),\n y1 = y + rx * Math.sin(-ry * rad),\n y2 = y + rx * Math.sin(-a * rad),\n res = [[\"M\", x1, y1], [\"A\", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];\n } else {\n res = [\n [\"M\", x, y],\n [\"m\", 0, -ry],\n [\"a\", rx, ry, 0, 1, 1, 0, 2 * ry],\n [\"a\", rx, ry, 0, 1, 1, 0, -2 * ry],\n [\"z\"]\n ];\n }\n res.toString = toString;\n return res;\n }\n var unit2px = Snap._unit2px,\n getPath = {\n path: function (el) {\n return el.attr(\"path\");\n },\n circle: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx, attr.cy, attr.r);\n },\n ellipse: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);\n },\n rect: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);\n },\n image: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);\n },\n line: function (el) {\n return \"M\" + [el.attr(\"x1\") || 0, el.attr(\"y1\") || 0, el.attr(\"x2\"), el.attr(\"y2\")];\n },\n polyline: function (el) {\n return \"M\" + el.attr(\"points\");\n },\n polygon: function (el) {\n return \"M\" + el.attr(\"points\") + \"z\";\n },\n deflt: function (el) {\n var bbox = el.node.getBBox();\n return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);\n }\n };\n function pathToRelative(pathArray) {\n var pth = paths(pathArray),\n lowerCase = String.prototype.toLowerCase;\n if (pth.rel) {\n return pathClone(pth.rel);\n }\n if (!Snap.is(pathArray, \"array\") || !Snap.is(pathArray && pathArray[0], \"array\")) {\n pathArray = Snap.parsePathString(pathArray);\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0;\n if (pathArray[0][0] == \"M\") {\n x = pathArray[0][1];\n y = pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res.push([\"M\", x, y]);\n }\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var r = res[i] = [],\n pa = pathArray[i];\n if (pa[0] != lowerCase.call(pa[0])) {\n r[0] = lowerCase.call(pa[0]);\n switch (r[0]) {\n case \"a\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +(pa[6] - x).toFixed(3);\n r[7] = +(pa[7] - y).toFixed(3);\n break;\n case \"v\":\n r[1] = +(pa[1] - y).toFixed(3);\n break;\n case \"m\":\n mx = pa[1];\n my = pa[2];\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);\n }\n }\n } else {\n r = res[i] = [];\n if (pa[0] == \"m\") {\n mx = pa[1] + x;\n my = pa[2] + y;\n }\n for (var k = 0, kk = pa.length; k < kk; k++) {\n res[i][k] = pa[k];\n }\n }\n var len = res[i].length;\n switch (res[i][0]) {\n case \"z\":\n x = mx;\n y = my;\n break;\n case \"h\":\n x += +res[i][len - 1];\n break;\n case \"v\":\n y += +res[i][len - 1];\n break;\n default:\n x += +res[i][len - 2];\n y += +res[i][len - 1];\n }\n }\n res.toString = toString;\n pth.rel = pathClone(res);\n return res;\n }\n function pathToAbsolute(pathArray) {\n var pth = paths(pathArray);\n if (pth.abs) {\n return pathClone(pth.abs);\n }\n if (!is(pathArray, \"array\") || !is(pathArray && pathArray[0], \"array\")) { // rough assumption\n pathArray = Snap.parsePathString(pathArray);\n }\n if (!pathArray || !pathArray.length) {\n return [[\"M\", 0, 0]];\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0,\n pa0;\n if (pathArray[0][0] == \"M\") {\n x = +pathArray[0][1];\n y = +pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res[0] = [\"M\", x, y];\n }\n var crz = pathArray.length == 3 &&\n pathArray[0][0] == \"M\" &&\n pathArray[1][0].toUpperCase() == \"R\" &&\n pathArray[2][0].toUpperCase() == \"Z\";\n for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n res.push(r = []);\n pa = pathArray[i];\n pa0 = pa[0];\n if (pa0 != pa0.toUpperCase()) {\n r[0] = pa0.toUpperCase();\n switch (r[0]) {\n case \"A\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case \"V\":\n r[1] = +pa[1] + y;\n break;\n case \"H\":\n r[1] = +pa[1] + x;\n break;\n case \"R\":\n var dots = [x, y].concat(pa.slice(1));\n for (var j = 2, jj = dots.length; j < jj; j++) {\n dots[j] = +dots[j] + x;\n dots[++j] = +dots[j] + y;\n }\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n break;\n case \"O\":\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n break;\n case \"U\":\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n break;\n case \"M\":\n mx = +pa[1] + x;\n my = +pa[2] + y;\n default:\n for (j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n } else if (pa0 == \"R\") {\n dots = [x, y].concat(pa.slice(1));\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n r = [\"R\"].concat(pa.slice(-2));\n } else if (pa0 == \"O\") {\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n } else if (pa0 == \"U\") {\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n } else {\n for (var k = 0, kk = pa.length; k < kk; k++) {\n r[k] = pa[k];\n }\n }\n pa0 = pa0.toUpperCase();\n if (pa0 != \"O\") {\n switch (r[0]) {\n case \"Z\":\n x = +mx;\n y = +my;\n break;\n case \"H\":\n x = r[1];\n break;\n case \"V\":\n y = r[1];\n break;\n case \"M\":\n mx = r[r.length - 2];\n my = r[r.length - 1];\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n }\n }\n res.toString = toString;\n pth.abs = pathClone(res);\n return res;\n }\n function l2c(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n }\n function q2c(x1, y1, ax, ay, x2, y2) {\n var _13 = 1 / 3,\n _23 = 2 / 3;\n return [\n _13 * x1 + _23 * ax,\n _13 * y1 + _23 * ay,\n _13 * x2 + _23 * ax,\n _13 * y2 + _23 * ay,\n x2,\n y2\n ];\n }\n function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n // for more information of where this math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var _120 = PI * 120 / 180,\n rad = PI / 180 * (+angle || 0),\n res = [],\n xy,\n rotate = Snap._.cacher(function (x, y, rad) {\n var X = x * math.cos(rad) - y * math.sin(rad),\n Y = x * math.sin(rad) + y * math.cos(rad);\n return {x: X, y: Y};\n });\n if (!recursive) {\n xy = rotate(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotate(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var cos = math.cos(PI / 180 * angle),\n sin = math.sin(PI / 180 * angle),\n x = (x1 - x2) / 2,\n y = (y1 - y2) / 2;\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n if (h > 1) {\n h = math.sqrt(h);\n rx = h * rx;\n ry = h * ry;\n }\n var rx2 = rx * rx,\n ry2 = ry * ry,\n k = (large_arc_flag == sweep_flag ? -1 : 1) *\n math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n cx = k * rx * y / ry + (x1 + x2) / 2,\n cy = k * -ry * x / rx + (y1 + y2) / 2,\n f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n\n f1 = x1 < cx ? PI - f1 : f1;\n f2 = x2 < cx ? PI - f2 : f2;\n f1 < 0 && (f1 = PI * 2 + f1);\n f2 < 0 && (f2 = PI * 2 + f2);\n if (sweep_flag && f1 > f2) {\n f1 = f1 - PI * 2;\n }\n if (!sweep_flag && f2 > f1) {\n f2 = f2 - PI * 2;\n }\n } else {\n f1 = recursive[0];\n f2 = recursive[1];\n cx = recursive[2];\n cy = recursive[3];\n }\n var df = f2 - f1;\n if (abs(df) > _120) {\n var f2old = f2,\n x2old = x2,\n y2old = y2;\n f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n x2 = cx + rx * math.cos(f2);\n y2 = cy + ry * math.sin(f2);\n res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);\n }\n df = f2 - f1;\n var c1 = math.cos(f1),\n s1 = math.sin(f1),\n c2 = math.cos(f2),\n s2 = math.sin(f2),\n t = math.tan(df / 4),\n hx = 4 / 3 * rx * t,\n hy = 4 / 3 * ry * t,\n m1 = [x1, y1],\n m2 = [x1 + hx * s1, y1 - hy * c1],\n m3 = [x2 + hx * s2, y2 - hy * c2],\n m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n if (recursive) {\n return [m2, m3, m4].concat(res);\n } else {\n res = [m2, m3, m4].concat(res).join().split(\",\");\n var newres = [];\n for (var i = 0, ii = res.length; i < ii; i++) {\n newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n }\n return newres;\n }\n }\n function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n return {\n x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n };\n }\n \n // Returns bounding box of cubic bezier curve.\n // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n // Original version: NISHIO Hirokazu\n // Modifications: https://github.com/timo22345\n function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [[], []],\n a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (var i = 0; i < 2; ++i) {\n if (i == 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (abs(a) < 1e-12) {\n if (abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var x, y, j = tvalues.length,\n jlen = j,\n mt;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n\n return {\n min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},\n max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}\n };\n }\n\n function path2curve(path, path2) {\n var pth = !path2 && paths(path);\n if (!path2 && pth.curve) {\n return pathClone(pth.curve);\n }\n var p = pathToAbsolute(path),\n p2 = path2 && pathToAbsolute(path2),\n attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n processPath = function (path, d, pcom) {\n var nx, ny;\n if (!path) {\n return [\"C\", d.x, d.y, d.x, d.y, d.x, d.y];\n }\n !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);\n switch (path[0]) {\n case \"M\":\n d.X = path[1];\n d.Y = path[2];\n break;\n case \"A\":\n path = [\"C\"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));\n break;\n case \"S\":\n if (pcom == \"C\" || pcom == \"S\") { // In \"S\" case we have to take into account, if the previous command is C/S.\n nx = d.x * 2 - d.bx; // And reflect the previous\n ny = d.y * 2 - d.by; // command's control point relative to the current point.\n }\n else { // or some else or nothing\n nx = d.x;\n ny = d.y;\n }\n path = [\"C\", nx, ny].concat(path.slice(1));\n break;\n case \"T\":\n if (pcom == \"Q\" || pcom == \"T\") { // In \"T\" case we have to take into account, if the previous command is Q/T.\n d.qx = d.x * 2 - d.qx; // And make a reflection similar\n d.qy = d.y * 2 - d.qy; // to case \"S\".\n }\n else { // or something else or nothing\n d.qx = d.x;\n d.qy = d.y;\n }\n path = [\"C\"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));\n break;\n case \"Q\":\n d.qx = path[1];\n d.qy = path[2];\n path = [\"C\"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));\n break;\n case \"L\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], path[2]));\n break;\n case \"H\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], d.y));\n break;\n case \"V\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.x, path[1]));\n break;\n case \"Z\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.X, d.Y));\n break;\n }\n return path;\n },\n fixArc = function (pp, i) {\n if (pp[i].length > 7) {\n pp[i].shift();\n var pi = pp[i];\n while (pi.length) {\n pcoms1[i] = \"A\"; // if created multiple C:s, their original seg is saved\n p2 && (pcoms2[i] = \"A\"); // the same as above\n pp.splice(i++, 0, [\"C\"].concat(pi.splice(0, 6)));\n }\n pp.splice(i, 1);\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n fixM = function (path1, path2, a1, a2, i) {\n if (path1 && path2 && path1[i][0] == \"M\" && path2[i][0] != \"M\") {\n path2.splice(i, 0, [\"M\", a2.x, a2.y]);\n a1.bx = 0;\n a1.by = 0;\n a1.x = path1[i][1];\n a1.y = path1[i][2];\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n pcoms1 = [], // path commands of original path p\n pcoms2 = [], // path commands of original path p2\n pfirst = \"\", // temporary holder for original path command\n pcom = \"\"; // holder for previous path command of original path\n for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {\n p[i] && (pfirst = p[i][0]); // save current path command\n\n if (pfirst != \"C\") // C is not saved yet, because it may be result of conversion\n {\n pcoms1[i] = pfirst; // Save current path command\n i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom\n }\n p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath\n\n if (pcoms1[i] != \"A\" && pfirst == \"C\") pcoms1[i] = \"C\"; // A is the only command\n // which may produce multiple C:s\n // so we have to make sure that C is also C in original path\n\n fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1\n\n if (p2) { // the same procedures is done to p2\n p2[i] && (pfirst = p2[i][0]);\n if (pfirst != \"C\") {\n pcoms2[i] = pfirst;\n i && (pcom = pcoms2[i - 1]);\n }\n p2[i] = processPath(p2[i], attrs2, pcom);\n\n if (pcoms2[i] != \"A\" && pfirst == \"C\") {\n pcoms2[i] = \"C\";\n }\n\n fixArc(p2, i);\n }\n fixM(p, p2, attrs, attrs2, i);\n fixM(p2, p, attrs2, attrs, i);\n var seg = p[i],\n seg2 = p2 && p2[i],\n seglen = seg.length,\n seg2len = p2 && seg2.length;\n attrs.x = seg[seglen - 2];\n attrs.y = seg[seglen - 1];\n attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);\n attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);\n attrs2.x = p2 && seg2[seg2len - 2];\n attrs2.y = p2 && seg2[seg2len - 1];\n }\n if (!p2) {\n pth.curve = pathClone(p);\n }\n return p2 ? [p, p2] : p;\n }\n function mapPath(path, matrix) {\n if (!matrix) {\n return path;\n }\n var x, y, i, j, ii, jj, pathi;\n path = path2curve(path);\n for (i = 0, ii = path.length; i < ii; i++) {\n pathi = path[i];\n for (j = 1, jj = pathi.length; j < jj; j += 2) {\n x = matrix.x(pathi[j], pathi[j + 1]);\n y = matrix.y(pathi[j], pathi[j + 1]);\n pathi[j] = x;\n pathi[j + 1] = y;\n }\n }\n return path;\n }\n\n // http://schepers.cc/getting-to-the-point\n function catmullRom2bezier(crp, z) {\n var d = [];\n for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {\n var p = [\n {x: +crp[i - 2], y: +crp[i - 1]},\n {x: +crp[i], y: +crp[i + 1]},\n {x: +crp[i + 2], y: +crp[i + 3]},\n {x: +crp[i + 4], y: +crp[i + 5]}\n ];\n if (z) {\n if (!i) {\n p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};\n } else if (iLen - 4 == i) {\n p[3] = {x: +crp[0], y: +crp[1]};\n } else if (iLen - 2 == i) {\n p[2] = {x: +crp[0], y: +crp[1]};\n p[3] = {x: +crp[2], y: +crp[3]};\n }\n } else {\n if (iLen - 4 == i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {x: +crp[i], y: +crp[i + 1]};\n }\n }\n d.push([\"C\",\n (-p[0].x + 6 * p[1].x + p[2].x) / 6,\n (-p[0].y + 6 * p[1].y + p[2].y) / 6,\n (p[1].x + 6 * p[2].x - p[3].x) / 6,\n (p[1].y + 6*p[2].y - p[3].y) / 6,\n p[2].x,\n p[2].y\n ]);\n }\n\n return d;\n }\n\n // export\n Snap.path = paths;\n\n /*/\n * Snap.path.getTotalLength\n [ method ]\n **\n * Returns the length of the given path in pixels\n **\n - path (string) SVG path string\n **\n = (number) length\n /*/\n Snap.path.getTotalLength = getTotalLength;\n /*/\n * Snap.path.getPointAtLength\n [ method ]\n **\n * Returns the coordinates of the point located at the given length along the given path\n **\n - path (string) SVG path string\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n Snap.path.getPointAtLength = getPointAtLength;\n /*/\n * Snap.path.getSubpath\n [ method ]\n **\n * Returns the subpath of a given path between given start and end lengths\n **\n - path (string) SVG path string\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n Snap.path.getSubpath = function (path, from, to) {\n if (this.getTotalLength(path) - to < 1e-6) {\n return getSubpathsAtLength(path, from).end;\n }\n var a = getSubpathsAtLength(path, to, 1);\n return from ? getSubpathsAtLength(a, from).end : a;\n };\n /*/\n * Element.getTotalLength\n [ method ]\n **\n * Returns the length of the path in pixels (only works for `path` elements)\n = (number) length\n /*/\n elproto.getTotalLength = function () {\n if (this.node.getTotalLength) {\n return this.node.getTotalLength();\n }\n };\n // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?\n /*/\n * Element.getPointAtLength\n [ method ]\n **\n * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)\n **\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n elproto.getPointAtLength = function (length) {\n return getPointAtLength(this.attr(\"d\"), length);\n };\n // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.\n /*/\n * Element.getSubpath\n [ method ]\n **\n * Returns subpath of a given element from given start and end lengths (only works for `path` elements)\n **\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n elproto.getSubpath = function (from, to) {\n return Snap.path.getSubpath(this.attr(\"d\"), from, to);\n };\n Snap._.box = box;\n /*/\n * Snap.path.findDotsAtSegment\n [ method ]\n **\n * Utility method\n **\n * Finds dot coordinates on the given cubic beziér curve at the given t\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n - t (number) position on the curve (0..1)\n = (object) point information in format:\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o m: {\n o x: (number) x coordinate of the left anchor,\n o y: (number) y coordinate of the left anchor\n o },\n o n: {\n o x: (number) x coordinate of the right anchor,\n o y: (number) y coordinate of the right anchor\n o },\n o start: {\n o x: (number) x coordinate of the start of the curve,\n o y: (number) y coordinate of the start of the curve\n o },\n o end: {\n o x: (number) x coordinate of the end of the curve,\n o y: (number) y coordinate of the end of the curve\n o },\n o alpha: (number) angle of the curve derivative at the point\n o }\n /*/\n Snap.path.findDotsAtSegment = findDotsAtSegment;\n /*/\n * Snap.path.bezierBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given cubic beziér curve\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n * or\n - bez (array) array of six points for beziér curve\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.bezierBBox = bezierBBox;\n /*/\n * Snap.path.isPointInsideBBox\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside bounding box\n - bbox (string) bounding box\n - x (string) x coordinate of the point\n - y (string) y coordinate of the point\n = (boolean) `true` if point is inside\n /*/\n Snap.path.isPointInsideBBox = isPointInsideBBox;\n /*/\n * Snap.path.isBBoxIntersect\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if two bounding boxes intersect\n - bbox1 (string) first bounding box\n - bbox2 (string) second bounding box\n = (boolean) `true` if bounding boxes intersect\n /*/\n Snap.path.isBBoxIntersect = isBBoxIntersect;\n /*/\n * Snap.path.intersection\n [ method ]\n **\n * Utility method\n **\n * Finds intersections of two paths\n - path1 (string) path string\n - path2 (string) path string\n = (array) dots of intersection\n o [\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o t1: (number) t value for segment of path1,\n o t2: (number) t value for segment of path2,\n o segment1: (number) order number for segment of path1,\n o segment2: (number) order number for segment of path2,\n o bez1: (array) eight coordinates representing beziér curve for the segment of path1,\n o bez2: (array) eight coordinates representing beziér curve for the segment of path2\n o }\n o ]\n /*/\n Snap.path.intersection = pathIntersection;\n Snap.path.intersectionNumber = pathIntersectionNumber;\n /*/\n * Snap.path.isPointInside\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside a given closed path.\n *\n * Note: fill mode doesn’t affect the result of this method.\n - path (string) path string\n - x (number) x of the point\n - y (number) y of the point\n = (boolean) `true` if point is inside the path\n /*/\n Snap.path.isPointInside = isPointInsidePath;\n /*/\n * Snap.path.getBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given path\n - path (string) path string\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.getBBox = pathBBox;\n Snap.path.get = getPath;\n /*/\n * Snap.path.toRelative\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into relative values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toRelative = pathToRelative;\n /*/\n * Snap.path.toAbsolute\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into absolute values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toAbsolute = pathToAbsolute;\n /*/\n * Snap.path.toCubic\n [ method ]\n **\n * Utility method\n **\n * Converts path to a new path where all segments are cubic beziér curves\n - pathString (string|array) path string or array of segments\n = (array) array of segments\n /*/\n Snap.path.toCubic = path2curve;\n /*/\n * Snap.path.map\n [ method ]\n **\n * Transform the path string with the given matrix\n - path (string) path string\n - matrix (object) see @Matrix\n = (string) transformed path string\n /*/\n Snap.path.map = mapPath;\n Snap.path.toString = toString;\n Snap.path.clone = pathClone;\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n has = \"hasOwnProperty\",\n supportsTouch = \"createTouch\" in glob.doc,\n events = [\n \"click\", \"dblclick\", \"mousedown\", \"mousemove\", \"mouseout\",\n \"mouseover\", \"mouseup\", \"touchstart\", \"touchmove\", \"touchend\",\n \"touchcancel\"\n ],\n touchMap = {\n mousedown: \"touchstart\",\n mousemove: \"touchmove\",\n mouseup: \"touchend\"\n },\n getScroll = function (xy, el) {\n var name = xy == \"y\" ? \"scrollTop\" : \"scrollLeft\",\n doc = el && el.node ? el.node.ownerDocument : glob.doc;\n return doc[name in doc.documentElement ? \"documentElement\" : \"body\"][name];\n },\n preventDefault = function () {\n this.returnValue = false;\n },\n preventTouch = function () {\n return this.originalEvent.preventDefault();\n },\n stopPropagation = function () {\n this.cancelBubble = true;\n },\n stopTouch = function () {\n return this.originalEvent.stopPropagation();\n },\n addEvent = (function () {\n if (glob.doc.addEventListener) {\n return function (obj, type, fn, element) {\n var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,\n f = function (e) {\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element);\n if (supportsTouch && touchMap[has](type)) {\n for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {\n if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {\n var olde = e;\n e = e.targetTouches[i];\n e.originalEvent = olde;\n e.preventDefault = preventTouch;\n e.stopPropagation = stopTouch;\n break;\n }\n }\n }\n var x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n return fn.call(element, e, x, y);\n };\n\n if (type !== realName) {\n obj.addEventListener(type, f, false);\n }\n\n obj.addEventListener(realName, f, false);\n\n return function () {\n if (type !== realName) {\n obj.removeEventListener(type, f, false);\n }\n\n obj.removeEventListener(realName, f, false);\n return true;\n };\n };\n } else if (glob.doc.attachEvent) {\n return function (obj, type, fn, element) {\n var f = function (e) {\n e = e || element.node.ownerDocument.window.event;\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element),\n x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n e.preventDefault = e.preventDefault || preventDefault;\n e.stopPropagation = e.stopPropagation || stopPropagation;\n return fn.call(element, e, x, y);\n };\n obj.attachEvent(\"on\" + type, f);\n var detacher = function () {\n obj.detachEvent(\"on\" + type, f);\n return true;\n };\n return detacher;\n };\n }\n })(),\n drag = [],\n dragMove = function (e) {\n var x = e.clientX,\n y = e.clientY,\n scrollY = getScroll(\"y\"),\n scrollX = getScroll(\"x\"),\n dragi,\n j = drag.length;\n while (j--) {\n dragi = drag[j];\n if (supportsTouch) {\n var i = e.touches && e.touches.length,\n touch;\n while (i--) {\n touch = e.touches[i];\n if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {\n x = touch.clientX;\n y = touch.clientY;\n (e.originalEvent ? e.originalEvent : e).preventDefault();\n break;\n }\n }\n } else {\n e.preventDefault();\n }\n var node = dragi.el.node,\n o,\n next = node.nextSibling,\n parent = node.parentNode,\n display = node.style.display;\n // glob.win.opera && parent.removeChild(node);\n // node.style.display = \"none\";\n // o = dragi.el.paper.getElementByPoint(x, y);\n // node.style.display = display;\n // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));\n // o && eve(\"snap.drag.over.\" + dragi.el.id, dragi.el, o);\n x += scrollX;\n y += scrollY;\n eve(\"snap.drag.move.\" + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);\n }\n },\n dragUp = function (e) {\n Snap.unmousemove(dragMove).unmouseup(dragUp);\n var i = drag.length,\n dragi;\n while (i--) {\n dragi = drag[i];\n dragi.el._drag = {};\n eve(\"snap.drag.end.\" + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);\n }\n drag = [];\n };\n /*/\n * Element.click\n [ method ]\n **\n * Adds a click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unclick\n [ method ]\n **\n * Removes a click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.dblclick\n [ method ]\n **\n * Adds a double click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.undblclick\n [ method ]\n **\n * Removes a double click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousedown\n [ method ]\n **\n * Adds a mousedown event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousedown\n [ method ]\n **\n * Removes a mousedown event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousemove\n [ method ]\n **\n * Adds a mousemove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousemove\n [ method ]\n **\n * Removes a mousemove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseout\n [ method ]\n **\n * Adds a mouseout event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseout\n [ method ]\n **\n * Removes a mouseout event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseover\n [ method ]\n **\n * Adds a mouseover event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseover\n [ method ]\n **\n * Removes a mouseover event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseup\n [ method ]\n **\n * Adds a mouseup event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseup\n [ method ]\n **\n * Removes a mouseup event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchstart\n [ method ]\n **\n * Adds a touchstart event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchstart\n [ method ]\n **\n * Removes a touchstart event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchmove\n [ method ]\n **\n * Adds a touchmove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchmove\n [ method ]\n **\n * Removes a touchmove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchend\n [ method ]\n **\n * Adds a touchend event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchend\n [ method ]\n **\n * Removes a touchend event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchcancel\n [ method ]\n **\n * Adds a touchcancel event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchcancel\n [ method ]\n **\n * Removes a touchcancel event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n for (var i = events.length; i--;) {\n (function (eventName) {\n Snap[eventName] = elproto[eventName] = function (fn, scope) {\n if (Snap.is(fn, \"function\")) {\n this.events = this.events || [];\n this.events.push({\n name: eventName,\n f: fn,\n unbind: addEvent(this.node || document, eventName, fn, scope || this)\n });\n }\n return this;\n };\n Snap[\"un\" + eventName] =\n elproto[\"un\" + eventName] = function (fn) {\n var events = this.events || [],\n l = events.length;\n while (l--) if (events[l].name == eventName &&\n (events[l].f == fn || !fn)) {\n events[l].unbind();\n events.splice(l, 1);\n !events.length && delete this.events;\n return this;\n }\n return this;\n };\n })(events[i]);\n }\n /*/\n * Element.hover\n [ method ]\n **\n * Adds hover event handlers to the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n - icontext (object) #optional context for hover in handler\n - ocontext (object) #optional context for hover out handler\n = (object) @Element\n /*/\n elproto.hover = function (f_in, f_out, scope_in, scope_out) {\n return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);\n };\n /*/\n * Element.unhover\n [ method ]\n **\n * Removes hover event handlers from the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n = (object) @Element\n /*/\n elproto.unhover = function (f_in, f_out) {\n return this.unmouseover(f_in).unmouseout(f_out);\n };\n var draggable = [];\n // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.\n // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?\n // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.\n // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?\n /*/\n * Element.drag\n [ method ]\n **\n * Adds event handlers for an element's drag gesture\n **\n - onmove (function) handler for moving\n - onstart (function) handler for drag start\n - onend (function) handler for drag end\n - mcontext (object) #optional context for moving handler\n - scontext (object) #optional context for drag start handler\n - econtext (object) #optional context for drag end handler\n * Additionaly following `drag` events are triggered: `drag.start.<id>` on start, \n * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element \n * `drag.over.<id>` fires as well.\n *\n * Start event and start handler are called in specified context or in context of the element with following parameters:\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * Move event and move handler are called in specified context or in context of the element with following parameters:\n o dx (number) shift by x from the start point\n o dy (number) shift by y from the start point\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * End event and end handler are called in specified context or in context of the element with following parameters:\n o event (object) DOM event object\n = (object) @Element\n /*/\n elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {\n if (!arguments.length) {\n var origTransform;\n return this.drag(function (dx, dy) {\n this.attr({\n transform: origTransform + (origTransform ? \"T\" : \"t\") + [dx, dy]\n });\n }, function () {\n origTransform = this.transform().local;\n });\n }\n function start(e, x, y) {\n (e.originalEvent || e).preventDefault();\n this._drag.x = x;\n this._drag.y = y;\n this._drag.id = e.identifier;\n !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);\n drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});\n onstart && eve.on(\"snap.drag.start.\" + this.id, onstart);\n onmove && eve.on(\"snap.drag.move.\" + this.id, onmove);\n onend && eve.on(\"snap.drag.end.\" + this.id, onend);\n eve(\"snap.drag.start.\" + this.id, start_scope || move_scope || this, x, y, e);\n }\n this._drag = {};\n draggable.push({el: this, start: start});\n this.mousedown(start);\n return this;\n };\n /*\n * Element.onDragOver\n [ method ]\n **\n * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)\n - f (function) handler for event, first argument would be the element you are dragging over\n /*/\n // elproto.onDragOver = function (f) {\n // f ? eve.on(\"snap.drag.over.\" + this.id, f) : eve.unbind(\"snap.drag.over.\" + this.id);\n // };\n /*/\n * Element.undrag\n [ method ]\n **\n * Removes all drag event handlers from the given element\n /*/\n elproto.undrag = function () {\n var i = draggable.length;\n while (i--) if (draggable[i].el == this) {\n this.unmousedown(draggable[i].start);\n draggable.splice(i, 1);\n eve.unbind(\"snap.drag.*.\" + this.id);\n }\n !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);\n return this;\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n pproto = Paper.prototype,\n rgurl = /^/s*url/((.+)/)/,\n Str = String,\n $ = Snap._.$;\n Snap.filter = {};\n /*/\n * Paper.filter\n [ method ]\n **\n * Creates a `<filter>` element\n **\n - filstr (string) SVG fragment of filter provided as a string\n = (object) @Element\n * Note: It is recommended to use filters embedded into the page inside an empty SVG element.\n > Usage\n | var f = paper.filter('<feGaussianBlur stdDeviation=\"2\"/>'),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n pproto.filter = function (filstr) {\n var paper = this;\n if (paper.type != \"svg\") {\n paper = paper.paper;\n }\n var f = Snap.parse(Str(filstr)),\n id = Snap._.id(),\n width = paper.node.offsetWidth,\n height = paper.node.offsetHeight,\n filter = $(\"filter\");\n $(filter, {\n id: id,\n filterUnits: \"userSpaceOnUse\"\n });\n filter.appendChild(f.node);\n paper.defs.appendChild(filter);\n return new Element(filter);\n };\n \n eve.on(\"snap.util.getattr.filter\", function () {\n eve.stop();\n var p = $(this.node, \"filter\");\n if (p) {\n var match = Str(p).match(rgurl);\n return match && Snap.select(match[1]);\n }\n });\n eve.on(\"snap.util.attr.filter\", function (value) {\n if (value instanceof Element && value.type == \"filter\") {\n eve.stop();\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n id = value.id;\n }\n $(this.node, {\n filter: Snap.url(id)\n });\n }\n if (!value || value == \"none\") {\n eve.stop();\n this.node.removeAttribute(\"filter\");\n }\n });\n /*/\n * Snap.filter.blur\n [ method ]\n **\n * Returns an SVG markup string for the blur filter\n **\n - x (number) amount of horizontal blur, in pixels\n - y (number) #optional amount of vertical blur, in pixels\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.blur(5, 10)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.blur = function (x, y) {\n if (x == null) {\n x = 2;\n }\n var def = y == null ? x : [x, y];\n return Snap.format('/<feGaussianBlur stdDeviation=\"{def}\"/>', {\n def: def\n });\n };\n Snap.filter.blur.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.shadow\n [ method ]\n **\n * Returns an SVG markup string for the shadow filter\n **\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - blur (number) #optional amount of blur\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * which makes blur default to `4`. Or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - opacity (number) #optional `0..1` opacity of the shadow\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.shadow = function (dx, dy, blur, color, opacity) {\n if (typeof blur == \"string\") {\n color = blur;\n opacity = color;\n blur = 4;\n }\n if (typeof color != \"string\") {\n opacity = color;\n color = \"#000\";\n }\n color = color || \"#000\";\n if (blur == null) {\n blur = 4;\n }\n if (opacity == null) {\n opacity = 1;\n }\n if (dx == null) {\n dx = 0;\n dy = 2;\n }\n if (dy == null) {\n dy = dx;\n }\n color = Snap.color(color);\n return Snap.format('<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"{blur}\"/><feOffset dx=\"{dx}\" dy=\"{dy}\" result=\"offsetblur\"/><feFlood flood-color=\"{color}\"/><feComposite in2=\"offsetblur\" operator=\"in\"/><feComponentTransfer><feFuncA type=\"linear\" slope=\"{opacity}\"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge>', {\n color: color,\n dx: dx,\n dy: dy,\n blur: blur,\n opacity: opacity\n });\n };\n Snap.filter.shadow.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.grayscale\n [ method ]\n **\n * Returns an SVG markup string for the grayscale filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.grayscale = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0\"/>', {\n a: 0.2126 + 0.7874 * (1 - amount),\n b: 0.7152 - 0.7152 * (1 - amount),\n c: 0.0722 - 0.0722 * (1 - amount),\n d: 0.2126 - 0.2126 * (1 - amount),\n e: 0.7152 + 0.2848 * (1 - amount),\n f: 0.0722 - 0.0722 * (1 - amount),\n g: 0.2126 - 0.2126 * (1 - amount),\n h: 0.0722 + 0.9278 * (1 - amount)\n });\n };\n Snap.filter.grayscale.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.sepia\n [ method ]\n **\n * Returns an SVG markup string for the sepia filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.sepia = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0\"/>', {\n a: 0.393 + 0.607 * (1 - amount),\n b: 0.769 - 0.769 * (1 - amount),\n c: 0.189 - 0.189 * (1 - amount),\n d: 0.349 - 0.349 * (1 - amount),\n e: 0.686 + 0.314 * (1 - amount),\n f: 0.168 - 0.168 * (1 - amount),\n g: 0.272 - 0.272 * (1 - amount),\n h: 0.534 - 0.534 * (1 - amount),\n i: 0.131 + 0.869 * (1 - amount)\n });\n };\n Snap.filter.sepia.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.saturate\n [ method ]\n **\n * Returns an SVG markup string for the saturate filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.saturate = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"saturate\" values=\"{amount}\"/>', {\n amount: 1 - amount\n });\n };\n Snap.filter.saturate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.hueRotate\n [ method ]\n **\n * Returns an SVG markup string for the hue-rotate filter\n **\n - angle (number) angle of rotation\n = (string) filter representation\n /*/\n Snap.filter.hueRotate = function (angle) {\n angle = angle || 0;\n return Snap.format('<feColorMatrix type=\"hueRotate\" values=\"{angle}\"/>', {\n angle: angle\n });\n };\n Snap.filter.hueRotate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.invert\n [ method ]\n **\n * Returns an SVG markup string for the invert filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.invert = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncG type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncB type=\"table\" tableValues=\"{amount} {amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: 1 - amount\n });\n };\n Snap.filter.invert.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.brightness\n [ method ]\n **\n * Returns an SVG markup string for the brightness filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.brightness = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\"/><feFuncG type=\"linear\" slope=\"{amount}\"/><feFuncB type=\"linear\" slope=\"{amount}\"/></feComponentTransfer>', {\n amount: amount\n });\n };\n Snap.filter.brightness.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.contrast\n [ method ]\n **\n * Returns an SVG markup string for the contrast filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.contrast = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncG type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncB type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: .5 - amount / 2\n });\n };\n Snap.filter.contrast.toString = function () {\n return this();\n };\n});\n\nreturn Snap;\n}));","'use strict';\n\nvar snapsvg = module.exports = require(73);\n\nsnapsvg.plugin(function(Snap, Element) {\n\n /*/\n * Element.children\n [ method ]\n **\n * Returns array of all the children of the element.\n = (array) array of Elements\n /*/\n Element.prototype.children = function () {\n var out = [],\n ch = this.node.childNodes;\n for (var i = 0, ii = ch.length; i < ii; i++) {\n out[i] = new Snap(ch[i]);\n }\n return out;\n };\n});\n\n\n/**\n * @class ClassPlugin\n *\n * Extends snapsvg with methods to add and remove classes\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n function split(str) {\n return str.split(//s+/);\n }\n\n function join(array) {\n return array.join(' ');\n }\n\n function getClasses(e) {\n return split(e.attr('class') || '');\n }\n\n function setClasses(e, classes) {\n e.attr('class', join(classes));\n }\n\n /**\n * @method snapsvg.Element#addClass\n *\n * @example\n *\n * e.attr('class', 'selector');\n *\n * e.addClass('foo bar'); // adds classes foo and bar\n * e.attr('class'); // -> 'selector foo bar'\n *\n * e.addClass('fooBar');\n * e.attr('class'); // -> 'selector foo bar fooBar'\n *\n * @param {String} cls classes to be added to the element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.addClass = function(cls) {\n var current = getClasses(this),\n add = split(cls),\n i, e;\n\n for (i = 0, e; !!(e = add[i]); i++) {\n if (current.indexOf(e) === -1) {\n current.push(e);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n /**\n * @method snapsvg.Element#hasClass\n *\n * @param {String} cls the class to query for\n * @return {Boolean} returns true if the element has the given class\n */\n Element.prototype.hasClass = function(cls) {\n if (!cls) {\n throw new Error('[snapsvg] syntax: hasClass(clsStr)');\n }\n\n return getClasses(this).indexOf(cls) !== -1;\n };\n\n /**\n * @method snapsvg.Element#removeClass\n *\n * @example\n *\n * e.attr('class', 'foo bar');\n *\n * e.removeClass('foo');\n * e.attr('class'); // -> 'bar'\n *\n * e.removeClass('foo bar'); // removes classes foo and bar\n * e.attr('class'); // -> ''\n *\n * @param {String} cls classes to be removed from element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.removeClass = function(cls) {\n var current = getClasses(this),\n remove = split(cls),\n i, e, idx;\n\n for (i = 0, e; !!(e = remove[i]); i++) {\n idx = current.indexOf(e);\n\n if (idx !== -1) {\n // remove element from array\n current.splice(idx, 1);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n});\n\n/**\n * @class TranslatePlugin\n *\n * Extends snapsvg with methods to translate elements\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.Element#translate\n *\n * @example\n *\n * e.translate(10, 20);\n *\n * // sets transform matrix to translate(10, 20)\n *\n * @param {Number} x translation\n * @param {Number} y translation\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.translate = function(x, y) {\n var matrix = new Snap.Matrix();\n matrix.translate(x, y);\n return this.transform(matrix);\n };\n});\n\n\n/**\n * @class CreatePlugin\n *\n * Create an svg element without attaching it to the dom\n */\nsnapsvg.plugin(function(Snap) {\n\n Snap.create = function(name, attrs) {\n return Snap._.wrap(Snap._.$(name, attrs));\n };\n});\n\n\n/**\n * @class CreatSnapAtPlugin\n *\n * Extends snap.svg with a method to create a SVG element\n * at a specific position in the DOM.\n */\nsnapsvg.plugin(function(Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.createSnapAt\n *\n * @example\n *\n * snapsvg.createSnapAt(parentNode, 200, 200);\n *\n * @param {Number} width of svg\n * @param {Number} height of svg\n * @param {Object} parentNode svg Element will be child of this\n *\n * @return {snapsvg.Element} the newly created wrapped SVG element instance\n */\n Snap.createSnapAt = function(width, height, parentNode) {\n\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('width', width);\n svg.setAttribute('height', height);\n if (!parentNode) {\n parentNode = document.body;\n }\n parentNode.appendChild(svg);\n\n return new Snap(svg);\n };\n});","\r\nvar isArray = function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]';\r\n};\r\n\r\nvar annotate = function() {\r\n var args = Array.prototype.slice.call(arguments);\r\n \r\n if (args.length === 1 && isArray(args[0])) {\r\n args = args[0];\r\n }\r\n\r\n var fn = args.pop();\r\n\r\n fn.$inject = args;\r\n\r\n return fn;\r\n};\r\n\r\n\r\n// Current limitations:\r\n// - can't put into \"function arg\" comments\r\n// function /* (no parenthesis like this) */ (){}\r\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\r\n//\r\n// Just put the comment before function or inside:\r\n// /* (((this is fine))) */ function(a, b) {}\r\n// function abc(a) { /* (((this is fine))) */}\r\n\r\nvar FN_ARGS = /^function/s*[^/(]*/(/s*([^/)]*)/)/m;\r\nvar FN_ARG = ////*([^/*]*)/*///m;\r\n\r\nvar parse = function(fn) {\r\n if (typeof fn !== 'function') {\r\n throw new Error('Cannot annotate \"' + fn + '\". Expected a function!');\r\n }\r\n\r\n var match = fn.toString().match(FN_ARGS);\r\n return match[1] && match[1].split(',').map(function(arg) {\r\n match = arg.match(FN_ARG);\r\n return match ? match[1].trim() : arg.trim();\r\n }) || [];\r\n};\r\n\r\n\r\nexports.annotate = annotate;\r\nexports.parse = parse;\r\nexports.isArray = isArray;\r\n","module.exports = {\r\n annotate: require(75).annotate,\r\n Module: require(78),\r\n Injector: require(77)\r\n};\r\n","var Module = require(78);\r\nvar autoAnnotate = require(75).parse;\r\nvar annotate = require(75).annotate;\r\nvar isArray = require(75).isArray;\r\n\r\n\r\nvar Injector = function(modules, parent) {\r\n parent = parent || {\r\n get: function(name) {\r\n currentlyResolving.push(name);\r\n throw error('No provider for \"' + name + '\"!');\r\n }\r\n };\r\n\r\n var currentlyResolving = [];\r\n var providers = this._providers = Object.create(parent._providers || null);\r\n var instances = this._instances = Object.create(null);\r\n\r\n var self = instances.injector = this;\r\n\r\n var error = function(msg) {\r\n var stack = currentlyResolving.join(' -> ');\r\n currentlyResolving.length = 0;\r\n return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);\r\n };\r\n\r\n var get = function(name) {\r\n if (!providers[name] && name.indexOf('.') !== -1) {\r\n var parts = name.split('.');\r\n var pivot = get(parts.shift());\r\n\r\n while(parts.length) {\r\n pivot = pivot[parts.shift()];\r\n }\r\n\r\n return pivot;\r\n }\r\n\r\n if (Object.hasOwnProperty.call(instances, name)) {\r\n return instances[name];\r\n }\r\n\r\n if (Object.hasOwnProperty.call(providers, name)) {\r\n if (currentlyResolving.indexOf(name) !== -1) {\r\n currentlyResolving.push(name);\r\n throw error('Cannot resolve circular dependency!');\r\n }\r\n\r\n currentlyResolving.push(name);\r\n instances[name] = providers[name][0](providers[name][1]);\r\n currentlyResolving.pop();\r\n\r\n return instances[name];\r\n }\r\n\r\n return parent.get(name);\r\n };\r\n\r\n var instantiate = function(Type) {\r\n var instance = Object.create(Type.prototype);\r\n var returned = invoke(Type, instance);\r\n\r\n return typeof returned === 'object' ? returned : instance;\r\n };\r\n\r\n var invoke = function(fn, context) {\r\n if (typeof fn !== 'function') {\r\n if (isArray(fn)) {\r\n fn = annotate(fn.slice());\r\n } else {\r\n throw new Error('Cannot invoke \"' + fn + '\". Expected a function!');\r\n }\r\n }\r\n\r\n var inject = fn.$inject && fn.$inject || autoAnnotate(fn);\r\n var dependencies = inject.map(function(dep) {\r\n return get(dep);\r\n });\r\n\r\n // TODO(vojta): optimize without apply\r\n return fn.apply(context, dependencies);\r\n };\r\n\r\n\r\n var createPrivateInjectorFactory = function(privateChildInjector) {\r\n return annotate(function(key) {\r\n return privateChildInjector.get(key);\r\n });\r\n };\r\n\r\n var createChild = function(modules, forceNewInstances) {\r\n if (forceNewInstances && forceNewInstances.length) {\r\n var fromParentModule = Object.create(null);\r\n var matchedScopes = Object.create(null);\r\n\r\n var privateInjectorsCache = [];\r\n var privateChildInjectors = [];\r\n var privateChildFactories = [];\r\n\r\n var provider;\r\n var cacheIdx;\r\n var privateChildInjector;\r\n var privateChildInjectorFactory;\r\n for (var name in providers) {\r\n provider = providers[name];\r\n\r\n if (forceNewInstances.indexOf(name) !== -1) {\r\n if (provider[2] === 'private') {\r\n cacheIdx = privateInjectorsCache.indexOf(provider[3]);\r\n if (cacheIdx === -1) {\r\n privateChildInjector = provider[3].createChild([], forceNewInstances);\r\n privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\r\n privateInjectorsCache.push(provider[3]);\r\n privateChildInjectors.push(privateChildInjector);\r\n privateChildFactories.push(privateChildInjectorFactory);\r\n fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];\r\n } else {\r\n fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];\r\n }\r\n } else {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n }\r\n matchedScopes[name] = true;\r\n }\r\n\r\n if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\r\n forceNewInstances.forEach(function(scope) {\r\n if (provider[1].$scope.indexOf(scope) !== -1) {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n matchedScopes[scope] = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n forceNewInstances.forEach(function(scope) {\r\n if (!matchedScopes[scope]) {\r\n throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\r\n }\r\n });\r\n\r\n modules.unshift(fromParentModule);\r\n }\r\n\r\n return new Injector(modules, self);\r\n };\r\n\r\n var factoryMap = {\r\n factory: invoke,\r\n type: instantiate,\r\n value: function(value) {\r\n return value;\r\n }\r\n };\r\n\r\n modules.forEach(function(module) {\r\n\r\n function arrayUnwrap(type, value) {\r\n if (type !== 'value' && isArray(value)) {\r\n value = annotate(value.slice());\r\n }\r\n\r\n return value;\r\n }\r\n\r\n // TODO(vojta): handle wrong inputs (modules)\r\n if (module instanceof Module) {\r\n module.forEach(function(provider) {\r\n var name = provider[0];\r\n var type = provider[1];\r\n var value = provider[2];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n } else if (typeof module === 'object') {\r\n if (module.__exports__) {\r\n var clonedModule = Object.keys(module).reduce(function(m, key) {\r\n if (key.substring(0, 2) !== '__') {\r\n m[key] = module[key];\r\n }\r\n return m;\r\n }, Object.create(null));\r\n\r\n var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);\r\n var getFromPrivateInjector = annotate(function(key) {\r\n return privateInjector.get(key);\r\n });\r\n module.__exports__.forEach(function(key) {\r\n providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];\r\n });\r\n } else {\r\n Object.keys(module).forEach(function(name) {\r\n if (module[name][2] === 'private') {\r\n providers[name] = module[name];\r\n return;\r\n }\r\n\r\n var type = module[name][0];\r\n var value = module[name][1];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n }\r\n }\r\n });\r\n\r\n // public API\r\n this.get = get;\r\n this.invoke = invoke;\r\n this.instantiate = instantiate;\r\n this.createChild = createChild;\r\n};\r\n\r\nmodule.exports = Injector;\r\n","var Module = function() {\r\n var providers = [];\r\n\r\n this.factory = function(name, factory) {\r\n providers.push([name, 'factory', factory]);\r\n return this;\r\n };\r\n\r\n this.value = function(name, value) {\r\n providers.push([name, 'value', value]);\r\n return this;\r\n };\r\n\r\n this.type = function(name, type) {\r\n providers.push([name, 'type', type]);\r\n return this;\r\n };\r\n\r\n this.forEach = function(iterator) {\r\n providers.forEach(iterator);\r\n };\r\n};\r\n\r\nmodule.exports = Module;\r\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","var arrayEvery = require(97),\n baseCallback = require(104),\n baseEvery = require(109),\n isArray = require(166),\n isIterateeCall = require(154);\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * The predicate is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias all\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.every(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = every;\n","var arrayFilter = require(98),\n baseCallback = require(104),\n baseFilter = require(110),\n isArray = require(166);\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias select\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.filter([4, 5, 6], function(n) {\n * return n % 2 == 0;\n * });\n * // => [4, 6]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.filter(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.filter(users, 'active'), 'user');\n * // => ['barney']\n */\nfunction filter(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n predicate = baseCallback(predicate, thisArg, 3);\n return func(collection, predicate);\n}\n\nmodule.exports = filter;\n","var baseEach = require(108),\n createFind = require(143);\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias detect\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.result(_.find(users, function(chr) {\n * return chr.age < 40;\n * }), 'user');\n * // => 'barney'\n *\n * // using the `_.matches` callback shorthand\n * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.result(_.find(users, 'active', false), 'user');\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.result(_.find(users, 'active'), 'user');\n * // => 'barney'\n */\nvar find = createFind(baseEach);\n\nmodule.exports = find;\n","var arrayEach = require(96),\n baseEach = require(108),\n createForEach = require(144);\n\n/**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection). Iteratee functions may exit iteration early\n * by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n * may be used for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(n) {\n * console.log(n);\n * }).value();\n * // => logs each value from left to right and returns the array\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n * console.log(n, key);\n * });\n * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n */\nvar forEach = createForEach(arrayEach, baseEach);\n\nmodule.exports = forEach;\n","var createAggregator = require(138);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is an array of the elements responsible for generating the key.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return Math.floor(n);\n * });\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * // using the `_.property` callback shorthand\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n});\n\nmodule.exports = groupBy;\n","var baseIndexOf = require(118),\n getLength = require(149),\n isArray = require(166),\n isIterateeCall = require(154),\n isLength = require(156),\n isString = require(172),\n values = require(181);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection` using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n * from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @alias contains, include\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {*} target The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n * // => true\n *\n * _.includes('pebbles', 'eb');\n * // => true\n */\nfunction includes(collection, target, fromIndex, guard) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n collection = values(collection);\n length = collection.length;\n }\n if (!length) {\n return false;\n }\n if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n fromIndex = 0;\n } else {\n fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n }\n return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)\n : (baseIndexOf(collection, target, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var arrayMap = require(99),\n baseCallback = require(104),\n baseMap = require(123),\n isArray = require(166);\n\n/**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n * `sum`, `uniq`, and `words`\n *\n * @static\n * @memberOf _\n * @alias collect\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function timesThree(n) {\n * return n * 3;\n * }\n *\n * _.map([1, 2], timesThree);\n * // => [3, 6]\n *\n * _.map({ 'a': 1, 'b': 2 }, timesThree);\n * // => [3, 6] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee, thisArg) {\n var func = isArray(collection) ? arrayMap : baseMap;\n iteratee = baseCallback(iteratee, thisArg, 3);\n return func(collection, iteratee);\n}\n\nmodule.exports = map;\n","var arrayReduce = require(100),\n baseEach = require(108),\n createReduce = require(145);\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` through `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not provided the first element of `collection` is used as the initial\n * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`\n *\n * @static\n * @memberOf _\n * @alias foldl, inject\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.reduce([1, 2], function(total, n) {\n * return total + n;\n * });\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n * result[key] = n * 3;\n * return result;\n * }, {});\n * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n */\nvar reduce = createReduce(arrayReduce, baseEach);\n\nmodule.exports = reduce;\n","var arraySome = require(101),\n baseCallback = require(104),\n baseSome = require(132),\n isArray = require(166),\n isIterateeCall = require(154);\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * The function returns as soon as it finds a passing value and does not iterate\n * over the entire collection. The predicate is bound to `thisArg` and invoked\n * with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias any\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.some(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, thisArg) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = some;\n","var isNative = require(168);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeNow = isNative(nativeNow = Date.now) && nativeNow;\n\n/**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = nativeNow || function() {\n return new Date().getTime();\n};\n\nmodule.exports = now;\n","var isObject = require(170),\n now = require(90);\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that delays invoking `func` until after `wait` milliseconds\n * have elapsed since the last time it was invoked. The created function comes\n * with a `cancel` method to cancel delayed invocations. Provide an options\n * object to indicate that `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it is invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n * 'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n * todoChanges.cancel();\n * }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\nfunction debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = wait < 0 ? 0 : (+wait || 0);\n if (options === true) {\n var leading = true;\n trailing = false;\n } else if (isObject(options)) {\n leading = options.leading;\n maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n trailing = 'trailing' in options ? options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n }\n\n function delayed() {\n var remaining = wait - (now() - stamp);\n if (remaining <= 0 || remaining > wait) {\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n var isCalled = trailingCall;\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n } else {\n timeoutId = setTimeout(delayed, remaining);\n }\n }\n\n function maxDelayed() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (trailing || (maxWait !== wait)) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n }\n\n function debounced() {\n args = arguments;\n stamp = now();\n thisArg = this;\n trailingCall = trailing && (timeoutId || !leading);\n\n if (maxWait === false) {\n var leadingCall = leading && !timeoutId;\n } else {\n if (!maxTimeoutId && !leading) {\n lastCalled = stamp;\n }\n var remaining = maxWait - (stamp - lastCalled),\n isCalled = remaining <= 0 || remaining > maxWait;\n\n if (isCalled) {\n if (maxTimeoutId) {\n maxTimeoutId = clearTimeout(maxTimeoutId);\n }\n lastCalled = stamp;\n result = func.apply(thisArg, args);\n }\n else if (!maxTimeoutId) {\n maxTimeoutId = setTimeout(maxDelayed, remaining);\n }\n }\n if (isCalled && timeoutId) {\n timeoutId = clearTimeout(timeoutId);\n }\n else if (!timeoutId && wait !== maxWait) {\n timeoutId = setTimeout(delayed, wait);\n }\n if (leadingCall) {\n isCalled = true;\n result = func.apply(thisArg, args);\n }\n if (isCalled && !timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n return result;\n }\n debounced.cancel = cancel;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var baseDelay = require(106),\n restParam = require(93);\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it is invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // logs 'deferred' after one or more milliseconds\n */\nvar defer = restParam(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n","var cachePush = require('./cachePush'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var length = values ? values.length : 0;\n\n this.data = { 'hash': nativeCreate(null), 'set': new Set };\n while (length--) {\n this.push(values[length]);\n }\n}\n\n// Add functions to the `Set` cache.\nSetCache.prototype.push = cachePush;\n\nmodule.exports = SetCache;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = arrayCopy;\n","/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n","/**\n * A specialized version of `_.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * A specialized version of `_.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * A specialized version of `_.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the first element of `array`\n * as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * A specialized version of `_.some` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var getSymbols = require(150),\n keys = require(176);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * A specialized version of `_.assign` for customizing assigned values without\n * support for argument juggling, multiple sources, and `this` binding `customizer`\n * functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n */\nfunction assignWith(object, source, customizer) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n value = object[key],\n result = customizer(value, source[key], key, object, source);\n\n if ((result === result ? (result !== value) : (value === value)) ||\n (value === undefined && !(key in object))) {\n object[key] = result;\n }\n }\n return object;\n}\n\nmodule.exports = assignWith;\n","var baseCopy = require(105),\n getSymbols = require(150),\n isNative = require(168),\n keys = require(176);\n\n/** Native method references. */\nvar preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;\n\n/** Used as `baseAssign`. */\nvar nativeAssign = (function() {\n // Avoid `Object.assign` in Firefox 34-37 which have an early implementation\n // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344\n // for more details.\n //\n // Use `Object.preventExtensions` on a plain object instead of simply using\n // `Object('x')` because Chrome and IE fail to throw an error when attempting\n // to assign values to readonly indexes of strings.\n var func = preventExtensions && isNative(func = Object.assign) && func;\n try {\n if (func) {\n var object = preventExtensions({ '1': 0 });\n object[0] = 1;\n }\n } catch(e) {\n // Only attempt in strict mode.\n try { func(object, 'xo'); } catch(e) {}\n return !object[1] && func;\n }\n return false;\n}());\n\n/**\n * The base implementation of `_.assign` without support for argument juggling,\n * multiple sources, and `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nvar baseAssign = nativeAssign || function(object, source) {\n return source == null\n ? object\n : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));\n};\n\nmodule.exports = baseAssign;\n","var baseMatches = require(124),\n baseMatchesProperty = require(125),\n bindCallback = require(135),\n identity = require(185),\n property = require(186);\n\n/**\n * The base implementation of `_.callback` which supports specifying the\n * number of arguments to provide to `func`.\n *\n * @private\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction baseCallback(func, thisArg, argCount) {\n var type = typeof func;\n if (type == 'function') {\n return thisArg === undefined\n ? func\n : bindCallback(func, thisArg, argCount);\n }\n if (func == null) {\n return identity;\n }\n if (type == 'object') {\n return baseMatches(func);\n }\n return thisArg === undefined\n ? property(func)\n : baseMatchesProperty(func, thisArg);\n}\n\nmodule.exports = baseCallback;\n","/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n}\n\nmodule.exports = baseCopy;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts an index\n * of where to slice the arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Object} args The arguments provide to `func`.\n * @returns {number} Returns the timer id.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","var baseIndexOf = require(118),\n cacheIndexOf = require(136),\n createCache = require(142);\n\n/**\n * The base implementation of `_.difference` which accepts a single array\n * of values to exclude.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values) {\n var length = array ? array.length : 0,\n result = [];\n\n if (!length) {\n return result;\n }\n var index = -1,\n indexOf = baseIndexOf,\n isCommon = true,\n cache = (isCommon && values.length >= 200) ? createCache(values) : null,\n valuesLength = values.length;\n\n if (cache) {\n indexOf = cacheIndexOf;\n isCommon = false;\n values = cache;\n }\n outer:\n while (++index < length) {\n var value = array[index];\n\n if (isCommon && value === value) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === value) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (indexOf(values, value, 0) < 0) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var baseForOwn = require(116),\n createBaseEach = require(140);\n\n/**\n * The base implementation of `_.forEach` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require(108);\n\n/**\n * The base implementation of `_.every` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n","var baseEach = require(108);\n\n/**\n * The base implementation of `_.filter` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n * without support for callback shorthands and `this` binding, which iterates\n * over `collection` using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @param {boolean} [retKey] Specify returning the key of the found element\n * instead of the element itself.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFind(collection, predicate, eachFunc, retKey) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = retKey ? key : value;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFind;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var isArguments = require(165),\n isArray = require(166),\n isArrayLike = require(152),\n isObjectLike = require(157);\n\n/**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, isDeep, isStrict) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (isObjectLike(value) && isArrayLike(value) &&\n (isStrict || isArray(value) || isArguments(value))) {\n if (isDeep) {\n // Recursively flatten arrays (susceptible to call stack limits).\n value = baseFlatten(value, isDeep, isStrict);\n }\n var valIndex = -1,\n valLength = value.length;\n\n while (++valIndex < valLength) {\n result[++resIndex] = value[valIndex];\n }\n } else if (!isStrict) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var createBaseFor = require(141);\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require(114),\n keysIn = require(177);\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n","var baseFor = require(114),\n keys = require(176);\n\n/**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var toObject = require(163);\n\n/**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path, pathKey) {\n if (object == null) {\n return;\n }\n if (pathKey !== undefined && pathKey in toObject(object)) {\n path = [pathKey];\n }\n var index = -1,\n length = path.length;\n\n while (object != null && ++index < length) {\n object = object[path[index]];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var indexOfNaN = require(151);\n\n/**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOf;\n","var baseIsEqualDeep = require(120);\n\n/**\n * The base implementation of `_.isEqual` without support for `this` binding\n * `customizer` functions.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n // Exit early for identical values.\n if (value === other) {\n return true;\n }\n var valType = typeof value,\n othType = typeof other;\n\n // Exit early for unlike primitive values.\n if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||\n value == null || other == null) {\n // Return `false` unless both values are `NaN`.\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n}\n\nmodule.exports = baseIsEqual;\n","var equalArrays = require(146),\n equalByTag = require(147),\n equalObjects = require(148),\n isArray = require(166),\n isTypedArray = require(173);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = objToString.call(object);\n if (objTag == argsTag) {\n objTag = objectTag;\n } else if (objTag != objectTag) {\n objIsArr = isTypedArray(object);\n }\n }\n if (!othIsArr) {\n othTag = objToString.call(other);\n if (othTag == argsTag) {\n othTag = objectTag;\n } else if (othTag != objectTag) {\n othIsArr = isTypedArray(other);\n }\n }\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && !(objIsArr || objIsObj)) {\n return equalByTag(object, other, objTag);\n }\n if (!isLoose) {\n var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (valWrapped || othWrapped) {\n return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n }\n }\n if (!isSameTag) {\n return false;\n }\n // Assume cyclic values are equal.\n // For more information on detecting circular references see https://es5.github.io/#JO.\n stackA || (stackA = []);\n stackB || (stackB = []);\n\n var length = stackA.length;\n while (length--) {\n if (stackA[length] == object) {\n return stackB[length] == other;\n }\n }\n // Add `object` and `other` to the stack of traversed objects.\n stackA.push(object);\n stackB.push(other);\n\n var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n stackA.pop();\n stackB.pop();\n\n return result;\n}\n\nmodule.exports = baseIsEqualDeep;\n","/**\n * The base implementation of `_.isFunction` without support for environments\n * with incorrect `typeof` results.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n */\nfunction baseIsFunction(value) {\n // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n return typeof value == 'function' || false;\n}\n\nmodule.exports = baseIsFunction;\n","var baseIsEqual = require(119);\n\n/**\n * The base implementation of `_.isMatch` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The source property names to match.\n * @param {Array} values The source values to match.\n * @param {Array} strictCompareFlags Strict comparison flags for source values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, props, values, strictCompareFlags, customizer) {\n var index = -1,\n length = props.length,\n noCustomizer = !customizer;\n\n while (++index < length) {\n if ((noCustomizer && strictCompareFlags[index])\n ? values[index] !== object[props[index]]\n : !(props[index] in object)\n ) {\n return false;\n }\n }\n index = -1;\n while (++index < length) {\n var key = props[index],\n objValue = object[key],\n srcValue = values[index];\n\n if (noCustomizer && strictCompareFlags[index]) {\n var result = objValue !== undefined || (key in object);\n } else {\n result = customizer ? customizer(objValue, srcValue, key) : undefined;\n if (result === undefined) {\n result = baseIsEqual(srcValue, objValue, customizer, true);\n }\n }\n if (!result) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var baseEach = require(108),\n isArrayLike = require(152);\n\n/**\n * The base implementation of `_.map` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var baseIsMatch = require(122),\n constant = require(184),\n isStrictComparable = require(158),\n keys = require(176),\n toObject = require(163);\n\n/**\n * The base implementation of `_.matches` which does not clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatches(source) {\n var props = keys(source),\n length = props.length;\n\n if (!length) {\n return constant(true);\n }\n if (length == 1) {\n var key = props[0],\n value = source[key];\n\n if (isStrictComparable(value)) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value && (value !== undefined || (key in toObject(object)));\n };\n }\n }\n var values = Array(length),\n strictCompareFlags = Array(length);\n\n while (length--) {\n value = source[props[length]];\n values[length] = value;\n strictCompareFlags[length] = isStrictComparable(value);\n }\n return function(object) {\n return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require(117),\n baseIsEqual = require(119),\n baseSlice = require(131),\n isArray = require(166),\n isKey = require(155),\n isStrictComparable = require(158),\n last = require(80),\n toObject = require(163),\n toPath = require(164);\n\n/**\n * The base implementation of `_.matchesProperty` which does not which does\n * not clone `value`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} value The value to compare.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatchesProperty(path, value) {\n var isArr = isArray(path),\n isCommon = isKey(path) && isStrictComparable(value),\n pathKey = (path + '');\n\n path = toPath(path);\n return function(object) {\n if (object == null) {\n return false;\n }\n var key = pathKey;\n object = toObject(object);\n if ((isArr || !isCommon) && !(key in object)) {\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n if (object == null) {\n return false;\n }\n key = last(path);\n object = toObject(object);\n }\n return object[key] === value\n ? (value !== undefined || (key in object))\n : baseIsEqual(value, object[key], null, true);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var arrayEach = require(96),\n baseMergeDeep = require(127),\n getSymbols = require(150),\n isArray = require(166),\n isArrayLike = require(152),\n isObject = require(170),\n isObjectLike = require(157),\n isTypedArray = require(173),\n keys = require(176);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));\n if (!isSrcArr) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((isSrcArr || result !== undefined) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n}\n\nmodule.exports = baseMerge;\n","var arrayCopy = require(95),\n isArguments = require(165),\n isArray = require(166),\n isArrayLike = require(152),\n isPlainObject = require(171),\n isTypedArray = require(173),\n toPlainObject = require(174);\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n}\n\nmodule.exports = baseMergeDeep;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require(117),\n toPath = require(164);\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction basePropertyDeep(path) {\n var pathKey = (path + '');\n path = toPath(path);\n return function(object) {\n return baseGet(object, path, pathKey);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight` without support\n * for callback shorthands and `this` binding, which iterates over `collection`\n * using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initFromCollection Specify using the first or last element\n * of `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initFromCollection\n ? (initFromCollection = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n start = start == null ? 0 : (+start || 0);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : (+end || 0);\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseEach = require(108);\n\n/**\n * The base implementation of `_.some` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n","/**\n * Converts `value` to a string if it is not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n if (typeof value == 'string') {\n return value;\n }\n return value == null ? '' : (value + '');\n}\n\nmodule.exports = baseToString;\n","/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n var index = -1,\n length = props.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = object[props[index]];\n }\n return result;\n}\n\nmodule.exports = baseValues;\n","var identity = require(185);\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\nmodule.exports = bindCallback;\n","var isObject = require(170);\n\n/**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\nfunction cacheIndexOf(cache, value) {\n var data = cache.data,\n result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n return result ? 0 : -1;\n}\n\nmodule.exports = cacheIndexOf;\n","var isObject = require(170);\n\n/**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\nfunction cachePush(value) {\n var data = this.data;\n if (typeof value == 'string' || isObject(value)) {\n data.set.add(value);\n } else {\n data.hash[value] = true;\n }\n}\n\nmodule.exports = cachePush;\n","var baseCallback = require(104),\n baseEach = require(108),\n isArray = require(166);\n\n/**\n * Creates a function that aggregates a collection, creating an accumulator\n * object composed from the results of running each element in the collection\n * through an iteratee.\n *\n * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,\n * and `_.partition`.\n *\n * @private\n * @param {Function} setter The function to set keys and values of the accumulator object.\n * @param {Function} [initializer] The function to initialize the accumulator object.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee, thisArg) {\n var result = initializer ? initializer() : {};\n iteratee = baseCallback(iteratee, thisArg, 3);\n\n if (isArray(collection)) {\n var index = -1,\n length = collection.length;\n\n while (++index < length) {\n var value = collection[index];\n setter(result, value, iteratee(value, index, collection), collection);\n }\n } else {\n baseEach(collection, function(value, key, collection) {\n setter(result, value, iteratee(value, key, collection), collection);\n });\n }\n return result;\n };\n}\n\nmodule.exports = createAggregator;\n","var bindCallback = require(135),\n isIterateeCall = require(154),\n restParam = require(93);\n\n/**\n * Creates a function that assigns properties of source object(s) to a given\n * destination object.\n *\n * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 && sources[length - 2],\n guard = length > 2 && sources[2],\n thisArg = length > 1 && sources[length - 1];\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : null;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? null : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var getLength = require(149),\n isLength = require(156),\n toObject = require(163);\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n return eachFunc(collection, iteratee);\n }\n var index = fromRight ? length : -1,\n iterable = toObject(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var toObject = require(163);\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var SetCache = require('./SetCache'),\n constant = require('../utility/constant'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\nvar createCache = !(nativeCreate && Set) ? constant(null) : function(values) {\n return new SetCache(values);\n};\n\nmodule.exports = createCache;\n","var baseCallback = require(104),\n baseFind = require(111),\n baseFindIndex = require(112),\n isArray = require(166);\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(eachFunc, fromRight) {\n return function(collection, predicate, thisArg) {\n predicate = baseCallback(predicate, thisArg, 3);\n if (isArray(collection)) {\n var index = baseFindIndex(collection, predicate, fromRight);\n return index > -1 ? collection[index] : undefined;\n }\n return baseFind(collection, predicate, eachFunc);\n };\n}\n\nmodule.exports = createFind;\n","var bindCallback = require(135),\n isArray = require(166);\n\n/**\n * Creates a function for `_.forEach` or `_.forEachRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createForEach(arrayFunc, eachFunc) {\n return function(collection, iteratee, thisArg) {\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee)\n : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n };\n}\n\nmodule.exports = createForEach;\n","var baseCallback = require(104),\n baseReduce = require(130),\n isArray = require(166);\n\n/**\n * Creates a function for `_.reduce` or `_.reduceRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createReduce(arrayFunc, eachFunc) {\n return function(collection, iteratee, accumulator, thisArg) {\n var initFromArray = arguments.length < 3;\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n };\n}\n\nmodule.exports = createReduce;\n","/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing arrays.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var index = -1,\n arrLength = array.length,\n othLength = other.length,\n result = true;\n\n if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (result && ++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, arrValue, index)\n : customizer(arrValue, othValue, index);\n }\n if (result === undefined) {\n // Recursively compare arrays (susceptible to call stack limits).\n if (isLoose) {\n var othIndex = othLength;\n while (othIndex--) {\n othValue = other[othIndex];\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n if (result) {\n break;\n }\n }\n } else {\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n }\n return !!result;\n}\n\nmodule.exports = equalArrays;\n","/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n stringTag = '[object String]';\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} value The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag) {\n switch (tag) {\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object)\n ? other != +other\n : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var keys = require(176);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isLoose) {\n return false;\n }\n var skipCtor = isLoose,\n index = -1;\n\n while (++index < objLength) {\n var key = objProps[index],\n result = isLoose ? key in other : hasOwnProperty.call(other, key);\n\n if (result) {\n var objValue = object[key],\n othValue = other[key];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, objValue, key)\n : customizer(objValue, othValue, key);\n }\n if (result === undefined) {\n // Recursively compare objects (susceptible to call stack limits).\n result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n if (!result) {\n return false;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (!skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = equalObjects;\n","var baseProperty = require(128);\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n","var constant = require(184),\n isNative = require(168),\n toObject = require(163);\n\n/** Native method references. */\nvar getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;\n\n/**\n * Creates an array of the own symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {\n return getOwnPropertySymbols(toObject(object));\n};\n\nmodule.exports = getSymbols;\n","/**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\nfunction indexOfNaN(array, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 0 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n var other = array[index];\n if (other !== other) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = indexOfNaN;\n","var getLength = require(149),\n isLength = require(156);\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = +value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n","var isArrayLike = require(152),\n isIndex = require(153),\n isObject = require(170);\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var isArray = require(166),\n toObject = require(163);\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = //.|/[(?:[^[/]]*|([\"'])(?:(?!/1)[^/n//]|//.)*?/1)/]/,\n reIsPlainProp = /^/w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n var type = typeof value;\n if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n return true;\n }\n if (isArray(value)) {\n return false;\n }\n var result = !reIsDeepProp.test(value);\n return result || (object != null && value in toObject(object));\n}\n\nmodule.exports = isKey;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require(170);\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var toObject = require(163);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties specified\n * by `props`.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property names to pick.\n * @returns {Object} Returns the new object.\n */\nfunction pickByArray(object, props) {\n object = toObject(object);\n\n var index = -1,\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index];\n if (key in object) {\n result[key] = object[key];\n }\n }\n return result;\n}\n\nmodule.exports = pickByArray;\n","var baseForIn = require(115);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties `predicate`\n * returns truthy for.\n *\n * @private\n * @param {Object} object The source object.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Object} Returns the new object.\n */\nfunction pickByCallback(object, predicate) {\n var result = {};\n baseForIn(object, function(value, key, object) {\n if (predicate(value, key, object)) {\n result[key] = value;\n }\n });\n return result;\n}\n\nmodule.exports = pickByCallback;\n","var baseForIn = require(115),\n isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A fallback implementation of `_.isPlainObject` which checks if `value`\n * is an object created by the `Object` constructor or has a `[[Prototype]]`\n * of `null`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n */\nfunction shimIsPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||\n (!hasOwnProperty.call(value, 'constructor') &&\n (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = shimIsPlainObject;\n","var isArguments = require(165),\n isArray = require(166),\n isIndex = require(153),\n isLength = require(156),\n keysIn = require(177),\n support = require(183);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object)));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = shimKeys;\n","var isObject = require(170);\n\n/**\n * Converts `value` to an object if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n","var baseToString = require(133),\n isArray = require(166);\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[/]]+|/[(?:(-?/d+(?:/./d+)?)|([\"'])((?:(?!/2)[^/n//]|//.)*?)/2)/]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = ///(//)?/g;\n\n/**\n * Converts `value` to property path array if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return value;\n }\n var result = [];\n baseToString(value).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n}\n\nmodule.exports = toPath;\n","var isArrayLike = require(152),\n isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;\n}\n\nmodule.exports = isArguments;\n","var isLength = require(156),\n isNative = require(168),\n isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n","var baseIsFunction = require('../internal/baseIsFunction'),\n isNative = require('./isNative');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nvar isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return objToString.call(value) == funcTag;\n};\n\nmodule.exports = isFunction;\n","var escapeRegExp = require(182),\n isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^/[object .+?Constructor/]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n escapeRegExp(objToString)\n .replace(/toString|(function).*?(?=///()| for .+?(?=///])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (objToString.call(value) == funcTag) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isNative;\n","var isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(8.4);\n * // => true\n *\n * _.isNumber(NaN);\n * // => true\n *\n * _.isNumber('8.4');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return type == 'function' || (!!value && type == 'object');\n}\n\nmodule.exports = isObject;\n","var isNative = require(168),\n shimIsPlainObject = require(161);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nvar isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {\n if (!(value && objToString.call(value) == objectTag)) {\n return false;\n }\n var valueOf = value.valueOf,\n objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);\n\n return objProto\n ? (value == objProto || getPrototypeOf(value) == objProto)\n : shimIsPlainObject(value);\n};\n\nmodule.exports = isPlainObject;\n","var isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var isLength = require(156),\n isObjectLike = require(157);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n","var baseCopy = require(105),\n keysIn = require(177);\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignWith = require(102),\n baseAssign = require(103),\n createAssigner = require(139);\n\n/**\n * Assigns own enumerable properties of source object(s) to the destination\n * object. Subsequent sources overwrite property assignments of previous sources.\n * If `customizer` is provided it is invoked to produce the assigned values.\n * The `customizer` is bound to `thisArg` and invoked with five arguments:\n * (objectValue, sourceValue, key, object, source).\n *\n * **Note:** This method mutates `object` and is based on\n * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).\n *\n * @static\n * @memberOf _\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using a customizer callback\n * var defaults = _.partialRight(_.assign, function(value, other) {\n * return _.isUndefined(value) ? other : value;\n * });\n *\n * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\nvar assign = createAssigner(function(object, source, customizer) {\n return customizer\n ? assignWith(object, source, customizer)\n : baseAssign(object, source);\n});\n\nmodule.exports = assign;\n","var isArrayLike = require(152),\n isNative = require(168),\n isObject = require(170),\n shimKeys = require(162);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object != null && object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n","var isArguments = require(165),\n isArray = require(166),\n isIndex = require(153),\n isLength = require(156),\n isObject = require(170),\n support = require(183);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keysIn;\n","var baseMerge = require(126),\n createAssigner = require(139);\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it is invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n","var arrayMap = require(99),\n baseDifference = require(107),\n baseFlatten = require(113),\n bindCallback = require(135),\n keysIn = require(177),\n pickByArray = require(159),\n pickByCallback = require(160),\n restParam = require(93);\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to omit, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.omit(object, 'age');\n * // => { 'user': 'fred' }\n *\n * _.omit(object, _.isNumber);\n * // => { 'user': 'fred' }\n */\nvar omit = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n if (typeof props[0] != 'function') {\n var props = arrayMap(baseFlatten(props), String);\n return pickByArray(object, baseDifference(keysIn(object), props));\n }\n var predicate = bindCallback(props[0], props[1], 3);\n return pickByCallback(object, function(value, key, object) {\n return !predicate(value, key, object);\n });\n});\n\nmodule.exports = omit;\n","var baseFlatten = require(113),\n bindCallback = require(135),\n pickByArray = require(159),\n pickByCallback = require(160),\n restParam = require(93);\n\n/**\n * Creates an object composed of the picked `object` properties. Property\n * names may be specified as individual arguments or as arrays of property\n * names. If `predicate` is provided it is invoked for each property of `object`\n * picking the properties `predicate` returns truthy for. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to pick, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.pick(object, 'user');\n * // => { 'user': 'fred' }\n *\n * _.pick(object, _.isString);\n * // => { 'user': 'fred' }\n */\nvar pick = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n return typeof props[0] == 'function'\n ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n : pickByArray(object, baseFlatten(props));\n});\n\nmodule.exports = pick;\n","var baseValues = require(134),\n keys = require(176);\n\n/**\n * Creates an array of the own enumerable property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseToString = require(133);\n\n/**\n * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).\n * In addition to special characters the forward slash is escaped to allow for\n * easier `eval` use and `Function` compilation.\n */\nvar reRegExpChars = /[.*+?^${}()|[/]////]/g,\n reHasRegExpChars = RegExp(reRegExpChars.source);\n\n/**\n * Escapes the `RegExp` special characters \"/\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '/[lodash/]/(https:////lodash/.com///)'\n */\nfunction escapeRegExp(string) {\n string = baseToString(string);\n return (string && reHasRegExpChars.test(string))\n ? string.replace(reRegExpChars, '//$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to detect DOM support. */\nvar document = (document = global.window) && document.document;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\nvar support = {};\n\n(function(x) {\n var Ctor = function() { this.x = x; },\n args = arguments,\n object = { '0': x, 'length': x },\n props = [];\n\n Ctor.prototype = { 'valueOf': x, 'y': x };\n for (var key in new Ctor) { props.push(key); }\n\n /**\n * Detect if functions can be decompiled by `Function#toString`\n * (all but Firefox OS certified apps, older Opera mobile browsers, and\n * the PlayStation 3; forced `false` for Windows 8 apps).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcDecomp = //bthis/b/.test(function() { return this; });\n\n /**\n * Detect if `Function#name` is supported (all but IE).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcNames = typeof Function.name == 'string';\n\n /**\n * Detect if the DOM is supported.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.dom = document.createDocumentFragment().nodeType === 11;\n } catch(e) {\n support.dom = false;\n }\n\n /**\n * Detect if `arguments` object indexes are non-enumerable.\n *\n * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object\n * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat\n * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`\n * checks for indexes that exceed the number of function parameters and\n * whose associated argument values are `0`.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);\n } catch(e) {\n support.nonEnumArgs = true;\n }\n}(1, 0));\n\nmodule.exports = support;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseProperty = require(128),\n basePropertyDeep = require(129),\n isKey = require(155);\n\n/**\n * Creates a function which returns the property value at `path` on a\n * given object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","module.exports = require(194);","module.exports = function(el) {\n\n var c;\n\n while (el.childNodes.length) {\n c = el.childNodes[0];\n el.removeChild(c);\n }\n\n return el;\n};","module.exports = require(197);","module.exports = require(201);","module.exports = require(198);","module.exports = require(200);","module.exports = function(el) {\n el.parentNode && el.parentNode.removeChild(el);\n};","/**\n * Module dependencies.\n */\n\nvar index = require(195);\n\n/**\n * Whitespace regexp.\n */\n\nvar re = //s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function(el){\n return new ClassList(el);\n};\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function(name){\n // classList\n if (this.list) {\n this.list.add(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (!~i) arr.push(name);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function(name){\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n // classList\n if (this.list) {\n this.list.remove(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (~i) arr.splice(i, 1);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function(re){\n var arr = this.array();\n for (var i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function(name, force){\n // classList\n if (this.list) {\n if (\"undefined\" !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n }\n\n // fallback\n if (\"undefined\" !== typeof force) {\n if (!force) {\n this.remove(name);\n } else {\n this.add(name);\n }\n } else {\n if (this.has(name)) {\n this.remove(name);\n } else {\n this.add(name);\n }\n }\n\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function(){\n var className = this.el.getAttribute('class') || '';\n var str = className.replace(/^/s+|/s+$/g, '');\n var arr = str.split(re);\n if ('' === arr[0]) arr.shift();\n return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has =\nClassList.prototype.contains = function(name){\n return this.list\n ? this.list.contains(name)\n : !! ~index(this.array(), name);\n};\n","module.exports = function(arr, obj){\n if (arr.indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};","var matches = require(199)\n\nmodule.exports = function (element, selector, checkYoSelf, root) {\n element = checkYoSelf ? {parentNode: element} : element\n\n root = root || document\n\n // Make sure `element !== document` and `element != null`\n // otherwise we get an illegal invocation\n while ((element = element.parentNode) && element !== document) {\n if (matches(element, selector))\n return element\n // After `matches` on the edge case that\n // the selector matches the root\n // (when the root is not the document)\n if (element === root)\n return\n }\n}\n","/**\n * Module dependencies.\n */\n\nvar closest = require(196)\n , event = require(198);\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, selector, type, fn, capture){\n return event.bind(el, type, function(e){\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true, el);\n if (e.delegateTarget) fn.call(el, e);\n }, capture);\n};\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n event.unbind(el, type, fn, capture);\n};\n","var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, type, fn, capture){\n el[bind](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n el[unbind](prefix + type, fn, capture || false);\n return fn;\n};","/**\n * Module dependencies.\n */\n\nvar query = require(200);\n\n/**\n * Element prototype.\n */\n\nvar proto = Element.prototype;\n\n/**\n * Vendor function.\n */\n\nvar vendor = proto.matches\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\n/**\n * Expose `match()`.\n */\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = query.all(selector, el.parentNode);\n for (var i = 0; i < nodes.length; ++i) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n","function one(selector, el) {\n return el.querySelector(selector);\n}\n\nexports = module.exports = function(selector, el){\n el = el || document;\n return one(selector, el);\n};\n\nexports.all = function(selector, el){\n el = el || document;\n return el.querySelectorAll(selector);\n};\n\nexports.engine = function(obj){\n if (!obj.one) throw new Error('.one callback required');\n if (!obj.all) throw new Error('.all callback required');\n one = obj.one;\n exports.all = obj.all;\n return exports;\n};\n","\n/**\n * Expose `parse`.\n */\n\nmodule.exports = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar div = document.createElement('div');\n// Setup\ndiv.innerHTML = ' <link/><table></table><a href=\"/a\">a</a><input type=\"checkbox\"/>';\n// Make sure that link elements get serialized correctly by innerHTML\n// This requires a wrapper element in IE\nvar innerHTMLBug = !div.getElementsByTagName('link').length;\ndiv = undefined;\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '<fieldset>', '</fieldset>'],\n tr: [2, '<table><tbody>', '</tbody></table>'],\n col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nmap.option =\nmap.optgroup = [1, '<select multiple=\"multiple\">', '</select>'];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '<table>', '</table>'];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">','</svg>'];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (<div> for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([/w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^/s+|/s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = map[tag] || map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n","module.exports = require(204);\r\n\r\nmodule.exports.Collection = require(203);","'use strict';\r\n\r\n/**\r\n * An empty collection stub. Use {@link RefsCollection.extend} to extend a\r\n * collection with ref semantics.\r\n *\r\n * @classdesc A change and inverse-reference aware collection with set semantics.\r\n *\r\n * @class RefsCollection\r\n */\r\nfunction RefsCollection() { }\r\n\r\n/**\r\n * Extends a collection with {@link Refs} aware methods\r\n *\r\n * @memberof RefsCollection\r\n * @static\r\n *\r\n * @param {Array<Object>} collection\r\n * @param {Refs} refs instance\r\n * @param {Object} property represented by the collection\r\n * @param {Object} target object the collection is attached to\r\n *\r\n * @return {RefsCollection<Object>} the extended array\r\n */\r\nfunction extend(collection, refs, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n /**\r\n * Removes the given element from the array and returns it.\r\n *\r\n * @method RefsCollection#remove\r\n *\r\n * @param {Object} element the element to remove\r\n */\r\n collection.remove = function(element) {\r\n var idx = this.indexOf(element);\r\n if (idx !== -1) {\r\n this.splice(idx, 1);\r\n\r\n // unset inverse\r\n refs.unset(element, inverseProperty, target);\r\n }\r\n\r\n return element;\r\n };\r\n\r\n /**\r\n * Returns true if the collection contains the given element\r\n *\r\n * @method RefsCollection#contains\r\n *\r\n * @param {Object} element the element to check for\r\n */\r\n collection.contains = function(element) {\r\n return this.indexOf(element) !== -1;\r\n };\r\n\r\n /**\r\n * Adds an element to the array, unless it exists already (set semantics).\r\n *\r\n * @method RefsCollection#add\r\n *\r\n * @param {Object} element the element to add\r\n */\r\n collection.add = function(element) {\r\n\r\n if (!this.contains(element)) {\r\n this.push(element);\r\n\r\n // set inverse\r\n refs.set(element, inverseProperty, target);\r\n }\r\n };\r\n\r\n return collection;\r\n}\r\n\r\n\r\nmodule.exports.extend = extend;","'use strict';\r\n\r\nvar Collection = require(203);\r\n\r\nfunction hasOwnProperty(e, property) {\r\n return Object.prototype.hasOwnProperty.call(e, property.name || property);\r\n}\r\n\r\n\r\nfunction defineCollectionProperty(ref, property, target) {\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n value: Collection.extend(target[property.name] || [], ref, property, target)\r\n });\r\n}\r\n\r\n\r\nfunction defineProperty(ref, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n var _value = target[property.name];\r\n\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n\r\n get: function() {\r\n return _value;\r\n },\r\n\r\n set: function(value) {\r\n\r\n // return if we already performed all changes\r\n if (value === _value) {\r\n return;\r\n }\r\n\r\n var old = _value;\r\n\r\n // temporary set null\r\n _value = null;\r\n\r\n if (old) {\r\n ref.unset(old, inverseProperty, target);\r\n }\r\n\r\n // set new value\r\n _value = value;\r\n\r\n // set inverse value\r\n ref.set(_value, inverseProperty, target);\r\n }\r\n });\r\n\r\n}\r\n\r\n/**\r\n * Creates a new references object defining two inversly related\r\n * attribute descriptors a and b.\r\n *\r\n * <p>\r\n * When bound to an object using {@link Refs#bind} the references\r\n * get activated and ensure that add and remove operations are applied\r\n * reversely, too.\r\n * </p>\r\n *\r\n * <p>\r\n * For attributes represented as collections {@link Refs} provides the\r\n * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\r\n * that must be used to properly hook into the inverse change mechanism.\r\n * </p>\r\n *\r\n * @class Refs\r\n *\r\n * @classdesc A bi-directional reference between two attributes.\r\n *\r\n * @param {Refs.AttributeDescriptor} a property descriptor\r\n * @param {Refs.AttributeDescriptor} b property descriptor\r\n *\r\n * @example\r\n *\r\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\r\n *\r\n * var car = { name: 'toyota' };\r\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\r\n *\r\n * refs.bind(car, 'wheels');\r\n *\r\n * car.wheels // []\r\n * car.wheels.add(wheels[0]);\r\n * car.wheels.add(wheels[1]);\r\n *\r\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\r\n *\r\n * wheels[0].car // { name: 'toyota' };\r\n * car.wheels.remove(wheels[0]);\r\n *\r\n * wheels[0].car // undefined\r\n */\r\nfunction Refs(a, b) {\r\n\r\n if (!(this instanceof Refs)) {\r\n return new Refs(a, b);\r\n }\r\n\r\n // link\r\n a.inverse = b;\r\n b.inverse = a;\r\n\r\n this.props = {};\r\n this.props[a.name] = a;\r\n this.props[b.name] = b;\r\n}\r\n\r\n/**\r\n * Binds one side of a bi-directional reference to a\r\n * target object.\r\n *\r\n * @memberOf Refs\r\n *\r\n * @param {Object} target\r\n * @param {String} property\r\n */\r\nRefs.prototype.bind = function(target, property) {\r\n if (typeof property === 'string') {\r\n if (!this.props[property]) {\r\n throw new Error('no property <' + property + '> in ref');\r\n }\r\n property = this.props[property];\r\n }\r\n\r\n if (property.collection) {\r\n defineCollectionProperty(this, property, target);\r\n } else {\r\n defineProperty(this, property, target);\r\n }\r\n};\r\n\r\nRefs.prototype.ensureBound = function(target, property) {\r\n if (!hasOwnProperty(target, property)) {\r\n this.bind(target, property);\r\n }\r\n};\r\n\r\nRefs.prototype.unset = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].remove(value);\r\n } else {\r\n target[property.name] = undefined;\r\n }\r\n }\r\n};\r\n\r\nRefs.prototype.set = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].add(value);\r\n } else {\r\n target[property.name] = value;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = Refs;\r\n\r\n\r\n/**\r\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\r\n *\r\n * @typedef {Object} Refs.AttributeDescriptor\r\n * @property {String} name\r\n * @property {boolean} [collection=false]\r\n * @property {boolean} [enumerable=false]\r\n */"]} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.min.js
new file mode 100644
index 0000000..ac15209
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-navigated-viewer.min.js
@@ -0,0 +1,9 @@
+/*! bpmn-js - bpmn-navigated-viewer v0.10.3 | (c) 2014, 2015 camunda Services GmbH | bpmn.io/license */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.BpmnJS=e()}}(function(){var e;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(e){o.call(this,e)}var i=e(79),o=e(2);i(r,o),t.exports=r,r.prototype._navigationModules=[e(61),e(59)],r.prototype._modules=[].concat(r.prototype._modules,r.prototype._navigationModules)},{2:2,59:59,61:61,79:79}],2:[function(e,t,n){"use strict";function r(e,t){var n=e.get("eventBus");t.forEach(function(e){n.on(e.event,e.handler)})}function i(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/,n=t.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}function o(e){return e+(l(e)?"px":"")}function a(e){this.options=e=s({},g,e||{});var t=e.container;t.get&&(t=t.get(0)),u(t)&&(t=f(t));var n=this.container=p('<div class="bjs-container"></div>');t.appendChild(n),s(n.style,{width:o(e.width),height:o(e.height),position:e.position});var r="iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC",i='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100"><img src="data:image/png;base64,'+r+'"></a>';n.appendChild(p(i))}var s=e(175),c=e(179),u=e(172),l=e(169),p=e(190),f=e(192),h=e(193),d=e(36),m=e(15),y=e(9),g={width:"100%",height:"100%",position:"relative",container:"body"};a.prototype.importXML=function(e,t){var n=this;this.moddle=this.createModdle(),this.moddle.fromXML(e,"bpmn:Definitions",function(e,r,o){if(e)return e=i(e),t(e);var a=o.warnings;n.importDefinitions(r,function(e,n){return e?t(e):void t(null,a.concat(n||[]))})})},a.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this.definitions;return n?void this.moddle.toXML(n,e,t):t(new Error("no definitions loaded"))},a.prototype.createModdle=function(){return new m(this.options.moddleExtensions)},a.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),r=n.getDefaultLayer(),i=n._svg.select("defs"),o=r.innerSVG(),a=i&&i.outerSVG()||"",s=r.getBBox(),c='<?xml version="1.0" encoding="utf-8"?>\n<!-- created with bpmn-js / http://bpmn.io -->\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>";t(null,c)},a.prototype.get=function(e){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.get(e)},a.prototype.invoke=function(e){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.invoke(e)},a.prototype.importDefinitions=function(e,t){try{this.diagram&&this.clear(),this.definitions=e;var n=this.diagram=this._createDiagram(this.options);this._init(n),y.importBpmnDiagram(n,e,t)}catch(r){t(r)}},a.prototype._init=function(e){r(e,this.__listeners||[])},a.prototype._createDiagram=function(e){var t=[].concat(e.modules||this.getModules(),e.additionalModules||[]);return t.unshift({bpmnjs:["value",this],moddle:["value",this.moddle]}),e=c(e,"additionalModules"),e=s(e,{canvas:{container:this.container},modules:t}),new d(e)},a.prototype.getModules=function(){return this._modules},a.prototype.clear=function(){var e=this.diagram;e&&e.destroy()},a.prototype.destroy=function(){this.clear(),h(this.container)},a.prototype.on=function(e,t){var n=this.diagram,r=this.__listeners=this.__listeners||[];r.push({event:e,handler:t}),n&&n.get("eventBus").on(e,t)},a.prototype._modules=[e(3),e(56),e(52)],t.exports=a},{15:15,169:169,172:172,175:175,179:179,190:190,192:192,193:193,3:3,36:36,52:52,56:56,9:9}],3:[function(e,t,n){t.exports={__depends__:[e(6),e(11)]}},{11:11,6:6}],4:[function(e,t,n){"use strict";function r(e,t,n){function r(e,t){X[e]=t}function i(e){return X[e]}function y(e){function t(e,t){var n=s({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},o=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var a=t.element.attr(n).marker(0,0,20,20,i.x,i.y).attr({markerWidth:20*o,markerHeight:20*o});return r(e,a)}t("sequenceflow-end",{element:e.path("M 1 5 L 11 10 L 1 15 Z"),ref:{x:11,y:10},scale:.5}),t("messageflow-start",{element:e.circle(6,6,3.5),attrs:{fill:"white",stroke:"black"},ref:{x:6,y:6}}),t("messageflow-end",{element:e.path("m 1 5 l 0 -3 l 7 3 l -7 3 z"),attrs:{fill:"white",stroke:"black",strokeLinecap:"butt"},ref:{x:8.5,y:5}}),t("data-association-end",{element:e.path("M 1 5 L 11 10 L 1 15"),attrs:{fill:"white",stroke:"black"},ref:{x:11,y:10},scale:.5}),t("conditional-flow-marker",{element:e.path("M 0 10 L 8 6 L 16 10 L 8 14 Z"),attrs:{fill:"white",stroke:"black"},ref:{x:-1,y:10},scale:.5}),t("conditional-default-flow-marker",{element:e.path("M 1 4 L 5 16"),attrs:{stroke:"black"},ref:{x:-5,y:10},scale:.5})}function g(e,n,r){return o(n)||(r=n,n=[]),t.style(n||[],s(r,e||{}))}function v(e,t,n,r,i){a(r)&&(i=r,r=0),r=r||0,i=g(i,{stroke:"black",strokeWidth:2,fill:"white"});var o=t/2,s=n/2;return e.circle(o,s,Math.round((t+n)/4-r)).attr(i)}function x(e,t,n,r,i,o){return a(i)&&(o=i,i=0),i=i||0,o=g(o,{stroke:"black",strokeWidth:2,fill:"white"}),e.rect(i,i,t-2*i,n-2*i,r).attr(o)}function b(e,t,n,r){var i=t/2,o=n/2,a=[i,0,t,o,i,n,0,o];return r=g(r,{stroke:"black",strokeWidth:2,fill:"white"}),e.polygon(a).attr(r)}function E(e,t,n){return n=g(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}),m(t,n).appendTo(e)}function w(e,t,n){return n=g(n,["no-fill"],{strokeWidth:2,stroke:"black"}),e.path(t).attr(n)}function A(e){return function(t,n){return Q[e](t,n)}}function _(e){return Q[e]}function S(e,t){var n=L(e),r=j(n);return F(n,"bpmn:MessageEventDefinition")?_("bpmn:MessageEventDefinition")(t,e,r):F(n,"bpmn:TimerEventDefinition")?_("bpmn:TimerEventDefinition")(t,e,r):F(n,"bpmn:ConditionalEventDefinition")?_("bpmn:ConditionalEventDefinition")(t,e):F(n,"bpmn:SignalEventDefinition")?_("bpmn:SignalEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")&&F(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?_("bpmn:MultipleEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")&&F(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?_("bpmn:ParallelMultipleEventDefinition")(t,e,r):F(n,"bpmn:EscalationEventDefinition")?_("bpmn:EscalationEventDefinition")(t,e,r):F(n,"bpmn:LinkEventDefinition")?_("bpmn:LinkEventDefinition")(t,e,r):F(n,"bpmn:ErrorEventDefinition")?_("bpmn:ErrorEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")?_("bpmn:CancelEventDefinition")(t,e,r):F(n,"bpmn:CompensateEventDefinition")?_("bpmn:CompensateEventDefinition")(t,e,r):F(n,"bpmn:TerminateEventDefinition")?_("bpmn:TerminateEventDefinition")(t,e,r):null}function T(e,t,n){return K.createText(e,t||"",n).addClass("djs-label")}function C(e,t,n){var r=L(t);return T(e,r.name,{box:t,align:n,padding:5})}function R(e,t,n){var r=L(t);return r.name||(t.hidden=!0),T(e,r.name,{box:t,align:n,style:{fontSize:"11px"}})}function N(e,t,n){var r=T(e,t,{box:{height:30,width:n.height},align:"center-middle"}),i=-1*n.height;r.transform("rotate(270) translate("+i+",0)")}function M(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,r=1;r<t.length;r++)n+="L"+t[r].x+","+t[r].y+" ";return n}function D(e,t,n){var r,i=L(t),o=l(n,"SubProcessMarker");return r=o?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},c(n,function(n){_(n)(e,t,r)}),"bpmn:AdHocSubProcess"===i.$type&&_("AdhocMarker")(e,t,r),i.loopCharacteristics&&void 0===i.loopCharacteristics.isSequential?void _("LoopMarker")(e,t,r):(i.loopCharacteristics&&void 0!==i.loopCharacteristics.isSequential&&!i.loopCharacteristics.isSequential&&_("ParallelMarker")(e,t,r),i.loopCharacteristics&&i.loopCharacteristics.isSequential&&_("SequentialMarker")(e,t,r),void(i.isForCompensation&&_("CompensationMarker")(e,t,r)))}function P(e,t){var n=t.type,r=Q[n];return r?r(e,t):f.prototype.drawShape.apply(this,[e,t])}function k(e,t){var n=t.type,r=Q[n];return r?r(e,t):f.prototype.drawConnection.apply(this,[e,t])}function O(e,t){var r=(t.height-16)/t.height,i=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:r}});w(e,i,{strokeWidth:2})}function B(e,t){return e.isCollection||e.elementObjectRef&&e.elementObjectRef.isCollection}function I(e){return e.businessObject.di}function L(e){return e.businessObject}function F(e,t,n){function r(e,t){return u(t,function(t,n){return e[n]==t})}return p(e.eventDefinitions,function(i){return i.$type===t&&r(e,n)})}function j(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}function V(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function G(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return V(i)}function U(e){var t=q,n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-i,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]];return V(a)}function W(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return V(s)}function z(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return V(o)}function $(e){var t=L(e);return t.$instanceOf("bpmn:Event")?G(e):t.$instanceOf("bpmn:Activity")?U(e):t.$instanceOf("bpmn:Gateway")?W(e):z(e)}f.call(this,t);var q=10,Y=3,H={fontFamily:"Arial, sans-serif",fontSize:"12px"},K=new h({style:H,size:{width:100}}),X={},Q={"bpmn:Event":function(e,t,n){return v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={},r=L(t);r.isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=_("bpmn:Event")(e,t,n);return S(t,e),i},"bpmn:MessageEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),o=r?"black":"white",a=r?"white":"black",s=w(e,i,{strokeWidth:1,fill:o,stroke:a});return s},"bpmn:TimerEventDefinition":function(e,t){var r=v(e,t.width,t.height,.2*t.height,{strokeWidth:2}),i=n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}});w(e,i,{strokeWidth:2,strokeLinecap:"square"});for(var o=0;12>o;o++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2,c=t.height/2;w(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*o+","+c+","+s+")"})}return r},"bpmn:EscalationEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.555}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:ConditionalEventDefinition":function(e,t){var r=n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}});return w(e,r,{strokeWidth:1})},"bpmn:LinkEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:ErrorEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:CancelEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o}).transform("rotate(45)")},"bpmn:CompensateEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.201,my:.472}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:SignalEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:MultipleEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),o=r?"black":"none";return w(e,i,{strokeWidth:1,fill:o})},"bpmn:ParallelMultipleEventDefinition":function(e,t){var r=n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}});return w(e,r,{strokeWidth:1})},"bpmn:EndEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:4});return S(t,e,!0),n},"bpmn:TerminateEventDefinition":function(e,t){var n=v(e,t.width,t.height,8,{strokeWidth:4,fill:"black"});return n},"bpmn:IntermediateEvent":function(e,t){var n=_("bpmn:Event")(e,t,{strokeWidth:1});return v(e,t.width,t.height,Y,{strokeWidth:1,fill:"none"}),S(t,e),n},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return x(e,t.width,t.height,q,n)},"bpmn:Task":function(e,t,n){var r=_("bpmn:Activity")(e,t,n);return C(e,t,"center-middle"),D(e,t),r},"bpmn:ServiceTask":function(e,t){var r=_("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});w(e,i,{strokeWidth:1,fill:"none"});var o=n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});w(e,o,{strokeWidth:0,stroke:"none",fill:"white"});var a=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return w(e,a,{strokeWidth:1,fill:"white"}),r},"bpmn:UserTask":function(e,t){var r=_("bpmn:Task")(e,t),i=15,o=12,a=n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:i,y:o}});w(e,a,{strokeWidth:.5,fill:"none"});var s=n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:i,y:o}});w(e,s,{strokeWidth:.5,fill:"none"});var c=n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:i,y:o}});return w(e,c,{strokeWidth:.5,fill:"black"}),r},"bpmn:ManualTask":function(e,t){var r=_("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return w(e,i,{strokeWidth:.25,fill:"white",stroke:"black"}),r},"bpmn:SendTask":function(e,t){var r=_("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return w(e,i,{strokeWidth:1,fill:"black",stroke:"white"}),r},"bpmn:ReceiveTask":function(e,t){var r,i=L(t),o=_("bpmn:Task")(e,t);return i.instantiate?(v(e,28,28,4.4,{strokeWidth:1}),r=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,r,{strokeWidth:1}),o},"bpmn:ScriptTask":function(e,t){var r=_("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return w(e,i,{strokeWidth:1}),r},"bpmn:BusinessRuleTask":function(e,t){var r=_("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),o=w(e,i);o.attr({strokeWidth:1,fill:"AAA"});var a=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),s=w(e,a);return s.attr({strokeWidth:1}),r},"bpmn:SubProcess":function(e,t,n){var r=_("bpmn:Activity")(e,t,n),i=L(t),o=d.isExpanded(i),a=!!i.triggeredByEvent;return a&&r.attr({strokeDasharray:"1,2"}),C(e,t,o?"center-top":"center-middle"),o?D(e,t):D(e,t,["SubProcessMarker"]),r},"bpmn:AdHocSubProcess":function(e,t){return _("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,n){var r=_("bpmn:SubProcess")(e,n),i=t.style(["no-fill","no-events"]);return x(e,n.width,n.height,q-2,Y,i),r},"bpmn:CallActivity":function(e,t){return _("bpmn:Task")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n=_("bpmn:Lane")(e,t,{fill:"White"}),r=d.isExpanded(t);if(r){E(e,[{x:30,y:0},{x:30,y:t.height}]);var i=L(t).name;N(e,i,t)}else{var o=L(t).name;T(e,o,{box:t,align:"center-middle"})}var a=!!L(t).participantMultiplicity;return a&&_("ParticipantMultiplicityMarker")(e,t),n},"bpmn:Lane":function(e,t,n){var r=x(e,t.width,t.height,0,n||{fill:"none"}),i=L(t);if("bpmn:Lane"===i.$type){var o=i.name;N(e,o,t)}return r},"bpmn:InclusiveGateway":function(e,t){var n=b(e,t.width,t.height);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:"none"}),n},"bpmn:ExclusiveGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return I(t).isMarkerVisible&&w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:ComplexGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}});return w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:ParallelGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}});return w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:EventBasedGateway":function(e,t){function r(){var r=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,r,{strokeWidth:2,fill:"none"})}var i=L(t),o=b(e,t.width,t.height);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none"});var a=i.eventGatewayType,s=!!i.instantiate;if("Parallel"===a){var c=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),u=w(e,c);u.attr({strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!s){var l=v(e,t.width,t.height,.26*t.height);l.attr({strokeWidth:1,fill:"none"})}r()}return o},"bpmn:Gateway":function(e,t){return b(e,t.width,t.height)},"bpmn:SequenceFlow":function(e,t){var n=M(t),r=w(e,n,{strokeLinejoin:"round",markerEnd:i("sequenceflow-end")}),o=L(t),a=t.source.businessObject;return o.conditionExpression&&a.$instanceOf("bpmn:Task")&&r.attr({markerStart:i("conditional-flow-marker")}),a["default"]&&a.$instanceOf("bpmn:Gateway")&&a["default"]===o&&r.attr({markerStart:i("conditional-default-flow-marker")}),r},"bpmn:Association":function(e,t,n){return n=s({strokeDasharray:"1,6",strokeLinecap:"round",strokeLinejoin:"round"},n||{}),E(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){return _("bpmn:Association")(e,t,{markerEnd:i("data-association-end")})},"bpmn:DataOutputAssociation":function(e,t){return _("bpmn:Association")(e,t,{markerEnd:i("data-association-end")})},"bpmn:MessageFlow":function(e,t){var r=L(t),o=I(t),a=M(t),s=w(e,a,{markerEnd:i("messageflow-end"),markerStart:i("messageflow-start"),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px"});if(r.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),u=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),l={strokeWidth:1};"initiating"===o.messageVisibleKind?(l.fill="white",l.stroke="black"):(l.fill="#888",l.stroke="white"),w(e,u,l)}return s},"bpmn:DataObject":function(e,t){var r=n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),i=w(e,r,{fill:"white"}),o=L(t);return B(o)&&O(e,t),i},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var r=n.getRawPath("DATA_ARROW"),i=_("bpmn:DataObject")(e,t);return w(e,r,{strokeWidth:1}),i},"bpmn:DataOutput":function(e,t){var r=n.getRawPath("DATA_ARROW"),i=_("bpmn:DataObject")(e,t);return w(e,r,{strokeWidth:1,fill:"black"}),i},"bpmn:DataStoreReference":function(e,t){var r=n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),i=w(e,r,{strokeWidth:2,fill:"white"});return i},"bpmn:BoundaryEvent":function(e,t){var n=L(t),r=n.cancelActivity,i={strokeLinecap:"round",strokeWidth:1};r||(i.strokeDasharray="6");var o=_("bpmn:Event")(e,t,i);return v(e,t.width,t.height,Y,i),S(t,e),o},"bpmn:Group":function(e,t){return x(e,t.width,t.height,q,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return R(e,t,"")},"bpmn:TextAnnotation":function(e,t){var r={fill:"none",stroke:"none"},i=x(e,t.width,t.height,0,0,r),o=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}});w(e,o);var a=L(t).text||"";return T(e,a,{box:t,align:"left-middle",padding:5}),i},ParticipantMultiplicityMarker:function(e,t){var r=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}});w(e,r)},SubProcessMarker:function(e,t){var r=x(e,14,14,0,{strokeWidth:1});r.transform("translate("+(t.width/2-7.5)+","+(t.height-20)+")");var i=n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}});w(e,i)},ParallelMarker:function(e,t,r){var i=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.parallel)/t.width,my:(t.height-20)/t.height}});w(e,i)},SequentialMarker:function(e,t,r){var i=n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.seq)/t.width,my:(t.height-19)/t.height}});w(e,i)},CompensationMarker:function(e,t,r){var i=n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.compensation)/t.width,my:(t.height-13)/t.height}});w(e,i,{strokeWidth:1})},LoopMarker:function(e,t,r){var i=n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.loop)/t.width,my:(t.height-7)/t.height}});w(e,i,{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,r){var i=n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.adhoc)/t.width,my:(t.height-15)/t.height}});w(e,i,{strokeWidth:1,fill:"black"})}};e.on("canvas.init",function(e){y(e.svg)}),this.drawShape=P,this.drawConnection=k,this.getShapePath=$}var i=e(79),o=e(166),a=e(170),s=e(175),c=e(84),u=e(81),l=e(86),p=e(89),f=e(44),h=e(71),d=e(12),m=f.createLine;i(r,f),r.$inject=["eventBus","styles","pathMap"],t.exports=r},{12:12,166:166,170:170,175:175,44:44,71:71,79:79,81:81,84:84,86:86,89:89}],5:[function(e,t,n){"use strict";function r(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"m {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} {e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z",height:36,width:36,heightElements:[2.382,4.764,4.926,6.589333,7.146,13.178667,19.768],widthElements:[2.463,2.808,4.926,5.616,7.389,8.424]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z",height:36,width:36,heightElements:[5,10],widthElements:[10]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"
+},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,o=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var a={};if(t.position){for(var s=t.containerHeight/o.height*t.yScaleFactor,c=t.containerWidth/o.width*t.xScaleFactor,u=0;u<o.heightElements.length;u++)a["y"+u]=o.heightElements[u]*s;for(var l=0;l<o.widthElements.length;l++)a["x"+l]=o.widthElements[l]*c}var p=i.format(o.d,{mx:n,my:r,e:a});return p}}var i=e(74);t.exports=r},{74:74}],6:[function(e,t,n){t.exports={renderer:["type",e(4)],pathMap:["type",e(5)]}},{4:4,5:5}],7:[function(e,t,n){"use strict";function r(e,t){return a({id:e.id,type:e.$type,businessObject:e},t)}function i(e){return s(e,function(e){return{x:e.x,y:e.y}})}function o(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r}var a=e(175),s=e(87),c=e(13),u=c.hasExternalLabel,l=c.getExternalLabelBounds,p=e(12).isExpanded,f=e(10).elementToString;o.$inject=["eventBus","canvas","elementFactory","elementRegistry"],t.exports=o,o.prototype.add=function(e,t){var n,o=e.di;if(o.$instanceOf("bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(r(e)),this._canvas.setRootElement(n);else if(o.$instanceOf("bpmndi:BPMNShape")){var a=!p(e),s=t&&(t.hidden||t.collapsed),c=e.di.bounds;n=this._elementFactory.createShape(r(e,{collapsed:a,hidden:s,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height)})),this._canvas.addShape(n,t)}else{if(!o.$instanceOf("bpmndi:BPMNEdge"))throw new Error("unknown di "+f(o)+" for element "+f(e));var l=this._getSource(e),h=this._getTarget(e);n=this._elementFactory.createConnection(r(e,{source:l,target:h,waypoints:i(e.di.waypoint)})),this._canvas.addConnection(n,t)}return u(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},o.prototype.addLabel=function(e,t){var n=l(e,t),i=this._elementFactory.createLabel(r(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}));return this._canvas.addShape(i,t.parent)},o.prototype._getEnd=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===i&&(r=r&&r[0]),("source"===t&&"bpmn:DataOutputAssociation"===i||"target"===t&&"bpmn:DataInputAssociation"===i)&&(r=e.$parent),n=r&&this._getElement(r))return n;throw r?new Error("element "+f(r)+" referenced by "+f(e)+"#"+t+"Ref not yet drawn"):new Error(f(e)+"#"+t+"Ref not specified")},o.prototype._getSource=function(e){return this._getEnd(e,"source")},o.prototype._getTarget=function(e){return this._getEnd(e,"target")},o.prototype._getElement=function(e){return this._elementRegistry.get(e.id)}},{10:10,12:12,13:13,175:175,87:87}],8:[function(e,t,n){"use strict";function r(e,t){return e.$instanceOf(t)}function i(e){return s(e.rootElements,function(e){return r(e,"bpmn:Process")||r(e,"bpmn:Collaboration")})}function o(e){function t(e,t){return function(n){e(n,t)}}function n(t,n){var r=t.gfx;if(r)throw new Error("already rendered "+l(t));return e.element(t,n)}function o(t,n){return e.root(t,n)}function s(e,t){try{return e.di&&n(e,t)}catch(r){u(r.message,{element:e,error:r}),console.error("failed to import "+l(e)),console.error(r)}}function u(t,n){e.error(t,n)}function f(e){var t=e.bpmnElement;t?t.di?u("multiple DI elements defined for "+l(t),{element:t}):(p.bind(t,"di"),t.di=e):u("no bpmnElement referenced in "+l(e),{element:e})}function h(e){d(e.plane)}function d(e){f(e),c(e.planeElement,m)}function m(e){f(e)}function y(e,t){var n=e.diagrams;if(t&&-1===n.indexOf(t))throw new Error("diagram not part of bpmn:Definitions");if(!t&&n&&n.length&&(t=n[0]),t){h(t);var a=t.plane;if(!a)throw new Error("no plane for "+l(t));var s=a.bpmnElement;if(!s){if(s=i(e),!s)return u("no process or collaboration present to display");u("correcting missing bpmnElement on "+l(a)+" to "+l(s)),a.bpmnElement=s,f(a)}var c=o(s,a);if(r(s,"bpmn:Process"))v(s,c);else{if(!r(s,"bpmn:Collaboration"))throw new Error("unsupported bpmnElement for "+l(a)+" : "+l(s));V(s,c),x(e.rootElements,c)}g(U)}}function g(e){c(e,function(e){e()})}function v(e,t){I(e,t),C(e.ioSpecification,t),T(e.artifacts,t),G.push(e)}function x(e){var n=a(e,function(e){return r(e,"bpmn:Process")&&e.laneSets&&-1===G.indexOf(e)});n.forEach(t(v))}function b(e,t){s(e,t)}function E(e,n){c(e,t(b,n))}function w(e,t){s(e,t)}function A(e,t){s(e,t)}function _(e,t){s(e,t)}function S(e,t){s(e,t)}function T(e,t){c(e,function(e){r(e,"bpmn:Association")?U.push(function(){S(e,t)}):S(e,t)})}function C(e,n){e&&(c(e.dataInputs,t(A,n)),c(e.dataOutputs,t(_,n)))}function R(e,t){I(e,t),T(e.artifacts,t)}function N(e,t){var n=s(e,t);r(e,"bpmn:SubProcess")&&R(e,n||t)}function M(e,t){s(e,t)}function D(e,t){s(e,t)}function P(e,t){s(e,t)}function k(e,t){var n=s(e,t);if(e.childLaneSet)O(e.childLaneSet,n||t);else{var r=a(e.flowNodeRef,function(e){return"bpmn:BoundaryEvent"!==e.$type});F(r,n||t)}}function O(e,n){c(e.lanes,t(k,n))}function B(e,n){c(e,t(O,n))}function I(e,t){e.laneSets?(B(e.laneSets,t),L(e.flowElements)):F(e.flowElements,t)}function L(e,t){c(e,function(e){r(e,"bpmn:SequenceFlow")?U.push(function(){M(e,t)}):r(e,"bpmn:BoundaryEvent")?U.unshift(function(){P(e,t)}):r(e,"bpmn:DataObject")||(r(e,"bpmn:DataStoreReference")?D(e,t):r(e,"bpmn:DataObjectReference")&&D(e,t))})}function F(e,n){c(e,function(e){r(e,"bpmn:SequenceFlow")?U.push(function(){M(e,n)}):r(e,"bpmn:BoundaryEvent")?U.unshift(function(){P(e,n)}):r(e,"bpmn:FlowNode")?(N(e,n),r(e,"bpmn:Activity")&&(C(e.ioSpecification,n),U.push(function(){c(e.dataInputAssociations,t(w,n)),c(e.dataOutputAssociations,t(w,n))}))):r(e,"bpmn:DataObject")||(r(e,"bpmn:DataStoreReference")?D(e,n):r(e,"bpmn:DataObjectReference")?D(e,n):u("unrecognized flowElement "+l(e)+" in context "+(n?l(n.businessObject):null),{element:e,context:n}))})}function j(e,t){var n=s(e,t),r=e.processRef;r&&v(r,n||t)}function V(e){c(e.participants,t(j)),T(e.artifacts),U.push(function(){E(e.messageFlows)})}var G=[],U=[];return{handleDefinitions:y}}var a=e(82),s=e(83),c=e(84),u=e(202),l=e(10).elementToString,p=new u({name:"bpmnElement",enumerable:!0},{name:"di"});t.exports=o},{10:10,202:202,82:82,83:83,84:84}],9:[function(e,t,n){"use strict";function r(e,t,n){function r(e){var t={root:function(e){return a.add(e)},element:function(e,t){return a.add(e,t)},error:function(e,t){c.push({message:e,context:t})}},n=new i(t);n.handleDefinitions(e)}var o,a=e.get("bpmnImporter"),s=e.get("eventBus"),c=[];s.fire("import.start");try{r(t)}catch(u){o=u}s.fire(o?"import.error":"import.success",{error:o,warnings:c}),n(o,c)}var i=e(8);t.exports.importBpmnDiagram=r},{8:8}],10:[function(e,t,n){"use strict";t.exports.elementToString=function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},{}],11:[function(e,t,n){t.exports={bpmnImporter:["type",e(7)]}},{7:7}],12:[function(e,t,n){"use strict";var r=e(14).is,i=e(14).getBusinessObject;t.exports.isExpanded=function(e){return r(e,"bpmn:CallActivity")?!1:r(e,"bpmn:SubProcess")?i(e).di.isExpanded:r(e,"bpmn:Participant")?!!i(e).processRef:!0}},{14:14}],13:[function(e,t,n){"use strict";var r=e(175),i=t.exports.DEFAULT_LABEL_SIZE={width:90,height:20};t.exports.hasExternalLabel=function(e){return e.$instanceOf("bpmn:Event")||e.$instanceOf("bpmn:Gateway")||e.$instanceOf("bpmn:DataStoreReference")||e.$instanceOf("bpmn:DataObjectReference")||e.$instanceOf("bpmn:SequenceFlow")||e.$instanceOf("bpmn:MessageFlow")};var o=t.exports.getWaypointsMid=function(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}},a=t.exports.getExternalLabelMid=function(e){return e.waypoints?o(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+i.height/2}};t.exports.getExternalLabelBounds=function(e,t){var n,o,s,c=e.di,u=c.label;return u&&u.bounds?(s=u.bounds,o={width:Math.max(i.width,s.width),height:s.height},n={x:s.x+s.width/2,y:s.y+s.height/2}):(n=a(t),o=i),r({x:n.x-o.width/2,y:n.y-o.height/2},o)}},{175:175}],14:[function(e,t,n){"use strict";function r(e,t){var n=i(e);return n&&n.$instanceOf(t)}function i(e){return e&&e.businessObject||e}t.exports.is=r,t.exports.getBusinessObject=i},{}],15:[function(e,t,n){t.exports=e(17)},{17:17}],16:[function(e,t,n){"use strict";function r(e,t){s.call(this,e,t)}var i=e(172),o=e(167),a=e(175),s=e(23),c=e(19),u=e(20);r.prototype=Object.create(s.prototype),t.exports=r,r.prototype.fromXML=function(e,t,n,r){i(t)||(r=n,n=t,t="bpmn:Definitions"),o(n)&&(r=n,n={});var s=new c(a({model:this,lax:!0},n)),u=s.handler(t);s.fromXML(e,u,r)},r.prototype.toXML=function(e,t,n){o(t)&&(n=t,t={});var r=new u(t);try{var i=r.toXML(e);n(null,i)}catch(a){n(a)}}},{167:167,172:172,175:175,19:19,20:20,23:23}],17:[function(e,t,n){"use strict";var r=e(175),i=e(16),o={bpmn:e(32),bpmndi:e(33),dc:e(34),di:e(35)};t.exports=function(e,t){return new i(r({},o,e),t)}},{16:16,175:175,32:32,33:33,34:34,35:35}],18:[function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){return e.charAt(0).toLowerCase()+e.slice(1)}function o(e){return e.xml&&"lowerCase"===e.xml.tagAlias}t.exports.aliasToName=function(e,t){return o(t)?r(e):e},t.exports.nameToAlias=function(e,t){return o(t)?i(e):e},t.exports.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"},t.exports.XSI_TYPE="xsi:type"},{}],19:[function(e,t,n){"use strict";function r(e){var t=e.attributes;return y(t,function(e,t,n){var r,i;return t.local?(i=_(t.name,t.prefix),r=i.name):r=t.prefix,e[r]=t.value,e},{})}function i(e,t,n){var r,i=_(t.value),o=e.ns[i.prefix||""],a=i.localName,s=o&&n.getPackage(o);s&&(r=s.xml&&s.xml.typePrefix,r&&0===a.indexOf(r)&&(a=a.slice(r.length)),t.value=s.prefix+":"+a)}function o(e,t,n){var r,a;if(r=e.uri||n){var s=t.getPackage(r);a=s?s.prefix:e.prefix,e.prefix=a,e.uri=r}g(e.attributes,function(n){n.uri===M&&"type"===n.local&&i(e,n,t),o(n,t,null)})}function a(e){x(this,e);var t=this.elementsById={},n=this.references=[],r=this.warnings=[];this.addReference=function(e){n.push(e)},this.addElement=function(e,n){if(!e||!n)throw new Error("[xml-reader] id or ctx must not be null");t[e]=n},this.addWarning=function(e){r.push(e)}}function s(){}function c(){}function u(){}function l(e,t){this.property=e,this.context=t}function p(e,t){this.element=t,this.propertyDesc=e}function f(){}function h(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function d(e,t,n){this.model=e,this.context=n}function m(e){e instanceof A&&(e={model:e}),x(this,{lax:!1},e)}var y=e(88),g=e(84),v=e(83),x=e(175),b=e(92),E=e(22),w=e(21).parser,A=e(23),_=e(28).parseName,S=e(31),T=S.coerceType,C=S.isSimple,R=e(18),N=R.XSI_TYPE,M=R.DEFAULT_NS_MAP.xsi,D=R.aliasToName;s.prototype.handleEnd=function(){},s.prototype.handleText=function(){},s.prototype.handleNode=function(){},c.prototype=new s,c.prototype.handleNode=function(){return this},u.prototype=new s,u.prototype.handleText=function(e){this.body=(this.body||"")+e},l.prototype=new u,l.prototype.handleNode=function(e){if(this.element)throw new Error("expected no sub nodes");return this.element=this.createReference(e),this},l.prototype.handleEnd=function(){this.element.id=this.body},l.prototype.createReference=function(){return{property:this.property.ns.name,id:""}},p.prototype=new u,p.prototype.handleEnd=function(){var e=this.body,t=this.element,n=this.propertyDesc;e=T(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},f.prototype=Object.create(u.prototype),f.prototype.handleNode=function(e){var t,n=this,r=this.element;return r?n=this.handleChild(e):(r=this.element=this.createElement(e),t=r.id,t&&this.context.addElement(t,r)),n},h.prototype=new f,h.prototype.addReference=function(e){this.context.addReference(e)},h.prototype.handleEnd=function(){var e=this.body,t=this.element,n=t.$descriptor,r=n.bodyProperty;r&&void 0!==e&&(e=T(r.type,e),t.set(r.name,e))},h.prototype.createElement=function(e){var t=r(e),n=this.type,i=n.$descriptor,o=this.context,a=new n({});return g(t,function(e,t){var n=i.propertiesByName[t];n&&n.isReference?o.addReference({element:a,property:n.ns.name,id:e}):(n&&(e=T(n.type,e)),a.set(t,e))}),a},h.prototype.getPropertyForNode=function(e){var t,n,r,i=_(e.local,e.prefix),o=this.type,a=this.model,s=o.$descriptor,c=i.name,u=s.propertiesByName[c];if(u)return u.serialize===N&&(r=e.attributes[N])?(t=r.value,n=a.getType(t),x({},u,{effectiveType:n.$descriptor.name})):u;var l=a.getPackage(i.prefix);if(l){if(t=i.prefix+":"+D(i.localName,s.$pkg),n=a.getType(t),u=v(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return x({},u,{effectiveType:n.$descriptor.name})}else if(u=v(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw new Error("unrecognized element <"+i.name+">")},h.prototype.toString=function(){return"ElementDescriptor["+this.type.$descriptor.name+"]"},h.prototype.valueHandler=function(e,t){return new p(e,t)},h.prototype.referenceHandler=function(e){return new l(e,this.context)},h.prototype.handler=function(e){return"Element"===e?new d(this.model,e,this.context):new h(this.model,e,this.context)},h.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,C(n))return this.valueHandler(t,r);i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e);var o=i.element;return void 0!==o&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(x(o,{element:r}),this.context.addReference(o)):o.$parent=r),i},d.prototype=Object.create(f.prototype),d.prototype.createElement=function(e){var t=e.name,n=e.prefix,r=e.ns[n],i=e.attributes;return this.model.createAny(t,r,i)},d.prototype.handleChild=function(e){var t,n=new d(this.model,"Element",this.context).handleNode(e),r=this.element,i=n.element;return void 0!==i&&(t=r.$children=r.$children||[],t.push(i),i.$parent=r),n},d.prototype.handleText=function(e){this.body=this.body||""+e},d.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},m.prototype.fromXML=function(e,t,n){function r(){var e,t,n=f.elementsById,r=f.references;for(e=0;t=r[e];e++){var i=t.element,o=n[t.id],a=i.$descriptor.propertiesByName[t.property];if(o||f.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var s=i.get(a.name),c=s.indexOf(t);o?s[c]=o:s.splice(c,1)}else i.set(a.name,o)}}function i(e){d.pop().handleEnd()}function s(e){var t=d.peek();o(e,l);try{d.push(t.handleNode(e))}catch(n){var r=this.line,i=this.column,a="unparsable content <"+e.name+"> detected\n line: "+r+"\n column: "+i+"\n nested error: "+n.message;if(!p)throw console.error("could not parse document"),console.error(n),new Error(a);f.addWarning({message:a,error:n}),console.warn("could not parse node"),console.warn(n),d.push(new c)}}function u(e){d.peek().handleText(e)}var l=this.model,p=this.lax,f=new a({parseRoot:t}),h=new w(!0,{xmlns:!0,trim:!0}),d=new E;t.context=f,d.push(t),h.onopentag=s,h.oncdata=h.ontext=u,h.onclosetag=i,h.onend=r,b(function(){var r;try{h.write(e).close()}catch(i){r=i}n(r,r?void 0:t.element,f)})},m.prototype.handler=function(e){return new h(this.model,e)},t.exports=m,t.exports.ElementHandler=h},{175:175,18:18,21:21,22:22,23:23,28:28,31:31,83:83,84:84,88:88,92:92}],20:[function(e,t,n){"use strict";function r(e){return b(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function i(e,t){return t.isGeneric?t.name:w({localName:T(t.ns.localName,t.$pkg)},e)}function o(e,t){return w({localName:t.ns.localName},e)}function a(e){var t=e.$descriptor;return E(t.properties,function(t){var n=t.name;if(!e.hasOwnProperty(n))return!1;var r=e[n];return r===t["default"]?!1:t.isMany?r.length:!0})}function s(e){return e=b(e)?e:""+e,e.replace(R,function(e){return"&#"+D[e]+";"})}function c(e){return E(e,function(e){return e.isAttr})}function u(e){return E(e,function(e){return!e.isAttr})}function l(e,t){this.ns=t}function p(){}function f(e){this.ns=e}function h(e,t){this.body=[],this.attrs=[],this.parent=e,this.ns=t}function d(e,t){h.call(this,e,t)}function m(){this.value="",this.write=function(e){this.value+=e}}function y(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function g(e){function t(t,n){var r=n||new m,i=new y(r,e.format);return e.preamble&&i.append(C),(new h).build(t).serializeTo(i),n?void 0:r.value}return e=w({format:!1,preamble:!0},e||{}),{toXML:t}}var v=e(87),x=e(84),b=e(172),E=e(82),w=e(175),A=e(31),_=e(28).parseName,S=e(18),T=S.nameToAlias,C='<?xml version="1.0" encoding="UTF-8"?>\n',R=/(<|>|'|"|&|\n\r|\n)/g,N=S.DEFAULT_NS_MAP,M=S.XSI_TYPE,D={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};l.prototype.build=function(e){return this.element=e,this},l.prototype.serializeTo=function(e){e.appendIndent().append("<"+r(this.ns)+">"+this.element.id+"</"+r(this.ns)+">").appendNewLine()},p.prototype.serializeValue=p.prototype.serializeTo=function(e){var t=this.escape;t&&e.append("<![CDATA["),e.append(this.value),t&&e.append("]]>")},p.prototype.build=function(e,t){return this.value=t,"String"===e.type&&R.test(t)&&(this.escape=!0),this},f.prototype=new p,f.prototype.serializeTo=function(e){e.appendIndent().append("<"+r(this.ns)+">"),this.serializeValue(e),e.append("</"+r(this.ns)+">").appendNewLine()},h.prototype.build=function(e){this.element=e;var t=this.parseNsAttributes(e);if(this.ns||(this.ns=this.nsTagName(e.$descriptor)),e.$descriptor.isGeneric)this.parseGeneric(e);else{var n=a(e);this.parseAttributes(c(n)),this.parseContainments(u(n)),this.parseGenericAttributes(e,t)}return this},h.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return i(t,e)},h.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return o(t,e)},h.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},h.prototype.nsAttributeName=function(e){var t;b(e)?t=_(e):e.ns&&(t=e.ns);var n=this.logNamespaceUsed(t);return this.isLocalNs(n)?{localName:t.localName}:w({localName:t.localName},n)},h.prototype.parseGeneric=function(e){var t=this,n=this.body,r=this.attrs;x(e,function(e,i){"$body"===i?n.push((new p).build({type:"String"},e)):"$children"===i?x(e,function(e){n.push(new h(t).build(e))}):0!==i.indexOf("$")&&r.push({name:i,value:s(e)})})},h.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return x(n,function(e,n){var i=_(n);"xmlns"===i.prefix?t.logNamespace({prefix:i.localName,uri:e}):i.prefix||"xmlns"!==i.localName?r.push({name:n,value:e}):t.logNamespace({uri:e})}),r},h.prototype.parseGenericAttributes=function(e,t){var n=this;x(t,function(t){if(t.name!==M)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(r){console.warn("[writer] missing namespace information for ",t.name,"=",t.value,"on",e,r)}})},h.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;x(e,function(e){var i=r.get(e.name),o=e.isReference,a=e.isMany,s=t.nsPropertyTagName(e);if(a||(i=[i]),e.isBody)n.push((new p).build(e,i[0]));else if(A.isSimple(e.type))x(i,function(t){n.push(new f(s).build(e,t))});else if(o)x(i,function(e){n.push(new l(t,s).build(e))});else{var c=e.serialize===M;x(i,function(e){var r;r=c?new d(t,s):new h(t),n.push(r.build(e))})}})},h.prototype.getNamespaces=function(){return this.parent?this.namespaces=this.parent.getNamespaces():this.namespaces||(this.namespaces={prefixMap:{},uriMap:{},used:{}}),this.namespaces},h.prototype.logNamespace=function(e){var t=this.getNamespaces(),n=t.uriMap[e.uri];return n||(t.uriMap[e.uri]=e),t.prefixMap[e.prefix]=e.uri,e},h.prototype.logNamespaceUsed=function(e){var t=this.element,n=t.$model,r=this.getNamespaces(),i=e.prefix,o=e.uri||N[i]||r.prefixMap[i]||(n?(n.getPackage(i)||{}).uri:null);if(!o)throw new Error("no namespace uri given for prefix <"+e.prefix+">");return e=r.uriMap[o],e||(e=this.logNamespace({prefix:i,uri:o})),r.used[e.uri]||(r.used[e.uri]=e),e},h.prototype.parseAttributes=function(e){var t=this,n=this.element;x(e,function(e){t.logNamespaceUsed(e.ns);var r=n.get(e.name);e.isReference&&(r=r.id),t.addAttribute(t.nsAttributeName(e),r)})},h.prototype.addAttribute=function(e,t){var n=this.attrs;b(t)&&(t=s(t)),n.push({name:e,value:t})},h.prototype.serializeAttributes=function(e){function t(){return v(o.used,function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}})}var n=this.attrs,i=!this.parent,o=this.namespaces;i&&(n=t().concat(n)),x(n,function(t){e.append(" ").append(r(t.name)).append('="').append(t.value).append('"')})},h.prototype.serializeTo=function(e){var t=this.body.length,n=!(1===this.body.length&&this.body[0]instanceof p);e.appendIndent().append("<"+r(this.ns)),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),x(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+r(this.ns)+">")),e.appendNewLine()},d.prototype=new h,d.prototype.build=function(e){var t=e.$descriptor;this.element=e,this.typeNs=this.nsTagName(t);var n=this.typeNs,r=e.$model.getPackage(n.uri),i=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(M),(n.prefix?n.prefix+":":"")+i+t.ns.localName),h.prototype.build.call(this,e)},d.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri},t.exports=g},{172:172,175:175,18:18,28:28,31:31,82:82,84:84,87:87}],21:[function(e,t,n){(function(t){!function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);var i=this;o(i),i.q=i.c="",i.bufferCheckPosition=n.MAX_BUFFER_LENGTH,i.opt=t||{},i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags,i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase",i.tags=[],i.closed=i.closedRoot=i.sawRoot=!1,i.tag=i.error=null,i.strict=!!e,i.noscript=!(!e&&!i.opt.noscript),i.state=z.BEGIN,i.ENTITIES=Object.create(n.ENTITIES),i.attribList=[],i.opt.xmlns&&(i.ns=Object.create(G)),i.trackPosition=i.opt.position!==!1,i.trackPosition&&(i.position=i.line=i.column=0),h(i,"onready")}function i(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,i=0,o=C.length;o>i;i++){var a=e[C[i]].length;if(a>t)switch(C[i]){case"textNode":m(e);break;case"cdata":d(e,"oncdata",e.cdata),e.cdata="";break;case"script":d(e,"onscript",e.script),e.script="";break;default:g(e,"Max buffer length exceeded: "+C[i])}r=Math.max(r,a)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}function o(e){for(var t=0,n=C.length;n>t;t++)e[C[t]]=""}function a(e){m(e),""!==e.cdata&&(d(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(d(e,"onscript",e.script),e.script="")}function s(e,t){return new c(e,t)}function c(e,t){if(!(this instanceof c))return new c(e,t);R.apply(this),this._parser=new r(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,M.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){return t?void n.on(e,t):(n.removeAllListeners(e),n._parser["on"+e]=t)},enumerable:!0,configurable:!1})})}function u(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function l(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function p(e,t){return l(e)?!!t.match(e):e[t]}function f(e,t){return!p(e,t)}function h(e,t,n){e[t]&&e[t](n)}function d(e,t,n){e.textNode&&m(e),h(e,t,n)}function m(e){e.textNode=y(e.opt,e.textNode),e.textNode&&h(e,"ontext",e.textNode),e.textNode=""}function y(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function g(e,t){return m(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,h(e,"onerror",t),e}function v(e){return e.closedRoot||x(e,"Unclosed root tag"),e.state!==z.BEGIN&&e.state!==z.TEXT&&g(e,"Unexpected end"),m(e),e.c="",e.closed=!0,h(e,"onend"),r.call(e,e.strict,e.opt),e}function x(e,t){if("object"!=typeof e||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&g(e,t)}function b(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0}function E(e,t){var n=e.indexOf(":"),r=0>n?["",e]:e.split(":"),i=r[0],o=r[1];return t&&"xmlns"===e&&(i="xmlns",o=""),{prefix:i,local:o}}function w(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))return e.attribName=e.attribValue="";if(e.opt.xmlns){var t=E(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==j)x(e,"xml: prefix must be bound to "+j+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==V)x(e,"xmlns: prefix must be bound to "+V+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,d(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}function A(e,t){if(e.opt.xmlns){var n=e.tag,r=E(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(x(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(t){d(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var o=0,a=e.attribList.length;a>o;o++){var s=e.attribList[o],c=s[0],u=s[1],l=E(c,!0),p=l.prefix,f=l.local,h=""==p?"":n.ns[p]||"",m={name:c,value:u,prefix:p,local:f,uri:h};p&&"xmlns"!=p&&!h&&(x(e,"Unbound namespace prefix: "+JSON.stringify(p)),m.uri=p),e.tag.attributes[c]=m,d(e,"onattribute",m)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),d(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=z.TEXT:e.state=z.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function _(e){if(!e.tagName)return x(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=z.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=z.SCRIPT);d(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){var i=e.tags[t];if(i.name===r)break;x(e,"Unexpected close tag")}if(0>t)return x(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=z.TEXT);e.tagName=n;for(var o=e.tags.length;o-->t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,d(e,"onclosetag",e.tagName);var s={};for(var c in a.ns)s[c]=a.ns[c];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==u.ns&&Object.keys(a.ns).forEach(function(t){var n=a.ns[t];d(e,"onclosenamespace",{prefix:t,uri:n})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=z.TEXT}function S(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:(n=r,"#"===n.charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),t=parseInt(n,16),i=t.toString(16)):(n=n.slice(1),t=parseInt(n,10),i=t.toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(x(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function T(e){var t=this;if(this.error)throw this.error;if(t.closed)return g(t,"Cannot write after close. Assign an onready handler.");if(null===e)return v(t);for(var n=0,r="";t.c=r=e.charAt(n++);)switch(t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++),t.state){case z.BEGIN:"<"===r?(t.state=z.OPEN_WAKA,t.startTagPosition=t.position):f(D,r)&&(x(t,"Non-whitespace before first tag."),t.textNode=r,t.state=z.TEXT);continue;case z.TEXT:if(t.sawRoot&&!t.closedRoot){for(var o=n-1;r&&"<"!==r&&"&"!==r;)r=e.charAt(n++),r&&t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++);t.textNode+=e.substring(o,n-1)}"<"===r?(t.state=z.OPEN_WAKA,t.startTagPosition=t.position):(!f(D,r)||t.sawRoot&&!t.closedRoot||x(t,"Text data outside of root node."),"&"===r?t.state=z.TEXT_ENTITY:t.textNode+=r);continue;case z.SCRIPT:"<"===r?t.state=z.SCRIPT_ENDING:t.script+=r;continue;case z.SCRIPT_ENDING:"/"===r?t.state=z.CLOSE_TAG:(t.script+="<"+r,t.state=z.SCRIPT);continue;case z.OPEN_WAKA:if("!"===r)t.state=z.SGML_DECL,t.sgmlDecl="";else if(p(D,r));else if(p(U,r))t.state=z.OPEN_TAG,t.tagName=r;else if("/"===r)t.state=z.CLOSE_TAG,t.tagName="";else if("?"===r)t.state=z.PROC_INST,t.procInstName=t.procInstBody="";else{if(x(t,"Unencoded <"),t.startTagPosition+1<t.position){var a=t.position-t.startTagPosition;r=new Array(a).join(" ")+r}t.textNode+="<"+r,t.state=z.TEXT}continue;case z.SGML_DECL:(t.sgmlDecl+r).toUpperCase()===L?(d(t,"onopencdata"),t.state=z.CDATA,t.sgmlDecl="",t.cdata=""):t.sgmlDecl+r==="--"?(t.state=z.COMMENT,t.comment="",t.sgmlDecl=""):(t.sgmlDecl+r).toUpperCase()===F?(t.state=z.DOCTYPE,(t.doctype||t.sawRoot)&&x(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):">"===r?(d(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=z.TEXT):p(O,r)?(t.state=z.SGML_DECL_QUOTED,t.sgmlDecl+=r):t.sgmlDecl+=r;continue;case z.SGML_DECL_QUOTED:r===t.q&&(t.state=z.SGML_DECL,t.q=""),t.sgmlDecl+=r;continue;case z.DOCTYPE:">"===r?(t.state=z.TEXT,d(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=r,"["===r?t.state=z.DOCTYPE_DTD:p(O,r)&&(t.state=z.DOCTYPE_QUOTED,t.q=r));continue;case z.DOCTYPE_QUOTED:t.doctype+=r,r===t.q&&(t.q="",t.state=z.DOCTYPE);continue;case z.DOCTYPE_DTD:t.doctype+=r,"]"===r?t.state=z.DOCTYPE:p(O,r)&&(t.state=z.DOCTYPE_DTD_QUOTED,t.q=r);continue;case z.DOCTYPE_DTD_QUOTED:t.doctype+=r,r===t.q&&(t.state=z.DOCTYPE_DTD,t.q="");continue;case z.COMMENT:"-"===r?t.state=z.COMMENT_ENDING:t.comment+=r;continue;case z.COMMENT_ENDING:"-"===r?(t.state=z.COMMENT_ENDED,
+t.comment=y(t.opt,t.comment),t.comment&&d(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+r,t.state=z.COMMENT);continue;case z.COMMENT_ENDED:">"!==r?(x(t,"Malformed comment"),t.comment+="--"+r,t.state=z.COMMENT):t.state=z.TEXT;continue;case z.CDATA:"]"===r?t.state=z.CDATA_ENDING:t.cdata+=r;continue;case z.CDATA_ENDING:"]"===r?t.state=z.CDATA_ENDING_2:(t.cdata+="]"+r,t.state=z.CDATA);continue;case z.CDATA_ENDING_2:">"===r?(t.cdata&&d(t,"oncdata",t.cdata),d(t,"onclosecdata"),t.cdata="",t.state=z.TEXT):"]"===r?t.cdata+="]":(t.cdata+="]]"+r,t.state=z.CDATA);continue;case z.PROC_INST:"?"===r?t.state=z.PROC_INST_ENDING:p(D,r)?t.state=z.PROC_INST_BODY:t.procInstName+=r;continue;case z.PROC_INST_BODY:if(!t.procInstBody&&p(D,r))continue;"?"===r?t.state=z.PROC_INST_ENDING:t.procInstBody+=r;continue;case z.PROC_INST_ENDING:">"===r?(d(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=z.TEXT):(t.procInstBody+="?"+r,t.state=z.PROC_INST_BODY);continue;case z.OPEN_TAG:p(W,r)?t.tagName+=r:(b(t),">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:(f(D,r)&&x(t,"Invalid character in tag name"),t.state=z.ATTRIB));continue;case z.OPEN_TAG_SLASH:">"===r?(A(t,!0),_(t)):(x(t,"Forward-slash in opening tag not followed by >"),t.state=z.ATTRIB);continue;case z.ATTRIB:if(p(D,r))continue;">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:p(U,r)?(t.attribName=r,t.attribValue="",t.state=z.ATTRIB_NAME):x(t,"Invalid attribute name");continue;case z.ATTRIB_NAME:"="===r?t.state=z.ATTRIB_VALUE:">"===r?(x(t,"Attribute without value"),t.attribValue=t.attribName,w(t),A(t)):p(D,r)?t.state=z.ATTRIB_NAME_SAW_WHITE:p(W,r)?t.attribName+=r:x(t,"Invalid attribute name");continue;case z.ATTRIB_NAME_SAW_WHITE:if("="===r)t.state=z.ATTRIB_VALUE;else{if(p(D,r))continue;x(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",d(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===r?A(t):p(U,r)?(t.attribName=r,t.state=z.ATTRIB_NAME):(x(t,"Invalid attribute name"),t.state=z.ATTRIB)}continue;case z.ATTRIB_VALUE:if(p(D,r))continue;p(O,r)?(t.q=r,t.state=z.ATTRIB_VALUE_QUOTED):(x(t,"Unquoted attribute value"),t.state=z.ATTRIB_VALUE_UNQUOTED,t.attribValue=r);continue;case z.ATTRIB_VALUE_QUOTED:if(r!==t.q){"&"===r?t.state=z.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=r;continue}w(t),t.q="",t.state=z.ATTRIB_VALUE_CLOSED;continue;case z.ATTRIB_VALUE_CLOSED:p(D,r)?t.state=z.ATTRIB:">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:p(U,r)?(x(t,"No whitespace between attributes"),t.attribName=r,t.attribValue="",t.state=z.ATTRIB_NAME):x(t,"Invalid attribute name");continue;case z.ATTRIB_VALUE_UNQUOTED:if(f(I,r)){"&"===r?t.state=z.ATTRIB_VALUE_ENTITY_U:t.attribValue+=r;continue}w(t),">"===r?A(t):t.state=z.ATTRIB;continue;case z.CLOSE_TAG:if(t.tagName)">"===r?_(t):p(W,r)?t.tagName+=r:t.script?(t.script+="</"+t.tagName,t.tagName="",t.state=z.SCRIPT):(f(D,r)&&x(t,"Invalid tagname in closing tag"),t.state=z.CLOSE_TAG_SAW_WHITE);else{if(p(D,r))continue;f(U,r)?t.script?(t.script+="</"+r,t.state=z.SCRIPT):x(t,"Invalid tagname in closing tag."):t.tagName=r}continue;case z.CLOSE_TAG_SAW_WHITE:if(p(D,r))continue;">"===r?_(t):x(t,"Invalid characters in closing tag");continue;case z.TEXT_ENTITY:case z.ATTRIB_VALUE_ENTITY_Q:case z.ATTRIB_VALUE_ENTITY_U:switch(t.state){case z.TEXT_ENTITY:var s=z.TEXT,c="textNode";break;case z.ATTRIB_VALUE_ENTITY_Q:var s=z.ATTRIB_VALUE_QUOTED,c="attribValue";break;case z.ATTRIB_VALUE_ENTITY_U:var s=z.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===r?(t[c]+=S(t),t.entity="",t.state=s):p(B,r)?t.entity+=r:(x(t,"Invalid character entity"),t[c]+="&"+t.entity+r,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&i(t),t}n.parser=function(e,t){return new r(e,t)},n.SAXParser=r,n.SAXStream=c,n.createStream=s,n.MAX_BUFFER_LENGTH=65536;var C=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];n.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){this.__proto__=e}return t.prototype=e,new t}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),r.prototype={end:function(){v(this)},write:T,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};try{var R=e("stream").Stream}catch(N){var R=function(){}}var M=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});c.prototype=Object.create(R.prototype,{constructor:{value:c}}),c.prototype.write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},c.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},c.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===M.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),R.prototype.on.call(n,e,t)};var D="\r\n ",P="0124356789",k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",O="'\"",B=P+k+"#",I=D+">",L="[CDATA[",F="DOCTYPE",j="http://www.w3.org/XML/1998/namespace",V="http://www.w3.org/2000/xmlns/",G={xml:j,xmlns:V};D=u(D),P=u(P),k=u(k);var U=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,W=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;O=u(O),B=u(B),I=u(I);var z=0;n.STATE={BEGIN:z++,TEXT:z++,TEXT_ENTITY:z++,OPEN_WAKA:z++,SGML_DECL:z++,SGML_DECL_QUOTED:z++,DOCTYPE:z++,DOCTYPE_QUOTED:z++,DOCTYPE_DTD:z++,DOCTYPE_DTD_QUOTED:z++,COMMENT_STARTING:z++,COMMENT:z++,COMMENT_ENDING:z++,COMMENT_ENDED:z++,CDATA:z++,CDATA_ENDING:z++,CDATA_ENDING_2:z++,PROC_INST:z++,PROC_INST_BODY:z++,PROC_INST_ENDING:z++,OPEN_TAG:z++,OPEN_TAG_SLASH:z++,ATTRIB:z++,ATTRIB_NAME:z++,ATTRIB_NAME_SAW_WHITE:z++,ATTRIB_VALUE:z++,ATTRIB_VALUE_QUOTED:z++,ATTRIB_VALUE_CLOSED:z++,ATTRIB_VALUE_UNQUOTED:z++,ATTRIB_VALUE_ENTITY_Q:z++,ATTRIB_VALUE_ENTITY_U:z++,CLOSE_TAG:z++,CLOSE_TAG_SAW_WHITE:z++,SCRIPT:z++,SCRIPT_ENDING:z++},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r});for(var z in n.STATE)n.STATE[n.STATE[z]]=z;z=n.STATE,String.fromCodePoint||!function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,i=16384,o=[],a=-1,s=arguments.length;if(!s)return"";for(var c="";++a<s;){var u=Number(arguments[a]);if(!isFinite(u)||0>u||u>1114111||t(u)!=u)throw RangeError("Invalid code point: "+u);65535>=u?o.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,o.push(n,r)),(a+1==s||o.length>i)&&(c+=e.apply(null,o),o.length=0)}return c};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n}()}("undefined"==typeof n?sax={}:n)}).call(this,void 0)},{undefined:void 0}],22:[function(t,n,r){!function(t){"use strict";function i(){this.data=[null],this.top=0}function o(){return new i}i.prototype.clear=function(){return this.data=[null],this.top=0,this},i.prototype.length=function(){return this.top},i.prototype.peek=function(){return this.data[this.top]},i.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},i.prototype.push=function(e){return this.data[++this.top]=e,this},"undefined"!=typeof r?n.exports=o:"function"==typeof e?e(function(){return o}):t.stack=o}(this)},{}],23:[function(e,t,n){t.exports=e(27)},{27:27}],24:[function(e,t,n){"use strict";function r(){}r.prototype.get=function(e){return this.$model.properties.get(this,e)},r.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},t.exports=r},{}],25:[function(e,t,n){"use strict";function r(e){this.ns=e,this.name=e.name,this.allTypes=[],this.properties=[],this.propertiesByName={}}var i=e(180),o=e(175),a=e(84),s=e(28).parseName;t.exports=r,r.prototype.build=function(){return i(this,["ns","name","allTypes","properties","propertiesByName","bodyProperty"])},r.prototype.addProperty=function(e,t){this.addNamedProperty(e,!0);var n=this.properties;void 0!==t?n.splice(t,0,e):n.push(e)},r.prototype.replaceProperty=function(e,t){var n=e.ns,r=this.properties,i=this.propertiesByName,o=e.name!==t.name;if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}this.addNamedProperty(t,o);var a=r.indexOf(e);if(-1===a)throw new Error("property <"+n.name+"> not found in property list");r[a]=t,i[n.name]=i[n.localName]=t},r.prototype.redefineProperty=function(e){var t=e.ns.prefix,n=e.redefines.split("#"),r=s(n[0],t),i=s(n[1],r.prefix).name,o=this.propertiesByName[i];if(!o)throw new Error("refined property <"+i+"> not found");this.replaceProperty(o,e),delete e.redefines},r.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},r.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},r.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},r.prototype.addIdProperty=function(e){var t=s(e,this.ns.prefix),n={name:t.localName,type:"String",isAttr:!0,ns:t};this.addProperty(n,0)},r.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},r.prototype.hasProperty=function(e){return this.propertiesByName[e]},r.prototype.addTrait=function(e){var t=this.allTypes;-1===t.indexOf(e)&&(a(e.properties,function(t){t=o({},t,{name:t.ns.localName}),Object.defineProperty(t,"definedBy",{value:e}),t.redefines?this.redefineProperty(t):(t.isBody&&this.setBodyProperty(t),this.addProperty(t))},this),t.push(e))}},{175:175,180:180,28:28,84:84}],26:[function(e,t,n){"use strict";function r(e,t){this.model=e,this.properties=t}var i=e(84),o=e(24);t.exports=r,r.prototype.createType=function(e){function t(e){r.define(this,"$type",{value:s,enumerable:!0}),r.define(this,"$attrs",{value:{}}),r.define(this,"$parent",{writable:!0}),i(e,function(e,t){this.set(t,e)},this)}var n=this.model,r=this.properties,a=Object.create(o.prototype);i(e.properties,function(e){e.isMany||void 0===e["default"]||(a[e.name]=e["default"])}),r.defineModel(a,n),r.defineDescriptor(a,e);var s=e.ns.name;return t.prototype=a,t.hasType=a.$instanceOf=this.model.hasType,r.defineModel(t,n),r.defineDescriptor(t,e),t}},{24:24,84:84}],27:[function(e,t,n){"use strict";function r(e,t){t=t||{},this.properties=new l(this),this.factory=new c(this,this.properties),this.registry=new u(e,this.properties,t),this.typeCache={}}var i=e(172),o=e(170),a=e(84),s=e(83),c=e(26),u=e(30),l=e(29),p=e(28).parseName;t.exports=r,r.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},r.prototype.getType=function(e){var t=this.typeCache,n=i(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},r.prototype.createAny=function(e,t,n){var r=p(e),i={$type:e},s={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,s),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),a(n,function(e,t){o(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e}),i},r.prototype.getPackage=function(e){return this.registry.getPackage(e)},r.prototype.getPackages=function(){return this.registry.getPackages()},r.prototype.getElementDescriptor=function(e){return e.$descriptor},r.prototype.hasType=function(e,t){void 0===t&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return!!s(n.allTypes,function(e){return e.name===t})},r.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]}},{170:170,172:172,26:26,28:28,29:29,30:30,83:83,84:84}],28:[function(e,t,n){"use strict";t.exports.parseName=function(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return e=(r?r+":":"")+n,{name:e,prefix:r,localName:n}}},{}],29:[function(e,t,n){"use strict";function r(e){this.model=e}t.exports=r,r.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t);r?Object.defineProperty(e,r.name,{enumerable:!r.isReference,writable:!0,value:n}):e.$attrs[t]=n},r.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&Object.defineProperty(e,r,{enumerable:!n.isReference,writable:!0,value:[]}),e[r]},r.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},r.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},r.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})}},{}],30:[function(e,t,n){"use strict";function r(e,t,n){this.options=i({generateId:"id"},n||{}),this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,o(e,this.registerPackage,this)}var i=e(175),o=e(84),a=e(31),s=e(25),c=e(28).parseName,u=a.isBuiltIn;t.exports=r,r.prototype.getPackage=function(e){return this.packageMap[e]},r.prototype.getPackages=function(){return this.packages},r.prototype.registerPackage=function(e){e=i({},e),o(e.types,function(t){this.registerType(t,e)},this),this.packageMap[e.uri]=this.packageMap[e.prefix]=e,this.packages.push(e)},r.prototype.registerType=function(e,t){e=i({},e,{superClass:(e.superClass||[]).slice(),"extends":(e["extends"]||[]).slice(),properties:(e.properties||[]).slice()});var n=c(e.name,t.prefix),r=n.name,a={};o(e.properties,function(e){var t=c(e.name,n.prefix),r=t.name;u(e.type)||(e.type=c(e.type,t.prefix).name),i(e,{ns:t,name:r}),a[r]=e}),i(e,{ns:n,name:r,propertiesByName:a}),o(e["extends"],function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)},this),this.definePackage(e,t),this.typeMap[r]=e},r.prototype.mapTypes=function(e,t){function n(n){var r=c(n,u(n)?"":e.prefix);i.mapTypes(r,t)}var r=u(e.name)?{name:e.name}:this.typeMap[e.name],i=this;if(!r)throw new Error("unknown type <"+e.name+">");o(r.superClass,n),t(r),o(r.traits,n)},r.prototype.getEffectiveDescriptor=function(e){var t=c(e),n=new s(t);this.mapTypes(t,function(e){n.addTrait(e)});var r=this.options.generateId;r&&!n.hasProperty(r)&&n.addIdProperty(r);var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},r.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})}},{175:175,25:25,28:28,31:31,84:84}],31:[function(e,t,n){"use strict";var r={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},i={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};t.exports.coerceType=function(e,t){var n=i[e];return n?n(t):t},t.exports.isBuiltIn=function(e){return!!r[e]},t.exports.isSimple=function(e){return!!i[e]}},{}],32:[function(e,t,n){t.exports={name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"outMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"errorRefs",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"childLaneSet",type:"LaneSet",serialize:"xsi:type"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection","default":"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,"default":"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",serialize:"xsi:type"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String"},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand","default":!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition"}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference","default":!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting","default":!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"inputSet",type:"InputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataInputAssociation",type:"DataInputAssociation",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean","default":!1},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataOutputAssociation",type:"DataOutputAssociation",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity","default":!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean"},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",serialize:"xsi:type"},{name:"timeCycle",type:"Expression",serialize:"xsi:type"},{name:"timeDuration",type:"Expression",serialize:"xsi:type"}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",serialize:"xsi:type"}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"transformation",type:"FormalExpression"},{name:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"inputSetRefs",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"outputSetRefs",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",serialize:"xsi:type"},{name:"to",type:"Expression",serialize:"xsi:type"}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited","default":!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",
+type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!0},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"body",type:"String",isBody:!0},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",type:"String",isAttr:!0},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",serialize:"xsi:type"},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"supportedInterfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum","default":0,isAttr:!0,type:"Integer"},{name:"maximum","default":1,isAttr:!0,type:"Integer"}]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType","default":"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["FlowElementsContainer","Collaboration"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isVirtual:!0,isMany:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCharacteristics",type:"LoopCharacteristics"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity","default":1,isAttr:!0,type:"Integer"},{name:"completionQuantity","default":1,isAttr:!0,type:"Integer"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent","default":!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential","default":!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior","default":"All",isAttr:!0},{name:"loopCardinality",type:"Expression",serialize:"xsi:type"},{name:"loopDataInputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"inputDataItem",type:"DataInput"},{name:"outputDataItem",type:"DataOutput"},{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",serialize:"xsi:type"},{name:"loopMaximum",type:"Expression",serialize:"xsi:type"}]},{name:"CallActivity",superClass:["Activity"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances","default":!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"}]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage","default":"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage","default":"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],emumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}}},{}],33:[function(e,t,n){t.exports={name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,"default":"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],emumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[],prefix:"bpmndi"}},{}],34:[function(e,t,n){t.exports={name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]}},{}],35:[function(e,t,n){t.exports={name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",serialize:"xsi:type"}]},{name:"Diagram",isAbstract:!0,properties:[{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",xml:{tagAlias:"lowerCase"}}},{}],36:[function(e,t,n){t.exports=e(37)},{37:37}],37:[function(e,t,n){"use strict";function r(e){function t(e){return i.indexOf(e)>=0}function n(e){i.push(e)}function r(e){t(e)||((e.__depends__||[]).forEach(r),t(e)||(n(e),(e.__init__||[]).forEach(function(e){o.push(e)})))}var i=[],o=[];e.forEach(r);var s=new a.Injector(i);return o.forEach(function(e){try{s["string"==typeof e?"get":"invoke"](e)}catch(t){throw console.error("Failed to instantiate component"),console.error(t.stack),t}}),s}function i(t){t=t||{};var n={config:["value",t]},i=e(43),o=[n,i].concat(t.modules||[]);return r(o)}function o(e,t){this.injector=t=t||i(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var a=e(76);t.exports=o,o.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")}},{43:43,76:76}],38:[function(e,t,n){"use strict";function r(e,t){return Math.round(e*t)/t}function i(e){return u(e)?e+"px":e}function o(e){e=l({},{width:"100%",height:"100%"},e);var t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),l(n.style,{position:"relative",overflow:"hidden",width:i(e.width),height:i(e.height)}),t.appendChild(n),n}function a(e,t){return e.group().attr({"class":t})}function s(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._init(e||{})}function c(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}var u=e(169),l=e(175),p=e(84),f=e(63),h=e(74),d="base";s.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],t.exports=s,s.prototype._init=function(e){var t=this._eventBus,n=o(e),r=h.createSnapAt("100%","100%",n),i=a(r,"viewport"),s=this;this._container=n,this._svg=r,this._viewport=i,this._layers={},t.on("diagram.init",function(e){t.fire("canvas.init",{svg:r,viewport:i})}),t.on("diagram.destroy",function(){var e=s._container.parentNode;e&&e.removeChild(n),t.fire("canvas.destroy",{svg:s._svg,viewport:s._viewport}),s._svg.remove(),s._svg=s._container=s._layers=s._viewport=null})},s.prototype.getDefaultLayer=function(){return this.getLayer(d)},s.prototype.getLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];return t||(t=this._layers[e]=a(this._viewport,"layer-"+e)),t},s.prototype.getContainer=function(){return this._container},s.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),r=this._elementRegistry._elements[e.id],r&&(p([r.gfx,r.secondaryGfx],function(e){e&&e[n?"addClass":"removeClass"](t)}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},s.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},s.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},s.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return n&&n.hasClass(t)},s.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},s.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot"}),this._rootElement},s.prototype.setRootElement=function(e,t){this._ensureValidId(e);var n=this._rootElement,r=this._elementRegistry,i=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");i.fire("root.remove",{element:n}),i.fire("root.removed",{element:n}),r.remove(n)}var o=this.getDefaultLayer();return i.fire("root.add",{element:e}),r.add(e,o,this._svg),i.fire("root.added",{element:e,gfx:o}),this._rootElement=e,e},s.prototype._ensureValidId=function(e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists")},s.prototype._setParent=function(e,t){f.add(t.children,e),e.parent=t},s.prototype._addElement=function(e,t,n){n=n||this.getRootElement();var r=this._eventBus,i=this._graphicsFactory;this._ensureValidId(t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n);var o=i.create(e,t);return this._elementRegistry.add(t,o),i.update(e,t,o),r.fire(e+".added",{element:t,gfx:o}),t},s.prototype.addShape=function(e,t){return this._addElement("shape",e,t)},s.prototype.addConnection=function(e,t){return this._addElement("connection",e,t)},s.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;return(e=n.get(e.id||e))?(i.fire(t+".remove",{element:e}),r.remove(e),f.remove(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e):void 0},s.prototype.removeShape=function(e){return this._removeElement(e,"shape")},s.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},s.prototype.sendToFront=function(e,t){t!==!1&&(t=!0),t&&e.parent&&this.sendToFront(e.parent),p(e.children,function(e){this.sendToFront(e,!1)},this);var n=this.getGraphics(e),r=n.parent();n.remove().appendTo(r)},s.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},s.prototype._fireViewboxChange=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox(!1)})},s.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,o,a,s=this._viewport,c=this.getSize();return e?(i=Math.min(c.width/e.width,c.height/e.height),n=(new h.Matrix).scale(i).translate(-e.x,-e.y),s.transform(n),this._fireViewboxChange(),e):(t=this.getDefaultLayer().getBBox(!0),n=s.transform().localMatrix,i=r(n.a,1e3),o=r(-n.e||0,1e3),a=r(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/i:0,y:a?a/i:0,width:c.width/i,height:c.height/i,scale:i,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:c})},s.prototype.scroll=function(e){var t=this._viewport.node,n=t.getCTM();return e&&(e=l({dx:0,dy:0},e||{}),n=this._svg.node.createSVGMatrix().translate(e.dx,e.dy).multiply(n),c(t,n),this._fireViewboxChange()),{x:n.e,y:n.f}},s.prototype.zoom=function(e,t){if("fit-viewport"===e)return this._fitViewport(t);var n=this.viewbox();if(void 0===e)return n.scale;var i=n.outer;"auto"===t&&(t={x:i.width/2,y:i.height/2});var o=this._setZoom(e,t);return this._fireViewboxChange(),r(o.a,1e3)},s.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,o=r.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=i.width&&o.y+o.height<=i.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,i.width),height:Math.max(o.height+o.y,i.height)}:(t=Math.min(1,i.width/o.width,i.height/o.height),n={x:o.x+(e?o.width/2-i.width/t/2:0),y:o.y+(e?o.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox().scale},s.prototype._setZoom=function(e,t){var n,r,i,o,a,s=this._svg.node,u=this._viewport.node,p=s.createSVGMatrix(),f=s.createSVGPoint();i=u.getCTM();var h=i.a;return t?(n=l(f,t),r=n.matrixTransform(i.inverse()),o=p.translate(r.x,r.y).scale(1/h*e).translate(-r.x,-r.y),a=i.multiply(o)):a=p.scale(e),c(this._viewport.node,a),a},s.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},s.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();if(e.waypoints){var r=this.getGraphics(e),i=r.getBBox(!0);t=r.getBBox(),t.x-=i.x,t.y-=i.y,t.width+=2*i.x,t.height+=2*i.y}else t=e;var o=t.x*n.scale-n.x*n.scale,a=t.y*n.scale-n.y*n.scale,s=t.width*n.scale,c=t.height*n.scale;return{x:o,y:a,width:s,height:c}}},{169:169,175:175,63:63,74:74,84:84}],39:[function(e,t,n){"use strict";function r(){this._uid=12}var i=e(57);t.exports=r,r.prototype.createRoot=function(e){return this.create("root",e)},r.prototype.createLabel=function(e){return this.create("label",e)},r.prototype.createShape=function(e){return this.create("shape",e)},r.prototype.createConnection=function(e){return this.create("connection",e)},r.prototype.create=function(e,t){return t=t||{},t.id||(t.id=e+"_"+this._uid++),i.create(e,t)}},{57:57}],40:[function(e,t,n){"use strict";function r(){this._elements={}}var i="data-element-id";t.exports=r,r.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),t.attr(i,r),n&&n.attr(i,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},r.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(r.gfx.attr(i,null),r.secondaryGfx&&r.secondaryGfx.attr(i,null),delete t[n])},r.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e));var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},r.prototype.get=function(e){var t;t="string"==typeof e?e:e&&e.attr(i);var n=this._elements[t];return n&&n.element},r.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},r.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})},r.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},r.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}},{}],41:[function(e,t,n){"use strict";function r(){this._listeners={};var e=this;this.on("diagram.destroy",1,function(){e._listeners=null})}function i(){}var o=e(167),a=e(166),s=e(169),c=e(175),u=1e3;t.exports=r,r.prototype.on=function(e,t,n){if(e=a(e)?e:[e],o(t)&&(n=t,t=u),!s(t))throw new Error("priority must be a number");var r=this,i={priority:t,callback:n};e.forEach(function(e){r._addListener(e,i)})},r.prototype.once=function(e,t){function n(){t.apply(r,arguments),r.off(e,n)}var r=this;this.on(e,n)},r.prototype.off=function(e,t){var n,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0},r.prototype.fire=function(e,t){var n,r,o,a,s,c,u;if(u=Array.prototype.slice.call(arguments),"object"==typeof e&&(n=e,e=n.type),!e)throw new Error("no event type specified");if(o=this._listeners[e]){t instanceof i?n=t:(n=new i,n.init(t)),u[0]=n,r=n.type;try{for(e!==r&&(n.type=e),a=0;(s=o[a])&&!n.cancelBubble;a++)try{c=n.returnValue=s.callback.apply(null,u),void 0!==c&&n.stopPropagation(),c===!1&&n.preventDefault()}catch(l){if(!this.handleError(l))throw console.error("unhandled error in event listener"),console.error(l.stack),l}}finally{e!==r&&(n.type=r)}return void 0===c&&n.defaultPrevented&&(c=!1),c}},r.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},r.prototype._addListener=function(e,t){var n,r,i=this._getListeners(e);for(r=0;n=i[r];r++)if(n.priority<t.priority)return void i.splice(r,0,t);i.push(t)},r.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},t.exports.Event=i,i.prototype.stopPropagation=function(){this.cancelBubble=!0},i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.init=function(e){c(this,e||{})}},{166:166,167:167,169:169,175:175}],42:[function(e,t,n){"use strict";function r(e,t){this._renderer=e,this._elementRegistry=t}var i=e(84),o=e(88),a=e(67),s=e(188);r.$inject=["renderer","elementRegistry"],t.exports=r,r.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=a.getChildren(n),t||(t=n.parent().group().attr("class","djs-children"))):t=n,t},r.prototype._clear=function(e){var t=a.getVisual(e);return s(t.node),t},r.prototype._createContainer=function(e,t){var n=t.group().attr("class","djs-group"),r=n.group().attr("class","djs-element djs-"+e);return r.group().attr("class","djs-visual"),r},r.prototype.create=function(e,t){var n=this._getChildren(t.parent);return this._createContainer(e,n)},r.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=o(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),i(t,function(e){var t=n._getChildren(e),o=e.children;o&&i(o.slice().reverse(),function(e){var n=r.getGraphics(e);n.parent().prependTo(t)})})},r.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this._renderer.drawShape(r,t),n.translate(t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this._renderer.drawConnection(r,t)}n.attr("display",t.hidden?"none":"block")}},r.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);t.parent().remove()}},{188:188,67:67,84:84,88:88}],43:[function(e,t,n){t.exports={__depends__:[e(46)],__init__:["canvas"],canvas:["type",e(38)],elementRegistry:["type",e(40)],elementFactory:["type",e(39)],eventBus:["type",e(41)],
+graphicsFactory:["type",e(42)]}},{38:38,39:39,40:40,41:41,42:42,46:46}],44:[function(e,t,n){"use strict";function r(e){this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}function i(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function o(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}function a(e,t){return c.create("polyline",{points:o(e)}).attr(t||{})}function s(e,t){return e.attr({points:o(t)})}var c=e(74);t.exports=r,r.$inject=["styles"],r.prototype.drawShape=function(e,t){return e.rect(0,0,t.width||0,t.height||0).attr(this.SHAPE_STYLE)},r.prototype.drawConnection=function(e,t){return a(t.waypoints,this.CONNECTION_STYLE).appendTo(e)},r.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,o=e.height,a=[["M",t,n],["l",r,0],["l",0,o],["l",-r,0],["z"]];return i(a)},r.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,o=[];for(t=0;n=r[t];t++)n=n.original||n,o.push([0===t?"M":"L",n.x,n.y]);return i(o)},t.exports.createLine=a,t.exports.updateLine=s},{74:74}],45:[function(e,t,n){"use strict";function r(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}};this.cls=function(e,t,n){var r=this.style(t,n);return o(r,{"class":e})},this.style=function(t,n){i(t)||n||(n=t,t=[]);var r=a(t,function(t,n){return o(t,e[n]||{})},{});return n?o(r,n):r}}var i=e(166),o=e(175),a=e(88);t.exports=r},{166:166,175:175,88:88}],46:[function(e,t,n){t.exports={renderer:["type",e(44)],styles:["type",e(45)]}},{44:44,45:45}],47:[function(e,t,n){"use strict";function r(e,t,n){function r(n,r){var i,o=r.delegateTarget||r.target,a=o&&new l(o),s=t.get(a);a&&s&&(i=e.fire(n,{element:s,gfx:a,originalEvent:r}),i===!1&&(r.stopPropagation(),r.preventDefault()))}function a(e){var t=y[e];return t||(t=y[e]=function(t){u(t)&&r(e,t)}),t}function p(e,t,n){var r=a(n);r.$delegate=o.bind(e,v,t,r)}function f(e,t,n){o.unbind(e,t,a(n).$delegate)}function h(e){i(g,function(t,n){p(e.node,n,t)})}function d(e){i(g,function(t,n){f(e.node,n,t)})}var m=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15}),y={},g={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup"},v="svg, .djs-element";e.on("canvas.destroy",function(e){d(e.svg)}),e.on("canvas.init",function(e){h(e.svg)}),e.on(["shape.added","connection.added"],function(e){var t,n,r=e.element,i=e.gfx;r.waypoints?(t=s(r.waypoints),n="connection"):(t=l.create("rect",{x:0,y:0,width:r.width,height:r.height}),n="shape"),t.attr(m).appendTo(i.node)}),e.on("shape.changed",function(e){var t=e.element,n=e.gfx,r=n.select(".djs-hit");r.attr({width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,r=n.select(".djs-hit");c(r,t.waypoints)}),this.fire=r,this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=f}var i=e(84),o=e(189),a=e(44),s=a.createLine,c=a.updateLine,u=e(69).isPrimaryButton,l=e(74);r.$inject=["eventBus","elementRegistry","styles"],t.exports=r},{189:189,44:44,69:69,74:74,84:84}],48:[function(e,t,n){t.exports={__init__:["interactionEvents"],interactionEvents:["type",e(47)]}},{47:47}],49:[function(e,t,n){"use strict";function r(e,t,n){function r(e,t){return i.create("rect",u).prependTo(e)}function a(e,t){e.attr({x:-c,y:-c,width:t.width+2*c,height:t.height+2*c})}function s(e,t){var n=o(t);e.attr({x:n.x-c,y:n.y-c,width:n.width+2*c,height:n.height+2*c})}var c=6,u=t.cls("djs-outline",["no-fill"]);e.on(["shape.added","shape.changed"],function(e){var t=e.element,n=e.gfx,i=n.select(".djs-outline");i||(i=r(n,t)),a(i,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=n.select(".djs-outline");i||(i=r(n,t)),s(i,t)})}var i=e(74),o=e(65).getBBox;r.$inject=["eventBus","styles","elementRegistry"],t.exports=r},{65:65,74:74}],50:[function(e,t,n){"use strict";t.exports={__init__:["outline"],outline:["type",e(49)]}},{49:49}],51:[function(e,t,n){"use strict";function r(e){var t=d('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');return e.insertBefore(t,e.firstChild),t}function i(e,t,n){l(e.style,{left:t+"px",top:n+"px"})}function o(e,t){e.style.display=t===!1?"none":""}function a(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=v,this._overlayDefaults={show:{minZoom:.7,maxZoom:5}},this._overlays={},this._overlayContainers={},this._overlayRoot=r(n.getContainer()),this._init(e)}var s=e(166),c=e(172),u=e(170),l=e(175),p=e(84),f=e(82),h=e(91),d=e(190),m=e(187),y=e(193),g=e(65).getBBox,v=new(e(68))("ov");a.$inject=["config.overlays","eventBus","canvas","elementRegistry"],t.exports=a,a.prototype.get=function(e){if(c(e)&&(e={id:e}),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?f(t.overlays,{type:e.type}):t.overlays.slice():[]}return e.type?f(this._overlays,{type:e.type}):e.id?this._overlays[e.id]:null},a.prototype.add=function(e,t,n){if(u(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=l({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},a.prototype.remove=function(e){var t=this.get(e)||[];s(t)||(t=[t]);var n=this;p(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(y(e.html),y(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}})},a.prototype.show=function(){o(this._overlayRoot)},a.prototype.hide=function(){o(this._overlayRoot,!1)},a.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,o=t.y;if(t.waypoints){var a=g(t);r=a.x,o=a.y}i(n,r,o)},a.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,o=t.left,a=t.top;if(void 0!==t.right){var s;s=r.waypoints?g(r).width:r.width,o=-1*t.right+s}if(void 0!==t.bottom){var c;c=r.waypoints?g(r).height:r.height,a=-1*t.bottom+c}i(n,o||0,a||0)},a.prototype._createOverlayContainer=function(e){var t=d('<div class="djs-overlays djs-overlays-'+e.id+'" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),n},a.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._overlayRoot.style.transform=r,this._overlayRoot.style["-ms-transform"]=r},a.prototype._getOverlayContainer=function(e,t){var n=e&&e.id||e,r=this._overlayContainers[n];return r||t||(r=this._overlayContainers[n]=this._createOverlayContainer(e)),r},a.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,o=e.html;o.get&&(o=o.get(0)),c(o)&&(o=d(o)),n=this._getOverlayContainer(i),t=d('<div class="djs-overlay" data-overlay-id="'+r+'" style="position: absolute">'),t.appendChild(o),e.type&&m(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e)},a.prototype._updateOverlayVisibilty=function(e){p(this._overlays,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),o(r,i))})},a.prototype._init=function(e){var t=this._eventBus,n=this,r=function(e){n._updateRoot(e),n._updateOverlayVisibilty(e),n.show()};e&&e.deferUpdate===!1||(r=h(r,300)),t.on("canvas.viewbox.changed",function(e){n.hide(),r(e.viewbox)}),t.on(["shape.remove","connection.remove"],function(e){var t=n.get({element:e.element});p(t,function(e){n.remove(e.id)})}),t.on(["element.changed"],function(e){var t=e.element,r=n._getOverlayContainer(t,!0);r&&(p(r.overlays,function(e){n._updateOverlay(e)}),n._updateOverlayContainer(r))}),t.on("element.marker.update",function(e){var t=n._getOverlayContainer(e.element,!0);t&&m(t.html)[e.add?"add":"remove"](e.marker)})}},{166:166,170:170,172:172,175:175,187:187,190:190,193:193,65:65,68:68,82:82,84:84,91:91}],52:[function(e,t,n){t.exports={__init__:["overlays"],overlays:["type",e(51)]}},{51:51}],53:[function(e,t,n){"use strict";function r(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)})}var i=e(166),o=e(84);r.$inject=["eventBus"],t.exports=r,r.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},r.prototype.get=function(){return this._selectedElements},r.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},r.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();i(e)||(e=e?[e]:[]),t?o(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})}},{166:166,84:84}],54:[function(e,t,n){"use strict";function r(e,t,n){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){t.select(e.context.shapes)}),e.on("element.click",function(e){var r=e.element;r===n.getRootElement()&&(r=null);var o=t.isSelected(r),a=t.get().length>1,s=i(e);return o&&a?s?t.deselect(r):t.select(r):void(o?t.deselect(r):t.select(r,s))})}var i=e(69).hasPrimaryModifier;r.$inject=["eventBus","selection","canvas"],t.exports=r},{69:69}],55:[function(e,t,n){"use strict";function r(e,t,n,r,s){function c(e,n){t.addMarker(e,n)}function u(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){c(e.element,o)}),e.on("element.out",function(e){u(e.element,o)}),e.on("selection.changed",function(e){function t(e){u(e,a)}function n(e){c(e,a)}var r=e.oldSelection,o=e.newSelection;i(r,function(e){-1===o.indexOf(e)&&t(e)}),i(o,function(e){-1===r.indexOf(e)&&n(e)})})}var i=e(84),o="hover",a="selected";r.$inject=["eventBus","canvas","selection","graphicsFactory","styles"],t.exports=r},{84:84}],56:[function(e,t,n){t.exports={__init__:["selectionVisuals","selectionBehavior"],__depends__:[e(48),e(50)],selection:["type",e(53)],selectionVisuals:["type",e(55)],selectionBehavior:["type",e(54)]}},{48:48,50:50,53:53,54:54,55:55}],57:[function(e,t,n){"use strict";function r(){Object.defineProperty(this,"businessObject",{writable:!0}),p.bind(this,"parent"),f.bind(this,"label"),h.bind(this,"outgoing"),d.bind(this,"incoming")}function i(){r.call(this),p.bind(this,"children")}function o(){i.call(this)}function a(){i.call(this),f.bind(this,"labelTarget")}function s(){r.call(this),h.bind(this,"source"),d.bind(this,"target")}var c=e(175),u=e(79),l=e(202),p=new l({name:"children",enumerable:!0,collection:!0},{name:"parent"}),f=new l({name:"label",enumerable:!0},{name:"labelTarget"}),h=new l({name:"outgoing",collection:!0},{name:"source"}),d=new l({name:"incoming",collection:!0},{name:"target"});u(i,r),u(o,i),u(a,i),u(s,r);var m={connection:s,shape:i,label:a,root:o};t.exports.create=function(e,t){var n=m[e];if(!n)throw new Error("unknown type: <"+e+">");return c(new n,t)},t.exports.Base=r,t.exports.Root=o,t.exports.Shape=i,t.exports.Connection=s,t.exports.Label=a},{175:175,202:202,79:79}],58:[function(e,t,n){"use strict";function r(e,t){return{x:e.x-t.x,y:e.y-t.y}}function i(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function o(e,t){function n(e){var n=f.start,o=u.toPoint(e),c=r(o,n);if(!f.dragging&&i(c)>l&&(f.dragging=!0,s.install(),a.set("move")),f.dragging){var p=f.last||f.start;c=r(o,p),t.scroll({dx:c.x,dy:c.y}),f.last=o}e.preventDefault()}function o(e){c.unbind(document,"mousemove",n),c.unbind(document,"mouseup",o),f=null,a.unset(),u.stopEvent(e)}function p(e){e.button||e.ctrlKey||e.shiftKey||e.altKey||(f={start:u.toPoint(e)},c.bind(document,"mousemove",n),c.bind(document,"mouseup",o),u.stopEvent(e))}var f,h=t._container;c.bind(h,"mousedown",p)}var a=e(64),s=e(62),c=e(191),u=e(66),l=15;o.$inject=["eventBus","canvas"],t.exports=o},{191:191,62:62,64:64,66:66}],59:[function(e,t,n){t.exports={__init__:["moveCanvas"],moveCanvas:["type",e(58)]}},{58:58}],60:[function(e,t,n){"use strict";function r(e,t){function n(e){return Math.max(p.min,Math.min(p.max,e))}function r(){t.zoom("fit-viewport")}function c(e,r){var i=t.zoom(),o=Math.pow(1+Math.abs(e),e>0?1:-1);t.zoom(n(i*o),r)}function u(e){t.scroll(e)}function l(e){i.bind(e,"wheel",function(t){t.preventDefault();var n,r=o(t),i=a(t);if(r||i){n=s?0===t.deltaMode?1.25:50:0===t.deltaMode?.025:.5;var l={};i?l.dx=n*(t.deltaX||t.deltaY):l.dy=n*t.deltaY,u(l)}else{n=0===t.deltaMode?.025:.5;var p=e.getBoundingClientRect(),f={x:t.clientX-p.left,y:t.clientY-p.top};c(t.deltaY*n/-5,f)}})}var p={min:.2,max:4};e.on("canvas.init",function(e){l(t._container)}),this.zoom=c,this.reset=r}var i=e(191),o=e(69).hasPrimaryModifier,a=e(69).hasSecondaryModifier,s=e(70).isMac;r.$inject=["eventBus","canvas"],t.exports=r},{191:191,69:69,70:70}],61:[function(e,t,n){t.exports={__init__:["zoomScroll"],zoomScroll:["type",e(60)]}},{60:60}],62:[function(e,t,n){"use strict";function r(e){s(e),i(!1)}function i(e){a[e?"bind":"unbind"](document.body,"click",r,!0)}function o(){return i(!0),function(){i(!1)}}var a=e(191),s=e(66).stopEvent;t.exports.install=o},{191:191,66:66}],63:[function(e,t,n){"use strict";t.exports.remove=function(e,t){if(e&&t){var n=e.indexOf(t);if(-1!==n)return e.splice(n,1),t}},t.exports.add=function(e,t,n){if(e&&t){isNaN(n)&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}},t.exports.indexOf=function(e,t){return e&&t?e.indexOf(t):-1}},{}],64:[function(e,t,n){"use strict";var r=e(187),i=/^djs-cursor-.*$/;t.exports.set=function(e){var t=r(document.body);t.removeMatching(i),e&&t.add("djs-cursor-"+e)},t.exports.unset=function(){this.set(null)}},{187:187}],65:[function(e,t,n){"use strict";function r(e,t,n){var r=!n||-1===e.indexOf(t);return r&&e.push(t),r}function i(e,t,n){n=n||0,d(e,function(e,r){var o=t(e,r,n);p(o)&&o.length&&i(o,t,n+1)})}function o(e,t,n){var o=[],a=[];return i(e,function(e,i,s){r(o,e,t);var c=e.children;return(-1===n||n>s)&&c&&r(a,c,t)?c:void 0}),o}function a(e,t){return o(e,!t,1)}function s(e,t){return o(e,!t,-1)}function c(e){function t(e){r[e.source.id]&&r[e.target.id]&&(r[e.id]=e),o[e.source.id]&&o[e.target.id]&&(c[e.id]=s[e.id]=e),a[e.id]=e}function n(e){return s[e.id]=e,e.waypoints?void(c[e.id]=a[e.id]=e):(o[e.id]=e,d(e.incoming,t),d(e.outgoing,t),e.children)}var r=h(e,function(e){return e.id}),o={},a={},s={},c={};return i(e,n),{allShapes:o,allConnections:a,topLevel:r,enclosedConnections:c,enclosedElements:s}}function u(e,t){t=!!t,p(e)||(e=[e]);var n,r,i,o;return d(e,function(e){var a=e;e.waypoints&&!t&&(a=u(e.waypoints,!0));var s=a.x,c=a.y,l=a.height||0,p=a.width||0;(n>s||void 0===n)&&(n=s),(r>c||void 0===r)&&(r=c),(s+p>i||void 0===i)&&(i=s+p),(c+l>o||void 0===o)&&(o=c+l)}),{x:n,y:r,height:o-r,width:i-n}}function l(e,t){var n={};return d(e,function(e){var r=e;r.waypoints&&(r=u(r)),!f(t.y)&&r.x>t.x&&(n[e.id]=e),!f(t.x)&&r.y>t.y&&(n[e.id]=e),r.x>t.x&&r.y>t.y&&(f(t.width)&&f(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y?n[e.id]=e:f(t.width)&&f(t.height)||(n[e.id]=e))}),n}var p=e(166),f=e(169),h=e(85),d=e(84);t.exports.eachElement=i,t.exports.selfAndDirectChildren=a,t.exports.selfAndAllChildren=s,t.exports.getBBox=u,t.exports.getEnclosedElements=l,t.exports.getClosure=c},{166:166,169:169,84:84,85:85}],66:[function(e,t,n){"use strict";function r(e){return e&&e.preventDefault()}function i(e,t){e&&(e.stopPropagation&&e.stopPropagation(),t&&e.stopImmediatePropagation&&e.stopImmediatePropagation())}function o(e){return e.originalEvent||e.srcEvent}function a(e,t){c(e,t),s(e)}function s(e){r(e),r(o(e))}function c(e,t){i(e,t),i(o(e),t)}function u(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}t.exports.getOriginal=o,t.exports.stopEvent=a,t.exports.preventDefault=s,t.exports.stopPropagation=c,t.exports.toPoint=u},{}],67:[function(e,t,n){"use strict";function r(e){return e.select(".djs-visual")}function i(e){return e.parent().children()[1]}function o(e){return r(e).select("*").getBBox()}t.exports.getVisual=r,t.exports.getChildren=i,t.exports.getBBox=o},{}],68:[function(e,t,n){"use strict";function r(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}t.exports=r,r.prototype.next=function(){return this._prefix+ ++this._counter}},{}],69:[function(e,t,n){"use strict";function r(e){return!(i(e)||e).button}var i=e(66).getOriginal,o=e(70).isMac;t.exports.isPrimaryButton=r,t.exports.isMac=o,t.exports.hasPrimaryModifier=function(e){var t=i(e)||e;return r(e)?o()?t.altKey:t.ctrlKey:!1},t.exports.hasSecondaryModifier=function(e){var t=i(e)||e;return r(e)&&t.shiftKey}},{66:66,70:70}],70:[function(e,t,n){"use strict";t.exports.isMac=function(){return/mac/i.test(navigator.platform)}},{}],71:[function(e,t,n){"use strict";function r(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function i(e){return p(e)?f({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function o(e,t){return t.textContent=e,t.getBBox()}function a(e,t,n){for(var r,i=e.shift(),a=i;;){if(r=o(a,n),r.width=a?r.width:0," "===a||""===a||r.width<Math.round(t)||a.length<4)return s(e,a,i,r);a=u(a,r.width,t)}}function s(e,t,n,r){if(t.length<n.length){var i=e[0]||"",o=n.slice(t.length).trim();i=/-\s*$/.test(o)?o.replace(/-\s*$/,"")+i.replace(/^\s+/,""):o+" "+i,e[0]=i}return{width:r.width,height:r.height,text:t}}function c(e,t){var n,r=e.split(/(\s|-)/g),i=[],o=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+o<t)){"-"===n&&i.pop();break}i.push(n),o+=n.length}return i.join("")}function u(e,t,n){var r=Math.max(e.length*(n/t),1),i=c(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function l(e){this._config=f({},{size:v,padding:g,style:{},align:"center-top"},e||{})}var p=e(170),f=e(175),h=e(84),d=e(88),m=e(178),y=e(74),g=0,v={width:150,height:50};l.prototype.createText=function(e,t,n){for(var o=m({},this._config.size,n.box||{}),s=m({},this._config.style,n.style||{}),c=r(n.align||this._config.align),u=i(void 0!==n.padding?n.padding:this._config.padding),l=t.split(/\r?\n/g),p=[],f=o.width-u.left-u.right,g=e.paper.text(0,0,"").attr(s).node;l.length;)p.push(a(l,f,g));var v,x,b=d(p,function(e,t,n){return e+t.height},0);switch(c.vertical){case"middle":v=(o.height-b)/2-p[0].height/4;break;default:v=u.top}var E=e.text().attr(s);return h(p,function(e){switch(v+=e.height,c.horizontal){case"left":x=u.left;break;case"right":x=f-u.right-e.width;break;default:x=Math.max((f-e.width)/2+u.left,0)}var t=y.create("tspan",{x:x,y:v}).node;t.textContent=e.text,E.append(t)}),g.parentNode.removeChild(g),E},t.exports=l},{170:170,175:175,178:178,74:74,84:84,88:88}],72:[function(t,n,r){!function(t){var r,i,o="0.4.2",a="hasOwnProperty",s=/[\.\/]/,c=/\s*,\s*/,u="*",l=function(e,t){return e-t},p={n:{}},f=function(){for(var e=0,t=this.length;t>e;e++)if("undefined"!=typeof this[e])return this[e]},h=function(){for(var e=this.length;--e;)if("undefined"!=typeof this[e])return this[e]},d=function(e,t){e=String(e);var n,o=i,a=Array.prototype.slice.call(arguments,2),s=d.listeners(e),c=0,u=[],p={},m=[],y=r;m.firstDefined=f,m.lastDefined=h,r=e,i=0;for(var g=0,v=s.length;v>g;g++)"zIndex"in s[g]&&(u.push(s[g].zIndex),s[g].zIndex<0&&(p[s[g].zIndex]=s[g]));for(u.sort(l);u[c]<0;)if(n=p[u[c++]],m.push(n.apply(t,a)),i)return i=o,m;for(g=0;v>g;g++)if(n=s[g],"zIndex"in n)if(n.zIndex==u[c]){if(m.push(n.apply(t,a)),i)break;do if(c++,n=p[u[c]],n&&m.push(n.apply(t,a)),i)break;while(n)}else p[n.zIndex]=n;else if(m.push(n.apply(t,a)),i)break;return i=o,r=y,m};d._events=p,d.listeners=function(e){var t,n,r,i,o,a,c,l,f=e.split(s),h=p,d=[h],m=[];for(i=0,o=f.length;o>i;i++){for(l=[],a=0,c=d.length;c>a;a++)for(h=d[a].n,n=[h[f[i]],h[u]],r=2;r--;)t=n[r],t&&(l.push(t),m=m.concat(t.f||[]));d=l}return m},d.on=function(e,t){if(e=String(e),"function"!=typeof t)return function(){};for(var n=e.split(c),r=0,i=n.length;i>r;r++)!function(e){for(var n,r=e.split(s),i=p,o=0,a=r.length;a>o;o++)i=i.n,i=i.hasOwnProperty(r[o])&&i[r[o]]||(i[r[o]]={n:{}});for(i.f=i.f||[],o=0,a=i.f.length;a>o;o++)if(i.f[o]==t){n=!0;break}!n&&i.f.push(t)}(n[r]);return function(e){+e==+e&&(t.zIndex=+e)}},d.f=function(e){var t=[].slice.call(arguments,1);return function(){d.apply(null,[e,null].concat(t).concat([].slice.call(arguments,0)))}},d.stop=function(){i=1},d.nt=function(e){return e?new RegExp("(?:\\.|\\/|^)"+e+"(?:\\.|\\/|$)").test(r):r},d.nts=function(){return r.split(s)},d.off=d.unbind=function(e,t){if(!e)return void(d._events=p={n:{}});var n=e.split(c);if(n.length>1)for(var r=0,i=n.length;i>r;r++)d.off(n[r],t);else{n=e.split(s);var o,l,f,r,i,h,m,y=[p];for(r=0,i=n.length;i>r;r++)for(h=0;h<y.length;h+=f.length-2){if(f=[h,1],o=y[h].n,n[r]!=u)o[n[r]]&&f.push(o[n[r]]);else for(l in o)o[a](l)&&f.push(o[l]);y.splice.apply(y,f)}for(r=0,i=y.length;i>r;r++)for(o=y[r];o.n;){if(t){if(o.f){for(h=0,m=o.f.length;m>h;h++)if(o.f[h]==t){o.f.splice(h,1);break}!o.f.length&&delete o.f}for(l in o.n)if(o.n[a](l)&&o.n[l].f){var g=o.n[l].f;for(h=0,m=g.length;m>h;h++)if(g[h]==t){g.splice(h,1);break}!g.length&&delete o.n[l].f}}else{delete o.f;for(l in o.n)o.n[a](l)&&o.n[l].f&&delete o.n[l].f}o=o.n}}},d.once=function(e,t){var n=function(){return d.unbind(e,n),t.apply(this,arguments)};return d.on(e,n)},d.version=o,d.toString=function(){return"You are running Eve "+o},"undefined"!=typeof n&&n.exports?n.exports=d:"function"==typeof e&&e.amd?e("eve",[],function(){return d}):t.eve=d}(this)},{}],73:[function(t,n,r){!function(i,o){if("function"==typeof e&&e.amd)e(["eve"],function(e){return o(i,e)});else if("undefined"!=typeof r){var a=t(72);n.exports=o(i,a)}else o(i,i.eve)}(window||this,function(e,t){var n=function(t){var n={},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,16)},i=Array.isArray||function(e){return e instanceof Array||"[object Array]"==Object.prototype.toString.call(e)},o=0,a="M"+(+new Date).toString(36),s=function(){return a+(o++).toString(36)},c=Date.now||function(){return+new Date},u=function(e){var t=this;if(null==e)return t.s;var n=t.s-e;t.b+=t.dur*n,t.B+=t.dur*n,t.s=e},l=function(e){var t=this;return null==e?t.spd:void(t.spd=e)},p=function(e){var t=this;return null==e?t.dur:(t.s=t.s*e/t.dur,void(t.dur=e))},f=function(){var e=this;delete n[e.id],e.update(),t("mina.stop."+e.id,e)},h=function(){var e=this;e.pdif||(delete n[e.id],e.update(),e.pdif=e.get()-e.b)},d=function(){var e=this;e.pdif&&(e.b=e.get()-e.pdif,delete e.pdif,n[e.id]=e)},m=function(){var e,t=this;if(i(t.start)){e=[];for(var n=0,r=t.start.length;r>n;n++)e[n]=+t.start[n]+(t.end[n]-t.start[n])*t.easing(t.s)}else e=+t.start+(t.end-t.start)*t.easing(t.s);t.set(e)},y=function(){var e=0;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i],a=o.get();e++,o.s=(a-o.b)/(o.dur/o.spd),o.s>=1&&(delete n[i],o.s=1,e--,function(e){setTimeout(function(){t("mina.finish."+e.id,e)})}(o)),o.update()}e&&r(y)},g=function(e,t,i,o,a,c,v){var x={id:s(),start:e,end:t,b:i,s:0,dur:o-i,spd:1,get:a,set:c,easing:v||g.linear,status:u,speed:l,duration:p,stop:f,pause:h,resume:d,update:m};n[x.id]=x;var b,E=0;for(b in n)if(n.hasOwnProperty(b)&&(E++,2==E))break;return 1==E&&r(y),x};return g.time=c,g.getById=function(e){return n[e]||null},g.linear=function(e){return e},g.easeout=function(e){return Math.pow(e,1.7)},g.easein=function(e){return Math.pow(e,.48)},g.easeinout=function(e){if(1==e)return 1;if(0==e)return 0;var t=.48-e/1.04,n=Math.sqrt(.1734+t*t),r=n-t,i=Math.pow(Math.abs(r),1/3)*(0>r?-1:1),o=-n-t,a=Math.pow(Math.abs(o),1/3)*(0>o?-1:1),s=i+a+.5;return 3*(1-s)*s*s+s*s*s},g.backin=function(e){if(1==e)return 1;var t=1.70158;return e*e*((t+1)*e-t)},g.backout=function(e){if(0==e)return 0;e-=1;var t=1.70158;return e*e*((t+1)*e+t)+1},g.elastic=function(e){return e==!!e?e:Math.pow(2,-10*e)*Math.sin(2*(e-.075)*Math.PI/.3)+1},g.bounce=function(e){var t,n=7.5625,r=2.75;return 1/r>e?t=n*e*e:2/r>e?(e-=1.5/r,t=n*e*e+.75):2.5/r>e?(e-=2.25/r,t=n*e*e+.9375):(e-=2.625/r,t=n*e*e+.984375),t},e.mina=g,g}("undefined"==typeof t?function(){}:t),r=function(e){function n(e,t){if(e){if(e.tagName)return w(e);if(i(e,"array")&&n.set)return n.set.apply(n,e);if(e instanceof v)return e;if(null==t)return e=A.doc.querySelector(e),w(e)}return e=null==e?"100%":e,t=null==t?"100%":t,new E(e,t)}function r(e,t){if(t){if("#text"==e&&(e=A.doc.createTextNode(t.text||"")),"string"==typeof e&&(e=r(e)),"string"==typeof t)return"xlink:"==t.substring(0,6)?e.getAttributeNS(z,t.substring(6)):"xml:"==t.substring(0,4)?e.getAttributeNS($,t.substring(4)):e.getAttribute(t);for(var n in t)if(t[_](n)){var i=S(t[n]);i?"xlink:"==n.substring(0,6)?e.setAttributeNS(z,n.substring(6),i):"xml:"==n.substring(0,4)?e.setAttributeNS($,n.substring(4),i):e.setAttribute(n,i):e.removeAttribute(n)}}else e=A.doc.createElementNS($,e);return e}function i(e,t){return t=S.prototype.toLowerCase.call(t),"finite"==t?isFinite(e):"array"==t&&(e instanceof Array||Array.isArray&&Array.isArray(e))?!0:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||O.call(e).slice(8,-1).toLowerCase()==t}function o(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[_](n)&&(t[n]=o(e[n]));return t}function a(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function s(e,t,n){function r(){var i=Array.prototype.slice.call(arguments,0),o=i.join("␀"),s=r.cache=r.cache||{},c=r.count=r.count||[];return s[_](o)?(a(c,o),n?n(s[o]):s[o]):(c.length>=1e3&&delete s[c.shift()],c.push(o),s[o]=e.apply(t,i),n?n(s[o]):s[o])}return r}function c(e,t,n,r,i,o){if(null==i){var a=e-n,s=t-r;return a||s?(180+180*R.atan2(-s,-a)/P+360)%360:0}return c(e,t,i,o)-c(n,r,i,o)}function u(e){return e%360*P/180}function l(e){return 180*e/P%360}function p(e){var t=[];return e=e.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(e,n,r){return r=r.split(/\s*,\s*|\s+/),"rotate"==n&&1==r.length&&r.push(0,0),"scale"==n&&(r.length>2?r=r.slice(0,2):2==r.length&&r.push(0,0),1==r.length&&r.push(r[0],0,0)),"skewX"==n?t.push(["m",1,0,R.tan(u(r[0])),1,0,0]):"skewY"==n?t.push(["m",1,R.tan(u(r[0])),0,1,0,0]):t.push([n.charAt(0)].concat(r)),e}),t}function f(e,t){var r=J(e),i=new n.Matrix;if(r)for(var o=0,a=r.length;a>o;o++){var s,c,u,l,p,f=r[o],h=f.length,d=S(f[0]).toLowerCase(),m=f[0]!=d,y=m?i.invert():0;"t"==d&&2==h?i.translate(f[1],0):"t"==d&&3==h?m?(s=y.x(0,0),c=y.y(0,0),u=y.x(f[1],f[2]),l=y.y(f[1],f[2]),i.translate(u-s,l-c)):i.translate(f[1],f[2]):"r"==d?2==h?(p=p||t,i.rotate(f[1],p.x+p.width/2,p.y+p.height/2)):4==h&&(m?(u=y.x(f[2],f[3]),l=y.y(f[2],f[3]),i.rotate(f[1],u,l)):i.rotate(f[1],f[2],f[3])):"s"==d?2==h||3==h?(p=p||t,i.scale(f[1],f[h-1],p.x+p.width/2,p.y+p.height/2)):4==h?m?(u=y.x(f[2],f[3]),l=y.y(f[2],f[3]),i.scale(f[1],f[1],u,l)):i.scale(f[1],f[1],f[2],f[3]):5==h&&(m?(u=y.x(f[3],f[4]),l=y.y(f[3],f[4]),i.scale(f[1],f[2],u,l)):i.scale(f[1],f[2],f[3],f[4])):"m"==d&&7==h&&i.add(f[1],f[2],f[3],f[4],f[5],f[6])}return i}function h(e){var t=e.node.ownerSVGElement&&w(e.node.ownerSVGElement)||e.node.parentNode&&w(e.node.parentNode)||n.select("svg")||n(0,0),r=t.select("defs"),i=null==r?!1:r.node;return i||(i=b("defs",t.node).node),i}function d(e){return e.node.ownerSVGElement&&w(e.node.ownerSVGElement)||n.select("svg")}function m(e,t,n){function i(e){if(null==e)return k;if(e==+e)return e;r(u,{width:e});try{return u.getBBox().width}catch(t){return 0}}function o(e){if(null==e)return k;if(e==+e)return e;r(u,{height:e});try{return u.getBBox().height}catch(t){return 0}}function a(r,i){null==t?c[r]=i(e.attr(r)||0):r==t&&(c=i(null==n?e.attr(r)||0:n))}var s=d(e).node,c={},u=s.querySelector(".svg---mgr");switch(u||(u=r("rect"),r(u,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),s.appendChild(u)),e.type){case"rect":a("rx",i),a("ry",o);case"image":a("width",i),a("height",o);case"text":a("x",i),a("y",o);break;case"circle":a("cx",i),a("cy",o),a("r",i);break;case"ellipse":a("cx",i),a("cy",o),a("rx",i),a("ry",o);break;case"line":a("x1",i),a("x2",i),a("y1",o),a("y2",o);break;case"marker":a("refX",i),a("markerWidth",i),a("refY",o),a("markerHeight",o);break;case"radialGradient":a("fx",i),a("fy",o);break;case"tspan":a("dx",i),a("dy",o);break;default:a(t,i)}return s.removeChild(u),c}function y(e){i(e,"array")||(e=Array.prototype.slice.call(arguments,0));for(var t=0,n=0,r=this.node;this[t];)delete this[t++];for(t=0;t<e.length;t++)"set"==e[t].type?e[t].forEach(function(e){r.appendChild(e.node)}):r.appendChild(e[t].node);var o=r.childNodes;for(t=0;t<o.length;t++)this[n++]=w(o[t]);return this}function v(e){if(e.snap in q)return q[e.snap];var t;try{t=e.ownerSVGElement}catch(n){}this.node=e,t&&(this.paper=new E(t)),this.type=e.tagName;var r=this.id=W(this);if(this.anims={},this._={transform:[]},e.snap=r,q[r]=this,"g"==this.type&&(this.add=y),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var i in E.prototype)E.prototype[_](i)&&(this[i]=E.prototype[i])}function x(e){this.node=e}function b(e,t){var n=r(e);t.appendChild(n);var i=w(n);return i}function E(e,t){var n,i,o,a=E.prototype;if(e&&"svg"==e.tagName){if(e.snap in q)return q[e.snap];var s=e.ownerDocument;n=new v(e),i=e.getElementsByTagName("desc")[0],o=e.getElementsByTagName("defs")[0],i||(i=r("desc"),i.appendChild(s.createTextNode("Created with Snap")),n.node.appendChild(i)),o||(o=r("defs"),n.node.appendChild(o)),n.defs=o;for(var c in a)a[_](c)&&(n[c]=a[c]);n.paper=n.root=n}else n=b("svg",A.doc.body),r(n.node,{height:t,version:1.1,width:e,xmlns:$});return n}function w(e){return e?e instanceof v||e instanceof x?e:e.tagName&&"svg"==e.tagName.toLowerCase()?new E(e):e.tagName&&"object"==e.tagName.toLowerCase()&&"image/svg+xml"==e.type?new E(e.contentDocument.getElementsByTagName("svg")[0]):new v(e):e}n.version="0.3.0",n.toString=function(){return"Snap v"+this.version},n._={};var A={win:e.window,doc:e.window.document};n._.glob=A;var _="hasOwnProperty",S=String,T=parseFloat,C=parseInt,R=Math,N=R.max,M=R.min,D=R.abs,P=(R.pow,R.PI),k=(R.round,""),O=Object.prototype.toString,B=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,I=(n._.separator=/[,\s]+/,/[\s]*,[\s]*/),L={hs:1,rg:1},F=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,j=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,V=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,G=0,U="S"+(+new Date).toString(36),W=function(e){return(e&&e.type?e.type:k)+U+(G++).toString(36)},z="http://www.w3.org/1999/xlink",$="http://www.w3.org/2000/svg",q={};n.url=function(e){return"url('#"+e+"')"};n._.$=r,n._.id=W,n.format=function(){var e=/\{([^\}]+)\}/g,t=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(e,n,r){var i=r;return n.replace(t,function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==r?e:i)+""};return function(t,r){return S(t).replace(e,function(e,t){return n(e,t,r)})}}(),n._.clone=o,n._.cacher=s,n.rad=u,n.deg=l,n.angle=c,n.is=i,n.snapTo=function(e,t,n){if(n=i(n,"finite")?n:10,i(e,"array")){for(var r=e.length;r--;)if(D(e[r]-t)<=n)return e[r]}else{e=+e;var o=t%e;if(n>o)return t-o;if(o>e-n)return t-o+e}return t},n.getRGB=s(function(e){if(!e||(e=S(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:X};if(!(L[_](e.toLowerCase().substring(0,2))||"#"==e.charAt())&&(e=Y(e)),
+!e)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X};var t,r,o,a,s,c,u=e.match(B);return u?(u[2]&&(o=C(u[2].substring(5),16),r=C(u[2].substring(3,5),16),t=C(u[2].substring(1,3),16)),u[3]&&(o=C((s=u[3].charAt(3))+s,16),r=C((s=u[3].charAt(2))+s,16),t=C((s=u[3].charAt(1))+s,16)),u[4]&&(c=u[4].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t*=2.55),r=T(c[1]),"%"==c[1].slice(-1)&&(r*=2.55),o=T(c[2]),"%"==c[2].slice(-1)&&(o*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(a=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100)),u[5]?(c=u[5].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t/=100),r=T(c[1]),"%"==c[1].slice(-1)&&(r/=100),o=T(c[2]),"%"==c[2].slice(-1)&&(o/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(t/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(a=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),n.hsb2rgb(t,r,o,a)):u[6]?(c=u[6].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t/=100),r=T(c[1]),"%"==c[1].slice(-1)&&(r/=100),o=T(c[2]),"%"==c[2].slice(-1)&&(o/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(t/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(a=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),n.hsl2rgb(t,r,o,a)):(t=M(R.round(t),255),r=M(R.round(r),255),o=M(R.round(o),255),a=M(N(a,0),1),u={r:t,g:r,b:o,toString:X},u.hex="#"+(16777216|o|r<<8|t<<16).toString(16).slice(1),u.opacity=i(a,"finite")?a:1,u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X}},n),n.hsb=s(function(e,t,r){return n.hsb2rgb(e,t,r).hex}),n.hsl=s(function(e,t,r){return n.hsl2rgb(e,t,r).hex}),n.rgb=s(function(e,t,n,r){if(i(r,"finite")){var o=R.round;return"rgba("+[o(e),o(t),o(n),+r.toFixed(2)]+")"}return"#"+(16777216|n|t<<8|e<<16).toString(16).slice(1)});var Y=function(e){var t=A.doc.getElementsByTagName("head")[0]||A.doc.getElementsByTagName("svg")[0],n="rgb(255, 0, 0)";return(Y=s(function(e){if("red"==e.toLowerCase())return n;t.style.color=n,t.style.color=e;var r=A.doc.defaultView.getComputedStyle(t,k).getPropertyValue("color");return r==n?null:r}))(e)},H=function(){return"hsb("+[this.h,this.s,this.b]+")"},K=function(){return"hsl("+[this.h,this.s,this.l]+")"},X=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},Q=function(e,t,r){if(null==t&&i(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(r=e.b,t=e.g,e=e.r),null==t&&i(e,string)){var o=n.getRGB(e);e=o.r,t=o.g,r=o.b}return(e>1||t>1||r>1)&&(e/=255,t/=255,r/=255),[e,t,r]},Z=function(e,t,r,o){e=R.round(255*e),t=R.round(255*t),r=R.round(255*r);var a={r:e,g:t,b:r,opacity:i(o,"finite")?o:1,hex:n.rgb(e,t,r),toString:X};return i(o,"finite")&&(a.opacity=o),a};n.color=function(e){var t;return i(e,"object")&&"h"in e&&"s"in e&&"b"in e?(t=n.hsb2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.opacity=1,e.hex=t.hex):i(e,"object")&&"h"in e&&"s"in e&&"l"in e?(t=n.hsl2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.opacity=1,e.hex=t.hex):(i(e,"string")&&(e=n.getRGB(e)),i(e,"object")&&"r"in e&&"g"in e&&"b"in e&&!("error"in e)?(t=n.rgb2hsl(e),e.h=t.h,e.s=t.s,e.l=t.l,t=n.rgb2hsb(e),e.v=t.b):(e={hex:"none"},e.r=e.g=e.b=e.h=e.s=e.v=e.l=-1,e.error=1)),e.toString=X,e},n.hsb2rgb=function(e,t,n,r){i(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(n=e.b,t=e.s,e=e.h,r=e.o),e*=360;var o,a,s,c,u;return e=e%360/60,u=n*t,c=u*(1-D(e%2-1)),o=a=s=n-u,e=~~e,o+=[u,c,0,0,c,u][e],a+=[c,u,u,c,0,0][e],s+=[0,0,c,u,u,c][e],Z(o,a,s,r)},n.hsl2rgb=function(e,t,n,r){i(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(n=e.l,t=e.s,e=e.h),(e>1||t>1||n>1)&&(e/=360,t/=100,n/=100),e*=360;var o,a,s,c,u;return e=e%360/60,u=2*t*(.5>n?n:1-n),c=u*(1-D(e%2-1)),o=a=s=n-u/2,e=~~e,o+=[u,c,0,0,c,u][e],a+=[c,u,u,c,0,0][e],s+=[0,0,c,u,u,c][e],Z(o,a,s,r)},n.rgb2hsb=function(e,t,n){n=Q(e,t,n),e=n[0],t=n[1],n=n[2];var r,i,o,a;return o=N(e,t,n),a=o-M(e,t,n),r=0==a?null:o==e?(t-n)/a:o==t?(n-e)/a+2:(e-t)/a+4,r=(r+360)%6*60/360,i=0==a?0:a/o,{h:r,s:i,b:o,toString:H}},n.rgb2hsl=function(e,t,n){n=Q(e,t,n),e=n[0],t=n[1],n=n[2];var r,i,o,a,s,c;return a=N(e,t,n),s=M(e,t,n),c=a-s,r=0==c?null:a==e?(t-n)/c:a==t?(n-e)/c+2:(e-t)/c+4,r=(r+360)%6*60/360,o=(a+s)/2,i=0==c?0:.5>o?c/(2*o):c/(2-2*o),{h:r,s:i,l:o,toString:K}},n.parsePathString=function(e){if(!e)return null;var t=n.path(e);if(t.arr)return n.path.clone(t.arr);var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},o=[];return i(e,"array")&&i(e[0],"array")&&(o=n.path.clone(e)),o.length||S(e).replace(F,function(e,t,n){var i=[],a=t.toLowerCase();if(n.replace(V,function(e,t){t&&i.push(+t)}),"m"==a&&i.length>2&&(o.push([t].concat(i.splice(0,2))),a="l",t="m"==t?"l":"L"),"o"==a&&1==i.length&&o.push([t,i[0]]),"r"==a)o.push([t].concat(i));else for(;i.length>=r[a]&&(o.push([t].concat(i.splice(0,r[a]))),r[a]););}),o.toString=n.path.toString,t.arr=n.path.clone(o),o};var J=n.parseTransformString=function(e){if(!e)return null;var t=[];return i(e,"array")&&i(e[0],"array")&&(t=n.path.clone(e)),t.length||S(e).replace(j,function(e,n,r){var i=[];n.toLowerCase();r.replace(V,function(e,t){t&&i.push(+t)}),t.push([n].concat(i))}),t.toString=n.path.toString,t};n._.svgTransform2string=p,n._.rgTransform=/^[a-z][\s]*-?\.?\d/i,n._.transform2matrix=f,n._unit2px=m;A.doc.contains||A.doc.compareDocumentPosition?function(e,t){var n=9==e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e==r||!(!r||1!=r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t;)if(t=t.parentNode,t==e)return!0;return!1};n._.getSomeDefs=h,n._.getSomeSVG=d,n.select=function(e){return e=S(e).replace(/([^\\]):/g,"$1\\:"),w(A.doc.querySelector(e))},n.selectAll=function(e){for(var t=A.doc.querySelectorAll(e),r=(n.set||Array)(),i=0;i<t.length;i++)r.push(w(t[i]));return r},setInterval(function(){for(var e in q)if(q[_](e)){var t=q[e],n=t.node;("svg"!=t.type&&!n.ownerSVGElement||"svg"==t.type&&(!n.parentNode||"ownerSVGElement"in n.parentNode&&!n.ownerSVGElement))&&delete q[e]}},1e4),v.prototype.attr=function(e,n){var r=this;r.node;if(!e)return r;if(i(e,"string")){if(!(arguments.length>1))return t("snap.util.getattr."+e,r).firstDefined();var o={};o[e]=n,e=o}for(var a in e)e[_](a)&&t("snap.util.attr."+a,r,e[a]);return r},n.parse=function(e){var t=A.doc.createDocumentFragment(),n=!0,r=A.doc.createElement("div");if(e=S(e),e.match(/^\s*<\s*svg(?:\s|>)/)||(e="<svg>"+e+"</svg>",n=!1),r.innerHTML=e,e=r.getElementsByTagName("svg")[0])if(n)t=e;else{for(;e.firstChild;)t.appendChild(e.firstChild);r.innerHTML=k}return new x(t)},n.fragment=function(){for(var e=Array.prototype.slice.call(arguments,0),t=A.doc.createDocumentFragment(),r=0,i=e.length;i>r;r++){var o=e[r];o.node&&o.node.nodeType&&t.appendChild(o.node),o.nodeType&&t.appendChild(o),"string"==typeof o&&t.appendChild(n.parse(o).node)}return new x(t)},n._.make=b,n._.wrap=w,E.prototype.el=function(e,t){var n=b(e,this.node);return t&&n.attr(t),n},t.on("snap.util.getattr",function(){var e=t.nt();e=e.substring(e.lastIndexOf(".")+1);var n=e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});return ee[_](n)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(n):r(this.node,e)});var ee={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};t.on("snap.util.attr",function(e){var n=t.nt(),i={};n=n.substring(n.lastIndexOf(".")+1),i[n]=e;var o=n.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()}),a=n.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});ee[_](a)?this.node.style[o]=null==e?k:e:r(this.node,i)}),function(e){}(E.prototype),n.ajax=function(e,n,r,o){var a=new XMLHttpRequest,s=W();if(a){if(i(n,"function"))o=r,r=n,n=null;else if(i(n,"object")){var c=[];for(var u in n)n.hasOwnProperty(u)&&c.push(encodeURIComponent(u)+"="+encodeURIComponent(n[u]));n=c.join("&")}return a.open(n?"POST":"GET",e,!0),n&&(a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.setRequestHeader("Content-type","application/x-www-form-urlencoded")),r&&(t.once("snap.ajax."+s+".0",r),t.once("snap.ajax."+s+".200",r),t.once("snap.ajax."+s+".304",r)),a.onreadystatechange=function(){4==a.readyState&&t("snap.ajax."+s+"."+a.status,o,a)},4==a.readyState?a:(a.send(n),a)}},n.load=function(e,t,r){n.ajax(e,function(e){var i=n.parse(e.responseText);r?t.call(r,i):t(i)})};var te=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.body,i=n.documentElement,o=i.clientTop||r.clientTop||0,a=i.clientLeft||r.clientLeft||0,s=t.top+(g.win.pageYOffset||i.scrollTop||r.scrollTop)-o,c=t.left+(g.win.pageXOffset||i.scrollLeft||r.scrollLeft)-a;return{y:s,x:c}};return n.getElementByPoint=function(e,t){var n=this,r=(n.canvas,A.doc.elementFromPoint(e,t));if(A.win.opera&&"svg"==r.tagName){var i=te(r),o=r.createSVGRect();o.x=e-i.x,o.y=t-i.y,o.width=o.height=1;var a=r.getIntersectionList(o,null);a.length&&(r=a[a.length-1])}return r?w(r):null},n.plugin=function(e){e(n,v,E,A,x)},A.win.Snap=n,n}(e||this);return r.plugin(function(r,i,o,a,s){function c(e,t){if(null==t){var n=!0;if(t="linearGradient"==e.type||"radialGradient"==e.type?e.node.getAttribute("gradientTransform"):"pattern"==e.type?e.node.getAttribute("patternTransform"):e.node.getAttribute("transform"),!t)return new r.Matrix;t=r._.svgTransform2string(t)}else t=r._.rgTransform.test(t)?d(t).replace(/\.{3}|\u2026/g,e._.transform||E):r._.svgTransform2string(t),h(t,"array")&&(t=r.path?r.path.toString.call(t):d(t)),e._.transform=t;var i=r._.transform2matrix(t,e.getBBox(1));return n?i:void(e.matrix=i)}function u(e){function t(e,t){var n=y(e.node,t);n=n&&n.match(o),n=n&&n[2],n&&"#"==n.charAt()&&(n=n.substring(1),n&&(s[n]=(s[n]||[]).concat(function(n){var r={};r[t]=URL(n),y(e.node,r)})))}function n(e){var t=y(e.node,"xlink:href");t&&"#"==t.charAt()&&(t=t.substring(1),t&&(s[t]=(s[t]||[]).concat(function(t){e.attr("xlink:href","#"+t)})))}for(var r,i=e.selectAll("*"),o=/^\s*url\(("|'|)(.*)\1\)\s*$/,a=[],s={},c=0,u=i.length;u>c;c++){r=i[c],t(r,"fill"),t(r,"stroke"),t(r,"filter"),t(r,"mask"),t(r,"clip-path"),n(r);var l=y(r.node,"id");l&&(y(r.node,{id:r.id}),a.push({old:l,id:r.id}))}for(c=0,u=a.length;u>c;c++){var p=s[a[c].old];if(p)for(var f=0,h=p.length;h>f;f++)p[f](a[c].id)}}function l(e,t,n){return function(r){var i=r.slice(e,t);return 1==i.length&&(i=i[0]),n?n(i):i}}function p(e){return function(){var t=e?"<"+this.type:"",n=this.node.attributes,r=this.node.childNodes;if(e)for(var i=0,o=n.length;o>i;i++)t+=" "+n[i].name+'="'+n[i].value.replace(/"/g,'\\"')+'"';if(r.length){for(e&&(t+=">"),i=0,o=r.length;o>i;i++)3==r[i].nodeType?t+=r[i].nodeValue:1==r[i].nodeType&&(t+=b(r[i]).toString());e&&(t+="</"+this.type+">")}else e&&(t+="/>");return t}}var f=i.prototype,h=r.is,d=String,m=r._unit2px,y=r._.$,g=r._.make,v=r._.getSomeDefs,x="hasOwnProperty",b=r._.wrap;f.getBBox=function(e){if(!r.Matrix||!r.path)return this.node.getBBox();var t=this,n=new r.Matrix;if(t.removed)return r._.box();for(;"use"==t.type;)if(e||(n=n.add(t.transform().localMatrix.translate(t.attr("x")||0,t.attr("y")||0))),t.original)t=t.original;else{var i=t.attr("xlink:href");t=t.original=t.node.ownerDocument.getElementById(i.substring(i.indexOf("#")+1))}var o=t._,a=r.path.get[t.type]||r.path.get.deflt;try{return e?(o.bboxwt=a?r.path.getBBox(t.realPath=a(t)):r._.box(t.node.getBBox()),r._.box(o.bboxwt)):(t.realPath=a(t),t.matrix=t.transform().localMatrix,o.bbox=r.path.getBBox(r.path.map(t.realPath,n.add(t.matrix))),r._.box(o.bbox))}catch(s){return r._.box()}};var w=function(){return this.string};f.transform=function(e){var t=this._;if(null==e){for(var n,i=this,o=new r.Matrix(this.node.getCTM()),a=c(this),s=[a],u=new r.Matrix,l=a.toTransformString(),p=d(a)==d(this.matrix)?d(t.transform):l;"svg"!=i.type&&(i=i.parent());)s.push(c(i));for(n=s.length;n--;)u.add(s[n]);return{string:p,globalMatrix:o,totalMatrix:u,localMatrix:a,diffMatrix:o.clone().add(a.invert()),global:o.toTransformString(),total:u.toTransformString(),local:l,toString:w}}return e instanceof r.Matrix?(this.matrix=e,this._.transform=e.toTransformString()):c(this,e),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?y(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?y(this.node,{patternTransform:this.matrix}):y(this.node,{transform:this.matrix})),this},f.parent=function(){return b(this.node.parentNode)},f.append=f.add=function(e){if(e){if("set"==e.type){var t=this;return e.forEach(function(e){t.add(e)}),this}e=b(e),this.node.appendChild(e.node),e.paper=this.paper}return this},f.appendTo=function(e){return e&&(e=b(e),e.append(this)),this},f.prepend=function(e){if(e){if("set"==e.type){var t,n=this;return e.forEach(function(e){t?t.after(e):n.prepend(e),t=e}),this}e=b(e);var r=e.parent();this.node.insertBefore(e.node,this.node.firstChild),this.add&&this.add(),e.paper=this.paper,this.parent()&&this.parent().add(),r&&r.add()}return this},f.prependTo=function(e){return e=b(e),e.prepend(this),this},f.before=function(e){if("set"==e.type){var t=this;return e.forEach(function(e){var n=e.parent();t.node.parentNode.insertBefore(e.node,t.node),n&&n.add()}),this.parent().add(),this}e=b(e);var n=e.parent();return this.node.parentNode.insertBefore(e.node,this.node),this.parent()&&this.parent().add(),n&&n.add(),e.paper=this.paper,this},f.after=function(e){e=b(e);var t=e.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(e.node,this.node.nextSibling):this.node.parentNode.appendChild(e.node),this.parent()&&this.parent().add(),t&&t.add(),e.paper=this.paper,this},f.insertBefore=function(e){e=b(e);var t=this.parent();return e.node.parentNode.insertBefore(this.node,e.node),this.paper=e.paper,t&&t.add(),e.parent()&&e.parent().add(),this},f.insertAfter=function(e){e=b(e);var t=this.parent();return e.node.parentNode.insertBefore(this.node,e.node.nextSibling),this.paper=e.paper,t&&t.add(),e.parent()&&e.parent().add(),this},f.remove=function(){var e=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,e&&e.add(),this},f.select=function(e){return e=d(e).replace(/([^\\]):/g,"$1\\:"),b(this.node.querySelector(e))},f.selectAll=function(e){for(var t=this.node.querySelectorAll(e),n=(r.set||Array)(),i=0;i<t.length;i++)n.push(b(t[i]));return n},f.asPX=function(e,t){return null==t&&(t=this.attr(e)),+m(this,e,t)},f.use=function(){var e,t=this.node.id;return t||(t=this.id,y(this.node,{id:t})),e="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?g(this.type,this.node.parentNode):g("use",this.node.parentNode),y(e.node,{"xlink:href":"#"+t}),e.original=this,e},f.clone=function(){var e=b(this.node.cloneNode(!0));return y(e.node,"id")&&y(e.node,{id:e.id}),u(e),e.insertAfter(this),e},f.toDefs=function(){var e=v(this);return e.appendChild(this.node),this},f.pattern=f.toPattern=function(e,t,n,r){var i=g("pattern",v(this));return null==e&&(e=this.getBBox()),h(e,"object")&&"x"in e&&(t=e.y,n=e.width,r=e.height,e=e.x),y(i.node,{x:e,y:t,width:n,height:r,patternUnits:"userSpaceOnUse",id:i.id,viewBox:[e,t,n,r].join(" ")}),i.node.appendChild(this.node),i},f.marker=function(e,t,n,r,i,o){var a=g("marker",v(this));return null==e&&(e=this.getBBox()),h(e,"object")&&"x"in e&&(t=e.y,n=e.width,r=e.height,i=e.refX||e.cx,o=e.refY||e.cy,e=e.x),y(a.node,{viewBox:[e,t,n,r].join(" "),markerWidth:n,markerHeight:r,orient:"auto",refX:i||0,refY:o||0,id:a.id}),a.node.appendChild(this.node),a};var A=function(e,t,r,i){"function"!=typeof r||r.length||(i=r,r=n.linear),this.attr=e,this.dur=t,r&&(this.easing=r),i&&(this.callback=i)};r._.Animation=A,r.animation=function(e,t,n,r){return new A(e,t,n,r)},f.inAnim=function(){var e=this,t=[];for(var n in e.anims)e.anims[x](n)&&!function(e){t.push({anim:new A(e._attrs,e.dur,e.easing,e._callback),mina:e,curStatus:e.status(),status:function(t){return e.status(t)},stop:function(){e.stop()}})}(e.anims[n]);return t},r.animate=function(e,r,i,o,a,s){"function"!=typeof a||a.length||(s=a,a=n.linear);var c=n.time(),u=n(e,r,c,c+o,n.time,i,a);return s&&t.once("mina.finish."+u.id,s),u},f.stop=function(){for(var e=this.inAnim(),t=0,n=e.length;n>t;t++)e[t].stop();return this},f.animate=function(e,r,i,o){"function"!=typeof i||i.length||(o=i,i=n.linear),e instanceof A&&(o=e.callback,i=e.easing,r=i.dur,e=e.attr);var a,s,c,u,p=[],f=[],m={},y=this;for(var g in e)if(e[x](g)){y.equal?(u=y.equal(g,d(e[g])),a=u.from,s=u.to,c=u.f):(a=+y.attr(g),s=+e[g]);var v=h(a,"array")?a.length:1;m[g]=l(p.length,p.length+v,c),p=p.concat(a),f=f.concat(s)}var b=n.time(),E=n(p,f,b,b+r,n.time,function(e){var t={};for(var n in m)m[x](n)&&(t[n]=m[n](e));y.attr(t)},i);return y.anims[E.id]=E,E._attrs=e,E._callback=o,t("snap.animcreated."+y.id,E),t.once("mina.finish."+E.id,function(){delete y.anims[E.id],o&&o.call(y)}),t.once("mina.stop."+E.id,function(){delete y.anims[E.id]}),y};var _={};f.data=function(e,n){var i=_[this.id]=_[this.id]||{};if(0==arguments.length)return t("snap.data.get."+this.id,this,i,null),i;if(1==arguments.length){if(r.is(e,"object")){for(var o in e)e[x](o)&&this.data(o,e[o]);return this}return t("snap.data.get."+this.id,this,i[e],e),i[e]}return i[e]=n,t("snap.data.set."+this.id,this,n,e),this},f.removeData=function(e){return null==e?_[this.id]={}:_[this.id]&&delete _[this.id][e],this},f.outerSVG=f.toString=p(1),f.innerSVG=p(),f.toDataURL=function(){if(e&&e.btoa){var t=this.getBBox(),n=r.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+t.x.toFixed(3),y:+t.y.toFixed(3),width:+t.width.toFixed(3),height:+t.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))}},s.prototype.select=f.select,s.prototype.selectAll=f.selectAll}),r.plugin(function(e,t,n,r,i){function o(e,t,n,r,i,o){return null==t&&"[object SVGMatrix]"==a.call(e)?(this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.e=e.e,void(this.f=e.f)):void(null!=e?(this.a=+e,this.b=+t,this.c=+n,this.d=+r,this.e=+i,this.f=+o):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var a=Object.prototype.toString,s=String,c=Math,u="";!function(t){function n(e){return e[0]*e[0]+e[1]*e[1]}function r(e){var t=c.sqrt(n(e));e[0]&&(e[0]/=t),e[1]&&(e[1]/=t)}t.add=function(e,t,n,r,i,a){var s,c,u,l,p=[[],[],[]],f=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],h=[[e,n,i],[t,r,a],[0,0,1]];for(e&&e instanceof o&&(h=[[e.a,e.c,e.e],[e.b,e.d,e.f],[0,0,1]]),s=0;3>s;s++)for(c=0;3>c;c++){for(l=0,u=0;3>u;u++)l+=f[s][u]*h[u][c];p[s][c]=l}return this.a=p[0][0],this.b=p[1][0],this.c=p[0][1],this.d=p[1][1],this.e=p[0][2],this.f=p[1][2],this},t.invert=function(){var e=this,t=e.a*e.d-e.b*e.c;return new o(e.d/t,-e.b/t,-e.c/t,e.a/t,(e.c*e.f-e.d*e.e)/t,(e.b*e.e-e.a*e.f)/t)},t.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(e,t){return this.add(1,0,0,1,e,t)},t.scale=function(e,t,n,r){return null==t&&(t=e),(n||r)&&this.add(1,0,0,1,n,r),this.add(e,0,0,t,0,0),(n||r)&&this.add(1,0,0,1,-n,-r),this},t.rotate=function(t,n,r){t=e.rad(t),n=n||0,r=r||0;var i=+c.cos(t).toFixed(9),o=+c.sin(t).toFixed(9);return this.add(i,o,-o,i,n,r),this.add(1,0,0,1,-n,-r)},t.x=function(e,t){return e*this.a+t*this.c+this.e},t.y=function(e,t){return e*this.b+t*this.d+this.f},t.get=function(e){return+this[s.fromCharCode(97+e)].toFixed(4)},t.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.determinant=function(){return this.a*this.d-this.b*this.c},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=c.sqrt(n(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=c.sqrt(n(i[1])),r(i[1]),t.shear/=t.scaley,this.determinant()<0&&(t.scalex=-t.scalex);var o=-i[0][1],a=i[1][1];return 0>a?(t.rotate=e.deg(c.acos(a)),0>o&&(t.rotate=360-t.rotate)):t.rotate=e.deg(c.asin(o)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(e){var t=e||this.split();return+t.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[+t.dx.toFixed(4),+t.dy.toFixed(4)]:u)+(1!=t.scalex||1!=t.scaley?"s"+[t.scalex,t.scaley,0,0]:u)+(t.rotate?"r"+[+t.rotate.toFixed(4),0,0]:u))}}(o.prototype),e.Matrix=o,e.matrix=function(e,t,n,r,i,a){return new o(e,t,n,r,i,a)}}),r.plugin(function(e,n,r,i,o){function a(r){return function(i){if(t.stop(),i instanceof o&&1==i.node.childNodes.length&&("radialGradient"==i.node.firstChild.tagName||"linearGradient"==i.node.firstChild.tagName||"pattern"==i.node.firstChild.tagName)&&(i=i.node.firstChild,h(this).appendChild(i),i=p(i)),i instanceof n)if("radialGradient"==i.type||"linearGradient"==i.type||"pattern"==i.type){i.node.id||m(i.node,{id:i.id});var a=y(i.node.id)}else a=i.attr(r);else if(a=e.color(i),a.error){var s=e(h(this).ownerSVGElement).gradient(i);s?(s.node.id||m(s.node,{id:s.id}),a=y(s.node.id)):a=i}else a=g(a);var c={};c[r]=a,m(this.node,c),this.node.style[r]=x}}function s(e){t.stop(),e==+e&&(e+="px"),this.node.style.fontSize=e}function c(e){for(var t=[],n=e.childNodes,r=0,i=n.length;i>r;r++){var o=n[r];3==o.nodeType&&t.push(o.nodeValue),"tspan"==o.tagName&&(1==o.childNodes.length&&3==o.firstChild.nodeType?t.push(o.firstChild.nodeValue):t.push(c(o)))}return t}function u(){return t.stop(),this.node.style.fontSize}var l=e._.make,p=e._.wrap,f=e.is,h=e._.getSomeDefs,d=/^url\(#?([^)]+)\)$/,m=e._.$,y=e.url,g=String,v=e._.separator,x="";t.on("snap.util.attr.mask",function(e){if(e instanceof n||e instanceof o){if(t.stop(),e instanceof o&&1==e.node.childNodes.length&&(e=e.node.firstChild,h(this).appendChild(e),e=p(e)),"mask"==e.type)var r=e;else r=l("mask",h(this)),r.node.appendChild(e.node);!r.node.id&&m(r.node,{id:r.id}),m(this.node,{mask:y(r.id)})}}),function(e){t.on("snap.util.attr.clip",e),t.on("snap.util.attr.clip-path",e),t.on("snap.util.attr.clipPath",e)}(function(e){if(e instanceof n||e instanceof o){if(t.stop(),"clipPath"==e.type)var r=e;else r=l("clipPath",h(this)),r.node.appendChild(e.node),!r.node.id&&m(r.node,{id:r.id});m(this.node,{"clip-path":y(r.node.id||r.id)})}}),t.on("snap.util.attr.fill",a("fill")),t.on("snap.util.attr.stroke",a("stroke"));var b=/^([lr])(?:\(([^)]*)\))?(.*)$/i;t.on("snap.util.grad.parse",function(e){e=g(e);var t=e.match(b);if(!t)return null;var n=t[1],r=t[2],i=t[3];return r=r.split(/\s*,\s*/).map(function(e){return+e==e?+e:e}),1==r.length&&0==r[0]&&(r=[]),i=i.split("-"),i=i.map(function(e){e=e.split(":");var t={color:e[0]};return e[1]&&(t.offset=parseFloat(e[1])),t}),{type:n,params:r,stops:i}}),t.on("snap.util.attr.d",function(n){t.stop(),f(n,"array")&&f(n[0],"array")&&(n=e.path.toString.call(n)),n=g(n),n.match(/[ruo]/i)&&(n=e.path.toAbsolute(n)),m(this.node,{d:n})})(-1),t.on("snap.util.attr.#text",function(e){t.stop(),e=g(e);for(var n=i.doc.createTextNode(e);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(n)})(-1),t.on("snap.util.attr.path",function(e){t.stop(),this.attr({d:e})})(-1),t.on("snap.util.attr.class",function(e){t.stop(),this.node.className.baseVal=e})(-1),t.on("snap.util.attr.viewBox",function(e){var n;n=f(e,"object")&&"x"in e?[e.x,e.y,e.width,e.height].join(" "):f(e,"array")?e.join(" "):e,m(this.node,{viewBox:n}),t.stop()})(-1),t.on("snap.util.attr.transform",function(e){this.transform(e),t.stop()})(-1),t.on("snap.util.attr.r",function(e){"rect"==this.type&&(t.stop(),m(this.node,{rx:e,ry:e}))})(-1),t.on("snap.util.attr.textpath",function(e){if(t.stop(),"text"==this.type){var r,i,o;if(!e&&this.textPath){for(i=this.textPath;i.node.firstChild;)this.node.appendChild(i.node.firstChild);return i.remove(),void delete this.textPath}if(f(e,"string")){var a=h(this),s=p(a.parentNode).path(e);a.appendChild(s.node),r=s.id,s.attr({id:r})}else e=p(e),e instanceof n&&(r=e.attr("id"),r||(r=e.id,e.attr({id:r})));if(r)if(i=this.textPath,o=this.node,i)i.attr({"xlink:href":"#"+r});else{for(i=m("textPath",{"xlink:href":"#"+r});o.firstChild;)i.appendChild(o.firstChild);o.appendChild(i),this.textPath=p(i)}}})(-1),t.on("snap.util.attr.text",function(e){if("text"==this.type){for(var n=this.node,r=function(e){var t=m("tspan");if(f(e,"array"))for(var n=0;n<e.length;n++)t.appendChild(r(e[n]));else t.appendChild(i.doc.createTextNode(e));return t.normalize&&t.normalize(),t};n.firstChild;)n.removeChild(n.firstChild);for(var o=r(e);o.firstChild;)n.appendChild(o.firstChild)}t.stop()})(-1),t.on("snap.util.attr.fontSize",s)(-1),t.on("snap.util.attr.font-size",s)(-1),t.on("snap.util.getattr.transform",function(){return t.stop(),this.transform()})(-1),t.on("snap.util.getattr.textpath",function(){return t.stop(),this.textPath})(-1),function(){function n(n){return function(){t.stop();var r=i.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+n);return"none"==r?r:e(i.doc.getElementById(r.match(d)[1]))}}function r(e){return function(n){t.stop();var r="marker"+e.charAt(0).toUpperCase()+e.substring(1);if(""==n||!n)return void(this.node.style[r]="none");if("marker"==n.type){var i=n.node.id;return i||m(n.node,{id:n.id}),void(this.node.style[r]=y(i))}}}t.on("snap.util.getattr.marker-end",n("end"))(-1),t.on("snap.util.getattr.markerEnd",n("end"))(-1),t.on("snap.util.getattr.marker-start",n("start"))(-1),t.on("snap.util.getattr.markerStart",n("start"))(-1),t.on("snap.util.getattr.marker-mid",n("mid"))(-1),t.on("snap.util.getattr.markerMid",n("mid"))(-1),t.on("snap.util.attr.marker-end",r("end"))(-1),t.on("snap.util.attr.markerEnd",r("end"))(-1),t.on("snap.util.attr.marker-start",r("start"))(-1),t.on("snap.util.attr.markerStart",r("start"))(-1),t.on("snap.util.attr.marker-mid",r("mid"))(-1),t.on("snap.util.attr.markerMid",r("mid"))(-1)}(),t.on("snap.util.getattr.r",function(){return"rect"==this.type&&m(this.node,"rx")==m(this.node,"ry")?(t.stop(),m(this.node,"rx")):void 0})(-1),t.on("snap.util.getattr.text",function(){if("text"==this.type||"tspan"==this.type){t.stop();var e=c(this.node);return 1==e.length?e[0]:e}})(-1),t.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),t.on("snap.util.getattr.viewBox",function(){t.stop();var n=m(this.node,"viewBox");return n?(n=n.split(v),e._.box(+n[0],+n[1],+n[2],+n[3])):void 0})(-1),t.on("snap.util.getattr.points",function(){var e=m(this.node,"points");return t.stop(),e?e.split(v):void 0})(-1),t.on("snap.util.getattr.path",function(){var e=m(this.node,"d");return t.stop(),e})(-1),t.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),t.on("snap.util.getattr.fontSize",u)(-1),t.on("snap.util.getattr.font-size",u)(-1)}),r.plugin(function(n,r,i,o,a){var s=i.prototype,c=n.is;s.rect=function(e,t,n,r,i,o){var a;return null==o&&(o=i),c(e,"object")&&"[object Object]"==e?a=e:null!=e&&(a={x:e,y:t,width:n,height:r},null!=i&&(a.rx=i,a.ry=o)),this.el("rect",a)},s.circle=function(e,t,n){var r;return c(e,"object")&&"[object Object]"==e?r=e:null!=e&&(r={cx:e,cy:t,r:n}),this.el("circle",r)};var u=function(){function e(){this.parentNode.removeChild(this)}return function(t,n){var r=o.doc.createElement("img"),i=o.doc.body;r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){n.call(r),r.onload=r.onerror=null,i.removeChild(r)},r.onerror=e,i.appendChild(r),r.src=t}}();s.image=function(e,t,r,i,o){var a=this.el("image");if(c(e,"object")&&"src"in e)a.attr(e);else if(null!=e){var s={"xlink:href":e,preserveAspectRatio:"none"};null!=t&&null!=r&&(s.x=t,s.y=r),null!=i&&null!=o?(s.width=i,s.height=o):u(e,function(){n._.$(a.node,{width:this.offsetWidth,height:this.offsetHeight})}),n._.$(a.node,s)}return a},s.ellipse=function(e,t,n,r){var i;return c(e,"object")&&"[object Object]"==e?i=e:null!=e&&(i={cx:e,cy:t,rx:n,ry:r}),this.el("ellipse",i)},s.path=function(e){var t;return c(e,"object")&&!c(e,"array")?t=e:e&&(t={d:e}),this.el("path",t)},s.group=s.g=function(e){var t=this.el("g");return 1==arguments.length&&e&&!e.type?t.attr(e):arguments.length&&t.add(Array.prototype.slice.call(arguments,0)),t},s.svg=function(e,t,n,r,i,o,a,s){var u={};return c(e,"object")&&null==t?u=e:(null!=e&&(u.x=e),null!=t&&(u.y=t),null!=n&&(u.width=n),null!=r&&(u.height=r),null!=i&&null!=o&&null!=a&&null!=s&&(u.viewBox=[i,o,a,s])),this.el("svg",u)},s.mask=function(e){var t=this.el("mask");return 1==arguments.length&&e&&!e.type?t.attr(e):arguments.length&&t.add(Array.prototype.slice.call(arguments,0)),t},s.ptrn=function(e,t,n,r,i,o,a,s){if(c(e,"object"))var u=e;else u={patternUnits:"userSpaceOnUse"},e&&(u.x=e),t&&(u.y=t),null!=n&&(u.width=n),null!=r&&(u.height=r),null!=i&&null!=o&&null!=a&&null!=s&&(u.viewBox=[i,o,a,s]);return this.el("pattern",u)},s.use=function(e){return null!=e?(e instanceof r&&(e.attr("id")||e.attr({id:n._.id(e)}),e=e.attr("id")),"#"==String(e).charAt()&&(e=e.substring(1)),this.el("use",{"xlink:href":"#"+e})):r.prototype.use.call(this)},s.symbol=function(e,t,n,r){var i={};return null!=e&&null!=t&&null!=n&&null!=r&&(i.viewBox=[e,t,n,r]),this.el("symbol",i)},s.text=function(e,t,n){var r={};return c(e,"object")?r=e:null!=e&&(r={x:e,y:t,text:n||""}),this.el("text",r)},s.line=function(e,t,n,r){var i={};return c(e,"object")?i=e:null!=e&&(i={x1:e,x2:n,y1:t,y2:r}),this.el("line",i)},s.polyline=function(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments,0));var t={};return c(e,"object")&&!c(e,"array")?t=e:null!=e&&(t={points:e}),this.el("polyline",t)},s.polygon=function(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments,0));var t={};return c(e,"object")&&!c(e,"array")?t=e:null!=e&&(t={points:e}),this.el("polygon",t)},function(){function r(){return this.selectAll("stop")}function i(e,t){var r=l("stop"),i={offset:+t+"%"};return e=n.color(e),i["stop-color"]=e.hex,e.opacity<1&&(i["stop-opacity"]=e.opacity),l(r,i),this.node.appendChild(r),this}function o(){if("linearGradient"==this.type){var e=l(this.node,"x1")||0,t=l(this.node,"x2")||1,r=l(this.node,"y1")||0,i=l(this.node,"y2")||0;return n._.box(e,r,math.abs(t-e),math.abs(i-r))}var o=this.node.cx||.5,a=this.node.cy||.5,s=this.node.r||0;return n._.box(o-s,a-s,2*s,2*s)}function a(e,n){function r(e,t){for(var n=(t-p)/(e-f),r=f;e>r;r++)a[r].offset=+(+p+n*(r-f)).toFixed(2);f=e,p=t}var i,o=t("snap.util.grad.parse",null,n).firstDefined();if(!o)return null;o.params.unshift(e),i="l"==o.type.toLowerCase()?c.apply(0,o.params):u.apply(0,o.params),o.type!=o.type.toLowerCase()&&l(i.node,{gradientUnits:"userSpaceOnUse"});var a=o.stops,s=a.length,p=0,f=0;s--;for(var h=0;s>h;h++)"offset"in a[h]&&r(h,a[h].offset);for(a[s].offset=a[s].offset||100,r(s,a[s].offset),h=0;s>=h;h++){var d=a[h];i.addStop(d.color,d.offset)}return i}function c(e,t,a,s,c){var u=n._.make("linearGradient",e);return u.stops=r,u.addStop=i,u.getBBox=o,null!=t&&l(u.node,{x1:t,y1:a,x2:s,y2:c}),u}function u(e,t,a,s,c,u){var p=n._.make("radialGradient",e);return p.stops=r,p.addStop=i,p.getBBox=o,
+null!=t&&l(p.node,{cx:t,cy:a,r:s}),null!=c&&null!=u&&l(p.node,{fx:c,fy:u}),p}var l=n._.$;s.gradient=function(e){return a(this.defs,e)},s.gradientLinear=function(e,t,n,r){return c(this.defs,e,t,n,r)},s.gradientRadial=function(e,t,n,r,i){return u(this.defs,e,t,n,r,i)},s.toString=function(){var e,t=this.node.ownerDocument,r=t.createDocumentFragment(),i=t.createElement("div"),o=this.node.cloneNode(!0);return r.appendChild(i),i.appendChild(o),n._.$(o,{xmlns:"http://www.w3.org/2000/svg"}),e=i.innerHTML,r.removeChild(r.firstChild),e},s.toDataURL=function(){return e&&e.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},s.clear=function(){for(var e,t=this.node.firstChild;t;)e=t.nextSibling,"defs"!=t.tagName?t.parentNode.removeChild(t):s.clear.call({node:t}),t=e}}()}),r.plugin(function(e,t,n,r){function i(e){var t=i.ps=i.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)t[F](n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function o(e,t,n,r){return null==e&&(e=t=n=r=0),null==t&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,w:n,height:r,h:r,x2:e+n,y2:t+r,cx:e+n/2,cy:t+r/2,r1:G.min(n,r)/2,r2:G.max(n,r)/2,r0:G.sqrt(n*n+r*r)/2,path:_(e,t,n,r),vb:[e,t,n,r].join(" ")}}function a(){return this.join(",").replace(j,"$1")}function s(e){var t=L(e);return t.toString=a,t}function c(e,t,n,r,i,o,a,s,c){return null==c?m(e,t,n,r,i,o,a,s):l(e,t,n,r,i,o,a,s,y(e,t,n,r,i,o,a,s,c))}function u(n,r){function i(e){return+(+e).toFixed(3)}return e._.cacher(function(e,o,a){e instanceof t&&(e=e.attr("d")),e=P(e);for(var s,u,p,f,h,d="",m={},y=0,g=0,v=e.length;v>g;g++){if(p=e[g],"M"==p[0])s=+p[1],u=+p[2];else{if(f=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6]),y+f>o){if(r&&!m.start){if(h=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6],o-y),d+=["C"+i(h.start.x),i(h.start.y),i(h.m.x),i(h.m.y),i(h.x),i(h.y)],a)return d;m.start=d,d=["M"+i(h.x),i(h.y)+"C"+i(h.n.x),i(h.n.y),i(h.end.x),i(h.end.y),i(p[5]),i(p[6])].join(),y+=f,s=+p[5],u=+p[6];continue}if(!n&&!r)return h=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6],o-y)}y+=f,s=+p[5],u=+p[6]}d+=p.shift()+p}return m.end=d,h=n?y:r?m:l(s,u,p[0],p[1],p[2],p[3],p[4],p[5],1)},null,e._.clone)}function l(e,t,n,r,i,o,a,s,c){var u=1-c,l=$(u,3),p=$(u,2),f=c*c,h=f*c,d=l*e+3*p*c*n+3*u*c*c*i+h*a,m=l*t+3*p*c*r+3*u*c*c*o+h*s,y=e+2*c*(n-e)+f*(i-2*n+e),g=t+2*c*(r-t)+f*(o-2*r+t),v=n+2*c*(i-n)+f*(a-2*i+n),x=r+2*c*(o-r)+f*(s-2*o+r),b=u*e+c*n,E=u*t+c*r,w=u*i+c*a,A=u*o+c*s,_=90-180*G.atan2(y-v,g-x)/U;return{x:d,y:m,m:{x:y,y:g},n:{x:v,y:x},start:{x:b,y:E},end:{x:w,y:A},alpha:_}}function p(t,n,r,i,a,s,c,u){e.is(t,"array")||(t=[t,n,r,i,a,s,c,u]);var l=D.apply(null,t);return o(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)}function f(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function h(e,t){return e=o(e),t=o(t),f(t,e.x,e.y)||f(t,e.x2,e.y)||f(t,e.x,e.y2)||f(t,e.x2,e.y2)||f(e,t.x,t.y)||f(e,t.x2,t.y)||f(e,t.x,t.y2)||f(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function d(e,t,n,r,i){var o=-3*t+9*n-9*r+3*i,a=e*o+6*t-12*n+6*r;return e*a-3*t+3*n}function m(e,t,n,r,i,o,a,s,c){null==c&&(c=1),c=c>1?1:0>c?0:c;for(var u=c/2,l=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;l>m;m++){var y=u*p[m]+u,g=d(y,e,n,i,a),v=d(y,t,r,o,s),x=g*g+v*v;h+=f[m]*G.sqrt(x)}return u*h}function y(e,t,n,r,i,o,a,s,c){if(!(0>c||m(e,t,n,r,i,o,a,s)<c)){var u,l=1,p=l/2,f=l-p,h=.01;for(u=m(e,t,n,r,i,o,a,s,f);q(u-c)>h;)p/=2,f+=(c>u?1:-1)*p,u=m(e,t,n,r,i,o,a,s,f);return f}}function g(e,t,n,r,i,o,a,s){if(!(z(e,n)<W(i,a)||W(e,n)>z(i,a)||z(t,r)<W(o,s)||W(t,r)>z(o,s))){var c=(e*r-t*n)*(i-a)-(e-n)*(i*s-o*a),u=(e*r-t*n)*(o-s)-(t-r)*(i*s-o*a),l=(e-n)*(o-s)-(t-r)*(i-a);if(l){var p=c/l,f=u/l,h=+p.toFixed(2),d=+f.toFixed(2);if(!(h<+W(e,n).toFixed(2)||h>+z(e,n).toFixed(2)||h<+W(i,a).toFixed(2)||h>+z(i,a).toFixed(2)||d<+W(t,r).toFixed(2)||d>+z(t,r).toFixed(2)||d<+W(o,s).toFixed(2)||d>+z(o,s).toFixed(2)))return{x:p,y:f}}}}function v(e,t,n){var r=p(e),i=p(t);if(!h(r,i))return n?0:[];for(var o=m.apply(0,e),a=m.apply(0,t),s=~~(o/8),c=~~(a/8),u=[],f=[],d={},y=n?0:[],v=0;s+1>v;v++){var x=l.apply(0,e.concat(v/s));u.push({x:x.x,y:x.y,t:v/s})}for(v=0;c+1>v;v++)x=l.apply(0,t.concat(v/c)),f.push({x:x.x,y:x.y,t:v/c});for(v=0;s>v;v++)for(var b=0;c>b;b++){var E=u[v],w=u[v+1],A=f[b],_=f[b+1],S=q(w.x-E.x)<.001?"y":"x",T=q(_.x-A.x)<.001?"y":"x",C=g(E.x,E.y,w.x,w.y,A.x,A.y,_.x,_.y);if(C){if(d[C.x.toFixed(4)]==C.y.toFixed(4))continue;d[C.x.toFixed(4)]=C.y.toFixed(4);var R=E.t+q((C[S]-E[S])/(w[S]-E[S]))*(w.t-E.t),N=A.t+q((C[T]-A[T])/(_[T]-A[T]))*(_.t-A.t);R>=0&&1>=R&&N>=0&&1>=N&&(n?y++:y.push({x:C.x,y:C.y,t1:R,t2:N}))}}return y}function x(e,t){return E(e,t)}function b(e,t){return E(e,t,1)}function E(e,t,n){e=P(e),t=P(t);for(var r,i,o,a,s,c,u,l,p,f,h=n?0:[],d=0,m=e.length;m>d;d++){var y=e[d];if("M"==y[0])r=s=y[1],i=c=y[2];else{"C"==y[0]?(p=[r,i].concat(y.slice(1)),r=p[6],i=p[7]):(p=[r,i,r,i,s,c,s,c],r=s,i=c);for(var g=0,x=t.length;x>g;g++){var b=t[g];if("M"==b[0])o=u=b[1],a=l=b[2];else{"C"==b[0]?(f=[o,a].concat(b.slice(1)),o=f[6],a=f[7]):(f=[o,a,o,a,u,l,u,l],o=u,a=l);var E=v(p,f,n);if(n)h+=E;else{for(var w=0,A=E.length;A>w;w++)E[w].segment1=d,E[w].segment2=g,E[w].bez1=p,E[w].bez2=f;h=h.concat(E)}}}}}return h}function w(e,t,n){var r=A(e);return f(r,t,n)&&E(e,[["M",t,n],["H",r.x2+10]],1)%2==1}function A(e){var t=i(e);if(t.bbox)return L(t.bbox);if(!e)return o();e=P(e);for(var n,r=0,a=0,s=[],c=[],u=0,l=e.length;l>u;u++)if(n=e[u],"M"==n[0])r=n[1],a=n[2],s.push(r),c.push(a);else{var p=D(r,a,n[1],n[2],n[3],n[4],n[5],n[6]);s=s.concat(p.min.x,p.max.x),c=c.concat(p.min.y,p.max.y),r=n[5],a=n[6]}var f=W.apply(0,s),h=W.apply(0,c),d=z.apply(0,s),m=z.apply(0,c),y=o(f,h,d-f,m-h);return t.bbox=L(y),y}function _(e,t,n,r,i){if(i)return[["M",+e+ +i,t],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",e,t],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.toString=a,o}function S(e,t,n,r,i){if(null==i&&null==r&&(r=n),e=+e,t=+t,n=+n,r=+r,null!=i)var o=Math.PI/180,s=e+n*Math.cos(-r*o),c=e+n*Math.cos(-i*o),u=t+n*Math.sin(-r*o),l=t+n*Math.sin(-i*o),p=[["M",s,u],["A",n,n,0,+(i-r>180),0,c,l]];else p=[["M",e,t],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return p.toString=a,p}function T(t){var n=i(t),r=String.prototype.toLowerCase;if(n.rel)return s(n.rel);e.is(t,"array")&&e.is(t&&t[0],"array")||(t=e.parsePathString(t));var o=[],c=0,u=0,l=0,p=0,f=0;"M"==t[0][0]&&(c=t[0][1],u=t[0][2],l=c,p=u,f++,o.push(["M",c,u]));for(var h=f,d=t.length;d>h;h++){var m=o[h]=[],y=t[h];if(y[0]!=r.call(y[0]))switch(m[0]=r.call(y[0]),m[0]){case"a":m[1]=y[1],m[2]=y[2],m[3]=y[3],m[4]=y[4],m[5]=y[5],m[6]=+(y[6]-c).toFixed(3),m[7]=+(y[7]-u).toFixed(3);break;case"v":m[1]=+(y[1]-u).toFixed(3);break;case"m":l=y[1],p=y[2];default:for(var g=1,v=y.length;v>g;g++)m[g]=+(y[g]-(g%2?c:u)).toFixed(3)}else{m=o[h]=[],"m"==y[0]&&(l=y[1]+c,p=y[2]+u);for(var x=0,b=y.length;b>x;x++)o[h][x]=y[x]}var E=o[h].length;switch(o[h][0]){case"z":c=l,u=p;break;case"h":c+=+o[h][E-1];break;case"v":u+=+o[h][E-1];break;default:c+=+o[h][E-2],u+=+o[h][E-1]}}return o.toString=a,n.rel=s(o),o}function C(t){var n=i(t);if(n.abs)return s(n.abs);if(I(t,"array")&&I(t&&t[0],"array")||(t=e.parsePathString(t)),!t||!t.length)return[["M",0,0]];var r,o=[],c=0,u=0,l=0,p=0,f=0;"M"==t[0][0]&&(c=+t[0][1],u=+t[0][2],l=c,p=u,f++,o[0]=["M",c,u]);for(var h,d,m=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),y=f,g=t.length;g>y;y++){if(o.push(h=[]),d=t[y],r=d[0],r!=r.toUpperCase())switch(h[0]=r.toUpperCase(),h[0]){case"A":h[1]=d[1],h[2]=d[2],h[3]=d[3],h[4]=d[4],h[5]=d[5],h[6]=+d[6]+c,h[7]=+d[7]+u;break;case"V":h[1]=+d[1]+u;break;case"H":h[1]=+d[1]+c;break;case"R":for(var v=[c,u].concat(d.slice(1)),x=2,b=v.length;b>x;x++)v[x]=+v[x]+c,v[++x]=+v[x]+u;o.pop(),o=o.concat(O(v,m));break;case"O":o.pop(),v=S(c,u,d[1],d[2]),v.push(v[0]),o=o.concat(v);break;case"U":o.pop(),o=o.concat(S(c,u,d[1],d[2],d[3])),h=["U"].concat(o[o.length-1].slice(-2));break;case"M":l=+d[1]+c,p=+d[2]+u;default:for(x=1,b=d.length;b>x;x++)h[x]=+d[x]+(x%2?c:u)}else if("R"==r)v=[c,u].concat(d.slice(1)),o.pop(),o=o.concat(O(v,m)),h=["R"].concat(d.slice(-2));else if("O"==r)o.pop(),v=S(c,u,d[1],d[2]),v.push(v[0]),o=o.concat(v);else if("U"==r)o.pop(),o=o.concat(S(c,u,d[1],d[2],d[3])),h=["U"].concat(o[o.length-1].slice(-2));else for(var E=0,w=d.length;w>E;E++)h[E]=d[E];if(r=r.toUpperCase(),"O"!=r)switch(h[0]){case"Z":c=+l,u=+p;break;case"H":c=h[1];break;case"V":u=h[1];break;case"M":l=h[h.length-2],p=h[h.length-1];default:c=h[h.length-2],u=h[h.length-1]}}return o.toString=a,n.abs=s(o),o}function R(e,t,n,r){return[e,t,n,r,n,r]}function N(e,t,n,r,i,o){var a=1/3,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function M(t,n,r,i,o,a,s,c,u,l){var p,f=120*U/180,h=U/180*(+o||0),d=[],m=e._.cacher(function(e,t,n){var r=e*G.cos(n)-t*G.sin(n),i=e*G.sin(n)+t*G.cos(n);return{x:r,y:i}});if(l)_=l[0],S=l[1],w=l[2],A=l[3];else{p=m(t,n,-h),t=p.x,n=p.y,p=m(c,u,-h),c=p.x,u=p.y;var y=(G.cos(U/180*o),G.sin(U/180*o),(t-c)/2),g=(n-u)/2,v=y*y/(r*r)+g*g/(i*i);v>1&&(v=G.sqrt(v),r=v*r,i=v*i);var x=r*r,b=i*i,E=(a==s?-1:1)*G.sqrt(q((x*b-x*g*g-b*y*y)/(x*g*g+b*y*y))),w=E*r*g/i+(t+c)/2,A=E*-i*y/r+(n+u)/2,_=G.asin(((n-A)/i).toFixed(9)),S=G.asin(((u-A)/i).toFixed(9));_=w>t?U-_:_,S=w>c?U-S:S,0>_&&(_=2*U+_),0>S&&(S=2*U+S),s&&_>S&&(_-=2*U),!s&&S>_&&(S-=2*U)}var T=S-_;if(q(T)>f){var C=S,R=c,N=u;S=_+f*(s&&S>_?1:-1),c=w+r*G.cos(S),u=A+i*G.sin(S),d=M(c,u,r,i,o,0,s,R,N,[S,C,w,A])}T=S-_;var D=G.cos(_),P=G.sin(_),k=G.cos(S),O=G.sin(S),B=G.tan(T/4),I=4/3*r*B,L=4/3*i*B,F=[t,n],j=[t+I*P,n-L*D],V=[c+I*O,u-L*k],W=[c,u];if(j[0]=2*F[0]-j[0],j[1]=2*F[1]-j[1],l)return[j,V,W].concat(d);d=[j,V,W].concat(d).join().split(",");for(var z=[],$=0,Y=d.length;Y>$;$++)z[$]=$%2?m(d[$-1],d[$],h).y:m(d[$],d[$+1],h).x;return z}function D(e,t,n,r,i,o,a,s){for(var c,u,l,p,f,h,d,m,y=[],g=[[],[]],v=0;2>v;++v)if(0==v?(u=6*e-12*n+6*i,c=-3*e+9*n-9*i+3*a,l=3*n-3*e):(u=6*t-12*r+6*o,c=-3*t+9*r-9*o+3*s,l=3*r-3*t),q(c)<1e-12){if(q(u)<1e-12)continue;p=-l/u,p>0&&1>p&&y.push(p)}else d=u*u-4*l*c,m=G.sqrt(d),0>d||(f=(-u+m)/(2*c),f>0&&1>f&&y.push(f),h=(-u-m)/(2*c),h>0&&1>h&&y.push(h));for(var x,b=y.length,E=b;b--;)p=y[b],x=1-p,g[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*i+p*p*p*a,g[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*s;return g[0][E]=e,g[1][E]=t,g[0][E+1]=a,g[1][E+1]=s,g[0].length=g[1].length=E+2,{min:{x:W.apply(0,g[0]),y:W.apply(0,g[1])},max:{x:z.apply(0,g[0]),y:z.apply(0,g[1])}}}function P(e,t){var n=!t&&i(e);if(!t&&n.curve)return s(n.curve);for(var r=C(e),o=t&&C(t),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u=(function(e,t,n){var r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(M.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i].concat(e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(N(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(N(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(R(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(R(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(R(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(R(t.x,t.y,t.X,t.Y))}return e}),l=function(e,t){if(e[t].length>7){e[t].shift();for(var n=e[t];n.length;)f[t]="A",o&&(h[t]="A"),e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),g=z(r.length,o&&o.length||0)}},p=function(e,t,n,i,a){e&&t&&"M"==e[a][0]&&"M"!=t[a][0]&&(t.splice(a,0,["M",i.x,i.y]),n.bx=0,n.by=0,n.x=e[a][1],n.y=e[a][2],g=z(r.length,o&&o.length||0))},f=[],h=[],d="",m="",y=0,g=z(r.length,o&&o.length||0);g>y;y++){r[y]&&(d=r[y][0]),"C"!=d&&(f[y]=d,y&&(m=f[y-1])),r[y]=u(r[y],a,m),"A"!=f[y]&&"C"==d&&(f[y]="C"),l(r,y),o&&(o[y]&&(d=o[y][0]),"C"!=d&&(h[y]=d,y&&(m=h[y-1])),o[y]=u(o[y],c,m),"A"!=h[y]&&"C"==d&&(h[y]="C"),l(o,y)),p(r,o,a,c,y),p(o,r,c,a,y);var v=r[y],x=o&&o[y],b=v.length,E=o&&x.length;a.x=v[b-2],a.y=v[b-1],a.bx=V(v[b-4])||a.x,a.by=V(v[b-3])||a.y,c.bx=o&&(V(x[E-4])||c.x),c.by=o&&(V(x[E-3])||c.y),c.x=o&&x[E-2],c.y=o&&x[E-1]}return o||(n.curve=s(r)),o?[r,o]:r}function k(e,t){if(!t)return e;var n,r,i,o,a,s,c;for(e=P(e),i=0,a=e.length;a>i;i++)for(c=e[i],o=1,s=c.length;s>o;o+=2)n=t.x(c[o],c[o+1]),r=t.y(c[o],c[o+1]),c[o]=n,c[o+1]=r;return e}function O(e,t){for(var n=[],r=0,i=e.length;i-2*!t>r;r+=2){var o=[{x:+e[r-2],y:+e[r-1]},{x:+e[r],y:+e[r+1]},{x:+e[r+2],y:+e[r+3]},{x:+e[r+4],y:+e[r+5]}];t?r?i-4==r?o[3]={x:+e[0],y:+e[1]}:i-2==r&&(o[2]={x:+e[0],y:+e[1]},o[3]={x:+e[2],y:+e[3]}):o[0]={x:+e[i-2],y:+e[i-1]}:i-4==r?o[3]=o[2]:r||(o[0]={x:+e[r],y:+e[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}var B=t.prototype,I=e.is,L=e._.clone,F="hasOwnProperty",j=/,?([a-z]),?/gi,V=parseFloat,G=Math,U=G.PI,W=G.min,z=G.max,$=G.pow,q=G.abs,Y=u(1),H=u(),K=u(0,1),X=e._unit2px,Q={path:function(e){return e.attr("path")},circle:function(e){var t=X(e);return S(t.cx,t.cy,t.r)},ellipse:function(e){var t=X(e);return S(t.cx||0,t.cy||0,t.rx,t.ry)},rect:function(e){var t=X(e);return _(t.x||0,t.y||0,t.width,t.height,t.rx,t.ry)},image:function(e){var t=X(e);return _(t.x||0,t.y||0,t.width,t.height)},line:function(e){return"M"+[e.attr("x1")||0,e.attr("y1")||0,e.attr("x2"),e.attr("y2")]},polyline:function(e){return"M"+e.attr("points")},polygon:function(e){return"M"+e.attr("points")+"z"},deflt:function(e){var t=e.node.getBBox();return _(t.x,t.y,t.width,t.height)}};e.path=i,e.path.getTotalLength=Y,e.path.getPointAtLength=H,e.path.getSubpath=function(e,t,n){if(this.getTotalLength(e)-n<1e-6)return K(e,t).end;var r=K(e,n,1);return t?K(r,t).end:r},B.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},B.getPointAtLength=function(e){return H(this.attr("d"),e)},B.getSubpath=function(t,n){return e.path.getSubpath(this.attr("d"),t,n)},e._.box=o,e.path.findDotsAtSegment=l,e.path.bezierBBox=p,e.path.isPointInsideBBox=f,e.path.isBBoxIntersect=h,e.path.intersection=x,e.path.intersectionNumber=b,e.path.isPointInside=w,e.path.getBBox=A,e.path.get=Q,e.path.toRelative=T,e.path.toAbsolute=C,e.path.toCubic=P,e.path.map=k,e.path.toString=a,e.path.clone=s}),r.plugin(function(e,n,r,i){for(var o=n.prototype,a="hasOwnProperty",s=("createTouch"in i.doc),c=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},l=(function(e,t){var n="y"==e?"scrollTop":"scrollLeft",r=t&&t.node?t.node.ownerDocument:i.doc;return r[n in r.documentElement?"documentElement":"body"][n]}),p=function(){this.returnValue=!1},f=function(){return this.originalEvent.preventDefault()},h=function(){this.cancelBubble=!0},d=function(){return this.originalEvent.stopPropagation()},m=function(){return i.doc.addEventListener?function(e,t,n,r){var i=s&&u[t]?u[t]:t,o=function(i){var o=l("y",r),c=l("x",r);if(s&&u[a](t))for(var p=0,h=i.targetTouches&&i.targetTouches.length;h>p;p++)if(i.targetTouches[p].target==e||e.contains(i.targetTouches[p].target)){var m=i;i=i.targetTouches[p],i.originalEvent=m,i.preventDefault=f,i.stopPropagation=d;break}var y=i.clientX+c,g=i.clientY+o;return n.call(r,i,y,g)};return t!==i&&e.addEventListener(t,o,!1),e.addEventListener(i,o,!1),function(){return t!==i&&e.removeEventListener(t,o,!1),e.removeEventListener(i,o,!1),!0}}:i.doc.attachEvent?function(e,t,n,r){var i=function(e){e=e||r.node.ownerDocument.window.event;var t=l("y",r),i=l("x",r),o=e.clientX+i,a=e.clientY+t;return e.preventDefault=e.preventDefault||p,e.stopPropagation=e.stopPropagation||h,n.call(r,e,o,a)};e.attachEvent("on"+t,i);var o=function(){return e.detachEvent("on"+t,i),!0};return o}:void 0}(),y=[],g=function(e){for(var n,r=e.clientX,i=e.clientY,o=l("y"),a=l("x"),c=y.length;c--;){if(n=y[c],s){for(var u,p=e.touches&&e.touches.length;p--;)if(u=e.touches[p],u.identifier==n.el._drag.id||n.el.node.contains(u.target)){r=u.clientX,i=u.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var f=n.el.node;f.nextSibling,f.parentNode,f.style.display;r+=a,i+=o,t("snap.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,e)}},v=function(n){e.unmousemove(g).unmouseup(v);for(var r,i=y.length;i--;)r=y[i],r.el._drag={},t("snap.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n);y=[]},x=c.length;x--;)!function(t){e[t]=o[t]=function(n,r){return e.is(n,"function")&&(this.events=this.events||[],this.events.push({name:t,f:n,unbind:m(this.node||document,t,n,r||this)})),this},e["un"+t]=o["un"+t]=function(e){for(var n=this.events||[],r=n.length;r--;)if(n[r].name==t&&(n[r].f==e||!e))return n[r].unbind(),n.splice(r,1),!n.length&&delete this.events,this;return this}}(c[x]);o.hover=function(e,t,n,r){return this.mouseover(e,n).mouseout(t,r||n)},o.unhover=function(e,t){return this.unmouseover(e).unmouseout(t)};var b=[];o.drag=function(n,r,i,o,a,s){function c(c,u,l){(c.originalEvent||c).preventDefault(),this._drag.x=u,this._drag.y=l,this._drag.id=c.identifier,!y.length&&e.mousemove(g).mouseup(v),y.push({el:this,move_scope:o,start_scope:a,end_scope:s}),r&&t.on("snap.drag.start."+this.id,r),n&&t.on("snap.drag.move."+this.id,n),i&&t.on("snap.drag.end."+this.id,i),t("snap.drag.start."+this.id,a||o||this,u,l,c)}if(!arguments.length){var u;return this.drag(function(e,t){this.attr({transform:u+(u?"T":"t")+[e,t]})},function(){u=this.transform().local})}return this._drag={},b.push({el:this,start:c}),this.mousedown(c),this},o.undrag=function(){for(var n=b.length;n--;)b[n].el==this&&(this.unmousedown(b[n].start),b.splice(n,1),t.unbind("snap.drag.*."+this.id));return!b.length&&e.unmousemove(g).unmouseup(v),this}}),r.plugin(function(e,n,r,i){var o=(n.prototype,r.prototype),a=/^\s*url\((.+)\)/,s=String,c=e._.$;e.filter={},o.filter=function(t){var r=this;"svg"!=r.type&&(r=r.paper);var i=e.parse(s(t)),o=e._.id(),a=(r.node.offsetWidth,r.node.offsetHeight,c("filter"));return c(a,{id:o,filterUnits:"userSpaceOnUse"}),a.appendChild(i.node),r.defs.appendChild(a),new n(a)},t.on("snap.util.getattr.filter",function(){t.stop();var n=c(this.node,"filter");if(n){var r=s(n).match(a);return r&&e.select(r[1])}}),t.on("snap.util.attr.filter",function(r){if(r instanceof n&&"filter"==r.type){t.stop();var i=r.node.id;i||(c(r.node,{id:r.id}),i=r.id),c(this.node,{filter:e.url(i)})}r&&"none"!=r||(t.stop(),this.node.removeAttribute("filter"))}),e.filter.blur=function(t,n){null==t&&(t=2);var r=null==n?t:[t,n];return e.format('<feGaussianBlur stdDeviation="{def}"/>',{def:r})},e.filter.blur.toString=function(){return this()},e.filter.shadow=function(t,n,r,i,o){return"string"==typeof r&&(i=r,o=i,r=4),"string"!=typeof i&&(o=i,i="#000"),i=i||"#000",null==r&&(r=4),null==o&&(o=1),null==t&&(t=0,n=2),null==n&&(n=t),i=e.color(i),e.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:i,dx:t,dy:n,blur:r,opacity:o})},e.filter.shadow.toString=function(){return this()},e.filter.grayscale=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-t),b:.7152-.7152*(1-t),c:.0722-.0722*(1-t),d:.2126-.2126*(1-t),e:.7152+.2848*(1-t),f:.0722-.0722*(1-t),g:.2126-.2126*(1-t),h:.0722+.9278*(1-t)})},e.filter.grayscale.toString=function(){return this()},e.filter.sepia=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-t),b:.769-.769*(1-t),c:.189-.189*(1-t),d:.349-.349*(1-t),e:.686+.314*(1-t),f:.168-.168*(1-t),g:.272-.272*(1-t),h:.534-.534*(1-t),i:.131+.869*(1-t)})},e.filter.sepia.toString=function(){return this()},e.filter.saturate=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-t})},e.filter.saturate.toString=function(){return this()},e.filter.hueRotate=function(t){return t=t||0,e.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:t})},e.filter.hueRotate.toString=function(){return this()},e.filter.invert=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:t,amount2:1-t})},e.filter.invert.toString=function(){return this()},e.filter.brightness=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:t})},e.filter.brightness.toString=function(){return this()},e.filter.contrast=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:t,amount2:.5-t/2})},e.filter.contrast.toString=function(){return this()}}),r})},{72:72}],74:[function(e,t,n){"use strict";var r=t.exports=e(73);r.plugin(function(e,t){t.prototype.children=function(){for(var t=[],n=this.node.childNodes,r=0,i=n.length;i>r;r++)t[r]=new e(n[r]);return t}}),r.plugin(function(e,t,n,r){function i(e){return e.split(/\s+/)}function o(e){return e.join(" ")}function a(e){return i(e.attr("class")||"")}function s(e,t){e.attr("class",o(t))}t.prototype.addClass=function(e){var t,n,r=a(this),o=i(e);for(t=0,n;n=o[t];t++)-1===r.indexOf(n)&&r.push(n);return s(this,r),this},t.prototype.hasClass=function(e){if(!e)throw new Error("[snapsvg] syntax: hasClass(clsStr)");return-1!==a(this).indexOf(e)},t.prototype.removeClass=function(e){var t,n,r,o=a(this),c=i(e);for(t=0,n;n=c[t];t++)r=o.indexOf(n),-1!==r&&o.splice(r,1);return s(this,o),this}}),r.plugin(function(e,t,n,r){t.prototype.translate=function(t,n){var r=new e.Matrix;return r.translate(t,n),this.transform(r)}}),r.plugin(function(e){e.create=function(t,n){return e._.wrap(e._.$(t,n))}}),r.plugin(function(e,t,n,r){e.createSnapAt=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("width",t),i.setAttribute("height",n),r||(r=document.body),r.appendChild(i),new e(i)}})},{73:73}],75:[function(e,t,n){var r=function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(){var e=Array.prototype.slice.call(arguments);1===e.length&&r(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t},o=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,a=/\/\*([^\*]*)\*\//m,s=function(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(o);return t[1]&&t[1].split(",").map(function(e){return t=e.match(a),t?t[1].trim():e.trim()})||[]};n.annotate=i,n.parse=s,n.isArray=r},{}],76:[function(e,t,n){t.exports={annotate:e(75).annotate,Module:e(78),Injector:e(77)}},{75:75,77:77,78:78}],77:[function(e,t,n){var r=e(78),i=e(75).parse,o=e(75).annotate,a=e(75).isArray,s=function(e,t){t=t||{get:function(e){throw n.push(e),p('No provider for "'+e+'"!')}};var n=[],c=this._providers=Object.create(t._providers||null),u=this._instances=Object.create(null),l=u.injector=this,p=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)},f=function(e){if(!c[e]&&-1!==e.indexOf(".")){for(var r=e.split("."),i=f(r.shift());r.length;)i=i[r.shift()];return i}if(Object.hasOwnProperty.call(u,e))return u[e];if(Object.hasOwnProperty.call(c,e)){if(-1!==n.indexOf(e))throw n.push(e),p("Cannot resolve circular dependency!");return n.push(e),u[e]=c[e][0](c[e][1]),n.pop(),u[e]}return t.get(e)},h=function(e){var t=Object.create(e.prototype),n=d(e,t);return"object"==typeof n?n:t},d=function(e,t){if("function"!=typeof e){if(!a(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=o(e.slice())}var n=e.$inject&&e.$inject||i(e),r=n.map(function(e){return f(e)});return e.apply(t,r)},m=function(e){return o(function(t){return e.get(t)})},y=function(e,t){if(t&&t.length){var n,r,i,o,a=Object.create(null),u=Object.create(null),p=[],f=[],h=[];for(var d in c)n=c[d],-1!==t.indexOf(d)&&("private"===n[2]?(r=p.indexOf(n[3]),-1===r?(i=n[3].createChild([],t),o=m(i),p.push(n[3]),f.push(i),h.push(o),a[d]=[o,d,"private",i]):a[d]=[h[r],d,"private",f[r]]):a[d]=[n[2],n[1]],u[d]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(a[d]=[n[2],n[1]],u[e]=!0)});t.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(a)}return new s(e,l)},g={factory:d,type:h,value:function(e){return e}};e.forEach(function(e){function t(e,t){return"value"!==e&&a(t)&&(t=o(t.slice())),t}if(e instanceof r)e.forEach(function(e){var n=e[0],r=e[1],i=e[2];c[n]=[g[r],t(r,i),r]});else if("object"==typeof e)if(e.__exports__){var n=Object.keys(e).reduce(function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t},Object.create(null)),i=new s((e.__modules__||[]).concat([n]),l),u=o(function(e){return i.get(e)});e.__exports__.forEach(function(e){c[e]=[u,e,"private",i]})}else Object.keys(e).forEach(function(n){if("private"===e[n][2])return void(c[n]=e[n]);var r=e[n][0],i=e[n][1];c[n]=[g[r],t(r,i),r]})}),this.get=f,this.invoke=d,this.instantiate=h,this.createChild=y};t.exports=s},{75:75,78:78}],78:[function(e,t,n){var r=function(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}};t.exports=r},{}],79:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],80:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],81:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return n&&c(e,t,n)&&(t=null),("function"!=typeof t||void 0!==n)&&(t=o(t,n,3)),r(e,t)}var i=e(97),o=e(104),a=e(109),s=e(166),c=e(154);t.exports=r},{104:104,109:109,154:154,166:166,97:97}],82:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return t=o(t,n,3),r(e,t)}var i=e(98),o=e(104),a=e(110),s=e(166);t.exports=r},{104:104,110:110,166:166,98:98}],83:[function(e,t,n){var r=e(108),i=e(143),o=i(r);t.exports=o},{108:108,143:143}],84:[function(e,t,n){var r=e(96),i=e(108),o=e(144),a=o(r,i);t.exports=a},{108:108,144:144,96:96}],85:[function(e,t,n){var r=e(138),i=Object.prototype,o=i.hasOwnProperty,a=r(function(e,t,n){o.call(e,n)?e[n].push(t):e[n]=[t]});t.exports=a},{138:138}],86:[function(e,t,n){function r(e,t,n,r){var f=e?o(e):0;return c(f)||(e=l(e),f=e.length),f?(n="number"!=typeof n||r&&s(t,n,r)?0:0>n?p(f+n,0):n||0,"string"==typeof e||!a(e)&&u(e)?f>n&&e.indexOf(t,n)>-1:i(e,t,n)>-1):!1}var i=e(118),o=e(149),a=e(166),s=e(154),c=e(156),u=e(172),l=e(181),p=Math.max;t.exports=r},{118:118,149:149,154:154,156:156,166:166,172:172,181:181}],87:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return t=o(t,n,3),r(e,t)}var i=e(99),o=e(104),a=e(123),s=e(166);t.exports=r},{104:104,123:123,166:166,99:99}],88:[function(e,t,n){var r=e(100),i=e(108),o=e(145),a=o(r,i);t.exports=a},{100:100,108:108,145:145}],89:[function(e,t,n){function r(e,t,n){var r=s(e)?i:a;return n&&c(e,t,n)&&(t=null),("function"!=typeof t||void 0!==n)&&(t=o(t,n,3)),r(e,t)}var i=e(101),o=e(104),a=e(132),s=e(166),c=e(154);t.exports=r},{101:101,104:104,132:132,154:154,166:166}],90:[function(e,t,n){var r=e(168),i=r(i=Date.now)&&i,o=i||function(){return(new Date).getTime()};t.exports=o},{168:168}],91:[function(e,t,n){function r(e,t,n){function r(){y&&clearTimeout(y),f&&clearTimeout(f),f=y=g=void 0}function c(){var n=t-(o()-d);if(0>=n||n>t){f&&clearTimeout(f);var r=g;f=y=g=void 0,r&&(v=o(),h=e.apply(m,p),y||f||(p=m=null))}else y=setTimeout(c,n)}function u(){y&&clearTimeout(y),f=y=g=void 0,(b||x!==t)&&(v=o(),h=e.apply(m,p),y||f||(p=m=null))}function l(){if(p=arguments,d=o(),m=this,g=b&&(y||!E),x===!1)var n=E&&!y;else{f||E||(v=d);var r=x-(d-v),i=0>=r||r>x;i?(f&&(f=clearTimeout(f)),v=d,h=e.apply(m,p)):f||(f=setTimeout(u,r))}return i&&y?y=clearTimeout(y):y||t===x||(y=setTimeout(c,t)),n&&(i=!0,h=e.apply(m,p)),!i||y||f||(p=m=null),h}var p,f,h,d,m,y,g,v=0,x=!1,b=!0;if("function"!=typeof e)throw new TypeError(a);if(t=0>t?0:+t||0,n===!0){var E=!0;b=!1}else i(n)&&(E=n.leading,x="maxWait"in n&&s(+n.maxWait||0,t),b="trailing"in n?n.trailing:b);return l.cancel=r,l}var i=e(170),o=e(90),a="Expected a function",s=Math.max;t.exports=r},{170:170,90:90}],92:[function(e,t,n){var r=e(106),i=e(93),o=i(function(e,t){return r(e,1,t)});t.exports=o},{106:106,93:93}],93:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(i);return t=o(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=o(n.length-t,0),a=Array(i);++r<i;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var i="Expected a function",o=Math.max;t.exports=r},{}],94:[function(e,t,n){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=e(137),o=e(168),a=o(a=n.Set)&&a,s=o(s=Object.create)&&s;r.prototype.push=i,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{137:137,168:168}],95:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],96:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],97:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=r},{}],98:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=-1,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[++i]=a)}return o}t.exports=r},{}],99:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],100:[function(e,t,n){function r(e,t,n,r){var i=-1,o=e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}t.exports=r},{}],101:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],102:[function(e,t,n){function r(e,t,n){var r=o(t);s.apply(r,i(t));for(var a=-1,c=r.length;++a<c;){var u=r[a],l=e[u],p=n(l,t[u],u,e,t);(p===p?p===l:l!==l)&&(void 0!==l||u in e)||(e[u]=p)}return e}var i=e(150),o=e(176),a=Array.prototype,s=a.push;t.exports=r},{150:150,176:176}],103:[function(e,t,n){var r=e(105),i=e(150),o=e(168),a=e(176),s=o(s=Object.preventExtensions)&&s,c=function(){var e=s&&o(e=Object.assign)&&e;try{if(e){var t=s({1:0});t[0]=1}}catch(n){try{e(t,"xo")}catch(n){}return!t[1]&&e}return!1}(),u=c||function(e,t){return null==t?e:r(t,i(t),r(t,a(t),e))};t.exports=u},{105:105,150:150,168:168,176:176}],104:[function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:a(e,t,n):null==e?s:"object"==r?i(e):void 0===t?c(e):o(e,t)}var i=e(124),o=e(125),a=e(135),s=e(185),c=e(186);
+t.exports=r},{124:124,125:125,135:135,185:185,186:186}],105:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}t.exports=r},{}],106:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)throw new TypeError(i);return setTimeout(function(){e.apply(void 0,n)},t)}var i="Expected a function";t.exports=r},{}],107:[function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var s=-1,c=i,u=!0,l=u&&t.length>=200?a(t):null,p=t.length;l&&(c=o,u=!1,t=l);e:for(;++s<n;){var f=e[s];if(u&&f===f){for(var h=p;h--;)if(t[h]===f)continue e;r.push(f)}else c(t,f,0)<0&&r.push(f)}return r}var i=e(118),o=e(136),a=e(142);t.exports=r},{118:118,136:136,142:142}],108:[function(e,t,n){var r=e(116),i=e(140),o=i(r);t.exports=o},{116:116,140:140}],109:[function(e,t,n){function r(e,t){var n=!0;return i(e,function(e,r,i){return n=!!t(e,r,i)}),n}var i=e(108);t.exports=r},{108:108}],110:[function(e,t,n){function r(e,t){var n=[];return i(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var i=e(108);t.exports=r},{108:108}],111:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,o){return t(e,n,o)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],112:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],113:[function(e,t,n){function r(e,t,n){for(var c=-1,u=e.length,l=-1,p=[];++c<u;){var f=e[c];if(s(f)&&a(f)&&(n||o(f)||i(f))){t&&(f=r(f,t,n));for(var h=-1,d=f.length;++h<d;)p[++l]=f[h]}else n||(p[++l]=f)}return p}var i=e(165),o=e(166),a=e(152),s=e(157);t.exports=r},{152:152,157:157,165:165,166:166}],114:[function(e,t,n){var r=e(141),i=r();t.exports=i},{141:141}],115:[function(e,t,n){function r(e,t){return i(e,t,o)}var i=e(114),o=e(177);t.exports=r},{114:114,177:177}],116:[function(e,t,n){function r(e,t){return i(e,t,o)}var i=e(114),o=e(176);t.exports=r},{114:114,176:176}],117:[function(e,t,n){function r(e,t,n){if(null!=e){void 0!==n&&n in i(e)&&(t=[n]);for(var r=-1,o=t.length;null!=e&&++r<o;)e=e[t[r]];return r&&r==o?e:void 0}}var i=e(163);t.exports=r},{163:163}],118:[function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=e(151);t.exports=r},{151:151}],119:[function(e,t,n){function r(e,t,n,o,a,s){if(e===t)return!0;var c=typeof e,u=typeof t;return"function"!=c&&"object"!=c&&"function"!=u&&"object"!=u||null==e||null==t?e!==e&&t!==t:i(e,t,r,n,o,a,s)}var i=e(120);t.exports=r},{120:120}],120:[function(e,t,n){function r(e,t,n,r,f,m,y){var g=s(e),v=s(t),x=l,b=l;g||(x=d.call(e),x==u?x=p:x!=p&&(g=c(e))),v||(b=d.call(t),b==u?b=p:b!=p&&(v=c(t)));var E=x==p,w=b==p,A=x==b;if(A&&!g&&!E)return o(e,t,x);if(!f){var _=E&&h.call(e,"__wrapped__"),S=w&&h.call(t,"__wrapped__");if(_||S)return n(_?e.value():e,S?t.value():t,r,f,m,y)}if(!A)return!1;m||(m=[]),y||(y=[]);for(var T=m.length;T--;)if(m[T]==e)return y[T]==t;m.push(e),y.push(t);var C=(g?i:a)(e,t,n,r,f,m,y);return m.pop(),y.pop(),C}var i=e(146),o=e(147),a=e(148),s=e(166),c=e(173),u="[object Arguments]",l="[object Array]",p="[object Object]",f=Object.prototype,h=f.hasOwnProperty,d=f.toString;t.exports=r},{146:146,147:147,148:148,166:166,173:173}],121:[function(e,t,n){function r(e){return"function"==typeof e||!1}t.exports=r},{}],122:[function(e,t,n){function r(e,t,n,r,o){for(var a=-1,s=t.length,c=!o;++a<s;)if(c&&r[a]?n[a]!==e[t[a]]:!(t[a]in e))return!1;for(a=-1;++a<s;){var u=t[a],l=e[u],p=n[a];if(c&&r[a])var f=void 0!==l||u in e;else f=o?o(l,p,u):void 0,void 0===f&&(f=i(p,l,o,!0));if(!f)return!1}return!0}var i=e(119);t.exports=r},{119:119}],123:[function(e,t,n){function r(e,t){var n=-1,r=o(e)?Array(e.length):[];return i(e,function(e,i,o){r[++n]=t(e,i,o)}),r}var i=e(108),o=e(152);t.exports=r},{108:108,152:152}],124:[function(e,t,n){function r(e){var t=s(e),n=t.length;if(!n)return o(!0);if(1==n){var r=t[0],u=e[r];if(a(u))return function(e){return null==e?!1:e[r]===u&&(void 0!==u||r in c(e))}}for(var l=Array(n),p=Array(n);n--;)u=e[t[n]],l[n]=u,p[n]=a(u);return function(e){return null!=e&&i(c(e),t,l,p)}}var i=e(122),o=e(184),a=e(158),s=e(176),c=e(163);t.exports=r},{122:122,158:158,163:163,176:176,184:184}],125:[function(e,t,n){function r(e,t){var n=s(e),r=c(e)&&u(t),h=e+"";return e=f(e),function(s){if(null==s)return!1;var c=h;if(s=p(s),!(!n&&r||c in s)){if(s=1==e.length?s:i(s,a(e,0,-1)),null==s)return!1;c=l(e),s=p(s)}return s[c]===t?void 0!==t||c in s:o(t,s[c],null,!0)}}var i=e(117),o=e(119),a=e(131),s=e(166),c=e(155),u=e(158),l=e(80),p=e(163),f=e(164);t.exports=r},{117:117,119:119,131:131,155:155,158:158,163:163,164:164,166:166,80:80}],126:[function(e,t,n){function r(e,t,n,h,m){if(!u(e))return e;var y=c(t)&&(s(t)||p(t));if(!y){var g=f(t);d.apply(g,a(t))}return i(g||t,function(i,a){if(g&&(a=i,i=t[a]),l(i))h||(h=[]),m||(m=[]),o(e,t,a,r,n,h,m);else{var s=e[a],c=n?n(s,i,a,e,t):void 0,u=void 0===c;u&&(c=i),!y&&void 0===c||!u&&(c===c?c===s:s!==s)||(e[a]=c)}}),e}var i=e(96),o=e(127),a=e(150),s=e(166),c=e(152),u=e(170),l=e(157),p=e(173),f=e(176),h=Array.prototype,d=h.push;t.exports=r},{127:127,150:150,152:152,157:157,166:166,170:170,173:173,176:176,96:96}],127:[function(e,t,n){function r(e,t,n,r,p,f,h){for(var d=f.length,m=t[n];d--;)if(f[d]==m)return void(e[n]=h[d]);var y=e[n],g=p?p(y,m,n,e,t):void 0,v=void 0===g;v&&(g=m,s(m)&&(a(m)||u(m))?g=a(y)?y:s(y)?i(y):[]:c(m)||o(m)?g=o(y)?l(y):c(y)?y:{}:v=!1),f.push(m),h.push(g),v?e[n]=r(g,m,p,f,h):(g===g?g!==y:y===y)&&(e[n]=g)}var i=e(95),o=e(165),a=e(166),s=e(152),c=e(171),u=e(173),l=e(174);t.exports=r},{152:152,165:165,166:166,171:171,173:173,174:174,95:95}],128:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}t.exports=r},{}],129:[function(e,t,n){function r(e){var t=e+"";return e=o(e),function(n){return i(n,e,t)}}var i=e(117),o=e(164);t.exports=r},{117:117,164:164}],130:[function(e,t,n){function r(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}t.exports=r},{}],131:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}t.exports=r},{}],132:[function(e,t,n){function r(e,t){var n;return i(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}var i=e(108);t.exports=r},{108:108}],133:[function(e,t,n){function r(e){return"string"==typeof e?e:null==e?"":e+""}t.exports=r},{}],134:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e[t[n]];return i}t.exports=r},{}],135:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=e(185);t.exports=r},{185:185}],136:[function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=e(170);t.exports=r},{170:170}],137:[function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=e(170);t.exports=r},{170:170}],138:[function(e,t,n){function r(e,t){return function(n,r,s){var c=t?t():{};if(r=i(r,s,3),a(n))for(var u=-1,l=n.length;++u<l;){var p=n[u];e(c,p,r(p,u,n),n)}else o(n,function(t,n,i){e(c,t,r(t,n,i),i)});return c}}var i=e(104),o=e(108),a=e(166);t.exports=r},{104:104,108:108,166:166}],139:[function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2&&n[a-2],c=a>2&&n[2],u=a>1&&n[a-1];for("function"==typeof s?(s=i(s,u,5),a-=2):(s="function"==typeof u?u:null,a-=s?1:0),c&&o(n[0],n[1],c)&&(s=3>a?null:s,a=1);++r<a;){var l=n[r];l&&e(t,l,s)}return t})}var i=e(135),o=e(154),a=e(93);t.exports=r},{135:135,154:154,93:93}],140:[function(e,t,n){function r(e,t){return function(n,r){var s=n?i(n):0;if(!o(s))return e(n,r);for(var c=t?s:-1,u=a(n);(t?c--:++c<s)&&r(u[c],c,u)!==!1;);return n}}var i=e(149),o=e(156),a=e(163);t.exports=r},{149:149,156:156,163:163}],141:[function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,c=e?s:-1;e?c--:++c<s;){var u=a[c];if(n(o[u],u,o)===!1)break}return t}}var i=e(163);t.exports=r},{163:163}],142:[function(e,t,n){(function(n){var r=e(94),i=e(184),o=e(168),a=o(a=n.Set)&&a,s=o(s=Object.create)&&s,c=s&&a?function(e){return new r(e)}:i(null);t.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{168:168,184:184,94:94}],143:[function(e,t,n){function r(e,t){return function(n,r,c){if(r=i(r,c,3),s(n)){var u=a(n,r,t);return u>-1?n[u]:void 0}return o(n,r,e)}}var i=e(104),o=e(111),a=e(112),s=e(166);t.exports=r},{104:104,111:111,112:112,166:166}],144:[function(e,t,n){function r(e,t){return function(n,r,a){return"function"==typeof r&&void 0===a&&o(n)?e(n,r):t(n,i(r,a,3))}}var i=e(135),o=e(166);t.exports=r},{135:135,166:166}],145:[function(e,t,n){function r(e,t){return function(n,r,s,c){var u=arguments.length<3;return"function"==typeof r&&void 0===c&&a(n)?e(n,r,s,u):o(n,i(r,c,4),s,u,t)}}var i=e(104),o=e(130),a=e(166);t.exports=r},{104:104,130:130,166:166}],146:[function(e,t,n){function r(e,t,n,r,i,o,a){var s=-1,c=e.length,u=t.length,l=!0;if(c!=u&&!(i&&u>c))return!1;for(;l&&++s<c;){var p=e[s],f=t[s];if(l=void 0,r&&(l=i?r(f,p,s):r(p,f,s)),void 0===l)if(i)for(var h=u;h--&&(f=t[h],!(l=p&&p===f||n(p,f,r,i,o,a))););else l=p&&p===f||n(p,f,r,i,o,a)}return!!l}t.exports=r},{}],147:[function(e,t,n){function r(e,t,n){switch(n){case i:case o:return+e==+t;case a:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:e==+t;case c:case u:return e==t+""}return!1}var i="[object Boolean]",o="[object Date]",a="[object Error]",s="[object Number]",c="[object RegExp]",u="[object String]";t.exports=r},{}],148:[function(e,t,n){function r(e,t,n,r,o,s,c){var u=i(e),l=u.length,p=i(t),f=p.length;if(l!=f&&!o)return!1;for(var h=o,d=-1;++d<l;){var m=u[d],y=o?m in t:a.call(t,m);if(y){var g=e[m],v=t[m];y=void 0,r&&(y=o?r(v,g,m):r(g,v,m)),void 0===y&&(y=g&&g===v||n(g,v,r,o,s,c))}if(!y)return!1;h||(h="constructor"==m)}if(!h){var x=e.constructor,b=t.constructor;if(x!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b))return!1}return!0}var i=e(176),o=Object.prototype,a=o.hasOwnProperty;t.exports=r},{176:176}],149:[function(e,t,n){var r=e(128),i=r("length");t.exports=i},{128:128}],150:[function(e,t,n){var r=e(184),i=e(168),o=e(163),a=i(a=Object.getOwnPropertySymbols)&&a,s=a?function(e){return a(o(e))}:r([]);t.exports=s},{163:163,168:168,184:184}],151:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}t.exports=r},{}],152:[function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=e(149),o=e(156);t.exports=r},{149:149,156:156}],153:[function(e,t,n){function r(e,t){return e=+e,t=null==t?i:t,e>-1&&e%1==0&&t>e}var i=Math.pow(2,53)-1;t.exports=r},{}],154:[function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=e(152),o=e(153),a=e(170);t.exports=r},{152:152,153:153,170:170}],155:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!a.test(e);return r||null!=t&&e in o(t)}var i=e(166),o=e(163),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r},{163:163,166:166}],156:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=Math.pow(2,53)-1;t.exports=r},{}],157:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],158:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e(170);t.exports=r},{170:170}],159:[function(e,t,n){function r(e,t){e=i(e);for(var n=-1,r=t.length,o={};++n<r;){var a=t[n];a in e&&(o[a]=e[a])}return o}var i=e(163);t.exports=r},{163:163}],160:[function(e,t,n){function r(e,t){var n={};return i(e,function(e,r,i){t(e,r,i)&&(n[r]=e)}),n}var i=e(115);t.exports=r},{115:115}],161:[function(e,t,n){function r(e){var t;if(!o(e)||u.call(e)!=a||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=e(115),o=e(157),a="[object Object]",s=Object.prototype,c=s.hasOwnProperty,u=s.toString;t.exports=r},{115:115,157:157}],162:[function(e,t,n){function r(e){for(var t=c(e),n=t.length,r=n&&e.length,l=r&&s(r)&&(o(e)||u.nonEnumArgs&&i(e)),f=-1,h=[];++f<n;){var d=t[f];(l&&a(d,r)||p.call(e,d))&&h.push(d)}return h}var i=e(165),o=e(166),a=e(153),s=e(156),c=e(177),u=e(183),l=Object.prototype,p=l.hasOwnProperty;t.exports=r},{153:153,156:156,165:165,166:166,177:177,183:183}],163:[function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=e(170);t.exports=r},{170:170}],164:[function(e,t,n){function r(e){if(o(e))return e;var t=[];return i(e).replace(a,function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)}),t}var i=e(133),o=e(166),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=r},{133:133,166:166}],165:[function(e,t,n){function r(e){return o(e)&&i(e)&&c.call(e)==a}var i=e(152),o=e(157),a="[object Arguments]",s=Object.prototype,c=s.toString;t.exports=r},{152:152,157:157}],166:[function(e,t,n){var r=e(156),i=e(168),o=e(157),a="[object Array]",s=Object.prototype,c=s.toString,u=i(u=Array.isArray)&&u,l=u||function(e){return o(e)&&r(e.length)&&c.call(e)==a};t.exports=l},{156:156,157:157,168:168}],167:[function(e,t,n){(function(n){var r=e(121),i=e(168),o="[object Function]",a=Object.prototype,s=a.toString,c=i(c=n.Uint8Array)&&c,u=r(/x/)||c&&!r(c)?function(e){return s.call(e)==o}:r;t.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{121:121,168:168}],168:[function(e,t,n){function r(e){return null==e?!1:l.call(e)==a?p.test(u.call(e)):o(e)&&s.test(e)}var i=e(182),o=e(157),a="[object Function]",s=/^\[object .+?Constructor\]$/,c=Object.prototype,u=Function.prototype.toString,l=c.toString,p=RegExp("^"+i(l).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{157:157,182:182}],169:[function(e,t,n){function r(e){return"number"==typeof e||i(e)&&s.call(e)==o}var i=e(157),o="[object Number]",a=Object.prototype,s=a.toString;t.exports=r},{157:157}],170:[function(e,t,n){function r(e){var t=typeof e;return"function"==t||!!e&&"object"==t}t.exports=r},{}],171:[function(e,t,n){var r=e(168),i=e(161),o="[object Object]",a=Object.prototype,s=a.toString,c=r(c=Object.getPrototypeOf)&&c,u=c?function(e){if(!e||s.call(e)!=o)return!1;var t=e.valueOf,n=r(t)&&(n=c(t))&&c(n);return n?e==n||c(e)==n:i(e)}:i;t.exports=u},{161:161,168:168}],172:[function(e,t,n){function r(e){return"string"==typeof e||i(e)&&s.call(e)==o}var i=e(157),o="[object String]",a=Object.prototype,s=a.toString;t.exports=r},{157:157}],173:[function(e,t,n){function r(e){return o(e)&&i(e.length)&&!!N[D.call(e)]}var i=e(156),o=e(157),a="[object Arguments]",s="[object Array]",c="[object Boolean]",u="[object Date]",l="[object Error]",p="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",y="[object Set]",g="[object String]",v="[object WeakMap]",x="[object ArrayBuffer]",b="[object Float32Array]",E="[object Float64Array]",w="[object Int8Array]",A="[object Int16Array]",_="[object Int32Array]",S="[object Uint8Array]",T="[object Uint8ClampedArray]",C="[object Uint16Array]",R="[object Uint32Array]",N={};N[b]=N[E]=N[w]=N[A]=N[_]=N[S]=N[T]=N[C]=N[R]=!0,N[a]=N[s]=N[x]=N[c]=N[u]=N[l]=N[p]=N[f]=N[h]=N[d]=N[m]=N[y]=N[g]=N[v]=!1;var M=Object.prototype,D=M.toString;t.exports=r},{156:156,157:157}],174:[function(e,t,n){function r(e){return i(e,o(e))}var i=e(105),o=e(177);t.exports=r},{105:105,177:177}],175:[function(e,t,n){var r=e(102),i=e(103),o=e(139),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});t.exports=a},{102:102,103:103,139:139}],176:[function(e,t,n){var r=e(152),i=e(168),o=e(170),a=e(162),s=i(s=Object.keys)&&s,c=s?function(e){var t=null!=e&&e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&r(e)?a(e):o(e)?s(e):[]}:a;t.exports=c},{152:152,162:162,168:168,170:170}],177:[function(e,t,n){function r(e){if(null==e)return[];c(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||u.nonEnumArgs&&i(e))&&t||0;for(var n=e.constructor,r=-1,l="function"==typeof n&&n.prototype===e,f=Array(t),h=t>0;++r<t;)f[r]=r+"";for(var d in e)h&&a(d,t)||"constructor"==d&&(l||!p.call(e,d))||f.push(d);return f}var i=e(165),o=e(166),a=e(153),s=e(156),c=e(170),u=e(183),l=Object.prototype,p=l.hasOwnProperty;t.exports=r},{153:153,156:156,165:165,166:166,170:170,183:183}],178:[function(e,t,n){var r=e(126),i=e(139),o=i(r);t.exports=o},{126:126,139:139}],179:[function(e,t,n){var r=e(99),i=e(107),o=e(113),a=e(135),s=e(177),c=e(159),u=e(160),l=e(93),p=l(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=r(o(t),String);return c(e,i(s(e),t))}var n=a(t[0],t[1],3);return u(e,function(e,t,r){return!n(e,t,r)})});t.exports=p},{107:107,113:113,135:135,159:159,160:160,177:177,93:93,99:99}],180:[function(e,t,n){var r=e(113),i=e(135),o=e(159),a=e(160),s=e(93),c=s(function(e,t){return null==e?{}:"function"==typeof t[0]?a(e,i(t[0],t[1],3)):o(e,r(t))});t.exports=c},{113:113,135:135,159:159,160:160,93:93}],181:[function(e,t,n){function r(e){return i(e,o(e))}var i=e(134),o=e(176);t.exports=r},{134:134,176:176}],182:[function(e,t,n){function r(e){return e=i(e),e&&a.test(e)?e.replace(o,"\\$&"):e}var i=e(133),o=/[.*+?^${}()|[\]\/\\]/g,a=RegExp(o.source);t.exports=r},{133:133}],183:[function(e,t,n){(function(e){var n=Object.prototype,r=(r=e.window)&&r.document,i=n.propertyIsEnumerable,o={};!function(e){var t=function(){this.x=e},n=arguments,a=[];t.prototype={valueOf:e,y:e};for(var s in new t)a.push(s);o.funcDecomp=/\bthis\b/.test(function(){return this}),o.funcNames="string"==typeof Function.name;try{o.dom=11===r.createDocumentFragment().nodeType}catch(c){o.dom=!1}try{o.nonEnumArgs=!i.call(n,1)}catch(c){o.nonEnumArgs=!0}}(1,0),t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],184:[function(e,t,n){function r(e){return function(){return e}}t.exports=r},{}],185:[function(e,t,n){function r(e){return e}t.exports=r},{}],186:[function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=e(128),o=e(129),a=e(155);t.exports=r},{128:128,129:129,155:155}],187:[function(e,t,n){t.exports=e(194)},{194:194}],188:[function(e,t,n){t.exports=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}},{}],189:[function(e,t,n){t.exports=e(197)},{197:197}],190:[function(e,t,n){t.exports=e(201)},{201:201}],191:[function(e,t,n){t.exports=e(198)},{198:198}],192:[function(e,t,n){t.exports=e(200)},{200:200}],193:[function(e,t,n){t.exports=function(e){e.parentNode&&e.parentNode.removeChild(e)}},{}],194:[function(e,t,n){function r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}var i=e(195),o=/\s+/,a=Object.prototype.toString;t.exports=function(e){return new r(e)},r.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),n=i(t,e);return~n||t.push(e),this.el.className=t.join(" "),this},r.prototype.remove=function(e){if("[object RegExp]"==a.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=i(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},r.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},r.prototype.toggle=function(e,t){return this.list?("undefined"!=typeof t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):("undefined"!=typeof t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},r.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),n=t.split(o);return""===n[0]&&n.shift(),n},r.prototype.has=r.prototype.contains=function(e){return this.list?this.list.contains(e):!!~i(this.array(),e)}},{195:195}],195:[function(e,t,n){t.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],196:[function(e,t,n){var r=e(199);t.exports=function(e,t,n,i){for(e=n?{parentNode:e}:e,i=i||document;(e=e.parentNode)&&e!==document;){if(r(e,t))return e;if(e===i)return}}},{199:199}],197:[function(e,t,n){var r=e(196),i=e(198);n.bind=function(e,t,n,o,a){return i.bind(e,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=r(i,t,!0,e),n.delegateTarget&&o.call(e,n)},a)},n.unbind=function(e,t,n,r){i.unbind(e,t,n,r)}},{196:196,198:198}],198:[function(e,t,n){var r=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==r?"on":"";n.bind=function(e,t,n,i){return e[r](o+t,n,i||!1),n},n.unbind=function(e,t,n,r){return e[i](o+t,n,r||!1),n}},{}],199:[function(e,t,n){function r(e,t){if(!e||1!==e.nodeType)return!1;if(a)return a.call(e,t);for(var n=i.all(t,e.parentNode),r=0;r<n.length;++r)if(n[r]==e)return!0;return!1}var i=e(200),o=Element.prototype,a=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;t.exports=r},{200:200}],200:[function(e,t,n){function r(e,t){return t.querySelector(e)}n=t.exports=function(e,t){return t=t||document,r(e,t)},n.all=function(e,t){return t=t||document,t.querySelectorAll(e)},n.engine=function(e){if(!e.one)throw new Error(".one callback required");if(!e.all)throw new Error(".all callback required");return r=e.one,n.all=e.all,n}},{}],201:[function(e,t,n){function r(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=t.createElement("html");return i.innerHTML=e,i.removeChild(i.lastChild)}var o=a[r]||a._default,s=o[0],c=o[1],u=o[2],i=t.createElement("div");for(i.innerHTML=c+e+u;s--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);for(var l=t.createDocumentFragment();i.firstChild;)l.appendChild(i.removeChild(i.firstChild));return l}t.exports=r;var i=document.createElement("div");i.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var o=!i.getElementsByTagName("link").length;i=void 0;var a={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:o?[1,"X<div>","</div>"]:[0,"",""]};a.td=a.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],a.option=a.optgroup=[1,'<select multiple="multiple">',"</select>"],a.thead=a.tbody=a.colgroup=a.caption=a.tfoot=[1,"<table>","</table>"],a.polyline=a.ellipse=a.polygon=a.circle=a.text=a.line=a.path=a.rect=a.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],202:[function(e,t,n){t.exports=e(204),t.exports.Collection=e(203)},{203:203,204:204}],203:[function(e,t,n){"use strict";function r(e,t,n,r){var i=n.inverse;return e.remove=function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e},e.contains=function(e){return-1!==this.indexOf(e)},e.add=function(e){this.contains(e)||(this.push(e),t.set(e,i,r))},e}t.exports.extend=r},{}],204:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function i(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:s.extend(n[t.name]||[],e,t,n)})}function o(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var o=i;i=null,o&&e.unset(o,r,n),i=t,e.set(i,r,n)}}})}function a(e,t){return this instanceof a?(e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,void(this.props[t.name]=t)):new a(e,t)}var s=e(203);a.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?i(this,t,e):o(this,t,e)},a.prototype.ensureBound=function(e,t){r(e,t)||this.bind(e,t)},a.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?e[t.name].remove(n):e[t.name]=void 0)},a.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?e[t.name].add(n):e[t.name]=n)},t.exports=a},{203:203}]},{},[1])(1)}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js
new file mode 100644
index 0000000..26557db
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js
@@ -0,0 +1,27080 @@
+/*!
+ * bpmn-js - bpmn-viewer v0.10.3
+
+ * Copyright 2014, 2015 camunda Services GmbH and other contributors
+ *
+ * Released under the bpmn.io license
+ * http://bpmn.io/license
+ *
+ * Source Code: https://github.com/bpmn-io/bpmn-js
+ *
+ * Date: 2015-05-18
+ */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.BpmnJS=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168),
+ omit = _dereq_(172),
+ isString = _dereq_(165),
+ isNumber = _dereq_(162);
+
+var domify = _dereq_(183),
+ domQuery = _dereq_(184),
+ domRemove = _dereq_(185);
+
+var Diagram = _dereq_(35),
+ BpmnModdle = _dereq_(14);
+
+var Importer = _dereq_(8);
+
+
+function initListeners(diagram, listeners) {
+ var events = diagram.get('eventBus');
+
+ listeners.forEach(function(l) {
+ events.on(l.event, l.handler);
+ });
+}
+
+function checkValidationError(err) {
+
+ // check if we can help the user by indicating wrong BPMN 2.0 xml
+ // (in case he or the exporting tool did not get that right)
+
+ var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
+ var match = pattern.exec(err.message);
+
+ if (match) {
+ err.message =
+ 'unparsable content <' + match[1] + '> detected; ' +
+ 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
+ }
+
+ return err;
+}
+
+var DEFAULT_OPTIONS = {
+ width: '100%',
+ height: '100%',
+ position: 'relative',
+ container: 'body'
+};
+
+
+/**
+ * Ensure the passed argument is a proper unit (defaulting to px)
+ */
+function ensureUnit(val) {
+ return val + (isNumber(val) ? 'px' : '');
+}
+
+/**
+ * A viewer for BPMN 2.0 diagrams.
+ *
+ * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include
+ * additional features.
+ *
+ *
+ * ## Extending the Viewer
+ *
+ * In order to extend the viewer pass extension modules to bootstrap via the
+ * `additionalModules` option. An extension module is an object that exposes
+ * named services.
+ *
+ * The following example depicts the integration of a simple
+ * logging component that integrates with interaction events:
+ *
+ *
+ * ```javascript
+ *
+ * // logging component
+ * function InteractionLogger(eventBus) {
+ * eventBus.on('element.hover', function(event) {
+ * console.log()
+ * })
+ * }
+ *
+ * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
+ *
+ * // extension module
+ * var extensionModule = {
+ * __init__: [ 'interactionLogger' ],
+ * interactionLogger: [ 'type', InteractionLogger ]
+ * };
+ *
+ * // extend the viewer
+ * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });
+ * bpmnViewer.importXML(...);
+ * ```
+ *
+ * @param {Object} [options] configuration options to pass to the viewer
+ * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.
+ * @param {String|Number} [options.width] the width of the viewer
+ * @param {String|Number} [options.height] the height of the viewer
+ * @param {Object} [options.moddleExtensions] extension packages to provide
+ * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules
+ * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules
+ */
+function Viewer(options) {
+
+ this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
+
+ var parent = options.container;
+
+ // support jquery element
+ // unwrap it if passed
+ if (parent.get) {
+ parent = parent.get(0);
+ }
+
+ // support selector
+ if (isString(parent)) {
+ parent = domQuery(parent);
+ }
+
+ var container = this.container = domify('<div class="bjs-container"></div>');
+ parent.appendChild(container);
+
+ assign(container.style, {
+ width: ensureUnit(options.width),
+ height: ensureUnit(options.height),
+ position: options.position
+ });
+
+ /**
+ * The code in the <project-logo></project-logo> area
+ * must not be changed, see http://bpmn.io/license for more information
+ *
+ * <project-logo>
+ */
+
+ /* jshint -W101 */
+
+ // inlined ../resources/bpmnjs.png
+ var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
+
+ /* jshint +W101 */
+
+ var linkMarkup =
+ '<a href="http://bpmn.io" ' +
+ 'target="_blank" ' +
+ 'class="bjs-powered-by" ' +
+ 'title="Powered by bpmn.io" ' +
+ 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
+ '<img src="data:image/png;base64,' + logoData + '">' +
+ '</a>';
+
+ container.appendChild(domify(linkMarkup));
+
+ /* </project-logo> */
+}
+
+Viewer.prototype.importXML = function(xml, done) {
+
+ var self = this;
+
+ this.moddle = this.createModdle();
+
+ this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
+
+ if (err) {
+ err = checkValidationError(err);
+ return done(err);
+ }
+
+ var parseWarnings = context.warnings;
+
+ self.importDefinitions(definitions, function(err, importWarnings) {
+ if (err) {
+ return done(err);
+ }
+
+ done(null, parseWarnings.concat(importWarnings || []));
+ });
+ });
+};
+
+Viewer.prototype.saveXML = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var definitions = this.definitions;
+
+ if (!definitions) {
+ return done(new Error('no definitions loaded'));
+ }
+
+ this.moddle.toXML(definitions, options, done);
+};
+
+Viewer.prototype.createModdle = function() {
+ return new BpmnModdle(this.options.moddleExtensions);
+};
+
+Viewer.prototype.saveSVG = function(options, done) {
+
+ if (!done) {
+ done = options;
+ options = {};
+ }
+
+ var canvas = this.get('canvas');
+
+ var contentNode = canvas.getDefaultLayer(),
+ defsNode = canvas._svg.select('defs');
+
+ var contents = contentNode.innerSVG(),
+ defs = (defsNode && defsNode.outerSVG()) || '';
+
+ var bbox = contentNode.getBBox();
+
+ var svg =
+ '<?xml version="1.0" encoding="utf-8"?>\n' +
+ '<!-- created with bpmn-js / http://bpmn.io -->\n' +
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
+ '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
+ 'width="' + bbox.width + '" height="' + bbox.height + '" ' +
+ 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
+ defs + contents +
+ '</svg>';
+
+ done(null, svg);
+};
+
+Viewer.prototype.get = function(name) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.get(name);
+};
+
+Viewer.prototype.invoke = function(fn) {
+
+ if (!this.diagram) {
+ throw new Error('no diagram loaded');
+ }
+
+ return this.diagram.invoke(fn);
+};
+
+Viewer.prototype.importDefinitions = function(definitions, done) {
+
+ // use try/catch to not swallow synchronous exceptions
+ // that may be raised during model parsing
+ try {
+ if (this.diagram) {
+ this.clear();
+ }
+
+ this.definitions = definitions;
+
+ var diagram = this.diagram = this._createDiagram(this.options);
+
+ this._init(diagram);
+
+ Importer.importBpmnDiagram(diagram, definitions, done);
+ } catch (e) {
+ done(e);
+ }
+};
+
+Viewer.prototype._init = function(diagram) {
+ initListeners(diagram, this.__listeners || []);
+};
+
+Viewer.prototype._createDiagram = function(options) {
+
+ var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
+
+ // add self as an available service
+ modules.unshift({
+ bpmnjs: [ 'value', this ],
+ moddle: [ 'value', this.moddle ]
+ });
+
+ options = omit(options, 'additionalModules');
+
+ options = assign(options, {
+ canvas: { container: this.container },
+ modules: modules
+ });
+
+ return new Diagram(options);
+};
+
+
+Viewer.prototype.getModules = function() {
+ return this._modules;
+};
+
+/**
+ * Remove all drawn elements from the viewer.
+ *
+ * After calling this method the viewer can still
+ * be reused for opening another diagram.
+ */
+Viewer.prototype.clear = function() {
+ var diagram = this.diagram;
+
+ if (diagram) {
+ diagram.destroy();
+ }
+};
+
+/**
+ * Destroy the viewer instance and remove all its remainders
+ * from the document tree.
+ */
+Viewer.prototype.destroy = function() {
+ // clear underlying diagram
+ this.clear();
+
+ // remove container
+ domRemove(this.container);
+};
+
+/**
+ * Register an event listener on the viewer
+ *
+ * @param {String} event
+ * @param {Function} handler
+ */
+Viewer.prototype.on = function(event, handler) {
+ var diagram = this.diagram,
+ listeners = this.__listeners = this.__listeners || [];
+
+ listeners.push({ event: event, handler: handler });
+
+ if (diagram) {
+ diagram.get('eventBus').on(event, handler);
+ }
+};
+
+// modules the viewer is composed of
+Viewer.prototype._modules = [
+ _dereq_(2),
+ _dereq_(55),
+ _dereq_(51)
+];
+
+module.exports = Viewer;
+
+},{"14":14,"162":162,"165":165,"168":168,"172":172,"183":183,"184":184,"185":185,"2":2,"35":35,"51":51,"55":55,"8":8}],2:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [
+ _dereq_(5),
+ _dereq_(10)
+ ]
+};
+},{"10":10,"5":5}],3:[function(_dereq_,module,exports){
+'use strict';
+
+var inherits = _dereq_(72),
+ isArray = _dereq_(159),
+ isObject = _dereq_(163),
+ assign = _dereq_(168),
+ forEach = _dereq_(77),
+ every = _dereq_(74),
+ includes = _dereq_(79),
+ some = _dereq_(82);
+
+var DefaultRenderer = _dereq_(43),
+ TextUtil = _dereq_(64),
+ DiUtil = _dereq_(11);
+
+var createLine = DefaultRenderer.createLine;
+
+
+function BpmnRenderer(events, styles, pathMap) {
+
+ DefaultRenderer.call(this, styles);
+
+ var TASK_BORDER_RADIUS = 10;
+ var INNER_OUTER_DIST = 3;
+
+ var LABEL_STYLE = {
+ fontFamily: 'Arial, sans-serif',
+ fontSize: '12px'
+ };
+
+ var textUtil = new TextUtil({
+ style: LABEL_STYLE,
+ size: { width: 100 }
+ });
+
+ var markers = {};
+
+ function addMarker(id, element) {
+ markers[id] = element;
+ }
+
+ function marker(id) {
+ return markers[id];
+ }
+
+ function initMarkers(svg) {
+
+ function createMarker(id, options) {
+ var attrs = assign({
+ fill: 'black',
+ strokeWidth: 1,
+ strokeLinecap: 'round',
+ strokeDasharray: 'none'
+ }, options.attrs);
+
+ var ref = options.ref || { x: 0, y: 0 };
+
+ var scale = options.scale || 1;
+
+ // fix for safari / chrome / firefox bug not correctly
+ // resetting stroke dash array
+ if (attrs.strokeDasharray === 'none') {
+ attrs.strokeDasharray = [10000, 1];
+ }
+
+ var marker = options.element
+ .attr(attrs)
+ .marker(0, 0, 20, 20, ref.x, ref.y)
+ .attr({
+ markerWidth: 20 * scale,
+ markerHeight: 20 * scale
+ });
+
+ return addMarker(id, marker);
+ }
+
+
+ createMarker('sequenceflow-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('messageflow-start', {
+ element: svg.circle(6, 6, 3.5),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 6, y: 6 }
+ });
+
+ createMarker('messageflow-end', {
+ element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black',
+ strokeLinecap: 'butt'
+ },
+ ref: { x: 8.5, y: 5 }
+ });
+
+ createMarker('data-association-end', {
+ element: svg.path('M 1 5 L 11 10 L 1 15'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: 11, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-flow-marker', {
+ element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
+ attrs: {
+ fill: 'white',
+ stroke: 'black'
+ },
+ ref: { x: -1, y: 10 },
+ scale: 0.5
+ });
+
+ createMarker('conditional-default-flow-marker', {
+ element: svg.path('M 1 4 L 5 16'),
+ attrs: {
+ stroke: 'black'
+ },
+ ref: { x: -5, y: 10 },
+ scale: 0.5
+ });
+ }
+
+ function computeStyle(custom, traits, defaultStyles) {
+ if (!isArray(traits)) {
+ defaultStyles = traits;
+ traits = [];
+ }
+
+ return styles.style(traits || [], assign(defaultStyles, custom || {}));
+ }
+
+ function drawCircle(p, width, height, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ var cx = width / 2,
+ cy = height / 2;
+
+ return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
+ }
+
+ function drawRect(p, width, height, r, offset, attrs) {
+
+ if (isObject(offset)) {
+ attrs = offset;
+ offset = 0;
+ }
+
+ offset = offset || 0;
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
+ }
+
+ function drawDiamond(p, width, height, attrs) {
+
+ var x_2 = width / 2;
+ var y_2 = height / 2;
+
+ var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];
+
+ attrs = computeStyle(attrs, {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return p.polygon(points).attr(attrs);
+ }
+
+ function drawLine(p, waypoints, attrs) {
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ stroke: 'black',
+ strokeWidth: 2,
+ fill: 'none'
+ });
+
+ return createLine(waypoints, attrs).appendTo(p);
+ }
+
+ function drawPath(p, d, attrs) {
+
+ attrs = computeStyle(attrs, [ 'no-fill' ], {
+ strokeWidth: 2,
+ stroke: 'black'
+ });
+
+ return p.path(d).attr(attrs);
+ }
+
+ function as(type) {
+ return function(p, element) {
+ return handlers[type](p, element);
+ };
+ }
+
+ function renderer(type) {
+ return handlers[type];
+ }
+
+ function renderEventContent(element, p) {
+
+ var event = getSemantic(element);
+ var isThrowing = isThrowEvent(event);
+
+ if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
+ return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
+ return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
+ return renderer('bpmn:ConditionalEventDefinition')(p, element);
+ }
+
+ if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
+ return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {
+ return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
+ isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {
+ return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
+ return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
+ return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
+ return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
+ return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
+ return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
+ }
+
+ if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
+ return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
+ }
+
+ return null;
+ }
+
+ function renderLabel(p, label, options) {
+ return textUtil.createText(p, label || '', options).addClass('djs-label');
+ }
+
+ function renderEmbeddedLabel(p, element, align) {
+ var semantic = getSemantic(element);
+ return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });
+ }
+
+ function renderExternalLabel(p, element, align) {
+ var semantic = getSemantic(element);
+
+ if (!semantic.name) {
+ element.hidden = true;
+ }
+
+ return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });
+ }
+
+ function renderLaneLabel(p, text, element) {
+ var textBox = renderLabel(p, text, {
+ box: { height: 30, width: element.height },
+ align: 'center-middle'
+ });
+
+ var top = -1 * element.height;
+ textBox.transform(
+ 'rotate(270) ' +
+ 'translate(' + top + ',' + 0 + ')'
+ );
+ }
+
+ function createPathFromConnection(connection) {
+ var waypoints = connection.waypoints;
+
+ var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;
+ for (var i = 1; i < waypoints.length; i++) {
+ pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
+ }
+ return pathData;
+ }
+
+ var handlers = {
+ 'bpmn:Event': function(p, element, attrs) {
+ return drawCircle(p, element.width, element.height, attrs);
+ },
+ 'bpmn:StartEvent': function(p, element) {
+ var attrs = {};
+ var semantic = getSemantic(element);
+
+ if (!semantic.isInterrupting) {
+ attrs = {
+ strokeDasharray: '6',
+ strokeLinecap: 'round'
+ };
+ }
+
+ var circle = renderer('bpmn:Event')(p, element, attrs);
+
+ renderEventContent(element, p);
+
+ return circle;
+ },
+ 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.235,
+ my: 0.315
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'white';
+ var stroke = isThrowing ? 'white' : 'black';
+
+ var messagePath = drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill,
+ stroke: stroke
+ });
+
+ return messagePath;
+ },
+ 'bpmn:TimerEventDefinition': function(p, element) {
+
+ var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
+ strokeWidth: 2
+ });
+
+ var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ drawPath(p, pathData, {
+ strokeWidth: 2,
+ strokeLinecap: 'square'
+ });
+
+ for(var i = 0;i < 12;i++) {
+
+ var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
+ xScaleFactor: 0.75,
+ yScaleFactor: 0.75,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.5,
+ my: 0.5
+ }
+ });
+
+ var width = element.width / 2;
+ var height = element.height / 2;
+
+ drawPath(p, linePathData, {
+ strokeWidth: 1,
+ strokeLinecap: 'square',
+ transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
+ });
+ }
+
+ return circle;
+ },
+ 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.555
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ConditionalEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.222
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_LINK', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.57,
+ my: 0.263
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_ERROR', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.2,
+ my: 0.722
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
+ xScaleFactor: 1.0,
+ yScaleFactor: 1.0,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.638,
+ my: -0.055
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ }).transform('rotate(45)');
+ },
+ 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.201,
+ my: 0.472
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.5,
+ my: 0.2
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
+ var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
+ xScaleFactor: 1.1,
+ yScaleFactor: 1.1,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.222,
+ my: 0.36
+ }
+ });
+
+ var fill = isThrowing ? 'black' : 'none';
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: fill
+ });
+ },
+ 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
+ var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
+ xScaleFactor: 1.2,
+ yScaleFactor: 1.2,
+ containerWidth: event.width,
+ containerHeight: event.height,
+ position: {
+ mx: 0.458,
+ my: 0.194
+ }
+ });
+
+ return drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+ },
+ 'bpmn:EndEvent': function(p, element) {
+ var circle = renderer('bpmn:Event')(p, element, {
+ strokeWidth: 4
+ });
+
+ renderEventContent(element, p, true);
+
+ return circle;
+ },
+ 'bpmn:TerminateEventDefinition': function(p, element) {
+ var circle = drawCircle(p, element.width, element.height, 8, {
+ strokeWidth: 4,
+ fill: 'black'
+ });
+
+ return circle;
+ },
+ 'bpmn:IntermediateEvent': function(p, element) {
+ var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });
+ /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
+ 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
+
+ 'bpmn:Activity': function(p, element, attrs) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
+ },
+
+ 'bpmn:Task': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+ renderEmbeddedLabel(p, element, 'center-middle');
+ attachTaskMarkers(p, element);
+ return rect;
+ },
+ 'bpmn:ServiceTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 12,
+ y: 18
+ }
+ });
+
+ /* service bg */ drawPath(p, pathDataBG, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
+ abspos: {
+ x: 17.2,
+ y: 18
+ }
+ });
+
+ /* service fill */ drawPath(p, fillPathData, {
+ strokeWidth: 0,
+ stroke: 'none',
+ fill: 'white'
+ });
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
+ abspos: {
+ x: 17,
+ y: 22
+ }
+ });
+
+ /* service */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:UserTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var x = 15;
+ var y = 12;
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user path */ drawPath(p, pathData, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user2 path */ drawPath(p, pathData2, {
+ strokeWidth: 0.5,
+ fill: 'none'
+ });
+
+ var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
+ abspos: {
+ x: x,
+ y: y
+ }
+ });
+
+ /* user3 path */ drawPath(p, pathData3, {
+ strokeWidth: 0.5,
+ fill: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:ManualTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
+ abspos: {
+ x: 17,
+ y: 15
+ }
+ });
+
+ /* manual path */ drawPath(p, pathData, {
+ strokeWidth: 0.25,
+ fill: 'white',
+ stroke: 'black'
+ });
+
+ return task;
+ },
+ 'bpmn:SendTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.285,
+ my: 0.357
+ }
+ });
+
+ /* send path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black',
+ stroke: 'white'
+ });
+
+ return task;
+ },
+ 'bpmn:ReceiveTask' : function(p, element) {
+ var semantic = getSemantic(element);
+
+ var task = renderer('bpmn:Task')(p, element);
+ var pathData;
+
+ if (semantic.instantiate) {
+ drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
+ abspos: {
+ x: 7.77,
+ y: 9.52
+ }
+ });
+ } else {
+
+ pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
+ xScaleFactor: 0.9,
+ yScaleFactor: 0.9,
+ containerWidth: 21,
+ containerHeight: 14,
+ position: {
+ mx: 0.3,
+ my: 0.4
+ }
+ });
+ }
+
+ /* receive path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:ScriptTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
+ abspos: {
+ x: 15,
+ y: 20
+ }
+ });
+
+ /* script path */ drawPath(p, pathData, {
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:BusinessRuleTask': function(p, element) {
+ var task = renderer('bpmn:Task')(p, element);
+
+ var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessHeaderPath = drawPath(p, headerPathData);
+ businessHeaderPath.attr({
+ strokeWidth: 1,
+ fill: 'AAA'
+ });
+
+ var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
+ abspos: {
+ x: 8,
+ y: 8
+ }
+ });
+
+ var businessPath = drawPath(p, headerData);
+ businessPath.attr({
+ strokeWidth: 1
+ });
+
+ return task;
+ },
+ 'bpmn:SubProcess': function(p, element, attrs) {
+ var rect = renderer('bpmn:Activity')(p, element, attrs);
+
+ var semantic = getSemantic(element);
+
+ var expanded = DiUtil.isExpanded(semantic);
+
+ var isEventSubProcess = !!semantic.triggeredByEvent;
+ if (isEventSubProcess) {
+ rect.attr({
+ strokeDasharray: '1,2'
+ });
+ }
+
+ renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
+
+ if (expanded) {
+ attachTaskMarkers(p, element);
+ } else {
+ attachTaskMarkers(p, element, ['SubProcessMarker']);
+ }
+
+ return rect;
+ },
+ 'bpmn:AdHocSubProcess': function(p, element) {
+ return renderer('bpmn:SubProcess')(p, element);
+ },
+ 'bpmn:Transaction': function(p, element) {
+ var outer = renderer('bpmn:SubProcess')(p, element);
+
+ var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);
+
+ /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
+
+ return outer;
+ },
+ 'bpmn:CallActivity': function(p, element) {
+ return renderer('bpmn:Task')(p, element, {
+ strokeWidth: 5
+ });
+ },
+ 'bpmn:Participant': function(p, element) {
+
+ var lane = renderer('bpmn:Lane')(p, element, {
+ fill: 'White'
+ });
+
+ var expandedPool = DiUtil.isExpanded(element);
+
+ if (expandedPool) {
+ drawLine(p, [
+ { x: 30, y: 0 },
+ { x: 30, y: element.height }
+ ]);
+ var text = getSemantic(element).name;
+ renderLaneLabel(p, text, element);
+ } else {
+ // Collapsed pool draw text inline
+ var text2 = getSemantic(element).name;
+ renderLabel(p, text2, { box: element, align: 'center-middle' });
+ }
+
+ var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
+
+ if(participantMultiplicity) {
+ renderer('ParticipantMultiplicityMarker')(p, element);
+ }
+
+ return lane;
+ },
+ 'bpmn:Lane': function(p, element, attrs) {
+ var rect = drawRect(p, element.width, element.height, 0, attrs || {
+ fill: 'none'
+ });
+
+ var semantic = getSemantic(element);
+
+ if (semantic.$type === 'bpmn:Lane') {
+ var text = semantic.name;
+ renderLaneLabel(p, text, element);
+ }
+
+ return rect;
+ },
+ 'bpmn:InclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* circle path */
+ drawCircle(p, element.width, element.height, element.height * 0.24, {
+ strokeWidth: 2.5,
+ fill: 'none'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ExclusiveGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
+ xScaleFactor: 0.4,
+ yScaleFactor: 0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.32,
+ my: 0.3
+ }
+ });
+
+ if (!!(getDi(element).isMarkerVisible)) {
+ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+
+ return diamond;
+ },
+ 'bpmn:ComplexGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
+ xScaleFactor: 0.5,
+ yScaleFactor:0.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.26
+ }
+ });
+
+ /* complex path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:ParallelGateway': function(p, element) {
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.6,
+ yScaleFactor:0.6,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.46,
+ my: 0.2
+ }
+ });
+
+ /* parallel path */ drawPath(p, pathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return diamond;
+ },
+ 'bpmn:EventBasedGateway': function(p, element) {
+
+ var semantic = getSemantic(element);
+
+ var diamond = drawDiamond(p, element.width, element.height);
+
+ /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {
+ strokeWidth: 1,
+ fill: 'none'
+ });
+
+ var type = semantic.eventGatewayType;
+ var instantiate = !!semantic.instantiate;
+
+ function drawEvent() {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
+ xScaleFactor: 0.18,
+ yScaleFactor: 0.18,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.36,
+ my: 0.44
+ }
+ });
+
+ /* event path */ drawPath(p, pathData, {
+ strokeWidth: 2,
+ fill: 'none'
+ });
+ }
+
+ if (type === 'Parallel') {
+
+ var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
+ xScaleFactor: 0.4,
+ yScaleFactor:0.4,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var parallelPath = drawPath(p, pathData);
+ parallelPath.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ } else if (type === 'Exclusive') {
+
+ if (!instantiate) {
+ var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
+ innerCircle.attr({
+ strokeWidth: 1,
+ fill: 'none'
+ });
+ }
+
+ drawEvent();
+ }
+
+
+ return diamond;
+ },
+ 'bpmn:Gateway': function(p, element) {
+ return drawDiamond(p, element.width, element.height);
+ },
+ 'bpmn:SequenceFlow': function(p, element) {
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ strokeLinejoin: 'round',
+ markerEnd: marker('sequenceflow-end')
+ });
+
+ var sequenceFlow = getSemantic(element);
+ var source = element.source.businessObject;
+
+ // conditional flow marker
+ if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
+ path.attr({
+ markerStart: marker('conditional-flow-marker')
+ });
+ }
+
+ // default marker
+ if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
+ path.attr({
+ markerStart: marker('conditional-default-flow-marker')
+ });
+ }
+
+ return path;
+ },
+ 'bpmn:Association': function(p, element, attrs) {
+
+ attrs = assign({
+ strokeDasharray: '1,6',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round'
+ }, attrs || {});
+
+ // TODO(nre): style according to directed state
+ return drawLine(p, element.waypoints, attrs);
+ },
+ 'bpmn:DataInputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:DataOutputAssociation': function(p, element) {
+ return renderer('bpmn:Association')(p, element, {
+ markerEnd: marker('data-association-end')
+ });
+ },
+ 'bpmn:MessageFlow': function(p, element) {
+
+ var semantic = getSemantic(element),
+ di = getDi(element);
+
+ var pathData = createPathFromConnection(element);
+ var path = drawPath(p, pathData, {
+ markerEnd: marker('messageflow-end'),
+ markerStart: marker('messageflow-start'),
+ strokeDasharray: '10, 12',
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round',
+ strokeWidth: '1.5px'
+ });
+
+ if (semantic.messageRef) {
+ var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
+
+ var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
+ abspos: {
+ x: midPoint.x,
+ y: midPoint.y
+ }
+ });
+
+ var messageAttrs = { strokeWidth: 1 };
+
+ if (di.messageVisibleKind === 'initiating') {
+ messageAttrs.fill = 'white';
+ messageAttrs.stroke = 'black';
+ } else {
+ messageAttrs.fill = '#888';
+ messageAttrs.stroke = 'white';
+ }
+
+ drawPath(p, markerPathData, messageAttrs);
+ }
+
+ return path;
+ },
+ 'bpmn:DataObject': function(p, element) {
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.474,
+ my: 0.296
+ }
+ });
+
+ var elementObject = drawPath(p, pathData, { fill: 'white' });
+
+ var semantic = getSemantic(element);
+
+ if (isCollection(semantic)) {
+ renderDataItemCollection(p, element);
+ }
+
+ return elementObject;
+ },
+ 'bpmn:DataObjectReference': as('bpmn:DataObject'),
+ 'bpmn:DataInput': function(p, element) {
+
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });
+
+ return elementObject;
+ },
+ 'bpmn:DataOutput': function(p, element) {
+ var arrowPathData = pathMap.getRawPath('DATA_ARROW');
+
+ // page
+ var elementObject = renderer('bpmn:DataObject')(p, element);
+
+ /* output arrow path */ drawPath(p, arrowPathData, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+
+ return elementObject;
+ },
+ 'bpmn:DataStoreReference': function(p, element) {
+ var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0,
+ my: 0.133
+ }
+ });
+
+ var elementStore = drawPath(p, DATA_STORE_PATH, {
+ strokeWidth: 2,
+ fill: 'white'
+ });
+
+ return elementStore;
+ },
+ 'bpmn:BoundaryEvent': function(p, element) {
+
+ var semantic = getSemantic(element),
+ cancel = semantic.cancelActivity;
+
+ var attrs = {
+ strokeLinecap: 'round',
+ strokeWidth: 1
+ };
+
+ if (!cancel) {
+ attrs.strokeDasharray = '6';
+ }
+
+ var outer = renderer('bpmn:Event')(p, element, attrs);
+ /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
+
+ renderEventContent(element, p);
+
+ return outer;
+ },
+ 'bpmn:Group': function(p, element) {
+ return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
+ strokeWidth: 1,
+ strokeDasharray: '8,3,1,3',
+ fill: 'none',
+ pointerEvents: 'none'
+ });
+ },
+ 'label': function(p, element) {
+ return renderExternalLabel(p, element, '');
+ },
+ 'bpmn:TextAnnotation': function(p, element) {
+ var style = {
+ 'fill': 'none',
+ 'stroke': 'none'
+ };
+ var textElement = drawRect(p, element.width, element.height, 0, 0, style);
+ var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.0,
+ my: 0.0
+ }
+ });
+ drawPath(p, textPathData);
+
+ var text = getSemantic(element).text || '';
+ renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });
+
+ return textElement;
+ },
+ 'ParticipantMultiplicityMarker': function(p, element) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'SubProcessMarker': function(p, element) {
+ var markerRect = drawRect(p, 14, 14, 0, {
+ strokeWidth: 1
+ });
+
+ // Process marker is placed in the middle of the box
+ // therefore fixed values can be used here
+ markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
+
+ var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
+ xScaleFactor: 1.5,
+ yScaleFactor: 1.5,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: (element.width / 2 - 7.5) / element.width,
+ my: (element.height - 20) / element.height
+ }
+ });
+
+ drawPath(p, subProcessPath);
+ },
+ 'ParallelMarker': function(p, element, position) {
+ var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.parallel) / element.width),
+ my: (element.height - 20) / element.height
+ }
+ });
+ drawPath(p, subProcessPath);
+ },
+ 'SequentialMarker': function(p, element, position) {
+ var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.seq) / element.width),
+ my: (element.height - 19) / element.height
+ }
+ });
+ drawPath(p, sequentialPath);
+ },
+ 'CompensationMarker': function(p, element, position) {
+ var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.compensation) / element.width),
+ my: (element.height - 13) / element.height
+ }
+ });
+ drawPath(p, compensationPath, { strokeWidth: 1 });
+ },
+ 'LoopMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.loop) / element.width),
+ my: (element.height - 7) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'none',
+ strokeLinecap: 'round',
+ strokeMiterlimit: 0.5
+ });
+ },
+ 'AdhocMarker': function(p, element, position) {
+ var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: ((element.width / 2 + position.adhoc) / element.width),
+ my: (element.height - 15) / element.height
+ }
+ });
+
+ drawPath(p, loopPath, {
+ strokeWidth: 1,
+ fill: 'black'
+ });
+ }
+ };
+
+ function attachTaskMarkers(p, element, taskMarkers) {
+ var obj = getSemantic(element);
+
+ var subprocess = includes(taskMarkers, 'SubProcessMarker');
+ var position;
+
+ if (subprocess) {
+ position = {
+ seq: -21,
+ parallel: -22,
+ compensation: -42,
+ loop: -18,
+ adhoc: 10
+ };
+ } else {
+ position = {
+ seq: -3,
+ parallel: -6,
+ compensation: -27,
+ loop: 0,
+ adhoc: 10
+ };
+ }
+
+ forEach(taskMarkers, function(marker) {
+ renderer(marker)(p, element, position);
+ });
+
+ if (obj.$type === 'bpmn:AdHocSubProcess') {
+ renderer('AdhocMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
+ renderer('LoopMarker')(p, element, position);
+ return;
+ }
+ if (obj.loopCharacteristics &&
+ obj.loopCharacteristics.isSequential !== undefined &&
+ !obj.loopCharacteristics.isSequential) {
+ renderer('ParallelMarker')(p, element, position);
+ }
+ if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
+ renderer('SequentialMarker')(p, element, position);
+ }
+ if (!!obj.isForCompensation) {
+ renderer('CompensationMarker')(p, element, position);
+ }
+ }
+
+ function drawShape(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function drawConnection(parent, element) {
+ var type = element.type;
+ var h = handlers[type];
+
+ /* jshint -W040 */
+ if (!h) {
+ return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);
+ } else {
+ return h(parent, element);
+ }
+ }
+
+ function renderDataItemCollection(p, element) {
+
+ var yPosition = (element.height - 16) / element.height;
+
+ var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
+ xScaleFactor: 1,
+ yScaleFactor: 1,
+ containerWidth: element.width,
+ containerHeight: element.height,
+ position: {
+ mx: 0.451,
+ my: yPosition
+ }
+ });
+
+ /* collection path */ drawPath(p, pathData, {
+ strokeWidth: 2
+ });
+ }
+
+ function isCollection(element, filter) {
+ return element.isCollection ||
+ (element.elementObjectRef && element.elementObjectRef.isCollection);
+ }
+
+ function getDi(element) {
+ return element.businessObject.di;
+ }
+
+ function getSemantic(element) {
+ return element.businessObject;
+ }
+
+ /**
+ * Checks if eventDefinition of the given element matches with semantic type.
+ *
+ * @return {boolean} true if element is of the given semantic type
+ */
+ function isTypedEvent(event, eventDefinitionType, filter) {
+
+ function matches(definition, filter) {
+ return every(filter, function(val, key) {
+
+ // we want a == conversion here, to be able to catch
+ // undefined == false and friends
+ /* jshint -W116 */
+ return definition[key] == val;
+ });
+ }
+
+ return some(event.eventDefinitions, function(definition) {
+ return definition.$type === eventDefinitionType && matches(event, filter);
+ });
+ }
+
+ function isThrowEvent(event) {
+ return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
+ }
+
+
+ /////// cropping path customizations /////////////////////////
+
+ function componentsToPath(elements) {
+ return elements.join(',').replace(/,?([A-z]),?/g, '$1');
+ }
+
+ function getCirclePath(shape) {
+
+ var cx = shape.x + shape.width / 2,
+ cy = shape.y + shape.height / 2,
+ radius = shape.width / 2;
+
+ var circlePath = [
+ ['M', cx, cy],
+ ['m', 0, -radius],
+ ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
+ ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
+ ['z']
+ ];
+
+ return componentsToPath(circlePath);
+ }
+
+ function getRoundRectPath(shape) {
+
+ var radius = TASK_BORDER_RADIUS,
+ x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var roundRectPath = [
+ ['M', x + radius, y],
+ ['l', width - radius * 2, 0],
+ ['a', radius, radius, 0, 0, 1, radius, radius],
+ ['l', 0, height - radius * 2],
+ ['a', radius, radius, 0, 0, 1, -radius, radius],
+ ['l', radius * 2 - width, 0],
+ ['a', radius, radius, 0, 0, 1, -radius, -radius],
+ ['l', 0, radius * 2 - height],
+ ['a', radius, radius, 0, 0, 1, radius, -radius],
+ ['z']
+ ];
+
+ return componentsToPath(roundRectPath);
+ }
+
+ function getDiamondPath(shape) {
+
+ var width = shape.width,
+ height = shape.height,
+ x = shape.x,
+ y = shape.y,
+ halfWidth = width / 2,
+ halfHeight = height / 2;
+
+ var diamondPath = [
+ ['M', x + halfWidth, y],
+ ['l', halfWidth, halfHeight],
+ ['l', -halfWidth, halfHeight],
+ ['l', -halfWidth, -halfHeight],
+ ['z']
+ ];
+
+ return componentsToPath(diamondPath);
+ }
+
+ function getRectPath(shape) {
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var rectPath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(rectPath);
+ }
+
+ function getShapePath(element) {
+ var obj = getSemantic(element);
+
+ if (obj.$instanceOf('bpmn:Event')) {
+ return getCirclePath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Activity')) {
+ return getRoundRectPath(element);
+ }
+
+ if (obj.$instanceOf('bpmn:Gateway')) {
+ return getDiamondPath(element);
+ }
+
+ return getRectPath(element);
+ }
+
+
+ // hook onto canvas init event to initialize
+ // connection start/end markers on svg
+ events.on('canvas.init', function(event) {
+ initMarkers(event.svg);
+ });
+
+ this.drawShape = drawShape;
+ this.drawConnection = drawConnection;
+
+ this.getShapePath = getShapePath;
+}
+
+inherits(BpmnRenderer, DefaultRenderer);
+
+
+BpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];
+
+module.exports = BpmnRenderer;
+
+},{"11":11,"159":159,"163":163,"168":168,"43":43,"64":64,"72":72,"74":74,"77":77,"79":79,"82":82}],4:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(67);
+
+/**
+ * Map containing SVG paths needed by BpmnRenderer.
+ */
+
+function PathMap() {
+
+ /**
+ * Contains a map of path elements
+ *
+ * <h1>Path definition</h1>
+ * A parameterized path is defined like this:
+ * <pre>
+ * 'GATEWAY_PARALLEL': {
+ * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ * height: 17.5,
+ * width: 17.5,
+ * heightElements: [2.5, 7.5],
+ * widthElements: [2.5, 7.5]
+ * }
+ * </pre>
+ * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling
+ * is based on the ratio between the specified height and width in this object and the
+ * height and width that is set as scale target (Note x,y coordinates will be scaled with
+ * individual ratios).</p>
+ * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.
+ * The scaling is based on the computed ratios.
+ * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using
+ * the computed ratio coefficient.
+ * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.
+ * <ul>
+ * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>
+ * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>
+ * </ul>
+ * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.
+ * </p>
+ */
+ this.pathMap = {
+ 'EVENT_MESSAGE': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 36,
+ width: 36,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'EVENT_SIGNAL': {
+ d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
+ height: 36,
+ width: 36,
+ heightElements: [18],
+ widthElements: [10, 20]
+ },
+ 'EVENT_ESCALATION': {
+ d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +
+ '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',
+ height: 36,
+ width: 36,
+ heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
+ widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
+ },
+ 'EVENT_CONDITIONAL': {
+ d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
+ 'M {e.x2},{e.y3} l {e.x0},0 ' +
+ 'M {e.x2},{e.y4} l {e.x0},0 ' +
+ 'M {e.x2},{e.y5} l {e.x0},0 ' +
+ 'M {e.x2},{e.y6} l {e.x0},0 ' +
+ 'M {e.x2},{e.y7} l {e.x0},0 ' +
+ 'M {e.x2},{e.y8} l {e.x0},0 ',
+ height: 36,
+ width: 36,
+ heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
+ widthElements: [10.5, 14.5, 12.5]
+ },
+ 'EVENT_LINK': {
+ d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
+ height: 36,
+ width: 36,
+ heightElements: [4.4375, 6.75, 7.8125],
+ widthElements: [9.84375, 13.5]
+ },
+ 'EVENT_ERROR': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
+ height: 36,
+ width: 36,
+ heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
+ widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
+ },
+ 'EVENT_CANCEL_45': {
+ d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [4.75, 8.5],
+ widthElements: [4.75, 8.5]
+ },
+ 'EVENT_COMPENSATION': {
+ d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
+ height: 36,
+ width: 36,
+ heightElements: [5, 10],
+ widthElements: [10]
+ },
+ 'EVENT_TIMER_WH': {
+ d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 2],
+ widthElements: [3, 7]
+ },
+ 'EVENT_TIMER_LINE': {
+ d: 'M {mx},{my} ' +
+ 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
+ height: 36,
+ width: 36,
+ heightElements: [10, 3],
+ widthElements: [0, 0]
+ },
+ 'EVENT_MULTIPLE': {
+ d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [6.28099, 12.56199],
+ widthElements: [3.1405, 9.42149, 12.56198]
+ },
+ 'EVENT_PARALLEL_MULTIPLE': {
+ d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
+ '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
+ height: 36,
+ width: 36,
+ heightElements: [2.56228, 7.68683],
+ widthElements: [2.56228, 7.68683]
+ },
+ 'GATEWAY_EXCLUSIVE': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
+ '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
+ '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
+ height: 17.5,
+ width: 17.5,
+ heightElements: [8.5, 6.5312, -6.5312, -8.5],
+ widthElements: [6.5, -6.5, 3, -3, 5, -5]
+ },
+ 'GATEWAY_PARALLEL': {
+ d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
+ '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
+ height: 30,
+ width: 30,
+ heightElements: [5, 12.5],
+ widthElements: [5, 12.5]
+ },
+ 'GATEWAY_EVENT_BASED': {
+ d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
+ height: 11,
+ width: 11,
+ heightElements: [-6, 6, 12, -12],
+ widthElements: [9, -3, -12]
+ },
+ 'GATEWAY_COMPLEX': {
+ d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
+ '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
+ '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
+ '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
+ height: 17.125,
+ width: 17.125,
+ heightElements: [4.875, 3.4375, 2.125, 3],
+ widthElements: [3.4375, 2.125, 4.875, 3]
+ },
+ 'DATA_OBJECT_PATH': {
+ d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
+ height: 61,
+ width: 51,
+ heightElements: [10, 50, 60],
+ widthElements: [10, 40, 50, 60]
+ },
+ 'DATA_OBJECT_COLLECTION_PATH': {
+ d:'m {mx}, {my} ' +
+ 'm 0 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ' +
+ 'm 4 15 l 0 -15 ',
+ height: 61,
+ width: 51,
+ heightElements: [12],
+ widthElements: [1, 6, 12, 15]
+ },
+ 'DATA_ARROW': {
+ d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
+ height: 61,
+ width: 51,
+ heightElements: [],
+ widthElements: []
+ },
+ 'DATA_STORE': {
+ d:'m {mx},{my} ' +
+ 'l 0,{e.y2} ' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'l 0,-{e.y2} ' +
+ 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
+ 'm -{e.x2},{e.y0}' +
+ 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',
+ height: 61,
+ width: 61,
+ heightElements: [7, 10, 45],
+ widthElements: [2, 58, 60]
+ },
+ 'TEXT_ANNOTATION': {
+ d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
+ height: 30,
+ width: 10,
+ heightElements: [30],
+ widthElements: [10]
+ },
+ 'MARKER_SUB_PROCESS': {
+ d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_PARALLEL': {
+ d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_SEQUENTIAL': {
+ d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
+ height: 10,
+ width: 10,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_COMPENSATION': {
+ d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
+ height: 10,
+ width: 21,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_LOOP': {
+ d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
+ '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
+ '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
+ 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
+ height: 13.9,
+ width: 13.7,
+ heightElements: [],
+ widthElements: []
+ },
+ 'MARKER_ADHOC': {
+ d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
+ '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
+ '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
+ '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
+ '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
+ height: 4,
+ width: 15,
+ heightElements: [],
+ widthElements: []
+ },
+ 'TASK_TYPE_SEND': {
+ d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
+ height: 14,
+ width: 21,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_SCRIPT': {
+ d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
+ 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
+ 'm -7,-12 l 5,0 ' +
+ 'm -4.5,3 l 4.5,0 ' +
+ 'm -3,3 l 5,0' +
+ 'm -4,3 l 5,0',
+ height: 15,
+ width: 12.6,
+ heightElements: [6, 14],
+ widthElements: [10.5, 21]
+ },
+ 'TASK_TYPE_USER_1': {
+ d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
+ '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
+ '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
+ 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
+ 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
+ },
+ 'TASK_TYPE_USER_2': {
+ d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
+ '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
+ },
+ 'TASK_TYPE_USER_3': {
+ d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
+ '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
+ '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
+ },
+ 'TASK_TYPE_MANUAL': {
+ d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
+ '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
+ '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
+ '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
+ '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
+ '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
+ '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
+ '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
+ '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
+ '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
+ '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
+ '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
+ },
+ 'TASK_TYPE_INSTANTIATING_SEND': {
+ d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
+ },
+ 'TASK_TYPE_SERVICE': {
+ d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
+ '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
+ '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
+ 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
+ '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
+ '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
+ 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
+ '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
+ 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
+ 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
+ '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
+ 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
+ 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_SERVICE_FILL': {
+ d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
+ '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
+ '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_HEADER': {
+ d: 'm {mx},{my} 0,4 20,0 0,-4 z'
+ },
+ 'TASK_TYPE_BUSINESS_RULE_MAIN': {
+ d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
+ 'm 0,8 l 20,0 ' +
+ 'm -13,-4 l 0,8'
+ },
+ 'MESSAGE_FLOW_MARKER': {
+ d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
+ }
+ };
+
+ this.getRawPath = function getRawPath(pathId) {
+ return this.pathMap[pathId].d;
+ };
+
+ /**
+ * Scales the path to the given height and width.
+ * <h1>Use case</h1>
+ * <p>Use case is to scale the content of elements (event, gateways) based
+ * on the element bounding box's size.
+ * </p>
+ * <h1>Why not transform</h1>
+ * <p>Scaling a path with transform() will also scale the stroke and IE does not support
+ * the option 'non-scaling-stroke' to prevent this.
+ * Also there are use cases where only some parts of a path should be
+ * scaled.</p>
+ *
+ * @param {String} pathId The ID of the path.
+ * @param {Object} param <p>
+ * Example param object scales the path to 60% size of the container (data.width, data.height).
+ * <pre>
+ * {
+ * xScaleFactor: 0.6,
+ * yScaleFactor:0.6,
+ * containerWidth: data.width,
+ * containerHeight: data.height,
+ * position: {
+ * mx: 0.46,
+ * my: 0.2,
+ * }
+ * }
+ * </pre>
+ * <ul>
+ * <li>targetpathwidth = xScaleFactor * containerWidth</li>
+ * <li>targetpathheight = yScaleFactor * containerHeight</li>
+ * <li>Position is used to set the starting coordinate of the path. M is computed:
+ * <ul>
+ * <li>position.x * containerWidth</li>
+ * <li>position.y * containerHeight</li>
+ * </ul>
+ * Center of the container <pre> position: {
+ * mx: 0.5,
+ * my: 0.5,
+ * }</pre>
+ * Upper left corner of the container
+ * <pre> position: {
+ * mx: 0.0,
+ * my: 0.0,
+ * }</pre>
+ * </li>
+ * </ul>
+ * </p>
+ *
+ */
+ this.getScaledPath = function getScaledPath(pathId, param) {
+ var rawPath = this.pathMap[pathId];
+
+ // positioning
+ // compute the start point of the path
+ var mx, my;
+
+ if(!!param.abspos) {
+ mx = param.abspos.x;
+ my = param.abspos.y;
+ } else {
+ mx = param.containerWidth * param.position.mx;
+ my = param.containerHeight * param.position.my;
+ }
+
+ var coordinates = {}; //map for the scaled coordinates
+ if(param.position) {
+
+ // path
+ var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
+ var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
+
+
+ //Apply height ratio
+ for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
+ coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
+ }
+
+ //Apply width ratio
+ for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
+ coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
+ }
+ }
+
+ //Apply value to raw path
+ var path = Snap.format(
+ rawPath.d, {
+ mx: mx,
+ my: my,
+ e: coordinates
+ }
+ );
+ return path;
+ };
+}
+
+module.exports = PathMap;
+
+},{"67":67}],5:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(3) ],
+ pathMap: [ 'type', _dereq_(4) ]
+};
+},{"3":3,"4":4}],6:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168),
+ map = _dereq_(80);
+
+var LabelUtil = _dereq_(12);
+
+var hasExternalLabel = LabelUtil.hasExternalLabel,
+ getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
+ isExpanded = _dereq_(11).isExpanded,
+ elementToString = _dereq_(9).elementToString;
+
+
+function elementData(semantic, attrs) {
+ return assign({
+ id: semantic.id,
+ type: semantic.$type,
+ businessObject: semantic
+ }, attrs);
+}
+
+function collectWaypoints(waypoints) {
+ return map(waypoints, function(p) {
+ return { x: p.x, y: p.y };
+ });
+}
+
+
+/**
+ * An importer that adds bpmn elements to the canvas
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementFactory} elementFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+
+ this._elementFactory = elementFactory;
+ this._elementRegistry = elementRegistry;
+}
+
+BpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];
+
+module.exports = BpmnImporter;
+
+
+/**
+ * Add bpmn element (semantic) to the canvas onto the
+ * specified parent shape.
+ */
+BpmnImporter.prototype.add = function(semantic, parentElement) {
+
+ var di = semantic.di,
+ element;
+
+ // ROOT ELEMENT
+ // handle the special case that we deal with a
+ // invisible root element (process or collaboration)
+ if (di.$instanceOf('bpmndi:BPMNPlane')) {
+
+ // add a virtual element (not being drawn)
+ element = this._elementFactory.createRoot(elementData(semantic));
+
+ this._canvas.setRootElement(element);
+ }
+
+ // SHAPE
+ else if (di.$instanceOf('bpmndi:BPMNShape')) {
+
+ var collapsed = !isExpanded(semantic);
+ var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
+
+ var bounds = semantic.di.bounds;
+
+ element = this._elementFactory.createShape(elementData(semantic, {
+ collapsed: collapsed,
+ hidden: hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ this._canvas.addShape(element, parentElement);
+ }
+
+ // CONNECTION
+ else if (di.$instanceOf('bpmndi:BPMNEdge')) {
+
+ var source = this._getSource(semantic),
+ target = this._getTarget(semantic);
+
+ element = this._elementFactory.createConnection(elementData(semantic, {
+ source: source,
+ target: target,
+ waypoints: collectWaypoints(semantic.di.waypoint)
+ }));
+
+ this._canvas.addConnection(element, parentElement);
+ } else {
+ throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
+ }
+
+ // (optional) LABEL
+ if (hasExternalLabel(semantic)) {
+ this.addLabel(semantic, element);
+ }
+
+
+ this._eventBus.fire('bpmnElement.added', { element: element });
+
+ return element;
+};
+
+
+/**
+ * add label for an element
+ */
+BpmnImporter.prototype.addLabel = function(semantic, element) {
+ var bounds = getExternalLabelBounds(semantic, element);
+
+ var label = this._elementFactory.createLabel(elementData(semantic, {
+ id: semantic.id + '_label',
+ labelTarget: element,
+ type: 'label',
+ hidden: element.hidden,
+ x: Math.round(bounds.x),
+ y: Math.round(bounds.y),
+ width: Math.round(bounds.width),
+ height: Math.round(bounds.height)
+ }));
+
+ return this._canvas.addShape(label, element.parent);
+};
+
+/**
+ * Return the drawn connection end based on the given side.
+ *
+ * @throws {Error} if the end is not yet drawn
+ */
+BpmnImporter.prototype._getEnd = function(semantic, side) {
+
+ var element,
+ refSemantic,
+ type = semantic.$type;
+
+ refSemantic = semantic[side + 'Ref'];
+
+ // handle mysterious isMany DataAssociation#sourceRef
+ if (side === 'source' && type === 'bpmn:DataInputAssociation') {
+ refSemantic = refSemantic && refSemantic[0];
+ }
+
+ // fix source / target for DataInputAssociation / DataOutputAssociation
+ if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
+ side === 'target' && type === 'bpmn:DataInputAssociation') {
+
+ refSemantic = semantic.$parent;
+ }
+
+ element = refSemantic && this._getElement(refSemantic);
+
+ if (element) {
+ return element;
+ }
+
+ if (refSemantic) {
+ throw new Error(
+ 'element ' + elementToString(refSemantic) + ' referenced by ' +
+ elementToString(semantic) + '#' + side + 'Ref not yet drawn');
+ } else {
+ throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
+ }
+};
+
+BpmnImporter.prototype._getSource = function(semantic) {
+ return this._getEnd(semantic, 'source');
+};
+
+BpmnImporter.prototype._getTarget = function(semantic) {
+ return this._getEnd(semantic, 'target');
+};
+
+
+BpmnImporter.prototype._getElement = function(semantic) {
+ return this._elementRegistry.get(semantic.id);
+};
+
+},{"11":11,"12":12,"168":168,"80":80,"9":9}],7:[function(_dereq_,module,exports){
+'use strict';
+
+var filter = _dereq_(75),
+ find = _dereq_(76),
+ forEach = _dereq_(77);
+
+var Refs = _dereq_(194);
+
+var elementToString = _dereq_(9).elementToString;
+
+var diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });
+
+/**
+ * Returns true if an element has the given meta-model type
+ *
+ * @param {ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ return element.$instanceOf(type);
+}
+
+
+/**
+ * Find a suitable display candidate for definitions where the DI does not
+ * correctly specify one.
+ */
+function findDisplayCandidate(definitions) {
+ return find(definitions.rootElements, function(e) {
+ return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
+ });
+}
+
+
+function BpmnTreeWalker(handler) {
+
+ // list of containers already walked
+ var handledProcesses = [];
+
+ // list of elements to handle deferred to ensure
+ // prerequisites are drawn
+ var deferred = [];
+
+ ///// Helpers /////////////////////////////////
+
+ function contextual(fn, ctx) {
+ return function(e) {
+ fn(e, ctx);
+ };
+ }
+
+ function visit(element, ctx) {
+
+ var gfx = element.gfx;
+
+ // avoid multiple rendering of elements
+ if (gfx) {
+ throw new Error('already rendered ' + elementToString(element));
+ }
+
+ // call handler
+ return handler.element(element, ctx);
+ }
+
+ function visitRoot(element, diagram) {
+ return handler.root(element, diagram);
+ }
+
+ function visitIfDi(element, ctx) {
+ try {
+ return element.di && visit(element, ctx);
+ } catch (e) {
+ logError(e.message, { element: element, error: e });
+
+ console.error('failed to import ' + elementToString(element));
+ console.error(e);
+ }
+ }
+
+ function logError(message, context) {
+ handler.error(message, context);
+ }
+
+ ////// DI handling ////////////////////////////
+
+ function registerDi(di) {
+ var bpmnElement = di.bpmnElement;
+
+ if (bpmnElement) {
+ if (bpmnElement.di) {
+ logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });
+ } else {
+ diRefs.bind(bpmnElement, 'di');
+ bpmnElement.di = di;
+ }
+ } else {
+ logError('no bpmnElement referenced in ' + elementToString(di), { element: di });
+ }
+ }
+
+ function handleDiagram(diagram) {
+ handlePlane(diagram.plane);
+ }
+
+ function handlePlane(plane) {
+ registerDi(plane);
+
+ forEach(plane.planeElement, handlePlaneElement);
+ }
+
+ function handlePlaneElement(planeElement) {
+ registerDi(planeElement);
+ }
+
+
+ ////// Semantic handling //////////////////////
+
+ function handleDefinitions(definitions, diagram) {
+ // make sure we walk the correct bpmnElement
+
+ var diagrams = definitions.diagrams;
+
+ if (diagram && diagrams.indexOf(diagram) === -1) {
+ throw new Error('diagram not part of bpmn:Definitions');
+ }
+
+ if (!diagram && diagrams && diagrams.length) {
+ diagram = diagrams[0];
+ }
+
+ // no diagram -> nothing to import
+ if (!diagram) {
+ return;
+ }
+
+ // load DI from selected diagram only
+ handleDiagram(diagram);
+
+
+ var plane = diagram.plane;
+
+ if (!plane) {
+ throw new Error('no plane for ' + elementToString(diagram));
+ }
+
+
+ var rootElement = plane.bpmnElement;
+
+ // ensure we default to a suitable display candidate (process or collaboration),
+ // even if non is specified in DI
+ if (!rootElement) {
+ rootElement = findDisplayCandidate(definitions);
+
+ if (!rootElement) {
+ return logError('no process or collaboration present to display');
+ } else {
+
+ logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
+
+ // correct DI on the fly
+ plane.bpmnElement = rootElement;
+ registerDi(plane);
+ }
+ }
+
+
+ var ctx = visitRoot(rootElement, plane);
+
+ if (is(rootElement, 'bpmn:Process')) {
+ handleProcess(rootElement, ctx);
+ } else if (is(rootElement, 'bpmn:Collaboration')) {
+ handleCollaboration(rootElement, ctx);
+
+ // force drawing of everything not yet drawn that is part of the target DI
+ handleUnhandledProcesses(definitions.rootElements, ctx);
+ } else {
+ throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
+ }
+
+ // handle all deferred elements
+ handleDeferred(deferred);
+ }
+
+ function handleDeferred(deferred) {
+ forEach(deferred, function(d) { d(); });
+ }
+
+ function handleProcess(process, context) {
+ handleFlowElementsContainer(process, context);
+ handleIoSpecification(process.ioSpecification, context);
+
+ handleArtifacts(process.artifacts, context);
+
+ // log process handled
+ handledProcesses.push(process);
+ }
+
+ function handleUnhandledProcesses(rootElements) {
+
+ // walk through all processes that have not yet been drawn and draw them
+ // if they contain lanes with DI information.
+ // we do this to pass the free-floating lane test cases in the MIWG test suite
+ var processes = filter(rootElements, function(e) {
+ return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
+ });
+
+ processes.forEach(contextual(handleProcess));
+ }
+
+ function handleMessageFlow(messageFlow, context) {
+ visitIfDi(messageFlow, context);
+ }
+
+ function handleMessageFlows(messageFlows, context) {
+ forEach(messageFlows, contextual(handleMessageFlow, context));
+ }
+
+ function handleDataAssociation(association, context) {
+ visitIfDi(association, context);
+ }
+
+ function handleDataInput(dataInput, context) {
+ visitIfDi(dataInput, context);
+ }
+
+ function handleDataOutput(dataOutput, context) {
+ visitIfDi(dataOutput, context);
+ }
+
+ function handleArtifact(artifact, context) {
+
+ // bpmn:TextAnnotation
+ // bpmn:Group
+ // bpmn:Association
+
+ visitIfDi(artifact, context);
+ }
+
+ function handleArtifacts(artifacts, context) {
+
+ forEach(artifacts, function(e) {
+ if (is(e, 'bpmn:Association')) {
+ deferred.push(function() {
+ handleArtifact(e, context);
+ });
+ } else {
+ handleArtifact(e, context);
+ }
+ });
+ }
+
+ function handleIoSpecification(ioSpecification, context) {
+
+ if (!ioSpecification) {
+ return;
+ }
+
+ forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
+ forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
+ }
+
+ function handleSubProcess(subProcess, context) {
+ handleFlowElementsContainer(subProcess, context);
+ handleArtifacts(subProcess.artifacts, context);
+ }
+
+ function handleFlowNode(flowNode, context) {
+ var childCtx = visitIfDi(flowNode, context);
+
+ if (is(flowNode, 'bpmn:SubProcess')) {
+ handleSubProcess(flowNode, childCtx || context);
+ }
+ }
+
+ function handleSequenceFlow(sequenceFlow, context) {
+ visitIfDi(sequenceFlow, context);
+ }
+
+ function handleDataElement(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleBoundaryEvent(dataObject, context) {
+ visitIfDi(dataObject, context);
+ }
+
+ function handleLane(lane, context) {
+ var newContext = visitIfDi(lane, context);
+
+ if (lane.childLaneSet) {
+ handleLaneSet(lane.childLaneSet, newContext || context);
+ } else {
+ var filterList = filter(lane.flowNodeRef, function(e) {
+ return e.$type !== 'bpmn:BoundaryEvent';
+ });
+ handleFlowElements(filterList, newContext || context);
+ }
+ }
+
+ function handleLaneSet(laneSet, context) {
+ forEach(laneSet.lanes, contextual(handleLane, context));
+ }
+
+ function handleLaneSets(laneSets, context) {
+ forEach(laneSets, contextual(handleLaneSet, context));
+ }
+
+ function handleFlowElementsContainer(container, context) {
+
+ if (container.laneSets) {
+ handleLaneSets(container.laneSets, context);
+ handleNonFlowNodes(container.flowElements);
+ } else {
+ handleFlowElements(container.flowElements, context);
+ }
+ }
+
+ function handleNonFlowNodes(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ }
+ });
+ }
+
+ function handleFlowElements(flowElements, context) {
+ forEach(flowElements, function(e) {
+ if (is(e, 'bpmn:SequenceFlow')) {
+ deferred.push(function() {
+ handleSequenceFlow(e, context);
+ });
+ } else if (is(e, 'bpmn:BoundaryEvent')) {
+ deferred.unshift(function() {
+ handleBoundaryEvent(e, context);
+ });
+ } else if (is(e, 'bpmn:FlowNode')) {
+ handleFlowNode(e, context);
+
+ if (is(e, 'bpmn:Activity')) {
+
+ handleIoSpecification(e.ioSpecification, context);
+
+ // defer handling of associations
+ deferred.push(function() {
+ forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
+ forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
+ });
+ }
+ } else if (is(e, 'bpmn:DataObject')) {
+ // SKIP (assume correct referencing via DataObjectReference)
+ } else if (is(e, 'bpmn:DataStoreReference')) {
+ handleDataElement(e, context);
+ } else if (is(e, 'bpmn:DataObjectReference')) {
+ handleDataElement(e, context);
+ } else {
+ logError(
+ 'unrecognized flowElement ' + elementToString(e) + ' in context ' +
+ (context ? elementToString(context.businessObject) : null),
+ { element: e, context: context });
+ }
+ });
+ }
+
+ function handleParticipant(participant, context) {
+ var newCtx = visitIfDi(participant, context);
+
+ var process = participant.processRef;
+ if (process) {
+ handleProcess(process, newCtx || context);
+ }
+ }
+
+ function handleCollaboration(collaboration) {
+
+ forEach(collaboration.participants, contextual(handleParticipant));
+
+ handleArtifacts(collaboration.artifacts);
+
+ // handle message flows latest in the process
+ deferred.push(function() {
+ handleMessageFlows(collaboration.messageFlows);
+ });
+ }
+
+
+ ///// API ////////////////////////////////
+
+ return {
+ handleDefinitions: handleDefinitions
+ };
+}
+
+module.exports = BpmnTreeWalker;
+},{"194":194,"75":75,"76":76,"77":77,"9":9}],8:[function(_dereq_,module,exports){
+'use strict';
+
+var BpmnTreeWalker = _dereq_(7);
+
+
+/**
+ * Import the definitions into a diagram.
+ *
+ * Errors and warnings are reported through the specified callback.
+ *
+ * @param {Diagram} diagram
+ * @param {ModdleElement} definitions
+ * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done
+ */
+function importBpmnDiagram(diagram, definitions, done) {
+
+ var importer = diagram.get('bpmnImporter'),
+ eventBus = diagram.get('eventBus');
+
+ var error,
+ warnings = [];
+
+ function parse(definitions) {
+
+ var visitor = {
+
+ root: function(element) {
+ return importer.add(element);
+ },
+
+ element: function(element, parentShape) {
+ return importer.add(element, parentShape);
+ },
+
+ error: function(message, context) {
+ warnings.push({ message: message, context: context });
+ }
+ };
+
+ var walker = new BpmnTreeWalker(visitor);
+
+ // import
+ walker.handleDefinitions(definitions);
+ }
+
+ eventBus.fire('import.start');
+
+ try {
+ parse(definitions);
+ } catch (e) {
+ error = e;
+ }
+
+ eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });
+ done(error, warnings);
+}
+
+module.exports.importBpmnDiagram = importBpmnDiagram;
+},{"7":7}],9:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.elementToString = function(e) {
+ if (!e) {
+ return '<null>';
+ }
+
+ return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
+};
+},{}],10:[function(_dereq_,module,exports){
+module.exports = {
+ bpmnImporter: [ 'type', _dereq_(6) ]
+};
+},{"6":6}],11:[function(_dereq_,module,exports){
+'use strict';
+
+var is = _dereq_(13).is,
+ getBusinessObject = _dereq_(13).getBusinessObject;
+
+module.exports.isExpanded = function(element) {
+
+ if (is(element, 'bpmn:CallActivity')) {
+ return false;
+ }
+
+ if (is(element, 'bpmn:SubProcess')) {
+ return getBusinessObject(element).di.isExpanded;
+ }
+
+ if (is(element, 'bpmn:Participant')) {
+ return !!getBusinessObject(element).processRef;
+ }
+
+ return true;
+};
+
+},{"13":13}],12:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168);
+
+
+var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
+ width: 90,
+ height: 20
+};
+
+
+/**
+ * Returns true if the given semantic has an external label
+ *
+ * @param {BpmnElement} semantic
+ * @return {Boolean} true if has label
+ */
+module.exports.hasExternalLabel = function(semantic) {
+
+ return semantic.$instanceOf('bpmn:Event') ||
+ semantic.$instanceOf('bpmn:Gateway') ||
+ semantic.$instanceOf('bpmn:DataStoreReference') ||
+ semantic.$instanceOf('bpmn:DataObjectReference') ||
+ semantic.$instanceOf('bpmn:SequenceFlow') ||
+ semantic.$instanceOf('bpmn:MessageFlow');
+};
+
+
+/**
+ * Get the middle of a number of waypoints
+ *
+ * @param {Array<Point>} waypoints
+ * @return {Point} the mid point
+ */
+var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
+
+ var mid = waypoints.length / 2 - 1;
+
+ var first = waypoints[Math.floor(mid)];
+ var second = waypoints[Math.ceil(mid + 0.01)];
+
+ return {
+ x: first.x + (second.x - first.x) / 2,
+ y: first.y + (second.y - first.y) / 2
+ };
+};
+
+
+var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
+
+ if (element.waypoints) {
+ return getWaypointsMid(element.waypoints);
+ } else {
+ return {
+ x: element.x + element.width / 2,
+ y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
+ };
+ }
+};
+
+/**
+ * Returns the bounds of an elements label, parsed from the elements DI or
+ * generated from its bounds.
+ *
+ * @param {BpmnElement} semantic
+ * @param {djs.model.Base} element
+ */
+module.exports.getExternalLabelBounds = function(semantic, element) {
+
+ var mid,
+ size,
+ bounds,
+ di = semantic.di,
+ label = di.label;
+
+ if (label && label.bounds) {
+ bounds = label.bounds;
+
+ size = {
+ width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
+ height: bounds.height
+ };
+
+ mid = {
+ x: bounds.x + bounds.width / 2,
+ y: bounds.y + bounds.height / 2
+ };
+ } else {
+
+ mid = getExternalLabelMid(element);
+
+ size = DEFAULT_LABEL_SIZE;
+ }
+
+ return assign({
+ x: mid.x - size.width / 2,
+ y: mid.y - size.height / 2
+ }, size);
+};
+},{"168":168}],13:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Is an element of the given BPMN type?
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ * @param {String} type
+ *
+ * @return {Boolean}
+ */
+function is(element, type) {
+ var bo = getBusinessObject(element);
+
+ return bo && bo.$instanceOf(type);
+}
+
+module.exports.is = is;
+
+
+/**
+ * Return the business object for a given element.
+ *
+ * @param {djs.model.Base|ModdleElement} element
+ *
+ * @return {ModdleElement}
+ */
+function getBusinessObject(element) {
+ return (element && element.businessObject) || element;
+}
+
+module.exports.getBusinessObject = getBusinessObject;
+
+},{}],14:[function(_dereq_,module,exports){
+module.exports = _dereq_(16);
+},{"16":16}],15:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(165),
+ isFunction = _dereq_(160),
+ assign = _dereq_(168);
+
+var Moddle = _dereq_(22),
+ XmlReader = _dereq_(18),
+ XmlWriter = _dereq_(19);
+
+/**
+ * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.
+ *
+ * @class BpmnModdle
+ * @extends Moddle
+ *
+ * @param {Object|Array} packages to use for instantiating the model
+ * @param {Object} [options] additional options to pass over
+ */
+function BpmnModdle(packages, options) {
+ Moddle.call(this, packages, options);
+}
+
+BpmnModdle.prototype = Object.create(Moddle.prototype);
+
+module.exports = BpmnModdle;
+
+
+/**
+ * Instantiates a BPMN model tree from a given xml string.
+ *
+ * @param {String} xmlStr
+ * @param {String} [typeName='bpmn:Definitions'] name of the root element
+ * @param {Object} [options] options to pass to the underlying reader
+ * @param {Function} done callback that is invoked with (err, result, parseContext)
+ * once the import completes
+ */
+BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
+
+ if (!isString(typeName)) {
+ done = options;
+ options = typeName;
+ typeName = 'bpmn:Definitions';
+ }
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var reader = new XmlReader(assign({ model: this, lax: true }, options));
+ var rootHandler = reader.handler(typeName);
+
+ reader.fromXML(xmlStr, rootHandler, done);
+};
+
+
+/**
+ * Serializes a BPMN 2.0 object tree to XML.
+ *
+ * @param {String} element the root element, typically an instance of `bpmn:Definitions`
+ * @param {Object} [options] to pass to the underlying writer
+ * @param {Function} done callback invoked with (err, xmlStr) once the import completes
+ */
+BpmnModdle.prototype.toXML = function(element, options, done) {
+
+ if (isFunction(options)) {
+ done = options;
+ options = {};
+ }
+
+ var writer = new XmlWriter(options);
+ try {
+ var result = writer.toXML(element);
+ done(null, result);
+ } catch (e) {
+ done(e);
+ }
+};
+
+},{"160":160,"165":165,"168":168,"18":18,"19":19,"22":22}],16:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168);
+
+var BpmnModdle = _dereq_(15);
+
+var packages = {
+ bpmn: _dereq_(31),
+ bpmndi: _dereq_(32),
+ dc: _dereq_(33),
+ di: _dereq_(34)
+};
+
+module.exports = function(additionalPackages, options) {
+ return new BpmnModdle(assign({}, packages, additionalPackages), options);
+};
+},{"15":15,"168":168,"31":31,"32":32,"33":33,"34":34}],17:[function(_dereq_,module,exports){
+'use strict';
+
+function capitalize(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+}
+
+function lower(string) {
+ return string.charAt(0).toLowerCase() + string.slice(1);
+}
+
+function hasLowerCaseAlias(pkg) {
+ return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
+}
+
+
+module.exports.aliasToName = function(alias, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return capitalize(alias);
+ } else {
+ return alias;
+ }
+};
+
+module.exports.nameToAlias = function(name, pkg) {
+ if (hasLowerCaseAlias(pkg)) {
+ return lower(name);
+ } else {
+ return name;
+ }
+};
+
+module.exports.DEFAULT_NS_MAP = {
+ 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
+};
+
+module.exports.XSI_TYPE = 'xsi:type';
+},{}],18:[function(_dereq_,module,exports){
+'use strict';
+
+var reduce = _dereq_(81),
+ forEach = _dereq_(77),
+ find = _dereq_(76),
+ assign = _dereq_(168),
+ defer = _dereq_(85);
+
+var Stack = _dereq_(21),
+ SaxParser = _dereq_(20).parser,
+ Moddle = _dereq_(22),
+ parseNameNs = _dereq_(27).parseName,
+ Types = _dereq_(30),
+ coerceType = Types.coerceType,
+ isSimpleType = Types.isSimple,
+ common = _dereq_(17),
+ XSI_TYPE = common.XSI_TYPE,
+ XSI_URI = common.DEFAULT_NS_MAP.xsi,
+ aliasToName = common.aliasToName;
+
+function parseNodeAttributes(node) {
+ var nodeAttrs = node.attributes;
+
+ return reduce(nodeAttrs, function(result, v, k) {
+ var name, ns;
+
+ if (!v.local) {
+ name = v.prefix;
+ } else {
+ ns = parseNameNs(v.name, v.prefix);
+ name = ns.name;
+ }
+
+ result[name] = v.value;
+ return result;
+ }, {});
+}
+
+function normalizeType(node, attr, model) {
+ var nameNs = parseNameNs(attr.value);
+
+ var uri = node.ns[nameNs.prefix || ''],
+ localName = nameNs.localName,
+ pkg = uri && model.getPackage(uri),
+ typePrefix;
+
+ if (pkg) {
+ typePrefix = pkg.xml && pkg.xml.typePrefix;
+
+ if (typePrefix && localName.indexOf(typePrefix) === 0) {
+ localName = localName.slice(typePrefix.length);
+ }
+
+ attr.value = pkg.prefix + ':' + localName;
+ }
+}
+
+/**
+ * Normalizes namespaces for a node given an optional default namespace and a
+ * number of mappings from uris to default prefixes.
+ *
+ * @param {XmlNode} node
+ * @param {Model} model the model containing all registered namespaces
+ * @param {Uri} defaultNsUri
+ */
+function normalizeNamespaces(node, model, defaultNsUri) {
+ var uri, prefix;
+
+ uri = node.uri || defaultNsUri;
+
+ if (uri) {
+ var pkg = model.getPackage(uri);
+
+ if (pkg) {
+ prefix = pkg.prefix;
+ } else {
+ prefix = node.prefix;
+ }
+
+ node.prefix = prefix;
+ node.uri = uri;
+ }
+
+ forEach(node.attributes, function(attr) {
+
+ // normalize xsi:type attributes because the
+ // assigned type may or may not be namespace prefixed
+ if (attr.uri === XSI_URI && attr.local === 'type') {
+ normalizeType(node, attr, model);
+ }
+
+ normalizeNamespaces(attr, model, null);
+ });
+}
+
+
+/**
+ * A parse context.
+ *
+ * @class
+ *
+ * @param {Object} options
+ * @param {ElementHandler} options.parseRoot the root handler for parsing a document
+ * @param {boolean} [options.lax=false] whether or not to ignore invalid elements
+ */
+function Context(options) {
+
+ /**
+ * @property {ElementHandler} parseRoot
+ */
+
+ /**
+ * @property {Boolean} lax
+ */
+
+ assign(this, options);
+
+ var elementsById = this.elementsById = {};
+ var references = this.references = [];
+ var warnings = this.warnings = [];
+
+ this.addReference = function(reference) {
+ references.push(reference);
+ };
+
+ this.addElement = function(id, element) {
+
+ if (!id || !element) {
+ throw new Error('[xml-reader] id or ctx must not be null');
+ }
+
+ elementsById[id] = element;
+ };
+
+ this.addWarning = function (w) {
+ warnings.push(w);
+ };
+}
+
+function BaseHandler() {}
+
+BaseHandler.prototype.handleEnd = function() {};
+BaseHandler.prototype.handleText = function() {};
+BaseHandler.prototype.handleNode = function() {};
+
+
+/**
+ * A simple pass through handler that does nothing except for
+ * ignoring all input it receives.
+ *
+ * This is used to ignore unknown elements and
+ * attributes.
+ */
+function NoopHandler() { }
+
+NoopHandler.prototype = new BaseHandler();
+
+NoopHandler.prototype.handleNode = function() {
+ return this;
+};
+
+function BodyHandler() {}
+
+BodyHandler.prototype = new BaseHandler();
+
+BodyHandler.prototype.handleText = function(text) {
+ this.body = (this.body || '') + text;
+};
+
+function ReferenceHandler(property, context) {
+ this.property = property;
+ this.context = context;
+}
+
+ReferenceHandler.prototype = new BodyHandler();
+
+ReferenceHandler.prototype.handleNode = function(node) {
+
+ if (this.element) {
+ throw new Error('expected no sub nodes');
+ } else {
+ this.element = this.createReference(node);
+ }
+
+ return this;
+};
+
+ReferenceHandler.prototype.handleEnd = function() {
+ this.element.id = this.body;
+};
+
+ReferenceHandler.prototype.createReference = function() {
+ return {
+ property: this.property.ns.name,
+ id: ''
+ };
+};
+
+function ValueHandler(propertyDesc, element) {
+ this.element = element;
+ this.propertyDesc = propertyDesc;
+}
+
+ValueHandler.prototype = new BodyHandler();
+
+ValueHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ propertyDesc = this.propertyDesc;
+
+ value = coerceType(propertyDesc.type, value);
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(value);
+ } else {
+ element.set(propertyDesc.name, value);
+ }
+};
+
+
+function BaseElementHandler() {}
+
+BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
+
+BaseElementHandler.prototype.handleNode = function(node) {
+ var parser = this,
+ element = this.element,
+ id;
+
+ if (!element) {
+ element = this.element = this.createElement(node);
+ id = element.id;
+
+ if (id) {
+ this.context.addElement(id, element);
+ }
+ } else {
+ parser = this.handleChild(node);
+ }
+
+ return parser;
+};
+
+/**
+ * @class XMLReader.ElementHandler
+ *
+ */
+function ElementHandler(model, type, context) {
+ this.model = model;
+ this.type = model.getType(type);
+ this.context = context;
+}
+
+ElementHandler.prototype = new BaseElementHandler();
+
+ElementHandler.prototype.addReference = function(reference) {
+ this.context.addReference(reference);
+};
+
+ElementHandler.prototype.handleEnd = function() {
+
+ var value = this.body,
+ element = this.element,
+ descriptor = element.$descriptor,
+ bodyProperty = descriptor.bodyProperty;
+
+ if (bodyProperty && value !== undefined) {
+ value = coerceType(bodyProperty.type, value);
+ element.set(bodyProperty.name, value);
+ }
+};
+
+/**
+ * Create an instance of the model from the given node.
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.createElement = function(node) {
+ var attributes = parseNodeAttributes(node),
+ Type = this.type,
+ descriptor = Type.$descriptor,
+ context = this.context,
+ instance = new Type({});
+
+ forEach(attributes, function(value, name) {
+
+ var prop = descriptor.propertiesByName[name];
+
+ if (prop && prop.isReference) {
+ context.addReference({
+ element: instance,
+ property: prop.ns.name,
+ id: value
+ });
+ } else {
+ if (prop) {
+ value = coerceType(prop.type, value);
+ }
+
+ instance.set(name, value);
+ }
+ });
+
+ return instance;
+};
+
+ElementHandler.prototype.getPropertyForNode = function(node) {
+
+ var nameNs = parseNameNs(node.local, node.prefix);
+
+ var type = this.type,
+ model = this.model,
+ descriptor = type.$descriptor;
+
+ var propertyName = nameNs.name,
+ property = descriptor.propertiesByName[propertyName],
+ elementTypeName,
+ elementType,
+ typeAnnotation;
+
+ // search for properties by name first
+
+ if (property) {
+
+ if (property.serialize === XSI_TYPE) {
+ typeAnnotation = node.attributes[XSI_TYPE];
+
+ // xsi type is optional, if it does not exists the
+ // default type is assumed
+ if (typeAnnotation) {
+
+ elementTypeName = typeAnnotation.value;
+
+ // TODO: extract real name from attribute
+ elementType = model.getType(elementTypeName);
+
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ }
+
+ // search for properties by name first
+ return property;
+ }
+
+
+ var pkg = model.getPackage(nameNs.prefix);
+
+ if (pkg) {
+ elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
+ elementType = model.getType(elementTypeName);
+
+ // search for collection members later
+ property = find(descriptor.properties, function(p) {
+ return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
+ });
+
+ if (property) {
+ return assign({}, property, { effectiveType: elementType.$descriptor.name });
+ }
+ } else {
+ // parse unknown element (maybe extension)
+ property = find(descriptor.properties, function(p) {
+ return !p.isReference && !p.isAttribute && p.type === 'Element';
+ });
+
+ if (property) {
+ return property;
+ }
+ }
+
+ throw new Error('unrecognized element <' + nameNs.name + '>');
+};
+
+ElementHandler.prototype.toString = function() {
+ return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
+};
+
+ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
+ return new ValueHandler(propertyDesc, element);
+};
+
+ElementHandler.prototype.referenceHandler = function(propertyDesc) {
+ return new ReferenceHandler(propertyDesc, this.context);
+};
+
+ElementHandler.prototype.handler = function(type) {
+ if (type === 'Element') {
+ return new GenericElementHandler(this.model, type, this.context);
+ } else {
+ return new ElementHandler(this.model, type, this.context);
+ }
+};
+
+/**
+ * Handle the child element parsing
+ *
+ * @param {Element} node the xml node
+ */
+ElementHandler.prototype.handleChild = function(node) {
+ var propertyDesc, type, element, childHandler;
+
+ propertyDesc = this.getPropertyForNode(node);
+ element = this.element;
+
+ type = propertyDesc.effectiveType || propertyDesc.type;
+
+ if (isSimpleType(type)) {
+ return this.valueHandler(propertyDesc, element);
+ }
+
+ if (propertyDesc.isReference) {
+ childHandler = this.referenceHandler(propertyDesc).handleNode(node);
+ } else {
+ childHandler = this.handler(type).handleNode(node);
+ }
+
+ var newElement = childHandler.element;
+
+ // child handles may decide to skip elements
+ // by not returning anything
+ if (newElement !== undefined) {
+
+ if (propertyDesc.isMany) {
+ element.get(propertyDesc.name).push(newElement);
+ } else {
+ element.set(propertyDesc.name, newElement);
+ }
+
+ if (propertyDesc.isReference) {
+ assign(newElement, {
+ element: element
+ });
+
+ this.context.addReference(newElement);
+ } else {
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+ }
+
+ return childHandler;
+};
+
+
+function GenericElementHandler(model, type, context) {
+ this.model = model;
+ this.context = context;
+}
+
+GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
+
+GenericElementHandler.prototype.createElement = function(node) {
+
+ var name = node.name,
+ prefix = node.prefix,
+ uri = node.ns[prefix],
+ attributes = node.attributes;
+
+ return this.model.createAny(name, uri, attributes);
+};
+
+GenericElementHandler.prototype.handleChild = function(node) {
+
+ var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
+ element = this.element;
+
+ var newElement = handler.element,
+ children;
+
+ if (newElement !== undefined) {
+ children = element.$children = element.$children || [];
+ children.push(newElement);
+
+ // establish child -> parent relationship
+ newElement.$parent = element;
+ }
+
+ return handler;
+};
+
+GenericElementHandler.prototype.handleText = function(text) {
+ this.body = this.body || '' + text;
+};
+
+GenericElementHandler.prototype.handleEnd = function() {
+ if (this.body) {
+ this.element.$body = this.body;
+ }
+};
+
+/**
+ * A reader for a meta-model
+ *
+ * @param {Object} options
+ * @param {Model} options.model used to read xml files
+ * @param {Boolean} options.lax whether to make parse errors warnings
+ */
+function XMLReader(options) {
+
+ if (options instanceof Moddle) {
+ options = {
+ model: options
+ };
+ }
+
+ assign(this, { lax: false }, options);
+}
+
+
+XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
+
+ var model = this.model,
+ lax = this.lax,
+ context = new Context({
+ parseRoot: rootHandler
+ });
+
+ var parser = new SaxParser(true, { xmlns: true, trim: true }),
+ stack = new Stack();
+
+ rootHandler.context = context;
+
+ // push root handler
+ stack.push(rootHandler);
+
+
+ function resolveReferences() {
+
+ var elementsById = context.elementsById;
+ var references = context.references;
+
+ var i, r;
+
+ for (i = 0; !!(r = references[i]); i++) {
+ var element = r.element;
+ var reference = elementsById[r.id];
+ var property = element.$descriptor.propertiesByName[r.property];
+
+ if (!reference) {
+ context.addWarning({
+ message: 'unresolved reference <' + r.id + '>',
+ element: r.element,
+ property: r.property,
+ value: r.id
+ });
+ }
+
+ if (property.isMany) {
+ var collection = element.get(property.name),
+ idx = collection.indexOf(r);
+
+ if (!reference) {
+ // remove unresolvable reference
+ collection.splice(idx, 1);
+ } else {
+ // update reference
+ collection[idx] = reference;
+ }
+ } else {
+ element.set(property.name, reference);
+ }
+ }
+ }
+
+ function handleClose(tagName) {
+ stack.pop().handleEnd();
+ }
+
+ function handleOpen(node) {
+ var handler = stack.peek();
+
+ normalizeNamespaces(node, model);
+
+ try {
+ stack.push(handler.handleNode(node));
+ } catch (e) {
+
+ var line = this.line,
+ column = this.column;
+
+ var message =
+ 'unparsable content <' + node.name + '> detected\n\t' +
+ 'line: ' + line + '\n\t' +
+ 'column: ' + column + '\n\t' +
+ 'nested error: ' + e.message;
+
+ if (lax) {
+ context.addWarning({
+ message: message,
+ error: e
+ });
+
+ console.warn('could not parse node');
+ console.warn(e);
+
+ stack.push(new NoopHandler());
+ } else {
+ console.error('could not parse document');
+ console.error(e);
+
+ throw new Error(message);
+ }
+ }
+ }
+
+ function handleText(text) {
+ stack.peek().handleText(text);
+ }
+
+ parser.onopentag = handleOpen;
+ parser.oncdata = parser.ontext = handleText;
+ parser.onclosetag = handleClose;
+ parser.onend = resolveReferences;
+
+ // deferred parse XML to make loading really ascnchronous
+ // this ensures the execution environment (node or browser)
+ // is kept responsive and that certain optimization strategies
+ // can kick in
+ defer(function() {
+ var error;
+
+ try {
+ parser.write(xml).close();
+ } catch (e) {
+ error = e;
+ }
+
+ done(error, error ? undefined : rootHandler.element, context);
+ });
+};
+
+XMLReader.prototype.handler = function(name) {
+ return new ElementHandler(this.model, name);
+};
+
+module.exports = XMLReader;
+module.exports.ElementHandler = ElementHandler;
+},{"168":168,"17":17,"20":20,"21":21,"22":22,"27":27,"30":30,"76":76,"77":77,"81":81,"85":85}],19:[function(_dereq_,module,exports){
+'use strict';
+
+var map = _dereq_(80),
+ forEach = _dereq_(77),
+ isString = _dereq_(165),
+ filter = _dereq_(75),
+ assign = _dereq_(168);
+
+var Types = _dereq_(30),
+ parseNameNs = _dereq_(27).parseName,
+ common = _dereq_(17),
+ nameToAlias = common.nameToAlias;
+
+var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
+ ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
+ DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
+ XSI_TYPE = common.XSI_TYPE;
+
+
+function nsName(ns) {
+ if (isString(ns)) {
+ return ns;
+ } else {
+ return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
+ }
+}
+
+function getElementNs(ns, descriptor) {
+ if (descriptor.isGeneric) {
+ return descriptor.name;
+ } else {
+ return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);
+ }
+}
+
+function getPropertyNs(ns, descriptor) {
+ return assign({ localName: descriptor.ns.localName }, ns);
+}
+
+function getSerializableProperties(element) {
+ var descriptor = element.$descriptor;
+
+ return filter(descriptor.properties, function(p) {
+ var name = p.name;
+
+ // do not serialize defaults
+ if (!element.hasOwnProperty(name)) {
+ return false;
+ }
+
+ var value = element[name];
+
+ // do not serialize default equals
+ if (value === p.default) {
+ return false;
+ }
+
+ return p.isMany ? value.length : true;
+ });
+}
+
+var ESCAPE_MAP = {
+ '\n': '10',
+ '\n\r': '10',
+ '"': '34',
+ '\'': '39',
+ '<': '60',
+ '>': '62',
+ '&': '38'
+};
+
+/**
+ * Escape a string attribute to not contain any bad values (line breaks, '"', ...)
+ *
+ * @param {String} str the string to escape
+ * @return {String} the escaped string
+ */
+function escapeAttr(str) {
+
+ // ensure we are handling strings here
+ str = isString(str) ? str : '' + str;
+
+ return str.replace(ESCAPE_CHARS, function(str) {
+ return '&#' + ESCAPE_MAP[str] + ';';
+ });
+}
+
+function filterAttributes(props) {
+ return filter(props, function(p) { return p.isAttr; });
+}
+
+function filterContained(props) {
+ return filter(props, function(p) { return !p.isAttr; });
+}
+
+
+function ReferenceSerializer(parent, ns) {
+ this.ns = ns;
+}
+
+ReferenceSerializer.prototype.build = function(element) {
+ this.element = element;
+ return this;
+};
+
+ReferenceSerializer.prototype.serializeTo = function(writer) {
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function BodySerializer() {}
+
+BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
+ var escape = this.escape;
+
+ if (escape) {
+ writer.append('<![CDATA[');
+ }
+
+ writer.append(this.value);
+
+ if (escape) {
+ writer.append(']]>');
+ }
+};
+
+BodySerializer.prototype.build = function(prop, value) {
+ this.value = value;
+
+ if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
+ this.escape = true;
+ }
+
+ return this;
+};
+
+function ValueSerializer(ns) {
+ this.ns = ns;
+}
+
+ValueSerializer.prototype = new BodySerializer();
+
+ValueSerializer.prototype.serializeTo = function(writer) {
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns) + '>');
+
+ this.serializeValue(writer);
+
+ writer
+ .append( '</' + nsName(this.ns) + '>')
+ .appendNewLine();
+};
+
+function ElementSerializer(parent, ns) {
+ this.body = [];
+ this.attrs = [];
+
+ this.parent = parent;
+ this.ns = ns;
+}
+
+ElementSerializer.prototype.build = function(element) {
+ this.element = element;
+
+ var otherAttrs = this.parseNsAttributes(element);
+
+ if (!this.ns) {
+ this.ns = this.nsTagName(element.$descriptor);
+ }
+
+ if (element.$descriptor.isGeneric) {
+ this.parseGeneric(element);
+ } else {
+ var properties = getSerializableProperties(element);
+
+ this.parseAttributes(filterAttributes(properties));
+ this.parseContainments(filterContained(properties));
+
+ this.parseGenericAttributes(element, otherAttrs);
+ }
+
+ return this;
+};
+
+ElementSerializer.prototype.nsTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getElementNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
+ var effectiveNs = this.logNamespaceUsed(descriptor.ns);
+ return getPropertyNs(effectiveNs, descriptor);
+};
+
+ElementSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.ns.uri;
+};
+
+ElementSerializer.prototype.nsAttributeName = function(element) {
+
+ var ns;
+
+ if (isString(element)) {
+ ns = parseNameNs(element);
+ } else
+ if (element.ns) {
+ ns = element.ns;
+ }
+
+ var effectiveNs = this.logNamespaceUsed(ns);
+
+ // strip prefix if same namespace like parent
+ if (this.isLocalNs(effectiveNs)) {
+ return { localName: ns.localName };
+ } else {
+ return assign({ localName: ns.localName }, effectiveNs);
+ }
+};
+
+ElementSerializer.prototype.parseGeneric = function(element) {
+
+ var self = this,
+ body = this.body,
+ attrs = this.attrs;
+
+ forEach(element, function(val, key) {
+
+ if (key === '$body') {
+ body.push(new BodySerializer().build({ type: 'String' }, val));
+ } else
+ if (key === '$children') {
+ forEach(val, function(child) {
+ body.push(new ElementSerializer(self).build(child));
+ });
+ } else
+ if (key.indexOf('$') !== 0) {
+ attrs.push({ name: key, value: escapeAttr(val) });
+ }
+ });
+};
+
+/**
+ * Parse namespaces and return a list of left over generic attributes
+ *
+ * @param {Object} element
+ * @return {Array<Object>}
+ */
+ElementSerializer.prototype.parseNsAttributes = function(element) {
+ var self = this;
+
+ var genericAttrs = element.$attrs;
+
+ var attributes = [];
+
+ // parse namespace attributes first
+ // and log them. push non namespace attributes to a list
+ // and process them later
+ forEach(genericAttrs, function(value, name) {
+ var nameNs = parseNameNs(name);
+
+ if (nameNs.prefix === 'xmlns') {
+ self.logNamespace({ prefix: nameNs.localName, uri: value });
+ } else
+ if (!nameNs.prefix && nameNs.localName === 'xmlns') {
+ self.logNamespace({ uri: value });
+ } else {
+ attributes.push({ name: name, value: value });
+ }
+ });
+
+ return attributes;
+};
+
+ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
+
+ var self = this;
+
+ forEach(attributes, function(attr) {
+
+ // do not serialize xsi:type attribute
+ // it is set manually based on the actual implementation type
+ if (attr.name === XSI_TYPE) {
+ return;
+ }
+
+ try {
+ self.addAttribute(self.nsAttributeName(attr.name), attr.value);
+ } catch (e) {
+ console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
+ }
+ });
+};
+
+ElementSerializer.prototype.parseContainments = function(properties) {
+
+ var self = this,
+ body = this.body,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ var value = element.get(p.name),
+ isReference = p.isReference,
+ isMany = p.isMany;
+
+ var ns = self.nsPropertyTagName(p);
+
+ if (!isMany) {
+ value = [ value ];
+ }
+
+ if (p.isBody) {
+ body.push(new BodySerializer().build(p, value[0]));
+ } else
+ if (Types.isSimple(p.type)) {
+ forEach(value, function(v) {
+ body.push(new ValueSerializer(ns).build(p, v));
+ });
+ } else
+ if (isReference) {
+ forEach(value, function(v) {
+ body.push(new ReferenceSerializer(self, ns).build(v));
+ });
+ } else {
+ // allow serialization via type
+ // rather than element name
+ var asType = p.serialize === XSI_TYPE;
+
+ forEach(value, function(v) {
+ var serializer;
+
+ if (asType) {
+ serializer = new TypeSerializer(self, ns);
+ } else {
+ serializer = new ElementSerializer(self);
+ }
+
+ body.push(serializer.build(v));
+ });
+ }
+ });
+};
+
+ElementSerializer.prototype.getNamespaces = function() {
+ if (!this.parent) {
+ if (!this.namespaces) {
+ this.namespaces = {
+ prefixMap: {},
+ uriMap: {},
+ used: {}
+ };
+ }
+ } else {
+ this.namespaces = this.parent.getNamespaces();
+ }
+
+ return this.namespaces;
+};
+
+ElementSerializer.prototype.logNamespace = function(ns) {
+ var namespaces = this.getNamespaces();
+
+ var existing = namespaces.uriMap[ns.uri];
+
+ if (!existing) {
+ namespaces.uriMap[ns.uri] = ns;
+ }
+
+ namespaces.prefixMap[ns.prefix] = ns.uri;
+
+ return ns;
+};
+
+ElementSerializer.prototype.logNamespaceUsed = function(ns) {
+ var element = this.element,
+ model = element.$model,
+ namespaces = this.getNamespaces();
+
+ // ns may be
+ //
+ // * prefix only
+ // * prefix:uri
+
+ var prefix = ns.prefix;
+ var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
+ namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
+
+ if (!uri) {
+ throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
+ }
+
+ ns = namespaces.uriMap[uri];
+
+ if (!ns) {
+ ns = this.logNamespace({ prefix: prefix, uri: uri });
+ }
+
+ if (!namespaces.used[ns.uri]) {
+ namespaces.used[ns.uri] = ns;
+ }
+
+ return ns;
+};
+
+ElementSerializer.prototype.parseAttributes = function(properties) {
+ var self = this,
+ element = this.element;
+
+ forEach(properties, function(p) {
+ self.logNamespaceUsed(p.ns);
+
+ var value = element.get(p.name);
+
+ if (p.isReference) {
+ value = value.id;
+ }
+
+ self.addAttribute(self.nsAttributeName(p), value);
+ });
+};
+
+ElementSerializer.prototype.addAttribute = function(name, value) {
+ var attrs = this.attrs;
+
+ if (isString(value)) {
+ value = escapeAttr(value);
+ }
+
+ attrs.push({ name: name, value: value });
+};
+
+ElementSerializer.prototype.serializeAttributes = function(writer) {
+ var attrs = this.attrs,
+ root = !this.parent,
+ namespaces = this.namespaces;
+
+ function collectNsAttrs() {
+ return map(namespaces.used, function(ns) {
+ var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
+ return { name: name, value: ns.uri };
+ });
+ }
+
+ if (root) {
+ attrs = collectNsAttrs().concat(attrs);
+ }
+
+ forEach(attrs, function(a) {
+ writer
+ .append(' ')
+ .append(nsName(a.name)).append('="').append(a.value).append('"');
+ });
+};
+
+ElementSerializer.prototype.serializeTo = function(writer) {
+ var hasBody = this.body.length,
+ indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
+
+ writer
+ .appendIndent()
+ .append('<' + nsName(this.ns));
+
+ this.serializeAttributes(writer);
+
+ writer.append(hasBody ? '>' : ' />');
+
+ if (hasBody) {
+
+ if (indent) {
+ writer
+ .appendNewLine()
+ .indent();
+ }
+
+ forEach(this.body, function(b) {
+ b.serializeTo(writer);
+ });
+
+ if (indent) {
+ writer
+ .unindent()
+ .appendIndent();
+ }
+
+ writer.append('</' + nsName(this.ns) + '>');
+ }
+
+ writer.appendNewLine();
+};
+
+/**
+ * A serializer for types that handles serialization of data types
+ */
+function TypeSerializer(parent, ns) {
+ ElementSerializer.call(this, parent, ns);
+}
+
+TypeSerializer.prototype = new ElementSerializer();
+
+TypeSerializer.prototype.build = function(element) {
+ var descriptor = element.$descriptor;
+
+ this.element = element;
+
+ this.typeNs = this.nsTagName(descriptor);
+
+ // add xsi:type attribute to represent the elements
+ // actual type
+
+ var typeNs = this.typeNs,
+ pkg = element.$model.getPackage(typeNs.uri),
+ typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
+
+ this.addAttribute(this.nsAttributeName(XSI_TYPE),
+ (typeNs.prefix ? typeNs.prefix + ':' : '') +
+ typePrefix + descriptor.ns.localName);
+
+ // do the usual stuff
+ return ElementSerializer.prototype.build.call(this, element);
+};
+
+TypeSerializer.prototype.isLocalNs = function(ns) {
+ return ns.uri === this.typeNs.uri;
+};
+
+function SavingWriter() {
+ this.value = '';
+
+ this.write = function(str) {
+ this.value += str;
+ };
+}
+
+function FormatingWriter(out, format) {
+
+ var indent = [''];
+
+ this.append = function(str) {
+ out.write(str);
+
+ return this;
+ };
+
+ this.appendNewLine = function() {
+ if (format) {
+ out.write('\n');
+ }
+
+ return this;
+ };
+
+ this.appendIndent = function() {
+ if (format) {
+ out.write(indent.join(' '));
+ }
+
+ return this;
+ };
+
+ this.indent = function() {
+ indent.push('');
+ return this;
+ };
+
+ this.unindent = function() {
+ indent.pop();
+ return this;
+ };
+}
+
+/**
+ * A writer for meta-model backed document trees
+ *
+ * @param {Object} options output options to pass into the writer
+ */
+function XMLWriter(options) {
+
+ options = assign({ format: false, preamble: true }, options || {});
+
+ function toXML(tree, writer) {
+ var internalWriter = writer || new SavingWriter();
+ var formatingWriter = new FormatingWriter(internalWriter, options.format);
+
+ if (options.preamble) {
+ formatingWriter.append(XML_PREAMBLE);
+ }
+
+ new ElementSerializer().build(tree).serializeTo(formatingWriter);
+
+ if (!writer) {
+ return internalWriter.value;
+ }
+ }
+
+ return {
+ toXML: toXML
+ };
+}
+
+module.exports = XMLWriter;
+},{"165":165,"168":168,"17":17,"27":27,"30":30,"75":75,"77":77,"80":80}],20:[function(_dereq_,module,exports){
+(function (Buffer){
+// wrapper for non-node envs
+;(function (sax) {
+
+sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+sax.SAXParser = SAXParser
+sax.SAXStream = SAXStream
+sax.createStream = createStream
+
+// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+// since that's the earliest that a buffer overrun could occur. This way, checks are
+// as rare as required, but as often as necessary to ensure never crossing this bound.
+// Furthermore, buffers are only tested at most once per write(), so passing a very
+// large string into write() might have undesirable effects, but this is manageable by
+// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+// edge case, result in creating at most one complete copy of the string passed in.
+// Set to Infinity to have unlimited buffers.
+sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+var buffers = [
+ "comment", "sgmlDecl", "textNode", "tagName", "doctype",
+ "procInstName", "procInstBody", "entity", "attribName",
+ "attribValue", "cdata", "script"
+]
+
+sax.EVENTS = // for discoverability.
+ [ "text"
+ , "processinginstruction"
+ , "sgmldeclaration"
+ , "doctype"
+ , "comment"
+ , "attribute"
+ , "opentag"
+ , "closetag"
+ , "opencdata"
+ , "cdata"
+ , "closecdata"
+ , "error"
+ , "end"
+ , "ready"
+ , "script"
+ , "opennamespace"
+ , "closenamespace"
+ ]
+
+function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ""
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.ENTITIES = Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, "onready")
+}
+
+if (!Object.create) Object.create = function (o) {
+ function f () { this.__proto__ = o }
+ f.prototype = o
+ return new f
+}
+
+if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {
+ return o.__proto__
+}
+
+if (!Object.keys) Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+}
+
+function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ , maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case "textNode":
+ closeText(parser)
+ break
+
+ case "cdata":
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ break
+
+ case "script":
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ break
+
+ default:
+ error(parser, "Max buffer length exceeded: "+buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)
+ + parser.position
+}
+
+function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ parser[buffers[i]] = ""
+ }
+}
+
+function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== "") {
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ }
+ if (parser.script !== "") {
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+}
+
+SAXParser.prototype =
+ { end: function () { end(this) }
+ , write: write
+ , resume: function () { this.error = null; return this }
+ , close: function () { return this.write(null) }
+ , flush: function () { flushBuffers(this) }
+ }
+
+try {
+ var Stream = _dereq_("stream").Stream
+} catch (ex) {
+ var Stream = function () {}
+}
+
+
+var streamWraps = sax.EVENTS.filter(function (ev) {
+ return ev !== "error" && ev !== "end"
+})
+
+function createStream (strict, opt) {
+ return new SAXStream(strict, opt)
+}
+
+function SAXStream (strict, opt) {
+ if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
+
+ Stream.apply(this)
+
+ this._parser = new SAXParser(strict, opt)
+ this.writable = true
+ this.readable = true
+
+
+ var me = this
+
+ this._parser.onend = function () {
+ me.emit("end")
+ }
+
+ this._parser.onerror = function (er) {
+ me.emit("error", er)
+
+ // if didn't throw, then means error was handled.
+ // go ahead and clear error, so we can write again.
+ me._parser.error = null
+ }
+
+ this._decoder = null;
+
+ streamWraps.forEach(function (ev) {
+ Object.defineProperty(me, "on" + ev, {
+ get: function () { return me._parser["on" + ev] },
+ set: function (h) {
+ if (!h) {
+ me.removeAllListeners(ev)
+ return me._parser["on"+ev] = h
+ }
+ me.on(ev, h)
+ },
+ enumerable: true,
+ configurable: false
+ })
+ })
+}
+
+SAXStream.prototype = Object.create(Stream.prototype,
+ { constructor: { value: SAXStream } })
+
+SAXStream.prototype.write = function (data) {
+ if (typeof Buffer === 'function' &&
+ typeof Buffer.isBuffer === 'function' &&
+ Buffer.isBuffer(data)) {
+ if (!this._decoder) {
+ var SD = _dereq_('string_decoder').StringDecoder
+ this._decoder = new SD('utf8')
+ }
+ data = this._decoder.write(data);
+ }
+
+ this._parser.write(data.toString())
+ this.emit("data", data)
+ return true
+}
+
+SAXStream.prototype.end = function (chunk) {
+ if (chunk && chunk.length) this.write(chunk)
+ this._parser.end()
+ return true
+}
+
+SAXStream.prototype.on = function (ev, handler) {
+ var me = this
+ if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) {
+ me._parser["on"+ev] = function () {
+ var args = arguments.length === 1 ? [arguments[0]]
+ : Array.apply(null, arguments)
+ args.splice(0, 0, ev)
+ me.emit.apply(me, args)
+ }
+ }
+
+ return Stream.prototype.on.call(me, ev, handler)
+}
+
+
+
+// character classes and tokens
+var whitespace = "\r\n\t "
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ , number = "0124356789"
+ , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ // (Letter | "_" | ":")
+ , quote = "'\""
+ , entity = number+letter+"#"
+ , attribEnd = whitespace + ">"
+ , CDATA = "[CDATA["
+ , DOCTYPE = "DOCTYPE"
+ , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
+ , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
+ , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+// turn all the string character sets into character class objects.
+whitespace = charClass(whitespace)
+number = charClass(number)
+letter = charClass(letter)
+
+// http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+// This implementation works on strings, a single character at a time
+// as such, it cannot ever support astral-plane characters (10000-EFFFF)
+// without a significant breaking change to either this parser, or the
+// JavaScript language. Implementation of an emoji-capable xml parser
+// is left as an exercise for the reader.
+var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
+
+quote = charClass(quote)
+entity = charClass(entity)
+attribEnd = charClass(attribEnd)
+
+function charClass (str) {
+ return str.split("").reduce(function (s, c) {
+ s[c] = true
+ return s
+ }, {})
+}
+
+function isRegExp (c) {
+ return Object.prototype.toString.call(c) === '[object RegExp]'
+}
+
+function is (charclass, c) {
+ return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
+}
+
+function not (charclass, c) {
+ return !is(charclass, c)
+}
+
+var S = 0
+sax.STATE =
+{ BEGIN : S++
+, TEXT : S++ // general stuff
+, TEXT_ENTITY : S++ // &amp and such.
+, OPEN_WAKA : S++ // <
+, SGML_DECL : S++ // <!BLARG
+, SGML_DECL_QUOTED : S++ // <!BLARG foo "bar
+, DOCTYPE : S++ // <!DOCTYPE
+, DOCTYPE_QUOTED : S++ // <!DOCTYPE "//blah
+, DOCTYPE_DTD : S++ // <!DOCTYPE "//blah" [ ...
+, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE "//blah" [ "foo
+, COMMENT_STARTING : S++ // <!-
+, COMMENT : S++ // <!--
+, COMMENT_ENDING : S++ // <!-- blah -
+, COMMENT_ENDED : S++ // <!-- blah --
+, CDATA : S++ // <![CDATA[ something
+, CDATA_ENDING : S++ // ]
+, CDATA_ENDING_2 : S++ // ]]
+, PROC_INST : S++ // <?hi
+, PROC_INST_BODY : S++ // <?hi there
+, PROC_INST_ENDING : S++ // <?hi "there" ?
+, OPEN_TAG : S++ // <strong
+, OPEN_TAG_SLASH : S++ // <strong /
+, ATTRIB : S++ // <a
+, ATTRIB_NAME : S++ // <a foo
+, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _
+, ATTRIB_VALUE : S++ // <a foo=
+, ATTRIB_VALUE_QUOTED : S++ // <a foo="bar
+, ATTRIB_VALUE_CLOSED : S++ // <a foo="bar"
+, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar
+, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar="&quot;"
+, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;
+, CLOSE_TAG : S++ // </a
+, CLOSE_TAG_SAW_WHITE : S++ // </a >
+, SCRIPT : S++ // <script> ...
+, SCRIPT_ENDING : S++ // <script> ... <
+}
+
+sax.ENTITIES =
+{ "amp" : "&"
+, "gt" : ">"
+, "lt" : "<"
+, "quot" : "\""
+, "apos" : "'"
+, "AElig" : 198
+, "Aacute" : 193
+, "Acirc" : 194
+, "Agrave" : 192
+, "Aring" : 197
+, "Atilde" : 195
+, "Auml" : 196
+, "Ccedil" : 199
+, "ETH" : 208
+, "Eacute" : 201
+, "Ecirc" : 202
+, "Egrave" : 200
+, "Euml" : 203
+, "Iacute" : 205
+, "Icirc" : 206
+, "Igrave" : 204
+, "Iuml" : 207
+, "Ntilde" : 209
+, "Oacute" : 211
+, "Ocirc" : 212
+, "Ograve" : 210
+, "Oslash" : 216
+, "Otilde" : 213
+, "Ouml" : 214
+, "THORN" : 222
+, "Uacute" : 218
+, "Ucirc" : 219
+, "Ugrave" : 217
+, "Uuml" : 220
+, "Yacute" : 221
+, "aacute" : 225
+, "acirc" : 226
+, "aelig" : 230
+, "agrave" : 224
+, "aring" : 229
+, "atilde" : 227
+, "auml" : 228
+, "ccedil" : 231
+, "eacute" : 233
+, "ecirc" : 234
+, "egrave" : 232
+, "eth" : 240
+, "euml" : 235
+, "iacute" : 237
+, "icirc" : 238
+, "igrave" : 236
+, "iuml" : 239
+, "ntilde" : 241
+, "oacute" : 243
+, "ocirc" : 244
+, "ograve" : 242
+, "oslash" : 248
+, "otilde" : 245
+, "ouml" : 246
+, "szlig" : 223
+, "thorn" : 254
+, "uacute" : 250
+, "ucirc" : 251
+, "ugrave" : 249
+, "uuml" : 252
+, "yacute" : 253
+, "yuml" : 255
+, "copy" : 169
+, "reg" : 174
+, "nbsp" : 160
+, "iexcl" : 161
+, "cent" : 162
+, "pound" : 163
+, "curren" : 164
+, "yen" : 165
+, "brvbar" : 166
+, "sect" : 167
+, "uml" : 168
+, "ordf" : 170
+, "laquo" : 171
+, "not" : 172
+, "shy" : 173
+, "macr" : 175
+, "deg" : 176
+, "plusmn" : 177
+, "sup1" : 185
+, "sup2" : 178
+, "sup3" : 179
+, "acute" : 180
+, "micro" : 181
+, "para" : 182
+, "middot" : 183
+, "cedil" : 184
+, "ordm" : 186
+, "raquo" : 187
+, "frac14" : 188
+, "frac12" : 189
+, "frac34" : 190
+, "iquest" : 191
+, "times" : 215
+, "divide" : 247
+, "OElig" : 338
+, "oelig" : 339
+, "Scaron" : 352
+, "scaron" : 353
+, "Yuml" : 376
+, "fnof" : 402
+, "circ" : 710
+, "tilde" : 732
+, "Alpha" : 913
+, "Beta" : 914
+, "Gamma" : 915
+, "Delta" : 916
+, "Epsilon" : 917
+, "Zeta" : 918
+, "Eta" : 919
+, "Theta" : 920
+, "Iota" : 921
+, "Kappa" : 922
+, "Lambda" : 923
+, "Mu" : 924
+, "Nu" : 925
+, "Xi" : 926
+, "Omicron" : 927
+, "Pi" : 928
+, "Rho" : 929
+, "Sigma" : 931
+, "Tau" : 932
+, "Upsilon" : 933
+, "Phi" : 934
+, "Chi" : 935
+, "Psi" : 936
+, "Omega" : 937
+, "alpha" : 945
+, "beta" : 946
+, "gamma" : 947
+, "delta" : 948
+, "epsilon" : 949
+, "zeta" : 950
+, "eta" : 951
+, "theta" : 952
+, "iota" : 953
+, "kappa" : 954
+, "lambda" : 955
+, "mu" : 956
+, "nu" : 957
+, "xi" : 958
+, "omicron" : 959
+, "pi" : 960
+, "rho" : 961
+, "sigmaf" : 962
+, "sigma" : 963
+, "tau" : 964
+, "upsilon" : 965
+, "phi" : 966
+, "chi" : 967
+, "psi" : 968
+, "omega" : 969
+, "thetasym" : 977
+, "upsih" : 978
+, "piv" : 982
+, "ensp" : 8194
+, "emsp" : 8195
+, "thinsp" : 8201
+, "zwnj" : 8204
+, "zwj" : 8205
+, "lrm" : 8206
+, "rlm" : 8207
+, "ndash" : 8211
+, "mdash" : 8212
+, "lsquo" : 8216
+, "rsquo" : 8217
+, "sbquo" : 8218
+, "ldquo" : 8220
+, "rdquo" : 8221
+, "bdquo" : 8222
+, "dagger" : 8224
+, "Dagger" : 8225
+, "bull" : 8226
+, "hellip" : 8230
+, "permil" : 8240
+, "prime" : 8242
+, "Prime" : 8243
+, "lsaquo" : 8249
+, "rsaquo" : 8250
+, "oline" : 8254
+, "frasl" : 8260
+, "euro" : 8364
+, "image" : 8465
+, "weierp" : 8472
+, "real" : 8476
+, "trade" : 8482
+, "alefsym" : 8501
+, "larr" : 8592
+, "uarr" : 8593
+, "rarr" : 8594
+, "darr" : 8595
+, "harr" : 8596
+, "crarr" : 8629
+, "lArr" : 8656
+, "uArr" : 8657
+, "rArr" : 8658
+, "dArr" : 8659
+, "hArr" : 8660
+, "forall" : 8704
+, "part" : 8706
+, "exist" : 8707
+, "empty" : 8709
+, "nabla" : 8711
+, "isin" : 8712
+, "notin" : 8713
+, "ni" : 8715
+, "prod" : 8719
+, "sum" : 8721
+, "minus" : 8722
+, "lowast" : 8727
+, "radic" : 8730
+, "prop" : 8733
+, "infin" : 8734
+, "ang" : 8736
+, "and" : 8743
+, "or" : 8744
+, "cap" : 8745
+, "cup" : 8746
+, "int" : 8747
+, "there4" : 8756
+, "sim" : 8764
+, "cong" : 8773
+, "asymp" : 8776
+, "ne" : 8800
+, "equiv" : 8801
+, "le" : 8804
+, "ge" : 8805
+, "sub" : 8834
+, "sup" : 8835
+, "nsub" : 8836
+, "sube" : 8838
+, "supe" : 8839
+, "oplus" : 8853
+, "otimes" : 8855
+, "perp" : 8869
+, "sdot" : 8901
+, "lceil" : 8968
+, "rceil" : 8969
+, "lfloor" : 8970
+, "rfloor" : 8971
+, "lang" : 9001
+, "rang" : 9002
+, "loz" : 9674
+, "spades" : 9824
+, "clubs" : 9827
+, "hearts" : 9829
+, "diams" : 9830
+}
+
+Object.keys(sax.ENTITIES).forEach(function (key) {
+ var e = sax.ENTITIES[key]
+ var s = typeof e === 'number' ? String.fromCharCode(e) : e
+ sax.ENTITIES[key] = s
+})
+
+for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
+
+// shorthand
+S = sax.STATE
+
+function emit (parser, event, data) {
+ parser[event] && parser[event](data)
+}
+
+function emitNode (parser, nodeType, data) {
+ if (parser.textNode) closeText(parser)
+ emit(parser, nodeType, data)
+}
+
+function closeText (parser) {
+ parser.textNode = textopts(parser.opt, parser.textNode)
+ if (parser.textNode) emit(parser, "ontext", parser.textNode)
+ parser.textNode = ""
+}
+
+function textopts (opt, text) {
+ if (opt.trim) text = text.trim()
+ if (opt.normalize) text = text.replace(/\s+/g, " ")
+ return text
+}
+
+function error (parser, er) {
+ closeText(parser)
+ if (parser.trackPosition) {
+ er += "\nLine: "+parser.line+
+ "\nColumn: "+parser.column+
+ "\nChar: "+parser.c
+ }
+ er = new Error(er)
+ parser.error = er
+ emit(parser, "onerror", er)
+ return parser
+}
+
+function end (parser) {
+ if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
+ if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
+ closeText(parser)
+ parser.c = ""
+ parser.closed = true
+ emit(parser, "onend")
+ SAXParser.call(parser, parser.strict, parser.opt)
+ return parser
+}
+
+function strictFail (parser, message) {
+ if (typeof parser !== 'object' || !(parser instanceof SAXParser))
+ throw new Error('bad call to strictFail');
+ if (parser.strict) error(parser, message)
+}
+
+function newTag (parser) {
+ if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ , tag = parser.tag = { name : parser.tagName, attributes : {} }
+
+ // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+ if (parser.opt.xmlns) tag.ns = parent.ns
+ parser.attribList.length = 0
+}
+
+function qname (name, attribute) {
+ var i = name.indexOf(":")
+ , qualName = i < 0 ? [ "", name ] : name.split(":")
+ , prefix = qualName[0]
+ , local = qualName[1]
+
+ // <x "xmlns"="http://foo">
+ if (attribute && name === "xmlns") {
+ prefix = "xmlns"
+ local = ""
+ }
+
+ return { prefix: prefix, local: local }
+}
+
+function attrib (parser) {
+ if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
+
+ if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+ parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+ return parser.attribName = parser.attribValue = ""
+ }
+
+ if (parser.opt.xmlns) {
+ var qn = qname(parser.attribName, true)
+ , prefix = qn.prefix
+ , local = qn.local
+
+ if (prefix === "xmlns") {
+ // namespace binding attribute; push the binding into scope
+ if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
+ strictFail( parser
+ , "xml: prefix must be bound to " + XML_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
+ strictFail( parser
+ , "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else {
+ var tag = parser.tag
+ , parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns === parent.ns) {
+ tag.ns = Object.create(parent.ns)
+ }
+ tag.ns[local] = parser.attribValue
+ }
+ }
+
+ // defer onattribute events until all attributes have been seen
+ // so any new bindings can take effect; preserve attribute order
+ // so deferred events can be emitted in document order
+ parser.attribList.push([parser.attribName, parser.attribValue])
+ } else {
+ // in non-xmlns mode, we can emit the event right away
+ parser.tag.attributes[parser.attribName] = parser.attribValue
+ emitNode( parser
+ , "onattribute"
+ , { name: parser.attribName
+ , value: parser.attribValue } )
+ }
+
+ parser.attribName = parser.attribValue = ""
+}
+
+function openTag (parser, selfClosing) {
+ if (parser.opt.xmlns) {
+ // emit namespace binding events
+ var tag = parser.tag
+
+ // add namespace info to tag
+ var qn = qname(parser.tagName)
+ tag.prefix = qn.prefix
+ tag.local = qn.local
+ tag.uri = tag.ns[qn.prefix] || ""
+
+ if (tag.prefix && !tag.uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(parser.tagName))
+ tag.uri = qn.prefix
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns && parent.ns !== tag.ns) {
+ Object.keys(tag.ns).forEach(function (p) {
+ emitNode( parser
+ , "onopennamespace"
+ , { prefix: p , uri: tag.ns[p] } )
+ })
+ }
+
+ // handle deferred onattribute events
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (var i = 0, l = parser.attribList.length; i < l; i ++) {
+ var nv = parser.attribList[i]
+ var name = nv[0]
+ , value = nv[1]
+ , qualName = qname(name, true)
+ , prefix = qualName.prefix
+ , local = qualName.local
+ , uri = prefix == "" ? "" : (tag.ns[prefix] || "")
+ , a = { name: name
+ , value: value
+ , prefix: prefix
+ , local: local
+ , uri: uri
+ }
+
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (prefix && prefix != "xmlns" && !uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(prefix))
+ a.uri = prefix
+ }
+ parser.tag.attributes[name] = a
+ emitNode(parser, "onattribute", a)
+ }
+ parser.attribList.length = 0
+ }
+
+ parser.tag.isSelfClosing = !!selfClosing
+
+ // process the tag
+ parser.sawRoot = true
+ parser.tags.push(parser.tag)
+ emitNode(parser, "onopentag", parser.tag)
+ if (!selfClosing) {
+ // special case for <script> in non-strict mode.
+ if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
+ parser.state = S.SCRIPT
+ } else {
+ parser.state = S.TEXT
+ }
+ parser.tag = null
+ parser.tagName = ""
+ }
+ parser.attribName = parser.attribValue = ""
+ parser.attribList.length = 0
+}
+
+function closeTag (parser) {
+ if (!parser.tagName) {
+ strictFail(parser, "Weird empty close tag.")
+ parser.textNode += "</>"
+ parser.state = S.TEXT
+ return
+ }
+
+ if (parser.script) {
+ if (parser.tagName !== "script") {
+ parser.script += "</" + parser.tagName + ">"
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ return
+ }
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = parser.tags.length
+ var tagName = parser.tagName
+ if (!parser.strict) tagName = tagName[parser.looseCase]()
+ var closeTo = tagName
+ while (t --) {
+ var close = parser.tags[t]
+ if (close.name !== closeTo) {
+ // fail the first time in strict mode
+ strictFail(parser, "Unexpected close tag")
+ } else break
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0) {
+ strictFail(parser, "Unmatched closing tag: "+parser.tagName)
+ parser.textNode += "</" + parser.tagName + ">"
+ parser.state = S.TEXT
+ return
+ }
+ parser.tagName = tagName
+ var s = parser.tags.length
+ while (s --> t) {
+ var tag = parser.tag = parser.tags.pop()
+ parser.tagName = parser.tag.name
+ emitNode(parser, "onclosetag", parser.tagName)
+
+ var x = {}
+ for (var i in tag.ns) x[i] = tag.ns[i]
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (parser.opt.xmlns && tag.ns !== parent.ns) {
+ // remove namespace bindings introduced by tag
+ Object.keys(tag.ns).forEach(function (p) {
+ var n = tag.ns[p]
+ emitNode(parser, "onclosenamespace", { prefix: p, uri: n })
+ })
+ }
+ }
+ if (t === 0) parser.closedRoot = true
+ parser.tagName = parser.attribValue = parser.attribName = ""
+ parser.attribList.length = 0
+ parser.state = S.TEXT
+}
+
+function parseEntity (parser) {
+ var entity = parser.entity
+ , entityLC = entity.toLowerCase()
+ , num
+ , numStr = ""
+ if (parser.ENTITIES[entity])
+ return parser.ENTITIES[entity]
+ if (parser.ENTITIES[entityLC])
+ return parser.ENTITIES[entityLC]
+ entity = entityLC
+ if (entity.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2)
+ num = parseInt(entity, 16)
+ numStr = num.toString(16)
+ } else {
+ entity = entity.slice(1)
+ num = parseInt(entity, 10)
+ numStr = num.toString(10)
+ }
+ }
+ entity = entity.replace(/^0+/, "")
+ if (numStr.toLowerCase() !== entity) {
+ strictFail(parser, "Invalid character entity")
+ return "&"+parser.entity + ";"
+ }
+
+ return String.fromCodePoint(num)
+}
+
+function write (chunk) {
+ var parser = this
+ if (this.error) throw this.error
+ if (parser.closed) return error(parser,
+ "Cannot write after close. Assign an onready handler.")
+ if (chunk === null) return end(parser)
+ var i = 0, c = ""
+ while (parser.c = c = chunk.charAt(i++)) {
+ if (parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ switch (parser.state) {
+
+ case S.BEGIN:
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else if (not(whitespace,c)) {
+ // have to process this as a text node.
+ // weird, but happens.
+ strictFail(parser, "Non-whitespace before first tag.")
+ parser.textNode = c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.TEXT:
+ if (parser.sawRoot && !parser.closedRoot) {
+ var starti = i-1
+ while (c && c!=="<" && c!=="&") {
+ c = chunk.charAt(i++)
+ if (c && parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ }
+ parser.textNode += chunk.substring(starti, i-1)
+ }
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else {
+ if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
+ strictFail(parser, "Text data outside of root node.")
+ if (c === "&") parser.state = S.TEXT_ENTITY
+ else parser.textNode += c
+ }
+ continue
+
+ case S.SCRIPT:
+ // only non-strict
+ if (c === "<") {
+ parser.state = S.SCRIPT_ENDING
+ } else parser.script += c
+ continue
+
+ case S.SCRIPT_ENDING:
+ if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ } else {
+ parser.script += "<" + c
+ parser.state = S.SCRIPT
+ }
+ continue
+
+ case S.OPEN_WAKA:
+ // either a /, ?, !, or text is coming next.
+ if (c === "!") {
+ parser.state = S.SGML_DECL
+ parser.sgmlDecl = ""
+ } else if (is(whitespace, c)) {
+ // wait for it...
+ } else if (is(nameStart,c)) {
+ parser.state = S.OPEN_TAG
+ parser.tagName = c
+ } else if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ parser.tagName = ""
+ } else if (c === "?") {
+ parser.state = S.PROC_INST
+ parser.procInstName = parser.procInstBody = ""
+ } else {
+ strictFail(parser, "Unencoded <")
+ // if there was some whitespace, then add that in.
+ if (parser.startTagPosition + 1 < parser.position) {
+ var pad = parser.position - parser.startTagPosition
+ c = new Array(pad).join(" ") + c
+ }
+ parser.textNode += "<" + c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.SGML_DECL:
+ if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {
+ emitNode(parser, "onopencdata")
+ parser.state = S.CDATA
+ parser.sgmlDecl = ""
+ parser.cdata = ""
+ } else if (parser.sgmlDecl+c === "--") {
+ parser.state = S.COMMENT
+ parser.comment = ""
+ parser.sgmlDecl = ""
+ } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {
+ parser.state = S.DOCTYPE
+ if (parser.doctype || parser.sawRoot) strictFail(parser,
+ "Inappropriately located doctype declaration")
+ parser.doctype = ""
+ parser.sgmlDecl = ""
+ } else if (c === ">") {
+ emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
+ parser.sgmlDecl = ""
+ parser.state = S.TEXT
+ } else if (is(quote, c)) {
+ parser.state = S.SGML_DECL_QUOTED
+ parser.sgmlDecl += c
+ } else parser.sgmlDecl += c
+ continue
+
+ case S.SGML_DECL_QUOTED:
+ if (c === parser.q) {
+ parser.state = S.SGML_DECL
+ parser.q = ""
+ }
+ parser.sgmlDecl += c
+ continue
+
+ case S.DOCTYPE:
+ if (c === ">") {
+ parser.state = S.TEXT
+ emitNode(parser, "ondoctype", parser.doctype)
+ parser.doctype = true // just remember that we saw it.
+ } else {
+ parser.doctype += c
+ if (c === "[") parser.state = S.DOCTYPE_DTD
+ else if (is(quote, c)) {
+ parser.state = S.DOCTYPE_QUOTED
+ parser.q = c
+ }
+ }
+ continue
+
+ case S.DOCTYPE_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.q = ""
+ parser.state = S.DOCTYPE
+ }
+ continue
+
+ case S.DOCTYPE_DTD:
+ parser.doctype += c
+ if (c === "]") parser.state = S.DOCTYPE
+ else if (is(quote,c)) {
+ parser.state = S.DOCTYPE_DTD_QUOTED
+ parser.q = c
+ }
+ continue
+
+ case S.DOCTYPE_DTD_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.state = S.DOCTYPE_DTD
+ parser.q = ""
+ }
+ continue
+
+ case S.COMMENT:
+ if (c === "-") parser.state = S.COMMENT_ENDING
+ else parser.comment += c
+ continue
+
+ case S.COMMENT_ENDING:
+ if (c === "-") {
+ parser.state = S.COMMENT_ENDED
+ parser.comment = textopts(parser.opt, parser.comment)
+ if (parser.comment) emitNode(parser, "oncomment", parser.comment)
+ parser.comment = ""
+ } else {
+ parser.comment += "-" + c
+ parser.state = S.COMMENT
+ }
+ continue
+
+ case S.COMMENT_ENDED:
+ if (c !== ">") {
+ strictFail(parser, "Malformed comment")
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ parser.comment += "--" + c
+ parser.state = S.COMMENT
+ } else parser.state = S.TEXT
+ continue
+
+ case S.CDATA:
+ if (c === "]") parser.state = S.CDATA_ENDING
+ else parser.cdata += c
+ continue
+
+ case S.CDATA_ENDING:
+ if (c === "]") parser.state = S.CDATA_ENDING_2
+ else {
+ parser.cdata += "]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.CDATA_ENDING_2:
+ if (c === ">") {
+ if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
+ emitNode(parser, "onclosecdata")
+ parser.cdata = ""
+ parser.state = S.TEXT
+ } else if (c === "]") {
+ parser.cdata += "]"
+ } else {
+ parser.cdata += "]]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.PROC_INST:
+ if (c === "?") parser.state = S.PROC_INST_ENDING
+ else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
+ else parser.procInstName += c
+ continue
+
+ case S.PROC_INST_BODY:
+ if (!parser.procInstBody && is(whitespace, c)) continue
+ else if (c === "?") parser.state = S.PROC_INST_ENDING
+ else parser.procInstBody += c
+ continue
+
+ case S.PROC_INST_ENDING:
+ if (c === ">") {
+ emitNode(parser, "onprocessinginstruction", {
+ name : parser.procInstName,
+ body : parser.procInstBody
+ })
+ parser.procInstName = parser.procInstBody = ""
+ parser.state = S.TEXT
+ } else {
+ parser.procInstBody += "?" + c
+ parser.state = S.PROC_INST_BODY
+ }
+ continue
+
+ case S.OPEN_TAG:
+ if (is(nameBody, c)) parser.tagName += c
+ else {
+ newTag(parser)
+ if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else {
+ if (not(whitespace, c)) strictFail(
+ parser, "Invalid character in tag name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.OPEN_TAG_SLASH:
+ if (c === ">") {
+ openTag(parser, true)
+ closeTag(parser)
+ } else {
+ strictFail(parser, "Forward-slash in opening tag not followed by >")
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.ATTRIB:
+ // haven't read the attribute name yet.
+ if (is(whitespace, c)) continue
+ else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (c === ">") {
+ strictFail(parser, "Attribute without value")
+ parser.attribValue = parser.attribName
+ attrib(parser)
+ openTag(parser)
+ }
+ else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
+ else if (is(nameBody, c)) parser.attribName += c
+ else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME_SAW_WHITE:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (is(whitespace, c)) continue
+ else {
+ strictFail(parser, "Attribute without value")
+ parser.tag.attributes[parser.attribName] = ""
+ parser.attribValue = ""
+ emitNode(parser, "onattribute",
+ { name : parser.attribName, value : "" })
+ parser.attribName = ""
+ if (c === ">") openTag(parser)
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, "Invalid attribute name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.ATTRIB_VALUE:
+ if (is(whitespace, c)) continue
+ else if (is(quote, c)) {
+ parser.q = c
+ parser.state = S.ATTRIB_VALUE_QUOTED
+ } else {
+ strictFail(parser, "Unquoted attribute value")
+ parser.state = S.ATTRIB_VALUE_UNQUOTED
+ parser.attribValue = c
+ }
+ continue
+
+ case S.ATTRIB_VALUE_QUOTED:
+ if (c !== parser.q) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ parser.q = ""
+ parser.state = S.ATTRIB_VALUE_CLOSED
+ continue
+
+ case S.ATTRIB_VALUE_CLOSED:
+ if (is(whitespace, c)) {
+ parser.state = S.ATTRIB
+ } else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ strictFail(parser, "No whitespace between attributes")
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_VALUE_UNQUOTED:
+ if (not(attribEnd,c)) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ if (c === ">") openTag(parser)
+ else parser.state = S.ATTRIB
+ continue
+
+ case S.CLOSE_TAG:
+ if (!parser.tagName) {
+ if (is(whitespace, c)) continue
+ else if (not(nameStart, c)) {
+ if (parser.script) {
+ parser.script += "</" + c
+ parser.state = S.SCRIPT
+ } else {
+ strictFail(parser, "Invalid tagname in closing tag.")
+ }
+ } else parser.tagName = c
+ }
+ else if (c === ">") closeTag(parser)
+ else if (is(nameBody, c)) parser.tagName += c
+ else if (parser.script) {
+ parser.script += "</" + parser.tagName
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ } else {
+ if (not(whitespace, c)) strictFail(parser,
+ "Invalid tagname in closing tag")
+ parser.state = S.CLOSE_TAG_SAW_WHITE
+ }
+ continue
+
+ case S.CLOSE_TAG_SAW_WHITE:
+ if (is(whitespace, c)) continue
+ if (c === ">") closeTag(parser)
+ else strictFail(parser, "Invalid characters in closing tag")
+ continue
+
+ case S.TEXT_ENTITY:
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ case S.ATTRIB_VALUE_ENTITY_U:
+ switch(parser.state) {
+ case S.TEXT_ENTITY:
+ var returnState = S.TEXT, buffer = "textNode"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_U:
+ var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"
+ break
+ }
+ if (c === ";") {
+ parser[buffer] += parseEntity(parser)
+ parser.entity = ""
+ parser.state = returnState
+ }
+ else if (is(entity, c)) parser.entity += c
+ else {
+ strictFail(parser, "Invalid character entity")
+ parser[buffer] += "&" + parser.entity + c
+ parser.entity = ""
+ parser.state = returnState
+ }
+ continue
+
+ default:
+ throw new Error(parser, "Unknown state: " + parser.state)
+ }
+ } // while
+ // cdata blocks can get very big under normal conditions. emit and move on.
+ // if (parser.state === S.CDATA && parser.cdata) {
+ // emitNode(parser, "oncdata", parser.cdata)
+ // parser.cdata = ""
+ // }
+ if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
+ return parser
+}
+
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+if (!String.fromCodePoint) {
+ (function() {
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function() {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (Object.defineProperty) {
+ Object.defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
+
+})(typeof exports === "undefined" ? sax = {} : exports);
+
+}).call(this,undefined)
+
+},{"undefined":undefined}],21:[function(_dereq_,module,exports){
+/**
+ * Tiny stack for browser or server
+ *
+ * @author Jason Mulligan <jason.mulligan@avoidwork.com>
+ * @copyright 2014 Jason Mulligan
+ * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
+ * @link http://avoidwork.github.io/tiny-stack
+ * @module tiny-stack
+ * @version 0.1.0
+ */
+
+( function ( global ) {
+
+"use strict";
+
+/**
+ * TinyStack
+ *
+ * @constructor
+ */
+function TinyStack () {
+ this.data = [null];
+ this.top = 0;
+}
+
+/**
+ * Clears the stack
+ *
+ * @method clear
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.clear = function clear () {
+ this.data = [null];
+ this.top = 0;
+
+ return this;
+};
+
+/**
+ * Gets the size of the stack
+ *
+ * @method length
+ * @memberOf TinyStack
+ * @return {Number} Size of stack
+ */
+TinyStack.prototype.length = function length () {
+ return this.top;
+};
+
+/**
+ * Gets the item at the top of the stack
+ *
+ * @method peek
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.peek = function peek () {
+ return this.data[this.top];
+};
+
+/**
+ * Gets & removes the item at the top of the stack
+ *
+ * @method pop
+ * @memberOf TinyStack
+ * @return {Mixed} Item at the top of the stack
+ */
+TinyStack.prototype.pop = function pop () {
+ if ( this.top > 0 ) {
+ this.top--;
+
+ return this.data.pop();
+ }
+ else {
+ return undefined;
+ }
+};
+
+/**
+ * Pushes an item onto the stack
+ *
+ * @method push
+ * @memberOf TinyStack
+ * @return {Object} {@link TinyStack}
+ */
+TinyStack.prototype.push = function push ( arg ) {
+ this.data[++this.top] = arg;
+
+ return this;
+};
+
+/**
+ * TinyStack factory
+ *
+ * @method factory
+ * @return {Object} {@link TinyStack}
+ */
+function factory () {
+ return new TinyStack();
+}
+
+// Node, AMD & window supported
+if ( typeof exports != "undefined" ) {
+ module.exports = factory;
+}
+else if ( typeof define == "function" ) {
+ define( function () {
+ return factory;
+ } );
+}
+else {
+ global.stack = factory;
+}
+} )( this );
+
+},{}],22:[function(_dereq_,module,exports){
+module.exports = _dereq_(26);
+},{"26":26}],23:[function(_dereq_,module,exports){
+'use strict';
+
+function Base() { }
+
+Base.prototype.get = function(name) {
+ return this.$model.properties.get(this, name);
+};
+
+Base.prototype.set = function(name, value) {
+ this.$model.properties.set(this, name, value);
+};
+
+
+module.exports = Base;
+},{}],24:[function(_dereq_,module,exports){
+'use strict';
+
+var pick = _dereq_(173),
+ assign = _dereq_(168),
+ forEach = _dereq_(77);
+
+var parseNameNs = _dereq_(27).parseName;
+
+
+function DescriptorBuilder(nameNs) {
+ this.ns = nameNs;
+ this.name = nameNs.name;
+ this.allTypes = [];
+ this.properties = [];
+ this.propertiesByName = {};
+}
+
+module.exports = DescriptorBuilder;
+
+
+DescriptorBuilder.prototype.build = function() {
+ return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);
+};
+
+DescriptorBuilder.prototype.addProperty = function(p, idx) {
+ this.addNamedProperty(p, true);
+
+ var properties = this.properties;
+
+ if (idx !== undefined) {
+ properties.splice(idx, 0, p);
+ } else {
+ properties.push(p);
+ }
+};
+
+
+DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
+ var oldNameNs = oldProperty.ns;
+
+ var props = this.properties,
+ propertiesByName = this.propertiesByName,
+ rename = oldProperty.name !== newProperty.name;
+
+ if (oldProperty.isBody) {
+
+ if (!newProperty.isBody) {
+ throw new Error(
+ 'property <' + newProperty.ns.name + '> must be body property ' +
+ 'to refine <' + oldProperty.ns.name + '>');
+ }
+
+ // TODO: Check compatibility
+ this.setBodyProperty(newProperty, false);
+ }
+
+ // replacing the named property is intentional
+ // thus, validate only if this is a "rename" operation
+ this.addNamedProperty(newProperty, rename);
+
+ // replace old property at index with new one
+ var idx = props.indexOf(oldProperty);
+ if (idx === -1) {
+ throw new Error('property <' + oldNameNs.name + '> not found in property list');
+ }
+
+ props[idx] = newProperty;
+
+ // replace propertiesByName entry with new property
+ propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
+};
+
+
+DescriptorBuilder.prototype.redefineProperty = function(p) {
+
+ var nsPrefix = p.ns.prefix;
+ var parts = p.redefines.split('#');
+
+ var name = parseNameNs(parts[0], nsPrefix);
+ var attrName = parseNameNs(parts[1], name.prefix).name;
+
+ var redefinedProperty = this.propertiesByName[attrName];
+ if (!redefinedProperty) {
+ throw new Error('refined property <' + attrName + '> not found');
+ } else {
+ this.replaceProperty(redefinedProperty, p);
+ }
+
+ delete p.redefines;
+};
+
+DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ if (validate) {
+ this.assertNotDefined(p, ns.name);
+ this.assertNotDefined(p, ns.localName);
+ }
+
+ propsByName[ns.name] = propsByName[ns.localName] = p;
+};
+
+DescriptorBuilder.prototype.removeNamedProperty = function(p) {
+ var ns = p.ns,
+ propsByName = this.propertiesByName;
+
+ delete propsByName[ns.name];
+ delete propsByName[ns.localName];
+};
+
+DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
+
+ if (validate && this.bodyProperty) {
+ throw new Error(
+ 'body property defined multiple times ' +
+ '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
+ }
+
+ this.bodyProperty = p;
+};
+
+DescriptorBuilder.prototype.addIdProperty = function(name) {
+ var nameNs = parseNameNs(name, this.ns.prefix);
+
+ var p = {
+ name: nameNs.localName,
+ type: 'String',
+ isAttr: true,
+ ns: nameNs
+ };
+
+ // ensure that id is always the first attribute (if present)
+ this.addProperty(p, 0);
+};
+
+DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
+ var propertyName = p.name,
+ definedProperty = this.propertiesByName[propertyName];
+
+ if (definedProperty) {
+ throw new Error(
+ 'property <' + propertyName + '> already defined; ' +
+ 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
+ '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
+ }
+};
+
+DescriptorBuilder.prototype.hasProperty = function(name) {
+ return this.propertiesByName[name];
+};
+
+DescriptorBuilder.prototype.addTrait = function(t) {
+
+ var allTypes = this.allTypes;
+
+ if (allTypes.indexOf(t) !== -1) {
+ return;
+ }
+
+ forEach(t.properties, function(p) {
+
+ // clone property to allow extensions
+ p = assign({}, p, {
+ name: p.ns.localName
+ });
+
+ Object.defineProperty(p, 'definedBy', {
+ value: t
+ });
+
+ // add redefine support
+ if (p.redefines) {
+ this.redefineProperty(p);
+ } else {
+ if (p.isBody) {
+ this.setBodyProperty(p);
+ }
+ this.addProperty(p);
+ }
+ }, this);
+
+ allTypes.push(t);
+};
+
+},{"168":168,"173":173,"27":27,"77":77}],25:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(77);
+
+var Base = _dereq_(23);
+
+
+function Factory(model, properties) {
+ this.model = model;
+ this.properties = properties;
+}
+
+module.exports = Factory;
+
+
+Factory.prototype.createType = function(descriptor) {
+
+ var model = this.model;
+
+ var props = this.properties,
+ prototype = Object.create(Base.prototype);
+
+ // initialize default values
+ forEach(descriptor.properties, function(p) {
+ if (!p.isMany && p.default !== undefined) {
+ prototype[p.name] = p.default;
+ }
+ });
+
+ props.defineModel(prototype, model);
+ props.defineDescriptor(prototype, descriptor);
+
+ var name = descriptor.ns.name;
+
+ /**
+ * The new type constructor
+ */
+ function ModdleElement(attrs) {
+ props.define(this, '$type', { value: name, enumerable: true });
+ props.define(this, '$attrs', { value: {} });
+ props.define(this, '$parent', { writable: true });
+
+ forEach(attrs, function(val, key) {
+ this.set(key, val);
+ }, this);
+ }
+
+ ModdleElement.prototype = prototype;
+
+ ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
+
+ // static links
+ props.defineModel(ModdleElement, model);
+ props.defineDescriptor(ModdleElement, descriptor);
+
+ return ModdleElement;
+};
+},{"23":23,"77":77}],26:[function(_dereq_,module,exports){
+'use strict';
+
+var isString = _dereq_(165),
+ isObject = _dereq_(163),
+ forEach = _dereq_(77),
+ find = _dereq_(76);
+
+
+var Factory = _dereq_(25),
+ Registry = _dereq_(29),
+ Properties = _dereq_(28);
+
+var parseNameNs = _dereq_(27).parseName;
+
+
+//// Moddle implementation /////////////////////////////////////////////////
+
+/**
+ * @class Moddle
+ *
+ * A model that can be used to create elements of a specific type.
+ *
+ * @example
+ *
+ * var Moddle = require('moddle');
+ *
+ * var pkg = {
+ * name: 'mypackage',
+ * prefix: 'my',
+ * types: [
+ * { name: 'Root' }
+ * ]
+ * };
+ *
+ * var moddle = new Moddle([pkg]);
+ *
+ * @param {Array<Package>} packages the packages to contain
+ * @param {Object} options additional options to pass to the model
+ */
+function Moddle(packages, options) {
+
+ options = options || {};
+
+ this.properties = new Properties(this);
+
+ this.factory = new Factory(this, this.properties);
+ this.registry = new Registry(packages, this.properties, options);
+
+ this.typeCache = {};
+}
+
+module.exports = Moddle;
+
+
+/**
+ * Create an instance of the specified type.
+ *
+ * @method Moddle#create
+ *
+ * @example
+ *
+ * var foo = moddle.create('my:Foo');
+ * var bar = moddle.create('my:Bar', { id: 'BAR_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @param {Object} attrs a number of attributes to initialize the model instance with
+ * @return {Object} model instance
+ */
+Moddle.prototype.create = function(descriptor, attrs) {
+ var Type = this.getType(descriptor);
+
+ if (!Type) {
+ throw new Error('unknown type <' + descriptor + '>');
+ }
+
+ return new Type(attrs);
+};
+
+
+/**
+ * Returns the type representing a given descriptor
+ *
+ * @method Moddle#getType
+ *
+ * @example
+ *
+ * var Foo = moddle.getType('my:Foo');
+ * var foo = new Foo({ 'id' : 'FOO_1' });
+ *
+ * @param {String|Object} descriptor the type descriptor or name know to the model
+ * @return {Object} the type representing the descriptor
+ */
+Moddle.prototype.getType = function(descriptor) {
+
+ var cache = this.typeCache;
+
+ var name = isString(descriptor) ? descriptor : descriptor.ns.name;
+
+ var type = cache[name];
+
+ if (!type) {
+ descriptor = this.registry.getEffectiveDescriptor(name);
+ type = cache[name] = this.factory.createType(descriptor);
+ }
+
+ return type;
+};
+
+
+/**
+ * Creates an any-element type to be used within model instances.
+ *
+ * This can be used to create custom elements that lie outside the meta-model.
+ * The created element contains all the meta-data required to serialize it
+ * as part of meta-model elements.
+ *
+ * @method Moddle#createAny
+ *
+ * @example
+ *
+ * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {
+ * value: 'bar'
+ * });
+ *
+ * var container = moddle.create('my:Container', 'http://my', {
+ * any: [ foo ]
+ * });
+ *
+ * // go ahead and serialize the stuff
+ *
+ *
+ * @param {String} name the name of the element
+ * @param {String} nsUri the namespace uri of the element
+ * @param {Object} [properties] a map of properties to initialize the instance with
+ * @return {Object} the any type instance
+ */
+Moddle.prototype.createAny = function(name, nsUri, properties) {
+
+ var nameNs = parseNameNs(name);
+
+ var element = {
+ $type: name
+ };
+
+ var descriptor = {
+ name: name,
+ isGeneric: true,
+ ns: {
+ prefix: nameNs.prefix,
+ localName: nameNs.localName,
+ uri: nsUri
+ }
+ };
+
+ this.properties.defineDescriptor(element, descriptor);
+ this.properties.defineModel(element, this);
+ this.properties.define(element, '$parent', { enumerable: false, writable: true });
+
+ forEach(properties, function(a, key) {
+ if (isObject(a) && a.value !== undefined) {
+ element[a.name] = a.value;
+ } else {
+ element[key] = a;
+ }
+ });
+
+ return element;
+};
+
+/**
+ * Returns a registered package by uri or prefix
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackage = function(uriOrPrefix) {
+ return this.registry.getPackage(uriOrPrefix);
+};
+
+/**
+ * Returns a snapshot of all known packages
+ *
+ * @return {Object} the package
+ */
+Moddle.prototype.getPackages = function() {
+ return this.registry.getPackages();
+};
+
+/**
+ * Returns the descriptor for an element
+ */
+Moddle.prototype.getElementDescriptor = function(element) {
+ return element.$descriptor;
+};
+
+/**
+ * Returns true if the given descriptor or instance
+ * represents the given type.
+ *
+ * May be applied to this, if element is omitted.
+ */
+Moddle.prototype.hasType = function(element, type) {
+ if (type === undefined) {
+ type = element;
+ element = this;
+ }
+
+ var descriptor = element.$model.getElementDescriptor(element);
+
+ return !!find(descriptor.allTypes, function(t) {
+ return t.name === type;
+ });
+};
+
+
+/**
+ * Returns the descriptor of an elements named property
+ */
+Moddle.prototype.getPropertyDescriptor = function(element, property) {
+ return this.getElementDescriptor(element).propertiesByName[property];
+};
+
+},{"163":163,"165":165,"25":25,"27":27,"28":28,"29":29,"76":76,"77":77}],27:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Parses a namespaced attribute name of the form (ns:)localName to an object,
+ * given a default prefix to assume in case no explicit namespace is given.
+ *
+ * @param {String} name
+ * @param {String} [defaultPrefix] the default prefix to take, if none is present.
+ *
+ * @return {Object} the parsed name
+ */
+module.exports.parseName = function(name, defaultPrefix) {
+ var parts = name.split(/:/),
+ localName, prefix;
+
+ // no prefix (i.e. only local name)
+ if (parts.length === 1) {
+ localName = name;
+ prefix = defaultPrefix;
+ } else
+ // prefix + local name
+ if (parts.length === 2) {
+ localName = parts[1];
+ prefix = parts[0];
+ } else {
+ throw new Error('expected <prefix:localName> or <localName>, got ' + name);
+ }
+
+ name = (prefix ? prefix + ':' : '') + localName;
+
+ return {
+ name: name,
+ prefix: prefix,
+ localName: localName
+ };
+};
+},{}],28:[function(_dereq_,module,exports){
+'use strict';
+
+
+/**
+ * A utility that gets and sets properties of model elements.
+ *
+ * @param {Model} model
+ */
+function Properties(model) {
+ this.model = model;
+}
+
+module.exports = Properties;
+
+
+/**
+ * Sets a named property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} value
+ */
+Properties.prototype.set = function(target, name, value) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ target.$attrs[name] = value;
+ } else {
+ Object.defineProperty(target, property.name, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: value
+ });
+ }
+};
+
+/**
+ * Returns the named property of the given element
+ *
+ * @param {Object} target
+ * @param {String} name
+ *
+ * @return {Object}
+ */
+Properties.prototype.get = function(target, name) {
+
+ var property = this.model.getPropertyDescriptor(target, name);
+
+ if (!property) {
+ return target.$attrs[name];
+ }
+
+ var propertyName = property.name;
+
+ // check if access to collection property and lazily initialize it
+ if (!target[propertyName] && property.isMany) {
+ Object.defineProperty(target, propertyName, {
+ enumerable: !property.isReference,
+ writable: true,
+ value: []
+ });
+ }
+
+ return target[propertyName];
+};
+
+
+/**
+ * Define a property on the target element
+ *
+ * @param {Object} target
+ * @param {String} name
+ * @param {Object} options
+ */
+Properties.prototype.define = function(target, name, options) {
+ Object.defineProperty(target, name, options);
+};
+
+
+/**
+ * Define the descriptor for an element
+ */
+Properties.prototype.defineDescriptor = function(target, descriptor) {
+ this.define(target, '$descriptor', { value: descriptor });
+};
+
+/**
+ * Define the model for an element
+ */
+Properties.prototype.defineModel = function(target, model) {
+ this.define(target, '$model', { value: model });
+};
+},{}],29:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168),
+ forEach = _dereq_(77);
+
+var Types = _dereq_(30),
+ DescriptorBuilder = _dereq_(24);
+
+var parseNameNs = _dereq_(27).parseName,
+ isBuiltInType = Types.isBuiltIn;
+
+
+function Registry(packages, properties, options) {
+ this.options = assign({ generateId: 'id' }, options || {});
+
+ this.packageMap = {};
+ this.typeMap = {};
+
+ this.packages = [];
+
+ this.properties = properties;
+
+ forEach(packages, this.registerPackage, this);
+}
+
+module.exports = Registry;
+
+
+Registry.prototype.getPackage = function(uriOrPrefix) {
+ return this.packageMap[uriOrPrefix];
+};
+
+Registry.prototype.getPackages = function() {
+ return this.packages;
+};
+
+
+Registry.prototype.registerPackage = function(pkg) {
+
+ // copy package
+ pkg = assign({}, pkg);
+
+ // register types
+ forEach(pkg.types, function(descriptor) {
+ this.registerType(descriptor, pkg);
+ }, this);
+
+ this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
+ this.packages.push(pkg);
+};
+
+
+/**
+ * Register a type from a specific package with us
+ */
+Registry.prototype.registerType = function(type, pkg) {
+
+ type = assign({}, type, {
+ superClass: (type.superClass || []).slice(),
+ extends: (type.extends || []).slice(),
+ properties: (type.properties || []).slice()
+ });
+
+ var ns = parseNameNs(type.name, pkg.prefix),
+ name = ns.name,
+ propertiesByName = {};
+
+ // parse properties
+ forEach(type.properties, function(p) {
+
+ // namespace property names
+ var propertyNs = parseNameNs(p.name, ns.prefix),
+ propertyName = propertyNs.name;
+
+ // namespace property types
+ if (!isBuiltInType(p.type)) {
+ p.type = parseNameNs(p.type, propertyNs.prefix).name;
+ }
+
+ assign(p, {
+ ns: propertyNs,
+ name: propertyName
+ });
+
+ propertiesByName[propertyName] = p;
+ });
+
+ // update ns + name
+ assign(type, {
+ ns: ns,
+ name: name,
+ propertiesByName: propertiesByName
+ });
+
+ forEach(type.extends, function(extendsName) {
+ var extended = this.typeMap[extendsName];
+
+ extended.traits = extended.traits || [];
+ extended.traits.push(name);
+ }, this);
+
+ // link to package
+ this.definePackage(type, pkg);
+
+ // register
+ this.typeMap[name] = type;
+};
+
+
+/**
+ * Traverse the type hierarchy from bottom to top.
+ */
+Registry.prototype.mapTypes = function(nsName, iterator) {
+
+ var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];
+
+ var self = this;
+
+ /**
+ * Traverse the selected super type or trait
+ *
+ * @param {String} cls
+ */
+ function traverseSuper(cls) {
+ var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
+ self.mapTypes(parentNs, iterator);
+ }
+
+ if (!type) {
+ throw new Error('unknown type <' + nsName.name + '>');
+ }
+
+ forEach(type.superClass, traverseSuper);
+
+ iterator(type);
+
+ forEach(type.traits, traverseSuper);
+};
+
+
+/**
+ * Returns the effective descriptor for a type.
+ *
+ * @param {String} type the namespaced name (ns:localName) of the type
+ *
+ * @return {Descriptor} the resulting effective descriptor
+ */
+Registry.prototype.getEffectiveDescriptor = function(name) {
+
+ var nsName = parseNameNs(name);
+
+ var builder = new DescriptorBuilder(nsName);
+
+ this.mapTypes(nsName, function(type) {
+ builder.addTrait(type);
+ });
+
+ // check we have an id assigned
+ var id = this.options.generateId;
+ if (id && !builder.hasProperty(id)) {
+ builder.addIdProperty(id);
+ }
+
+ var descriptor = builder.build();
+
+ // define package link
+ this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
+
+ return descriptor;
+};
+
+
+Registry.prototype.definePackage = function(target, pkg) {
+ this.properties.define(target, '$pkg', { value: pkg });
+};
+},{"168":168,"24":24,"27":27,"30":30,"77":77}],30:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Built-in moddle types
+ */
+var BUILTINS = {
+ String: true,
+ Boolean: true,
+ Integer: true,
+ Real: true,
+ Element: true
+};
+
+/**
+ * Converters for built in types from string representations
+ */
+var TYPE_CONVERTERS = {
+ String: function(s) { return s; },
+ Boolean: function(s) { return s === 'true'; },
+ Integer: function(s) { return parseInt(s, 10); },
+ Real: function(s) { return parseFloat(s, 10); }
+};
+
+/**
+ * Convert a type to its real representation
+ */
+module.exports.coerceType = function(type, value) {
+
+ var converter = TYPE_CONVERTERS[type];
+
+ if (converter) {
+ return converter(value);
+ } else {
+ return value;
+ }
+};
+
+/**
+ * Return whether the given type is built-in
+ */
+module.exports.isBuiltIn = function(type) {
+ return !!BUILTINS[type];
+};
+
+/**
+ * Return whether the given type is simple
+ */
+module.exports.isSimple = function(type) {
+ return !!TYPE_CONVERTERS[type];
+};
+},{}],31:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMN20",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
+ "associations": [],
+ "types": [
+ {
+ "name": "Interface",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operations",
+ "type": "Operation",
+ "isMany": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Operation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outMessageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "errorRefs",
+ "type": "Error",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "implementationRef",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EndPoint",
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "Auditing",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "GlobalTask",
+ "superClass": [
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Monitoring",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Performer",
+ "superClass": [
+ "ResourceRole"
+ ]
+ },
+ {
+ "name": "Process",
+ "superClass": [
+ "FlowElementsContainer",
+ "CallableElement"
+ ],
+ "properties": [
+ {
+ "name": "processType",
+ "type": "ProcessType",
+ "isAttr": true
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "supports",
+ "type": "Process",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "definitionalCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "isExecutable",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "correlationSubscriptions",
+ "type": "CorrelationSubscription",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LaneSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Lane",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "childLaneSet",
+ "type": "LaneSet",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "partitionElementRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "flowNodeRef",
+ "type": "FlowNode",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "partitionElement",
+ "type": "BaseElement"
+ }
+ ]
+ },
+ {
+ "name": "GlobalManualTask",
+ "superClass": [
+ "GlobalTask"
+ ]
+ },
+ {
+ "name": "ManualTask",
+ "superClass": [
+ "Task"
+ ]
+ },
+ {
+ "name": "UserTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ },
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Rendering",
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "HumanPerformer",
+ "superClass": [
+ "Performer"
+ ]
+ },
+ {
+ "name": "PotentialOwner",
+ "superClass": [
+ "HumanPerformer"
+ ]
+ },
+ {
+ "name": "GlobalUserTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "renderings",
+ "type": "Rendering",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Gateway",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "gatewayDirection",
+ "type": "GatewayDirection",
+ "default": "Unspecified",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "eventGatewayType",
+ "type": "EventBasedGatewayType",
+ "isAttr": true,
+ "default": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "ComplexGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "activationCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InclusiveGateway",
+ "superClass": [
+ "Gateway"
+ ],
+ "properties": [
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParallelGateway",
+ "superClass": [
+ "Gateway"
+ ]
+ },
+ {
+ "name": "RootElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "Relationship",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "direction",
+ "type": "RelationshipDirection",
+ "isAttr": true
+ },
+ {
+ "name": "source",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "target",
+ "isMany": true,
+ "isReference": true,
+ "type": "Element"
+ }
+ ]
+ },
+ {
+ "name": "BaseElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "id",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "type": "Documentation",
+ "isMany": true
+ },
+ {
+ "name": "extensionDefinitions",
+ "type": "ExtensionDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "extensionElements",
+ "type": "ExtensionElements"
+ }
+ ]
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "mustUnderstand",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "definition",
+ "type": "ExtensionDefinition"
+ }
+ ]
+ },
+ {
+ "name": "ExtensionDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "extensionAttributeDefinitions",
+ "type": "ExtensionAttributeDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionAttributeDefinition",
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isReference",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "extensionDefinition",
+ "type": "ExtensionDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ExtensionElements",
+ "properties": [
+ {
+ "name": "valueRef",
+ "isAttr": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ },
+ {
+ "name": "extensionAttributeDefinition",
+ "type": "ExtensionAttributeDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Documentation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Event",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "IntermediateCatchEvent",
+ "superClass": [
+ "CatchEvent"
+ ]
+ },
+ {
+ "name": "IntermediateThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "EndEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "StartEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "isInterrupting",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "ThrowEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "inputSet",
+ "type": "InputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociation",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CatchEvent",
+ "isAbstract": true,
+ "superClass": [
+ "Event"
+ ],
+ "properties": [
+ {
+ "name": "parallelMultiple",
+ "isAttr": true,
+ "type": "Boolean",
+ "default": false
+ },
+ {
+ "name": "outputSet",
+ "type": "OutputSet"
+ },
+ {
+ "name": "eventDefinitionRefs",
+ "type": "EventDefinition",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataOutputAssociation",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ },
+ {
+ "name": "eventDefinitions",
+ "type": "EventDefinition",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "BoundaryEvent",
+ "superClass": [
+ "CatchEvent"
+ ],
+ "properties": [
+ {
+ "name": "cancelActivity",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "attachedToRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "EventDefinition",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CancelEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "ErrorEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "errorRef",
+ "type": "Error",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TerminateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ]
+ },
+ {
+ "name": "EscalationEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "escalationRef",
+ "type": "Escalation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Escalation",
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "escalationCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ],
+ "superClass": [
+ "RootElement"
+ ]
+ },
+ {
+ "name": "CompensateEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "waitForCompletion",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "activityRef",
+ "type": "Activity",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TimerEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "timeDate",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeCycle",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "timeDuration",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "LinkEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "target",
+ "type": "LinkEventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "source",
+ "type": "LinkEventDefinition",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConditionalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "SignalEventDefinition",
+ "superClass": [
+ "EventDefinition"
+ ],
+ "properties": [
+ {
+ "name": "signalRef",
+ "type": "Signal",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Signal",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ImplicitThrowEvent",
+ "superClass": [
+ "ThrowEvent"
+ ]
+ },
+ {
+ "name": "DataState",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ItemAwareElement",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "itemSubjectRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "dataState",
+ "type": "DataState"
+ }
+ ]
+ },
+ {
+ "name": "DataAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "transformation",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "assignment",
+ "type": "Assignment",
+ "isMany": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "ItemAwareElement",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "ItemAwareElement",
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataInput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithOptional",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "inputSetWithWhileExecuting",
+ "type": "InputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataOutput",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithOptional",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetWithWhileExecuting",
+ "type": "OutputSet",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "dataInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingInputRefs",
+ "type": "DataInput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outputSetRefs",
+ "type": "OutputSet",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "OutputSet",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "inputSetRefs",
+ "type": "InputSet",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "optionalOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "whileExecutingOutputRefs",
+ "type": "DataOutput",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Property",
+ "superClass": [
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "DataInputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "DataOutputAssociation",
+ "superClass": [
+ "DataAssociation"
+ ]
+ },
+ {
+ "name": "InputOutputSpecification",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "inputSets",
+ "type": "InputSet",
+ "isMany": true
+ },
+ {
+ "name": "outputSets",
+ "type": "OutputSet",
+ "isMany": true
+ },
+ {
+ "name": "dataInputs",
+ "type": "DataInput",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputs",
+ "type": "DataOutput",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "DataObject",
+ "superClass": [
+ "FlowElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "InputOutputBinding",
+ "properties": [
+ {
+ "name": "inputDataRef",
+ "type": "InputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outputDataRef",
+ "type": "OutputSet",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Assignment",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "from",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "to",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "DataStore",
+ "superClass": [
+ "RootElement",
+ "ItemAwareElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "capacity",
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "isUnlimited",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "DataStoreReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataStoreRef",
+ "type": "DataStore",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "DataObjectReference",
+ "superClass": [
+ "ItemAwareElement",
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "dataObjectRef",
+ "type": "DataObject",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationLink",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ConversationAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerConversationNodeRef",
+ "type": "ConversationNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CallConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "calledCollaborationRef",
+ "type": "Collaboration",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Conversation",
+ "superClass": [
+ "ConversationNode"
+ ]
+ },
+ {
+ "name": "SubConversation",
+ "superClass": [
+ "ConversationNode"
+ ],
+ "properties": [
+ {
+ "name": "conversationNodes",
+ "type": "ConversationNode",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ConversationNode",
+ "isAbstract": true,
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "messageFlowRefs",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "GlobalConversation",
+ "superClass": [
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "PartnerEntity",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "PartnerRole",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "participantRef",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationProperty",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRetrievalExpression",
+ "type": "CorrelationPropertyRetrievalExpression",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Error",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "structureRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "errorCode",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "CorrelationKey",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Expression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "isAbstract": true
+ },
+ {
+ "name": "FormalExpression",
+ "superClass": [
+ "Expression"
+ ],
+ "properties": [
+ {
+ "name": "language",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "body",
+ "type": "String",
+ "isBody": true
+ },
+ {
+ "name": "evaluatesToTypeRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Message",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "itemRef",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ItemDefinition",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "itemKind",
+ "type": "ItemKind",
+ "isAttr": true
+ },
+ {
+ "name": "structureRef",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "isCollection",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "import",
+ "type": "Import",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElement",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "auditing",
+ "type": "Auditing"
+ },
+ {
+ "name": "monitoring",
+ "type": "Monitoring"
+ },
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SequenceFlow",
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "isImmediate",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "conditionExpression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "sourceRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "FlowNode",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "FlowElementsContainer",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "laneSets",
+ "type": "LaneSet",
+ "isMany": true
+ },
+ {
+ "name": "flowElements",
+ "type": "FlowElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "CallableElement",
+ "isAbstract": true,
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "supportedInterfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "ioBinding",
+ "type": "InputOutputBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "FlowNode",
+ "isAbstract": true,
+ "superClass": [
+ "FlowElement"
+ ],
+ "properties": [
+ {
+ "name": "incoming",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoing",
+ "type": "SequenceFlow",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "lanes",
+ "type": "Lane",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyRetrievalExpression",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "messagePath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationPropertyBinding",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "dataPath",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "correlationPropertyRef",
+ "type": "CorrelationProperty",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Resource",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resourceParameters",
+ "type": "ResourceParameter",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameter",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isRequired",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "type",
+ "type": "ItemDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "CorrelationSubscription",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "correlationKeyRef",
+ "type": "CorrelationKey",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationPropertyBinding",
+ "type": "CorrelationPropertyBinding",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlow",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "sourceRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "InteractionNode",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "MessageFlowAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerMessageFlowRef",
+ "type": "MessageFlow",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "InteractionNode",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "incomingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "outgoingConversationLinks",
+ "type": "ConversationLink",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Participant",
+ "superClass": [
+ "InteractionNode",
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "interfaceRefs",
+ "type": "Interface",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "participantMultiplicity",
+ "type": "ParticipantMultiplicity"
+ },
+ {
+ "name": "endPointRefs",
+ "type": "EndPoint",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "processRef",
+ "type": "Process",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantAssociation",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "innerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "outerParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ParticipantMultiplicity",
+ "properties": [
+ {
+ "name": "minimum",
+ "default": 0,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "maximum",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "Collaboration",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "isClosed",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "choreographyRef",
+ "type": "Choreography",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ },
+ {
+ "name": "messageFlowAssociations",
+ "type": "MessageFlowAssociation",
+ "isMany": true
+ },
+ {
+ "name": "conversationAssociations",
+ "type": "ConversationAssociation"
+ },
+ {
+ "name": "participants",
+ "type": "Participant",
+ "isMany": true
+ },
+ {
+ "name": "messageFlows",
+ "type": "MessageFlow",
+ "isMany": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "conversations",
+ "type": "ConversationNode",
+ "isMany": true
+ },
+ {
+ "name": "conversationLinks",
+ "type": "ConversationLink",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyActivity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "participantRefs",
+ "type": "Participant",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "correlationKeys",
+ "type": "CorrelationKey",
+ "isMany": true
+ },
+ {
+ "name": "loopType",
+ "type": "ChoreographyLoopType",
+ "default": "None",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "CallChoreography",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "calledChoreographyRef",
+ "type": "Choreography",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "participantAssociations",
+ "type": "ParticipantAssociation",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "SubChoreography",
+ "superClass": [
+ "ChoreographyActivity",
+ "FlowElementsContainer"
+ ],
+ "properties": [
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyTask",
+ "superClass": [
+ "ChoreographyActivity"
+ ],
+ "properties": [
+ {
+ "name": "messageFlowRef",
+ "type": "MessageFlow",
+ "isMany": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Choreography",
+ "superClass": [
+ "FlowElementsContainer",
+ "Collaboration"
+ ]
+ },
+ {
+ "name": "GlobalChoreographyTask",
+ "superClass": [
+ "Choreography"
+ ],
+ "properties": [
+ {
+ "name": "initiatingParticipantRef",
+ "type": "Participant",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "TextAnnotation",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "text",
+ "type": "String"
+ },
+ {
+ "name": "textFormat",
+ "default": "text/plain",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Group",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "categoryValueRef",
+ "type": "CategoryValue",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Association",
+ "superClass": [
+ "Artifact"
+ ],
+ "properties": [
+ {
+ "name": "associationDirection",
+ "type": "AssociationDirection",
+ "isAttr": true
+ },
+ {
+ "name": "sourceRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "targetRef",
+ "type": "BaseElement",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "Category",
+ "superClass": [
+ "RootElement"
+ ],
+ "properties": [
+ {
+ "name": "categoryValue",
+ "type": "CategoryValue",
+ "isMany": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Artifact",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "CategoryValue",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "categorizedFlowElements",
+ "type": "FlowElement",
+ "isVirtual": true,
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "value",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Activity",
+ "isAbstract": true,
+ "superClass": [
+ "FlowNode"
+ ],
+ "properties": [
+ {
+ "name": "isForCompensation",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCharacteristics",
+ "type": "LoopCharacteristics"
+ },
+ {
+ "name": "resources",
+ "type": "ResourceRole",
+ "isMany": true
+ },
+ {
+ "name": "default",
+ "type": "SequenceFlow",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "properties",
+ "type": "Property",
+ "isMany": true
+ },
+ {
+ "name": "ioSpecification",
+ "type": "InputOutputSpecification"
+ },
+ {
+ "name": "boundaryEventRefs",
+ "type": "BoundaryEvent",
+ "isMany": true,
+ "isReference": true
+ },
+ {
+ "name": "dataInputAssociations",
+ "type": "DataInputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "dataOutputAssociations",
+ "type": "DataOutputAssociation",
+ "isMany": true
+ },
+ {
+ "name": "startQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ },
+ {
+ "name": "completionQuantity",
+ "default": 1,
+ "isAttr": true,
+ "type": "Integer"
+ }
+ ]
+ },
+ {
+ "name": "ServiceTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "SubProcess",
+ "superClass": [
+ "Activity",
+ "FlowElementsContainer",
+ "InteractionNode"
+ ],
+ "properties": [
+ {
+ "name": "triggeredByEvent",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "artifacts",
+ "type": "Artifact",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LoopCharacteristics",
+ "isAbstract": true,
+ "superClass": [
+ "BaseElement"
+ ]
+ },
+ {
+ "name": "MultiInstanceLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "isSequential",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "behavior",
+ "type": "MultiInstanceBehavior",
+ "default": "All",
+ "isAttr": true
+ },
+ {
+ "name": "loopCardinality",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopDataInputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "loopDataOutputRef",
+ "type": "ItemAwareElement",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "inputDataItem",
+ "type": "DataInput"
+ },
+ {
+ "name": "outputDataItem",
+ "type": "DataOutput"
+ },
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "complexBehaviorDefinition",
+ "type": "ComplexBehaviorDefinition",
+ "isMany": true
+ },
+ {
+ "name": "oneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "noneBehaviorEventRef",
+ "type": "EventDefinition",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "StandardLoopCharacteristics",
+ "superClass": [
+ "LoopCharacteristics"
+ ],
+ "properties": [
+ {
+ "name": "testBefore",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "loopCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "loopMaximum",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "CallActivity",
+ "superClass": [
+ "Activity"
+ ],
+ "properties": [
+ {
+ "name": "calledElement",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Task",
+ "superClass": [
+ "Activity",
+ "InteractionNode"
+ ]
+ },
+ {
+ "name": "SendTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ReceiveTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "instantiate",
+ "default": false,
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "operationRef",
+ "type": "Operation",
+ "isAttr": true,
+ "isReference": true
+ },
+ {
+ "name": "messageRef",
+ "type": "Message",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ScriptTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "scriptFormat",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "BusinessRuleTask",
+ "superClass": [
+ "Task"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "AdHocSubProcess",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "completionCondition",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "ordering",
+ "type": "AdHocOrdering",
+ "isAttr": true
+ },
+ {
+ "name": "cancelRemainingInstances",
+ "default": true,
+ "isAttr": true,
+ "type": "Boolean"
+ }
+ ]
+ },
+ {
+ "name": "Transaction",
+ "superClass": [
+ "SubProcess"
+ ],
+ "properties": [
+ {
+ "name": "protocol",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "method",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalScriptTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "scriptLanguage",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "script",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "GlobalBusinessRuleTask",
+ "superClass": [
+ "GlobalTask"
+ ],
+ "properties": [
+ {
+ "name": "implementation",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ComplexBehaviorDefinition",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "condition",
+ "type": "FormalExpression"
+ },
+ {
+ "name": "event",
+ "type": "ImplicitThrowEvent"
+ }
+ ]
+ },
+ {
+ "name": "ResourceRole",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "resourceRef",
+ "type": "Resource",
+ "isReference": true
+ },
+ {
+ "name": "resourceParameterBindings",
+ "type": "ResourceParameterBinding",
+ "isMany": true
+ },
+ {
+ "name": "resourceAssignmentExpression",
+ "type": "ResourceAssignmentExpression"
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "ResourceParameterBinding",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ },
+ {
+ "name": "parameterRef",
+ "type": "ResourceParameter",
+ "isAttr": true,
+ "isReference": true
+ }
+ ]
+ },
+ {
+ "name": "ResourceAssignmentExpression",
+ "properties": [
+ {
+ "name": "expression",
+ "type": "Expression",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Import",
+ "properties": [
+ {
+ "name": "importType",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "location",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "namespace",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ },
+ {
+ "name": "Definitions",
+ "superClass": [
+ "BaseElement"
+ ],
+ "properties": [
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "targetNamespace",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "expressionLanguage",
+ "default": "http://www.w3.org/1999/XPath",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "typeLanguage",
+ "default": "http://www.w3.org/2001/XMLSchema",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "imports",
+ "type": "Import",
+ "isMany": true
+ },
+ {
+ "name": "extensions",
+ "type": "Extension",
+ "isMany": true
+ },
+ {
+ "name": "rootElements",
+ "type": "RootElement",
+ "isMany": true
+ },
+ {
+ "name": "diagrams",
+ "isMany": true,
+ "type": "bpmndi:BPMNDiagram"
+ },
+ {
+ "name": "exporter",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "relationships",
+ "type": "Relationship",
+ "isMany": true
+ },
+ {
+ "name": "exporterVersion",
+ "isAttr": true,
+ "type": "String"
+ }
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ProcessType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Public"
+ },
+ {
+ "name": "Private"
+ }
+ ]
+ },
+ {
+ "name": "GatewayDirection",
+ "literalValues": [
+ {
+ "name": "Unspecified"
+ },
+ {
+ "name": "Converging"
+ },
+ {
+ "name": "Diverging"
+ },
+ {
+ "name": "Mixed"
+ }
+ ]
+ },
+ {
+ "name": "EventBasedGatewayType",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Exclusive"
+ }
+ ]
+ },
+ {
+ "name": "RelationshipDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Forward"
+ },
+ {
+ "name": "Backward"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "ItemKind",
+ "literalValues": [
+ {
+ "name": "Physical"
+ },
+ {
+ "name": "Information"
+ }
+ ]
+ },
+ {
+ "name": "ChoreographyLoopType",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "Standard"
+ },
+ {
+ "name": "MultiInstanceSequential"
+ },
+ {
+ "name": "MultiInstanceParallel"
+ }
+ ]
+ },
+ {
+ "name": "AssociationDirection",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "Both"
+ }
+ ]
+ },
+ {
+ "name": "MultiInstanceBehavior",
+ "literalValues": [
+ {
+ "name": "None"
+ },
+ {
+ "name": "One"
+ },
+ {
+ "name": "All"
+ },
+ {
+ "name": "Complex"
+ }
+ ]
+ },
+ {
+ "name": "AdHocOrdering",
+ "literalValues": [
+ {
+ "name": "Parallel"
+ },
+ {
+ "name": "Sequential"
+ }
+ ]
+ }
+ ],
+ "prefix": "bpmn",
+ "xml": {
+ "tagAlias": "lowerCase",
+ "typePrefix": "t"
+ }
+}
+},{}],32:[function(_dereq_,module,exports){
+module.exports={
+ "name": "BPMNDI",
+ "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
+ "types": [
+ {
+ "name": "BPMNDiagram",
+ "properties": [
+ {
+ "name": "plane",
+ "type": "BPMNPlane",
+ "redefines": "di:Diagram#rootElement"
+ },
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isMany": true
+ }
+ ],
+ "superClass": [
+ "di:Diagram"
+ ]
+ },
+ {
+ "name": "BPMNPlane",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ }
+ ],
+ "superClass": [
+ "di:Plane"
+ ]
+ },
+ {
+ "name": "BPMNShape",
+ "properties": [
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "isHorizontal",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isExpanded",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "isMarkerVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "isMessageVisible",
+ "isAttr": true,
+ "type": "Boolean"
+ },
+ {
+ "name": "participantBandKind",
+ "type": "ParticipantBandKind",
+ "isAttr": true
+ },
+ {
+ "name": "choreographyActivityShape",
+ "type": "BPMNShape",
+ "isAttr": true,
+ "isReference": true
+ }
+ ],
+ "superClass": [
+ "di:LabeledShape"
+ ]
+ },
+ {
+ "name": "BPMNEdge",
+ "properties": [
+ {
+ "name": "label",
+ "type": "BPMNLabel"
+ },
+ {
+ "name": "bpmnElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "bpmn:BaseElement",
+ "redefines": "di:DiagramElement#modelElement"
+ },
+ {
+ "name": "sourceElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#source"
+ },
+ {
+ "name": "targetElement",
+ "isAttr": true,
+ "isReference": true,
+ "type": "di:DiagramElement",
+ "redefines": "di:Edge#target"
+ },
+ {
+ "name": "messageVisibleKind",
+ "type": "MessageVisibleKind",
+ "isAttr": true,
+ "default": "initiating"
+ }
+ ],
+ "superClass": [
+ "di:LabeledEdge"
+ ]
+ },
+ {
+ "name": "BPMNLabel",
+ "properties": [
+ {
+ "name": "labelStyle",
+ "type": "BPMNLabelStyle",
+ "isAttr": true,
+ "isReference": true,
+ "redefines": "di:DiagramElement#style"
+ }
+ ],
+ "superClass": [
+ "di:Label"
+ ]
+ },
+ {
+ "name": "BPMNLabelStyle",
+ "properties": [
+ {
+ "name": "font",
+ "type": "dc:Font"
+ }
+ ],
+ "superClass": [
+ "di:Style"
+ ]
+ }
+ ],
+ "emumerations": [
+ {
+ "name": "ParticipantBandKind",
+ "literalValues": [
+ {
+ "name": "top_initiating"
+ },
+ {
+ "name": "middle_initiating"
+ },
+ {
+ "name": "bottom_initiating"
+ },
+ {
+ "name": "top_non_initiating"
+ },
+ {
+ "name": "middle_non_initiating"
+ },
+ {
+ "name": "bottom_non_initiating"
+ }
+ ]
+ },
+ {
+ "name": "MessageVisibleKind",
+ "literalValues": [
+ {
+ "name": "initiating"
+ },
+ {
+ "name": "non_initiating"
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "bpmndi"
+}
+},{}],33:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DC",
+ "uri": "http://www.omg.org/spec/DD/20100524/DC",
+ "types": [
+ {
+ "name": "Boolean"
+ },
+ {
+ "name": "Integer"
+ },
+ {
+ "name": "Real"
+ },
+ {
+ "name": "String"
+ },
+ {
+ "name": "Font",
+ "properties": [
+ {
+ "name": "name",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "size",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "isBold",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isItalic",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isUnderline",
+ "type": "Boolean",
+ "isAttr": true
+ },
+ {
+ "name": "isStrikeThrough",
+ "type": "Boolean",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Point",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ }
+ ]
+ },
+ {
+ "name": "Bounds",
+ "properties": [
+ {
+ "name": "x",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "y",
+ "type": "Real",
+ "default": "0",
+ "isAttr": true
+ },
+ {
+ "name": "width",
+ "type": "Real",
+ "isAttr": true
+ },
+ {
+ "name": "height",
+ "type": "Real",
+ "isAttr": true
+ }
+ ]
+ }
+ ],
+ "prefix": "dc",
+ "associations": []
+}
+},{}],34:[function(_dereq_,module,exports){
+module.exports={
+ "name": "DI",
+ "uri": "http://www.omg.org/spec/DD/20100524/DI",
+ "types": [
+ {
+ "name": "DiagramElement",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "extension",
+ "type": "Extension"
+ },
+ {
+ "name": "owningDiagram",
+ "type": "Diagram",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "owningElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "modelElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true,
+ "type": "Element"
+ },
+ {
+ "name": "style",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "ownedElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Node",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ]
+ },
+ {
+ "name": "Edge",
+ "isAbstract": true,
+ "superClass": [
+ "DiagramElement"
+ ],
+ "properties": [
+ {
+ "name": "source",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "target",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isReference": true
+ },
+ {
+ "name": "waypoint",
+ "isUnique": false,
+ "isMany": true,
+ "type": "dc:Point",
+ "serialize": "xsi:type"
+ }
+ ]
+ },
+ {
+ "name": "Diagram",
+ "isAbstract": true,
+ "properties": [
+ {
+ "name": "rootElement",
+ "type": "DiagramElement",
+ "isReadOnly": true,
+ "isVirtual": true
+ },
+ {
+ "name": "name",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "documentation",
+ "isAttr": true,
+ "type": "String"
+ },
+ {
+ "name": "resolution",
+ "isAttr": true,
+ "type": "Real"
+ },
+ {
+ "name": "ownedStyle",
+ "type": "Style",
+ "isReadOnly": true,
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Shape",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Plane",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "planeElement",
+ "type": "DiagramElement",
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledEdge",
+ "isAbstract": true,
+ "superClass": [
+ "Edge"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "LabeledShape",
+ "isAbstract": true,
+ "superClass": [
+ "Shape"
+ ],
+ "properties": [
+ {
+ "name": "ownedLabel",
+ "type": "Label",
+ "isReadOnly": true,
+ "subsettedProperty": "DiagramElement-ownedElement",
+ "isVirtual": true,
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "Label",
+ "isAbstract": true,
+ "superClass": [
+ "Node"
+ ],
+ "properties": [
+ {
+ "name": "bounds",
+ "type": "dc:Bounds"
+ }
+ ]
+ },
+ {
+ "name": "Style",
+ "isAbstract": true
+ },
+ {
+ "name": "Extension",
+ "properties": [
+ {
+ "name": "values",
+ "type": "Element",
+ "isMany": true
+ }
+ ]
+ }
+ ],
+ "associations": [],
+ "prefix": "di",
+ "xml": {
+ "tagAlias": "lowerCase"
+ }
+}
+},{}],35:[function(_dereq_,module,exports){
+module.exports = _dereq_(36);
+},{"36":36}],36:[function(_dereq_,module,exports){
+'use strict';
+
+var di = _dereq_(69);
+
+
+/**
+ * Bootstrap an injector from a list of modules, instantiating a number of default components
+ *
+ * @ignore
+ * @param {Array<didi.Module>} bootstrapModules
+ *
+ * @return {didi.Injector} a injector to use to access the components
+ */
+function bootstrap(bootstrapModules) {
+
+ var modules = [],
+ components = [];
+
+ function hasModule(m) {
+ return modules.indexOf(m) >= 0;
+ }
+
+ function addModule(m) {
+ modules.push(m);
+ }
+
+ function visit(m) {
+ if (hasModule(m)) {
+ return;
+ }
+
+ (m.__depends__ || []).forEach(visit);
+
+ if (hasModule(m)) {
+ return;
+ }
+
+ addModule(m);
+
+ (m.__init__ || []).forEach(function(c) {
+ components.push(c);
+ });
+ }
+
+ bootstrapModules.forEach(visit);
+
+ var injector = new di.Injector(modules);
+
+ components.forEach(function(c) {
+
+ try {
+ // eagerly resolve component (fn or string)
+ injector[typeof c === 'string' ? 'get' : 'invoke'](c);
+ } catch (e) {
+ console.error('Failed to instantiate component');
+ console.error(e.stack);
+
+ throw e;
+ }
+ });
+
+ return injector;
+}
+
+/**
+ * Creates an injector from passed options.
+ *
+ * @ignore
+ * @param {Object} options
+ * @return {didi.Injector}
+ */
+function createInjector(options) {
+
+ options = options || {};
+
+ var configModule = {
+ 'config': ['value', options]
+ };
+
+ var coreModule = _dereq_(42);
+
+ var modules = [ configModule, coreModule ].concat(options.modules || []);
+
+ return bootstrap(modules);
+}
+
+
+/**
+ * The main diagram-js entry point that bootstraps the diagram with the given
+ * configuration.
+ *
+ * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.
+ *
+ * @class djs.Diagram
+ * @memberOf djs
+ * @constructor
+ *
+ * @example
+ *
+ * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>
+ *
+ * // plug-in implemenentation
+ * function MyLoggingPlugin(eventBus) {
+ * eventBus.on('shape.added', function(event) {
+ * console.log('shape ', event.shape, ' was added to the diagram');
+ * });
+ * }
+ *
+ * // export as module
+ * module.exports = {
+ * __init__: [ 'myLoggingPlugin' ],
+ * myLoggingPlugin: [ 'type', MyLoggingPlugin ]
+ * };
+ *
+ *
+ * // instantiate the diagram with the new plug-in
+ *
+ * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });
+ *
+ * diagram.invoke([ 'canvas', function(canvas) {
+ * // add shape to drawing canvas
+ * canvas.addShape({ x: 10, y: 10 });
+ * });
+ *
+ * // 'shape ... was added to the diagram' logged to console
+ *
+ * @param {Object} options
+ * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram
+ * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with
+ */
+function Diagram(options, injector) {
+
+ // create injector unless explicitly specified
+ this.injector = injector = injector || createInjector(options);
+
+ // API
+
+ /**
+ * Resolves a diagram service
+ *
+ * @method Diagram#get
+ *
+ * @param {String} name the name of the diagram service to be retrieved
+ * @param {Object} [locals] a number of locals to use to resolve certain dependencies
+ */
+ this.get = injector.get;
+
+ /**
+ * Executes a function into which diagram services are injected
+ *
+ * @method Diagram#invoke
+ *
+ * @param {Function|Object[]} fn the function to resolve
+ * @param {Object} locals a number of locals to use to resolve certain dependencies
+ */
+ this.invoke = injector.invoke;
+
+ // init
+
+ // indicate via event
+
+
+ /**
+ * An event indicating that all plug-ins are loaded.
+ *
+ * Use this event to fire other events to interested plug-ins
+ *
+ * @memberOf Diagram
+ *
+ * @event diagram.init
+ *
+ * @example
+ *
+ * eventBus.on('diagram.init', function() {
+ * eventBus.fire('my-custom-event', { foo: 'BAR' });
+ * });
+ *
+ * @type {Object}
+ */
+ this.get('eventBus').fire('diagram.init');
+}
+
+module.exports = Diagram;
+
+
+/**
+ * Destroys the diagram
+ *
+ * @method Diagram#destroy
+ */
+Diagram.prototype.destroy = function() {
+ this.get('eventBus').fire('diagram.destroy');
+};
+},{"42":42,"69":69}],37:[function(_dereq_,module,exports){
+'use strict';
+
+var isNumber = _dereq_(162),
+ assign = _dereq_(168),
+ forEach = _dereq_(77);
+
+var Collections = _dereq_(57);
+
+var Snap = _dereq_(67);
+
+function round(number, resolution) {
+ return Math.round(number * resolution) / resolution;
+}
+
+function ensurePx(number) {
+ return isNumber(number) ? number + 'px' : number;
+}
+
+/**
+ * Creates a HTML container element for a SVG element with
+ * the given configuration
+ *
+ * @param {Object} options
+ * @return {HTMLElement} the container element
+ */
+function createContainer(options) {
+
+ options = assign({}, { width: '100%', height: '100%' }, options);
+
+ var container = options.container || document.body;
+
+ // create a <div> around the svg element with the respective size
+ // this way we can always get the correct container size
+ // (this is impossible for <svg> elements at the moment)
+ var parent = document.createElement('div');
+ parent.setAttribute('class', 'djs-container');
+
+ assign(parent.style, {
+ position: 'relative',
+ overflow: 'hidden',
+ width: ensurePx(options.width),
+ height: ensurePx(options.height)
+ });
+
+ container.appendChild(parent);
+
+ return parent;
+}
+
+function createGroup(parent, cls) {
+ return parent.group().attr({ 'class' : cls });
+}
+
+var BASE_LAYER = 'base';
+
+
+/**
+ * The main drawing canvas.
+ *
+ * @class
+ * @constructor
+ *
+ * @emits Canvas#canvas.init
+ *
+ * @param {Object} config
+ * @param {EventBus} eventBus
+ * @param {GraphicsFactory} graphicsFactory
+ * @param {ElementRegistry} elementRegistry
+ */
+function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
+ this._eventBus = eventBus;
+ this._elementRegistry = elementRegistry;
+ this._graphicsFactory = graphicsFactory;
+
+ this._init(config || {});
+}
+
+Canvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];
+
+module.exports = Canvas;
+
+
+Canvas.prototype._init = function(config) {
+
+ // Creates a <svg> element that is wrapped into a <div>.
+ // This way we are always able to correctly figure out the size of the svg element
+ // by querying the parent node.
+ //
+ // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
+ //
+ // <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
+ // <svg width="100%" height="100%">
+ // ...
+ // </svg>
+ // </div>
+
+ // html container
+ var eventBus = this._eventBus,
+
+ container = createContainer(config),
+ svg = Snap.createSnapAt('100%', '100%', container),
+ viewport = createGroup(svg, 'viewport'),
+
+ self = this;
+
+ this._container = container;
+ this._svg = svg;
+ this._viewport = viewport;
+ this._layers = {};
+
+ eventBus.on('diagram.init', function(event) {
+
+ /**
+ * An event indicating that the canvas is ready to be drawn on.
+ *
+ * @memberOf Canvas
+ *
+ * @event canvas.init
+ *
+ * @type {Object}
+ * @property {Snap<SVGSVGElement>} svg the created svg element
+ * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes
+ */
+ eventBus.fire('canvas.init', { svg: svg, viewport: viewport });
+ });
+
+ eventBus.on('diagram.destroy', function() {
+
+ var parent = self._container.parentNode;
+
+ if (parent) {
+ parent.removeChild(container);
+ }
+
+ eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });
+
+ self._svg.remove();
+
+ self._svg = self._container = self._layers = self._viewport = null;
+ });
+
+};
+
+/**
+ * Returns the default layer on which
+ * all elements are drawn.
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getDefaultLayer = function() {
+ return this.getLayer(BASE_LAYER);
+};
+
+/**
+ * Returns a layer that is used to draw elements
+ * or annotations on it.
+ *
+ * @param {String} name
+ *
+ * @returns {Snap<SVGGroup>}
+ */
+Canvas.prototype.getLayer = function(name) {
+
+ if (!name) {
+ throw new Error('must specify a name');
+ }
+
+ var layer = this._layers[name];
+ if (!layer) {
+ layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
+ }
+
+ return layer;
+};
+
+
+/**
+ * Returns the html element that encloses the
+ * drawing canvas.
+ *
+ * @return {DOMNode}
+ */
+Canvas.prototype.getContainer = function() {
+ return this._container;
+};
+
+
+/////////////// markers ///////////////////////////////////
+
+Canvas.prototype._updateMarker = function(element, marker, add) {
+ var container;
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ // we need to access all
+ container = this._elementRegistry._elements[element.id];
+
+ if (!container) {
+ return;
+ }
+
+ forEach([ container.gfx, container.secondaryGfx ], function(gfx) {
+ if (gfx) {
+ // invoke either addClass or removeClass based on mode
+ gfx[add ? 'addClass' : 'removeClass'](marker);
+ }
+ });
+
+ /**
+ * An event indicating that a marker has been updated for an element
+ *
+ * @event element.marker.update
+ * @type {Object}
+ * @property {djs.model.Element} element the shape
+ * @property {Object} gfx the graphical representation of the shape
+ * @property {String} marker
+ * @property {Boolean} add true if the marker was added, false if it got removed
+ */
+ this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });
+};
+
+
+/**
+ * Adds a marker to an element (basically a css class).
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @example
+ * canvas.addMarker('foo', 'some-marker');
+ *
+ * var fooGfx = canvas.getGraphics('foo');
+ *
+ * fooGfx; // <g class="... some-marker"> ... </g>
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.addMarker = function(element, marker) {
+ this._updateMarker(element, marker, true);
+};
+
+
+/**
+ * Remove a marker from an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.removeMarker = function(element, marker) {
+ this._updateMarker(element, marker, false);
+};
+
+/**
+ * Check the existence of a marker on element.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.hasMarker = function(element, marker) {
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ var gfx = this.getGraphics(element);
+
+ return gfx && gfx.hasClass(marker);
+};
+
+/**
+ * Toggles a marker on an element.
+ *
+ * Fires the element.marker.update event, making it possible to
+ * integrate extension into the marker life-cycle, too.
+ *
+ * @param {String|djs.model.Base} element
+ * @param {String} marker
+ */
+Canvas.prototype.toggleMarker = function(element, marker) {
+ if(this.hasMarker(element, marker)) {
+ this.removeMarker(element, marker);
+ } else {
+ this.addMarker(element, marker);
+ }
+};
+
+Canvas.prototype.getRootElement = function() {
+ if (!this._rootElement) {
+ this.setRootElement({ id: '__implicitroot' });
+ }
+
+ return this._rootElement;
+};
+
+
+
+//////////////// root element handling ///////////////////////////
+
+/**
+ * Sets a given element as the new root element for the canvas
+ * and returns the new root element.
+ *
+ * @param {Object|djs.model.Root} element
+ * @param {Boolean} [override] whether to override the current root element, if any
+ *
+ * @return {Object|djs.model.Root} new root element
+ */
+Canvas.prototype.setRootElement = function(element, override) {
+
+ this._ensureValidId(element);
+
+ var oldRoot = this._rootElement,
+ elementRegistry = this._elementRegistry,
+ eventBus = this._eventBus;
+
+ if (oldRoot) {
+ if (!override) {
+ throw new Error('rootElement already set, need to specify override');
+ }
+
+ // simulate element remove event sequence
+ eventBus.fire('root.remove', { element: oldRoot });
+ eventBus.fire('root.removed', { element: oldRoot });
+
+ elementRegistry.remove(oldRoot);
+ }
+
+ var gfx = this.getDefaultLayer();
+
+ // resemble element add event sequence
+ eventBus.fire('root.add', { element: element });
+
+ elementRegistry.add(element, gfx, this._svg);
+
+ eventBus.fire('root.added', { element: element, gfx: gfx });
+
+ this._rootElement = element;
+
+ return element;
+};
+
+
+
+///////////// add functionality ///////////////////////////////
+
+Canvas.prototype._ensureValidId = function(element) {
+ if (!element.id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elementRegistry.get(element.id)) {
+ throw new Error('element with id ' + element.id + ' already exists');
+ }
+};
+
+Canvas.prototype._setParent = function(element, parent) {
+ Collections.add(parent.children, element);
+ element.parent = parent;
+};
+
+/**
+ * Adds an element to the canvas.
+ *
+ * This wires the parent <-> child relationship between the element and
+ * a explicitly specified parent or an implicit root element.
+ *
+ * During add it emits the events
+ *
+ * * <{type}.add> (element, parent)
+ * * <{type}.added> (element, gfx)
+ *
+ * Extensions may hook into these events to perform their magic.
+ *
+ * @param {String} type
+ * @param {Object|djs.model.Base} element
+ * @param {Object|djs.model.Base} [parent]
+ *
+ * @return {Object|djs.model.Base} the added element
+ */
+Canvas.prototype._addElement = function(type, element, parent) {
+
+ parent = parent || this.getRootElement();
+
+ var eventBus = this._eventBus,
+ graphicsFactory = this._graphicsFactory;
+
+ this._ensureValidId(element);
+
+ eventBus.fire(type + '.add', { element: element, parent: parent });
+
+ this._setParent(element, parent);
+
+ // create graphics
+ var gfx = graphicsFactory.create(type, element);
+
+ this._elementRegistry.add(element, gfx);
+
+ // update its visual
+ graphicsFactory.update(type, element, gfx);
+
+ eventBus.fire(type + '.added', { element: element, gfx: gfx });
+
+ return element;
+};
+
+/**
+ * Adds a shape to the canvas
+ *
+ * @param {Object|djs.model.Shape} shape to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Shape} the added shape
+ */
+Canvas.prototype.addShape = function(shape, parent) {
+ return this._addElement('shape', shape, parent);
+};
+
+/**
+ * Adds a connection to the canvas
+ *
+ * @param {Object|djs.model.Connection} connection to add to the diagram
+ * @param {djs.model.Base} [parent]
+ *
+ * @return {djs.model.Connection} the added connection
+ */
+Canvas.prototype.addConnection = function(connection, parent) {
+ return this._addElement('connection', connection, parent);
+};
+
+
+/**
+ * Internal remove element
+ */
+Canvas.prototype._removeElement = function(element, type) {
+
+ var elementRegistry = this._elementRegistry,
+ graphicsFactory = this._graphicsFactory,
+ eventBus = this._eventBus;
+
+ element = elementRegistry.get(element.id || element);
+
+ if (!element) {
+ // element was removed already
+ return;
+ }
+
+ eventBus.fire(type + '.remove', { element: element });
+
+ graphicsFactory.remove(element);
+
+ // unset parent <-> child relationship
+ Collections.remove(element.parent && element.parent.children, element);
+ element.parent = null;
+
+ eventBus.fire(type + '.removed', { element: element });
+
+ elementRegistry.remove(element);
+
+ return element;
+};
+
+
+/**
+ * Removes a shape from the canvas
+ *
+ * @param {String|djs.model.Shape} shape or shape id to be removed
+ *
+ * @return {djs.model.Shape} the removed shape
+ */
+Canvas.prototype.removeShape = function(shape) {
+
+ /**
+ * An event indicating that a shape is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.remove
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+
+ /**
+ * An event indicating that a shape has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event shape.removed
+ * @type {Object}
+ * @property {djs.model.Shape} element the shape descriptor
+ * @property {Object} gfx the graphical representation of the shape
+ */
+ return this._removeElement(shape, 'shape');
+};
+
+
+/**
+ * Removes a connection from the canvas
+ *
+ * @param {String|djs.model.Connection} connection or connection id to be removed
+ *
+ * @return {djs.model.Connection} the removed connection
+ */
+Canvas.prototype.removeConnection = function(connection) {
+
+ /**
+ * An event indicating that a connection is about to be removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.remove
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+
+ /**
+ * An event indicating that a connection has been removed from the canvas.
+ *
+ * @memberOf Canvas
+ *
+ * @event connection.removed
+ * @type {Object}
+ * @property {djs.model.Connection} element the connection descriptor
+ * @property {Object} gfx the graphical representation of the connection
+ */
+ return this._removeElement(connection, 'connection');
+};
+
+
+/**
+ * Sends a shape to the front.
+ *
+ * This method takes parent / child relationships between shapes into account
+ * and makes sure that children are properly handled, too.
+ *
+ * @param {djs.model.Shape} shape descriptor of the shape to be sent to front
+ * @param {boolean} [bubble=true] whether to send parent shapes to front, too
+ */
+Canvas.prototype.sendToFront = function(shape, bubble) {
+
+ if (bubble !== false) {
+ bubble = true;
+ }
+
+ if (bubble && shape.parent) {
+ this.sendToFront(shape.parent);
+ }
+
+ forEach(shape.children, function(child) {
+ this.sendToFront(child, false);
+ }, this);
+
+ var gfx = this.getGraphics(shape),
+ gfxParent = gfx.parent();
+
+ gfx.remove().appendTo(gfxParent);
+};
+
+
+/**
+ * Return the graphical object underlaying a certain diagram element
+ *
+ * @param {String|djs.model.Base} element descriptor of the element
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+Canvas.prototype.getGraphics = function(element, secondary) {
+ return this._elementRegistry.getGraphics(element, secondary);
+};
+
+
+Canvas.prototype._fireViewboxChange = function() {
+ this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });
+};
+
+
+/**
+ * Gets or sets the view box of the canvas, i.e. the area that is currently displayed
+ *
+ * @param {Object} [box] the new view box to set
+ * @param {Number} box.x the top left X coordinate of the canvas visible in view box
+ * @param {Number} box.y the top left Y coordinate of the canvas visible in view box
+ * @param {Number} box.width the visible width
+ * @param {Number} box.height
+ *
+ * @example
+ *
+ * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
+ *
+ * // sets the visible area of the diagram to (100|100) -> (600|100)
+ * // and and scales it according to the diagram width
+ *
+ * @return {Object} the current view box
+ */
+Canvas.prototype.viewbox = function(box) {
+
+ if (box === undefined && this._cachedViewbox) {
+ return this._cachedViewbox;
+ }
+
+ var viewport = this._viewport,
+ innerBox,
+ outerBox = this.getSize(),
+ matrix,
+ scale,
+ x, y;
+
+ if (!box) {
+ // compute the inner box based on the
+ // diagrams default layer. This allows us to exclude
+ // external components, such as overlays
+ innerBox = this.getDefaultLayer().getBBox(true);
+
+ matrix = viewport.transform().localMatrix;
+ scale = round(matrix.a, 1000);
+
+ x = round(-matrix.e || 0, 1000);
+ y = round(-matrix.f || 0, 1000);
+
+ box = this._cachedViewbox = {
+ x: x ? x / scale : 0,
+ y: y ? y / scale : 0,
+ width: outerBox.width / scale,
+ height: outerBox.height / scale,
+ scale: scale,
+ inner: {
+ width: innerBox.width,
+ height: innerBox.height,
+ x: innerBox.x,
+ y: innerBox.y
+ },
+ outer: outerBox
+ };
+
+ return box;
+ } else {
+ scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
+
+ matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
+ viewport.transform(matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return box;
+};
+
+
+/**
+ * Gets or sets the scroll of the canvas.
+ *
+ * @param {Object} [delta] the new scroll to apply.
+ *
+ * @param {Number} [delta.dx]
+ * @param {Number} [delta.dy]
+ */
+Canvas.prototype.scroll = function(delta) {
+
+ var node = this._viewport.node;
+ var matrix = node.getCTM();
+
+ if (delta) {
+ delta = assign({ dx: 0, dy: 0 }, delta || {});
+
+ matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
+
+ setCTM(node, matrix);
+
+ this._fireViewboxChange();
+ }
+
+ return { x: matrix.e, y: matrix.f };
+};
+
+
+/**
+ * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.
+ *
+ * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,
+ * or `fit-viewport` to adjust the size to fit the current viewport
+ * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null
+ *
+ * @return {Number} the current scale
+ */
+Canvas.prototype.zoom = function(newScale, center) {
+
+ if (newScale === 'fit-viewport') {
+ return this._fitViewport(center);
+ }
+
+ var vbox = this.viewbox();
+
+ if (newScale === undefined) {
+ return vbox.scale;
+ }
+
+ var outer = vbox.outer;
+
+ if (center === 'auto') {
+ center = {
+ x: outer.width / 2,
+ y: outer.height / 2
+ };
+ }
+
+ var matrix = this._setZoom(newScale, center);
+
+ this._fireViewboxChange();
+
+ return round(matrix.a, 1000);
+};
+
+function setCTM(node, m) {
+ var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
+ node.setAttribute('transform', mstr);
+}
+
+Canvas.prototype._fitViewport = function(center) {
+
+ var vbox = this.viewbox(),
+ outer = vbox.outer,
+ inner = vbox.inner,
+ newScale,
+ newViewbox;
+
+ // display the complete diagram without zooming in.
+ // instead of relying on internal zoom, we perform a
+ // hard reset on the canvas viewbox to realize this
+ //
+ // if diagram does not need to be zoomed in, we focus it around
+ // the diagram origin instead
+
+ if (inner.x >= 0 &&
+ inner.y >= 0 &&
+ inner.x + inner.width <= outer.width &&
+ inner.y + inner.height <= outer.height &&
+ !center) {
+
+ newViewbox = {
+ x: 0,
+ y: 0,
+ width: Math.max(inner.width + inner.x, outer.width),
+ height: Math.max(inner.height + inner.y, outer.height)
+ };
+ } else {
+
+ newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
+ newViewbox = {
+ x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
+ y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
+ width: outer.width / newScale,
+ height: outer.height / newScale
+ };
+ }
+
+ this.viewbox(newViewbox);
+
+ return this.viewbox().scale;
+};
+
+
+Canvas.prototype._setZoom = function(scale, center) {
+
+ var svg = this._svg.node,
+ viewport = this._viewport.node;
+
+ var matrix = svg.createSVGMatrix();
+ var point = svg.createSVGPoint();
+
+ var centerPoint,
+ originalPoint,
+ currentMatrix,
+ scaleMatrix,
+ newMatrix;
+
+ currentMatrix = viewport.getCTM();
+
+
+ var currentScale = currentMatrix.a;
+
+ if (center) {
+ centerPoint = assign(point, center);
+
+ // revert applied viewport transformations
+ originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
+
+ // create scale matrix
+ scaleMatrix = matrix
+ .translate(originalPoint.x, originalPoint.y)
+ .scale(1 / currentScale * scale)
+ .translate(-originalPoint.x, -originalPoint.y);
+
+ newMatrix = currentMatrix.multiply(scaleMatrix);
+ } else {
+ newMatrix = matrix.scale(scale);
+ }
+
+ setCTM(this._viewport.node, newMatrix);
+
+ return newMatrix;
+};
+
+
+/**
+ * Returns the size of the canvas
+ *
+ * @return {Dimensions}
+ */
+Canvas.prototype.getSize = function () {
+ return {
+ width: this._container.clientWidth,
+ height: this._container.clientHeight
+ };
+};
+
+
+/**
+ * Return the absolute bounding box for the given element
+ *
+ * The absolute bounding box may be used to display overlays in the
+ * callers (browser) coordinate system rather than the zoomed in/out
+ * canvas coordinates.
+ *
+ * @param {ElementDescriptor} element
+ * @return {Bounds} the absolute bounding box
+ */
+Canvas.prototype.getAbsoluteBBox = function(element) {
+ var vbox = this.viewbox();
+ var bbox;
+
+ // connection
+ // use svg bbox
+ if (element.waypoints) {
+ var gfx = this.getGraphics(element);
+
+ var transformBBox = gfx.getBBox(true);
+ bbox = gfx.getBBox();
+
+ bbox.x -= transformBBox.x;
+ bbox.y -= transformBBox.y;
+
+ bbox.width += 2 * transformBBox.x;
+ bbox.height += 2 * transformBBox.y;
+ }
+ // shapes
+ // use data
+ else {
+ bbox = element;
+ }
+
+ var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
+ var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
+
+ var width = bbox.width * vbox.scale;
+ var height = bbox.height * vbox.scale;
+
+ return {
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ };
+};
+
+},{"162":162,"168":168,"57":57,"67":67,"77":77}],38:[function(_dereq_,module,exports){
+'use strict';
+
+var Model = _dereq_(56);
+
+
+/**
+ * A factory for diagram-js shapes
+ */
+function ElementFactory() {
+ this._uid = 12;
+}
+
+module.exports = ElementFactory;
+
+
+ElementFactory.prototype.createRoot = function(attrs) {
+ return this.create('root', attrs);
+};
+
+ElementFactory.prototype.createLabel = function(attrs) {
+ return this.create('label', attrs);
+};
+
+ElementFactory.prototype.createShape = function(attrs) {
+ return this.create('shape', attrs);
+};
+
+ElementFactory.prototype.createConnection = function(attrs) {
+ return this.create('connection', attrs);
+};
+
+/**
+ * Create a model element with the given type and
+ * a number of pre-set attributes.
+ *
+ * @param {String} type
+ * @param {Object} attrs
+ * @return {djs.model.Base} the newly created model instance
+ */
+ElementFactory.prototype.create = function(type, attrs) {
+
+ attrs = attrs || {};
+
+ if (!attrs.id) {
+ attrs.id = type + '_' + (this._uid++);
+ }
+
+ return Model.create(type, attrs);
+};
+},{"56":56}],39:[function(_dereq_,module,exports){
+'use strict';
+
+var ELEMENT_ID = 'data-element-id';
+
+
+/**
+ * @class
+ *
+ * A registry that keeps track of all shapes in the diagram.
+ */
+function ElementRegistry() {
+ this._elements = {};
+}
+
+module.exports = ElementRegistry;
+
+/**
+ * Register a pair of (element, gfx, (secondaryGfx)).
+ *
+ * @param {djs.model.Base} element
+ * @param {Snap<SVGElement>} gfx
+ * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too
+ */
+ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
+
+ var id = element.id;
+
+ this._validateId(id);
+
+ // associate dom node with element
+ gfx.attr(ELEMENT_ID, id);
+
+ if (secondaryGfx) {
+ secondaryGfx.attr(ELEMENT_ID, id);
+ }
+
+ this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };
+};
+
+/**
+ * Removes an element from the registry.
+ *
+ * @param {djs.model.Base} element
+ */
+ElementRegistry.prototype.remove = function(element) {
+ var elements = this._elements,
+ id = element.id || element,
+ container = id && elements[id];
+
+ if (container) {
+
+ // unset element id on gfx
+ container.gfx.attr(ELEMENT_ID, null);
+
+ if (container.secondaryGfx) {
+ container.secondaryGfx.attr(ELEMENT_ID, null);
+ }
+
+ delete elements[id];
+ }
+};
+
+/**
+ * Update the id of an element
+ *
+ * @param {djs.model.Base} element
+ * @param {String} newId
+ */
+ElementRegistry.prototype.updateId = function(element, newId) {
+
+ this._validateId(newId);
+
+ if (typeof element === 'string') {
+ element = this.get(element);
+ }
+
+ var gfx = this.getGraphics(element),
+ secondaryGfx = this.getGraphics(element, true);
+
+ this.remove(element);
+
+ element.id = newId;
+
+ this.add(element, gfx, secondaryGfx);
+};
+
+/**
+ * Return the model element for a given id or graphics.
+ *
+ * @example
+ *
+ * elementRegistry.get('SomeElementId_1');
+ * elementRegistry.get(gfx);
+ *
+ *
+ * @param {String|SVGElement} filter for selecting the element
+ *
+ * @return {djs.model.Base}
+ */
+ElementRegistry.prototype.get = function(filter) {
+ var id;
+
+ if (typeof filter === 'string') {
+ id = filter;
+ } else {
+ id = filter && filter.attr(ELEMENT_ID);
+ }
+
+ var container = this._elements[id];
+ return container && container.element;
+};
+
+/**
+ * Return all elements that match a given filter function.
+ *
+ * @param {Function} fn
+ *
+ * @return {Array<djs.model.Base>}
+ */
+ElementRegistry.prototype.filter = function(fn) {
+
+ var filtered = [];
+
+ this.forEach(function(element, gfx) {
+ if(fn(element, gfx)) {
+ filtered.push(element);
+ }
+ });
+
+ return filtered;
+};
+
+/**
+ * Iterate over all diagram elements.
+ *
+ * @param {Function} fn
+ */
+ElementRegistry.prototype.forEach = function(fn) {
+
+ var map = this._elements;
+
+ Object.keys(map).forEach(function(id) {
+ var container = map[id],
+ element = container.element,
+ gfx = container.gfx;
+
+ return fn(element, gfx);
+ });
+};
+
+/**
+ * Return the graphical representation of an element or its id.
+ *
+ * @example
+ * elementRegistry.getGraphics('SomeElementId_1');
+ * elementRegistry.getGraphics(rootElement); // <g ...>
+ *
+ * elementRegistry.getGraphics(rootElement, true); // <svg ...>
+ *
+ *
+ * @param {String|djs.model.Base} filter
+ * @param {Boolean} [secondary=false] whether to return the secondary connected element
+ *
+ * @return {SVGElement}
+ */
+ElementRegistry.prototype.getGraphics = function(filter, secondary) {
+ var id = filter.id || filter;
+
+ var container = this._elements[id];
+ return container && (secondary ? container.secondaryGfx : container.gfx);
+};
+
+/**
+ * Validate the suitability of the given id and signals a problem
+ * with an exception.
+ *
+ * @param {String} id
+ *
+ * @throws {Error} if id is empty or already assigned
+ */
+ElementRegistry.prototype._validateId = function(id) {
+ if (!id) {
+ throw new Error('element must have an id');
+ }
+
+ if (this._elements[id]) {
+ throw new Error('element with id ' + id + ' already added');
+ }
+};
+},{}],40:[function(_dereq_,module,exports){
+'use strict';
+
+var isFunction = _dereq_(160),
+ isArray = _dereq_(159),
+ isNumber = _dereq_(162),
+ assign = _dereq_(168);
+
+var DEFAULT_PRIORITY = 1000;
+
+
+/**
+ * A general purpose event bus.
+ *
+ * This component is used to communicate across a diagram instance.
+ * Other parts of a diagram can use it to listen to and broadcast events.
+ *
+ *
+ * ## Registering for Events
+ *
+ * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
+ * methods to register for events. {@link EventBus#off} can be used to
+ * remove event registrations. Listeners receive an instance of {@link Event}
+ * as the first argument. It allows them to hook into the event execution.
+ *
+ * ```javascript
+ *
+ * // listen for event
+ * eventBus.on('foo', function(event) {
+ *
+ * // access event type
+ * event.type; // 'foo'
+ *
+ * // stop propagation to other listeners
+ * event.stopPropagation();
+ *
+ * // prevent event default
+ * event.preventDefault();
+ * });
+ *
+ * // listen for event with custom payload
+ * eventBus.on('bar', function(event, payload) {
+ * console.log(payload);
+ * });
+ *
+ * // listen for event returning value
+ * eventBus.on('foobar', function(event) {
+ *
+ * // stop event propagation + prevent default
+ * return false;
+ *
+ * // stop event propagation + return custom result
+ * return {
+ * complex: 'listening result'
+ * };
+ * });
+ *
+ *
+ * // listen with custom priority (default=1000, higher is better)
+ * eventBus.on('priorityfoo', 1500, function(event) {
+ * console.log('invoked first!');
+ * });
+ * ```
+ *
+ *
+ * ## Emitting Events
+ *
+ * Events can be emitted via the event bus using {@link EventBus#fire}.
+ *
+ * ```javascript
+ *
+ * // false indicates that the default action
+ * // was prevented by listeners
+ * if (eventBus.fire('foo') === false) {
+ * console.log('default has been prevented!');
+ * };
+ *
+ *
+ * // custom args + return value listener
+ * eventBus.on('sum', function(event, a, b) {
+ * return a + b;
+ * });
+ *
+ * // you can pass custom arguments + retrieve result values.
+ * var sum = eventBus.fire('sum', 1, 2);
+ * console.log(sum); // 3
+ * ```
+ */
+function EventBus() {
+ this._listeners = {};
+
+ // cleanup on destroy
+
+ var self = this;
+
+ // destroy on lowest priority to allow
+ // message passing until the bitter end
+ this.on('diagram.destroy', 1, function() {
+ self._listeners = null;
+ });
+}
+
+module.exports = EventBus;
+
+
+/**
+ * Register an event listener for events with the given name.
+ *
+ * The callback will be invoked with `event, ...additionalArguments`
+ * that have been passed to {@link EventBus#fire}.
+ *
+ * Returning false from a listener will prevent the events default action
+ * (if any is specified). To stop an event from being processed further in
+ * other listeners execute {@link Event#stopPropagation}.
+ *
+ * Returning anything but `undefined` from a listener will stop the listener propagation.
+ *
+ * @param {String|Array<String>} events
+ * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher
+ * @param {Function} callback
+ */
+EventBus.prototype.on = function(events, priority, callback) {
+
+ events = isArray(events) ? events : [ events ];
+
+ if (isFunction(priority)) {
+ callback = priority;
+ priority = DEFAULT_PRIORITY;
+ }
+
+ if (!isNumber(priority)) {
+ throw new Error('priority must be a number');
+ }
+
+ var self = this,
+ listener = { priority: priority, callback: callback };
+
+ events.forEach(function(e) {
+ self._addListener(e, listener);
+ });
+};
+
+
+/**
+ * Register an event listener that is executed only once.
+ *
+ * @param {String} event the event name to register for
+ * @param {Function} callback the callback to execute
+ */
+EventBus.prototype.once = function(event, callback) {
+
+ var self = this;
+
+ function wrappedCallback() {
+ callback.apply(self, arguments);
+ self.off(event, wrappedCallback);
+ }
+
+ this.on(event, wrappedCallback);
+};
+
+
+/**
+ * Removes event listeners by event and callback.
+ *
+ * If no callback is given, all listeners for a given event name are being removed.
+ *
+ * @param {String} event
+ * @param {Function} [callback]
+ */
+EventBus.prototype.off = function(event, callback) {
+ var listeners = this._getListeners(event),
+ listener, idx;
+
+ if (callback) {
+
+ // move through listeners from back to front
+ // and remove matching listeners
+ for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
+ if (listener.callback === callback) {
+ listeners.splice(idx, 1);
+ }
+ }
+ } else {
+ // clear listeners
+ listeners.length = 0;
+ }
+};
+
+
+/**
+ * Fires a named event.
+ *
+ * @example
+ *
+ * // fire event by name
+ * events.fire('foo');
+ *
+ * // fire event object with nested type
+ * var event = { type: 'foo' };
+ * events.fire(event);
+ *
+ * // fire event with explicit type
+ * var event = { x: 10, y: 20 };
+ * events.fire('element.moved', event);
+ *
+ * // pass additional arguments to the event
+ * events.on('foo', function(event, bar) {
+ * alert(bar);
+ * });
+ *
+ * events.fire({ type: 'foo' }, 'I am bar!');
+ *
+ * @param {String} [name] the optional event name
+ * @param {Object} [event] the event object
+ * @param {...Object} additional arguments to be passed to the callback functions
+ *
+ * @return {Boolean} the events return value, if specified or false if the
+ * default action was prevented by listeners
+ */
+EventBus.prototype.fire = function(type, data) {
+
+ var event,
+ originalType,
+ listeners, idx, listener,
+ returnValue,
+ args;
+
+ args = Array.prototype.slice.call(arguments);
+
+ if (typeof type === 'object') {
+ event = type;
+ type = event.type;
+ }
+
+ if (!type) {
+ throw new Error('no event type specified');
+ }
+
+ listeners = this._listeners[type];
+
+ if (!listeners) {
+ return;
+ }
+
+ // we make sure we fire instances of our home made
+ // events here. We wrap them only once, though
+ if (data instanceof Event) {
+ // we are fine, we alread have an event
+ event = data;
+ } else {
+ event = new Event();
+ event.init(data);
+ }
+
+ // ensure we pass the event as the first parameter
+ args[0] = event;
+
+ // original event type (in case we delegate)
+ originalType = event.type;
+
+ try {
+
+ // update event type before delegation
+ if (type !== originalType) {
+ event.type = type;
+ }
+
+ for (idx = 0; !!(listener = listeners[idx]); idx++) {
+
+ // handle stopped propagation
+ if (event.cancelBubble) {
+ break;
+ }
+
+ try {
+ // returning false prevents the default action
+ returnValue = event.returnValue = listener.callback.apply(null, args);
+
+ // stop propagation on return value
+ if (returnValue !== undefined) {
+ event.stopPropagation();
+ }
+
+ // prevent default on return false
+ if (returnValue === false) {
+ event.preventDefault();
+ }
+ } catch (e) {
+ if (!this.handleError(e)) {
+ console.error('unhandled error in event listener');
+ console.error(e.stack);
+
+ throw e;
+ }
+ }
+ }
+ } finally {
+ // reset event type after delegation
+ if (type !== originalType) {
+ event.type = originalType;
+ }
+ }
+
+ // set the return value to false if the event default
+ // got prevented and no other return value exists
+ if (returnValue === undefined && event.defaultPrevented) {
+ returnValue = false;
+ }
+
+ return returnValue;
+};
+
+
+EventBus.prototype.handleError = function(error) {
+ return this.fire('error', { error: error }) === false;
+};
+
+
+/*
+ * Add new listener with a certain priority to the list
+ * of listeners (for the given event).
+ *
+ * The semantics of listener registration / listener execution are
+ * first register, first serve: New listeners will always be inserted
+ * after existing listeners with the same priority.
+ *
+ * Example: Inserting two listeners with priority 1000 and 1300
+ *
+ * * before: [ 1500, 1500, 1000, 1000 ]
+ * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]
+ *
+ * @param {String} event
+ * @param {Object} listener { priority, callback }
+ */
+EventBus.prototype._addListener = function(event, newListener) {
+
+ var listeners = this._getListeners(event),
+ existingListener,
+ idx;
+
+ // ensure we order listeners by priority from
+ // 0 (high) to n > 0 (low)
+ for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
+ if (existingListener.priority < newListener.priority) {
+
+ // prepend newListener at before existingListener
+ listeners.splice(idx, 0, newListener);
+ return;
+ }
+ }
+
+ listeners.push(newListener);
+};
+
+
+EventBus.prototype._getListeners = function(name) {
+ var listeners = this._listeners[name];
+
+ if (!listeners) {
+ this._listeners[name] = listeners = [];
+ }
+
+ return listeners;
+};
+
+
+/**
+ * A event that is emitted via the event bus.
+ */
+function Event() { }
+
+module.exports.Event = Event;
+
+Event.prototype.stopPropagation = function() {
+ this.cancelBubble = true;
+};
+
+Event.prototype.preventDefault = function() {
+ this.defaultPrevented = true;
+};
+
+Event.prototype.init = function(data) {
+ assign(this, data || {});
+};
+
+},{"159":159,"160":160,"162":162,"168":168}],41:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(77),
+ reduce = _dereq_(81);
+
+var GraphicsUtil = _dereq_(60),
+ domClear = _dereq_(181);
+
+/**
+ * A factory that creates graphical elements
+ *
+ * @param {Renderer} renderer
+ */
+function GraphicsFactory(renderer, elementRegistry) {
+ this._renderer = renderer;
+ this._elementRegistry = elementRegistry;
+}
+
+GraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];
+
+module.exports = GraphicsFactory;
+
+
+GraphicsFactory.prototype._getChildren = function(element) {
+
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ var childrenGfx;
+
+ // root element
+ if (!element.parent) {
+ childrenGfx = gfx;
+ } else {
+ childrenGfx = GraphicsUtil.getChildren(gfx);
+ if (!childrenGfx) {
+ childrenGfx = gfx.parent().group().attr('class', 'djs-children');
+ }
+ }
+
+ return childrenGfx;
+};
+
+/**
+ * Clears the graphical representation of the element and returns the
+ * cleared visual (the <g class="djs-visual" /> element).
+ */
+GraphicsFactory.prototype._clear = function(gfx) {
+ var visual = GraphicsUtil.getVisual(gfx);
+
+ domClear(visual.node);
+
+ return visual;
+};
+
+/**
+ * Creates a gfx container for shapes and connections
+ *
+ * The layout is as follows:
+ *
+ * <g class="djs-group">
+ *
+ * <!-- the gfx -->
+ * <g class="djs-element djs-(shape|connection)">
+ * <g class="djs-visual">
+ * <!-- the renderer draws in here -->
+ * </g>
+ *
+ * <!-- extensions (overlays, click box, ...) goes here
+ * </g>
+ *
+ * <!-- the gfx child nodes -->
+ * <g class="djs-children"></g>
+ * </g>
+ *
+ * @param {Object} parent
+ * @param {String} type the type of the element, i.e. shape | connection
+ */
+GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
+ var outerGfx = parentGfx.group().attr('class', 'djs-group'),
+ gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
+
+ // create visual
+ gfx.group().attr('class', 'djs-visual');
+
+ return gfx;
+};
+
+GraphicsFactory.prototype.create = function(type, element) {
+ var childrenGfx = this._getChildren(element.parent);
+ return this._createContainer(type, childrenGfx);
+};
+
+
+GraphicsFactory.prototype.updateContainments = function(elements) {
+
+ var self = this,
+ elementRegistry = this._elementRegistry,
+ parents;
+
+
+ parents = reduce(elements, function(map, e) {
+
+ if (e.parent) {
+ map[e.parent.id] = e.parent;
+ }
+
+ return map;
+ }, {});
+
+ // update all parents of changed and reorganized their children
+ // in the correct order (as indicated in our model)
+ forEach(parents, function(parent) {
+
+ var childGfx = self._getChildren(parent),
+ children = parent.children;
+
+ if (!children) {
+ return;
+ }
+
+ forEach(children.slice().reverse(), function(c) {
+ var gfx = elementRegistry.getGraphics(c);
+ gfx.parent().prependTo(childGfx);
+ });
+ });
+
+};
+
+GraphicsFactory.prototype.update = function(type, element, gfx) {
+
+ // Do not update root element
+ if (!element.parent) {
+ return;
+ }
+
+ var visual = this._clear(gfx);
+
+ // redraw
+ if (type === 'shape') {
+ this._renderer.drawShape(visual, element);
+
+ // update positioning
+ gfx.translate(element.x, element.y);
+ } else
+ if (type === 'connection') {
+ this._renderer.drawConnection(visual, element);
+ } else {
+ throw new Error('unknown type: ' + type);
+ }
+
+ gfx.attr('display', element.hidden ? 'none' : 'block');
+};
+
+
+GraphicsFactory.prototype.remove = function(element) {
+ var gfx = this._elementRegistry.getGraphics(element);
+
+ // remove
+ gfx.parent().remove();
+};
+
+},{"181":181,"60":60,"77":77,"81":81}],42:[function(_dereq_,module,exports){
+module.exports = {
+ __depends__: [ _dereq_(45) ],
+ __init__: [ 'canvas' ],
+ canvas: [ 'type', _dereq_(37) ],
+ elementRegistry: [ 'type', _dereq_(39) ],
+ elementFactory: [ 'type', _dereq_(38) ],
+ eventBus: [ 'type', _dereq_(40) ],
+ graphicsFactory: [ 'type', _dereq_(41) ]
+};
+},{"37":37,"38":38,"39":39,"40":40,"41":41,"45":45}],43:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(67);
+
+
+/**
+ * The default renderer used for shapes and connections.
+ *
+ * @param {Styles} styles
+ */
+function Renderer(styles) {
+ this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });
+ this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });
+}
+
+module.exports = Renderer;
+
+Renderer.$inject = ['styles'];
+
+
+Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
+ return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
+};
+
+Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
+ return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
+};
+
+function componentsToPath(components) {
+ return components.join(',').replace(/,?([A-z]),?/g, '$1');
+}
+
+/**
+ * Gets the default SVG path of a shape that represents it's visual bounds.
+ *
+ * @param {djs.model.Shape} shape
+ * @return {string} svg path
+ */
+Renderer.prototype.getShapePath = function getShapePath(shape) {
+
+ var x = shape.x,
+ y = shape.y,
+ width = shape.width,
+ height = shape.height;
+
+ var shapePath = [
+ ['M', x, y],
+ ['l', width, 0],
+ ['l', 0, height],
+ ['l', -width, 0],
+ ['z']
+ ];
+
+ return componentsToPath(shapePath);
+};
+
+/**
+ * Gets the default SVG path of a connection that represents it's visual bounds.
+ *
+ * @param {djs.model.Connection} connection
+ * @return {string} svg path
+ */
+Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
+ var waypoints = connection.waypoints;
+
+ var idx, point, connectionPath = [];
+
+ for (idx = 0; !!(point = waypoints[idx]); idx++) {
+
+ // take invisible docking into account
+ // when creating the path
+ point = point.original || point;
+
+ connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);
+ }
+
+ return componentsToPath(connectionPath);
+};
+
+
+function toSVGPoints(points) {
+ var result = '';
+
+ for (var i = 0, p; !!(p = points[i]); i++) {
+ result += p.x + ',' + p.y + ' ';
+ }
+
+ return result;
+}
+
+function createLine(points, attrs) {
+ return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});
+}
+
+function updateLine(gfx, points) {
+ return gfx.attr({ points: toSVGPoints(points) });
+}
+
+module.exports.createLine = createLine;
+module.exports.updateLine = updateLine;
+},{"67":67}],44:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(159),
+ assign = _dereq_(168),
+ reduce = _dereq_(81);
+
+
+/**
+ * A component that manages shape styles
+ */
+function Styles() {
+
+ var defaultTraits = {
+
+ 'no-fill': {
+ fill: 'none'
+ },
+ 'no-border': {
+ strokeOpacity: 0.0
+ },
+ 'no-events': {
+ pointerEvents: 'none'
+ }
+ };
+
+ /**
+ * Builds a style definition from a className, a list of traits and an object of additional attributes.
+ *
+ * @param {String} className
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.cls = function(className, traits, additionalAttrs) {
+ var attrs = this.style(traits, additionalAttrs);
+
+ return assign(attrs, { 'class': className });
+ };
+
+ /**
+ * Builds a style definition from a list of traits and an object of additional attributes.
+ *
+ * @param {Array<String>} traits
+ * @param {Object} additionalAttrs
+ *
+ * @return {Object} the style defintion
+ */
+ this.style = function(traits, additionalAttrs) {
+
+ if (!isArray(traits) && !additionalAttrs) {
+ additionalAttrs = traits;
+ traits = [];
+ }
+
+ var attrs = reduce(traits, function(attrs, t) {
+ return assign(attrs, defaultTraits[t] || {});
+ }, {});
+
+ return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
+ };
+}
+
+module.exports = Styles;
+},{"159":159,"168":168,"81":81}],45:[function(_dereq_,module,exports){
+module.exports = {
+ renderer: [ 'type', _dereq_(43) ],
+ styles: [ 'type', _dereq_(44) ]
+};
+},{"43":43,"44":44}],46:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(77),
+ domDelegate = _dereq_(182),
+ Renderer = _dereq_(43),
+ createLine = Renderer.createLine,
+ updateLine = Renderer.updateLine;
+
+
+var isPrimaryButton = _dereq_(62).isPrimaryButton;
+
+var Snap = _dereq_(67);
+
+/**
+ * A plugin that provides interaction events for diagram elements.
+ *
+ * It emits the following events:
+ *
+ * * element.hover
+ * * element.out
+ * * element.click
+ * * element.dblclick
+ * * element.mousedown
+ *
+ * Each event is a tuple { element, gfx, originalEvent }.
+ *
+ * Canceling the event via Event#preventDefault() prevents the original DOM operation.
+ *
+ * @param {EventBus} eventBus
+ */
+function InteractionEvents(eventBus, elementRegistry, styles) {
+
+ var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {
+ stroke: 'white',
+ strokeWidth: 15
+ });
+
+ function fire(type, event) {
+ var target = event.delegateTarget || event.target,
+ gfx = target && new Snap(target),
+ element = elementRegistry.get(gfx),
+ returnValue;
+
+ if (!gfx || !element) {
+ return;
+ }
+
+ returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });
+
+ if (returnValue === false) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }
+
+ var handlers = {};
+
+ function mouseHandler(type) {
+
+ var fn = handlers[type];
+
+ if (!fn) {
+ fn = handlers[type] = function(event) {
+ // only indicate left mouse button interactions
+ if (isPrimaryButton(event)) {
+ fire(type, event);
+ }
+ };
+ }
+
+ return fn;
+ }
+
+ var bindings = {
+ mouseover: 'element.hover',
+ mouseout: 'element.out',
+ click: 'element.click',
+ dblclick: 'element.dblclick',
+ mousedown: 'element.mousedown',
+ mouseup: 'element.mouseup'
+ };
+
+ var elementSelector = 'svg, .djs-element';
+
+ ///// event registration
+
+ function registerEvent(node, event, localEvent) {
+ var handler = mouseHandler(localEvent);
+ handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
+ }
+
+ function unregisterEvent(node, event, localEvent) {
+ domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
+ }
+
+ function registerEvents(svg) {
+ forEach(bindings, function(val, key) {
+ registerEvent(svg.node, key, val);
+ });
+ }
+
+ function unregisterEvents(svg) {
+ forEach(bindings, function(val, key) {
+ unregisterEvent(svg.node, key, val);
+ });
+ }
+
+ eventBus.on('canvas.destroy', function(event) {
+ unregisterEvents(event.svg);
+ });
+
+ eventBus.on('canvas.init', function(event) {
+ registerEvents(event.svg);
+ });
+
+
+ eventBus.on([ 'shape.added', 'connection.added' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx,
+ hit,
+ type;
+
+ if (element.waypoints) {
+ hit = createLine(element.waypoints);
+ type = 'connection';
+ } else {
+ hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });
+ type = 'shape';
+ }
+
+ hit.attr(HIT_STYLE).appendTo(gfx.node);
+ });
+
+ // update djs-hit on change
+
+ eventBus.on('shape.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ hit.attr({
+ width: element.width,
+ height: element.height
+ });
+ });
+
+ eventBus.on('connection.changed', function(event) {
+
+ var element = event.element,
+ gfx = event.gfx,
+ hit = gfx.select('.djs-hit');
+
+ updateLine(hit, element.waypoints);
+ });
+
+
+ // API
+
+ this.fire = fire;
+
+ this.mouseHandler = mouseHandler;
+
+ this.registerEvent = registerEvent;
+ this.unregisterEvent = unregisterEvent;
+}
+
+
+InteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];
+
+module.exports = InteractionEvents;
+
+
+/**
+ * An event indicating that the mouse hovered over an element
+ *
+ * @event element.hover
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has left an element
+ *
+ * @event element.out
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has clicked an element
+ *
+ * @event element.click
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has double clicked an element
+ *
+ * @event element.dblclick
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone down on an element.
+ *
+ * @event element.mousedown
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+
+/**
+ * An event indicating that the mouse has gone up on an element.
+ *
+ * @event element.mouseup
+ *
+ * @type {Object}
+ * @property {djs.model.Base} element
+ * @property {Snap<Element>} gfx
+ * @property {Event} originalEvent
+ */
+},{"182":182,"43":43,"62":62,"67":67,"77":77}],47:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'interactionEvents' ],
+ interactionEvents: [ 'type', _dereq_(46) ]
+};
+},{"46":46}],48:[function(_dereq_,module,exports){
+'use strict';
+
+var Snap = _dereq_(67);
+var getBBox = _dereq_(58).getBBox;
+
+
+/**
+ * @class
+ *
+ * A plugin that adds an outline to shapes and connections that may be activated and styled
+ * via CSS classes.
+ *
+ * @param {EventBus} events the event bus
+ */
+function Outline(eventBus, styles, elementRegistry) {
+
+ var OUTLINE_OFFSET = 6;
+
+ var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
+
+ function createOutline(gfx, bounds) {
+ return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
+ }
+
+ function updateShapeOutline(outline, bounds) {
+
+ outline.attr({
+ x: -OUTLINE_OFFSET,
+ y: -OUTLINE_OFFSET,
+ width: bounds.width + OUTLINE_OFFSET * 2,
+ height: bounds.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ function updateConnectionOutline(outline, connection) {
+
+ var bbox = getBBox(connection);
+
+ outline.attr({
+ x: bbox.x - OUTLINE_OFFSET,
+ y: bbox.y - OUTLINE_OFFSET,
+ width: bbox.width + OUTLINE_OFFSET * 2,
+ height: bbox.height + OUTLINE_OFFSET * 2
+ });
+ }
+
+ eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateShapeOutline(outline, element);
+ });
+
+ eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {
+ var element = event.element,
+ gfx = event.gfx;
+
+ var outline = gfx.select('.djs-outline');
+
+ if (!outline) {
+ outline = createOutline(gfx, element);
+ }
+
+ updateConnectionOutline(outline, element);
+ });
+
+
+}
+
+
+Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
+
+module.exports = Outline;
+
+},{"58":58,"67":67}],49:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports = {
+ __init__: [ 'outline' ],
+ outline: [ 'type', _dereq_(48) ]
+};
+},{"48":48}],50:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(159),
+ isString = _dereq_(165),
+ isObject = _dereq_(163),
+ assign = _dereq_(168),
+ forEach = _dereq_(77),
+ filter = _dereq_(75),
+ debounce = _dereq_(84);
+
+var domify = _dereq_(183),
+ domClasses = _dereq_(180),
+ domRemove = _dereq_(185);
+
+var getBBox = _dereq_(58).getBBox;
+
+// document wide unique overlay ids
+var ids = new (_dereq_(61))('ov');
+
+
+function createRoot(parent) {
+ var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
+ parent.insertBefore(root, parent.firstChild);
+
+ return root;
+}
+
+
+function setPosition(el, x, y) {
+ assign(el.style, { left: x + 'px', top: y + 'px' });
+}
+
+function setVisible(el, visible) {
+ el.style.display = visible === false ? 'none' : '';
+}
+
+/**
+ * A service that allows users to attach overlays to diagram elements.
+ *
+ * The overlay service will take care of overlay positioning during updates.
+ *
+ * @example
+ *
+ * // add a pink badge on the top left of the shape
+ * overlays.add(someShape, {
+ * position: {
+ * top: -5,
+ * left: -5
+ * },
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add via shape id
+ *
+ * overlays.add('some-element-id', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ * // or add with optional type
+ *
+ * overlays.add(someShape, 'badge', {
+ * position: {
+ * top: -5,
+ * left: -5
+ * }
+ * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>'
+ * });
+ *
+ *
+ * // remove an overlay
+ *
+ * var id = overlays.add(...);
+ * overlays.remove(id);
+ *
+ * @param {EventBus} eventBus
+ * @param {Canvas} canvas
+ * @param {ElementRegistry} elementRegistry
+ */
+function Overlays(config, eventBus, canvas, elementRegistry) {
+
+ this._eventBus = eventBus;
+ this._canvas = canvas;
+ this._elementRegistry = elementRegistry;
+
+ this._ids = ids;
+
+ this._overlayDefaults = {
+ show: {
+ minZoom: 0.7,
+ maxZoom: 5.0
+ }
+ };
+
+ /**
+ * Mapping overlayId -> overlay
+ */
+ this._overlays = {};
+
+ /**
+ * Mapping elementId -> overlay container
+ */
+ this._overlayContainers = {};
+
+ // root html element for all overlays
+ this._overlayRoot = createRoot(canvas.getContainer());
+
+ this._init(config);
+}
+
+
+Overlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];
+
+module.exports = Overlays;
+
+
+/**
+ * Returns the overlay with the specified id or a list of overlays
+ * for an element with a given type.
+ *
+ * @example
+ *
+ * // return the single overlay with the given id
+ * overlays.get('some-id');
+ *
+ * // return all overlays for the shape
+ * overlays.get({ element: someShape });
+ *
+ * // return all overlays on shape with type 'badge'
+ * overlays.get({ element: someShape, type: 'badge' });
+ *
+ * // shape can also be specified as id
+ * overlays.get({ element: 'element-id', type: 'badge' });
+ *
+ *
+ * @param {Object} search
+ * @param {String} [search.id]
+ * @param {String|djs.model.Base} [search.element]
+ * @param {String} [search.type]
+ *
+ * @return {Object|Array<Object>} the overlay(s)
+ */
+Overlays.prototype.get = function(search) {
+
+ if (isString(search)) {
+ search = { id: search };
+ }
+
+ if (search.element) {
+ var container = this._getOverlayContainer(search.element, true);
+
+ // return a list of overlays when searching by element (+type)
+ if (container) {
+ return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();
+ } else {
+ return [];
+ }
+ } else
+ if (search.type) {
+ return filter(this._overlays, { type: search.type });
+ } else {
+ // return single element when searching by id
+ return search.id ? this._overlays[search.id] : null;
+ }
+};
+
+/**
+ * Adds a HTML overlay to an element.
+ *
+ * @param {String|djs.model.Base} element attach overlay to this shape
+ * @param {String} [type] optional type to assign to the overlay
+ * @param {Object} overlay the overlay configuration
+ *
+ * @param {String|DOMElement} overlay.html html element to use as an overlay
+ * @param {Object} [overlay.show] show configuration
+ * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay
+ * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay
+ * @param {Object} overlay.position where to attach the overlay
+ * @param {Number} [overlay.position.left] relative to element bbox left attachment
+ * @param {Number} [overlay.position.top] relative to element bbox top attachment
+ * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment
+ * @param {Number} [overlay.position.right] relative to element bbox right attachment
+ *
+ * @return {String} id that may be used to reference the overlay for update or removal
+ */
+Overlays.prototype.add = function(element, type, overlay) {
+
+ if (isObject(type)) {
+ overlay = type;
+ type = null;
+ }
+
+ if (!element.id) {
+ element = this._elementRegistry.get(element);
+ }
+
+ if (!overlay.position) {
+ throw new Error('must specifiy overlay position');
+ }
+
+ if (!overlay.html) {
+ throw new Error('must specifiy overlay html');
+ }
+
+ if (!element) {
+ throw new Error('invalid element specified');
+ }
+
+ var id = this._ids.next();
+
+ overlay = assign({}, this._overlayDefaults, overlay, {
+ id: id,
+ type: type,
+ element: element,
+ html: overlay.html
+ });
+
+ this._addOverlay(overlay);
+
+ return id;
+};
+
+
+/**
+ * Remove an overlay with the given id or all overlays matching the given filter.
+ *
+ * @see Overlays#get for filter options.
+ *
+ * @param {String} [id]
+ * @param {Object} [filter]
+ */
+Overlays.prototype.remove = function(filter) {
+
+ var overlays = this.get(filter) || [];
+
+ if (!isArray(overlays)) {
+ overlays = [ overlays ];
+ }
+
+ var self = this;
+
+ forEach(overlays, function(overlay) {
+
+ var container = self._getOverlayContainer(overlay.element, true);
+
+ if (overlay) {
+ domRemove(overlay.html);
+ domRemove(overlay.htmlContainer);
+
+ delete overlay.htmlContainer;
+ delete overlay.element;
+
+ delete self._overlays[overlay.id];
+ }
+
+ if (container) {
+ var idx = container.overlays.indexOf(overlay);
+ if (idx !== -1) {
+ container.overlays.splice(idx, 1);
+ }
+ }
+ });
+
+};
+
+
+Overlays.prototype.show = function() {
+ setVisible(this._overlayRoot);
+};
+
+
+Overlays.prototype.hide = function() {
+ setVisible(this._overlayRoot, false);
+};
+
+
+Overlays.prototype._updateOverlayContainer = function(container) {
+ var element = container.element,
+ html = container.html;
+
+ // update container left,top according to the elements x,y coordinates
+ // this ensures we can attach child elements relative to this container
+
+ var x = element.x,
+ y = element.y;
+
+ if (element.waypoints) {
+ var bbox = getBBox(element);
+ x = bbox.x;
+ y = bbox.y;
+ }
+
+ setPosition(html, x, y);
+};
+
+
+Overlays.prototype._updateOverlay = function(overlay) {
+
+ var position = overlay.position,
+ htmlContainer = overlay.htmlContainer,
+ element = overlay.element;
+
+ // update overlay html relative to shape because
+ // it is already positioned on the element
+
+ // update relative
+ var left = position.left,
+ top = position.top;
+
+ if (position.right !== undefined) {
+
+ var width;
+
+ if (element.waypoints) {
+ width = getBBox(element).width;
+ } else {
+ width = element.width;
+ }
+
+ left = position.right * -1 + width;
+ }
+
+ if (position.bottom !== undefined) {
+
+ var height;
+
+ if (element.waypoints) {
+ height = getBBox(element).height;
+ } else {
+ height = element.height;
+ }
+
+ top = position.bottom * -1 + height;
+ }
+
+ setPosition(htmlContainer, left || 0, top || 0);
+};
+
+
+Overlays.prototype._createOverlayContainer = function(element) {
+ var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
+
+ this._overlayRoot.appendChild(html);
+
+ var container = {
+ html: html,
+ element: element,
+ overlays: []
+ };
+
+ this._updateOverlayContainer(container);
+
+ return container;
+};
+
+
+Overlays.prototype._updateRoot = function(viewbox) {
+ var a = viewbox.scale || 1;
+ var d = viewbox.scale || 1;
+
+ var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
+
+ this._overlayRoot.style.transform = matrix;
+ this._overlayRoot.style['-ms-transform'] = matrix;
+};
+
+
+Overlays.prototype._getOverlayContainer = function(element, raw) {
+ var id = (element && element.id) || element;
+
+ var container = this._overlayContainers[id];
+ if (!container && !raw) {
+ container = this._overlayContainers[id] = this._createOverlayContainer(element);
+ }
+
+ return container;
+};
+
+
+Overlays.prototype._addOverlay = function(overlay) {
+
+ var id = overlay.id,
+ element = overlay.element,
+ html = overlay.html,
+ htmlContainer,
+ overlayContainer;
+
+ // unwrap jquery (for those who need it)
+ if (html.get) {
+ html = html.get(0);
+ }
+
+ // create proper html elements from
+ // overlay HTML strings
+ if (isString(html)) {
+ html = domify(html);
+ }
+
+ overlayContainer = this._getOverlayContainer(element);
+
+ htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
+
+ htmlContainer.appendChild(html);
+
+ if (overlay.type) {
+ domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
+ }
+
+ overlay.htmlContainer = htmlContainer;
+
+ overlayContainer.overlays.push(overlay);
+ overlayContainer.html.appendChild(htmlContainer);
+
+ this._overlays[id] = overlay;
+
+ this._updateOverlay(overlay);
+};
+
+Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
+
+ forEach(this._overlays, function(overlay) {
+ var show = overlay.show,
+ htmlContainer = overlay.htmlContainer,
+ visible = true;
+
+ if (show) {
+ if (show.minZoom > viewbox.scale ||
+ show.maxZoom < viewbox.scale) {
+ visible = false;
+ }
+
+ setVisible(htmlContainer, visible);
+ }
+ });
+};
+
+Overlays.prototype._init = function(config) {
+
+ var eventBus = this._eventBus;
+
+ var self = this;
+
+
+ // scroll/zoom integration
+
+ var updateViewbox = function(viewbox) {
+ self._updateRoot(viewbox);
+ self._updateOverlayVisibilty(viewbox);
+
+ self.show();
+ };
+
+ if (!config || config.deferUpdate !== false) {
+ updateViewbox = debounce(updateViewbox, 300);
+ }
+
+ eventBus.on('canvas.viewbox.changed', function(event) {
+ self.hide();
+ updateViewbox(event.viewbox);
+ });
+
+
+ // remove integration
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var overlays = self.get({ element: e.element });
+
+ forEach(overlays, function(o) {
+ self.remove(o.id);
+ });
+ });
+
+
+ // move integration
+
+ eventBus.on([
+ 'element.changed'
+ ], function(e) {
+ var element = e.element;
+
+ var container = self._getOverlayContainer(element, true);
+
+ if (container) {
+ forEach(container.overlays, function(overlay) {
+ self._updateOverlay(overlay);
+ });
+
+ self._updateOverlayContainer(container);
+ }
+ });
+
+
+ // marker integration, simply add them on the overlays as classes, too.
+
+ eventBus.on('element.marker.update', function(e) {
+ var container = self._getOverlayContainer(e.element, true);
+ if (container) {
+ domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
+ }
+ });
+};
+
+},{"159":159,"163":163,"165":165,"168":168,"180":180,"183":183,"185":185,"58":58,"61":61,"75":75,"77":77,"84":84}],51:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'overlays' ],
+ overlays: [ 'type', _dereq_(50) ]
+};
+},{"50":50}],52:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(159),
+ forEach = _dereq_(77);
+
+
+/**
+ * A service that offers the current selection in a diagram.
+ * Offers the api to control the selection, too.
+ *
+ * @class
+ *
+ * @param {EventBus} eventBus the event bus
+ */
+function Selection(eventBus) {
+
+ this._eventBus = eventBus;
+
+ this._selectedElements = [];
+
+ var self = this;
+
+ eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {
+ var element = e.element;
+ self.deselect(element);
+ });
+}
+
+Selection.$inject = [ 'eventBus' ];
+
+module.exports = Selection;
+
+
+Selection.prototype.deselect = function(element) {
+ var selectedElements = this._selectedElements;
+
+ var idx = selectedElements.indexOf(element);
+
+ if (idx !== -1) {
+ var oldSelection = selectedElements.slice();
+
+ selectedElements.splice(idx, 1);
+
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+ }
+};
+
+
+Selection.prototype.get = function() {
+ return this._selectedElements;
+};
+
+Selection.prototype.isSelected = function(element) {
+ return this._selectedElements.indexOf(element) !== -1;
+};
+
+
+/**
+ * This method selects one or more elements on the diagram.
+ *
+ * By passing an additional add parameter you can decide whether or not the element(s)
+ * should be added to the already existing selection or not.
+ *
+ * @method Selection#select
+ *
+ * @param {Object|Object[]} elements element or array of elements to be selected
+ * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false
+ */
+Selection.prototype.select = function(elements, add) {
+ var selectedElements = this._selectedElements,
+ oldSelection = selectedElements.slice();
+
+ if (!isArray(elements)) {
+ elements = elements ? [ elements ] : [];
+ }
+
+ // selection may be cleared by passing an empty array or null
+ // to the method
+ if (add) {
+ forEach(elements, function(element) {
+ if (selectedElements.indexOf(element) !== -1) {
+ // already selected
+ return;
+ } else {
+ selectedElements.push(element);
+ }
+ });
+ } else {
+ this._selectedElements = selectedElements = elements.slice();
+ }
+ this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });
+};
+
+},{"159":159,"77":77}],53:[function(_dereq_,module,exports){
+'use strict';
+
+var hasPrimaryModifier = _dereq_(62).hasPrimaryModifier;
+
+
+function SelectionBehavior(eventBus, selection, canvas) {
+
+ eventBus.on('create.end', 500, function(e) {
+ if (e.context.canExecute) {
+ selection.select(e.shape);
+ }
+ });
+
+ eventBus.on('connect.end', 500, function(e) {
+ if (e.context.canExecute && e.context.target) {
+ selection.select(e.context.target);
+ }
+ });
+
+ eventBus.on('shape.move.end', 500, function(e) {
+ selection.select(e.context.shapes);
+ });
+
+
+ // Shift + click selection
+ eventBus.on('element.click', function(event) {
+
+ var element = event.element;
+
+ // do not select the root element
+ // or connections
+ if (element === canvas.getRootElement()) {
+ element = null;
+ }
+
+ var isSelected = selection.isSelected(element),
+ isMultiSelect = selection.get().length > 1;
+
+ // mouse-event: SELECTION_KEY
+ var add = hasPrimaryModifier(event);
+
+ // select OR deselect element in multi selection
+ if (isSelected && isMultiSelect) {
+ if (add) {
+ return selection.deselect(element);
+ } else {
+ return selection.select(element);
+ }
+ } else
+ if (!isSelected) {
+ selection.select(element, add);
+ } else {
+ selection.deselect(element);
+ }
+ });
+}
+
+SelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];
+
+module.exports = SelectionBehavior;
+
+},{"62":62}],54:[function(_dereq_,module,exports){
+'use strict';
+
+var forEach = _dereq_(77);
+
+var MARKER_HOVER = 'hover',
+ MARKER_SELECTED = 'selected';
+
+
+/**
+ * A plugin that adds a visible selection UI to shapes and connections
+ * by appending the <code>hover</code> and <code>selected</code> classes to them.
+ *
+ * @class
+ *
+ * Makes elements selectable, too.
+ *
+ * @param {EventBus} events
+ * @param {SelectionService} selection
+ * @param {Canvas} canvas
+ */
+function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
+
+ this._multiSelectionBox = null;
+
+ function addMarker(e, cls) {
+ canvas.addMarker(e, cls);
+ }
+
+ function removeMarker(e, cls) {
+ canvas.removeMarker(e, cls);
+ }
+
+ events.on('element.hover', function(event) {
+ addMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('element.out', function(event) {
+ removeMarker(event.element, MARKER_HOVER);
+ });
+
+ events.on('selection.changed', function(event) {
+
+ function deselect(s) {
+ removeMarker(s, MARKER_SELECTED);
+ }
+
+ function select(s) {
+ addMarker(s, MARKER_SELECTED);
+ }
+
+ var oldSelection = event.oldSelection,
+ newSelection = event.newSelection;
+
+ forEach(oldSelection, function(e) {
+ if (newSelection.indexOf(e) === -1) {
+ deselect(e);
+ }
+ });
+
+ forEach(newSelection, function(e) {
+ if (oldSelection.indexOf(e) === -1) {
+ select(e);
+ }
+ });
+ });
+}
+
+SelectionVisuals.$inject = [
+ 'eventBus',
+ 'canvas',
+ 'selection',
+ 'graphicsFactory',
+ 'styles'
+];
+
+module.exports = SelectionVisuals;
+
+},{"77":77}],55:[function(_dereq_,module,exports){
+module.exports = {
+ __init__: [ 'selectionVisuals', 'selectionBehavior' ],
+ __depends__: [
+ _dereq_(47),
+ _dereq_(49)
+ ],
+ selection: [ 'type', _dereq_(52) ],
+ selectionVisuals: [ 'type', _dereq_(54) ],
+ selectionBehavior: [ 'type', _dereq_(53) ]
+};
+
+},{"47":47,"49":49,"52":52,"53":53,"54":54}],56:[function(_dereq_,module,exports){
+'use strict';
+
+var assign = _dereq_(168),
+ inherits = _dereq_(72);
+
+var Refs = _dereq_(194);
+
+var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
+ labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),
+ outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),
+ incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });
+
+/**
+ * @namespace djs.model
+ */
+
+/**
+ * @memberOf djs.model
+ */
+
+/**
+ * The basic graphical representation
+ *
+ * @class
+ *
+ * @abstract
+ */
+function Base() {
+
+ /**
+ * The object that backs up the shape
+ *
+ * @name Base#businessObject
+ * @type Object
+ */
+ Object.defineProperty(this, 'businessObject', {
+ writable: true
+ });
+
+ /**
+ * The parent shape
+ *
+ * @name Base#parent
+ * @type Shape
+ */
+ parentRefs.bind(this, 'parent');
+
+ /**
+ * @name Base#label
+ * @type Label
+ */
+ labelRefs.bind(this, 'label');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#outgoing
+ * @type Array<Connection>
+ */
+ outgoingRefs.bind(this, 'outgoing');
+
+ /**
+ * The list of outgoing connections
+ *
+ * @name Base#incoming
+ * @type Array<Connection>
+ */
+ incomingRefs.bind(this, 'incoming');
+}
+
+
+/**
+ * A graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Shape() {
+ Base.call(this);
+
+ /**
+ * The list of children
+ *
+ * @name Shape#children
+ * @type Array<Base>
+ */
+ parentRefs.bind(this, 'children');
+}
+
+inherits(Shape, Base);
+
+
+/**
+ * A root graphical object
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Root() {
+ Shape.call(this);
+}
+
+inherits(Root, Shape);
+
+
+/**
+ * A label for an element
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Shape
+ */
+function Label() {
+ Shape.call(this);
+
+ /**
+ * The labeled element
+ *
+ * @name Label#labelTarget
+ * @type Base
+ */
+ labelRefs.bind(this, 'labelTarget');
+}
+
+inherits(Label, Shape);
+
+
+/**
+ * A connection between two elements
+ *
+ * @class
+ * @constructor
+ *
+ * @extends Base
+ */
+function Connection() {
+ Base.call(this);
+
+ /**
+ * The element this connection originates from
+ *
+ * @name Connection#source
+ * @type Base
+ */
+ outgoingRefs.bind(this, 'source');
+
+ /**
+ * The element this connection points to
+ *
+ * @name Connection#target
+ * @type Base
+ */
+ incomingRefs.bind(this, 'target');
+}
+
+inherits(Connection, Base);
+
+
+var types = {
+ connection: Connection,
+ shape: Shape,
+ label: Label,
+ root: Root
+};
+
+/**
+ * Creates a new model element of the specified type
+ *
+ * @method create
+ *
+ * @example
+ *
+ * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });
+ * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });
+ *
+ * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });
+ *
+ * @param {String} type lower-cased model name
+ * @param {Object} attrs attributes to initialize the new model instance with
+ *
+ * @return {Base} the new model instance
+ */
+module.exports.create = function(type, attrs) {
+ var Type = types[type];
+ if (!Type) {
+ throw new Error('unknown type: <' + type + '>');
+ }
+ return assign(new Type(), attrs);
+};
+
+
+module.exports.Base = Base;
+module.exports.Root = Root;
+module.exports.Shape = Shape;
+module.exports.Connection = Connection;
+module.exports.Label = Label;
+},{"168":168,"194":194,"72":72}],57:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Failsafe remove an element from a collection
+ *
+ * @param {Array<Object>} [collection]
+ * @param {Object} [element]
+ *
+ * @return {Object} the element that got removed or undefined
+ */
+module.exports.remove = function(collection, element) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ var idx = collection.indexOf(element);
+ if (idx === -1) {
+ return;
+ }
+
+ collection.splice(idx, 1);
+
+ return element;
+};
+
+/**
+ * Fail save add an element to the given connection, ensuring
+ * it does not yet exist.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ * @param {Number} idx
+ */
+module.exports.add = function(collection, element, idx) {
+
+ if (!collection || !element) {
+ return;
+ }
+
+ if (isNaN(idx)) {
+ idx = -1;
+ }
+
+ var currentIdx = collection.indexOf(element);
+
+ if (currentIdx !== -1) {
+
+ if (currentIdx === idx) {
+ // nothing to do, position has not changed
+ return;
+ } else {
+
+ if (idx !== -1) {
+ // remove from current position
+ collection.splice(currentIdx, 1);
+ } else {
+ // already exists in collection
+ return;
+ }
+ }
+ }
+
+ if (idx !== -1) {
+ // insert at specified position
+ collection.splice(idx, 0, element);
+ } else {
+ // push to end
+ collection.push(element);
+ }
+};
+
+
+/**
+ * Fail get the index of an element in a collection.
+ *
+ * @param {Array<Object>} collection
+ * @param {Object} element
+ *
+ * @return {Number} the index or -1 if collection or element do
+ * not exist or the element is not contained.
+ */
+module.exports.indexOf = function(collection, element) {
+
+ if (!collection || !element) {
+ return -1;
+ }
+
+ return collection.indexOf(element);
+};
+
+},{}],58:[function(_dereq_,module,exports){
+'use strict';
+
+var isArray = _dereq_(159),
+ isNumber = _dereq_(162),
+ groupBy = _dereq_(78),
+ forEach = _dereq_(77);
+
+/**
+ * Adds an element to a collection and returns true if the
+ * element was added.
+ *
+ * @param {Array<Object>} elements
+ * @param {Object} e
+ * @param {Boolean} unique
+ */
+function add(elements, e, unique) {
+ var canAdd = !unique || elements.indexOf(e) === -1;
+
+ if (canAdd) {
+ elements.push(e);
+ }
+
+ return canAdd;
+}
+
+function eachElement(elements, fn, depth) {
+
+ depth = depth || 0;
+
+ forEach(elements, function(s, i) {
+ var filter = fn(s, i, depth);
+
+ if (isArray(filter) && filter.length) {
+ eachElement(filter, fn, depth + 1);
+ }
+ });
+}
+
+/**
+ * Collects self + child elements up to a given depth from a list of elements.
+ *
+ * @param {Array<djs.model.Base>} elements the elements to select the children from
+ * @param {Boolean} unique whether to return a unique result set (no duplicates)
+ * @param {Number} maxDepth the depth to search through or -1 for infinite
+ *
+ * @return {Array<djs.model.Base>} found elements
+ */
+function selfAndChildren(elements, unique, maxDepth) {
+ var result = [],
+ processedChildren = [];
+
+ eachElement(elements, function(element, i, depth) {
+ add(result, element, unique);
+
+ var children = element.children;
+
+ // max traversal depth not reached yet
+ if (maxDepth === -1 || depth < maxDepth) {
+
+ // children exist && children not yet processed
+ if (children && add(processedChildren, children, unique)) {
+ return children;
+ }
+ }
+ });
+
+ return result;
+}
+
+/**
+ * Return self + direct children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndDirectChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, 1);
+}
+
+/**
+ * Return self + ALL children for a number of elements
+ *
+ * @param {Array<djs.model.Base>} elements to query
+ * @param {Boolean} allowDuplicates to allow duplicates in the result set
+ *
+ * @return {Array<djs.model.Base>} the collected elements
+ */
+function selfAndAllChildren(elements, allowDuplicates) {
+ return selfAndChildren(elements, !allowDuplicates, -1);
+}
+
+/**
+ * Gets the the closure fo all selected elements,
+ * their connections and
+ *
+ * @param {Array<djs.model.Base>} elements
+ * @return {Object} enclosure
+ */
+function getClosure(elements) {
+
+ // original elements passed to this function
+ var topLevel = groupBy(elements, function(e) { return e.id; });
+
+ var allShapes = {},
+ allConnections = {},
+ enclosedElements = {},
+ enclosedConnections = {};
+
+ function handleConnection(c) {
+ if (topLevel[c.source.id] && topLevel[c.target.id]) {
+ topLevel[c.id] = c;
+ }
+
+ // not enclosed as a child, but maybe logically
+ // (connecting two moved elements?)
+ if (allShapes[c.source.id] && allShapes[c.target.id]) {
+ enclosedConnections[c.id] = enclosedElements[c.id] = c;
+ }
+
+ allConnections[c.id] = c;
+ }
+
+ function handleElement(element) {
+
+ enclosedElements[element.id] = element;
+
+ if (element.waypoints) {
+ // remember connection
+ enclosedConnections[element.id] = allConnections[element.id] = element;
+ } else {
+ // remember shape
+ allShapes[element.id] = element;
+
+ // remember all connections
+ forEach(element.incoming, handleConnection);
+
+ forEach(element.outgoing, handleConnection);
+
+ // recurse into children
+ return element.children;
+ }
+ }
+
+ eachElement(elements, handleElement);
+
+ return {
+ allShapes: allShapes,
+ allConnections: allConnections,
+ topLevel: topLevel,
+ enclosedConnections: enclosedConnections,
+ enclosedElements: enclosedElements
+ };
+}
+
+/**
+ * Returns the surrounding bbox for all elements in the array or the element primitive.
+ */
+function getBBox(elements, stopRecursion) {
+
+ stopRecursion = !!stopRecursion;
+ if (!isArray(elements)) {
+ elements = [elements];
+ }
+
+ var minX,
+ minY,
+ maxX,
+ maxY;
+
+ forEach(elements, function(element) {
+
+ // If element is a connection the bbox must be computed first
+ var bbox = element;
+ if (element.waypoints && !stopRecursion) {
+ bbox = getBBox(element.waypoints, true);
+ }
+
+ var x = bbox.x,
+ y = bbox.y,
+ height = bbox.height || 0,
+ width = bbox.width || 0;
+
+ if (x < minX || minX === undefined) {
+ minX = x;
+ }
+ if (y < minY || minY === undefined) {
+ minY = y;
+ }
+
+ if ((x + width) > maxX || maxX === undefined) {
+ maxX = x + width;
+ }
+ if ((y + height) > maxY || maxY === undefined) {
+ maxY = y + height;
+ }
+ });
+
+ return {
+ x: minX,
+ y: minY,
+ height: maxY - minY,
+ width: maxX - minX
+ };
+}
+
+
+/**
+ * Returns all elements that are enclosed from the bounding box.
+ *
+ * @param {Array<Object>} elements List of Elements to search through
+ * @param {Object} bbox the enclosing bbox.
+ * <ul>
+ * <li>If bbox.(width|height) is not specified
+ * the method returns all elements with element.x/y &gt; bbox.x/y
+ * </li>
+ * <li>If only bbox.x or bbox.y is specified, method return all elements with
+ * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
+ * </ul>
+ *
+ */
+function getEnclosedElements(elements, bbox) {
+
+ var filteredElements = {};
+
+ forEach(elements, function(element) {
+
+ var e = element;
+
+ if (e.waypoints) {
+ e = getBBox(e);
+ }
+
+ if (!isNumber(bbox.y) && (e.x > bbox.x)) {
+ filteredElements[element.id] = element;
+ }
+ if (!isNumber(bbox.x) && (e.y > bbox.y)) {
+ filteredElements[element.id] = element;
+ }
+ if (e.x > bbox.x && e.y > bbox.y) {
+ if (isNumber(bbox.width) && isNumber(bbox.height) &&
+ e.width + e.x < bbox.width + bbox.x &&
+ e.height + e.y < bbox.height + bbox.y) {
+
+ filteredElements[element.id] = element;
+ } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
+ filteredElements[element.id] = element;
+ }
+ }
+ });
+
+ return filteredElements;
+}
+
+
+
+module.exports.eachElement = eachElement;
+module.exports.selfAndDirectChildren = selfAndDirectChildren;
+module.exports.selfAndAllChildren = selfAndAllChildren;
+module.exports.getBBox = getBBox;
+module.exports.getEnclosedElements = getEnclosedElements;
+
+module.exports.getClosure = getClosure;
+
+},{"159":159,"162":162,"77":77,"78":78}],59:[function(_dereq_,module,exports){
+'use strict';
+
+function __preventDefault(event) {
+ return event && event.preventDefault();
+}
+
+function __stopPropagation(event, immediate) {
+ if (!event) {
+ return;
+ }
+
+ if (event.stopPropagation) {
+ event.stopPropagation();
+ }
+
+ if (immediate && event.stopImmediatePropagation) {
+ event.stopImmediatePropagation();
+ }
+}
+
+
+function getOriginal(event) {
+ return event.originalEvent || event.srcEvent;
+}
+
+module.exports.getOriginal = getOriginal;
+
+
+function stopEvent(event, immediate) {
+ stopPropagation(event, immediate);
+ preventDefault(event);
+}
+
+module.exports.stopEvent = stopEvent;
+
+
+function preventDefault(event) {
+ __preventDefault(event);
+ __preventDefault(getOriginal(event));
+}
+
+module.exports.preventDefault = preventDefault;
+
+
+function stopPropagation(event, immediate) {
+ __stopPropagation(event, immediate);
+ __stopPropagation(getOriginal(event), immediate);
+}
+
+module.exports.stopPropagation = stopPropagation;
+
+
+function toPoint(event) {
+
+ if (event.pointers && event.pointers.length) {
+ event = event.pointers[0];
+ }
+
+ if (event.touches && event.touches.length) {
+ event = event.touches[0];
+ }
+
+ return event ? {
+ x: event.clientX,
+ y: event.clientY
+ } : null;
+}
+
+module.exports.toPoint = toPoint;
+
+},{}],60:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * SVGs for elements are generated by the {@link GraphicsFactory}.
+ *
+ * This utility gives quick access to the important semantic
+ * parts of an element.
+ */
+
+/**
+ * Returns the visual part of a diagram element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Snap<SVGElement>}
+ */
+function getVisual(gfx) {
+ return gfx.select('.djs-visual');
+}
+
+/**
+ * Returns the children for a given diagram element.
+ *
+ * @param {Snap<SVGElement>} gfx
+ * @return {Snap<SVGElement>}
+ */
+function getChildren(gfx) {
+ return gfx.parent().children()[1];
+}
+
+/**
+ * Returns the visual bbox of an element
+ *
+ * @param {Snap<SVGElement>} gfx
+ *
+ * @return {Bounds}
+ */
+function getBBox(gfx) {
+ return getVisual(gfx).select('*').getBBox();
+}
+
+
+module.exports.getVisual = getVisual;
+module.exports.getChildren = getChildren;
+module.exports.getBBox = getBBox;
+},{}],61:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * Util that provides unique IDs.
+ *
+ * @class djs.util.IdGenerator
+ * @constructor
+ * @memberOf djs.util
+ *
+ * The ids can be customized via a given prefix and contain a random value to avoid collisions.
+ *
+ * @param {String} prefix a prefix to prepend to generated ids (for better readability)
+ */
+function IdGenerator(prefix) {
+
+ this._counter = 0;
+ this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
+}
+
+module.exports = IdGenerator;
+
+/**
+ * Returns a next unique ID.
+ *
+ * @method djs.util.IdGenerator#next
+ *
+ * @returns {String} the id
+ */
+IdGenerator.prototype.next = function() {
+ return this._prefix + (++this._counter);
+};
+
+},{}],62:[function(_dereq_,module,exports){
+'use strict';
+
+var getOriginalEvent = _dereq_(59).getOriginal;
+
+var isMac = _dereq_(63).isMac;
+
+
+function isPrimaryButton(event) {
+ // button === 0 -> left áka primary mouse button
+ return !(getOriginalEvent(event) || event).button;
+}
+
+module.exports.isPrimaryButton = isPrimaryButton;
+
+module.exports.isMac = isMac;
+
+module.exports.hasPrimaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ if (!isPrimaryButton(event)) {
+ return false;
+ }
+
+ // Use alt as primary modifier key for mac OS
+ if (isMac()) {
+ return originalEvent.altKey;
+ } else {
+ return originalEvent.ctrlKey;
+ }
+};
+
+
+module.exports.hasSecondaryModifier = function(event) {
+ var originalEvent = getOriginalEvent(event) || event;
+
+ return isPrimaryButton(event) && originalEvent.shiftKey;
+};
+
+},{"59":59,"63":63}],63:[function(_dereq_,module,exports){
+'use strict';
+
+module.exports.isMac = function isMac() {
+ return (/mac/i).test(navigator.platform);
+};
+},{}],64:[function(_dereq_,module,exports){
+'use strict';
+
+var isObject = _dereq_(163),
+ assign = _dereq_(168),
+ forEach = _dereq_(77),
+ reduce = _dereq_(81),
+ merge = _dereq_(171);
+
+var Snap = _dereq_(67);
+
+var DEFAULT_BOX_PADDING = 0;
+
+var DEFAULT_LABEL_SIZE = {
+ width: 150,
+ height: 50
+};
+
+
+function parseAlign(align) {
+
+ var parts = align.split('-');
+
+ return {
+ horizontal: parts[0] || 'center',
+ vertical: parts[1] || 'top'
+ };
+}
+
+function parsePadding(padding) {
+
+ if (isObject(padding)) {
+ return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
+ } else {
+ return {
+ top: padding,
+ left: padding,
+ right: padding,
+ bottom: padding
+ };
+ }
+}
+
+function getTextBBox(text, fakeText) {
+ fakeText.textContent = text;
+ return fakeText.getBBox();
+}
+
+
+/**
+ * Layout the next line and return the layouted element.
+ *
+ * Alters the lines passed.
+ *
+ * @param {Array<String>} lines
+ * @return {Object} the line descriptor, an object { width, height, text }
+ */
+function layoutNext(lines, maxWidth, fakeText) {
+
+ var originalLine = lines.shift(),
+ fitLine = originalLine;
+
+ var textBBox;
+
+ while (true) {
+ textBBox = getTextBBox(fitLine, fakeText);
+
+ textBBox.width = fitLine ? textBBox.width : 0;
+
+ // try to fit
+ if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
+ return fit(lines, fitLine, originalLine, textBBox);
+ }
+
+
+ fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
+ }
+}
+
+function fit(lines, fitLine, originalLine, textBBox) {
+ if (fitLine.length < originalLine.length) {
+ var nextLine = lines[0] || '',
+ remainder = originalLine.slice(fitLine.length).trim();
+
+ if (/-\s*$/.test(remainder)) {
+ nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
+ } else {
+ nextLine = remainder + ' ' + nextLine;
+ }
+
+ lines[0] = nextLine;
+ }
+ return { width: textBBox.width, height: textBBox.height, text: fitLine };
+}
+
+
+/**
+ * Shortens a line based on spacing and hyphens.
+ * Returns the shortened result on success.
+ *
+ * @param {String} line
+ * @param {Number} maxLength the maximum characters of the string
+ * @return {String} the shortened string
+ */
+function semanticShorten(line, maxLength) {
+ var parts = line.split(/(\s|-)/g),
+ part,
+ shortenedParts = [],
+ length = 0;
+
+ // try to shorten via spaces + hyphens
+ if (parts.length > 1) {
+ while ((part = parts.shift())) {
+ if (part.length + length < maxLength) {
+ shortenedParts.push(part);
+ length += part.length;
+ } else {
+ // remove previous part, too if hyphen does not fit anymore
+ if (part === '-') {
+ shortenedParts.pop();
+ }
+
+ break;
+ }
+ }
+ }
+
+ return shortenedParts.join('');
+}
+
+
+function shortenLine(line, width, maxWidth) {
+ var length = Math.max(line.length * (maxWidth / width), 1);
+
+ // try to shorten semantically (i.e. based on spaces and hyphens)
+ var shortenedLine = semanticShorten(line, length);
+
+ if (!shortenedLine) {
+
+ // force shorten by cutting the long word
+ shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
+ }
+
+ return shortenedLine;
+}
+
+
+/**
+ * Creates a new label utility
+ *
+ * @param {Object} config
+ * @param {Dimensions} config.size
+ * @param {Number} config.padding
+ * @param {Object} config.style
+ * @param {String} config.align
+ */
+function Text(config) {
+
+ this._config = assign({}, {
+ size: DEFAULT_LABEL_SIZE,
+ padding: DEFAULT_BOX_PADDING,
+ style: {},
+ align: 'center-top'
+ }, config || {});
+}
+
+
+/**
+ * Create a label in the parent node.
+ *
+ * @method Text#createText
+ *
+ * @param {SVGElement} parent the parent to draw the label on
+ * @param {String} text the text to render on the label
+ * @param {Object} options
+ * @param {String} options.align how to align in the bounding box.
+ * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.
+ * @param {String} options.style style to be applied to the text
+ *
+ * @return {SVGText} the text element created
+ */
+Text.prototype.createText = function(parent, text, options) {
+
+ var box = merge({}, this._config.size, options.box || {}),
+ style = merge({}, this._config.style, options.style || {}),
+ align = parseAlign(options.align || this._config.align),
+ padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
+
+ var lines = text.split(/\r?\n/g),
+ layouted = [];
+
+ var maxWidth = box.width - padding.left - padding.right;
+
+ // FF regression: ensure text is shown during rendering
+ // by attaching it directly to the body
+ var fakeText = parent.paper.text(0, 0, '').attr(style).node;
+
+ while (lines.length) {
+ layouted.push(layoutNext(lines, maxWidth, fakeText));
+ }
+
+ var totalHeight = reduce(layouted, function(sum, line, idx) {
+ return sum + line.height;
+ }, 0);
+
+ // the y position of the next line
+ var y, x;
+
+ switch (align.vertical) {
+ case 'middle':
+ y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
+ break;
+
+ default:
+ y = padding.top;
+ }
+
+ var textElement = parent.text().attr(style);
+
+ forEach(layouted, function(line) {
+ y += line.height;
+
+ switch (align.horizontal) {
+ case 'left':
+ x = padding.left;
+ break;
+
+ case 'right':
+ x = (maxWidth - padding.right - line.width);
+ break;
+
+ default:
+ // aka center
+ x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
+ }
+
+
+ var tspan = Snap.create('tspan', { x: x, y: y }).node;
+ tspan.textContent = line.text;
+
+ textElement.append(tspan);
+ });
+
+ // remove fake text
+ fakeText.parentNode.removeChild(fakeText);
+
+ return textElement;
+};
+
+
+module.exports = Text;
+},{"163":163,"168":168,"171":171,"67":67,"77":77,"81":81}],65:[function(_dereq_,module,exports){
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// ┌────────────────────────────────────────────────────────────┐ \\
+// │ Eve 0.4.2 - JavaScript Events Library │ \\
+// ├────────────────────────────────────────────────────────────┤ \\
+// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
+// └────────────────────────────────────────────────────────────┘ \\
+
+(function (glob) {
+ var version = "0.4.2",
+ has = "hasOwnProperty",
+ separator = /[\.\/]/,
+ comaseparator = /\s*,\s*/,
+ wildcard = "*",
+ fun = function () {},
+ numsort = function (a, b) {
+ return a - b;
+ },
+ current_event,
+ stop,
+ events = {n: {}},
+ firstDefined = function () {
+ for (var i = 0, ii = this.length; i < ii; i++) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ lastDefined = function () {
+ var i = this.length;
+ while (--i) {
+ if (typeof this[i] != "undefined") {
+ return this[i];
+ }
+ }
+ },
+ /*\
+ * eve
+ [ method ]
+
+ * Fires event with given `name`, given scope and other parameters.
+
+ > Arguments
+
+ - name (string) name of the *event*, dot (`.`) or slash (`/`) separated
+ - scope (object) context for the event handlers
+ - varargs (...) the rest of arguments will be sent to event handlers
+
+ = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
+ \*/
+ eve = function (name, scope) {
+ name = String(name);
+ var e = events,
+ oldstop = stop,
+ args = Array.prototype.slice.call(arguments, 2),
+ listeners = eve.listeners(name),
+ z = 0,
+ f = false,
+ l,
+ indexed = [],
+ queue = {},
+ out = [],
+ ce = current_event,
+ errors = [];
+ out.firstDefined = firstDefined;
+ out.lastDefined = lastDefined;
+ current_event = name;
+ stop = 0;
+ for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
+ indexed.push(listeners[i].zIndex);
+ if (listeners[i].zIndex < 0) {
+ queue[listeners[i].zIndex] = listeners[i];
+ }
+ }
+ indexed.sort(numsort);
+ while (indexed[z] < 0) {
+ l = queue[indexed[z++]];
+ out.push(l.apply(scope, args));
+ if (stop) {
+ stop = oldstop;
+ return out;
+ }
+ }
+ for (i = 0; i < ii; i++) {
+ l = listeners[i];
+ if ("zIndex" in l) {
+ if (l.zIndex == indexed[z]) {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ do {
+ z++;
+ l = queue[indexed[z]];
+ l && out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ } while (l)
+ } else {
+ queue[l.zIndex] = l;
+ }
+ } else {
+ out.push(l.apply(scope, args));
+ if (stop) {
+ break;
+ }
+ }
+ }
+ stop = oldstop;
+ current_event = ce;
+ return out;
+ };
+ // Undocumented. Debug only.
+ eve._events = events;
+ /*\
+ * eve.listeners
+ [ method ]
+
+ * Internal method which gives you array of all event handlers that will be triggered by the given `name`.
+
+ > Arguments
+
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated
+
+ = (array) array of event handlers
+ \*/
+ eve.listeners = function (name) {
+ var names = name.split(separator),
+ e = events,
+ item,
+ items,
+ k,
+ i,
+ ii,
+ j,
+ jj,
+ nes,
+ es = [e],
+ out = [];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ nes = [];
+ for (j = 0, jj = es.length; j < jj; j++) {
+ e = es[j].n;
+ items = [e[names[i]], e[wildcard]];
+ k = 2;
+ while (k--) {
+ item = items[k];
+ if (item) {
+ nes.push(item);
+ out = out.concat(item.f || []);
+ }
+ }
+ }
+ es = nes;
+ }
+ return out;
+ };
+
+ /*\
+ * eve.on
+ [ method ]
+ **
+ * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
+ | eve.on("*.under.*", f);
+ | eve("mouse.under.floor"); // triggers f
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
+ > Example:
+ | eve.on("mouse", eatIt)(2);
+ | eve.on("mouse", scream);
+ | eve.on("mouse", catchIt)(1);
+ * This will ensure that `catchIt` function will be called before `eatIt`.
+ *
+ * If you want to put your handler before non-indexed handlers, specify a negative value.
+ * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
+ \*/
+ eve.on = function (name, f) {
+ name = String(name);
+ if (typeof f != "function") {
+ return function () {};
+ }
+ var names = name.split(comaseparator);
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ (function (name) {
+ var names = name.split(separator),
+ e = events,
+ exist;
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ e = e.n;
+ e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
+ }
+ e.f = e.f || [];
+ for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
+ exist = true;
+ break;
+ }
+ !exist && e.f.push(f);
+ }(names[i]));
+ }
+ return function (zIndex) {
+ if (+zIndex == +zIndex) {
+ f.zIndex = +zIndex;
+ }
+ };
+ };
+ /*\
+ * eve.f
+ [ method ]
+ **
+ * Returns function that will fire given event with optional arguments.
+ * Arguments that will be passed to the result function will be also
+ * concated to the list of final arguments.
+ | el.onclick = eve.f("click", 1, 2);
+ | eve.on("click", function (a, b, c) {
+ | console.log(a, b, c); // 1, 2, [event object]
+ | });
+ > Arguments
+ - event (string) event name
+ - varargs (…) and any other arguments
+ = (function) possible event handler function
+ \*/
+ eve.f = function (event) {
+ var attrs = [].slice.call(arguments, 1);
+ return function () {
+ eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
+ };
+ };
+ /*\
+ * eve.stop
+ [ method ]
+ **
+ * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.
+ \*/
+ eve.stop = function () {
+ stop = 1;
+ };
+ /*\
+ * eve.nt
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ > Arguments
+ **
+ - subname (string) #optional subname of the event
+ **
+ = (string) name of the event, if `subname` is not specified
+ * or
+ = (boolean) `true`, if current event’s name contains `subname`
+ \*/
+ eve.nt = function (subname) {
+ if (subname) {
+ return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
+ }
+ return current_event;
+ };
+ /*\
+ * eve.nts
+ [ method ]
+ **
+ * Could be used inside event handler to figure out actual name of the event.
+ **
+ **
+ = (array) names of the event
+ \*/
+ eve.nts = function () {
+ return current_event.split(separator);
+ };
+ /*\
+ * eve.off
+ [ method ]
+ **
+ * Removes given function from the list of event listeners assigned to given name.
+ * If no arguments specified all the events will be cleared.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ \*/
+ /*\
+ * eve.unbind
+ [ method ]
+ **
+ * See @eve.off
+ \*/
+ eve.off = eve.unbind = function (name, f) {
+ if (!name) {
+ eve._events = events = {n: {}};
+ return;
+ }
+ var names = name.split(comaseparator);
+ if (names.length > 1) {
+ for (var i = 0, ii = names.length; i < ii; i++) {
+ eve.off(names[i], f);
+ }
+ return;
+ }
+ names = name.split(separator);
+ var e,
+ key,
+ splice,
+ i, ii, j, jj,
+ cur = [events];
+ for (i = 0, ii = names.length; i < ii; i++) {
+ for (j = 0; j < cur.length; j += splice.length - 2) {
+ splice = [j, 1];
+ e = cur[j].n;
+ if (names[i] != wildcard) {
+ if (e[names[i]]) {
+ splice.push(e[names[i]]);
+ }
+ } else {
+ for (key in e) if (e[has](key)) {
+ splice.push(e[key]);
+ }
+ }
+ cur.splice.apply(cur, splice);
+ }
+ }
+ for (i = 0, ii = cur.length; i < ii; i++) {
+ e = cur[i];
+ while (e.n) {
+ if (f) {
+ if (e.f) {
+ for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {
+ e.f.splice(j, 1);
+ break;
+ }
+ !e.f.length && delete e.f;
+ }
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ var funcs = e.n[key].f;
+ for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {
+ funcs.splice(j, 1);
+ break;
+ }
+ !funcs.length && delete e.n[key].f;
+ }
+ } else {
+ delete e.f;
+ for (key in e.n) if (e.n[has](key) && e.n[key].f) {
+ delete e.n[key].f;
+ }
+ }
+ e = e.n;
+ }
+ }
+ };
+ /*\
+ * eve.once
+ [ method ]
+ **
+ * Binds given event handler with a given name to only run once then unbind itself.
+ | eve.once("login", f);
+ | eve("login"); // triggers f
+ | eve("login"); // no listeners
+ * Use @eve to trigger the listener.
+ **
+ > Arguments
+ **
+ - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
+ - f (function) event handler function
+ **
+ = (function) same return function as @eve.on
+ \*/
+ eve.once = function (name, f) {
+ var f2 = function () {
+ eve.unbind(name, f2);
+ return f.apply(this, arguments);
+ };
+ return eve.on(name, f2);
+ };
+ /*\
+ * eve.version
+ [ property (string) ]
+ **
+ * Current version of the library.
+ \*/
+ eve.version = version;
+ eve.toString = function () {
+ return "You are running Eve " + version;
+ };
+ (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() { return eve; })) : (glob.eve = eve));
+})(this);
+
+},{}],66:[function(_dereq_,module,exports){
+// Snap.svg 0.3.0
+//
+// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// build: 2014-09-08
+
+(function (glob, factory) {
+ // AMD support
+ if (typeof define === "function" && define.amd) {
+ // Define as an anonymous module
+ define(["eve"], function( eve ) {
+ return factory(glob, eve);
+ });
+ } else if (typeof exports !== 'undefined') {
+ // Next for Node.js or CommonJS
+ var eve = _dereq_(65);
+ module.exports = factory(glob, eve);
+ } else {
+ // Browser globals (glob is window)
+ // Snap adds itself to window
+ factory(glob, glob.eve);
+ }
+}(window || this, function (window, eve) {
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+var mina = (function (eve) {
+ var animations = {},
+ requestAnimFrame = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function (callback) {
+ setTimeout(callback, 16);
+ },
+ isArray = Array.isArray || function (a) {
+ return a instanceof Array ||
+ Object.prototype.toString.call(a) == "[object Array]";
+ },
+ idgen = 0,
+ idprefix = "M" + (+new Date).toString(36),
+ ID = function () {
+ return idprefix + (idgen++).toString(36);
+ },
+ diff = function (a, b, A, B) {
+ if (isArray(a)) {
+ res = [];
+ for (var i = 0, ii = a.length; i < ii; i++) {
+ res[i] = diff(a[i], b, A[i], B);
+ }
+ return res;
+ }
+ var dif = (A - a) / (B - b);
+ return function (bb) {
+ return a + dif * (bb - b);
+ };
+ },
+ timer = Date.now || function () {
+ return +new Date;
+ },
+ sta = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.s;
+ }
+ var ds = a.s - val;
+ a.b += a.dur * ds;
+ a.B += a.dur * ds;
+ a.s = val;
+ },
+ speed = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.spd;
+ }
+ a.spd = val;
+ },
+ duration = function (val) {
+ var a = this;
+ if (val == null) {
+ return a.dur;
+ }
+ a.s = a.s * val / a.dur;
+ a.dur = val;
+ },
+ stopit = function () {
+ var a = this;
+ delete animations[a.id];
+ a.update();
+ eve("mina.stop." + a.id, a);
+ },
+ pause = function () {
+ var a = this;
+ if (a.pdif) {
+ return;
+ }
+ delete animations[a.id];
+ a.update();
+ a.pdif = a.get() - a.b;
+ },
+ resume = function () {
+ var a = this;
+ if (!a.pdif) {
+ return;
+ }
+ a.b = a.get() - a.pdif;
+ delete a.pdif;
+ animations[a.id] = a;
+ },
+ update = function () {
+ var a = this,
+ res;
+ if (isArray(a.start)) {
+ res = [];
+ for (var j = 0, jj = a.start.length; j < jj; j++) {
+ res[j] = +a.start[j] +
+ (a.end[j] - a.start[j]) * a.easing(a.s);
+ }
+ } else {
+ res = +a.start + (a.end - a.start) * a.easing(a.s);
+ }
+ a.set(res);
+ },
+ frame = function () {
+ var len = 0;
+ for (var i in animations) if (animations.hasOwnProperty(i)) {
+ var a = animations[i],
+ b = a.get(),
+ res;
+ len++;
+ a.s = (b - a.b) / (a.dur / a.spd);
+ if (a.s >= 1) {
+ delete animations[i];
+ a.s = 1;
+ len--;
+ (function (a) {
+ setTimeout(function () {
+ eve("mina.finish." + a.id, a);
+ });
+ }(a));
+ }
+ a.update();
+ }
+ len && requestAnimFrame(frame);
+ },
+ /*\
+ * mina
+ [ method ]
+ **
+ * Generic animation of numbers
+ **
+ - a (number) start _slave_ number
+ - A (number) end _slave_ number
+ - b (number) start _master_ number (start time in general case)
+ - B (number) end _master_ number (end time in gereal case)
+ - get (function) getter of _master_ number (see @mina.time)
+ - set (function) setter of _slave_ number
+ - easing (function) #optional easing function, default is @mina.linear
+ = (object) animation descriptor
+ o {
+ o id (string) animation id,
+ o start (number) start _slave_ number,
+ o end (number) end _slave_ number,
+ o b (number) start _master_ number,
+ o s (number) animation status (0..1),
+ o dur (number) animation duration,
+ o spd (number) animation speed,
+ o get (function) getter of _master_ number (see @mina.time),
+ o set (function) setter of _slave_ number,
+ o easing (function) easing function, default is @mina.linear,
+ o status (function) status getter/setter,
+ o speed (function) speed getter/setter,
+ o duration (function) duration getter/setter,
+ o stop (function) animation stopper
+ o pause (function) pauses the animation
+ o resume (function) resumes the animation
+ o update (function) calles setter with the right value of the animation
+ o }
+ \*/
+ mina = function (a, A, b, B, get, set, easing) {
+ var anim = {
+ id: ID(),
+ start: a,
+ end: A,
+ b: b,
+ s: 0,
+ dur: B - b,
+ spd: 1,
+ get: get,
+ set: set,
+ easing: easing || mina.linear,
+ status: sta,
+ speed: speed,
+ duration: duration,
+ stop: stopit,
+ pause: pause,
+ resume: resume,
+ update: update
+ };
+ animations[anim.id] = anim;
+ var len = 0, i;
+ for (i in animations) if (animations.hasOwnProperty(i)) {
+ len++;
+ if (len == 2) {
+ break;
+ }
+ }
+ len == 1 && requestAnimFrame(frame);
+ return anim;
+ };
+ /*\
+ * mina.time
+ [ method ]
+ **
+ * Returns the current time. Equivalent to:
+ | function () {
+ | return (new Date).getTime();
+ | }
+ \*/
+ mina.time = timer;
+ /*\
+ * mina.getById
+ [ method ]
+ **
+ * Returns an animation by its id
+ - id (string) animation's id
+ = (object) See @mina
+ \*/
+ mina.getById = function (id) {
+ return animations[id] || null;
+ };
+
+ /*\
+ * mina.linear
+ [ method ]
+ **
+ * Default linear easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.linear = function (n) {
+ return n;
+ };
+ /*\
+ * mina.easeout
+ [ method ]
+ **
+ * Easeout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeout = function (n) {
+ return Math.pow(n, 1.7);
+ };
+ /*\
+ * mina.easein
+ [ method ]
+ **
+ * Easein easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easein = function (n) {
+ return Math.pow(n, .48);
+ };
+ /*\
+ * mina.easeinout
+ [ method ]
+ **
+ * Easeinout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.easeinout = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ if (n == 0) {
+ return 0;
+ }
+ var q = .48 - n / 1.04,
+ Q = Math.sqrt(.1734 + q * q),
+ x = Q - q,
+ X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
+ y = -Q - q,
+ Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
+ t = X + Y + .5;
+ return (1 - t) * 3 * t * t + t * t * t;
+ };
+ /*\
+ * mina.backin
+ [ method ]
+ **
+ * Backin easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backin = function (n) {
+ if (n == 1) {
+ return 1;
+ }
+ var s = 1.70158;
+ return n * n * ((s + 1) * n - s);
+ };
+ /*\
+ * mina.backout
+ [ method ]
+ **
+ * Backout easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.backout = function (n) {
+ if (n == 0) {
+ return 0;
+ }
+ n = n - 1;
+ var s = 1.70158;
+ return n * n * ((s + 1) * n + s) + 1;
+ };
+ /*\
+ * mina.elastic
+ [ method ]
+ **
+ * Elastic easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.elastic = function (n) {
+ if (n == !!n) {
+ return n;
+ }
+ return Math.pow(2, -10 * n) * Math.sin((n - .075) *
+ (2 * Math.PI) / .3) + 1;
+ };
+ /*\
+ * mina.bounce
+ [ method ]
+ **
+ * Bounce easing
+ - n (number) input 0..1
+ = (number) output 0..1
+ \*/
+ mina.bounce = function (n) {
+ var s = 7.5625,
+ p = 2.75,
+ l;
+ if (n < (1 / p)) {
+ l = s * n * n;
+ } else {
+ if (n < (2 / p)) {
+ n -= (1.5 / p);
+ l = s * n * n + .75;
+ } else {
+ if (n < (2.5 / p)) {
+ n -= (2.25 / p);
+ l = s * n * n + .9375;
+ } else {
+ n -= (2.625 / p);
+ l = s * n * n + .984375;
+ }
+ }
+ }
+ return l;
+ };
+ window.mina = mina;
+ return mina;
+})(typeof eve == "undefined" ? function () {} : eve);
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+var Snap = (function(root) {
+Snap.version = "0.3.0";
+/*\
+ * Snap
+ [ method ]
+ **
+ * Creates a drawing surface or wraps existing SVG element.
+ **
+ - width (number|string) width of surface
+ - height (number|string) height of surface
+ * or
+ - DOM (SVGElement) element to be wrapped into Snap structure
+ * or
+ - array (array) array of elements (will return set of elements)
+ * or
+ - query (string) CSS query selector
+ = (object) @Element
+\*/
+function Snap(w, h) {
+ if (w) {
+ if (w.tagName) {
+ return wrap(w);
+ }
+ if (is(w, "array") && Snap.set) {
+ return Snap.set.apply(Snap, w);
+ }
+ if (w instanceof Element) {
+ return w;
+ }
+ if (h == null) {
+ w = glob.doc.querySelector(w);
+ return wrap(w);
+ }
+ }
+ w = w == null ? "100%" : w;
+ h = h == null ? "100%" : h;
+ return new Paper(w, h);
+}
+Snap.toString = function () {
+ return "Snap v" + this.version;
+};
+Snap._ = {};
+var glob = {
+ win: root.window,
+ doc: root.window.document
+};
+Snap._.glob = glob;
+var has = "hasOwnProperty",
+ Str = String,
+ toFloat = parseFloat,
+ toInt = parseInt,
+ math = Math,
+ mmax = math.max,
+ mmin = math.min,
+ abs = math.abs,
+ pow = math.pow,
+ PI = math.PI,
+ round = math.round,
+ E = "",
+ S = " ",
+ objectToString = Object.prototype.toString,
+ ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
+ colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
+ bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ separator = Snap._.separator = /[,\s]+/,
+ whitespace = /[\s]/g,
+ commaSpaces = /[\s]*,[\s]*/,
+ hsrg = {hs: 1, rg: 1},
+ pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
+ pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
+ idgen = 0,
+ idprefix = "S" + (+new Date).toString(36),
+ ID = function (el) {
+ return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
+ },
+ xlink = "http://www.w3.org/1999/xlink",
+ xmlns = "http://www.w3.org/2000/svg",
+ hub = {},
+ URL = Snap.url = function (url) {
+ return "url('#" + url + "')";
+ };
+
+function $(el, attr) {
+ if (attr) {
+ if (el == "#text") {
+ el = glob.doc.createTextNode(attr.text || "");
+ }
+ if (typeof el == "string") {
+ el = $(el);
+ }
+ if (typeof attr == "string") {
+ if (attr.substring(0, 6) == "xlink:") {
+ return el.getAttributeNS(xlink, attr.substring(6));
+ }
+ if (attr.substring(0, 4) == "xml:") {
+ return el.getAttributeNS(xmlns, attr.substring(4));
+ }
+ return el.getAttribute(attr);
+ }
+ for (var key in attr) if (attr[has](key)) {
+ var val = Str(attr[key]);
+ if (val) {
+ if (key.substring(0, 6) == "xlink:") {
+ el.setAttributeNS(xlink, key.substring(6), val);
+ } else if (key.substring(0, 4) == "xml:") {
+ el.setAttributeNS(xmlns, key.substring(4), val);
+ } else {
+ el.setAttribute(key, val);
+ }
+ } else {
+ el.removeAttribute(key);
+ }
+ }
+ } else {
+ el = glob.doc.createElementNS(xmlns, el);
+ }
+ return el;
+}
+Snap._.$ = $;
+Snap._.id = ID;
+function getAttrs(el) {
+ var attrs = el.attributes,
+ name,
+ out = {};
+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].namespaceURI == xlink) {
+ name = "xlink:";
+ } else {
+ name = "";
+ }
+ name += attrs[i].name;
+ out[name] = attrs[i].textContent;
+ }
+ return out;
+}
+function is(o, type) {
+ type = Str.prototype.toLowerCase.call(type);
+ if (type == "finite") {
+ return isFinite(o);
+ }
+ if (type == "array" &&
+ (o instanceof Array || Array.isArray && Array.isArray(o))) {
+ return true;
+ }
+ return (type == "null" && o === null) ||
+ (type == typeof o && o !== null) ||
+ (type == "object" && o === Object(o)) ||
+ objectToString.call(o).slice(8, -1).toLowerCase() == type;
+}
+/*\
+ * Snap.format
+ [ method ]
+ **
+ * Replaces construction of type `{<name>}` to the corresponding argument
+ **
+ - token (string) string to format
+ - json (object) object which properties are used as a replacement
+ = (string) formatted string
+ > Usage
+ | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
+ | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
+ | x: 10,
+ | y: 20,
+ | dim: {
+ | width: 40,
+ | height: 50,
+ | "negative width": -40
+ | }
+ | }));
+\*/
+Snap.format = (function () {
+ var tokenRegex = /\{([^\}]+)\}/g,
+ objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches .xxxxx or ["xxxxx"] to run over object properties
+ replacer = function (all, key, obj) {
+ var res = obj;
+ key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
+ name = name || quotedName;
+ if (res) {
+ if (name in res) {
+ res = res[name];
+ }
+ typeof res == "function" && isFunc && (res = res());
+ }
+ });
+ res = (res == null || res == obj ? all : res) + "";
+ return res;
+ };
+ return function (str, obj) {
+ return Str(str).replace(tokenRegex, function (all, key) {
+ return replacer(all, key, obj);
+ });
+ };
+})();
+function clone(obj) {
+ if (typeof obj == "function" || Object(obj) !== obj) {
+ return obj;
+ }
+ var res = new obj.constructor;
+ for (var key in obj) if (obj[has](key)) {
+ res[key] = clone(obj[key]);
+ }
+ return res;
+}
+Snap._.clone = clone;
+function repush(array, item) {
+ for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {
+ return array.push(array.splice(i, 1)[0]);
+ }
+}
+function cacher(f, scope, postprocessor) {
+ function newf() {
+ var arg = Array.prototype.slice.call(arguments, 0),
+ args = arg.join("\u2400"),
+ cache = newf.cache = newf.cache || {},
+ count = newf.count = newf.count || [];
+ if (cache[has](args)) {
+ repush(count, args);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ count.length >= 1e3 && delete cache[count.shift()];
+ count.push(args);
+ cache[args] = f.apply(scope, arg);
+ return postprocessor ? postprocessor(cache[args]) : cache[args];
+ }
+ return newf;
+}
+Snap._.cacher = cacher;
+function angle(x1, y1, x2, y2, x3, y3) {
+ if (x3 == null) {
+ var x = x1 - x2,
+ y = y1 - y2;
+ if (!x && !y) {
+ return 0;
+ }
+ return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
+ } else {
+ return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
+ }
+}
+function rad(deg) {
+ return deg % 360 * PI / 180;
+}
+function deg(rad) {
+ return rad * 180 / PI % 360;
+}
+function x_y() {
+ return this.x + S + this.y;
+}
+function x_y_w_h() {
+ return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
+}
+
+/*\
+ * Snap.rad
+ [ method ]
+ **
+ * Transform angle to radians
+ - deg (number) angle in degrees
+ = (number) angle in radians
+\*/
+Snap.rad = rad;
+/*\
+ * Snap.deg
+ [ method ]
+ **
+ * Transform angle to degrees
+ - rad (number) angle in radians
+ = (number) angle in degrees
+\*/
+Snap.deg = deg;
+/*\
+ * Snap.angle
+ [ method ]
+ **
+ * Returns an angle between two or three points
+ > Parameters
+ - x1 (number) x coord of first point
+ - y1 (number) y coord of first point
+ - x2 (number) x coord of second point
+ - y2 (number) y coord of second point
+ - x3 (number) #optional x coord of third point
+ - y3 (number) #optional y coord of third point
+ = (number) angle in degrees
+\*/
+Snap.angle = angle;
+/*\
+ * Snap.is
+ [ method ]
+ **
+ * Handy replacement for the `typeof` operator
+ - o (…) any object or primitive
+ - type (string) name of the type, e.g., `string`, `function`, `number`, etc.
+ = (boolean) `true` if given value is of given type
+\*/
+Snap.is = is;
+/*\
+ * Snap.snapTo
+ [ method ]
+ **
+ * Snaps given value to given grid
+ - values (array|number) given array of values or step of the grid
+ - value (number) value to adjust
+ - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.
+ = (number) adjusted value
+\*/
+Snap.snapTo = function (values, value, tolerance) {
+ tolerance = is(tolerance, "finite") ? tolerance : 10;
+ if (is(values, "array")) {
+ var i = values.length;
+ while (i--) if (abs(values[i] - value) <= tolerance) {
+ return values[i];
+ }
+ } else {
+ values = +values;
+ var rem = value % values;
+ if (rem < tolerance) {
+ return value - rem;
+ }
+ if (rem > values - tolerance) {
+ return value - rem + values;
+ }
+ }
+ return value;
+};
+// Colour
+/*\
+ * Snap.getRGB
+ [ method ]
+ **
+ * Parses color string as RGB object
+ - color (string) color string in one of the following formats:
+ # <ul>
+ # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>
+ # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>
+ # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>
+ # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>
+ # <li>rgba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>
+ # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>
+ # <li>hsba(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>
+ # <li>hsla(•••, •••, •••, •••) — also with opacity</li>
+ # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>
+ # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>
+ # </ul>
+ * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) true if string can't be parsed
+ o }
+\*/
+Snap.getRGB = cacher(function (colour) {
+ if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ if (colour == "none") {
+ return {r: -1, g: -1, b: -1, hex: "none", toString: rgbtoString};
+ }
+ !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
+ if (!colour) {
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+ }
+ var res,
+ red,
+ green,
+ blue,
+ opacity,
+ t,
+ values,
+ rgb = colour.match(colourRegExp);
+ if (rgb) {
+ if (rgb[2]) {
+ blue = toInt(rgb[2].substring(5), 16);
+ green = toInt(rgb[2].substring(3, 5), 16);
+ red = toInt(rgb[2].substring(1, 3), 16);
+ }
+ if (rgb[3]) {
+ blue = toInt((t = rgb[3].charAt(3)) + t, 16);
+ green = toInt((t = rgb[3].charAt(2)) + t, 16);
+ red = toInt((t = rgb[3].charAt(1)) + t, 16);
+ }
+ if (rgb[4]) {
+ values = rgb[4].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red *= 2.55);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green *= 2.55);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue *= 2.55);
+ rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ }
+ if (rgb[5]) {
+ values = rgb[5].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsb2rgb(red, green, blue, opacity);
+ }
+ if (rgb[6]) {
+ values = rgb[6].split(commaSpaces);
+ red = toFloat(values[0]);
+ values[0].slice(-1) == "%" && (red /= 100);
+ green = toFloat(values[1]);
+ values[1].slice(-1) == "%" && (green /= 100);
+ blue = toFloat(values[2]);
+ values[2].slice(-1) == "%" && (blue /= 100);
+ (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
+ rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
+ values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
+ return Snap.hsl2rgb(red, green, blue, opacity);
+ }
+ red = mmin(math.round(red), 255);
+ green = mmin(math.round(green), 255);
+ blue = mmin(math.round(blue), 255);
+ opacity = mmin(mmax(opacity, 0), 1);
+ rgb = {r: red, g: green, b: blue, toString: rgbtoString};
+ rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
+ rgb.opacity = is(opacity, "finite") ? opacity : 1;
+ return rgb;
+ }
+ return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
+}, Snap);
+// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.
+/*\
+ * Snap.hsb
+ [ method ]
+ **
+ * Converts HSB values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - b (number) value or brightness
+ = (string) hex representation of the color
+\*/
+Snap.hsb = cacher(function (h, s, b) {
+ return Snap.hsb2rgb(h, s, b).hex;
+});
+/*\
+ * Snap.hsl
+ [ method ]
+ **
+ * Converts HSL values to a hex representation of the color
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (string) hex representation of the color
+\*/
+Snap.hsl = cacher(function (h, s, l) {
+ return Snap.hsl2rgb(h, s, l).hex;
+});
+/*\
+ * Snap.rgb
+ [ method ]
+ **
+ * Converts RGB values to a hex representation of the color
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (string) hex representation of the color
+\*/
+Snap.rgb = cacher(function (r, g, b, o) {
+ if (is(o, "finite")) {
+ var round = math.round;
+ return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
+ }
+ return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
+});
+var toHex = function (color) {
+ var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
+ red = "rgb(255, 0, 0)";
+ toHex = cacher(function (color) {
+ if (color.toLowerCase() == "red") {
+ return red;
+ }
+ i.style.color = red;
+ i.style.color = color;
+ var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
+ return out == red ? null : out;
+ });
+ return toHex(color);
+},
+hsbtoString = function () {
+ return "hsb(" + [this.h, this.s, this.b] + ")";
+},
+hsltoString = function () {
+ return "hsl(" + [this.h, this.s, this.l] + ")";
+},
+rgbtoString = function () {
+ return this.opacity == 1 || this.opacity == null ?
+ this.hex :
+ "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
+},
+prepareRGB = function (r, g, b) {
+ if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
+ b = r.b;
+ g = r.g;
+ r = r.r;
+ }
+ if (g == null && is(r, string)) {
+ var clr = Snap.getRGB(r);
+ r = clr.r;
+ g = clr.g;
+ b = clr.b;
+ }
+ if (r > 1 || g > 1 || b > 1) {
+ r /= 255;
+ g /= 255;
+ b /= 255;
+ }
+
+ return [r, g, b];
+},
+packageRGB = function (r, g, b, o) {
+ r = math.round(r * 255);
+ g = math.round(g * 255);
+ b = math.round(b * 255);
+ var rgb = {
+ r: r,
+ g: g,
+ b: b,
+ opacity: is(o, "finite") ? o : 1,
+ hex: Snap.rgb(r, g, b),
+ toString: rgbtoString
+ };
+ is(o, "finite") && (rgb.opacity = o);
+ return rgb;
+};
+// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?
+/*\
+ * Snap.color
+ [ method ]
+ **
+ * Parses the color string and returns an object featuring the color's component values
+ - clr (string) color string in one of the supported formats (see @Snap.getRGB)
+ = (object) Combined RGB/HSB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••,
+ o error (boolean) `true` if string can't be parsed,
+ o h (number) hue,
+ o s (number) saturation,
+ o v (number) value (brightness),
+ o l (number) lightness
+ o }
+\*/
+Snap.color = function (clr) {
+ var rgb;
+ if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
+ rgb = Snap.hsb2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
+ rgb = Snap.hsl2rgb(clr);
+ clr.r = rgb.r;
+ clr.g = rgb.g;
+ clr.b = rgb.b;
+ clr.opacity = 1;
+ clr.hex = rgb.hex;
+ } else {
+ if (is(clr, "string")) {
+ clr = Snap.getRGB(clr);
+ }
+ if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
+ rgb = Snap.rgb2hsl(clr);
+ clr.h = rgb.h;
+ clr.s = rgb.s;
+ clr.l = rgb.l;
+ rgb = Snap.rgb2hsb(clr);
+ clr.v = rgb.b;
+ } else {
+ clr = {hex: "none"};
+ clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
+ clr.error = 1;
+ }
+ }
+ clr.toString = rgbtoString;
+ return clr;
+};
+/*\
+ * Snap.hsb2rgb
+ [ method ]
+ **
+ * Converts HSB values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - v (number) value or brightness
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsb2rgb = function (h, s, v, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
+ v = h.b;
+ s = h.s;
+ h = h.h;
+ o = h.o;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = v * s;
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = v - C;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.hsl2rgb
+ [ method ]
+ **
+ * Converts HSL values to an RGB object
+ - h (number) hue
+ - s (number) saturation
+ - l (number) luminosity
+ = (object) RGB object in the following format:
+ o {
+ o r (number) red,
+ o g (number) green,
+ o b (number) blue,
+ o hex (string) color in HTML/CSS format: #••••••
+ o }
+\*/
+Snap.hsl2rgb = function (h, s, l, o) {
+ if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
+ l = h.l;
+ s = h.s;
+ h = h.h;
+ }
+ if (h > 1 || s > 1 || l > 1) {
+ h /= 360;
+ s /= 100;
+ l /= 100;
+ }
+ h *= 360;
+ var R, G, B, X, C;
+ h = (h % 360) / 60;
+ C = 2 * s * (l < .5 ? l : 1 - l);
+ X = C * (1 - abs(h % 2 - 1));
+ R = G = B = l - C / 2;
+
+ h = ~~h;
+ R += [C, X, 0, 0, X, C][h];
+ G += [X, C, C, X, 0, 0][h];
+ B += [0, 0, X, C, C, X][h];
+ return packageRGB(R, G, B, o);
+};
+/*\
+ * Snap.rgb2hsb
+ [ method ]
+ **
+ * Converts RGB values to an HSB object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSB object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o b (number) brightness
+ o }
+\*/
+Snap.rgb2hsb = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, V, C;
+ V = mmax(r, g, b);
+ C = V - mmin(r, g, b);
+ H = (C == 0 ? null :
+ V == r ? (g - b) / C :
+ V == g ? (b - r) / C + 2 :
+ (r - g) / C + 4
+ );
+ H = ((H + 360) % 6) * 60 / 360;
+ S = C == 0 ? 0 : C / V;
+ return {h: H, s: S, b: V, toString: hsbtoString};
+};
+/*\
+ * Snap.rgb2hsl
+ [ method ]
+ **
+ * Converts RGB values to an HSL object
+ - r (number) red
+ - g (number) green
+ - b (number) blue
+ = (object) HSL object in the following format:
+ o {
+ o h (number) hue,
+ o s (number) saturation,
+ o l (number) luminosity
+ o }
+\*/
+Snap.rgb2hsl = function (r, g, b) {
+ b = prepareRGB(r, g, b);
+ r = b[0];
+ g = b[1];
+ b = b[2];
+
+ var H, S, L, M, m, C;
+ M = mmax(r, g, b);
+ m = mmin(r, g, b);
+ C = M - m;
+ H = (C == 0 ? null :
+ M == r ? (g - b) / C :
+ M == g ? (b - r) / C + 2 :
+ (r - g) / C + 4);
+ H = ((H + 360) % 6) * 60 / 360;
+ L = (M + m) / 2;
+ S = (C == 0 ? 0 :
+ L < .5 ? C / (2 * L) :
+ C / (2 - 2 * L));
+ return {h: H, s: S, l: L, toString: hsltoString};
+};
+
+// Transformations
+// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured?
+/*\
+ * Snap.parsePathString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given path string into an array of arrays of path segments
+ - pathString (string|array) path string or array of segments (in the last case it is returned straight away)
+ = (array) array of segments
+\*/
+Snap.parsePathString = function (pathString) {
+ if (!pathString) {
+ return null;
+ }
+ var pth = Snap.path(pathString);
+ if (pth.arr) {
+ return Snap.path.clone(pth.arr);
+ }
+
+ var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
+ data = [];
+ if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
+ data = Snap.path.clone(pathString);
+ }
+ if (!data.length) {
+ Str(pathString).replace(pathCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ if (name == "m" && params.length > 2) {
+ data.push([b].concat(params.splice(0, 2)));
+ name = "l";
+ b = b == "m" ? "l" : "L";
+ }
+ if (name == "o" && params.length == 1) {
+ data.push([b, params[0]]);
+ }
+ if (name == "r") {
+ data.push([b].concat(params));
+ } else while (params.length >= paramCounts[name]) {
+ data.push([b].concat(params.splice(0, paramCounts[name])));
+ if (!paramCounts[name]) {
+ break;
+ }
+ }
+ });
+ }
+ data.toString = Snap.path.toString;
+ pth.arr = Snap.path.clone(data);
+ return data;
+};
+/*\
+ * Snap.parseTransformString
+ [ method ]
+ **
+ * Utility method
+ **
+ * Parses given transform string into an array of transformations
+ - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)
+ = (array) array of transformations
+\*/
+var parseTransformString = Snap.parseTransformString = function (TString) {
+ if (!TString) {
+ return null;
+ }
+ var paramCounts = {r: 3, s: 4, t: 2, m: 6},
+ data = [];
+ if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
+ data = Snap.path.clone(TString);
+ }
+ if (!data.length) {
+ Str(TString).replace(tCommand, function (a, b, c) {
+ var params = [],
+ name = b.toLowerCase();
+ c.replace(pathValues, function (a, b) {
+ b && params.push(+b);
+ });
+ data.push([b].concat(params));
+ });
+ }
+ data.toString = Snap.path.toString;
+ return data;
+};
+function svgTransform2string(tstr) {
+ var res = [];
+ tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function (all, name, params) {
+ params = params.split(/\s*,\s*|\s+/);
+ if (name == "rotate" && params.length == 1) {
+ params.push(0, 0);
+ }
+ if (name == "scale") {
+ if (params.length > 2) {
+ params = params.slice(0, 2);
+ } else if (params.length == 2) {
+ params.push(0, 0);
+ }
+ if (params.length == 1) {
+ params.push(params[0], 0, 0);
+ }
+ }
+ if (name == "skewX") {
+ res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
+ } else if (name == "skewY") {
+ res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
+ } else {
+ res.push([name.charAt(0)].concat(params));
+ }
+ return all;
+ });
+ return res;
+}
+Snap._.svgTransform2string = svgTransform2string;
+Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
+function transform2matrix(tstr, bbox) {
+ var tdata = parseTransformString(tstr),
+ m = new Snap.Matrix;
+ if (tdata) {
+ for (var i = 0, ii = tdata.length; i < ii; i++) {
+ var t = tdata[i],
+ tlen = t.length,
+ command = Str(t[0]).toLowerCase(),
+ absolute = t[0] != command,
+ inver = absolute ? m.invert() : 0,
+ x1,
+ y1,
+ x2,
+ y2,
+ bb;
+ if (command == "t" && tlen == 2){
+ m.translate(t[1], 0);
+ } else if (command == "t" && tlen == 3) {
+ if (absolute) {
+ x1 = inver.x(0, 0);
+ y1 = inver.y(0, 0);
+ x2 = inver.x(t[1], t[2]);
+ y2 = inver.y(t[1], t[2]);
+ m.translate(x2 - x1, y2 - y1);
+ } else {
+ m.translate(t[1], t[2]);
+ }
+ } else if (command == "r") {
+ if (tlen == 2) {
+ bb = bb || bbox;
+ m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.rotate(t[1], x2, y2);
+ } else {
+ m.rotate(t[1], t[2], t[3]);
+ }
+ }
+ } else if (command == "s") {
+ if (tlen == 2 || tlen == 3) {
+ bb = bb || bbox;
+ m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
+ } else if (tlen == 4) {
+ if (absolute) {
+ x2 = inver.x(t[2], t[3]);
+ y2 = inver.y(t[2], t[3]);
+ m.scale(t[1], t[1], x2, y2);
+ } else {
+ m.scale(t[1], t[1], t[2], t[3]);
+ }
+ } else if (tlen == 5) {
+ if (absolute) {
+ x2 = inver.x(t[3], t[4]);
+ y2 = inver.y(t[3], t[4]);
+ m.scale(t[1], t[2], x2, y2);
+ } else {
+ m.scale(t[1], t[2], t[3], t[4]);
+ }
+ }
+ } else if (command == "m" && tlen == 7) {
+ m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
+ }
+ }
+ }
+ return m;
+}
+Snap._.transform2matrix = transform2matrix;
+Snap._unit2px = unit2px;
+var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
+ function (a, b) {
+ var adown = a.nodeType == 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a == bup || !!(bup && bup.nodeType == 1 && (
+ adown.contains ?
+ adown.contains(bup) :
+ a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
+ ));
+ } :
+ function (a, b) {
+ if (b) {
+ while (b) {
+ b = b.parentNode;
+ if (b == a) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+function getSomeDefs(el) {
+ var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
+ (el.node.parentNode && wrap(el.node.parentNode)) ||
+ Snap.select("svg") ||
+ Snap(0, 0),
+ pdefs = p.select("defs"),
+ defs = pdefs == null ? false : pdefs.node;
+ if (!defs) {
+ defs = make("defs", p.node).node;
+ }
+ return defs;
+}
+function getSomeSVG(el) {
+ return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
+}
+Snap._.getSomeDefs = getSomeDefs;
+Snap._.getSomeSVG = getSomeSVG;
+function unit2px(el, name, value) {
+ var svg = getSomeSVG(el).node,
+ out = {},
+ mgr = svg.querySelector(".svg---mgr");
+ if (!mgr) {
+ mgr = $("rect");
+ $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, "class": "svg---mgr", fill: "none"});
+ svg.appendChild(mgr);
+ }
+ function getW(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {width: val});
+ try {
+ return mgr.getBBox().width;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function getH(val) {
+ if (val == null) {
+ return E;
+ }
+ if (val == +val) {
+ return val;
+ }
+ $(mgr, {height: val});
+ try {
+ return mgr.getBBox().height;
+ } catch (e) {
+ return 0;
+ }
+ }
+ function set(nam, f) {
+ if (name == null) {
+ out[nam] = f(el.attr(nam) || 0);
+ } else if (nam == name) {
+ out = f(value == null ? el.attr(nam) || 0 : value);
+ }
+ }
+ switch (el.type) {
+ case "rect":
+ set("rx", getW);
+ set("ry", getH);
+ case "image":
+ set("width", getW);
+ set("height", getH);
+ case "text":
+ set("x", getW);
+ set("y", getH);
+ break;
+ case "circle":
+ set("cx", getW);
+ set("cy", getH);
+ set("r", getW);
+ break;
+ case "ellipse":
+ set("cx", getW);
+ set("cy", getH);
+ set("rx", getW);
+ set("ry", getH);
+ break;
+ case "line":
+ set("x1", getW);
+ set("x2", getW);
+ set("y1", getH);
+ set("y2", getH);
+ break;
+ case "marker":
+ set("refX", getW);
+ set("markerWidth", getW);
+ set("refY", getH);
+ set("markerHeight", getH);
+ break;
+ case "radialGradient":
+ set("fx", getW);
+ set("fy", getH);
+ break;
+ case "tspan":
+ set("dx", getW);
+ set("dy", getH);
+ break;
+ default:
+ set(name, getW);
+ }
+ svg.removeChild(mgr);
+ return out;
+}
+/*\
+ * Snap.select
+ [ method ]
+ **
+ * Wraps a DOM element specified by CSS selector as @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(glob.doc.querySelector(query));
+};
+/*\
+ * Snap.selectAll
+ [ method ]
+ **
+ * Wraps DOM elements specified by CSS selector as set or array of @Element
+ - query (string) CSS selector of the element
+ = (Element) the current element
+\*/
+Snap.selectAll = function (query) {
+ var nodelist = glob.doc.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+};
+
+function add2group(list) {
+ if (!is(list, "array")) {
+ list = Array.prototype.slice.call(arguments, 0);
+ }
+ var i = 0,
+ j = 0,
+ node = this.node;
+ while (this[i]) delete this[i++];
+ for (i = 0; i < list.length; i++) {
+ if (list[i].type == "set") {
+ list[i].forEach(function (el) {
+ node.appendChild(el.node);
+ });
+ } else {
+ node.appendChild(list[i].node);
+ }
+ }
+ var children = node.childNodes;
+ for (i = 0; i < children.length; i++) {
+ this[j++] = wrap(children[i]);
+ }
+ return this;
+}
+// Hub garbage collector every 10s
+setInterval(function () {
+ for (var key in hub) if (hub[has](key)) {
+ var el = hub[key],
+ node = el.node;
+ if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
+ delete hub[key];
+ }
+ }
+}, 1e4);
+function Element(el) {
+ if (el.snap in hub) {
+ return hub[el.snap];
+ }
+ var svg;
+ try {
+ svg = el.ownerSVGElement;
+ } catch(e) {}
+ /*\
+ * Element.node
+ [ property (object) ]
+ **
+ * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
+ > Usage
+ | // draw a circle at coordinate 10,10 with radius of 10
+ | var c = paper.circle(10, 10, 10);
+ | c.node.onclick = function () {
+ | c.attr("fill", "red");
+ | };
+ \*/
+ this.node = el;
+ if (svg) {
+ this.paper = new Paper(svg);
+ }
+ /*\
+ * Element.type
+ [ property (string) ]
+ **
+ * SVG tag name of the given element.
+ \*/
+ this.type = el.tagName;
+ var id = this.id = ID(this);
+ this.anims = {};
+ this._ = {
+ transform: []
+ };
+ el.snap = id;
+ hub[id] = this;
+ if (this.type == "g") {
+ this.add = add2group;
+ }
+ if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {
+ for (var method in Paper.prototype) if (Paper.prototype[has](method)) {
+ this[method] = Paper.prototype[method];
+ }
+ }
+}
+ /*\
+ * Element.attr
+ [ method ]
+ **
+ * Gets or sets given attributes of the element.
+ **
+ - params (object) contains key-value pairs of attributes you want to set
+ * or
+ - param (string) name of the attribute
+ = (Element) the current element
+ * or
+ = (string) value of attribute
+ > Usage
+ | el.attr({
+ | fill: "#fc0",
+ | stroke: "#000",
+ | strokeWidth: 2, // CamelCase...
+ | "fill-opacity": 0.5, // or dash-separated names
+ | width: "*=2" // prefixed values
+ | });
+ | console.log(el.attr("fill")); // #fc0
+ * Prefixed values in format `"+=10"` supported. All four operations
+ * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`
+ * and `-`: `"+=2em"`.
+ \*/
+ Element.prototype.attr = function (params, value) {
+ var el = this,
+ node = el.node;
+ if (!params) {
+ return el;
+ }
+ if (is(params, "string")) {
+ if (arguments.length > 1) {
+ var json = {};
+ json[params] = value;
+ params = json;
+ } else {
+ return eve("snap.util.getattr." + params, el).firstDefined();
+ }
+ }
+ for (var att in params) {
+ if (params[has](att)) {
+ eve("snap.util.attr." + att, el, params[att]);
+ }
+ }
+ return el;
+ };
+/*\
+ * Snap.parse
+ [ method ]
+ **
+ * Parses SVG fragment and converts it into a @Fragment
+ **
+ - svg (string) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.parse = function (svg) {
+ var f = glob.doc.createDocumentFragment(),
+ full = true,
+ div = glob.doc.createElement("div");
+ svg = Str(svg);
+ if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
+ svg = "<svg>" + svg + "</svg>";
+ full = false;
+ }
+ div.innerHTML = svg;
+ svg = div.getElementsByTagName("svg")[0];
+ if (svg) {
+ if (full) {
+ f = svg;
+ } else {
+ while (svg.firstChild) {
+ f.appendChild(svg.firstChild);
+ }
+ div.innerHTML = E;
+ }
+ }
+ return new Fragment(f);
+};
+function Fragment(frag) {
+ this.node = frag;
+}
+// SIERRA Snap.fragment() could especially use a code example
+/*\
+ * Snap.fragment
+ [ method ]
+ **
+ * Creates a DOM fragment from a given list of elements or strings
+ **
+ - varargs (…) SVG string
+ = (Fragment) the @Fragment
+\*/
+Snap.fragment = function () {
+ var args = Array.prototype.slice.call(arguments, 0),
+ f = glob.doc.createDocumentFragment();
+ for (var i = 0, ii = args.length; i < ii; i++) {
+ var item = args[i];
+ if (item.node && item.node.nodeType) {
+ f.appendChild(item.node);
+ }
+ if (item.nodeType) {
+ f.appendChild(item);
+ }
+ if (typeof item == "string") {
+ f.appendChild(Snap.parse(item).node);
+ }
+ }
+ return new Fragment(f);
+};
+
+function make(name, parent) {
+ var res = $(name);
+ parent.appendChild(res);
+ var el = wrap(res);
+ return el;
+}
+function Paper(w, h) {
+ var res,
+ desc,
+ defs,
+ proto = Paper.prototype;
+ if (w && w.tagName == "svg") {
+ if (w.snap in hub) {
+ return hub[w.snap];
+ }
+ var doc = w.ownerDocument;
+ res = new Element(w);
+ desc = w.getElementsByTagName("desc")[0];
+ defs = w.getElementsByTagName("defs")[0];
+ if (!desc) {
+ desc = $("desc");
+ desc.appendChild(doc.createTextNode("Created with Snap"));
+ res.node.appendChild(desc);
+ }
+ if (!defs) {
+ defs = $("defs");
+ res.node.appendChild(defs);
+ }
+ res.defs = defs;
+ for (var key in proto) if (proto[has](key)) {
+ res[key] = proto[key];
+ }
+ res.paper = res.root = res;
+ } else {
+ res = make("svg", glob.doc.body);
+ $(res.node, {
+ height: h,
+ version: 1.1,
+ width: w,
+ xmlns: xmlns
+ });
+ }
+ return res;
+}
+function wrap(dom) {
+ if (!dom) {
+ return dom;
+ }
+ if (dom instanceof Element || dom instanceof Fragment) {
+ return dom;
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
+ return new Paper(dom);
+ }
+ if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
+ return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
+ }
+ return new Element(dom);
+}
+
+Snap._.make = make;
+Snap._.wrap = wrap;
+/*\
+ * Paper.el
+ [ method ]
+ **
+ * Creates an element on paper with a given name and no attributes
+ **
+ - name (string) tag name
+ - attr (object) attributes
+ = (Element) the current element
+ > Usage
+ | var c = paper.circle(10, 10, 10); // is the same as...
+ | var c = paper.el("circle").attr({
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+ | // and the same as
+ | var c = paper.el("circle", {
+ | cx: 10,
+ | cy: 10,
+ | r: 10
+ | });
+\*/
+Paper.prototype.el = function (name, attr) {
+ var el = make(name, this.node);
+ attr && el.attr(attr);
+ return el;
+};
+// default
+eve.on("snap.util.getattr", function () {
+ var att = eve.nt();
+ att = att.substring(att.lastIndexOf(".") + 1);
+ var css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
+ } else {
+ return $(this.node, att);
+ }
+});
+var cssAttr = {
+ "alignment-baseline": 0,
+ "baseline-shift": 0,
+ "clip": 0,
+ "clip-path": 0,
+ "clip-rule": 0,
+ "color": 0,
+ "color-interpolation": 0,
+ "color-interpolation-filters": 0,
+ "color-profile": 0,
+ "color-rendering": 0,
+ "cursor": 0,
+ "direction": 0,
+ "display": 0,
+ "dominant-baseline": 0,
+ "enable-background": 0,
+ "fill": 0,
+ "fill-opacity": 0,
+ "fill-rule": 0,
+ "filter": 0,
+ "flood-color": 0,
+ "flood-opacity": 0,
+ "font": 0,
+ "font-family": 0,
+ "font-size": 0,
+ "font-size-adjust": 0,
+ "font-stretch": 0,
+ "font-style": 0,
+ "font-variant": 0,
+ "font-weight": 0,
+ "glyph-orientation-horizontal": 0,
+ "glyph-orientation-vertical": 0,
+ "image-rendering": 0,
+ "kerning": 0,
+ "letter-spacing": 0,
+ "lighting-color": 0,
+ "marker": 0,
+ "marker-end": 0,
+ "marker-mid": 0,
+ "marker-start": 0,
+ "mask": 0,
+ "opacity": 0,
+ "overflow": 0,
+ "pointer-events": 0,
+ "shape-rendering": 0,
+ "stop-color": 0,
+ "stop-opacity": 0,
+ "stroke": 0,
+ "stroke-dasharray": 0,
+ "stroke-dashoffset": 0,
+ "stroke-linecap": 0,
+ "stroke-linejoin": 0,
+ "stroke-miterlimit": 0,
+ "stroke-opacity": 0,
+ "stroke-width": 0,
+ "text-anchor": 0,
+ "text-decoration": 0,
+ "text-rendering": 0,
+ "unicode-bidi": 0,
+ "visibility": 0,
+ "word-spacing": 0,
+ "writing-mode": 0
+};
+
+eve.on("snap.util.attr", function (value) {
+ var att = eve.nt(),
+ attr = {};
+ att = att.substring(att.lastIndexOf(".") + 1);
+ attr[att] = value;
+ var style = att.replace(/-(\w)/gi, function (all, letter) {
+ return letter.toUpperCase();
+ }),
+ css = att.replace(/[A-Z]/g, function (letter) {
+ return "-" + letter.toLowerCase();
+ });
+ if (cssAttr[has](css)) {
+ this.node.style[style] = value == null ? E : value;
+ } else {
+ $(this.node, attr);
+ }
+});
+(function (proto) {}(Paper.prototype));
+
+// simple ajax
+/*\
+ * Snap.ajax
+ [ method ]
+ **
+ * Simple implementation of Ajax
+ **
+ - url (string) URL
+ - postData (object|string) data for post request
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ * or
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+ = (XMLHttpRequest) the XMLHttpRequest object, just in case
+\*/
+Snap.ajax = function (url, postData, callback, scope){
+ var req = new XMLHttpRequest,
+ id = ID();
+ if (req) {
+ if (is(postData, "function")) {
+ scope = callback;
+ callback = postData;
+ postData = null;
+ } else if (is(postData, "object")) {
+ var pd = [];
+ for (var key in postData) if (postData.hasOwnProperty(key)) {
+ pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
+ }
+ postData = pd.join("&");
+ }
+ req.open((postData ? "POST" : "GET"), url, true);
+ if (postData) {
+ req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ }
+ if (callback) {
+ eve.once("snap.ajax." + id + ".0", callback);
+ eve.once("snap.ajax." + id + ".200", callback);
+ eve.once("snap.ajax." + id + ".304", callback);
+ }
+ req.onreadystatechange = function() {
+ if (req.readyState != 4) return;
+ eve("snap.ajax." + id + "." + req.status, scope, req);
+ };
+ if (req.readyState == 4) {
+ return req;
+ }
+ req.send(postData);
+ return req;
+ }
+};
+/*\
+ * Snap.load
+ [ method ]
+ **
+ * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
+ **
+ - url (string) URL
+ - callback (function) callback
+ - scope (object) #optional scope of callback
+\*/
+Snap.load = function (url, callback, scope) {
+ Snap.ajax(url, function (req) {
+ var f = Snap.parse(req.responseText);
+ scope ? callback.call(scope, f) : callback(f);
+ });
+};
+var getOffset = function (elem) {
+ var box = elem.getBoundingClientRect(),
+ doc = elem.ownerDocument,
+ body = doc.body,
+ docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return {
+ y: top,
+ x: left
+ };
+};
+/*\
+ * Snap.getElementByPoint
+ [ method ]
+ **
+ * Returns you topmost element under given point.
+ **
+ = (object) Snap element object
+ - x (number) x coordinate from the top left corner of the window
+ - y (number) y coordinate from the top left corner of the window
+ > Usage
+ | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: "#f00"});
+\*/
+Snap.getElementByPoint = function (x, y) {
+ var paper = this,
+ svg = paper.canvas,
+ target = glob.doc.elementFromPoint(x, y);
+ if (glob.win.opera && target.tagName == "svg") {
+ var so = getOffset(target),
+ sr = target.createSVGRect();
+ sr.x = x - so.x;
+ sr.y = y - so.y;
+ sr.width = sr.height = 1;
+ var hits = target.getIntersectionList(sr, null);
+ if (hits.length) {
+ target = hits[hits.length - 1];
+ }
+ }
+ if (!target) {
+ return null;
+ }
+ return wrap(target);
+};
+/*\
+ * Snap.plugin
+ [ method ]
+ **
+ * Let you write plugins. You pass in a function with four arguments, like this:
+ | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {
+ | Snap.newmethod = function () {};
+ | Element.prototype.newmethod = function () {};
+ | Paper.prototype.newmethod = function () {};
+ | });
+ * Inside the function you have access to all main objects (and their
+ * prototypes). This allow you to extend anything you want.
+ **
+ - f (function) your plugin body
+\*/
+Snap.plugin = function (f) {
+ f(Snap, Element, Paper, glob, Fragment);
+};
+glob.win.Snap = Snap;
+return Snap;
+}(window || this));
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ Str = String,
+ unit2px = Snap._unit2px,
+ $ = Snap._.$,
+ make = Snap._.make,
+ getSomeDefs = Snap._.getSomeDefs,
+ has = "hasOwnProperty",
+ wrap = Snap._.wrap;
+ /*\
+ * Element.getBBox
+ [ method ]
+ **
+ * Returns the bounding box descriptor for the given element
+ **
+ = (object) bounding box descriptor:
+ o {
+ o cx: (number) x of the center,
+ o cy: (number) x of the center,
+ o h: (number) height,
+ o height: (number) height,
+ o path: (string) path command for the box,
+ o r0: (number) radius of a circle that fully encloses the box,
+ o r1: (number) radius of the smallest circle that can be enclosed,
+ o r2: (number) radius of the largest circle that can be enclosed,
+ o vb: (string) box as a viewbox command,
+ o w: (number) width,
+ o width: (number) width,
+ o x2: (number) x of the right side,
+ o x: (number) x of the left side,
+ o y2: (number) y of the bottom edge,
+ o y: (number) y of the top edge
+ o }
+ \*/
+ elproto.getBBox = function (isWithoutTransform) {
+ if (!Snap.Matrix || !Snap.path) {
+ return this.node.getBBox();
+ }
+ var el = this,
+ m = new Snap.Matrix;
+ if (el.removed) {
+ return Snap._.box();
+ }
+ while (el.type == "use") {
+ if (!isWithoutTransform) {
+ m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
+ }
+ if (el.original) {
+ el = el.original;
+ } else {
+ var href = el.attr("xlink:href");
+ el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
+ }
+ }
+ var _ = el._,
+ pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
+ try {
+ if (isWithoutTransform) {
+ _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
+ return Snap._.box(_.bboxwt);
+ } else {
+ el.realPath = pathfinder(el);
+ el.matrix = el.transform().localMatrix;
+ _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
+ return Snap._.box(_.bbox);
+ }
+ } catch (e) {
+ // Firefox doesn’t give you bbox of hidden element
+ return Snap._.box();
+ }
+ };
+ var propString = function () {
+ return this.string;
+ };
+ function extractTransform(el, tstr) {
+ if (tstr == null) {
+ var doReturn = true;
+ if (el.type == "linearGradient" || el.type == "radialGradient") {
+ tstr = el.node.getAttribute("gradientTransform");
+ } else if (el.type == "pattern") {
+ tstr = el.node.getAttribute("patternTransform");
+ } else {
+ tstr = el.node.getAttribute("transform");
+ }
+ if (!tstr) {
+ return new Snap.Matrix;
+ }
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ if (!Snap._.rgTransform.test(tstr)) {
+ tstr = Snap._.svgTransform2string(tstr);
+ } else {
+ tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
+ }
+ if (is(tstr, "array")) {
+ tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
+ }
+ el._.transform = tstr;
+ }
+ var m = Snap._.transform2matrix(tstr, el.getBBox(1));
+ if (doReturn) {
+ return m;
+ } else {
+ el.matrix = m;
+ }
+ }
+ /*\
+ * Element.transform
+ [ method ]
+ **
+ * Gets or sets transformation of the element
+ **
+ - tstr (string) transform string in Snap or SVG format
+ = (Element) the current element
+ * or
+ = (object) transformation descriptor:
+ o {
+ o string (string) transform string,
+ o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,
+ o localMatrix (Matrix) matrix of transformations applied only to the element,
+ o diffMatrix (Matrix) matrix of difference between global and local transformations,
+ o global (string) global transformation as string,
+ o local (string) local transformation as string,
+ o toString (function) returns `string` property
+ o }
+ \*/
+ elproto.transform = function (tstr) {
+ var _ = this._;
+ if (tstr == null) {
+ var papa = this,
+ global = new Snap.Matrix(this.node.getCTM()),
+ local = extractTransform(this),
+ ms = [local],
+ m = new Snap.Matrix,
+ i,
+ localString = local.toTransformString(),
+ string = Str(local) == Str(this.matrix) ?
+ Str(_.transform) : localString;
+ while (papa.type != "svg" && (papa = papa.parent())) {
+ ms.push(extractTransform(papa));
+ }
+ i = ms.length;
+ while (i--) {
+ m.add(ms[i]);
+ }
+ return {
+ string: string,
+ globalMatrix: global,
+ totalMatrix: m,
+ localMatrix: local,
+ diffMatrix: global.clone().add(local.invert()),
+ global: global.toTransformString(),
+ total: m.toTransformString(),
+ local: localString,
+ toString: propString
+ };
+ }
+ if (tstr instanceof Snap.Matrix) {
+ this.matrix = tstr;
+ this._.transform = tstr.toTransformString();
+ } else {
+ extractTransform(this, tstr);
+ }
+
+ if (this.node) {
+ if (this.type == "linearGradient" || this.type == "radialGradient") {
+ $(this.node, {gradientTransform: this.matrix});
+ } else if (this.type == "pattern") {
+ $(this.node, {patternTransform: this.matrix});
+ } else {
+ $(this.node, {transform: this.matrix});
+ }
+ }
+
+ return this;
+ };
+ /*\
+ * Element.parent
+ [ method ]
+ **
+ * Returns the element's parent
+ **
+ = (Element) the parent element
+ \*/
+ elproto.parent = function () {
+ return wrap(this.node.parentNode);
+ };
+ /*\
+ * Element.append
+ [ method ]
+ **
+ * Appends the given element to current one
+ **
+ - el (Element|Set) element to append
+ = (Element) the parent element
+ \*/
+ /*\
+ * Element.add
+ [ method ]
+ **
+ * See @Element.append
+ \*/
+ elproto.append = elproto.add = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ it.add(el);
+ });
+ return this;
+ }
+ el = wrap(el);
+ this.node.appendChild(el.node);
+ el.paper = this.paper;
+ }
+ return this;
+ };
+ /*\
+ * Element.appendTo
+ [ method ]
+ **
+ * Appends the current element to the given one
+ **
+ - el (Element) parent element to append to
+ = (Element) the child element
+ \*/
+ elproto.appendTo = function (el) {
+ if (el) {
+ el = wrap(el);
+ el.append(this);
+ }
+ return this;
+ };
+ /*\
+ * Element.prepend
+ [ method ]
+ **
+ * Prepends the given element to the current one
+ **
+ - el (Element) element to prepend
+ = (Element) the parent element
+ \*/
+ elproto.prepend = function (el) {
+ if (el) {
+ if (el.type == "set") {
+ var it = this,
+ first;
+ el.forEach(function (el) {
+ if (first) {
+ first.after(el);
+ } else {
+ it.prepend(el);
+ }
+ first = el;
+ });
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.insertBefore(el.node, this.node.firstChild);
+ this.add && this.add();
+ el.paper = this.paper;
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ }
+ return this;
+ };
+ /*\
+ * Element.prependTo
+ [ method ]
+ **
+ * Prepends the current element to the given one
+ **
+ - el (Element) parent element to prepend to
+ = (Element) the child element
+ \*/
+ elproto.prependTo = function (el) {
+ el = wrap(el);
+ el.prepend(this);
+ return this;
+ };
+ /*\
+ * Element.before
+ [ method ]
+ **
+ * Inserts given element before the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.before = function (el) {
+ if (el.type == "set") {
+ var it = this;
+ el.forEach(function (el) {
+ var parent = el.parent();
+ it.node.parentNode.insertBefore(el.node, it.node);
+ parent && parent.add();
+ });
+ this.parent().add();
+ return this;
+ }
+ el = wrap(el);
+ var parent = el.parent();
+ this.node.parentNode.insertBefore(el.node, this.node);
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.after
+ [ method ]
+ **
+ * Inserts given element after the current one
+ **
+ - el (Element) element to insert
+ = (Element) the parent element
+ \*/
+ elproto.after = function (el) {
+ el = wrap(el);
+ var parent = el.parent();
+ if (this.node.nextSibling) {
+ this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
+ } else {
+ this.node.parentNode.appendChild(el.node);
+ }
+ this.parent() && this.parent().add();
+ parent && parent.add();
+ el.paper = this.paper;
+ return this;
+ };
+ /*\
+ * Element.insertBefore
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertBefore = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.insertAfter
+ [ method ]
+ **
+ * Inserts the element after the given one
+ **
+ - el (Element) element next to whom insert to
+ = (Element) the parent element
+ \*/
+ elproto.insertAfter = function (el) {
+ el = wrap(el);
+ var parent = this.parent();
+ el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
+ this.paper = el.paper;
+ parent && parent.add();
+ el.parent() && el.parent().add();
+ return this;
+ };
+ /*\
+ * Element.remove
+ [ method ]
+ **
+ * Removes element from the DOM
+ = (Element) the detached element
+ \*/
+ elproto.remove = function () {
+ var parent = this.parent();
+ this.node.parentNode && this.node.parentNode.removeChild(this.node);
+ delete this.paper;
+ this.removed = true;
+ parent && parent.add();
+ return this;
+ };
+ /*\
+ * Element.select
+ [ method ]
+ **
+ * Gathers the nested @Element matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Element) result of query selection
+ \*/
+ elproto.select = function (query) {
+ query = Str(query).replace(/([^\\]):/g, "$1\\:");
+ return wrap(this.node.querySelector(query));
+ };
+ /*\
+ * Element.selectAll
+ [ method ]
+ **
+ * Gathers nested @Element objects matching the given set of CSS selectors
+ **
+ - query (string) CSS selector
+ = (Set|array) result of query selection
+ \*/
+ elproto.selectAll = function (query) {
+ var nodelist = this.node.querySelectorAll(query),
+ set = (Snap.set || Array)();
+ for (var i = 0; i < nodelist.length; i++) {
+ set.push(wrap(nodelist[i]));
+ }
+ return set;
+ };
+ /*\
+ * Element.asPX
+ [ method ]
+ **
+ * Returns given attribute of the element as a `px` value (not %, em, etc.)
+ **
+ - attr (string) attribute name
+ - value (string) #optional attribute value
+ = (Element) result of query selection
+ \*/
+ elproto.asPX = function (attr, value) {
+ if (value == null) {
+ value = this.attr(attr);
+ }
+ return +unit2px(this, attr, value);
+ };
+ // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
+ /*\
+ * Element.use
+ [ method ]
+ **
+ * Creates a `<use>` element linked to the current element
+ **
+ = (Element) the `<use>` element
+ \*/
+ elproto.use = function () {
+ var use,
+ id = this.node.id;
+ if (!id) {
+ id = this.id;
+ $(this.node, {
+ id: id
+ });
+ }
+ if (this.type == "linearGradient" || this.type == "radialGradient" ||
+ this.type == "pattern") {
+ use = make(this.type, this.node.parentNode);
+ } else {
+ use = make("use", this.node.parentNode);
+ }
+ $(use.node, {
+ "xlink:href": "#" + id
+ });
+ use.original = this;
+ return use;
+ };
+ function fixids(el) {
+ var els = el.selectAll("*"),
+ it,
+ url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
+ ids = [],
+ uses = {};
+ function urltest(it, name) {
+ var val = $(it.node, name);
+ val = val && val.match(url);
+ val = val && val[2];
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ var attr = {};
+ attr[name] = URL(id);
+ $(it.node, attr);
+ });
+ }
+ }
+ function linktest(it) {
+ var val = $(it.node, "xlink:href");
+ if (val && val.charAt() == "#") {
+ val = val.substring(1);
+ } else {
+ return;
+ }
+ if (val) {
+ uses[val] = (uses[val] || []).concat(function (id) {
+ it.attr("xlink:href", "#" + id);
+ });
+ }
+ }
+ for (var i = 0, ii = els.length; i < ii; i++) {
+ it = els[i];
+ urltest(it, "fill");
+ urltest(it, "stroke");
+ urltest(it, "filter");
+ urltest(it, "mask");
+ urltest(it, "clip-path");
+ linktest(it);
+ var oldid = $(it.node, "id");
+ if (oldid) {
+ $(it.node, {id: it.id});
+ ids.push({
+ old: oldid,
+ id: it.id
+ });
+ }
+ }
+ for (i = 0, ii = ids.length; i < ii; i++) {
+ var fs = uses[ids[i].old];
+ if (fs) {
+ for (var j = 0, jj = fs.length; j < jj; j++) {
+ fs[j](ids[i].id);
+ }
+ }
+ }
+ }
+ /*\
+ * Element.clone
+ [ method ]
+ **
+ * Creates a clone of the element and inserts it after the element
+ **
+ = (Element) the clone
+ \*/
+ elproto.clone = function () {
+ var clone = wrap(this.node.cloneNode(true));
+ if ($(clone.node, "id")) {
+ $(clone.node, {id: clone.id});
+ }
+ fixids(clone);
+ clone.insertAfter(this);
+ return clone;
+ };
+ /*\
+ * Element.toDefs
+ [ method ]
+ **
+ * Moves element to the shared `<defs>` area
+ **
+ = (Element) the element
+ \*/
+ elproto.toDefs = function () {
+ var defs = getSomeDefs(this);
+ defs.appendChild(this.node);
+ return this;
+ };
+ /*\
+ * Element.toPattern
+ [ method ]
+ **
+ * Creates a `<pattern>` element from the current element
+ **
+ * To create a pattern you have to specify the pattern rect:
+ - x (string|number)
+ - y (string|number)
+ - width (string|number)
+ - height (string|number)
+ = (Element) the `<pattern>` element
+ * You can use pattern later on as an argument for `fill` attribute:
+ | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
+ | fill: "none",
+ | stroke: "#bada55",
+ | strokeWidth: 5
+ | }).pattern(0, 0, 10, 10),
+ | c = paper.circle(200, 200, 100);
+ | c.attr({
+ | fill: p
+ | });
+ \*/
+ elproto.pattern = elproto.toPattern = function (x, y, width, height) {
+ var p = make("pattern", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ $(p.node, {
+ x: x,
+ y: y,
+ width: width,
+ height: height,
+ patternUnits: "userSpaceOnUse",
+ id: p.id,
+ viewBox: [x, y, width, height].join(" ")
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
+// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
+ /*\
+ * Element.marker
+ [ method ]
+ **
+ * Creates a `<marker>` element from the current element
+ **
+ * To create a marker you have to specify the bounding rect and reference point:
+ - x (number)
+ - y (number)
+ - width (number)
+ - height (number)
+ - refX (number)
+ - refY (number)
+ = (Element) the `<marker>` element
+ * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
+ \*/
+ // TODO add usage for markers
+ elproto.marker = function (x, y, width, height, refX, refY) {
+ var p = make("marker", getSomeDefs(this));
+ if (x == null) {
+ x = this.getBBox();
+ }
+ if (is(x, "object") && "x" in x) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ refX = x.refX || x.cx;
+ refY = x.refY || x.cy;
+ x = x.x;
+ }
+ $(p.node, {
+ viewBox: [x, y, width, height].join(" "),
+ markerWidth: width,
+ markerHeight: height,
+ orient: "auto",
+ refX: refX || 0,
+ refY: refY || 0,
+ id: p.id
+ });
+ p.node.appendChild(this.node);
+ return p;
+ };
+ // animation
+ function slice(from, to, f) {
+ return function (arr) {
+ var res = arr.slice(from, to);
+ if (res.length == 1) {
+ res = res[0];
+ }
+ return f ? f(res) : res;
+ };
+ }
+ var Animation = function (attr, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ this.attr = attr;
+ this.dur = ms;
+ easing && (this.easing = easing);
+ callback && (this.callback = callback);
+ };
+ Snap._.Animation = Animation;
+ /*\
+ * Snap.animation
+ [ method ]
+ **
+ * Creates an animation object
+ **
+ - attr (object) attributes of final destination
+ - duration (number) duration of the animation, in milliseconds
+ - easing (function) #optional one of easing functions of @mina or custom one
+ - callback (function) #optional callback function that fires when animation ends
+ = (object) animation object
+ \*/
+ Snap.animation = function (attr, ms, easing, callback) {
+ return new Animation(attr, ms, easing, callback);
+ };
+ /*\
+ * Element.inAnim
+ [ method ]
+ **
+ * Returns a set of animations that may be able to manipulate the current element
+ **
+ = (object) in format:
+ o {
+ o anim (object) animation object,
+ o mina (object) @mina object,
+ o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ \*/
+ elproto.inAnim = function () {
+ var el = this,
+ res = [];
+ for (var id in el.anims) if (el.anims[has](id)) {
+ (function (a) {
+ res.push({
+ anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
+ mina: a,
+ curStatus: a.status(),
+ status: function (val) {
+ return a.status(val);
+ },
+ stop: function () {
+ a.stop();
+ }
+ });
+ }(el.anims[id]));
+ }
+ return res;
+ };
+ /*\
+ * Snap.animate
+ [ method ]
+ **
+ * Runs generic animation of one number into another with a caring function
+ **
+ - from (number|array) number or array of numbers
+ - to (number|array) number or array of numbers
+ - setter (function) caring function that accepts one number argument
+ - duration (number) duration, in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function to execute when animation ends
+ = (object) animation object in @mina format
+ o {
+ o id (string) animation id, consider it read-only,
+ o duration (function) gets or sets the duration of the animation,
+ o easing (function) easing,
+ o speed (function) gets or sets the speed of the animation,
+ o status (function) gets or sets the status of the animation,
+ o stop (function) stops the animation
+ o }
+ | var rect = Snap().rect(0, 0, 10, 10);
+ | Snap.animate(0, 10, function (val) {
+ | rect.attr({
+ | x: val
+ | });
+ | }, 1000);
+ | // in given context is equivalent to
+ | rect.animate({x: 10}, 1000);
+ \*/
+ Snap.animate = function (from, to, setter, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ var now = mina.time(),
+ anim = mina(from, to, now, now + ms, mina.time, setter, easing);
+ callback && eve.once("mina.finish." + anim.id, callback);
+ return anim;
+ };
+ /*\
+ * Element.stop
+ [ method ]
+ **
+ * Stops all the animations for the current element
+ **
+ = (Element) the current element
+ \*/
+ elproto.stop = function () {
+ var anims = this.inAnim();
+ for (var i = 0, ii = anims.length; i < ii; i++) {
+ anims[i].stop();
+ }
+ return this;
+ };
+ /*\
+ * Element.animate
+ [ method ]
+ **
+ * Animates the given attributes of the element
+ **
+ - attrs (object) key-value pairs of destination attributes
+ - duration (number) duration of the animation in milliseconds
+ - easing (function) #optional easing function from @mina or custom
+ - callback (function) #optional callback function that executes when the animation ends
+ = (Element) the current element
+ \*/
+ elproto.animate = function (attrs, ms, easing, callback) {
+ if (typeof easing == "function" && !easing.length) {
+ callback = easing;
+ easing = mina.linear;
+ }
+ if (attrs instanceof Animation) {
+ callback = attrs.callback;
+ easing = attrs.easing;
+ ms = easing.dur;
+ attrs = attrs.attr;
+ }
+ var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,
+ el = this;
+ for (var key in attrs) if (attrs[has](key)) {
+ if (el.equal) {
+ eq = el.equal(key, Str(attrs[key]));
+ from = eq.from;
+ to = eq.to;
+ f = eq.f;
+ } else {
+ from = +el.attr(key);
+ to = +attrs[key];
+ }
+ var len = is(from, "array") ? from.length : 1;
+ keys[key] = slice(fkeys.length, fkeys.length + len, f);
+ fkeys = fkeys.concat(from);
+ tkeys = tkeys.concat(to);
+ }
+ var now = mina.time(),
+ anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {
+ var attr = {};
+ for (var key in keys) if (keys[has](key)) {
+ attr[key] = keys[key](val);
+ }
+ el.attr(attr);
+ }, easing);
+ el.anims[anim.id] = anim;
+ anim._attrs = attrs;
+ anim._callback = callback;
+ eve("snap.animcreated." + el.id, anim);
+ eve.once("mina.finish." + anim.id, function () {
+ delete el.anims[anim.id];
+ callback && callback.call(el);
+ });
+ eve.once("mina.stop." + anim.id, function () {
+ delete el.anims[anim.id];
+ });
+ return el;
+ };
+ var eldata = {};
+ /*\
+ * Element.data
+ [ method ]
+ **
+ * Adds or retrieves given value associated with given key. (Don’t confuse
+ * with `data-` attributes)
+ *
+ * See also @Element.removeData
+ - key (string) key to store data
+ - value (any) #optional value to store
+ = (object) @Element
+ * or, if value is not specified:
+ = (any) value
+ > Usage
+ | for (var i = 0, i < 5, i++) {
+ | paper.circle(10 + 15 * i, 10, 10)
+ | .attr({fill: "#000"})
+ | .data("i", i)
+ | .click(function () {
+ | alert(this.data("i"));
+ | });
+ | }
+ \*/
+ elproto.data = function (key, value) {
+ var data = eldata[this.id] = eldata[this.id] || {};
+ if (arguments.length == 0){
+ eve("snap.data.get." + this.id, this, data, null);
+ return data;
+ }
+ if (arguments.length == 1) {
+ if (Snap.is(key, "object")) {
+ for (var i in key) if (key[has](i)) {
+ this.data(i, key[i]);
+ }
+ return this;
+ }
+ eve("snap.data.get." + this.id, this, data[key], key);
+ return data[key];
+ }
+ data[key] = value;
+ eve("snap.data.set." + this.id, this, value, key);
+ return this;
+ };
+ /*\
+ * Element.removeData
+ [ method ]
+ **
+ * Removes value associated with an element by given key.
+ * If key is not provided, removes all the data of the element.
+ - key (string) #optional key
+ = (object) @Element
+ \*/
+ elproto.removeData = function (key) {
+ if (key == null) {
+ eldata[this.id] = {};
+ } else {
+ eldata[this.id] && delete eldata[this.id][key];
+ }
+ return this;
+ };
+ /*\
+ * Element.outerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element, equivalent to HTML's `outerHTML`.
+ *
+ * See also @Element.innerSVG
+ = (string) SVG code for the element
+ \*/
+ /*\
+ * Element.toString
+ [ method ]
+ **
+ * See @Element.outerSVG
+ \*/
+ elproto.outerSVG = elproto.toString = toString(1);
+ /*\
+ * Element.innerSVG
+ [ method ]
+ **
+ * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`
+ = (string) SVG code for the element
+ \*/
+ elproto.innerSVG = toString();
+ function toString(type) {
+ return function () {
+ var res = type ? "<" + this.type : "",
+ attr = this.node.attributes,
+ chld = this.node.childNodes;
+ if (type) {
+ for (var i = 0, ii = attr.length; i < ii; i++) {
+ res += " " + attr[i].name + '="' +
+ attr[i].value.replace(/"/g, '\\"') + '"';
+ }
+ }
+ if (chld.length) {
+ type && (res += ">");
+ for (i = 0, ii = chld.length; i < ii; i++) {
+ if (chld[i].nodeType == 3) {
+ res += chld[i].nodeValue;
+ } else if (chld[i].nodeType == 1) {
+ res += wrap(chld[i]).toString();
+ }
+ }
+ type && (res += "</" + this.type + ">");
+ } else {
+ type && (res += "/>");
+ }
+ return res;
+ };
+ }
+ elproto.toDataURL = function () {
+ if (window && window.btoa) {
+ var bb = this.getBBox(),
+ svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
+ x: +bb.x.toFixed(3),
+ y: +bb.y.toFixed(3),
+ width: +bb.width.toFixed(3),
+ height: +bb.height.toFixed(3),
+ contents: this.outerSVG()
+ });
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
+ }
+ };
+ /*\
+ * Fragment.select
+ [ method ]
+ **
+ * See @Element.select
+ \*/
+ Fragment.prototype.select = elproto.select;
+ /*\
+ * Fragment.selectAll
+ [ method ]
+ **
+ * See @Element.selectAll
+ \*/
+ Fragment.prototype.selectAll = elproto.selectAll;
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var objectToString = Object.prototype.toString,
+ Str = String,
+ math = Math,
+ E = "";
+ function Matrix(a, b, c, d, e, f) {
+ if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
+ this.a = a.a;
+ this.b = a.b;
+ this.c = a.c;
+ this.d = a.d;
+ this.e = a.e;
+ this.f = a.f;
+ return;
+ }
+ if (a != null) {
+ this.a = +a;
+ this.b = +b;
+ this.c = +c;
+ this.d = +d;
+ this.e = +e;
+ this.f = +f;
+ } else {
+ this.a = 1;
+ this.b = 0;
+ this.c = 0;
+ this.d = 1;
+ this.e = 0;
+ this.f = 0;
+ }
+ }
+ (function (matrixproto) {
+ /*\
+ * Matrix.add
+ [ method ]
+ **
+ * Adds the given matrix to existing one
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - matrix (object) @Matrix
+ \*/
+ matrixproto.add = function (a, b, c, d, e, f) {
+ var out = [[], [], []],
+ m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
+ matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
+ x, y, z, res;
+
+ if (a && a instanceof Matrix) {
+ matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
+ }
+
+ for (x = 0; x < 3; x++) {
+ for (y = 0; y < 3; y++) {
+ res = 0;
+ for (z = 0; z < 3; z++) {
+ res += m[x][z] * matrix[z][y];
+ }
+ out[x][y] = res;
+ }
+ }
+ this.a = out[0][0];
+ this.b = out[1][0];
+ this.c = out[0][1];
+ this.d = out[1][1];
+ this.e = out[0][2];
+ this.f = out[1][2];
+ return this;
+ };
+ /*\
+ * Matrix.invert
+ [ method ]
+ **
+ * Returns an inverted version of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.invert = function () {
+ var me = this,
+ x = me.a * me.d - me.b * me.c;
+ return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
+ };
+ /*\
+ * Matrix.clone
+ [ method ]
+ **
+ * Returns a copy of the matrix
+ = (object) @Matrix
+ \*/
+ matrixproto.clone = function () {
+ return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
+ };
+ /*\
+ * Matrix.translate
+ [ method ]
+ **
+ * Translate the matrix
+ - x (number) horizontal offset distance
+ - y (number) vertical offset distance
+ \*/
+ matrixproto.translate = function (x, y) {
+ return this.add(1, 0, 0, 1, x, y);
+ };
+ /*\
+ * Matrix.scale
+ [ method ]
+ **
+ * Scales the matrix
+ - x (number) amount to be scaled, with `1` resulting in no change
+ - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)
+ - cx (number) #optional horizontal origin point from which to scale
+ - cy (number) #optional vertical origin point from which to scale
+ * Default cx, cy is the middle point of the element.
+ \*/
+ matrixproto.scale = function (x, y, cx, cy) {
+ y == null && (y = x);
+ (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
+ this.add(x, 0, 0, y, 0, 0);
+ (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
+ return this;
+ };
+ /*\
+ * Matrix.rotate
+ [ method ]
+ **
+ * Rotates the matrix
+ - a (number) angle of rotation, in degrees
+ - x (number) horizontal origin point from which to rotate
+ - y (number) vertical origin point from which to rotate
+ \*/
+ matrixproto.rotate = function (a, x, y) {
+ a = Snap.rad(a);
+ x = x || 0;
+ y = y || 0;
+ var cos = +math.cos(a).toFixed(9),
+ sin = +math.sin(a).toFixed(9);
+ this.add(cos, sin, -sin, cos, x, y);
+ return this.add(1, 0, 0, 1, -x, -y);
+ };
+ /*\
+ * Matrix.x
+ [ method ]
+ **
+ * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y
+ - x (number)
+ - y (number)
+ = (number) x
+ \*/
+ matrixproto.x = function (x, y) {
+ return x * this.a + y * this.c + this.e;
+ };
+ /*\
+ * Matrix.y
+ [ method ]
+ **
+ * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x
+ - x (number)
+ - y (number)
+ = (number) y
+ \*/
+ matrixproto.y = function (x, y) {
+ return x * this.b + y * this.d + this.f;
+ };
+ matrixproto.get = function (i) {
+ return +this[Str.fromCharCode(97 + i)].toFixed(4);
+ };
+ matrixproto.toString = function () {
+ return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
+ };
+ matrixproto.offset = function () {
+ return [this.e.toFixed(4), this.f.toFixed(4)];
+ };
+ function norm(a) {
+ return a[0] * a[0] + a[1] * a[1];
+ }
+ function normalize(a) {
+ var mag = math.sqrt(norm(a));
+ a[0] && (a[0] /= mag);
+ a[1] && (a[1] /= mag);
+ }
+ /*\
+ * Matrix.determinant
+ [ method ]
+ **
+ * Finds determinant of the given matrix.
+ = (number) determinant
+ \*/
+ matrixproto.determinant = function () {
+ return this.a * this.d - this.b * this.c;
+ };
+ /*\
+ * Matrix.split
+ [ method ]
+ **
+ * Splits matrix into primitive transformations
+ = (object) in format:
+ o dx (number) translation by x
+ o dy (number) translation by y
+ o scalex (number) scale by x
+ o scaley (number) scale by y
+ o shear (number) shear
+ o rotate (number) rotation in deg
+ o isSimple (boolean) could it be represented via simple transformations
+ \*/
+ matrixproto.split = function () {
+ var out = {};
+ // translation
+ out.dx = this.e;
+ out.dy = this.f;
+
+ // scale and shear
+ var row = [[this.a, this.c], [this.b, this.d]];
+ out.scalex = math.sqrt(norm(row[0]));
+ normalize(row[0]);
+
+ out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
+ row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
+
+ out.scaley = math.sqrt(norm(row[1]));
+ normalize(row[1]);
+ out.shear /= out.scaley;
+
+ if (this.determinant() < 0) {
+ out.scalex = -out.scalex;
+ }
+
+ // rotation
+ var sin = -row[0][1],
+ cos = row[1][1];
+ if (cos < 0) {
+ out.rotate = Snap.deg(math.acos(cos));
+ if (sin < 0) {
+ out.rotate = 360 - out.rotate;
+ }
+ } else {
+ out.rotate = Snap.deg(math.asin(sin));
+ }
+
+ out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
+ out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
+ out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
+ return out;
+ };
+ /*\
+ * Matrix.toTransformString
+ [ method ]
+ **
+ * Returns transform string that represents given matrix
+ = (string) transform string
+ \*/
+ matrixproto.toTransformString = function (shorter) {
+ var s = shorter || this.split();
+ if (!+s.shear.toFixed(9)) {
+ s.scalex = +s.scalex.toFixed(4);
+ s.scaley = +s.scaley.toFixed(4);
+ s.rotate = +s.rotate.toFixed(4);
+ return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
+ (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
+ (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
+ } else {
+ return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
+ }
+ };
+ })(Matrix.prototype);
+ /*\
+ * Snap.Matrix
+ [ method ]
+ **
+ * Matrix constructor, extend on your own risk.
+ * To create matrices use @Snap.matrix.
+ \*/
+ Snap.Matrix = Matrix;
+ /*\
+ * Snap.matrix
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns a matrix based on the given parameters
+ - a (number)
+ - b (number)
+ - c (number)
+ - d (number)
+ - e (number)
+ - f (number)
+ * or
+ - svgMatrix (SVGMatrix)
+ = (object) @Matrix
+ \*/
+ Snap.matrix = function (a, b, c, d, e, f) {
+ return new Matrix(a, b, c, d, e, f);
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var has = "hasOwnProperty",
+ make = Snap._.make,
+ wrap = Snap._.wrap,
+ is = Snap.is,
+ getSomeDefs = Snap._.getSomeDefs,
+ reURLValue = /^url\(#?([^)]+)\)$/,
+ $ = Snap._.$,
+ URL = Snap.url,
+ Str = String,
+ separator = Snap._.separator,
+ E = "";
+ // Attributes event handlers
+ eve.on("snap.util.attr.mask", function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value.type == "mask") {
+ var mask = value;
+ } else {
+ mask = make("mask", getSomeDefs(this));
+ mask.node.appendChild(value.node);
+ }
+ !mask.node.id && $(mask.node, {
+ id: mask.id
+ });
+ $(this.node, {
+ mask: URL(mask.id)
+ });
+ }
+ });
+ (function (clipIt) {
+ eve.on("snap.util.attr.clip", clipIt);
+ eve.on("snap.util.attr.clip-path", clipIt);
+ eve.on("snap.util.attr.clipPath", clipIt);
+ }(function (value) {
+ if (value instanceof Element || value instanceof Fragment) {
+ eve.stop();
+ if (value.type == "clipPath") {
+ var clip = value;
+ } else {
+ clip = make("clipPath", getSomeDefs(this));
+ clip.node.appendChild(value.node);
+ !clip.node.id && $(clip.node, {
+ id: clip.id
+ });
+ }
+ $(this.node, {
+ "clip-path": URL(clip.node.id || clip.id)
+ });
+ }
+ }));
+ function fillStroke(name) {
+ return function (value) {
+ eve.stop();
+ if (value instanceof Fragment && value.node.childNodes.length == 1 &&
+ (value.node.firstChild.tagName == "radialGradient" ||
+ value.node.firstChild.tagName == "linearGradient" ||
+ value.node.firstChild.tagName == "pattern")) {
+ value = value.node.firstChild;
+ getSomeDefs(this).appendChild(value);
+ value = wrap(value);
+ }
+ if (value instanceof Element) {
+ if (value.type == "radialGradient" || value.type == "linearGradient"
+ || value.type == "pattern") {
+ if (!value.node.id) {
+ $(value.node, {
+ id: value.id
+ });
+ }
+ var fill = URL(value.node.id);
+ } else {
+ fill = value.attr(name);
+ }
+ } else {
+ fill = Snap.color(value);
+ if (fill.error) {
+ var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
+ if (grad) {
+ if (!grad.node.id) {
+ $(grad.node, {
+ id: grad.id
+ });
+ }
+ fill = URL(grad.node.id);
+ } else {
+ fill = value;
+ }
+ } else {
+ fill = Str(fill);
+ }
+ }
+ var attrs = {};
+ attrs[name] = fill;
+ $(this.node, attrs);
+ this.node.style[name] = E;
+ };
+ }
+ eve.on("snap.util.attr.fill", fillStroke("fill"));
+ eve.on("snap.util.attr.stroke", fillStroke("stroke"));
+ var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
+ eve.on("snap.util.grad.parse", function parseGrad(string) {
+ string = Str(string);
+ var tokens = string.match(gradrg);
+ if (!tokens) {
+ return null;
+ }
+ var type = tokens[1],
+ params = tokens[2],
+ stops = tokens[3];
+ params = params.split(/\s*,\s*/).map(function (el) {
+ return +el == el ? +el : el;
+ });
+ if (params.length == 1 && params[0] == 0) {
+ params = [];
+ }
+ stops = stops.split("-");
+ stops = stops.map(function (el) {
+ el = el.split(":");
+ var out = {
+ color: el[0]
+ };
+ if (el[1]) {
+ out.offset = parseFloat(el[1]);
+ }
+ return out;
+ });
+ return {
+ type: type,
+ params: params,
+ stops: stops
+ };
+ });
+
+ eve.on("snap.util.attr.d", function (value) {
+ eve.stop();
+ if (is(value, "array") && is(value[0], "array")) {
+ value = Snap.path.toString.call(value);
+ }
+ value = Str(value);
+ if (value.match(/[ruo]/i)) {
+ value = Snap.path.toAbsolute(value);
+ }
+ $(this.node, {d: value});
+ })(-1);
+ eve.on("snap.util.attr.#text", function (value) {
+ eve.stop();
+ value = Str(value);
+ var txt = glob.doc.createTextNode(value);
+ while (this.node.firstChild) {
+ this.node.removeChild(this.node.firstChild);
+ }
+ this.node.appendChild(txt);
+ })(-1);
+ eve.on("snap.util.attr.path", function (value) {
+ eve.stop();
+ this.attr({d: value});
+ })(-1);
+ eve.on("snap.util.attr.class", function (value) {
+ eve.stop();
+ this.node.className.baseVal = value;
+ })(-1);
+ eve.on("snap.util.attr.viewBox", function (value) {
+ var vb;
+ if (is(value, "object") && "x" in value) {
+ vb = [value.x, value.y, value.width, value.height].join(" ");
+ } else if (is(value, "array")) {
+ vb = value.join(" ");
+ } else {
+ vb = value;
+ }
+ $(this.node, {
+ viewBox: vb
+ });
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.transform", function (value) {
+ this.transform(value);
+ eve.stop();
+ })(-1);
+ eve.on("snap.util.attr.r", function (value) {
+ if (this.type == "rect") {
+ eve.stop();
+ $(this.node, {
+ rx: value,
+ ry: value
+ });
+ }
+ })(-1);
+ eve.on("snap.util.attr.textpath", function (value) {
+ eve.stop();
+ if (this.type == "text") {
+ var id, tp, node;
+ if (!value && this.textPath) {
+ tp = this.textPath;
+ while (tp.node.firstChild) {
+ this.node.appendChild(tp.node.firstChild);
+ }
+ tp.remove();
+ delete this.textPath;
+ return;
+ }
+ if (is(value, "string")) {
+ var defs = getSomeDefs(this),
+ path = wrap(defs.parentNode).path(value);
+ defs.appendChild(path.node);
+ id = path.id;
+ path.attr({id: id});
+ } else {
+ value = wrap(value);
+ if (value instanceof Element) {
+ id = value.attr("id");
+ if (!id) {
+ id = value.id;
+ value.attr({id: id});
+ }
+ }
+ }
+ if (id) {
+ tp = this.textPath;
+ node = this.node;
+ if (tp) {
+ tp.attr({"xlink:href": "#" + id});
+ } else {
+ tp = $("textPath", {
+ "xlink:href": "#" + id
+ });
+ while (node.firstChild) {
+ tp.appendChild(node.firstChild);
+ }
+ node.appendChild(tp);
+ this.textPath = wrap(tp);
+ }
+ }
+ }
+ })(-1);
+ eve.on("snap.util.attr.text", function (value) {
+ if (this.type == "text") {
+ var i = 0,
+ node = this.node,
+ tuner = function (chunk) {
+ var out = $("tspan");
+ if (is(chunk, "array")) {
+ for (var i = 0; i < chunk.length; i++) {
+ out.appendChild(tuner(chunk[i]));
+ }
+ } else {
+ out.appendChild(glob.doc.createTextNode(chunk));
+ }
+ out.normalize && out.normalize();
+ return out;
+ };
+ while (node.firstChild) {
+ node.removeChild(node.firstChild);
+ }
+ var tuned = tuner(value);
+ while (tuned.firstChild) {
+ node.appendChild(tuned.firstChild);
+ }
+ }
+ eve.stop();
+ })(-1);
+ function setFontSize(value) {
+ eve.stop();
+ if (value == +value) {
+ value += "px";
+ }
+ this.node.style.fontSize = value;
+ }
+ eve.on("snap.util.attr.fontSize", setFontSize)(-1);
+ eve.on("snap.util.attr.font-size", setFontSize)(-1);
+
+
+ eve.on("snap.util.getattr.transform", function () {
+ eve.stop();
+ return this.transform();
+ })(-1);
+ eve.on("snap.util.getattr.textpath", function () {
+ eve.stop();
+ return this.textPath;
+ })(-1);
+ // Markers
+ (function () {
+ function getter(end) {
+ return function () {
+ eve.stop();
+ var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
+ if (style == "none") {
+ return style;
+ } else {
+ return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
+ }
+ };
+ }
+ function setter(end) {
+ return function (value) {
+ eve.stop();
+ var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
+ if (value == "" || !value) {
+ this.node.style[name] = "none";
+ return;
+ }
+ if (value.type == "marker") {
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ }
+ this.node.style[name] = URL(id);
+ return;
+ }
+ };
+ }
+ eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
+ eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
+ eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
+ eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
+ eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
+ eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
+ eve.on("snap.util.attr.marker-end", setter("end"))(-1);
+ eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
+ eve.on("snap.util.attr.marker-start", setter("start"))(-1);
+ eve.on("snap.util.attr.markerStart", setter("start"))(-1);
+ eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
+ eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
+ }());
+ eve.on("snap.util.getattr.r", function () {
+ if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
+ eve.stop();
+ return $(this.node, "rx");
+ }
+ })(-1);
+ function textExtract(node) {
+ var out = [];
+ var children = node.childNodes;
+ for (var i = 0, ii = children.length; i < ii; i++) {
+ var chi = children[i];
+ if (chi.nodeType == 3) {
+ out.push(chi.nodeValue);
+ }
+ if (chi.tagName == "tspan") {
+ if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
+ out.push(chi.firstChild.nodeValue);
+ } else {
+ out.push(textExtract(chi));
+ }
+ }
+ }
+ return out;
+ }
+ eve.on("snap.util.getattr.text", function () {
+ if (this.type == "text" || this.type == "tspan") {
+ eve.stop();
+ var out = textExtract(this.node);
+ return out.length == 1 ? out[0] : out;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.#text", function () {
+ return this.node.textContent;
+ })(-1);
+ eve.on("snap.util.getattr.viewBox", function () {
+ eve.stop();
+ var vb = $(this.node, "viewBox");
+ if (vb) {
+ vb = vb.split(separator);
+ return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.points", function () {
+ var p = $(this.node, "points");
+ eve.stop();
+ if (p) {
+ return p.split(separator);
+ } else {
+ return;
+ }
+ })(-1);
+ eve.on("snap.util.getattr.path", function () {
+ var p = $(this.node, "d");
+ eve.stop();
+ return p;
+ })(-1);
+ eve.on("snap.util.getattr.class", function () {
+ return this.node.className.baseVal;
+ })(-1);
+ function getFontSize() {
+ eve.stop();
+ return this.node.style.fontSize;
+ }
+ eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
+ eve.on("snap.util.getattr.font-size", getFontSize)(-1);
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
+ var proto = Paper.prototype,
+ is = Snap.is;
+ /*\
+ * Paper.rect
+ [ method ]
+ *
+ * Draws a rectangle
+ **
+ - x (number) x coordinate of the top left corner
+ - y (number) y coordinate of the top left corner
+ - width (number) width
+ - height (number) height
+ - rx (number) #optional horizontal radius for rounded corners, default is 0
+ - ry (number) #optional vertical radius for rounded corners, default is rx or 0
+ = (object) the `rect` element
+ **
+ > Usage
+ | // regular rectangle
+ | var c = paper.rect(10, 10, 50, 50);
+ | // rectangle with rounded corners
+ | var c = paper.rect(40, 40, 50, 50, 10);
+ \*/
+ proto.rect = function (x, y, w, h, rx, ry) {
+ var attr;
+ if (ry == null) {
+ ry = rx;
+ }
+ if (is(x, "object") && x == "[object Object]") {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ width: w,
+ height: h
+ };
+ if (rx != null) {
+ attr.rx = rx;
+ attr.ry = ry;
+ }
+ }
+ return this.el("rect", attr);
+ };
+ /*\
+ * Paper.circle
+ [ method ]
+ **
+ * Draws a circle
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - r (number) radius
+ = (object) the `circle` element
+ **
+ > Usage
+ | var c = paper.circle(50, 50, 40);
+ \*/
+ proto.circle = function (cx, cy, r) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr = {
+ cx: cx,
+ cy: cy,
+ r: r
+ };
+ }
+ return this.el("circle", attr);
+ };
+
+ var preload = (function () {
+ function onerror() {
+ this.parentNode.removeChild(this);
+ }
+ return function (src, f) {
+ var img = glob.doc.createElement("img"),
+ body = glob.doc.body;
+ img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
+ img.onload = function () {
+ f.call(img);
+ img.onload = img.onerror = null;
+ body.removeChild(img);
+ };
+ img.onerror = onerror;
+ body.appendChild(img);
+ img.src = src;
+ };
+ }());
+
+ /*\
+ * Paper.image
+ [ method ]
+ **
+ * Places an image on the surface
+ **
+ - src (string) URI of the source image
+ - x (number) x offset position
+ - y (number) y offset position
+ - width (number) width of the image
+ - height (number) height of the image
+ = (object) the `image` element
+ * or
+ = (object) Snap element object with type `image`
+ **
+ > Usage
+ | var c = paper.image("apple.png", 10, 10, 80, 80);
+ \*/
+ proto.image = function (src, x, y, width, height) {
+ var el = this.el("image");
+ if (is(src, "object") && "src" in src) {
+ el.attr(src);
+ } else if (src != null) {
+ var set = {
+ "xlink:href": src,
+ preserveAspectRatio: "none"
+ };
+ if (x != null && y != null) {
+ set.x = x;
+ set.y = y;
+ }
+ if (width != null && height != null) {
+ set.width = width;
+ set.height = height;
+ } else {
+ preload(src, function () {
+ Snap._.$(el.node, {
+ width: this.offsetWidth,
+ height: this.offsetHeight
+ });
+ });
+ }
+ Snap._.$(el.node, set);
+ }
+ return el;
+ };
+ /*\
+ * Paper.ellipse
+ [ method ]
+ **
+ * Draws an ellipse
+ **
+ - x (number) x coordinate of the centre
+ - y (number) y coordinate of the centre
+ - rx (number) horizontal radius
+ - ry (number) vertical radius
+ = (object) the `ellipse` element
+ **
+ > Usage
+ | var c = paper.ellipse(50, 50, 40, 20);
+ \*/
+ proto.ellipse = function (cx, cy, rx, ry) {
+ var attr;
+ if (is(cx, "object") && cx == "[object Object]") {
+ attr = cx;
+ } else if (cx != null) {
+ attr ={
+ cx: cx,
+ cy: cy,
+ rx: rx,
+ ry: ry
+ };
+ }
+ return this.el("ellipse", attr);
+ };
+ // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
+ /*\
+ * Paper.path
+ [ method ]
+ **
+ * Creates a `<path>` element using the given string as the path's definition
+ - pathString (string) #optional path string in SVG format
+ * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:
+ | "M10,20L30,40"
+ * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.
+ *
+ # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
+ # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>
+ # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>
+ # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>
+ # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>
+ # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>
+ # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>
+ # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>
+ # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>
+ # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>
+ # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>
+ # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>
+ # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
+ * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
+ * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.
+ > Usage
+ | var c = paper.path("M10 10L90 90");
+ | // draw a diagonal line:
+ | // move to 10,10, line to 90,90
+ \*/
+ proto.path = function (d) {
+ var attr;
+ if (is(d, "object") && !is(d, "array")) {
+ attr = d;
+ } else if (d) {
+ attr = {d: d};
+ }
+ return this.el("path", attr);
+ };
+ /*\
+ * Paper.g
+ [ method ]
+ **
+ * Creates a group element
+ **
+ - varargs (…) #optional elements to nest within the group
+ = (object) the `g` element
+ **
+ > Usage
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g(c2, c1); // note that the order of elements is different
+ * or
+ | var c1 = paper.circle(),
+ | c2 = paper.rect(),
+ | g = paper.g();
+ | g.add(c2, c1);
+ \*/
+ /*\
+ * Paper.group
+ [ method ]
+ **
+ * See @Paper.g
+ \*/
+ proto.group = proto.g = function (first) {
+ var attr,
+ el = this.el("g");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.svg
+ [ method ]
+ **
+ * Creates a nested SVG element.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `svg` element
+ **
+ \*/
+ proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {
+ var attrs = {};
+ if (is(x, "object") && y == null) {
+ attrs = x;
+ } else {
+ if (x != null) {
+ attrs.x = x;
+ }
+ if (y != null) {
+ attrs.y = y;
+ }
+ if (width != null) {
+ attrs.width = width;
+ }
+ if (height != null) {
+ attrs.height = height;
+ }
+ if (vbx != null && vby != null && vbw != null && vbh != null) {
+ attrs.viewBox = [vbx, vby, vbw, vbh];
+ }
+ }
+ return this.el("svg", attrs);
+ };
+ /*\
+ * Paper.mask
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a mask.
+ **
+ = (object) the `mask` element
+ **
+ \*/
+ proto.mask = function (first) {
+ var attr,
+ el = this.el("mask");
+ if (arguments.length == 1 && first && !first.type) {
+ el.attr(first);
+ } else if (arguments.length) {
+ el.add(Array.prototype.slice.call(arguments, 0));
+ }
+ return el;
+ };
+ /*\
+ * Paper.ptrn
+ [ method ]
+ **
+ * Equivalent in behaviour to @Paper.g, except it’s a pattern.
+ - x (number) @optional X of the element
+ - y (number) @optional Y of the element
+ - width (number) @optional width of the element
+ - height (number) @optional height of the element
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ **
+ = (object) the `pattern` element
+ **
+ \*/
+ proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {
+ if (is(x, "object")) {
+ var attr = x;
+ } else {
+ attr = {patternUnits: "userSpaceOnUse"};
+ if (x) {
+ attr.x = x;
+ }
+ if (y) {
+ attr.y = y;
+ }
+ if (width != null) {
+ attr.width = width;
+ }
+ if (height != null) {
+ attr.height = height;
+ }
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+ }
+ return this.el("pattern", attr);
+ };
+ /*\
+ * Paper.use
+ [ method ]
+ **
+ * Creates a <use> element.
+ - id (string) @optional id of element to link
+ * or
+ - id (Element) @optional element to link
+ **
+ = (object) the `use` element
+ **
+ \*/
+ proto.use = function (id) {
+ if (id != null) {
+ if (id instanceof Element) {
+ if (!id.attr("id")) {
+ id.attr({id: Snap._.id(id)});
+ }
+ id = id.attr("id");
+ }
+ if (String(id).charAt() == "#") {
+ id = id.substring(1);
+ }
+ return this.el("use", {"xlink:href": "#" + id});
+ } else {
+ return Element.prototype.use.call(this);
+ }
+ };
+ /*\
+ * Paper.symbol
+ [ method ]
+ **
+ * Creates a <symbol> element.
+ - vbx (number) @optional viewbox X
+ - vby (number) @optional viewbox Y
+ - vbw (number) @optional viewbox width
+ - vbh (number) @optional viewbox height
+ = (object) the `symbol` element
+ **
+ \*/
+ proto.symbol = function (vx, vy, vw, vh) {
+ var attr = {};
+ if (vx != null && vy != null && vw != null && vh != null) {
+ attr.viewBox = [vx, vy, vw, vh];
+ }
+
+ return this.el("symbol", attr);
+ };
+ /*\
+ * Paper.text
+ [ method ]
+ **
+ * Draws a text string
+ **
+ - x (number) x coordinate position
+ - y (number) y coordinate position
+ - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements
+ = (object) the `text` element
+ **
+ > Usage
+ | var t1 = paper.text(50, 50, "Snap");
+ | var t2 = paper.text(50, 50, ["S","n","a","p"]);
+ | // Text path usage
+ | t1.attr({textpath: "M10,10L100,100"});
+ | // or
+ | var pth = paper.path("M10,10L100,100");
+ | t1.attr({textpath: pth});
+ \*/
+ proto.text = function (x, y, text) {
+ var attr = {};
+ if (is(x, "object")) {
+ attr = x;
+ } else if (x != null) {
+ attr = {
+ x: x,
+ y: y,
+ text: text || ""
+ };
+ }
+ return this.el("text", attr);
+ };
+ /*\
+ * Paper.line
+ [ method ]
+ **
+ * Draws a line
+ **
+ - x1 (number) x coordinate position of the start
+ - y1 (number) y coordinate position of the start
+ - x2 (number) x coordinate position of the end
+ - y2 (number) y coordinate position of the end
+ = (object) the `line` element
+ **
+ > Usage
+ | var t1 = paper.line(50, 50, 100, 100);
+ \*/
+ proto.line = function (x1, y1, x2, y2) {
+ var attr = {};
+ if (is(x1, "object")) {
+ attr = x1;
+ } else if (x1 != null) {
+ attr = {
+ x1: x1,
+ x2: x2,
+ y1: y1,
+ y2: y2
+ };
+ }
+ return this.el("line", attr);
+ };
+ /*\
+ * Paper.polyline
+ [ method ]
+ **
+ * Draws a polyline
+ **
+ - points (array) array of points
+ * or
+ - varargs (…) points
+ = (object) the `polyline` element
+ **
+ > Usage
+ | var p1 = paper.polyline([10, 10, 100, 100]);
+ | var p2 = paper.polyline(10, 10, 100, 100);
+ \*/
+ proto.polyline = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polyline", attr);
+ };
+ /*\
+ * Paper.polygon
+ [ method ]
+ **
+ * Draws a polygon. See @Paper.polyline
+ \*/
+ proto.polygon = function (points) {
+ if (arguments.length > 1) {
+ points = Array.prototype.slice.call(arguments, 0);
+ }
+ var attr = {};
+ if (is(points, "object") && !is(points, "array")) {
+ attr = points;
+ } else if (points != null) {
+ attr = {points: points};
+ }
+ return this.el("polygon", attr);
+ };
+ // gradients
+ (function () {
+ var $ = Snap._.$;
+ // gradients' helpers
+ function Gstops() {
+ return this.selectAll("stop");
+ }
+ function GaddStop(color, offset) {
+ var stop = $("stop"),
+ attr = {
+ offset: +offset + "%"
+ };
+ color = Snap.color(color);
+ attr["stop-color"] = color.hex;
+ if (color.opacity < 1) {
+ attr["stop-opacity"] = color.opacity;
+ }
+ $(stop, attr);
+ this.node.appendChild(stop);
+ return this;
+ }
+ function GgetBBox() {
+ if (this.type == "linearGradient") {
+ var x1 = $(this.node, "x1") || 0,
+ x2 = $(this.node, "x2") || 1,
+ y1 = $(this.node, "y1") || 0,
+ y2 = $(this.node, "y2") || 0;
+ return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
+ } else {
+ var cx = this.node.cx || .5,
+ cy = this.node.cy || .5,
+ r = this.node.r || 0;
+ return Snap._.box(cx - r, cy - r, r * 2, r * 2);
+ }
+ }
+ function gradient(defs, str) {
+ var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
+ el;
+ if (!grad) {
+ return null;
+ }
+ grad.params.unshift(defs);
+ if (grad.type.toLowerCase() == "l") {
+ el = gradientLinear.apply(0, grad.params);
+ } else {
+ el = gradientRadial.apply(0, grad.params);
+ }
+ if (grad.type != grad.type.toLowerCase()) {
+ $(el.node, {
+ gradientUnits: "userSpaceOnUse"
+ });
+ }
+ var stops = grad.stops,
+ len = stops.length,
+ start = 0,
+ j = 0;
+ function seed(i, end) {
+ var step = (end - start) / (i - j);
+ for (var k = j; k < i; k++) {
+ stops[k].offset = +(+start + step * (k - j)).toFixed(2);
+ }
+ j = i;
+ start = end;
+ }
+ len--;
+ for (var i = 0; i < len; i++) if ("offset" in stops[i]) {
+ seed(i, stops[i].offset);
+ }
+ stops[len].offset = stops[len].offset || 100;
+ seed(len, stops[len].offset);
+ for (i = 0; i <= len; i++) {
+ var stop = stops[i];
+ el.addStop(stop.color, stop.offset);
+ }
+ return el;
+ }
+ function gradientLinear(defs, x1, y1, x2, y2) {
+ var el = Snap._.make("linearGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (x1 != null) {
+ $(el.node, {
+ x1: x1,
+ y1: y1,
+ x2: x2,
+ y2: y2
+ });
+ }
+ return el;
+ }
+ function gradientRadial(defs, cx, cy, r, fx, fy) {
+ var el = Snap._.make("radialGradient", defs);
+ el.stops = Gstops;
+ el.addStop = GaddStop;
+ el.getBBox = GgetBBox;
+ if (cx != null) {
+ $(el.node, {
+ cx: cx,
+ cy: cy,
+ r: r
+ });
+ }
+ if (fx != null && fy != null) {
+ $(el.node, {
+ fx: fx,
+ fy: fy
+ });
+ }
+ return el;
+ }
+ /*\
+ * Paper.gradient
+ [ method ]
+ **
+ * Creates a gradient element
+ **
+ - gradient (string) gradient descriptor
+ > Gradient Descriptor
+ * The gradient descriptor is an expression formatted as
+ * follows: `<type>(<coords>)<colors>`. The `<type>` can be
+ * either linear or radial. The uppercase `L` or `R` letters
+ * indicate absolute coordinates offset from the SVG surface.
+ * Lowercase `l` or `r` letters indicate coordinates
+ * calculated relative to the element to which the gradient is
+ * applied. Coordinates specify a linear gradient vector as
+ * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
+ * `r` and optional `fx`, `fy` specifying a focal point away
+ * from the center of the circle. Specify `<colors>` as a list
+ * of dash-separated CSS color values. Each color may be
+ * followed by a custom offset value, separated with a colon
+ * character.
+ > Examples
+ * Linear gradient, relative from top-left corner to bottom-right
+ * corner, from black through red to white:
+ | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff");
+ * Linear gradient, absolute from (0, 0) to (100, 100), from black
+ * through red at 25% to white:
+ | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25-#fff");
+ * Radial gradient, relative from the center of the element with radius
+ * half the width, from black to white:
+ | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff");
+ * To apply the gradient:
+ | paper.circle(50, 50, 40).attr({
+ | fill: g
+ | });
+ = (object) the `gradient` element
+ \*/
+ proto.gradient = function (str) {
+ return gradient(this.defs, str);
+ };
+ proto.gradientLinear = function (x1, y1, x2, y2) {
+ return gradientLinear(this.defs, x1, y1, x2, y2);
+ };
+ proto.gradientRadial = function (cx, cy, r, fx, fy) {
+ return gradientRadial(this.defs, cx, cy, r, fx, fy);
+ };
+ /*\
+ * Paper.toString
+ [ method ]
+ **
+ * Returns SVG code for the @Paper
+ = (string) SVG code for the @Paper
+ \*/
+ proto.toString = function () {
+ var doc = this.node.ownerDocument,
+ f = doc.createDocumentFragment(),
+ d = doc.createElement("div"),
+ svg = this.node.cloneNode(true),
+ res;
+ f.appendChild(d);
+ d.appendChild(svg);
+ Snap._.$(svg, {xmlns: "http://www.w3.org/2000/svg"});
+ res = d.innerHTML;
+ f.removeChild(f.firstChild);
+ return res;
+ };
+ /*\
+ * Paper.toDataURL
+ [ method ]
+ **
+ * Returns SVG code for the @Paper as Data URI string.
+ = (string) Data URI string
+ \*/
+ proto.toDataURL = function () {
+ if (window && window.btoa) {
+ return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
+ }
+ };
+ /*\
+ * Paper.clear
+ [ method ]
+ **
+ * Removes all child nodes of the paper, except <defs>.
+ \*/
+ proto.clear = function () {
+ var node = this.node.firstChild,
+ next;
+ while (node) {
+ next = node.nextSibling;
+ if (node.tagName != "defs") {
+ node.parentNode.removeChild(node);
+ } else {
+ proto.clear.call({node: node});
+ }
+ node = next;
+ }
+ };
+ }());
+});
+
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ is = Snap.is,
+ clone = Snap._.clone,
+ has = "hasOwnProperty",
+ p2s = /,?([a-z]),?/gi,
+ toFloat = parseFloat,
+ math = Math,
+ PI = math.PI,
+ mmin = math.min,
+ mmax = math.max,
+ pow = math.pow,
+ abs = math.abs;
+ function paths(ps) {
+ var p = paths.ps = paths.ps || {};
+ if (p[ps]) {
+ p[ps].sleep = 100;
+ } else {
+ p[ps] = {
+ sleep: 100
+ };
+ }
+ setTimeout(function () {
+ for (var key in p) if (p[has](key) && key != ps) {
+ p[key].sleep--;
+ !p[key].sleep && delete p[key];
+ }
+ });
+ return p[ps];
+ }
+ function box(x, y, width, height) {
+ if (x == null) {
+ x = y = width = height = 0;
+ }
+ if (y == null) {
+ y = x.y;
+ width = x.width;
+ height = x.height;
+ x = x.x;
+ }
+ return {
+ x: x,
+ y: y,
+ width: width,
+ w: width,
+ height: height,
+ h: height,
+ x2: x + width,
+ y2: y + height,
+ cx: x + width / 2,
+ cy: y + height / 2,
+ r1: math.min(width, height) / 2,
+ r2: math.max(width, height) / 2,
+ r0: math.sqrt(width * width + height * height) / 2,
+ path: rectPath(x, y, width, height),
+ vb: [x, y, width, height].join(" ")
+ };
+ }
+ function toString() {
+ return this.join(",").replace(p2s, "$1");
+ }
+ function pathClone(pathArray) {
+ var res = clone(pathArray);
+ res.toString = toString;
+ return res;
+ }
+ function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
+ if (length == null) {
+ return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
+ } else {
+ return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
+ getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
+ }
+ }
+ function getLengthFactory(istotal, subpath) {
+ function O(val) {
+ return +(+val).toFixed(3);
+ }
+ return Snap._.cacher(function (path, length, onlystart) {
+ if (path instanceof Element) {
+ path = path.attr("d");
+ }
+ path = path2curve(path);
+ var x, y, p, l, sp = "", subpaths = {}, point,
+ len = 0;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = +p[1];
+ y = +p[2];
+ } else {
+ l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ if (len + l > length) {
+ if (subpath && !subpaths.start) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ sp += [
+ "C" + O(point.start.x),
+ O(point.start.y),
+ O(point.m.x),
+ O(point.m.y),
+ O(point.x),
+ O(point.y)
+ ];
+ if (onlystart) {return sp;}
+ subpaths.start = sp;
+ sp = [
+ "M" + O(point.x),
+ O(point.y) + "C" + O(point.n.x),
+ O(point.n.y),
+ O(point.end.x),
+ O(point.end.y),
+ O(p[5]),
+ O(p[6])
+ ].join();
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ continue;
+ }
+ if (!istotal && !subpath) {
+ point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
+ return point;
+ }
+ }
+ len += l;
+ x = +p[5];
+ y = +p[6];
+ }
+ sp += p.shift() + p;
+ }
+ subpaths.end = sp;
+ point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
+ return point;
+ }, null, Snap._.clone);
+ }
+ var getTotalLength = getLengthFactory(1),
+ getPointAtLength = getLengthFactory(),
+ getSubpathsAtLength = getLengthFactory(0, 1);
+ function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t,
+ t13 = pow(t1, 3),
+ t12 = pow(t1, 2),
+ t2 = t * t,
+ t3 = t2 * t,
+ x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
+ y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
+ mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
+ my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
+ nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
+ ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
+ ax = t1 * p1x + t * c1x,
+ ay = t1 * p1y + t * c1y,
+ cx = t1 * c2x + t * p2x,
+ cy = t1 * c2y + t * p2y,
+ alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
+ // (mx > nx || my < ny) && (alpha += 180);
+ return {
+ x: x,
+ y: y,
+ m: {x: mx, y: my},
+ n: {x: nx, y: ny},
+ start: {x: ax, y: ay},
+ end: {x: cx, y: cy},
+ alpha: alpha
+ };
+ }
+ function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
+ if (!Snap.is(p1x, "array")) {
+ p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
+ }
+ var bbox = curveDim.apply(null, p1x);
+ return box(
+ bbox.min.x,
+ bbox.min.y,
+ bbox.max.x - bbox.min.x,
+ bbox.max.y - bbox.min.y
+ );
+ }
+ function isPointInsideBBox(bbox, x, y) {
+ return x >= bbox.x &&
+ x <= bbox.x + bbox.width &&
+ y >= bbox.y &&
+ y <= bbox.y + bbox.height;
+ }
+ function isBBoxIntersect(bbox1, bbox2) {
+ bbox1 = box(bbox1);
+ bbox2 = box(bbox2);
+ return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)
+ || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)
+ || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)
+ || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)
+ || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)
+ || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
+ || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
+ && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y
+ || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
+ }
+ function base3(t, p1, p2, p3, p4) {
+ var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
+ t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
+ return t * t2 - 3 * p1 + 3 * p2;
+ }
+ function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
+ if (z == null) {
+ z = 1;
+ }
+ z = z > 1 ? 1 : z < 0 ? 0 : z;
+ var z2 = z / 2,
+ n = 12,
+ Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
+ Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],
+ sum = 0;
+ for (var i = 0; i < n; i++) {
+ var ct = z2 * Tvalues[i] + z2,
+ xbase = base3(ct, x1, x2, x3, x4),
+ ybase = base3(ct, y1, y2, y3, y4),
+ comb = xbase * xbase + ybase * ybase;
+ sum += Cvalues[i] * math.sqrt(comb);
+ }
+ return z2 * sum;
+ }
+ function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
+ if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
+ return;
+ }
+ var t = 1,
+ step = t / 2,
+ t2 = t - step,
+ l,
+ e = .01;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ while (abs(l - ll) > e) {
+ step /= 2;
+ t2 += (l < ll ? 1 : -1) * step;
+ l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
+ }
+ return t2;
+ }
+ function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
+ if (
+ mmax(x1, x2) < mmin(x3, x4) ||
+ mmin(x1, x2) > mmax(x3, x4) ||
+ mmax(y1, y2) < mmin(y3, y4) ||
+ mmin(y1, y2) > mmax(y3, y4)
+ ) {
+ return;
+ }
+ var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
+ ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
+ denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
+
+ if (!denominator) {
+ return;
+ }
+ var px = nx / denominator,
+ py = ny / denominator,
+ px2 = +px.toFixed(2),
+ py2 = +py.toFixed(2);
+ if (
+ px2 < +mmin(x1, x2).toFixed(2) ||
+ px2 > +mmax(x1, x2).toFixed(2) ||
+ px2 < +mmin(x3, x4).toFixed(2) ||
+ px2 > +mmax(x3, x4).toFixed(2) ||
+ py2 < +mmin(y1, y2).toFixed(2) ||
+ py2 > +mmax(y1, y2).toFixed(2) ||
+ py2 < +mmin(y3, y4).toFixed(2) ||
+ py2 > +mmax(y3, y4).toFixed(2)
+ ) {
+ return;
+ }
+ return {x: px, y: py};
+ }
+ function inter(bez1, bez2) {
+ return interHelper(bez1, bez2);
+ }
+ function interCount(bez1, bez2) {
+ return interHelper(bez1, bez2, 1);
+ }
+ function interHelper(bez1, bez2, justCount) {
+ var bbox1 = bezierBBox(bez1),
+ bbox2 = bezierBBox(bez2);
+ if (!isBBoxIntersect(bbox1, bbox2)) {
+ return justCount ? 0 : [];
+ }
+ var l1 = bezlen.apply(0, bez1),
+ l2 = bezlen.apply(0, bez2),
+ n1 = ~~(l1 / 8),
+ n2 = ~~(l2 / 8),
+ dots1 = [],
+ dots2 = [],
+ xy = {},
+ res = justCount ? 0 : [];
+ for (var i = 0; i < n1 + 1; i++) {
+ var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
+ dots1.push({x: p.x, y: p.y, t: i / n1});
+ }
+ for (i = 0; i < n2 + 1; i++) {
+ p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
+ dots2.push({x: p.x, y: p.y, t: i / n2});
+ }
+ for (i = 0; i < n1; i++) {
+ for (var j = 0; j < n2; j++) {
+ var di = dots1[i],
+ di1 = dots1[i + 1],
+ dj = dots2[j],
+ dj1 = dots2[j + 1],
+ ci = abs(di1.x - di.x) < .001 ? "y" : "x",
+ cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
+ is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
+ if (is) {
+ if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
+ continue;
+ }
+ xy[is.x.toFixed(4)] = is.y.toFixed(4);
+ var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
+ t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
+ if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
+ if (justCount) {
+ res++;
+ } else {
+ res.push({
+ x: is.x,
+ y: is.y,
+ t1: t1,
+ t2: t2
+ });
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function pathIntersection(path1, path2) {
+ return interPathHelper(path1, path2);
+ }
+ function pathIntersectionNumber(path1, path2) {
+ return interPathHelper(path1, path2, 1);
+ }
+ function interPathHelper(path1, path2, justCount) {
+ path1 = path2curve(path1);
+ path2 = path2curve(path2);
+ var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
+ res = justCount ? 0 : [];
+ for (var i = 0, ii = path1.length; i < ii; i++) {
+ var pi = path1[i];
+ if (pi[0] == "M") {
+ x1 = x1m = pi[1];
+ y1 = y1m = pi[2];
+ } else {
+ if (pi[0] == "C") {
+ bez1 = [x1, y1].concat(pi.slice(1));
+ x1 = bez1[6];
+ y1 = bez1[7];
+ } else {
+ bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
+ x1 = x1m;
+ y1 = y1m;
+ }
+ for (var j = 0, jj = path2.length; j < jj; j++) {
+ var pj = path2[j];
+ if (pj[0] == "M") {
+ x2 = x2m = pj[1];
+ y2 = y2m = pj[2];
+ } else {
+ if (pj[0] == "C") {
+ bez2 = [x2, y2].concat(pj.slice(1));
+ x2 = bez2[6];
+ y2 = bez2[7];
+ } else {
+ bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
+ x2 = x2m;
+ y2 = y2m;
+ }
+ var intr = interHelper(bez1, bez2, justCount);
+ if (justCount) {
+ res += intr;
+ } else {
+ for (var k = 0, kk = intr.length; k < kk; k++) {
+ intr[k].segment1 = i;
+ intr[k].segment2 = j;
+ intr[k].bez1 = bez1;
+ intr[k].bez2 = bez2;
+ }
+ res = res.concat(intr);
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+ function isPointInsidePath(path, x, y) {
+ var bbox = pathBBox(path);
+ return isPointInsideBBox(bbox, x, y) &&
+ interPathHelper(path, [["M", x, y], ["H", bbox.x2 + 10]], 1) % 2 == 1;
+ }
+ function pathBBox(path) {
+ var pth = paths(path);
+ if (pth.bbox) {
+ return clone(pth.bbox);
+ }
+ if (!path) {
+ return box();
+ }
+ path = path2curve(path);
+ var x = 0,
+ y = 0,
+ X = [],
+ Y = [],
+ p;
+ for (var i = 0, ii = path.length; i < ii; i++) {
+ p = path[i];
+ if (p[0] == "M") {
+ x = p[1];
+ y = p[2];
+ X.push(x);
+ Y.push(y);
+ } else {
+ var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
+ X = X.concat(dim.min.x, dim.max.x);
+ Y = Y.concat(dim.min.y, dim.max.y);
+ x = p[5];
+ y = p[6];
+ }
+ }
+ var xmin = mmin.apply(0, X),
+ ymin = mmin.apply(0, Y),
+ xmax = mmax.apply(0, X),
+ ymax = mmax.apply(0, Y),
+ bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
+ pth.bbox = clone(bb);
+ return bb;
+ }
+ function rectPath(x, y, w, h, r) {
+ if (r) {
+ return [
+ ["M", +x + (+r), y],
+ ["l", w - r * 2, 0],
+ ["a", r, r, 0, 0, 1, r, r],
+ ["l", 0, h - r * 2],
+ ["a", r, r, 0, 0, 1, -r, r],
+ ["l", r * 2 - w, 0],
+ ["a", r, r, 0, 0, 1, -r, -r],
+ ["l", 0, r * 2 - h],
+ ["a", r, r, 0, 0, 1, r, -r],
+ ["z"]
+ ];
+ }
+ var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
+ res.toString = toString;
+ return res;
+ }
+ function ellipsePath(x, y, rx, ry, a) {
+ if (a == null && ry == null) {
+ ry = rx;
+ }
+ x = +x;
+ y = +y;
+ rx = +rx;
+ ry = +ry;
+ if (a != null) {
+ var rad = Math.PI / 180,
+ x1 = x + rx * Math.cos(-ry * rad),
+ x2 = x + rx * Math.cos(-a * rad),
+ y1 = y + rx * Math.sin(-ry * rad),
+ y2 = y + rx * Math.sin(-a * rad),
+ res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
+ } else {
+ res = [
+ ["M", x, y],
+ ["m", 0, -ry],
+ ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
+ ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
+ ["z"]
+ ];
+ }
+ res.toString = toString;
+ return res;
+ }
+ var unit2px = Snap._unit2px,
+ getPath = {
+ path: function (el) {
+ return el.attr("path");
+ },
+ circle: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx, attr.cy, attr.r);
+ },
+ ellipse: function (el) {
+ var attr = unit2px(el);
+ return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
+ },
+ rect: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
+ },
+ image: function (el) {
+ var attr = unit2px(el);
+ return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
+ },
+ line: function (el) {
+ return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
+ },
+ polyline: function (el) {
+ return "M" + el.attr("points");
+ },
+ polygon: function (el) {
+ return "M" + el.attr("points") + "z";
+ },
+ deflt: function (el) {
+ var bbox = el.node.getBBox();
+ return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
+ }
+ };
+ function pathToRelative(pathArray) {
+ var pth = paths(pathArray),
+ lowerCase = String.prototype.toLowerCase;
+ if (pth.rel) {
+ return pathClone(pth.rel);
+ }
+ if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0;
+ if (pathArray[0][0] == "M") {
+ x = pathArray[0][1];
+ y = pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res.push(["M", x, y]);
+ }
+ for (var i = start, ii = pathArray.length; i < ii; i++) {
+ var r = res[i] = [],
+ pa = pathArray[i];
+ if (pa[0] != lowerCase.call(pa[0])) {
+ r[0] = lowerCase.call(pa[0]);
+ switch (r[0]) {
+ case "a":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +(pa[6] - x).toFixed(3);
+ r[7] = +(pa[7] - y).toFixed(3);
+ break;
+ case "v":
+ r[1] = +(pa[1] - y).toFixed(3);
+ break;
+ case "m":
+ mx = pa[1];
+ my = pa[2];
+ default:
+ for (var j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
+ }
+ }
+ } else {
+ r = res[i] = [];
+ if (pa[0] == "m") {
+ mx = pa[1] + x;
+ my = pa[2] + y;
+ }
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ res[i][k] = pa[k];
+ }
+ }
+ var len = res[i].length;
+ switch (res[i][0]) {
+ case "z":
+ x = mx;
+ y = my;
+ break;
+ case "h":
+ x += +res[i][len - 1];
+ break;
+ case "v":
+ y += +res[i][len - 1];
+ break;
+ default:
+ x += +res[i][len - 2];
+ y += +res[i][len - 1];
+ }
+ }
+ res.toString = toString;
+ pth.rel = pathClone(res);
+ return res;
+ }
+ function pathToAbsolute(pathArray) {
+ var pth = paths(pathArray);
+ if (pth.abs) {
+ return pathClone(pth.abs);
+ }
+ if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough assumption
+ pathArray = Snap.parsePathString(pathArray);
+ }
+ if (!pathArray || !pathArray.length) {
+ return [["M", 0, 0]];
+ }
+ var res = [],
+ x = 0,
+ y = 0,
+ mx = 0,
+ my = 0,
+ start = 0,
+ pa0;
+ if (pathArray[0][0] == "M") {
+ x = +pathArray[0][1];
+ y = +pathArray[0][2];
+ mx = x;
+ my = y;
+ start++;
+ res[0] = ["M", x, y];
+ }
+ var crz = pathArray.length == 3 &&
+ pathArray[0][0] == "M" &&
+ pathArray[1][0].toUpperCase() == "R" &&
+ pathArray[2][0].toUpperCase() == "Z";
+ for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
+ res.push(r = []);
+ pa = pathArray[i];
+ pa0 = pa[0];
+ if (pa0 != pa0.toUpperCase()) {
+ r[0] = pa0.toUpperCase();
+ switch (r[0]) {
+ case "A":
+ r[1] = pa[1];
+ r[2] = pa[2];
+ r[3] = pa[3];
+ r[4] = pa[4];
+ r[5] = pa[5];
+ r[6] = +pa[6] + x;
+ r[7] = +pa[7] + y;
+ break;
+ case "V":
+ r[1] = +pa[1] + y;
+ break;
+ case "H":
+ r[1] = +pa[1] + x;
+ break;
+ case "R":
+ var dots = [x, y].concat(pa.slice(1));
+ for (var j = 2, jj = dots.length; j < jj; j++) {
+ dots[j] = +dots[j] + x;
+ dots[++j] = +dots[j] + y;
+ }
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ break;
+ case "O":
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ break;
+ case "U":
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ break;
+ case "M":
+ mx = +pa[1] + x;
+ my = +pa[2] + y;
+ default:
+ for (j = 1, jj = pa.length; j < jj; j++) {
+ r[j] = +pa[j] + ((j % 2) ? x : y);
+ }
+ }
+ } else if (pa0 == "R") {
+ dots = [x, y].concat(pa.slice(1));
+ res.pop();
+ res = res.concat(catmullRom2bezier(dots, crz));
+ r = ["R"].concat(pa.slice(-2));
+ } else if (pa0 == "O") {
+ res.pop();
+ dots = ellipsePath(x, y, pa[1], pa[2]);
+ dots.push(dots[0]);
+ res = res.concat(dots);
+ } else if (pa0 == "U") {
+ res.pop();
+ res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
+ r = ["U"].concat(res[res.length - 1].slice(-2));
+ } else {
+ for (var k = 0, kk = pa.length; k < kk; k++) {
+ r[k] = pa[k];
+ }
+ }
+ pa0 = pa0.toUpperCase();
+ if (pa0 != "O") {
+ switch (r[0]) {
+ case "Z":
+ x = +mx;
+ y = +my;
+ break;
+ case "H":
+ x = r[1];
+ break;
+ case "V":
+ y = r[1];
+ break;
+ case "M":
+ mx = r[r.length - 2];
+ my = r[r.length - 1];
+ default:
+ x = r[r.length - 2];
+ y = r[r.length - 1];
+ }
+ }
+ }
+ res.toString = toString;
+ pth.abs = pathClone(res);
+ return res;
+ }
+ function l2c(x1, y1, x2, y2) {
+ return [x1, y1, x2, y2, x2, y2];
+ }
+ function q2c(x1, y1, ax, ay, x2, y2) {
+ var _13 = 1 / 3,
+ _23 = 2 / 3;
+ return [
+ _13 * x1 + _23 * ax,
+ _13 * y1 + _23 * ay,
+ _13 * x2 + _23 * ax,
+ _13 * y2 + _23 * ay,
+ x2,
+ y2
+ ];
+ }
+ function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
+ // for more information of where this math came from visit:
+ // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
+ var _120 = PI * 120 / 180,
+ rad = PI / 180 * (+angle || 0),
+ res = [],
+ xy,
+ rotate = Snap._.cacher(function (x, y, rad) {
+ var X = x * math.cos(rad) - y * math.sin(rad),
+ Y = x * math.sin(rad) + y * math.cos(rad);
+ return {x: X, y: Y};
+ });
+ if (!recursive) {
+ xy = rotate(x1, y1, -rad);
+ x1 = xy.x;
+ y1 = xy.y;
+ xy = rotate(x2, y2, -rad);
+ x2 = xy.x;
+ y2 = xy.y;
+ var cos = math.cos(PI / 180 * angle),
+ sin = math.sin(PI / 180 * angle),
+ x = (x1 - x2) / 2,
+ y = (y1 - y2) / 2;
+ var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
+ if (h > 1) {
+ h = math.sqrt(h);
+ rx = h * rx;
+ ry = h * ry;
+ }
+ var rx2 = rx * rx,
+ ry2 = ry * ry,
+ k = (large_arc_flag == sweep_flag ? -1 : 1) *
+ math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
+ cx = k * rx * y / ry + (x1 + x2) / 2,
+ cy = k * -ry * x / rx + (y1 + y2) / 2,
+ f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
+ f2 = math.asin(((y2 - cy) / ry).toFixed(9));
+
+ f1 = x1 < cx ? PI - f1 : f1;
+ f2 = x2 < cx ? PI - f2 : f2;
+ f1 < 0 && (f1 = PI * 2 + f1);
+ f2 < 0 && (f2 = PI * 2 + f2);
+ if (sweep_flag && f1 > f2) {
+ f1 = f1 - PI * 2;
+ }
+ if (!sweep_flag && f2 > f1) {
+ f2 = f2 - PI * 2;
+ }
+ } else {
+ f1 = recursive[0];
+ f2 = recursive[1];
+ cx = recursive[2];
+ cy = recursive[3];
+ }
+ var df = f2 - f1;
+ if (abs(df) > _120) {
+ var f2old = f2,
+ x2old = x2,
+ y2old = y2;
+ f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
+ x2 = cx + rx * math.cos(f2);
+ y2 = cy + ry * math.sin(f2);
+ res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
+ }
+ df = f2 - f1;
+ var c1 = math.cos(f1),
+ s1 = math.sin(f1),
+ c2 = math.cos(f2),
+ s2 = math.sin(f2),
+ t = math.tan(df / 4),
+ hx = 4 / 3 * rx * t,
+ hy = 4 / 3 * ry * t,
+ m1 = [x1, y1],
+ m2 = [x1 + hx * s1, y1 - hy * c1],
+ m3 = [x2 + hx * s2, y2 - hy * c2],
+ m4 = [x2, y2];
+ m2[0] = 2 * m1[0] - m2[0];
+ m2[1] = 2 * m1[1] - m2[1];
+ if (recursive) {
+ return [m2, m3, m4].concat(res);
+ } else {
+ res = [m2, m3, m4].concat(res).join().split(",");
+ var newres = [];
+ for (var i = 0, ii = res.length; i < ii; i++) {
+ newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
+ }
+ return newres;
+ }
+ }
+ function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
+ var t1 = 1 - t;
+ return {
+ x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
+ y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
+ };
+ }
+
+ // Returns bounding box of cubic bezier curve.
+ // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
+ // Original version: NISHIO Hirokazu
+ // Modifications: https://github.com/timo22345
+ function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var tvalues = [],
+ bounds = [[], []],
+ a, b, c, t, t1, t2, b2ac, sqrtb2ac;
+ for (var i = 0; i < 2; ++i) {
+ if (i == 0) {
+ b = 6 * x0 - 12 * x1 + 6 * x2;
+ a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
+ c = 3 * x1 - 3 * x0;
+ } else {
+ b = 6 * y0 - 12 * y1 + 6 * y2;
+ a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
+ c = 3 * y1 - 3 * y0;
+ }
+ if (abs(a) < 1e-12) {
+ if (abs(b) < 1e-12) {
+ continue;
+ }
+ t = -c / b;
+ if (0 < t && t < 1) {
+ tvalues.push(t);
+ }
+ continue;
+ }
+ b2ac = b * b - 4 * c * a;
+ sqrtb2ac = math.sqrt(b2ac);
+ if (b2ac < 0) {
+ continue;
+ }
+ t1 = (-b + sqrtb2ac) / (2 * a);
+ if (0 < t1 && t1 < 1) {
+ tvalues.push(t1);
+ }
+ t2 = (-b - sqrtb2ac) / (2 * a);
+ if (0 < t2 && t2 < 1) {
+ tvalues.push(t2);
+ }
+ }
+
+ var x, y, j = tvalues.length,
+ jlen = j,
+ mt;
+ while (j--) {
+ t = tvalues[j];
+ mt = 1 - t;
+ bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
+ bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
+ }
+
+ bounds[0][jlen] = x0;
+ bounds[1][jlen] = y0;
+ bounds[0][jlen + 1] = x3;
+ bounds[1][jlen + 1] = y3;
+ bounds[0].length = bounds[1].length = jlen + 2;
+
+
+ return {
+ min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},
+ max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}
+ };
+ }
+
+ function path2curve(path, path2) {
+ var pth = !path2 && paths(path);
+ if (!path2 && pth.curve) {
+ return pathClone(pth.curve);
+ }
+ var p = pathToAbsolute(path),
+ p2 = path2 && pathToAbsolute(path2),
+ attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
+ processPath = function (path, d, pcom) {
+ var nx, ny;
+ if (!path) {
+ return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
+ }
+ !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);
+ switch (path[0]) {
+ case "M":
+ d.X = path[1];
+ d.Y = path[2];
+ break;
+ case "A":
+ path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
+ break;
+ case "S":
+ if (pcom == "C" || pcom == "S") { // In "S" case we have to take into account, if the previous command is C/S.
+ nx = d.x * 2 - d.bx; // And reflect the previous
+ ny = d.y * 2 - d.by; // command's control point relative to the current point.
+ }
+ else { // or some else or nothing
+ nx = d.x;
+ ny = d.y;
+ }
+ path = ["C", nx, ny].concat(path.slice(1));
+ break;
+ case "T":
+ if (pcom == "Q" || pcom == "T") { // In "T" case we have to take into account, if the previous command is Q/T.
+ d.qx = d.x * 2 - d.qx; // And make a reflection similar
+ d.qy = d.y * 2 - d.qy; // to case "S".
+ }
+ else { // or something else or nothing
+ d.qx = d.x;
+ d.qy = d.y;
+ }
+ path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
+ break;
+ case "Q":
+ d.qx = path[1];
+ d.qy = path[2];
+ path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
+ break;
+ case "L":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
+ break;
+ case "H":
+ path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
+ break;
+ case "V":
+ path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
+ break;
+ case "Z":
+ path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
+ break;
+ }
+ return path;
+ },
+ fixArc = function (pp, i) {
+ if (pp[i].length > 7) {
+ pp[i].shift();
+ var pi = pp[i];
+ while (pi.length) {
+ pcoms1[i] = "A"; // if created multiple C:s, their original seg is saved
+ p2 && (pcoms2[i] = "A"); // the same as above
+ pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
+ }
+ pp.splice(i, 1);
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ fixM = function (path1, path2, a1, a2, i) {
+ if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
+ path2.splice(i, 0, ["M", a2.x, a2.y]);
+ a1.bx = 0;
+ a1.by = 0;
+ a1.x = path1[i][1];
+ a1.y = path1[i][2];
+ ii = mmax(p.length, p2 && p2.length || 0);
+ }
+ },
+ pcoms1 = [], // path commands of original path p
+ pcoms2 = [], // path commands of original path p2
+ pfirst = "", // temporary holder for original path command
+ pcom = ""; // holder for previous path command of original path
+ for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
+ p[i] && (pfirst = p[i][0]); // save current path command
+
+ if (pfirst != "C") // C is not saved yet, because it may be result of conversion
+ {
+ pcoms1[i] = pfirst; // Save current path command
+ i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom
+ }
+ p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
+
+ if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
+ // which may produce multiple C:s
+ // so we have to make sure that C is also C in original path
+
+ fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
+
+ if (p2) { // the same procedures is done to p2
+ p2[i] && (pfirst = p2[i][0]);
+ if (pfirst != "C") {
+ pcoms2[i] = pfirst;
+ i && (pcom = pcoms2[i - 1]);
+ }
+ p2[i] = processPath(p2[i], attrs2, pcom);
+
+ if (pcoms2[i] != "A" && pfirst == "C") {
+ pcoms2[i] = "C";
+ }
+
+ fixArc(p2, i);
+ }
+ fixM(p, p2, attrs, attrs2, i);
+ fixM(p2, p, attrs2, attrs, i);
+ var seg = p[i],
+ seg2 = p2 && p2[i],
+ seglen = seg.length,
+ seg2len = p2 && seg2.length;
+ attrs.x = seg[seglen - 2];
+ attrs.y = seg[seglen - 1];
+ attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
+ attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
+ attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
+ attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
+ attrs2.x = p2 && seg2[seg2len - 2];
+ attrs2.y = p2 && seg2[seg2len - 1];
+ }
+ if (!p2) {
+ pth.curve = pathClone(p);
+ }
+ return p2 ? [p, p2] : p;
+ }
+ function mapPath(path, matrix) {
+ if (!matrix) {
+ return path;
+ }
+ var x, y, i, j, ii, jj, pathi;
+ path = path2curve(path);
+ for (i = 0, ii = path.length; i < ii; i++) {
+ pathi = path[i];
+ for (j = 1, jj = pathi.length; j < jj; j += 2) {
+ x = matrix.x(pathi[j], pathi[j + 1]);
+ y = matrix.y(pathi[j], pathi[j + 1]);
+ pathi[j] = x;
+ pathi[j + 1] = y;
+ }
+ }
+ return path;
+ }
+
+ // http://schepers.cc/getting-to-the-point
+ function catmullRom2bezier(crp, z) {
+ var d = [];
+ for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
+ var p = [
+ {x: +crp[i - 2], y: +crp[i - 1]},
+ {x: +crp[i], y: +crp[i + 1]},
+ {x: +crp[i + 2], y: +crp[i + 3]},
+ {x: +crp[i + 4], y: +crp[i + 5]}
+ ];
+ if (z) {
+ if (!i) {
+ p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};
+ } else if (iLen - 4 == i) {
+ p[3] = {x: +crp[0], y: +crp[1]};
+ } else if (iLen - 2 == i) {
+ p[2] = {x: +crp[0], y: +crp[1]};
+ p[3] = {x: +crp[2], y: +crp[3]};
+ }
+ } else {
+ if (iLen - 4 == i) {
+ p[3] = p[2];
+ } else if (!i) {
+ p[0] = {x: +crp[i], y: +crp[i + 1]};
+ }
+ }
+ d.push(["C",
+ (-p[0].x + 6 * p[1].x + p[2].x) / 6,
+ (-p[0].y + 6 * p[1].y + p[2].y) / 6,
+ (p[1].x + 6 * p[2].x - p[3].x) / 6,
+ (p[1].y + 6*p[2].y - p[3].y) / 6,
+ p[2].x,
+ p[2].y
+ ]);
+ }
+
+ return d;
+ }
+
+ // export
+ Snap.path = paths;
+
+ /*\
+ * Snap.path.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the given path in pixels
+ **
+ - path (string) SVG path string
+ **
+ = (number) length
+ \*/
+ Snap.path.getTotalLength = getTotalLength;
+ /*\
+ * Snap.path.getPointAtLength
+ [ method ]
+ **
+ * Returns the coordinates of the point located at the given length along the given path
+ **
+ - path (string) SVG path string
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ Snap.path.getPointAtLength = getPointAtLength;
+ /*\
+ * Snap.path.getSubpath
+ [ method ]
+ **
+ * Returns the subpath of a given path between given start and end lengths
+ **
+ - path (string) SVG path string
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ Snap.path.getSubpath = function (path, from, to) {
+ if (this.getTotalLength(path) - to < 1e-6) {
+ return getSubpathsAtLength(path, from).end;
+ }
+ var a = getSubpathsAtLength(path, to, 1);
+ return from ? getSubpathsAtLength(a, from).end : a;
+ };
+ /*\
+ * Element.getTotalLength
+ [ method ]
+ **
+ * Returns the length of the path in pixels (only works for `path` elements)
+ = (number) length
+ \*/
+ elproto.getTotalLength = function () {
+ if (this.node.getTotalLength) {
+ return this.node.getTotalLength();
+ }
+ };
+ // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?
+ /*\
+ * Element.getPointAtLength
+ [ method ]
+ **
+ * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)
+ **
+ - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps
+ **
+ = (object) representation of the point:
+ o {
+ o x: (number) x coordinate,
+ o y: (number) y coordinate,
+ o alpha: (number) angle of derivative
+ o }
+ \*/
+ elproto.getPointAtLength = function (length) {
+ return getPointAtLength(this.attr("d"), length);
+ };
+ // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.
+ /*\
+ * Element.getSubpath
+ [ method ]
+ **
+ * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
+ **
+ - from (number) length, in pixels, from the start of the path to the start of the segment
+ - to (number) length, in pixels, from the start of the path to the end of the segment
+ **
+ = (string) path string definition for the segment
+ \*/
+ elproto.getSubpath = function (from, to) {
+ return Snap.path.getSubpath(this.attr("d"), from, to);
+ };
+ Snap._.box = box;
+ /*\
+ * Snap.path.findDotsAtSegment
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds dot coordinates on the given cubic beziér curve at the given t
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ - t (number) position on the curve (0..1)
+ = (object) point information in format:
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o m: {
+ o x: (number) x coordinate of the left anchor,
+ o y: (number) y coordinate of the left anchor
+ o },
+ o n: {
+ o x: (number) x coordinate of the right anchor,
+ o y: (number) y coordinate of the right anchor
+ o },
+ o start: {
+ o x: (number) x coordinate of the start of the curve,
+ o y: (number) y coordinate of the start of the curve
+ o },
+ o end: {
+ o x: (number) x coordinate of the end of the curve,
+ o y: (number) y coordinate of the end of the curve
+ o },
+ o alpha: (number) angle of the curve derivative at the point
+ o }
+ \*/
+ Snap.path.findDotsAtSegment = findDotsAtSegment;
+ /*\
+ * Snap.path.bezierBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given cubic beziér curve
+ - p1x (number) x of the first point of the curve
+ - p1y (number) y of the first point of the curve
+ - c1x (number) x of the first anchor of the curve
+ - c1y (number) y of the first anchor of the curve
+ - c2x (number) x of the second anchor of the curve
+ - c2y (number) y of the second anchor of the curve
+ - p2x (number) x of the second point of the curve
+ - p2y (number) y of the second point of the curve
+ * or
+ - bez (array) array of six points for beziér curve
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.bezierBBox = bezierBBox;
+ /*\
+ * Snap.path.isPointInsideBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside bounding box
+ - bbox (string) bounding box
+ - x (string) x coordinate of the point
+ - y (string) y coordinate of the point
+ = (boolean) `true` if point is inside
+ \*/
+ Snap.path.isPointInsideBBox = isPointInsideBBox;
+ /*\
+ * Snap.path.isBBoxIntersect
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if two bounding boxes intersect
+ - bbox1 (string) first bounding box
+ - bbox2 (string) second bounding box
+ = (boolean) `true` if bounding boxes intersect
+ \*/
+ Snap.path.isBBoxIntersect = isBBoxIntersect;
+ /*\
+ * Snap.path.intersection
+ [ method ]
+ **
+ * Utility method
+ **
+ * Finds intersections of two paths
+ - path1 (string) path string
+ - path2 (string) path string
+ = (array) dots of intersection
+ o [
+ o {
+ o x: (number) x coordinate of the point,
+ o y: (number) y coordinate of the point,
+ o t1: (number) t value for segment of path1,
+ o t2: (number) t value for segment of path2,
+ o segment1: (number) order number for segment of path1,
+ o segment2: (number) order number for segment of path2,
+ o bez1: (array) eight coordinates representing beziér curve for the segment of path1,
+ o bez2: (array) eight coordinates representing beziér curve for the segment of path2
+ o }
+ o ]
+ \*/
+ Snap.path.intersection = pathIntersection;
+ Snap.path.intersectionNumber = pathIntersectionNumber;
+ /*\
+ * Snap.path.isPointInside
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns `true` if given point is inside a given closed path.
+ *
+ * Note: fill mode doesn’t affect the result of this method.
+ - path (string) path string
+ - x (number) x of the point
+ - y (number) y of the point
+ = (boolean) `true` if point is inside the path
+ \*/
+ Snap.path.isPointInside = isPointInsidePath;
+ /*\
+ * Snap.path.getBBox
+ [ method ]
+ **
+ * Utility method
+ **
+ * Returns the bounding box of a given path
+ - path (string) path string
+ = (object) bounding box
+ o {
+ o x: (number) x coordinate of the left top point of the box,
+ o y: (number) y coordinate of the left top point of the box,
+ o x2: (number) x coordinate of the right bottom point of the box,
+ o y2: (number) y coordinate of the right bottom point of the box,
+ o width: (number) width of the box,
+ o height: (number) height of the box
+ o }
+ \*/
+ Snap.path.getBBox = pathBBox;
+ Snap.path.get = getPath;
+ /*\
+ * Snap.path.toRelative
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into relative values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toRelative = pathToRelative;
+ /*\
+ * Snap.path.toAbsolute
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path coordinates into absolute values
+ - path (string) path string
+ = (array) path string
+ \*/
+ Snap.path.toAbsolute = pathToAbsolute;
+ /*\
+ * Snap.path.toCubic
+ [ method ]
+ **
+ * Utility method
+ **
+ * Converts path to a new path where all segments are cubic beziér curves
+ - pathString (string|array) path string or array of segments
+ = (array) array of segments
+ \*/
+ Snap.path.toCubic = path2curve;
+ /*\
+ * Snap.path.map
+ [ method ]
+ **
+ * Transform the path string with the given matrix
+ - path (string) path string
+ - matrix (object) see @Matrix
+ = (string) transformed path string
+ \*/
+ Snap.path.map = mapPath;
+ Snap.path.toString = toString;
+ Snap.path.clone = pathClone;
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ has = "hasOwnProperty",
+ supportsTouch = "createTouch" in glob.doc,
+ events = [
+ "click", "dblclick", "mousedown", "mousemove", "mouseout",
+ "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
+ "touchcancel"
+ ],
+ touchMap = {
+ mousedown: "touchstart",
+ mousemove: "touchmove",
+ mouseup: "touchend"
+ },
+ getScroll = function (xy, el) {
+ var name = xy == "y" ? "scrollTop" : "scrollLeft",
+ doc = el && el.node ? el.node.ownerDocument : glob.doc;
+ return doc[name in doc.documentElement ? "documentElement" : "body"][name];
+ },
+ preventDefault = function () {
+ this.returnValue = false;
+ },
+ preventTouch = function () {
+ return this.originalEvent.preventDefault();
+ },
+ stopPropagation = function () {
+ this.cancelBubble = true;
+ },
+ stopTouch = function () {
+ return this.originalEvent.stopPropagation();
+ },
+ addEvent = (function () {
+ if (glob.doc.addEventListener) {
+ return function (obj, type, fn, element) {
+ var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
+ f = function (e) {
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element);
+ if (supportsTouch && touchMap[has](type)) {
+ for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
+ if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
+ var olde = e;
+ e = e.targetTouches[i];
+ e.originalEvent = olde;
+ e.preventDefault = preventTouch;
+ e.stopPropagation = stopTouch;
+ break;
+ }
+ }
+ }
+ var x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ return fn.call(element, e, x, y);
+ };
+
+ if (type !== realName) {
+ obj.addEventListener(type, f, false);
+ }
+
+ obj.addEventListener(realName, f, false);
+
+ return function () {
+ if (type !== realName) {
+ obj.removeEventListener(type, f, false);
+ }
+
+ obj.removeEventListener(realName, f, false);
+ return true;
+ };
+ };
+ } else if (glob.doc.attachEvent) {
+ return function (obj, type, fn, element) {
+ var f = function (e) {
+ e = e || element.node.ownerDocument.window.event;
+ var scrollY = getScroll("y", element),
+ scrollX = getScroll("x", element),
+ x = e.clientX + scrollX,
+ y = e.clientY + scrollY;
+ e.preventDefault = e.preventDefault || preventDefault;
+ e.stopPropagation = e.stopPropagation || stopPropagation;
+ return fn.call(element, e, x, y);
+ };
+ obj.attachEvent("on" + type, f);
+ var detacher = function () {
+ obj.detachEvent("on" + type, f);
+ return true;
+ };
+ return detacher;
+ };
+ }
+ })(),
+ drag = [],
+ dragMove = function (e) {
+ var x = e.clientX,
+ y = e.clientY,
+ scrollY = getScroll("y"),
+ scrollX = getScroll("x"),
+ dragi,
+ j = drag.length;
+ while (j--) {
+ dragi = drag[j];
+ if (supportsTouch) {
+ var i = e.touches && e.touches.length,
+ touch;
+ while (i--) {
+ touch = e.touches[i];
+ if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
+ x = touch.clientX;
+ y = touch.clientY;
+ (e.originalEvent ? e.originalEvent : e).preventDefault();
+ break;
+ }
+ }
+ } else {
+ e.preventDefault();
+ }
+ var node = dragi.el.node,
+ o,
+ next = node.nextSibling,
+ parent = node.parentNode,
+ display = node.style.display;
+ // glob.win.opera && parent.removeChild(node);
+ // node.style.display = "none";
+ // o = dragi.el.paper.getElementByPoint(x, y);
+ // node.style.display = display;
+ // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));
+ // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
+ x += scrollX;
+ y += scrollY;
+ eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
+ }
+ },
+ dragUp = function (e) {
+ Snap.unmousemove(dragMove).unmouseup(dragUp);
+ var i = drag.length,
+ dragi;
+ while (i--) {
+ dragi = drag[i];
+ dragi.el._drag = {};
+ eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
+ }
+ drag = [];
+ };
+ /*\
+ * Element.click
+ [ method ]
+ **
+ * Adds a click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unclick
+ [ method ]
+ **
+ * Removes a click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.dblclick
+ [ method ]
+ **
+ * Adds a double click event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.undblclick
+ [ method ]
+ **
+ * Removes a double click event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousedown
+ [ method ]
+ **
+ * Adds a mousedown event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousedown
+ [ method ]
+ **
+ * Removes a mousedown event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mousemove
+ [ method ]
+ **
+ * Adds a mousemove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmousemove
+ [ method ]
+ **
+ * Removes a mousemove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseout
+ [ method ]
+ **
+ * Adds a mouseout event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseout
+ [ method ]
+ **
+ * Removes a mouseout event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseover
+ [ method ]
+ **
+ * Adds a mouseover event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseover
+ [ method ]
+ **
+ * Removes a mouseover event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.mouseup
+ [ method ]
+ **
+ * Adds a mouseup event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.unmouseup
+ [ method ]
+ **
+ * Removes a mouseup event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchstart
+ [ method ]
+ **
+ * Adds a touchstart event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchstart
+ [ method ]
+ **
+ * Removes a touchstart event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchmove
+ [ method ]
+ **
+ * Adds a touchmove event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchmove
+ [ method ]
+ **
+ * Removes a touchmove event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchend
+ [ method ]
+ **
+ * Adds a touchend event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchend
+ [ method ]
+ **
+ * Removes a touchend event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+
+ /*\
+ * Element.touchcancel
+ [ method ]
+ **
+ * Adds a touchcancel event handler to the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ /*\
+ * Element.untouchcancel
+ [ method ]
+ **
+ * Removes a touchcancel event handler from the element
+ - handler (function) handler for the event
+ = (object) @Element
+ \*/
+ for (var i = events.length; i--;) {
+ (function (eventName) {
+ Snap[eventName] = elproto[eventName] = function (fn, scope) {
+ if (Snap.is(fn, "function")) {
+ this.events = this.events || [];
+ this.events.push({
+ name: eventName,
+ f: fn,
+ unbind: addEvent(this.node || document, eventName, fn, scope || this)
+ });
+ }
+ return this;
+ };
+ Snap["un" + eventName] =
+ elproto["un" + eventName] = function (fn) {
+ var events = this.events || [],
+ l = events.length;
+ while (l--) if (events[l].name == eventName &&
+ (events[l].f == fn || !fn)) {
+ events[l].unbind();
+ events.splice(l, 1);
+ !events.length && delete this.events;
+ return this;
+ }
+ return this;
+ };
+ })(events[i]);
+ }
+ /*\
+ * Element.hover
+ [ method ]
+ **
+ * Adds hover event handlers to the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ - icontext (object) #optional context for hover in handler
+ - ocontext (object) #optional context for hover out handler
+ = (object) @Element
+ \*/
+ elproto.hover = function (f_in, f_out, scope_in, scope_out) {
+ return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
+ };
+ /*\
+ * Element.unhover
+ [ method ]
+ **
+ * Removes hover event handlers from the element
+ - f_in (function) handler for hover in
+ - f_out (function) handler for hover out
+ = (object) @Element
+ \*/
+ elproto.unhover = function (f_in, f_out) {
+ return this.unmouseover(f_in).unmouseout(f_out);
+ };
+ var draggable = [];
+ // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.
+ // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?
+ // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.
+ // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
+ /*\
+ * Element.drag
+ [ method ]
+ **
+ * Adds event handlers for an element's drag gesture
+ **
+ - onmove (function) handler for moving
+ - onstart (function) handler for drag start
+ - onend (function) handler for drag end
+ - mcontext (object) #optional context for moving handler
+ - scontext (object) #optional context for drag start handler
+ - econtext (object) #optional context for drag end handler
+ * Additionaly following `drag` events are triggered: `drag.start.<id>` on start,
+ * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element
+ * `drag.over.<id>` fires as well.
+ *
+ * Start event and start handler are called in specified context or in context of the element with following parameters:
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * Move event and move handler are called in specified context or in context of the element with following parameters:
+ o dx (number) shift by x from the start point
+ o dy (number) shift by y from the start point
+ o x (number) x position of the mouse
+ o y (number) y position of the mouse
+ o event (object) DOM event object
+ * End event and end handler are called in specified context or in context of the element with following parameters:
+ o event (object) DOM event object
+ = (object) @Element
+ \*/
+ elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {
+ if (!arguments.length) {
+ var origTransform;
+ return this.drag(function (dx, dy) {
+ this.attr({
+ transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
+ });
+ }, function () {
+ origTransform = this.transform().local;
+ });
+ }
+ function start(e, x, y) {
+ (e.originalEvent || e).preventDefault();
+ this._drag.x = x;
+ this._drag.y = y;
+ this._drag.id = e.identifier;
+ !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
+ drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});
+ onstart && eve.on("snap.drag.start." + this.id, onstart);
+ onmove && eve.on("snap.drag.move." + this.id, onmove);
+ onend && eve.on("snap.drag.end." + this.id, onend);
+ eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
+ }
+ this._drag = {};
+ draggable.push({el: this, start: start});
+ this.mousedown(start);
+ return this;
+ };
+ /*
+ * Element.onDragOver
+ [ method ]
+ **
+ * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)
+ - f (function) handler for event, first argument would be the element you are dragging over
+ \*/
+ // elproto.onDragOver = function (f) {
+ // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over." + this.id);
+ // };
+ /*\
+ * Element.undrag
+ [ method ]
+ **
+ * Removes all drag event handlers from the given element
+ \*/
+ elproto.undrag = function () {
+ var i = draggable.length;
+ while (i--) if (draggable[i].el == this) {
+ this.unmousedown(draggable[i].start);
+ draggable.splice(i, 1);
+ eve.unbind("snap.drag.*." + this.id);
+ }
+ !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
+ return this;
+ };
+});
+// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+Snap.plugin(function (Snap, Element, Paper, glob) {
+ var elproto = Element.prototype,
+ pproto = Paper.prototype,
+ rgurl = /^\s*url\((.+)\)/,
+ Str = String,
+ $ = Snap._.$;
+ Snap.filter = {};
+ /*\
+ * Paper.filter
+ [ method ]
+ **
+ * Creates a `<filter>` element
+ **
+ - filstr (string) SVG fragment of filter provided as a string
+ = (object) @Element
+ * Note: It is recommended to use filters embedded into the page inside an empty SVG element.
+ > Usage
+ | var f = paper.filter('<feGaussianBlur stdDeviation="2"/>'),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ pproto.filter = function (filstr) {
+ var paper = this;
+ if (paper.type != "svg") {
+ paper = paper.paper;
+ }
+ var f = Snap.parse(Str(filstr)),
+ id = Snap._.id(),
+ width = paper.node.offsetWidth,
+ height = paper.node.offsetHeight,
+ filter = $("filter");
+ $(filter, {
+ id: id,
+ filterUnits: "userSpaceOnUse"
+ });
+ filter.appendChild(f.node);
+ paper.defs.appendChild(filter);
+ return new Element(filter);
+ };
+
+ eve.on("snap.util.getattr.filter", function () {
+ eve.stop();
+ var p = $(this.node, "filter");
+ if (p) {
+ var match = Str(p).match(rgurl);
+ return match && Snap.select(match[1]);
+ }
+ });
+ eve.on("snap.util.attr.filter", function (value) {
+ if (value instanceof Element && value.type == "filter") {
+ eve.stop();
+ var id = value.node.id;
+ if (!id) {
+ $(value.node, {id: value.id});
+ id = value.id;
+ }
+ $(this.node, {
+ filter: Snap.url(id)
+ });
+ }
+ if (!value || value == "none") {
+ eve.stop();
+ this.node.removeAttribute("filter");
+ }
+ });
+ /*\
+ * Snap.filter.blur
+ [ method ]
+ **
+ * Returns an SVG markup string for the blur filter
+ **
+ - x (number) amount of horizontal blur, in pixels
+ - y (number) #optional amount of vertical blur, in pixels
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.blur(5, 10)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.blur = function (x, y) {
+ if (x == null) {
+ x = 2;
+ }
+ var def = y == null ? x : [x, y];
+ return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
+ def: def
+ });
+ };
+ Snap.filter.blur.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.shadow
+ [ method ]
+ **
+ * Returns an SVG markup string for the shadow filter
+ **
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - blur (number) #optional amount of blur
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - color (string) #optional color of the shadow
+ - opacity (number) #optional `0..1` opacity of the shadow
+ * which makes blur default to `4`. Or
+ - dx (number) #optional horizontal shift of the shadow, in pixels
+ - dy (number) #optional vertical shift of the shadow, in pixels
+ - opacity (number) #optional `0..1` opacity of the shadow
+ = (string) filter representation
+ > Usage
+ | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),
+ | c = paper.circle(10, 10, 10).attr({
+ | filter: f
+ | });
+ \*/
+ Snap.filter.shadow = function (dx, dy, blur, color, opacity) {
+ if (typeof blur == "string") {
+ color = blur;
+ opacity = color;
+ blur = 4;
+ }
+ if (typeof color != "string") {
+ opacity = color;
+ color = "#000";
+ }
+ color = color || "#000";
+ if (blur == null) {
+ blur = 4;
+ }
+ if (opacity == null) {
+ opacity = 1;
+ }
+ if (dx == null) {
+ dx = 0;
+ dy = 2;
+ }
+ if (dy == null) {
+ dy = dx;
+ }
+ color = Snap.color(color);
+ return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
+ color: color,
+ dx: dx,
+ dy: dy,
+ blur: blur,
+ opacity: opacity
+ });
+ };
+ Snap.filter.shadow.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.grayscale
+ [ method ]
+ **
+ * Returns an SVG markup string for the grayscale filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.grayscale = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
+ a: 0.2126 + 0.7874 * (1 - amount),
+ b: 0.7152 - 0.7152 * (1 - amount),
+ c: 0.0722 - 0.0722 * (1 - amount),
+ d: 0.2126 - 0.2126 * (1 - amount),
+ e: 0.7152 + 0.2848 * (1 - amount),
+ f: 0.0722 - 0.0722 * (1 - amount),
+ g: 0.2126 - 0.2126 * (1 - amount),
+ h: 0.0722 + 0.9278 * (1 - amount)
+ });
+ };
+ Snap.filter.grayscale.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.sepia
+ [ method ]
+ **
+ * Returns an SVG markup string for the sepia filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.sepia = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
+ a: 0.393 + 0.607 * (1 - amount),
+ b: 0.769 - 0.769 * (1 - amount),
+ c: 0.189 - 0.189 * (1 - amount),
+ d: 0.349 - 0.349 * (1 - amount),
+ e: 0.686 + 0.314 * (1 - amount),
+ f: 0.168 - 0.168 * (1 - amount),
+ g: 0.272 - 0.272 * (1 - amount),
+ h: 0.534 - 0.534 * (1 - amount),
+ i: 0.131 + 0.869 * (1 - amount)
+ });
+ };
+ Snap.filter.sepia.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.saturate
+ [ method ]
+ **
+ * Returns an SVG markup string for the saturate filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.saturate = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
+ amount: 1 - amount
+ });
+ };
+ Snap.filter.saturate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.hueRotate
+ [ method ]
+ **
+ * Returns an SVG markup string for the hue-rotate filter
+ **
+ - angle (number) angle of rotation
+ = (string) filter representation
+ \*/
+ Snap.filter.hueRotate = function (angle) {
+ angle = angle || 0;
+ return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
+ angle: angle
+ });
+ };
+ Snap.filter.hueRotate.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.invert
+ [ method ]
+ **
+ * Returns an SVG markup string for the invert filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.invert = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: 1 - amount
+ });
+ };
+ Snap.filter.invert.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.brightness
+ [ method ]
+ **
+ * Returns an SVG markup string for the brightness filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.brightness = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
+ amount: amount
+ });
+ };
+ Snap.filter.brightness.toString = function () {
+ return this();
+ };
+ /*\
+ * Snap.filter.contrast
+ [ method ]
+ **
+ * Returns an SVG markup string for the contrast filter
+ **
+ - amount (number) amount of filter (`0..1`)
+ = (string) filter representation
+ \*/
+ Snap.filter.contrast = function (amount) {
+ if (amount == null) {
+ amount = 1;
+ }
+ return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
+ amount: amount,
+ amount2: .5 - amount / 2
+ });
+ };
+ Snap.filter.contrast.toString = function () {
+ return this();
+ };
+});
+
+return Snap;
+}));
+},{"65":65}],67:[function(_dereq_,module,exports){
+'use strict';
+
+var snapsvg = module.exports = _dereq_(66);
+
+snapsvg.plugin(function(Snap, Element) {
+
+ /*\
+ * Element.children
+ [ method ]
+ **
+ * Returns array of all the children of the element.
+ = (array) array of Elements
+ \*/
+ Element.prototype.children = function () {
+ var out = [],
+ ch = this.node.childNodes;
+ for (var i = 0, ii = ch.length; i < ii; i++) {
+ out[i] = new Snap(ch[i]);
+ }
+ return out;
+ };
+});
+
+
+/**
+ * @class ClassPlugin
+ *
+ * Extends snapsvg with methods to add and remove classes
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ function split(str) {
+ return str.split(/\s+/);
+ }
+
+ function join(array) {
+ return array.join(' ');
+ }
+
+ function getClasses(e) {
+ return split(e.attr('class') || '');
+ }
+
+ function setClasses(e, classes) {
+ e.attr('class', join(classes));
+ }
+
+ /**
+ * @method snapsvg.Element#addClass
+ *
+ * @example
+ *
+ * e.attr('class', 'selector');
+ *
+ * e.addClass('foo bar'); // adds classes foo and bar
+ * e.attr('class'); // -> 'selector foo bar'
+ *
+ * e.addClass('fooBar');
+ * e.attr('class'); // -> 'selector foo bar fooBar'
+ *
+ * @param {String} cls classes to be added to the element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.addClass = function(cls) {
+ var current = getClasses(this),
+ add = split(cls),
+ i, e;
+
+ for (i = 0, e; !!(e = add[i]); i++) {
+ if (current.indexOf(e) === -1) {
+ current.push(e);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+ /**
+ * @method snapsvg.Element#hasClass
+ *
+ * @param {String} cls the class to query for
+ * @return {Boolean} returns true if the element has the given class
+ */
+ Element.prototype.hasClass = function(cls) {
+ if (!cls) {
+ throw new Error('[snapsvg] syntax: hasClass(clsStr)');
+ }
+
+ return getClasses(this).indexOf(cls) !== -1;
+ };
+
+ /**
+ * @method snapsvg.Element#removeClass
+ *
+ * @example
+ *
+ * e.attr('class', 'foo bar');
+ *
+ * e.removeClass('foo');
+ * e.attr('class'); // -> 'bar'
+ *
+ * e.removeClass('foo bar'); // removes classes foo and bar
+ * e.attr('class'); // -> ''
+ *
+ * @param {String} cls classes to be removed from element
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.removeClass = function(cls) {
+ var current = getClasses(this),
+ remove = split(cls),
+ i, e, idx;
+
+ for (i = 0, e; !!(e = remove[i]); i++) {
+ idx = current.indexOf(e);
+
+ if (idx !== -1) {
+ // remove element from array
+ current.splice(idx, 1);
+ }
+ }
+
+ setClasses(this, current);
+
+ return this;
+ };
+
+});
+
+/**
+ * @class TranslatePlugin
+ *
+ * Extends snapsvg with methods to translate elements
+ */
+snapsvg.plugin(function (Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.Element#translate
+ *
+ * @example
+ *
+ * e.translate(10, 20);
+ *
+ * // sets transform matrix to translate(10, 20)
+ *
+ * @param {Number} x translation
+ * @param {Number} y translation
+ *
+ * @return {snapsvg.Element} the element (this)
+ */
+ Element.prototype.translate = function(x, y) {
+ var matrix = new Snap.Matrix();
+ matrix.translate(x, y);
+ return this.transform(matrix);
+ };
+});
+
+
+/**
+ * @class CreatePlugin
+ *
+ * Create an svg element without attaching it to the dom
+ */
+snapsvg.plugin(function(Snap) {
+
+ Snap.create = function(name, attrs) {
+ return Snap._.wrap(Snap._.$(name, attrs));
+ };
+});
+
+
+/**
+ * @class CreatSnapAtPlugin
+ *
+ * Extends snap.svg with a method to create a SVG element
+ * at a specific position in the DOM.
+ */
+snapsvg.plugin(function(Snap, Element, Paper, global) {
+
+ /*
+ * @method snapsvg.createSnapAt
+ *
+ * @example
+ *
+ * snapsvg.createSnapAt(parentNode, 200, 200);
+ *
+ * @param {Number} width of svg
+ * @param {Number} height of svg
+ * @param {Object} parentNode svg Element will be child of this
+ *
+ * @return {snapsvg.Element} the newly created wrapped SVG element instance
+ */
+ Snap.createSnapAt = function(width, height, parentNode) {
+
+ var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ svg.setAttribute('width', width);
+ svg.setAttribute('height', height);
+ if (!parentNode) {
+ parentNode = document.body;
+ }
+ parentNode.appendChild(svg);
+
+ return new Snap(svg);
+ };
+});
+},{"66":66}],68:[function(_dereq_,module,exports){
+
+var isArray = function(obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+};
+
+var annotate = function() {
+ var args = Array.prototype.slice.call(arguments);
+
+ if (args.length === 1 && isArray(args[0])) {
+ args = args[0];
+ }
+
+ var fn = args.pop();
+
+ fn.$inject = args;
+
+ return fn;
+};
+
+
+// Current limitations:
+// - can't put into "function arg" comments
+// function /* (no parenthesis like this) */ (){}
+// function abc( /* xx (no parenthesis like this) */ a, b) {}
+//
+// Just put the comment before function or inside:
+// /* (((this is fine))) */ function(a, b) {}
+// function abc(a) { /* (((this is fine))) */}
+
+var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG = /\/\*([^\*]*)\*\//m;
+
+var parse = function(fn) {
+ if (typeof fn !== 'function') {
+ throw new Error('Cannot annotate "' + fn + '". Expected a function!');
+ }
+
+ var match = fn.toString().match(FN_ARGS);
+ return match[1] && match[1].split(',').map(function(arg) {
+ match = arg.match(FN_ARG);
+ return match ? match[1].trim() : arg.trim();
+ }) || [];
+};
+
+
+exports.annotate = annotate;
+exports.parse = parse;
+exports.isArray = isArray;
+
+},{}],69:[function(_dereq_,module,exports){
+module.exports = {
+ annotate: _dereq_(68).annotate,
+ Module: _dereq_(71),
+ Injector: _dereq_(70)
+};
+
+},{"68":68,"70":70,"71":71}],70:[function(_dereq_,module,exports){
+var Module = _dereq_(71);
+var autoAnnotate = _dereq_(68).parse;
+var annotate = _dereq_(68).annotate;
+var isArray = _dereq_(68).isArray;
+
+
+var Injector = function(modules, parent) {
+ parent = parent || {
+ get: function(name) {
+ currentlyResolving.push(name);
+ throw error('No provider for "' + name + '"!');
+ }
+ };
+
+ var currentlyResolving = [];
+ var providers = this._providers = Object.create(parent._providers || null);
+ var instances = this._instances = Object.create(null);
+
+ var self = instances.injector = this;
+
+ var error = function(msg) {
+ var stack = currentlyResolving.join(' -> ');
+ currentlyResolving.length = 0;
+ return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
+ };
+
+ var get = function(name) {
+ if (!providers[name] && name.indexOf('.') !== -1) {
+ var parts = name.split('.');
+ var pivot = get(parts.shift());
+
+ while(parts.length) {
+ pivot = pivot[parts.shift()];
+ }
+
+ return pivot;
+ }
+
+ if (Object.hasOwnProperty.call(instances, name)) {
+ return instances[name];
+ }
+
+ if (Object.hasOwnProperty.call(providers, name)) {
+ if (currentlyResolving.indexOf(name) !== -1) {
+ currentlyResolving.push(name);
+ throw error('Cannot resolve circular dependency!');
+ }
+
+ currentlyResolving.push(name);
+ instances[name] = providers[name][0](providers[name][1]);
+ currentlyResolving.pop();
+
+ return instances[name];
+ }
+
+ return parent.get(name);
+ };
+
+ var instantiate = function(Type) {
+ var instance = Object.create(Type.prototype);
+ var returned = invoke(Type, instance);
+
+ return typeof returned === 'object' ? returned : instance;
+ };
+
+ var invoke = function(fn, context) {
+ if (typeof fn !== 'function') {
+ if (isArray(fn)) {
+ fn = annotate(fn.slice());
+ } else {
+ throw new Error('Cannot invoke "' + fn + '". Expected a function!');
+ }
+ }
+
+ var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
+ var dependencies = inject.map(function(dep) {
+ return get(dep);
+ });
+
+ // TODO(vojta): optimize without apply
+ return fn.apply(context, dependencies);
+ };
+
+
+ var createPrivateInjectorFactory = function(privateChildInjector) {
+ return annotate(function(key) {
+ return privateChildInjector.get(key);
+ });
+ };
+
+ var createChild = function(modules, forceNewInstances) {
+ if (forceNewInstances && forceNewInstances.length) {
+ var fromParentModule = Object.create(null);
+ var matchedScopes = Object.create(null);
+
+ var privateInjectorsCache = [];
+ var privateChildInjectors = [];
+ var privateChildFactories = [];
+
+ var provider;
+ var cacheIdx;
+ var privateChildInjector;
+ var privateChildInjectorFactory;
+ for (var name in providers) {
+ provider = providers[name];
+
+ if (forceNewInstances.indexOf(name) !== -1) {
+ if (provider[2] === 'private') {
+ cacheIdx = privateInjectorsCache.indexOf(provider[3]);
+ if (cacheIdx === -1) {
+ privateChildInjector = provider[3].createChild([], forceNewInstances);
+ privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
+ privateInjectorsCache.push(provider[3]);
+ privateChildInjectors.push(privateChildInjector);
+ privateChildFactories.push(privateChildInjectorFactory);
+ fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
+ } else {
+ fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
+ }
+ } else {
+ fromParentModule[name] = [provider[2], provider[1]];
+ }
+ matchedScopes[name] = true;
+ }
+
+ if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
+ forceNewInstances.forEach(function(scope) {
+ if (provider[1].$scope.indexOf(scope) !== -1) {
+ fromParentModule[name] = [provider[2], provider[1]];
+ matchedScopes[scope] = true;
+ }
+ });
+ }
+ }
+
+ forceNewInstances.forEach(function(scope) {
+ if (!matchedScopes[scope]) {
+ throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
+ }
+ });
+
+ modules.unshift(fromParentModule);
+ }
+
+ return new Injector(modules, self);
+ };
+
+ var factoryMap = {
+ factory: invoke,
+ type: instantiate,
+ value: function(value) {
+ return value;
+ }
+ };
+
+ modules.forEach(function(module) {
+
+ function arrayUnwrap(type, value) {
+ if (type !== 'value' && isArray(value)) {
+ value = annotate(value.slice());
+ }
+
+ return value;
+ }
+
+ // TODO(vojta): handle wrong inputs (modules)
+ if (module instanceof Module) {
+ module.forEach(function(provider) {
+ var name = provider[0];
+ var type = provider[1];
+ var value = provider[2];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ } else if (typeof module === 'object') {
+ if (module.__exports__) {
+ var clonedModule = Object.keys(module).reduce(function(m, key) {
+ if (key.substring(0, 2) !== '__') {
+ m[key] = module[key];
+ }
+ return m;
+ }, Object.create(null));
+
+ var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
+ var getFromPrivateInjector = annotate(function(key) {
+ return privateInjector.get(key);
+ });
+ module.__exports__.forEach(function(key) {
+ providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
+ });
+ } else {
+ Object.keys(module).forEach(function(name) {
+ if (module[name][2] === 'private') {
+ providers[name] = module[name];
+ return;
+ }
+
+ var type = module[name][0];
+ var value = module[name][1];
+
+ providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
+ });
+ }
+ }
+ });
+
+ // public API
+ this.get = get;
+ this.invoke = invoke;
+ this.instantiate = instantiate;
+ this.createChild = createChild;
+};
+
+module.exports = Injector;
+
+},{"68":68,"71":71}],71:[function(_dereq_,module,exports){
+var Module = function() {
+ var providers = [];
+
+ this.factory = function(name, factory) {
+ providers.push([name, 'factory', factory]);
+ return this;
+ };
+
+ this.value = function(name, value) {
+ providers.push([name, 'value', value]);
+ return this;
+ };
+
+ this.type = function(name, type) {
+ providers.push([name, 'type', type]);
+ return this;
+ };
+
+ this.forEach = function(iterator) {
+ providers.forEach(iterator);
+ };
+};
+
+module.exports = Module;
+
+},{}],72:[function(_dereq_,module,exports){
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+
+},{}],73:[function(_dereq_,module,exports){
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
+
+},{}],74:[function(_dereq_,module,exports){
+var arrayEvery = _dereq_(90),
+ baseCallback = _dereq_(97),
+ baseEvery = _dereq_(102),
+ isArray = _dereq_(159),
+ isIterateeCall = _dereq_(147);
+
+/**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = every;
+
+},{"102":102,"147":147,"159":159,"90":90,"97":97}],75:[function(_dereq_,module,exports){
+var arrayFilter = _dereq_(91),
+ baseCallback = _dereq_(97),
+ baseFilter = _dereq_(103),
+ isArray = _dereq_(159);
+
+/**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = baseCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+}
+
+module.exports = filter;
+
+},{"103":103,"159":159,"91":91,"97":97}],76:[function(_dereq_,module,exports){
+var baseEach = _dereq_(101),
+ createFind = _dereq_(136);
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
+
+},{"101":101,"136":136}],77:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(89),
+ baseEach = _dereq_(101),
+ createForEach = _dereq_(137);
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
+
+},{"101":101,"137":137,"89":89}],78:[function(_dereq_,module,exports){
+var createAggregator = _dereq_(131);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+});
+
+module.exports = groupBy;
+
+},{"131":131}],79:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(111),
+ getLength = _dereq_(142),
+ isArray = _dereq_(159),
+ isIterateeCall = _dereq_(147),
+ isLength = _dereq_(149),
+ isString = _dereq_(165),
+ values = _dereq_(174);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (!length) {
+ return false;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
+ : (baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
+
+},{"111":111,"142":142,"147":147,"149":149,"159":159,"165":165,"174":174}],80:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(92),
+ baseCallback = _dereq_(97),
+ baseMap = _dereq_(116),
+ isArray = _dereq_(159);
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
+
+},{"116":116,"159":159,"92":92,"97":97}],81:[function(_dereq_,module,exports){
+var arrayReduce = _dereq_(93),
+ baseEach = _dereq_(101),
+ createReduce = _dereq_(138);
+
+/**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as interatees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+var reduce = createReduce(arrayReduce, baseEach);
+
+module.exports = reduce;
+
+},{"101":101,"138":138,"93":93}],82:[function(_dereq_,module,exports){
+var arraySome = _dereq_(94),
+ baseCallback = _dereq_(97),
+ baseSome = _dereq_(125),
+ isArray = _dereq_(159),
+ isIterateeCall = _dereq_(147);
+
+/**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = some;
+
+},{"125":125,"147":147,"159":159,"94":94,"97":97}],83:[function(_dereq_,module,exports){
+var isNative = _dereq_(161);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = isNative(nativeNow = Date.now) && nativeNow;
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
+
+},{"161":161}],84:[function(_dereq_,module,exports){
+var isObject = _dereq_(163),
+ now = _dereq_(83);
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that delays invoking `func` until after `wait` milliseconds
+ * have elapsed since the last time it was invoked. The created function comes
+ * with a `cancel` method to cancel delayed invocations. Provide an options
+ * object to indicate that `func` should be invoked on the leading and/or
+ * trailing edge of the `wait` timeout. Subsequent calls to the debounced
+ * function return the result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ var isCalled = trailingCall;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (trailing || (maxWait !== wait)) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+}
+
+module.exports = debounce;
+
+},{"163":163,"83":83}],85:[function(_dereq_,module,exports){
+var baseDelay = _dereq_(99),
+ restParam = _dereq_(86);
+
+/**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+});
+
+module.exports = defer;
+
+},{"86":86,"99":99}],86:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],87:[function(_dereq_,module,exports){
+(function (global){
+var cachePush = _dereq_(130),
+ isNative = _dereq_(161);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+}
+
+// Add functions to the `Set` cache.
+SetCache.prototype.push = cachePush;
+
+module.exports = SetCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"130":130,"161":161}],88:[function(_dereq_,module,exports){
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
+
+},{}],89:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
+
+},{}],90:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = arrayEvery;
+
+},{}],91:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayFilter;
+
+},{}],92:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
+
+},{}],93:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+}
+
+module.exports = arrayReduce;
+
+},{}],94:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
+
+},{}],95:[function(_dereq_,module,exports){
+var getSymbols = _dereq_(143),
+ keys = _dereq_(169);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+function assignWith(object, source, customizer) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+}
+
+module.exports = assignWith;
+
+},{"143":143,"169":169}],96:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(98),
+ getSymbols = _dereq_(143),
+ isNative = _dereq_(161),
+ keys = _dereq_(169);
+
+/** Native method references. */
+var preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;
+
+/** Used as `baseAssign`. */
+var nativeAssign = (function() {
+ // Avoid `Object.assign` in Firefox 34-37 which have an early implementation
+ // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
+ // for more details.
+ //
+ // Use `Object.preventExtensions` on a plain object instead of simply using
+ // `Object('x')` because Chrome and IE fail to throw an error when attempting
+ // to assign values to readonly indexes of strings.
+ var func = preventExtensions && isNative(func = Object.assign) && func;
+ try {
+ if (func) {
+ var object = preventExtensions({ '1': 0 });
+ object[0] = 1;
+ }
+ } catch(e) {
+ // Only attempt in strict mode.
+ try { func(object, 'xo'); } catch(e) {}
+ return !object[1] && func;
+ }
+ return false;
+}());
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+var baseAssign = nativeAssign || function(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
+};
+
+module.exports = baseAssign;
+
+},{"143":143,"161":161,"169":169,"98":98}],97:[function(_dereq_,module,exports){
+var baseMatches = _dereq_(117),
+ baseMatchesProperty = _dereq_(118),
+ bindCallback = _dereq_(128),
+ identity = _dereq_(178),
+ property = _dereq_(179);
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
+
+},{"117":117,"118":118,"128":128,"178":178,"179":179}],98:[function(_dereq_,module,exports){
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],99:[function(_dereq_,module,exports){
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+}
+
+module.exports = baseDelay;
+
+},{}],100:[function(_dereq_,module,exports){
+var baseIndexOf = _dereq_(111),
+ cacheIndexOf = _dereq_(129),
+ createCache = _dereq_(135);
+
+/**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = baseIndexOf,
+ isCommon = true,
+ cache = (isCommon && values.length >= 200) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseDifference;
+
+},{"111":111,"129":129,"135":135}],101:[function(_dereq_,module,exports){
+var baseForOwn = _dereq_(109),
+ createBaseEach = _dereq_(133);
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
+
+},{"109":109,"133":133}],102:[function(_dereq_,module,exports){
+var baseEach = _dereq_(101);
+
+/**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+}
+
+module.exports = baseEvery;
+
+},{"101":101}],103:[function(_dereq_,module,exports){
+var baseEach = _dereq_(101);
+
+/**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+}
+
+module.exports = baseFilter;
+
+},{"101":101}],104:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
+
+},{}],105:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
+
+},{}],106:[function(_dereq_,module,exports){
+var isArguments = _dereq_(158),
+ isArray = _dereq_(159),
+ isArrayLike = _dereq_(145),
+ isObjectLike = _dereq_(150);
+
+/**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = baseFlatten;
+
+},{"145":145,"150":150,"158":158,"159":159}],107:[function(_dereq_,module,exports){
+var createBaseFor = _dereq_(134);
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
+
+},{"134":134}],108:[function(_dereq_,module,exports){
+var baseFor = _dereq_(107),
+ keysIn = _dereq_(170);
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
+
+},{"107":107,"170":170}],109:[function(_dereq_,module,exports){
+var baseFor = _dereq_(107),
+ keys = _dereq_(169);
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
+
+},{"107":107,"169":169}],110:[function(_dereq_,module,exports){
+var toObject = _dereq_(156);
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = -1,
+ length = path.length;
+
+ while (object != null && ++index < length) {
+ object = object[path[index]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
+
+},{"156":156}],111:[function(_dereq_,module,exports){
+var indexOfNaN = _dereq_(144);
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
+
+},{"144":144}],112:[function(_dereq_,module,exports){
+var baseIsEqualDeep = _dereq_(113);
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ // Exit early for identical values.
+ if (value === other) {
+ return true;
+ }
+ var valType = typeof value,
+ othType = typeof other;
+
+ // Exit early for unlike primitive values.
+ if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||
+ value == null || other == null) {
+ // Return `false` unless both values are `NaN`.
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
+
+},{"113":113}],113:[function(_dereq_,module,exports){
+var equalArrays = _dereq_(139),
+ equalByTag = _dereq_(140),
+ equalObjects = _dereq_(141),
+ isArray = _dereq_(159),
+ isTypedArray = _dereq_(166);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (valWrapped || othWrapped) {
+ return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
+
+},{"139":139,"140":140,"141":141,"159":159,"166":166}],114:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+}
+
+module.exports = baseIsFunction;
+
+},{}],115:[function(_dereq_,module,exports){
+var baseIsEqual = _dereq_(112);
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The source property names to match.
+ * @param {Array} values The source values to match.
+ * @param {Array} strictCompareFlags Strict comparison flags for source values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
+ var index = -1,
+ length = props.length,
+ noCustomizer = !customizer;
+
+ while (++index < length) {
+ if ((noCustomizer && strictCompareFlags[index])
+ ? values[index] !== object[props[index]]
+ : !(props[index] in object)
+ ) {
+ return false;
+ }
+ }
+ index = -1;
+ while (++index < length) {
+ var key = props[index],
+ objValue = object[key],
+ srcValue = values[index];
+
+ if (noCustomizer && strictCompareFlags[index]) {
+ var result = objValue !== undefined || (key in object);
+ } else {
+ result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (result === undefined) {
+ result = baseIsEqual(srcValue, objValue, customizer, true);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
+
+},{"112":112}],116:[function(_dereq_,module,exports){
+var baseEach = _dereq_(101),
+ isArrayLike = _dereq_(145);
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
+
+},{"101":101,"145":145}],117:[function(_dereq_,module,exports){
+var baseIsMatch = _dereq_(115),
+ constant = _dereq_(177),
+ isStrictComparable = _dereq_(151),
+ keys = _dereq_(169),
+ toObject = _dereq_(156);
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var props = keys(source),
+ length = props.length;
+
+ if (!length) {
+ return constant(true);
+ }
+ if (length == 1) {
+ var key = props[0],
+ value = source[key];
+
+ if (isStrictComparable(value)) {
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ }
+ var values = Array(length),
+ strictCompareFlags = Array(length);
+
+ while (length--) {
+ value = source[props[length]];
+ values[length] = value;
+ strictCompareFlags[length] = isStrictComparable(value);
+ }
+ return function(object) {
+ return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
+ };
+}
+
+module.exports = baseMatches;
+
+},{"115":115,"151":151,"156":156,"169":169,"177":177}],118:[function(_dereq_,module,exports){
+var baseGet = _dereq_(110),
+ baseIsEqual = _dereq_(112),
+ baseSlice = _dereq_(124),
+ isArray = _dereq_(159),
+ isKey = _dereq_(148),
+ isStrictComparable = _dereq_(151),
+ last = _dereq_(73),
+ toObject = _dereq_(156),
+ toPath = _dereq_(157);
+
+/**
+ * The base implementation of `_.matchesProperty` which does not which does
+ * not clone `value`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} value The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, value) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(value),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === value
+ ? (value !== undefined || (key in object))
+ : baseIsEqual(value, object[key], null, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
+
+},{"110":110,"112":112,"124":124,"148":148,"151":151,"156":156,"157":157,"159":159,"73":73}],119:[function(_dereq_,module,exports){
+var arrayEach = _dereq_(89),
+ baseMergeDeep = _dereq_(120),
+ getSymbols = _dereq_(143),
+ isArray = _dereq_(159),
+ isArrayLike = _dereq_(145),
+ isObject = _dereq_(163),
+ isObjectLike = _dereq_(150),
+ isTypedArray = _dereq_(166),
+ keys = _dereq_(169);
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));
+ if (!isSrcArr) {
+ var props = keys(source);
+ push.apply(props, getSymbols(source));
+ }
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((isSrcArr || result !== undefined) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+}
+
+module.exports = baseMerge;
+
+},{"120":120,"143":143,"145":145,"150":150,"159":159,"163":163,"166":166,"169":169,"89":89}],120:[function(_dereq_,module,exports){
+var arrayCopy = _dereq_(88),
+ isArguments = _dereq_(158),
+ isArray = _dereq_(159),
+ isArrayLike = _dereq_(145),
+ isPlainObject = _dereq_(164),
+ isTypedArray = _dereq_(166),
+ toPlainObject = _dereq_(167);
+
+/**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+}
+
+module.exports = baseMergeDeep;
+
+},{"145":145,"158":158,"159":159,"164":164,"166":166,"167":167,"88":88}],121:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+module.exports = baseProperty;
+
+},{}],122:[function(_dereq_,module,exports){
+var baseGet = _dereq_(110),
+ toPath = _dereq_(157);
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
+
+},{"110":110,"157":157}],123:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+}
+
+module.exports = baseReduce;
+
+},{}],124:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
+
+},{}],125:[function(_dereq_,module,exports){
+var baseEach = _dereq_(101);
+
+/**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+}
+
+module.exports = baseSome;
+
+},{"101":101}],126:[function(_dereq_,module,exports){
+/**
+ * Converts `value` to a string if it is not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
+
+},{}],127:[function(_dereq_,module,exports){
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
+
+},{}],128:[function(_dereq_,module,exports){
+var identity = _dereq_(178);
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
+
+},{"178":178}],129:[function(_dereq_,module,exports){
+var isObject = _dereq_(163);
+
+/**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+}
+
+module.exports = cacheIndexOf;
+
+},{"163":163}],130:[function(_dereq_,module,exports){
+var isObject = _dereq_(163);
+
+/**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+}
+
+module.exports = cachePush;
+
+},{"163":163}],131:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(97),
+ baseEach = _dereq_(101),
+ isArray = _dereq_(159);
+
+/**
+ * Creates a function that aggregates a collection, creating an accumulator
+ * object composed from the results of running each element in the collection
+ * through an iteratee.
+ *
+ * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
+ * and `_.partition`.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+}
+
+module.exports = createAggregator;
+
+},{"101":101,"159":159,"97":97}],132:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(128),
+ isIterateeCall = _dereq_(147),
+ restParam = _dereq_(86);
+
+/**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 && sources[length - 2],
+ guard = length > 2 && sources[2],
+ thisArg = length > 1 && sources[length - 1];
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : null;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? null : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+}
+
+module.exports = createAssigner;
+
+},{"128":128,"147":147,"86":86}],133:[function(_dereq_,module,exports){
+var getLength = _dereq_(142),
+ isLength = _dereq_(149),
+ toObject = _dereq_(156);
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
+
+},{"142":142,"149":149,"156":156}],134:[function(_dereq_,module,exports){
+var toObject = _dereq_(156);
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
+
+},{"156":156}],135:[function(_dereq_,module,exports){
+(function (global){
+var SetCache = _dereq_(87),
+ constant = _dereq_(177),
+ isNative = _dereq_(161);
+
+/** Native method references. */
+var Set = isNative(Set = global.Set) && Set;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+
+/**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
+ return new SetCache(values);
+};
+
+module.exports = createCache;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"161":161,"177":177,"87":87}],136:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(97),
+ baseFind = _dereq_(104),
+ baseFindIndex = _dereq_(105),
+ isArray = _dereq_(159);
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
+
+},{"104":104,"105":105,"159":159,"97":97}],137:[function(_dereq_,module,exports){
+var bindCallback = _dereq_(128),
+ isArray = _dereq_(159);
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
+
+},{"128":128,"159":159}],138:[function(_dereq_,module,exports){
+var baseCallback = _dereq_(97),
+ baseReduce = _dereq_(123),
+ isArray = _dereq_(159);
+
+/**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+}
+
+module.exports = createReduce;
+
+},{"123":123,"159":159,"97":97}],139:[function(_dereq_,module,exports){
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length,
+ result = true;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (result && ++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, arrValue, index)
+ : customizer(arrValue, othValue, index);
+ }
+ if (result === undefined) {
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ var othIndex = othLength;
+ while (othIndex--) {
+ othValue = other[othIndex];
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ if (result) {
+ break;
+ }
+ }
+ } else {
+ result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ }
+ return !!result;
+}
+
+module.exports = equalArrays;
+
+},{}],140:[function(_dereq_,module,exports){
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} value The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
+
+},{}],141:[function(_dereq_,module,exports){
+var keys = _dereq_(169);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var skipCtor = isLoose,
+ index = -1;
+
+ while (++index < objLength) {
+ var key = objProps[index],
+ result = isLoose ? key in other : hasOwnProperty.call(other, key);
+
+ if (result) {
+ var objValue = object[key],
+ othValue = other[key];
+
+ result = undefined;
+ if (customizer) {
+ result = isLoose
+ ? customizer(othValue, objValue, key)
+ : customizer(objValue, othValue, key);
+ }
+ if (result === undefined) {
+ // Recursively compare objects (susceptible to call stack limits).
+ result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!result) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
+
+},{"169":169}],142:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(121);
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
+
+},{"121":121}],143:[function(_dereq_,module,exports){
+var constant = _dereq_(177),
+ isNative = _dereq_(161),
+ toObject = _dereq_(156);
+
+/** Native method references. */
+var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;
+
+/**
+ * Creates an array of the own symbols of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of symbols.
+ */
+var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
+ return getOwnPropertySymbols(toObject(object));
+};
+
+module.exports = getSymbols;
+
+},{"156":156,"161":161,"177":177}],144:[function(_dereq_,module,exports){
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
+
+},{}],145:[function(_dereq_,module,exports){
+var getLength = _dereq_(142),
+ isLength = _dereq_(149);
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
+
+},{"142":142,"149":149}],146:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = +value;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
+
+},{}],147:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(145),
+ isIndex = _dereq_(146),
+ isObject = _dereq_(163);
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
+
+},{"145":145,"146":146,"163":163}],148:[function(_dereq_,module,exports){
+var isArray = _dereq_(159),
+ toObject = _dereq_(156);
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
+
+},{"156":156,"159":159}],149:[function(_dereq_,module,exports){
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
+
+},{}],150:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
+
+},{}],151:[function(_dereq_,module,exports){
+var isObject = _dereq_(163);
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
+
+},{"163":163}],152:[function(_dereq_,module,exports){
+var toObject = _dereq_(156);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+
+module.exports = pickByArray;
+
+},{"156":156}],153:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(108);
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+}
+
+module.exports = pickByCallback;
+
+},{"108":108}],154:[function(_dereq_,module,exports){
+var baseForIn = _dereq_(108),
+ isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+function shimIsPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = shimIsPlainObject;
+
+},{"108":108,"150":150}],155:[function(_dereq_,module,exports){
+var isArguments = _dereq_(158),
+ isArray = _dereq_(159),
+ isIndex = _dereq_(146),
+ isLength = _dereq_(149),
+ keysIn = _dereq_(170),
+ support = _dereq_(176);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object)));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
+
+},{"146":146,"149":149,"158":158,"159":159,"170":170,"176":176}],156:[function(_dereq_,module,exports){
+var isObject = _dereq_(163);
+
+/**
+ * Converts `value` to an object if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
+
+},{"163":163}],157:[function(_dereq_,module,exports){
+var baseToString = _dereq_(126),
+ isArray = _dereq_(159);
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it is not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
+
+},{"126":126,"159":159}],158:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(145),
+ isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+}
+
+module.exports = isArguments;
+
+},{"145":145,"150":150}],159:[function(_dereq_,module,exports){
+var isLength = _dereq_(149),
+ isNative = _dereq_(161),
+ isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
+
+},{"149":149,"150":150,"161":161}],160:[function(_dereq_,module,exports){
+(function (global){
+var baseIsFunction = _dereq_(114),
+ isNative = _dereq_(161);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+};
+
+module.exports = isFunction;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{"114":114,"161":161}],161:[function(_dereq_,module,exports){
+var escapeRegExp = _dereq_(175),
+ isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(objToString)
+ .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+module.exports = isNative;
+
+},{"150":150,"175":175}],162:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+}
+
+module.exports = isNumber;
+
+},{"150":150}],163:[function(_dereq_,module,exports){
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return type == 'function' || (!!value && type == 'object');
+}
+
+module.exports = isObject;
+
+},{}],164:[function(_dereq_,module,exports){
+var isNative = _dereq_(161),
+ shimIsPlainObject = _dereq_(154);
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = value.valueOf,
+ objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+};
+
+module.exports = isPlainObject;
+
+},{"154":154,"161":161}],165:[function(_dereq_,module,exports){
+var isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
+
+},{"150":150}],166:[function(_dereq_,module,exports){
+var isLength = _dereq_(149),
+ isObjectLike = _dereq_(150);
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
+
+},{"149":149,"150":150}],167:[function(_dereq_,module,exports){
+var baseCopy = _dereq_(98),
+ keysIn = _dereq_(170);
+
+/**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+}
+
+module.exports = toPlainObject;
+
+},{"170":170,"98":98}],168:[function(_dereq_,module,exports){
+var assignWith = _dereq_(95),
+ baseAssign = _dereq_(96),
+ createAssigner = _dereq_(132);
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+});
+
+module.exports = assign;
+
+},{"132":132,"95":95,"96":96}],169:[function(_dereq_,module,exports){
+var isArrayLike = _dereq_(145),
+ isNative = _dereq_(161),
+ isObject = _dereq_(163),
+ shimKeys = _dereq_(155);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object != null && object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
+
+},{"145":145,"155":155,"161":161,"163":163}],170:[function(_dereq_,module,exports){
+var isArguments = _dereq_(158),
+ isArray = _dereq_(159),
+ isIndex = _dereq_(146),
+ isLength = _dereq_(149),
+ isObject = _dereq_(163),
+ support = _dereq_(176);
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"146":146,"149":149,"158":158,"159":159,"163":163,"176":176}],171:[function(_dereq_,module,exports){
+var baseMerge = _dereq_(119),
+ createAssigner = _dereq_(132);
+
+/**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+var merge = createAssigner(baseMerge);
+
+module.exports = merge;
+
+},{"119":119,"132":132}],172:[function(_dereq_,module,exports){
+var arrayMap = _dereq_(92),
+ baseDifference = _dereq_(100),
+ baseFlatten = _dereq_(106),
+ bindCallback = _dereq_(128),
+ keysIn = _dereq_(170),
+ pickByArray = _dereq_(152),
+ pickByCallback = _dereq_(153),
+ restParam = _dereq_(86);
+
+/**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+});
+
+module.exports = omit;
+
+},{"100":100,"106":106,"128":128,"152":152,"153":153,"170":170,"86":86,"92":92}],173:[function(_dereq_,module,exports){
+var baseFlatten = _dereq_(106),
+ bindCallback = _dereq_(128),
+ pickByArray = _dereq_(152),
+ pickByCallback = _dereq_(153),
+ restParam = _dereq_(86);
+
+/**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+});
+
+module.exports = pick;
+
+},{"106":106,"128":128,"152":152,"153":153,"86":86}],174:[function(_dereq_,module,exports){
+var baseValues = _dereq_(127),
+ keys = _dereq_(169);
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
+
+},{"127":127,"169":169}],175:[function(_dereq_,module,exports){
+var baseToString = _dereq_(126);
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = escapeRegExp;
+
+},{"126":126}],176:[function(_dereq_,module,exports){
+(function (global){
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to detect DOM support. */
+var document = (document = global.window) && document.document;
+
+/** Native method references. */
+var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ args = arguments,
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if functions can be decompiled by `Function#toString`
+ * (all but Firefox OS certified apps, older Opera mobile browsers, and
+ * the PlayStation 3; forced `false` for Windows 8 apps).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcDecomp = /\bthis\b/.test(function() { return this; });
+
+ /**
+ * Detect if `Function#name` is supported (all but IE).
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ support.funcNames = typeof Function.name == 'string';
+
+ /**
+ * Detect if the DOM is supported.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.dom = document.createDocumentFragment().nodeType === 11;
+ } catch(e) {
+ support.dom = false;
+ }
+
+ /**
+ * Detect if `arguments` object indexes are non-enumerable.
+ *
+ * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object
+ * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat
+ * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`
+ * checks for indexes that exceed the number of function parameters and
+ * whose associated argument values are `0`.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
+ } catch(e) {
+ support.nonEnumArgs = true;
+ }
+}(1, 0));
+
+module.exports = support;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],177:[function(_dereq_,module,exports){
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+function constant(value) {
+ return function() {
+ return value;
+ };
+}
+
+module.exports = constant;
+
+},{}],178:[function(_dereq_,module,exports){
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
+
+},{}],179:[function(_dereq_,module,exports){
+var baseProperty = _dereq_(121),
+ basePropertyDeep = _dereq_(122),
+ isKey = _dereq_(148);
+
+/**
+ * Creates a function which returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
+
+},{"121":121,"122":122,"148":148}],180:[function(_dereq_,module,exports){
+module.exports = _dereq_(186);
+},{"186":186}],181:[function(_dereq_,module,exports){
+module.exports = function(el) {
+
+ var c;
+
+ while (el.childNodes.length) {
+ c = el.childNodes[0];
+ el.removeChild(c);
+ }
+
+ return el;
+};
+},{}],182:[function(_dereq_,module,exports){
+module.exports = _dereq_(189);
+},{"189":189}],183:[function(_dereq_,module,exports){
+module.exports = _dereq_(193);
+},{"193":193}],184:[function(_dereq_,module,exports){
+module.exports = _dereq_(192);
+},{"192":192}],185:[function(_dereq_,module,exports){
+module.exports = function(el) {
+ el.parentNode && el.parentNode.removeChild(el);
+};
+},{}],186:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var index = _dereq_(187);
+
+/**
+ * Whitespace regexp.
+ */
+
+var re = /\s+/;
+
+/**
+ * toString reference.
+ */
+
+var toString = Object.prototype.toString;
+
+/**
+ * Wrap `el` in a `ClassList`.
+ *
+ * @param {Element} el
+ * @return {ClassList}
+ * @api public
+ */
+
+module.exports = function(el){
+ return new ClassList(el);
+};
+
+/**
+ * Initialize a new ClassList for `el`.
+ *
+ * @param {Element} el
+ * @api private
+ */
+
+function ClassList(el) {
+ if (!el || !el.nodeType) {
+ throw new Error('A DOM element reference is required');
+ }
+ this.el = el;
+ this.list = el.classList;
+}
+
+/**
+ * Add class `name` if not already present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.add = function(name){
+ // classList
+ if (this.list) {
+ this.list.add(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (!~i) arr.push(name);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove class `name` when present, or
+ * pass a regular expression to remove
+ * any which match.
+ *
+ * @param {String|RegExp} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.remove = function(name){
+ if ('[object RegExp]' == toString.call(name)) {
+ return this.removeMatching(name);
+ }
+
+ // classList
+ if (this.list) {
+ this.list.remove(name);
+ return this;
+ }
+
+ // fallback
+ var arr = this.array();
+ var i = index(arr, name);
+ if (~i) arr.splice(i, 1);
+ this.el.className = arr.join(' ');
+ return this;
+};
+
+/**
+ * Remove all classes matching `re`.
+ *
+ * @param {RegExp} re
+ * @return {ClassList}
+ * @api private
+ */
+
+ClassList.prototype.removeMatching = function(re){
+ var arr = this.array();
+ for (var i = 0; i < arr.length; i++) {
+ if (re.test(arr[i])) {
+ this.remove(arr[i]);
+ }
+ }
+ return this;
+};
+
+/**
+ * Toggle class `name`, can force state via `force`.
+ *
+ * For browsers that support classList, but do not support `force` yet,
+ * the mistake will be detected and corrected.
+ *
+ * @param {String} name
+ * @param {Boolean} force
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.toggle = function(name, force){
+ // classList
+ if (this.list) {
+ if ("undefined" !== typeof force) {
+ if (force !== this.list.toggle(name, force)) {
+ this.list.toggle(name); // toggle again to correct
+ }
+ } else {
+ this.list.toggle(name);
+ }
+ return this;
+ }
+
+ // fallback
+ if ("undefined" !== typeof force) {
+ if (!force) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ } else {
+ if (this.has(name)) {
+ this.remove(name);
+ } else {
+ this.add(name);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an array of classes.
+ *
+ * @return {Array}
+ * @api public
+ */
+
+ClassList.prototype.array = function(){
+ var className = this.el.getAttribute('class') || '';
+ var str = className.replace(/^\s+|\s+$/g, '');
+ var arr = str.split(re);
+ if ('' === arr[0]) arr.shift();
+ return arr;
+};
+
+/**
+ * Check if class `name` is present.
+ *
+ * @param {String} name
+ * @return {ClassList}
+ * @api public
+ */
+
+ClassList.prototype.has =
+ClassList.prototype.contains = function(name){
+ return this.list
+ ? this.list.contains(name)
+ : !! ~index(this.array(), name);
+};
+
+},{"187":187}],187:[function(_dereq_,module,exports){
+module.exports = function(arr, obj){
+ if (arr.indexOf) return arr.indexOf(obj);
+ for (var i = 0; i < arr.length; ++i) {
+ if (arr[i] === obj) return i;
+ }
+ return -1;
+};
+},{}],188:[function(_dereq_,module,exports){
+var matches = _dereq_(191)
+
+module.exports = function (element, selector, checkYoSelf, root) {
+ element = checkYoSelf ? {parentNode: element} : element
+
+ root = root || document
+
+ // Make sure `element !== document` and `element != null`
+ // otherwise we get an illegal invocation
+ while ((element = element.parentNode) && element !== document) {
+ if (matches(element, selector))
+ return element
+ // After `matches` on the edge case that
+ // the selector matches the root
+ // (when the root is not the document)
+ if (element === root)
+ return
+ }
+}
+
+},{"191":191}],189:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var closest = _dereq_(188)
+ , event = _dereq_(190);
+
+/**
+ * Delegate event `type` to `selector`
+ * and invoke `fn(e)`. A callback function
+ * is returned which may be passed to `.unbind()`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, selector, type, fn, capture){
+ return event.bind(el, type, function(e){
+ var target = e.target || e.srcElement;
+ e.delegateTarget = closest(target, selector, true, el);
+ if (e.delegateTarget) fn.call(el, e);
+ }, capture);
+};
+
+/**
+ * Unbind event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ event.unbind(el, type, fn, capture);
+};
+
+},{"188":188,"190":190}],190:[function(_dereq_,module,exports){
+var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
+ unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
+ prefix = bind !== 'addEventListener' ? 'on' : '';
+
+/**
+ * Bind `el` event `type` to `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.bind = function(el, type, fn, capture){
+ el[bind](prefix + type, fn, capture || false);
+ return fn;
+};
+
+/**
+ * Unbind `el` event `type`'s callback `fn`.
+ *
+ * @param {Element} el
+ * @param {String} type
+ * @param {Function} fn
+ * @param {Boolean} capture
+ * @return {Function}
+ * @api public
+ */
+
+exports.unbind = function(el, type, fn, capture){
+ el[unbind](prefix + type, fn, capture || false);
+ return fn;
+};
+},{}],191:[function(_dereq_,module,exports){
+/**
+ * Module dependencies.
+ */
+
+var query = _dereq_(192);
+
+/**
+ * Element prototype.
+ */
+
+var proto = Element.prototype;
+
+/**
+ * Vendor function.
+ */
+
+var vendor = proto.matches
+ || proto.webkitMatchesSelector
+ || proto.mozMatchesSelector
+ || proto.msMatchesSelector
+ || proto.oMatchesSelector;
+
+/**
+ * Expose `match()`.
+ */
+
+module.exports = match;
+
+/**
+ * Match `el` to `selector`.
+ *
+ * @param {Element} el
+ * @param {String} selector
+ * @return {Boolean}
+ * @api public
+ */
+
+function match(el, selector) {
+ if (!el || el.nodeType !== 1) return false;
+ if (vendor) return vendor.call(el, selector);
+ var nodes = query.all(selector, el.parentNode);
+ for (var i = 0; i < nodes.length; ++i) {
+ if (nodes[i] == el) return true;
+ }
+ return false;
+}
+
+},{"192":192}],192:[function(_dereq_,module,exports){
+function one(selector, el) {
+ return el.querySelector(selector);
+}
+
+exports = module.exports = function(selector, el){
+ el = el || document;
+ return one(selector, el);
+};
+
+exports.all = function(selector, el){
+ el = el || document;
+ return el.querySelectorAll(selector);
+};
+
+exports.engine = function(obj){
+ if (!obj.one) throw new Error('.one callback required');
+ if (!obj.all) throw new Error('.all callback required');
+ one = obj.one;
+ exports.all = obj.all;
+ return exports;
+};
+
+},{}],193:[function(_dereq_,module,exports){
+
+/**
+ * Expose `parse`.
+ */
+
+module.exports = parse;
+
+/**
+ * Tests for browser support.
+ */
+
+var div = document.createElement('div');
+// Setup
+div.innerHTML = ' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
+// Make sure that link elements get serialized correctly by innerHTML
+// This requires a wrapper element in IE
+var innerHTMLBug = !div.getElementsByTagName('link').length;
+div = undefined;
+
+/**
+ * Wrap map from jquery.
+ */
+
+var map = {
+ legend: [1, '<fieldset>', '</fieldset>'],
+ tr: [2, '<table><tbody>', '</tbody></table>'],
+ col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
+ // for script/link/style tags to work in IE6-8, you have to wrap
+ // in a div with a non-whitespace character in front, ha!
+ _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
+};
+
+map.td =
+map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
+
+map.option =
+map.optgroup = [1, '<select multiple="multiple">', '</select>'];
+
+map.thead =
+map.tbody =
+map.colgroup =
+map.caption =
+map.tfoot = [1, '<table>', '</table>'];
+
+map.polyline =
+map.ellipse =
+map.polygon =
+map.circle =
+map.text =
+map.line =
+map.path =
+map.rect =
+map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
+
+/**
+ * Parse `html` and return a DOM Node instance, which could be a TextNode,
+ * HTML DOM Node of some kind (<div> for example), or a DocumentFragment
+ * instance, depending on the contents of the `html` string.
+ *
+ * @param {String} html - HTML string to "domify"
+ * @param {Document} doc - The `document` instance to create the Node for
+ * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
+ * @api private
+ */
+
+function parse(html, doc) {
+ if ('string' != typeof html) throw new TypeError('String expected');
+
+ // default to the global `document` object
+ if (!doc) doc = document;
+
+ // tag name
+ var m = /<([\w:]+)/.exec(html);
+ if (!m) return doc.createTextNode(html);
+
+ html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace
+
+ var tag = m[1];
+
+ // body support
+ if (tag == 'body') {
+ var el = doc.createElement('html');
+ el.innerHTML = html;
+ return el.removeChild(el.lastChild);
+ }
+
+ // wrap map
+ var wrap = map[tag] || map._default;
+ var depth = wrap[0];
+ var prefix = wrap[1];
+ var suffix = wrap[2];
+ var el = doc.createElement('div');
+ el.innerHTML = prefix + html + suffix;
+ while (depth--) el = el.lastChild;
+
+ // one element
+ if (el.firstChild == el.lastChild) {
+ return el.removeChild(el.firstChild);
+ }
+
+ // several elements
+ var fragment = doc.createDocumentFragment();
+ while (el.firstChild) {
+ fragment.appendChild(el.removeChild(el.firstChild));
+ }
+
+ return fragment;
+}
+
+},{}],194:[function(_dereq_,module,exports){
+module.exports = _dereq_(196);
+
+module.exports.Collection = _dereq_(195);
+},{"195":195,"196":196}],195:[function(_dereq_,module,exports){
+'use strict';
+
+/**
+ * An empty collection stub. Use {@link RefsCollection.extend} to extend a
+ * collection with ref semantics.
+ *
+ * @classdesc A change and inverse-reference aware collection with set semantics.
+ *
+ * @class RefsCollection
+ */
+function RefsCollection() { }
+
+/**
+ * Extends a collection with {@link Refs} aware methods
+ *
+ * @memberof RefsCollection
+ * @static
+ *
+ * @param {Array<Object>} collection
+ * @param {Refs} refs instance
+ * @param {Object} property represented by the collection
+ * @param {Object} target object the collection is attached to
+ *
+ * @return {RefsCollection<Object>} the extended array
+ */
+function extend(collection, refs, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ /**
+ * Removes the given element from the array and returns it.
+ *
+ * @method RefsCollection#remove
+ *
+ * @param {Object} element the element to remove
+ */
+ collection.remove = function(element) {
+ var idx = this.indexOf(element);
+ if (idx !== -1) {
+ this.splice(idx, 1);
+
+ // unset inverse
+ refs.unset(element, inverseProperty, target);
+ }
+
+ return element;
+ };
+
+ /**
+ * Returns true if the collection contains the given element
+ *
+ * @method RefsCollection#contains
+ *
+ * @param {Object} element the element to check for
+ */
+ collection.contains = function(element) {
+ return this.indexOf(element) !== -1;
+ };
+
+ /**
+ * Adds an element to the array, unless it exists already (set semantics).
+ *
+ * @method RefsCollection#add
+ *
+ * @param {Object} element the element to add
+ */
+ collection.add = function(element) {
+
+ if (!this.contains(element)) {
+ this.push(element);
+
+ // set inverse
+ refs.set(element, inverseProperty, target);
+ }
+ };
+
+ return collection;
+}
+
+
+module.exports.extend = extend;
+},{}],196:[function(_dereq_,module,exports){
+'use strict';
+
+var Collection = _dereq_(195);
+
+function hasOwnProperty(e, property) {
+ return Object.prototype.hasOwnProperty.call(e, property.name || property);
+}
+
+
+function defineCollectionProperty(ref, property, target) {
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+ value: Collection.extend(target[property.name] || [], ref, property, target)
+ });
+}
+
+
+function defineProperty(ref, property, target) {
+
+ var inverseProperty = property.inverse;
+
+ var _value = target[property.name];
+
+ Object.defineProperty(target, property.name, {
+ enumerable: property.enumerable,
+
+ get: function() {
+ return _value;
+ },
+
+ set: function(value) {
+
+ // return if we already performed all changes
+ if (value === _value) {
+ return;
+ }
+
+ var old = _value;
+
+ // temporary set null
+ _value = null;
+
+ if (old) {
+ ref.unset(old, inverseProperty, target);
+ }
+
+ // set new value
+ _value = value;
+
+ // set inverse value
+ ref.set(_value, inverseProperty, target);
+ }
+ });
+
+}
+
+/**
+ * Creates a new references object defining two inversly related
+ * attribute descriptors a and b.
+ *
+ * <p>
+ * When bound to an object using {@link Refs#bind} the references
+ * get activated and ensure that add and remove operations are applied
+ * reversely, too.
+ * </p>
+ *
+ * <p>
+ * For attributes represented as collections {@link Refs} provides the
+ * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions
+ * that must be used to properly hook into the inverse change mechanism.
+ * </p>
+ *
+ * @class Refs
+ *
+ * @classdesc A bi-directional reference between two attributes.
+ *
+ * @param {Refs.AttributeDescriptor} a property descriptor
+ * @param {Refs.AttributeDescriptor} b property descriptor
+ *
+ * @example
+ *
+ * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });
+ *
+ * var car = { name: 'toyota' };
+ * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];
+ *
+ * refs.bind(car, 'wheels');
+ *
+ * car.wheels // []
+ * car.wheels.add(wheels[0]);
+ * car.wheels.add(wheels[1]);
+ *
+ * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
+ *
+ * wheels[0].car // { name: 'toyota' };
+ * car.wheels.remove(wheels[0]);
+ *
+ * wheels[0].car // undefined
+ */
+function Refs(a, b) {
+
+ if (!(this instanceof Refs)) {
+ return new Refs(a, b);
+ }
+
+ // link
+ a.inverse = b;
+ b.inverse = a;
+
+ this.props = {};
+ this.props[a.name] = a;
+ this.props[b.name] = b;
+}
+
+/**
+ * Binds one side of a bi-directional reference to a
+ * target object.
+ *
+ * @memberOf Refs
+ *
+ * @param {Object} target
+ * @param {String} property
+ */
+Refs.prototype.bind = function(target, property) {
+ if (typeof property === 'string') {
+ if (!this.props[property]) {
+ throw new Error('no property <' + property + '> in ref');
+ }
+ property = this.props[property];
+ }
+
+ if (property.collection) {
+ defineCollectionProperty(this, property, target);
+ } else {
+ defineProperty(this, property, target);
+ }
+};
+
+Refs.prototype.ensureBound = function(target, property) {
+ if (!hasOwnProperty(target, property)) {
+ this.bind(target, property);
+ }
+};
+
+Refs.prototype.unset = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].remove(value);
+ } else {
+ target[property.name] = undefined;
+ }
+ }
+};
+
+Refs.prototype.set = function(target, property, value) {
+
+ if (target) {
+ this.ensureBound(target, property);
+
+ if (property.collection) {
+ target[property.name].add(value);
+ } else {
+ target[property.name] = value;
+ }
+ }
+};
+
+module.exports = Refs;
+
+
+/**
+ * An attribute descriptor to be used specify an attribute in a {@link Refs} instance
+ *
+ * @typedef {Object} Refs.AttributeDescriptor
+ * @property {String} name
+ * @property {boolean} [collection=false]
+ * @property {boolean} [enumerable=false]
+ */
+},{"195":195}]},{},[1])(1)
+});
+//# sourceMappingURL=bpmn-viewer.js.map \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js.map b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js.map
new file mode 100644
index 0000000..72dbc2e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","lib/Viewer.js","lib/core/index.js","lib/draw/BpmnRenderer.js","lib/draw/PathMap.js","lib/draw/index.js","lib/import/BpmnImporter.js","lib/import/BpmnTreeWalker.js","lib/import/Importer.js","lib/import/Util.js","lib/import/index.js","lib/util/DiUtil.js","lib/util/LabelUtil.js","lib/util/ModelUtil.js","node_modules/bpmn-moddle/index.js","node_modules/bpmn-moddle/lib/bpmn-moddle.js","node_modules/bpmn-moddle/lib/simple.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/common.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/reader.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/writer.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/sax/lib/sax.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/tiny-stack/lib/tiny-stack.js","node_modules/bpmn-moddle/node_modules/moddle/index.js","node_modules/bpmn-moddle/node_modules/moddle/lib/base.js","node_modules/bpmn-moddle/node_modules/moddle/lib/descriptor-builder.js","node_modules/bpmn-moddle/node_modules/moddle/lib/factory.js","node_modules/bpmn-moddle/node_modules/moddle/lib/moddle.js","node_modules/bpmn-moddle/node_modules/moddle/lib/ns.js","node_modules/bpmn-moddle/node_modules/moddle/lib/properties.js","node_modules/bpmn-moddle/node_modules/moddle/lib/registry.js","node_modules/bpmn-moddle/node_modules/moddle/lib/types.js","node_modules/bpmn-moddle/resources/bpmn/json/bpmn.json","node_modules/bpmn-moddle/resources/bpmn/json/bpmndi.json","node_modules/bpmn-moddle/resources/bpmn/json/dc.json","node_modules/bpmn-moddle/resources/bpmn/json/di.json","node_modules/diagram-js/index.js","node_modules/diagram-js/lib/Diagram.js","node_modules/diagram-js/lib/core/Canvas.js","node_modules/diagram-js/lib/core/ElementFactory.js","node_modules/diagram-js/lib/core/ElementRegistry.js","node_modules/diagram-js/lib/core/EventBus.js","node_modules/diagram-js/lib/core/GraphicsFactory.js","node_modules/diagram-js/lib/core/index.js","node_modules/diagram-js/lib/draw/Renderer.js","node_modules/diagram-js/lib/draw/Styles.js","node_modules/diagram-js/lib/draw/index.js","node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js","node_modules/diagram-js/lib/features/interaction-events/index.js","node_modules/diagram-js/lib/features/outline/Outline.js","node_modules/diagram-js/lib/features/outline/index.js","node_modules/diagram-js/lib/features/overlays/Overlays.js","node_modules/diagram-js/lib/features/overlays/index.js","node_modules/diagram-js/lib/features/selection/Selection.js","node_modules/diagram-js/lib/features/selection/SelectionBehavior.js","node_modules/diagram-js/lib/features/selection/SelectionVisuals.js","node_modules/diagram-js/lib/features/selection/index.js","node_modules/diagram-js/lib/model/index.js","node_modules/diagram-js/lib/util/Collections.js","node_modules/diagram-js/lib/util/Elements.js","node_modules/diagram-js/lib/util/Event.js","node_modules/diagram-js/lib/util/GraphicsUtil.js","node_modules/diagram-js/lib/util/IdGenerator.js","node_modules/diagram-js/lib/util/Mouse.js","node_modules/diagram-js/lib/util/Platform.js","node_modules/diagram-js/lib/util/Text.js","node_modules/diagram-js/node_modules/eve/eve.js","node_modules/diagram-js/node_modules/snapsvg/dist/snap.svg.js","node_modules/diagram-js/vendor/snapsvg.js","node_modules/didi/lib/annotation.js","node_modules/didi/lib/index.js","node_modules/didi/lib/injector.js","node_modules/didi/lib/module.js","node_modules/inherits/inherits_browser.js","node_modules/lodash/array/last.js","node_modules/lodash/collection/every.js","node_modules/lodash/collection/filter.js","node_modules/lodash/collection/find.js","node_modules/lodash/collection/forEach.js","node_modules/lodash/collection/groupBy.js","node_modules/lodash/collection/includes.js","node_modules/lodash/collection/map.js","node_modules/lodash/collection/reduce.js","node_modules/lodash/collection/some.js","node_modules/lodash/date/now.js","node_modules/lodash/function/debounce.js","node_modules/lodash/function/defer.js","node_modules/lodash/function/restParam.js","node_modules/lodash/internal/SetCache.js","node_modules/lodash/internal/arrayCopy.js","node_modules/lodash/internal/arrayEach.js","node_modules/lodash/internal/arrayEvery.js","node_modules/lodash/internal/arrayFilter.js","node_modules/lodash/internal/arrayMap.js","node_modules/lodash/internal/arrayReduce.js","node_modules/lodash/internal/arraySome.js","node_modules/lodash/internal/assignWith.js","node_modules/lodash/internal/baseAssign.js","node_modules/lodash/internal/baseCallback.js","node_modules/lodash/internal/baseCopy.js","node_modules/lodash/internal/baseDelay.js","node_modules/lodash/internal/baseDifference.js","node_modules/lodash/internal/baseEach.js","node_modules/lodash/internal/baseEvery.js","node_modules/lodash/internal/baseFilter.js","node_modules/lodash/internal/baseFind.js","node_modules/lodash/internal/baseFindIndex.js","node_modules/lodash/internal/baseFlatten.js","node_modules/lodash/internal/baseFor.js","node_modules/lodash/internal/baseForIn.js","node_modules/lodash/internal/baseForOwn.js","node_modules/lodash/internal/baseGet.js","node_modules/lodash/internal/baseIndexOf.js","node_modules/lodash/internal/baseIsEqual.js","node_modules/lodash/internal/baseIsEqualDeep.js","node_modules/lodash/internal/baseIsFunction.js","node_modules/lodash/internal/baseIsMatch.js","node_modules/lodash/internal/baseMap.js","node_modules/lodash/internal/baseMatches.js","node_modules/lodash/internal/baseMatchesProperty.js","node_modules/lodash/internal/baseMerge.js","node_modules/lodash/internal/baseMergeDeep.js","node_modules/lodash/internal/baseProperty.js","node_modules/lodash/internal/basePropertyDeep.js","node_modules/lodash/internal/baseReduce.js","node_modules/lodash/internal/baseSlice.js","node_modules/lodash/internal/baseSome.js","node_modules/lodash/internal/baseToString.js","node_modules/lodash/internal/baseValues.js","node_modules/lodash/internal/bindCallback.js","node_modules/lodash/internal/cacheIndexOf.js","node_modules/lodash/internal/cachePush.js","node_modules/lodash/internal/createAggregator.js","node_modules/lodash/internal/createAssigner.js","node_modules/lodash/internal/createBaseEach.js","node_modules/lodash/internal/createBaseFor.js","node_modules/lodash/internal/createCache.js","node_modules/lodash/internal/createFind.js","node_modules/lodash/internal/createForEach.js","node_modules/lodash/internal/createReduce.js","node_modules/lodash/internal/equalArrays.js","node_modules/lodash/internal/equalByTag.js","node_modules/lodash/internal/equalObjects.js","node_modules/lodash/internal/getLength.js","node_modules/lodash/internal/getSymbols.js","node_modules/lodash/internal/indexOfNaN.js","node_modules/lodash/internal/isArrayLike.js","node_modules/lodash/internal/isIndex.js","node_modules/lodash/internal/isIterateeCall.js","node_modules/lodash/internal/isKey.js","node_modules/lodash/internal/isLength.js","node_modules/lodash/internal/isObjectLike.js","node_modules/lodash/internal/isStrictComparable.js","node_modules/lodash/internal/pickByArray.js","node_modules/lodash/internal/pickByCallback.js","node_modules/lodash/internal/shimIsPlainObject.js","node_modules/lodash/internal/shimKeys.js","node_modules/lodash/internal/toObject.js","node_modules/lodash/internal/toPath.js","node_modules/lodash/lang/isArguments.js","node_modules/lodash/lang/isArray.js","node_modules/lodash/lang/isFunction.js","node_modules/lodash/lang/isNative.js","node_modules/lodash/lang/isNumber.js","node_modules/lodash/lang/isObject.js","node_modules/lodash/lang/isPlainObject.js","node_modules/lodash/lang/isString.js","node_modules/lodash/lang/isTypedArray.js","node_modules/lodash/lang/toPlainObject.js","node_modules/lodash/object/assign.js","node_modules/lodash/object/keys.js","node_modules/lodash/object/keysIn.js","node_modules/lodash/object/merge.js","node_modules/lodash/object/omit.js","node_modules/lodash/object/pick.js","node_modules/lodash/object/values.js","node_modules/lodash/string/escapeRegExp.js","node_modules/lodash/support.js","node_modules/lodash/utility/constant.js","node_modules/lodash/utility/identity.js","node_modules/lodash/utility/property.js","node_modules/min-dom/lib/classes.js","node_modules/min-dom/lib/clear.js","node_modules/min-dom/lib/delegate.js","node_modules/min-dom/lib/domify.js","node_modules/min-dom/lib/query.js","node_modules/min-dom/lib/remove.js","node_modules/min-dom/node_modules/component-classes/index.js","node_modules/min-dom/node_modules/component-classes/node_modules/component-indexof/index.js","node_modules/min-dom/node_modules/component-closest/index.js","node_modules/min-dom/node_modules/component-delegate/index.js","node_modules/min-dom/node_modules/component-event/index.js","node_modules/min-dom/node_modules/component-matches-selector/index.js","node_modules/min-dom/node_modules/component-query/index.js","node_modules/min-dom/node_modules/domify/index.js","node_modules/object-refs/index.js","node_modules/object-refs/lib/collection.js","node_modules/object-refs/lib/refs.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChWA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACl4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt0FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvNA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7OA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxfA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;ACAA;;ACAA;;ACAA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","'use strict';\n\nvar assign = require(168),\n omit = require(172),\n isString = require(165),\n isNumber = require(162);\n\nvar domify = require(183),\n domQuery = require(184),\n domRemove = require(185);\n\nvar Diagram = require(35),\n BpmnModdle = require(14);\n\nvar Importer = require(8);\n\n\nfunction initListeners(diagram, listeners) {\n var events = diagram.get('eventBus');\n\n listeners.forEach(function(l) {\n events.on(l.event, l.handler);\n });\n}\n\nfunction checkValidationError(err) {\n\n // check if we can help the user by indicating wrong BPMN 2.0 xml\n // (in case he or the exporting tool did not get that right)\n\n var pattern = /unparsable content <([^>]+)> detected([/s/S]*)$/;\n var match = pattern.exec(err.message);\n\n if (match) {\n err.message =\n 'unparsable content <' + match[1] + '> detected; ' +\n 'this may indicate an invalid BPMN 2.0 diagram file' + match[2];\n }\n\n return err;\n}\n\nvar DEFAULT_OPTIONS = {\n width: '100%',\n height: '100%',\n position: 'relative',\n container: 'body'\n};\n\n\n/**\n * Ensure the passed argument is a proper unit (defaulting to px)\n */\nfunction ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}\n\n/**\n * A viewer for BPMN 2.0 diagrams.\n *\n * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include\n * additional features.\n *\n *\n * ## Extending the Viewer\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n * eventBus.on('element.hover', function(event) {\n * console.log()\n * })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n * __init__: [ 'interactionLogger' ],\n * interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });\n * bpmnViewer.importXML(...);\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Viewer(options) {\n\n this.options = options = assign({}, DEFAULT_OPTIONS, options || {});\n\n var parent = options.container;\n\n // support jquery element\n // unwrap it if passed\n if (parent.get) {\n parent = parent.get(0);\n }\n\n // support selector\n if (isString(parent)) {\n parent = domQuery(parent);\n }\n\n var container = this.container = domify('<div class=\"bjs-container\"></div>');\n parent.appendChild(container);\n\n assign(container.style, {\n width: ensureUnit(options.width),\n height: ensureUnit(options.height),\n position: options.position\n });\n\n /**\n * The code in the <project-logo></project-logo> area\n * must not be changed, see http://bpmn.io/license for more information\n *\n * <project-logo>\n */\n\n /* jshint -W101 */\n\n // inlined ../resources/bpmnjs.png\n var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';\n\n /* jshint +W101 */\n\n var linkMarkup =\n '<a href=\"http://bpmn.io\" ' +\n 'target=\"_blank\" ' +\n 'class=\"bjs-powered-by\" ' +\n 'title=\"Powered by bpmn.io\" ' +\n 'style=\"position: absolute; bottom: 15px; right: 15px; z-index: 100\">' +\n '<img src=\"data:image/png;base64,' + logoData + '\">' +\n '</a>';\n\n container.appendChild(domify(linkMarkup));\n\n /* </project-logo> */\n}\n\nViewer.prototype.importXML = function(xml, done) {\n\n var self = this;\n\n this.moddle = this.createModdle();\n\n this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {\n\n if (err) {\n err = checkValidationError(err);\n return done(err);\n }\n\n var parseWarnings = context.warnings;\n\n self.importDefinitions(definitions, function(err, importWarnings) {\n if (err) {\n return done(err);\n }\n\n done(null, parseWarnings.concat(importWarnings || []));\n });\n });\n};\n\nViewer.prototype.saveXML = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var definitions = this.definitions;\n\n if (!definitions) {\n return done(new Error('no definitions loaded'));\n }\n\n this.moddle.toXML(definitions, options, done);\n};\n\nViewer.prototype.createModdle = function() {\n return new BpmnModdle(this.options.moddleExtensions);\n};\n\nViewer.prototype.saveSVG = function(options, done) {\n\n if (!done) {\n done = options;\n options = {};\n }\n\n var canvas = this.get('canvas');\n\n var contentNode = canvas.getDefaultLayer(),\n defsNode = canvas._svg.select('defs');\n\n var contents = contentNode.innerSVG(),\n defs = (defsNode && defsNode.outerSVG()) || '';\n\n var bbox = contentNode.getBBox();\n\n var svg =\n '<?xml version=\"1.0\" encoding=\"utf-8\"?>/n' +\n '<!-- created with bpmn-js / http://bpmn.io -->/n' +\n '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">/n' +\n '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ' +\n 'width=\"' + bbox.width + '\" height=\"' + bbox.height + '\" ' +\n 'viewBox=\"' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '\" version=\"1.1\">' +\n defs + contents +\n '</svg>';\n\n done(null, svg);\n};\n\nViewer.prototype.get = function(name) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.get(name);\n};\n\nViewer.prototype.invoke = function(fn) {\n\n if (!this.diagram) {\n throw new Error('no diagram loaded');\n }\n\n return this.diagram.invoke(fn);\n};\n\nViewer.prototype.importDefinitions = function(definitions, done) {\n\n // use try/catch to not swallow synchronous exceptions\n // that may be raised during model parsing\n try {\n if (this.diagram) {\n this.clear();\n }\n\n this.definitions = definitions;\n\n var diagram = this.diagram = this._createDiagram(this.options);\n\n this._init(diagram);\n\n Importer.importBpmnDiagram(diagram, definitions, done);\n } catch (e) {\n done(e);\n }\n};\n\nViewer.prototype._init = function(diagram) {\n initListeners(diagram, this.__listeners || []);\n};\n\nViewer.prototype._createDiagram = function(options) {\n\n var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);\n\n // add self as an available service\n modules.unshift({\n bpmnjs: [ 'value', this ],\n moddle: [ 'value', this.moddle ]\n });\n\n options = omit(options, 'additionalModules');\n\n options = assign(options, {\n canvas: { container: this.container },\n modules: modules\n });\n\n return new Diagram(options);\n};\n\n\nViewer.prototype.getModules = function() {\n return this._modules;\n};\n\n/**\n * Remove all drawn elements from the viewer.\n *\n * After calling this method the viewer can still\n * be reused for opening another diagram.\n */\nViewer.prototype.clear = function() {\n var diagram = this.diagram;\n\n if (diagram) {\n diagram.destroy();\n }\n};\n\n/**\n * Destroy the viewer instance and remove all its remainders\n * from the document tree.\n */\nViewer.prototype.destroy = function() {\n // clear underlying diagram\n this.clear();\n\n // remove container\n domRemove(this.container);\n};\n\n/**\n * Register an event listener on the viewer\n *\n * @param {String} event\n * @param {Function} handler\n */\nViewer.prototype.on = function(event, handler) {\n var diagram = this.diagram,\n listeners = this.__listeners = this.__listeners || [];\n\n listeners.push({ event: event, handler: handler });\n\n if (diagram) {\n diagram.get('eventBus').on(event, handler);\n }\n};\n\n// modules the viewer is composed of\nViewer.prototype._modules = [\n require(2),\n require(55),\n require(51)\n];\n\nmodule.exports = Viewer;\n","module.exports = {\n __depends__: [\n require(5),\n require(10)\n ]\n};","'use strict';\n\nvar inherits = require(72),\n isArray = require(159),\n isObject = require(163),\n assign = require(168),\n forEach = require(77),\n every = require(74),\n includes = require(79),\n some = require(82);\n\nvar DefaultRenderer = require(43),\n TextUtil = require(64),\n DiUtil = require(11);\n\nvar createLine = DefaultRenderer.createLine;\n\n\nfunction BpmnRenderer(events, styles, pathMap) {\n\n DefaultRenderer.call(this, styles);\n\n var TASK_BORDER_RADIUS = 10;\n var INNER_OUTER_DIST = 3;\n\n var LABEL_STYLE = {\n fontFamily: 'Arial, sans-serif',\n fontSize: '12px'\n };\n\n var textUtil = new TextUtil({\n style: LABEL_STYLE,\n size: { width: 100 }\n });\n\n var markers = {};\n\n function addMarker(id, element) {\n markers[id] = element;\n }\n\n function marker(id) {\n return markers[id];\n }\n\n function initMarkers(svg) {\n\n function createMarker(id, options) {\n var attrs = assign({\n fill: 'black',\n strokeWidth: 1,\n strokeLinecap: 'round',\n strokeDasharray: 'none'\n }, options.attrs);\n\n var ref = options.ref || { x: 0, y: 0 };\n\n var scale = options.scale || 1;\n\n // fix for safari / chrome / firefox bug not correctly\n // resetting stroke dash array\n if (attrs.strokeDasharray === 'none') {\n attrs.strokeDasharray = [10000, 1];\n }\n\n var marker = options.element\n .attr(attrs)\n .marker(0, 0, 20, 20, ref.x, ref.y)\n .attr({\n markerWidth: 20 * scale,\n markerHeight: 20 * scale\n });\n\n return addMarker(id, marker);\n }\n\n\n createMarker('sequenceflow-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15 Z'),\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('messageflow-start', {\n element: svg.circle(6, 6, 3.5),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 6, y: 6 }\n });\n\n createMarker('messageflow-end', {\n element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),\n attrs: {\n fill: 'white',\n stroke: 'black',\n strokeLinecap: 'butt'\n },\n ref: { x: 8.5, y: 5 }\n });\n\n createMarker('data-association-end', {\n element: svg.path('M 1 5 L 11 10 L 1 15'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: 11, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-flow-marker', {\n element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),\n attrs: {\n fill: 'white',\n stroke: 'black'\n },\n ref: { x: -1, y: 10 },\n scale: 0.5\n });\n\n createMarker('conditional-default-flow-marker', {\n element: svg.path('M 1 4 L 5 16'),\n attrs: {\n stroke: 'black'\n },\n ref: { x: -5, y: 10 },\n scale: 0.5\n });\n }\n\n function computeStyle(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return styles.style(traits || [], assign(defaultStyles, custom || {}));\n }\n\n function drawCircle(p, width, height, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n var cx = width / 2,\n cy = height / 2;\n\n return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);\n }\n\n function drawRect(p, width, height, r, offset, attrs) {\n\n if (isObject(offset)) {\n attrs = offset;\n offset = 0;\n }\n\n offset = offset || 0;\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);\n }\n\n function drawDiamond(p, width, height, attrs) {\n\n var x_2 = width / 2;\n var y_2 = height / 2;\n\n var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];\n\n attrs = computeStyle(attrs, {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'white'\n });\n\n return p.polygon(points).attr(attrs);\n }\n\n function drawLine(p, waypoints, attrs) {\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n stroke: 'black',\n strokeWidth: 2,\n fill: 'none'\n });\n\n return createLine(waypoints, attrs).appendTo(p);\n }\n\n function drawPath(p, d, attrs) {\n\n attrs = computeStyle(attrs, [ 'no-fill' ], {\n strokeWidth: 2,\n stroke: 'black'\n });\n\n return p.path(d).attr(attrs);\n }\n\n function as(type) {\n return function(p, element) {\n return handlers[type](p, element);\n };\n }\n\n function renderer(type) {\n return handlers[type];\n }\n\n function renderEventContent(element, p) {\n\n var event = getSemantic(element);\n var isThrowing = isThrowEvent(event);\n\n if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {\n return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {\n return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {\n return renderer('bpmn:ConditionalEventDefinition')(p, element);\n }\n\n if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {\n return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {\n return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {\n return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {\n return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {\n return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {\n return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {\n return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {\n return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);\n }\n\n if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {\n return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);\n }\n\n return null;\n }\n\n function renderLabel(p, label, options) {\n return textUtil.createText(p, label || '', options).addClass('djs-label');\n }\n\n function renderEmbeddedLabel(p, element, align) {\n var semantic = getSemantic(element);\n return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });\n }\n\n function renderExternalLabel(p, element, align) {\n var semantic = getSemantic(element);\n\n if (!semantic.name) {\n element.hidden = true;\n }\n\n return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });\n }\n\n function renderLaneLabel(p, text, element) {\n var textBox = renderLabel(p, text, {\n box: { height: 30, width: element.height },\n align: 'center-middle'\n });\n\n var top = -1 * element.height;\n textBox.transform(\n 'rotate(270) ' +\n 'translate(' + top + ',' + 0 + ')'\n );\n }\n\n function createPathFromConnection(connection) {\n var waypoints = connection.waypoints;\n\n var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;\n for (var i = 1; i < waypoints.length; i++) {\n pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';\n }\n return pathData;\n }\n\n var handlers = {\n 'bpmn:Event': function(p, element, attrs) {\n return drawCircle(p, element.width, element.height, attrs);\n },\n 'bpmn:StartEvent': function(p, element) {\n var attrs = {};\n var semantic = getSemantic(element);\n\n if (!semantic.isInterrupting) {\n attrs = {\n strokeDasharray: '6',\n strokeLinecap: 'round'\n };\n }\n\n var circle = renderer('bpmn:Event')(p, element, attrs);\n\n renderEventContent(element, p);\n\n return circle;\n },\n 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.235,\n my: 0.315\n }\n });\n\n var fill = isThrowing ? 'black' : 'white';\n var stroke = isThrowing ? 'white' : 'black';\n\n var messagePath = drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill,\n stroke: stroke\n });\n\n return messagePath;\n },\n 'bpmn:TimerEventDefinition': function(p, element) {\n\n var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {\n strokeWidth: 2\n });\n\n var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n drawPath(p, pathData, {\n strokeWidth: 2,\n strokeLinecap: 'square'\n });\n\n for(var i = 0;i < 12;i++) {\n\n var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {\n xScaleFactor: 0.75,\n yScaleFactor: 0.75,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.5,\n my: 0.5\n }\n });\n\n var width = element.width / 2;\n var height = element.height / 2;\n\n drawPath(p, linePathData, {\n strokeWidth: 1,\n strokeLinecap: 'square',\n transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'\n });\n }\n\n return circle;\n },\n 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.555\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ConditionalEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.222\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_LINK', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.57,\n my: 0.263\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_ERROR', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.2,\n my: 0.722\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {\n xScaleFactor: 1.0,\n yScaleFactor: 1.0,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.638,\n my: -0.055\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n }).transform('rotate(45)');\n },\n 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.201,\n my: 0.472\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.5,\n my: 0.2\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {\n var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {\n xScaleFactor: 1.1,\n yScaleFactor: 1.1,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.222,\n my: 0.36\n }\n });\n\n var fill = isThrowing ? 'black' : 'none';\n\n return drawPath(p, pathData, {\n strokeWidth: 1,\n fill: fill\n });\n },\n 'bpmn:ParallelMultipleEventDefinition': function(p, event) {\n var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {\n xScaleFactor: 1.2,\n yScaleFactor: 1.2,\n containerWidth: event.width,\n containerHeight: event.height,\n position: {\n mx: 0.458,\n my: 0.194\n }\n });\n\n return drawPath(p, pathData, {\n strokeWidth: 1\n });\n },\n 'bpmn:EndEvent': function(p, element) {\n var circle = renderer('bpmn:Event')(p, element, {\n strokeWidth: 4\n });\n\n renderEventContent(element, p, true);\n\n return circle;\n },\n 'bpmn:TerminateEventDefinition': function(p, element) {\n var circle = drawCircle(p, element.width, element.height, 8, {\n strokeWidth: 4,\n fill: 'black'\n });\n\n return circle;\n },\n 'bpmn:IntermediateEvent': function(p, element) {\n var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });\n /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),\n 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),\n\n 'bpmn:Activity': function(p, element, attrs) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);\n },\n\n 'bpmn:Task': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n renderEmbeddedLabel(p, element, 'center-middle');\n attachTaskMarkers(p, element);\n return rect;\n },\n 'bpmn:ServiceTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 12,\n y: 18\n }\n });\n\n /* service bg */ drawPath(p, pathDataBG, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {\n abspos: {\n x: 17.2,\n y: 18\n }\n });\n\n /* service fill */ drawPath(p, fillPathData, {\n strokeWidth: 0,\n stroke: 'none',\n fill: 'white'\n });\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n abspos: {\n x: 17,\n y: 22\n }\n });\n\n /* service */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'white'\n });\n\n return task;\n },\n 'bpmn:UserTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var x = 15;\n var y = 12;\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user path */ drawPath(p, pathData, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user2 path */ drawPath(p, pathData2, {\n strokeWidth: 0.5,\n fill: 'none'\n });\n\n var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {\n abspos: {\n x: x,\n y: y\n }\n });\n\n /* user3 path */ drawPath(p, pathData3, {\n strokeWidth: 0.5,\n fill: 'black'\n });\n\n return task;\n },\n 'bpmn:ManualTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {\n abspos: {\n x: 17,\n y: 15\n }\n });\n\n /* manual path */ drawPath(p, pathData, {\n strokeWidth: 0.25,\n fill: 'white',\n stroke: 'black'\n });\n\n return task;\n },\n 'bpmn:SendTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.285,\n my: 0.357\n }\n });\n\n /* send path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black',\n stroke: 'white'\n });\n\n return task;\n },\n 'bpmn:ReceiveTask' : function(p, element) {\n var semantic = getSemantic(element);\n\n var task = renderer('bpmn:Task')(p, element);\n var pathData;\n\n if (semantic.instantiate) {\n drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });\n\n pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {\n abspos: {\n x: 7.77,\n y: 9.52\n }\n });\n } else {\n\n pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n xScaleFactor: 0.9,\n yScaleFactor: 0.9,\n containerWidth: 21,\n containerHeight: 14,\n position: {\n mx: 0.3,\n my: 0.4\n }\n });\n }\n\n /* receive path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:ScriptTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {\n abspos: {\n x: 15,\n y: 20\n }\n });\n\n /* script path */ drawPath(p, pathData, {\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:BusinessRuleTask': function(p, element) {\n var task = renderer('bpmn:Task')(p, element);\n\n var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessHeaderPath = drawPath(p, headerPathData);\n businessHeaderPath.attr({\n strokeWidth: 1,\n fill: 'AAA'\n });\n\n var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {\n abspos: {\n x: 8,\n y: 8\n }\n });\n\n var businessPath = drawPath(p, headerData);\n businessPath.attr({\n strokeWidth: 1\n });\n\n return task;\n },\n 'bpmn:SubProcess': function(p, element, attrs) {\n var rect = renderer('bpmn:Activity')(p, element, attrs);\n\n var semantic = getSemantic(element);\n\n var expanded = DiUtil.isExpanded(semantic);\n\n var isEventSubProcess = !!semantic.triggeredByEvent;\n if (isEventSubProcess) {\n rect.attr({\n strokeDasharray: '1,2'\n });\n }\n\n renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');\n\n if (expanded) {\n attachTaskMarkers(p, element);\n } else {\n attachTaskMarkers(p, element, ['SubProcessMarker']);\n }\n\n return rect;\n },\n 'bpmn:AdHocSubProcess': function(p, element) {\n return renderer('bpmn:SubProcess')(p, element);\n },\n 'bpmn:Transaction': function(p, element) {\n var outer = renderer('bpmn:SubProcess')(p, element);\n\n var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);\n\n /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);\n\n return outer;\n },\n 'bpmn:CallActivity': function(p, element) {\n return renderer('bpmn:Task')(p, element, {\n strokeWidth: 5\n });\n },\n 'bpmn:Participant': function(p, element) {\n\n var lane = renderer('bpmn:Lane')(p, element, {\n fill: 'White'\n });\n\n var expandedPool = DiUtil.isExpanded(element);\n\n if (expandedPool) {\n drawLine(p, [\n { x: 30, y: 0 },\n { x: 30, y: element.height }\n ]);\n var text = getSemantic(element).name;\n renderLaneLabel(p, text, element);\n } else {\n // Collapsed pool draw text inline\n var text2 = getSemantic(element).name;\n renderLabel(p, text2, { box: element, align: 'center-middle' });\n }\n\n var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);\n\n if(participantMultiplicity) {\n renderer('ParticipantMultiplicityMarker')(p, element);\n }\n\n return lane;\n },\n 'bpmn:Lane': function(p, element, attrs) {\n var rect = drawRect(p, element.width, element.height, 0, attrs || {\n fill: 'none'\n });\n\n var semantic = getSemantic(element);\n\n if (semantic.$type === 'bpmn:Lane') {\n var text = semantic.name;\n renderLaneLabel(p, text, element);\n }\n\n return rect;\n },\n 'bpmn:InclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* circle path */\n drawCircle(p, element.width, element.height, element.height * 0.24, {\n strokeWidth: 2.5,\n fill: 'none'\n });\n\n return diamond;\n },\n 'bpmn:ExclusiveGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {\n xScaleFactor: 0.4,\n yScaleFactor: 0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.32,\n my: 0.3\n }\n });\n\n if (!!(getDi(element).isMarkerVisible)) {\n drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n\n return diamond;\n },\n 'bpmn:ComplexGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {\n xScaleFactor: 0.5,\n yScaleFactor:0.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.26\n }\n });\n\n /* complex path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:ParallelGateway': function(p, element) {\n var diamond = drawDiamond(p, element.width, element.height);\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.6,\n yScaleFactor:0.6,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.46,\n my: 0.2\n }\n });\n\n /* parallel path */ drawPath(p, pathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return diamond;\n },\n 'bpmn:EventBasedGateway': function(p, element) {\n\n var semantic = getSemantic(element);\n\n var diamond = drawDiamond(p, element.width, element.height);\n\n /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {\n strokeWidth: 1,\n fill: 'none'\n });\n\n var type = semantic.eventGatewayType;\n var instantiate = !!semantic.instantiate;\n\n function drawEvent() {\n\n var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {\n xScaleFactor: 0.18,\n yScaleFactor: 0.18,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.36,\n my: 0.44\n }\n });\n\n /* event path */ drawPath(p, pathData, {\n strokeWidth: 2,\n fill: 'none'\n });\n }\n\n if (type === 'Parallel') {\n\n var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n xScaleFactor: 0.4,\n yScaleFactor:0.4,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var parallelPath = drawPath(p, pathData);\n parallelPath.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n } else if (type === 'Exclusive') {\n\n if (!instantiate) {\n var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);\n innerCircle.attr({\n strokeWidth: 1,\n fill: 'none'\n });\n }\n\n drawEvent();\n }\n\n\n return diamond;\n },\n 'bpmn:Gateway': function(p, element) {\n return drawDiamond(p, element.width, element.height);\n },\n 'bpmn:SequenceFlow': function(p, element) {\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n strokeLinejoin: 'round',\n markerEnd: marker('sequenceflow-end')\n });\n\n var sequenceFlow = getSemantic(element);\n var source = element.source.businessObject;\n\n // conditional flow marker\n if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {\n path.attr({\n markerStart: marker('conditional-flow-marker')\n });\n }\n\n // default marker\n if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {\n path.attr({\n markerStart: marker('conditional-default-flow-marker')\n });\n }\n\n return path;\n },\n 'bpmn:Association': function(p, element, attrs) {\n\n attrs = assign({\n strokeDasharray: '1,6',\n strokeLinecap: 'round',\n strokeLinejoin: 'round'\n }, attrs || {});\n\n // TODO(nre): style according to directed state\n return drawLine(p, element.waypoints, attrs);\n },\n 'bpmn:DataInputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:DataOutputAssociation': function(p, element) {\n return renderer('bpmn:Association')(p, element, {\n markerEnd: marker('data-association-end')\n });\n },\n 'bpmn:MessageFlow': function(p, element) {\n\n var semantic = getSemantic(element),\n di = getDi(element);\n\n var pathData = createPathFromConnection(element);\n var path = drawPath(p, pathData, {\n markerEnd: marker('messageflow-end'),\n markerStart: marker('messageflow-start'),\n strokeDasharray: '10, 12',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n strokeWidth: '1.5px'\n });\n\n if (semantic.messageRef) {\n var midPoint = path.getPointAtLength(path.getTotalLength() / 2);\n\n var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {\n abspos: {\n x: midPoint.x,\n y: midPoint.y\n }\n });\n\n var messageAttrs = { strokeWidth: 1 };\n\n if (di.messageVisibleKind === 'initiating') {\n messageAttrs.fill = 'white';\n messageAttrs.stroke = 'black';\n } else {\n messageAttrs.fill = '#888';\n messageAttrs.stroke = 'white';\n }\n\n drawPath(p, markerPathData, messageAttrs);\n }\n\n return path;\n },\n 'bpmn:DataObject': function(p, element) {\n var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.474,\n my: 0.296\n }\n });\n\n var elementObject = drawPath(p, pathData, { fill: 'white' });\n\n var semantic = getSemantic(element);\n\n if (isCollection(semantic)) {\n renderDataItemCollection(p, element);\n }\n\n return elementObject;\n },\n 'bpmn:DataObjectReference': as('bpmn:DataObject'),\n 'bpmn:DataInput': function(p, element) {\n\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });\n\n return elementObject;\n },\n 'bpmn:DataOutput': function(p, element) {\n var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n // page\n var elementObject = renderer('bpmn:DataObject')(p, element);\n\n /* output arrow path */ drawPath(p, arrowPathData, {\n strokeWidth: 1,\n fill: 'black'\n });\n\n return elementObject;\n },\n 'bpmn:DataStoreReference': function(p, element) {\n var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0,\n my: 0.133\n }\n });\n\n var elementStore = drawPath(p, DATA_STORE_PATH, {\n strokeWidth: 2,\n fill: 'white'\n });\n\n return elementStore;\n },\n 'bpmn:BoundaryEvent': function(p, element) {\n\n var semantic = getSemantic(element),\n cancel = semantic.cancelActivity;\n\n var attrs = {\n strokeLinecap: 'round',\n strokeWidth: 1\n };\n\n if (!cancel) {\n attrs.strokeDasharray = '6';\n }\n\n var outer = renderer('bpmn:Event')(p, element, attrs);\n /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);\n\n renderEventContent(element, p);\n\n return outer;\n },\n 'bpmn:Group': function(p, element) {\n return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {\n strokeWidth: 1,\n strokeDasharray: '8,3,1,3',\n fill: 'none',\n pointerEvents: 'none'\n });\n },\n 'label': function(p, element) {\n return renderExternalLabel(p, element, '');\n },\n 'bpmn:TextAnnotation': function(p, element) {\n var style = {\n 'fill': 'none',\n 'stroke': 'none'\n };\n var textElement = drawRect(p, element.width, element.height, 0, 0, style);\n var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.0,\n my: 0.0\n }\n });\n drawPath(p, textPathData);\n\n var text = getSemantic(element).text || '';\n renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });\n\n return textElement;\n },\n 'ParticipantMultiplicityMarker': function(p, element) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'SubProcessMarker': function(p, element) {\n var markerRect = drawRect(p, 14, 14, 0, {\n strokeWidth: 1\n });\n\n // Process marker is placed in the middle of the box\n // therefore fixed values can be used here\n markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');\n\n var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {\n xScaleFactor: 1.5,\n yScaleFactor: 1.5,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: (element.width / 2 - 7.5) / element.width,\n my: (element.height - 20) / element.height\n }\n });\n\n drawPath(p, subProcessPath);\n },\n 'ParallelMarker': function(p, element, position) {\n var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.parallel) / element.width),\n my: (element.height - 20) / element.height\n }\n });\n drawPath(p, subProcessPath);\n },\n 'SequentialMarker': function(p, element, position) {\n var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.seq) / element.width),\n my: (element.height - 19) / element.height\n }\n });\n drawPath(p, sequentialPath);\n },\n 'CompensationMarker': function(p, element, position) {\n var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.compensation) / element.width),\n my: (element.height - 13) / element.height\n }\n });\n drawPath(p, compensationPath, { strokeWidth: 1 });\n },\n 'LoopMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_LOOP', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.loop) / element.width),\n my: (element.height - 7) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'none',\n strokeLinecap: 'round',\n strokeMiterlimit: 0.5\n });\n },\n 'AdhocMarker': function(p, element, position) {\n var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: ((element.width / 2 + position.adhoc) / element.width),\n my: (element.height - 15) / element.height\n }\n });\n\n drawPath(p, loopPath, {\n strokeWidth: 1,\n fill: 'black'\n });\n }\n };\n\n function attachTaskMarkers(p, element, taskMarkers) {\n var obj = getSemantic(element);\n\n var subprocess = includes(taskMarkers, 'SubProcessMarker');\n var position;\n\n if (subprocess) {\n position = {\n seq: -21,\n parallel: -22,\n compensation: -42,\n loop: -18,\n adhoc: 10\n };\n } else {\n position = {\n seq: -3,\n parallel: -6,\n compensation: -27,\n loop: 0,\n adhoc: 10\n };\n }\n\n forEach(taskMarkers, function(marker) {\n renderer(marker)(p, element, position);\n });\n\n if (obj.$type === 'bpmn:AdHocSubProcess') {\n renderer('AdhocMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {\n renderer('LoopMarker')(p, element, position);\n return;\n }\n if (obj.loopCharacteristics &&\n obj.loopCharacteristics.isSequential !== undefined &&\n !obj.loopCharacteristics.isSequential) {\n renderer('ParallelMarker')(p, element, position);\n }\n if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {\n renderer('SequentialMarker')(p, element, position);\n }\n if (!!obj.isForCompensation) {\n renderer('CompensationMarker')(p, element, position);\n }\n }\n\n function drawShape(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function drawConnection(parent, element) {\n var type = element.type;\n var h = handlers[type];\n\n /* jshint -W040 */\n if (!h) {\n return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);\n } else {\n return h(parent, element);\n }\n }\n\n function renderDataItemCollection(p, element) {\n\n var yPosition = (element.height - 16) / element.height;\n\n var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {\n xScaleFactor: 1,\n yScaleFactor: 1,\n containerWidth: element.width,\n containerHeight: element.height,\n position: {\n mx: 0.451,\n my: yPosition\n }\n });\n\n /* collection path */ drawPath(p, pathData, {\n strokeWidth: 2\n });\n }\n\n function isCollection(element, filter) {\n return element.isCollection ||\n (element.elementObjectRef && element.elementObjectRef.isCollection);\n }\n\n function getDi(element) {\n return element.businessObject.di;\n }\n\n function getSemantic(element) {\n return element.businessObject;\n }\n\n /**\n * Checks if eventDefinition of the given element matches with semantic type.\n *\n * @return {boolean} true if element is of the given semantic type\n */\n function isTypedEvent(event, eventDefinitionType, filter) {\n\n function matches(definition, filter) {\n return every(filter, function(val, key) {\n\n // we want a == conversion here, to be able to catch\n // undefined == false and friends\n /* jshint -W116 */\n return definition[key] == val;\n });\n }\n\n return some(event.eventDefinitions, function(definition) {\n return definition.$type === eventDefinitionType && matches(event, filter);\n });\n }\n\n function isThrowEvent(event) {\n return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');\n }\n\n\n /////// cropping path customizations /////////////////////////\n\n function componentsToPath(elements) {\n return elements.join(',').replace(/,?([A-z]),?/g, '$1');\n }\n\n function getCirclePath(shape) {\n\n var cx = shape.x + shape.width / 2,\n cy = shape.y + shape.height / 2,\n radius = shape.width / 2;\n\n var circlePath = [\n ['M', cx, cy],\n ['m', 0, -radius],\n ['a', radius, radius, 0, 1, 1, 0, 2 * radius],\n ['a', radius, radius, 0, 1, 1, 0, -2 * radius],\n ['z']\n ];\n\n return componentsToPath(circlePath);\n }\n\n function getRoundRectPath(shape) {\n\n var radius = TASK_BORDER_RADIUS,\n x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var roundRectPath = [\n ['M', x + radius, y],\n ['l', width - radius * 2, 0],\n ['a', radius, radius, 0, 0, 1, radius, radius],\n ['l', 0, height - radius * 2],\n ['a', radius, radius, 0, 0, 1, -radius, radius],\n ['l', radius * 2 - width, 0],\n ['a', radius, radius, 0, 0, 1, -radius, -radius],\n ['l', 0, radius * 2 - height],\n ['a', radius, radius, 0, 0, 1, radius, -radius],\n ['z']\n ];\n\n return componentsToPath(roundRectPath);\n }\n\n function getDiamondPath(shape) {\n\n var width = shape.width,\n height = shape.height,\n x = shape.x,\n y = shape.y,\n halfWidth = width / 2,\n halfHeight = height / 2;\n\n var diamondPath = [\n ['M', x + halfWidth, y],\n ['l', halfWidth, halfHeight],\n ['l', -halfWidth, halfHeight],\n ['l', -halfWidth, -halfHeight],\n ['z']\n ];\n\n return componentsToPath(diamondPath);\n }\n\n function getRectPath(shape) {\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var rectPath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(rectPath);\n }\n\n function getShapePath(element) {\n var obj = getSemantic(element);\n\n if (obj.$instanceOf('bpmn:Event')) {\n return getCirclePath(element);\n }\n\n if (obj.$instanceOf('bpmn:Activity')) {\n return getRoundRectPath(element);\n }\n\n if (obj.$instanceOf('bpmn:Gateway')) {\n return getDiamondPath(element);\n }\n\n return getRectPath(element);\n }\n\n\n // hook onto canvas init event to initialize\n // connection start/end markers on svg\n events.on('canvas.init', function(event) {\n initMarkers(event.svg);\n });\n\n this.drawShape = drawShape;\n this.drawConnection = drawConnection;\n\n this.getShapePath = getShapePath;\n}\n\ninherits(BpmnRenderer, DefaultRenderer);\n\n\nBpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];\n\nmodule.exports = BpmnRenderer;\n","'use strict';\n\nvar Snap = require(67);\n\n/**\n * Map containing SVG paths needed by BpmnRenderer.\n */\n\nfunction PathMap() {\n\n /**\n * Contains a map of path elements\n *\n * <h1>Path definition</h1>\n * A parameterized path is defined like this:\n * <pre>\n * 'GATEWAY_PARALLEL': {\n * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n * height: 17.5,\n * width: 17.5,\n * heightElements: [2.5, 7.5],\n * widthElements: [2.5, 7.5]\n * }\n * </pre>\n * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling\n * is based on the ratio between the specified height and width in this object and the\n * height and width that is set as scale target (Note x,y coordinates will be scaled with\n * individual ratios).</p>\n * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.\n * The scaling is based on the computed ratios.\n * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using\n * the computed ratio coefficient.\n * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.\n * <ul>\n * <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>\n * <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>\n * </ul>\n * The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.\n * </p>\n */\n this.pathMap = {\n 'EVENT_MESSAGE': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 36,\n width: 36,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'EVENT_SIGNAL': {\n d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',\n height: 36,\n width: 36,\n heightElements: [18],\n widthElements: [10, 20]\n },\n 'EVENT_ESCALATION': {\n d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +\n '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',\n height: 36,\n width: 36,\n heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],\n widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]\n },\n 'EVENT_CONDITIONAL': {\n d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +\n 'M {e.x2},{e.y3} l {e.x0},0 ' +\n 'M {e.x2},{e.y4} l {e.x0},0 ' +\n 'M {e.x2},{e.y5} l {e.x0},0 ' +\n 'M {e.x2},{e.y6} l {e.x0},0 ' +\n 'M {e.x2},{e.y7} l {e.x0},0 ' +\n 'M {e.x2},{e.y8} l {e.x0},0 ',\n height: 36,\n width: 36,\n heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],\n widthElements: [10.5, 14.5, 12.5]\n },\n 'EVENT_LINK': {\n d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',\n height: 36,\n width: 36,\n heightElements: [4.4375, 6.75, 7.8125],\n widthElements: [9.84375, 13.5]\n },\n 'EVENT_ERROR': {\n d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',\n height: 36,\n width: 36,\n heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],\n widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]\n },\n 'EVENT_CANCEL_45': {\n d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 36,\n width: 36,\n heightElements: [4.75, 8.5],\n widthElements: [4.75, 8.5]\n },\n 'EVENT_COMPENSATION': {\n d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',\n height: 36,\n width: 36,\n heightElements: [5, 10],\n widthElements: [10]\n },\n 'EVENT_TIMER_WH': {\n d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 2],\n widthElements: [3, 7]\n },\n 'EVENT_TIMER_LINE': {\n d: 'M {mx},{my} ' +\n 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',\n height: 36,\n width: 36,\n heightElements: [10, 3],\n widthElements: [0, 0]\n },\n 'EVENT_MULTIPLE': {\n d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',\n height: 36,\n width: 36,\n heightElements: [6.28099, 12.56199],\n widthElements: [3.1405, 9.42149, 12.56198]\n },\n 'EVENT_PARALLEL_MULTIPLE': {\n d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n height: 36,\n width: 36,\n heightElements: [2.56228, 7.68683],\n widthElements: [2.56228, 7.68683]\n },\n 'GATEWAY_EXCLUSIVE': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +\n '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +\n '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',\n height: 17.5,\n width: 17.5,\n heightElements: [8.5, 6.5312, -6.5312, -8.5],\n widthElements: [6.5, -6.5, 3, -3, 5, -5]\n },\n 'GATEWAY_PARALLEL': {\n d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n height: 30,\n width: 30,\n heightElements: [5, 12.5],\n widthElements: [5, 12.5]\n },\n 'GATEWAY_EVENT_BASED': {\n d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',\n height: 11,\n width: 11,\n heightElements: [-6, 6, 12, -12],\n widthElements: [9, -3, -12]\n },\n 'GATEWAY_COMPLEX': {\n d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +\n '{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +\n '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +\n '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',\n height: 17.125,\n width: 17.125,\n heightElements: [4.875, 3.4375, 2.125, 3],\n widthElements: [3.4375, 2.125, 4.875, 3]\n },\n 'DATA_OBJECT_PATH': {\n d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',\n height: 61,\n width: 51,\n heightElements: [10, 50, 60],\n widthElements: [10, 40, 50, 60]\n },\n 'DATA_OBJECT_COLLECTION_PATH': {\n d:'m {mx}, {my} ' +\n 'm 0 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ' +\n 'm 4 15 l 0 -15 ',\n height: 61,\n width: 51,\n heightElements: [12],\n widthElements: [1, 6, 12, 15]\n },\n 'DATA_ARROW': {\n d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',\n height: 61,\n width: 51,\n heightElements: [],\n widthElements: []\n },\n 'DATA_STORE': {\n d:'m {mx},{my} ' +\n 'l 0,{e.y2} ' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'l 0,-{e.y2} ' +\n 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 ' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +\n 'm -{e.x2},{e.y0}' +\n 'c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0',\n height: 61,\n width: 61,\n heightElements: [7, 10, 45],\n widthElements: [2, 58, 60]\n },\n 'TEXT_ANNOTATION': {\n d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',\n height: 30,\n width: 10,\n heightElements: [30],\n widthElements: [10]\n },\n 'MARKER_SUB_PROCESS': {\n d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_PARALLEL': {\n d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_SEQUENTIAL': {\n d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',\n height: 10,\n width: 10,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_COMPENSATION': {\n d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',\n height: 10,\n width: 21,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_LOOP': {\n d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +\n '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +\n '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +\n 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',\n height: 13.9,\n width: 13.7,\n heightElements: [],\n widthElements: []\n },\n 'MARKER_ADHOC': {\n d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +\n '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +\n '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +\n '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +\n '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',\n height: 4,\n width: 15,\n heightElements: [],\n widthElements: []\n },\n 'TASK_TYPE_SEND': {\n d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',\n height: 14,\n width: 21,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_SCRIPT': {\n d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +\n 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +\n 'm -7,-12 l 5,0 ' +\n 'm -4.5,3 l 4.5,0 ' +\n 'm -3,3 l 5,0' +\n 'm -4,3 l 5,0',\n height: 15,\n width: 12.6,\n heightElements: [6, 14],\n widthElements: [10.5, 21]\n },\n 'TASK_TYPE_USER_1': {\n d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +\n '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +\n '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +\n 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +\n 'm -8,6 l 0,5.5 m 11,0 l 0,-5'\n },\n 'TASK_TYPE_USER_2': {\n d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +\n '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '\n },\n 'TASK_TYPE_USER_3': {\n d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +\n '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +\n '-4.20799998,3.36699999 -4.20699998,4.34799999 z'\n },\n 'TASK_TYPE_MANUAL': {\n d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +\n '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +\n '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +\n '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +\n '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +\n '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +\n '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +\n '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +\n '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +\n '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +\n '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +\n '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'\n },\n 'TASK_TYPE_INSTANTIATING_SEND': {\n d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'\n },\n 'TASK_TYPE_SERVICE': {\n d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +\n '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +\n '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +\n 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +\n '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +\n '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +\n 'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +\n '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +\n 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +\n 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +\n '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +\n 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +\n 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_SERVICE_FILL': {\n d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_HEADER': {\n d: 'm {mx},{my} 0,4 20,0 0,-4 z'\n },\n 'TASK_TYPE_BUSINESS_RULE_MAIN': {\n d: 'm {mx},{my} 0,12 20,0 0,-12 z' +\n 'm 0,8 l 20,0 ' +\n 'm -13,-4 l 0,8'\n },\n 'MESSAGE_FLOW_MARKER': {\n d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'\n }\n };\n\n this.getRawPath = function getRawPath(pathId) {\n return this.pathMap[pathId].d;\n };\n\n /**\n * Scales the path to the given height and width.\n * <h1>Use case</h1>\n * <p>Use case is to scale the content of elements (event, gateways) based\n * on the element bounding box's size.\n * </p>\n * <h1>Why not transform</h1>\n * <p>Scaling a path with transform() will also scale the stroke and IE does not support\n * the option 'non-scaling-stroke' to prevent this.\n * Also there are use cases where only some parts of a path should be\n * scaled.</p>\n *\n * @param {String} pathId The ID of the path.\n * @param {Object} param <p>\n * Example param object scales the path to 60% size of the container (data.width, data.height).\n * <pre>\n * {\n * xScaleFactor: 0.6,\n * yScaleFactor:0.6,\n * containerWidth: data.width,\n * containerHeight: data.height,\n * position: {\n * mx: 0.46,\n * my: 0.2,\n * }\n * }\n * </pre>\n * <ul>\n * <li>targetpathwidth = xScaleFactor * containerWidth</li>\n * <li>targetpathheight = yScaleFactor * containerHeight</li>\n * <li>Position is used to set the starting coordinate of the path. M is computed:\n * <ul>\n * <li>position.x * containerWidth</li>\n * <li>position.y * containerHeight</li>\n * </ul>\n * Center of the container <pre> position: {\n * mx: 0.5,\n * my: 0.5,\n * }</pre>\n * Upper left corner of the container\n * <pre> position: {\n * mx: 0.0,\n * my: 0.0,\n * }</pre>\n * </li>\n * </ul>\n * </p>\n *\n */\n this.getScaledPath = function getScaledPath(pathId, param) {\n var rawPath = this.pathMap[pathId];\n\n // positioning\n // compute the start point of the path\n var mx, my;\n\n if(!!param.abspos) {\n mx = param.abspos.x;\n my = param.abspos.y;\n } else {\n mx = param.containerWidth * param.position.mx;\n my = param.containerHeight * param.position.my;\n }\n\n var coordinates = {}; //map for the scaled coordinates\n if(param.position) {\n\n // path\n var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;\n var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;\n\n\n //Apply height ratio\n for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {\n coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;\n }\n\n //Apply width ratio\n for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {\n coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;\n }\n }\n\n //Apply value to raw path\n var path = Snap.format(\n rawPath.d, {\n mx: mx,\n my: my,\n e: coordinates\n }\n );\n return path;\n };\n}\n\nmodule.exports = PathMap;\n","module.exports = {\n renderer: [ 'type', require(3) ],\n pathMap: [ 'type', require(4) ]\n};","'use strict';\n\nvar assign = require(168),\n map = require(80);\n\nvar LabelUtil = require(12);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n getExternalLabelBounds = LabelUtil.getExternalLabelBounds,\n isExpanded = require(11).isExpanded,\n elementToString = require(9).elementToString;\n\n\nfunction elementData(semantic, attrs) {\n return assign({\n id: semantic.id,\n type: semantic.$type,\n businessObject: semantic\n }, attrs);\n}\n\nfunction collectWaypoints(waypoints) {\n return map(waypoints, function(p) {\n return { x: p.x, y: p.y };\n });\n}\n\n\n/**\n * An importer that adds bpmn elements to the canvas\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementFactory} elementFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._canvas = canvas;\n\n this._elementFactory = elementFactory;\n this._elementRegistry = elementRegistry;\n}\n\nBpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];\n\nmodule.exports = BpmnImporter;\n\n\n/**\n * Add bpmn element (semantic) to the canvas onto the\n * specified parent shape.\n */\nBpmnImporter.prototype.add = function(semantic, parentElement) {\n\n var di = semantic.di,\n element;\n\n // ROOT ELEMENT\n // handle the special case that we deal with a\n // invisible root element (process or collaboration)\n if (di.$instanceOf('bpmndi:BPMNPlane')) {\n\n // add a virtual element (not being drawn)\n element = this._elementFactory.createRoot(elementData(semantic));\n\n this._canvas.setRootElement(element);\n }\n\n // SHAPE\n else if (di.$instanceOf('bpmndi:BPMNShape')) {\n\n var collapsed = !isExpanded(semantic);\n var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n var bounds = semantic.di.bounds;\n\n element = this._elementFactory.createShape(elementData(semantic, {\n collapsed: collapsed,\n hidden: hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n this._canvas.addShape(element, parentElement);\n }\n\n // CONNECTION\n else if (di.$instanceOf('bpmndi:BPMNEdge')) {\n\n var source = this._getSource(semantic),\n target = this._getTarget(semantic);\n\n element = this._elementFactory.createConnection(elementData(semantic, {\n source: source,\n target: target,\n waypoints: collectWaypoints(semantic.di.waypoint)\n }));\n\n this._canvas.addConnection(element, parentElement);\n } else {\n throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));\n }\n\n // (optional) LABEL\n if (hasExternalLabel(semantic)) {\n this.addLabel(semantic, element);\n }\n\n\n this._eventBus.fire('bpmnElement.added', { element: element });\n\n return element;\n};\n\n\n/**\n * add label for an element\n */\nBpmnImporter.prototype.addLabel = function(semantic, element) {\n var bounds = getExternalLabelBounds(semantic, element);\n\n var label = this._elementFactory.createLabel(elementData(semantic, {\n id: semantic.id + '_label',\n labelTarget: element,\n type: 'label',\n hidden: element.hidden,\n x: Math.round(bounds.x),\n y: Math.round(bounds.y),\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }));\n\n return this._canvas.addShape(label, element.parent);\n};\n\n/**\n * Return the drawn connection end based on the given side.\n *\n * @throws {Error} if the end is not yet drawn\n */\nBpmnImporter.prototype._getEnd = function(semantic, side) {\n\n var element,\n refSemantic,\n type = semantic.$type;\n\n refSemantic = semantic[side + 'Ref'];\n\n // handle mysterious isMany DataAssociation#sourceRef\n if (side === 'source' && type === 'bpmn:DataInputAssociation') {\n refSemantic = refSemantic && refSemantic[0];\n }\n\n // fix source / target for DataInputAssociation / DataOutputAssociation\n if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||\n side === 'target' && type === 'bpmn:DataInputAssociation') {\n\n refSemantic = semantic.$parent;\n }\n\n element = refSemantic && this._getElement(refSemantic);\n\n if (element) {\n return element;\n }\n\n if (refSemantic) {\n throw new Error(\n 'element ' + elementToString(refSemantic) + ' referenced by ' +\n elementToString(semantic) + '#' + side + 'Ref not yet drawn');\n } else {\n throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');\n }\n};\n\nBpmnImporter.prototype._getSource = function(semantic) {\n return this._getEnd(semantic, 'source');\n};\n\nBpmnImporter.prototype._getTarget = function(semantic) {\n return this._getEnd(semantic, 'target');\n};\n\n\nBpmnImporter.prototype._getElement = function(semantic) {\n return this._elementRegistry.get(semantic.id);\n};\n","'use strict';\n\nvar filter = require(75),\n find = require(76),\n forEach = require(77);\n\nvar Refs = require(194);\n\nvar elementToString = require(9).elementToString;\n\nvar diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });\n\n/**\n * Returns true if an element has the given meta-model type\n *\n * @param {ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n return element.$instanceOf(type);\n}\n\n\n/**\n * Find a suitable display candidate for definitions where the DI does not\n * correctly specify one.\n */\nfunction findDisplayCandidate(definitions) {\n return find(definitions.rootElements, function(e) {\n return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');\n });\n}\n\n\nfunction BpmnTreeWalker(handler) {\n\n // list of containers already walked\n var handledProcesses = [];\n\n // list of elements to handle deferred to ensure\n // prerequisites are drawn\n var deferred = [];\n\n ///// Helpers /////////////////////////////////\n\n function contextual(fn, ctx) {\n return function(e) {\n fn(e, ctx);\n };\n }\n\n function visit(element, ctx) {\n\n var gfx = element.gfx;\n\n // avoid multiple rendering of elements\n if (gfx) {\n throw new Error('already rendered ' + elementToString(element));\n }\n\n // call handler\n return handler.element(element, ctx);\n }\n\n function visitRoot(element, diagram) {\n return handler.root(element, diagram);\n }\n\n function visitIfDi(element, ctx) {\n try {\n return element.di && visit(element, ctx);\n } catch (e) {\n logError(e.message, { element: element, error: e });\n\n console.error('failed to import ' + elementToString(element));\n console.error(e);\n }\n }\n\n function logError(message, context) {\n handler.error(message, context);\n }\n\n ////// DI handling ////////////////////////////\n\n function registerDi(di) {\n var bpmnElement = di.bpmnElement;\n\n if (bpmnElement) {\n if (bpmnElement.di) {\n logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });\n } else {\n diRefs.bind(bpmnElement, 'di');\n bpmnElement.di = di;\n }\n } else {\n logError('no bpmnElement referenced in ' + elementToString(di), { element: di });\n }\n }\n\n function handleDiagram(diagram) {\n handlePlane(diagram.plane);\n }\n\n function handlePlane(plane) {\n registerDi(plane);\n\n forEach(plane.planeElement, handlePlaneElement);\n }\n\n function handlePlaneElement(planeElement) {\n registerDi(planeElement);\n }\n\n\n ////// Semantic handling //////////////////////\n\n function handleDefinitions(definitions, diagram) {\n // make sure we walk the correct bpmnElement\n\n var diagrams = definitions.diagrams;\n\n if (diagram && diagrams.indexOf(diagram) === -1) {\n throw new Error('diagram not part of bpmn:Definitions');\n }\n\n if (!diagram && diagrams && diagrams.length) {\n diagram = diagrams[0];\n }\n\n // no diagram -> nothing to import\n if (!diagram) {\n return;\n }\n\n // load DI from selected diagram only\n handleDiagram(diagram);\n\n\n var plane = diagram.plane;\n\n if (!plane) {\n throw new Error('no plane for ' + elementToString(diagram));\n }\n\n\n var rootElement = plane.bpmnElement;\n\n // ensure we default to a suitable display candidate (process or collaboration),\n // even if non is specified in DI\n if (!rootElement) {\n rootElement = findDisplayCandidate(definitions);\n\n if (!rootElement) {\n return logError('no process or collaboration present to display');\n } else {\n\n logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));\n\n // correct DI on the fly\n plane.bpmnElement = rootElement;\n registerDi(plane);\n }\n }\n\n\n var ctx = visitRoot(rootElement, plane);\n\n if (is(rootElement, 'bpmn:Process')) {\n handleProcess(rootElement, ctx);\n } else if (is(rootElement, 'bpmn:Collaboration')) {\n handleCollaboration(rootElement, ctx);\n\n // force drawing of everything not yet drawn that is part of the target DI\n handleUnhandledProcesses(definitions.rootElements, ctx);\n } else {\n throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));\n }\n\n // handle all deferred elements\n handleDeferred(deferred);\n }\n\n function handleDeferred(deferred) {\n forEach(deferred, function(d) { d(); });\n }\n\n function handleProcess(process, context) {\n handleFlowElementsContainer(process, context);\n handleIoSpecification(process.ioSpecification, context);\n\n handleArtifacts(process.artifacts, context);\n\n // log process handled\n handledProcesses.push(process);\n }\n\n function handleUnhandledProcesses(rootElements) {\n\n // walk through all processes that have not yet been drawn and draw them\n // if they contain lanes with DI information.\n // we do this to pass the free-floating lane test cases in the MIWG test suite\n var processes = filter(rootElements, function(e) {\n return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;\n });\n\n processes.forEach(contextual(handleProcess));\n }\n\n function handleMessageFlow(messageFlow, context) {\n visitIfDi(messageFlow, context);\n }\n\n function handleMessageFlows(messageFlows, context) {\n forEach(messageFlows, contextual(handleMessageFlow, context));\n }\n\n function handleDataAssociation(association, context) {\n visitIfDi(association, context);\n }\n\n function handleDataInput(dataInput, context) {\n visitIfDi(dataInput, context);\n }\n\n function handleDataOutput(dataOutput, context) {\n visitIfDi(dataOutput, context);\n }\n\n function handleArtifact(artifact, context) {\n\n // bpmn:TextAnnotation\n // bpmn:Group\n // bpmn:Association\n\n visitIfDi(artifact, context);\n }\n\n function handleArtifacts(artifacts, context) {\n\n forEach(artifacts, function(e) {\n if (is(e, 'bpmn:Association')) {\n deferred.push(function() {\n handleArtifact(e, context);\n });\n } else {\n handleArtifact(e, context);\n }\n });\n }\n\n function handleIoSpecification(ioSpecification, context) {\n\n if (!ioSpecification) {\n return;\n }\n\n forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));\n forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));\n }\n\n function handleSubProcess(subProcess, context) {\n handleFlowElementsContainer(subProcess, context);\n handleArtifacts(subProcess.artifacts, context);\n }\n\n function handleFlowNode(flowNode, context) {\n var childCtx = visitIfDi(flowNode, context);\n\n if (is(flowNode, 'bpmn:SubProcess')) {\n handleSubProcess(flowNode, childCtx || context);\n }\n }\n\n function handleSequenceFlow(sequenceFlow, context) {\n visitIfDi(sequenceFlow, context);\n }\n\n function handleDataElement(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleBoundaryEvent(dataObject, context) {\n visitIfDi(dataObject, context);\n }\n\n function handleLane(lane, context) {\n var newContext = visitIfDi(lane, context);\n\n if (lane.childLaneSet) {\n handleLaneSet(lane.childLaneSet, newContext || context);\n } else {\n var filterList = filter(lane.flowNodeRef, function(e) {\n return e.$type !== 'bpmn:BoundaryEvent';\n });\n handleFlowElements(filterList, newContext || context);\n }\n }\n\n function handleLaneSet(laneSet, context) {\n forEach(laneSet.lanes, contextual(handleLane, context));\n }\n\n function handleLaneSets(laneSets, context) {\n forEach(laneSets, contextual(handleLaneSet, context));\n }\n\n function handleFlowElementsContainer(container, context) {\n\n if (container.laneSets) {\n handleLaneSets(container.laneSets, context);\n handleNonFlowNodes(container.flowElements);\n } else {\n handleFlowElements(container.flowElements, context);\n }\n }\n\n function handleNonFlowNodes(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n }\n });\n }\n\n function handleFlowElements(flowElements, context) {\n forEach(flowElements, function(e) {\n if (is(e, 'bpmn:SequenceFlow')) {\n deferred.push(function() {\n handleSequenceFlow(e, context);\n });\n } else if (is(e, 'bpmn:BoundaryEvent')) {\n deferred.unshift(function() {\n handleBoundaryEvent(e, context);\n });\n } else if (is(e, 'bpmn:FlowNode')) {\n handleFlowNode(e, context);\n\n if (is(e, 'bpmn:Activity')) {\n\n handleIoSpecification(e.ioSpecification, context);\n\n // defer handling of associations\n deferred.push(function() {\n forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));\n forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));\n });\n }\n } else if (is(e, 'bpmn:DataObject')) {\n // SKIP (assume correct referencing via DataObjectReference)\n } else if (is(e, 'bpmn:DataStoreReference')) {\n handleDataElement(e, context);\n } else if (is(e, 'bpmn:DataObjectReference')) {\n handleDataElement(e, context);\n } else {\n logError(\n 'unrecognized flowElement ' + elementToString(e) + ' in context ' +\n (context ? elementToString(context.businessObject) : null),\n { element: e, context: context });\n }\n });\n }\n\n function handleParticipant(participant, context) {\n var newCtx = visitIfDi(participant, context);\n\n var process = participant.processRef;\n if (process) {\n handleProcess(process, newCtx || context);\n }\n }\n\n function handleCollaboration(collaboration) {\n\n forEach(collaboration.participants, contextual(handleParticipant));\n\n handleArtifacts(collaboration.artifacts);\n\n // handle message flows latest in the process\n deferred.push(function() {\n handleMessageFlows(collaboration.messageFlows);\n });\n }\n\n\n ///// API ////////////////////////////////\n\n return {\n handleDefinitions: handleDefinitions\n };\n}\n\nmodule.exports = BpmnTreeWalker;","'use strict';\n\nvar BpmnTreeWalker = require(7);\n\n\n/**\n * Import the definitions into a diagram.\n *\n * Errors and warnings are reported through the specified callback.\n *\n * @param {Diagram} diagram\n * @param {ModdleElement} definitions\n * @param {Function} done the callback, invoked with (err, [ warning ]) once the import is done\n */\nfunction importBpmnDiagram(diagram, definitions, done) {\n\n var importer = diagram.get('bpmnImporter'),\n eventBus = diagram.get('eventBus');\n\n var error,\n warnings = [];\n\n function parse(definitions) {\n\n var visitor = {\n\n root: function(element) {\n return importer.add(element);\n },\n\n element: function(element, parentShape) {\n return importer.add(element, parentShape);\n },\n\n error: function(message, context) {\n warnings.push({ message: message, context: context });\n }\n };\n\n var walker = new BpmnTreeWalker(visitor);\n\n // import\n walker.handleDefinitions(definitions);\n }\n\n eventBus.fire('import.start');\n\n try {\n parse(definitions);\n } catch (e) {\n error = e;\n }\n\n eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });\n done(error, warnings);\n}\n\nmodule.exports.importBpmnDiagram = importBpmnDiagram;","'use strict';\n\nmodule.exports.elementToString = function(e) {\n if (!e) {\n return '<null>';\n }\n\n return '<' + e.$type + (e.id ? ' id=\"' + e.id : '') + '\" />';\n};","module.exports = {\n bpmnImporter: [ 'type', require(6) ]\n};","'use strict';\n\nvar is = require(13).is,\n getBusinessObject = require(13).getBusinessObject;\n\nmodule.exports.isExpanded = function(element) {\n\n if (is(element, 'bpmn:CallActivity')) {\n return false;\n }\n\n if (is(element, 'bpmn:SubProcess')) {\n return getBusinessObject(element).di.isExpanded;\n }\n\n if (is(element, 'bpmn:Participant')) {\n return !!getBusinessObject(element).processRef;\n }\n\n return true;\n};\n","'use strict';\n\nvar assign = require(168);\n\n\nvar DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {\n width: 90,\n height: 20\n};\n\n\n/**\n * Returns true if the given semantic has an external label\n *\n * @param {BpmnElement} semantic\n * @return {Boolean} true if has label\n */\nmodule.exports.hasExternalLabel = function(semantic) {\n\n return semantic.$instanceOf('bpmn:Event') ||\n semantic.$instanceOf('bpmn:Gateway') ||\n semantic.$instanceOf('bpmn:DataStoreReference') ||\n semantic.$instanceOf('bpmn:DataObjectReference') ||\n semantic.$instanceOf('bpmn:SequenceFlow') ||\n semantic.$instanceOf('bpmn:MessageFlow');\n};\n\n\n/**\n * Get the middle of a number of waypoints\n *\n * @param {Array<Point>} waypoints\n * @return {Point} the mid point\n */\nvar getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {\n\n var mid = waypoints.length / 2 - 1;\n\n var first = waypoints[Math.floor(mid)];\n var second = waypoints[Math.ceil(mid + 0.01)];\n\n return {\n x: first.x + (second.x - first.x) / 2,\n y: first.y + (second.y - first.y) / 2\n };\n};\n\n\nvar getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {\n\n if (element.waypoints) {\n return getWaypointsMid(element.waypoints);\n } else {\n return {\n x: element.x + element.width / 2,\n y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2\n };\n }\n};\n\n/**\n * Returns the bounds of an elements label, parsed from the elements DI or\n * generated from its bounds.\n *\n * @param {BpmnElement} semantic\n * @param {djs.model.Base} element\n */\nmodule.exports.getExternalLabelBounds = function(semantic, element) {\n\n var mid,\n size,\n bounds,\n di = semantic.di,\n label = di.label;\n\n if (label && label.bounds) {\n bounds = label.bounds;\n\n size = {\n width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),\n height: bounds.height\n };\n\n mid = {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n };\n } else {\n\n mid = getExternalLabelMid(element);\n\n size = DEFAULT_LABEL_SIZE;\n }\n\n return assign({\n x: mid.x - size.width / 2,\n y: mid.y - size.height / 2\n }, size);\n};","'use strict';\n\n/**\n * Is an element of the given BPMN type?\n *\n * @param {djs.model.Base|ModdleElement} element\n * @param {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n var bo = getBusinessObject(element);\n\n return bo && bo.$instanceOf(type);\n}\n\nmodule.exports.is = is;\n\n\n/**\n * Return the business object for a given element.\n *\n * @param {djs.model.Base|ModdleElement} element\n *\n * @return {ModdleElement}\n */\nfunction getBusinessObject(element) {\n return (element && element.businessObject) || element;\n}\n\nmodule.exports.getBusinessObject = getBusinessObject;\n","module.exports = require(16);","'use strict';\n\nvar isString = require(165),\n isFunction = require(160),\n assign = require(168);\n\nvar Moddle = require(22),\n XmlReader = require(18),\n XmlWriter = require(19);\n\n/**\n * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.\n *\n * @class BpmnModdle\n * @extends Moddle\n *\n * @param {Object|Array} packages to use for instantiating the model\n * @param {Object} [options] additional options to pass over\n */\nfunction BpmnModdle(packages, options) {\n Moddle.call(this, packages, options);\n}\n\nBpmnModdle.prototype = Object.create(Moddle.prototype);\n\nmodule.exports = BpmnModdle;\n\n\n/**\n * Instantiates a BPMN model tree from a given xml string.\n *\n * @param {String} xmlStr\n * @param {String} [typeName='bpmn:Definitions'] name of the root element\n * @param {Object} [options] options to pass to the underlying reader\n * @param {Function} done callback that is invoked with (err, result, parseContext)\n * once the import completes\n */\nBpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {\n\n if (!isString(typeName)) {\n done = options;\n options = typeName;\n typeName = 'bpmn:Definitions';\n }\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var reader = new XmlReader(assign({ model: this, lax: true }, options));\n var rootHandler = reader.handler(typeName);\n\n reader.fromXML(xmlStr, rootHandler, done);\n};\n\n\n/**\n * Serializes a BPMN 2.0 object tree to XML.\n *\n * @param {String} element the root element, typically an instance of `bpmn:Definitions`\n * @param {Object} [options] to pass to the underlying writer\n * @param {Function} done callback invoked with (err, xmlStr) once the import completes\n */\nBpmnModdle.prototype.toXML = function(element, options, done) {\n\n if (isFunction(options)) {\n done = options;\n options = {};\n }\n\n var writer = new XmlWriter(options);\n try {\n var result = writer.toXML(element);\n done(null, result);\n } catch (e) {\n done(e);\n }\n};\n","'use strict';\n\nvar assign = require(168);\n\nvar BpmnModdle = require(15);\n\nvar packages = {\n bpmn: require(31),\n bpmndi: require(32),\n dc: require(33),\n di: require(34)\n};\n\nmodule.exports = function(additionalPackages, options) {\n return new BpmnModdle(assign({}, packages, additionalPackages), options);\n};","'use strict';\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction lower(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n}\n\nfunction hasLowerCaseAlias(pkg) {\n return pkg.xml && pkg.xml.tagAlias === 'lowerCase';\n}\n\n\nmodule.exports.aliasToName = function(alias, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return capitalize(alias);\n } else {\n return alias;\n }\n};\n\nmodule.exports.nameToAlias = function(name, pkg) {\n if (hasLowerCaseAlias(pkg)) {\n return lower(name);\n } else {\n return name;\n }\n};\n\nmodule.exports.DEFAULT_NS_MAP = {\n 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'\n};\n\nmodule.exports.XSI_TYPE = 'xsi:type';","'use strict';\n\nvar reduce = require(81),\n forEach = require(77),\n find = require(76),\n assign = require(168),\n defer = require(85);\n\nvar Stack = require(21),\n SaxParser = require(20).parser,\n Moddle = require(22),\n parseNameNs = require(27).parseName,\n Types = require(30),\n coerceType = Types.coerceType,\n isSimpleType = Types.isSimple,\n common = require(17),\n XSI_TYPE = common.XSI_TYPE,\n XSI_URI = common.DEFAULT_NS_MAP.xsi,\n aliasToName = common.aliasToName;\n\nfunction parseNodeAttributes(node) {\n var nodeAttrs = node.attributes;\n\n return reduce(nodeAttrs, function(result, v, k) {\n var name, ns;\n\n if (!v.local) {\n name = v.prefix;\n } else {\n ns = parseNameNs(v.name, v.prefix);\n name = ns.name;\n }\n\n result[name] = v.value;\n return result;\n }, {});\n}\n\nfunction normalizeType(node, attr, model) {\n var nameNs = parseNameNs(attr.value);\n\n var uri = node.ns[nameNs.prefix || ''],\n localName = nameNs.localName,\n pkg = uri && model.getPackage(uri),\n typePrefix;\n\n if (pkg) {\n typePrefix = pkg.xml && pkg.xml.typePrefix;\n\n if (typePrefix && localName.indexOf(typePrefix) === 0) {\n localName = localName.slice(typePrefix.length);\n }\n\n attr.value = pkg.prefix + ':' + localName;\n }\n}\n\n/**\n * Normalizes namespaces for a node given an optional default namespace and a\n * number of mappings from uris to default prefixes.\n *\n * @param {XmlNode} node\n * @param {Model} model the model containing all registered namespaces\n * @param {Uri} defaultNsUri\n */\nfunction normalizeNamespaces(node, model, defaultNsUri) {\n var uri, prefix;\n\n uri = node.uri || defaultNsUri;\n\n if (uri) {\n var pkg = model.getPackage(uri);\n\n if (pkg) {\n prefix = pkg.prefix;\n } else {\n prefix = node.prefix;\n }\n\n node.prefix = prefix;\n node.uri = uri;\n }\n\n forEach(node.attributes, function(attr) {\n\n // normalize xsi:type attributes because the\n // assigned type may or may not be namespace prefixed\n if (attr.uri === XSI_URI && attr.local === 'type') {\n normalizeType(node, attr, model);\n }\n\n normalizeNamespaces(attr, model, null);\n });\n}\n\n\n/**\n * A parse context.\n *\n * @class\n *\n * @param {Object} options\n * @param {ElementHandler} options.parseRoot the root handler for parsing a document\n * @param {boolean} [options.lax=false] whether or not to ignore invalid elements\n */\nfunction Context(options) {\n\n /**\n * @property {ElementHandler} parseRoot\n */\n\n /**\n * @property {Boolean} lax\n */\n\n assign(this, options);\n\n var elementsById = this.elementsById = {};\n var references = this.references = [];\n var warnings = this.warnings = [];\n\n this.addReference = function(reference) {\n references.push(reference);\n };\n\n this.addElement = function(id, element) {\n\n if (!id || !element) {\n throw new Error('[xml-reader] id or ctx must not be null');\n }\n\n elementsById[id] = element;\n };\n\n this.addWarning = function (w) {\n warnings.push(w);\n };\n}\n\nfunction BaseHandler() {}\n\nBaseHandler.prototype.handleEnd = function() {};\nBaseHandler.prototype.handleText = function() {};\nBaseHandler.prototype.handleNode = function() {};\n\n\n/**\n * A simple pass through handler that does nothing except for\n * ignoring all input it receives.\n *\n * This is used to ignore unknown elements and\n * attributes.\n */\nfunction NoopHandler() { }\n\nNoopHandler.prototype = new BaseHandler();\n\nNoopHandler.prototype.handleNode = function() {\n return this;\n};\n\nfunction BodyHandler() {}\n\nBodyHandler.prototype = new BaseHandler();\n\nBodyHandler.prototype.handleText = function(text) {\n this.body = (this.body || '') + text;\n};\n\nfunction ReferenceHandler(property, context) {\n this.property = property;\n this.context = context;\n}\n\nReferenceHandler.prototype = new BodyHandler();\n\nReferenceHandler.prototype.handleNode = function(node) {\n\n if (this.element) {\n throw new Error('expected no sub nodes');\n } else {\n this.element = this.createReference(node);\n }\n\n return this;\n};\n\nReferenceHandler.prototype.handleEnd = function() {\n this.element.id = this.body;\n};\n\nReferenceHandler.prototype.createReference = function() {\n return {\n property: this.property.ns.name,\n id: ''\n };\n};\n\nfunction ValueHandler(propertyDesc, element) {\n this.element = element;\n this.propertyDesc = propertyDesc;\n}\n\nValueHandler.prototype = new BodyHandler();\n\nValueHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n propertyDesc = this.propertyDesc;\n\n value = coerceType(propertyDesc.type, value);\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(value);\n } else {\n element.set(propertyDesc.name, value);\n }\n};\n\n\nfunction BaseElementHandler() {}\n\nBaseElementHandler.prototype = Object.create(BodyHandler.prototype);\n\nBaseElementHandler.prototype.handleNode = function(node) {\n var parser = this,\n element = this.element,\n id;\n\n if (!element) {\n element = this.element = this.createElement(node);\n id = element.id;\n\n if (id) {\n this.context.addElement(id, element);\n }\n } else {\n parser = this.handleChild(node);\n }\n\n return parser;\n};\n\n/**\n * @class XMLReader.ElementHandler\n *\n */\nfunction ElementHandler(model, type, context) {\n this.model = model;\n this.type = model.getType(type);\n this.context = context;\n}\n\nElementHandler.prototype = new BaseElementHandler();\n\nElementHandler.prototype.addReference = function(reference) {\n this.context.addReference(reference);\n};\n\nElementHandler.prototype.handleEnd = function() {\n\n var value = this.body,\n element = this.element,\n descriptor = element.$descriptor,\n bodyProperty = descriptor.bodyProperty;\n\n if (bodyProperty && value !== undefined) {\n value = coerceType(bodyProperty.type, value);\n element.set(bodyProperty.name, value);\n }\n};\n\n/**\n * Create an instance of the model from the given node.\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.createElement = function(node) {\n var attributes = parseNodeAttributes(node),\n Type = this.type,\n descriptor = Type.$descriptor,\n context = this.context,\n instance = new Type({});\n\n forEach(attributes, function(value, name) {\n\n var prop = descriptor.propertiesByName[name];\n\n if (prop && prop.isReference) {\n context.addReference({\n element: instance,\n property: prop.ns.name,\n id: value\n });\n } else {\n if (prop) {\n value = coerceType(prop.type, value);\n }\n\n instance.set(name, value);\n }\n });\n\n return instance;\n};\n\nElementHandler.prototype.getPropertyForNode = function(node) {\n\n var nameNs = parseNameNs(node.local, node.prefix);\n\n var type = this.type,\n model = this.model,\n descriptor = type.$descriptor;\n\n var propertyName = nameNs.name,\n property = descriptor.propertiesByName[propertyName],\n elementTypeName,\n elementType,\n typeAnnotation;\n\n // search for properties by name first\n\n if (property) {\n\n if (property.serialize === XSI_TYPE) {\n typeAnnotation = node.attributes[XSI_TYPE];\n\n // xsi type is optional, if it does not exists the\n // default type is assumed\n if (typeAnnotation) {\n\n elementTypeName = typeAnnotation.value;\n\n // TODO: extract real name from attribute\n elementType = model.getType(elementTypeName);\n\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n }\n\n // search for properties by name first\n return property;\n }\n\n\n var pkg = model.getPackage(nameNs.prefix);\n\n if (pkg) {\n elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);\n elementType = model.getType(elementTypeName);\n\n // search for collection members later\n property = find(descriptor.properties, function(p) {\n return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);\n });\n\n if (property) {\n return assign({}, property, { effectiveType: elementType.$descriptor.name });\n }\n } else {\n // parse unknown element (maybe extension)\n property = find(descriptor.properties, function(p) {\n return !p.isReference && !p.isAttribute && p.type === 'Element';\n });\n\n if (property) {\n return property;\n }\n }\n\n throw new Error('unrecognized element <' + nameNs.name + '>');\n};\n\nElementHandler.prototype.toString = function() {\n return 'ElementDescriptor[' + this.type.$descriptor.name + ']';\n};\n\nElementHandler.prototype.valueHandler = function(propertyDesc, element) {\n return new ValueHandler(propertyDesc, element);\n};\n\nElementHandler.prototype.referenceHandler = function(propertyDesc) {\n return new ReferenceHandler(propertyDesc, this.context);\n};\n\nElementHandler.prototype.handler = function(type) {\n if (type === 'Element') {\n return new GenericElementHandler(this.model, type, this.context);\n } else {\n return new ElementHandler(this.model, type, this.context);\n }\n};\n\n/**\n * Handle the child element parsing\n *\n * @param {Element} node the xml node\n */\nElementHandler.prototype.handleChild = function(node) {\n var propertyDesc, type, element, childHandler;\n\n propertyDesc = this.getPropertyForNode(node);\n element = this.element;\n\n type = propertyDesc.effectiveType || propertyDesc.type;\n\n if (isSimpleType(type)) {\n return this.valueHandler(propertyDesc, element);\n }\n\n if (propertyDesc.isReference) {\n childHandler = this.referenceHandler(propertyDesc).handleNode(node);\n } else {\n childHandler = this.handler(type).handleNode(node);\n }\n\n var newElement = childHandler.element;\n\n // child handles may decide to skip elements\n // by not returning anything\n if (newElement !== undefined) {\n\n if (propertyDesc.isMany) {\n element.get(propertyDesc.name).push(newElement);\n } else {\n element.set(propertyDesc.name, newElement);\n }\n\n if (propertyDesc.isReference) {\n assign(newElement, {\n element: element\n });\n\n this.context.addReference(newElement);\n } else {\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n }\n\n return childHandler;\n};\n\n\nfunction GenericElementHandler(model, type, context) {\n this.model = model;\n this.context = context;\n}\n\nGenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);\n\nGenericElementHandler.prototype.createElement = function(node) {\n\n var name = node.name,\n prefix = node.prefix,\n uri = node.ns[prefix],\n attributes = node.attributes;\n\n return this.model.createAny(name, uri, attributes);\n};\n\nGenericElementHandler.prototype.handleChild = function(node) {\n\n var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),\n element = this.element;\n\n var newElement = handler.element,\n children;\n\n if (newElement !== undefined) {\n children = element.$children = element.$children || [];\n children.push(newElement);\n\n // establish child -> parent relationship\n newElement.$parent = element;\n }\n\n return handler;\n};\n\nGenericElementHandler.prototype.handleText = function(text) {\n this.body = this.body || '' + text;\n};\n\nGenericElementHandler.prototype.handleEnd = function() {\n if (this.body) {\n this.element.$body = this.body;\n }\n};\n\n/**\n * A reader for a meta-model\n *\n * @param {Object} options\n * @param {Model} options.model used to read xml files\n * @param {Boolean} options.lax whether to make parse errors warnings\n */\nfunction XMLReader(options) {\n\n if (options instanceof Moddle) {\n options = {\n model: options\n };\n }\n\n assign(this, { lax: false }, options);\n}\n\n\nXMLReader.prototype.fromXML = function(xml, rootHandler, done) {\n\n var model = this.model,\n lax = this.lax,\n context = new Context({\n parseRoot: rootHandler\n });\n\n var parser = new SaxParser(true, { xmlns: true, trim: true }),\n stack = new Stack();\n\n rootHandler.context = context;\n\n // push root handler\n stack.push(rootHandler);\n\n\n function resolveReferences() {\n\n var elementsById = context.elementsById;\n var references = context.references;\n\n var i, r;\n\n for (i = 0; !!(r = references[i]); i++) {\n var element = r.element;\n var reference = elementsById[r.id];\n var property = element.$descriptor.propertiesByName[r.property];\n\n if (!reference) {\n context.addWarning({\n message: 'unresolved reference <' + r.id + '>',\n element: r.element,\n property: r.property,\n value: r.id\n });\n }\n\n if (property.isMany) {\n var collection = element.get(property.name),\n idx = collection.indexOf(r);\n\n if (!reference) {\n // remove unresolvable reference\n collection.splice(idx, 1);\n } else {\n // update reference\n collection[idx] = reference;\n }\n } else {\n element.set(property.name, reference);\n }\n }\n }\n\n function handleClose(tagName) {\n stack.pop().handleEnd();\n }\n\n function handleOpen(node) {\n var handler = stack.peek();\n\n normalizeNamespaces(node, model);\n\n try {\n stack.push(handler.handleNode(node));\n } catch (e) {\n\n var line = this.line,\n column = this.column;\n\n var message =\n 'unparsable content <' + node.name + '> detected/n/t' +\n 'line: ' + line + '/n/t' +\n 'column: ' + column + '/n/t' +\n 'nested error: ' + e.message;\n\n if (lax) {\n context.addWarning({\n message: message,\n error: e\n });\n\n console.warn('could not parse node');\n console.warn(e);\n\n stack.push(new NoopHandler());\n } else {\n console.error('could not parse document');\n console.error(e);\n\n throw new Error(message);\n }\n }\n }\n\n function handleText(text) {\n stack.peek().handleText(text);\n }\n\n parser.onopentag = handleOpen;\n parser.oncdata = parser.ontext = handleText;\n parser.onclosetag = handleClose;\n parser.onend = resolveReferences;\n\n // deferred parse XML to make loading really ascnchronous\n // this ensures the execution environment (node or browser)\n // is kept responsive and that certain optimization strategies\n // can kick in\n defer(function() {\n var error;\n\n try {\n parser.write(xml).close();\n } catch (e) {\n error = e;\n }\n\n done(error, error ? undefined : rootHandler.element, context);\n });\n};\n\nXMLReader.prototype.handler = function(name) {\n return new ElementHandler(this.model, name);\n};\n\nmodule.exports = XMLReader;\nmodule.exports.ElementHandler = ElementHandler;","'use strict';\n\nvar map = require(80),\n forEach = require(77),\n isString = require(165),\n filter = require(75),\n assign = require(168);\n\nvar Types = require(30),\n parseNameNs = require(27).parseName,\n common = require(17),\n nameToAlias = common.nameToAlias;\n\nvar XML_PREAMBLE = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>/n',\n ESCAPE_CHARS = /(<|>|'|\"|&|/n/r|/n)/g,\n DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,\n XSI_TYPE = common.XSI_TYPE;\n\n\nfunction nsName(ns) {\n if (isString(ns)) {\n return ns;\n } else {\n return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;\n }\n}\n\nfunction getElementNs(ns, descriptor) {\n if (descriptor.isGeneric) {\n return descriptor.name;\n } else {\n return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);\n }\n}\n\nfunction getPropertyNs(ns, descriptor) {\n return assign({ localName: descriptor.ns.localName }, ns);\n}\n\nfunction getSerializableProperties(element) {\n var descriptor = element.$descriptor;\n\n return filter(descriptor.properties, function(p) {\n var name = p.name;\n\n // do not serialize defaults\n if (!element.hasOwnProperty(name)) {\n return false;\n }\n\n var value = element[name];\n\n // do not serialize default equals\n if (value === p.default) {\n return false;\n }\n\n return p.isMany ? value.length : true;\n });\n}\n\nvar ESCAPE_MAP = {\n '/n': '10',\n '/n/r': '10',\n '\"': '34',\n '/'': '39',\n '<': '60',\n '>': '62',\n '&': '38'\n};\n\n/**\n * Escape a string attribute to not contain any bad values (line breaks, '\"', ...)\n *\n * @param {String} str the string to escape\n * @return {String} the escaped string\n */\nfunction escapeAttr(str) {\n\n // ensure we are handling strings here\n str = isString(str) ? str : '' + str;\n\n return str.replace(ESCAPE_CHARS, function(str) {\n return '&#' + ESCAPE_MAP[str] + ';';\n });\n}\n\nfunction filterAttributes(props) {\n return filter(props, function(p) { return p.isAttr; });\n}\n\nfunction filterContained(props) {\n return filter(props, function(p) { return !p.isAttr; });\n}\n\n\nfunction ReferenceSerializer(parent, ns) {\n this.ns = ns;\n}\n\nReferenceSerializer.prototype.build = function(element) {\n this.element = element;\n return this;\n};\n\nReferenceSerializer.prototype.serializeTo = function(writer) {\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction BodySerializer() {}\n\nBodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {\n var escape = this.escape;\n\n if (escape) {\n writer.append('<![CDATA[');\n }\n\n writer.append(this.value);\n\n if (escape) {\n writer.append(']]>');\n }\n};\n\nBodySerializer.prototype.build = function(prop, value) {\n this.value = value;\n\n if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {\n this.escape = true;\n }\n\n return this;\n};\n\nfunction ValueSerializer(ns) {\n this.ns = ns;\n}\n\nValueSerializer.prototype = new BodySerializer();\n\nValueSerializer.prototype.serializeTo = function(writer) {\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns) + '>');\n\n this.serializeValue(writer);\n\n writer\n .append( '</' + nsName(this.ns) + '>')\n .appendNewLine();\n};\n\nfunction ElementSerializer(parent, ns) {\n this.body = [];\n this.attrs = [];\n\n this.parent = parent;\n this.ns = ns;\n}\n\nElementSerializer.prototype.build = function(element) {\n this.element = element;\n\n var otherAttrs = this.parseNsAttributes(element);\n\n if (!this.ns) {\n this.ns = this.nsTagName(element.$descriptor);\n }\n\n if (element.$descriptor.isGeneric) {\n this.parseGeneric(element);\n } else {\n var properties = getSerializableProperties(element);\n\n this.parseAttributes(filterAttributes(properties));\n this.parseContainments(filterContained(properties));\n\n this.parseGenericAttributes(element, otherAttrs);\n }\n\n return this;\n};\n\nElementSerializer.prototype.nsTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getElementNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.nsPropertyTagName = function(descriptor) {\n var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n return getPropertyNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.ns.uri;\n};\n\nElementSerializer.prototype.nsAttributeName = function(element) {\n\n var ns;\n\n if (isString(element)) {\n ns = parseNameNs(element);\n } else\n if (element.ns) {\n ns = element.ns;\n }\n\n var effectiveNs = this.logNamespaceUsed(ns);\n\n // strip prefix if same namespace like parent\n if (this.isLocalNs(effectiveNs)) {\n return { localName: ns.localName };\n } else {\n return assign({ localName: ns.localName }, effectiveNs);\n }\n};\n\nElementSerializer.prototype.parseGeneric = function(element) {\n\n var self = this,\n body = this.body,\n attrs = this.attrs;\n\n forEach(element, function(val, key) {\n\n if (key === '$body') {\n body.push(new BodySerializer().build({ type: 'String' }, val));\n } else\n if (key === '$children') {\n forEach(val, function(child) {\n body.push(new ElementSerializer(self).build(child));\n });\n } else\n if (key.indexOf('$') !== 0) {\n attrs.push({ name: key, value: escapeAttr(val) });\n }\n });\n};\n\n/**\n * Parse namespaces and return a list of left over generic attributes\n *\n * @param {Object} element\n * @return {Array<Object>}\n */\nElementSerializer.prototype.parseNsAttributes = function(element) {\n var self = this;\n\n var genericAttrs = element.$attrs;\n\n var attributes = [];\n\n // parse namespace attributes first\n // and log them. push non namespace attributes to a list\n // and process them later\n forEach(genericAttrs, function(value, name) {\n var nameNs = parseNameNs(name);\n\n if (nameNs.prefix === 'xmlns') {\n self.logNamespace({ prefix: nameNs.localName, uri: value });\n } else\n if (!nameNs.prefix && nameNs.localName === 'xmlns') {\n self.logNamespace({ uri: value });\n } else {\n attributes.push({ name: name, value: value });\n }\n });\n\n return attributes;\n};\n\nElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {\n\n var self = this;\n\n forEach(attributes, function(attr) {\n\n // do not serialize xsi:type attribute\n // it is set manually based on the actual implementation type\n if (attr.name === XSI_TYPE) {\n return;\n }\n\n try {\n self.addAttribute(self.nsAttributeName(attr.name), attr.value);\n } catch (e) {\n console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);\n }\n });\n};\n\nElementSerializer.prototype.parseContainments = function(properties) {\n\n var self = this,\n body = this.body,\n element = this.element;\n\n forEach(properties, function(p) {\n var value = element.get(p.name),\n isReference = p.isReference,\n isMany = p.isMany;\n\n var ns = self.nsPropertyTagName(p);\n\n if (!isMany) {\n value = [ value ];\n }\n\n if (p.isBody) {\n body.push(new BodySerializer().build(p, value[0]));\n } else\n if (Types.isSimple(p.type)) {\n forEach(value, function(v) {\n body.push(new ValueSerializer(ns).build(p, v));\n });\n } else\n if (isReference) {\n forEach(value, function(v) {\n body.push(new ReferenceSerializer(self, ns).build(v));\n });\n } else {\n // allow serialization via type\n // rather than element name\n var asType = p.serialize === XSI_TYPE;\n\n forEach(value, function(v) {\n var serializer;\n\n if (asType) {\n serializer = new TypeSerializer(self, ns);\n } else {\n serializer = new ElementSerializer(self);\n }\n\n body.push(serializer.build(v));\n });\n }\n });\n};\n\nElementSerializer.prototype.getNamespaces = function() {\n if (!this.parent) {\n if (!this.namespaces) {\n this.namespaces = {\n prefixMap: {},\n uriMap: {},\n used: {}\n };\n }\n } else {\n this.namespaces = this.parent.getNamespaces();\n }\n\n return this.namespaces;\n};\n\nElementSerializer.prototype.logNamespace = function(ns) {\n var namespaces = this.getNamespaces();\n\n var existing = namespaces.uriMap[ns.uri];\n\n if (!existing) {\n namespaces.uriMap[ns.uri] = ns;\n }\n\n namespaces.prefixMap[ns.prefix] = ns.uri;\n\n return ns;\n};\n\nElementSerializer.prototype.logNamespaceUsed = function(ns) {\n var element = this.element,\n model = element.$model,\n namespaces = this.getNamespaces();\n\n // ns may be\n //\n // * prefix only\n // * prefix:uri\n\n var prefix = ns.prefix;\n var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||\n namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);\n\n if (!uri) {\n throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');\n }\n\n ns = namespaces.uriMap[uri];\n\n if (!ns) {\n ns = this.logNamespace({ prefix: prefix, uri: uri });\n }\n\n if (!namespaces.used[ns.uri]) {\n namespaces.used[ns.uri] = ns;\n }\n\n return ns;\n};\n\nElementSerializer.prototype.parseAttributes = function(properties) {\n var self = this,\n element = this.element;\n\n forEach(properties, function(p) {\n self.logNamespaceUsed(p.ns);\n\n var value = element.get(p.name);\n\n if (p.isReference) {\n value = value.id;\n }\n\n self.addAttribute(self.nsAttributeName(p), value);\n });\n};\n\nElementSerializer.prototype.addAttribute = function(name, value) {\n var attrs = this.attrs;\n\n if (isString(value)) {\n value = escapeAttr(value);\n }\n\n attrs.push({ name: name, value: value });\n};\n\nElementSerializer.prototype.serializeAttributes = function(writer) {\n var attrs = this.attrs,\n root = !this.parent,\n namespaces = this.namespaces;\n\n function collectNsAttrs() {\n return map(namespaces.used, function(ns) {\n var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');\n return { name: name, value: ns.uri };\n });\n }\n\n if (root) {\n attrs = collectNsAttrs().concat(attrs);\n }\n\n forEach(attrs, function(a) {\n writer\n .append(' ')\n .append(nsName(a.name)).append('=\"').append(a.value).append('\"');\n });\n};\n\nElementSerializer.prototype.serializeTo = function(writer) {\n var hasBody = this.body.length,\n indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);\n\n writer\n .appendIndent()\n .append('<' + nsName(this.ns));\n\n this.serializeAttributes(writer);\n\n writer.append(hasBody ? '>' : ' />');\n\n if (hasBody) {\n\n if (indent) {\n writer\n .appendNewLine()\n .indent();\n }\n\n forEach(this.body, function(b) {\n b.serializeTo(writer);\n });\n\n if (indent) {\n writer\n .unindent()\n .appendIndent();\n }\n\n writer.append('</' + nsName(this.ns) + '>');\n }\n\n writer.appendNewLine();\n};\n\n/**\n * A serializer for types that handles serialization of data types\n */\nfunction TypeSerializer(parent, ns) {\n ElementSerializer.call(this, parent, ns);\n}\n\nTypeSerializer.prototype = new ElementSerializer();\n\nTypeSerializer.prototype.build = function(element) {\n var descriptor = element.$descriptor;\n\n this.element = element;\n\n this.typeNs = this.nsTagName(descriptor);\n\n // add xsi:type attribute to represent the elements\n // actual type\n\n var typeNs = this.typeNs,\n pkg = element.$model.getPackage(typeNs.uri),\n typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';\n\n this.addAttribute(this.nsAttributeName(XSI_TYPE),\n (typeNs.prefix ? typeNs.prefix + ':' : '') +\n typePrefix + descriptor.ns.localName);\n\n // do the usual stuff\n return ElementSerializer.prototype.build.call(this, element);\n};\n\nTypeSerializer.prototype.isLocalNs = function(ns) {\n return ns.uri === this.typeNs.uri;\n};\n\nfunction SavingWriter() {\n this.value = '';\n\n this.write = function(str) {\n this.value += str;\n };\n}\n\nfunction FormatingWriter(out, format) {\n\n var indent = [''];\n\n this.append = function(str) {\n out.write(str);\n\n return this;\n };\n\n this.appendNewLine = function() {\n if (format) {\n out.write('/n');\n }\n\n return this;\n };\n\n this.appendIndent = function() {\n if (format) {\n out.write(indent.join(' '));\n }\n\n return this;\n };\n\n this.indent = function() {\n indent.push('');\n return this;\n };\n\n this.unindent = function() {\n indent.pop();\n return this;\n };\n}\n\n/**\n * A writer for meta-model backed document trees\n *\n * @param {Object} options output options to pass into the writer\n */\nfunction XMLWriter(options) {\n\n options = assign({ format: false, preamble: true }, options || {});\n\n function toXML(tree, writer) {\n var internalWriter = writer || new SavingWriter();\n var formatingWriter = new FormatingWriter(internalWriter, options.format);\n\n if (options.preamble) {\n formatingWriter.append(XML_PREAMBLE);\n }\n\n new ElementSerializer().build(tree).serializeTo(formatingWriter);\n\n if (!writer) {\n return internalWriter.value;\n }\n }\n\n return {\n toXML: toXML\n };\n}\n\nmodule.exports = XMLWriter;","// wrapper for non-node envs\n;(function (sax) {\n\nsax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\nsax.SAXParser = SAXParser\nsax.SAXStream = SAXStream\nsax.createStream = createStream\n\n// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n// since that's the earliest that a buffer overrun could occur. This way, checks are\n// as rare as required, but as often as necessary to ensure never crossing this bound.\n// Furthermore, buffers are only tested at most once per write(), so passing a very\n// large string into write() might have undesirable effects, but this is manageable by\n// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n// edge case, result in creating at most one complete copy of the string passed in.\n// Set to Infinity to have unlimited buffers.\nsax.MAX_BUFFER_LENGTH = 64 * 1024\n\nvar buffers = [\n \"comment\", \"sgmlDecl\", \"textNode\", \"tagName\", \"doctype\",\n \"procInstName\", \"procInstBody\", \"entity\", \"attribName\",\n \"attribValue\", \"cdata\", \"script\"\n]\n\nsax.EVENTS = // for discoverability.\n [ \"text\"\n , \"processinginstruction\"\n , \"sgmldeclaration\"\n , \"doctype\"\n , \"comment\"\n , \"attribute\"\n , \"opentag\"\n , \"closetag\"\n , \"opencdata\"\n , \"cdata\"\n , \"closecdata\"\n , \"error\"\n , \"end\"\n , \"ready\"\n , \"script\"\n , \"opennamespace\"\n , \"closenamespace\"\n ]\n\nfunction SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = \"\"\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\"\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.ENTITIES = Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) parser.ns = Object.create(rootNS)\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, \"onready\")\n}\n\nif (!Object.create) Object.create = function (o) {\n function f () { this.__proto__ = o }\n f.prototype = o\n return new f\n}\n\nif (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {\n return o.__proto__\n}\n\nif (!Object.keys) Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n}\n\nfunction checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n , maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i ++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case \"textNode\":\n closeText(parser)\n break\n\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n break\n\n case \"script\":\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n break\n\n default:\n error(parser, \"Max buffer length exceeded: \"+buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)\n + parser.position\n}\n\nfunction clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i ++) {\n parser[buffers[i]] = \"\"\n }\n}\n\nfunction flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata)\n parser.cdata = \"\"\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n}\n\nSAXParser.prototype =\n { end: function () { end(this) }\n , write: write\n , resume: function () { this.error = null; return this }\n , close: function () { return this.write(null) }\n , flush: function () { flushBuffers(this) }\n }\n\ntry {\n var Stream = require(\"stream\").Stream\n} catch (ex) {\n var Stream = function () {}\n}\n\n\nvar streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== \"error\" && ev !== \"end\"\n})\n\nfunction createStream (strict, opt) {\n return new SAXStream(strict, opt)\n}\n\nfunction SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n\n var me = this\n\n this._parser.onend = function () {\n me.emit(\"end\")\n }\n\n this._parser.onerror = function (er) {\n me.emit(\"error\", er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null;\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function () { return me._parser[\"on\" + ev] },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n return me._parser[\"on\"+ev] = h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n}\n\nSAXStream.prototype = Object.create(Stream.prototype,\n { constructor: { value: SAXStream } })\n\nSAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data);\n }\n\n this._parser.write(data.toString())\n this.emit(\"data\", data)\n return true\n}\n\nSAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) this.write(chunk)\n this._parser.end()\n return true\n}\n\nSAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser[\"on\"+ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\"+ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]]\n : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n}\n\n\n\n// character classes and tokens\nvar whitespace = \"/r/n/t \"\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n , number = \"0124356789\"\n , letter = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n // (Letter | \"_\" | \":\")\n , quote = \"'/\"\"\n , entity = number+letter+\"#\"\n , attribEnd = whitespace + \">\"\n , CDATA = \"[CDATA[\"\n , DOCTYPE = \"DOCTYPE\"\n , XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\"\n , XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\"\n , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n// turn all the string character sets into character class objects.\nwhitespace = charClass(whitespace)\nnumber = charClass(number)\nletter = charClass(letter)\n\n// http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n// This implementation works on strings, a single character at a time\n// as such, it cannot ever support astral-plane characters (10000-EFFFF)\n// without a significant breaking change to either this parser, or the\n// JavaScript language. Implementation of an emoji-capable xml parser\n// is left as an exercise for the reader.\nvar nameStart = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD]/\n\nvar nameBody = /[:_A-Za-z/u00C0-/u00D6/u00D8-/u00F6/u00F8-/u02FF/u0370-/u037D/u037F-/u1FFF/u200C-/u200D/u2070-/u218F/u2C00-/u2FEF/u3001-/uD7FF/uF900-/uFDCF/uFDF0-/uFFFD/u00B7/u0300-/u036F/u203F-/u2040/./d-]/\n\nquote = charClass(quote)\nentity = charClass(entity)\nattribEnd = charClass(attribEnd)\n\nfunction charClass (str) {\n return str.split(\"\").reduce(function (s, c) {\n s[c] = true\n return s\n }, {})\n}\n\nfunction isRegExp (c) {\n return Object.prototype.toString.call(c) === '[object RegExp]'\n}\n\nfunction is (charclass, c) {\n return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]\n}\n\nfunction not (charclass, c) {\n return !is(charclass, c)\n}\n\nvar S = 0\nsax.STATE =\n{ BEGIN : S++\n, TEXT : S++ // general stuff\n, TEXT_ENTITY : S++ // &amp and such.\n, OPEN_WAKA : S++ // <\n, SGML_DECL : S++ // <!BLARG\n, SGML_DECL_QUOTED : S++ // <!BLARG foo \"bar\n, DOCTYPE : S++ // <!DOCTYPE\n, DOCTYPE_QUOTED : S++ // <!DOCTYPE \"//blah\n, DOCTYPE_DTD : S++ // <!DOCTYPE \"//blah\" [ ...\n, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE \"//blah\" [ \"foo\n, COMMENT_STARTING : S++ // <!-\n, COMMENT : S++ // <!--\n, COMMENT_ENDING : S++ // <!-- blah -\n, COMMENT_ENDED : S++ // <!-- blah --\n, CDATA : S++ // <![CDATA[ something\n, CDATA_ENDING : S++ // ]\n, CDATA_ENDING_2 : S++ // ]]\n, PROC_INST : S++ // <?hi\n, PROC_INST_BODY : S++ // <?hi there\n, PROC_INST_ENDING : S++ // <?hi \"there\" ?\n, OPEN_TAG : S++ // <strong\n, OPEN_TAG_SLASH : S++ // <strong /\n, ATTRIB : S++ // <a\n, ATTRIB_NAME : S++ // <a foo\n, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _\n, ATTRIB_VALUE : S++ // <a foo=\n, ATTRIB_VALUE_QUOTED : S++ // <a foo=\"bar\n, ATTRIB_VALUE_CLOSED : S++ // <a foo=\"bar\"\n, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar\n, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar=\"&quot;\"\n, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;\n, CLOSE_TAG : S++ // </a\n, CLOSE_TAG_SAW_WHITE : S++ // </a >\n, SCRIPT : S++ // <script> ...\n, SCRIPT_ENDING : S++ // <script> ... <\n}\n\nsax.ENTITIES =\n{ \"amp\" : \"&\"\n, \"gt\" : \">\"\n, \"lt\" : \"<\"\n, \"quot\" : \"/\"\"\n, \"apos\" : \"'\"\n, \"AElig\" : 198\n, \"Aacute\" : 193\n, \"Acirc\" : 194\n, \"Agrave\" : 192\n, \"Aring\" : 197\n, \"Atilde\" : 195\n, \"Auml\" : 196\n, \"Ccedil\" : 199\n, \"ETH\" : 208\n, \"Eacute\" : 201\n, \"Ecirc\" : 202\n, \"Egrave\" : 200\n, \"Euml\" : 203\n, \"Iacute\" : 205\n, \"Icirc\" : 206\n, \"Igrave\" : 204\n, \"Iuml\" : 207\n, \"Ntilde\" : 209\n, \"Oacute\" : 211\n, \"Ocirc\" : 212\n, \"Ograve\" : 210\n, \"Oslash\" : 216\n, \"Otilde\" : 213\n, \"Ouml\" : 214\n, \"THORN\" : 222\n, \"Uacute\" : 218\n, \"Ucirc\" : 219\n, \"Ugrave\" : 217\n, \"Uuml\" : 220\n, \"Yacute\" : 221\n, \"aacute\" : 225\n, \"acirc\" : 226\n, \"aelig\" : 230\n, \"agrave\" : 224\n, \"aring\" : 229\n, \"atilde\" : 227\n, \"auml\" : 228\n, \"ccedil\" : 231\n, \"eacute\" : 233\n, \"ecirc\" : 234\n, \"egrave\" : 232\n, \"eth\" : 240\n, \"euml\" : 235\n, \"iacute\" : 237\n, \"icirc\" : 238\n, \"igrave\" : 236\n, \"iuml\" : 239\n, \"ntilde\" : 241\n, \"oacute\" : 243\n, \"ocirc\" : 244\n, \"ograve\" : 242\n, \"oslash\" : 248\n, \"otilde\" : 245\n, \"ouml\" : 246\n, \"szlig\" : 223\n, \"thorn\" : 254\n, \"uacute\" : 250\n, \"ucirc\" : 251\n, \"ugrave\" : 249\n, \"uuml\" : 252\n, \"yacute\" : 253\n, \"yuml\" : 255\n, \"copy\" : 169\n, \"reg\" : 174\n, \"nbsp\" : 160\n, \"iexcl\" : 161\n, \"cent\" : 162\n, \"pound\" : 163\n, \"curren\" : 164\n, \"yen\" : 165\n, \"brvbar\" : 166\n, \"sect\" : 167\n, \"uml\" : 168\n, \"ordf\" : 170\n, \"laquo\" : 171\n, \"not\" : 172\n, \"shy\" : 173\n, \"macr\" : 175\n, \"deg\" : 176\n, \"plusmn\" : 177\n, \"sup1\" : 185\n, \"sup2\" : 178\n, \"sup3\" : 179\n, \"acute\" : 180\n, \"micro\" : 181\n, \"para\" : 182\n, \"middot\" : 183\n, \"cedil\" : 184\n, \"ordm\" : 186\n, \"raquo\" : 187\n, \"frac14\" : 188\n, \"frac12\" : 189\n, \"frac34\" : 190\n, \"iquest\" : 191\n, \"times\" : 215\n, \"divide\" : 247\n, \"OElig\" : 338\n, \"oelig\" : 339\n, \"Scaron\" : 352\n, \"scaron\" : 353\n, \"Yuml\" : 376\n, \"fnof\" : 402\n, \"circ\" : 710\n, \"tilde\" : 732\n, \"Alpha\" : 913\n, \"Beta\" : 914\n, \"Gamma\" : 915\n, \"Delta\" : 916\n, \"Epsilon\" : 917\n, \"Zeta\" : 918\n, \"Eta\" : 919\n, \"Theta\" : 920\n, \"Iota\" : 921\n, \"Kappa\" : 922\n, \"Lambda\" : 923\n, \"Mu\" : 924\n, \"Nu\" : 925\n, \"Xi\" : 926\n, \"Omicron\" : 927\n, \"Pi\" : 928\n, \"Rho\" : 929\n, \"Sigma\" : 931\n, \"Tau\" : 932\n, \"Upsilon\" : 933\n, \"Phi\" : 934\n, \"Chi\" : 935\n, \"Psi\" : 936\n, \"Omega\" : 937\n, \"alpha\" : 945\n, \"beta\" : 946\n, \"gamma\" : 947\n, \"delta\" : 948\n, \"epsilon\" : 949\n, \"zeta\" : 950\n, \"eta\" : 951\n, \"theta\" : 952\n, \"iota\" : 953\n, \"kappa\" : 954\n, \"lambda\" : 955\n, \"mu\" : 956\n, \"nu\" : 957\n, \"xi\" : 958\n, \"omicron\" : 959\n, \"pi\" : 960\n, \"rho\" : 961\n, \"sigmaf\" : 962\n, \"sigma\" : 963\n, \"tau\" : 964\n, \"upsilon\" : 965\n, \"phi\" : 966\n, \"chi\" : 967\n, \"psi\" : 968\n, \"omega\" : 969\n, \"thetasym\" : 977\n, \"upsih\" : 978\n, \"piv\" : 982\n, \"ensp\" : 8194\n, \"emsp\" : 8195\n, \"thinsp\" : 8201\n, \"zwnj\" : 8204\n, \"zwj\" : 8205\n, \"lrm\" : 8206\n, \"rlm\" : 8207\n, \"ndash\" : 8211\n, \"mdash\" : 8212\n, \"lsquo\" : 8216\n, \"rsquo\" : 8217\n, \"sbquo\" : 8218\n, \"ldquo\" : 8220\n, \"rdquo\" : 8221\n, \"bdquo\" : 8222\n, \"dagger\" : 8224\n, \"Dagger\" : 8225\n, \"bull\" : 8226\n, \"hellip\" : 8230\n, \"permil\" : 8240\n, \"prime\" : 8242\n, \"Prime\" : 8243\n, \"lsaquo\" : 8249\n, \"rsaquo\" : 8250\n, \"oline\" : 8254\n, \"frasl\" : 8260\n, \"euro\" : 8364\n, \"image\" : 8465\n, \"weierp\" : 8472\n, \"real\" : 8476\n, \"trade\" : 8482\n, \"alefsym\" : 8501\n, \"larr\" : 8592\n, \"uarr\" : 8593\n, \"rarr\" : 8594\n, \"darr\" : 8595\n, \"harr\" : 8596\n, \"crarr\" : 8629\n, \"lArr\" : 8656\n, \"uArr\" : 8657\n, \"rArr\" : 8658\n, \"dArr\" : 8659\n, \"hArr\" : 8660\n, \"forall\" : 8704\n, \"part\" : 8706\n, \"exist\" : 8707\n, \"empty\" : 8709\n, \"nabla\" : 8711\n, \"isin\" : 8712\n, \"notin\" : 8713\n, \"ni\" : 8715\n, \"prod\" : 8719\n, \"sum\" : 8721\n, \"minus\" : 8722\n, \"lowast\" : 8727\n, \"radic\" : 8730\n, \"prop\" : 8733\n, \"infin\" : 8734\n, \"ang\" : 8736\n, \"and\" : 8743\n, \"or\" : 8744\n, \"cap\" : 8745\n, \"cup\" : 8746\n, \"int\" : 8747\n, \"there4\" : 8756\n, \"sim\" : 8764\n, \"cong\" : 8773\n, \"asymp\" : 8776\n, \"ne\" : 8800\n, \"equiv\" : 8801\n, \"le\" : 8804\n, \"ge\" : 8805\n, \"sub\" : 8834\n, \"sup\" : 8835\n, \"nsub\" : 8836\n, \"sube\" : 8838\n, \"supe\" : 8839\n, \"oplus\" : 8853\n, \"otimes\" : 8855\n, \"perp\" : 8869\n, \"sdot\" : 8901\n, \"lceil\" : 8968\n, \"rceil\" : 8969\n, \"lfloor\" : 8970\n, \"rfloor\" : 8971\n, \"lang\" : 9001\n, \"rang\" : 9002\n, \"loz\" : 9674\n, \"spades\" : 9824\n, \"clubs\" : 9827\n, \"hearts\" : 9829\n, \"diams\" : 9830\n}\n\nObject.keys(sax.ENTITIES).forEach(function (key) {\n var e = sax.ENTITIES[key]\n var s = typeof e === 'number' ? String.fromCharCode(e) : e\n sax.ENTITIES[key] = s\n})\n\nfor (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S\n\n// shorthand\nS = sax.STATE\n\nfunction emit (parser, event, data) {\n parser[event] && parser[event](data)\n}\n\nfunction emitNode (parser, nodeType, data) {\n if (parser.textNode) closeText(parser)\n emit(parser, nodeType, data)\n}\n\nfunction closeText (parser) {\n parser.textNode = textopts(parser.opt, parser.textNode)\n if (parser.textNode) emit(parser, \"ontext\", parser.textNode)\n parser.textNode = \"\"\n}\n\nfunction textopts (opt, text) {\n if (opt.trim) text = text.trim()\n if (opt.normalize) text = text.replace(//s+/g, \" \")\n return text\n}\n\nfunction error (parser, er) {\n closeText(parser)\n if (parser.trackPosition) {\n er += \"/nLine: \"+parser.line+\n \"/nColumn: \"+parser.column+\n \"/nChar: \"+parser.c\n }\n er = new Error(er)\n parser.error = er\n emit(parser, \"onerror\", er)\n return parser\n}\n\nfunction end (parser) {\n if (!parser.closedRoot) strictFail(parser, \"Unclosed root tag\")\n if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, \"Unexpected end\")\n closeText(parser)\n parser.c = \"\"\n parser.closed = true\n emit(parser, \"onend\")\n SAXParser.call(parser, parser.strict, parser.opt)\n return parser\n}\n\nfunction strictFail (parser, message) {\n if (typeof parser !== 'object' || !(parser instanceof SAXParser))\n throw new Error('bad call to strictFail');\n if (parser.strict) error(parser, message)\n}\n\nfunction newTag (parser) {\n if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()\n var parent = parser.tags[parser.tags.length - 1] || parser\n , tag = parser.tag = { name : parser.tagName, attributes : {} }\n\n // will be overridden if tag contails an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (parser.opt.xmlns) tag.ns = parent.ns\n parser.attribList.length = 0\n}\n\nfunction qname (name, attribute) {\n var i = name.indexOf(\":\")\n , qualName = i < 0 ? [ \"\", name ] : name.split(\":\")\n , prefix = qualName[0]\n , local = qualName[1]\n\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === \"xmlns\") {\n prefix = \"xmlns\"\n local = \"\"\n }\n\n return { prefix: prefix, local: local }\n}\n\nfunction attrib (parser) {\n if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()\n\n if (parser.attribList.indexOf(parser.attribName) !== -1 ||\n parser.tag.attributes.hasOwnProperty(parser.attribName)) {\n return parser.attribName = parser.attribValue = \"\"\n }\n\n if (parser.opt.xmlns) {\n var qn = qname(parser.attribName, true)\n , prefix = qn.prefix\n , local = qn.local\n\n if (prefix === \"xmlns\") {\n // namespace binding attribute; push the binding into scope\n if (local === \"xml\" && parser.attribValue !== XML_NAMESPACE) {\n strictFail( parser\n , \"xml: prefix must be bound to \" + XML_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else if (local === \"xmlns\" && parser.attribValue !== XMLNS_NAMESPACE) {\n strictFail( parser\n , \"xmlns: prefix must be bound to \" + XMLNS_NAMESPACE + \"/n\"\n + \"Actual: \" + parser.attribValue )\n } else {\n var tag = parser.tag\n , parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns)\n }\n tag.ns[local] = parser.attribValue\n }\n }\n\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect; preserve attribute order\n // so deferred events can be emitted in document order\n parser.attribList.push([parser.attribName, parser.attribValue])\n } else {\n // in non-xmlns mode, we can emit the event right away\n parser.tag.attributes[parser.attribName] = parser.attribValue\n emitNode( parser\n , \"onattribute\"\n , { name: parser.attribName\n , value: parser.attribValue } )\n }\n\n parser.attribName = parser.attribValue = \"\"\n}\n\nfunction openTag (parser, selfClosing) {\n if (parser.opt.xmlns) {\n // emit namespace binding events\n var tag = parser.tag\n\n // add namespace info to tag\n var qn = qname(parser.tagName)\n tag.prefix = qn.prefix\n tag.local = qn.local\n tag.uri = tag.ns[qn.prefix] || \"\"\n\n if (tag.prefix && !tag.uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(parser.tagName))\n tag.uri = qn.prefix\n }\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (tag.ns && parent.ns !== tag.ns) {\n Object.keys(tag.ns).forEach(function (p) {\n emitNode( parser\n , \"onopennamespace\"\n , { prefix: p , uri: tag.ns[p] } )\n })\n }\n\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (var i = 0, l = parser.attribList.length; i < l; i ++) {\n var nv = parser.attribList[i]\n var name = nv[0]\n , value = nv[1]\n , qualName = qname(name, true)\n , prefix = qualName.prefix\n , local = qualName.local\n , uri = prefix == \"\" ? \"\" : (tag.ns[prefix] || \"\")\n , a = { name: name\n , value: value\n , prefix: prefix\n , local: local\n , uri: uri\n }\n\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix != \"xmlns\" && !uri) {\n strictFail(parser, \"Unbound namespace prefix: \"\n + JSON.stringify(prefix))\n a.uri = prefix\n }\n parser.tag.attributes[name] = a\n emitNode(parser, \"onattribute\", a)\n }\n parser.attribList.length = 0\n }\n\n parser.tag.isSelfClosing = !!selfClosing\n\n // process the tag\n parser.sawRoot = true\n parser.tags.push(parser.tag)\n emitNode(parser, \"onopentag\", parser.tag)\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!parser.noscript && parser.tagName.toLowerCase() === \"script\") {\n parser.state = S.SCRIPT\n } else {\n parser.state = S.TEXT\n }\n parser.tag = null\n parser.tagName = \"\"\n }\n parser.attribName = parser.attribValue = \"\"\n parser.attribList.length = 0\n}\n\nfunction closeTag (parser) {\n if (!parser.tagName) {\n strictFail(parser, \"Weird empty close tag.\")\n parser.textNode += \"</>\"\n parser.state = S.TEXT\n return\n }\n\n if (parser.script) {\n if (parser.tagName !== \"script\") {\n parser.script += \"</\" + parser.tagName + \">\"\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n return\n }\n emitNode(parser, \"onscript\", parser.script)\n parser.script = \"\"\n }\n\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n var t = parser.tags.length\n var tagName = parser.tagName\n if (!parser.strict) tagName = tagName[parser.looseCase]()\n var closeTo = tagName\n while (t --) {\n var close = parser.tags[t]\n if (close.name !== closeTo) {\n // fail the first time in strict mode\n strictFail(parser, \"Unexpected close tag\")\n } else break\n }\n\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n strictFail(parser, \"Unmatched closing tag: \"+parser.tagName)\n parser.textNode += \"</\" + parser.tagName + \">\"\n parser.state = S.TEXT\n return\n }\n parser.tagName = tagName\n var s = parser.tags.length\n while (s --> t) {\n var tag = parser.tag = parser.tags.pop()\n parser.tagName = parser.tag.name\n emitNode(parser, \"onclosetag\", parser.tagName)\n\n var x = {}\n for (var i in tag.ns) x[i] = tag.ns[i]\n\n var parent = parser.tags[parser.tags.length - 1] || parser\n if (parser.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n Object.keys(tag.ns).forEach(function (p) {\n var n = tag.ns[p]\n emitNode(parser, \"onclosenamespace\", { prefix: p, uri: n })\n })\n }\n }\n if (t === 0) parser.closedRoot = true\n parser.tagName = parser.attribValue = parser.attribName = \"\"\n parser.attribList.length = 0\n parser.state = S.TEXT\n}\n\nfunction parseEntity (parser) {\n var entity = parser.entity\n , entityLC = entity.toLowerCase()\n , num\n , numStr = \"\"\n if (parser.ENTITIES[entity])\n return parser.ENTITIES[entity]\n if (parser.ENTITIES[entityLC])\n return parser.ENTITIES[entityLC]\n entity = entityLC\n if (entity.charAt(0) === \"#\") {\n if (entity.charAt(1) === \"x\") {\n entity = entity.slice(2)\n num = parseInt(entity, 16)\n numStr = num.toString(16)\n } else {\n entity = entity.slice(1)\n num = parseInt(entity, 10)\n numStr = num.toString(10)\n }\n }\n entity = entity.replace(/^0+/, \"\")\n if (numStr.toLowerCase() !== entity) {\n strictFail(parser, \"Invalid character entity\")\n return \"&\"+parser.entity + \";\"\n }\n\n return String.fromCodePoint(num)\n}\n\nfunction write (chunk) {\n var parser = this\n if (this.error) throw this.error\n if (parser.closed) return error(parser,\n \"Cannot write after close. Assign an onready handler.\")\n if (chunk === null) return end(parser)\n var i = 0, c = \"\"\n while (parser.c = c = chunk.charAt(i++)) {\n if (parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n switch (parser.state) {\n\n case S.BEGIN:\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else if (not(whitespace,c)) {\n // have to process this as a text node.\n // weird, but happens.\n strictFail(parser, \"Non-whitespace before first tag.\")\n parser.textNode = c\n parser.state = S.TEXT\n }\n continue\n\n case S.TEXT:\n if (parser.sawRoot && !parser.closedRoot) {\n var starti = i-1\n while (c && c!==\"<\" && c!==\"&\") {\n c = chunk.charAt(i++)\n if (c && parser.trackPosition) {\n parser.position ++\n if (c === \"/n\") {\n parser.line ++\n parser.column = 0\n } else parser.column ++\n }\n }\n parser.textNode += chunk.substring(starti, i-1)\n }\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA\n parser.startTagPosition = parser.position\n } else {\n if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))\n strictFail(parser, \"Text data outside of root node.\")\n if (c === \"&\") parser.state = S.TEXT_ENTITY\n else parser.textNode += c\n }\n continue\n\n case S.SCRIPT:\n // only non-strict\n if (c === \"<\") {\n parser.state = S.SCRIPT_ENDING\n } else parser.script += c\n continue\n\n case S.SCRIPT_ENDING:\n if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n } else {\n parser.script += \"<\" + c\n parser.state = S.SCRIPT\n }\n continue\n\n case S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === \"!\") {\n parser.state = S.SGML_DECL\n parser.sgmlDecl = \"\"\n } else if (is(whitespace, c)) {\n // wait for it...\n } else if (is(nameStart,c)) {\n parser.state = S.OPEN_TAG\n parser.tagName = c\n } else if (c === \"/\") {\n parser.state = S.CLOSE_TAG\n parser.tagName = \"\"\n } else if (c === \"?\") {\n parser.state = S.PROC_INST\n parser.procInstName = parser.procInstBody = \"\"\n } else {\n strictFail(parser, \"Unencoded <\")\n // if there was some whitespace, then add that in.\n if (parser.startTagPosition + 1 < parser.position) {\n var pad = parser.position - parser.startTagPosition\n c = new Array(pad).join(\" \") + c\n }\n parser.textNode += \"<\" + c\n parser.state = S.TEXT\n }\n continue\n\n case S.SGML_DECL:\n if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {\n emitNode(parser, \"onopencdata\")\n parser.state = S.CDATA\n parser.sgmlDecl = \"\"\n parser.cdata = \"\"\n } else if (parser.sgmlDecl+c === \"--\") {\n parser.state = S.COMMENT\n parser.comment = \"\"\n parser.sgmlDecl = \"\"\n } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {\n parser.state = S.DOCTYPE\n if (parser.doctype || parser.sawRoot) strictFail(parser,\n \"Inappropriately located doctype declaration\")\n parser.doctype = \"\"\n parser.sgmlDecl = \"\"\n } else if (c === \">\") {\n emitNode(parser, \"onsgmldeclaration\", parser.sgmlDecl)\n parser.sgmlDecl = \"\"\n parser.state = S.TEXT\n } else if (is(quote, c)) {\n parser.state = S.SGML_DECL_QUOTED\n parser.sgmlDecl += c\n } else parser.sgmlDecl += c\n continue\n\n case S.SGML_DECL_QUOTED:\n if (c === parser.q) {\n parser.state = S.SGML_DECL\n parser.q = \"\"\n }\n parser.sgmlDecl += c\n continue\n\n case S.DOCTYPE:\n if (c === \">\") {\n parser.state = S.TEXT\n emitNode(parser, \"ondoctype\", parser.doctype)\n parser.doctype = true // just remember that we saw it.\n } else {\n parser.doctype += c\n if (c === \"[\") parser.state = S.DOCTYPE_DTD\n else if (is(quote, c)) {\n parser.state = S.DOCTYPE_QUOTED\n parser.q = c\n }\n }\n continue\n\n case S.DOCTYPE_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.q = \"\"\n parser.state = S.DOCTYPE\n }\n continue\n\n case S.DOCTYPE_DTD:\n parser.doctype += c\n if (c === \"]\") parser.state = S.DOCTYPE\n else if (is(quote,c)) {\n parser.state = S.DOCTYPE_DTD_QUOTED\n parser.q = c\n }\n continue\n\n case S.DOCTYPE_DTD_QUOTED:\n parser.doctype += c\n if (c === parser.q) {\n parser.state = S.DOCTYPE_DTD\n parser.q = \"\"\n }\n continue\n\n case S.COMMENT:\n if (c === \"-\") parser.state = S.COMMENT_ENDING\n else parser.comment += c\n continue\n\n case S.COMMENT_ENDING:\n if (c === \"-\") {\n parser.state = S.COMMENT_ENDED\n parser.comment = textopts(parser.opt, parser.comment)\n if (parser.comment) emitNode(parser, \"oncomment\", parser.comment)\n parser.comment = \"\"\n } else {\n parser.comment += \"-\" + c\n parser.state = S.COMMENT\n }\n continue\n\n case S.COMMENT_ENDED:\n if (c !== \">\") {\n strictFail(parser, \"Malformed comment\")\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n parser.comment += \"--\" + c\n parser.state = S.COMMENT\n } else parser.state = S.TEXT\n continue\n\n case S.CDATA:\n if (c === \"]\") parser.state = S.CDATA_ENDING\n else parser.cdata += c\n continue\n\n case S.CDATA_ENDING:\n if (c === \"]\") parser.state = S.CDATA_ENDING_2\n else {\n parser.cdata += \"]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.CDATA_ENDING_2:\n if (c === \">\") {\n if (parser.cdata) emitNode(parser, \"oncdata\", parser.cdata)\n emitNode(parser, \"onclosecdata\")\n parser.cdata = \"\"\n parser.state = S.TEXT\n } else if (c === \"]\") {\n parser.cdata += \"]\"\n } else {\n parser.cdata += \"]]\" + c\n parser.state = S.CDATA\n }\n continue\n\n case S.PROC_INST:\n if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY\n else parser.procInstName += c\n continue\n\n case S.PROC_INST_BODY:\n if (!parser.procInstBody && is(whitespace, c)) continue\n else if (c === \"?\") parser.state = S.PROC_INST_ENDING\n else parser.procInstBody += c\n continue\n\n case S.PROC_INST_ENDING:\n if (c === \">\") {\n emitNode(parser, \"onprocessinginstruction\", {\n name : parser.procInstName,\n body : parser.procInstBody\n })\n parser.procInstName = parser.procInstBody = \"\"\n parser.state = S.TEXT\n } else {\n parser.procInstBody += \"?\" + c\n parser.state = S.PROC_INST_BODY\n }\n continue\n\n case S.OPEN_TAG:\n if (is(nameBody, c)) parser.tagName += c\n else {\n newTag(parser)\n if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else {\n if (not(whitespace, c)) strictFail(\n parser, \"Invalid character in tag name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.OPEN_TAG_SLASH:\n if (c === \">\") {\n openTag(parser, true)\n closeTag(parser)\n } else {\n strictFail(parser, \"Forward-slash in opening tag not followed by >\")\n parser.state = S.ATTRIB\n }\n continue\n\n case S.ATTRIB:\n // haven't read the attribute name yet.\n if (is(whitespace, c)) continue\n else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (c === \">\") {\n strictFail(parser, \"Attribute without value\")\n parser.attribValue = parser.attribName\n attrib(parser)\n openTag(parser)\n }\n else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE\n else if (is(nameBody, c)) parser.attribName += c\n else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_NAME_SAW_WHITE:\n if (c === \"=\") parser.state = S.ATTRIB_VALUE\n else if (is(whitespace, c)) continue\n else {\n strictFail(parser, \"Attribute without value\")\n parser.tag.attributes[parser.attribName] = \"\"\n parser.attribValue = \"\"\n emitNode(parser, \"onattribute\",\n { name : parser.attribName, value : \"\" })\n parser.attribName = \"\"\n if (c === \">\") openTag(parser)\n else if (is(nameStart, c)) {\n parser.attribName = c\n parser.state = S.ATTRIB_NAME\n } else {\n strictFail(parser, \"Invalid attribute name\")\n parser.state = S.ATTRIB\n }\n }\n continue\n\n case S.ATTRIB_VALUE:\n if (is(whitespace, c)) continue\n else if (is(quote, c)) {\n parser.q = c\n parser.state = S.ATTRIB_VALUE_QUOTED\n } else {\n strictFail(parser, \"Unquoted attribute value\")\n parser.state = S.ATTRIB_VALUE_UNQUOTED\n parser.attribValue = c\n }\n continue\n\n case S.ATTRIB_VALUE_QUOTED:\n if (c !== parser.q) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_Q\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n parser.q = \"\"\n parser.state = S.ATTRIB_VALUE_CLOSED\n continue\n\n case S.ATTRIB_VALUE_CLOSED:\n if (is(whitespace, c)) {\n parser.state = S.ATTRIB\n } else if (c === \">\") openTag(parser)\n else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n else if (is(nameStart, c)) {\n strictFail(parser, \"No whitespace between attributes\")\n parser.attribName = c\n parser.attribValue = \"\"\n parser.state = S.ATTRIB_NAME\n } else strictFail(parser, \"Invalid attribute name\")\n continue\n\n case S.ATTRIB_VALUE_UNQUOTED:\n if (not(attribEnd,c)) {\n if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_U\n else parser.attribValue += c\n continue\n }\n attrib(parser)\n if (c === \">\") openTag(parser)\n else parser.state = S.ATTRIB\n continue\n\n case S.CLOSE_TAG:\n if (!parser.tagName) {\n if (is(whitespace, c)) continue\n else if (not(nameStart, c)) {\n if (parser.script) {\n parser.script += \"</\" + c\n parser.state = S.SCRIPT\n } else {\n strictFail(parser, \"Invalid tagname in closing tag.\")\n }\n } else parser.tagName = c\n }\n else if (c === \">\") closeTag(parser)\n else if (is(nameBody, c)) parser.tagName += c\n else if (parser.script) {\n parser.script += \"</\" + parser.tagName\n parser.tagName = \"\"\n parser.state = S.SCRIPT\n } else {\n if (not(whitespace, c)) strictFail(parser,\n \"Invalid tagname in closing tag\")\n parser.state = S.CLOSE_TAG_SAW_WHITE\n }\n continue\n\n case S.CLOSE_TAG_SAW_WHITE:\n if (is(whitespace, c)) continue\n if (c === \">\") closeTag(parser)\n else strictFail(parser, \"Invalid characters in closing tag\")\n continue\n\n case S.TEXT_ENTITY:\n case S.ATTRIB_VALUE_ENTITY_Q:\n case S.ATTRIB_VALUE_ENTITY_U:\n switch(parser.state) {\n case S.TEXT_ENTITY:\n var returnState = S.TEXT, buffer = \"textNode\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_Q:\n var returnState = S.ATTRIB_VALUE_QUOTED, buffer = \"attribValue\"\n break\n\n case S.ATTRIB_VALUE_ENTITY_U:\n var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = \"attribValue\"\n break\n }\n if (c === \";\") {\n parser[buffer] += parseEntity(parser)\n parser.entity = \"\"\n parser.state = returnState\n }\n else if (is(entity, c)) parser.entity += c\n else {\n strictFail(parser, \"Invalid character entity\")\n parser[buffer] += \"&\" + parser.entity + c\n parser.entity = \"\"\n parser.state = returnState\n }\n continue\n\n default:\n throw new Error(parser, \"Unknown state: \" + parser.state)\n }\n } // while\n // cdata blocks can get very big under normal conditions. emit and move on.\n // if (parser.state === S.CDATA && parser.cdata) {\n // emitNode(parser, \"oncdata\", parser.cdata)\n // parser.cdata = \"\"\n // }\n if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)\n return parser\n}\n\n/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n (function() {\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n if (Object.defineProperty) {\n Object.defineProperty(String, 'fromCodePoint', {\n 'value': fromCodePoint,\n 'configurable': true,\n 'writable': true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n }());\n}\n\n})(typeof exports === \"undefined\" ? sax = {} : exports);\n","/**\n * Tiny stack for browser or server\n *\n * @author Jason Mulligan <jason.mulligan@avoidwork.com>\n * @copyright 2014 Jason Mulligan\n * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>\n * @link http://avoidwork.github.io/tiny-stack\n * @module tiny-stack\n * @version 0.1.0\n */\n\n( function ( global ) {\n\n\"use strict\";\n\n/**\n * TinyStack\n *\n * @constructor\n */\nfunction TinyStack () {\n\tthis.data = [null];\n\tthis.top = 0;\n}\n\n/**\n * Clears the stack\n *\n * @method clear\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.clear = function clear () {\n\tthis.data = [null];\n\tthis.top = 0;\n\n\treturn this;\n};\n\n/**\n * Gets the size of the stack\n *\n * @method length\n * @memberOf TinyStack\n * @return {Number} Size of stack\n */\nTinyStack.prototype.length = function length () {\n\treturn this.top;\n};\n\n/**\n * Gets the item at the top of the stack\n *\n * @method peek\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.peek = function peek () {\n\treturn this.data[this.top];\n};\n\n/**\n * Gets & removes the item at the top of the stack\n *\n * @method pop\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.pop = function pop () {\n\tif ( this.top > 0 ) {\n\t\tthis.top--;\n\n\t\treturn this.data.pop();\n\t}\n\telse {\n\t\treturn undefined;\n\t}\n};\n\n/**\n * Pushes an item onto the stack\n *\n * @method push\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.push = function push ( arg ) {\n\tthis.data[++this.top] = arg;\n\n\treturn this;\n};\n\n/**\n * TinyStack factory\n *\n * @method factory\n * @return {Object} {@link TinyStack}\n */\nfunction factory () {\n\treturn new TinyStack();\n}\n\n// Node, AMD & window supported\nif ( typeof exports != \"undefined\" ) {\n\tmodule.exports = factory;\n}\nelse if ( typeof define == \"function\" ) {\n\tdefine( function () {\n\t\treturn factory;\n\t} );\n}\nelse {\n\tglobal.stack = factory;\n}\n} )( this );\n","module.exports = require(26);","'use strict';\n\nfunction Base() { }\n\nBase.prototype.get = function(name) {\n return this.$model.properties.get(this, name);\n};\n\nBase.prototype.set = function(name, value) {\n this.$model.properties.set(this, name, value);\n};\n\n\nmodule.exports = Base;","'use strict';\n\nvar pick = require(173),\n assign = require(168),\n forEach = require(77);\n\nvar parseNameNs = require(27).parseName;\n\n\nfunction DescriptorBuilder(nameNs) {\n this.ns = nameNs;\n this.name = nameNs.name;\n this.allTypes = [];\n this.properties = [];\n this.propertiesByName = {};\n}\n\nmodule.exports = DescriptorBuilder;\n\n\nDescriptorBuilder.prototype.build = function() {\n return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);\n};\n\nDescriptorBuilder.prototype.addProperty = function(p, idx) {\n this.addNamedProperty(p, true);\n\n var properties = this.properties;\n\n if (idx !== undefined) {\n properties.splice(idx, 0, p);\n } else {\n properties.push(p);\n }\n};\n\n\nDescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {\n var oldNameNs = oldProperty.ns;\n\n var props = this.properties,\n propertiesByName = this.propertiesByName,\n rename = oldProperty.name !== newProperty.name;\n\n if (oldProperty.isBody) {\n\n if (!newProperty.isBody) {\n throw new Error(\n 'property <' + newProperty.ns.name + '> must be body property ' +\n 'to refine <' + oldProperty.ns.name + '>');\n }\n\n // TODO: Check compatibility\n this.setBodyProperty(newProperty, false);\n }\n\n // replacing the named property is intentional\n // thus, validate only if this is a \"rename\" operation\n this.addNamedProperty(newProperty, rename);\n\n // replace old property at index with new one\n var idx = props.indexOf(oldProperty);\n if (idx === -1) {\n throw new Error('property <' + oldNameNs.name + '> not found in property list');\n }\n\n props[idx] = newProperty;\n\n // replace propertiesByName entry with new property\n propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;\n};\n\n\nDescriptorBuilder.prototype.redefineProperty = function(p) {\n\n var nsPrefix = p.ns.prefix;\n var parts = p.redefines.split('#');\n\n var name = parseNameNs(parts[0], nsPrefix);\n var attrName = parseNameNs(parts[1], name.prefix).name;\n\n var redefinedProperty = this.propertiesByName[attrName];\n if (!redefinedProperty) {\n throw new Error('refined property <' + attrName + '> not found');\n } else {\n this.replaceProperty(redefinedProperty, p);\n }\n\n delete p.redefines;\n};\n\nDescriptorBuilder.prototype.addNamedProperty = function(p, validate) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n if (validate) {\n this.assertNotDefined(p, ns.name);\n this.assertNotDefined(p, ns.localName);\n }\n\n propsByName[ns.name] = propsByName[ns.localName] = p;\n};\n\nDescriptorBuilder.prototype.removeNamedProperty = function(p) {\n var ns = p.ns,\n propsByName = this.propertiesByName;\n\n delete propsByName[ns.name];\n delete propsByName[ns.localName];\n};\n\nDescriptorBuilder.prototype.setBodyProperty = function(p, validate) {\n\n if (validate && this.bodyProperty) {\n throw new Error(\n 'body property defined multiple times ' +\n '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');\n }\n\n this.bodyProperty = p;\n};\n\nDescriptorBuilder.prototype.addIdProperty = function(name) {\n var nameNs = parseNameNs(name, this.ns.prefix);\n\n var p = {\n name: nameNs.localName,\n type: 'String',\n isAttr: true,\n ns: nameNs\n };\n\n // ensure that id is always the first attribute (if present)\n this.addProperty(p, 0);\n};\n\nDescriptorBuilder.prototype.assertNotDefined = function(p, name) {\n var propertyName = p.name,\n definedProperty = this.propertiesByName[propertyName];\n\n if (definedProperty) {\n throw new Error(\n 'property <' + propertyName + '> already defined; ' +\n 'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +\n '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');\n }\n};\n\nDescriptorBuilder.prototype.hasProperty = function(name) {\n return this.propertiesByName[name];\n};\n\nDescriptorBuilder.prototype.addTrait = function(t) {\n\n var allTypes = this.allTypes;\n\n if (allTypes.indexOf(t) !== -1) {\n return;\n }\n\n forEach(t.properties, function(p) {\n\n // clone property to allow extensions\n p = assign({}, p, {\n name: p.ns.localName\n });\n\n Object.defineProperty(p, 'definedBy', {\n value: t\n });\n\n // add redefine support\n if (p.redefines) {\n this.redefineProperty(p);\n } else {\n if (p.isBody) {\n this.setBodyProperty(p);\n }\n this.addProperty(p);\n }\n }, this);\n\n allTypes.push(t);\n};\n","'use strict';\n\nvar forEach = require(77);\n\nvar Base = require(23);\n\n\nfunction Factory(model, properties) {\n this.model = model;\n this.properties = properties;\n}\n\nmodule.exports = Factory;\n\n\nFactory.prototype.createType = function(descriptor) {\n\n var model = this.model;\n\n var props = this.properties,\n prototype = Object.create(Base.prototype);\n\n // initialize default values\n forEach(descriptor.properties, function(p) {\n if (!p.isMany && p.default !== undefined) {\n prototype[p.name] = p.default;\n }\n });\n\n props.defineModel(prototype, model);\n props.defineDescriptor(prototype, descriptor);\n\n var name = descriptor.ns.name;\n\n /**\n * The new type constructor\n */\n function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n\n forEach(attrs, function(val, key) {\n this.set(key, val);\n }, this);\n }\n\n ModdleElement.prototype = prototype;\n\n ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;\n\n // static links\n props.defineModel(ModdleElement, model);\n props.defineDescriptor(ModdleElement, descriptor);\n\n return ModdleElement;\n};","'use strict';\n\nvar isString = require(165),\n isObject = require(163),\n forEach = require(77),\n find = require(76);\n\n\nvar Factory = require(25),\n Registry = require(29),\n Properties = require(28);\n\nvar parseNameNs = require(27).parseName;\n\n\n//// Moddle implementation /////////////////////////////////////////////////\n\n/**\n * @class Moddle\n *\n * A model that can be used to create elements of a specific type.\n *\n * @example\n *\n * var Moddle = require('moddle');\n *\n * var pkg = {\n * name: 'mypackage',\n * prefix: 'my',\n * types: [\n * { name: 'Root' }\n * ]\n * };\n *\n * var moddle = new Moddle([pkg]);\n *\n * @param {Array<Package>} packages the packages to contain\n * @param {Object} options additional options to pass to the model\n */\nfunction Moddle(packages, options) {\n\n options = options || {};\n\n this.properties = new Properties(this);\n\n this.factory = new Factory(this, this.properties);\n this.registry = new Registry(packages, this.properties, options);\n\n this.typeCache = {};\n}\n\nmodule.exports = Moddle;\n\n\n/**\n * Create an instance of the specified type.\n *\n * @method Moddle#create\n *\n * @example\n *\n * var foo = moddle.create('my:Foo');\n * var bar = moddle.create('my:Bar', { id: 'BAR_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @param {Object} attrs a number of attributes to initialize the model instance with\n * @return {Object} model instance\n */\nModdle.prototype.create = function(descriptor, attrs) {\n var Type = this.getType(descriptor);\n\n if (!Type) {\n throw new Error('unknown type <' + descriptor + '>');\n }\n\n return new Type(attrs);\n};\n\n\n/**\n * Returns the type representing a given descriptor\n *\n * @method Moddle#getType\n *\n * @example\n *\n * var Foo = moddle.getType('my:Foo');\n * var foo = new Foo({ 'id' : 'FOO_1' });\n *\n * @param {String|Object} descriptor the type descriptor or name know to the model\n * @return {Object} the type representing the descriptor\n */\nModdle.prototype.getType = function(descriptor) {\n\n var cache = this.typeCache;\n\n var name = isString(descriptor) ? descriptor : descriptor.ns.name;\n\n var type = cache[name];\n\n if (!type) {\n descriptor = this.registry.getEffectiveDescriptor(name);\n type = cache[name] = this.factory.createType(descriptor);\n }\n\n return type;\n};\n\n\n/**\n * Creates an any-element type to be used within model instances.\n *\n * This can be used to create custom elements that lie outside the meta-model.\n * The created element contains all the meta-data required to serialize it\n * as part of meta-model elements.\n *\n * @method Moddle#createAny\n *\n * @example\n *\n * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {\n * value: 'bar'\n * });\n *\n * var container = moddle.create('my:Container', 'http://my', {\n * any: [ foo ]\n * });\n *\n * // go ahead and serialize the stuff\n *\n *\n * @param {String} name the name of the element\n * @param {String} nsUri the namespace uri of the element\n * @param {Object} [properties] a map of properties to initialize the instance with\n * @return {Object} the any type instance\n */\nModdle.prototype.createAny = function(name, nsUri, properties) {\n\n var nameNs = parseNameNs(name);\n\n var element = {\n $type: name\n };\n\n var descriptor = {\n name: name,\n isGeneric: true,\n ns: {\n prefix: nameNs.prefix,\n localName: nameNs.localName,\n uri: nsUri\n }\n };\n\n this.properties.defineDescriptor(element, descriptor);\n this.properties.defineModel(element, this);\n this.properties.define(element, '$parent', { enumerable: false, writable: true });\n\n forEach(properties, function(a, key) {\n if (isObject(a) && a.value !== undefined) {\n element[a.name] = a.value;\n } else {\n element[key] = a;\n }\n });\n\n return element;\n};\n\n/**\n * Returns a registered package by uri or prefix\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackage = function(uriOrPrefix) {\n return this.registry.getPackage(uriOrPrefix);\n};\n\n/**\n * Returns a snapshot of all known packages\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackages = function() {\n return this.registry.getPackages();\n};\n\n/**\n * Returns the descriptor for an element\n */\nModdle.prototype.getElementDescriptor = function(element) {\n return element.$descriptor;\n};\n\n/**\n * Returns true if the given descriptor or instance\n * represents the given type.\n *\n * May be applied to this, if element is omitted.\n */\nModdle.prototype.hasType = function(element, type) {\n if (type === undefined) {\n type = element;\n element = this;\n }\n\n var descriptor = element.$model.getElementDescriptor(element);\n\n return !!find(descriptor.allTypes, function(t) {\n return t.name === type;\n });\n};\n\n\n/**\n * Returns the descriptor of an elements named property\n */\nModdle.prototype.getPropertyDescriptor = function(element, property) {\n return this.getElementDescriptor(element).propertiesByName[property];\n};\n","'use strict';\n\n/**\n * Parses a namespaced attribute name of the form (ns:)localName to an object,\n * given a default prefix to assume in case no explicit namespace is given.\n *\n * @param {String} name\n * @param {String} [defaultPrefix] the default prefix to take, if none is present.\n *\n * @return {Object} the parsed name\n */\nmodule.exports.parseName = function(name, defaultPrefix) {\n var parts = name.split(/:/),\n localName, prefix;\n\n // no prefix (i.e. only local name)\n if (parts.length === 1) {\n localName = name;\n prefix = defaultPrefix;\n } else\n // prefix + local name\n if (parts.length === 2) {\n localName = parts[1];\n prefix = parts[0];\n } else {\n throw new Error('expected <prefix:localName> or <localName>, got ' + name);\n }\n\n name = (prefix ? prefix + ':' : '') + localName;\n\n return {\n name: name,\n prefix: prefix,\n localName: localName\n };\n};","'use strict';\n\n\n/**\n * A utility that gets and sets properties of model elements.\n *\n * @param {Model} model\n */\nfunction Properties(model) {\n this.model = model;\n}\n\nmodule.exports = Properties;\n\n\n/**\n * Sets a named property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} value\n */\nProperties.prototype.set = function(target, name, value) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n target.$attrs[name] = value;\n } else {\n Object.defineProperty(target, property.name, {\n enumerable: !property.isReference,\n writable: true,\n value: value\n });\n }\n};\n\n/**\n * Returns the named property of the given element\n *\n * @param {Object} target\n * @param {String} name\n *\n * @return {Object}\n */\nProperties.prototype.get = function(target, name) {\n\n var property = this.model.getPropertyDescriptor(target, name);\n\n if (!property) {\n return target.$attrs[name];\n }\n\n var propertyName = property.name;\n\n // check if access to collection property and lazily initialize it\n if (!target[propertyName] && property.isMany) {\n Object.defineProperty(target, propertyName, {\n enumerable: !property.isReference,\n writable: true,\n value: []\n });\n }\n\n return target[propertyName];\n};\n\n\n/**\n * Define a property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} options\n */\nProperties.prototype.define = function(target, name, options) {\n Object.defineProperty(target, name, options);\n};\n\n\n/**\n * Define the descriptor for an element\n */\nProperties.prototype.defineDescriptor = function(target, descriptor) {\n this.define(target, '$descriptor', { value: descriptor });\n};\n\n/**\n * Define the model for an element\n */\nProperties.prototype.defineModel = function(target, model) {\n this.define(target, '$model', { value: model });\n};","'use strict';\n\nvar assign = require(168),\n forEach = require(77);\n\nvar Types = require(30),\n DescriptorBuilder = require(24);\n\nvar parseNameNs = require(27).parseName,\n isBuiltInType = Types.isBuiltIn;\n\n\nfunction Registry(packages, properties, options) {\n this.options = assign({ generateId: 'id' }, options || {});\n\n this.packageMap = {};\n this.typeMap = {};\n\n this.packages = [];\n\n this.properties = properties;\n\n forEach(packages, this.registerPackage, this);\n}\n\nmodule.exports = Registry;\n\n\nRegistry.prototype.getPackage = function(uriOrPrefix) {\n return this.packageMap[uriOrPrefix];\n};\n\nRegistry.prototype.getPackages = function() {\n return this.packages;\n};\n\n\nRegistry.prototype.registerPackage = function(pkg) {\n\n // copy package\n pkg = assign({}, pkg);\n\n // register types\n forEach(pkg.types, function(descriptor) {\n this.registerType(descriptor, pkg);\n }, this);\n\n this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;\n this.packages.push(pkg);\n};\n\n\n/**\n * Register a type from a specific package with us\n */\nRegistry.prototype.registerType = function(type, pkg) {\n\n type = assign({}, type, {\n superClass: (type.superClass || []).slice(),\n extends: (type.extends || []).slice(),\n properties: (type.properties || []).slice()\n });\n\n var ns = parseNameNs(type.name, pkg.prefix),\n name = ns.name,\n propertiesByName = {};\n\n // parse properties\n forEach(type.properties, function(p) {\n\n // namespace property names\n var propertyNs = parseNameNs(p.name, ns.prefix),\n propertyName = propertyNs.name;\n\n // namespace property types\n if (!isBuiltInType(p.type)) {\n p.type = parseNameNs(p.type, propertyNs.prefix).name;\n }\n\n assign(p, {\n ns: propertyNs,\n name: propertyName\n });\n\n propertiesByName[propertyName] = p;\n });\n\n // update ns + name\n assign(type, {\n ns: ns,\n name: name,\n propertiesByName: propertiesByName\n });\n\n forEach(type.extends, function(extendsName) {\n var extended = this.typeMap[extendsName];\n\n extended.traits = extended.traits || [];\n extended.traits.push(name);\n }, this);\n\n // link to package\n this.definePackage(type, pkg);\n\n // register\n this.typeMap[name] = type;\n};\n\n\n/**\n * Traverse the type hierarchy from bottom to top.\n */\nRegistry.prototype.mapTypes = function(nsName, iterator) {\n\n var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];\n\n var self = this;\n\n /**\n * Traverse the selected super type or trait\n *\n * @param {String} cls\n */\n function traverseSuper(cls) {\n var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);\n self.mapTypes(parentNs, iterator);\n }\n\n if (!type) {\n throw new Error('unknown type <' + nsName.name + '>');\n }\n\n forEach(type.superClass, traverseSuper);\n\n iterator(type);\n\n forEach(type.traits, traverseSuper);\n};\n\n\n/**\n * Returns the effective descriptor for a type.\n *\n * @param {String} type the namespaced name (ns:localName) of the type\n *\n * @return {Descriptor} the resulting effective descriptor\n */\nRegistry.prototype.getEffectiveDescriptor = function(name) {\n\n var nsName = parseNameNs(name);\n\n var builder = new DescriptorBuilder(nsName);\n\n this.mapTypes(nsName, function(type) {\n builder.addTrait(type);\n });\n\n // check we have an id assigned\n var id = this.options.generateId;\n if (id && !builder.hasProperty(id)) {\n builder.addIdProperty(id);\n }\n\n var descriptor = builder.build();\n\n // define package link\n this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);\n\n return descriptor;\n};\n\n\nRegistry.prototype.definePackage = function(target, pkg) {\n this.properties.define(target, '$pkg', { value: pkg });\n};","'use strict';\n\n/**\n * Built-in moddle types\n */\nvar BUILTINS = {\n String: true,\n Boolean: true,\n Integer: true,\n Real: true,\n Element: true\n};\n\n/**\n * Converters for built in types from string representations\n */\nvar TYPE_CONVERTERS = {\n String: function(s) { return s; },\n Boolean: function(s) { return s === 'true'; },\n Integer: function(s) { return parseInt(s, 10); },\n Real: function(s) { return parseFloat(s, 10); }\n};\n\n/**\n * Convert a type to its real representation\n */\nmodule.exports.coerceType = function(type, value) {\n\n var converter = TYPE_CONVERTERS[type];\n\n if (converter) {\n return converter(value);\n } else {\n return value;\n }\n};\n\n/**\n * Return whether the given type is built-in\n */\nmodule.exports.isBuiltIn = function(type) {\n return !!BUILTINS[type];\n};\n\n/**\n * Return whether the given type is simple\n */\nmodule.exports.isSimple = function(type) {\n return !!TYPE_CONVERTERS[type];\n};","module.exports={\n \"name\": \"BPMN20\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/MODEL\",\n \"associations\": [],\n \"types\": [\n {\n \"name\": \"Interface\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operations\",\n \"type\": \"Operation\",\n \"isMany\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Operation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outMessageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"errorRefs\",\n \"type\": \"Error\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"implementationRef\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EndPoint\",\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"Auditing\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"GlobalTask\",\n \"superClass\": [\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Monitoring\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Performer\",\n \"superClass\": [\n \"ResourceRole\"\n ]\n },\n {\n \"name\": \"Process\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"CallableElement\"\n ],\n \"properties\": [\n {\n \"name\": \"processType\",\n \"type\": \"ProcessType\",\n \"isAttr\": true\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"supports\",\n \"type\": \"Process\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"definitionalCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"isExecutable\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationSubscriptions\",\n \"type\": \"CorrelationSubscription\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LaneSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Lane\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"childLaneSet\",\n \"type\": \"LaneSet\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"partitionElementRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"flowNodeRef\",\n \"type\": \"FlowNode\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"partitionElement\",\n \"type\": \"BaseElement\"\n }\n ]\n },\n {\n \"name\": \"GlobalManualTask\",\n \"superClass\": [\n \"GlobalTask\"\n ]\n },\n {\n \"name\": \"ManualTask\",\n \"superClass\": [\n \"Task\"\n ]\n },\n {\n \"name\": \"UserTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n },\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Rendering\",\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"HumanPerformer\",\n \"superClass\": [\n \"Performer\"\n ]\n },\n {\n \"name\": \"PotentialOwner\",\n \"superClass\": [\n \"HumanPerformer\"\n ]\n },\n {\n \"name\": \"GlobalUserTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"renderings\",\n \"type\": \"Rendering\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Gateway\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"gatewayDirection\",\n \"type\": \"GatewayDirection\",\n \"default\": \"Unspecified\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"EventBasedGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"eventGatewayType\",\n \"type\": \"EventBasedGatewayType\",\n \"isAttr\": true,\n \"default\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"ComplexGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"activationCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InclusiveGateway\",\n \"superClass\": [\n \"Gateway\"\n ],\n \"properties\": [\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParallelGateway\",\n \"superClass\": [\n \"Gateway\"\n ]\n },\n {\n \"name\": \"RootElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"Relationship\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"direction\",\n \"type\": \"RelationshipDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"source\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"target\",\n \"isMany\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n }\n ]\n },\n {\n \"name\": \"BaseElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"id\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"type\": \"Documentation\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionDefinitions\",\n \"type\": \"ExtensionDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"extensionElements\",\n \"type\": \"ExtensionElements\"\n }\n ]\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"mustUnderstand\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"definition\",\n \"type\": \"ExtensionDefinition\"\n }\n ]\n },\n {\n \"name\": \"ExtensionDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"extensionAttributeDefinitions\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionAttributeDefinition\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isReference\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"extensionDefinition\",\n \"type\": \"ExtensionDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ExtensionElements\",\n \"properties\": [\n {\n \"name\": \"valueRef\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n },\n {\n \"name\": \"extensionAttributeDefinition\",\n \"type\": \"ExtensionAttributeDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Documentation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Event\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"IntermediateCatchEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ]\n },\n {\n \"name\": \"IntermediateThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"EndEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"StartEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"isInterrupting\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"ThrowEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSet\",\n \"type\": \"InputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociation\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CatchEvent\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Event\"\n ],\n \"properties\": [\n {\n \"name\": \"parallelMultiple\",\n \"isAttr\": true,\n \"type\": \"Boolean\",\n \"default\": false\n },\n {\n \"name\": \"outputSet\",\n \"type\": \"OutputSet\"\n },\n {\n \"name\": \"eventDefinitionRefs\",\n \"type\": \"EventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataOutputAssociation\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n },\n {\n \"name\": \"eventDefinitions\",\n \"type\": \"EventDefinition\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"BoundaryEvent\",\n \"superClass\": [\n \"CatchEvent\"\n ],\n \"properties\": [\n {\n \"name\": \"cancelActivity\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"attachedToRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"EventDefinition\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CancelEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"ErrorEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"errorRef\",\n \"type\": \"Error\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TerminateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ]\n },\n {\n \"name\": \"EscalationEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"escalationRef\",\n \"type\": \"Escalation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Escalation\",\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"escalationCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ],\n \"superClass\": [\n \"RootElement\"\n ]\n },\n {\n \"name\": \"CompensateEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"waitForCompletion\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"activityRef\",\n \"type\": \"Activity\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TimerEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"timeDate\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeCycle\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"timeDuration\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"LinkEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"target\",\n \"type\": \"LinkEventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"source\",\n \"type\": \"LinkEventDefinition\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConditionalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"SignalEventDefinition\",\n \"superClass\": [\n \"EventDefinition\"\n ],\n \"properties\": [\n {\n \"name\": \"signalRef\",\n \"type\": \"Signal\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Signal\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ImplicitThrowEvent\",\n \"superClass\": [\n \"ThrowEvent\"\n ]\n },\n {\n \"name\": \"DataState\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ItemAwareElement\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemSubjectRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataState\",\n \"type\": \"DataState\"\n }\n ]\n },\n {\n \"name\": \"DataAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"transformation\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"assignment\",\n \"type\": \"Assignment\",\n \"isMany\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"ItemAwareElement\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"ItemAwareElement\",\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataInput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithOptional\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputSetWithWhileExecuting\",\n \"type\": \"InputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataOutput\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithOptional\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetWithWhileExecuting\",\n \"type\": \"OutputSet\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"dataInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingInputRefs\",\n \"type\": \"DataInput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputSetRefs\",\n \"type\": \"OutputSet\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"OutputSet\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"inputSetRefs\",\n \"type\": \"InputSet\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"optionalOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"whileExecutingOutputRefs\",\n \"type\": \"DataOutput\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Property\",\n \"superClass\": [\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"DataInputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"DataOutputAssociation\",\n \"superClass\": [\n \"DataAssociation\"\n ]\n },\n {\n \"name\": \"InputOutputSpecification\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"inputSets\",\n \"type\": \"InputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"outputSets\",\n \"type\": \"OutputSet\",\n \"isMany\": true\n },\n {\n \"name\": \"dataInputs\",\n \"type\": \"DataInput\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputs\",\n \"type\": \"DataOutput\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"DataObject\",\n \"superClass\": [\n \"FlowElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"InputOutputBinding\",\n \"properties\": [\n {\n \"name\": \"inputDataRef\",\n \"type\": \"InputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outputDataRef\",\n \"type\": \"OutputSet\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Assignment\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"from\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"to\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"DataStore\",\n \"superClass\": [\n \"RootElement\",\n \"ItemAwareElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"capacity\",\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"isUnlimited\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"DataStoreReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataStoreRef\",\n \"type\": \"DataStore\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"DataObjectReference\",\n \"superClass\": [\n \"ItemAwareElement\",\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataObjectRef\",\n \"type\": \"DataObject\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ConversationLink\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ConversationAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerConversationNodeRef\",\n \"type\": \"ConversationNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CallConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"calledCollaborationRef\",\n \"type\": \"Collaboration\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Conversation\",\n \"superClass\": [\n \"ConversationNode\"\n ]\n },\n {\n \"name\": \"SubConversation\",\n \"superClass\": [\n \"ConversationNode\"\n ],\n \"properties\": [\n {\n \"name\": \"conversationNodes\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ConversationNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageFlowRefs\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"GlobalConversation\",\n \"superClass\": [\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"PartnerEntity\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"PartnerRole\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"participantRef\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationProperty\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRetrievalExpression\",\n \"type\": \"CorrelationPropertyRetrievalExpression\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Error\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"structureRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"errorCode\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"CorrelationKey\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Expression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"isAbstract\": true\n },\n {\n \"name\": \"FormalExpression\",\n \"superClass\": [\n \"Expression\"\n ],\n \"properties\": [\n {\n \"name\": \"language\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"body\",\n \"type\": \"String\",\n \"isBody\": true\n },\n {\n \"name\": \"evaluatesToTypeRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Message\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"itemRef\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ItemDefinition\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"itemKind\",\n \"type\": \"ItemKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"structureRef\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"isCollection\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"import\",\n \"type\": \"Import\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"auditing\",\n \"type\": \"Auditing\"\n },\n {\n \"name\": \"monitoring\",\n \"type\": \"Monitoring\"\n },\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SequenceFlow\",\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"isImmediate\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"conditionExpression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"FlowNode\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"FlowElementsContainer\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"laneSets\",\n \"type\": \"LaneSet\",\n \"isMany\": true\n },\n {\n \"name\": \"flowElements\",\n \"type\": \"FlowElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"CallableElement\",\n \"isAbstract\": true,\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"supportedInterfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ioBinding\",\n \"type\": \"InputOutputBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"FlowNode\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowElement\"\n ],\n \"properties\": [\n {\n \"name\": \"incoming\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoing\",\n \"type\": \"SequenceFlow\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"lanes\",\n \"type\": \"Lane\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyRetrievalExpression\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"messagePath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationPropertyBinding\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"dataPath\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"correlationPropertyRef\",\n \"type\": \"CorrelationProperty\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Resource\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resourceParameters\",\n \"type\": \"ResourceParameter\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ResourceParameter\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isRequired\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"type\",\n \"type\": \"ItemDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"CorrelationSubscription\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"correlationKeyRef\",\n \"type\": \"CorrelationKey\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationPropertyBinding\",\n \"type\": \"CorrelationPropertyBinding\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlow\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"InteractionNode\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"MessageFlowAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerMessageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"InteractionNode\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"incomingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outgoingConversationLinks\",\n \"type\": \"ConversationLink\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Participant\",\n \"superClass\": [\n \"InteractionNode\",\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"interfaceRefs\",\n \"type\": \"Interface\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantMultiplicity\",\n \"type\": \"ParticipantMultiplicity\"\n },\n {\n \"name\": \"endPointRefs\",\n \"type\": \"EndPoint\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"processRef\",\n \"type\": \"Process\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantAssociation\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"innerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"outerParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ParticipantMultiplicity\",\n \"properties\": [\n {\n \"name\": \"minimum\",\n \"default\": 0,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"maximum\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"Collaboration\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"isClosed\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"choreographyRef\",\n \"type\": \"Choreography\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlowAssociations\",\n \"type\": \"MessageFlowAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationAssociations\",\n \"type\": \"ConversationAssociation\"\n },\n {\n \"name\": \"participants\",\n \"type\": \"Participant\",\n \"isMany\": true\n },\n {\n \"name\": \"messageFlows\",\n \"type\": \"MessageFlow\",\n \"isMany\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"conversations\",\n \"type\": \"ConversationNode\",\n \"isMany\": true\n },\n {\n \"name\": \"conversationLinks\",\n \"type\": \"ConversationLink\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyActivity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"participantRefs\",\n \"type\": \"Participant\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"correlationKeys\",\n \"type\": \"CorrelationKey\",\n \"isMany\": true\n },\n {\n \"name\": \"loopType\",\n \"type\": \"ChoreographyLoopType\",\n \"default\": \"None\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"CallChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledChoreographyRef\",\n \"type\": \"Choreography\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"participantAssociations\",\n \"type\": \"ParticipantAssociation\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"SubChoreography\",\n \"superClass\": [\n \"ChoreographyActivity\",\n \"FlowElementsContainer\"\n ],\n \"properties\": [\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"ChoreographyTask\",\n \"superClass\": [\n \"ChoreographyActivity\"\n ],\n \"properties\": [\n {\n \"name\": \"messageFlowRef\",\n \"type\": \"MessageFlow\",\n \"isMany\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Choreography\",\n \"superClass\": [\n \"FlowElementsContainer\",\n \"Collaboration\"\n ]\n },\n {\n \"name\": \"GlobalChoreographyTask\",\n \"superClass\": [\n \"Choreography\"\n ],\n \"properties\": [\n {\n \"name\": \"initiatingParticipantRef\",\n \"type\": \"Participant\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"TextAnnotation\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"text\",\n \"type\": \"String\"\n },\n {\n \"name\": \"textFormat\",\n \"default\": \"text/plain\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Group\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValueRef\",\n \"type\": \"CategoryValue\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Association\",\n \"superClass\": [\n \"Artifact\"\n ],\n \"properties\": [\n {\n \"name\": \"associationDirection\",\n \"type\": \"AssociationDirection\",\n \"isAttr\": true\n },\n {\n \"name\": \"sourceRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"targetRef\",\n \"type\": \"BaseElement\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"Category\",\n \"superClass\": [\n \"RootElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categoryValue\",\n \"type\": \"CategoryValue\",\n \"isMany\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Artifact\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"CategoryValue\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"categorizedFlowElements\",\n \"type\": \"FlowElement\",\n \"isVirtual\": true,\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"value\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Activity\",\n \"isAbstract\": true,\n \"superClass\": [\n \"FlowNode\"\n ],\n \"properties\": [\n {\n \"name\": \"isForCompensation\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCharacteristics\",\n \"type\": \"LoopCharacteristics\"\n },\n {\n \"name\": \"resources\",\n \"type\": \"ResourceRole\",\n \"isMany\": true\n },\n {\n \"name\": \"default\",\n \"type\": \"SequenceFlow\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"properties\",\n \"type\": \"Property\",\n \"isMany\": true\n },\n {\n \"name\": \"ioSpecification\",\n \"type\": \"InputOutputSpecification\"\n },\n {\n \"name\": \"boundaryEventRefs\",\n \"type\": \"BoundaryEvent\",\n \"isMany\": true,\n \"isReference\": true\n },\n {\n \"name\": \"dataInputAssociations\",\n \"type\": \"DataInputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"dataOutputAssociations\",\n \"type\": \"DataOutputAssociation\",\n \"isMany\": true\n },\n {\n \"name\": \"startQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n },\n {\n \"name\": \"completionQuantity\",\n \"default\": 1,\n \"isAttr\": true,\n \"type\": \"Integer\"\n }\n ]\n },\n {\n \"name\": \"ServiceTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"SubProcess\",\n \"superClass\": [\n \"Activity\",\n \"FlowElementsContainer\",\n \"InteractionNode\"\n ],\n \"properties\": [\n {\n \"name\": \"triggeredByEvent\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"artifacts\",\n \"type\": \"Artifact\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LoopCharacteristics\",\n \"isAbstract\": true,\n \"superClass\": [\n \"BaseElement\"\n ]\n },\n {\n \"name\": \"MultiInstanceLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"isSequential\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"behavior\",\n \"type\": \"MultiInstanceBehavior\",\n \"default\": \"All\",\n \"isAttr\": true\n },\n {\n \"name\": \"loopCardinality\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopDataInputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"loopDataOutputRef\",\n \"type\": \"ItemAwareElement\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"inputDataItem\",\n \"type\": \"DataInput\"\n },\n {\n \"name\": \"outputDataItem\",\n \"type\": \"DataOutput\"\n },\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"complexBehaviorDefinition\",\n \"type\": \"ComplexBehaviorDefinition\",\n \"isMany\": true\n },\n {\n \"name\": \"oneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"noneBehaviorEventRef\",\n \"type\": \"EventDefinition\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"StandardLoopCharacteristics\",\n \"superClass\": [\n \"LoopCharacteristics\"\n ],\n \"properties\": [\n {\n \"name\": \"testBefore\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"loopCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"loopMaximum\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"CallActivity\",\n \"superClass\": [\n \"Activity\"\n ],\n \"properties\": [\n {\n \"name\": \"calledElement\",\n \"type\": \"String\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Task\",\n \"superClass\": [\n \"Activity\",\n \"InteractionNode\"\n ]\n },\n {\n \"name\": \"SendTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ReceiveTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"instantiate\",\n \"default\": false,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"operationRef\",\n \"type\": \"Operation\",\n \"isAttr\": true,\n \"isReference\": true\n },\n {\n \"name\": \"messageRef\",\n \"type\": \"Message\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ScriptTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptFormat\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"BusinessRuleTask\",\n \"superClass\": [\n \"Task\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"AdHocSubProcess\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"completionCondition\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"ordering\",\n \"type\": \"AdHocOrdering\",\n \"isAttr\": true\n },\n {\n \"name\": \"cancelRemainingInstances\",\n \"default\": true,\n \"isAttr\": true,\n \"type\": \"Boolean\"\n }\n ]\n },\n {\n \"name\": \"Transaction\",\n \"superClass\": [\n \"SubProcess\"\n ],\n \"properties\": [\n {\n \"name\": \"protocol\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"method\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalScriptTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"scriptLanguage\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"script\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"GlobalBusinessRuleTask\",\n \"superClass\": [\n \"GlobalTask\"\n ],\n \"properties\": [\n {\n \"name\": \"implementation\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ComplexBehaviorDefinition\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"condition\",\n \"type\": \"FormalExpression\"\n },\n {\n \"name\": \"event\",\n \"type\": \"ImplicitThrowEvent\"\n }\n ]\n },\n {\n \"name\": \"ResourceRole\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"resourceRef\",\n \"type\": \"Resource\",\n \"isReference\": true\n },\n {\n \"name\": \"resourceParameterBindings\",\n \"type\": \"ResourceParameterBinding\",\n \"isMany\": true\n },\n {\n \"name\": \"resourceAssignmentExpression\",\n \"type\": \"ResourceAssignmentExpression\"\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"ResourceParameterBinding\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n },\n {\n \"name\": \"parameterRef\",\n \"type\": \"ResourceParameter\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ]\n },\n {\n \"name\": \"ResourceAssignmentExpression\",\n \"properties\": [\n {\n \"name\": \"expression\",\n \"type\": \"Expression\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Import\",\n \"properties\": [\n {\n \"name\": \"importType\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"location\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"namespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n },\n {\n \"name\": \"Definitions\",\n \"superClass\": [\n \"BaseElement\"\n ],\n \"properties\": [\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"targetNamespace\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"expressionLanguage\",\n \"default\": \"http://www.w3.org/1999/XPath\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"typeLanguage\",\n \"default\": \"http://www.w3.org/2001/XMLSchema\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"imports\",\n \"type\": \"Import\",\n \"isMany\": true\n },\n {\n \"name\": \"extensions\",\n \"type\": \"Extension\",\n \"isMany\": true\n },\n {\n \"name\": \"rootElements\",\n \"type\": \"RootElement\",\n \"isMany\": true\n },\n {\n \"name\": \"diagrams\",\n \"isMany\": true,\n \"type\": \"bpmndi:BPMNDiagram\"\n },\n {\n \"name\": \"exporter\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"relationships\",\n \"type\": \"Relationship\",\n \"isMany\": true\n },\n {\n \"name\": \"exporterVersion\",\n \"isAttr\": true,\n \"type\": \"String\"\n }\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ProcessType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Public\"\n },\n {\n \"name\": \"Private\"\n }\n ]\n },\n {\n \"name\": \"GatewayDirection\",\n \"literalValues\": [\n {\n \"name\": \"Unspecified\"\n },\n {\n \"name\": \"Converging\"\n },\n {\n \"name\": \"Diverging\"\n },\n {\n \"name\": \"Mixed\"\n }\n ]\n },\n {\n \"name\": \"EventBasedGatewayType\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Exclusive\"\n }\n ]\n },\n {\n \"name\": \"RelationshipDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Forward\"\n },\n {\n \"name\": \"Backward\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"ItemKind\",\n \"literalValues\": [\n {\n \"name\": \"Physical\"\n },\n {\n \"name\": \"Information\"\n }\n ]\n },\n {\n \"name\": \"ChoreographyLoopType\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"Standard\"\n },\n {\n \"name\": \"MultiInstanceSequential\"\n },\n {\n \"name\": \"MultiInstanceParallel\"\n }\n ]\n },\n {\n \"name\": \"AssociationDirection\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"Both\"\n }\n ]\n },\n {\n \"name\": \"MultiInstanceBehavior\",\n \"literalValues\": [\n {\n \"name\": \"None\"\n },\n {\n \"name\": \"One\"\n },\n {\n \"name\": \"All\"\n },\n {\n \"name\": \"Complex\"\n }\n ]\n },\n {\n \"name\": \"AdHocOrdering\",\n \"literalValues\": [\n {\n \"name\": \"Parallel\"\n },\n {\n \"name\": \"Sequential\"\n }\n ]\n }\n ],\n \"prefix\": \"bpmn\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\",\n \"typePrefix\": \"t\"\n }\n}","module.exports={\n \"name\": \"BPMNDI\",\n \"uri\": \"http://www.omg.org/spec/BPMN/20100524/DI\",\n \"types\": [\n {\n \"name\": \"BPMNDiagram\",\n \"properties\": [\n {\n \"name\": \"plane\",\n \"type\": \"BPMNPlane\",\n \"redefines\": \"di:Diagram#rootElement\"\n },\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isMany\": true\n }\n ],\n \"superClass\": [\n \"di:Diagram\"\n ]\n },\n {\n \"name\": \"BPMNPlane\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n }\n ],\n \"superClass\": [\n \"di:Plane\"\n ]\n },\n {\n \"name\": \"BPMNShape\",\n \"properties\": [\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"isHorizontal\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isExpanded\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"isMarkerVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"isMessageVisible\",\n \"isAttr\": true,\n \"type\": \"Boolean\"\n },\n {\n \"name\": \"participantBandKind\",\n \"type\": \"ParticipantBandKind\",\n \"isAttr\": true\n },\n {\n \"name\": \"choreographyActivityShape\",\n \"type\": \"BPMNShape\",\n \"isAttr\": true,\n \"isReference\": true\n }\n ],\n \"superClass\": [\n \"di:LabeledShape\"\n ]\n },\n {\n \"name\": \"BPMNEdge\",\n \"properties\": [\n {\n \"name\": \"label\",\n \"type\": \"BPMNLabel\"\n },\n {\n \"name\": \"bpmnElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"bpmn:BaseElement\",\n \"redefines\": \"di:DiagramElement#modelElement\"\n },\n {\n \"name\": \"sourceElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#source\"\n },\n {\n \"name\": \"targetElement\",\n \"isAttr\": true,\n \"isReference\": true,\n \"type\": \"di:DiagramElement\",\n \"redefines\": \"di:Edge#target\"\n },\n {\n \"name\": \"messageVisibleKind\",\n \"type\": \"MessageVisibleKind\",\n \"isAttr\": true,\n \"default\": \"initiating\"\n }\n ],\n \"superClass\": [\n \"di:LabeledEdge\"\n ]\n },\n {\n \"name\": \"BPMNLabel\",\n \"properties\": [\n {\n \"name\": \"labelStyle\",\n \"type\": \"BPMNLabelStyle\",\n \"isAttr\": true,\n \"isReference\": true,\n \"redefines\": \"di:DiagramElement#style\"\n }\n ],\n \"superClass\": [\n \"di:Label\"\n ]\n },\n {\n \"name\": \"BPMNLabelStyle\",\n \"properties\": [\n {\n \"name\": \"font\",\n \"type\": \"dc:Font\"\n }\n ],\n \"superClass\": [\n \"di:Style\"\n ]\n }\n ],\n \"emumerations\": [\n {\n \"name\": \"ParticipantBandKind\",\n \"literalValues\": [\n {\n \"name\": \"top_initiating\"\n },\n {\n \"name\": \"middle_initiating\"\n },\n {\n \"name\": \"bottom_initiating\"\n },\n {\n \"name\": \"top_non_initiating\"\n },\n {\n \"name\": \"middle_non_initiating\"\n },\n {\n \"name\": \"bottom_non_initiating\"\n }\n ]\n },\n {\n \"name\": \"MessageVisibleKind\",\n \"literalValues\": [\n {\n \"name\": \"initiating\"\n },\n {\n \"name\": \"non_initiating\"\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"bpmndi\"\n}","module.exports={\n \"name\": \"DC\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DC\",\n \"types\": [\n {\n \"name\": \"Boolean\"\n },\n {\n \"name\": \"Integer\"\n },\n {\n \"name\": \"Real\"\n },\n {\n \"name\": \"String\"\n },\n {\n \"name\": \"Font\",\n \"properties\": [\n {\n \"name\": \"name\",\n \"type\": \"String\",\n \"isAttr\": true\n },\n {\n \"name\": \"size\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"isBold\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isItalic\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isUnderline\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n },\n {\n \"name\": \"isStrikeThrough\",\n \"type\": \"Boolean\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Point\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n }\n ]\n },\n {\n \"name\": \"Bounds\",\n \"properties\": [\n {\n \"name\": \"x\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"y\",\n \"type\": \"Real\",\n \"default\": \"0\",\n \"isAttr\": true\n },\n {\n \"name\": \"width\",\n \"type\": \"Real\",\n \"isAttr\": true\n },\n {\n \"name\": \"height\",\n \"type\": \"Real\",\n \"isAttr\": true\n }\n ]\n }\n ],\n \"prefix\": \"dc\",\n \"associations\": []\n}","module.exports={\n \"name\": \"DI\",\n \"uri\": \"http://www.omg.org/spec/DD/20100524/DI\",\n \"types\": [\n {\n \"name\": \"DiagramElement\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"extension\",\n \"type\": \"Extension\"\n },\n {\n \"name\": \"owningDiagram\",\n \"type\": \"Diagram\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"owningElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"modelElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true,\n \"type\": \"Element\"\n },\n {\n \"name\": \"style\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"ownedElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Node\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ]\n },\n {\n \"name\": \"Edge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"DiagramElement\"\n ],\n \"properties\": [\n {\n \"name\": \"source\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"target\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isReference\": true\n },\n {\n \"name\": \"waypoint\",\n \"isUnique\": false,\n \"isMany\": true,\n \"type\": \"dc:Point\",\n \"serialize\": \"xsi:type\"\n }\n ]\n },\n {\n \"name\": \"Diagram\",\n \"isAbstract\": true,\n \"properties\": [\n {\n \"name\": \"rootElement\",\n \"type\": \"DiagramElement\",\n \"isReadOnly\": true,\n \"isVirtual\": true\n },\n {\n \"name\": \"name\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"documentation\",\n \"isAttr\": true,\n \"type\": \"String\"\n },\n {\n \"name\": \"resolution\",\n \"isAttr\": true,\n \"type\": \"Real\"\n },\n {\n \"name\": \"ownedStyle\",\n \"type\": \"Style\",\n \"isReadOnly\": true,\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Shape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Plane\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"planeElement\",\n \"type\": \"DiagramElement\",\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledEdge\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Edge\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"LabeledShape\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Shape\"\n ],\n \"properties\": [\n {\n \"name\": \"ownedLabel\",\n \"type\": \"Label\",\n \"isReadOnly\": true,\n \"subsettedProperty\": \"DiagramElement-ownedElement\",\n \"isVirtual\": true,\n \"isMany\": true\n }\n ]\n },\n {\n \"name\": \"Label\",\n \"isAbstract\": true,\n \"superClass\": [\n \"Node\"\n ],\n \"properties\": [\n {\n \"name\": \"bounds\",\n \"type\": \"dc:Bounds\"\n }\n ]\n },\n {\n \"name\": \"Style\",\n \"isAbstract\": true\n },\n {\n \"name\": \"Extension\",\n \"properties\": [\n {\n \"name\": \"values\",\n \"type\": \"Element\",\n \"isMany\": true\n }\n ]\n }\n ],\n \"associations\": [],\n \"prefix\": \"di\",\n \"xml\": {\n \"tagAlias\": \"lowerCase\"\n }\n}","module.exports = require(36);","'use strict';\n\nvar di = require(69);\n\n\n/**\n * Bootstrap an injector from a list of modules, instantiating a number of default components\n *\n * @ignore\n * @param {Array<didi.Module>} bootstrapModules\n *\n * @return {didi.Injector} a injector to use to access the components\n */\nfunction bootstrap(bootstrapModules) {\n\n var modules = [],\n components = [];\n\n function hasModule(m) {\n return modules.indexOf(m) >= 0;\n }\n\n function addModule(m) {\n modules.push(m);\n }\n\n function visit(m) {\n if (hasModule(m)) {\n return;\n }\n\n (m.__depends__ || []).forEach(visit);\n\n if (hasModule(m)) {\n return;\n }\n\n addModule(m);\n\n (m.__init__ || []).forEach(function(c) {\n components.push(c);\n });\n }\n\n bootstrapModules.forEach(visit);\n\n var injector = new di.Injector(modules);\n\n components.forEach(function(c) {\n\n try {\n // eagerly resolve component (fn or string)\n injector[typeof c === 'string' ? 'get' : 'invoke'](c);\n } catch (e) {\n console.error('Failed to instantiate component');\n console.error(e.stack);\n\n throw e;\n }\n });\n\n return injector;\n}\n\n/**\n * Creates an injector from passed options.\n *\n * @ignore\n * @param {Object} options\n * @return {didi.Injector}\n */\nfunction createInjector(options) {\n\n options = options || {};\n\n var configModule = {\n 'config': ['value', options]\n };\n\n var coreModule = require(42);\n\n var modules = [ configModule, coreModule ].concat(options.modules || []);\n\n return bootstrap(modules);\n}\n\n\n/**\n * The main diagram-js entry point that bootstraps the diagram with the given\n * configuration.\n *\n * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.\n *\n * @class djs.Diagram\n * @memberOf djs\n * @constructor\n *\n * @example\n *\n * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>\n *\n * // plug-in implemenentation\n * function MyLoggingPlugin(eventBus) {\n * eventBus.on('shape.added', function(event) {\n * console.log('shape ', event.shape, ' was added to the diagram');\n * });\n * }\n *\n * // export as module\n * module.exports = {\n * __init__: [ 'myLoggingPlugin' ],\n * myLoggingPlugin: [ 'type', MyLoggingPlugin ]\n * };\n *\n *\n * // instantiate the diagram with the new plug-in\n *\n * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });\n *\n * diagram.invoke([ 'canvas', function(canvas) {\n * // add shape to drawing canvas\n * canvas.addShape({ x: 10, y: 10 });\n * });\n *\n * // 'shape ... was added to the diagram' logged to console\n *\n * @param {Object} options\n * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram\n * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with\n */\nfunction Diagram(options, injector) {\n\n // create injector unless explicitly specified\n this.injector = injector = injector || createInjector(options);\n\n // API\n\n /**\n * Resolves a diagram service\n *\n * @method Diagram#get\n *\n * @param {String} name the name of the diagram service to be retrieved\n * @param {Object} [locals] a number of locals to use to resolve certain dependencies\n */\n this.get = injector.get;\n\n /**\n * Executes a function into which diagram services are injected\n *\n * @method Diagram#invoke\n *\n * @param {Function|Object[]} fn the function to resolve\n * @param {Object} locals a number of locals to use to resolve certain dependencies\n */\n this.invoke = injector.invoke;\n\n // init\n\n // indicate via event\n\n\n /**\n * An event indicating that all plug-ins are loaded.\n *\n * Use this event to fire other events to interested plug-ins\n *\n * @memberOf Diagram\n *\n * @event diagram.init\n *\n * @example\n *\n * eventBus.on('diagram.init', function() {\n * eventBus.fire('my-custom-event', { foo: 'BAR' });\n * });\n *\n * @type {Object}\n */\n this.get('eventBus').fire('diagram.init');\n}\n\nmodule.exports = Diagram;\n\n\n/**\n * Destroys the diagram\n *\n * @method Diagram#destroy\n */\nDiagram.prototype.destroy = function() {\n this.get('eventBus').fire('diagram.destroy');\n};","'use strict';\n\nvar isNumber = require(162),\n assign = require(168),\n forEach = require(77);\n\nvar Collections = require(57);\n\nvar Snap = require(67);\n\nfunction round(number, resolution) {\n return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n return isNumber(number) ? number + 'px' : number;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param {Object} options\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n options = assign({}, { width: '100%', height: '100%' }, options);\n\n var container = options.container || document.body;\n\n // create a <div> around the svg element with the respective size\n // this way we can always get the correct container size\n // (this is impossible for <svg> elements at the moment)\n var parent = document.createElement('div');\n parent.setAttribute('class', 'djs-container');\n\n assign(parent.style, {\n position: 'relative',\n overflow: 'hidden',\n width: ensurePx(options.width),\n height: ensurePx(options.height)\n });\n\n container.appendChild(parent);\n\n return parent;\n}\n\nfunction createGroup(parent, cls) {\n return parent.group().attr({ 'class' : cls });\n}\n\nvar BASE_LAYER = 'base';\n\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n this._eventBus = eventBus;\n this._elementRegistry = elementRegistry;\n this._graphicsFactory = graphicsFactory;\n\n this._init(config || {});\n}\n\nCanvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];\n\nmodule.exports = Canvas;\n\n\nCanvas.prototype._init = function(config) {\n\n // Creates a <svg> element that is wrapped into a <div>.\n // This way we are always able to correctly figure out the size of the svg element\n // by querying the parent node.\n //\n // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n //\n // <div class=\"djs-container\" style=\"width: {desired-width}, height: {desired-height}\">\n // <svg width=\"100%\" height=\"100%\">\n // ...\n // </svg>\n // </div>\n\n // html container\n var eventBus = this._eventBus,\n\n container = createContainer(config),\n svg = Snap.createSnapAt('100%', '100%', container),\n viewport = createGroup(svg, 'viewport'),\n\n self = this;\n\n this._container = container;\n this._svg = svg;\n this._viewport = viewport;\n this._layers = {};\n\n eventBus.on('diagram.init', function(event) {\n\n /**\n * An event indicating that the canvas is ready to be drawn on.\n *\n * @memberOf Canvas\n *\n * @event canvas.init\n *\n * @type {Object}\n * @property {Snap<SVGSVGElement>} svg the created svg element\n * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes\n */\n eventBus.fire('canvas.init', { svg: svg, viewport: viewport });\n });\n\n eventBus.on('diagram.destroy', function() {\n\n var parent = self._container.parentNode;\n\n if (parent) {\n parent.removeChild(container);\n }\n\n eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });\n\n self._svg.remove();\n\n self._svg = self._container = self._layers = self._viewport = null;\n });\n\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getDefaultLayer = function() {\n return this.getLayer(BASE_LAYER);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * @param {String} name\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getLayer = function(name) {\n\n if (!name) {\n throw new Error('must specify a name');\n }\n\n var layer = this._layers[name];\n if (!layer) {\n layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);\n }\n\n return layer;\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {DOMNode}\n */\nCanvas.prototype.getContainer = function() {\n return this._container;\n};\n\n\n/////////////// markers ///////////////////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n var container;\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n // we need to access all\n container = this._elementRegistry._elements[element.id];\n\n if (!container) {\n return;\n }\n\n forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n if (gfx) {\n // invoke either addClass or removeClass based on mode\n gfx[add ? 'addClass' : 'removeClass'](marker);\n }\n });\n\n /**\n * An event indicating that a marker has been updated for an element\n *\n * @event element.marker.update\n * @type {Object}\n * @property {djs.model.Element} element the shape\n * @property {Object} gfx the graphical representation of the shape\n * @property {String} marker\n * @property {Boolean} add true if the marker was added, false if it got removed\n */\n this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n * canvas.addMarker('foo', 'some-marker');\n *\n * var fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; // <g class=\"... some-marker\"> ... </g>\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.addMarker = function(element, marker) {\n this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n this._updateMarker(element, marker, false);\n};\n\n/**\n * Check the existence of a marker on element.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n var gfx = this.getGraphics(element);\n\n return gfx && gfx.hasClass(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n if(this.hasMarker(element, marker)) {\n this.removeMarker(element, marker);\n } else {\n this.addMarker(element, marker);\n }\n};\n\nCanvas.prototype.getRootElement = function() {\n if (!this._rootElement) {\n this.setRootElement({ id: '__implicitroot' });\n }\n\n return this._rootElement;\n};\n\n\n\n//////////////// root element handling ///////////////////////////\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {Object|djs.model.Root} element\n * @param {Boolean} [override] whether to override the current root element, if any\n *\n * @return {Object|djs.model.Root} new root element\n */\nCanvas.prototype.setRootElement = function(element, override) {\n\n this._ensureValidId(element);\n\n var oldRoot = this._rootElement,\n elementRegistry = this._elementRegistry,\n eventBus = this._eventBus;\n\n if (oldRoot) {\n if (!override) {\n throw new Error('rootElement already set, need to specify override');\n }\n\n // simulate element remove event sequence\n eventBus.fire('root.remove', { element: oldRoot });\n eventBus.fire('root.removed', { element: oldRoot });\n\n elementRegistry.remove(oldRoot);\n }\n\n var gfx = this.getDefaultLayer();\n\n // resemble element add event sequence\n eventBus.fire('root.add', { element: element });\n\n elementRegistry.add(element, gfx, this._svg);\n\n eventBus.fire('root.added', { element: element, gfx: gfx });\n\n this._rootElement = element;\n\n return element;\n};\n\n\n\n///////////// add functionality ///////////////////////////////\n\nCanvas.prototype._ensureValidId = function(element) {\n if (!element.id) {\n throw new Error('element must have an id');\n }\n\n if (this._elementRegistry.get(element.id)) {\n throw new Error('element with id ' + element.id + ' already exists');\n }\n};\n\nCanvas.prototype._setParent = function(element, parent) {\n Collections.add(parent.children, element);\n element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n * * <{type}.add> (element, parent)\n * * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {String} type\n * @param {Object|djs.model.Base} element\n * @param {Object|djs.model.Base} [parent]\n *\n * @return {Object|djs.model.Base} the added element\n */\nCanvas.prototype._addElement = function(type, element, parent) {\n\n parent = parent || this.getRootElement();\n\n var eventBus = this._eventBus,\n graphicsFactory = this._graphicsFactory;\n\n this._ensureValidId(element);\n\n eventBus.fire(type + '.add', { element: element, parent: parent });\n\n this._setParent(element, parent);\n\n // create graphics\n var gfx = graphicsFactory.create(type, element);\n\n this._elementRegistry.add(element, gfx);\n\n // update its visual\n graphicsFactory.update(type, element, gfx);\n\n eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n return element;\n};\n\n/**\n * Adds a shape to the canvas\n *\n * @param {Object|djs.model.Shape} shape to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Shape} the added shape\n */\nCanvas.prototype.addShape = function(shape, parent) {\n return this._addElement('shape', shape, parent);\n};\n\n/**\n * Adds a connection to the canvas\n *\n * @param {Object|djs.model.Connection} connection to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Connection} the added connection\n */\nCanvas.prototype.addConnection = function(connection, parent) {\n return this._addElement('connection', connection, parent);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n var elementRegistry = this._elementRegistry,\n graphicsFactory = this._graphicsFactory,\n eventBus = this._eventBus;\n\n element = elementRegistry.get(element.id || element);\n\n if (!element) {\n // element was removed already\n return;\n }\n\n eventBus.fire(type + '.remove', { element: element });\n\n graphicsFactory.remove(element);\n\n // unset parent <-> child relationship\n Collections.remove(element.parent && element.parent.children, element);\n element.parent = null;\n\n eventBus.fire(type + '.removed', { element: element });\n\n elementRegistry.remove(element);\n\n return element;\n};\n\n\n/**\n * Removes a shape from the canvas\n *\n * @param {String|djs.model.Shape} shape or shape id to be removed\n *\n * @return {djs.model.Shape} the removed shape\n */\nCanvas.prototype.removeShape = function(shape) {\n\n /**\n * An event indicating that a shape is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.remove\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n\n /**\n * An event indicating that a shape has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event shape.removed\n * @type {Object}\n * @property {djs.model.Shape} element the shape descriptor\n * @property {Object} gfx the graphical representation of the shape\n */\n return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas\n *\n * @param {String|djs.model.Connection} connection or connection id to be removed\n *\n * @return {djs.model.Connection} the removed connection\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n /**\n * An event indicating that a connection is about to be removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.remove\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n\n /**\n * An event indicating that a connection has been removed from the canvas.\n *\n * @memberOf Canvas\n *\n * @event connection.removed\n * @type {Object}\n * @property {djs.model.Connection} element the connection descriptor\n * @property {Object} gfx the graphical representation of the connection\n */\n return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Sends a shape to the front.\n *\n * This method takes parent / child relationships between shapes into account\n * and makes sure that children are properly handled, too.\n *\n * @param {djs.model.Shape} shape descriptor of the shape to be sent to front\n * @param {boolean} [bubble=true] whether to send parent shapes to front, too\n */\nCanvas.prototype.sendToFront = function(shape, bubble) {\n\n if (bubble !== false) {\n bubble = true;\n }\n\n if (bubble && shape.parent) {\n this.sendToFront(shape.parent);\n }\n\n forEach(shape.children, function(child) {\n this.sendToFront(child, false);\n }, this);\n\n var gfx = this.getGraphics(shape),\n gfxParent = gfx.parent();\n\n gfx.remove().appendTo(gfxParent);\n};\n\n\n/**\n * Return the graphical object underlaying a certain diagram element\n *\n * @param {String|djs.model.Base} element descriptor of the element\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\nCanvas.prototype._fireViewboxChange = function() {\n this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the area that is currently displayed\n *\n * @param {Object} [box] the new view box to set\n * @param {Number} box.x the top left X coordinate of the canvas visible in view box\n * @param {Number} box.y the top left Y coordinate of the canvas visible in view box\n * @param {Number} box.width the visible width\n * @param {Number} box.height\n *\n * @example\n *\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * @return {Object} the current view box\n */\nCanvas.prototype.viewbox = function(box) {\n\n if (box === undefined && this._cachedViewbox) {\n return this._cachedViewbox;\n }\n\n var viewport = this._viewport,\n innerBox,\n outerBox = this.getSize(),\n matrix,\n scale,\n x, y;\n\n if (!box) {\n // compute the inner box based on the\n // diagrams default layer. This allows us to exclude\n // external components, such as overlays\n innerBox = this.getDefaultLayer().getBBox(true);\n\n matrix = viewport.transform().localMatrix;\n scale = round(matrix.a, 1000);\n\n x = round(-matrix.e || 0, 1000);\n y = round(-matrix.f || 0, 1000);\n\n box = this._cachedViewbox = {\n x: x ? x / scale : 0,\n y: y ? y / scale : 0,\n width: outerBox.width / scale,\n height: outerBox.height / scale,\n scale: scale,\n inner: {\n width: innerBox.width,\n height: innerBox.height,\n x: innerBox.x,\n y: innerBox.y\n },\n outer: outerBox\n };\n\n return box;\n } else {\n scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);\n viewport.transform(matrix);\n\n this._fireViewboxChange();\n }\n\n return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {Object} [delta] the new scroll to apply.\n *\n * @param {Number} [delta.dx]\n * @param {Number} [delta.dy]\n */\nCanvas.prototype.scroll = function(delta) {\n\n var node = this._viewport.node;\n var matrix = node.getCTM();\n\n if (delta) {\n delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n setCTM(node, matrix);\n\n this._fireViewboxChange();\n }\n\n return { x: matrix.e, y: matrix.f };\n};\n\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.\n *\n * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,\n * or `fit-viewport` to adjust the size to fit the current viewport\n * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null\n *\n * @return {Number} the current scale\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n if (newScale === 'fit-viewport') {\n return this._fitViewport(center);\n }\n\n var vbox = this.viewbox();\n\n if (newScale === undefined) {\n return vbox.scale;\n }\n\n var outer = vbox.outer;\n\n if (center === 'auto') {\n center = {\n x: outer.width / 2,\n y: outer.height / 2\n };\n }\n\n var matrix = this._setZoom(newScale, center);\n\n this._fireViewboxChange();\n\n return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n var vbox = this.viewbox(),\n outer = vbox.outer,\n inner = vbox.inner,\n newScale,\n newViewbox;\n\n // display the complete diagram without zooming in.\n // instead of relying on internal zoom, we perform a\n // hard reset on the canvas viewbox to realize this\n //\n // if diagram does not need to be zoomed in, we focus it around\n // the diagram origin instead\n\n if (inner.x >= 0 &&\n inner.y >= 0 &&\n inner.x + inner.width <= outer.width &&\n inner.y + inner.height <= outer.height &&\n !center) {\n\n newViewbox = {\n x: 0,\n y: 0,\n width: Math.max(inner.width + inner.x, outer.width),\n height: Math.max(inner.height + inner.y, outer.height)\n };\n } else {\n\n newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n newViewbox = {\n x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n width: outer.width / newScale,\n height: outer.height / newScale\n };\n }\n\n this.viewbox(newViewbox);\n\n return this.viewbox().scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n var svg = this._svg.node,\n viewport = this._viewport.node;\n\n var matrix = svg.createSVGMatrix();\n var point = svg.createSVGPoint();\n\n var centerPoint,\n originalPoint,\n currentMatrix,\n scaleMatrix,\n newMatrix;\n\n currentMatrix = viewport.getCTM();\n\n\n var currentScale = currentMatrix.a;\n\n if (center) {\n centerPoint = assign(point, center);\n\n // revert applied viewport transformations\n originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n // create scale matrix\n scaleMatrix = matrix\n .translate(originalPoint.x, originalPoint.y)\n .scale(1 / currentScale * scale)\n .translate(-originalPoint.x, -originalPoint.y);\n\n newMatrix = currentMatrix.multiply(scaleMatrix);\n } else {\n newMatrix = matrix.scale(scale);\n }\n\n setCTM(this._viewport.node, newMatrix);\n\n return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas\n *\n * @return {Dimensions}\n */\nCanvas.prototype.getSize = function () {\n return {\n width: this._container.clientWidth,\n height: this._container.clientHeight\n };\n};\n\n\n/**\n * Return the absolute bounding box for the given element\n *\n * The absolute bounding box may be used to display overlays in the\n * callers (browser) coordinate system rather than the zoomed in/out\n * canvas coordinates.\n *\n * @param {ElementDescriptor} element\n * @return {Bounds} the absolute bounding box\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n var vbox = this.viewbox();\n var bbox;\n\n // connection\n // use svg bbox\n if (element.waypoints) {\n var gfx = this.getGraphics(element);\n\n var transformBBox = gfx.getBBox(true);\n bbox = gfx.getBBox();\n\n bbox.x -= transformBBox.x;\n bbox.y -= transformBBox.y;\n\n bbox.width += 2 * transformBBox.x;\n bbox.height += 2 * transformBBox.y;\n }\n // shapes\n // use data\n else {\n bbox = element;\n }\n\n var x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n var y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n var width = bbox.width * vbox.scale;\n var height = bbox.height * vbox.scale;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n};\n","'use strict';\n\nvar Model = require(56);\n\n\n/**\n * A factory for diagram-js shapes\n */\nfunction ElementFactory() {\n this._uid = 12;\n}\n\nmodule.exports = ElementFactory;\n\n\nElementFactory.prototype.createRoot = function(attrs) {\n return this.create('root', attrs);\n};\n\nElementFactory.prototype.createLabel = function(attrs) {\n return this.create('label', attrs);\n};\n\nElementFactory.prototype.createShape = function(attrs) {\n return this.create('shape', attrs);\n};\n\nElementFactory.prototype.createConnection = function(attrs) {\n return this.create('connection', attrs);\n};\n\n/**\n * Create a model element with the given type and\n * a number of pre-set attributes.\n *\n * @param {String} type\n * @param {Object} attrs\n * @return {djs.model.Base} the newly created model instance\n */\nElementFactory.prototype.create = function(type, attrs) {\n\n attrs = attrs || {};\n\n if (!attrs.id) {\n attrs.id = type + '_' + (this._uid++);\n }\n\n return Model.create(type, attrs);\n};","'use strict';\n\nvar ELEMENT_ID = 'data-element-id';\n\n\n/**\n * @class\n *\n * A registry that keeps track of all shapes in the diagram.\n */\nfunction ElementRegistry() {\n this._elements = {};\n}\n\nmodule.exports = ElementRegistry;\n\n/**\n * Register a pair of (element, gfx, (secondaryGfx)).\n *\n * @param {djs.model.Base} element\n * @param {Snap<SVGElement>} gfx\n * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n var id = element.id;\n\n this._validateId(id);\n\n // associate dom node with element\n gfx.attr(ELEMENT_ID, id);\n\n if (secondaryGfx) {\n secondaryGfx.attr(ELEMENT_ID, id);\n }\n\n this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Removes an element from the registry.\n *\n * @param {djs.model.Base} element\n */\nElementRegistry.prototype.remove = function(element) {\n var elements = this._elements,\n id = element.id || element,\n container = id && elements[id];\n\n if (container) {\n\n // unset element id on gfx\n container.gfx.attr(ELEMENT_ID, null);\n\n if (container.secondaryGfx) {\n container.secondaryGfx.attr(ELEMENT_ID, null);\n }\n\n delete elements[id];\n }\n};\n\n/**\n * Update the id of an element\n *\n * @param {djs.model.Base} element\n * @param {String} newId\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n this._validateId(newId);\n\n if (typeof element === 'string') {\n element = this.get(element);\n }\n\n var gfx = this.getGraphics(element),\n secondaryGfx = this.getGraphics(element, true);\n\n this.remove(element);\n\n element.id = newId;\n\n this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Return the model element for a given id or graphics.\n *\n * @example\n *\n * elementRegistry.get('SomeElementId_1');\n * elementRegistry.get(gfx);\n *\n *\n * @param {String|SVGElement} filter for selecting the element\n *\n * @return {djs.model.Base}\n */\nElementRegistry.prototype.get = function(filter) {\n var id;\n\n if (typeof filter === 'string') {\n id = filter;\n } else {\n id = filter && filter.attr(ELEMENT_ID);\n }\n\n var container = this._elements[id];\n return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {Function} fn\n *\n * @return {Array<djs.model.Base>}\n */\nElementRegistry.prototype.filter = function(fn) {\n\n var filtered = [];\n\n this.forEach(function(element, gfx) {\n if(fn(element, gfx)) {\n filtered.push(element);\n }\n });\n\n return filtered;\n};\n\n/**\n * Iterate over all diagram elements.\n *\n * @param {Function} fn\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n var map = this._elements;\n\n Object.keys(map).forEach(function(id) {\n var container = map[id],\n element = container.element,\n gfx = container.gfx;\n\n return fn(element, gfx);\n });\n};\n\n/**\n * Return the graphical representation of an element or its id.\n *\n * @example\n * elementRegistry.getGraphics('SomeElementId_1');\n * elementRegistry.getGraphics(rootElement); // <g ...>\n *\n * elementRegistry.getGraphics(rootElement, true); // <svg ...>\n *\n *\n * @param {String|djs.model.Base} filter\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n var id = filter.id || filter;\n\n var container = this._elements[id];\n return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate the suitability of the given id and signals a problem\n * with an exception.\n *\n * @param {String} id\n *\n * @throws {Error} if id is empty or already assigned\n */\nElementRegistry.prototype._validateId = function(id) {\n if (!id) {\n throw new Error('element must have an id');\n }\n\n if (this._elements[id]) {\n throw new Error('element with id ' + id + ' already added');\n }\n};","'use strict';\n\nvar isFunction = require(160),\n isArray = require(159),\n isNumber = require(162),\n assign = require(168);\n\nvar DEFAULT_PRIORITY = 1000;\n\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n * // access event type\n * event.type; // 'foo'\n *\n * // stop propagation to other listeners\n * event.stopPropagation();\n *\n * // prevent event default\n * event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n * console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n * // stop event propagation + prevent default\n * return false;\n *\n * // stop event propagation + return custom result\n * return {\n * complex: 'listening result'\n * };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n * console.log('invoked first!');\n * });\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n * console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n * return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nfunction EventBus() {\n this._listeners = {};\n\n // cleanup on destroy\n\n var self = this;\n\n // destroy on lowest priority to allow\n // message passing until the bitter end\n this.on('diagram.destroy', 1, function() {\n self._listeners = null;\n });\n}\n\nmodule.exports = EventBus;\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {String|Array<String>} events\n * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n */\nEventBus.prototype.on = function(events, priority, callback) {\n\n events = isArray(events) ? events : [ events ];\n\n if (isFunction(priority)) {\n callback = priority;\n priority = DEFAULT_PRIORITY;\n }\n\n if (!isNumber(priority)) {\n throw new Error('priority must be a number');\n }\n\n var self = this,\n listener = { priority: priority, callback: callback };\n\n events.forEach(function(e) {\n self._addListener(e, listener);\n });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {String} event the event name to register for\n * @param {Function} callback the callback to execute\n */\nEventBus.prototype.once = function(event, callback) {\n\n var self = this;\n\n function wrappedCallback() {\n callback.apply(self, arguments);\n self.off(event, wrappedCallback);\n }\n\n this.on(event, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {String} event\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(event, callback) {\n var listeners = this._getListeners(event),\n listener, idx;\n\n if (callback) {\n\n // move through listeners from back to front\n // and remove matching listeners\n for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {\n if (listener.callback === callback) {\n listeners.splice(idx, 1);\n }\n }\n } else {\n // clear listeners\n listeners.length = 0;\n }\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n * alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {String} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {Boolean} the events return value, if specified or false if the\n * default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n\n var event,\n originalType,\n listeners, idx, listener,\n returnValue,\n args;\n\n args = Array.prototype.slice.call(arguments);\n\n if (typeof type === 'object') {\n event = type;\n type = event.type;\n }\n\n if (!type) {\n throw new Error('no event type specified');\n }\n\n listeners = this._listeners[type];\n\n if (!listeners) {\n return;\n }\n\n // we make sure we fire instances of our home made\n // events here. We wrap them only once, though\n if (data instanceof Event) {\n // we are fine, we alread have an event\n event = data;\n } else {\n event = new Event();\n event.init(data);\n }\n\n // ensure we pass the event as the first parameter\n args[0] = event;\n\n // original event type (in case we delegate)\n originalType = event.type;\n\n try {\n\n // update event type before delegation\n if (type !== originalType) {\n event.type = type;\n }\n\n for (idx = 0; !!(listener = listeners[idx]); idx++) {\n\n // handle stopped propagation\n if (event.cancelBubble) {\n break;\n }\n\n try {\n // returning false prevents the default action\n returnValue = event.returnValue = listener.callback.apply(null, args);\n\n // stop propagation on return value\n if (returnValue !== undefined) {\n event.stopPropagation();\n }\n\n // prevent default on return false\n if (returnValue === false) {\n event.preventDefault();\n }\n } catch (e) {\n if (!this.handleError(e)) {\n console.error('unhandled error in event listener');\n console.error(e.stack);\n\n throw e;\n }\n }\n }\n } finally {\n // reset event type after delegation\n if (type !== originalType) {\n event.type = originalType;\n }\n }\n\n // set the return value to false if the event default\n // got prevented and no other return value exists\n if (returnValue === undefined && event.defaultPrevented) {\n returnValue = false;\n }\n\n return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n return this.fire('error', { error: error }) === false;\n};\n\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n * * before: [ 1500, 1500, 1000, 1000 ]\n * * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {String} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n var listeners = this._getListeners(event),\n existingListener,\n idx;\n\n // ensure we order listeners by priority from\n // 0 (high) to n > 0 (low)\n for (idx = 0; !!(existingListener = listeners[idx]); idx++) {\n if (existingListener.priority < newListener.priority) {\n\n // prepend newListener at before existingListener\n listeners.splice(idx, 0, newListener);\n return;\n }\n }\n\n listeners.push(newListener);\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n var listeners = this._listeners[name];\n\n if (!listeners) {\n this._listeners[name] = listeners = [];\n }\n\n return listeners;\n};\n\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction Event() { }\n\nmodule.exports.Event = Event;\n\nEvent.prototype.stopPropagation = function() {\n this.cancelBubble = true;\n};\n\nEvent.prototype.preventDefault = function() {\n this.defaultPrevented = true;\n};\n\nEvent.prototype.init = function(data) {\n assign(this, data || {});\n};\n","'use strict';\n\nvar forEach = require(77),\n reduce = require(81);\n\nvar GraphicsUtil = require(60),\n domClear = require(181);\n\n/**\n * A factory that creates graphical elements\n *\n * @param {Renderer} renderer\n */\nfunction GraphicsFactory(renderer, elementRegistry) {\n this._renderer = renderer;\n this._elementRegistry = elementRegistry;\n}\n\nGraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];\n\nmodule.exports = GraphicsFactory;\n\n\nGraphicsFactory.prototype._getChildren = function(element) {\n\n var gfx = this._elementRegistry.getGraphics(element);\n\n var childrenGfx;\n\n // root element\n if (!element.parent) {\n childrenGfx = gfx;\n } else {\n childrenGfx = GraphicsUtil.getChildren(gfx);\n if (!childrenGfx) {\n childrenGfx = gfx.parent().group().attr('class', 'djs-children');\n }\n }\n\n return childrenGfx;\n};\n\n/**\n * Clears the graphical representation of the element and returns the\n * cleared visual (the <g class=\"djs-visual\" /> element).\n */\nGraphicsFactory.prototype._clear = function(gfx) {\n var visual = GraphicsUtil.getVisual(gfx);\n\n domClear(visual.node);\n\n return visual;\n};\n\n/**\n * Creates a gfx container for shapes and connections\n *\n * The layout is as follows:\n *\n * <g class=\"djs-group\">\n *\n * <!-- the gfx -->\n * <g class=\"djs-element djs-(shape|connection)\">\n * <g class=\"djs-visual\">\n * <!-- the renderer draws in here -->\n * </g>\n *\n * <!-- extensions (overlays, click box, ...) goes here\n * </g>\n *\n * <!-- the gfx child nodes -->\n * <g class=\"djs-children\"></g>\n * </g>\n *\n * @param {Object} parent\n * @param {String} type the type of the element, i.e. shape | connection\n */\nGraphicsFactory.prototype._createContainer = function(type, parentGfx) {\n var outerGfx = parentGfx.group().attr('class', 'djs-group'),\n gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);\n\n // create visual\n gfx.group().attr('class', 'djs-visual');\n\n return gfx;\n};\n\nGraphicsFactory.prototype.create = function(type, element) {\n var childrenGfx = this._getChildren(element.parent);\n return this._createContainer(type, childrenGfx);\n};\n\n\nGraphicsFactory.prototype.updateContainments = function(elements) {\n\n var self = this,\n elementRegistry = this._elementRegistry,\n parents;\n\n\n parents = reduce(elements, function(map, e) {\n\n if (e.parent) {\n map[e.parent.id] = e.parent;\n }\n\n return map;\n }, {});\n\n // update all parents of changed and reorganized their children\n // in the correct order (as indicated in our model)\n forEach(parents, function(parent) {\n\n var childGfx = self._getChildren(parent),\n children = parent.children;\n\n if (!children) {\n return;\n }\n\n forEach(children.slice().reverse(), function(c) {\n var gfx = elementRegistry.getGraphics(c);\n gfx.parent().prependTo(childGfx);\n });\n });\n\n};\n\nGraphicsFactory.prototype.update = function(type, element, gfx) {\n\n // Do not update root element\n if (!element.parent) {\n return;\n }\n\n var visual = this._clear(gfx);\n\n // redraw\n if (type === 'shape') {\n this._renderer.drawShape(visual, element);\n\n // update positioning\n gfx.translate(element.x, element.y);\n } else\n if (type === 'connection') {\n this._renderer.drawConnection(visual, element);\n } else {\n throw new Error('unknown type: ' + type);\n }\n\n gfx.attr('display', element.hidden ? 'none' : 'block');\n};\n\n\nGraphicsFactory.prototype.remove = function(element) {\n var gfx = this._elementRegistry.getGraphics(element);\n\n // remove\n gfx.parent().remove();\n};\n","module.exports = {\n __depends__: [ require(45) ],\n __init__: [ 'canvas' ],\n canvas: [ 'type', require(37) ],\n elementRegistry: [ 'type', require(39) ],\n elementFactory: [ 'type', require(38) ],\n eventBus: [ 'type', require(40) ],\n graphicsFactory: [ 'type', require(41) ]\n};","'use strict';\n\nvar Snap = require(67);\n\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {Styles} styles\n */\nfunction Renderer(styles) {\n this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n}\n\nmodule.exports = Renderer;\n\nRenderer.$inject = ['styles'];\n\n\nRenderer.prototype.drawShape = function drawShape(gfxGroup, data) {\n return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);\n};\n\nRenderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {\n return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);\n};\n\nfunction componentsToPath(components) {\n return components.join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * Gets the default SVG path of a shape that represents it's visual bounds.\n *\n * @param {djs.model.Shape} shape\n * @return {string} svg path\n */\nRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n var x = shape.x,\n y = shape.y,\n width = shape.width,\n height = shape.height;\n\n var shapePath = [\n ['M', x, y],\n ['l', width, 0],\n ['l', 0, height],\n ['l', -width, 0],\n ['z']\n ];\n\n return componentsToPath(shapePath);\n};\n\n/**\n * Gets the default SVG path of a connection that represents it's visual bounds.\n *\n * @param {djs.model.Connection} connection\n * @return {string} svg path\n */\nRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n var waypoints = connection.waypoints;\n\n var idx, point, connectionPath = [];\n\n for (idx = 0; !!(point = waypoints[idx]); idx++) {\n\n // take invisible docking into account\n // when creating the path\n point = point.original || point;\n\n connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n }\n\n return componentsToPath(connectionPath);\n};\n\n\nfunction toSVGPoints(points) {\n var result = '';\n\n for (var i = 0, p; !!(p = points[i]); i++) {\n result += p.x + ',' + p.y + ' ';\n }\n\n return result;\n}\n\nfunction createLine(points, attrs) {\n return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});\n}\n\nfunction updateLine(gfx, points) {\n return gfx.attr({ points: toSVGPoints(points) });\n}\n\nmodule.exports.createLine = createLine;\nmodule.exports.updateLine = updateLine;","'use strict';\n\nvar isArray = require(159),\n assign = require(168),\n reduce = require(81);\n\n\n/**\n * A component that manages shape styles\n */\nfunction Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n}\n\nmodule.exports = Styles;","module.exports = {\n renderer: [ 'type', require(43) ],\n styles: [ 'type', require(44) ]\n};","'use strict';\n\nvar forEach = require(77),\n domDelegate = require(182),\n Renderer = require(43),\n createLine = Renderer.createLine,\n updateLine = Renderer.updateLine;\n\n\nvar isPrimaryButton = require(62).isPrimaryButton;\n\nvar Snap = require(67);\n\n/**\n * A plugin that provides interaction events for diagram elements.\n *\n * It emits the following events:\n *\n * * element.hover\n * * element.out\n * * element.click\n * * element.dblclick\n * * element.mousedown\n *\n * Each event is a tuple { element, gfx, originalEvent }.\n *\n * Canceling the event via Event#preventDefault() prevents the original DOM operation.\n *\n * @param {EventBus} eventBus\n */\nfunction InteractionEvents(eventBus, elementRegistry, styles) {\n\n var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {\n stroke: 'white',\n strokeWidth: 15\n });\n\n function fire(type, event) {\n var target = event.delegateTarget || event.target,\n gfx = target && new Snap(target),\n element = elementRegistry.get(gfx),\n returnValue;\n\n if (!gfx || !element) {\n return;\n }\n\n returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });\n\n if (returnValue === false) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n var handlers = {};\n\n function mouseHandler(type) {\n\n var fn = handlers[type];\n\n if (!fn) {\n fn = handlers[type] = function(event) {\n // only indicate left mouse button interactions\n if (isPrimaryButton(event)) {\n fire(type, event);\n }\n };\n }\n\n return fn;\n }\n\n var bindings = {\n mouseover: 'element.hover',\n mouseout: 'element.out',\n click: 'element.click',\n dblclick: 'element.dblclick',\n mousedown: 'element.mousedown',\n mouseup: 'element.mouseup'\n };\n\n var elementSelector = 'svg, .djs-element';\n\n ///// event registration\n\n function registerEvent(node, event, localEvent) {\n var handler = mouseHandler(localEvent);\n handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);\n }\n\n function unregisterEvent(node, event, localEvent) {\n domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);\n }\n\n function registerEvents(svg) {\n forEach(bindings, function(val, key) {\n registerEvent(svg.node, key, val);\n });\n }\n\n function unregisterEvents(svg) {\n forEach(bindings, function(val, key) {\n unregisterEvent(svg.node, key, val);\n });\n }\n\n eventBus.on('canvas.destroy', function(event) {\n unregisterEvents(event.svg);\n });\n\n eventBus.on('canvas.init', function(event) {\n registerEvents(event.svg);\n });\n\n\n eventBus.on([ 'shape.added', 'connection.added' ], function(event) {\n var element = event.element,\n gfx = event.gfx,\n hit,\n type;\n\n if (element.waypoints) {\n hit = createLine(element.waypoints);\n type = 'connection';\n } else {\n hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });\n type = 'shape';\n }\n\n hit.attr(HIT_STYLE).appendTo(gfx.node);\n });\n\n // update djs-hit on change\n\n eventBus.on('shape.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n hit.attr({\n width: element.width,\n height: element.height\n });\n });\n\n eventBus.on('connection.changed', function(event) {\n\n var element = event.element,\n gfx = event.gfx,\n hit = gfx.select('.djs-hit');\n\n updateLine(hit, element.waypoints);\n });\n\n\n // API\n\n this.fire = fire;\n\n this.mouseHandler = mouseHandler;\n\n this.registerEvent = registerEvent;\n this.unregisterEvent = unregisterEvent;\n}\n\n\nInteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];\n\nmodule.exports = InteractionEvents;\n\n\n/**\n * An event indicating that the mouse hovered over an element\n *\n * @event element.hover\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has left an element\n *\n * @event element.out\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has clicked an element\n *\n * @event element.click\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has double clicked an element\n *\n * @event element.dblclick\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone down on an element.\n *\n * @event element.mousedown\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone up on an element.\n *\n * @event element.mouseup\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */","module.exports = {\n __init__: [ 'interactionEvents' ],\n interactionEvents: [ 'type', require(46) ]\n};","'use strict';\n\nvar Snap = require(67);\nvar getBBox = require(58).getBBox;\n\n\n/**\n * @class\n *\n * A plugin that adds an outline to shapes and connections that may be activated and styled\n * via CSS classes.\n *\n * @param {EventBus} events the event bus\n */\nfunction Outline(eventBus, styles, elementRegistry) {\n\n var OUTLINE_OFFSET = 6;\n\n var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);\n\n function createOutline(gfx, bounds) {\n return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);\n }\n\n function updateShapeOutline(outline, bounds) {\n\n outline.attr({\n x: -OUTLINE_OFFSET,\n y: -OUTLINE_OFFSET,\n width: bounds.width + OUTLINE_OFFSET * 2,\n height: bounds.height + OUTLINE_OFFSET * 2\n });\n }\n\n function updateConnectionOutline(outline, connection) {\n\n var bbox = getBBox(connection);\n\n outline.attr({\n x: bbox.x - OUTLINE_OFFSET,\n y: bbox.y - OUTLINE_OFFSET,\n width: bbox.width + OUTLINE_OFFSET * 2,\n height: bbox.height + OUTLINE_OFFSET * 2\n });\n }\n\n eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateShapeOutline(outline, element);\n });\n\n eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {\n var element = event.element,\n gfx = event.gfx;\n\n var outline = gfx.select('.djs-outline');\n\n if (!outline) {\n outline = createOutline(gfx, element);\n }\n\n updateConnectionOutline(outline, element);\n });\n\n\n}\n\n\nOutline.$inject = ['eventBus', 'styles', 'elementRegistry'];\n\nmodule.exports = Outline;\n","'use strict';\n\nmodule.exports = {\n __init__: [ 'outline' ],\n outline: [ 'type', require(48) ]\n};","'use strict';\n\nvar isArray = require(159),\n isString = require(165),\n isObject = require(163),\n assign = require(168),\n forEach = require(77),\n filter = require(75),\n debounce = require(84);\n\nvar domify = require(183),\n domClasses = require(180),\n domRemove = require(185);\n\nvar getBBox = require(58).getBBox;\n\n// document wide unique overlay ids\nvar ids = new (require(61))('ov');\n\n\nfunction createRoot(parent) {\n var root = domify('<div class=\"djs-overlay-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n parent.insertBefore(root, parent.firstChild);\n\n return root;\n}\n\n\nfunction setPosition(el, x, y) {\n assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n el.style.display = visible === false ? 'none' : '';\n}\n\n/**\n * A service that allows users to attach overlays to diagram elements.\n *\n * The overlay service will take care of overlay positioning during updates.\n *\n * @example\n *\n * // add a pink badge on the top left of the shape\n * overlays.add(someShape, {\n * position: {\n * top: -5,\n * left: -5\n * },\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add via shape id\n *\n * overlays.add('some-element-id', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add with optional type\n *\n * overlays.add(someShape, 'badge', {\n * position: {\n * top: -5,\n * left: -5\n * }\n * html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n *\n * // remove an overlay\n *\n * var id = overlays.add(...);\n * overlays.remove(id);\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nfunction Overlays(config, eventBus, canvas, elementRegistry) {\n\n this._eventBus = eventBus;\n this._canvas = canvas;\n this._elementRegistry = elementRegistry;\n\n this._ids = ids;\n\n this._overlayDefaults = {\n show: {\n minZoom: 0.7,\n maxZoom: 5.0\n }\n };\n\n /**\n * Mapping overlayId -> overlay\n */\n this._overlays = {};\n\n /**\n * Mapping elementId -> overlay container\n */\n this._overlayContainers = {};\n\n // root html element for all overlays\n this._overlayRoot = createRoot(canvas.getContainer());\n\n this._init(config);\n}\n\n\nOverlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];\n\nmodule.exports = Overlays;\n\n\n/**\n * Returns the overlay with the specified id or a list of overlays\n * for an element with a given type.\n *\n * @example\n *\n * // return the single overlay with the given id\n * overlays.get('some-id');\n *\n * // return all overlays for the shape\n * overlays.get({ element: someShape });\n *\n * // return all overlays on shape with type 'badge'\n * overlays.get({ element: someShape, type: 'badge' });\n *\n * // shape can also be specified as id\n * overlays.get({ element: 'element-id', type: 'badge' });\n *\n *\n * @param {Object} search\n * @param {String} [search.id]\n * @param {String|djs.model.Base} [search.element]\n * @param {String} [search.type]\n *\n * @return {Object|Array<Object>} the overlay(s)\n */\nOverlays.prototype.get = function(search) {\n\n if (isString(search)) {\n search = { id: search };\n }\n\n if (search.element) {\n var container = this._getOverlayContainer(search.element, true);\n\n // return a list of overlays when searching by element (+type)\n if (container) {\n return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();\n } else {\n return [];\n }\n } else\n if (search.type) {\n return filter(this._overlays, { type: search.type });\n } else {\n // return single element when searching by id\n return search.id ? this._overlays[search.id] : null;\n }\n};\n\n/**\n * Adds a HTML overlay to an element.\n *\n * @param {String|djs.model.Base} element attach overlay to this shape\n * @param {String} [type] optional type to assign to the overlay\n * @param {Object} overlay the overlay configuration\n *\n * @param {String|DOMElement} overlay.html html element to use as an overlay\n * @param {Object} [overlay.show] show configuration\n * @param {Number} [overlay.show.minZoom] minimal zoom level to show the overlay\n * @param {Number} [overlay.show.maxZoom] maximum zoom level to show the overlay\n * @param {Object} overlay.position where to attach the overlay\n * @param {Number} [overlay.position.left] relative to element bbox left attachment\n * @param {Number} [overlay.position.top] relative to element bbox top attachment\n * @param {Number} [overlay.position.bottom] relative to element bbox bottom attachment\n * @param {Number} [overlay.position.right] relative to element bbox right attachment\n *\n * @return {String} id that may be used to reference the overlay for update or removal\n */\nOverlays.prototype.add = function(element, type, overlay) {\n\n if (isObject(type)) {\n overlay = type;\n type = null;\n }\n\n if (!element.id) {\n element = this._elementRegistry.get(element);\n }\n\n if (!overlay.position) {\n throw new Error('must specifiy overlay position');\n }\n\n if (!overlay.html) {\n throw new Error('must specifiy overlay html');\n }\n\n if (!element) {\n throw new Error('invalid element specified');\n }\n\n var id = this._ids.next();\n\n overlay = assign({}, this._overlayDefaults, overlay, {\n id: id,\n type: type,\n element: element,\n html: overlay.html\n });\n\n this._addOverlay(overlay);\n\n return id;\n};\n\n\n/**\n * Remove an overlay with the given id or all overlays matching the given filter.\n *\n * @see Overlays#get for filter options.\n *\n * @param {String} [id]\n * @param {Object} [filter]\n */\nOverlays.prototype.remove = function(filter) {\n\n var overlays = this.get(filter) || [];\n\n if (!isArray(overlays)) {\n overlays = [ overlays ];\n }\n\n var self = this;\n\n forEach(overlays, function(overlay) {\n\n var container = self._getOverlayContainer(overlay.element, true);\n\n if (overlay) {\n domRemove(overlay.html);\n domRemove(overlay.htmlContainer);\n\n delete overlay.htmlContainer;\n delete overlay.element;\n\n delete self._overlays[overlay.id];\n }\n\n if (container) {\n var idx = container.overlays.indexOf(overlay);\n if (idx !== -1) {\n container.overlays.splice(idx, 1);\n }\n }\n });\n\n};\n\n\nOverlays.prototype.show = function() {\n setVisible(this._overlayRoot);\n};\n\n\nOverlays.prototype.hide = function() {\n setVisible(this._overlayRoot, false);\n};\n\n\nOverlays.prototype._updateOverlayContainer = function(container) {\n var element = container.element,\n html = container.html;\n\n // update container left,top according to the elements x,y coordinates\n // this ensures we can attach child elements relative to this container\n\n var x = element.x,\n y = element.y;\n\n if (element.waypoints) {\n var bbox = getBBox(element);\n x = bbox.x;\n y = bbox.y;\n }\n\n setPosition(html, x, y);\n};\n\n\nOverlays.prototype._updateOverlay = function(overlay) {\n\n var position = overlay.position,\n htmlContainer = overlay.htmlContainer,\n element = overlay.element;\n\n // update overlay html relative to shape because\n // it is already positioned on the element\n\n // update relative\n var left = position.left,\n top = position.top;\n\n if (position.right !== undefined) {\n\n var width;\n\n if (element.waypoints) {\n width = getBBox(element).width;\n } else {\n width = element.width;\n }\n\n left = position.right * -1 + width;\n }\n\n if (position.bottom !== undefined) {\n\n var height;\n\n if (element.waypoints) {\n height = getBBox(element).height;\n } else {\n height = element.height;\n }\n\n top = position.bottom * -1 + height;\n }\n\n setPosition(htmlContainer, left || 0, top || 0);\n};\n\n\nOverlays.prototype._createOverlayContainer = function(element) {\n var html = domify('<div class=\"djs-overlays djs-overlays-' + element.id + '\" style=\"position: absolute\" />');\n\n this._overlayRoot.appendChild(html);\n\n var container = {\n html: html,\n element: element,\n overlays: []\n };\n\n this._updateOverlayContainer(container);\n\n return container;\n};\n\n\nOverlays.prototype._updateRoot = function(viewbox) {\n var a = viewbox.scale || 1;\n var d = viewbox.scale || 1;\n\n var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n this._overlayRoot.style.transform = matrix;\n this._overlayRoot.style['-ms-transform'] = matrix;\n};\n\n\nOverlays.prototype._getOverlayContainer = function(element, raw) {\n var id = (element && element.id) || element;\n\n var container = this._overlayContainers[id];\n if (!container && !raw) {\n container = this._overlayContainers[id] = this._createOverlayContainer(element);\n }\n\n return container;\n};\n\n\nOverlays.prototype._addOverlay = function(overlay) {\n\n var id = overlay.id,\n element = overlay.element,\n html = overlay.html,\n htmlContainer,\n overlayContainer;\n\n // unwrap jquery (for those who need it)\n if (html.get) {\n html = html.get(0);\n }\n\n // create proper html elements from\n // overlay HTML strings\n if (isString(html)) {\n html = domify(html);\n }\n\n overlayContainer = this._getOverlayContainer(element);\n\n htmlContainer = domify('<div class=\"djs-overlay\" data-overlay-id=\"' + id + '\" style=\"position: absolute\">');\n\n htmlContainer.appendChild(html);\n\n if (overlay.type) {\n domClasses(htmlContainer).add('djs-overlay-' + overlay.type);\n }\n\n overlay.htmlContainer = htmlContainer;\n\n overlayContainer.overlays.push(overlay);\n overlayContainer.html.appendChild(htmlContainer);\n\n this._overlays[id] = overlay;\n\n this._updateOverlay(overlay);\n};\n\nOverlays.prototype._updateOverlayVisibilty = function(viewbox) {\n\n forEach(this._overlays, function(overlay) {\n var show = overlay.show,\n htmlContainer = overlay.htmlContainer,\n visible = true;\n\n if (show) {\n if (show.minZoom > viewbox.scale ||\n show.maxZoom < viewbox.scale) {\n visible = false;\n }\n\n setVisible(htmlContainer, visible);\n }\n });\n};\n\nOverlays.prototype._init = function(config) {\n\n var eventBus = this._eventBus;\n\n var self = this;\n\n\n // scroll/zoom integration\n\n var updateViewbox = function(viewbox) {\n self._updateRoot(viewbox);\n self._updateOverlayVisibilty(viewbox);\n\n self.show();\n };\n\n if (!config || config.deferUpdate !== false) {\n updateViewbox = debounce(updateViewbox, 300);\n }\n\n eventBus.on('canvas.viewbox.changed', function(event) {\n self.hide();\n updateViewbox(event.viewbox);\n });\n\n\n // remove integration\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var overlays = self.get({ element: e.element });\n\n forEach(overlays, function(o) {\n self.remove(o.id);\n });\n });\n\n\n // move integration\n\n eventBus.on([\n 'element.changed'\n ], function(e) {\n var element = e.element;\n\n var container = self._getOverlayContainer(element, true);\n\n if (container) {\n forEach(container.overlays, function(overlay) {\n self._updateOverlay(overlay);\n });\n\n self._updateOverlayContainer(container);\n }\n });\n\n\n // marker integration, simply add them on the overlays as classes, too.\n\n eventBus.on('element.marker.update', function(e) {\n var container = self._getOverlayContainer(e.element, true);\n if (container) {\n domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);\n }\n });\n};\n","module.exports = {\n __init__: [ 'overlays' ],\n overlays: [ 'type', require(50) ]\n};","'use strict';\n\nvar isArray = require(159),\n forEach = require(77);\n\n\n/**\n * A service that offers the current selection in a diagram.\n * Offers the api to control the selection, too.\n *\n * @class\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction Selection(eventBus) {\n\n this._eventBus = eventBus;\n\n this._selectedElements = [];\n\n var self = this;\n\n eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n var element = e.element;\n self.deselect(element);\n });\n}\n\nSelection.$inject = [ 'eventBus' ];\n\nmodule.exports = Selection;\n\n\nSelection.prototype.deselect = function(element) {\n var selectedElements = this._selectedElements;\n\n var idx = selectedElements.indexOf(element);\n\n if (idx !== -1) {\n var oldSelection = selectedElements.slice();\n\n selectedElements.splice(idx, 1);\n\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n }\n};\n\n\nSelection.prototype.get = function() {\n return this._selectedElements;\n};\n\nSelection.prototype.isSelected = function(element) {\n return this._selectedElements.indexOf(element) !== -1;\n};\n\n\n/**\n * This method selects one or more elements on the diagram.\n *\n * By passing an additional add parameter you can decide whether or not the element(s)\n * should be added to the already existing selection or not.\n *\n * @method Selection#select\n *\n * @param {Object|Object[]} elements element or array of elements to be selected\n * @param {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false\n */\nSelection.prototype.select = function(elements, add) {\n var selectedElements = this._selectedElements,\n oldSelection = selectedElements.slice();\n\n if (!isArray(elements)) {\n elements = elements ? [ elements ] : [];\n }\n\n // selection may be cleared by passing an empty array or null\n // to the method\n if (add) {\n forEach(elements, function(element) {\n if (selectedElements.indexOf(element) !== -1) {\n // already selected\n return;\n } else {\n selectedElements.push(element);\n }\n });\n } else {\n this._selectedElements = selectedElements = elements.slice();\n }\n this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n};\n","'use strict';\n\nvar hasPrimaryModifier = require(62).hasPrimaryModifier;\n\n\nfunction SelectionBehavior(eventBus, selection, canvas) {\n\n eventBus.on('create.end', 500, function(e) {\n if (e.context.canExecute) {\n selection.select(e.shape);\n }\n });\n\n eventBus.on('connect.end', 500, function(e) {\n if (e.context.canExecute && e.context.target) {\n selection.select(e.context.target);\n }\n });\n\n eventBus.on('shape.move.end', 500, function(e) {\n selection.select(e.context.shapes);\n });\n\n\n // Shift + click selection\n eventBus.on('element.click', function(event) {\n\n var element = event.element;\n\n // do not select the root element\n // or connections\n if (element === canvas.getRootElement()) {\n element = null;\n }\n\n var isSelected = selection.isSelected(element),\n isMultiSelect = selection.get().length > 1;\n\n // mouse-event: SELECTION_KEY\n var add = hasPrimaryModifier(event);\n\n // select OR deselect element in multi selection\n if (isSelected && isMultiSelect) {\n if (add) {\n return selection.deselect(element);\n } else {\n return selection.select(element);\n }\n } else\n if (!isSelected) {\n selection.select(element, add);\n } else {\n selection.deselect(element);\n }\n });\n}\n\nSelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];\n\nmodule.exports = SelectionBehavior;\n","'use strict';\n\nvar forEach = require(77);\n\nvar MARKER_HOVER = 'hover',\n MARKER_SELECTED = 'selected';\n\n\n/**\n * A plugin that adds a visible selection UI to shapes and connections\n * by appending the <code>hover</code> and <code>selected</code> classes to them.\n *\n * @class\n *\n * Makes elements selectable, too.\n *\n * @param {EventBus} events\n * @param {SelectionService} selection\n * @param {Canvas} canvas\n */\nfunction SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {\n\n this._multiSelectionBox = null;\n\n function addMarker(e, cls) {\n canvas.addMarker(e, cls);\n }\n\n function removeMarker(e, cls) {\n canvas.removeMarker(e, cls);\n }\n\n events.on('element.hover', function(event) {\n addMarker(event.element, MARKER_HOVER);\n });\n\n events.on('element.out', function(event) {\n removeMarker(event.element, MARKER_HOVER);\n });\n\n events.on('selection.changed', function(event) {\n\n function deselect(s) {\n removeMarker(s, MARKER_SELECTED);\n }\n\n function select(s) {\n addMarker(s, MARKER_SELECTED);\n }\n\n var oldSelection = event.oldSelection,\n newSelection = event.newSelection;\n\n forEach(oldSelection, function(e) {\n if (newSelection.indexOf(e) === -1) {\n deselect(e);\n }\n });\n\n forEach(newSelection, function(e) {\n if (oldSelection.indexOf(e) === -1) {\n select(e);\n }\n });\n });\n}\n\nSelectionVisuals.$inject = [\n 'eventBus',\n 'canvas',\n 'selection',\n 'graphicsFactory',\n 'styles'\n];\n\nmodule.exports = SelectionVisuals;\n","module.exports = {\n __init__: [ 'selectionVisuals', 'selectionBehavior' ],\n __depends__: [\n require(47),\n require(49)\n ],\n selection: [ 'type', require(52) ],\n selectionVisuals: [ 'type', require(54) ],\n selectionBehavior: [ 'type', require(53) ]\n};\n","'use strict';\n\nvar assign = require(168),\n inherits = require(72);\n\nvar Refs = require(194);\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),\n outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @namespace djs.model\n */\n\n/**\n * @memberOf djs.model\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n *\n * @abstract\n */\nfunction Base() {\n\n /**\n * The object that backs up the shape\n *\n * @name Base#businessObject\n * @type Object\n */\n Object.defineProperty(this, 'businessObject', {\n writable: true\n });\n\n /**\n * The parent shape\n *\n * @name Base#parent\n * @type Shape\n */\n parentRefs.bind(this, 'parent');\n\n /**\n * @name Base#label\n * @type Label\n */\n labelRefs.bind(this, 'label');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#outgoing\n * @type Array<Connection>\n */\n outgoingRefs.bind(this, 'outgoing');\n\n /**\n * The list of outgoing connections\n *\n * @name Base#incoming\n * @type Array<Connection>\n */\n incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Shape() {\n Base.call(this);\n\n /**\n * The list of children\n *\n * @name Shape#children\n * @type Array<Base>\n */\n parentRefs.bind(this, 'children');\n}\n\ninherits(Shape, Base);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Root() {\n Shape.call(this);\n}\n\ninherits(Root, Shape);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(Label, Shape);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Connection() {\n Base.call(this);\n\n /**\n * The element this connection originates from\n *\n * @name Connection#source\n * @type Base\n */\n outgoingRefs.bind(this, 'source');\n\n /**\n * The element this connection points to\n *\n * @name Connection#target\n * @type Base\n */\n incomingRefs.bind(this, 'target');\n}\n\ninherits(Connection, Base);\n\n\nvar types = {\n connection: Connection,\n shape: Shape,\n label: Label,\n root: Root\n};\n\n/**\n * Creates a new model element of the specified type\n *\n * @method create\n *\n * @example\n *\n * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });\n * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });\n *\n * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });\n *\n * @param {String} type lower-cased model name\n * @param {Object} attrs attributes to initialize the new model instance with\n *\n * @return {Base} the new model instance\n */\nmodule.exports.create = function(type, attrs) {\n var Type = types[type];\n if (!Type) {\n throw new Error('unknown type: <' + type + '>');\n }\n return assign(new Type(), attrs);\n};\n\n\nmodule.exports.Base = Base;\nmodule.exports.Root = Root;\nmodule.exports.Shape = Shape;\nmodule.exports.Connection = Connection;\nmodule.exports.Label = Label;","'use strict';\n\n/**\n * Failsafe remove an element from a collection\n *\n * @param {Array<Object>} [collection]\n * @param {Object} [element]\n *\n * @return {Object} the element that got removed or undefined\n */\nmodule.exports.remove = function(collection, element) {\n\n if (!collection || !element) {\n return;\n }\n\n var idx = collection.indexOf(element);\n if (idx === -1) {\n return;\n }\n\n collection.splice(idx, 1);\n\n return element;\n};\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n * @param {Number} idx\n */\nmodule.exports.add = function(collection, element, idx) {\n\n if (!collection || !element) {\n return;\n }\n\n if (isNaN(idx)) {\n idx = -1;\n }\n\n var currentIdx = collection.indexOf(element);\n\n if (currentIdx !== -1) {\n\n if (currentIdx === idx) {\n // nothing to do, position has not changed\n return;\n } else {\n\n if (idx !== -1) {\n // remove from current position\n collection.splice(currentIdx, 1);\n } else {\n // already exists in collection\n return;\n }\n }\n }\n\n if (idx !== -1) {\n // insert at specified position\n collection.splice(idx, 0, element);\n } else {\n // push to end\n collection.push(element);\n }\n};\n\n\n/**\n * Fail get the index of an element in a collection.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n *\n * @return {Number} the index or -1 if collection or element do\n * not exist or the element is not contained.\n */\nmodule.exports.indexOf = function(collection, element) {\n\n if (!collection || !element) {\n return -1;\n }\n\n return collection.indexOf(element);\n};\n","'use strict';\n\nvar isArray = require(159),\n isNumber = require(162),\n groupBy = require(78),\n forEach = require(77);\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Array<Object>} elements\n * @param {Object} e\n * @param {Boolean} unique\n */\nfunction add(elements, e, unique) {\n var canAdd = !unique || elements.indexOf(e) === -1;\n\n if (canAdd) {\n elements.push(e);\n }\n\n return canAdd;\n}\n\nfunction eachElement(elements, fn, depth) {\n\n depth = depth || 0;\n\n forEach(elements, function(s, i) {\n var filter = fn(s, i, depth);\n\n if (isArray(filter) && filter.length) {\n eachElement(filter, fn, depth + 1);\n }\n });\n}\n\n/**\n * Collects self + child elements up to a given depth from a list of elements.\n *\n * @param {Array<djs.model.Base>} elements the elements to select the children from\n * @param {Boolean} unique whether to return a unique result set (no duplicates)\n * @param {Number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Array<djs.model.Base>} found elements\n */\nfunction selfAndChildren(elements, unique, maxDepth) {\n var result = [],\n processedChildren = [];\n\n eachElement(elements, function(element, i, depth) {\n add(result, element, unique);\n\n var children = element.children;\n\n // max traversal depth not reached yet\n if (maxDepth === -1 || depth < maxDepth) {\n\n // children exist && children not yet processed\n if (children && add(processedChildren, children, unique)) {\n return children;\n }\n }\n });\n\n return result;\n}\n\n/**\n * Return self + direct children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndDirectChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, 1);\n}\n\n/**\n * Return self + ALL children for a number of elements\n *\n * @param {Array<djs.model.Base>} elements to query\n * @param {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndAllChildren(elements, allowDuplicates) {\n return selfAndChildren(elements, !allowDuplicates, -1);\n}\n\n/**\n * Gets the the closure fo all selected elements,\n * their connections and\n *\n * @param {Array<djs.model.Base>} elements\n * @return {Object} enclosure\n */\nfunction getClosure(elements) {\n\n // original elements passed to this function\n var topLevel = groupBy(elements, function(e) { return e.id; });\n\n var allShapes = {},\n allConnections = {},\n enclosedElements = {},\n enclosedConnections = {};\n\n function handleConnection(c) {\n if (topLevel[c.source.id] && topLevel[c.target.id]) {\n topLevel[c.id] = c;\n }\n\n // not enclosed as a child, but maybe logically\n // (connecting two moved elements?)\n if (allShapes[c.source.id] && allShapes[c.target.id]) {\n enclosedConnections[c.id] = enclosedElements[c.id] = c;\n }\n\n allConnections[c.id] = c;\n }\n\n function handleElement(element) {\n\n enclosedElements[element.id] = element;\n\n if (element.waypoints) {\n // remember connection\n enclosedConnections[element.id] = allConnections[element.id] = element;\n } else {\n // remember shape\n allShapes[element.id] = element;\n\n // remember all connections\n forEach(element.incoming, handleConnection);\n\n forEach(element.outgoing, handleConnection);\n\n // recurse into children\n return element.children;\n }\n }\n\n eachElement(elements, handleElement);\n\n return {\n allShapes: allShapes,\n allConnections: allConnections,\n topLevel: topLevel,\n enclosedConnections: enclosedConnections,\n enclosedElements: enclosedElements\n };\n}\n\n/**\n * Returns the surrounding bbox for all elements in the array or the element primitive.\n */\nfunction getBBox(elements, stopRecursion) {\n\n stopRecursion = !!stopRecursion;\n if (!isArray(elements)) {\n elements = [elements];\n }\n\n var minX,\n minY,\n maxX,\n maxY;\n\n forEach(elements, function(element) {\n\n // If element is a connection the bbox must be computed first\n var bbox = element;\n if (element.waypoints && !stopRecursion) {\n bbox = getBBox(element.waypoints, true);\n }\n\n var x = bbox.x,\n y = bbox.y,\n height = bbox.height || 0,\n width = bbox.width || 0;\n\n if (x < minX || minX === undefined) {\n minX = x;\n }\n if (y < minY || minY === undefined) {\n minY = y;\n }\n\n if ((x + width) > maxX || maxX === undefined) {\n maxX = x + width;\n }\n if ((y + height) > maxY || maxY === undefined) {\n maxY = y + height;\n }\n });\n\n return {\n x: minX,\n y: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n}\n\n\n/**\n * Returns all elements that are enclosed from the bounding box.\n *\n * @param {Array<Object>} elements List of Elements to search through\n * @param {Object} bbox the enclosing bbox.\n * <ul>\n * <li>If bbox.(width|height) is not specified\n * the method returns all elements with element.x/y &gt; bbox.x/y\n * </li>\n * <li>If only bbox.x or bbox.y is specified, method return all elements with\n * e.x &gt; bbox.x or e.y &gt; bbox.y.</li>\n * </ul>\n *\n */\nfunction getEnclosedElements(elements, bbox) {\n\n var filteredElements = {};\n\n forEach(elements, function(element) {\n\n var e = element;\n\n if (e.waypoints) {\n e = getBBox(e);\n }\n\n if (!isNumber(bbox.y) && (e.x > bbox.x)) {\n filteredElements[element.id] = element;\n }\n if (!isNumber(bbox.x) && (e.y > bbox.y)) {\n filteredElements[element.id] = element;\n }\n if (e.x > bbox.x && e.y > bbox.y) {\n if (isNumber(bbox.width) && isNumber(bbox.height) &&\n e.width + e.x < bbox.width + bbox.x &&\n e.height + e.y < bbox.height + bbox.y) {\n\n filteredElements[element.id] = element;\n } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {\n filteredElements[element.id] = element;\n }\n }\n });\n\n return filteredElements;\n}\n\n\n\nmodule.exports.eachElement = eachElement;\nmodule.exports.selfAndDirectChildren = selfAndDirectChildren;\nmodule.exports.selfAndAllChildren = selfAndAllChildren;\nmodule.exports.getBBox = getBBox;\nmodule.exports.getEnclosedElements = getEnclosedElements;\n\nmodule.exports.getClosure = getClosure;\n","'use strict';\n\nfunction __preventDefault(event) {\n return event && event.preventDefault();\n}\n\nfunction __stopPropagation(event, immediate) {\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (immediate && event.stopImmediatePropagation) {\n event.stopImmediatePropagation();\n }\n}\n\n\nfunction getOriginal(event) {\n return event.originalEvent || event.srcEvent;\n}\n\nmodule.exports.getOriginal = getOriginal;\n\n\nfunction stopEvent(event, immediate) {\n stopPropagation(event, immediate);\n preventDefault(event);\n}\n\nmodule.exports.stopEvent = stopEvent;\n\n\nfunction preventDefault(event) {\n __preventDefault(event);\n __preventDefault(getOriginal(event));\n}\n\nmodule.exports.preventDefault = preventDefault;\n\n\nfunction stopPropagation(event, immediate) {\n __stopPropagation(event, immediate);\n __stopPropagation(getOriginal(event), immediate);\n}\n\nmodule.exports.stopPropagation = stopPropagation;\n\n\nfunction toPoint(event) {\n\n if (event.pointers && event.pointers.length) {\n event = event.pointers[0];\n }\n\n if (event.touches && event.touches.length) {\n event = event.touches[0];\n }\n\n return event ? {\n x: event.clientX,\n y: event.clientY\n } : null;\n}\n\nmodule.exports.toPoint = toPoint;\n","'use strict';\n\n/**\n * SVGs for elements are generated by the {@link GraphicsFactory}.\n *\n * This utility gives quick access to the important semantic\n * parts of an element.\n */\n\n/**\n * Returns the visual part of a diagram element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Snap<SVGElement>}\n */\nfunction getVisual(gfx) {\n return gfx.select('.djs-visual');\n}\n\n/**\n * Returns the children for a given diagram element.\n *\n * @param {Snap<SVGElement>} gfx\n * @return {Snap<SVGElement>}\n */\nfunction getChildren(gfx) {\n return gfx.parent().children()[1];\n}\n\n/**\n * Returns the visual bbox of an element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Bounds}\n */\nfunction getBBox(gfx) {\n return getVisual(gfx).select('*').getBBox();\n}\n\n\nmodule.exports.getVisual = getVisual;\nmodule.exports.getChildren = getChildren;\nmodule.exports.getBBox = getBBox;","'use strict';\n\n/**\n * Util that provides unique IDs.\n *\n * @class djs.util.IdGenerator\n * @constructor\n * @memberOf djs.util\n *\n * The ids can be customized via a given prefix and contain a random value to avoid collisions.\n *\n * @param {String} prefix a prefix to prepend to generated ids (for better readability)\n */\nfunction IdGenerator(prefix) {\n\n this._counter = 0;\n this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';\n}\n\nmodule.exports = IdGenerator;\n\n/**\n * Returns a next unique ID.\n *\n * @method djs.util.IdGenerator#next\n *\n * @returns {String} the id\n */\nIdGenerator.prototype.next = function() {\n return this._prefix + (++this._counter);\n};\n","'use strict';\n\nvar getOriginalEvent = require(59).getOriginal;\n\nvar isMac = require(63).isMac;\n\n\nfunction isPrimaryButton(event) {\n // button === 0 -> left áka primary mouse button\n return !(getOriginalEvent(event) || event).button;\n}\n\nmodule.exports.isPrimaryButton = isPrimaryButton;\n\nmodule.exports.isMac = isMac;\n\nmodule.exports.hasPrimaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n if (!isPrimaryButton(event)) {\n return false;\n }\n\n // Use alt as primary modifier key for mac OS\n if (isMac()) {\n return originalEvent.altKey;\n } else {\n return originalEvent.ctrlKey;\n }\n};\n\n\nmodule.exports.hasSecondaryModifier = function(event) {\n var originalEvent = getOriginalEvent(event) || event;\n\n return isPrimaryButton(event) && originalEvent.shiftKey;\n};\n","'use strict';\n\nmodule.exports.isMac = function isMac() {\n return (/mac/i).test(navigator.platform);\n};","'use strict';\n\nvar isObject = require(163),\n assign = require(168),\n forEach = require(77),\n reduce = require(81),\n merge = require(171);\n\nvar Snap = require(67);\n\nvar DEFAULT_BOX_PADDING = 0;\n\nvar DEFAULT_LABEL_SIZE = {\n width: 150,\n height: 50\n};\n\n\nfunction parseAlign(align) {\n\n var parts = align.split('-');\n\n return {\n horizontal: parts[0] || 'center',\n vertical: parts[1] || 'top'\n };\n}\n\nfunction parsePadding(padding) {\n\n if (isObject(padding)) {\n return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);\n } else {\n return {\n top: padding,\n left: padding,\n right: padding,\n bottom: padding\n };\n }\n}\n\nfunction getTextBBox(text, fakeText) {\n fakeText.textContent = text;\n return fakeText.getBBox();\n}\n\n\n/**\n * Layout the next line and return the layouted element.\n *\n * Alters the lines passed.\n *\n * @param {Array<String>} lines\n * @return {Object} the line descriptor, an object { width, height, text }\n */\nfunction layoutNext(lines, maxWidth, fakeText) {\n\n var originalLine = lines.shift(),\n fitLine = originalLine;\n\n var textBBox;\n\n while (true) {\n textBBox = getTextBBox(fitLine, fakeText);\n\n textBBox.width = fitLine ? textBBox.width : 0;\n\n // try to fit\n if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {\n return fit(lines, fitLine, originalLine, textBBox);\n }\n\n\n fitLine = shortenLine(fitLine, textBBox.width, maxWidth);\n }\n}\n\nfunction fit(lines, fitLine, originalLine, textBBox) {\n if (fitLine.length < originalLine.length) {\n var nextLine = lines[0] || '',\n remainder = originalLine.slice(fitLine.length).trim();\n\n if (/-/s*$/.test(remainder)) {\n nextLine = remainder.replace(/-/s*$/, '') + nextLine.replace(/^/s+/, '');\n } else {\n nextLine = remainder + ' ' + nextLine;\n }\n\n lines[0] = nextLine;\n }\n return { width: textBBox.width, height: textBBox.height, text: fitLine };\n}\n\n\n/**\n * Shortens a line based on spacing and hyphens.\n * Returns the shortened result on success.\n *\n * @param {String} line\n * @param {Number} maxLength the maximum characters of the string\n * @return {String} the shortened string\n */\nfunction semanticShorten(line, maxLength) {\n var parts = line.split(/(/s|-)/g),\n part,\n shortenedParts = [],\n length = 0;\n\n // try to shorten via spaces + hyphens\n if (parts.length > 1) {\n while ((part = parts.shift())) {\n if (part.length + length < maxLength) {\n shortenedParts.push(part);\n length += part.length;\n } else {\n // remove previous part, too if hyphen does not fit anymore\n if (part === '-') {\n shortenedParts.pop();\n }\n\n break;\n }\n }\n }\n\n return shortenedParts.join('');\n}\n\n\nfunction shortenLine(line, width, maxWidth) {\n var length = Math.max(line.length * (maxWidth / width), 1);\n\n // try to shorten semantically (i.e. based on spaces and hyphens)\n var shortenedLine = semanticShorten(line, length);\n\n if (!shortenedLine) {\n\n // force shorten by cutting the long word\n shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));\n }\n\n return shortenedLine;\n}\n\n\n/**\n * Creates a new label utility\n *\n * @param {Object} config\n * @param {Dimensions} config.size\n * @param {Number} config.padding\n * @param {Object} config.style\n * @param {String} config.align\n */\nfunction Text(config) {\n\n this._config = assign({}, {\n size: DEFAULT_LABEL_SIZE,\n padding: DEFAULT_BOX_PADDING,\n style: {},\n align: 'center-top'\n }, config || {});\n}\n\n\n/**\n * Create a label in the parent node.\n *\n * @method Text#createText\n *\n * @param {SVGElement} parent the parent to draw the label on\n * @param {String} text the text to render on the label\n * @param {Object} options\n * @param {String} options.align how to align in the bounding box.\n * Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.\n * @param {String} options.style style to be applied to the text\n *\n * @return {SVGText} the text element created\n */\nText.prototype.createText = function(parent, text, options) {\n\n var box = merge({}, this._config.size, options.box || {}),\n style = merge({}, this._config.style, options.style || {}),\n align = parseAlign(options.align || this._config.align),\n padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);\n\n var lines = text.split(//r?/n/g),\n layouted = [];\n\n var maxWidth = box.width - padding.left - padding.right;\n\n // FF regression: ensure text is shown during rendering\n // by attaching it directly to the body\n var fakeText = parent.paper.text(0, 0, '').attr(style).node;\n\n while (lines.length) {\n layouted.push(layoutNext(lines, maxWidth, fakeText));\n }\n\n var totalHeight = reduce(layouted, function(sum, line, idx) {\n return sum + line.height;\n }, 0);\n\n // the y position of the next line\n var y, x;\n\n switch (align.vertical) {\n case 'middle':\n y = (box.height - totalHeight) / 2 - layouted[0].height / 4;\n break;\n\n default:\n y = padding.top;\n }\n\n var textElement = parent.text().attr(style);\n\n forEach(layouted, function(line) {\n y += line.height;\n\n switch (align.horizontal) {\n case 'left':\n x = padding.left;\n break;\n\n case 'right':\n x = (maxWidth - padding.right - line.width);\n break;\n\n default:\n // aka center\n x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);\n }\n\n\n var tspan = Snap.create('tspan', { x: x, y: y }).node;\n tspan.textContent = line.text;\n\n textElement.append(tspan);\n });\n\n // remove fake text\n fakeText.parentNode.removeChild(fakeText);\n\n return textElement;\n};\n\n\nmodule.exports = Text;","// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ┌────────────────────────────────────────────────────────────┐ //\n// │ Eve 0.4.2 - JavaScript Events Library │ //\n// ├────────────────────────────────────────────────────────────┤ //\n// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ //\n// └────────────────────────────────────────────────────────────┘ //\n\n(function (glob) {\n var version = \"0.4.2\",\n has = \"hasOwnProperty\",\n separator = /[/.//]/,\n comaseparator = //s*,/s*/,\n wildcard = \"*\",\n fun = function () {},\n numsort = function (a, b) {\n return a - b;\n },\n current_event,\n stop,\n events = {n: {}},\n firstDefined = function () {\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n lastDefined = function () {\n var i = this.length;\n while (--i) {\n if (typeof this[i] != \"undefined\") {\n return this[i];\n }\n }\n },\n /*/\n * eve\n [ method ]\n\n * Fires event with given `name`, given scope and other parameters.\n\n > Arguments\n\n - name (string) name of the *event*, dot (`.`) or slash (`/`) separated\n - scope (object) context for the event handlers\n - varargs (...) the rest of arguments will be sent to event handlers\n\n = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.\n /*/\n eve = function (name, scope) {\n name = String(name);\n var e = events,\n oldstop = stop,\n args = Array.prototype.slice.call(arguments, 2),\n listeners = eve.listeners(name),\n z = 0,\n f = false,\n l,\n indexed = [],\n queue = {},\n out = [],\n ce = current_event,\n errors = [];\n out.firstDefined = firstDefined;\n out.lastDefined = lastDefined;\n current_event = name;\n stop = 0;\n for (var i = 0, ii = listeners.length; i < ii; i++) if (\"zIndex\" in listeners[i]) {\n indexed.push(listeners[i].zIndex);\n if (listeners[i].zIndex < 0) {\n queue[listeners[i].zIndex] = listeners[i];\n }\n }\n indexed.sort(numsort);\n while (indexed[z] < 0) {\n l = queue[indexed[z++]];\n out.push(l.apply(scope, args));\n if (stop) {\n stop = oldstop;\n return out;\n }\n }\n for (i = 0; i < ii; i++) {\n l = listeners[i];\n if (\"zIndex\" in l) {\n if (l.zIndex == indexed[z]) {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n do {\n z++;\n l = queue[indexed[z]];\n l && out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n } while (l)\n } else {\n queue[l.zIndex] = l;\n }\n } else {\n out.push(l.apply(scope, args));\n if (stop) {\n break;\n }\n }\n }\n stop = oldstop;\n current_event = ce;\n return out;\n };\n // Undocumented. Debug only.\n eve._events = events;\n /*/\n * eve.listeners\n [ method ]\n\n * Internal method which gives you array of all event handlers that will be triggered by the given `name`.\n\n > Arguments\n\n - name (string) name of the event, dot (`.`) or slash (`/`) separated\n\n = (array) array of event handlers\n /*/\n eve.listeners = function (name) {\n var names = name.split(separator),\n e = events,\n item,\n items,\n k,\n i,\n ii,\n j,\n jj,\n nes,\n es = [e],\n out = [];\n for (i = 0, ii = names.length; i < ii; i++) {\n nes = [];\n for (j = 0, jj = es.length; j < jj; j++) {\n e = es[j].n;\n items = [e[names[i]], e[wildcard]];\n k = 2;\n while (k--) {\n item = items[k];\n if (item) {\n nes.push(item);\n out = out.concat(item.f || []);\n }\n }\n }\n es = nes;\n }\n return out;\n };\n \n /*/\n * eve.on\n [ method ]\n **\n * Binds given event handler with a given name. You can use wildcards “`*`” for the names:\n | eve.on(\"*.under.*\", f);\n | eve(\"mouse.under.floor\"); // triggers f\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. \n > Example:\n | eve.on(\"mouse\", eatIt)(2);\n | eve.on(\"mouse\", scream);\n | eve.on(\"mouse\", catchIt)(1);\n * This will ensure that `catchIt` function will be called before `eatIt`.\n *\n * If you want to put your handler before non-indexed handlers, specify a negative value.\n * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.\n /*/\n eve.on = function (name, f) {\n name = String(name);\n if (typeof f != \"function\") {\n return function () {};\n }\n var names = name.split(comaseparator);\n for (var i = 0, ii = names.length; i < ii; i++) {\n (function (name) {\n var names = name.split(separator),\n e = events,\n exist;\n for (var i = 0, ii = names.length; i < ii; i++) {\n e = e.n;\n e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});\n }\n e.f = e.f || [];\n for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {\n exist = true;\n break;\n }\n !exist && e.f.push(f);\n }(names[i]));\n }\n return function (zIndex) {\n if (+zIndex == +zIndex) {\n f.zIndex = +zIndex;\n }\n };\n };\n /*/\n * eve.f\n [ method ]\n **\n * Returns function that will fire given event with optional arguments.\n * Arguments that will be passed to the result function will be also\n * concated to the list of final arguments.\n | el.onclick = eve.f(\"click\", 1, 2);\n | eve.on(\"click\", function (a, b, c) {\n | console.log(a, b, c); // 1, 2, [event object]\n | });\n > Arguments\n - event (string) event name\n - varargs (…) and any other arguments\n = (function) possible event handler function\n /*/\n eve.f = function (event) {\n var attrs = [].slice.call(arguments, 1);\n return function () {\n eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));\n };\n };\n /*/\n * eve.stop\n [ method ]\n **\n * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.\n /*/\n eve.stop = function () {\n stop = 1;\n };\n /*/\n * eve.nt\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n > Arguments\n **\n - subname (string) #optional subname of the event\n **\n = (string) name of the event, if `subname` is not specified\n * or\n = (boolean) `true`, if current event’s name contains `subname`\n /*/\n eve.nt = function (subname) {\n if (subname) {\n return new RegExp(\"(?://.|///|^)\" + subname + \"(?://.|///|$)\").test(current_event);\n }\n return current_event;\n };\n /*/\n * eve.nts\n [ method ]\n **\n * Could be used inside event handler to figure out actual name of the event.\n **\n **\n = (array) names of the event\n /*/\n eve.nts = function () {\n return current_event.split(separator);\n };\n /*/\n * eve.off\n [ method ]\n **\n * Removes given function from the list of event listeners assigned to given name.\n * If no arguments specified all the events will be cleared.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n /*/\n /*/\n * eve.unbind\n [ method ]\n **\n * See @eve.off\n /*/\n eve.off = eve.unbind = function (name, f) {\n if (!name) {\n eve._events = events = {n: {}};\n return;\n }\n var names = name.split(comaseparator);\n if (names.length > 1) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n eve.off(names[i], f);\n }\n return;\n }\n names = name.split(separator);\n var e,\n key,\n splice,\n i, ii, j, jj,\n cur = [events];\n for (i = 0, ii = names.length; i < ii; i++) {\n for (j = 0; j < cur.length; j += splice.length - 2) {\n splice = [j, 1];\n e = cur[j].n;\n if (names[i] != wildcard) {\n if (e[names[i]]) {\n splice.push(e[names[i]]);\n }\n } else {\n for (key in e) if (e[has](key)) {\n splice.push(e[key]);\n }\n }\n cur.splice.apply(cur, splice);\n }\n }\n for (i = 0, ii = cur.length; i < ii; i++) {\n e = cur[i];\n while (e.n) {\n if (f) {\n if (e.f) {\n for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {\n e.f.splice(j, 1);\n break;\n }\n !e.f.length && delete e.f;\n }\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n var funcs = e.n[key].f;\n for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {\n funcs.splice(j, 1);\n break;\n }\n !funcs.length && delete e.n[key].f;\n }\n } else {\n delete e.f;\n for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n delete e.n[key].f;\n }\n }\n e = e.n;\n }\n }\n };\n /*/\n * eve.once\n [ method ]\n **\n * Binds given event handler with a given name to only run once then unbind itself.\n | eve.once(\"login\", f);\n | eve(\"login\"); // triggers f\n | eve(\"login\"); // no listeners\n * Use @eve to trigger the listener.\n **\n > Arguments\n **\n - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n - f (function) event handler function\n **\n = (function) same return function as @eve.on\n /*/\n eve.once = function (name, f) {\n var f2 = function () {\n eve.unbind(name, f2);\n return f.apply(this, arguments);\n };\n return eve.on(name, f2);\n };\n /*/\n * eve.version\n [ property (string) ]\n **\n * Current version of the library.\n /*/\n eve.version = version;\n eve.toString = function () {\n return \"You are running Eve \" + version;\n };\n (typeof module != \"undefined\" && module.exports) ? (module.exports = eve) : (typeof define === \"function\" && define.amd ? (define(\"eve\", [], function() { return eve; })) : (glob.eve = eve));\n})(this);\n","// Snap.svg 0.3.0\n// \n// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// \n// build: 2014-09-08\n\n(function (glob, factory) {\n // AMD support\n if (typeof define === \"function\" && define.amd) {\n // Define as an anonymous module\n define([\"eve\"], function( eve ) {\n return factory(glob, eve);\n });\n } else if (typeof exports !== 'undefined') {\n // Next for Node.js or CommonJS\n var eve = require(65);\n module.exports = factory(glob, eve);\n } else {\n // Browser globals (glob is window)\n // Snap adds itself to window\n factory(glob, glob.eve);\n }\n}(window || this, function (window, eve) {\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar mina = (function (eve) {\n var animations = {},\n requestAnimFrame = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, 16);\n },\n isArray = Array.isArray || function (a) {\n return a instanceof Array ||\n Object.prototype.toString.call(a) == \"[object Array]\";\n },\n idgen = 0,\n idprefix = \"M\" + (+new Date).toString(36),\n ID = function () {\n return idprefix + (idgen++).toString(36);\n },\n diff = function (a, b, A, B) {\n if (isArray(a)) {\n res = [];\n for (var i = 0, ii = a.length; i < ii; i++) {\n res[i] = diff(a[i], b, A[i], B);\n }\n return res;\n }\n var dif = (A - a) / (B - b);\n return function (bb) {\n return a + dif * (bb - b);\n };\n },\n timer = Date.now || function () {\n return +new Date;\n },\n sta = function (val) {\n var a = this;\n if (val == null) {\n return a.s;\n }\n var ds = a.s - val;\n a.b += a.dur * ds;\n a.B += a.dur * ds;\n a.s = val;\n },\n speed = function (val) {\n var a = this;\n if (val == null) {\n return a.spd;\n }\n a.spd = val;\n },\n duration = function (val) {\n var a = this;\n if (val == null) {\n return a.dur;\n }\n a.s = a.s * val / a.dur;\n a.dur = val;\n },\n stopit = function () {\n var a = this;\n delete animations[a.id];\n a.update();\n eve(\"mina.stop.\" + a.id, a);\n },\n pause = function () {\n var a = this;\n if (a.pdif) {\n return;\n }\n delete animations[a.id];\n a.update();\n a.pdif = a.get() - a.b;\n },\n resume = function () {\n var a = this;\n if (!a.pdif) {\n return;\n }\n a.b = a.get() - a.pdif;\n delete a.pdif;\n animations[a.id] = a;\n },\n update = function () {\n var a = this,\n res;\n if (isArray(a.start)) {\n res = [];\n for (var j = 0, jj = a.start.length; j < jj; j++) {\n res[j] = +a.start[j] +\n (a.end[j] - a.start[j]) * a.easing(a.s);\n }\n } else {\n res = +a.start + (a.end - a.start) * a.easing(a.s);\n }\n a.set(res);\n },\n frame = function () {\n var len = 0;\n for (var i in animations) if (animations.hasOwnProperty(i)) {\n var a = animations[i],\n b = a.get(),\n res;\n len++;\n a.s = (b - a.b) / (a.dur / a.spd);\n if (a.s >= 1) {\n delete animations[i];\n a.s = 1;\n len--;\n (function (a) {\n setTimeout(function () {\n eve(\"mina.finish.\" + a.id, a);\n });\n }(a));\n }\n a.update();\n }\n len && requestAnimFrame(frame);\n },\n /*/\n * mina\n [ method ]\n **\n * Generic animation of numbers\n **\n - a (number) start _slave_ number\n - A (number) end _slave_ number\n - b (number) start _master_ number (start time in general case)\n - B (number) end _master_ number (end time in gereal case)\n - get (function) getter of _master_ number (see @mina.time)\n - set (function) setter of _slave_ number\n - easing (function) #optional easing function, default is @mina.linear\n = (object) animation descriptor\n o {\n o id (string) animation id,\n o start (number) start _slave_ number,\n o end (number) end _slave_ number,\n o b (number) start _master_ number,\n o s (number) animation status (0..1),\n o dur (number) animation duration,\n o spd (number) animation speed,\n o get (function) getter of _master_ number (see @mina.time),\n o set (function) setter of _slave_ number,\n o easing (function) easing function, default is @mina.linear,\n o status (function) status getter/setter,\n o speed (function) speed getter/setter,\n o duration (function) duration getter/setter,\n o stop (function) animation stopper\n o pause (function) pauses the animation\n o resume (function) resumes the animation\n o update (function) calles setter with the right value of the animation\n o }\n /*/\n mina = function (a, A, b, B, get, set, easing) {\n var anim = {\n id: ID(),\n start: a,\n end: A,\n b: b,\n s: 0,\n dur: B - b,\n spd: 1,\n get: get,\n set: set,\n easing: easing || mina.linear,\n status: sta,\n speed: speed,\n duration: duration,\n stop: stopit,\n pause: pause,\n resume: resume,\n update: update\n };\n animations[anim.id] = anim;\n var len = 0, i;\n for (i in animations) if (animations.hasOwnProperty(i)) {\n len++;\n if (len == 2) {\n break;\n }\n }\n len == 1 && requestAnimFrame(frame);\n return anim;\n };\n /*/\n * mina.time\n [ method ]\n **\n * Returns the current time. Equivalent to:\n | function () {\n | return (new Date).getTime();\n | }\n /*/\n mina.time = timer;\n /*/\n * mina.getById\n [ method ]\n **\n * Returns an animation by its id\n - id (string) animation's id\n = (object) See @mina\n /*/\n mina.getById = function (id) {\n return animations[id] || null;\n };\n\n /*/\n * mina.linear\n [ method ]\n **\n * Default linear easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.linear = function (n) {\n return n;\n };\n /*/\n * mina.easeout\n [ method ]\n **\n * Easeout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeout = function (n) {\n return Math.pow(n, 1.7);\n };\n /*/\n * mina.easein\n [ method ]\n **\n * Easein easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easein = function (n) {\n return Math.pow(n, .48);\n };\n /*/\n * mina.easeinout\n [ method ]\n **\n * Easeinout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.easeinout = function (n) {\n if (n == 1) {\n return 1;\n }\n if (n == 0) {\n return 0;\n }\n var q = .48 - n / 1.04,\n Q = Math.sqrt(.1734 + q * q),\n x = Q - q,\n X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),\n y = -Q - q,\n Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),\n t = X + Y + .5;\n return (1 - t) * 3 * t * t + t * t * t;\n };\n /*/\n * mina.backin\n [ method ]\n **\n * Backin easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backin = function (n) {\n if (n == 1) {\n return 1;\n }\n var s = 1.70158;\n return n * n * ((s + 1) * n - s);\n };\n /*/\n * mina.backout\n [ method ]\n **\n * Backout easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.backout = function (n) {\n if (n == 0) {\n return 0;\n }\n n = n - 1;\n var s = 1.70158;\n return n * n * ((s + 1) * n + s) + 1;\n };\n /*/\n * mina.elastic\n [ method ]\n **\n * Elastic easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.elastic = function (n) {\n if (n == !!n) {\n return n;\n }\n return Math.pow(2, -10 * n) * Math.sin((n - .075) *\n (2 * Math.PI) / .3) + 1;\n };\n /*/\n * mina.bounce\n [ method ]\n **\n * Bounce easing\n - n (number) input 0..1\n = (number) output 0..1\n /*/\n mina.bounce = function (n) {\n var s = 7.5625,\n p = 2.75,\n l;\n if (n < (1 / p)) {\n l = s * n * n;\n } else {\n if (n < (2 / p)) {\n n -= (1.5 / p);\n l = s * n * n + .75;\n } else {\n if (n < (2.5 / p)) {\n n -= (2.25 / p);\n l = s * n * n + .9375;\n } else {\n n -= (2.625 / p);\n l = s * n * n + .984375;\n }\n }\n }\n return l;\n };\n window.mina = mina;\n return mina;\n})(typeof eve == \"undefined\" ? function () {} : eve);\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nvar Snap = (function(root) {\nSnap.version = \"0.3.0\";\n/*/\n * Snap\n [ method ]\n **\n * Creates a drawing surface or wraps existing SVG element.\n **\n - width (number|string) width of surface\n - height (number|string) height of surface\n * or\n - DOM (SVGElement) element to be wrapped into Snap structure\n * or\n - array (array) array of elements (will return set of elements)\n * or\n - query (string) CSS query selector\n = (object) @Element\n/*/\nfunction Snap(w, h) {\n if (w) {\n if (w.tagName) {\n return wrap(w);\n }\n if (is(w, \"array\") && Snap.set) {\n return Snap.set.apply(Snap, w);\n }\n if (w instanceof Element) {\n return w;\n }\n if (h == null) {\n w = glob.doc.querySelector(w);\n return wrap(w);\n }\n }\n w = w == null ? \"100%\" : w;\n h = h == null ? \"100%\" : h;\n return new Paper(w, h);\n}\nSnap.toString = function () {\n return \"Snap v\" + this.version;\n};\nSnap._ = {};\nvar glob = {\n win: root.window,\n doc: root.window.document\n};\nSnap._.glob = glob;\nvar has = \"hasOwnProperty\",\n Str = String,\n toFloat = parseFloat,\n toInt = parseInt,\n math = Math,\n mmax = math.max,\n mmin = math.min,\n abs = math.abs,\n pow = math.pow,\n PI = math.PI,\n round = math.round,\n E = \"\",\n S = \" \",\n objectToString = Object.prototype.toString,\n ISURL = /^url/(['\"]?([^/)]+?)['\"]?/)$/i,\n colourRegExp = /^/s*((#[a-f/d]{6})|(#[a-f/d]{3})|rgba?/(/s*([/d/.]+%?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+%?(?:/s*,/s*[/d/.]+%?)?)/s*/)|hsba?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/)|hsla?/(/s*([/d/.]+(?:deg|/xb0|%)?/s*,/s*[/d/.]+%?/s*,/s*[/d/.]+(?:%?/s*,/s*[/d/.]+)?%?)/s*/))/s*$/i,\n bezierrg = /^(?:cubic-)?bezier/(([^,]+),([^,]+),([^,]+),([^/)]+)/)/,\n reURLValue = /^url/(#?([^)]+)/)$/,\n separator = Snap._.separator = /[,/s]+/,\n whitespace = /[/s]/g,\n commaSpaces = /[/s]*,[/s]*/,\n hsrg = {hs: 1, rg: 1},\n pathCommand = /([a-z])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n tCommand = /([rstm])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n pathValues = /(-?/d*/.?/d*(?:e[/-+]?//d+)?)[/s]*,?[/s]*/ig,\n idgen = 0,\n idprefix = \"S\" + (+new Date).toString(36),\n ID = function (el) {\n return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);\n },\n xlink = \"http://www.w3.org/1999/xlink\",\n xmlns = \"http://www.w3.org/2000/svg\",\n hub = {},\n URL = Snap.url = function (url) {\n return \"url('#\" + url + \"')\";\n };\n\nfunction $(el, attr) {\n if (attr) {\n if (el == \"#text\") {\n el = glob.doc.createTextNode(attr.text || \"\");\n }\n if (typeof el == \"string\") {\n el = $(el);\n }\n if (typeof attr == \"string\") {\n if (attr.substring(0, 6) == \"xlink:\") {\n return el.getAttributeNS(xlink, attr.substring(6));\n }\n if (attr.substring(0, 4) == \"xml:\") {\n return el.getAttributeNS(xmlns, attr.substring(4));\n }\n return el.getAttribute(attr);\n }\n for (var key in attr) if (attr[has](key)) {\n var val = Str(attr[key]);\n if (val) {\n if (key.substring(0, 6) == \"xlink:\") {\n el.setAttributeNS(xlink, key.substring(6), val);\n } else if (key.substring(0, 4) == \"xml:\") {\n el.setAttributeNS(xmlns, key.substring(4), val);\n } else {\n el.setAttribute(key, val);\n }\n } else {\n el.removeAttribute(key);\n }\n }\n } else {\n el = glob.doc.createElementNS(xmlns, el);\n }\n return el;\n}\nSnap._.$ = $;\nSnap._.id = ID;\nfunction getAttrs(el) {\n var attrs = el.attributes,\n name,\n out = {};\n for (var i = 0; i < attrs.length; i++) {\n if (attrs[i].namespaceURI == xlink) {\n name = \"xlink:\";\n } else {\n name = \"\";\n }\n name += attrs[i].name;\n out[name] = attrs[i].textContent;\n }\n return out;\n}\nfunction is(o, type) {\n type = Str.prototype.toLowerCase.call(type);\n if (type == \"finite\") {\n return isFinite(o);\n }\n if (type == \"array\" &&\n (o instanceof Array || Array.isArray && Array.isArray(o))) {\n return true;\n }\n return (type == \"null\" && o === null) ||\n (type == typeof o && o !== null) ||\n (type == \"object\" && o === Object(o)) ||\n objectToString.call(o).slice(8, -1).toLowerCase() == type;\n}\n/*/\n * Snap.format\n [ method ]\n **\n * Replaces construction of type `{<name>}` to the corresponding argument\n **\n - token (string) string to format\n - json (object) object which properties are used as a replacement\n = (string) formatted string\n > Usage\n | // this draws a rectangular shape equivalent to \"M10,20h40v50h-40z\"\n | paper.path(Snap.format(\"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z\", {\n | x: 10,\n | y: 20,\n | dim: {\n | width: 40,\n | height: 50,\n | \"negative width\": -40\n | }\n | }));\n/*/\nSnap.format = (function () {\n var tokenRegex = //{([^/}]+)/}/g,\n objNotationRegex = /(?:(?:^|/.)(.+?)(?=/[|/.|$|/()|/[('|\")(.+?)/2/])(/(/))?/g, // matches .xxxxx or [\"xxxxx\"] to run over object properties\n replacer = function (all, key, obj) {\n var res = obj;\n key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {\n name = name || quotedName;\n if (res) {\n if (name in res) {\n res = res[name];\n }\n typeof res == \"function\" && isFunc && (res = res());\n }\n });\n res = (res == null || res == obj ? all : res) + \"\";\n return res;\n };\n return function (str, obj) {\n return Str(str).replace(tokenRegex, function (all, key) {\n return replacer(all, key, obj);\n });\n };\n})();\nfunction clone(obj) {\n if (typeof obj == \"function\" || Object(obj) !== obj) {\n return obj;\n }\n var res = new obj.constructor;\n for (var key in obj) if (obj[has](key)) {\n res[key] = clone(obj[key]);\n }\n return res;\n}\nSnap._.clone = clone;\nfunction repush(array, item) {\n for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {\n return array.push(array.splice(i, 1)[0]);\n }\n}\nfunction cacher(f, scope, postprocessor) {\n function newf() {\n var arg = Array.prototype.slice.call(arguments, 0),\n args = arg.join(\"/u2400\"),\n cache = newf.cache = newf.cache || {},\n count = newf.count = newf.count || [];\n if (cache[has](args)) {\n repush(count, args);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n count.length >= 1e3 && delete cache[count.shift()];\n count.push(args);\n cache[args] = f.apply(scope, arg);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n return newf;\n}\nSnap._.cacher = cacher;\nfunction angle(x1, y1, x2, y2, x3, y3) {\n if (x3 == null) {\n var x = x1 - x2,\n y = y1 - y2;\n if (!x && !y) {\n return 0;\n }\n return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;\n } else {\n return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);\n }\n}\nfunction rad(deg) {\n return deg % 360 * PI / 180;\n}\nfunction deg(rad) {\n return rad * 180 / PI % 360;\n}\nfunction x_y() {\n return this.x + S + this.y;\n}\nfunction x_y_w_h() {\n return this.x + S + this.y + S + this.width + \" /xd7 \" + this.height;\n}\n\n/*/\n * Snap.rad\n [ method ]\n **\n * Transform angle to radians\n - deg (number) angle in degrees\n = (number) angle in radians\n/*/\nSnap.rad = rad;\n/*/\n * Snap.deg\n [ method ]\n **\n * Transform angle to degrees\n - rad (number) angle in radians\n = (number) angle in degrees\n/*/\nSnap.deg = deg;\n/*/\n * Snap.angle\n [ method ]\n **\n * Returns an angle between two or three points\n > Parameters\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n - x3 (number) #optional x coord of third point\n - y3 (number) #optional y coord of third point\n = (number) angle in degrees\n/*/\nSnap.angle = angle;\n/*/\n * Snap.is\n [ method ]\n **\n * Handy replacement for the `typeof` operator\n - o (…) any object or primitive\n - type (string) name of the type, e.g., `string`, `function`, `number`, etc.\n = (boolean) `true` if given value is of given type\n/*/\nSnap.is = is;\n/*/\n * Snap.snapTo\n [ method ]\n **\n * Snaps given value to given grid\n - values (array|number) given array of values or step of the grid\n - value (number) value to adjust\n - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.\n = (number) adjusted value\n/*/\nSnap.snapTo = function (values, value, tolerance) {\n tolerance = is(tolerance, \"finite\") ? tolerance : 10;\n if (is(values, \"array\")) {\n var i = values.length;\n while (i--) if (abs(values[i] - value) <= tolerance) {\n return values[i];\n }\n } else {\n values = +values;\n var rem = value % values;\n if (rem < tolerance) {\n return value - rem;\n }\n if (rem > values - tolerance) {\n return value - rem + values;\n }\n }\n return value;\n};\n// Colour\n/*/\n * Snap.getRGB\n [ method ]\n **\n * Parses color string as RGB object\n - color (string) color string in one of the following formats:\n # <ul>\n # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>\n # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>\n # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>\n # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>\n # <li>rgba(•••, •••, •••, •••) — also with opacity</li>\n # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>\n # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>\n # <li>hsba(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>\n # <li>hsla(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>\n # </ul>\n * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) true if string can't be parsed\n o }\n/*/\nSnap.getRGB = cacher(function (colour) {\n if (!colour || !!((colour = Str(colour)).indexOf(\"-\") + 1)) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n if (colour == \"none\") {\n return {r: -1, g: -1, b: -1, hex: \"none\", toString: rgbtoString};\n }\n !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == \"#\") && (colour = toHex(colour));\n if (!colour) {\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n }\n var res,\n red,\n green,\n blue,\n opacity,\n t,\n values,\n rgb = colour.match(colourRegExp);\n if (rgb) {\n if (rgb[2]) {\n blue = toInt(rgb[2].substring(5), 16);\n green = toInt(rgb[2].substring(3, 5), 16);\n red = toInt(rgb[2].substring(1, 3), 16);\n }\n if (rgb[3]) {\n blue = toInt((t = rgb[3].charAt(3)) + t, 16);\n green = toInt((t = rgb[3].charAt(2)) + t, 16);\n red = toInt((t = rgb[3].charAt(1)) + t, 16);\n }\n if (rgb[4]) {\n values = rgb[4].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red *= 2.55);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green *= 2.55);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue *= 2.55);\n rgb[1].toLowerCase().slice(0, 4) == \"rgba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n }\n if (rgb[5]) {\n values = rgb[5].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsb2rgb(red, green, blue, opacity);\n }\n if (rgb[6]) {\n values = rgb[6].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsla\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsl2rgb(red, green, blue, opacity);\n }\n red = mmin(math.round(red), 255);\n green = mmin(math.round(green), 255);\n blue = mmin(math.round(blue), 255);\n opacity = mmin(mmax(opacity, 0), 1);\n rgb = {r: red, g: green, b: blue, toString: rgbtoString};\n rgb.hex = \"#\" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);\n rgb.opacity = is(opacity, \"finite\") ? opacity : 1;\n return rgb;\n }\n return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n}, Snap);\n// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.\n/*/\n * Snap.hsb\n [ method ]\n **\n * Converts HSB values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - b (number) value or brightness\n = (string) hex representation of the color\n/*/\nSnap.hsb = cacher(function (h, s, b) {\n return Snap.hsb2rgb(h, s, b).hex;\n});\n/*/\n * Snap.hsl\n [ method ]\n **\n * Converts HSL values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (string) hex representation of the color\n/*/\nSnap.hsl = cacher(function (h, s, l) {\n return Snap.hsl2rgb(h, s, l).hex;\n});\n/*/\n * Snap.rgb\n [ method ]\n **\n * Converts RGB values to a hex representation of the color\n - r (number) red\n - g (number) green\n - b (number) blue\n = (string) hex representation of the color\n/*/\nSnap.rgb = cacher(function (r, g, b, o) {\n if (is(o, \"finite\")) {\n var round = math.round;\n return \"rgba(\" + [round(r), round(g), round(b), +o.toFixed(2)] + \")\";\n }\n return \"#\" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);\n});\nvar toHex = function (color) {\n var i = glob.doc.getElementsByTagName(\"head\")[0] || glob.doc.getElementsByTagName(\"svg\")[0],\n red = \"rgb(255, 0, 0)\";\n toHex = cacher(function (color) {\n if (color.toLowerCase() == \"red\") {\n return red;\n }\n i.style.color = red;\n i.style.color = color;\n var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue(\"color\");\n return out == red ? null : out;\n });\n return toHex(color);\n},\nhsbtoString = function () {\n return \"hsb(\" + [this.h, this.s, this.b] + \")\";\n},\nhsltoString = function () {\n return \"hsl(\" + [this.h, this.s, this.l] + \")\";\n},\nrgbtoString = function () {\n return this.opacity == 1 || this.opacity == null ?\n this.hex :\n \"rgba(\" + [this.r, this.g, this.b, this.opacity] + \")\";\n},\nprepareRGB = function (r, g, b) {\n if (g == null && is(r, \"object\") && \"r\" in r && \"g\" in r && \"b\" in r) {\n b = r.b;\n g = r.g;\n r = r.r;\n }\n if (g == null && is(r, string)) {\n var clr = Snap.getRGB(r);\n r = clr.r;\n g = clr.g;\n b = clr.b;\n }\n if (r > 1 || g > 1 || b > 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n }\n\n return [r, g, b];\n},\npackageRGB = function (r, g, b, o) {\n r = math.round(r * 255);\n g = math.round(g * 255);\n b = math.round(b * 255);\n var rgb = {\n r: r,\n g: g,\n b: b,\n opacity: is(o, \"finite\") ? o : 1,\n hex: Snap.rgb(r, g, b),\n toString: rgbtoString\n };\n is(o, \"finite\") && (rgb.opacity = o);\n return rgb;\n};\n// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?\n/*/\n * Snap.color\n [ method ]\n **\n * Parses the color string and returns an object featuring the color's component values\n - clr (string) color string in one of the supported formats (see @Snap.getRGB)\n = (object) Combined RGB/HSB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) `true` if string can't be parsed,\n o h (number) hue,\n o s (number) saturation,\n o v (number) value (brightness),\n o l (number) lightness\n o }\n/*/\nSnap.color = function (clr) {\n var rgb;\n if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"b\" in clr) {\n rgb = Snap.hsb2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"l\" in clr) {\n rgb = Snap.hsl2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else {\n if (is(clr, \"string\")) {\n clr = Snap.getRGB(clr);\n }\n if (is(clr, \"object\") && \"r\" in clr && \"g\" in clr && \"b\" in clr && !(\"error\" in clr)) {\n rgb = Snap.rgb2hsl(clr);\n clr.h = rgb.h;\n clr.s = rgb.s;\n clr.l = rgb.l;\n rgb = Snap.rgb2hsb(clr);\n clr.v = rgb.b;\n } else {\n clr = {hex: \"none\"};\n clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;\n clr.error = 1;\n }\n }\n clr.toString = rgbtoString;\n return clr;\n};\n/*/\n * Snap.hsb2rgb\n [ method ]\n **\n * Converts HSB values to an RGB object\n - h (number) hue\n - s (number) saturation\n - v (number) value or brightness\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsb2rgb = function (h, s, v, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"b\" in h) {\n v = h.b;\n s = h.s;\n h = h.h;\n o = h.o;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = v * s;\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = v - C;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.hsl2rgb\n [ method ]\n **\n * Converts HSL values to an RGB object\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsl2rgb = function (h, s, l, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"l\" in h) {\n l = h.l;\n s = h.s;\n h = h.h;\n }\n if (h > 1 || s > 1 || l > 1) {\n h /= 360;\n s /= 100;\n l /= 100;\n }\n h *= 360;\n var R, G, B, X, C;\n h = (h % 360) / 60;\n C = 2 * s * (l < .5 ? l : 1 - l);\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = l - C / 2;\n\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.rgb2hsb\n [ method ]\n **\n * Converts RGB values to an HSB object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSB object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o b (number) brightness\n o }\n/*/\nSnap.rgb2hsb = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, V, C;\n V = mmax(r, g, b);\n C = V - mmin(r, g, b);\n H = (C == 0 ? null :\n V == r ? (g - b) / C :\n V == g ? (b - r) / C + 2 :\n (r - g) / C + 4\n );\n H = ((H + 360) % 6) * 60 / 360;\n S = C == 0 ? 0 : C / V;\n return {h: H, s: S, b: V, toString: hsbtoString};\n};\n/*/\n * Snap.rgb2hsl\n [ method ]\n **\n * Converts RGB values to an HSL object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSL object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o l (number) luminosity\n o }\n/*/\nSnap.rgb2hsl = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n\n var H, S, L, M, m, C;\n M = mmax(r, g, b);\n m = mmin(r, g, b);\n C = M - m;\n H = (C == 0 ? null :\n M == r ? (g - b) / C :\n M == g ? (b - r) / C + 2 :\n (r - g) / C + 4);\n H = ((H + 360) % 6) * 60 / 360;\n L = (M + m) / 2;\n S = (C == 0 ? 0 :\n L < .5 ? C / (2 * L) :\n C / (2 - 2 * L));\n return {h: H, s: S, l: L, toString: hsltoString};\n};\n\n// Transformations\n// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ [\"M10,10\",\"L90,90\"], [\"M90,10\",\"L10,90\"] ] Otherwise how is each command structured?\n/*/\n * Snap.parsePathString\n [ method ]\n **\n * Utility method\n **\n * Parses given path string into an array of arrays of path segments\n - pathString (string|array) path string or array of segments (in the last case it is returned straight away)\n = (array) array of segments\n/*/\nSnap.parsePathString = function (pathString) {\n if (!pathString) {\n return null;\n }\n var pth = Snap.path(pathString);\n if (pth.arr) {\n return Snap.path.clone(pth.arr);\n }\n\n var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},\n data = [];\n if (is(pathString, \"array\") && is(pathString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(pathString);\n }\n if (!data.length) {\n Str(pathString).replace(pathCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n if (name == \"m\" && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = \"l\";\n b = b == \"m\" ? \"l\" : \"L\";\n }\n if (name == \"o\" && params.length == 1) {\n data.push([b, params[0]]);\n }\n if (name == \"r\") {\n data.push([b].concat(params));\n } else while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n });\n }\n data.toString = Snap.path.toString;\n pth.arr = Snap.path.clone(data);\n return data;\n};\n/*/\n * Snap.parseTransformString\n [ method ]\n **\n * Utility method\n **\n * Parses given transform string into an array of transformations\n - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)\n = (array) array of transformations\n/*/\nvar parseTransformString = Snap.parseTransformString = function (TString) {\n if (!TString) {\n return null;\n }\n var paramCounts = {r: 3, s: 4, t: 2, m: 6},\n data = [];\n if (is(TString, \"array\") && is(TString[0], \"array\")) { // rough assumption\n data = Snap.path.clone(TString);\n }\n if (!data.length) {\n Str(TString).replace(tCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n data.push([b].concat(params));\n });\n }\n data.toString = Snap.path.toString;\n return data;\n};\nfunction svgTransform2string(tstr) {\n var res = [];\n tstr = tstr.replace(/(?:^|/s)(/w+)/(([^)]+)/)/g, function (all, name, params) {\n params = params.split(//s*,/s*|/s+/);\n if (name == \"rotate\" && params.length == 1) {\n params.push(0, 0);\n }\n if (name == \"scale\") {\n if (params.length > 2) {\n params = params.slice(0, 2);\n } else if (params.length == 2) {\n params.push(0, 0);\n }\n if (params.length == 1) {\n params.push(params[0], 0, 0);\n }\n }\n if (name == \"skewX\") {\n res.push([\"m\", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);\n } else if (name == \"skewY\") {\n res.push([\"m\", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);\n } else {\n res.push([name.charAt(0)].concat(params));\n }\n return all;\n });\n return res;\n}\nSnap._.svgTransform2string = svgTransform2string;\nSnap._.rgTransform = /^[a-z][/s]*-?/.?/d/i;\nfunction transform2matrix(tstr, bbox) {\n var tdata = parseTransformString(tstr),\n m = new Snap.Matrix;\n if (tdata) {\n for (var i = 0, ii = tdata.length; i < ii; i++) {\n var t = tdata[i],\n tlen = t.length,\n command = Str(t[0]).toLowerCase(),\n absolute = t[0] != command,\n inver = absolute ? m.invert() : 0,\n x1,\n y1,\n x2,\n y2,\n bb;\n if (command == \"t\" && tlen == 2){\n m.translate(t[1], 0);\n } else if (command == \"t\" && tlen == 3) {\n if (absolute) {\n x1 = inver.x(0, 0);\n y1 = inver.y(0, 0);\n x2 = inver.x(t[1], t[2]);\n y2 = inver.y(t[1], t[2]);\n m.translate(x2 - x1, y2 - y1);\n } else {\n m.translate(t[1], t[2]);\n }\n } else if (command == \"r\") {\n if (tlen == 2) {\n bb = bb || bbox;\n m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.rotate(t[1], x2, y2);\n } else {\n m.rotate(t[1], t[2], t[3]);\n }\n }\n } else if (command == \"s\") {\n if (tlen == 2 || tlen == 3) {\n bb = bb || bbox;\n m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.scale(t[1], t[1], x2, y2);\n } else {\n m.scale(t[1], t[1], t[2], t[3]);\n }\n } else if (tlen == 5) {\n if (absolute) {\n x2 = inver.x(t[3], t[4]);\n y2 = inver.y(t[3], t[4]);\n m.scale(t[1], t[2], x2, y2);\n } else {\n m.scale(t[1], t[2], t[3], t[4]);\n }\n }\n } else if (command == \"m\" && tlen == 7) {\n m.add(t[1], t[2], t[3], t[4], t[5], t[6]);\n }\n }\n }\n return m;\n}\nSnap._.transform2matrix = transform2matrix;\nSnap._unit2px = unit2px;\nvar contains = glob.doc.contains || glob.doc.compareDocumentPosition ?\n function (a, b) {\n var adown = a.nodeType == 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a == bup || !!(bup && bup.nodeType == 1 && (\n adown.contains ?\n adown.contains(bup) :\n a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16\n ));\n } :\n function (a, b) {\n if (b) {\n while (b) {\n b = b.parentNode;\n if (b == a) {\n return true;\n }\n }\n }\n return false;\n };\nfunction getSomeDefs(el) {\n var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||\n (el.node.parentNode && wrap(el.node.parentNode)) ||\n Snap.select(\"svg\") ||\n Snap(0, 0),\n pdefs = p.select(\"defs\"),\n defs = pdefs == null ? false : pdefs.node;\n if (!defs) {\n defs = make(\"defs\", p.node).node;\n }\n return defs;\n}\nfunction getSomeSVG(el) {\n return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select(\"svg\");\n}\nSnap._.getSomeDefs = getSomeDefs;\nSnap._.getSomeSVG = getSomeSVG;\nfunction unit2px(el, name, value) {\n var svg = getSomeSVG(el).node,\n out = {},\n mgr = svg.querySelector(\".svg---mgr\");\n if (!mgr) {\n mgr = $(\"rect\");\n $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, \"class\": \"svg---mgr\", fill: \"none\"});\n svg.appendChild(mgr);\n }\n function getW(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {width: val});\n try {\n return mgr.getBBox().width;\n } catch (e) {\n return 0;\n }\n }\n function getH(val) {\n if (val == null) {\n return E;\n }\n if (val == +val) {\n return val;\n }\n $(mgr, {height: val});\n try {\n return mgr.getBBox().height;\n } catch (e) {\n return 0;\n }\n }\n function set(nam, f) {\n if (name == null) {\n out[nam] = f(el.attr(nam) || 0);\n } else if (nam == name) {\n out = f(value == null ? el.attr(nam) || 0 : value);\n }\n }\n switch (el.type) {\n case \"rect\":\n set(\"rx\", getW);\n set(\"ry\", getH);\n case \"image\":\n set(\"width\", getW);\n set(\"height\", getH);\n case \"text\":\n set(\"x\", getW);\n set(\"y\", getH);\n break;\n case \"circle\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"r\", getW);\n break;\n case \"ellipse\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"rx\", getW);\n set(\"ry\", getH);\n break;\n case \"line\":\n set(\"x1\", getW);\n set(\"x2\", getW);\n set(\"y1\", getH);\n set(\"y2\", getH);\n break;\n case \"marker\":\n set(\"refX\", getW);\n set(\"markerWidth\", getW);\n set(\"refY\", getH);\n set(\"markerHeight\", getH);\n break;\n case \"radialGradient\":\n set(\"fx\", getW);\n set(\"fy\", getH);\n break;\n case \"tspan\":\n set(\"dx\", getW);\n set(\"dy\", getH);\n break;\n default:\n set(name, getW);\n }\n svg.removeChild(mgr);\n return out;\n}\n/*/\n * Snap.select\n [ method ]\n **\n * Wraps a DOM element specified by CSS selector as @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(glob.doc.querySelector(query));\n};\n/*/\n * Snap.selectAll\n [ method ]\n **\n * Wraps DOM elements specified by CSS selector as set or array of @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.selectAll = function (query) {\n var nodelist = glob.doc.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n};\n\nfunction add2group(list) {\n if (!is(list, \"array\")) {\n list = Array.prototype.slice.call(arguments, 0);\n }\n var i = 0,\n j = 0,\n node = this.node;\n while (this[i]) delete this[i++];\n for (i = 0; i < list.length; i++) {\n if (list[i].type == \"set\") {\n list[i].forEach(function (el) {\n node.appendChild(el.node);\n });\n } else {\n node.appendChild(list[i].node);\n }\n }\n var children = node.childNodes;\n for (i = 0; i < children.length; i++) {\n this[j++] = wrap(children[i]);\n }\n return this;\n}\n// Hub garbage collector every 10s\nsetInterval(function () {\n for (var key in hub) if (hub[has](key)) {\n var el = hub[key],\n node = el.node;\n if (el.type != \"svg\" && !node.ownerSVGElement || el.type == \"svg\" && (!node.parentNode || \"ownerSVGElement\" in node.parentNode && !node.ownerSVGElement)) {\n delete hub[key];\n }\n }\n}, 1e4);\nfunction Element(el) {\n if (el.snap in hub) {\n return hub[el.snap];\n }\n var svg;\n try {\n svg = el.ownerSVGElement;\n } catch(e) {}\n /*/\n * Element.node\n [ property (object) ]\n **\n * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.\n > Usage\n | // draw a circle at coordinate 10,10 with radius of 10\n | var c = paper.circle(10, 10, 10);\n | c.node.onclick = function () {\n | c.attr(\"fill\", \"red\");\n | };\n /*/\n this.node = el;\n if (svg) {\n this.paper = new Paper(svg);\n }\n /*/\n * Element.type\n [ property (string) ]\n **\n * SVG tag name of the given element.\n /*/\n this.type = el.tagName;\n var id = this.id = ID(this);\n this.anims = {};\n this._ = {\n transform: []\n };\n el.snap = id;\n hub[id] = this;\n if (this.type == \"g\") {\n this.add = add2group;\n }\n if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {\n for (var method in Paper.prototype) if (Paper.prototype[has](method)) {\n this[method] = Paper.prototype[method];\n }\n }\n}\n /*/\n * Element.attr\n [ method ]\n **\n * Gets or sets given attributes of the element.\n **\n - params (object) contains key-value pairs of attributes you want to set\n * or\n - param (string) name of the attribute\n = (Element) the current element\n * or\n = (string) value of attribute\n > Usage\n | el.attr({\n | fill: \"#fc0\",\n | stroke: \"#000\",\n | strokeWidth: 2, // CamelCase...\n | \"fill-opacity\": 0.5, // or dash-separated names\n | width: \"*=2\" // prefixed values\n | });\n | console.log(el.attr(\"fill\")); // #fc0\n * Prefixed values in format `\"+=10\"` supported. All four operations\n * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`\n * and `-`: `\"+=2em\"`.\n /*/\n Element.prototype.attr = function (params, value) {\n var el = this,\n node = el.node;\n if (!params) {\n return el;\n }\n if (is(params, \"string\")) {\n if (arguments.length > 1) {\n var json = {};\n json[params] = value;\n params = json;\n } else {\n return eve(\"snap.util.getattr.\" + params, el).firstDefined();\n }\n }\n for (var att in params) {\n if (params[has](att)) {\n eve(\"snap.util.attr.\" + att, el, params[att]);\n }\n }\n return el;\n };\n/*/\n * Snap.parse\n [ method ]\n **\n * Parses SVG fragment and converts it into a @Fragment\n **\n - svg (string) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.parse = function (svg) {\n var f = glob.doc.createDocumentFragment(),\n full = true,\n div = glob.doc.createElement(\"div\");\n svg = Str(svg);\n if (!svg.match(/^/s*</s*svg(?:/s|>)/)) {\n svg = \"<svg>\" + svg + \"</svg>\";\n full = false;\n }\n div.innerHTML = svg;\n svg = div.getElementsByTagName(\"svg\")[0];\n if (svg) {\n if (full) {\n f = svg;\n } else {\n while (svg.firstChild) {\n f.appendChild(svg.firstChild);\n }\n div.innerHTML = E;\n }\n }\n return new Fragment(f);\n};\nfunction Fragment(frag) {\n this.node = frag;\n}\n// SIERRA Snap.fragment() could especially use a code example\n/*/\n * Snap.fragment\n [ method ]\n **\n * Creates a DOM fragment from a given list of elements or strings\n **\n - varargs (…) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.fragment = function () {\n var args = Array.prototype.slice.call(arguments, 0),\n f = glob.doc.createDocumentFragment();\n for (var i = 0, ii = args.length; i < ii; i++) {\n var item = args[i];\n if (item.node && item.node.nodeType) {\n f.appendChild(item.node);\n }\n if (item.nodeType) {\n f.appendChild(item);\n }\n if (typeof item == \"string\") {\n f.appendChild(Snap.parse(item).node);\n }\n }\n return new Fragment(f);\n};\n\nfunction make(name, parent) {\n var res = $(name);\n parent.appendChild(res);\n var el = wrap(res);\n return el;\n}\nfunction Paper(w, h) {\n var res,\n desc,\n defs,\n proto = Paper.prototype;\n if (w && w.tagName == \"svg\") {\n if (w.snap in hub) {\n return hub[w.snap];\n }\n var doc = w.ownerDocument;\n res = new Element(w);\n desc = w.getElementsByTagName(\"desc\")[0];\n defs = w.getElementsByTagName(\"defs\")[0];\n if (!desc) {\n desc = $(\"desc\");\n desc.appendChild(doc.createTextNode(\"Created with Snap\"));\n res.node.appendChild(desc);\n }\n if (!defs) {\n defs = $(\"defs\");\n res.node.appendChild(defs);\n }\n res.defs = defs;\n for (var key in proto) if (proto[has](key)) {\n res[key] = proto[key];\n }\n res.paper = res.root = res;\n } else {\n res = make(\"svg\", glob.doc.body);\n $(res.node, {\n height: h,\n version: 1.1,\n width: w,\n xmlns: xmlns\n });\n }\n return res;\n}\nfunction wrap(dom) {\n if (!dom) {\n return dom;\n }\n if (dom instanceof Element || dom instanceof Fragment) {\n return dom;\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"svg\") {\n return new Paper(dom);\n }\n if (dom.tagName && dom.tagName.toLowerCase() == \"object\" && dom.type == \"image/svg+xml\") {\n return new Paper(dom.contentDocument.getElementsByTagName(\"svg\")[0]);\n }\n return new Element(dom);\n}\n\nSnap._.make = make;\nSnap._.wrap = wrap;\n/*/\n * Paper.el\n [ method ]\n **\n * Creates an element on paper with a given name and no attributes\n **\n - name (string) tag name\n - attr (object) attributes\n = (Element) the current element\n > Usage\n | var c = paper.circle(10, 10, 10); // is the same as...\n | var c = paper.el(\"circle\").attr({\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n | // and the same as\n | var c = paper.el(\"circle\", {\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n/*/\nPaper.prototype.el = function (name, attr) {\n var el = make(name, this.node);\n attr && el.attr(attr);\n return el;\n};\n// default\neve.on(\"snap.util.getattr\", function () {\n var att = eve.nt();\n att = att.substring(att.lastIndexOf(\".\") + 1);\n var css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);\n } else {\n return $(this.node, att);\n }\n});\nvar cssAttr = {\n \"alignment-baseline\": 0,\n \"baseline-shift\": 0,\n \"clip\": 0,\n \"clip-path\": 0,\n \"clip-rule\": 0,\n \"color\": 0,\n \"color-interpolation\": 0,\n \"color-interpolation-filters\": 0,\n \"color-profile\": 0,\n \"color-rendering\": 0,\n \"cursor\": 0,\n \"direction\": 0,\n \"display\": 0,\n \"dominant-baseline\": 0,\n \"enable-background\": 0,\n \"fill\": 0,\n \"fill-opacity\": 0,\n \"fill-rule\": 0,\n \"filter\": 0,\n \"flood-color\": 0,\n \"flood-opacity\": 0,\n \"font\": 0,\n \"font-family\": 0,\n \"font-size\": 0,\n \"font-size-adjust\": 0,\n \"font-stretch\": 0,\n \"font-style\": 0,\n \"font-variant\": 0,\n \"font-weight\": 0,\n \"glyph-orientation-horizontal\": 0,\n \"glyph-orientation-vertical\": 0,\n \"image-rendering\": 0,\n \"kerning\": 0,\n \"letter-spacing\": 0,\n \"lighting-color\": 0,\n \"marker\": 0,\n \"marker-end\": 0,\n \"marker-mid\": 0,\n \"marker-start\": 0,\n \"mask\": 0,\n \"opacity\": 0,\n \"overflow\": 0,\n \"pointer-events\": 0,\n \"shape-rendering\": 0,\n \"stop-color\": 0,\n \"stop-opacity\": 0,\n \"stroke\": 0,\n \"stroke-dasharray\": 0,\n \"stroke-dashoffset\": 0,\n \"stroke-linecap\": 0,\n \"stroke-linejoin\": 0,\n \"stroke-miterlimit\": 0,\n \"stroke-opacity\": 0,\n \"stroke-width\": 0,\n \"text-anchor\": 0,\n \"text-decoration\": 0,\n \"text-rendering\": 0,\n \"unicode-bidi\": 0,\n \"visibility\": 0,\n \"word-spacing\": 0,\n \"writing-mode\": 0\n};\n\neve.on(\"snap.util.attr\", function (value) {\n var att = eve.nt(),\n attr = {};\n att = att.substring(att.lastIndexOf(\".\") + 1);\n attr[att] = value;\n var style = att.replace(/-(/w)/gi, function (all, letter) {\n return letter.toUpperCase();\n }),\n css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n if (cssAttr[has](css)) {\n this.node.style[style] = value == null ? E : value;\n } else {\n $(this.node, attr);\n }\n});\n(function (proto) {}(Paper.prototype));\n\n// simple ajax\n/*/\n * Snap.ajax\n [ method ]\n **\n * Simple implementation of Ajax\n **\n - url (string) URL\n - postData (object|string) data for post request\n - callback (function) callback\n - scope (object) #optional scope of callback\n * or\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n = (XMLHttpRequest) the XMLHttpRequest object, just in case\n/*/\nSnap.ajax = function (url, postData, callback, scope){\n var req = new XMLHttpRequest,\n id = ID();\n if (req) {\n if (is(postData, \"function\")) {\n scope = callback;\n callback = postData;\n postData = null;\n } else if (is(postData, \"object\")) {\n var pd = [];\n for (var key in postData) if (postData.hasOwnProperty(key)) {\n pd.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(postData[key]));\n }\n postData = pd.join(\"&\");\n }\n req.open((postData ? \"POST\" : \"GET\"), url, true);\n if (postData) {\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n if (callback) {\n eve.once(\"snap.ajax.\" + id + \".0\", callback);\n eve.once(\"snap.ajax.\" + id + \".200\", callback);\n eve.once(\"snap.ajax.\" + id + \".304\", callback);\n }\n req.onreadystatechange = function() {\n if (req.readyState != 4) return;\n eve(\"snap.ajax.\" + id + \".\" + req.status, scope, req);\n };\n if (req.readyState == 4) {\n return req;\n }\n req.send(postData);\n return req;\n }\n};\n/*/\n * Snap.load\n [ method ]\n **\n * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)\n **\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n/*/\nSnap.load = function (url, callback, scope) {\n Snap.ajax(url, function (req) {\n var f = Snap.parse(req.responseText);\n scope ? callback.call(scope, f) : callback(f);\n });\n};\nvar getOffset = function (elem) {\n var box = elem.getBoundingClientRect(),\n doc = elem.ownerDocument,\n body = doc.body,\n docElem = doc.documentElement,\n clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,\n top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,\n left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;\n return {\n y: top,\n x: left\n };\n};\n/*/\n * Snap.getElementByPoint\n [ method ]\n **\n * Returns you topmost element under given point.\n **\n = (object) Snap element object\n - x (number) x coordinate from the top left corner of the window\n - y (number) y coordinate from the top left corner of the window\n > Usage\n | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: \"#f00\"});\n/*/\nSnap.getElementByPoint = function (x, y) {\n var paper = this,\n svg = paper.canvas,\n target = glob.doc.elementFromPoint(x, y);\n if (glob.win.opera && target.tagName == \"svg\") {\n var so = getOffset(target),\n sr = target.createSVGRect();\n sr.x = x - so.x;\n sr.y = y - so.y;\n sr.width = sr.height = 1;\n var hits = target.getIntersectionList(sr, null);\n if (hits.length) {\n target = hits[hits.length - 1];\n }\n }\n if (!target) {\n return null;\n }\n return wrap(target);\n};\n/*/\n * Snap.plugin\n [ method ]\n **\n * Let you write plugins. You pass in a function with four arguments, like this:\n | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {\n | Snap.newmethod = function () {};\n | Element.prototype.newmethod = function () {};\n | Paper.prototype.newmethod = function () {};\n | });\n * Inside the function you have access to all main objects (and their\n * prototypes). This allow you to extend anything you want.\n **\n - f (function) your plugin body\n/*/\nSnap.plugin = function (f) {\n f(Snap, Element, Paper, glob, Fragment);\n};\nglob.win.Snap = Snap;\nreturn Snap;\n}(window || this));\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var elproto = Element.prototype,\n is = Snap.is,\n Str = String,\n unit2px = Snap._unit2px,\n $ = Snap._.$,\n make = Snap._.make,\n getSomeDefs = Snap._.getSomeDefs,\n has = \"hasOwnProperty\",\n wrap = Snap._.wrap;\n /*/\n * Element.getBBox\n [ method ]\n **\n * Returns the bounding box descriptor for the given element\n **\n = (object) bounding box descriptor:\n o {\n o cx: (number) x of the center,\n o cy: (number) x of the center,\n o h: (number) height,\n o height: (number) height,\n o path: (string) path command for the box,\n o r0: (number) radius of a circle that fully encloses the box,\n o r1: (number) radius of the smallest circle that can be enclosed,\n o r2: (number) radius of the largest circle that can be enclosed,\n o vb: (string) box as a viewbox command,\n o w: (number) width,\n o width: (number) width,\n o x2: (number) x of the right side,\n o x: (number) x of the left side,\n o y2: (number) y of the bottom edge,\n o y: (number) y of the top edge\n o }\n /*/\n elproto.getBBox = function (isWithoutTransform) {\n if (!Snap.Matrix || !Snap.path) {\n return this.node.getBBox();\n }\n var el = this,\n m = new Snap.Matrix;\n if (el.removed) {\n return Snap._.box();\n }\n while (el.type == \"use\") {\n if (!isWithoutTransform) {\n m = m.add(el.transform().localMatrix.translate(el.attr(\"x\") || 0, el.attr(\"y\") || 0));\n }\n if (el.original) {\n el = el.original;\n } else {\n var href = el.attr(\"xlink:href\");\n el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf(\"#\") + 1));\n }\n }\n var _ = el._,\n pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;\n try {\n if (isWithoutTransform) {\n _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());\n return Snap._.box(_.bboxwt);\n } else {\n el.realPath = pathfinder(el);\n el.matrix = el.transform().localMatrix;\n _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));\n return Snap._.box(_.bbox);\n }\n } catch (e) {\n // Firefox doesn’t give you bbox of hidden element\n return Snap._.box();\n }\n };\n var propString = function () {\n return this.string;\n };\n function extractTransform(el, tstr) {\n if (tstr == null) {\n var doReturn = true;\n if (el.type == \"linearGradient\" || el.type == \"radialGradient\") {\n tstr = el.node.getAttribute(\"gradientTransform\");\n } else if (el.type == \"pattern\") {\n tstr = el.node.getAttribute(\"patternTransform\");\n } else {\n tstr = el.node.getAttribute(\"transform\");\n }\n if (!tstr) {\n return new Snap.Matrix;\n }\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n if (!Snap._.rgTransform.test(tstr)) {\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n tstr = Str(tstr).replace(//.{3}|/u2026/g, el._.transform || E);\n }\n if (is(tstr, \"array\")) {\n tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);\n }\n el._.transform = tstr;\n }\n var m = Snap._.transform2matrix(tstr, el.getBBox(1));\n if (doReturn) {\n return m;\n } else {\n el.matrix = m;\n }\n }\n /*/\n * Element.transform\n [ method ]\n **\n * Gets or sets transformation of the element\n **\n - tstr (string) transform string in Snap or SVG format\n = (Element) the current element\n * or\n = (object) transformation descriptor:\n o {\n o string (string) transform string,\n o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,\n o localMatrix (Matrix) matrix of transformations applied only to the element,\n o diffMatrix (Matrix) matrix of difference between global and local transformations,\n o global (string) global transformation as string,\n o local (string) local transformation as string,\n o toString (function) returns `string` property\n o }\n /*/\n elproto.transform = function (tstr) {\n var _ = this._;\n if (tstr == null) {\n var papa = this,\n global = new Snap.Matrix(this.node.getCTM()),\n local = extractTransform(this),\n ms = [local],\n m = new Snap.Matrix,\n i,\n localString = local.toTransformString(),\n string = Str(local) == Str(this.matrix) ?\n Str(_.transform) : localString;\n while (papa.type != \"svg\" && (papa = papa.parent())) {\n ms.push(extractTransform(papa));\n }\n i = ms.length;\n while (i--) {\n m.add(ms[i]);\n }\n return {\n string: string,\n globalMatrix: global,\n totalMatrix: m,\n localMatrix: local,\n diffMatrix: global.clone().add(local.invert()),\n global: global.toTransformString(),\n total: m.toTransformString(),\n local: localString,\n toString: propString\n };\n }\n if (tstr instanceof Snap.Matrix) {\n this.matrix = tstr;\n this._.transform = tstr.toTransformString();\n } else {\n extractTransform(this, tstr);\n }\n\n if (this.node) {\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\") {\n $(this.node, {gradientTransform: this.matrix});\n } else if (this.type == \"pattern\") {\n $(this.node, {patternTransform: this.matrix});\n } else {\n $(this.node, {transform: this.matrix});\n }\n }\n\n return this;\n };\n /*/\n * Element.parent\n [ method ]\n **\n * Returns the element's parent\n **\n = (Element) the parent element\n /*/\n elproto.parent = function () {\n return wrap(this.node.parentNode);\n };\n /*/\n * Element.append\n [ method ]\n **\n * Appends the given element to current one\n **\n - el (Element|Set) element to append\n = (Element) the parent element\n /*/\n /*/\n * Element.add\n [ method ]\n **\n * See @Element.append\n /*/\n elproto.append = elproto.add = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n it.add(el);\n });\n return this;\n }\n el = wrap(el);\n this.node.appendChild(el.node);\n el.paper = this.paper;\n }\n return this;\n };\n /*/\n * Element.appendTo\n [ method ]\n **\n * Appends the current element to the given one\n **\n - el (Element) parent element to append to\n = (Element) the child element\n /*/\n elproto.appendTo = function (el) {\n if (el) {\n el = wrap(el);\n el.append(this);\n }\n return this;\n };\n /*/\n * Element.prepend\n [ method ]\n **\n * Prepends the given element to the current one\n **\n - el (Element) element to prepend\n = (Element) the parent element\n /*/\n elproto.prepend = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this,\n first;\n el.forEach(function (el) {\n if (first) {\n first.after(el);\n } else {\n it.prepend(el);\n }\n first = el;\n });\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.insertBefore(el.node, this.node.firstChild);\n this.add && this.add();\n el.paper = this.paper;\n this.parent() && this.parent().add();\n parent && parent.add();\n }\n return this;\n };\n /*/\n * Element.prependTo\n [ method ]\n **\n * Prepends the current element to the given one\n **\n - el (Element) parent element to prepend to\n = (Element) the child element\n /*/\n elproto.prependTo = function (el) {\n el = wrap(el);\n el.prepend(this);\n return this;\n };\n /*/\n * Element.before\n [ method ]\n **\n * Inserts given element before the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.before = function (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n var parent = el.parent();\n it.node.parentNode.insertBefore(el.node, it.node);\n parent && parent.add();\n });\n this.parent().add();\n return this;\n }\n el = wrap(el);\n var parent = el.parent();\n this.node.parentNode.insertBefore(el.node, this.node);\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.after\n [ method ]\n **\n * Inserts given element after the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n /*/\n elproto.after = function (el) {\n el = wrap(el);\n var parent = el.parent();\n if (this.node.nextSibling) {\n this.node.parentNode.insertBefore(el.node, this.node.nextSibling);\n } else {\n this.node.parentNode.appendChild(el.node);\n }\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*/\n * Element.insertBefore\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertBefore = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.insertAfter\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n /*/\n elproto.insertAfter = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node.nextSibling);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*/\n * Element.remove\n [ method ]\n **\n * Removes element from the DOM\n = (Element) the detached element\n /*/\n elproto.remove = function () {\n var parent = this.parent();\n this.node.parentNode && this.node.parentNode.removeChild(this.node);\n delete this.paper;\n this.removed = true;\n parent && parent.add();\n return this;\n };\n /*/\n * Element.select\n [ method ]\n **\n * Gathers the nested @Element matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Element) result of query selection\n /*/\n elproto.select = function (query) {\n query = Str(query).replace(/([^//]):/g, \"$1//:\");\n return wrap(this.node.querySelector(query));\n };\n /*/\n * Element.selectAll\n [ method ]\n **\n * Gathers nested @Element objects matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Set|array) result of query selection\n /*/\n elproto.selectAll = function (query) {\n var nodelist = this.node.querySelectorAll(query),\n set = (Snap.set || Array)();\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n return set;\n };\n /*/\n * Element.asPX\n [ method ]\n **\n * Returns given attribute of the element as a `px` value (not %, em, etc.)\n **\n - attr (string) attribute name\n - value (string) #optional attribute value\n = (Element) result of query selection\n /*/\n elproto.asPX = function (attr, value) {\n if (value == null) {\n value = this.attr(attr);\n }\n return +unit2px(this, attr, value);\n };\n // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.\n /*/\n * Element.use\n [ method ]\n **\n * Creates a `<use>` element linked to the current element\n **\n = (Element) the `<use>` element\n /*/\n elproto.use = function () {\n var use,\n id = this.node.id;\n if (!id) {\n id = this.id;\n $(this.node, {\n id: id\n });\n }\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\" ||\n this.type == \"pattern\") {\n use = make(this.type, this.node.parentNode);\n } else {\n use = make(\"use\", this.node.parentNode);\n }\n $(use.node, {\n \"xlink:href\": \"#\" + id\n });\n use.original = this;\n return use;\n };\n function fixids(el) {\n var els = el.selectAll(\"*\"),\n it,\n url = /^/s*url/((\"|'|)(.*)/1/)/s*$/,\n ids = [],\n uses = {};\n function urltest(it, name) {\n var val = $(it.node, name);\n val = val && val.match(url);\n val = val && val[2];\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n var attr = {};\n attr[name] = URL(id);\n $(it.node, attr);\n });\n }\n }\n function linktest(it) {\n var val = $(it.node, \"xlink:href\");\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n it.attr(\"xlink:href\", \"#\" + id);\n });\n }\n }\n for (var i = 0, ii = els.length; i < ii; i++) {\n it = els[i];\n urltest(it, \"fill\");\n urltest(it, \"stroke\");\n urltest(it, \"filter\");\n urltest(it, \"mask\");\n urltest(it, \"clip-path\");\n linktest(it);\n var oldid = $(it.node, \"id\");\n if (oldid) {\n $(it.node, {id: it.id});\n ids.push({\n old: oldid,\n id: it.id\n });\n }\n }\n for (i = 0, ii = ids.length; i < ii; i++) {\n var fs = uses[ids[i].old];\n if (fs) {\n for (var j = 0, jj = fs.length; j < jj; j++) {\n fs[j](ids[i].id);\n }\n }\n }\n }\n /*/\n * Element.clone\n [ method ]\n **\n * Creates a clone of the element and inserts it after the element\n **\n = (Element) the clone\n /*/\n elproto.clone = function () {\n var clone = wrap(this.node.cloneNode(true));\n if ($(clone.node, \"id\")) {\n $(clone.node, {id: clone.id});\n }\n fixids(clone);\n clone.insertAfter(this);\n return clone;\n };\n /*/\n * Element.toDefs\n [ method ]\n **\n * Moves element to the shared `<defs>` area\n **\n = (Element) the element\n /*/\n elproto.toDefs = function () {\n var defs = getSomeDefs(this);\n defs.appendChild(this.node);\n return this;\n };\n /*/\n * Element.toPattern\n [ method ]\n **\n * Creates a `<pattern>` element from the current element\n **\n * To create a pattern you have to specify the pattern rect:\n - x (string|number)\n - y (string|number)\n - width (string|number)\n - height (string|number)\n = (Element) the `<pattern>` element\n * You can use pattern later on as an argument for `fill` attribute:\n | var p = paper.path(\"M10-5-10,15M15,0,0,15M0-5-20,15\").attr({\n | fill: \"none\",\n | stroke: \"#bada55\",\n | strokeWidth: 5\n | }).pattern(0, 0, 10, 10),\n | c = paper.circle(200, 200, 100);\n | c.attr({\n | fill: p\n | });\n /*/\n elproto.pattern = elproto.toPattern = function (x, y, width, height) {\n var p = make(\"pattern\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n $(p.node, {\n x: x,\n y: y,\n width: width,\n height: height,\n patternUnits: \"userSpaceOnUse\",\n id: p.id,\n viewBox: [x, y, width, height].join(\" \")\n });\n p.node.appendChild(this.node);\n return p;\n };\n// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.\n// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?\n /*/\n * Element.marker\n [ method ]\n **\n * Creates a `<marker>` element from the current element\n **\n * To create a marker you have to specify the bounding rect and reference point:\n - x (number)\n - y (number)\n - width (number)\n - height (number)\n - refX (number)\n - refY (number)\n = (Element) the `<marker>` element\n * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.\n /*/\n // TODO add usage for markers\n elproto.marker = function (x, y, width, height, refX, refY) {\n var p = make(\"marker\", getSomeDefs(this));\n if (x == null) {\n x = this.getBBox();\n }\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n refX = x.refX || x.cx;\n refY = x.refY || x.cy;\n x = x.x;\n }\n $(p.node, {\n viewBox: [x, y, width, height].join(\" \"),\n markerWidth: width,\n markerHeight: height,\n orient: \"auto\",\n refX: refX || 0,\n refY: refY || 0,\n id: p.id\n });\n p.node.appendChild(this.node);\n return p;\n };\n // animation\n function slice(from, to, f) {\n return function (arr) {\n var res = arr.slice(from, to);\n if (res.length == 1) {\n res = res[0];\n }\n return f ? f(res) : res;\n };\n }\n var Animation = function (attr, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n this.attr = attr;\n this.dur = ms;\n easing && (this.easing = easing);\n callback && (this.callback = callback);\n };\n Snap._.Animation = Animation;\n /*/\n * Snap.animation\n [ method ]\n **\n * Creates an animation object\n **\n - attr (object) attributes of final destination\n - duration (number) duration of the animation, in milliseconds\n - easing (function) #optional one of easing functions of @mina or custom one\n - callback (function) #optional callback function that fires when animation ends\n = (object) animation object\n /*/\n Snap.animation = function (attr, ms, easing, callback) {\n return new Animation(attr, ms, easing, callback);\n };\n /*/\n * Element.inAnim\n [ method ]\n **\n * Returns a set of animations that may be able to manipulate the current element\n **\n = (object) in format:\n o {\n o anim (object) animation object,\n o mina (object) @mina object,\n o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n /*/\n elproto.inAnim = function () {\n var el = this,\n res = [];\n for (var id in el.anims) if (el.anims[has](id)) {\n (function (a) {\n res.push({\n anim: new Animation(a._attrs, a.dur, a.easing, a._callback),\n mina: a,\n curStatus: a.status(),\n status: function (val) {\n return a.status(val);\n },\n stop: function () {\n a.stop();\n }\n });\n }(el.anims[id]));\n }\n return res;\n };\n /*/\n * Snap.animate\n [ method ]\n **\n * Runs generic animation of one number into another with a caring function\n **\n - from (number|array) number or array of numbers\n - to (number|array) number or array of numbers\n - setter (function) caring function that accepts one number argument\n - duration (number) duration, in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function to execute when animation ends\n = (object) animation object in @mina format\n o {\n o id (string) animation id, consider it read-only,\n o duration (function) gets or sets the duration of the animation,\n o easing (function) easing,\n o speed (function) gets or sets the speed of the animation,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n | var rect = Snap().rect(0, 0, 10, 10);\n | Snap.animate(0, 10, function (val) {\n | rect.attr({\n | x: val\n | });\n | }, 1000);\n | // in given context is equivalent to\n | rect.animate({x: 10}, 1000);\n /*/\n Snap.animate = function (from, to, setter, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n var now = mina.time(),\n anim = mina(from, to, now, now + ms, mina.time, setter, easing);\n callback && eve.once(\"mina.finish.\" + anim.id, callback);\n return anim;\n };\n /*/\n * Element.stop\n [ method ]\n **\n * Stops all the animations for the current element\n **\n = (Element) the current element\n /*/\n elproto.stop = function () {\n var anims = this.inAnim();\n for (var i = 0, ii = anims.length; i < ii; i++) {\n anims[i].stop();\n }\n return this;\n };\n /*/\n * Element.animate\n [ method ]\n **\n * Animates the given attributes of the element\n **\n - attrs (object) key-value pairs of destination attributes\n - duration (number) duration of the animation in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function that executes when the animation ends\n = (Element) the current element\n /*/\n elproto.animate = function (attrs, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n if (attrs instanceof Animation) {\n callback = attrs.callback;\n easing = attrs.easing;\n ms = easing.dur;\n attrs = attrs.attr;\n }\n var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,\n el = this;\n for (var key in attrs) if (attrs[has](key)) {\n if (el.equal) {\n eq = el.equal(key, Str(attrs[key]));\n from = eq.from;\n to = eq.to;\n f = eq.f;\n } else {\n from = +el.attr(key);\n to = +attrs[key];\n }\n var len = is(from, \"array\") ? from.length : 1;\n keys[key] = slice(fkeys.length, fkeys.length + len, f);\n fkeys = fkeys.concat(from);\n tkeys = tkeys.concat(to);\n }\n var now = mina.time(),\n anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {\n var attr = {};\n for (var key in keys) if (keys[has](key)) {\n attr[key] = keys[key](val);\n }\n el.attr(attr);\n }, easing);\n el.anims[anim.id] = anim;\n anim._attrs = attrs;\n anim._callback = callback;\n eve(\"snap.animcreated.\" + el.id, anim);\n eve.once(\"mina.finish.\" + anim.id, function () {\n delete el.anims[anim.id];\n callback && callback.call(el);\n });\n eve.once(\"mina.stop.\" + anim.id, function () {\n delete el.anims[anim.id];\n });\n return el;\n };\n var eldata = {};\n /*/\n * Element.data\n [ method ]\n **\n * Adds or retrieves given value associated with given key. (Don’t confuse\n * with `data-` attributes)\n *\n * See also @Element.removeData\n - key (string) key to store data\n - value (any) #optional value to store\n = (object) @Element\n * or, if value is not specified:\n = (any) value\n > Usage\n | for (var i = 0, i < 5, i++) {\n | paper.circle(10 + 15 * i, 10, 10)\n | .attr({fill: \"#000\"})\n | .data(\"i\", i)\n | .click(function () {\n | alert(this.data(\"i\"));\n | });\n | }\n /*/\n elproto.data = function (key, value) {\n var data = eldata[this.id] = eldata[this.id] || {};\n if (arguments.length == 0){\n eve(\"snap.data.get.\" + this.id, this, data, null);\n return data;\n }\n if (arguments.length == 1) {\n if (Snap.is(key, \"object\")) {\n for (var i in key) if (key[has](i)) {\n this.data(i, key[i]);\n }\n return this;\n }\n eve(\"snap.data.get.\" + this.id, this, data[key], key);\n return data[key];\n }\n data[key] = value;\n eve(\"snap.data.set.\" + this.id, this, value, key);\n return this;\n };\n /*/\n * Element.removeData\n [ method ]\n **\n * Removes value associated with an element by given key.\n * If key is not provided, removes all the data of the element.\n - key (string) #optional key\n = (object) @Element\n /*/\n elproto.removeData = function (key) {\n if (key == null) {\n eldata[this.id] = {};\n } else {\n eldata[this.id] && delete eldata[this.id][key];\n }\n return this;\n };\n /*/\n * Element.outerSVG\n [ method ]\n **\n * Returns SVG code for the element, equivalent to HTML's `outerHTML`.\n *\n * See also @Element.innerSVG\n = (string) SVG code for the element\n /*/\n /*/\n * Element.toString\n [ method ]\n **\n * See @Element.outerSVG\n /*/\n elproto.outerSVG = elproto.toString = toString(1);\n /*/\n * Element.innerSVG\n [ method ]\n **\n * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`\n = (string) SVG code for the element\n /*/\n elproto.innerSVG = toString();\n function toString(type) {\n return function () {\n var res = type ? \"<\" + this.type : \"\",\n attr = this.node.attributes,\n chld = this.node.childNodes;\n if (type) {\n for (var i = 0, ii = attr.length; i < ii; i++) {\n res += \" \" + attr[i].name + '=\"' +\n attr[i].value.replace(/\"/g, '//\"') + '\"';\n }\n }\n if (chld.length) {\n type && (res += \">\");\n for (i = 0, ii = chld.length; i < ii; i++) {\n if (chld[i].nodeType == 3) {\n res += chld[i].nodeValue;\n } else if (chld[i].nodeType == 1) {\n res += wrap(chld[i]).toString();\n }\n }\n type && (res += \"</\" + this.type + \">\");\n } else {\n type && (res += \"/>\");\n }\n return res;\n };\n }\n elproto.toDataURL = function () {\n if (window && window.btoa) {\n var bb = this.getBBox(),\n svg = Snap.format('<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"{width}\" height=\"{height}\" viewBox=\"{x} {y} {width} {height}\">{contents}</svg>', {\n x: +bb.x.toFixed(3),\n y: +bb.y.toFixed(3),\n width: +bb.width.toFixed(3),\n height: +bb.height.toFixed(3),\n contents: this.outerSVG()\n });\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svg)));\n }\n };\n /*/\n * Fragment.select\n [ method ]\n **\n * See @Element.select\n /*/\n Fragment.prototype.select = elproto.select;\n /*/\n * Fragment.selectAll\n [ method ]\n **\n * See @Element.selectAll\n /*/\n Fragment.prototype.selectAll = elproto.selectAll;\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var objectToString = Object.prototype.toString,\n Str = String,\n math = Math,\n E = \"\";\n function Matrix(a, b, c, d, e, f) {\n if (b == null && objectToString.call(a) == \"[object SVGMatrix]\") {\n this.a = a.a;\n this.b = a.b;\n this.c = a.c;\n this.d = a.d;\n this.e = a.e;\n this.f = a.f;\n return;\n }\n if (a != null) {\n this.a = +a;\n this.b = +b;\n this.c = +c;\n this.d = +d;\n this.e = +e;\n this.f = +f;\n } else {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n }\n }\n (function (matrixproto) {\n /*/\n * Matrix.add\n [ method ]\n **\n * Adds the given matrix to existing one\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - matrix (object) @Matrix\n /*/\n matrixproto.add = function (a, b, c, d, e, f) {\n var out = [[], [], []],\n m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],\n matrix = [[a, c, e], [b, d, f], [0, 0, 1]],\n x, y, z, res;\n\n if (a && a instanceof Matrix) {\n matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];\n }\n\n for (x = 0; x < 3; x++) {\n for (y = 0; y < 3; y++) {\n res = 0;\n for (z = 0; z < 3; z++) {\n res += m[x][z] * matrix[z][y];\n }\n out[x][y] = res;\n }\n }\n this.a = out[0][0];\n this.b = out[1][0];\n this.c = out[0][1];\n this.d = out[1][1];\n this.e = out[0][2];\n this.f = out[1][2];\n return this;\n };\n /*/\n * Matrix.invert\n [ method ]\n **\n * Returns an inverted version of the matrix\n = (object) @Matrix\n /*/\n matrixproto.invert = function () {\n var me = this,\n x = me.a * me.d - me.b * me.c;\n return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);\n };\n /*/\n * Matrix.clone\n [ method ]\n **\n * Returns a copy of the matrix\n = (object) @Matrix\n /*/\n matrixproto.clone = function () {\n return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n };\n /*/\n * Matrix.translate\n [ method ]\n **\n * Translate the matrix\n - x (number) horizontal offset distance\n - y (number) vertical offset distance\n /*/\n matrixproto.translate = function (x, y) {\n return this.add(1, 0, 0, 1, x, y);\n };\n /*/\n * Matrix.scale\n [ method ]\n **\n * Scales the matrix\n - x (number) amount to be scaled, with `1` resulting in no change\n - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)\n - cx (number) #optional horizontal origin point from which to scale\n - cy (number) #optional vertical origin point from which to scale\n * Default cx, cy is the middle point of the element.\n /*/\n matrixproto.scale = function (x, y, cx, cy) {\n y == null && (y = x);\n (cx || cy) && this.add(1, 0, 0, 1, cx, cy);\n this.add(x, 0, 0, y, 0, 0);\n (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);\n return this;\n };\n /*/\n * Matrix.rotate\n [ method ]\n **\n * Rotates the matrix\n - a (number) angle of rotation, in degrees\n - x (number) horizontal origin point from which to rotate\n - y (number) vertical origin point from which to rotate\n /*/\n matrixproto.rotate = function (a, x, y) {\n a = Snap.rad(a);\n x = x || 0;\n y = y || 0;\n var cos = +math.cos(a).toFixed(9),\n sin = +math.sin(a).toFixed(9);\n this.add(cos, sin, -sin, cos, x, y);\n return this.add(1, 0, 0, 1, -x, -y);\n };\n /*/\n * Matrix.x\n [ method ]\n **\n * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y\n - x (number)\n - y (number)\n = (number) x\n /*/\n matrixproto.x = function (x, y) {\n return x * this.a + y * this.c + this.e;\n };\n /*/\n * Matrix.y\n [ method ]\n **\n * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x\n - x (number)\n - y (number)\n = (number) y\n /*/\n matrixproto.y = function (x, y) {\n return x * this.b + y * this.d + this.f;\n };\n matrixproto.get = function (i) {\n return +this[Str.fromCharCode(97 + i)].toFixed(4);\n };\n matrixproto.toString = function () {\n return \"matrix(\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + \")\";\n };\n matrixproto.offset = function () {\n return [this.e.toFixed(4), this.f.toFixed(4)];\n };\n function norm(a) {\n return a[0] * a[0] + a[1] * a[1];\n }\n function normalize(a) {\n var mag = math.sqrt(norm(a));\n a[0] && (a[0] /= mag);\n a[1] && (a[1] /= mag);\n }\n /*/\n * Matrix.determinant\n [ method ]\n **\n * Finds determinant of the given matrix.\n = (number) determinant\n /*/\n matrixproto.determinant = function () {\n return this.a * this.d - this.b * this.c;\n };\n /*/\n * Matrix.split\n [ method ]\n **\n * Splits matrix into primitive transformations\n = (object) in format:\n o dx (number) translation by x\n o dy (number) translation by y\n o scalex (number) scale by x\n o scaley (number) scale by y\n o shear (number) shear\n o rotate (number) rotation in deg\n o isSimple (boolean) could it be represented via simple transformations\n /*/\n matrixproto.split = function () {\n var out = {};\n // translation\n out.dx = this.e;\n out.dy = this.f;\n\n // scale and shear\n var row = [[this.a, this.c], [this.b, this.d]];\n out.scalex = math.sqrt(norm(row[0]));\n normalize(row[0]);\n\n out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];\n row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];\n\n out.scaley = math.sqrt(norm(row[1]));\n normalize(row[1]);\n out.shear /= out.scaley;\n\n if (this.determinant() < 0) {\n out.scalex = -out.scalex;\n }\n\n // rotation\n var sin = -row[0][1],\n cos = row[1][1];\n if (cos < 0) {\n out.rotate = Snap.deg(math.acos(cos));\n if (sin < 0) {\n out.rotate = 360 - out.rotate;\n }\n } else {\n out.rotate = Snap.deg(math.asin(sin));\n }\n\n out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);\n out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;\n out.noRotation = !+out.shear.toFixed(9) && !out.rotate;\n return out;\n };\n /*/\n * Matrix.toTransformString\n [ method ]\n **\n * Returns transform string that represents given matrix\n = (string) transform string\n /*/\n matrixproto.toTransformString = function (shorter) {\n var s = shorter || this.split();\n if (!+s.shear.toFixed(9)) {\n s.scalex = +s.scalex.toFixed(4);\n s.scaley = +s.scaley.toFixed(4);\n s.rotate = +s.rotate.toFixed(4);\n return (s.dx || s.dy ? \"t\" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) + \n (s.scalex != 1 || s.scaley != 1 ? \"s\" + [s.scalex, s.scaley, 0, 0] : E) +\n (s.rotate ? \"r\" + [+s.rotate.toFixed(4), 0, 0] : E);\n } else {\n return \"m\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];\n }\n };\n })(Matrix.prototype);\n /*/\n * Snap.Matrix\n [ method ]\n **\n * Matrix constructor, extend on your own risk.\n * To create matrices use @Snap.matrix.\n /*/\n Snap.Matrix = Matrix;\n /*/\n * Snap.matrix\n [ method ]\n **\n * Utility method\n **\n * Returns a matrix based on the given parameters\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - svgMatrix (SVGMatrix)\n = (object) @Matrix\n /*/\n Snap.matrix = function (a, b, c, d, e, f) {\n return new Matrix(a, b, c, d, e, f);\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var has = \"hasOwnProperty\",\n make = Snap._.make,\n wrap = Snap._.wrap,\n is = Snap.is,\n getSomeDefs = Snap._.getSomeDefs,\n reURLValue = /^url/(#?([^)]+)/)$/,\n $ = Snap._.$,\n URL = Snap.url,\n Str = String,\n separator = Snap._.separator,\n E = \"\";\n // Attributes event handlers\n eve.on(\"snap.util.attr.mask\", function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value.type == \"mask\") {\n var mask = value;\n } else {\n mask = make(\"mask\", getSomeDefs(this));\n mask.node.appendChild(value.node);\n }\n !mask.node.id && $(mask.node, {\n id: mask.id\n });\n $(this.node, {\n mask: URL(mask.id)\n });\n }\n });\n (function (clipIt) {\n eve.on(\"snap.util.attr.clip\", clipIt);\n eve.on(\"snap.util.attr.clip-path\", clipIt);\n eve.on(\"snap.util.attr.clipPath\", clipIt);\n }(function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n if (value.type == \"clipPath\") {\n var clip = value;\n } else {\n clip = make(\"clipPath\", getSomeDefs(this));\n clip.node.appendChild(value.node);\n !clip.node.id && $(clip.node, {\n id: clip.id\n });\n }\n $(this.node, {\n \"clip-path\": URL(clip.node.id || clip.id)\n });\n }\n }));\n function fillStroke(name) {\n return function (value) {\n eve.stop();\n if (value instanceof Fragment && value.node.childNodes.length == 1 &&\n (value.node.firstChild.tagName == \"radialGradient\" ||\n value.node.firstChild.tagName == \"linearGradient\" ||\n value.node.firstChild.tagName == \"pattern\")) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n if (value instanceof Element) {\n if (value.type == \"radialGradient\" || value.type == \"linearGradient\"\n || value.type == \"pattern\") {\n if (!value.node.id) {\n $(value.node, {\n id: value.id\n });\n }\n var fill = URL(value.node.id);\n } else {\n fill = value.attr(name);\n }\n } else {\n fill = Snap.color(value);\n if (fill.error) {\n var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);\n if (grad) {\n if (!grad.node.id) {\n $(grad.node, {\n id: grad.id\n });\n }\n fill = URL(grad.node.id);\n } else {\n fill = value;\n }\n } else {\n fill = Str(fill);\n }\n }\n var attrs = {};\n attrs[name] = fill;\n $(this.node, attrs);\n this.node.style[name] = E;\n };\n }\n eve.on(\"snap.util.attr.fill\", fillStroke(\"fill\"));\n eve.on(\"snap.util.attr.stroke\", fillStroke(\"stroke\"));\n var gradrg = /^([lr])(?:/(([^)]*)/))?(.*)$/i;\n eve.on(\"snap.util.grad.parse\", function parseGrad(string) {\n string = Str(string);\n var tokens = string.match(gradrg);\n if (!tokens) {\n return null;\n }\n var type = tokens[1],\n params = tokens[2],\n stops = tokens[3];\n params = params.split(//s*,/s*/).map(function (el) {\n return +el == el ? +el : el;\n });\n if (params.length == 1 && params[0] == 0) {\n params = [];\n }\n stops = stops.split(\"-\");\n stops = stops.map(function (el) {\n el = el.split(\":\");\n var out = {\n color: el[0]\n };\n if (el[1]) {\n out.offset = parseFloat(el[1]);\n }\n return out;\n });\n return {\n type: type,\n params: params,\n stops: stops\n };\n });\n\n eve.on(\"snap.util.attr.d\", function (value) {\n eve.stop();\n if (is(value, \"array\") && is(value[0], \"array\")) {\n value = Snap.path.toString.call(value);\n }\n value = Str(value);\n if (value.match(/[ruo]/i)) {\n value = Snap.path.toAbsolute(value);\n }\n $(this.node, {d: value});\n })(-1);\n eve.on(\"snap.util.attr.#text\", function (value) {\n eve.stop();\n value = Str(value);\n var txt = glob.doc.createTextNode(value);\n while (this.node.firstChild) {\n this.node.removeChild(this.node.firstChild);\n }\n this.node.appendChild(txt);\n })(-1);\n eve.on(\"snap.util.attr.path\", function (value) {\n eve.stop();\n this.attr({d: value});\n })(-1);\n eve.on(\"snap.util.attr.class\", function (value) {\n eve.stop();\n this.node.className.baseVal = value;\n })(-1);\n eve.on(\"snap.util.attr.viewBox\", function (value) {\n var vb;\n if (is(value, \"object\") && \"x\" in value) {\n vb = [value.x, value.y, value.width, value.height].join(\" \");\n } else if (is(value, \"array\")) {\n vb = value.join(\" \");\n } else {\n vb = value;\n }\n $(this.node, {\n viewBox: vb\n });\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.transform\", function (value) {\n this.transform(value);\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.r\", function (value) {\n if (this.type == \"rect\") {\n eve.stop();\n $(this.node, {\n rx: value,\n ry: value\n });\n }\n })(-1);\n eve.on(\"snap.util.attr.textpath\", function (value) {\n eve.stop();\n if (this.type == \"text\") {\n var id, tp, node;\n if (!value && this.textPath) {\n tp = this.textPath;\n while (tp.node.firstChild) {\n this.node.appendChild(tp.node.firstChild);\n }\n tp.remove();\n delete this.textPath;\n return;\n }\n if (is(value, \"string\")) {\n var defs = getSomeDefs(this),\n path = wrap(defs.parentNode).path(value);\n defs.appendChild(path.node);\n id = path.id;\n path.attr({id: id});\n } else {\n value = wrap(value);\n if (value instanceof Element) {\n id = value.attr(\"id\");\n if (!id) {\n id = value.id;\n value.attr({id: id});\n }\n }\n }\n if (id) {\n tp = this.textPath;\n node = this.node;\n if (tp) {\n tp.attr({\"xlink:href\": \"#\" + id});\n } else {\n tp = $(\"textPath\", {\n \"xlink:href\": \"#\" + id\n });\n while (node.firstChild) {\n tp.appendChild(node.firstChild);\n }\n node.appendChild(tp);\n this.textPath = wrap(tp);\n }\n }\n }\n })(-1);\n eve.on(\"snap.util.attr.text\", function (value) {\n if (this.type == \"text\") {\n var i = 0,\n node = this.node,\n tuner = function (chunk) {\n var out = $(\"tspan\");\n if (is(chunk, \"array\")) {\n for (var i = 0; i < chunk.length; i++) {\n out.appendChild(tuner(chunk[i]));\n }\n } else {\n out.appendChild(glob.doc.createTextNode(chunk));\n }\n out.normalize && out.normalize();\n return out;\n };\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n var tuned = tuner(value);\n while (tuned.firstChild) {\n node.appendChild(tuned.firstChild);\n }\n }\n eve.stop();\n })(-1);\n function setFontSize(value) {\n eve.stop();\n if (value == +value) {\n value += \"px\";\n }\n this.node.style.fontSize = value;\n }\n eve.on(\"snap.util.attr.fontSize\", setFontSize)(-1);\n eve.on(\"snap.util.attr.font-size\", setFontSize)(-1);\n\n\n eve.on(\"snap.util.getattr.transform\", function () {\n eve.stop();\n return this.transform();\n })(-1);\n eve.on(\"snap.util.getattr.textpath\", function () {\n eve.stop();\n return this.textPath;\n })(-1);\n // Markers\n (function () {\n function getter(end) {\n return function () {\n eve.stop();\n var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue(\"marker-\" + end);\n if (style == \"none\") {\n return style;\n } else {\n return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));\n }\n };\n }\n function setter(end) {\n return function (value) {\n eve.stop();\n var name = \"marker\" + end.charAt(0).toUpperCase() + end.substring(1);\n if (value == \"\" || !value) {\n this.node.style[name] = \"none\";\n return;\n }\n if (value.type == \"marker\") {\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n }\n this.node.style[name] = URL(id);\n return;\n }\n };\n }\n eve.on(\"snap.util.getattr.marker-end\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.markerEnd\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.marker-start\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.markerStart\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.marker-mid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.getattr.markerMid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.marker-end\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.markerEnd\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.marker-start\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.markerStart\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.marker-mid\", setter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.markerMid\", setter(\"mid\"))(-1);\n }());\n eve.on(\"snap.util.getattr.r\", function () {\n if (this.type == \"rect\" && $(this.node, \"rx\") == $(this.node, \"ry\")) {\n eve.stop();\n return $(this.node, \"rx\");\n }\n })(-1);\n function textExtract(node) {\n var out = [];\n var children = node.childNodes;\n for (var i = 0, ii = children.length; i < ii; i++) {\n var chi = children[i];\n if (chi.nodeType == 3) {\n out.push(chi.nodeValue);\n }\n if (chi.tagName == \"tspan\") {\n if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {\n out.push(chi.firstChild.nodeValue);\n } else {\n out.push(textExtract(chi));\n }\n }\n }\n return out;\n }\n eve.on(\"snap.util.getattr.text\", function () {\n if (this.type == \"text\" || this.type == \"tspan\") {\n eve.stop();\n var out = textExtract(this.node);\n return out.length == 1 ? out[0] : out;\n }\n })(-1);\n eve.on(\"snap.util.getattr.#text\", function () {\n return this.node.textContent;\n })(-1);\n eve.on(\"snap.util.getattr.viewBox\", function () {\n eve.stop();\n var vb = $(this.node, \"viewBox\");\n if (vb) {\n vb = vb.split(separator);\n return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.points\", function () {\n var p = $(this.node, \"points\");\n eve.stop();\n if (p) {\n return p.split(separator);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.path\", function () {\n var p = $(this.node, \"d\");\n eve.stop();\n return p;\n })(-1);\n eve.on(\"snap.util.getattr.class\", function () {\n return this.node.className.baseVal;\n })(-1);\n function getFontSize() {\n eve.stop();\n return this.node.style.fontSize;\n }\n eve.on(\"snap.util.getattr.fontSize\", getFontSize)(-1);\n eve.on(\"snap.util.getattr.font-size\", getFontSize)(-1);\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var proto = Paper.prototype,\n is = Snap.is;\n /*/\n * Paper.rect\n [ method ]\n *\n * Draws a rectangle\n **\n - x (number) x coordinate of the top left corner\n - y (number) y coordinate of the top left corner\n - width (number) width\n - height (number) height\n - rx (number) #optional horizontal radius for rounded corners, default is 0\n - ry (number) #optional vertical radius for rounded corners, default is rx or 0\n = (object) the `rect` element\n **\n > Usage\n | // regular rectangle\n | var c = paper.rect(10, 10, 50, 50);\n | // rectangle with rounded corners\n | var c = paper.rect(40, 40, 50, 50, 10);\n /*/\n proto.rect = function (x, y, w, h, rx, ry) {\n var attr;\n if (ry == null) {\n ry = rx;\n }\n if (is(x, \"object\") && x == \"[object Object]\") {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n width: w,\n height: h\n };\n if (rx != null) {\n attr.rx = rx;\n attr.ry = ry;\n }\n }\n return this.el(\"rect\", attr);\n };\n /*/\n * Paper.circle\n [ method ]\n **\n * Draws a circle\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - r (number) radius\n = (object) the `circle` element\n **\n > Usage\n | var c = paper.circle(50, 50, 40);\n /*/\n proto.circle = function (cx, cy, r) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr = {\n cx: cx,\n cy: cy,\n r: r\n };\n }\n return this.el(\"circle\", attr);\n };\n\n var preload = (function () {\n function onerror() {\n this.parentNode.removeChild(this);\n }\n return function (src, f) {\n var img = glob.doc.createElement(\"img\"),\n body = glob.doc.body;\n img.style.cssText = \"position:absolute;left:-9999em;top:-9999em\";\n img.onload = function () {\n f.call(img);\n img.onload = img.onerror = null;\n body.removeChild(img);\n };\n img.onerror = onerror;\n body.appendChild(img);\n img.src = src;\n };\n }());\n\n /*/\n * Paper.image\n [ method ]\n **\n * Places an image on the surface\n **\n - src (string) URI of the source image\n - x (number) x offset position\n - y (number) y offset position\n - width (number) width of the image\n - height (number) height of the image\n = (object) the `image` element\n * or\n = (object) Snap element object with type `image`\n **\n > Usage\n | var c = paper.image(\"apple.png\", 10, 10, 80, 80);\n /*/\n proto.image = function (src, x, y, width, height) {\n var el = this.el(\"image\");\n if (is(src, \"object\") && \"src\" in src) {\n el.attr(src);\n } else if (src != null) {\n var set = {\n \"xlink:href\": src,\n preserveAspectRatio: \"none\"\n };\n if (x != null && y != null) {\n set.x = x;\n set.y = y;\n }\n if (width != null && height != null) {\n set.width = width;\n set.height = height;\n } else {\n preload(src, function () {\n Snap._.$(el.node, {\n width: this.offsetWidth,\n height: this.offsetHeight\n });\n });\n }\n Snap._.$(el.node, set);\n }\n return el;\n };\n /*/\n * Paper.ellipse\n [ method ]\n **\n * Draws an ellipse\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - rx (number) horizontal radius\n - ry (number) vertical radius\n = (object) the `ellipse` element\n **\n > Usage\n | var c = paper.ellipse(50, 50, 40, 20);\n /*/\n proto.ellipse = function (cx, cy, rx, ry) {\n var attr;\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr ={\n cx: cx,\n cy: cy,\n rx: rx,\n ry: ry\n };\n }\n return this.el(\"ellipse\", attr);\n };\n // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.\n /*/\n * Paper.path\n [ method ]\n **\n * Creates a `<path>` element using the given string as the path's definition\n - pathString (string) #optional path string in SVG format\n * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:\n | \"M10,20L30,40\"\n * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.\n *\n # <p>Here is short list of commands available, for more details see <a href=\"http://www.w3.org/TR/SVG/paths.html#PathData\" title=\"Details of a path's data attribute's format are described in the SVG specification.\">SVG path string format</a> or <a href=\"https://developer.mozilla.org/en/SVG/Tutorial/Paths\">article about path strings at MDN</a>.</p>\n # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>\n # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>\n # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>\n # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>\n # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>\n # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>\n # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>\n # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>\n # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>\n # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>\n # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>\n # <tr><td>R</td><td><a href=\"http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline\">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>\n * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.\n * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.\n > Usage\n | var c = paper.path(\"M10 10L90 90\");\n | // draw a diagonal line:\n | // move to 10,10, line to 90,90\n /*/\n proto.path = function (d) {\n var attr;\n if (is(d, \"object\") && !is(d, \"array\")) {\n attr = d;\n } else if (d) {\n attr = {d: d};\n }\n return this.el(\"path\", attr);\n };\n /*/\n * Paper.g\n [ method ]\n **\n * Creates a group element\n **\n - varargs (…) #optional elements to nest within the group\n = (object) the `g` element\n **\n > Usage\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g(c2, c1); // note that the order of elements is different\n * or\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g();\n | g.add(c2, c1);\n /*/\n /*/\n * Paper.group\n [ method ]\n **\n * See @Paper.g\n /*/\n proto.group = proto.g = function (first) {\n var attr,\n el = this.el(\"g\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.svg\n [ method ]\n **\n * Creates a nested SVG element.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `svg` element\n **\n /*/\n proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {\n var attrs = {};\n if (is(x, \"object\") && y == null) {\n attrs = x;\n } else {\n if (x != null) {\n attrs.x = x;\n }\n if (y != null) {\n attrs.y = y;\n }\n if (width != null) {\n attrs.width = width;\n }\n if (height != null) {\n attrs.height = height;\n }\n if (vbx != null && vby != null && vbw != null && vbh != null) {\n attrs.viewBox = [vbx, vby, vbw, vbh];\n }\n }\n return this.el(\"svg\", attrs);\n };\n /*/\n * Paper.mask\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a mask.\n **\n = (object) the `mask` element\n **\n /*/\n proto.mask = function (first) {\n var attr,\n el = this.el(\"mask\");\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n return el;\n };\n /*/\n * Paper.ptrn\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a pattern.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `pattern` element\n **\n /*/\n proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {\n if (is(x, \"object\")) {\n var attr = x;\n } else {\n attr = {patternUnits: \"userSpaceOnUse\"};\n if (x) {\n attr.x = x;\n }\n if (y) {\n attr.y = y;\n }\n if (width != null) {\n attr.width = width;\n }\n if (height != null) {\n attr.height = height;\n }\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n }\n return this.el(\"pattern\", attr);\n };\n /*/\n * Paper.use\n [ method ]\n **\n * Creates a <use> element.\n - id (string) @optional id of element to link\n * or\n - id (Element) @optional element to link\n **\n = (object) the `use` element\n **\n /*/\n proto.use = function (id) {\n if (id != null) {\n if (id instanceof Element) {\n if (!id.attr(\"id\")) {\n id.attr({id: Snap._.id(id)});\n }\n id = id.attr(\"id\");\n }\n if (String(id).charAt() == \"#\") {\n id = id.substring(1);\n }\n return this.el(\"use\", {\"xlink:href\": \"#\" + id});\n } else {\n return Element.prototype.use.call(this);\n }\n };\n /*/\n * Paper.symbol\n [ method ]\n **\n * Creates a <symbol> element.\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n = (object) the `symbol` element\n **\n /*/\n proto.symbol = function (vx, vy, vw, vh) {\n var attr = {};\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n\n return this.el(\"symbol\", attr);\n };\n /*/\n * Paper.text\n [ method ]\n **\n * Draws a text string\n **\n - x (number) x coordinate position\n - y (number) y coordinate position\n - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements\n = (object) the `text` element\n **\n > Usage\n | var t1 = paper.text(50, 50, \"Snap\");\n | var t2 = paper.text(50, 50, [\"S\",\"n\",\"a\",\"p\"]);\n | // Text path usage\n | t1.attr({textpath: \"M10,10L100,100\"});\n | // or\n | var pth = paper.path(\"M10,10L100,100\");\n | t1.attr({textpath: pth});\n /*/\n proto.text = function (x, y, text) {\n var attr = {};\n if (is(x, \"object\")) {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n text: text || \"\"\n };\n }\n return this.el(\"text\", attr);\n };\n /*/\n * Paper.line\n [ method ]\n **\n * Draws a line\n **\n - x1 (number) x coordinate position of the start\n - y1 (number) y coordinate position of the start\n - x2 (number) x coordinate position of the end\n - y2 (number) y coordinate position of the end\n = (object) the `line` element\n **\n > Usage\n | var t1 = paper.line(50, 50, 100, 100);\n /*/\n proto.line = function (x1, y1, x2, y2) {\n var attr = {};\n if (is(x1, \"object\")) {\n attr = x1;\n } else if (x1 != null) {\n attr = {\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n }\n return this.el(\"line\", attr);\n };\n /*/\n * Paper.polyline\n [ method ]\n **\n * Draws a polyline\n **\n - points (array) array of points\n * or\n - varargs (…) points\n = (object) the `polyline` element\n **\n > Usage\n | var p1 = paper.polyline([10, 10, 100, 100]);\n | var p2 = paper.polyline(10, 10, 100, 100);\n /*/\n proto.polyline = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polyline\", attr);\n };\n /*/\n * Paper.polygon\n [ method ]\n **\n * Draws a polygon. See @Paper.polyline\n /*/\n proto.polygon = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n var attr = {};\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {points: points};\n }\n return this.el(\"polygon\", attr);\n };\n // gradients\n (function () {\n var $ = Snap._.$;\n // gradients' helpers\n function Gstops() {\n return this.selectAll(\"stop\");\n }\n function GaddStop(color, offset) {\n var stop = $(\"stop\"),\n attr = {\n offset: +offset + \"%\"\n };\n color = Snap.color(color);\n attr[\"stop-color\"] = color.hex;\n if (color.opacity < 1) {\n attr[\"stop-opacity\"] = color.opacity;\n }\n $(stop, attr);\n this.node.appendChild(stop);\n return this;\n }\n function GgetBBox() {\n if (this.type == \"linearGradient\") {\n var x1 = $(this.node, \"x1\") || 0,\n x2 = $(this.node, \"x2\") || 1,\n y1 = $(this.node, \"y1\") || 0,\n y2 = $(this.node, \"y2\") || 0;\n return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));\n } else {\n var cx = this.node.cx || .5,\n cy = this.node.cy || .5,\n r = this.node.r || 0;\n return Snap._.box(cx - r, cy - r, r * 2, r * 2);\n }\n }\n function gradient(defs, str) {\n var grad = eve(\"snap.util.grad.parse\", null, str).firstDefined(),\n el;\n if (!grad) {\n return null;\n }\n grad.params.unshift(defs);\n if (grad.type.toLowerCase() == \"l\") {\n el = gradientLinear.apply(0, grad.params);\n } else {\n el = gradientRadial.apply(0, grad.params);\n }\n if (grad.type != grad.type.toLowerCase()) {\n $(el.node, {\n gradientUnits: \"userSpaceOnUse\"\n });\n }\n var stops = grad.stops,\n len = stops.length,\n start = 0,\n j = 0;\n function seed(i, end) {\n var step = (end - start) / (i - j);\n for (var k = j; k < i; k++) {\n stops[k].offset = +(+start + step * (k - j)).toFixed(2);\n }\n j = i;\n start = end;\n }\n len--;\n for (var i = 0; i < len; i++) if (\"offset\" in stops[i]) {\n seed(i, stops[i].offset);\n }\n stops[len].offset = stops[len].offset || 100;\n seed(len, stops[len].offset);\n for (i = 0; i <= len; i++) {\n var stop = stops[i];\n el.addStop(stop.color, stop.offset);\n }\n return el;\n }\n function gradientLinear(defs, x1, y1, x2, y2) {\n var el = Snap._.make(\"linearGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (x1 != null) {\n $(el.node, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n }\n return el;\n }\n function gradientRadial(defs, cx, cy, r, fx, fy) {\n var el = Snap._.make(\"radialGradient\", defs);\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n if (cx != null) {\n $(el.node, {\n cx: cx,\n cy: cy,\n r: r\n });\n }\n if (fx != null && fy != null) {\n $(el.node, {\n fx: fx,\n fy: fy\n });\n }\n return el;\n }\n /*/\n * Paper.gradient\n [ method ]\n **\n * Creates a gradient element\n **\n - gradient (string) gradient descriptor\n > Gradient Descriptor\n * The gradient descriptor is an expression formatted as\n * follows: `<type>(<coords>)<colors>`. The `<type>` can be\n * either linear or radial. The uppercase `L` or `R` letters\n * indicate absolute coordinates offset from the SVG surface.\n * Lowercase `l` or `r` letters indicate coordinates\n * calculated relative to the element to which the gradient is\n * applied. Coordinates specify a linear gradient vector as\n * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,\n * `r` and optional `fx`, `fy` specifying a focal point away\n * from the center of the circle. Specify `<colors>` as a list\n * of dash-separated CSS color values. Each color may be\n * followed by a custom offset value, separated with a colon\n * character.\n > Examples\n * Linear gradient, relative from top-left corner to bottom-right\n * corner, from black through red to white:\n | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n * Linear gradient, absolute from (0, 0) to (100, 100), from black\n * through red at 25% to white:\n | var g = paper.gradient(\"L(0, 0, 100, 100)#000-#f00:25-#fff\");\n * Radial gradient, relative from the center of the element with radius\n * half the width, from black to white:\n | var g = paper.gradient(\"r(0.5, 0.5, 0.5)#000-#fff\");\n * To apply the gradient:\n | paper.circle(50, 50, 40).attr({\n | fill: g\n | });\n = (object) the `gradient` element\n /*/\n proto.gradient = function (str) {\n return gradient(this.defs, str);\n };\n proto.gradientLinear = function (x1, y1, x2, y2) {\n return gradientLinear(this.defs, x1, y1, x2, y2);\n };\n proto.gradientRadial = function (cx, cy, r, fx, fy) {\n return gradientRadial(this.defs, cx, cy, r, fx, fy);\n };\n /*/\n * Paper.toString\n [ method ]\n **\n * Returns SVG code for the @Paper\n = (string) SVG code for the @Paper\n /*/\n proto.toString = function () {\n var doc = this.node.ownerDocument,\n f = doc.createDocumentFragment(),\n d = doc.createElement(\"div\"),\n svg = this.node.cloneNode(true),\n res;\n f.appendChild(d);\n d.appendChild(svg);\n Snap._.$(svg, {xmlns: \"http://www.w3.org/2000/svg\"});\n res = d.innerHTML;\n f.removeChild(f.firstChild);\n return res;\n };\n /*/\n * Paper.toDataURL\n [ method ]\n **\n * Returns SVG code for the @Paper as Data URI string.\n = (string) Data URI string\n /*/\n proto.toDataURL = function () {\n if (window && window.btoa) {\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(this)));\n }\n };\n /*/\n * Paper.clear\n [ method ]\n **\n * Removes all child nodes of the paper, except <defs>.\n /*/\n proto.clear = function () {\n var node = this.node.firstChild,\n next;\n while (node) {\n next = node.nextSibling;\n if (node.tagName != \"defs\") {\n node.parentNode.removeChild(node);\n } else {\n proto.clear.call({node: node});\n }\n node = next;\n }\n };\n }());\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n is = Snap.is,\n clone = Snap._.clone,\n has = \"hasOwnProperty\",\n p2s = /,?([a-z]),?/gi,\n toFloat = parseFloat,\n math = Math,\n PI = math.PI,\n mmin = math.min,\n mmax = math.max,\n pow = math.pow,\n abs = math.abs;\n function paths(ps) {\n var p = paths.ps = paths.ps || {};\n if (p[ps]) {\n p[ps].sleep = 100;\n } else {\n p[ps] = {\n sleep: 100\n };\n }\n setTimeout(function () {\n for (var key in p) if (p[has](key) && key != ps) {\n p[key].sleep--;\n !p[key].sleep && delete p[key];\n }\n });\n return p[ps];\n }\n function box(x, y, width, height) {\n if (x == null) {\n x = y = width = height = 0;\n }\n if (y == null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: math.min(width, height) / 2,\n r2: math.max(width, height) / 2,\n r0: math.sqrt(width * width + height * height) / 2,\n path: rectPath(x, y, width, height),\n vb: [x, y, width, height].join(\" \")\n };\n }\n function toString() {\n return this.join(\",\").replace(p2s, \"$1\");\n }\n function pathClone(pathArray) {\n var res = clone(pathArray);\n res.toString = toString;\n return res;\n }\n function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {\n if (length == null) {\n return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);\n } else {\n return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,\n getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));\n }\n }\n function getLengthFactory(istotal, subpath) {\n function O(val) {\n return +(+val).toFixed(3);\n }\n return Snap._.cacher(function (path, length, onlystart) {\n if (path instanceof Element) {\n path = path.attr(\"d\");\n }\n path = path2curve(path);\n var x, y, p, l, sp = \"\", subpaths = {}, point,\n len = 0;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = +p[1];\n y = +p[2];\n } else {\n l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n if (len + l > length) {\n if (subpath && !subpaths.start) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n sp += [\n \"C\" + O(point.start.x),\n O(point.start.y),\n O(point.m.x),\n O(point.m.y),\n O(point.x),\n O(point.y)\n ];\n if (onlystart) {return sp;}\n subpaths.start = sp;\n sp = [\n \"M\" + O(point.x),\n O(point.y) + \"C\" + O(point.n.x),\n O(point.n.y),\n O(point.end.x),\n O(point.end.y),\n O(p[5]),\n O(p[6])\n ].join();\n len += l;\n x = +p[5];\n y = +p[6];\n continue;\n }\n if (!istotal && !subpath) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n return point;\n }\n }\n len += l;\n x = +p[5];\n y = +p[6];\n }\n sp += p.shift() + p;\n }\n subpaths.end = sp;\n point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);\n return point;\n }, null, Snap._.clone);\n }\n var getTotalLength = getLengthFactory(1),\n getPointAtLength = getLengthFactory(),\n getSubpathsAtLength = getLengthFactory(0, 1);\n function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t,\n t13 = pow(t1, 3),\n t12 = pow(t1, 2),\n t2 = t * t,\n t3 = t2 * t,\n x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,\n mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n ax = t1 * p1x + t * c1x,\n ay = t1 * p1y + t * c1y,\n cx = t1 * c2x + t * p2x,\n cy = t1 * c2y + t * p2y,\n alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);\n // (mx > nx || my < ny) && (alpha += 180);\n return {\n x: x,\n y: y,\n m: {x: mx, y: my},\n n: {x: nx, y: ny},\n start: {x: ax, y: ay},\n end: {x: cx, y: cy},\n alpha: alpha\n };\n }\n function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Snap.is(p1x, \"array\")) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n var bbox = curveDim.apply(null, p1x);\n return box(\n bbox.min.x,\n bbox.min.y,\n bbox.max.x - bbox.min.x,\n bbox.max.y - bbox.min.y\n );\n }\n function isPointInsideBBox(bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n }\n function isBBoxIntersect(bbox1, bbox2) {\n bbox1 = box(bbox1);\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)\n || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)\n || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)\n || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)\n || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)\n || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x\n || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)\n && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y\n || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n }\n function base3(t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n }\n function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z == null) {\n z = 1;\n }\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2,\n n = 12,\n Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],\n Cvalues = [0.2491,0.2491,0.2335,0.2335,0.2032,0.2032,0.1601,0.1601,0.1069,0.1069,0.0472,0.0472],\n sum = 0;\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2,\n xbase = base3(ct, x1, x2, x3, x4),\n ybase = base3(ct, y1, y2, y3, y4),\n comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * math.sqrt(comb);\n }\n return z2 * sum;\n }\n function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {\n if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {\n return;\n }\n var t = 1,\n step = t / 2,\n t2 = t - step,\n l,\n e = .01;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n while (abs(l - ll) > e) {\n step /= 2;\n t2 += (l < ll ? 1 : -1) * step;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n }\n return t2;\n }\n function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n if (\n mmax(x1, x2) < mmin(x3, x4) ||\n mmin(x1, x2) > mmax(x3, x4) ||\n mmax(y1, y2) < mmin(y3, y4) ||\n mmin(y1, y2) > mmax(y3, y4)\n ) {\n return;\n }\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (!denominator) {\n return;\n }\n var px = nx / denominator,\n py = ny / denominator,\n px2 = +px.toFixed(2),\n py2 = +py.toFixed(2);\n if (\n px2 < +mmin(x1, x2).toFixed(2) ||\n px2 > +mmax(x1, x2).toFixed(2) ||\n px2 < +mmin(x3, x4).toFixed(2) ||\n px2 > +mmax(x3, x4).toFixed(2) ||\n py2 < +mmin(y1, y2).toFixed(2) ||\n py2 > +mmax(y1, y2).toFixed(2) ||\n py2 < +mmin(y3, y4).toFixed(2) ||\n py2 > +mmax(y3, y4).toFixed(2)\n ) {\n return;\n }\n return {x: px, y: py};\n }\n function inter(bez1, bez2) {\n return interHelper(bez1, bez2);\n }\n function interCount(bez1, bez2) {\n return interHelper(bez1, bez2, 1);\n }\n function interHelper(bez1, bez2, justCount) {\n var bbox1 = bezierBBox(bez1),\n bbox2 = bezierBBox(bez2);\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n var l1 = bezlen.apply(0, bez1),\n l2 = bezlen.apply(0, bez2),\n n1 = ~~(l1 / 8),\n n2 = ~~(l2 / 8),\n dots1 = [],\n dots2 = [],\n xy = {},\n res = justCount ? 0 : [];\n for (var i = 0; i < n1 + 1; i++) {\n var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({x: p.x, y: p.y, t: i / n1});\n }\n for (i = 0; i < n2 + 1; i++) {\n p = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({x: p.x, y: p.y, t: i / n2});\n }\n for (i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i],\n di1 = dots1[i + 1],\n dj = dots2[j],\n dj1 = dots2[j + 1],\n ci = abs(di1.x - di.x) < .001 ? \"y\" : \"x\",\n cj = abs(dj1.x - dj.x) < .001 ? \"y\" : \"x\",\n is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n if (is) {\n if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {\n continue;\n }\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n res++;\n } else {\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2\n });\n }\n }\n }\n }\n }\n return res;\n }\n function pathIntersection(path1, path2) {\n return interPathHelper(path1, path2);\n }\n function pathIntersectionNumber(path1, path2) {\n return interPathHelper(path1, path2, 1);\n }\n function interPathHelper(path1, path2, justCount) {\n path1 = path2curve(path1);\n path2 = path2curve(path2);\n var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,\n res = justCount ? 0 : [];\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n if (pi[0] == \"M\") {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n } else {\n if (pi[0] == \"C\") {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n } else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n if (pj[0] == \"M\") {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n } else {\n if (pj[0] == \"C\") {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n } else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n var intr = interHelper(bez1, bez2, justCount);\n if (justCount) {\n res += intr;\n } else {\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n res = res.concat(intr);\n }\n }\n }\n }\n }\n return res;\n }\n function isPointInsidePath(path, x, y) {\n var bbox = pathBBox(path);\n return isPointInsideBBox(bbox, x, y) &&\n interPathHelper(path, [[\"M\", x, y], [\"H\", bbox.x2 + 10]], 1) % 2 == 1;\n }\n function pathBBox(path) {\n var pth = paths(path);\n if (pth.bbox) {\n return clone(pth.bbox);\n }\n if (!path) {\n return box();\n }\n path = path2curve(path);\n var x = 0, \n y = 0,\n X = [],\n Y = [],\n p;\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n if (p[0] == \"M\") {\n x = p[1];\n y = p[2];\n X.push(x);\n Y.push(y);\n } else {\n var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n X = X.concat(dim.min.x, dim.max.x);\n Y = Y.concat(dim.min.y, dim.max.y);\n x = p[5];\n y = p[6];\n }\n }\n var xmin = mmin.apply(0, X),\n ymin = mmin.apply(0, Y),\n xmax = mmax.apply(0, X),\n ymax = mmax.apply(0, Y),\n bb = box(xmin, ymin, xmax - xmin, ymax - ymin);\n pth.bbox = clone(bb);\n return bb;\n }\n function rectPath(x, y, w, h, r) {\n if (r) {\n return [\n [\"M\", +x + (+r), y],\n [\"l\", w - r * 2, 0],\n [\"a\", r, r, 0, 0, 1, r, r],\n [\"l\", 0, h - r * 2],\n [\"a\", r, r, 0, 0, 1, -r, r],\n [\"l\", r * 2 - w, 0],\n [\"a\", r, r, 0, 0, 1, -r, -r],\n [\"l\", 0, r * 2 - h],\n [\"a\", r, r, 0, 0, 1, r, -r],\n [\"z\"]\n ];\n }\n var res = [[\"M\", x, y], [\"l\", w, 0], [\"l\", 0, h], [\"l\", -w, 0], [\"z\"]];\n res.toString = toString;\n return res;\n }\n function ellipsePath(x, y, rx, ry, a) {\n if (a == null && ry == null) {\n ry = rx;\n }\n x = +x;\n y = +y;\n rx = +rx;\n ry = +ry;\n if (a != null) {\n var rad = Math.PI / 180,\n x1 = x + rx * Math.cos(-ry * rad),\n x2 = x + rx * Math.cos(-a * rad),\n y1 = y + rx * Math.sin(-ry * rad),\n y2 = y + rx * Math.sin(-a * rad),\n res = [[\"M\", x1, y1], [\"A\", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];\n } else {\n res = [\n [\"M\", x, y],\n [\"m\", 0, -ry],\n [\"a\", rx, ry, 0, 1, 1, 0, 2 * ry],\n [\"a\", rx, ry, 0, 1, 1, 0, -2 * ry],\n [\"z\"]\n ];\n }\n res.toString = toString;\n return res;\n }\n var unit2px = Snap._unit2px,\n getPath = {\n path: function (el) {\n return el.attr(\"path\");\n },\n circle: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx, attr.cy, attr.r);\n },\n ellipse: function (el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);\n },\n rect: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);\n },\n image: function (el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);\n },\n line: function (el) {\n return \"M\" + [el.attr(\"x1\") || 0, el.attr(\"y1\") || 0, el.attr(\"x2\"), el.attr(\"y2\")];\n },\n polyline: function (el) {\n return \"M\" + el.attr(\"points\");\n },\n polygon: function (el) {\n return \"M\" + el.attr(\"points\") + \"z\";\n },\n deflt: function (el) {\n var bbox = el.node.getBBox();\n return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);\n }\n };\n function pathToRelative(pathArray) {\n var pth = paths(pathArray),\n lowerCase = String.prototype.toLowerCase;\n if (pth.rel) {\n return pathClone(pth.rel);\n }\n if (!Snap.is(pathArray, \"array\") || !Snap.is(pathArray && pathArray[0], \"array\")) {\n pathArray = Snap.parsePathString(pathArray);\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0;\n if (pathArray[0][0] == \"M\") {\n x = pathArray[0][1];\n y = pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res.push([\"M\", x, y]);\n }\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var r = res[i] = [],\n pa = pathArray[i];\n if (pa[0] != lowerCase.call(pa[0])) {\n r[0] = lowerCase.call(pa[0]);\n switch (r[0]) {\n case \"a\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +(pa[6] - x).toFixed(3);\n r[7] = +(pa[7] - y).toFixed(3);\n break;\n case \"v\":\n r[1] = +(pa[1] - y).toFixed(3);\n break;\n case \"m\":\n mx = pa[1];\n my = pa[2];\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);\n }\n }\n } else {\n r = res[i] = [];\n if (pa[0] == \"m\") {\n mx = pa[1] + x;\n my = pa[2] + y;\n }\n for (var k = 0, kk = pa.length; k < kk; k++) {\n res[i][k] = pa[k];\n }\n }\n var len = res[i].length;\n switch (res[i][0]) {\n case \"z\":\n x = mx;\n y = my;\n break;\n case \"h\":\n x += +res[i][len - 1];\n break;\n case \"v\":\n y += +res[i][len - 1];\n break;\n default:\n x += +res[i][len - 2];\n y += +res[i][len - 1];\n }\n }\n res.toString = toString;\n pth.rel = pathClone(res);\n return res;\n }\n function pathToAbsolute(pathArray) {\n var pth = paths(pathArray);\n if (pth.abs) {\n return pathClone(pth.abs);\n }\n if (!is(pathArray, \"array\") || !is(pathArray && pathArray[0], \"array\")) { // rough assumption\n pathArray = Snap.parsePathString(pathArray);\n }\n if (!pathArray || !pathArray.length) {\n return [[\"M\", 0, 0]];\n }\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0,\n pa0;\n if (pathArray[0][0] == \"M\") {\n x = +pathArray[0][1];\n y = +pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res[0] = [\"M\", x, y];\n }\n var crz = pathArray.length == 3 &&\n pathArray[0][0] == \"M\" &&\n pathArray[1][0].toUpperCase() == \"R\" &&\n pathArray[2][0].toUpperCase() == \"Z\";\n for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n res.push(r = []);\n pa = pathArray[i];\n pa0 = pa[0];\n if (pa0 != pa0.toUpperCase()) {\n r[0] = pa0.toUpperCase();\n switch (r[0]) {\n case \"A\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case \"V\":\n r[1] = +pa[1] + y;\n break;\n case \"H\":\n r[1] = +pa[1] + x;\n break;\n case \"R\":\n var dots = [x, y].concat(pa.slice(1));\n for (var j = 2, jj = dots.length; j < jj; j++) {\n dots[j] = +dots[j] + x;\n dots[++j] = +dots[j] + y;\n }\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n break;\n case \"O\":\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n break;\n case \"U\":\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n break;\n case \"M\":\n mx = +pa[1] + x;\n my = +pa[2] + y;\n default:\n for (j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n } else if (pa0 == \"R\") {\n dots = [x, y].concat(pa.slice(1));\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n r = [\"R\"].concat(pa.slice(-2));\n } else if (pa0 == \"O\") {\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n } else if (pa0 == \"U\") {\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n } else {\n for (var k = 0, kk = pa.length; k < kk; k++) {\n r[k] = pa[k];\n }\n }\n pa0 = pa0.toUpperCase();\n if (pa0 != \"O\") {\n switch (r[0]) {\n case \"Z\":\n x = +mx;\n y = +my;\n break;\n case \"H\":\n x = r[1];\n break;\n case \"V\":\n y = r[1];\n break;\n case \"M\":\n mx = r[r.length - 2];\n my = r[r.length - 1];\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n }\n }\n res.toString = toString;\n pth.abs = pathClone(res);\n return res;\n }\n function l2c(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n }\n function q2c(x1, y1, ax, ay, x2, y2) {\n var _13 = 1 / 3,\n _23 = 2 / 3;\n return [\n _13 * x1 + _23 * ax,\n _13 * y1 + _23 * ay,\n _13 * x2 + _23 * ax,\n _13 * y2 + _23 * ay,\n x2,\n y2\n ];\n }\n function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n // for more information of where this math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var _120 = PI * 120 / 180,\n rad = PI / 180 * (+angle || 0),\n res = [],\n xy,\n rotate = Snap._.cacher(function (x, y, rad) {\n var X = x * math.cos(rad) - y * math.sin(rad),\n Y = x * math.sin(rad) + y * math.cos(rad);\n return {x: X, y: Y};\n });\n if (!recursive) {\n xy = rotate(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotate(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var cos = math.cos(PI / 180 * angle),\n sin = math.sin(PI / 180 * angle),\n x = (x1 - x2) / 2,\n y = (y1 - y2) / 2;\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n if (h > 1) {\n h = math.sqrt(h);\n rx = h * rx;\n ry = h * ry;\n }\n var rx2 = rx * rx,\n ry2 = ry * ry,\n k = (large_arc_flag == sweep_flag ? -1 : 1) *\n math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n cx = k * rx * y / ry + (x1 + x2) / 2,\n cy = k * -ry * x / rx + (y1 + y2) / 2,\n f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n\n f1 = x1 < cx ? PI - f1 : f1;\n f2 = x2 < cx ? PI - f2 : f2;\n f1 < 0 && (f1 = PI * 2 + f1);\n f2 < 0 && (f2 = PI * 2 + f2);\n if (sweep_flag && f1 > f2) {\n f1 = f1 - PI * 2;\n }\n if (!sweep_flag && f2 > f1) {\n f2 = f2 - PI * 2;\n }\n } else {\n f1 = recursive[0];\n f2 = recursive[1];\n cx = recursive[2];\n cy = recursive[3];\n }\n var df = f2 - f1;\n if (abs(df) > _120) {\n var f2old = f2,\n x2old = x2,\n y2old = y2;\n f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n x2 = cx + rx * math.cos(f2);\n y2 = cy + ry * math.sin(f2);\n res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);\n }\n df = f2 - f1;\n var c1 = math.cos(f1),\n s1 = math.sin(f1),\n c2 = math.cos(f2),\n s2 = math.sin(f2),\n t = math.tan(df / 4),\n hx = 4 / 3 * rx * t,\n hy = 4 / 3 * ry * t,\n m1 = [x1, y1],\n m2 = [x1 + hx * s1, y1 - hy * c1],\n m3 = [x2 + hx * s2, y2 - hy * c2],\n m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n if (recursive) {\n return [m2, m3, m4].concat(res);\n } else {\n res = [m2, m3, m4].concat(res).join().split(\",\");\n var newres = [];\n for (var i = 0, ii = res.length; i < ii; i++) {\n newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n }\n return newres;\n }\n }\n function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n return {\n x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n };\n }\n \n // Returns bounding box of cubic bezier curve.\n // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n // Original version: NISHIO Hirokazu\n // Modifications: https://github.com/timo22345\n function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [[], []],\n a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (var i = 0; i < 2; ++i) {\n if (i == 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (abs(a) < 1e-12) {\n if (abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var x, y, j = tvalues.length,\n jlen = j,\n mt;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n\n return {\n min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},\n max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}\n };\n }\n\n function path2curve(path, path2) {\n var pth = !path2 && paths(path);\n if (!path2 && pth.curve) {\n return pathClone(pth.curve);\n }\n var p = pathToAbsolute(path),\n p2 = path2 && pathToAbsolute(path2),\n attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n processPath = function (path, d, pcom) {\n var nx, ny;\n if (!path) {\n return [\"C\", d.x, d.y, d.x, d.y, d.x, d.y];\n }\n !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);\n switch (path[0]) {\n case \"M\":\n d.X = path[1];\n d.Y = path[2];\n break;\n case \"A\":\n path = [\"C\"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));\n break;\n case \"S\":\n if (pcom == \"C\" || pcom == \"S\") { // In \"S\" case we have to take into account, if the previous command is C/S.\n nx = d.x * 2 - d.bx; // And reflect the previous\n ny = d.y * 2 - d.by; // command's control point relative to the current point.\n }\n else { // or some else or nothing\n nx = d.x;\n ny = d.y;\n }\n path = [\"C\", nx, ny].concat(path.slice(1));\n break;\n case \"T\":\n if (pcom == \"Q\" || pcom == \"T\") { // In \"T\" case we have to take into account, if the previous command is Q/T.\n d.qx = d.x * 2 - d.qx; // And make a reflection similar\n d.qy = d.y * 2 - d.qy; // to case \"S\".\n }\n else { // or something else or nothing\n d.qx = d.x;\n d.qy = d.y;\n }\n path = [\"C\"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));\n break;\n case \"Q\":\n d.qx = path[1];\n d.qy = path[2];\n path = [\"C\"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));\n break;\n case \"L\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], path[2]));\n break;\n case \"H\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], d.y));\n break;\n case \"V\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.x, path[1]));\n break;\n case \"Z\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.X, d.Y));\n break;\n }\n return path;\n },\n fixArc = function (pp, i) {\n if (pp[i].length > 7) {\n pp[i].shift();\n var pi = pp[i];\n while (pi.length) {\n pcoms1[i] = \"A\"; // if created multiple C:s, their original seg is saved\n p2 && (pcoms2[i] = \"A\"); // the same as above\n pp.splice(i++, 0, [\"C\"].concat(pi.splice(0, 6)));\n }\n pp.splice(i, 1);\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n fixM = function (path1, path2, a1, a2, i) {\n if (path1 && path2 && path1[i][0] == \"M\" && path2[i][0] != \"M\") {\n path2.splice(i, 0, [\"M\", a2.x, a2.y]);\n a1.bx = 0;\n a1.by = 0;\n a1.x = path1[i][1];\n a1.y = path1[i][2];\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n pcoms1 = [], // path commands of original path p\n pcoms2 = [], // path commands of original path p2\n pfirst = \"\", // temporary holder for original path command\n pcom = \"\"; // holder for previous path command of original path\n for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {\n p[i] && (pfirst = p[i][0]); // save current path command\n\n if (pfirst != \"C\") // C is not saved yet, because it may be result of conversion\n {\n pcoms1[i] = pfirst; // Save current path command\n i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom\n }\n p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath\n\n if (pcoms1[i] != \"A\" && pfirst == \"C\") pcoms1[i] = \"C\"; // A is the only command\n // which may produce multiple C:s\n // so we have to make sure that C is also C in original path\n\n fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1\n\n if (p2) { // the same procedures is done to p2\n p2[i] && (pfirst = p2[i][0]);\n if (pfirst != \"C\") {\n pcoms2[i] = pfirst;\n i && (pcom = pcoms2[i - 1]);\n }\n p2[i] = processPath(p2[i], attrs2, pcom);\n\n if (pcoms2[i] != \"A\" && pfirst == \"C\") {\n pcoms2[i] = \"C\";\n }\n\n fixArc(p2, i);\n }\n fixM(p, p2, attrs, attrs2, i);\n fixM(p2, p, attrs2, attrs, i);\n var seg = p[i],\n seg2 = p2 && p2[i],\n seglen = seg.length,\n seg2len = p2 && seg2.length;\n attrs.x = seg[seglen - 2];\n attrs.y = seg[seglen - 1];\n attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);\n attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);\n attrs2.x = p2 && seg2[seg2len - 2];\n attrs2.y = p2 && seg2[seg2len - 1];\n }\n if (!p2) {\n pth.curve = pathClone(p);\n }\n return p2 ? [p, p2] : p;\n }\n function mapPath(path, matrix) {\n if (!matrix) {\n return path;\n }\n var x, y, i, j, ii, jj, pathi;\n path = path2curve(path);\n for (i = 0, ii = path.length; i < ii; i++) {\n pathi = path[i];\n for (j = 1, jj = pathi.length; j < jj; j += 2) {\n x = matrix.x(pathi[j], pathi[j + 1]);\n y = matrix.y(pathi[j], pathi[j + 1]);\n pathi[j] = x;\n pathi[j + 1] = y;\n }\n }\n return path;\n }\n\n // http://schepers.cc/getting-to-the-point\n function catmullRom2bezier(crp, z) {\n var d = [];\n for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {\n var p = [\n {x: +crp[i - 2], y: +crp[i - 1]},\n {x: +crp[i], y: +crp[i + 1]},\n {x: +crp[i + 2], y: +crp[i + 3]},\n {x: +crp[i + 4], y: +crp[i + 5]}\n ];\n if (z) {\n if (!i) {\n p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};\n } else if (iLen - 4 == i) {\n p[3] = {x: +crp[0], y: +crp[1]};\n } else if (iLen - 2 == i) {\n p[2] = {x: +crp[0], y: +crp[1]};\n p[3] = {x: +crp[2], y: +crp[3]};\n }\n } else {\n if (iLen - 4 == i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {x: +crp[i], y: +crp[i + 1]};\n }\n }\n d.push([\"C\",\n (-p[0].x + 6 * p[1].x + p[2].x) / 6,\n (-p[0].y + 6 * p[1].y + p[2].y) / 6,\n (p[1].x + 6 * p[2].x - p[3].x) / 6,\n (p[1].y + 6*p[2].y - p[3].y) / 6,\n p[2].x,\n p[2].y\n ]);\n }\n\n return d;\n }\n\n // export\n Snap.path = paths;\n\n /*/\n * Snap.path.getTotalLength\n [ method ]\n **\n * Returns the length of the given path in pixels\n **\n - path (string) SVG path string\n **\n = (number) length\n /*/\n Snap.path.getTotalLength = getTotalLength;\n /*/\n * Snap.path.getPointAtLength\n [ method ]\n **\n * Returns the coordinates of the point located at the given length along the given path\n **\n - path (string) SVG path string\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n Snap.path.getPointAtLength = getPointAtLength;\n /*/\n * Snap.path.getSubpath\n [ method ]\n **\n * Returns the subpath of a given path between given start and end lengths\n **\n - path (string) SVG path string\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n Snap.path.getSubpath = function (path, from, to) {\n if (this.getTotalLength(path) - to < 1e-6) {\n return getSubpathsAtLength(path, from).end;\n }\n var a = getSubpathsAtLength(path, to, 1);\n return from ? getSubpathsAtLength(a, from).end : a;\n };\n /*/\n * Element.getTotalLength\n [ method ]\n **\n * Returns the length of the path in pixels (only works for `path` elements)\n = (number) length\n /*/\n elproto.getTotalLength = function () {\n if (this.node.getTotalLength) {\n return this.node.getTotalLength();\n }\n };\n // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?\n /*/\n * Element.getPointAtLength\n [ method ]\n **\n * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)\n **\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n /*/\n elproto.getPointAtLength = function (length) {\n return getPointAtLength(this.attr(\"d\"), length);\n };\n // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.\n /*/\n * Element.getSubpath\n [ method ]\n **\n * Returns subpath of a given element from given start and end lengths (only works for `path` elements)\n **\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n /*/\n elproto.getSubpath = function (from, to) {\n return Snap.path.getSubpath(this.attr(\"d\"), from, to);\n };\n Snap._.box = box;\n /*/\n * Snap.path.findDotsAtSegment\n [ method ]\n **\n * Utility method\n **\n * Finds dot coordinates on the given cubic beziér curve at the given t\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n - t (number) position on the curve (0..1)\n = (object) point information in format:\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o m: {\n o x: (number) x coordinate of the left anchor,\n o y: (number) y coordinate of the left anchor\n o },\n o n: {\n o x: (number) x coordinate of the right anchor,\n o y: (number) y coordinate of the right anchor\n o },\n o start: {\n o x: (number) x coordinate of the start of the curve,\n o y: (number) y coordinate of the start of the curve\n o },\n o end: {\n o x: (number) x coordinate of the end of the curve,\n o y: (number) y coordinate of the end of the curve\n o },\n o alpha: (number) angle of the curve derivative at the point\n o }\n /*/\n Snap.path.findDotsAtSegment = findDotsAtSegment;\n /*/\n * Snap.path.bezierBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given cubic beziér curve\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n * or\n - bez (array) array of six points for beziér curve\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.bezierBBox = bezierBBox;\n /*/\n * Snap.path.isPointInsideBBox\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside bounding box\n - bbox (string) bounding box\n - x (string) x coordinate of the point\n - y (string) y coordinate of the point\n = (boolean) `true` if point is inside\n /*/\n Snap.path.isPointInsideBBox = isPointInsideBBox;\n /*/\n * Snap.path.isBBoxIntersect\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if two bounding boxes intersect\n - bbox1 (string) first bounding box\n - bbox2 (string) second bounding box\n = (boolean) `true` if bounding boxes intersect\n /*/\n Snap.path.isBBoxIntersect = isBBoxIntersect;\n /*/\n * Snap.path.intersection\n [ method ]\n **\n * Utility method\n **\n * Finds intersections of two paths\n - path1 (string) path string\n - path2 (string) path string\n = (array) dots of intersection\n o [\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o t1: (number) t value for segment of path1,\n o t2: (number) t value for segment of path2,\n o segment1: (number) order number for segment of path1,\n o segment2: (number) order number for segment of path2,\n o bez1: (array) eight coordinates representing beziér curve for the segment of path1,\n o bez2: (array) eight coordinates representing beziér curve for the segment of path2\n o }\n o ]\n /*/\n Snap.path.intersection = pathIntersection;\n Snap.path.intersectionNumber = pathIntersectionNumber;\n /*/\n * Snap.path.isPointInside\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside a given closed path.\n *\n * Note: fill mode doesn’t affect the result of this method.\n - path (string) path string\n - x (number) x of the point\n - y (number) y of the point\n = (boolean) `true` if point is inside the path\n /*/\n Snap.path.isPointInside = isPointInsidePath;\n /*/\n * Snap.path.getBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given path\n - path (string) path string\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n /*/\n Snap.path.getBBox = pathBBox;\n Snap.path.get = getPath;\n /*/\n * Snap.path.toRelative\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into relative values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toRelative = pathToRelative;\n /*/\n * Snap.path.toAbsolute\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into absolute values\n - path (string) path string\n = (array) path string\n /*/\n Snap.path.toAbsolute = pathToAbsolute;\n /*/\n * Snap.path.toCubic\n [ method ]\n **\n * Utility method\n **\n * Converts path to a new path where all segments are cubic beziér curves\n - pathString (string|array) path string or array of segments\n = (array) array of segments\n /*/\n Snap.path.toCubic = path2curve;\n /*/\n * Snap.path.map\n [ method ]\n **\n * Transform the path string with the given matrix\n - path (string) path string\n - matrix (object) see @Matrix\n = (string) transformed path string\n /*/\n Snap.path.map = mapPath;\n Snap.path.toString = toString;\n Snap.path.clone = pathClone;\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n has = \"hasOwnProperty\",\n supportsTouch = \"createTouch\" in glob.doc,\n events = [\n \"click\", \"dblclick\", \"mousedown\", \"mousemove\", \"mouseout\",\n \"mouseover\", \"mouseup\", \"touchstart\", \"touchmove\", \"touchend\",\n \"touchcancel\"\n ],\n touchMap = {\n mousedown: \"touchstart\",\n mousemove: \"touchmove\",\n mouseup: \"touchend\"\n },\n getScroll = function (xy, el) {\n var name = xy == \"y\" ? \"scrollTop\" : \"scrollLeft\",\n doc = el && el.node ? el.node.ownerDocument : glob.doc;\n return doc[name in doc.documentElement ? \"documentElement\" : \"body\"][name];\n },\n preventDefault = function () {\n this.returnValue = false;\n },\n preventTouch = function () {\n return this.originalEvent.preventDefault();\n },\n stopPropagation = function () {\n this.cancelBubble = true;\n },\n stopTouch = function () {\n return this.originalEvent.stopPropagation();\n },\n addEvent = (function () {\n if (glob.doc.addEventListener) {\n return function (obj, type, fn, element) {\n var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,\n f = function (e) {\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element);\n if (supportsTouch && touchMap[has](type)) {\n for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {\n if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {\n var olde = e;\n e = e.targetTouches[i];\n e.originalEvent = olde;\n e.preventDefault = preventTouch;\n e.stopPropagation = stopTouch;\n break;\n }\n }\n }\n var x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n return fn.call(element, e, x, y);\n };\n\n if (type !== realName) {\n obj.addEventListener(type, f, false);\n }\n\n obj.addEventListener(realName, f, false);\n\n return function () {\n if (type !== realName) {\n obj.removeEventListener(type, f, false);\n }\n\n obj.removeEventListener(realName, f, false);\n return true;\n };\n };\n } else if (glob.doc.attachEvent) {\n return function (obj, type, fn, element) {\n var f = function (e) {\n e = e || element.node.ownerDocument.window.event;\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element),\n x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n e.preventDefault = e.preventDefault || preventDefault;\n e.stopPropagation = e.stopPropagation || stopPropagation;\n return fn.call(element, e, x, y);\n };\n obj.attachEvent(\"on\" + type, f);\n var detacher = function () {\n obj.detachEvent(\"on\" + type, f);\n return true;\n };\n return detacher;\n };\n }\n })(),\n drag = [],\n dragMove = function (e) {\n var x = e.clientX,\n y = e.clientY,\n scrollY = getScroll(\"y\"),\n scrollX = getScroll(\"x\"),\n dragi,\n j = drag.length;\n while (j--) {\n dragi = drag[j];\n if (supportsTouch) {\n var i = e.touches && e.touches.length,\n touch;\n while (i--) {\n touch = e.touches[i];\n if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {\n x = touch.clientX;\n y = touch.clientY;\n (e.originalEvent ? e.originalEvent : e).preventDefault();\n break;\n }\n }\n } else {\n e.preventDefault();\n }\n var node = dragi.el.node,\n o,\n next = node.nextSibling,\n parent = node.parentNode,\n display = node.style.display;\n // glob.win.opera && parent.removeChild(node);\n // node.style.display = \"none\";\n // o = dragi.el.paper.getElementByPoint(x, y);\n // node.style.display = display;\n // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));\n // o && eve(\"snap.drag.over.\" + dragi.el.id, dragi.el, o);\n x += scrollX;\n y += scrollY;\n eve(\"snap.drag.move.\" + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);\n }\n },\n dragUp = function (e) {\n Snap.unmousemove(dragMove).unmouseup(dragUp);\n var i = drag.length,\n dragi;\n while (i--) {\n dragi = drag[i];\n dragi.el._drag = {};\n eve(\"snap.drag.end.\" + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);\n }\n drag = [];\n };\n /*/\n * Element.click\n [ method ]\n **\n * Adds a click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unclick\n [ method ]\n **\n * Removes a click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.dblclick\n [ method ]\n **\n * Adds a double click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.undblclick\n [ method ]\n **\n * Removes a double click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousedown\n [ method ]\n **\n * Adds a mousedown event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousedown\n [ method ]\n **\n * Removes a mousedown event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mousemove\n [ method ]\n **\n * Adds a mousemove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmousemove\n [ method ]\n **\n * Removes a mousemove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseout\n [ method ]\n **\n * Adds a mouseout event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseout\n [ method ]\n **\n * Removes a mouseout event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseover\n [ method ]\n **\n * Adds a mouseover event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseover\n [ method ]\n **\n * Removes a mouseover event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.mouseup\n [ method ]\n **\n * Adds a mouseup event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.unmouseup\n [ method ]\n **\n * Removes a mouseup event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchstart\n [ method ]\n **\n * Adds a touchstart event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchstart\n [ method ]\n **\n * Removes a touchstart event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchmove\n [ method ]\n **\n * Adds a touchmove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchmove\n [ method ]\n **\n * Removes a touchmove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchend\n [ method ]\n **\n * Adds a touchend event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchend\n [ method ]\n **\n * Removes a touchend event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n \n /*/\n * Element.touchcancel\n [ method ]\n **\n * Adds a touchcancel event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n /*/\n * Element.untouchcancel\n [ method ]\n **\n * Removes a touchcancel event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n /*/\n for (var i = events.length; i--;) {\n (function (eventName) {\n Snap[eventName] = elproto[eventName] = function (fn, scope) {\n if (Snap.is(fn, \"function\")) {\n this.events = this.events || [];\n this.events.push({\n name: eventName,\n f: fn,\n unbind: addEvent(this.node || document, eventName, fn, scope || this)\n });\n }\n return this;\n };\n Snap[\"un\" + eventName] =\n elproto[\"un\" + eventName] = function (fn) {\n var events = this.events || [],\n l = events.length;\n while (l--) if (events[l].name == eventName &&\n (events[l].f == fn || !fn)) {\n events[l].unbind();\n events.splice(l, 1);\n !events.length && delete this.events;\n return this;\n }\n return this;\n };\n })(events[i]);\n }\n /*/\n * Element.hover\n [ method ]\n **\n * Adds hover event handlers to the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n - icontext (object) #optional context for hover in handler\n - ocontext (object) #optional context for hover out handler\n = (object) @Element\n /*/\n elproto.hover = function (f_in, f_out, scope_in, scope_out) {\n return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);\n };\n /*/\n * Element.unhover\n [ method ]\n **\n * Removes hover event handlers from the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n = (object) @Element\n /*/\n elproto.unhover = function (f_in, f_out) {\n return this.unmouseover(f_in).unmouseout(f_out);\n };\n var draggable = [];\n // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.\n // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?\n // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.\n // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?\n /*/\n * Element.drag\n [ method ]\n **\n * Adds event handlers for an element's drag gesture\n **\n - onmove (function) handler for moving\n - onstart (function) handler for drag start\n - onend (function) handler for drag end\n - mcontext (object) #optional context for moving handler\n - scontext (object) #optional context for drag start handler\n - econtext (object) #optional context for drag end handler\n * Additionaly following `drag` events are triggered: `drag.start.<id>` on start, \n * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element \n * `drag.over.<id>` fires as well.\n *\n * Start event and start handler are called in specified context or in context of the element with following parameters:\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * Move event and move handler are called in specified context or in context of the element with following parameters:\n o dx (number) shift by x from the start point\n o dy (number) shift by y from the start point\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * End event and end handler are called in specified context or in context of the element with following parameters:\n o event (object) DOM event object\n = (object) @Element\n /*/\n elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {\n if (!arguments.length) {\n var origTransform;\n return this.drag(function (dx, dy) {\n this.attr({\n transform: origTransform + (origTransform ? \"T\" : \"t\") + [dx, dy]\n });\n }, function () {\n origTransform = this.transform().local;\n });\n }\n function start(e, x, y) {\n (e.originalEvent || e).preventDefault();\n this._drag.x = x;\n this._drag.y = y;\n this._drag.id = e.identifier;\n !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);\n drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});\n onstart && eve.on(\"snap.drag.start.\" + this.id, onstart);\n onmove && eve.on(\"snap.drag.move.\" + this.id, onmove);\n onend && eve.on(\"snap.drag.end.\" + this.id, onend);\n eve(\"snap.drag.start.\" + this.id, start_scope || move_scope || this, x, y, e);\n }\n this._drag = {};\n draggable.push({el: this, start: start});\n this.mousedown(start);\n return this;\n };\n /*\n * Element.onDragOver\n [ method ]\n **\n * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)\n - f (function) handler for event, first argument would be the element you are dragging over\n /*/\n // elproto.onDragOver = function (f) {\n // f ? eve.on(\"snap.drag.over.\" + this.id, f) : eve.unbind(\"snap.drag.over.\" + this.id);\n // };\n /*/\n * Element.undrag\n [ method ]\n **\n * Removes all drag event handlers from the given element\n /*/\n elproto.undrag = function () {\n var i = draggable.length;\n while (i--) if (draggable[i].el == this) {\n this.unmousedown(draggable[i].start);\n draggable.splice(i, 1);\n eve.unbind(\"snap.drag.*.\" + this.id);\n }\n !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);\n return this;\n };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n pproto = Paper.prototype,\n rgurl = /^/s*url/((.+)/)/,\n Str = String,\n $ = Snap._.$;\n Snap.filter = {};\n /*/\n * Paper.filter\n [ method ]\n **\n * Creates a `<filter>` element\n **\n - filstr (string) SVG fragment of filter provided as a string\n = (object) @Element\n * Note: It is recommended to use filters embedded into the page inside an empty SVG element.\n > Usage\n | var f = paper.filter('<feGaussianBlur stdDeviation=\"2\"/>'),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n pproto.filter = function (filstr) {\n var paper = this;\n if (paper.type != \"svg\") {\n paper = paper.paper;\n }\n var f = Snap.parse(Str(filstr)),\n id = Snap._.id(),\n width = paper.node.offsetWidth,\n height = paper.node.offsetHeight,\n filter = $(\"filter\");\n $(filter, {\n id: id,\n filterUnits: \"userSpaceOnUse\"\n });\n filter.appendChild(f.node);\n paper.defs.appendChild(filter);\n return new Element(filter);\n };\n \n eve.on(\"snap.util.getattr.filter\", function () {\n eve.stop();\n var p = $(this.node, \"filter\");\n if (p) {\n var match = Str(p).match(rgurl);\n return match && Snap.select(match[1]);\n }\n });\n eve.on(\"snap.util.attr.filter\", function (value) {\n if (value instanceof Element && value.type == \"filter\") {\n eve.stop();\n var id = value.node.id;\n if (!id) {\n $(value.node, {id: value.id});\n id = value.id;\n }\n $(this.node, {\n filter: Snap.url(id)\n });\n }\n if (!value || value == \"none\") {\n eve.stop();\n this.node.removeAttribute(\"filter\");\n }\n });\n /*/\n * Snap.filter.blur\n [ method ]\n **\n * Returns an SVG markup string for the blur filter\n **\n - x (number) amount of horizontal blur, in pixels\n - y (number) #optional amount of vertical blur, in pixels\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.blur(5, 10)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.blur = function (x, y) {\n if (x == null) {\n x = 2;\n }\n var def = y == null ? x : [x, y];\n return Snap.format('/<feGaussianBlur stdDeviation=\"{def}\"/>', {\n def: def\n });\n };\n Snap.filter.blur.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.shadow\n [ method ]\n **\n * Returns an SVG markup string for the shadow filter\n **\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - blur (number) #optional amount of blur\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * which makes blur default to `4`. Or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - opacity (number) #optional `0..1` opacity of the shadow\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n /*/\n Snap.filter.shadow = function (dx, dy, blur, color, opacity) {\n if (typeof blur == \"string\") {\n color = blur;\n opacity = color;\n blur = 4;\n }\n if (typeof color != \"string\") {\n opacity = color;\n color = \"#000\";\n }\n color = color || \"#000\";\n if (blur == null) {\n blur = 4;\n }\n if (opacity == null) {\n opacity = 1;\n }\n if (dx == null) {\n dx = 0;\n dy = 2;\n }\n if (dy == null) {\n dy = dx;\n }\n color = Snap.color(color);\n return Snap.format('<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"{blur}\"/><feOffset dx=\"{dx}\" dy=\"{dy}\" result=\"offsetblur\"/><feFlood flood-color=\"{color}\"/><feComposite in2=\"offsetblur\" operator=\"in\"/><feComponentTransfer><feFuncA type=\"linear\" slope=\"{opacity}\"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge>', {\n color: color,\n dx: dx,\n dy: dy,\n blur: blur,\n opacity: opacity\n });\n };\n Snap.filter.shadow.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.grayscale\n [ method ]\n **\n * Returns an SVG markup string for the grayscale filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.grayscale = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0\"/>', {\n a: 0.2126 + 0.7874 * (1 - amount),\n b: 0.7152 - 0.7152 * (1 - amount),\n c: 0.0722 - 0.0722 * (1 - amount),\n d: 0.2126 - 0.2126 * (1 - amount),\n e: 0.7152 + 0.2848 * (1 - amount),\n f: 0.0722 - 0.0722 * (1 - amount),\n g: 0.2126 - 0.2126 * (1 - amount),\n h: 0.0722 + 0.9278 * (1 - amount)\n });\n };\n Snap.filter.grayscale.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.sepia\n [ method ]\n **\n * Returns an SVG markup string for the sepia filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.sepia = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0\"/>', {\n a: 0.393 + 0.607 * (1 - amount),\n b: 0.769 - 0.769 * (1 - amount),\n c: 0.189 - 0.189 * (1 - amount),\n d: 0.349 - 0.349 * (1 - amount),\n e: 0.686 + 0.314 * (1 - amount),\n f: 0.168 - 0.168 * (1 - amount),\n g: 0.272 - 0.272 * (1 - amount),\n h: 0.534 - 0.534 * (1 - amount),\n i: 0.131 + 0.869 * (1 - amount)\n });\n };\n Snap.filter.sepia.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.saturate\n [ method ]\n **\n * Returns an SVG markup string for the saturate filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.saturate = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feColorMatrix type=\"saturate\" values=\"{amount}\"/>', {\n amount: 1 - amount\n });\n };\n Snap.filter.saturate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.hueRotate\n [ method ]\n **\n * Returns an SVG markup string for the hue-rotate filter\n **\n - angle (number) angle of rotation\n = (string) filter representation\n /*/\n Snap.filter.hueRotate = function (angle) {\n angle = angle || 0;\n return Snap.format('<feColorMatrix type=\"hueRotate\" values=\"{angle}\"/>', {\n angle: angle\n });\n };\n Snap.filter.hueRotate.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.invert\n [ method ]\n **\n * Returns an SVG markup string for the invert filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.invert = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncG type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncB type=\"table\" tableValues=\"{amount} {amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: 1 - amount\n });\n };\n Snap.filter.invert.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.brightness\n [ method ]\n **\n * Returns an SVG markup string for the brightness filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.brightness = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\"/><feFuncG type=\"linear\" slope=\"{amount}\"/><feFuncB type=\"linear\" slope=\"{amount}\"/></feComponentTransfer>', {\n amount: amount\n });\n };\n Snap.filter.brightness.toString = function () {\n return this();\n };\n /*/\n * Snap.filter.contrast\n [ method ]\n **\n * Returns an SVG markup string for the contrast filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n /*/\n Snap.filter.contrast = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncG type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncB type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: .5 - amount / 2\n });\n };\n Snap.filter.contrast.toString = function () {\n return this();\n };\n});\n\nreturn Snap;\n}));","'use strict';\n\nvar snapsvg = module.exports = require(66);\n\nsnapsvg.plugin(function(Snap, Element) {\n\n /*/\n * Element.children\n [ method ]\n **\n * Returns array of all the children of the element.\n = (array) array of Elements\n /*/\n Element.prototype.children = function () {\n var out = [],\n ch = this.node.childNodes;\n for (var i = 0, ii = ch.length; i < ii; i++) {\n out[i] = new Snap(ch[i]);\n }\n return out;\n };\n});\n\n\n/**\n * @class ClassPlugin\n *\n * Extends snapsvg with methods to add and remove classes\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n function split(str) {\n return str.split(//s+/);\n }\n\n function join(array) {\n return array.join(' ');\n }\n\n function getClasses(e) {\n return split(e.attr('class') || '');\n }\n\n function setClasses(e, classes) {\n e.attr('class', join(classes));\n }\n\n /**\n * @method snapsvg.Element#addClass\n *\n * @example\n *\n * e.attr('class', 'selector');\n *\n * e.addClass('foo bar'); // adds classes foo and bar\n * e.attr('class'); // -> 'selector foo bar'\n *\n * e.addClass('fooBar');\n * e.attr('class'); // -> 'selector foo bar fooBar'\n *\n * @param {String} cls classes to be added to the element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.addClass = function(cls) {\n var current = getClasses(this),\n add = split(cls),\n i, e;\n\n for (i = 0, e; !!(e = add[i]); i++) {\n if (current.indexOf(e) === -1) {\n current.push(e);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n /**\n * @method snapsvg.Element#hasClass\n *\n * @param {String} cls the class to query for\n * @return {Boolean} returns true if the element has the given class\n */\n Element.prototype.hasClass = function(cls) {\n if (!cls) {\n throw new Error('[snapsvg] syntax: hasClass(clsStr)');\n }\n\n return getClasses(this).indexOf(cls) !== -1;\n };\n\n /**\n * @method snapsvg.Element#removeClass\n *\n * @example\n *\n * e.attr('class', 'foo bar');\n *\n * e.removeClass('foo');\n * e.attr('class'); // -> 'bar'\n *\n * e.removeClass('foo bar'); // removes classes foo and bar\n * e.attr('class'); // -> ''\n *\n * @param {String} cls classes to be removed from element\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.removeClass = function(cls) {\n var current = getClasses(this),\n remove = split(cls),\n i, e, idx;\n\n for (i = 0, e; !!(e = remove[i]); i++) {\n idx = current.indexOf(e);\n\n if (idx !== -1) {\n // remove element from array\n current.splice(idx, 1);\n }\n }\n\n setClasses(this, current);\n\n return this;\n };\n\n});\n\n/**\n * @class TranslatePlugin\n *\n * Extends snapsvg with methods to translate elements\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.Element#translate\n *\n * @example\n *\n * e.translate(10, 20);\n *\n * // sets transform matrix to translate(10, 20)\n *\n * @param {Number} x translation\n * @param {Number} y translation\n *\n * @return {snapsvg.Element} the element (this)\n */\n Element.prototype.translate = function(x, y) {\n var matrix = new Snap.Matrix();\n matrix.translate(x, y);\n return this.transform(matrix);\n };\n});\n\n\n/**\n * @class CreatePlugin\n *\n * Create an svg element without attaching it to the dom\n */\nsnapsvg.plugin(function(Snap) {\n\n Snap.create = function(name, attrs) {\n return Snap._.wrap(Snap._.$(name, attrs));\n };\n});\n\n\n/**\n * @class CreatSnapAtPlugin\n *\n * Extends snap.svg with a method to create a SVG element\n * at a specific position in the DOM.\n */\nsnapsvg.plugin(function(Snap, Element, Paper, global) {\n\n /*\n * @method snapsvg.createSnapAt\n *\n * @example\n *\n * snapsvg.createSnapAt(parentNode, 200, 200);\n *\n * @param {Number} width of svg\n * @param {Number} height of svg\n * @param {Object} parentNode svg Element will be child of this\n *\n * @return {snapsvg.Element} the newly created wrapped SVG element instance\n */\n Snap.createSnapAt = function(width, height, parentNode) {\n\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('width', width);\n svg.setAttribute('height', height);\n if (!parentNode) {\n parentNode = document.body;\n }\n parentNode.appendChild(svg);\n\n return new Snap(svg);\n };\n});","\r\nvar isArray = function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]';\r\n};\r\n\r\nvar annotate = function() {\r\n var args = Array.prototype.slice.call(arguments);\r\n \r\n if (args.length === 1 && isArray(args[0])) {\r\n args = args[0];\r\n }\r\n\r\n var fn = args.pop();\r\n\r\n fn.$inject = args;\r\n\r\n return fn;\r\n};\r\n\r\n\r\n// Current limitations:\r\n// - can't put into \"function arg\" comments\r\n// function /* (no parenthesis like this) */ (){}\r\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\r\n//\r\n// Just put the comment before function or inside:\r\n// /* (((this is fine))) */ function(a, b) {}\r\n// function abc(a) { /* (((this is fine))) */}\r\n\r\nvar FN_ARGS = /^function/s*[^/(]*/(/s*([^/)]*)/)/m;\r\nvar FN_ARG = ////*([^/*]*)/*///m;\r\n\r\nvar parse = function(fn) {\r\n if (typeof fn !== 'function') {\r\n throw new Error('Cannot annotate \"' + fn + '\". Expected a function!');\r\n }\r\n\r\n var match = fn.toString().match(FN_ARGS);\r\n return match[1] && match[1].split(',').map(function(arg) {\r\n match = arg.match(FN_ARG);\r\n return match ? match[1].trim() : arg.trim();\r\n }) || [];\r\n};\r\n\r\n\r\nexports.annotate = annotate;\r\nexports.parse = parse;\r\nexports.isArray = isArray;\r\n","module.exports = {\r\n annotate: require(68).annotate,\r\n Module: require(71),\r\n Injector: require(70)\r\n};\r\n","var Module = require(71);\r\nvar autoAnnotate = require(68).parse;\r\nvar annotate = require(68).annotate;\r\nvar isArray = require(68).isArray;\r\n\r\n\r\nvar Injector = function(modules, parent) {\r\n parent = parent || {\r\n get: function(name) {\r\n currentlyResolving.push(name);\r\n throw error('No provider for \"' + name + '\"!');\r\n }\r\n };\r\n\r\n var currentlyResolving = [];\r\n var providers = this._providers = Object.create(parent._providers || null);\r\n var instances = this._instances = Object.create(null);\r\n\r\n var self = instances.injector = this;\r\n\r\n var error = function(msg) {\r\n var stack = currentlyResolving.join(' -> ');\r\n currentlyResolving.length = 0;\r\n return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);\r\n };\r\n\r\n var get = function(name) {\r\n if (!providers[name] && name.indexOf('.') !== -1) {\r\n var parts = name.split('.');\r\n var pivot = get(parts.shift());\r\n\r\n while(parts.length) {\r\n pivot = pivot[parts.shift()];\r\n }\r\n\r\n return pivot;\r\n }\r\n\r\n if (Object.hasOwnProperty.call(instances, name)) {\r\n return instances[name];\r\n }\r\n\r\n if (Object.hasOwnProperty.call(providers, name)) {\r\n if (currentlyResolving.indexOf(name) !== -1) {\r\n currentlyResolving.push(name);\r\n throw error('Cannot resolve circular dependency!');\r\n }\r\n\r\n currentlyResolving.push(name);\r\n instances[name] = providers[name][0](providers[name][1]);\r\n currentlyResolving.pop();\r\n\r\n return instances[name];\r\n }\r\n\r\n return parent.get(name);\r\n };\r\n\r\n var instantiate = function(Type) {\r\n var instance = Object.create(Type.prototype);\r\n var returned = invoke(Type, instance);\r\n\r\n return typeof returned === 'object' ? returned : instance;\r\n };\r\n\r\n var invoke = function(fn, context) {\r\n if (typeof fn !== 'function') {\r\n if (isArray(fn)) {\r\n fn = annotate(fn.slice());\r\n } else {\r\n throw new Error('Cannot invoke \"' + fn + '\". Expected a function!');\r\n }\r\n }\r\n\r\n var inject = fn.$inject && fn.$inject || autoAnnotate(fn);\r\n var dependencies = inject.map(function(dep) {\r\n return get(dep);\r\n });\r\n\r\n // TODO(vojta): optimize without apply\r\n return fn.apply(context, dependencies);\r\n };\r\n\r\n\r\n var createPrivateInjectorFactory = function(privateChildInjector) {\r\n return annotate(function(key) {\r\n return privateChildInjector.get(key);\r\n });\r\n };\r\n\r\n var createChild = function(modules, forceNewInstances) {\r\n if (forceNewInstances && forceNewInstances.length) {\r\n var fromParentModule = Object.create(null);\r\n var matchedScopes = Object.create(null);\r\n\r\n var privateInjectorsCache = [];\r\n var privateChildInjectors = [];\r\n var privateChildFactories = [];\r\n\r\n var provider;\r\n var cacheIdx;\r\n var privateChildInjector;\r\n var privateChildInjectorFactory;\r\n for (var name in providers) {\r\n provider = providers[name];\r\n\r\n if (forceNewInstances.indexOf(name) !== -1) {\r\n if (provider[2] === 'private') {\r\n cacheIdx = privateInjectorsCache.indexOf(provider[3]);\r\n if (cacheIdx === -1) {\r\n privateChildInjector = provider[3].createChild([], forceNewInstances);\r\n privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\r\n privateInjectorsCache.push(provider[3]);\r\n privateChildInjectors.push(privateChildInjector);\r\n privateChildFactories.push(privateChildInjectorFactory);\r\n fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];\r\n } else {\r\n fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];\r\n }\r\n } else {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n }\r\n matchedScopes[name] = true;\r\n }\r\n\r\n if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\r\n forceNewInstances.forEach(function(scope) {\r\n if (provider[1].$scope.indexOf(scope) !== -1) {\r\n fromParentModule[name] = [provider[2], provider[1]];\r\n matchedScopes[scope] = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n forceNewInstances.forEach(function(scope) {\r\n if (!matchedScopes[scope]) {\r\n throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\r\n }\r\n });\r\n\r\n modules.unshift(fromParentModule);\r\n }\r\n\r\n return new Injector(modules, self);\r\n };\r\n\r\n var factoryMap = {\r\n factory: invoke,\r\n type: instantiate,\r\n value: function(value) {\r\n return value;\r\n }\r\n };\r\n\r\n modules.forEach(function(module) {\r\n\r\n function arrayUnwrap(type, value) {\r\n if (type !== 'value' && isArray(value)) {\r\n value = annotate(value.slice());\r\n }\r\n\r\n return value;\r\n }\r\n\r\n // TODO(vojta): handle wrong inputs (modules)\r\n if (module instanceof Module) {\r\n module.forEach(function(provider) {\r\n var name = provider[0];\r\n var type = provider[1];\r\n var value = provider[2];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n } else if (typeof module === 'object') {\r\n if (module.__exports__) {\r\n var clonedModule = Object.keys(module).reduce(function(m, key) {\r\n if (key.substring(0, 2) !== '__') {\r\n m[key] = module[key];\r\n }\r\n return m;\r\n }, Object.create(null));\r\n\r\n var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);\r\n var getFromPrivateInjector = annotate(function(key) {\r\n return privateInjector.get(key);\r\n });\r\n module.__exports__.forEach(function(key) {\r\n providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];\r\n });\r\n } else {\r\n Object.keys(module).forEach(function(name) {\r\n if (module[name][2] === 'private') {\r\n providers[name] = module[name];\r\n return;\r\n }\r\n\r\n var type = module[name][0];\r\n var value = module[name][1];\r\n\r\n providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n });\r\n }\r\n }\r\n });\r\n\r\n // public API\r\n this.get = get;\r\n this.invoke = invoke;\r\n this.instantiate = instantiate;\r\n this.createChild = createChild;\r\n};\r\n\r\nmodule.exports = Injector;\r\n","var Module = function() {\r\n var providers = [];\r\n\r\n this.factory = function(name, factory) {\r\n providers.push([name, 'factory', factory]);\r\n return this;\r\n };\r\n\r\n this.value = function(name, value) {\r\n providers.push([name, 'value', value]);\r\n return this;\r\n };\r\n\r\n this.type = function(name, type) {\r\n providers.push([name, 'type', type]);\r\n return this;\r\n };\r\n\r\n this.forEach = function(iterator) {\r\n providers.forEach(iterator);\r\n };\r\n};\r\n\r\nmodule.exports = Module;\r\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","var arrayEvery = require(90),\n baseCallback = require(97),\n baseEvery = require(102),\n isArray = require(159),\n isIterateeCall = require(147);\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * The predicate is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias all\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.every(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = every;\n","var arrayFilter = require(91),\n baseCallback = require(97),\n baseFilter = require(103),\n isArray = require(159);\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias select\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.filter([4, 5, 6], function(n) {\n * return n % 2 == 0;\n * });\n * // => [4, 6]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.filter(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.filter(users, 'active'), 'user');\n * // => ['barney']\n */\nfunction filter(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n predicate = baseCallback(predicate, thisArg, 3);\n return func(collection, predicate);\n}\n\nmodule.exports = filter;\n","var baseEach = require(101),\n createFind = require(136);\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias detect\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.result(_.find(users, function(chr) {\n * return chr.age < 40;\n * }), 'user');\n * // => 'barney'\n *\n * // using the `_.matches` callback shorthand\n * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.result(_.find(users, 'active', false), 'user');\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.result(_.find(users, 'active'), 'user');\n * // => 'barney'\n */\nvar find = createFind(baseEach);\n\nmodule.exports = find;\n","var arrayEach = require(89),\n baseEach = require(101),\n createForEach = require(137);\n\n/**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection). Iteratee functions may exit iteration early\n * by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n * may be used for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(n) {\n * console.log(n);\n * }).value();\n * // => logs each value from left to right and returns the array\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n * console.log(n, key);\n * });\n * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n */\nvar forEach = createForEach(arrayEach, baseEach);\n\nmodule.exports = forEach;\n","var createAggregator = require(131);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is an array of the elements responsible for generating the key.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return Math.floor(n);\n * });\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * // using the `_.property` callback shorthand\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n});\n\nmodule.exports = groupBy;\n","var baseIndexOf = require(111),\n getLength = require(142),\n isArray = require(159),\n isIterateeCall = require(147),\n isLength = require(149),\n isString = require(165),\n values = require(174);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection` using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n * from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @alias contains, include\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {*} target The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n * // => true\n *\n * _.includes('pebbles', 'eb');\n * // => true\n */\nfunction includes(collection, target, fromIndex, guard) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n collection = values(collection);\n length = collection.length;\n }\n if (!length) {\n return false;\n }\n if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n fromIndex = 0;\n } else {\n fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n }\n return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)\n : (baseIndexOf(collection, target, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var arrayMap = require(92),\n baseCallback = require(97),\n baseMap = require(116),\n isArray = require(159);\n\n/**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n * `sum`, `uniq`, and `words`\n *\n * @static\n * @memberOf _\n * @alias collect\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function timesThree(n) {\n * return n * 3;\n * }\n *\n * _.map([1, 2], timesThree);\n * // => [3, 6]\n *\n * _.map({ 'a': 1, 'b': 2 }, timesThree);\n * // => [3, 6] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee, thisArg) {\n var func = isArray(collection) ? arrayMap : baseMap;\n iteratee = baseCallback(iteratee, thisArg, 3);\n return func(collection, iteratee);\n}\n\nmodule.exports = map;\n","var arrayReduce = require(93),\n baseEach = require(101),\n createReduce = require(138);\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` through `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not provided the first element of `collection` is used as the initial\n * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`\n *\n * @static\n * @memberOf _\n * @alias foldl, inject\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.reduce([1, 2], function(total, n) {\n * return total + n;\n * });\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n * result[key] = n * 3;\n * return result;\n * }, {});\n * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n */\nvar reduce = createReduce(arrayReduce, baseEach);\n\nmodule.exports = reduce;\n","var arraySome = require(94),\n baseCallback = require(97),\n baseSome = require(125),\n isArray = require(159),\n isIterateeCall = require(147);\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * The function returns as soon as it finds a passing value and does not iterate\n * over the entire collection. The predicate is bound to `thisArg` and invoked\n * with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias any\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.some(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, thisArg) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = null;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = baseCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n}\n\nmodule.exports = some;\n","var isNative = require(161);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeNow = isNative(nativeNow = Date.now) && nativeNow;\n\n/**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = nativeNow || function() {\n return new Date().getTime();\n};\n\nmodule.exports = now;\n","var isObject = require(163),\n now = require(83);\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that delays invoking `func` until after `wait` milliseconds\n * have elapsed since the last time it was invoked. The created function comes\n * with a `cancel` method to cancel delayed invocations. Provide an options\n * object to indicate that `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it is invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n * 'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n * todoChanges.cancel();\n * }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\nfunction debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = wait < 0 ? 0 : (+wait || 0);\n if (options === true) {\n var leading = true;\n trailing = false;\n } else if (isObject(options)) {\n leading = options.leading;\n maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n trailing = 'trailing' in options ? options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n }\n\n function delayed() {\n var remaining = wait - (now() - stamp);\n if (remaining <= 0 || remaining > wait) {\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n var isCalled = trailingCall;\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n } else {\n timeoutId = setTimeout(delayed, remaining);\n }\n }\n\n function maxDelayed() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (trailing || (maxWait !== wait)) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n }\n }\n\n function debounced() {\n args = arguments;\n stamp = now();\n thisArg = this;\n trailingCall = trailing && (timeoutId || !leading);\n\n if (maxWait === false) {\n var leadingCall = leading && !timeoutId;\n } else {\n if (!maxTimeoutId && !leading) {\n lastCalled = stamp;\n }\n var remaining = maxWait - (stamp - lastCalled),\n isCalled = remaining <= 0 || remaining > maxWait;\n\n if (isCalled) {\n if (maxTimeoutId) {\n maxTimeoutId = clearTimeout(maxTimeoutId);\n }\n lastCalled = stamp;\n result = func.apply(thisArg, args);\n }\n else if (!maxTimeoutId) {\n maxTimeoutId = setTimeout(maxDelayed, remaining);\n }\n }\n if (isCalled && timeoutId) {\n timeoutId = clearTimeout(timeoutId);\n }\n else if (!timeoutId && wait !== maxWait) {\n timeoutId = setTimeout(delayed, wait);\n }\n if (leadingCall) {\n isCalled = true;\n result = func.apply(thisArg, args);\n }\n if (isCalled && !timeoutId && !maxTimeoutId) {\n args = thisArg = null;\n }\n return result;\n }\n debounced.cancel = cancel;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var baseDelay = require(99),\n restParam = require(86);\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it is invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // logs 'deferred' after one or more milliseconds\n */\nvar defer = restParam(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n}\n\nmodule.exports = restParam;\n","var cachePush = require('./cachePush'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var length = values ? values.length : 0;\n\n this.data = { 'hash': nativeCreate(null), 'set': new Set };\n while (length--) {\n this.push(values[length]);\n }\n}\n\n// Add functions to the `Set` cache.\nSetCache.prototype.push = cachePush;\n\nmodule.exports = SetCache;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = arrayCopy;\n","/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n","/**\n * A specialized version of `_.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * A specialized version of `_.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * A specialized version of `_.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the first element of `array`\n * as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * A specialized version of `_.some` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var getSymbols = require(143),\n keys = require(169);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * A specialized version of `_.assign` for customizing assigned values without\n * support for argument juggling, multiple sources, and `this` binding `customizer`\n * functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n */\nfunction assignWith(object, source, customizer) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n value = object[key],\n result = customizer(value, source[key], key, object, source);\n\n if ((result === result ? (result !== value) : (value === value)) ||\n (value === undefined && !(key in object))) {\n object[key] = result;\n }\n }\n return object;\n}\n\nmodule.exports = assignWith;\n","var baseCopy = require(98),\n getSymbols = require(143),\n isNative = require(161),\n keys = require(169);\n\n/** Native method references. */\nvar preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;\n\n/** Used as `baseAssign`. */\nvar nativeAssign = (function() {\n // Avoid `Object.assign` in Firefox 34-37 which have an early implementation\n // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344\n // for more details.\n //\n // Use `Object.preventExtensions` on a plain object instead of simply using\n // `Object('x')` because Chrome and IE fail to throw an error when attempting\n // to assign values to readonly indexes of strings.\n var func = preventExtensions && isNative(func = Object.assign) && func;\n try {\n if (func) {\n var object = preventExtensions({ '1': 0 });\n object[0] = 1;\n }\n } catch(e) {\n // Only attempt in strict mode.\n try { func(object, 'xo'); } catch(e) {}\n return !object[1] && func;\n }\n return false;\n}());\n\n/**\n * The base implementation of `_.assign` without support for argument juggling,\n * multiple sources, and `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nvar baseAssign = nativeAssign || function(object, source) {\n return source == null\n ? object\n : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));\n};\n\nmodule.exports = baseAssign;\n","var baseMatches = require(117),\n baseMatchesProperty = require(118),\n bindCallback = require(128),\n identity = require(178),\n property = require(179);\n\n/**\n * The base implementation of `_.callback` which supports specifying the\n * number of arguments to provide to `func`.\n *\n * @private\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction baseCallback(func, thisArg, argCount) {\n var type = typeof func;\n if (type == 'function') {\n return thisArg === undefined\n ? func\n : bindCallback(func, thisArg, argCount);\n }\n if (func == null) {\n return identity;\n }\n if (type == 'object') {\n return baseMatches(func);\n }\n return thisArg === undefined\n ? property(func)\n : baseMatchesProperty(func, thisArg);\n}\n\nmodule.exports = baseCallback;\n","/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n}\n\nmodule.exports = baseCopy;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts an index\n * of where to slice the arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Object} args The arguments provide to `func`.\n * @returns {number} Returns the timer id.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","var baseIndexOf = require(111),\n cacheIndexOf = require(129),\n createCache = require(135);\n\n/**\n * The base implementation of `_.difference` which accepts a single array\n * of values to exclude.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values) {\n var length = array ? array.length : 0,\n result = [];\n\n if (!length) {\n return result;\n }\n var index = -1,\n indexOf = baseIndexOf,\n isCommon = true,\n cache = (isCommon && values.length >= 200) ? createCache(values) : null,\n valuesLength = values.length;\n\n if (cache) {\n indexOf = cacheIndexOf;\n isCommon = false;\n values = cache;\n }\n outer:\n while (++index < length) {\n var value = array[index];\n\n if (isCommon && value === value) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === value) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (indexOf(values, value, 0) < 0) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","var baseForOwn = require(109),\n createBaseEach = require(133);\n\n/**\n * The base implementation of `_.forEach` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require(101);\n\n/**\n * The base implementation of `_.every` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n","var baseEach = require(101);\n\n/**\n * The base implementation of `_.filter` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n * without support for callback shorthands and `this` binding, which iterates\n * over `collection` using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @param {boolean} [retKey] Specify returning the key of the found element\n * instead of the element itself.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFind(collection, predicate, eachFunc, retKey) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = retKey ? key : value;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFind;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var isArguments = require(158),\n isArray = require(159),\n isArrayLike = require(145),\n isObjectLike = require(150);\n\n/**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, isDeep, isStrict) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (isObjectLike(value) && isArrayLike(value) &&\n (isStrict || isArray(value) || isArguments(value))) {\n if (isDeep) {\n // Recursively flatten arrays (susceptible to call stack limits).\n value = baseFlatten(value, isDeep, isStrict);\n }\n var valIndex = -1,\n valLength = value.length;\n\n while (++valIndex < valLength) {\n result[++resIndex] = value[valIndex];\n }\n } else if (!isStrict) {\n result[++resIndex] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var createBaseFor = require(134);\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require(107),\n keysIn = require(170);\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n","var baseFor = require(107),\n keys = require(169);\n\n/**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var toObject = require(156);\n\n/**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path, pathKey) {\n if (object == null) {\n return;\n }\n if (pathKey !== undefined && pathKey in toObject(object)) {\n path = [pathKey];\n }\n var index = -1,\n length = path.length;\n\n while (object != null && ++index < length) {\n object = object[path[index]];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var indexOfNaN = require(144);\n\n/**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOf;\n","var baseIsEqualDeep = require(113);\n\n/**\n * The base implementation of `_.isEqual` without support for `this` binding\n * `customizer` functions.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n // Exit early for identical values.\n if (value === other) {\n return true;\n }\n var valType = typeof value,\n othType = typeof other;\n\n // Exit early for unlike primitive values.\n if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||\n value == null || other == null) {\n // Return `false` unless both values are `NaN`.\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n}\n\nmodule.exports = baseIsEqual;\n","var equalArrays = require(139),\n equalByTag = require(140),\n equalObjects = require(141),\n isArray = require(159),\n isTypedArray = require(166);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = objToString.call(object);\n if (objTag == argsTag) {\n objTag = objectTag;\n } else if (objTag != objectTag) {\n objIsArr = isTypedArray(object);\n }\n }\n if (!othIsArr) {\n othTag = objToString.call(other);\n if (othTag == argsTag) {\n othTag = objectTag;\n } else if (othTag != objectTag) {\n othIsArr = isTypedArray(other);\n }\n }\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && !(objIsArr || objIsObj)) {\n return equalByTag(object, other, objTag);\n }\n if (!isLoose) {\n var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (valWrapped || othWrapped) {\n return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n }\n }\n if (!isSameTag) {\n return false;\n }\n // Assume cyclic values are equal.\n // For more information on detecting circular references see https://es5.github.io/#JO.\n stackA || (stackA = []);\n stackB || (stackB = []);\n\n var length = stackA.length;\n while (length--) {\n if (stackA[length] == object) {\n return stackB[length] == other;\n }\n }\n // Add `object` and `other` to the stack of traversed objects.\n stackA.push(object);\n stackB.push(other);\n\n var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n stackA.pop();\n stackB.pop();\n\n return result;\n}\n\nmodule.exports = baseIsEqualDeep;\n","/**\n * The base implementation of `_.isFunction` without support for environments\n * with incorrect `typeof` results.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n */\nfunction baseIsFunction(value) {\n // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n return typeof value == 'function' || false;\n}\n\nmodule.exports = baseIsFunction;\n","var baseIsEqual = require(112);\n\n/**\n * The base implementation of `_.isMatch` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The source property names to match.\n * @param {Array} values The source values to match.\n * @param {Array} strictCompareFlags Strict comparison flags for source values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, props, values, strictCompareFlags, customizer) {\n var index = -1,\n length = props.length,\n noCustomizer = !customizer;\n\n while (++index < length) {\n if ((noCustomizer && strictCompareFlags[index])\n ? values[index] !== object[props[index]]\n : !(props[index] in object)\n ) {\n return false;\n }\n }\n index = -1;\n while (++index < length) {\n var key = props[index],\n objValue = object[key],\n srcValue = values[index];\n\n if (noCustomizer && strictCompareFlags[index]) {\n var result = objValue !== undefined || (key in object);\n } else {\n result = customizer ? customizer(objValue, srcValue, key) : undefined;\n if (result === undefined) {\n result = baseIsEqual(srcValue, objValue, customizer, true);\n }\n }\n if (!result) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var baseEach = require(101),\n isArrayLike = require(145);\n\n/**\n * The base implementation of `_.map` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var baseIsMatch = require(115),\n constant = require(177),\n isStrictComparable = require(151),\n keys = require(169),\n toObject = require(156);\n\n/**\n * The base implementation of `_.matches` which does not clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatches(source) {\n var props = keys(source),\n length = props.length;\n\n if (!length) {\n return constant(true);\n }\n if (length == 1) {\n var key = props[0],\n value = source[key];\n\n if (isStrictComparable(value)) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value && (value !== undefined || (key in toObject(object)));\n };\n }\n }\n var values = Array(length),\n strictCompareFlags = Array(length);\n\n while (length--) {\n value = source[props[length]];\n values[length] = value;\n strictCompareFlags[length] = isStrictComparable(value);\n }\n return function(object) {\n return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require(110),\n baseIsEqual = require(112),\n baseSlice = require(124),\n isArray = require(159),\n isKey = require(148),\n isStrictComparable = require(151),\n last = require(73),\n toObject = require(156),\n toPath = require(157);\n\n/**\n * The base implementation of `_.matchesProperty` which does not which does\n * not clone `value`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} value The value to compare.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatchesProperty(path, value) {\n var isArr = isArray(path),\n isCommon = isKey(path) && isStrictComparable(value),\n pathKey = (path + '');\n\n path = toPath(path);\n return function(object) {\n if (object == null) {\n return false;\n }\n var key = pathKey;\n object = toObject(object);\n if ((isArr || !isCommon) && !(key in object)) {\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n if (object == null) {\n return false;\n }\n key = last(path);\n object = toObject(object);\n }\n return object[key] === value\n ? (value !== undefined || (key in object))\n : baseIsEqual(value, object[key], null, true);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var arrayEach = require(89),\n baseMergeDeep = require(120),\n getSymbols = require(143),\n isArray = require(159),\n isArrayLike = require(145),\n isObject = require(163),\n isObjectLike = require(150),\n isTypedArray = require(166),\n keys = require(169);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));\n if (!isSrcArr) {\n var props = keys(source);\n push.apply(props, getSymbols(source));\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((isSrcArr || result !== undefined) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n}\n\nmodule.exports = baseMerge;\n","var arrayCopy = require(88),\n isArguments = require(158),\n isArray = require(159),\n isArrayLike = require(145),\n isPlainObject = require(164),\n isTypedArray = require(166),\n toPlainObject = require(167);\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n}\n\nmodule.exports = baseMergeDeep;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require(110),\n toPath = require(157);\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction basePropertyDeep(path) {\n var pathKey = (path + '');\n path = toPath(path);\n return function(object) {\n return baseGet(object, path, pathKey);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight` without support\n * for callback shorthands and `this` binding, which iterates over `collection`\n * using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initFromCollection Specify using the first or last element\n * of `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initFromCollection\n ? (initFromCollection = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n start = start == null ? 0 : (+start || 0);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : (+end || 0);\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseEach = require(101);\n\n/**\n * The base implementation of `_.some` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n","/**\n * Converts `value` to a string if it is not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n if (typeof value == 'string') {\n return value;\n }\n return value == null ? '' : (value + '');\n}\n\nmodule.exports = baseToString;\n","/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n var index = -1,\n length = props.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = object[props[index]];\n }\n return result;\n}\n\nmodule.exports = baseValues;\n","var identity = require(178);\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n}\n\nmodule.exports = bindCallback;\n","var isObject = require(163);\n\n/**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\nfunction cacheIndexOf(cache, value) {\n var data = cache.data,\n result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n return result ? 0 : -1;\n}\n\nmodule.exports = cacheIndexOf;\n","var isObject = require(163);\n\n/**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\nfunction cachePush(value) {\n var data = this.data;\n if (typeof value == 'string' || isObject(value)) {\n data.set.add(value);\n } else {\n data.hash[value] = true;\n }\n}\n\nmodule.exports = cachePush;\n","var baseCallback = require(97),\n baseEach = require(101),\n isArray = require(159);\n\n/**\n * Creates a function that aggregates a collection, creating an accumulator\n * object composed from the results of running each element in the collection\n * through an iteratee.\n *\n * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,\n * and `_.partition`.\n *\n * @private\n * @param {Function} setter The function to set keys and values of the accumulator object.\n * @param {Function} [initializer] The function to initialize the accumulator object.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee, thisArg) {\n var result = initializer ? initializer() : {};\n iteratee = baseCallback(iteratee, thisArg, 3);\n\n if (isArray(collection)) {\n var index = -1,\n length = collection.length;\n\n while (++index < length) {\n var value = collection[index];\n setter(result, value, iteratee(value, index, collection), collection);\n }\n } else {\n baseEach(collection, function(value, key, collection) {\n setter(result, value, iteratee(value, key, collection), collection);\n });\n }\n return result;\n };\n}\n\nmodule.exports = createAggregator;\n","var bindCallback = require(128),\n isIterateeCall = require(147),\n restParam = require(86);\n\n/**\n * Creates a function that assigns properties of source object(s) to a given\n * destination object.\n *\n * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 && sources[length - 2],\n guard = length > 2 && sources[2],\n thisArg = length > 1 && sources[length - 1];\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : null;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? null : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var getLength = require(142),\n isLength = require(149),\n toObject = require(156);\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n return eachFunc(collection, iteratee);\n }\n var index = fromRight ? length : -1,\n iterable = toObject(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var toObject = require(156);\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var SetCache = require('./SetCache'),\n constant = require('../utility/constant'),\n isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\nvar createCache = !(nativeCreate && Set) ? constant(null) : function(values) {\n return new SetCache(values);\n};\n\nmodule.exports = createCache;\n","var baseCallback = require(97),\n baseFind = require(104),\n baseFindIndex = require(105),\n isArray = require(159);\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(eachFunc, fromRight) {\n return function(collection, predicate, thisArg) {\n predicate = baseCallback(predicate, thisArg, 3);\n if (isArray(collection)) {\n var index = baseFindIndex(collection, predicate, fromRight);\n return index > -1 ? collection[index] : undefined;\n }\n return baseFind(collection, predicate, eachFunc);\n };\n}\n\nmodule.exports = createFind;\n","var bindCallback = require(128),\n isArray = require(159);\n\n/**\n * Creates a function for `_.forEach` or `_.forEachRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createForEach(arrayFunc, eachFunc) {\n return function(collection, iteratee, thisArg) {\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee)\n : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n };\n}\n\nmodule.exports = createForEach;\n","var baseCallback = require(97),\n baseReduce = require(123),\n isArray = require(159);\n\n/**\n * Creates a function for `_.reduce` or `_.reduceRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createReduce(arrayFunc, eachFunc) {\n return function(collection, iteratee, accumulator, thisArg) {\n var initFromArray = arguments.length < 3;\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n };\n}\n\nmodule.exports = createReduce;\n","/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing arrays.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var index = -1,\n arrLength = array.length,\n othLength = other.length,\n result = true;\n\n if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (result && ++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, arrValue, index)\n : customizer(arrValue, othValue, index);\n }\n if (result === undefined) {\n // Recursively compare arrays (susceptible to call stack limits).\n if (isLoose) {\n var othIndex = othLength;\n while (othIndex--) {\n othValue = other[othIndex];\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n if (result) {\n break;\n }\n }\n } else {\n result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n }\n return !!result;\n}\n\nmodule.exports = equalArrays;\n","/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n stringTag = '[object String]';\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} value The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag) {\n switch (tag) {\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object)\n ? other != +other\n : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var keys = require(169);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isLoose) {\n return false;\n }\n var skipCtor = isLoose,\n index = -1;\n\n while (++index < objLength) {\n var key = objProps[index],\n result = isLoose ? key in other : hasOwnProperty.call(other, key);\n\n if (result) {\n var objValue = object[key],\n othValue = other[key];\n\n result = undefined;\n if (customizer) {\n result = isLoose\n ? customizer(othValue, objValue, key)\n : customizer(objValue, othValue, key);\n }\n if (result === undefined) {\n // Recursively compare objects (susceptible to call stack limits).\n result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);\n }\n }\n if (!result) {\n return false;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (!skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = equalObjects;\n","var baseProperty = require(121);\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n","var constant = require(177),\n isNative = require(161),\n toObject = require(156);\n\n/** Native method references. */\nvar getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;\n\n/**\n * Creates an array of the own symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {\n return getOwnPropertySymbols(toObject(object));\n};\n\nmodule.exports = getSymbols;\n","/**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\nfunction indexOfNaN(array, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 0 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n var other = array[index];\n if (other !== other) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = indexOfNaN;\n","var getLength = require(142),\n isLength = require(149);\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = +value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n","var isArrayLike = require(145),\n isIndex = require(146),\n isObject = require(163);\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var isArray = require(159),\n toObject = require(156);\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = //.|/[(?:[^[/]]*|([\"'])(?:(?!/1)[^/n//]|//.)*?/1)/]/,\n reIsPlainProp = /^/w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n var type = typeof value;\n if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n return true;\n }\n if (isArray(value)) {\n return false;\n }\n var result = !reIsDeepProp.test(value);\n return result || (object != null && value in toObject(object));\n}\n\nmodule.exports = isKey;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require(163);\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var toObject = require(156);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties specified\n * by `props`.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property names to pick.\n * @returns {Object} Returns the new object.\n */\nfunction pickByArray(object, props) {\n object = toObject(object);\n\n var index = -1,\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index];\n if (key in object) {\n result[key] = object[key];\n }\n }\n return result;\n}\n\nmodule.exports = pickByArray;\n","var baseForIn = require(108);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties `predicate`\n * returns truthy for.\n *\n * @private\n * @param {Object} object The source object.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Object} Returns the new object.\n */\nfunction pickByCallback(object, predicate) {\n var result = {};\n baseForIn(object, function(value, key, object) {\n if (predicate(value, key, object)) {\n result[key] = value;\n }\n });\n return result;\n}\n\nmodule.exports = pickByCallback;\n","var baseForIn = require(108),\n isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A fallback implementation of `_.isPlainObject` which checks if `value`\n * is an object created by the `Object` constructor or has a `[[Prototype]]`\n * of `null`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n */\nfunction shimIsPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||\n (!hasOwnProperty.call(value, 'constructor') &&\n (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = shimIsPlainObject;\n","var isArguments = require(158),\n isArray = require(159),\n isIndex = require(146),\n isLength = require(149),\n keysIn = require(170),\n support = require(176);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object)));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = shimKeys;\n","var isObject = require(163);\n\n/**\n * Converts `value` to an object if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n","var baseToString = require(126),\n isArray = require(159);\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[/]]+|/[(?:(-?/d+(?:/./d+)?)|([\"'])((?:(?!/2)[^/n//]|//.)*?)/2)/]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = ///(//)?/g;\n\n/**\n * Converts `value` to property path array if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return value;\n }\n var result = [];\n baseToString(value).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n}\n\nmodule.exports = toPath;\n","var isArrayLike = require(145),\n isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;\n}\n\nmodule.exports = isArguments;\n","var isLength = require(149),\n isNative = require(161),\n isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n","var baseIsFunction = require('../internal/baseIsFunction'),\n isNative = require('./isNative');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nvar isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 equivalents which return 'object' for typed array constructors.\n return objToString.call(value) == funcTag;\n};\n\nmodule.exports = isFunction;\n","var escapeRegExp = require(175),\n isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^/[object .+?Constructor/]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n escapeRegExp(objToString)\n .replace(/toString|(function).*?(?=///()| for .+?(?=///])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n if (value == null) {\n return false;\n }\n if (objToString.call(value) == funcTag) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isNative;\n","var isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(8.4);\n * // => true\n *\n * _.isNumber(NaN);\n * // => true\n *\n * _.isNumber('8.4');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return type == 'function' || (!!value && type == 'object');\n}\n\nmodule.exports = isObject;\n","var isNative = require(161),\n shimIsPlainObject = require(154);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nvar isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {\n if (!(value && objToString.call(value) == objectTag)) {\n return false;\n }\n var valueOf = value.valueOf,\n objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);\n\n return objProto\n ? (value == objProto || getPrototypeOf(value) == objProto)\n : shimIsPlainObject(value);\n};\n\nmodule.exports = isPlainObject;\n","var isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var isLength = require(149),\n isObjectLike = require(150);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n","var baseCopy = require(98),\n keysIn = require(170);\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignWith = require(95),\n baseAssign = require(96),\n createAssigner = require(132);\n\n/**\n * Assigns own enumerable properties of source object(s) to the destination\n * object. Subsequent sources overwrite property assignments of previous sources.\n * If `customizer` is provided it is invoked to produce the assigned values.\n * The `customizer` is bound to `thisArg` and invoked with five arguments:\n * (objectValue, sourceValue, key, object, source).\n *\n * **Note:** This method mutates `object` and is based on\n * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).\n *\n * @static\n * @memberOf _\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using a customizer callback\n * var defaults = _.partialRight(_.assign, function(value, other) {\n * return _.isUndefined(value) ? other : value;\n * });\n *\n * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\nvar assign = createAssigner(function(object, source, customizer) {\n return customizer\n ? assignWith(object, source, customizer)\n : baseAssign(object, source);\n});\n\nmodule.exports = assign;\n","var isArrayLike = require(145),\n isNative = require(161),\n isObject = require(163),\n shimKeys = require(155);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object != null && object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n","var isArguments = require(158),\n isArray = require(159),\n isIndex = require(146),\n isLength = require(149),\n isObject = require(163),\n support = require(176);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keysIn;\n","var baseMerge = require(119),\n createAssigner = require(132);\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it is invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n","var arrayMap = require(92),\n baseDifference = require(100),\n baseFlatten = require(106),\n bindCallback = require(128),\n keysIn = require(170),\n pickByArray = require(152),\n pickByCallback = require(153),\n restParam = require(86);\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to omit, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.omit(object, 'age');\n * // => { 'user': 'fred' }\n *\n * _.omit(object, _.isNumber);\n * // => { 'user': 'fred' }\n */\nvar omit = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n if (typeof props[0] != 'function') {\n var props = arrayMap(baseFlatten(props), String);\n return pickByArray(object, baseDifference(keysIn(object), props));\n }\n var predicate = bindCallback(props[0], props[1], 3);\n return pickByCallback(object, function(value, key, object) {\n return !predicate(value, key, object);\n });\n});\n\nmodule.exports = omit;\n","var baseFlatten = require(106),\n bindCallback = require(128),\n pickByArray = require(152),\n pickByCallback = require(153),\n restParam = require(86);\n\n/**\n * Creates an object composed of the picked `object` properties. Property\n * names may be specified as individual arguments or as arrays of property\n * names. If `predicate` is provided it is invoked for each property of `object`\n * picking the properties `predicate` returns truthy for. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to pick, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.pick(object, 'user');\n * // => { 'user': 'fred' }\n *\n * _.pick(object, _.isString);\n * // => { 'user': 'fred' }\n */\nvar pick = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n return typeof props[0] == 'function'\n ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n : pickByArray(object, baseFlatten(props));\n});\n\nmodule.exports = pick;\n","var baseValues = require(127),\n keys = require(169);\n\n/**\n * Creates an array of the own enumerable property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseToString = require(126);\n\n/**\n * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).\n * In addition to special characters the forward slash is escaped to allow for\n * easier `eval` use and `Function` compilation.\n */\nvar reRegExpChars = /[.*+?^${}()|[/]////]/g,\n reHasRegExpChars = RegExp(reRegExpChars.source);\n\n/**\n * Escapes the `RegExp` special characters \"/\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '/[lodash/]/(https:////lodash/.com///)'\n */\nfunction escapeRegExp(string) {\n string = baseToString(string);\n return (string && reHasRegExpChars.test(string))\n ? string.replace(reRegExpChars, '//$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to detect DOM support. */\nvar document = (document = global.window) && document.document;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\nvar support = {};\n\n(function(x) {\n var Ctor = function() { this.x = x; },\n args = arguments,\n object = { '0': x, 'length': x },\n props = [];\n\n Ctor.prototype = { 'valueOf': x, 'y': x };\n for (var key in new Ctor) { props.push(key); }\n\n /**\n * Detect if functions can be decompiled by `Function#toString`\n * (all but Firefox OS certified apps, older Opera mobile browsers, and\n * the PlayStation 3; forced `false` for Windows 8 apps).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcDecomp = //bthis/b/.test(function() { return this; });\n\n /**\n * Detect if `Function#name` is supported (all but IE).\n *\n * @memberOf _.support\n * @type boolean\n */\n support.funcNames = typeof Function.name == 'string';\n\n /**\n * Detect if the DOM is supported.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.dom = document.createDocumentFragment().nodeType === 11;\n } catch(e) {\n support.dom = false;\n }\n\n /**\n * Detect if `arguments` object indexes are non-enumerable.\n *\n * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object\n * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat\n * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`\n * checks for indexes that exceed the number of function parameters and\n * whose associated argument values are `0`.\n *\n * @memberOf _.support\n * @type boolean\n */\n try {\n support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);\n } catch(e) {\n support.nonEnumArgs = true;\n }\n}(1, 0));\n\nmodule.exports = support;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseProperty = require(121),\n basePropertyDeep = require(122),\n isKey = require(148);\n\n/**\n * Creates a function which returns the property value at `path` on a\n * given object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","module.exports = require(186);","module.exports = function(el) {\n\n var c;\n\n while (el.childNodes.length) {\n c = el.childNodes[0];\n el.removeChild(c);\n }\n\n return el;\n};","module.exports = require(189);","module.exports = require(193);","module.exports = require(192);","module.exports = function(el) {\n el.parentNode && el.parentNode.removeChild(el);\n};","/**\n * Module dependencies.\n */\n\nvar index = require(187);\n\n/**\n * Whitespace regexp.\n */\n\nvar re = //s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function(el){\n return new ClassList(el);\n};\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n if (!el || !el.nodeType) {\n throw new Error('A DOM element reference is required');\n }\n this.el = el;\n this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function(name){\n // classList\n if (this.list) {\n this.list.add(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (!~i) arr.push(name);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function(name){\n if ('[object RegExp]' == toString.call(name)) {\n return this.removeMatching(name);\n }\n\n // classList\n if (this.list) {\n this.list.remove(name);\n return this;\n }\n\n // fallback\n var arr = this.array();\n var i = index(arr, name);\n if (~i) arr.splice(i, 1);\n this.el.className = arr.join(' ');\n return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function(re){\n var arr = this.array();\n for (var i = 0; i < arr.length; i++) {\n if (re.test(arr[i])) {\n this.remove(arr[i]);\n }\n }\n return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function(name, force){\n // classList\n if (this.list) {\n if (\"undefined\" !== typeof force) {\n if (force !== this.list.toggle(name, force)) {\n this.list.toggle(name); // toggle again to correct\n }\n } else {\n this.list.toggle(name);\n }\n return this;\n }\n\n // fallback\n if (\"undefined\" !== typeof force) {\n if (!force) {\n this.remove(name);\n } else {\n this.add(name);\n }\n } else {\n if (this.has(name)) {\n this.remove(name);\n } else {\n this.add(name);\n }\n }\n\n return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function(){\n var className = this.el.getAttribute('class') || '';\n var str = className.replace(/^/s+|/s+$/g, '');\n var arr = str.split(re);\n if ('' === arr[0]) arr.shift();\n return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has =\nClassList.prototype.contains = function(name){\n return this.list\n ? this.list.contains(name)\n : !! ~index(this.array(), name);\n};\n","module.exports = function(arr, obj){\n if (arr.indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};","var matches = require(191)\n\nmodule.exports = function (element, selector, checkYoSelf, root) {\n element = checkYoSelf ? {parentNode: element} : element\n\n root = root || document\n\n // Make sure `element !== document` and `element != null`\n // otherwise we get an illegal invocation\n while ((element = element.parentNode) && element !== document) {\n if (matches(element, selector))\n return element\n // After `matches` on the edge case that\n // the selector matches the root\n // (when the root is not the document)\n if (element === root)\n return\n }\n}\n","/**\n * Module dependencies.\n */\n\nvar closest = require(188)\n , event = require(190);\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, selector, type, fn, capture){\n return event.bind(el, type, function(e){\n var target = e.target || e.srcElement;\n e.delegateTarget = closest(target, selector, true, el);\n if (e.delegateTarget) fn.call(el, e);\n }, capture);\n};\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n event.unbind(el, type, fn, capture);\n};\n","var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, type, fn, capture){\n el[bind](prefix + type, fn, capture || false);\n return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n el[unbind](prefix + type, fn, capture || false);\n return fn;\n};","/**\n * Module dependencies.\n */\n\nvar query = require(192);\n\n/**\n * Element prototype.\n */\n\nvar proto = Element.prototype;\n\n/**\n * Vendor function.\n */\n\nvar vendor = proto.matches\n || proto.webkitMatchesSelector\n || proto.mozMatchesSelector\n || proto.msMatchesSelector\n || proto.oMatchesSelector;\n\n/**\n * Expose `match()`.\n */\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n if (!el || el.nodeType !== 1) return false;\n if (vendor) return vendor.call(el, selector);\n var nodes = query.all(selector, el.parentNode);\n for (var i = 0; i < nodes.length; ++i) {\n if (nodes[i] == el) return true;\n }\n return false;\n}\n","function one(selector, el) {\n return el.querySelector(selector);\n}\n\nexports = module.exports = function(selector, el){\n el = el || document;\n return one(selector, el);\n};\n\nexports.all = function(selector, el){\n el = el || document;\n return el.querySelectorAll(selector);\n};\n\nexports.engine = function(obj){\n if (!obj.one) throw new Error('.one callback required');\n if (!obj.all) throw new Error('.all callback required');\n one = obj.one;\n exports.all = obj.all;\n return exports;\n};\n","\n/**\n * Expose `parse`.\n */\n\nmodule.exports = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar div = document.createElement('div');\n// Setup\ndiv.innerHTML = ' <link/><table></table><a href=\"/a\">a</a><input type=\"checkbox\"/>';\n// Make sure that link elements get serialized correctly by innerHTML\n// This requires a wrapper element in IE\nvar innerHTMLBug = !div.getElementsByTagName('link').length;\ndiv = undefined;\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n legend: [1, '<fieldset>', '</fieldset>'],\n tr: [2, '<table><tbody>', '</tbody></table>'],\n col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n // for script/link/style tags to work in IE6-8, you have to wrap\n // in a div with a non-whitespace character in front, ha!\n _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nmap.option =\nmap.optgroup = [1, '<select multiple=\"multiple\">', '</select>'];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '<table>', '</table>'];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">','</svg>'];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (<div> for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n if ('string' != typeof html) throw new TypeError('String expected');\n\n // default to the global `document` object\n if (!doc) doc = document;\n\n // tag name\n var m = /<([/w:]+)/.exec(html);\n if (!m) return doc.createTextNode(html);\n\n html = html.replace(/^/s+|/s+$/g, ''); // Remove leading/trailing whitespace\n\n var tag = m[1];\n\n // body support\n if (tag == 'body') {\n var el = doc.createElement('html');\n el.innerHTML = html;\n return el.removeChild(el.lastChild);\n }\n\n // wrap map\n var wrap = map[tag] || map._default;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var el = doc.createElement('div');\n el.innerHTML = prefix + html + suffix;\n while (depth--) el = el.lastChild;\n\n // one element\n if (el.firstChild == el.lastChild) {\n return el.removeChild(el.firstChild);\n }\n\n // several elements\n var fragment = doc.createDocumentFragment();\n while (el.firstChild) {\n fragment.appendChild(el.removeChild(el.firstChild));\n }\n\n return fragment;\n}\n","module.exports = require(196);\r\n\r\nmodule.exports.Collection = require(195);","'use strict';\r\n\r\n/**\r\n * An empty collection stub. Use {@link RefsCollection.extend} to extend a\r\n * collection with ref semantics.\r\n *\r\n * @classdesc A change and inverse-reference aware collection with set semantics.\r\n *\r\n * @class RefsCollection\r\n */\r\nfunction RefsCollection() { }\r\n\r\n/**\r\n * Extends a collection with {@link Refs} aware methods\r\n *\r\n * @memberof RefsCollection\r\n * @static\r\n *\r\n * @param {Array<Object>} collection\r\n * @param {Refs} refs instance\r\n * @param {Object} property represented by the collection\r\n * @param {Object} target object the collection is attached to\r\n *\r\n * @return {RefsCollection<Object>} the extended array\r\n */\r\nfunction extend(collection, refs, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n /**\r\n * Removes the given element from the array and returns it.\r\n *\r\n * @method RefsCollection#remove\r\n *\r\n * @param {Object} element the element to remove\r\n */\r\n collection.remove = function(element) {\r\n var idx = this.indexOf(element);\r\n if (idx !== -1) {\r\n this.splice(idx, 1);\r\n\r\n // unset inverse\r\n refs.unset(element, inverseProperty, target);\r\n }\r\n\r\n return element;\r\n };\r\n\r\n /**\r\n * Returns true if the collection contains the given element\r\n *\r\n * @method RefsCollection#contains\r\n *\r\n * @param {Object} element the element to check for\r\n */\r\n collection.contains = function(element) {\r\n return this.indexOf(element) !== -1;\r\n };\r\n\r\n /**\r\n * Adds an element to the array, unless it exists already (set semantics).\r\n *\r\n * @method RefsCollection#add\r\n *\r\n * @param {Object} element the element to add\r\n */\r\n collection.add = function(element) {\r\n\r\n if (!this.contains(element)) {\r\n this.push(element);\r\n\r\n // set inverse\r\n refs.set(element, inverseProperty, target);\r\n }\r\n };\r\n\r\n return collection;\r\n}\r\n\r\n\r\nmodule.exports.extend = extend;","'use strict';\r\n\r\nvar Collection = require(195);\r\n\r\nfunction hasOwnProperty(e, property) {\r\n return Object.prototype.hasOwnProperty.call(e, property.name || property);\r\n}\r\n\r\n\r\nfunction defineCollectionProperty(ref, property, target) {\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n value: Collection.extend(target[property.name] || [], ref, property, target)\r\n });\r\n}\r\n\r\n\r\nfunction defineProperty(ref, property, target) {\r\n\r\n var inverseProperty = property.inverse;\r\n\r\n var _value = target[property.name];\r\n\r\n Object.defineProperty(target, property.name, {\r\n enumerable: property.enumerable,\r\n\r\n get: function() {\r\n return _value;\r\n },\r\n\r\n set: function(value) {\r\n\r\n // return if we already performed all changes\r\n if (value === _value) {\r\n return;\r\n }\r\n\r\n var old = _value;\r\n\r\n // temporary set null\r\n _value = null;\r\n\r\n if (old) {\r\n ref.unset(old, inverseProperty, target);\r\n }\r\n\r\n // set new value\r\n _value = value;\r\n\r\n // set inverse value\r\n ref.set(_value, inverseProperty, target);\r\n }\r\n });\r\n\r\n}\r\n\r\n/**\r\n * Creates a new references object defining two inversly related\r\n * attribute descriptors a and b.\r\n *\r\n * <p>\r\n * When bound to an object using {@link Refs#bind} the references\r\n * get activated and ensure that add and remove operations are applied\r\n * reversely, too.\r\n * </p>\r\n *\r\n * <p>\r\n * For attributes represented as collections {@link Refs} provides the\r\n * {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\r\n * that must be used to properly hook into the inverse change mechanism.\r\n * </p>\r\n *\r\n * @class Refs\r\n *\r\n * @classdesc A bi-directional reference between two attributes.\r\n *\r\n * @param {Refs.AttributeDescriptor} a property descriptor\r\n * @param {Refs.AttributeDescriptor} b property descriptor\r\n *\r\n * @example\r\n *\r\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\r\n *\r\n * var car = { name: 'toyota' };\r\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\r\n *\r\n * refs.bind(car, 'wheels');\r\n *\r\n * car.wheels // []\r\n * car.wheels.add(wheels[0]);\r\n * car.wheels.add(wheels[1]);\r\n *\r\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\r\n *\r\n * wheels[0].car // { name: 'toyota' };\r\n * car.wheels.remove(wheels[0]);\r\n *\r\n * wheels[0].car // undefined\r\n */\r\nfunction Refs(a, b) {\r\n\r\n if (!(this instanceof Refs)) {\r\n return new Refs(a, b);\r\n }\r\n\r\n // link\r\n a.inverse = b;\r\n b.inverse = a;\r\n\r\n this.props = {};\r\n this.props[a.name] = a;\r\n this.props[b.name] = b;\r\n}\r\n\r\n/**\r\n * Binds one side of a bi-directional reference to a\r\n * target object.\r\n *\r\n * @memberOf Refs\r\n *\r\n * @param {Object} target\r\n * @param {String} property\r\n */\r\nRefs.prototype.bind = function(target, property) {\r\n if (typeof property === 'string') {\r\n if (!this.props[property]) {\r\n throw new Error('no property <' + property + '> in ref');\r\n }\r\n property = this.props[property];\r\n }\r\n\r\n if (property.collection) {\r\n defineCollectionProperty(this, property, target);\r\n } else {\r\n defineProperty(this, property, target);\r\n }\r\n};\r\n\r\nRefs.prototype.ensureBound = function(target, property) {\r\n if (!hasOwnProperty(target, property)) {\r\n this.bind(target, property);\r\n }\r\n};\r\n\r\nRefs.prototype.unset = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].remove(value);\r\n } else {\r\n target[property.name] = undefined;\r\n }\r\n }\r\n};\r\n\r\nRefs.prototype.set = function(target, property, value) {\r\n\r\n if (target) {\r\n this.ensureBound(target, property);\r\n\r\n if (property.collection) {\r\n target[property.name].add(value);\r\n } else {\r\n target[property.name] = value;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = Refs;\r\n\r\n\r\n/**\r\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\r\n *\r\n * @typedef {Object} Refs.AttributeDescriptor\r\n * @property {String} name\r\n * @property {boolean} [collection=false]\r\n * @property {boolean} [enumerable=false]\r\n */"]} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.min.js
new file mode 100644
index 0000000..339da63
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-viewer.min.js
@@ -0,0 +1,9 @@
+/*! bpmn-js - bpmn-viewer v0.10.3 | (c) 2014, 2015 camunda Services GmbH | bpmn.io/license */
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.BpmnJS=e()}}(function(){var e;return function t(e,n,r){function i(o,s){if(!n[o]){if(!e[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";function r(e,t){var n=e.get("eventBus");t.forEach(function(e){n.on(e.event,e.handler)})}function i(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/,n=t.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}function a(e){return e+(l(e)?"px":"")}function o(e){this.options=e=s({},g,e||{});var t=e.container;t.get&&(t=t.get(0)),u(t)&&(t=f(t));var n=this.container=p('<div class="bjs-container"></div>');t.appendChild(n),s(n.style,{width:a(e.width),height:a(e.height),position:e.position});var r="iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC",i='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100"><img src="data:image/png;base64,'+r+'"></a>';n.appendChild(p(i))}var s=e(168),c=e(172),u=e(165),l=e(162),p=e(183),f=e(184),h=e(185),d=e(35),m=e(14),y=e(8),g={width:"100%",height:"100%",position:"relative",container:"body"};o.prototype.importXML=function(e,t){var n=this;this.moddle=this.createModdle(),this.moddle.fromXML(e,"bpmn:Definitions",function(e,r,a){if(e)return e=i(e),t(e);var o=a.warnings;n.importDefinitions(r,function(e,n){return e?t(e):void t(null,o.concat(n||[]))})})},o.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this.definitions;return n?void this.moddle.toXML(n,e,t):t(new Error("no definitions loaded"))},o.prototype.createModdle=function(){return new m(this.options.moddleExtensions)},o.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),r=n.getDefaultLayer(),i=n._svg.select("defs"),a=r.innerSVG(),o=i&&i.outerSVG()||"",s=r.getBBox(),c='<?xml version="1.0" encoding="utf-8"?>\n<!-- created with bpmn-js / http://bpmn.io -->\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+o+a+"</svg>";t(null,c)},o.prototype.get=function(e){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.get(e)},o.prototype.invoke=function(e){if(!this.diagram)throw new Error("no diagram loaded");return this.diagram.invoke(e)},o.prototype.importDefinitions=function(e,t){try{this.diagram&&this.clear(),this.definitions=e;var n=this.diagram=this._createDiagram(this.options);this._init(n),y.importBpmnDiagram(n,e,t)}catch(r){t(r)}},o.prototype._init=function(e){r(e,this.__listeners||[])},o.prototype._createDiagram=function(e){var t=[].concat(e.modules||this.getModules(),e.additionalModules||[]);return t.unshift({bpmnjs:["value",this],moddle:["value",this.moddle]}),e=c(e,"additionalModules"),e=s(e,{canvas:{container:this.container},modules:t}),new d(e)},o.prototype.getModules=function(){return this._modules},o.prototype.clear=function(){var e=this.diagram;e&&e.destroy()},o.prototype.destroy=function(){this.clear(),h(this.container)},o.prototype.on=function(e,t){var n=this.diagram,r=this.__listeners=this.__listeners||[];r.push({event:e,handler:t}),n&&n.get("eventBus").on(e,t)},o.prototype._modules=[e(2),e(55),e(51)],t.exports=o},{14:14,162:162,165:165,168:168,172:172,183:183,184:184,185:185,2:2,35:35,51:51,55:55,8:8}],2:[function(e,t,n){t.exports={__depends__:[e(5),e(10)]}},{10:10,5:5}],3:[function(e,t,n){"use strict";function r(e,t,n){function r(e,t){X[e]=t}function i(e){return X[e]}function y(e){function t(e,t){var n=s({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=t.element.attr(n).marker(0,0,20,20,i.x,i.y).attr({markerWidth:20*a,markerHeight:20*a});return r(e,o)}t("sequenceflow-end",{element:e.path("M 1 5 L 11 10 L 1 15 Z"),ref:{x:11,y:10},scale:.5}),t("messageflow-start",{element:e.circle(6,6,3.5),attrs:{fill:"white",stroke:"black"},ref:{x:6,y:6}}),t("messageflow-end",{element:e.path("m 1 5 l 0 -3 l 7 3 l -7 3 z"),attrs:{fill:"white",stroke:"black",strokeLinecap:"butt"},ref:{x:8.5,y:5}}),t("data-association-end",{element:e.path("M 1 5 L 11 10 L 1 15"),attrs:{fill:"white",stroke:"black"},ref:{x:11,y:10},scale:.5}),t("conditional-flow-marker",{element:e.path("M 0 10 L 8 6 L 16 10 L 8 14 Z"),attrs:{fill:"white",stroke:"black"},ref:{x:-1,y:10},scale:.5}),t("conditional-default-flow-marker",{element:e.path("M 1 4 L 5 16"),attrs:{stroke:"black"},ref:{x:-5,y:10},scale:.5})}function g(e,n,r){return a(n)||(r=n,n=[]),t.style(n||[],s(r,e||{}))}function v(e,t,n,r,i){o(r)&&(i=r,r=0),r=r||0,i=g(i,{stroke:"black",strokeWidth:2,fill:"white"});var a=t/2,s=n/2;return e.circle(a,s,Math.round((t+n)/4-r)).attr(i)}function x(e,t,n,r,i,a){return o(i)&&(a=i,i=0),i=i||0,a=g(a,{stroke:"black",strokeWidth:2,fill:"white"}),e.rect(i,i,t-2*i,n-2*i,r).attr(a)}function b(e,t,n,r){var i=t/2,a=n/2,o=[i,0,t,a,i,n,0,a];return r=g(r,{stroke:"black",strokeWidth:2,fill:"white"}),e.polygon(o).attr(r)}function E(e,t,n){return n=g(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}),m(t,n).appendTo(e)}function w(e,t,n){return n=g(n,["no-fill"],{strokeWidth:2,stroke:"black"}),e.path(t).attr(n)}function A(e){return function(t,n){return Q[e](t,n)}}function S(e){return Q[e]}function _(e,t){var n=L(e),r=j(n);return F(n,"bpmn:MessageEventDefinition")?S("bpmn:MessageEventDefinition")(t,e,r):F(n,"bpmn:TimerEventDefinition")?S("bpmn:TimerEventDefinition")(t,e,r):F(n,"bpmn:ConditionalEventDefinition")?S("bpmn:ConditionalEventDefinition")(t,e):F(n,"bpmn:SignalEventDefinition")?S("bpmn:SignalEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")&&F(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?S("bpmn:MultipleEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")&&F(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?S("bpmn:ParallelMultipleEventDefinition")(t,e,r):F(n,"bpmn:EscalationEventDefinition")?S("bpmn:EscalationEventDefinition")(t,e,r):F(n,"bpmn:LinkEventDefinition")?S("bpmn:LinkEventDefinition")(t,e,r):F(n,"bpmn:ErrorEventDefinition")?S("bpmn:ErrorEventDefinition")(t,e,r):F(n,"bpmn:CancelEventDefinition")?S("bpmn:CancelEventDefinition")(t,e,r):F(n,"bpmn:CompensateEventDefinition")?S("bpmn:CompensateEventDefinition")(t,e,r):F(n,"bpmn:TerminateEventDefinition")?S("bpmn:TerminateEventDefinition")(t,e,r):null}function T(e,t,n){return K.createText(e,t||"",n).addClass("djs-label")}function C(e,t,n){var r=L(t);return T(e,r.name,{box:t,align:n,padding:5})}function R(e,t,n){var r=L(t);return r.name||(t.hidden=!0),T(e,r.name,{box:t,align:n,style:{fontSize:"11px"}})}function N(e,t,n){var r=T(e,t,{box:{height:30,width:n.height},align:"center-middle"}),i=-1*n.height;r.transform("rotate(270) translate("+i+",0)")}function M(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,r=1;r<t.length;r++)n+="L"+t[r].x+","+t[r].y+" ";return n}function D(e,t,n){var r,i=L(t),a=l(n,"SubProcessMarker");return r=a?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},c(n,function(n){S(n)(e,t,r)}),"bpmn:AdHocSubProcess"===i.$type&&S("AdhocMarker")(e,t,r),i.loopCharacteristics&&void 0===i.loopCharacteristics.isSequential?void S("LoopMarker")(e,t,r):(i.loopCharacteristics&&void 0!==i.loopCharacteristics.isSequential&&!i.loopCharacteristics.isSequential&&S("ParallelMarker")(e,t,r),i.loopCharacteristics&&i.loopCharacteristics.isSequential&&S("SequentialMarker")(e,t,r),void(i.isForCompensation&&S("CompensationMarker")(e,t,r)))}function k(e,t){var n=t.type,r=Q[n];return r?r(e,t):f.prototype.drawShape.apply(this,[e,t])}function P(e,t){var n=t.type,r=Q[n];return r?r(e,t):f.prototype.drawConnection.apply(this,[e,t])}function O(e,t){var r=(t.height-16)/t.height,i=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:r}});w(e,i,{strokeWidth:2})}function B(e,t){return e.isCollection||e.elementObjectRef&&e.elementObjectRef.isCollection}function I(e){return e.businessObject.di}function L(e){return e.businessObject}function F(e,t,n){function r(e,t){return u(t,function(t,n){return e[n]==t})}return p(e.eventDefinitions,function(i){return i.$type===t&&r(e,n)})}function j(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}function V(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function G(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return V(i)}function U(e){var t=q,n=e.x,r=e.y,i=e.width,a=e.height,o=[["M",n+t,r],["l",i-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-i,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-a],["a",t,t,0,0,1,t,-t],["z"]];return V(o)}function W(e){var t=e.width,n=e.height,r=e.x,i=e.y,a=t/2,o=n/2,s=[["M",r+a,i],["l",a,o],["l",-a,o],["l",-a,-o],["z"]];return V(s)}function z(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return V(a)}function $(e){var t=L(e);return t.$instanceOf("bpmn:Event")?G(e):t.$instanceOf("bpmn:Activity")?U(e):t.$instanceOf("bpmn:Gateway")?W(e):z(e)}f.call(this,t);var q=10,H=3,Y={fontFamily:"Arial, sans-serif",fontSize:"12px"},K=new h({style:Y,size:{width:100}}),X={},Q={"bpmn:Event":function(e,t,n){return v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={},r=L(t);r.isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=S("bpmn:Event")(e,t,n);return _(t,e),i},"bpmn:MessageEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),a=r?"black":"white",o=r?"white":"black",s=w(e,i,{strokeWidth:1,fill:a,stroke:o});return s},"bpmn:TimerEventDefinition":function(e,t){var r=v(e,t.width,t.height,.2*t.height,{strokeWidth:2}),i=n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}});w(e,i,{strokeWidth:2,strokeLinecap:"square"});for(var a=0;12>a;a++){var o=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2,c=t.height/2;w(e,o,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*a+","+c+","+s+")"})}return r},"bpmn:EscalationEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.555}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:ConditionalEventDefinition":function(e,t){var r=n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}});return w(e,r,{strokeWidth:1})},"bpmn:LinkEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:ErrorEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:CancelEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a}).transform("rotate(45)")},"bpmn:CompensateEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.201,my:.472}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:SignalEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:MultipleEventDefinition":function(e,t,r){var i=n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),a=r?"black":"none";return w(e,i,{strokeWidth:1,fill:a})},"bpmn:ParallelMultipleEventDefinition":function(e,t){var r=n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}});return w(e,r,{strokeWidth:1})},"bpmn:EndEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:4});return _(t,e,!0),n},"bpmn:TerminateEventDefinition":function(e,t){var n=v(e,t.width,t.height,8,{strokeWidth:4,fill:"black"});return n},"bpmn:IntermediateEvent":function(e,t){var n=S("bpmn:Event")(e,t,{strokeWidth:1});return v(e,t.width,t.height,H,{strokeWidth:1,fill:"none"}),_(t,e),n},"bpmn:IntermediateCatchEvent":A("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":A("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return x(e,t.width,t.height,q,n)},"bpmn:Task":function(e,t,n){var r=S("bpmn:Activity")(e,t,n);return C(e,t,"center-middle"),D(e,t),r},"bpmn:ServiceTask":function(e,t){var r=S("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});w(e,i,{strokeWidth:1,fill:"none"});var a=n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}});w(e,a,{strokeWidth:0,stroke:"none",fill:"white"});var o=n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return w(e,o,{strokeWidth:1,fill:"white"}),r},"bpmn:UserTask":function(e,t){var r=S("bpmn:Task")(e,t),i=15,a=12,o=n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:i,y:a}});w(e,o,{strokeWidth:.5,fill:"none"});var s=n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:i,y:a}});w(e,s,{strokeWidth:.5,fill:"none"});var c=n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:i,y:a}});return w(e,c,{strokeWidth:.5,fill:"black"}),r},"bpmn:ManualTask":function(e,t){var r=S("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return w(e,i,{strokeWidth:.25,fill:"white",stroke:"black"}),r},"bpmn:SendTask":function(e,t){var r=S("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return w(e,i,{strokeWidth:1,fill:"black",stroke:"white"}),r},"bpmn:ReceiveTask":function(e,t){var r,i=L(t),a=S("bpmn:Task")(e,t);return i.instantiate?(v(e,28,28,4.4,{strokeWidth:1}),r=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(e,r,{strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t){var r=S("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return w(e,i,{strokeWidth:1}),r},"bpmn:BusinessRuleTask":function(e,t){var r=S("bpmn:Task")(e,t),i=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),a=w(e,i);a.attr({strokeWidth:1,fill:"AAA"});var o=n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),s=w(e,o);return s.attr({strokeWidth:1}),r},"bpmn:SubProcess":function(e,t,n){var r=S("bpmn:Activity")(e,t,n),i=L(t),a=d.isExpanded(i),o=!!i.triggeredByEvent;return o&&r.attr({strokeDasharray:"1,2"}),C(e,t,a?"center-top":"center-middle"),a?D(e,t):D(e,t,["SubProcessMarker"]),r},"bpmn:AdHocSubProcess":function(e,t){return S("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,n){var r=S("bpmn:SubProcess")(e,n),i=t.style(["no-fill","no-events"]);return x(e,n.width,n.height,q-2,H,i),r},"bpmn:CallActivity":function(e,t){return S("bpmn:Task")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n=S("bpmn:Lane")(e,t,{fill:"White"}),r=d.isExpanded(t);if(r){E(e,[{x:30,y:0},{x:30,y:t.height}]);var i=L(t).name;N(e,i,t)}else{var a=L(t).name;T(e,a,{box:t,align:"center-middle"})}var o=!!L(t).participantMultiplicity;return o&&S("ParticipantMultiplicityMarker")(e,t),n},"bpmn:Lane":function(e,t,n){var r=x(e,t.width,t.height,0,n||{fill:"none"}),i=L(t);if("bpmn:Lane"===i.$type){var a=i.name;N(e,a,t)}return r},"bpmn:InclusiveGateway":function(e,t){var n=b(e,t.width,t.height);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:"none"}),n},"bpmn:ExclusiveGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return I(t).isMarkerVisible&&w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:ComplexGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}});return w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:ParallelGateway":function(e,t){var r=b(e,t.width,t.height),i=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}});return w(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:EventBasedGateway":function(e,t){function r(){var r=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});w(e,r,{strokeWidth:2,fill:"none"})}var i=L(t),a=b(e,t.width,t.height);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none"});var o=i.eventGatewayType,s=!!i.instantiate;if("Parallel"===o){var c=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),u=w(e,c);u.attr({strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!s){var l=v(e,t.width,t.height,.26*t.height);l.attr({strokeWidth:1,fill:"none"})}r()}return a},"bpmn:Gateway":function(e,t){return b(e,t.width,t.height)},"bpmn:SequenceFlow":function(e,t){var n=M(t),r=w(e,n,{strokeLinejoin:"round",markerEnd:i("sequenceflow-end")}),a=L(t),o=t.source.businessObject;return a.conditionExpression&&o.$instanceOf("bpmn:Task")&&r.attr({markerStart:i("conditional-flow-marker")}),o["default"]&&o.$instanceOf("bpmn:Gateway")&&o["default"]===a&&r.attr({markerStart:i("conditional-default-flow-marker")}),r},"bpmn:Association":function(e,t,n){return n=s({strokeDasharray:"1,6",strokeLinecap:"round",strokeLinejoin:"round"},n||{}),E(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){return S("bpmn:Association")(e,t,{markerEnd:i("data-association-end")})},"bpmn:DataOutputAssociation":function(e,t){return S("bpmn:Association")(e,t,{markerEnd:i("data-association-end")})},"bpmn:MessageFlow":function(e,t){var r=L(t),a=I(t),o=M(t),s=w(e,o,{markerEnd:i("messageflow-end"),markerStart:i("messageflow-start"),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px"});if(r.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),u=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),l={strokeWidth:1};"initiating"===a.messageVisibleKind?(l.fill="white",l.stroke="black"):(l.fill="#888",l.stroke="white"),w(e,u,l)}return s},"bpmn:DataObject":function(e,t){var r=n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),i=w(e,r,{fill:"white"}),a=L(t);return B(a)&&O(e,t),i},"bpmn:DataObjectReference":A("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var r=n.getRawPath("DATA_ARROW"),i=S("bpmn:DataObject")(e,t);return w(e,r,{strokeWidth:1}),i},"bpmn:DataOutput":function(e,t){var r=n.getRawPath("DATA_ARROW"),i=S("bpmn:DataObject")(e,t);return w(e,r,{strokeWidth:1,fill:"black"}),i},"bpmn:DataStoreReference":function(e,t){var r=n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),i=w(e,r,{strokeWidth:2,fill:"white"});return i},"bpmn:BoundaryEvent":function(e,t){var n=L(t),r=n.cancelActivity,i={strokeLinecap:"round",strokeWidth:1};r||(i.strokeDasharray="6");var a=S("bpmn:Event")(e,t,i);return v(e,t.width,t.height,H,i),_(t,e),a},"bpmn:Group":function(e,t){return x(e,t.width,t.height,q,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return R(e,t,"")},"bpmn:TextAnnotation":function(e,t){var r={fill:"none",stroke:"none"},i=x(e,t.width,t.height,0,0,r),a=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}});w(e,a);var o=L(t).text||"";return T(e,o,{box:t,align:"left-middle",padding:5}),i},ParticipantMultiplicityMarker:function(e,t){var r=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}});w(e,r)},SubProcessMarker:function(e,t){var r=x(e,14,14,0,{strokeWidth:1});r.transform("translate("+(t.width/2-7.5)+","+(t.height-20)+")");var i=n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}});w(e,i)},ParallelMarker:function(e,t,r){var i=n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.parallel)/t.width,my:(t.height-20)/t.height}});w(e,i)},SequentialMarker:function(e,t,r){var i=n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.seq)/t.width,my:(t.height-19)/t.height}});w(e,i)},CompensationMarker:function(e,t,r){var i=n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.compensation)/t.width,my:(t.height-13)/t.height}});w(e,i,{strokeWidth:1})},LoopMarker:function(e,t,r){var i=n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.loop)/t.width,my:(t.height-7)/t.height}});w(e,i,{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,r){var i=n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+r.adhoc)/t.width,my:(t.height-15)/t.height}});w(e,i,{strokeWidth:1,fill:"black"})}};e.on("canvas.init",function(e){y(e.svg)}),this.drawShape=k,this.drawConnection=P,this.getShapePath=$}var i=e(72),a=e(159),o=e(163),s=e(168),c=e(77),u=e(74),l=e(79),p=e(82),f=e(43),h=e(64),d=e(11),m=f.createLine;i(r,f),r.$inject=["eventBus","styles","pathMap"],t.exports=r},{11:11,159:159,163:163,168:168,43:43,64:64,72:72,74:74,77:77,79:79,82:82}],4:[function(e,t,n){"use strict";function r(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"m {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} {e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z",height:36,width:36,heightElements:[2.382,4.764,4.926,6.589333,7.146,13.178667,19.768],widthElements:[2.463,2.808,4.926,5.616,7.389,8.424]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z",height:36,width:36,heightElements:[5,10],widthElements:[10]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"
+},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,r,a=this.pathMap[e];t.abspos?(n=t.abspos.x,r=t.abspos.y):(n=t.containerWidth*t.position.mx,r=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/a.height*t.yScaleFactor,c=t.containerWidth/a.width*t.xScaleFactor,u=0;u<a.heightElements.length;u++)o["y"+u]=a.heightElements[u]*s;for(var l=0;l<a.widthElements.length;l++)o["x"+l]=a.widthElements[l]*c}var p=i.format(a.d,{mx:n,my:r,e:o});return p}}var i=e(67);t.exports=r},{67:67}],5:[function(e,t,n){t.exports={renderer:["type",e(3)],pathMap:["type",e(4)]}},{3:3,4:4}],6:[function(e,t,n){"use strict";function r(e,t){return o({id:e.id,type:e.$type,businessObject:e},t)}function i(e){return s(e,function(e){return{x:e.x,y:e.y}})}function a(e,t,n,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r}var o=e(168),s=e(80),c=e(12),u=c.hasExternalLabel,l=c.getExternalLabelBounds,p=e(11).isExpanded,f=e(9).elementToString;a.$inject=["eventBus","canvas","elementFactory","elementRegistry"],t.exports=a,a.prototype.add=function(e,t){var n,a=e.di;if(a.$instanceOf("bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(r(e)),this._canvas.setRootElement(n);else if(a.$instanceOf("bpmndi:BPMNShape")){var o=!p(e),s=t&&(t.hidden||t.collapsed),c=e.di.bounds;n=this._elementFactory.createShape(r(e,{collapsed:o,hidden:s,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height)})),this._canvas.addShape(n,t)}else{if(!a.$instanceOf("bpmndi:BPMNEdge"))throw new Error("unknown di "+f(a)+" for element "+f(e));var l=this._getSource(e),h=this._getTarget(e);n=this._elementFactory.createConnection(r(e,{source:l,target:h,waypoints:i(e.di.waypoint)})),this._canvas.addConnection(n,t)}return u(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},a.prototype.addLabel=function(e,t){var n=l(e,t),i=this._elementFactory.createLabel(r(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)}));return this._canvas.addShape(i,t.parent)},a.prototype._getEnd=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===i&&(r=r&&r[0]),("source"===t&&"bpmn:DataOutputAssociation"===i||"target"===t&&"bpmn:DataInputAssociation"===i)&&(r=e.$parent),n=r&&this._getElement(r))return n;throw r?new Error("element "+f(r)+" referenced by "+f(e)+"#"+t+"Ref not yet drawn"):new Error(f(e)+"#"+t+"Ref not specified")},a.prototype._getSource=function(e){return this._getEnd(e,"source")},a.prototype._getTarget=function(e){return this._getEnd(e,"target")},a.prototype._getElement=function(e){return this._elementRegistry.get(e.id)}},{11:11,12:12,168:168,80:80,9:9}],7:[function(e,t,n){"use strict";function r(e,t){return e.$instanceOf(t)}function i(e){return s(e.rootElements,function(e){return r(e,"bpmn:Process")||r(e,"bpmn:Collaboration")})}function a(e){function t(e,t){return function(n){e(n,t)}}function n(t,n){var r=t.gfx;if(r)throw new Error("already rendered "+l(t));return e.element(t,n)}function a(t,n){return e.root(t,n)}function s(e,t){try{return e.di&&n(e,t)}catch(r){u(r.message,{element:e,error:r}),console.error("failed to import "+l(e)),console.error(r)}}function u(t,n){e.error(t,n)}function f(e){var t=e.bpmnElement;t?t.di?u("multiple DI elements defined for "+l(t),{element:t}):(p.bind(t,"di"),t.di=e):u("no bpmnElement referenced in "+l(e),{element:e})}function h(e){d(e.plane)}function d(e){f(e),c(e.planeElement,m)}function m(e){f(e)}function y(e,t){var n=e.diagrams;if(t&&-1===n.indexOf(t))throw new Error("diagram not part of bpmn:Definitions");if(!t&&n&&n.length&&(t=n[0]),t){h(t);var o=t.plane;if(!o)throw new Error("no plane for "+l(t));var s=o.bpmnElement;if(!s){if(s=i(e),!s)return u("no process or collaboration present to display");u("correcting missing bpmnElement on "+l(o)+" to "+l(s)),o.bpmnElement=s,f(o)}var c=a(s,o);if(r(s,"bpmn:Process"))v(s,c);else{if(!r(s,"bpmn:Collaboration"))throw new Error("unsupported bpmnElement for "+l(o)+" : "+l(s));V(s,c),x(e.rootElements,c)}g(U)}}function g(e){c(e,function(e){e()})}function v(e,t){I(e,t),C(e.ioSpecification,t),T(e.artifacts,t),G.push(e)}function x(e){var n=o(e,function(e){return r(e,"bpmn:Process")&&e.laneSets&&-1===G.indexOf(e)});n.forEach(t(v))}function b(e,t){s(e,t)}function E(e,n){c(e,t(b,n))}function w(e,t){s(e,t)}function A(e,t){s(e,t)}function S(e,t){s(e,t)}function _(e,t){s(e,t)}function T(e,t){c(e,function(e){r(e,"bpmn:Association")?U.push(function(){_(e,t)}):_(e,t)})}function C(e,n){e&&(c(e.dataInputs,t(A,n)),c(e.dataOutputs,t(S,n)))}function R(e,t){I(e,t),T(e.artifacts,t)}function N(e,t){var n=s(e,t);r(e,"bpmn:SubProcess")&&R(e,n||t)}function M(e,t){s(e,t)}function D(e,t){s(e,t)}function k(e,t){s(e,t)}function P(e,t){var n=s(e,t);if(e.childLaneSet)O(e.childLaneSet,n||t);else{var r=o(e.flowNodeRef,function(e){return"bpmn:BoundaryEvent"!==e.$type});F(r,n||t)}}function O(e,n){c(e.lanes,t(P,n))}function B(e,n){c(e,t(O,n))}function I(e,t){e.laneSets?(B(e.laneSets,t),L(e.flowElements)):F(e.flowElements,t)}function L(e,t){c(e,function(e){r(e,"bpmn:SequenceFlow")?U.push(function(){M(e,t)}):r(e,"bpmn:BoundaryEvent")?U.unshift(function(){k(e,t)}):r(e,"bpmn:DataObject")||(r(e,"bpmn:DataStoreReference")?D(e,t):r(e,"bpmn:DataObjectReference")&&D(e,t))})}function F(e,n){c(e,function(e){r(e,"bpmn:SequenceFlow")?U.push(function(){M(e,n)}):r(e,"bpmn:BoundaryEvent")?U.unshift(function(){k(e,n)}):r(e,"bpmn:FlowNode")?(N(e,n),r(e,"bpmn:Activity")&&(C(e.ioSpecification,n),U.push(function(){c(e.dataInputAssociations,t(w,n)),c(e.dataOutputAssociations,t(w,n))}))):r(e,"bpmn:DataObject")||(r(e,"bpmn:DataStoreReference")?D(e,n):r(e,"bpmn:DataObjectReference")?D(e,n):u("unrecognized flowElement "+l(e)+" in context "+(n?l(n.businessObject):null),{element:e,context:n}))})}function j(e,t){var n=s(e,t),r=e.processRef;r&&v(r,n||t)}function V(e){c(e.participants,t(j)),T(e.artifacts),U.push(function(){E(e.messageFlows)})}var G=[],U=[];return{handleDefinitions:y}}var o=e(75),s=e(76),c=e(77),u=e(194),l=e(9).elementToString,p=new u({name:"bpmnElement",enumerable:!0},{name:"di"});t.exports=a},{194:194,75:75,76:76,77:77,9:9}],8:[function(e,t,n){"use strict";function r(e,t,n){function r(e){var t={root:function(e){return o.add(e)},element:function(e,t){return o.add(e,t)},error:function(e,t){c.push({message:e,context:t})}},n=new i(t);n.handleDefinitions(e)}var a,o=e.get("bpmnImporter"),s=e.get("eventBus"),c=[];s.fire("import.start");try{r(t)}catch(u){a=u}s.fire(a?"import.error":"import.success",{error:a,warnings:c}),n(a,c)}var i=e(7);t.exports.importBpmnDiagram=r},{7:7}],9:[function(e,t,n){"use strict";t.exports.elementToString=function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},{}],10:[function(e,t,n){t.exports={bpmnImporter:["type",e(6)]}},{6:6}],11:[function(e,t,n){"use strict";var r=e(13).is,i=e(13).getBusinessObject;t.exports.isExpanded=function(e){return r(e,"bpmn:CallActivity")?!1:r(e,"bpmn:SubProcess")?i(e).di.isExpanded:r(e,"bpmn:Participant")?!!i(e).processRef:!0}},{13:13}],12:[function(e,t,n){"use strict";var r=e(168),i=t.exports.DEFAULT_LABEL_SIZE={width:90,height:20};t.exports.hasExternalLabel=function(e){return e.$instanceOf("bpmn:Event")||e.$instanceOf("bpmn:Gateway")||e.$instanceOf("bpmn:DataStoreReference")||e.$instanceOf("bpmn:DataObjectReference")||e.$instanceOf("bpmn:SequenceFlow")||e.$instanceOf("bpmn:MessageFlow")};var a=t.exports.getWaypointsMid=function(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}},o=t.exports.getExternalLabelMid=function(e){return e.waypoints?a(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+i.height/2}};t.exports.getExternalLabelBounds=function(e,t){var n,a,s,c=e.di,u=c.label;return u&&u.bounds?(s=u.bounds,a={width:Math.max(i.width,s.width),height:s.height},n={x:s.x+s.width/2,y:s.y+s.height/2}):(n=o(t),a=i),r({x:n.x-a.width/2,y:n.y-a.height/2},a)}},{168:168}],13:[function(e,t,n){"use strict";function r(e,t){var n=i(e);return n&&n.$instanceOf(t)}function i(e){return e&&e.businessObject||e}t.exports.is=r,t.exports.getBusinessObject=i},{}],14:[function(e,t,n){t.exports=e(16)},{16:16}],15:[function(e,t,n){"use strict";function r(e,t){s.call(this,e,t)}var i=e(165),a=e(160),o=e(168),s=e(22),c=e(18),u=e(19);r.prototype=Object.create(s.prototype),t.exports=r,r.prototype.fromXML=function(e,t,n,r){i(t)||(r=n,n=t,t="bpmn:Definitions"),a(n)&&(r=n,n={});var s=new c(o({model:this,lax:!0},n)),u=s.handler(t);s.fromXML(e,u,r)},r.prototype.toXML=function(e,t,n){a(t)&&(n=t,t={});var r=new u(t);try{var i=r.toXML(e);n(null,i)}catch(o){n(o)}}},{160:160,165:165,168:168,18:18,19:19,22:22}],16:[function(e,t,n){"use strict";var r=e(168),i=e(15),a={bpmn:e(31),bpmndi:e(32),dc:e(33),di:e(34)};t.exports=function(e,t){return new i(r({},a,e),t)}},{15:15,168:168,31:31,32:32,33:33,34:34}],17:[function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){return e.charAt(0).toLowerCase()+e.slice(1)}function a(e){return e.xml&&"lowerCase"===e.xml.tagAlias}t.exports.aliasToName=function(e,t){return a(t)?r(e):e},t.exports.nameToAlias=function(e,t){return a(t)?i(e):e},t.exports.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"},t.exports.XSI_TYPE="xsi:type"},{}],18:[function(e,t,n){"use strict";function r(e){var t=e.attributes;return y(t,function(e,t,n){var r,i;return t.local?(i=S(t.name,t.prefix),r=i.name):r=t.prefix,e[r]=t.value,e},{})}function i(e,t,n){var r,i=S(t.value),a=e.ns[i.prefix||""],o=i.localName,s=a&&n.getPackage(a);s&&(r=s.xml&&s.xml.typePrefix,r&&0===o.indexOf(r)&&(o=o.slice(r.length)),t.value=s.prefix+":"+o)}function a(e,t,n){var r,o;if(r=e.uri||n){var s=t.getPackage(r);o=s?s.prefix:e.prefix,e.prefix=o,e.uri=r}g(e.attributes,function(n){n.uri===M&&"type"===n.local&&i(e,n,t),a(n,t,null)})}function o(e){x(this,e);var t=this.elementsById={},n=this.references=[],r=this.warnings=[];this.addReference=function(e){n.push(e)},this.addElement=function(e,n){if(!e||!n)throw new Error("[xml-reader] id or ctx must not be null");t[e]=n},this.addWarning=function(e){r.push(e)}}function s(){}function c(){}function u(){}function l(e,t){this.property=e,this.context=t}function p(e,t){this.element=t,this.propertyDesc=e}function f(){}function h(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function d(e,t,n){this.model=e,this.context=n}function m(e){e instanceof A&&(e={model:e}),x(this,{lax:!1},e)}var y=e(81),g=e(77),v=e(76),x=e(168),b=e(85),E=e(21),w=e(20).parser,A=e(22),S=e(27).parseName,_=e(30),T=_.coerceType,C=_.isSimple,R=e(17),N=R.XSI_TYPE,M=R.DEFAULT_NS_MAP.xsi,D=R.aliasToName;s.prototype.handleEnd=function(){},s.prototype.handleText=function(){},s.prototype.handleNode=function(){},c.prototype=new s,c.prototype.handleNode=function(){return this},u.prototype=new s,u.prototype.handleText=function(e){this.body=(this.body||"")+e},l.prototype=new u,l.prototype.handleNode=function(e){if(this.element)throw new Error("expected no sub nodes");return this.element=this.createReference(e),this},l.prototype.handleEnd=function(){this.element.id=this.body},l.prototype.createReference=function(){return{property:this.property.ns.name,id:""}},p.prototype=new u,p.prototype.handleEnd=function(){var e=this.body,t=this.element,n=this.propertyDesc;e=T(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},f.prototype=Object.create(u.prototype),f.prototype.handleNode=function(e){var t,n=this,r=this.element;return r?n=this.handleChild(e):(r=this.element=this.createElement(e),t=r.id,t&&this.context.addElement(t,r)),n},h.prototype=new f,h.prototype.addReference=function(e){this.context.addReference(e)},h.prototype.handleEnd=function(){var e=this.body,t=this.element,n=t.$descriptor,r=n.bodyProperty;r&&void 0!==e&&(e=T(r.type,e),t.set(r.name,e))},h.prototype.createElement=function(e){var t=r(e),n=this.type,i=n.$descriptor,a=this.context,o=new n({});return g(t,function(e,t){var n=i.propertiesByName[t];n&&n.isReference?a.addReference({element:o,property:n.ns.name,id:e}):(n&&(e=T(n.type,e)),o.set(t,e))}),o},h.prototype.getPropertyForNode=function(e){var t,n,r,i=S(e.local,e.prefix),a=this.type,o=this.model,s=a.$descriptor,c=i.name,u=s.propertiesByName[c];if(u)return u.serialize===N&&(r=e.attributes[N])?(t=r.value,n=o.getType(t),x({},u,{effectiveType:n.$descriptor.name})):u;var l=o.getPackage(i.prefix);if(l){if(t=i.prefix+":"+D(i.localName,s.$pkg),n=o.getType(t),u=v(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return x({},u,{effectiveType:n.$descriptor.name})}else if(u=v(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw new Error("unrecognized element <"+i.name+">")},h.prototype.toString=function(){return"ElementDescriptor["+this.type.$descriptor.name+"]"},h.prototype.valueHandler=function(e,t){return new p(e,t)},h.prototype.referenceHandler=function(e){return new l(e,this.context)},h.prototype.handler=function(e){return"Element"===e?new d(this.model,e,this.context):new h(this.model,e,this.context)},h.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,C(n))return this.valueHandler(t,r);i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e);var a=i.element;return void 0!==a&&(t.isMany?r.get(t.name).push(a):r.set(t.name,a),t.isReference?(x(a,{element:r}),this.context.addReference(a)):a.$parent=r),i},d.prototype=Object.create(f.prototype),d.prototype.createElement=function(e){var t=e.name,n=e.prefix,r=e.ns[n],i=e.attributes;return this.model.createAny(t,r,i)},d.prototype.handleChild=function(e){var t,n=new d(this.model,"Element",this.context).handleNode(e),r=this.element,i=n.element;return void 0!==i&&(t=r.$children=r.$children||[],t.push(i),i.$parent=r),n},d.prototype.handleText=function(e){this.body=this.body||""+e},d.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},m.prototype.fromXML=function(e,t,n){function r(){var e,t,n=f.elementsById,r=f.references;for(e=0;t=r[e];e++){var i=t.element,a=n[t.id],o=i.$descriptor.propertiesByName[t.property];if(a||f.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),o.isMany){var s=i.get(o.name),c=s.indexOf(t);a?s[c]=a:s.splice(c,1)}else i.set(o.name,a)}}function i(e){d.pop().handleEnd()}function s(e){var t=d.peek();a(e,l);try{d.push(t.handleNode(e))}catch(n){var r=this.line,i=this.column,o="unparsable content <"+e.name+"> detected\n line: "+r+"\n column: "+i+"\n nested error: "+n.message;if(!p)throw console.error("could not parse document"),console.error(n),new Error(o);f.addWarning({message:o,error:n}),console.warn("could not parse node"),console.warn(n),d.push(new c)}}function u(e){d.peek().handleText(e)}var l=this.model,p=this.lax,f=new o({parseRoot:t}),h=new w(!0,{xmlns:!0,trim:!0}),d=new E;t.context=f,d.push(t),h.onopentag=s,h.oncdata=h.ontext=u,h.onclosetag=i,h.onend=r,b(function(){var r;try{h.write(e).close()}catch(i){r=i}n(r,r?void 0:t.element,f)})},m.prototype.handler=function(e){return new h(this.model,e)},t.exports=m,t.exports.ElementHandler=h},{168:168,17:17,20:20,21:21,22:22,27:27,30:30,76:76,77:77,81:81,85:85}],19:[function(e,t,n){"use strict";function r(e){return b(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function i(e,t){return t.isGeneric?t.name:w({localName:T(t.ns.localName,t.$pkg)},e)}function a(e,t){return w({localName:t.ns.localName},e)}function o(e){var t=e.$descriptor;return E(t.properties,function(t){var n=t.name;if(!e.hasOwnProperty(n))return!1;var r=e[n];return r===t["default"]?!1:t.isMany?r.length:!0})}function s(e){return e=b(e)?e:""+e,e.replace(R,function(e){return"&#"+D[e]+";"})}function c(e){return E(e,function(e){return e.isAttr})}function u(e){return E(e,function(e){return!e.isAttr})}function l(e,t){this.ns=t}function p(){}function f(e){this.ns=e}function h(e,t){this.body=[],this.attrs=[],this.parent=e,this.ns=t}function d(e,t){h.call(this,e,t)}function m(){this.value="",this.write=function(e){this.value+=e}}function y(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function g(e){function t(t,n){var r=n||new m,i=new y(r,e.format);return e.preamble&&i.append(C),(new h).build(t).serializeTo(i),n?void 0:r.value}return e=w({format:!1,preamble:!0},e||{}),{toXML:t}}var v=e(80),x=e(77),b=e(165),E=e(75),w=e(168),A=e(30),S=e(27).parseName,_=e(17),T=_.nameToAlias,C='<?xml version="1.0" encoding="UTF-8"?>\n',R=/(<|>|'|"|&|\n\r|\n)/g,N=_.DEFAULT_NS_MAP,M=_.XSI_TYPE,D={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};l.prototype.build=function(e){return this.element=e,this},l.prototype.serializeTo=function(e){e.appendIndent().append("<"+r(this.ns)+">"+this.element.id+"</"+r(this.ns)+">").appendNewLine()},p.prototype.serializeValue=p.prototype.serializeTo=function(e){var t=this.escape;t&&e.append("<![CDATA["),e.append(this.value),t&&e.append("]]>")},p.prototype.build=function(e,t){return this.value=t,"String"===e.type&&R.test(t)&&(this.escape=!0),this},f.prototype=new p,f.prototype.serializeTo=function(e){e.appendIndent().append("<"+r(this.ns)+">"),this.serializeValue(e),e.append("</"+r(this.ns)+">").appendNewLine()},h.prototype.build=function(e){this.element=e;var t=this.parseNsAttributes(e);if(this.ns||(this.ns=this.nsTagName(e.$descriptor)),e.$descriptor.isGeneric)this.parseGeneric(e);else{var n=o(e);this.parseAttributes(c(n)),this.parseContainments(u(n)),this.parseGenericAttributes(e,t)}return this},h.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return i(t,e)},h.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return a(t,e)},h.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},h.prototype.nsAttributeName=function(e){var t;b(e)?t=S(e):e.ns&&(t=e.ns);var n=this.logNamespaceUsed(t);return this.isLocalNs(n)?{localName:t.localName}:w({localName:t.localName},n)},h.prototype.parseGeneric=function(e){var t=this,n=this.body,r=this.attrs;x(e,function(e,i){"$body"===i?n.push((new p).build({type:"String"},e)):"$children"===i?x(e,function(e){n.push(new h(t).build(e))}):0!==i.indexOf("$")&&r.push({name:i,value:s(e)})})},h.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return x(n,function(e,n){var i=S(n);"xmlns"===i.prefix?t.logNamespace({prefix:i.localName,uri:e}):i.prefix||"xmlns"!==i.localName?r.push({name:n,value:e}):t.logNamespace({uri:e})}),r},h.prototype.parseGenericAttributes=function(e,t){var n=this;x(t,function(t){if(t.name!==M)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(r){console.warn("[writer] missing namespace information for ",t.name,"=",t.value,"on",e,r)}})},h.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;x(e,function(e){var i=r.get(e.name),a=e.isReference,o=e.isMany,s=t.nsPropertyTagName(e);if(o||(i=[i]),e.isBody)n.push((new p).build(e,i[0]));else if(A.isSimple(e.type))x(i,function(t){n.push(new f(s).build(e,t))});else if(a)x(i,function(e){n.push(new l(t,s).build(e))});else{var c=e.serialize===M;x(i,function(e){var r;r=c?new d(t,s):new h(t),n.push(r.build(e))})}})},h.prototype.getNamespaces=function(){return this.parent?this.namespaces=this.parent.getNamespaces():this.namespaces||(this.namespaces={prefixMap:{},uriMap:{},used:{}}),this.namespaces},h.prototype.logNamespace=function(e){var t=this.getNamespaces(),n=t.uriMap[e.uri];return n||(t.uriMap[e.uri]=e),t.prefixMap[e.prefix]=e.uri,e},h.prototype.logNamespaceUsed=function(e){var t=this.element,n=t.$model,r=this.getNamespaces(),i=e.prefix,a=e.uri||N[i]||r.prefixMap[i]||(n?(n.getPackage(i)||{}).uri:null);if(!a)throw new Error("no namespace uri given for prefix <"+e.prefix+">");return e=r.uriMap[a],e||(e=this.logNamespace({prefix:i,uri:a})),r.used[e.uri]||(r.used[e.uri]=e),e},h.prototype.parseAttributes=function(e){var t=this,n=this.element;x(e,function(e){t.logNamespaceUsed(e.ns);var r=n.get(e.name);e.isReference&&(r=r.id),t.addAttribute(t.nsAttributeName(e),r)})},h.prototype.addAttribute=function(e,t){var n=this.attrs;b(t)&&(t=s(t)),n.push({name:e,value:t})},h.prototype.serializeAttributes=function(e){function t(){return v(a.used,function(e){var t="xmlns"+(e.prefix?":"+e.prefix:"");return{name:t,value:e.uri}})}var n=this.attrs,i=!this.parent,a=this.namespaces;i&&(n=t().concat(n)),x(n,function(t){e.append(" ").append(r(t.name)).append('="').append(t.value).append('"')})},h.prototype.serializeTo=function(e){var t=this.body.length,n=!(1===this.body.length&&this.body[0]instanceof p);e.appendIndent().append("<"+r(this.ns)),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),x(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+r(this.ns)+">")),e.appendNewLine()},d.prototype=new h,d.prototype.build=function(e){var t=e.$descriptor;this.element=e,this.typeNs=this.nsTagName(t);var n=this.typeNs,r=e.$model.getPackage(n.uri),i=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(M),(n.prefix?n.prefix+":":"")+i+t.ns.localName),h.prototype.build.call(this,e)},d.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri},t.exports=g},{165:165,168:168,17:17,27:27,30:30,75:75,77:77,80:80}],20:[function(e,t,n){(function(t){!function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);var i=this;a(i),i.q=i.c="",i.bufferCheckPosition=n.MAX_BUFFER_LENGTH,i.opt=t||{},i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags,i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase",i.tags=[],i.closed=i.closedRoot=i.sawRoot=!1,i.tag=i.error=null,i.strict=!!e,i.noscript=!(!e&&!i.opt.noscript),i.state=z.BEGIN,i.ENTITIES=Object.create(n.ENTITIES),i.attribList=[],i.opt.xmlns&&(i.ns=Object.create(G)),i.trackPosition=i.opt.position!==!1,i.trackPosition&&(i.position=i.line=i.column=0),h(i,"onready")}function i(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,i=0,a=C.length;a>i;i++){var o=e[C[i]].length;if(o>t)switch(C[i]){case"textNode":m(e);break;case"cdata":d(e,"oncdata",e.cdata),e.cdata="";break;case"script":d(e,"onscript",e.script),e.script="";break;default:g(e,"Max buffer length exceeded: "+C[i])}r=Math.max(r,o)}e.bufferCheckPosition=n.MAX_BUFFER_LENGTH-r+e.position}function a(e){for(var t=0,n=C.length;n>t;t++)e[C[t]]=""}function o(e){m(e),""!==e.cdata&&(d(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(d(e,"onscript",e.script),e.script="")}function s(e,t){return new c(e,t)}function c(e,t){if(!(this instanceof c))return new c(e,t);R.apply(this),this._parser=new r(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,M.forEach(function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){return t?void n.on(e,t):(n.removeAllListeners(e),n._parser["on"+e]=t)},enumerable:!0,configurable:!1})})}function u(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function l(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function p(e,t){return l(e)?!!t.match(e):e[t]}function f(e,t){return!p(e,t)}function h(e,t,n){e[t]&&e[t](n)}function d(e,t,n){e.textNode&&m(e),h(e,t,n)}function m(e){e.textNode=y(e.opt,e.textNode),e.textNode&&h(e,"ontext",e.textNode),e.textNode=""}function y(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function g(e,t){return m(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,h(e,"onerror",t),e}function v(e){return e.closedRoot||x(e,"Unclosed root tag"),e.state!==z.BEGIN&&e.state!==z.TEXT&&g(e,"Unexpected end"),m(e),e.c="",e.closed=!0,h(e,"onend"),r.call(e,e.strict,e.opt),e}function x(e,t){if("object"!=typeof e||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&g(e,t)}function b(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0}function E(e,t){var n=e.indexOf(":"),r=0>n?["",e]:e.split(":"),i=r[0],a=r[1];return t&&"xmlns"===e&&(i="xmlns",a=""),{prefix:i,local:a}}function w(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))return e.attribName=e.attribValue="";if(e.opt.xmlns){var t=E(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==j)x(e,"xml: prefix must be bound to "+j+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==V)x(e,"xmlns: prefix must be bound to "+V+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,d(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}function A(e,t){if(e.opt.xmlns){var n=e.tag,r=E(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(x(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(t){d(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var a=0,o=e.attribList.length;o>a;a++){var s=e.attribList[a],c=s[0],u=s[1],l=E(c,!0),p=l.prefix,f=l.local,h=""==p?"":n.ns[p]||"",m={name:c,value:u,prefix:p,local:f,uri:h};p&&"xmlns"!=p&&!h&&(x(e,"Unbound namespace prefix: "+JSON.stringify(p)),m.uri=p),e.tag.attributes[c]=m,d(e,"onattribute",m)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),d(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=z.TEXT:e.state=z.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function S(e){if(!e.tagName)return x(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=z.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=z.SCRIPT);d(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--;){var i=e.tags[t];if(i.name===r)break;x(e,"Unexpected close tag")}if(0>t)return x(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=z.TEXT);e.tagName=n;for(var a=e.tags.length;a-->t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,d(e,"onclosetag",e.tagName);var s={};for(var c in o.ns)s[c]=o.ns[c];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach(function(t){var n=o.ns[t];d(e,"onclosenamespace",{prefix:t,uri:n})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=z.TEXT}function _(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:(n=r,"#"===n.charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),t=parseInt(n,16),i=t.toString(16)):(n=n.slice(1),t=parseInt(n,10),i=t.toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(x(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function T(e){var t=this;if(this.error)throw this.error;if(t.closed)return g(t,"Cannot write after close. Assign an onready handler.");if(null===e)return v(t);for(var n=0,r="";t.c=r=e.charAt(n++);)switch(t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++),t.state){case z.BEGIN:"<"===r?(t.state=z.OPEN_WAKA,t.startTagPosition=t.position):f(D,r)&&(x(t,"Non-whitespace before first tag."),t.textNode=r,t.state=z.TEXT);continue;case z.TEXT:if(t.sawRoot&&!t.closedRoot){for(var a=n-1;r&&"<"!==r&&"&"!==r;)r=e.charAt(n++),r&&t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++);t.textNode+=e.substring(a,n-1)}"<"===r?(t.state=z.OPEN_WAKA,t.startTagPosition=t.position):(!f(D,r)||t.sawRoot&&!t.closedRoot||x(t,"Text data outside of root node."),"&"===r?t.state=z.TEXT_ENTITY:t.textNode+=r);continue;case z.SCRIPT:"<"===r?t.state=z.SCRIPT_ENDING:t.script+=r;continue;case z.SCRIPT_ENDING:"/"===r?t.state=z.CLOSE_TAG:(t.script+="<"+r,t.state=z.SCRIPT);continue;case z.OPEN_WAKA:if("!"===r)t.state=z.SGML_DECL,t.sgmlDecl="";else if(p(D,r));else if(p(U,r))t.state=z.OPEN_TAG,t.tagName=r;else if("/"===r)t.state=z.CLOSE_TAG,t.tagName="";else if("?"===r)t.state=z.PROC_INST,t.procInstName=t.procInstBody="";else{if(x(t,"Unencoded <"),t.startTagPosition+1<t.position){var o=t.position-t.startTagPosition;r=new Array(o).join(" ")+r}t.textNode+="<"+r,t.state=z.TEXT}continue;case z.SGML_DECL:(t.sgmlDecl+r).toUpperCase()===L?(d(t,"onopencdata"),t.state=z.CDATA,t.sgmlDecl="",t.cdata=""):t.sgmlDecl+r==="--"?(t.state=z.COMMENT,t.comment="",t.sgmlDecl=""):(t.sgmlDecl+r).toUpperCase()===F?(t.state=z.DOCTYPE,(t.doctype||t.sawRoot)&&x(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):">"===r?(d(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=z.TEXT):p(O,r)?(t.state=z.SGML_DECL_QUOTED,t.sgmlDecl+=r):t.sgmlDecl+=r;continue;case z.SGML_DECL_QUOTED:r===t.q&&(t.state=z.SGML_DECL,t.q=""),t.sgmlDecl+=r;continue;case z.DOCTYPE:">"===r?(t.state=z.TEXT,d(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=r,"["===r?t.state=z.DOCTYPE_DTD:p(O,r)&&(t.state=z.DOCTYPE_QUOTED,t.q=r));continue;case z.DOCTYPE_QUOTED:t.doctype+=r,r===t.q&&(t.q="",t.state=z.DOCTYPE);continue;case z.DOCTYPE_DTD:t.doctype+=r,"]"===r?t.state=z.DOCTYPE:p(O,r)&&(t.state=z.DOCTYPE_DTD_QUOTED,t.q=r);continue;case z.DOCTYPE_DTD_QUOTED:t.doctype+=r,r===t.q&&(t.state=z.DOCTYPE_DTD,t.q="");continue;case z.COMMENT:"-"===r?t.state=z.COMMENT_ENDING:t.comment+=r;continue;case z.COMMENT_ENDING:"-"===r?(t.state=z.COMMENT_ENDED,
+t.comment=y(t.opt,t.comment),t.comment&&d(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+r,t.state=z.COMMENT);continue;case z.COMMENT_ENDED:">"!==r?(x(t,"Malformed comment"),t.comment+="--"+r,t.state=z.COMMENT):t.state=z.TEXT;continue;case z.CDATA:"]"===r?t.state=z.CDATA_ENDING:t.cdata+=r;continue;case z.CDATA_ENDING:"]"===r?t.state=z.CDATA_ENDING_2:(t.cdata+="]"+r,t.state=z.CDATA);continue;case z.CDATA_ENDING_2:">"===r?(t.cdata&&d(t,"oncdata",t.cdata),d(t,"onclosecdata"),t.cdata="",t.state=z.TEXT):"]"===r?t.cdata+="]":(t.cdata+="]]"+r,t.state=z.CDATA);continue;case z.PROC_INST:"?"===r?t.state=z.PROC_INST_ENDING:p(D,r)?t.state=z.PROC_INST_BODY:t.procInstName+=r;continue;case z.PROC_INST_BODY:if(!t.procInstBody&&p(D,r))continue;"?"===r?t.state=z.PROC_INST_ENDING:t.procInstBody+=r;continue;case z.PROC_INST_ENDING:">"===r?(d(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=z.TEXT):(t.procInstBody+="?"+r,t.state=z.PROC_INST_BODY);continue;case z.OPEN_TAG:p(W,r)?t.tagName+=r:(b(t),">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:(f(D,r)&&x(t,"Invalid character in tag name"),t.state=z.ATTRIB));continue;case z.OPEN_TAG_SLASH:">"===r?(A(t,!0),S(t)):(x(t,"Forward-slash in opening tag not followed by >"),t.state=z.ATTRIB);continue;case z.ATTRIB:if(p(D,r))continue;">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:p(U,r)?(t.attribName=r,t.attribValue="",t.state=z.ATTRIB_NAME):x(t,"Invalid attribute name");continue;case z.ATTRIB_NAME:"="===r?t.state=z.ATTRIB_VALUE:">"===r?(x(t,"Attribute without value"),t.attribValue=t.attribName,w(t),A(t)):p(D,r)?t.state=z.ATTRIB_NAME_SAW_WHITE:p(W,r)?t.attribName+=r:x(t,"Invalid attribute name");continue;case z.ATTRIB_NAME_SAW_WHITE:if("="===r)t.state=z.ATTRIB_VALUE;else{if(p(D,r))continue;x(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",d(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===r?A(t):p(U,r)?(t.attribName=r,t.state=z.ATTRIB_NAME):(x(t,"Invalid attribute name"),t.state=z.ATTRIB)}continue;case z.ATTRIB_VALUE:if(p(D,r))continue;p(O,r)?(t.q=r,t.state=z.ATTRIB_VALUE_QUOTED):(x(t,"Unquoted attribute value"),t.state=z.ATTRIB_VALUE_UNQUOTED,t.attribValue=r);continue;case z.ATTRIB_VALUE_QUOTED:if(r!==t.q){"&"===r?t.state=z.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=r;continue}w(t),t.q="",t.state=z.ATTRIB_VALUE_CLOSED;continue;case z.ATTRIB_VALUE_CLOSED:p(D,r)?t.state=z.ATTRIB:">"===r?A(t):"/"===r?t.state=z.OPEN_TAG_SLASH:p(U,r)?(x(t,"No whitespace between attributes"),t.attribName=r,t.attribValue="",t.state=z.ATTRIB_NAME):x(t,"Invalid attribute name");continue;case z.ATTRIB_VALUE_UNQUOTED:if(f(I,r)){"&"===r?t.state=z.ATTRIB_VALUE_ENTITY_U:t.attribValue+=r;continue}w(t),">"===r?A(t):t.state=z.ATTRIB;continue;case z.CLOSE_TAG:if(t.tagName)">"===r?S(t):p(W,r)?t.tagName+=r:t.script?(t.script+="</"+t.tagName,t.tagName="",t.state=z.SCRIPT):(f(D,r)&&x(t,"Invalid tagname in closing tag"),t.state=z.CLOSE_TAG_SAW_WHITE);else{if(p(D,r))continue;f(U,r)?t.script?(t.script+="</"+r,t.state=z.SCRIPT):x(t,"Invalid tagname in closing tag."):t.tagName=r}continue;case z.CLOSE_TAG_SAW_WHITE:if(p(D,r))continue;">"===r?S(t):x(t,"Invalid characters in closing tag");continue;case z.TEXT_ENTITY:case z.ATTRIB_VALUE_ENTITY_Q:case z.ATTRIB_VALUE_ENTITY_U:switch(t.state){case z.TEXT_ENTITY:var s=z.TEXT,c="textNode";break;case z.ATTRIB_VALUE_ENTITY_Q:var s=z.ATTRIB_VALUE_QUOTED,c="attribValue";break;case z.ATTRIB_VALUE_ENTITY_U:var s=z.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===r?(t[c]+=_(t),t.entity="",t.state=s):p(B,r)?t.entity+=r:(x(t,"Invalid character entity"),t[c]+="&"+t.entity+r,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&i(t),t}n.parser=function(e,t){return new r(e,t)},n.SAXParser=r,n.SAXStream=c,n.createStream=s,n.MAX_BUFFER_LENGTH=65536;var C=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];n.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){this.__proto__=e}return t.prototype=e,new t}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),r.prototype={end:function(){v(this)},write:T,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){o(this)}};try{var R=e("stream").Stream}catch(N){var R=function(){}}var M=n.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});c.prototype=Object.create(R.prototype,{constructor:{value:c}}),c.prototype.write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},c.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},c.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===M.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),R.prototype.on.call(n,e,t)};var D="\r\n ",k="0124356789",P="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",O="'\"",B=k+P+"#",I=D+">",L="[CDATA[",F="DOCTYPE",j="http://www.w3.org/XML/1998/namespace",V="http://www.w3.org/2000/xmlns/",G={xml:j,xmlns:V};D=u(D),k=u(k),P=u(P);var U=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,W=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;O=u(O),B=u(B),I=u(I);var z=0;n.STATE={BEGIN:z++,TEXT:z++,TEXT_ENTITY:z++,OPEN_WAKA:z++,SGML_DECL:z++,SGML_DECL_QUOTED:z++,DOCTYPE:z++,DOCTYPE_QUOTED:z++,DOCTYPE_DTD:z++,DOCTYPE_DTD_QUOTED:z++,COMMENT_STARTING:z++,COMMENT:z++,COMMENT_ENDING:z++,COMMENT_ENDED:z++,CDATA:z++,CDATA_ENDING:z++,CDATA_ENDING_2:z++,PROC_INST:z++,PROC_INST_BODY:z++,PROC_INST_ENDING:z++,OPEN_TAG:z++,OPEN_TAG_SLASH:z++,ATTRIB:z++,ATTRIB_NAME:z++,ATTRIB_NAME_SAW_WHITE:z++,ATTRIB_VALUE:z++,ATTRIB_VALUE_QUOTED:z++,ATTRIB_VALUE_CLOSED:z++,ATTRIB_VALUE_UNQUOTED:z++,ATTRIB_VALUE_ENTITY_Q:z++,ATTRIB_VALUE_ENTITY_U:z++,CLOSE_TAG:z++,CLOSE_TAG_SAW_WHITE:z++,SCRIPT:z++,SCRIPT_ENDING:z++},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach(function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r});for(var z in n.STATE)n.STATE[n.STATE[z]]=z;z=n.STATE,String.fromCodePoint||!function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,i=16384,a=[],o=-1,s=arguments.length;if(!s)return"";for(var c="";++o<s;){var u=Number(arguments[o]);if(!isFinite(u)||0>u||u>1114111||t(u)!=u)throw RangeError("Invalid code point: "+u);65535>=u?a.push(u):(u-=65536,n=(u>>10)+55296,r=u%1024+56320,a.push(n,r)),(o+1==s||a.length>i)&&(c+=e.apply(null,a),a.length=0)}return c};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n}()}("undefined"==typeof n?sax={}:n)}).call(this,void 0)},{undefined:void 0}],21:[function(t,n,r){!function(t){"use strict";function i(){this.data=[null],this.top=0}function a(){return new i}i.prototype.clear=function(){return this.data=[null],this.top=0,this},i.prototype.length=function(){return this.top},i.prototype.peek=function(){return this.data[this.top]},i.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},i.prototype.push=function(e){return this.data[++this.top]=e,this},"undefined"!=typeof r?n.exports=a:"function"==typeof e?e(function(){return a}):t.stack=a}(this)},{}],22:[function(e,t,n){t.exports=e(26)},{26:26}],23:[function(e,t,n){"use strict";function r(){}r.prototype.get=function(e){return this.$model.properties.get(this,e)},r.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},t.exports=r},{}],24:[function(e,t,n){"use strict";function r(e){this.ns=e,this.name=e.name,this.allTypes=[],this.properties=[],this.propertiesByName={}}var i=e(173),a=e(168),o=e(77),s=e(27).parseName;t.exports=r,r.prototype.build=function(){return i(this,["ns","name","allTypes","properties","propertiesByName","bodyProperty"])},r.prototype.addProperty=function(e,t){this.addNamedProperty(e,!0);var n=this.properties;void 0!==t?n.splice(t,0,e):n.push(e)},r.prototype.replaceProperty=function(e,t){var n=e.ns,r=this.properties,i=this.propertiesByName,a=e.name!==t.name;if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}this.addNamedProperty(t,a);var o=r.indexOf(e);if(-1===o)throw new Error("property <"+n.name+"> not found in property list");r[o]=t,i[n.name]=i[n.localName]=t},r.prototype.redefineProperty=function(e){var t=e.ns.prefix,n=e.redefines.split("#"),r=s(n[0],t),i=s(n[1],r.prefix).name,a=this.propertiesByName[i];if(!a)throw new Error("refined property <"+i+"> not found");this.replaceProperty(a,e),delete e.redefines},r.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},r.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},r.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},r.prototype.addIdProperty=function(e){var t=s(e,this.ns.prefix),n={name:t.localName,type:"String",isAttr:!0,ns:t};this.addProperty(n,0)},r.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},r.prototype.hasProperty=function(e){return this.propertiesByName[e]},r.prototype.addTrait=function(e){var t=this.allTypes;-1===t.indexOf(e)&&(o(e.properties,function(t){t=a({},t,{name:t.ns.localName}),Object.defineProperty(t,"definedBy",{value:e}),t.redefines?this.redefineProperty(t):(t.isBody&&this.setBodyProperty(t),this.addProperty(t))},this),t.push(e))}},{168:168,173:173,27:27,77:77}],25:[function(e,t,n){"use strict";function r(e,t){this.model=e,this.properties=t}var i=e(77),a=e(23);t.exports=r,r.prototype.createType=function(e){function t(e){r.define(this,"$type",{value:s,enumerable:!0}),r.define(this,"$attrs",{value:{}}),r.define(this,"$parent",{writable:!0}),i(e,function(e,t){this.set(t,e)},this)}var n=this.model,r=this.properties,o=Object.create(a.prototype);i(e.properties,function(e){e.isMany||void 0===e["default"]||(o[e.name]=e["default"])}),r.defineModel(o,n),r.defineDescriptor(o,e);var s=e.ns.name;return t.prototype=o,t.hasType=o.$instanceOf=this.model.hasType,r.defineModel(t,n),r.defineDescriptor(t,e),t}},{23:23,77:77}],26:[function(e,t,n){"use strict";function r(e,t){t=t||{},this.properties=new l(this),this.factory=new c(this,this.properties),this.registry=new u(e,this.properties,t),this.typeCache={}}var i=e(165),a=e(163),o=e(77),s=e(76),c=e(25),u=e(29),l=e(28),p=e(27).parseName;t.exports=r,r.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},r.prototype.getType=function(e){var t=this.typeCache,n=i(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},r.prototype.createAny=function(e,t,n){var r=p(e),i={$type:e},s={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,s),this.properties.defineModel(i,this),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),o(n,function(e,t){a(e)&&void 0!==e.value?i[e.name]=e.value:i[t]=e}),i},r.prototype.getPackage=function(e){return this.registry.getPackage(e)},r.prototype.getPackages=function(){return this.registry.getPackages()},r.prototype.getElementDescriptor=function(e){return e.$descriptor},r.prototype.hasType=function(e,t){void 0===t&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return!!s(n.allTypes,function(e){return e.name===t})},r.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]}},{163:163,165:165,25:25,27:27,28:28,29:29,76:76,77:77}],27:[function(e,t,n){"use strict";t.exports.parseName=function(e,t){var n,r,i=e.split(/:/);if(1===i.length)n=e,r=t;else{if(2!==i.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=i[1],r=i[0]}return e=(r?r+":":"")+n,{name:e,prefix:r,localName:n}}},{}],28:[function(e,t,n){"use strict";function r(e){this.model=e}t.exports=r,r.prototype.set=function(e,t,n){var r=this.model.getPropertyDescriptor(e,t);r?Object.defineProperty(e,r.name,{enumerable:!r.isReference,writable:!0,value:n}):e.$attrs[t]=n},r.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var r=n.name;return!e[r]&&n.isMany&&Object.defineProperty(e,r,{enumerable:!n.isReference,writable:!0,value:[]}),e[r]},r.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},r.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},r.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})}},{}],29:[function(e,t,n){"use strict";function r(e,t,n){this.options=i({generateId:"id"},n||{}),this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,a(e,this.registerPackage,this)}var i=e(168),a=e(77),o=e(30),s=e(24),c=e(27).parseName,u=o.isBuiltIn;t.exports=r,r.prototype.getPackage=function(e){return this.packageMap[e]},r.prototype.getPackages=function(){return this.packages},r.prototype.registerPackage=function(e){e=i({},e),a(e.types,function(t){this.registerType(t,e)},this),this.packageMap[e.uri]=this.packageMap[e.prefix]=e,this.packages.push(e)},r.prototype.registerType=function(e,t){e=i({},e,{superClass:(e.superClass||[]).slice(),"extends":(e["extends"]||[]).slice(),properties:(e.properties||[]).slice()});var n=c(e.name,t.prefix),r=n.name,o={};a(e.properties,function(e){var t=c(e.name,n.prefix),r=t.name;u(e.type)||(e.type=c(e.type,t.prefix).name),i(e,{ns:t,name:r}),o[r]=e}),i(e,{ns:n,name:r,propertiesByName:o}),a(e["extends"],function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(r)},this),this.definePackage(e,t),this.typeMap[r]=e},r.prototype.mapTypes=function(e,t){function n(n){var r=c(n,u(n)?"":e.prefix);i.mapTypes(r,t)}var r=u(e.name)?{name:e.name}:this.typeMap[e.name],i=this;if(!r)throw new Error("unknown type <"+e.name+">");a(r.superClass,n),t(r),a(r.traits,n)},r.prototype.getEffectiveDescriptor=function(e){var t=c(e),n=new s(t);this.mapTypes(t,function(e){n.addTrait(e)});var r=this.options.generateId;r&&!n.hasProperty(r)&&n.addIdProperty(r);var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},r.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})}},{168:168,24:24,27:27,30:30,77:77}],30:[function(e,t,n){"use strict";var r={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},i={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};t.exports.coerceType=function(e,t){var n=i[e];return n?n(t):t},t.exports.isBuiltIn=function(e){return!!r[e]},t.exports.isSimple=function(e){return!!i[e]}},{}],31:[function(e,t,n){t.exports={name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"outMessageRef",type:"Message",isAttr:!0,isReference:!0},{name:"errorRefs",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"childLaneSet",type:"LaneSet",serialize:"xsi:type"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection","default":"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,"default":"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",serialize:"xsi:type"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String"},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand","default":!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition"}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference","default":!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting","default":!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"inputSet",type:"InputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataInputAssociation",type:"DataInputAssociation",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean","default":!1},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitionRefs",type:"EventDefinition",isMany:!0,isReference:!0},{name:"dataOutputAssociation",type:"DataOutputAssociation",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"eventDefinitions",type:"EventDefinition",isMany:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity","default":!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean"},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",serialize:"xsi:type"},{name:"timeCycle",type:"Expression",serialize:"xsi:type"},{name:"timeDuration",type:"Expression",serialize:"xsi:type"}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",serialize:"xsi:type"}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"transformation",type:"FormalExpression"},{name:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"inputSetRefs",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"outputSetRefs",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0},{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",serialize:"xsi:type"},{name:"to",type:"Expression",serialize:"xsi:type"}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited","default":!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",
+type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!0},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"body",type:"String",isBody:!0},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",type:"String",isAttr:!0},{name:"isCollection","default":!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",serialize:"xsi:type"},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"supportedInterfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRefs",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum","default":0,isAttr:!0,type:"Integer"},{name:"maximum","default":1,isAttr:!0,type:"Integer"}]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRefs",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType","default":"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["FlowElementsContainer","Collaboration"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat","default":"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isVirtual:!0,isMany:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCharacteristics",type:"LoopCharacteristics"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"ioSpecification",type:"InputOutputSpecification"},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity","default":1,isAttr:!0,type:"Integer"},{name:"completionQuantity","default":1,isAttr:!0,type:"Integer"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent","default":!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential","default":!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior","default":"All",isAttr:!0},{name:"loopCardinality",type:"Expression",serialize:"xsi:type"},{name:"loopDataInputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isAttr:!0,isReference:!0},{name:"inputDataItem",type:"DataInput"},{name:"outputDataItem",type:"DataOutput"},{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore","default":!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",serialize:"xsi:type"},{name:"loopMaximum",type:"Expression",serialize:"xsi:type"}]},{name:"CallActivity",superClass:["Activity"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate","default":!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",serialize:"xsi:type"},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances","default":!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",serialize:"xsi:type"}]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage","default":"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage","default":"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],emumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}}},{}],32:[function(e,t,n){t.exports={name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,"default":"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],emumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[],prefix:"bpmndi"}},{}],33:[function(e,t,n){t.exports={name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real","default":"0",isAttr:!0},{name:"y",type:"Real","default":"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],prefix:"dc",associations:[]}},{}],34:[function(e,t,n){t.exports={name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",serialize:"xsi:type"}]},{name:"Diagram",isAbstract:!0,properties:[{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isVirtual:!0,isMany:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",xml:{tagAlias:"lowerCase"}}},{}],35:[function(e,t,n){t.exports=e(36)},{36:36}],36:[function(e,t,n){"use strict";function r(e){function t(e){return i.indexOf(e)>=0}function n(e){i.push(e)}function r(e){t(e)||((e.__depends__||[]).forEach(r),t(e)||(n(e),(e.__init__||[]).forEach(function(e){a.push(e)})))}var i=[],a=[];e.forEach(r);var s=new o.Injector(i);return a.forEach(function(e){try{s["string"==typeof e?"get":"invoke"](e)}catch(t){throw console.error("Failed to instantiate component"),console.error(t.stack),t}}),s}function i(t){t=t||{};var n={config:["value",t]},i=e(42),a=[n,i].concat(t.modules||[]);return r(a)}function a(e,t){this.injector=t=t||i(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var o=e(69);t.exports=a,a.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")}},{42:42,69:69}],37:[function(e,t,n){"use strict";function r(e,t){return Math.round(e*t)/t}function i(e){return u(e)?e+"px":e}function a(e){e=l({},{width:"100%",height:"100%"},e);var t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),l(n.style,{position:"relative",overflow:"hidden",width:i(e.width),height:i(e.height)}),t.appendChild(n),n}function o(e,t){return e.group().attr({"class":t})}function s(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._init(e||{})}function c(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}var u=e(162),l=e(168),p=e(77),f=e(57),h=e(67),d="base";s.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],t.exports=s,s.prototype._init=function(e){var t=this._eventBus,n=a(e),r=h.createSnapAt("100%","100%",n),i=o(r,"viewport"),s=this;this._container=n,this._svg=r,this._viewport=i,this._layers={},t.on("diagram.init",function(e){t.fire("canvas.init",{svg:r,viewport:i})}),t.on("diagram.destroy",function(){var e=s._container.parentNode;e&&e.removeChild(n),t.fire("canvas.destroy",{svg:s._svg,viewport:s._viewport}),s._svg.remove(),s._svg=s._container=s._layers=s._viewport=null})},s.prototype.getDefaultLayer=function(){return this.getLayer(d)},s.prototype.getLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];return t||(t=this._layers[e]=o(this._viewport,"layer-"+e)),t},s.prototype.getContainer=function(){return this._container},s.prototype._updateMarker=function(e,t,n){var r;e.id||(e=this._elementRegistry.get(e)),r=this._elementRegistry._elements[e.id],r&&(p([r.gfx,r.secondaryGfx],function(e){e&&e[n?"addClass":"removeClass"](t)}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},s.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},s.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},s.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return n&&n.hasClass(t)},s.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},s.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot"}),this._rootElement},s.prototype.setRootElement=function(e,t){this._ensureValidId(e);var n=this._rootElement,r=this._elementRegistry,i=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");i.fire("root.remove",{element:n}),i.fire("root.removed",{element:n}),r.remove(n)}var a=this.getDefaultLayer();return i.fire("root.add",{element:e}),r.add(e,a,this._svg),i.fire("root.added",{element:e,gfx:a}),this._rootElement=e,e},s.prototype._ensureValidId=function(e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists")},s.prototype._setParent=function(e,t){f.add(t.children,e),e.parent=t},s.prototype._addElement=function(e,t,n){n=n||this.getRootElement();var r=this._eventBus,i=this._graphicsFactory;this._ensureValidId(t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n);var a=i.create(e,t);return this._elementRegistry.add(t,a),i.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},s.prototype.addShape=function(e,t){return this._addElement("shape",e,t)},s.prototype.addConnection=function(e,t){return this._addElement("connection",e,t)},s.prototype._removeElement=function(e,t){var n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;return(e=n.get(e.id||e))?(i.fire(t+".remove",{element:e}),r.remove(e),f.remove(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e):void 0},s.prototype.removeShape=function(e){return this._removeElement(e,"shape")},s.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},s.prototype.sendToFront=function(e,t){t!==!1&&(t=!0),t&&e.parent&&this.sendToFront(e.parent),p(e.children,function(e){this.sendToFront(e,!1)},this);var n=this.getGraphics(e),r=n.parent();n.remove().appendTo(r)},s.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},s.prototype._fireViewboxChange=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox(!1)})},s.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,a,o,s=this._viewport,c=this.getSize();return e?(i=Math.min(c.width/e.width,c.height/e.height),n=(new h.Matrix).scale(i).translate(-e.x,-e.y),s.transform(n),this._fireViewboxChange(),e):(t=this.getDefaultLayer().getBBox(!0),n=s.transform().localMatrix,i=r(n.a,1e3),a=r(-n.e||0,1e3),o=r(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/i:0,y:o?o/i:0,width:c.width/i,height:c.height/i,scale:i,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:c})},s.prototype.scroll=function(e){var t=this._viewport.node,n=t.getCTM();return e&&(e=l({dx:0,dy:0},e||{}),n=this._svg.node.createSVGMatrix().translate(e.dx,e.dy).multiply(n),c(t,n),this._fireViewboxChange()),{x:n.e,y:n.f}},s.prototype.zoom=function(e,t){if("fit-viewport"===e)return this._fitViewport(t);var n=this.viewbox();if(void 0===e)return n.scale;var i=n.outer;"auto"===t&&(t={x:i.width/2,y:i.height/2});var a=this._setZoom(e,t);return this._fireViewboxChange(),r(a.a,1e3)},s.prototype._fitViewport=function(e){var t,n,r=this.viewbox(),i=r.outer,a=r.inner;return a.x>=0&&a.y>=0&&a.x+a.width<=i.width&&a.y+a.height<=i.height&&!e?n={x:0,y:0,width:Math.max(a.width+a.x,i.width),height:Math.max(a.height+a.y,i.height)}:(t=Math.min(1,i.width/a.width,i.height/a.height),n={x:a.x+(e?a.width/2-i.width/t/2:0),y:a.y+(e?a.height/2-i.height/t/2:0),width:i.width/t,height:i.height/t}),this.viewbox(n),this.viewbox().scale},s.prototype._setZoom=function(e,t){var n,r,i,a,o,s=this._svg.node,u=this._viewport.node,p=s.createSVGMatrix(),f=s.createSVGPoint();i=u.getCTM();var h=i.a;return t?(n=l(f,t),r=n.matrixTransform(i.inverse()),a=p.translate(r.x,r.y).scale(1/h*e).translate(-r.x,-r.y),o=i.multiply(a)):o=p.scale(e),c(this._viewport.node,o),o},s.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},s.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();if(e.waypoints){var r=this.getGraphics(e),i=r.getBBox(!0);t=r.getBBox(),t.x-=i.x,t.y-=i.y,t.width+=2*i.x,t.height+=2*i.y}else t=e;var a=t.x*n.scale-n.x*n.scale,o=t.y*n.scale-n.y*n.scale,s=t.width*n.scale,c=t.height*n.scale;return{x:a,y:o,width:s,height:c}}},{162:162,168:168,57:57,67:67,77:77}],38:[function(e,t,n){"use strict";function r(){this._uid=12}var i=e(56);t.exports=r,r.prototype.createRoot=function(e){return this.create("root",e)},r.prototype.createLabel=function(e){return this.create("label",e)},r.prototype.createShape=function(e){return this.create("shape",e)},r.prototype.createConnection=function(e){return this.create("connection",e)},r.prototype.create=function(e,t){return t=t||{},t.id||(t.id=e+"_"+this._uid++),i.create(e,t)}},{56:56}],39:[function(e,t,n){"use strict";function r(){this._elements={}}var i="data-element-id";t.exports=r,r.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),t.attr(i,r),n&&n.attr(i,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},r.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(r.gfx.attr(i,null),r.secondaryGfx&&r.secondaryGfx.attr(i,null),delete t[n])},r.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e));var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},r.prototype.get=function(e){var t;t="string"==typeof e?e:e&&e.attr(i);var n=this._elements[t];return n&&n.element},r.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},r.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,a=r.gfx;return e(i,a)})},r.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},r.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")}},{}],40:[function(e,t,n){"use strict";function r(){this._listeners={};var e=this;this.on("diagram.destroy",1,function(){e._listeners=null})}function i(){}var a=e(160),o=e(159),s=e(162),c=e(168),u=1e3;t.exports=r,r.prototype.on=function(e,t,n){if(e=o(e)?e:[e],a(t)&&(n=t,t=u),!s(t))throw new Error("priority must be a number");var r=this,i={priority:t,callback:n};e.forEach(function(e){r._addListener(e,i)})},r.prototype.once=function(e,t){function n(){t.apply(r,arguments),r.off(e,n)}var r=this;this.on(e,n)},r.prototype.off=function(e,t){var n,r,i=this._getListeners(e);if(t)for(r=i.length-1;n=i[r];r--)n.callback===t&&i.splice(r,1);else i.length=0},r.prototype.fire=function(e,t){var n,r,a,o,s,c,u;if(u=Array.prototype.slice.call(arguments),"object"==typeof e&&(n=e,e=n.type),!e)throw new Error("no event type specified");if(a=this._listeners[e]){t instanceof i?n=t:(n=new i,n.init(t)),u[0]=n,r=n.type;try{for(e!==r&&(n.type=e),o=0;(s=a[o])&&!n.cancelBubble;o++)try{c=n.returnValue=s.callback.apply(null,u),void 0!==c&&n.stopPropagation(),c===!1&&n.preventDefault()}catch(l){if(!this.handleError(l))throw console.error("unhandled error in event listener"),console.error(l.stack),l}}finally{e!==r&&(n.type=r)}return void 0===c&&n.defaultPrevented&&(c=!1),c}},r.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},r.prototype._addListener=function(e,t){var n,r,i=this._getListeners(e);for(r=0;n=i[r];r++)if(n.priority<t.priority)return void i.splice(r,0,t);i.push(t)},r.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},t.exports.Event=i,i.prototype.stopPropagation=function(){this.cancelBubble=!0},i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.init=function(e){c(this,e||{})}},{159:159,160:160,162:162,168:168}],41:[function(e,t,n){"use strict";function r(e,t){this._renderer=e,this._elementRegistry=t}var i=e(77),a=e(81),o=e(60),s=e(181);r.$inject=["renderer","elementRegistry"],t.exports=r,r.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=o.getChildren(n),t||(t=n.parent().group().attr("class","djs-children"))):t=n,t},r.prototype._clear=function(e){var t=o.getVisual(e);return s(t.node),t},r.prototype._createContainer=function(e,t){var n=t.group().attr("class","djs-group"),r=n.group().attr("class","djs-element djs-"+e);return r.group().attr("class","djs-visual"),r},r.prototype.create=function(e,t){var n=this._getChildren(t.parent);return this._createContainer(e,n)},r.prototype.updateContainments=function(e){var t,n=this,r=this._elementRegistry;t=a(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),i(t,function(e){var t=n._getChildren(e),a=e.children;a&&i(a.slice().reverse(),function(e){var n=r.getGraphics(e);n.parent().prependTo(t)})})},r.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if("shape"===e)this._renderer.drawShape(r,t),n.translate(t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this._renderer.drawConnection(r,t)}n.attr("display",t.hidden?"none":"block")}},r.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);t.parent().remove()}},{181:181,60:60,77:77,81:81}],42:[function(e,t,n){t.exports={__depends__:[e(45)],__init__:["canvas"],canvas:["type",e(37)],elementRegistry:["type",e(39)],elementFactory:["type",e(38)],eventBus:["type",e(40)],
+graphicsFactory:["type",e(41)]}},{37:37,38:38,39:39,40:40,41:41,45:45}],43:[function(e,t,n){"use strict";function r(e){this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}function i(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function a(e){for(var t,n="",r=0;t=e[r];r++)n+=t.x+","+t.y+" ";return n}function o(e,t){return c.create("polyline",{points:a(e)}).attr(t||{})}function s(e,t){return e.attr({points:a(t)})}var c=e(67);t.exports=r,r.$inject=["styles"],r.prototype.drawShape=function(e,t){return e.rect(0,0,t.width||0,t.height||0).attr(this.SHAPE_STYLE)},r.prototype.drawConnection=function(e,t){return o(t.waypoints,this.CONNECTION_STYLE).appendTo(e)},r.prototype.getShapePath=function(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=[["M",t,n],["l",r,0],["l",0,a],["l",-r,0],["z"]];return i(o)},r.prototype.getConnectionPath=function(e){var t,n,r=e.waypoints,a=[];for(t=0;n=r[t];t++)n=n.original||n,a.push([0===t?"M":"L",n.x,n.y]);return i(a)},t.exports.createLine=o,t.exports.updateLine=s},{67:67}],44:[function(e,t,n){"use strict";function r(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}};this.cls=function(e,t,n){var r=this.style(t,n);return a(r,{"class":e})},this.style=function(t,n){i(t)||n||(n=t,t=[]);var r=o(t,function(t,n){return a(t,e[n]||{})},{});return n?a(r,n):r}}var i=e(159),a=e(168),o=e(81);t.exports=r},{159:159,168:168,81:81}],45:[function(e,t,n){t.exports={renderer:["type",e(43)],styles:["type",e(44)]}},{43:43,44:44}],46:[function(e,t,n){"use strict";function r(e,t,n){function r(n,r){var i,a=r.delegateTarget||r.target,o=a&&new l(a),s=t.get(o);o&&s&&(i=e.fire(n,{element:s,gfx:o,originalEvent:r}),i===!1&&(r.stopPropagation(),r.preventDefault()))}function o(e){var t=y[e];return t||(t=y[e]=function(t){u(t)&&r(e,t)}),t}function p(e,t,n){var r=o(n);r.$delegate=a.bind(e,v,t,r)}function f(e,t,n){a.unbind(e,t,o(n).$delegate)}function h(e){i(g,function(t,n){p(e.node,n,t)})}function d(e){i(g,function(t,n){f(e.node,n,t)})}var m=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15}),y={},g={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup"},v="svg, .djs-element";e.on("canvas.destroy",function(e){d(e.svg)}),e.on("canvas.init",function(e){h(e.svg)}),e.on(["shape.added","connection.added"],function(e){var t,n,r=e.element,i=e.gfx;r.waypoints?(t=s(r.waypoints),n="connection"):(t=l.create("rect",{x:0,y:0,width:r.width,height:r.height}),n="shape"),t.attr(m).appendTo(i.node)}),e.on("shape.changed",function(e){var t=e.element,n=e.gfx,r=n.select(".djs-hit");r.attr({width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,r=n.select(".djs-hit");c(r,t.waypoints)}),this.fire=r,this.mouseHandler=o,this.registerEvent=p,this.unregisterEvent=f}var i=e(77),a=e(182),o=e(43),s=o.createLine,c=o.updateLine,u=e(62).isPrimaryButton,l=e(67);r.$inject=["eventBus","elementRegistry","styles"],t.exports=r},{182:182,43:43,62:62,67:67,77:77}],47:[function(e,t,n){t.exports={__init__:["interactionEvents"],interactionEvents:["type",e(46)]}},{46:46}],48:[function(e,t,n){"use strict";function r(e,t,n){function r(e,t){return i.create("rect",u).prependTo(e)}function o(e,t){e.attr({x:-c,y:-c,width:t.width+2*c,height:t.height+2*c})}function s(e,t){var n=a(t);e.attr({x:n.x-c,y:n.y-c,width:n.width+2*c,height:n.height+2*c})}var c=6,u=t.cls("djs-outline",["no-fill"]);e.on(["shape.added","shape.changed"],function(e){var t=e.element,n=e.gfx,i=n.select(".djs-outline");i||(i=r(n,t)),o(i,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=n.select(".djs-outline");i||(i=r(n,t)),s(i,t)})}var i=e(67),a=e(58).getBBox;r.$inject=["eventBus","styles","elementRegistry"],t.exports=r},{58:58,67:67}],49:[function(e,t,n){"use strict";t.exports={__init__:["outline"],outline:["type",e(48)]}},{48:48}],50:[function(e,t,n){"use strict";function r(e){var t=d('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');return e.insertBefore(t,e.firstChild),t}function i(e,t,n){l(e.style,{left:t+"px",top:n+"px"})}function a(e,t){e.style.display=t===!1?"none":""}function o(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=v,this._overlayDefaults={show:{minZoom:.7,maxZoom:5}},this._overlays={},this._overlayContainers={},this._overlayRoot=r(n.getContainer()),this._init(e)}var s=e(159),c=e(165),u=e(163),l=e(168),p=e(77),f=e(75),h=e(84),d=e(183),m=e(180),y=e(185),g=e(58).getBBox,v=new(e(61))("ov");o.$inject=["config.overlays","eventBus","canvas","elementRegistry"],t.exports=o,o.prototype.get=function(e){if(c(e)&&(e={id:e}),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?f(t.overlays,{type:e.type}):t.overlays.slice():[]}return e.type?f(this._overlays,{type:e.type}):e.id?this._overlays[e.id]:null},o.prototype.add=function(e,t,n){if(u(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=l({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},o.prototype.remove=function(e){var t=this.get(e)||[];s(t)||(t=[t]);var n=this;p(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(y(e.html),y(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var r=t.overlays.indexOf(e);-1!==r&&t.overlays.splice(r,1)}})},o.prototype.show=function(){a(this._overlayRoot)},o.prototype.hide=function(){a(this._overlayRoot,!1)},o.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,a=t.y;if(t.waypoints){var o=g(t);r=o.x,a=o.y}i(n,r,a)},o.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,a=t.left,o=t.top;if(void 0!==t.right){var s;s=r.waypoints?g(r).width:r.width,a=-1*t.right+s}if(void 0!==t.bottom){var c;c=r.waypoints?g(r).height:r.height,o=-1*t.bottom+c}i(n,a||0,o||0)},o.prototype._createOverlayContainer=function(e){var t=d('<div class="djs-overlays djs-overlays-'+e.id+'" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),n},o.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,r="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._overlayRoot.style.transform=r,this._overlayRoot.style["-ms-transform"]=r},o.prototype._getOverlayContainer=function(e,t){var n=e&&e.id||e,r=this._overlayContainers[n];return r||t||(r=this._overlayContainers[n]=this._createOverlayContainer(e)),r},o.prototype._addOverlay=function(e){var t,n,r=e.id,i=e.element,a=e.html;a.get&&(a=a.get(0)),c(a)&&(a=d(a)),n=this._getOverlayContainer(i),t=d('<div class="djs-overlay" data-overlay-id="'+r+'" style="position: absolute">'),t.appendChild(a),e.type&&m(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[r]=e,this._updateOverlay(e)},o.prototype._updateOverlayVisibilty=function(e){p(this._overlays,function(t){var n=t.show,r=t.htmlContainer,i=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(i=!1),a(r,i))})},o.prototype._init=function(e){var t=this._eventBus,n=this,r=function(e){n._updateRoot(e),n._updateOverlayVisibilty(e),n.show()};e&&e.deferUpdate===!1||(r=h(r,300)),t.on("canvas.viewbox.changed",function(e){n.hide(),r(e.viewbox)}),t.on(["shape.remove","connection.remove"],function(e){var t=n.get({element:e.element});p(t,function(e){n.remove(e.id)})}),t.on(["element.changed"],function(e){var t=e.element,r=n._getOverlayContainer(t,!0);r&&(p(r.overlays,function(e){n._updateOverlay(e)}),n._updateOverlayContainer(r))}),t.on("element.marker.update",function(e){var t=n._getOverlayContainer(e.element,!0);t&&m(t.html)[e.add?"add":"remove"](e.marker)})}},{159:159,163:163,165:165,168:168,180:180,183:183,185:185,58:58,61:61,75:75,77:77,84:84}],51:[function(e,t,n){t.exports={__init__:["overlays"],overlays:["type",e(50)]}},{50:50}],52:[function(e,t,n){"use strict";function r(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)})}var i=e(159),a=e(77);r.$inject=["eventBus"],t.exports=r,r.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},r.prototype.get=function(){return this._selectedElements},r.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},r.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();i(e)||(e=e?[e]:[]),t?a(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})}},{159:159,77:77}],53:[function(e,t,n){"use strict";function r(e,t,n){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){t.select(e.context.shapes)}),e.on("element.click",function(e){var r=e.element;r===n.getRootElement()&&(r=null);var a=t.isSelected(r),o=t.get().length>1,s=i(e);return a&&o?s?t.deselect(r):t.select(r):void(a?t.deselect(r):t.select(r,s))})}var i=e(62).hasPrimaryModifier;r.$inject=["eventBus","selection","canvas"],t.exports=r},{62:62}],54:[function(e,t,n){"use strict";function r(e,t,n,r,s){function c(e,n){t.addMarker(e,n)}function u(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){c(e.element,a)}),e.on("element.out",function(e){u(e.element,a)}),e.on("selection.changed",function(e){function t(e){u(e,o)}function n(e){c(e,o)}var r=e.oldSelection,a=e.newSelection;i(r,function(e){-1===a.indexOf(e)&&t(e)}),i(a,function(e){-1===r.indexOf(e)&&n(e)})})}var i=e(77),a="hover",o="selected";r.$inject=["eventBus","canvas","selection","graphicsFactory","styles"],t.exports=r},{77:77}],55:[function(e,t,n){t.exports={__init__:["selectionVisuals","selectionBehavior"],__depends__:[e(47),e(49)],selection:["type",e(52)],selectionVisuals:["type",e(54)],selectionBehavior:["type",e(53)]}},{47:47,49:49,52:52,53:53,54:54}],56:[function(e,t,n){"use strict";function r(){Object.defineProperty(this,"businessObject",{writable:!0}),p.bind(this,"parent"),f.bind(this,"label"),h.bind(this,"outgoing"),d.bind(this,"incoming")}function i(){r.call(this),p.bind(this,"children")}function a(){i.call(this)}function o(){i.call(this),f.bind(this,"labelTarget")}function s(){r.call(this),h.bind(this,"source"),d.bind(this,"target")}var c=e(168),u=e(72),l=e(194),p=new l({name:"children",enumerable:!0,collection:!0},{name:"parent"}),f=new l({name:"label",enumerable:!0},{name:"labelTarget"}),h=new l({name:"outgoing",collection:!0},{name:"source"}),d=new l({name:"incoming",collection:!0},{name:"target"});u(i,r),u(a,i),u(o,i),u(s,r);var m={connection:s,shape:i,label:o,root:a};t.exports.create=function(e,t){var n=m[e];if(!n)throw new Error("unknown type: <"+e+">");return c(new n,t)},t.exports.Base=r,t.exports.Root=a,t.exports.Shape=i,t.exports.Connection=s,t.exports.Label=o},{168:168,194:194,72:72}],57:[function(e,t,n){"use strict";t.exports.remove=function(e,t){if(e&&t){var n=e.indexOf(t);if(-1!==n)return e.splice(n,1),t}},t.exports.add=function(e,t,n){if(e&&t){isNaN(n)&&(n=-1);var r=e.indexOf(t);if(-1!==r){if(r===n)return;if(-1===n)return;e.splice(r,1)}-1!==n?e.splice(n,0,t):e.push(t)}},t.exports.indexOf=function(e,t){return e&&t?e.indexOf(t):-1}},{}],58:[function(e,t,n){"use strict";function r(e,t,n){var r=!n||-1===e.indexOf(t);return r&&e.push(t),r}function i(e,t,n){n=n||0,d(e,function(e,r){var a=t(e,r,n);p(a)&&a.length&&i(a,t,n+1)})}function a(e,t,n){var a=[],o=[];return i(e,function(e,i,s){r(a,e,t);var c=e.children;return(-1===n||n>s)&&c&&r(o,c,t)?c:void 0}),a}function o(e,t){return a(e,!t,1)}function s(e,t){return a(e,!t,-1)}function c(e){function t(e){r[e.source.id]&&r[e.target.id]&&(r[e.id]=e),a[e.source.id]&&a[e.target.id]&&(c[e.id]=s[e.id]=e),o[e.id]=e}function n(e){return s[e.id]=e,e.waypoints?void(c[e.id]=o[e.id]=e):(a[e.id]=e,d(e.incoming,t),d(e.outgoing,t),e.children)}var r=h(e,function(e){return e.id}),a={},o={},s={},c={};return i(e,n),{allShapes:a,allConnections:o,topLevel:r,enclosedConnections:c,enclosedElements:s}}function u(e,t){t=!!t,p(e)||(e=[e]);var n,r,i,a;return d(e,function(e){var o=e;e.waypoints&&!t&&(o=u(e.waypoints,!0));var s=o.x,c=o.y,l=o.height||0,p=o.width||0;(n>s||void 0===n)&&(n=s),(r>c||void 0===r)&&(r=c),(s+p>i||void 0===i)&&(i=s+p),(c+l>a||void 0===a)&&(a=c+l)}),{x:n,y:r,height:a-r,width:i-n}}function l(e,t){var n={};return d(e,function(e){var r=e;r.waypoints&&(r=u(r)),!f(t.y)&&r.x>t.x&&(n[e.id]=e),!f(t.x)&&r.y>t.y&&(n[e.id]=e),r.x>t.x&&r.y>t.y&&(f(t.width)&&f(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y?n[e.id]=e:f(t.width)&&f(t.height)||(n[e.id]=e))}),n}var p=e(159),f=e(162),h=e(78),d=e(77);t.exports.eachElement=i,t.exports.selfAndDirectChildren=o,t.exports.selfAndAllChildren=s,t.exports.getBBox=u,t.exports.getEnclosedElements=l,t.exports.getClosure=c},{159:159,162:162,77:77,78:78}],59:[function(e,t,n){"use strict";function r(e){return e&&e.preventDefault()}function i(e,t){e&&(e.stopPropagation&&e.stopPropagation(),t&&e.stopImmediatePropagation&&e.stopImmediatePropagation())}function a(e){return e.originalEvent||e.srcEvent}function o(e,t){c(e,t),s(e)}function s(e){r(e),r(a(e))}function c(e,t){i(e,t),i(a(e),t)}function u(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}t.exports.getOriginal=a,t.exports.stopEvent=o,t.exports.preventDefault=s,t.exports.stopPropagation=c,t.exports.toPoint=u},{}],60:[function(e,t,n){"use strict";function r(e){return e.select(".djs-visual")}function i(e){return e.parent().children()[1]}function a(e){return r(e).select("*").getBBox()}t.exports.getVisual=r,t.exports.getChildren=i,t.exports.getBBox=a},{}],61:[function(e,t,n){"use strict";function r(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}t.exports=r,r.prototype.next=function(){return this._prefix+ ++this._counter}},{}],62:[function(e,t,n){"use strict";function r(e){return!(i(e)||e).button}var i=e(59).getOriginal,a=e(63).isMac;t.exports.isPrimaryButton=r,t.exports.isMac=a,t.exports.hasPrimaryModifier=function(e){var t=i(e)||e;return r(e)?a()?t.altKey:t.ctrlKey:!1},t.exports.hasSecondaryModifier=function(e){var t=i(e)||e;return r(e)&&t.shiftKey}},{59:59,63:63}],63:[function(e,t,n){"use strict";t.exports.isMac=function(){return/mac/i.test(navigator.platform)}},{}],64:[function(e,t,n){"use strict";function r(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function i(e){return p(e)?f({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function a(e,t){return t.textContent=e,t.getBBox()}function o(e,t,n){for(var r,i=e.shift(),o=i;;){if(r=a(o,n),r.width=o?r.width:0," "===o||""===o||r.width<Math.round(t)||o.length<4)return s(e,o,i,r);o=u(o,r.width,t)}}function s(e,t,n,r){if(t.length<n.length){var i=e[0]||"",a=n.slice(t.length).trim();i=/-\s*$/.test(a)?a.replace(/-\s*$/,"")+i.replace(/^\s+/,""):a+" "+i,e[0]=i}return{width:r.width,height:r.height,text:t}}function c(e,t){var n,r=e.split(/(\s|-)/g),i=[],a=0;if(r.length>1)for(;n=r.shift();){if(!(n.length+a<t)){"-"===n&&i.pop();break}i.push(n),a+=n.length}return i.join("")}function u(e,t,n){var r=Math.max(e.length*(n/t),1),i=c(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function l(e){this._config=f({},{size:v,padding:g,style:{},align:"center-top"},e||{})}var p=e(163),f=e(168),h=e(77),d=e(81),m=e(171),y=e(67),g=0,v={width:150,height:50};l.prototype.createText=function(e,t,n){for(var a=m({},this._config.size,n.box||{}),s=m({},this._config.style,n.style||{}),c=r(n.align||this._config.align),u=i(void 0!==n.padding?n.padding:this._config.padding),l=t.split(/\r?\n/g),p=[],f=a.width-u.left-u.right,g=e.paper.text(0,0,"").attr(s).node;l.length;)p.push(o(l,f,g));var v,x,b=d(p,function(e,t,n){return e+t.height},0);switch(c.vertical){case"middle":v=(a.height-b)/2-p[0].height/4;break;default:v=u.top}var E=e.text().attr(s);return h(p,function(e){switch(v+=e.height,c.horizontal){case"left":x=u.left;break;case"right":x=f-u.right-e.width;break;default:x=Math.max((f-e.width)/2+u.left,0)}var t=y.create("tspan",{x:x,y:v}).node;t.textContent=e.text,E.append(t)}),g.parentNode.removeChild(g),E},t.exports=l},{163:163,168:168,171:171,67:67,77:77,81:81}],65:[function(t,n,r){!function(t){var r,i,a="0.4.2",o="hasOwnProperty",s=/[\.\/]/,c=/\s*,\s*/,u="*",l=function(e,t){return e-t},p={n:{}},f=function(){for(var e=0,t=this.length;t>e;e++)if("undefined"!=typeof this[e])return this[e]},h=function(){for(var e=this.length;--e;)if("undefined"!=typeof this[e])return this[e]},d=function(e,t){e=String(e);var n,a=i,o=Array.prototype.slice.call(arguments,2),s=d.listeners(e),c=0,u=[],p={},m=[],y=r;m.firstDefined=f,m.lastDefined=h,r=e,i=0;for(var g=0,v=s.length;v>g;g++)"zIndex"in s[g]&&(u.push(s[g].zIndex),s[g].zIndex<0&&(p[s[g].zIndex]=s[g]));for(u.sort(l);u[c]<0;)if(n=p[u[c++]],m.push(n.apply(t,o)),i)return i=a,m;for(g=0;v>g;g++)if(n=s[g],"zIndex"in n)if(n.zIndex==u[c]){if(m.push(n.apply(t,o)),i)break;do if(c++,n=p[u[c]],n&&m.push(n.apply(t,o)),i)break;while(n)}else p[n.zIndex]=n;else if(m.push(n.apply(t,o)),i)break;return i=a,r=y,m};d._events=p,d.listeners=function(e){var t,n,r,i,a,o,c,l,f=e.split(s),h=p,d=[h],m=[];for(i=0,a=f.length;a>i;i++){for(l=[],o=0,c=d.length;c>o;o++)for(h=d[o].n,n=[h[f[i]],h[u]],r=2;r--;)t=n[r],t&&(l.push(t),m=m.concat(t.f||[]));d=l}return m},d.on=function(e,t){if(e=String(e),"function"!=typeof t)return function(){};for(var n=e.split(c),r=0,i=n.length;i>r;r++)!function(e){for(var n,r=e.split(s),i=p,a=0,o=r.length;o>a;a++)i=i.n,i=i.hasOwnProperty(r[a])&&i[r[a]]||(i[r[a]]={n:{}});for(i.f=i.f||[],a=0,o=i.f.length;o>a;a++)if(i.f[a]==t){n=!0;break}!n&&i.f.push(t)}(n[r]);return function(e){+e==+e&&(t.zIndex=+e)}},d.f=function(e){var t=[].slice.call(arguments,1);return function(){d.apply(null,[e,null].concat(t).concat([].slice.call(arguments,0)))}},d.stop=function(){i=1},d.nt=function(e){return e?new RegExp("(?:\\.|\\/|^)"+e+"(?:\\.|\\/|$)").test(r):r},d.nts=function(){return r.split(s)},d.off=d.unbind=function(e,t){if(!e)return void(d._events=p={n:{}});var n=e.split(c);if(n.length>1)for(var r=0,i=n.length;i>r;r++)d.off(n[r],t);else{n=e.split(s);var a,l,f,r,i,h,m,y=[p];for(r=0,i=n.length;i>r;r++)for(h=0;h<y.length;h+=f.length-2){if(f=[h,1],a=y[h].n,n[r]!=u)a[n[r]]&&f.push(a[n[r]]);else for(l in a)a[o](l)&&f.push(a[l]);y.splice.apply(y,f)}for(r=0,i=y.length;i>r;r++)for(a=y[r];a.n;){if(t){if(a.f){for(h=0,m=a.f.length;m>h;h++)if(a.f[h]==t){a.f.splice(h,1);break}!a.f.length&&delete a.f}for(l in a.n)if(a.n[o](l)&&a.n[l].f){var g=a.n[l].f;for(h=0,m=g.length;m>h;h++)if(g[h]==t){g.splice(h,1);break}!g.length&&delete a.n[l].f}}else{delete a.f;for(l in a.n)a.n[o](l)&&a.n[l].f&&delete a.n[l].f}a=a.n}}},d.once=function(e,t){var n=function(){return d.unbind(e,n),t.apply(this,arguments)};return d.on(e,n)},d.version=a,d.toString=function(){return"You are running Eve "+a},"undefined"!=typeof n&&n.exports?n.exports=d:"function"==typeof e&&e.amd?e("eve",[],function(){return d}):t.eve=d}(this)},{}],66:[function(t,n,r){!function(i,a){if("function"==typeof e&&e.amd)e(["eve"],function(e){return a(i,e)});else if("undefined"!=typeof r){var o=t(65);n.exports=a(i,o)}else a(i,i.eve)}(window||this,function(e,t){var n=function(t){var n={},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,16)},i=Array.isArray||function(e){return e instanceof Array||"[object Array]"==Object.prototype.toString.call(e)},a=0,o="M"+(+new Date).toString(36),s=function(){return o+(a++).toString(36)},c=Date.now||function(){return+new Date},u=function(e){var t=this;if(null==e)return t.s;var n=t.s-e;t.b+=t.dur*n,t.B+=t.dur*n,t.s=e},l=function(e){var t=this;return null==e?t.spd:void(t.spd=e)},p=function(e){var t=this;return null==e?t.dur:(t.s=t.s*e/t.dur,void(t.dur=e))},f=function(){var e=this;delete n[e.id],e.update(),t("mina.stop."+e.id,e)},h=function(){var e=this;e.pdif||(delete n[e.id],e.update(),e.pdif=e.get()-e.b)},d=function(){var e=this;e.pdif&&(e.b=e.get()-e.pdif,delete e.pdif,n[e.id]=e)},m=function(){var e,t=this;if(i(t.start)){e=[];for(var n=0,r=t.start.length;r>n;n++)e[n]=+t.start[n]+(t.end[n]-t.start[n])*t.easing(t.s)}else e=+t.start+(t.end-t.start)*t.easing(t.s);t.set(e)},y=function(){var e=0;for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],o=a.get();e++,a.s=(o-a.b)/(a.dur/a.spd),a.s>=1&&(delete n[i],a.s=1,e--,function(e){setTimeout(function(){t("mina.finish."+e.id,e)})}(a)),a.update()}e&&r(y)},g=function(e,t,i,a,o,c,v){var x={id:s(),start:e,end:t,b:i,s:0,dur:a-i,spd:1,get:o,set:c,easing:v||g.linear,status:u,speed:l,duration:p,stop:f,pause:h,resume:d,update:m};n[x.id]=x;var b,E=0;for(b in n)if(n.hasOwnProperty(b)&&(E++,2==E))break;return 1==E&&r(y),x};return g.time=c,g.getById=function(e){return n[e]||null},g.linear=function(e){return e},g.easeout=function(e){return Math.pow(e,1.7)},g.easein=function(e){return Math.pow(e,.48)},g.easeinout=function(e){if(1==e)return 1;if(0==e)return 0;var t=.48-e/1.04,n=Math.sqrt(.1734+t*t),r=n-t,i=Math.pow(Math.abs(r),1/3)*(0>r?-1:1),a=-n-t,o=Math.pow(Math.abs(a),1/3)*(0>a?-1:1),s=i+o+.5;return 3*(1-s)*s*s+s*s*s},g.backin=function(e){if(1==e)return 1;var t=1.70158;return e*e*((t+1)*e-t)},g.backout=function(e){if(0==e)return 0;e-=1;var t=1.70158;return e*e*((t+1)*e+t)+1},g.elastic=function(e){return e==!!e?e:Math.pow(2,-10*e)*Math.sin(2*(e-.075)*Math.PI/.3)+1},g.bounce=function(e){var t,n=7.5625,r=2.75;return 1/r>e?t=n*e*e:2/r>e?(e-=1.5/r,t=n*e*e+.75):2.5/r>e?(e-=2.25/r,t=n*e*e+.9375):(e-=2.625/r,t=n*e*e+.984375),t},e.mina=g,g}("undefined"==typeof t?function(){}:t),r=function(e){function n(e,t){if(e){if(e.tagName)return w(e);if(i(e,"array")&&n.set)return n.set.apply(n,e);if(e instanceof v)return e;if(null==t)return e=A.doc.querySelector(e),w(e)}return e=null==e?"100%":e,t=null==t?"100%":t,new E(e,t)}function r(e,t){if(t){if("#text"==e&&(e=A.doc.createTextNode(t.text||"")),"string"==typeof e&&(e=r(e)),"string"==typeof t)return"xlink:"==t.substring(0,6)?e.getAttributeNS(z,t.substring(6)):"xml:"==t.substring(0,4)?e.getAttributeNS($,t.substring(4)):e.getAttribute(t);for(var n in t)if(t[S](n)){var i=_(t[n]);i?"xlink:"==n.substring(0,6)?e.setAttributeNS(z,n.substring(6),i):"xml:"==n.substring(0,4)?e.setAttributeNS($,n.substring(4),i):e.setAttribute(n,i):e.removeAttribute(n)}}else e=A.doc.createElementNS($,e);return e}function i(e,t){return t=_.prototype.toLowerCase.call(t),"finite"==t?isFinite(e):"array"==t&&(e instanceof Array||Array.isArray&&Array.isArray(e))?!0:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||O.call(e).slice(8,-1).toLowerCase()==t}function a(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[S](n)&&(t[n]=a(e[n]));return t}function o(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function s(e,t,n){function r(){var i=Array.prototype.slice.call(arguments,0),a=i.join("␀"),s=r.cache=r.cache||{},c=r.count=r.count||[];return s[S](a)?(o(c,a),n?n(s[a]):s[a]):(c.length>=1e3&&delete s[c.shift()],c.push(a),s[a]=e.apply(t,i),n?n(s[a]):s[a])}return r}function c(e,t,n,r,i,a){if(null==i){var o=e-n,s=t-r;return o||s?(180+180*R.atan2(-s,-o)/k+360)%360:0}return c(e,t,i,a)-c(n,r,i,a)}function u(e){return e%360*k/180}function l(e){return 180*e/k%360}function p(e){var t=[];return e=e.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,function(e,n,r){return r=r.split(/\s*,\s*|\s+/),"rotate"==n&&1==r.length&&r.push(0,0),"scale"==n&&(r.length>2?r=r.slice(0,2):2==r.length&&r.push(0,0),1==r.length&&r.push(r[0],0,0)),"skewX"==n?t.push(["m",1,0,R.tan(u(r[0])),1,0,0]):"skewY"==n?t.push(["m",1,R.tan(u(r[0])),0,1,0,0]):t.push([n.charAt(0)].concat(r)),e}),t}function f(e,t){var r=J(e),i=new n.Matrix;if(r)for(var a=0,o=r.length;o>a;a++){var s,c,u,l,p,f=r[a],h=f.length,d=_(f[0]).toLowerCase(),m=f[0]!=d,y=m?i.invert():0;"t"==d&&2==h?i.translate(f[1],0):"t"==d&&3==h?m?(s=y.x(0,0),c=y.y(0,0),u=y.x(f[1],f[2]),l=y.y(f[1],f[2]),i.translate(u-s,l-c)):i.translate(f[1],f[2]):"r"==d?2==h?(p=p||t,i.rotate(f[1],p.x+p.width/2,p.y+p.height/2)):4==h&&(m?(u=y.x(f[2],f[3]),l=y.y(f[2],f[3]),i.rotate(f[1],u,l)):i.rotate(f[1],f[2],f[3])):"s"==d?2==h||3==h?(p=p||t,i.scale(f[1],f[h-1],p.x+p.width/2,p.y+p.height/2)):4==h?m?(u=y.x(f[2],f[3]),l=y.y(f[2],f[3]),i.scale(f[1],f[1],u,l)):i.scale(f[1],f[1],f[2],f[3]):5==h&&(m?(u=y.x(f[3],f[4]),l=y.y(f[3],f[4]),i.scale(f[1],f[2],u,l)):i.scale(f[1],f[2],f[3],f[4])):"m"==d&&7==h&&i.add(f[1],f[2],f[3],f[4],f[5],f[6])}return i}function h(e){var t=e.node.ownerSVGElement&&w(e.node.ownerSVGElement)||e.node.parentNode&&w(e.node.parentNode)||n.select("svg")||n(0,0),r=t.select("defs"),i=null==r?!1:r.node;return i||(i=b("defs",t.node).node),i}function d(e){return e.node.ownerSVGElement&&w(e.node.ownerSVGElement)||n.select("svg")}function m(e,t,n){function i(e){if(null==e)return P;if(e==+e)return e;r(u,{width:e});try{return u.getBBox().width}catch(t){return 0}}function a(e){if(null==e)return P;if(e==+e)return e;r(u,{height:e});try{return u.getBBox().height}catch(t){return 0}}function o(r,i){null==t?c[r]=i(e.attr(r)||0):r==t&&(c=i(null==n?e.attr(r)||0:n))}var s=d(e).node,c={},u=s.querySelector(".svg---mgr");switch(u||(u=r("rect"),r(u,{x:-9e9,y:-9e9,width:10,height:10,"class":"svg---mgr",fill:"none"}),s.appendChild(u)),e.type){case"rect":o("rx",i),o("ry",a);case"image":o("width",i),o("height",a);case"text":o("x",i),o("y",a);break;case"circle":o("cx",i),o("cy",a),o("r",i);break;case"ellipse":o("cx",i),o("cy",a),o("rx",i),o("ry",a);break;case"line":o("x1",i),o("x2",i),o("y1",a),o("y2",a);break;case"marker":o("refX",i),o("markerWidth",i),o("refY",a),o("markerHeight",a);break;case"radialGradient":o("fx",i),o("fy",a);break;case"tspan":o("dx",i),o("dy",a);break;default:o(t,i)}return s.removeChild(u),c}function y(e){i(e,"array")||(e=Array.prototype.slice.call(arguments,0));for(var t=0,n=0,r=this.node;this[t];)delete this[t++];for(t=0;t<e.length;t++)"set"==e[t].type?e[t].forEach(function(e){r.appendChild(e.node)}):r.appendChild(e[t].node);var a=r.childNodes;for(t=0;t<a.length;t++)this[n++]=w(a[t]);return this}function v(e){if(e.snap in q)return q[e.snap];var t;try{t=e.ownerSVGElement}catch(n){}this.node=e,t&&(this.paper=new E(t)),this.type=e.tagName;var r=this.id=W(this);if(this.anims={},this._={transform:[]},e.snap=r,q[r]=this,"g"==this.type&&(this.add=y),this.type in{g:1,mask:1,pattern:1,symbol:1})for(var i in E.prototype)E.prototype[S](i)&&(this[i]=E.prototype[i])}function x(e){this.node=e}function b(e,t){var n=r(e);t.appendChild(n);var i=w(n);return i}function E(e,t){var n,i,a,o=E.prototype;if(e&&"svg"==e.tagName){if(e.snap in q)return q[e.snap];var s=e.ownerDocument;n=new v(e),i=e.getElementsByTagName("desc")[0],a=e.getElementsByTagName("defs")[0],i||(i=r("desc"),i.appendChild(s.createTextNode("Created with Snap")),n.node.appendChild(i)),a||(a=r("defs"),n.node.appendChild(a)),n.defs=a;for(var c in o)o[S](c)&&(n[c]=o[c]);n.paper=n.root=n}else n=b("svg",A.doc.body),r(n.node,{height:t,version:1.1,width:e,xmlns:$});return n}function w(e){return e?e instanceof v||e instanceof x?e:e.tagName&&"svg"==e.tagName.toLowerCase()?new E(e):e.tagName&&"object"==e.tagName.toLowerCase()&&"image/svg+xml"==e.type?new E(e.contentDocument.getElementsByTagName("svg")[0]):new v(e):e}n.version="0.3.0",n.toString=function(){return"Snap v"+this.version},n._={};var A={win:e.window,doc:e.window.document};n._.glob=A;var S="hasOwnProperty",_=String,T=parseFloat,C=parseInt,R=Math,N=R.max,M=R.min,D=R.abs,k=(R.pow,R.PI),P=(R.round,""),O=Object.prototype.toString,B=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,I=(n._.separator=/[,\s]+/,/[\s]*,[\s]*/),L={hs:1,rg:1},F=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,j=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,V=/(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/gi,G=0,U="S"+(+new Date).toString(36),W=function(e){return(e&&e.type?e.type:P)+U+(G++).toString(36)},z="http://www.w3.org/1999/xlink",$="http://www.w3.org/2000/svg",q={};n.url=function(e){return"url('#"+e+"')"};n._.$=r,n._.id=W,n.format=function(){var e=/\{([^\}]+)\}/g,t=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(e,n,r){var i=r;return n.replace(t,function(e,t,n,r,a){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==r?e:i)+""};return function(t,r){return _(t).replace(e,function(e,t){return n(e,t,r)})}}(),n._.clone=a,n._.cacher=s,n.rad=u,n.deg=l,n.angle=c,n.is=i,n.snapTo=function(e,t,n){if(n=i(n,"finite")?n:10,i(e,"array")){for(var r=e.length;r--;)if(D(e[r]-t)<=n)return e[r]}else{e=+e;var a=t%e;if(n>a)return t-a;if(a>e-n)return t-a+e}return t},n.getRGB=s(function(e){if(!e||(e=_(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:X};if(!(L[S](e.toLowerCase().substring(0,2))||"#"==e.charAt())&&(e=H(e)),!e)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X};var t,r,a,o,s,c,u=e.match(B);return u?(u[2]&&(a=C(u[2].substring(5),16),r=C(u[2].substring(3,5),16),t=C(u[2].substring(1,3),16)),u[3]&&(a=C((s=u[3].charAt(3))+s,16),r=C((s=u[3].charAt(2))+s,16),t=C((s=u[3].charAt(1))+s,16)),u[4]&&(c=u[4].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t*=2.55),r=T(c[1]),"%"==c[1].slice(-1)&&(r*=2.55),a=T(c[2]),"%"==c[2].slice(-1)&&(a*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(o=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(o/=100)),u[5]?(c=u[5].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t/=100),r=T(c[1]),"%"==c[1].slice(-1)&&(r/=100),a=T(c[2]),"%"==c[2].slice(-1)&&(a/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(t/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(o=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(o/=100),n.hsb2rgb(t,r,a,o)):u[6]?(c=u[6].split(I),t=T(c[0]),"%"==c[0].slice(-1)&&(t/=100),r=T(c[1]),"%"==c[1].slice(-1)&&(r/=100),a=T(c[2]),"%"==c[2].slice(-1)&&(a/=100),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(t/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(o=T(c[3])),c[3]&&"%"==c[3].slice(-1)&&(o/=100),n.hsl2rgb(t,r,a,o)):(t=M(R.round(t),255),r=M(R.round(r),255),a=M(R.round(a),255),o=M(N(o,0),1),u={r:t,g:r,b:a,toString:X},u.hex="#"+(16777216|a|r<<8|t<<16).toString(16).slice(1),u.opacity=i(o,"finite")?o:1,u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:X}},n),n.hsb=s(function(e,t,r){return n.hsb2rgb(e,t,r).hex}),n.hsl=s(function(e,t,r){return n.hsl2rgb(e,t,r).hex}),n.rgb=s(function(e,t,n,r){if(i(r,"finite")){var a=R.round;return"rgba("+[a(e),a(t),a(n),+r.toFixed(2)]+")"}return"#"+(16777216|n|t<<8|e<<16).toString(16).slice(1)});var H=function(e){var t=A.doc.getElementsByTagName("head")[0]||A.doc.getElementsByTagName("svg")[0],n="rgb(255, 0, 0)";return(H=s(function(e){if("red"==e.toLowerCase())return n;t.style.color=n,t.style.color=e;var r=A.doc.defaultView.getComputedStyle(t,P).getPropertyValue("color");return r==n?null:r}))(e)},Y=function(){return"hsb("+[this.h,this.s,this.b]+")"},K=function(){return"hsl("+[this.h,this.s,this.l]+")"},X=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},Q=function(e,t,r){if(null==t&&i(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(r=e.b,
+t=e.g,e=e.r),null==t&&i(e,string)){var a=n.getRGB(e);e=a.r,t=a.g,r=a.b}return(e>1||t>1||r>1)&&(e/=255,t/=255,r/=255),[e,t,r]},Z=function(e,t,r,a){e=R.round(255*e),t=R.round(255*t),r=R.round(255*r);var o={r:e,g:t,b:r,opacity:i(a,"finite")?a:1,hex:n.rgb(e,t,r),toString:X};return i(a,"finite")&&(o.opacity=a),o};n.color=function(e){var t;return i(e,"object")&&"h"in e&&"s"in e&&"b"in e?(t=n.hsb2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.opacity=1,e.hex=t.hex):i(e,"object")&&"h"in e&&"s"in e&&"l"in e?(t=n.hsl2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.opacity=1,e.hex=t.hex):(i(e,"string")&&(e=n.getRGB(e)),i(e,"object")&&"r"in e&&"g"in e&&"b"in e&&!("error"in e)?(t=n.rgb2hsl(e),e.h=t.h,e.s=t.s,e.l=t.l,t=n.rgb2hsb(e),e.v=t.b):(e={hex:"none"},e.r=e.g=e.b=e.h=e.s=e.v=e.l=-1,e.error=1)),e.toString=X,e},n.hsb2rgb=function(e,t,n,r){i(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(n=e.b,t=e.s,e=e.h,r=e.o),e*=360;var a,o,s,c,u;return e=e%360/60,u=n*t,c=u*(1-D(e%2-1)),a=o=s=n-u,e=~~e,a+=[u,c,0,0,c,u][e],o+=[c,u,u,c,0,0][e],s+=[0,0,c,u,u,c][e],Z(a,o,s,r)},n.hsl2rgb=function(e,t,n,r){i(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(n=e.l,t=e.s,e=e.h),(e>1||t>1||n>1)&&(e/=360,t/=100,n/=100),e*=360;var a,o,s,c,u;return e=e%360/60,u=2*t*(.5>n?n:1-n),c=u*(1-D(e%2-1)),a=o=s=n-u/2,e=~~e,a+=[u,c,0,0,c,u][e],o+=[c,u,u,c,0,0][e],s+=[0,0,c,u,u,c][e],Z(a,o,s,r)},n.rgb2hsb=function(e,t,n){n=Q(e,t,n),e=n[0],t=n[1],n=n[2];var r,i,a,o;return a=N(e,t,n),o=a-M(e,t,n),r=0==o?null:a==e?(t-n)/o:a==t?(n-e)/o+2:(e-t)/o+4,r=(r+360)%6*60/360,i=0==o?0:o/a,{h:r,s:i,b:a,toString:Y}},n.rgb2hsl=function(e,t,n){n=Q(e,t,n),e=n[0],t=n[1],n=n[2];var r,i,a,o,s,c;return o=N(e,t,n),s=M(e,t,n),c=o-s,r=0==c?null:o==e?(t-n)/c:o==t?(n-e)/c+2:(e-t)/c+4,r=(r+360)%6*60/360,a=(o+s)/2,i=0==c?0:.5>a?c/(2*a):c/(2-2*a),{h:r,s:i,l:a,toString:K}},n.parsePathString=function(e){if(!e)return null;var t=n.path(e);if(t.arr)return n.path.clone(t.arr);var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return i(e,"array")&&i(e[0],"array")&&(a=n.path.clone(e)),a.length||_(e).replace(F,function(e,t,n){var i=[],o=t.toLowerCase();if(n.replace(V,function(e,t){t&&i.push(+t)}),"m"==o&&i.length>2&&(a.push([t].concat(i.splice(0,2))),o="l",t="m"==t?"l":"L"),"o"==o&&1==i.length&&a.push([t,i[0]]),"r"==o)a.push([t].concat(i));else for(;i.length>=r[o]&&(a.push([t].concat(i.splice(0,r[o]))),r[o]););}),a.toString=n.path.toString,t.arr=n.path.clone(a),a};var J=n.parseTransformString=function(e){if(!e)return null;var t=[];return i(e,"array")&&i(e[0],"array")&&(t=n.path.clone(e)),t.length||_(e).replace(j,function(e,n,r){var i=[];n.toLowerCase();r.replace(V,function(e,t){t&&i.push(+t)}),t.push([n].concat(i))}),t.toString=n.path.toString,t};n._.svgTransform2string=p,n._.rgTransform=/^[a-z][\s]*-?\.?\d/i,n._.transform2matrix=f,n._unit2px=m;A.doc.contains||A.doc.compareDocumentPosition?function(e,t){var n=9==e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e==r||!(!r||1!=r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t;)if(t=t.parentNode,t==e)return!0;return!1};n._.getSomeDefs=h,n._.getSomeSVG=d,n.select=function(e){return e=_(e).replace(/([^\\]):/g,"$1\\:"),w(A.doc.querySelector(e))},n.selectAll=function(e){for(var t=A.doc.querySelectorAll(e),r=(n.set||Array)(),i=0;i<t.length;i++)r.push(w(t[i]));return r},setInterval(function(){for(var e in q)if(q[S](e)){var t=q[e],n=t.node;("svg"!=t.type&&!n.ownerSVGElement||"svg"==t.type&&(!n.parentNode||"ownerSVGElement"in n.parentNode&&!n.ownerSVGElement))&&delete q[e]}},1e4),v.prototype.attr=function(e,n){var r=this;r.node;if(!e)return r;if(i(e,"string")){if(!(arguments.length>1))return t("snap.util.getattr."+e,r).firstDefined();var a={};a[e]=n,e=a}for(var o in e)e[S](o)&&t("snap.util.attr."+o,r,e[o]);return r},n.parse=function(e){var t=A.doc.createDocumentFragment(),n=!0,r=A.doc.createElement("div");if(e=_(e),e.match(/^\s*<\s*svg(?:\s|>)/)||(e="<svg>"+e+"</svg>",n=!1),r.innerHTML=e,e=r.getElementsByTagName("svg")[0])if(n)t=e;else{for(;e.firstChild;)t.appendChild(e.firstChild);r.innerHTML=P}return new x(t)},n.fragment=function(){for(var e=Array.prototype.slice.call(arguments,0),t=A.doc.createDocumentFragment(),r=0,i=e.length;i>r;r++){var a=e[r];a.node&&a.node.nodeType&&t.appendChild(a.node),a.nodeType&&t.appendChild(a),"string"==typeof a&&t.appendChild(n.parse(a).node)}return new x(t)},n._.make=b,n._.wrap=w,E.prototype.el=function(e,t){var n=b(e,this.node);return t&&n.attr(t),n},t.on("snap.util.getattr",function(){var e=t.nt();e=e.substring(e.lastIndexOf(".")+1);var n=e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});return ee[S](n)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(n):r(this.node,e)});var ee={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};t.on("snap.util.attr",function(e){var n=t.nt(),i={};n=n.substring(n.lastIndexOf(".")+1),i[n]=e;var a=n.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()}),o=n.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});ee[S](o)?this.node.style[a]=null==e?P:e:r(this.node,i)}),function(e){}(E.prototype),n.ajax=function(e,n,r,a){var o=new XMLHttpRequest,s=W();if(o){if(i(n,"function"))a=r,r=n,n=null;else if(i(n,"object")){var c=[];for(var u in n)n.hasOwnProperty(u)&&c.push(encodeURIComponent(u)+"="+encodeURIComponent(n[u]));n=c.join("&")}return o.open(n?"POST":"GET",e,!0),n&&(o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded")),r&&(t.once("snap.ajax."+s+".0",r),t.once("snap.ajax."+s+".200",r),t.once("snap.ajax."+s+".304",r)),o.onreadystatechange=function(){4==o.readyState&&t("snap.ajax."+s+"."+o.status,a,o)},4==o.readyState?o:(o.send(n),o)}},n.load=function(e,t,r){n.ajax(e,function(e){var i=n.parse(e.responseText);r?t.call(r,i):t(i)})};var te=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.body,i=n.documentElement,a=i.clientTop||r.clientTop||0,o=i.clientLeft||r.clientLeft||0,s=t.top+(g.win.pageYOffset||i.scrollTop||r.scrollTop)-a,c=t.left+(g.win.pageXOffset||i.scrollLeft||r.scrollLeft)-o;return{y:s,x:c}};return n.getElementByPoint=function(e,t){var n=this,r=(n.canvas,A.doc.elementFromPoint(e,t));if(A.win.opera&&"svg"==r.tagName){var i=te(r),a=r.createSVGRect();a.x=e-i.x,a.y=t-i.y,a.width=a.height=1;var o=r.getIntersectionList(a,null);o.length&&(r=o[o.length-1])}return r?w(r):null},n.plugin=function(e){e(n,v,E,A,x)},A.win.Snap=n,n}(e||this);return r.plugin(function(r,i,a,o,s){function c(e,t){if(null==t){var n=!0;if(t="linearGradient"==e.type||"radialGradient"==e.type?e.node.getAttribute("gradientTransform"):"pattern"==e.type?e.node.getAttribute("patternTransform"):e.node.getAttribute("transform"),!t)return new r.Matrix;t=r._.svgTransform2string(t)}else t=r._.rgTransform.test(t)?d(t).replace(/\.{3}|\u2026/g,e._.transform||E):r._.svgTransform2string(t),h(t,"array")&&(t=r.path?r.path.toString.call(t):d(t)),e._.transform=t;var i=r._.transform2matrix(t,e.getBBox(1));return n?i:void(e.matrix=i)}function u(e){function t(e,t){var n=y(e.node,t);n=n&&n.match(a),n=n&&n[2],n&&"#"==n.charAt()&&(n=n.substring(1),n&&(s[n]=(s[n]||[]).concat(function(n){var r={};r[t]=URL(n),y(e.node,r)})))}function n(e){var t=y(e.node,"xlink:href");t&&"#"==t.charAt()&&(t=t.substring(1),t&&(s[t]=(s[t]||[]).concat(function(t){e.attr("xlink:href","#"+t)})))}for(var r,i=e.selectAll("*"),a=/^\s*url\(("|'|)(.*)\1\)\s*$/,o=[],s={},c=0,u=i.length;u>c;c++){r=i[c],t(r,"fill"),t(r,"stroke"),t(r,"filter"),t(r,"mask"),t(r,"clip-path"),n(r);var l=y(r.node,"id");l&&(y(r.node,{id:r.id}),o.push({old:l,id:r.id}))}for(c=0,u=o.length;u>c;c++){var p=s[o[c].old];if(p)for(var f=0,h=p.length;h>f;f++)p[f](o[c].id)}}function l(e,t,n){return function(r){var i=r.slice(e,t);return 1==i.length&&(i=i[0]),n?n(i):i}}function p(e){return function(){var t=e?"<"+this.type:"",n=this.node.attributes,r=this.node.childNodes;if(e)for(var i=0,a=n.length;a>i;i++)t+=" "+n[i].name+'="'+n[i].value.replace(/"/g,'\\"')+'"';if(r.length){for(e&&(t+=">"),i=0,a=r.length;a>i;i++)3==r[i].nodeType?t+=r[i].nodeValue:1==r[i].nodeType&&(t+=b(r[i]).toString());e&&(t+="</"+this.type+">")}else e&&(t+="/>");return t}}var f=i.prototype,h=r.is,d=String,m=r._unit2px,y=r._.$,g=r._.make,v=r._.getSomeDefs,x="hasOwnProperty",b=r._.wrap;f.getBBox=function(e){if(!r.Matrix||!r.path)return this.node.getBBox();var t=this,n=new r.Matrix;if(t.removed)return r._.box();for(;"use"==t.type;)if(e||(n=n.add(t.transform().localMatrix.translate(t.attr("x")||0,t.attr("y")||0))),t.original)t=t.original;else{var i=t.attr("xlink:href");t=t.original=t.node.ownerDocument.getElementById(i.substring(i.indexOf("#")+1))}var a=t._,o=r.path.get[t.type]||r.path.get.deflt;try{return e?(a.bboxwt=o?r.path.getBBox(t.realPath=o(t)):r._.box(t.node.getBBox()),r._.box(a.bboxwt)):(t.realPath=o(t),t.matrix=t.transform().localMatrix,a.bbox=r.path.getBBox(r.path.map(t.realPath,n.add(t.matrix))),r._.box(a.bbox))}catch(s){return r._.box()}};var w=function(){return this.string};f.transform=function(e){var t=this._;if(null==e){for(var n,i=this,a=new r.Matrix(this.node.getCTM()),o=c(this),s=[o],u=new r.Matrix,l=o.toTransformString(),p=d(o)==d(this.matrix)?d(t.transform):l;"svg"!=i.type&&(i=i.parent());)s.push(c(i));for(n=s.length;n--;)u.add(s[n]);return{string:p,globalMatrix:a,totalMatrix:u,localMatrix:o,diffMatrix:a.clone().add(o.invert()),global:a.toTransformString(),total:u.toTransformString(),local:l,toString:w}}return e instanceof r.Matrix?(this.matrix=e,this._.transform=e.toTransformString()):c(this,e),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?y(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?y(this.node,{patternTransform:this.matrix}):y(this.node,{transform:this.matrix})),this},f.parent=function(){return b(this.node.parentNode)},f.append=f.add=function(e){if(e){if("set"==e.type){var t=this;return e.forEach(function(e){t.add(e)}),this}e=b(e),this.node.appendChild(e.node),e.paper=this.paper}return this},f.appendTo=function(e){return e&&(e=b(e),e.append(this)),this},f.prepend=function(e){if(e){if("set"==e.type){var t,n=this;return e.forEach(function(e){t?t.after(e):n.prepend(e),t=e}),this}e=b(e);var r=e.parent();this.node.insertBefore(e.node,this.node.firstChild),this.add&&this.add(),e.paper=this.paper,this.parent()&&this.parent().add(),r&&r.add()}return this},f.prependTo=function(e){return e=b(e),e.prepend(this),this},f.before=function(e){if("set"==e.type){var t=this;return e.forEach(function(e){var n=e.parent();t.node.parentNode.insertBefore(e.node,t.node),n&&n.add()}),this.parent().add(),this}e=b(e);var n=e.parent();return this.node.parentNode.insertBefore(e.node,this.node),this.parent()&&this.parent().add(),n&&n.add(),e.paper=this.paper,this},f.after=function(e){e=b(e);var t=e.parent();return this.node.nextSibling?this.node.parentNode.insertBefore(e.node,this.node.nextSibling):this.node.parentNode.appendChild(e.node),this.parent()&&this.parent().add(),t&&t.add(),e.paper=this.paper,this},f.insertBefore=function(e){e=b(e);var t=this.parent();return e.node.parentNode.insertBefore(this.node,e.node),this.paper=e.paper,t&&t.add(),e.parent()&&e.parent().add(),this},f.insertAfter=function(e){e=b(e);var t=this.parent();return e.node.parentNode.insertBefore(this.node,e.node.nextSibling),this.paper=e.paper,t&&t.add(),e.parent()&&e.parent().add(),this},f.remove=function(){var e=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,e&&e.add(),this},f.select=function(e){return e=d(e).replace(/([^\\]):/g,"$1\\:"),b(this.node.querySelector(e))},f.selectAll=function(e){for(var t=this.node.querySelectorAll(e),n=(r.set||Array)(),i=0;i<t.length;i++)n.push(b(t[i]));return n},f.asPX=function(e,t){return null==t&&(t=this.attr(e)),+m(this,e,t)},f.use=function(){var e,t=this.node.id;return t||(t=this.id,y(this.node,{id:t})),e="linearGradient"==this.type||"radialGradient"==this.type||"pattern"==this.type?g(this.type,this.node.parentNode):g("use",this.node.parentNode),y(e.node,{"xlink:href":"#"+t}),e.original=this,e},f.clone=function(){var e=b(this.node.cloneNode(!0));return y(e.node,"id")&&y(e.node,{id:e.id}),u(e),e.insertAfter(this),e},f.toDefs=function(){var e=v(this);return e.appendChild(this.node),this},f.pattern=f.toPattern=function(e,t,n,r){var i=g("pattern",v(this));return null==e&&(e=this.getBBox()),h(e,"object")&&"x"in e&&(t=e.y,n=e.width,r=e.height,e=e.x),y(i.node,{x:e,y:t,width:n,height:r,patternUnits:"userSpaceOnUse",id:i.id,viewBox:[e,t,n,r].join(" ")}),i.node.appendChild(this.node),i},f.marker=function(e,t,n,r,i,a){var o=g("marker",v(this));return null==e&&(e=this.getBBox()),h(e,"object")&&"x"in e&&(t=e.y,n=e.width,r=e.height,i=e.refX||e.cx,a=e.refY||e.cy,e=e.x),y(o.node,{viewBox:[e,t,n,r].join(" "),markerWidth:n,markerHeight:r,orient:"auto",refX:i||0,refY:a||0,id:o.id}),o.node.appendChild(this.node),o};var A=function(e,t,r,i){"function"!=typeof r||r.length||(i=r,r=n.linear),this.attr=e,this.dur=t,r&&(this.easing=r),i&&(this.callback=i)};r._.Animation=A,r.animation=function(e,t,n,r){return new A(e,t,n,r)},f.inAnim=function(){var e=this,t=[];for(var n in e.anims)e.anims[x](n)&&!function(e){t.push({anim:new A(e._attrs,e.dur,e.easing,e._callback),mina:e,curStatus:e.status(),status:function(t){return e.status(t)},stop:function(){e.stop()}})}(e.anims[n]);return t},r.animate=function(e,r,i,a,o,s){"function"!=typeof o||o.length||(s=o,o=n.linear);var c=n.time(),u=n(e,r,c,c+a,n.time,i,o);return s&&t.once("mina.finish."+u.id,s),u},f.stop=function(){for(var e=this.inAnim(),t=0,n=e.length;n>t;t++)e[t].stop();return this},f.animate=function(e,r,i,a){"function"!=typeof i||i.length||(a=i,i=n.linear),e instanceof A&&(a=e.callback,i=e.easing,r=i.dur,e=e.attr);var o,s,c,u,p=[],f=[],m={},y=this;for(var g in e)if(e[x](g)){y.equal?(u=y.equal(g,d(e[g])),o=u.from,s=u.to,c=u.f):(o=+y.attr(g),s=+e[g]);var v=h(o,"array")?o.length:1;m[g]=l(p.length,p.length+v,c),p=p.concat(o),f=f.concat(s)}var b=n.time(),E=n(p,f,b,b+r,n.time,function(e){var t={};for(var n in m)m[x](n)&&(t[n]=m[n](e));y.attr(t)},i);return y.anims[E.id]=E,E._attrs=e,E._callback=a,t("snap.animcreated."+y.id,E),t.once("mina.finish."+E.id,function(){delete y.anims[E.id],a&&a.call(y)}),t.once("mina.stop."+E.id,function(){delete y.anims[E.id]}),y};var S={};f.data=function(e,n){var i=S[this.id]=S[this.id]||{};if(0==arguments.length)return t("snap.data.get."+this.id,this,i,null),i;if(1==arguments.length){if(r.is(e,"object")){for(var a in e)e[x](a)&&this.data(a,e[a]);return this}return t("snap.data.get."+this.id,this,i[e],e),i[e]}return i[e]=n,t("snap.data.set."+this.id,this,n,e),this},f.removeData=function(e){return null==e?S[this.id]={}:S[this.id]&&delete S[this.id][e],this},f.outerSVG=f.toString=p(1),f.innerSVG=p(),f.toDataURL=function(){if(e&&e.btoa){var t=this.getBBox(),n=r.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>',{x:+t.x.toFixed(3),y:+t.y.toFixed(3),width:+t.width.toFixed(3),height:+t.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))}},s.prototype.select=f.select,s.prototype.selectAll=f.selectAll}),r.plugin(function(e,t,n,r,i){function a(e,t,n,r,i,a){return null==t&&"[object SVGMatrix]"==o.call(e)?(this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.e=e.e,void(this.f=e.f)):void(null!=e?(this.a=+e,this.b=+t,this.c=+n,this.d=+r,this.e=+i,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var o=Object.prototype.toString,s=String,c=Math,u="";!function(t){function n(e){return e[0]*e[0]+e[1]*e[1]}function r(e){var t=c.sqrt(n(e));e[0]&&(e[0]/=t),e[1]&&(e[1]/=t)}t.add=function(e,t,n,r,i,o){var s,c,u,l,p=[[],[],[]],f=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],h=[[e,n,i],[t,r,o],[0,0,1]];for(e&&e instanceof a&&(h=[[e.a,e.c,e.e],[e.b,e.d,e.f],[0,0,1]]),s=0;3>s;s++)for(c=0;3>c;c++){for(l=0,u=0;3>u;u++)l+=f[s][u]*h[u][c];p[s][c]=l}return this.a=p[0][0],this.b=p[1][0],this.c=p[0][1],this.d=p[1][1],this.e=p[0][2],this.f=p[1][2],this},t.invert=function(){var e=this,t=e.a*e.d-e.b*e.c;return new a(e.d/t,-e.b/t,-e.c/t,e.a/t,(e.c*e.f-e.d*e.e)/t,(e.b*e.e-e.a*e.f)/t)},t.clone=function(){return new a(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(e,t){return this.add(1,0,0,1,e,t)},t.scale=function(e,t,n,r){return null==t&&(t=e),(n||r)&&this.add(1,0,0,1,n,r),this.add(e,0,0,t,0,0),(n||r)&&this.add(1,0,0,1,-n,-r),this},t.rotate=function(t,n,r){t=e.rad(t),n=n||0,r=r||0;var i=+c.cos(t).toFixed(9),a=+c.sin(t).toFixed(9);return this.add(i,a,-a,i,n,r),this.add(1,0,0,1,-n,-r)},t.x=function(e,t){return e*this.a+t*this.c+this.e},t.y=function(e,t){return e*this.b+t*this.d+this.f},t.get=function(e){return+this[s.fromCharCode(97+e)].toFixed(4)},t.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.determinant=function(){return this.a*this.d-this.b*this.c},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=c.sqrt(n(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=c.sqrt(n(i[1])),r(i[1]),t.shear/=t.scaley,this.determinant()<0&&(t.scalex=-t.scalex);var a=-i[0][1],o=i[1][1];return 0>o?(t.rotate=e.deg(c.acos(o)),0>a&&(t.rotate=360-t.rotate)):t.rotate=e.deg(c.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(e){var t=e||this.split();return+t.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[+t.dx.toFixed(4),+t.dy.toFixed(4)]:u)+(1!=t.scalex||1!=t.scaley?"s"+[t.scalex,t.scaley,0,0]:u)+(t.rotate?"r"+[+t.rotate.toFixed(4),0,0]:u))}}(a.prototype),e.Matrix=a,e.matrix=function(e,t,n,r,i,o){return new a(e,t,n,r,i,o)}}),r.plugin(function(e,n,r,i,a){function o(r){return function(i){if(t.stop(),i instanceof a&&1==i.node.childNodes.length&&("radialGradient"==i.node.firstChild.tagName||"linearGradient"==i.node.firstChild.tagName||"pattern"==i.node.firstChild.tagName)&&(i=i.node.firstChild,h(this).appendChild(i),i=p(i)),i instanceof n)if("radialGradient"==i.type||"linearGradient"==i.type||"pattern"==i.type){i.node.id||m(i.node,{id:i.id});var o=y(i.node.id)}else o=i.attr(r);else if(o=e.color(i),o.error){var s=e(h(this).ownerSVGElement).gradient(i);s?(s.node.id||m(s.node,{id:s.id}),o=y(s.node.id)):o=i}else o=g(o);var c={};c[r]=o,m(this.node,c),this.node.style[r]=x}}function s(e){t.stop(),e==+e&&(e+="px"),this.node.style.fontSize=e}function c(e){for(var t=[],n=e.childNodes,r=0,i=n.length;i>r;r++){var a=n[r];3==a.nodeType&&t.push(a.nodeValue),"tspan"==a.tagName&&(1==a.childNodes.length&&3==a.firstChild.nodeType?t.push(a.firstChild.nodeValue):t.push(c(a)))}return t}function u(){return t.stop(),this.node.style.fontSize}var l=e._.make,p=e._.wrap,f=e.is,h=e._.getSomeDefs,d=/^url\(#?([^)]+)\)$/,m=e._.$,y=e.url,g=String,v=e._.separator,x="";t.on("snap.util.attr.mask",function(e){if(e instanceof n||e instanceof a){if(t.stop(),e instanceof a&&1==e.node.childNodes.length&&(e=e.node.firstChild,h(this).appendChild(e),e=p(e)),"mask"==e.type)var r=e;else r=l("mask",h(this)),r.node.appendChild(e.node);!r.node.id&&m(r.node,{id:r.id}),m(this.node,{mask:y(r.id)})}}),function(e){t.on("snap.util.attr.clip",e),t.on("snap.util.attr.clip-path",e),t.on("snap.util.attr.clipPath",e)}(function(e){if(e instanceof n||e instanceof a){if(t.stop(),"clipPath"==e.type)var r=e;else r=l("clipPath",h(this)),r.node.appendChild(e.node),!r.node.id&&m(r.node,{id:r.id});m(this.node,{"clip-path":y(r.node.id||r.id)})}}),t.on("snap.util.attr.fill",o("fill")),t.on("snap.util.attr.stroke",o("stroke"));var b=/^([lr])(?:\(([^)]*)\))?(.*)$/i;t.on("snap.util.grad.parse",function(e){e=g(e);var t=e.match(b);if(!t)return null;var n=t[1],r=t[2],i=t[3];return r=r.split(/\s*,\s*/).map(function(e){return+e==e?+e:e}),1==r.length&&0==r[0]&&(r=[]),i=i.split("-"),i=i.map(function(e){e=e.split(":");var t={color:e[0]};return e[1]&&(t.offset=parseFloat(e[1])),t}),{type:n,params:r,stops:i}}),t.on("snap.util.attr.d",function(n){t.stop(),f(n,"array")&&f(n[0],"array")&&(n=e.path.toString.call(n)),n=g(n),n.match(/[ruo]/i)&&(n=e.path.toAbsolute(n)),m(this.node,{d:n})})(-1),t.on("snap.util.attr.#text",function(e){t.stop(),e=g(e);for(var n=i.doc.createTextNode(e);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(n)})(-1),t.on("snap.util.attr.path",function(e){t.stop(),this.attr({d:e})})(-1),t.on("snap.util.attr.class",function(e){t.stop(),this.node.className.baseVal=e})(-1),t.on("snap.util.attr.viewBox",function(e){var n;n=f(e,"object")&&"x"in e?[e.x,e.y,e.width,e.height].join(" "):f(e,"array")?e.join(" "):e,m(this.node,{viewBox:n}),t.stop()})(-1),t.on("snap.util.attr.transform",function(e){this.transform(e),t.stop()})(-1),t.on("snap.util.attr.r",function(e){"rect"==this.type&&(t.stop(),m(this.node,{rx:e,ry:e}))})(-1),t.on("snap.util.attr.textpath",function(e){if(t.stop(),"text"==this.type){var r,i,a;if(!e&&this.textPath){for(i=this.textPath;i.node.firstChild;)this.node.appendChild(i.node.firstChild);return i.remove(),void delete this.textPath}if(f(e,"string")){var o=h(this),s=p(o.parentNode).path(e);o.appendChild(s.node),r=s.id,s.attr({id:r})}else e=p(e),e instanceof n&&(r=e.attr("id"),r||(r=e.id,e.attr({id:r})));if(r)if(i=this.textPath,a=this.node,i)i.attr({"xlink:href":"#"+r});else{for(i=m("textPath",{"xlink:href":"#"+r});a.firstChild;)i.appendChild(a.firstChild);a.appendChild(i),this.textPath=p(i)}}})(-1),t.on("snap.util.attr.text",function(e){if("text"==this.type){for(var n=this.node,r=function(e){var t=m("tspan");if(f(e,"array"))for(var n=0;n<e.length;n++)t.appendChild(r(e[n]));else t.appendChild(i.doc.createTextNode(e));return t.normalize&&t.normalize(),t};n.firstChild;)n.removeChild(n.firstChild);for(var a=r(e);a.firstChild;)n.appendChild(a.firstChild)}t.stop()})(-1),t.on("snap.util.attr.fontSize",s)(-1),t.on("snap.util.attr.font-size",s)(-1),t.on("snap.util.getattr.transform",function(){return t.stop(),this.transform()})(-1),t.on("snap.util.getattr.textpath",function(){return t.stop(),this.textPath})(-1),function(){function n(n){return function(){t.stop();var r=i.doc.defaultView.getComputedStyle(this.node,null).getPropertyValue("marker-"+n);return"none"==r?r:e(i.doc.getElementById(r.match(d)[1]))}}function r(e){return function(n){t.stop();var r="marker"+e.charAt(0).toUpperCase()+e.substring(1);if(""==n||!n)return void(this.node.style[r]="none");if("marker"==n.type){var i=n.node.id;return i||m(n.node,{id:n.id}),void(this.node.style[r]=y(i))}}}t.on("snap.util.getattr.marker-end",n("end"))(-1),t.on("snap.util.getattr.markerEnd",n("end"))(-1),t.on("snap.util.getattr.marker-start",n("start"))(-1),t.on("snap.util.getattr.markerStart",n("start"))(-1),t.on("snap.util.getattr.marker-mid",n("mid"))(-1),t.on("snap.util.getattr.markerMid",n("mid"))(-1),t.on("snap.util.attr.marker-end",r("end"))(-1),t.on("snap.util.attr.markerEnd",r("end"))(-1),t.on("snap.util.attr.marker-start",r("start"))(-1),t.on("snap.util.attr.markerStart",r("start"))(-1),t.on("snap.util.attr.marker-mid",r("mid"))(-1),t.on("snap.util.attr.markerMid",r("mid"))(-1)}(),t.on("snap.util.getattr.r",function(){return"rect"==this.type&&m(this.node,"rx")==m(this.node,"ry")?(t.stop(),m(this.node,"rx")):void 0})(-1),t.on("snap.util.getattr.text",function(){if("text"==this.type||"tspan"==this.type){t.stop();var e=c(this.node);return 1==e.length?e[0]:e}})(-1),t.on("snap.util.getattr.#text",function(){return this.node.textContent})(-1),t.on("snap.util.getattr.viewBox",function(){t.stop();var n=m(this.node,"viewBox");return n?(n=n.split(v),e._.box(+n[0],+n[1],+n[2],+n[3])):void 0})(-1),t.on("snap.util.getattr.points",function(){var e=m(this.node,"points");return t.stop(),e?e.split(v):void 0})(-1),t.on("snap.util.getattr.path",function(){var e=m(this.node,"d");return t.stop(),e})(-1),t.on("snap.util.getattr.class",function(){return this.node.className.baseVal})(-1),t.on("snap.util.getattr.fontSize",u)(-1),t.on("snap.util.getattr.font-size",u)(-1)}),r.plugin(function(n,r,i,a,o){var s=i.prototype,c=n.is;s.rect=function(e,t,n,r,i,a){var o;return null==a&&(a=i),c(e,"object")&&"[object Object]"==e?o=e:null!=e&&(o={x:e,y:t,width:n,height:r},null!=i&&(o.rx=i,o.ry=a)),this.el("rect",o)},s.circle=function(e,t,n){var r;return c(e,"object")&&"[object Object]"==e?r=e:null!=e&&(r={cx:e,cy:t,r:n}),this.el("circle",r)};var u=function(){function e(){this.parentNode.removeChild(this)}return function(t,n){var r=a.doc.createElement("img"),i=a.doc.body;r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){n.call(r),r.onload=r.onerror=null,i.removeChild(r)},r.onerror=e,i.appendChild(r),r.src=t}}();s.image=function(e,t,r,i,a){var o=this.el("image");if(c(e,"object")&&"src"in e)o.attr(e);else if(null!=e){var s={"xlink:href":e,preserveAspectRatio:"none"};null!=t&&null!=r&&(s.x=t,s.y=r),null!=i&&null!=a?(s.width=i,s.height=a):u(e,function(){n._.$(o.node,{width:this.offsetWidth,height:this.offsetHeight})}),n._.$(o.node,s)}return o},s.ellipse=function(e,t,n,r){var i;return c(e,"object")&&"[object Object]"==e?i=e:null!=e&&(i={cx:e,cy:t,rx:n,ry:r}),this.el("ellipse",i)},s.path=function(e){var t;return c(e,"object")&&!c(e,"array")?t=e:e&&(t={d:e}),this.el("path",t)},s.group=s.g=function(e){var t=this.el("g");return 1==arguments.length&&e&&!e.type?t.attr(e):arguments.length&&t.add(Array.prototype.slice.call(arguments,0)),t},s.svg=function(e,t,n,r,i,a,o,s){var u={};return c(e,"object")&&null==t?u=e:(null!=e&&(u.x=e),null!=t&&(u.y=t),null!=n&&(u.width=n),null!=r&&(u.height=r),null!=i&&null!=a&&null!=o&&null!=s&&(u.viewBox=[i,a,o,s])),this.el("svg",u)},s.mask=function(e){var t=this.el("mask");return 1==arguments.length&&e&&!e.type?t.attr(e):arguments.length&&t.add(Array.prototype.slice.call(arguments,0)),t},s.ptrn=function(e,t,n,r,i,a,o,s){if(c(e,"object"))var u=e;else u={patternUnits:"userSpaceOnUse"},e&&(u.x=e),t&&(u.y=t),null!=n&&(u.width=n),null!=r&&(u.height=r),null!=i&&null!=a&&null!=o&&null!=s&&(u.viewBox=[i,a,o,s]);return this.el("pattern",u)},s.use=function(e){return null!=e?(e instanceof r&&(e.attr("id")||e.attr({id:n._.id(e)}),e=e.attr("id")),"#"==String(e).charAt()&&(e=e.substring(1)),this.el("use",{"xlink:href":"#"+e})):r.prototype.use.call(this)},s.symbol=function(e,t,n,r){var i={};return null!=e&&null!=t&&null!=n&&null!=r&&(i.viewBox=[e,t,n,r]),this.el("symbol",i)},s.text=function(e,t,n){var r={};return c(e,"object")?r=e:null!=e&&(r={x:e,y:t,text:n||""}),this.el("text",r)},s.line=function(e,t,n,r){var i={};return c(e,"object")?i=e:null!=e&&(i={x1:e,x2:n,y1:t,y2:r}),this.el("line",i)},s.polyline=function(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments,0));var t={};return c(e,"object")&&!c(e,"array")?t=e:null!=e&&(t={points:e}),this.el("polyline",t)},s.polygon=function(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments,0));var t={};return c(e,"object")&&!c(e,"array")?t=e:null!=e&&(t={points:e}),this.el("polygon",t)},function(){function r(){return this.selectAll("stop")}function i(e,t){var r=l("stop"),i={offset:+t+"%"};return e=n.color(e),i["stop-color"]=e.hex,e.opacity<1&&(i["stop-opacity"]=e.opacity),l(r,i),this.node.appendChild(r),this}function a(){if("linearGradient"==this.type){var e=l(this.node,"x1")||0,t=l(this.node,"x2")||1,r=l(this.node,"y1")||0,i=l(this.node,"y2")||0;return n._.box(e,r,math.abs(t-e),math.abs(i-r))}var a=this.node.cx||.5,o=this.node.cy||.5,s=this.node.r||0;return n._.box(a-s,o-s,2*s,2*s)}function o(e,n){function r(e,t){for(var n=(t-p)/(e-f),r=f;e>r;r++)o[r].offset=+(+p+n*(r-f)).toFixed(2);f=e,p=t}var i,a=t("snap.util.grad.parse",null,n).firstDefined();if(!a)return null;a.params.unshift(e),i="l"==a.type.toLowerCase()?c.apply(0,a.params):u.apply(0,a.params),a.type!=a.type.toLowerCase()&&l(i.node,{gradientUnits:"userSpaceOnUse"});var o=a.stops,s=o.length,p=0,f=0;s--;for(var h=0;s>h;h++)"offset"in o[h]&&r(h,o[h].offset);for(o[s].offset=o[s].offset||100,r(s,o[s].offset),h=0;s>=h;h++){var d=o[h];i.addStop(d.color,d.offset)}return i}function c(e,t,o,s,c){var u=n._.make("linearGradient",e);return u.stops=r,u.addStop=i,u.getBBox=a,null!=t&&l(u.node,{x1:t,y1:o,x2:s,y2:c}),u}function u(e,t,o,s,c,u){var p=n._.make("radialGradient",e);return p.stops=r,p.addStop=i,p.getBBox=a,null!=t&&l(p.node,{cx:t,cy:o,r:s}),null!=c&&null!=u&&l(p.node,{fx:c,fy:u}),p}var l=n._.$;s.gradient=function(e){return o(this.defs,e)},s.gradientLinear=function(e,t,n,r){return c(this.defs,e,t,n,r)},s.gradientRadial=function(e,t,n,r,i){return u(this.defs,e,t,n,r,i)},s.toString=function(){var e,t=this.node.ownerDocument,r=t.createDocumentFragment(),i=t.createElement("div"),a=this.node.cloneNode(!0);return r.appendChild(i),i.appendChild(a),n._.$(a,{xmlns:"http://www.w3.org/2000/svg"}),e=i.innerHTML,r.removeChild(r.firstChild),e},s.toDataURL=function(){return e&&e.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},s.clear=function(){for(var e,t=this.node.firstChild;t;)e=t.nextSibling,"defs"!=t.tagName?t.parentNode.removeChild(t):s.clear.call({node:t}),t=e}}()}),r.plugin(function(e,t,n,r){function i(e){var t=i.ps=i.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)t[F](n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function a(e,t,n,r){return null==e&&(e=t=n=r=0),null==t&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,w:n,height:r,h:r,x2:e+n,y2:t+r,cx:e+n/2,cy:t+r/2,r1:G.min(n,r)/2,r2:G.max(n,r)/2,r0:G.sqrt(n*n+r*r)/2,path:S(e,t,n,r),vb:[e,t,n,r].join(" ")}}function o(){return this.join(",").replace(j,"$1")}function s(e){var t=L(e);return t.toString=o,t}function c(e,t,n,r,i,a,o,s,c){return null==c?m(e,t,n,r,i,a,o,s):l(e,t,n,r,i,a,o,s,y(e,t,n,r,i,a,o,s,c))}function u(n,r){function i(e){return+(+e).toFixed(3)}return e._.cacher(function(e,a,o){e instanceof t&&(e=e.attr("d")),e=k(e);for(var s,u,p,f,h,d="",m={},y=0,g=0,v=e.length;v>g;g++){if(p=e[g],"M"==p[0])s=+p[1],u=+p[2];else{if(f=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6]),y+f>a){if(r&&!m.start){if(h=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6],a-y),d+=["C"+i(h.start.x),i(h.start.y),i(h.m.x),i(h.m.y),i(h.x),i(h.y)],o)return d;m.start=d,d=["M"+i(h.x),i(h.y)+"C"+i(h.n.x),i(h.n.y),i(h.end.x),i(h.end.y),i(p[5]),i(p[6])].join(),y+=f,s=+p[5],u=+p[6];continue}if(!n&&!r)return h=c(s,u,p[1],p[2],p[3],p[4],p[5],p[6],a-y)}y+=f,s=+p[5],u=+p[6]}d+=p.shift()+p}return m.end=d,h=n?y:r?m:l(s,u,p[0],p[1],p[2],p[3],p[4],p[5],1)},null,e._.clone)}function l(e,t,n,r,i,a,o,s,c){var u=1-c,l=$(u,3),p=$(u,2),f=c*c,h=f*c,d=l*e+3*p*c*n+3*u*c*c*i+h*o,m=l*t+3*p*c*r+3*u*c*c*a+h*s,y=e+2*c*(n-e)+f*(i-2*n+e),g=t+2*c*(r-t)+f*(a-2*r+t),v=n+2*c*(i-n)+f*(o-2*i+n),x=r+2*c*(a-r)+f*(s-2*a+r),b=u*e+c*n,E=u*t+c*r,w=u*i+c*o,A=u*a+c*s,S=90-180*G.atan2(y-v,g-x)/U;
+return{x:d,y:m,m:{x:y,y:g},n:{x:v,y:x},start:{x:b,y:E},end:{x:w,y:A},alpha:S}}function p(t,n,r,i,o,s,c,u){e.is(t,"array")||(t=[t,n,r,i,o,s,c,u]);var l=D.apply(null,t);return a(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)}function f(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function h(e,t){return e=a(e),t=a(t),f(t,e.x,e.y)||f(t,e.x2,e.y)||f(t,e.x,e.y2)||f(t,e.x2,e.y2)||f(e,t.x,t.y)||f(e,t.x2,t.y)||f(e,t.x,t.y2)||f(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function d(e,t,n,r,i){var a=-3*t+9*n-9*r+3*i,o=e*a+6*t-12*n+6*r;return e*o-3*t+3*n}function m(e,t,n,r,i,a,o,s,c){null==c&&(c=1),c=c>1?1:0>c?0:c;for(var u=c/2,l=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;l>m;m++){var y=u*p[m]+u,g=d(y,e,n,i,o),v=d(y,t,r,a,s),x=g*g+v*v;h+=f[m]*G.sqrt(x)}return u*h}function y(e,t,n,r,i,a,o,s,c){if(!(0>c||m(e,t,n,r,i,a,o,s)<c)){var u,l=1,p=l/2,f=l-p,h=.01;for(u=m(e,t,n,r,i,a,o,s,f);q(u-c)>h;)p/=2,f+=(c>u?1:-1)*p,u=m(e,t,n,r,i,a,o,s,f);return f}}function g(e,t,n,r,i,a,o,s){if(!(z(e,n)<W(i,o)||W(e,n)>z(i,o)||z(t,r)<W(a,s)||W(t,r)>z(a,s))){var c=(e*r-t*n)*(i-o)-(e-n)*(i*s-a*o),u=(e*r-t*n)*(a-s)-(t-r)*(i*s-a*o),l=(e-n)*(a-s)-(t-r)*(i-o);if(l){var p=c/l,f=u/l,h=+p.toFixed(2),d=+f.toFixed(2);if(!(h<+W(e,n).toFixed(2)||h>+z(e,n).toFixed(2)||h<+W(i,o).toFixed(2)||h>+z(i,o).toFixed(2)||d<+W(t,r).toFixed(2)||d>+z(t,r).toFixed(2)||d<+W(a,s).toFixed(2)||d>+z(a,s).toFixed(2)))return{x:p,y:f}}}}function v(e,t,n){var r=p(e),i=p(t);if(!h(r,i))return n?0:[];for(var a=m.apply(0,e),o=m.apply(0,t),s=~~(a/8),c=~~(o/8),u=[],f=[],d={},y=n?0:[],v=0;s+1>v;v++){var x=l.apply(0,e.concat(v/s));u.push({x:x.x,y:x.y,t:v/s})}for(v=0;c+1>v;v++)x=l.apply(0,t.concat(v/c)),f.push({x:x.x,y:x.y,t:v/c});for(v=0;s>v;v++)for(var b=0;c>b;b++){var E=u[v],w=u[v+1],A=f[b],S=f[b+1],_=q(w.x-E.x)<.001?"y":"x",T=q(S.x-A.x)<.001?"y":"x",C=g(E.x,E.y,w.x,w.y,A.x,A.y,S.x,S.y);if(C){if(d[C.x.toFixed(4)]==C.y.toFixed(4))continue;d[C.x.toFixed(4)]=C.y.toFixed(4);var R=E.t+q((C[_]-E[_])/(w[_]-E[_]))*(w.t-E.t),N=A.t+q((C[T]-A[T])/(S[T]-A[T]))*(S.t-A.t);R>=0&&1>=R&&N>=0&&1>=N&&(n?y++:y.push({x:C.x,y:C.y,t1:R,t2:N}))}}return y}function x(e,t){return E(e,t)}function b(e,t){return E(e,t,1)}function E(e,t,n){e=k(e),t=k(t);for(var r,i,a,o,s,c,u,l,p,f,h=n?0:[],d=0,m=e.length;m>d;d++){var y=e[d];if("M"==y[0])r=s=y[1],i=c=y[2];else{"C"==y[0]?(p=[r,i].concat(y.slice(1)),r=p[6],i=p[7]):(p=[r,i,r,i,s,c,s,c],r=s,i=c);for(var g=0,x=t.length;x>g;g++){var b=t[g];if("M"==b[0])a=u=b[1],o=l=b[2];else{"C"==b[0]?(f=[a,o].concat(b.slice(1)),a=f[6],o=f[7]):(f=[a,o,a,o,u,l,u,l],a=u,o=l);var E=v(p,f,n);if(n)h+=E;else{for(var w=0,A=E.length;A>w;w++)E[w].segment1=d,E[w].segment2=g,E[w].bez1=p,E[w].bez2=f;h=h.concat(E)}}}}}return h}function w(e,t,n){var r=A(e);return f(r,t,n)&&E(e,[["M",t,n],["H",r.x2+10]],1)%2==1}function A(e){var t=i(e);if(t.bbox)return L(t.bbox);if(!e)return a();e=k(e);for(var n,r=0,o=0,s=[],c=[],u=0,l=e.length;l>u;u++)if(n=e[u],"M"==n[0])r=n[1],o=n[2],s.push(r),c.push(o);else{var p=D(r,o,n[1],n[2],n[3],n[4],n[5],n[6]);s=s.concat(p.min.x,p.max.x),c=c.concat(p.min.y,p.max.y),r=n[5],o=n[6]}var f=W.apply(0,s),h=W.apply(0,c),d=z.apply(0,s),m=z.apply(0,c),y=a(f,h,d-f,m-h);return t.bbox=L(y),y}function S(e,t,n,r,i){if(i)return[["M",+e+ +i,t],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",e,t],["l",n,0],["l",0,r],["l",-n,0],["z"]];return a.toString=o,a}function _(e,t,n,r,i){if(null==i&&null==r&&(r=n),e=+e,t=+t,n=+n,r=+r,null!=i)var a=Math.PI/180,s=e+n*Math.cos(-r*a),c=e+n*Math.cos(-i*a),u=t+n*Math.sin(-r*a),l=t+n*Math.sin(-i*a),p=[["M",s,u],["A",n,n,0,+(i-r>180),0,c,l]];else p=[["M",e,t],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return p.toString=o,p}function T(t){var n=i(t),r=String.prototype.toLowerCase;if(n.rel)return s(n.rel);e.is(t,"array")&&e.is(t&&t[0],"array")||(t=e.parsePathString(t));var a=[],c=0,u=0,l=0,p=0,f=0;"M"==t[0][0]&&(c=t[0][1],u=t[0][2],l=c,p=u,f++,a.push(["M",c,u]));for(var h=f,d=t.length;d>h;h++){var m=a[h]=[],y=t[h];if(y[0]!=r.call(y[0]))switch(m[0]=r.call(y[0]),m[0]){case"a":m[1]=y[1],m[2]=y[2],m[3]=y[3],m[4]=y[4],m[5]=y[5],m[6]=+(y[6]-c).toFixed(3),m[7]=+(y[7]-u).toFixed(3);break;case"v":m[1]=+(y[1]-u).toFixed(3);break;case"m":l=y[1],p=y[2];default:for(var g=1,v=y.length;v>g;g++)m[g]=+(y[g]-(g%2?c:u)).toFixed(3)}else{m=a[h]=[],"m"==y[0]&&(l=y[1]+c,p=y[2]+u);for(var x=0,b=y.length;b>x;x++)a[h][x]=y[x]}var E=a[h].length;switch(a[h][0]){case"z":c=l,u=p;break;case"h":c+=+a[h][E-1];break;case"v":u+=+a[h][E-1];break;default:c+=+a[h][E-2],u+=+a[h][E-1]}}return a.toString=o,n.rel=s(a),a}function C(t){var n=i(t);if(n.abs)return s(n.abs);if(I(t,"array")&&I(t&&t[0],"array")||(t=e.parsePathString(t)),!t||!t.length)return[["M",0,0]];var r,a=[],c=0,u=0,l=0,p=0,f=0;"M"==t[0][0]&&(c=+t[0][1],u=+t[0][2],l=c,p=u,f++,a[0]=["M",c,u]);for(var h,d,m=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),y=f,g=t.length;g>y;y++){if(a.push(h=[]),d=t[y],r=d[0],r!=r.toUpperCase())switch(h[0]=r.toUpperCase(),h[0]){case"A":h[1]=d[1],h[2]=d[2],h[3]=d[3],h[4]=d[4],h[5]=d[5],h[6]=+d[6]+c,h[7]=+d[7]+u;break;case"V":h[1]=+d[1]+u;break;case"H":h[1]=+d[1]+c;break;case"R":for(var v=[c,u].concat(d.slice(1)),x=2,b=v.length;b>x;x++)v[x]=+v[x]+c,v[++x]=+v[x]+u;a.pop(),a=a.concat(O(v,m));break;case"O":a.pop(),v=_(c,u,d[1],d[2]),v.push(v[0]),a=a.concat(v);break;case"U":a.pop(),a=a.concat(_(c,u,d[1],d[2],d[3])),h=["U"].concat(a[a.length-1].slice(-2));break;case"M":l=+d[1]+c,p=+d[2]+u;default:for(x=1,b=d.length;b>x;x++)h[x]=+d[x]+(x%2?c:u)}else if("R"==r)v=[c,u].concat(d.slice(1)),a.pop(),a=a.concat(O(v,m)),h=["R"].concat(d.slice(-2));else if("O"==r)a.pop(),v=_(c,u,d[1],d[2]),v.push(v[0]),a=a.concat(v);else if("U"==r)a.pop(),a=a.concat(_(c,u,d[1],d[2],d[3])),h=["U"].concat(a[a.length-1].slice(-2));else for(var E=0,w=d.length;w>E;E++)h[E]=d[E];if(r=r.toUpperCase(),"O"!=r)switch(h[0]){case"Z":c=+l,u=+p;break;case"H":c=h[1];break;case"V":u=h[1];break;case"M":l=h[h.length-2],p=h[h.length-1];default:c=h[h.length-2],u=h[h.length-1]}}return a.toString=o,n.abs=s(a),a}function R(e,t,n,r){return[e,t,n,r,n,r]}function N(e,t,n,r,i,a){var o=1/3,s=2/3;return[o*e+s*n,o*t+s*r,o*i+s*n,o*a+s*r,i,a]}function M(t,n,r,i,a,o,s,c,u,l){var p,f=120*U/180,h=U/180*(+a||0),d=[],m=e._.cacher(function(e,t,n){var r=e*G.cos(n)-t*G.sin(n),i=e*G.sin(n)+t*G.cos(n);return{x:r,y:i}});if(l)S=l[0],_=l[1],w=l[2],A=l[3];else{p=m(t,n,-h),t=p.x,n=p.y,p=m(c,u,-h),c=p.x,u=p.y;var y=(G.cos(U/180*a),G.sin(U/180*a),(t-c)/2),g=(n-u)/2,v=y*y/(r*r)+g*g/(i*i);v>1&&(v=G.sqrt(v),r=v*r,i=v*i);var x=r*r,b=i*i,E=(o==s?-1:1)*G.sqrt(q((x*b-x*g*g-b*y*y)/(x*g*g+b*y*y))),w=E*r*g/i+(t+c)/2,A=E*-i*y/r+(n+u)/2,S=G.asin(((n-A)/i).toFixed(9)),_=G.asin(((u-A)/i).toFixed(9));S=w>t?U-S:S,_=w>c?U-_:_,0>S&&(S=2*U+S),0>_&&(_=2*U+_),s&&S>_&&(S-=2*U),!s&&_>S&&(_-=2*U)}var T=_-S;if(q(T)>f){var C=_,R=c,N=u;_=S+f*(s&&_>S?1:-1),c=w+r*G.cos(_),u=A+i*G.sin(_),d=M(c,u,r,i,a,0,s,R,N,[_,C,w,A])}T=_-S;var D=G.cos(S),k=G.sin(S),P=G.cos(_),O=G.sin(_),B=G.tan(T/4),I=4/3*r*B,L=4/3*i*B,F=[t,n],j=[t+I*k,n-L*D],V=[c+I*O,u-L*P],W=[c,u];if(j[0]=2*F[0]-j[0],j[1]=2*F[1]-j[1],l)return[j,V,W].concat(d);d=[j,V,W].concat(d).join().split(",");for(var z=[],$=0,H=d.length;H>$;$++)z[$]=$%2?m(d[$-1],d[$],h).y:m(d[$],d[$+1],h).x;return z}function D(e,t,n,r,i,a,o,s){for(var c,u,l,p,f,h,d,m,y=[],g=[[],[]],v=0;2>v;++v)if(0==v?(u=6*e-12*n+6*i,c=-3*e+9*n-9*i+3*o,l=3*n-3*e):(u=6*t-12*r+6*a,c=-3*t+9*r-9*a+3*s,l=3*r-3*t),q(c)<1e-12){if(q(u)<1e-12)continue;p=-l/u,p>0&&1>p&&y.push(p)}else d=u*u-4*l*c,m=G.sqrt(d),0>d||(f=(-u+m)/(2*c),f>0&&1>f&&y.push(f),h=(-u-m)/(2*c),h>0&&1>h&&y.push(h));for(var x,b=y.length,E=b;b--;)p=y[b],x=1-p,g[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*i+p*p*p*o,g[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*a+p*p*p*s;return g[0][E]=e,g[1][E]=t,g[0][E+1]=o,g[1][E+1]=s,g[0].length=g[1].length=E+2,{min:{x:W.apply(0,g[0]),y:W.apply(0,g[1])},max:{x:z.apply(0,g[0]),y:z.apply(0,g[1])}}}function k(e,t){var n=!t&&i(e);if(!t&&n.curve)return s(n.curve);for(var r=C(e),a=t&&C(t),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},c={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u=(function(e,t,n){var r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"].concat(M.apply(0,[t.x,t.y].concat(e.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i].concat(e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"].concat(N(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"].concat(N(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"].concat(R(t.x,t.y,e[1],e[2]));break;case"H":e=["C"].concat(R(t.x,t.y,e[1],t.y));break;case"V":e=["C"].concat(R(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"].concat(R(t.x,t.y,t.X,t.Y))}return e}),l=function(e,t){if(e[t].length>7){e[t].shift();for(var n=e[t];n.length;)f[t]="A",a&&(h[t]="A"),e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),g=z(r.length,a&&a.length||0)}},p=function(e,t,n,i,o){e&&t&&"M"==e[o][0]&&"M"!=t[o][0]&&(t.splice(o,0,["M",i.x,i.y]),n.bx=0,n.by=0,n.x=e[o][1],n.y=e[o][2],g=z(r.length,a&&a.length||0))},f=[],h=[],d="",m="",y=0,g=z(r.length,a&&a.length||0);g>y;y++){r[y]&&(d=r[y][0]),"C"!=d&&(f[y]=d,y&&(m=f[y-1])),r[y]=u(r[y],o,m),"A"!=f[y]&&"C"==d&&(f[y]="C"),l(r,y),a&&(a[y]&&(d=a[y][0]),"C"!=d&&(h[y]=d,y&&(m=h[y-1])),a[y]=u(a[y],c,m),"A"!=h[y]&&"C"==d&&(h[y]="C"),l(a,y)),p(r,a,o,c,y),p(a,r,c,o,y);var v=r[y],x=a&&a[y],b=v.length,E=a&&x.length;o.x=v[b-2],o.y=v[b-1],o.bx=V(v[b-4])||o.x,o.by=V(v[b-3])||o.y,c.bx=a&&(V(x[E-4])||c.x),c.by=a&&(V(x[E-3])||c.y),c.x=a&&x[E-2],c.y=a&&x[E-1]}return a||(n.curve=s(r)),a?[r,a]:r}function P(e,t){if(!t)return e;var n,r,i,a,o,s,c;for(e=k(e),i=0,o=e.length;o>i;i++)for(c=e[i],a=1,s=c.length;s>a;a+=2)n=t.x(c[a],c[a+1]),r=t.y(c[a],c[a+1]),c[a]=n,c[a+1]=r;return e}function O(e,t){for(var n=[],r=0,i=e.length;i-2*!t>r;r+=2){var a=[{x:+e[r-2],y:+e[r-1]},{x:+e[r],y:+e[r+1]},{x:+e[r+2],y:+e[r+3]},{x:+e[r+4],y:+e[r+5]}];t?r?i-4==r?a[3]={x:+e[0],y:+e[1]}:i-2==r&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[i-2],y:+e[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+e[r],y:+e[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}var B=t.prototype,I=e.is,L=e._.clone,F="hasOwnProperty",j=/,?([a-z]),?/gi,V=parseFloat,G=Math,U=G.PI,W=G.min,z=G.max,$=G.pow,q=G.abs,H=u(1),Y=u(),K=u(0,1),X=e._unit2px,Q={path:function(e){return e.attr("path")},circle:function(e){var t=X(e);return _(t.cx,t.cy,t.r)},ellipse:function(e){var t=X(e);return _(t.cx||0,t.cy||0,t.rx,t.ry)},rect:function(e){var t=X(e);return S(t.x||0,t.y||0,t.width,t.height,t.rx,t.ry)},image:function(e){var t=X(e);return S(t.x||0,t.y||0,t.width,t.height)},line:function(e){return"M"+[e.attr("x1")||0,e.attr("y1")||0,e.attr("x2"),e.attr("y2")]},polyline:function(e){return"M"+e.attr("points")},polygon:function(e){return"M"+e.attr("points")+"z"},deflt:function(e){var t=e.node.getBBox();return S(t.x,t.y,t.width,t.height)}};e.path=i,e.path.getTotalLength=H,e.path.getPointAtLength=Y,e.path.getSubpath=function(e,t,n){if(this.getTotalLength(e)-n<1e-6)return K(e,t).end;var r=K(e,n,1);return t?K(r,t).end:r},B.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},B.getPointAtLength=function(e){return Y(this.attr("d"),e)},B.getSubpath=function(t,n){return e.path.getSubpath(this.attr("d"),t,n)},e._.box=a,e.path.findDotsAtSegment=l,e.path.bezierBBox=p,e.path.isPointInsideBBox=f,e.path.isBBoxIntersect=h,e.path.intersection=x,e.path.intersectionNumber=b,e.path.isPointInside=w,e.path.getBBox=A,e.path.get=Q,e.path.toRelative=T,e.path.toAbsolute=C,e.path.toCubic=k,e.path.map=P,e.path.toString=o,e.path.clone=s}),r.plugin(function(e,n,r,i){for(var a=n.prototype,o="hasOwnProperty",s=("createTouch"in i.doc),c=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},l=(function(e,t){var n="y"==e?"scrollTop":"scrollLeft",r=t&&t.node?t.node.ownerDocument:i.doc;return r[n in r.documentElement?"documentElement":"body"][n]}),p=function(){this.returnValue=!1},f=function(){return this.originalEvent.preventDefault()},h=function(){this.cancelBubble=!0},d=function(){return this.originalEvent.stopPropagation()},m=function(){return i.doc.addEventListener?function(e,t,n,r){var i=s&&u[t]?u[t]:t,a=function(i){var a=l("y",r),c=l("x",r);if(s&&u[o](t))for(var p=0,h=i.targetTouches&&i.targetTouches.length;h>p;p++)if(i.targetTouches[p].target==e||e.contains(i.targetTouches[p].target)){var m=i;i=i.targetTouches[p],i.originalEvent=m,i.preventDefault=f,i.stopPropagation=d;break}var y=i.clientX+c,g=i.clientY+a;return n.call(r,i,y,g)};return t!==i&&e.addEventListener(t,a,!1),e.addEventListener(i,a,!1),function(){return t!==i&&e.removeEventListener(t,a,!1),e.removeEventListener(i,a,!1),!0}}:i.doc.attachEvent?function(e,t,n,r){var i=function(e){e=e||r.node.ownerDocument.window.event;var t=l("y",r),i=l("x",r),a=e.clientX+i,o=e.clientY+t;return e.preventDefault=e.preventDefault||p,e.stopPropagation=e.stopPropagation||h,n.call(r,e,a,o)};e.attachEvent("on"+t,i);var a=function(){return e.detachEvent("on"+t,i),!0};return a}:void 0}(),y=[],g=function(e){for(var n,r=e.clientX,i=e.clientY,a=l("y"),o=l("x"),c=y.length;c--;){if(n=y[c],s){for(var u,p=e.touches&&e.touches.length;p--;)if(u=e.touches[p],u.identifier==n.el._drag.id||n.el.node.contains(u.target)){r=u.clientX,i=u.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var f=n.el.node;f.nextSibling,f.parentNode,f.style.display;r+=o,i+=a,t("snap.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,e)}},v=function(n){e.unmousemove(g).unmouseup(v);for(var r,i=y.length;i--;)r=y[i],r.el._drag={},t("snap.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n);y=[]},x=c.length;x--;)!function(t){e[t]=a[t]=function(n,r){return e.is(n,"function")&&(this.events=this.events||[],this.events.push({name:t,f:n,unbind:m(this.node||document,t,n,r||this)})),this},e["un"+t]=a["un"+t]=function(e){for(var n=this.events||[],r=n.length;r--;)if(n[r].name==t&&(n[r].f==e||!e))return n[r].unbind(),n.splice(r,1),!n.length&&delete this.events,this;return this}}(c[x]);a.hover=function(e,t,n,r){return this.mouseover(e,n).mouseout(t,r||n)},a.unhover=function(e,t){return this.unmouseover(e).unmouseout(t)};var b=[];a.drag=function(n,r,i,a,o,s){function c(c,u,l){(c.originalEvent||c).preventDefault(),this._drag.x=u,this._drag.y=l,this._drag.id=c.identifier,!y.length&&e.mousemove(g).mouseup(v),y.push({el:this,move_scope:a,start_scope:o,end_scope:s}),r&&t.on("snap.drag.start."+this.id,r),n&&t.on("snap.drag.move."+this.id,n),i&&t.on("snap.drag.end."+this.id,i),t("snap.drag.start."+this.id,o||a||this,u,l,c)}if(!arguments.length){var u;return this.drag(function(e,t){this.attr({transform:u+(u?"T":"t")+[e,t]})},function(){u=this.transform().local})}return this._drag={},b.push({el:this,start:c}),this.mousedown(c),this},a.undrag=function(){for(var n=b.length;n--;)b[n].el==this&&(this.unmousedown(b[n].start),b.splice(n,1),t.unbind("snap.drag.*."+this.id));return!b.length&&e.unmousemove(g).unmouseup(v),this}}),r.plugin(function(e,n,r,i){var a=(n.prototype,r.prototype),o=/^\s*url\((.+)\)/,s=String,c=e._.$;e.filter={},a.filter=function(t){var r=this;"svg"!=r.type&&(r=r.paper);var i=e.parse(s(t)),a=e._.id(),o=(r.node.offsetWidth,r.node.offsetHeight,c("filter"));return c(o,{id:a,filterUnits:"userSpaceOnUse"}),o.appendChild(i.node),r.defs.appendChild(o),new n(o)},t.on("snap.util.getattr.filter",function(){t.stop();var n=c(this.node,"filter");if(n){var r=s(n).match(o);return r&&e.select(r[1])}}),t.on("snap.util.attr.filter",function(r){if(r instanceof n&&"filter"==r.type){t.stop();var i=r.node.id;i||(c(r.node,{id:r.id}),i=r.id),c(this.node,{filter:e.url(i)})}r&&"none"!=r||(t.stop(),this.node.removeAttribute("filter"))}),e.filter.blur=function(t,n){null==t&&(t=2);var r=null==n?t:[t,n];return e.format('<feGaussianBlur stdDeviation="{def}"/>',{def:r})},e.filter.blur.toString=function(){return this()},e.filter.shadow=function(t,n,r,i,a){return"string"==typeof r&&(i=r,a=i,r=4),"string"!=typeof i&&(a=i,i="#000"),i=i||"#000",null==r&&(r=4),null==a&&(a=1),null==t&&(t=0,n=2),null==n&&(n=t),i=e.color(i),e.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>',{color:i,dx:t,dy:n,blur:r,opacity:a})},e.filter.shadow.toString=function(){return this()},e.filter.grayscale=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>',{a:.2126+.7874*(1-t),b:.7152-.7152*(1-t),c:.0722-.0722*(1-t),d:.2126-.2126*(1-t),e:.7152+.2848*(1-t),f:.0722-.0722*(1-t),g:.2126-.2126*(1-t),h:.0722+.9278*(1-t)})},e.filter.grayscale.toString=function(){return this()},e.filter.sepia=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>',{a:.393+.607*(1-t),b:.769-.769*(1-t),c:.189-.189*(1-t),d:.349-.349*(1-t),e:.686+.314*(1-t),f:.168-.168*(1-t),g:.272-.272*(1-t),h:.534-.534*(1-t),i:.131+.869*(1-t)})},e.filter.sepia.toString=function(){return this()},e.filter.saturate=function(t){return null==t&&(t=1),e.format('<feColorMatrix type="saturate" values="{amount}"/>',{amount:1-t})},e.filter.saturate.toString=function(){return this()},e.filter.hueRotate=function(t){return t=t||0,e.format('<feColorMatrix type="hueRotate" values="{angle}"/>',{angle:t})},e.filter.hueRotate.toString=function(){return this()},e.filter.invert=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>',{amount:t,amount2:1-t})},e.filter.invert.toString=function(){return this()},e.filter.brightness=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>',{amount:t})},e.filter.brightness.toString=function(){return this()},e.filter.contrast=function(t){return null==t&&(t=1),e.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>',{amount:t,amount2:.5-t/2})},e.filter.contrast.toString=function(){return this()}}),r})},{65:65}],67:[function(e,t,n){"use strict";var r=t.exports=e(66);r.plugin(function(e,t){t.prototype.children=function(){for(var t=[],n=this.node.childNodes,r=0,i=n.length;i>r;r++)t[r]=new e(n[r]);return t}}),r.plugin(function(e,t,n,r){function i(e){return e.split(/\s+/)}function a(e){return e.join(" ")}function o(e){return i(e.attr("class")||"")}function s(e,t){e.attr("class",a(t))}t.prototype.addClass=function(e){var t,n,r=o(this),a=i(e);for(t=0,n;n=a[t];t++)-1===r.indexOf(n)&&r.push(n);return s(this,r),this},t.prototype.hasClass=function(e){if(!e)throw new Error("[snapsvg] syntax: hasClass(clsStr)");return-1!==o(this).indexOf(e)},t.prototype.removeClass=function(e){var t,n,r,a=o(this),c=i(e);for(t=0,n;n=c[t];t++)r=a.indexOf(n),-1!==r&&a.splice(r,1);return s(this,a),this}}),r.plugin(function(e,t,n,r){t.prototype.translate=function(t,n){var r=new e.Matrix;return r.translate(t,n),this.transform(r)}}),r.plugin(function(e){e.create=function(t,n){return e._.wrap(e._.$(t,n))}}),r.plugin(function(e,t,n,r){e.createSnapAt=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("width",t),i.setAttribute("height",n),r||(r=document.body),r.appendChild(i),new e(i)}})},{66:66}],68:[function(e,t,n){var r=function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(){var e=Array.prototype.slice.call(arguments);1===e.length&&r(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t},a=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,o=/\/\*([^\*]*)\*\//m,s=function(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(a);return t[1]&&t[1].split(",").map(function(e){return t=e.match(o),t?t[1].trim():e.trim()})||[]};n.annotate=i,n.parse=s,n.isArray=r},{}],69:[function(e,t,n){t.exports={annotate:e(68).annotate,Module:e(71),Injector:e(70)}},{68:68,70:70,71:71}],70:[function(e,t,n){var r=e(71),i=e(68).parse,a=e(68).annotate,o=e(68).isArray,s=function(e,t){t=t||{get:function(e){throw n.push(e),p('No provider for "'+e+'"!')}};var n=[],c=this._providers=Object.create(t._providers||null),u=this._instances=Object.create(null),l=u.injector=this,p=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)},f=function(e){if(!c[e]&&-1!==e.indexOf(".")){for(var r=e.split("."),i=f(r.shift());r.length;)i=i[r.shift()];return i}if(Object.hasOwnProperty.call(u,e))return u[e];if(Object.hasOwnProperty.call(c,e)){if(-1!==n.indexOf(e))throw n.push(e),p("Cannot resolve circular dependency!");return n.push(e),u[e]=c[e][0](c[e][1]),n.pop(),u[e]}return t.get(e)},h=function(e){var t=Object.create(e.prototype),n=d(e,t);return"object"==typeof n?n:t},d=function(e,t){if("function"!=typeof e){if(!o(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=a(e.slice())}var n=e.$inject&&e.$inject||i(e),r=n.map(function(e){return f(e)});return e.apply(t,r)},m=function(e){return a(function(t){return e.get(t)})},y=function(e,t){if(t&&t.length){var n,r,i,a,o=Object.create(null),u=Object.create(null),p=[],f=[],h=[];for(var d in c)n=c[d],-1!==t.indexOf(d)&&("private"===n[2]?(r=p.indexOf(n[3]),-1===r?(i=n[3].createChild([],t),a=m(i),p.push(n[3]),f.push(i),h.push(a),o[d]=[a,d,"private",i]):o[d]=[h[r],d,"private",f[r]]):o[d]=[n[2],n[1]],u[d]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(o[d]=[n[2],n[1]],u[e]=!0)});t.forEach(function(e){if(!u[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(o)}return new s(e,l)},g={factory:d,type:h,value:function(e){return e}};e.forEach(function(e){function t(e,t){return"value"!==e&&o(t)&&(t=a(t.slice())),t}if(e instanceof r)e.forEach(function(e){var n=e[0],r=e[1],i=e[2];c[n]=[g[r],t(r,i),r]});else if("object"==typeof e)if(e.__exports__){var n=Object.keys(e).reduce(function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t},Object.create(null)),i=new s((e.__modules__||[]).concat([n]),l),u=a(function(e){return i.get(e)});e.__exports__.forEach(function(e){c[e]=[u,e,"private",i]})}else Object.keys(e).forEach(function(n){if("private"===e[n][2])return void(c[n]=e[n]);var r=e[n][0],i=e[n][1];c[n]=[g[r],t(r,i),r]})}),this.get=f,this.invoke=d,this.instantiate=h,this.createChild=y};t.exports=s},{68:68,71:71}],71:[function(e,t,n){var r=function(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}};t.exports=r},{}],72:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],73:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],74:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return n&&c(e,t,n)&&(t=null),("function"!=typeof t||void 0!==n)&&(t=a(t,n,3)),r(e,t)}var i=e(90),a=e(97),o=e(102),s=e(159),c=e(147);t.exports=r},{102:102,147:147,159:159,90:90,97:97}],75:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return t=a(t,n,3),r(e,t)}var i=e(91),a=e(97),o=e(103),s=e(159);t.exports=r},{103:103,159:159,91:91,97:97}],76:[function(e,t,n){var r=e(101),i=e(136),a=i(r);t.exports=a},{101:101,136:136}],77:[function(e,t,n){var r=e(89),i=e(101),a=e(137),o=a(r,i);t.exports=o},{101:101,137:137,89:89}],78:[function(e,t,n){var r=e(131),i=Object.prototype,a=i.hasOwnProperty,o=r(function(e,t,n){a.call(e,n)?e[n].push(t):e[n]=[t]});t.exports=o},{131:131}],79:[function(e,t,n){function r(e,t,n,r){var f=e?a(e):0;return c(f)||(e=l(e),f=e.length),f?(n="number"!=typeof n||r&&s(t,n,r)?0:0>n?p(f+n,0):n||0,"string"==typeof e||!o(e)&&u(e)?f>n&&e.indexOf(t,n)>-1:i(e,t,n)>-1):!1}var i=e(111),a=e(142),o=e(159),s=e(147),c=e(149),u=e(165),l=e(174),p=Math.max;t.exports=r},{111:111,142:142,147:147,149:149,159:159,165:165,174:174}],80:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return t=a(t,n,3),r(e,t)}var i=e(92),a=e(97),o=e(116),s=e(159);t.exports=r},{116:116,159:159,92:92,97:97}],81:[function(e,t,n){var r=e(93),i=e(101),a=e(138),o=a(r,i);t.exports=o},{101:101,138:138,93:93}],82:[function(e,t,n){function r(e,t,n){var r=s(e)?i:o;return n&&c(e,t,n)&&(t=null),("function"!=typeof t||void 0!==n)&&(t=a(t,n,3)),r(e,t)}var i=e(94),a=e(97),o=e(125),s=e(159),c=e(147);t.exports=r},{125:125,147:147,159:159,94:94,97:97}],83:[function(e,t,n){var r=e(161),i=r(i=Date.now)&&i,a=i||function(){return(new Date).getTime()};t.exports=a},{161:161}],84:[function(e,t,n){function r(e,t,n){function r(){y&&clearTimeout(y),f&&clearTimeout(f),f=y=g=void 0}function c(){var n=t-(a()-d);if(0>=n||n>t){f&&clearTimeout(f);var r=g;f=y=g=void 0,r&&(v=a(),h=e.apply(m,p),y||f||(p=m=null))}else y=setTimeout(c,n)}function u(){y&&clearTimeout(y),f=y=g=void 0,(b||x!==t)&&(v=a(),h=e.apply(m,p),y||f||(p=m=null))}function l(){if(p=arguments,d=a(),m=this,g=b&&(y||!E),x===!1)var n=E&&!y;else{f||E||(v=d);var r=x-(d-v),i=0>=r||r>x;i?(f&&(f=clearTimeout(f)),v=d,h=e.apply(m,p)):f||(f=setTimeout(u,r))}return i&&y?y=clearTimeout(y):y||t===x||(y=setTimeout(c,t)),n&&(i=!0,h=e.apply(m,p)),!i||y||f||(p=m=null),h}var p,f,h,d,m,y,g,v=0,x=!1,b=!0;if("function"!=typeof e)throw new TypeError(o);if(t=0>t?0:+t||0,n===!0){var E=!0;b=!1}else i(n)&&(E=n.leading,x="maxWait"in n&&s(+n.maxWait||0,t),b="trailing"in n?n.trailing:b);return l.cancel=r,l}var i=e(163),a=e(83),o="Expected a function",s=Math.max;t.exports=r},{163:163,83:83}],85:[function(e,t,n){var r=e(99),i=e(86),a=i(function(e,t){return r(e,1,t)});t.exports=a},{86:86,99:99}],86:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(i);return t=a(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,i=a(n.length-t,0),o=Array(i);++r<i;)o[r]=n[t+r];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,n[0],o);case 2:return e.call(this,n[0],n[1],o)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=o,e.apply(this,s)}}var i="Expected a function",a=Math.max;t.exports=r},{}],87:[function(e,t,n){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new o};t--;)this.push(e[t])}var i=e(130),a=e(161),o=a(o=n.Set)&&o,s=a(s=Object.create)&&s;r.prototype.push=i,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{130:130,161:161}],88:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],89:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],90:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=r},{}],91:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=-1,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[++i]=o)}return a}t.exports=r},{}],92:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=r},{}],93:[function(e,t,n){function r(e,t,n,r){var i=-1,a=e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}t.exports=r},{}],94:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=r},{}],95:[function(e,t,n){function r(e,t,n){var r=a(t);s.apply(r,i(t));for(var o=-1,c=r.length;++o<c;){var u=r[o],l=e[u],p=n(l,t[u],u,e,t);(p===p?p===l:l!==l)&&(void 0!==l||u in e)||(e[u]=p)}return e}var i=e(143),a=e(169),o=Array.prototype,s=o.push;t.exports=r},{143:143,169:169}],96:[function(e,t,n){var r=e(98),i=e(143),a=e(161),o=e(169),s=a(s=Object.preventExtensions)&&s,c=function(){var e=s&&a(e=Object.assign)&&e;try{if(e){var t=s({1:0});t[0]=1}}catch(n){try{e(t,"xo")}catch(n){}return!t[1]&&e}return!1}(),u=c||function(e,t){return null==t?e:r(t,i(t),r(t,o(t),e))};t.exports=u},{143:143,161:161,169:169,98:98}],97:[function(e,t,n){function r(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:o(e,t,n):null==e?s:"object"==r?i(e):void 0===t?c(e):a(e,t)}var i=e(117),a=e(118),o=e(128),s=e(178),c=e(179);t.exports=r},{117:117,118:118,128:128,178:178,179:179}],98:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r];n[a]=e[a]}return n}t.exports=r},{}],99:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)throw new TypeError(i);return setTimeout(function(){e.apply(void 0,n)},t)}var i="Expected a function";t.exports=r},{}],100:[function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var s=-1,c=i,u=!0,l=u&&t.length>=200?o(t):null,p=t.length;l&&(c=a,u=!1,t=l);e:for(;++s<n;){var f=e[s];if(u&&f===f){for(var h=p;h--;)if(t[h]===f)continue e;r.push(f)}else c(t,f,0)<0&&r.push(f)}return r}var i=e(111),a=e(129),o=e(135);t.exports=r},{111:111,129:129,135:135}],101:[function(e,t,n){var r=e(109),i=e(133),a=i(r);t.exports=a},{109:109,133:133}],102:[function(e,t,n){function r(e,t){var n=!0;return i(e,function(e,r,i){return n=!!t(e,r,i)}),n}var i=e(101);t.exports=r},{101:101}],103:[function(e,t,n){function r(e,t){var n=[];return i(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var i=e(101);t.exports=r},{101:101}],104:[function(e,t,n){function r(e,t,n,r){var i;return n(e,function(e,n,a){return t(e,n,a)?(i=r?n:e,!1):void 0}),i}t.exports=r},{}],105:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=n?r:-1;n?i--:++i<r;)if(t(e[i],i,e))return i;return-1}t.exports=r},{}],106:[function(e,t,n){function r(e,t,n){for(var c=-1,u=e.length,l=-1,p=[];++c<u;){var f=e[c];if(s(f)&&o(f)&&(n||a(f)||i(f))){t&&(f=r(f,t,n));for(var h=-1,d=f.length;++h<d;)p[++l]=f[h]}else n||(p[++l]=f)}return p}var i=e(158),a=e(159),o=e(145),s=e(150);t.exports=r},{145:145,150:150,158:158,159:159}],107:[function(e,t,n){var r=e(134),i=r();t.exports=i},{134:134}],108:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e(107),a=e(170);t.exports=r},{107:107,170:170}],109:[function(e,t,n){function r(e,t){return i(e,t,a)}var i=e(107),a=e(169);t.exports=r},{107:107,169:169}],110:[function(e,t,n){function r(e,t,n){if(null!=e){void 0!==n&&n in i(e)&&(t=[n]);for(var r=-1,a=t.length;null!=e&&++r<a;)e=e[t[r]];return r&&r==a?e:void 0}}var i=e(156);t.exports=r},{156:156}],111:[function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var i=e(144);t.exports=r},{144:144}],112:[function(e,t,n){function r(e,t,n,a,o,s){if(e===t)return!0;var c=typeof e,u=typeof t;return"function"!=c&&"object"!=c&&"function"!=u&&"object"!=u||null==e||null==t?e!==e&&t!==t:i(e,t,r,n,a,o,s)}var i=e(113);t.exports=r},{113:113
+}],113:[function(e,t,n){function r(e,t,n,r,f,m,y){var g=s(e),v=s(t),x=l,b=l;g||(x=d.call(e),x==u?x=p:x!=p&&(g=c(e))),v||(b=d.call(t),b==u?b=p:b!=p&&(v=c(t)));var E=x==p,w=b==p,A=x==b;if(A&&!g&&!E)return a(e,t,x);if(!f){var S=E&&h.call(e,"__wrapped__"),_=w&&h.call(t,"__wrapped__");if(S||_)return n(S?e.value():e,_?t.value():t,r,f,m,y)}if(!A)return!1;m||(m=[]),y||(y=[]);for(var T=m.length;T--;)if(m[T]==e)return y[T]==t;m.push(e),y.push(t);var C=(g?i:o)(e,t,n,r,f,m,y);return m.pop(),y.pop(),C}var i=e(139),a=e(140),o=e(141),s=e(159),c=e(166),u="[object Arguments]",l="[object Array]",p="[object Object]",f=Object.prototype,h=f.hasOwnProperty,d=f.toString;t.exports=r},{139:139,140:140,141:141,159:159,166:166}],114:[function(e,t,n){function r(e){return"function"==typeof e||!1}t.exports=r},{}],115:[function(e,t,n){function r(e,t,n,r,a){for(var o=-1,s=t.length,c=!a;++o<s;)if(c&&r[o]?n[o]!==e[t[o]]:!(t[o]in e))return!1;for(o=-1;++o<s;){var u=t[o],l=e[u],p=n[o];if(c&&r[o])var f=void 0!==l||u in e;else f=a?a(l,p,u):void 0,void 0===f&&(f=i(p,l,a,!0));if(!f)return!1}return!0}var i=e(112);t.exports=r},{112:112}],116:[function(e,t,n){function r(e,t){var n=-1,r=a(e)?Array(e.length):[];return i(e,function(e,i,a){r[++n]=t(e,i,a)}),r}var i=e(101),a=e(145);t.exports=r},{101:101,145:145}],117:[function(e,t,n){function r(e){var t=s(e),n=t.length;if(!n)return a(!0);if(1==n){var r=t[0],u=e[r];if(o(u))return function(e){return null==e?!1:e[r]===u&&(void 0!==u||r in c(e))}}for(var l=Array(n),p=Array(n);n--;)u=e[t[n]],l[n]=u,p[n]=o(u);return function(e){return null!=e&&i(c(e),t,l,p)}}var i=e(115),a=e(177),o=e(151),s=e(169),c=e(156);t.exports=r},{115:115,151:151,156:156,169:169,177:177}],118:[function(e,t,n){function r(e,t){var n=s(e),r=c(e)&&u(t),h=e+"";return e=f(e),function(s){if(null==s)return!1;var c=h;if(s=p(s),!(!n&&r||c in s)){if(s=1==e.length?s:i(s,o(e,0,-1)),null==s)return!1;c=l(e),s=p(s)}return s[c]===t?void 0!==t||c in s:a(t,s[c],null,!0)}}var i=e(110),a=e(112),o=e(124),s=e(159),c=e(148),u=e(151),l=e(73),p=e(156),f=e(157);t.exports=r},{110:110,112:112,124:124,148:148,151:151,156:156,157:157,159:159,73:73}],119:[function(e,t,n){function r(e,t,n,h,m){if(!u(e))return e;var y=c(t)&&(s(t)||p(t));if(!y){var g=f(t);d.apply(g,o(t))}return i(g||t,function(i,o){if(g&&(o=i,i=t[o]),l(i))h||(h=[]),m||(m=[]),a(e,t,o,r,n,h,m);else{var s=e[o],c=n?n(s,i,o,e,t):void 0,u=void 0===c;u&&(c=i),!y&&void 0===c||!u&&(c===c?c===s:s!==s)||(e[o]=c)}}),e}var i=e(89),a=e(120),o=e(143),s=e(159),c=e(145),u=e(163),l=e(150),p=e(166),f=e(169),h=Array.prototype,d=h.push;t.exports=r},{120:120,143:143,145:145,150:150,159:159,163:163,166:166,169:169,89:89}],120:[function(e,t,n){function r(e,t,n,r,p,f,h){for(var d=f.length,m=t[n];d--;)if(f[d]==m)return void(e[n]=h[d]);var y=e[n],g=p?p(y,m,n,e,t):void 0,v=void 0===g;v&&(g=m,s(m)&&(o(m)||u(m))?g=o(y)?y:s(y)?i(y):[]:c(m)||a(m)?g=a(y)?l(y):c(y)?y:{}:v=!1),f.push(m),h.push(g),v?e[n]=r(g,m,p,f,h):(g===g?g!==y:y===y)&&(e[n]=g)}var i=e(88),a=e(158),o=e(159),s=e(145),c=e(164),u=e(166),l=e(167);t.exports=r},{145:145,158:158,159:159,164:164,166:166,167:167,88:88}],121:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}t.exports=r},{}],122:[function(e,t,n){function r(e){var t=e+"";return e=a(e),function(n){return i(n,e,t)}}var i=e(110),a=e(157);t.exports=r},{110:110,157:157}],123:[function(e,t,n){function r(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}t.exports=r},{}],124:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),n=void 0===n||n>i?i:+n||0,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=r},{}],125:[function(e,t,n){function r(e,t){var n;return i(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}var i=e(101);t.exports=r},{101:101}],126:[function(e,t,n){function r(e){return"string"==typeof e?e:null==e?"":e+""}t.exports=r},{}],127:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e[t[n]];return i}t.exports=r},{}],128:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)};case 5:return function(n,r,i,a,o){return e.call(t,n,r,i,a,o)}}return function(){return e.apply(t,arguments)}}var i=e(178);t.exports=r},{178:178}],129:[function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=e(163);t.exports=r},{163:163}],130:[function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=e(163);t.exports=r},{163:163}],131:[function(e,t,n){function r(e,t){return function(n,r,s){var c=t?t():{};if(r=i(r,s,3),o(n))for(var u=-1,l=n.length;++u<l;){var p=n[u];e(c,p,r(p,u,n),n)}else a(n,function(t,n,i){e(c,t,r(t,n,i),i)});return c}}var i=e(97),a=e(101),o=e(159);t.exports=r},{101:101,159:159,97:97}],132:[function(e,t,n){function r(e){return o(function(t,n){var r=-1,o=null==t?0:n.length,s=o>2&&n[o-2],c=o>2&&n[2],u=o>1&&n[o-1];for("function"==typeof s?(s=i(s,u,5),o-=2):(s="function"==typeof u?u:null,o-=s?1:0),c&&a(n[0],n[1],c)&&(s=3>o?null:s,o=1);++r<o;){var l=n[r];l&&e(t,l,s)}return t})}var i=e(128),a=e(147),o=e(86);t.exports=r},{128:128,147:147,86:86}],133:[function(e,t,n){function r(e,t){return function(n,r){var s=n?i(n):0;if(!a(s))return e(n,r);for(var c=t?s:-1,u=o(n);(t?c--:++c<s)&&r(u[c],c,u)!==!1;);return n}}var i=e(142),a=e(149),o=e(156);t.exports=r},{142:142,149:149,156:156}],134:[function(e,t,n){function r(e){return function(t,n,r){for(var a=i(t),o=r(t),s=o.length,c=e?s:-1;e?c--:++c<s;){var u=o[c];if(n(a[u],u,a)===!1)break}return t}}var i=e(156);t.exports=r},{156:156}],135:[function(e,t,n){(function(n){var r=e(87),i=e(177),a=e(161),o=a(o=n.Set)&&o,s=a(s=Object.create)&&s,c=s&&o?function(e){return new r(e)}:i(null);t.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{161:161,177:177,87:87}],136:[function(e,t,n){function r(e,t){return function(n,r,c){if(r=i(r,c,3),s(n)){var u=o(n,r,t);return u>-1?n[u]:void 0}return a(n,r,e)}}var i=e(97),a=e(104),o=e(105),s=e(159);t.exports=r},{104:104,105:105,159:159,97:97}],137:[function(e,t,n){function r(e,t){return function(n,r,o){return"function"==typeof r&&void 0===o&&a(n)?e(n,r):t(n,i(r,o,3))}}var i=e(128),a=e(159);t.exports=r},{128:128,159:159}],138:[function(e,t,n){function r(e,t){return function(n,r,s,c){var u=arguments.length<3;return"function"==typeof r&&void 0===c&&o(n)?e(n,r,s,u):a(n,i(r,c,4),s,u,t)}}var i=e(97),a=e(123),o=e(159);t.exports=r},{123:123,159:159,97:97}],139:[function(e,t,n){function r(e,t,n,r,i,a,o){var s=-1,c=e.length,u=t.length,l=!0;if(c!=u&&!(i&&u>c))return!1;for(;l&&++s<c;){var p=e[s],f=t[s];if(l=void 0,r&&(l=i?r(f,p,s):r(p,f,s)),void 0===l)if(i)for(var h=u;h--&&(f=t[h],!(l=p&&p===f||n(p,f,r,i,a,o))););else l=p&&p===f||n(p,f,r,i,a,o)}return!!l}t.exports=r},{}],140:[function(e,t,n){function r(e,t,n){switch(n){case i:case a:return+e==+t;case o:return e.name==t.name&&e.message==t.message;case s:return e!=+e?t!=+t:e==+t;case c:case u:return e==t+""}return!1}var i="[object Boolean]",a="[object Date]",o="[object Error]",s="[object Number]",c="[object RegExp]",u="[object String]";t.exports=r},{}],141:[function(e,t,n){function r(e,t,n,r,a,s,c){var u=i(e),l=u.length,p=i(t),f=p.length;if(l!=f&&!a)return!1;for(var h=a,d=-1;++d<l;){var m=u[d],y=a?m in t:o.call(t,m);if(y){var g=e[m],v=t[m];y=void 0,r&&(y=a?r(v,g,m):r(g,v,m)),void 0===y&&(y=g&&g===v||n(g,v,r,a,s,c))}if(!y)return!1;h||(h="constructor"==m)}if(!h){var x=e.constructor,b=t.constructor;if(x!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b))return!1}return!0}var i=e(169),a=Object.prototype,o=a.hasOwnProperty;t.exports=r},{169:169}],142:[function(e,t,n){var r=e(121),i=r("length");t.exports=i},{121:121}],143:[function(e,t,n){var r=e(177),i=e(161),a=e(156),o=i(o=Object.getOwnPropertySymbols)&&o,s=o?function(e){return o(a(e))}:r([]);t.exports=s},{156:156,161:161,177:177}],144:[function(e,t,n){function r(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var a=e[i];if(a!==a)return i}return-1}t.exports=r},{}],145:[function(e,t,n){function r(e){return null!=e&&a(i(e))}var i=e(142),a=e(149);t.exports=r},{142:142,149:149}],146:[function(e,t,n){function r(e,t){return e=+e,t=null==t?i:t,e>-1&&e%1==0&&t>e}var i=Math.pow(2,53)-1;t.exports=r},{}],147:[function(e,t,n){function r(e,t,n){if(!o(n))return!1;var r=typeof t;if("number"==r?i(n)&&a(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=e(145),a=e(146),o=e(163);t.exports=r},{145:145,146:146,163:163}],148:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&s.test(e)||"number"==n)return!0;if(i(e))return!1;var r=!o.test(e);return r||null!=t&&e in a(t)}var i=e(159),a=e(156),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r},{156:156,159:159}],149:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}var i=Math.pow(2,53)-1;t.exports=r},{}],150:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],151:[function(e,t,n){function r(e){return e===e&&!i(e)}var i=e(163);t.exports=r},{163:163}],152:[function(e,t,n){function r(e,t){e=i(e);for(var n=-1,r=t.length,a={};++n<r;){var o=t[n];o in e&&(a[o]=e[o])}return a}var i=e(156);t.exports=r},{156:156}],153:[function(e,t,n){function r(e,t){var n={};return i(e,function(e,r,i){t(e,r,i)&&(n[r]=e)}),n}var i=e(108);t.exports=r},{108:108}],154:[function(e,t,n){function r(e){var t;if(!a(e)||u.call(e)!=o||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=e(108),a=e(150),o="[object Object]",s=Object.prototype,c=s.hasOwnProperty,u=s.toString;t.exports=r},{108:108,150:150}],155:[function(e,t,n){function r(e){for(var t=c(e),n=t.length,r=n&&e.length,l=r&&s(r)&&(a(e)||u.nonEnumArgs&&i(e)),f=-1,h=[];++f<n;){var d=t[f];(l&&o(d,r)||p.call(e,d))&&h.push(d)}return h}var i=e(158),a=e(159),o=e(146),s=e(149),c=e(170),u=e(176),l=Object.prototype,p=l.hasOwnProperty;t.exports=r},{146:146,149:149,158:158,159:159,170:170,176:176}],156:[function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=e(163);t.exports=r},{163:163}],157:[function(e,t,n){function r(e){if(a(e))return e;var t=[];return i(e).replace(o,function(e,n,r,i){t.push(r?i.replace(s,"$1"):n||e)}),t}var i=e(126),a=e(159),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=r},{126:126,159:159}],158:[function(e,t,n){function r(e){return a(e)&&i(e)&&c.call(e)==o}var i=e(145),a=e(150),o="[object Arguments]",s=Object.prototype,c=s.toString;t.exports=r},{145:145,150:150}],159:[function(e,t,n){var r=e(149),i=e(161),a=e(150),o="[object Array]",s=Object.prototype,c=s.toString,u=i(u=Array.isArray)&&u,l=u||function(e){return a(e)&&r(e.length)&&c.call(e)==o};t.exports=l},{149:149,150:150,161:161}],160:[function(e,t,n){(function(n){var r=e(114),i=e(161),a="[object Function]",o=Object.prototype,s=o.toString,c=i(c=n.Uint8Array)&&c,u=r(/x/)||c&&!r(c)?function(e){return s.call(e)==a}:r;t.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{114:114,161:161}],161:[function(e,t,n){function r(e){return null==e?!1:l.call(e)==o?p.test(u.call(e)):a(e)&&s.test(e)}var i=e(175),a=e(150),o="[object Function]",s=/^\[object .+?Constructor\]$/,c=Object.prototype,u=Function.prototype.toString,l=c.toString,p=RegExp("^"+i(l).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{150:150,175:175}],162:[function(e,t,n){function r(e){return"number"==typeof e||i(e)&&s.call(e)==a}var i=e(150),a="[object Number]",o=Object.prototype,s=o.toString;t.exports=r},{150:150}],163:[function(e,t,n){function r(e){var t=typeof e;return"function"==t||!!e&&"object"==t}t.exports=r},{}],164:[function(e,t,n){var r=e(161),i=e(154),a="[object Object]",o=Object.prototype,s=o.toString,c=r(c=Object.getPrototypeOf)&&c,u=c?function(e){if(!e||s.call(e)!=a)return!1;var t=e.valueOf,n=r(t)&&(n=c(t))&&c(n);return n?e==n||c(e)==n:i(e)}:i;t.exports=u},{154:154,161:161}],165:[function(e,t,n){function r(e){return"string"==typeof e||i(e)&&s.call(e)==a}var i=e(150),a="[object String]",o=Object.prototype,s=o.toString;t.exports=r},{150:150}],166:[function(e,t,n){function r(e){return a(e)&&i(e.length)&&!!N[D.call(e)]}var i=e(149),a=e(150),o="[object Arguments]",s="[object Array]",c="[object Boolean]",u="[object Date]",l="[object Error]",p="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",y="[object Set]",g="[object String]",v="[object WeakMap]",x="[object ArrayBuffer]",b="[object Float32Array]",E="[object Float64Array]",w="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",_="[object Uint8Array]",T="[object Uint8ClampedArray]",C="[object Uint16Array]",R="[object Uint32Array]",N={};N[b]=N[E]=N[w]=N[A]=N[S]=N[_]=N[T]=N[C]=N[R]=!0,N[o]=N[s]=N[x]=N[c]=N[u]=N[l]=N[p]=N[f]=N[h]=N[d]=N[m]=N[y]=N[g]=N[v]=!1;var M=Object.prototype,D=M.toString;t.exports=r},{149:149,150:150}],167:[function(e,t,n){function r(e){return i(e,a(e))}var i=e(98),a=e(170);t.exports=r},{170:170,98:98}],168:[function(e,t,n){var r=e(95),i=e(96),a=e(132),o=a(function(e,t,n){return n?r(e,t,n):i(e,t)});t.exports=o},{132:132,95:95,96:96}],169:[function(e,t,n){var r=e(145),i=e(161),a=e(163),o=e(155),s=i(s=Object.keys)&&s,c=s?function(e){var t=null!=e&&e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&r(e)?o(e):a(e)?s(e):[]}:o;t.exports=c},{145:145,155:155,161:161,163:163}],170:[function(e,t,n){function r(e){if(null==e)return[];c(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(a(e)||u.nonEnumArgs&&i(e))&&t||0;for(var n=e.constructor,r=-1,l="function"==typeof n&&n.prototype===e,f=Array(t),h=t>0;++r<t;)f[r]=r+"";for(var d in e)h&&o(d,t)||"constructor"==d&&(l||!p.call(e,d))||f.push(d);return f}var i=e(158),a=e(159),o=e(146),s=e(149),c=e(163),u=e(176),l=Object.prototype,p=l.hasOwnProperty;t.exports=r},{146:146,149:149,158:158,159:159,163:163,176:176}],171:[function(e,t,n){var r=e(119),i=e(132),a=i(r);t.exports=a},{119:119,132:132}],172:[function(e,t,n){var r=e(92),i=e(100),a=e(106),o=e(128),s=e(170),c=e(152),u=e(153),l=e(86),p=l(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=r(a(t),String);return c(e,i(s(e),t))}var n=o(t[0],t[1],3);return u(e,function(e,t,r){return!n(e,t,r)})});t.exports=p},{100:100,106:106,128:128,152:152,153:153,170:170,86:86,92:92}],173:[function(e,t,n){var r=e(106),i=e(128),a=e(152),o=e(153),s=e(86),c=s(function(e,t){return null==e?{}:"function"==typeof t[0]?o(e,i(t[0],t[1],3)):a(e,r(t))});t.exports=c},{106:106,128:128,152:152,153:153,86:86}],174:[function(e,t,n){function r(e){return i(e,a(e))}var i=e(127),a=e(169);t.exports=r},{127:127,169:169}],175:[function(e,t,n){function r(e){return e=i(e),e&&o.test(e)?e.replace(a,"\\$&"):e}var i=e(126),a=/[.*+?^${}()|[\]\/\\]/g,o=RegExp(a.source);t.exports=r},{126:126}],176:[function(e,t,n){(function(e){var n=Object.prototype,r=(r=e.window)&&r.document,i=n.propertyIsEnumerable,a={};!function(e){var t=function(){this.x=e},n=arguments,o=[];t.prototype={valueOf:e,y:e};for(var s in new t)o.push(s);a.funcDecomp=/\bthis\b/.test(function(){return this}),a.funcNames="string"==typeof Function.name;try{a.dom=11===r.createDocumentFragment().nodeType}catch(c){a.dom=!1}try{a.nonEnumArgs=!i.call(n,1)}catch(c){a.nonEnumArgs=!0}}(1,0),t.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],177:[function(e,t,n){function r(e){return function(){return e}}t.exports=r},{}],178:[function(e,t,n){function r(e){return e}t.exports=r},{}],179:[function(e,t,n){function r(e){return o(e)?i(e):a(e)}var i=e(121),a=e(122),o=e(148);t.exports=r},{121:121,122:122,148:148}],180:[function(e,t,n){t.exports=e(186)},{186:186}],181:[function(e,t,n){t.exports=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}},{}],182:[function(e,t,n){t.exports=e(189)},{189:189}],183:[function(e,t,n){t.exports=e(193)},{193:193}],184:[function(e,t,n){t.exports=e(192)},{192:192}],185:[function(e,t,n){t.exports=function(e){e.parentNode&&e.parentNode.removeChild(e)}},{}],186:[function(e,t,n){function r(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}var i=e(187),a=/\s+/,o=Object.prototype.toString;t.exports=function(e){return new r(e)},r.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),n=i(t,e);return~n||t.push(e),this.el.className=t.join(" "),this},r.prototype.remove=function(e){if("[object RegExp]"==o.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=i(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},r.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},r.prototype.toggle=function(e,t){return this.list?("undefined"!=typeof t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):("undefined"!=typeof t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},r.prototype.array=function(){var e=this.el.getAttribute("class")||"",t=e.replace(/^\s+|\s+$/g,""),n=t.split(a);return""===n[0]&&n.shift(),n},r.prototype.has=r.prototype.contains=function(e){return this.list?this.list.contains(e):!!~i(this.array(),e)}},{187:187}],187:[function(e,t,n){t.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],188:[function(e,t,n){var r=e(191);t.exports=function(e,t,n,i){for(e=n?{parentNode:e}:e,i=i||document;(e=e.parentNode)&&e!==document;){if(r(e,t))return e;if(e===i)return}}},{191:191}],189:[function(e,t,n){var r=e(188),i=e(190);n.bind=function(e,t,n,a,o){return i.bind(e,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=r(i,t,!0,e),n.delegateTarget&&a.call(e,n)},o)},n.unbind=function(e,t,n,r){i.unbind(e,t,n,r)}},{188:188,190:190}],190:[function(e,t,n){var r=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",a="addEventListener"!==r?"on":"";n.bind=function(e,t,n,i){return e[r](a+t,n,i||!1),n},n.unbind=function(e,t,n,r){return e[i](a+t,n,r||!1),n}},{}],191:[function(e,t,n){function r(e,t){if(!e||1!==e.nodeType)return!1;if(o)return o.call(e,t);for(var n=i.all(t,e.parentNode),r=0;r<n.length;++r)if(n[r]==e)return!0;return!1}var i=e(192),a=Element.prototype,o=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;t.exports=r},{192:192}],192:[function(e,t,n){function r(e,t){return t.querySelector(e)}n=t.exports=function(e,t){return t=t||document,r(e,t)},n.all=function(e,t){return t=t||document,t.querySelectorAll(e)},n.engine=function(e){if(!e.one)throw new Error(".one callback required");if(!e.all)throw new Error(".all callback required");return r=e.one,n.all=e.all,n}},{}],193:[function(e,t,n){function r(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=t.createElement("html");return i.innerHTML=e,i.removeChild(i.lastChild)}var a=o[r]||o._default,s=a[0],c=a[1],u=a[2],i=t.createElement("div");for(i.innerHTML=c+e+u;s--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);for(var l=t.createDocumentFragment();i.firstChild;)l.appendChild(i.removeChild(i.firstChild));return l}t.exports=r;var i=document.createElement("div");i.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var a=!i.getElementsByTagName("link").length;i=void 0;var o={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:a?[1,"X<div>","</div>"]:[0,"",""]};o.td=o.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],o.option=o.optgroup=[1,'<select multiple="multiple">',"</select>"],o.thead=o.tbody=o.colgroup=o.caption=o.tfoot=[1,"<table>","</table>"],o.polyline=o.ellipse=o.polygon=o.circle=o.text=o.line=o.path=o.rect=o.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],194:[function(e,t,n){t.exports=e(196),t.exports.Collection=e(195)},{195:195,196:196}],195:[function(e,t,n){"use strict";function r(e,t,n,r){var i=n.inverse;return e.remove=function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,i,r)),e},e.contains=function(e){return-1!==this.indexOf(e)},e.add=function(e){this.contains(e)||(this.push(e),t.set(e,i,r))},e}t.exports.extend=r},{}],196:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function i(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:s.extend(n[t.name]||[],e,t,n)})}function a(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{enumerable:t.enumerable,get:function(){return i},set:function(t){if(t!==i){var a=i;i=null,a&&e.unset(a,r,n),i=t,e.set(i,r,n)}}})}function o(e,t){return this instanceof o?(e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,void(this.props[t.name]=t)):new o(e,t)}var s=e(195);o.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?i(this,t,e):a(this,t,e)},o.prototype.ensureBound=function(e,t){r(e,t)||this.bind(e,t)},o.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?e[t.name].remove(n):e[t.name]=void 0)},o.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?e[t.name].add(n):e[t.name]=n)},t.exports=o},{195:195}]},{},[1])(1)}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/.bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/.bower.json
new file mode 100644
index 0000000..33b7649
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/.bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "jquery-mousewheel",
+ "version": "3.1.13",
+ "main": "./jquery.mousewheel.js",
+ "ignore": [
+ "*.json",
+ "*.markdown",
+ "*.txt",
+ ".*",
+ "!LICENSE.txt",
+ "Gruntfile.js",
+ "test"
+ ],
+ "dependencies": {
+ "jquery": ">=1.2.2"
+ },
+ "homepage": "https://github.com/jquery/jquery-mousewheel",
+ "_release": "3.1.13",
+ "_resolution": {
+ "type": "version",
+ "tag": "3.1.13",
+ "commit": "67289b6b2aa0066d7d78a5807f520387135ffb22"
+ },
+ "_source": "git://github.com/jquery/jquery-mousewheel.git",
+ "_target": "~3.1.13",
+ "_originalSource": "jquery-mousewheel",
+ "_direct": true
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/ChangeLog.md b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/ChangeLog.md
new file mode 100644
index 0000000..76752a1
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/ChangeLog.md
@@ -0,0 +1,147 @@
+# Mouse Wheel ChangeLog
+
+## 3.1.13
+
+* Update copyright notice and license to remove years
+* Create the correct compressed version
+* Remove the obsolete jQuery Plugin Registry file
+
+## 3.1.12
+
+* Fix possible 0 value for line height when in delta mode 1
+
+## 3.1.11
+
+* Fix version number for package managers...
+
+## 3.1.10
+
+* Fix issue with calculating line height when using older versions of jQuery
+* Add offsetX/Y normalization with setting to turn it off
+* Cleans up data on teardown
+
+## 3.1.9
+
+* Fix bower.json file
+* Updated how the deltas are adjusted for older mousewheel based events that have deltas that are factors of 120.
+* Add $.event.special.mousewheel.settings.adjustOldDeltas (defaults to true) to turn off adjusting of old deltas that are factors of 120. You'd turn this off if you want to be as close to native scrolling as possible.
+
+## 3.1.8
+
+* Even better handling of older browsers that use a wheelDelta based on 120
+* And fix version reported by `$.event.special.mousewheel`
+
+## 3.1.7
+
+* Better handle the `deltaMode` values 1 (lines) and 2 (pages)
+* Attempt to better handle older browsers that use a wheelDelta based on 120
+
+## 3.1.6
+
+* Deprecating `delta`, `deltaX`, and `deltaY` event handler arguments
+* Update actual event object with normalized `deltaX `and `deltaY` values (`event.deltaX`, `event.deltaY`)
+* Add `deltaFactor` to the event object (`event.deltaFactor`)
+* Handle `> 0` but `< 1` deltas better
+* Do not fire the event if `deltaX` and `deltaY` are `0`
+* Better handle different devices that give different `lowestDelta` values
+* Add `$.event.special.mousewheel.version`
+* Some clean up
+
+## 3.1.5
+
+* Bad release because I did not update the new `$.event.special.mousewheel.version`
+
+## 3.1.4
+
+* Always set the `deltaY`
+* Add back in the `deltaX` and `deltaY` support for older Firefox versions
+
+## 3.1.3
+
+* Include `MozMousePixelScroll` in the to fix list to avoid inconsistent behavior in older Firefox
+
+## 3.1.2
+
+* Include grunt utilities for development purposes (jshint and uglify)
+* Include support for browserify
+* Some basic cleaning up
+
+## 3.1.1
+
+* Fix rounding issue with deltas less than zero
+
+
+## 3.1.0
+
+* Fix Firefox 17+ issues by using new wheel event
+* Normalize delta values
+* Adds horizontal support for IE 9+ by using new wheel event
+* Support AMD loaders
+
+
+## 3.0.6
+
+* Fix issue with delta being 0 in Firefox
+
+
+## 3.0.5
+
+* jQuery 1.7 compatibility
+
+
+## 3.0.4
+
+* Fix IE issue
+
+
+## 3.0.3
+
+* Added `deltaX` and `deltaY` for horizontal scrolling support (Thanks to Seamus Leahy)
+
+
+## 3.0.2
+
+* Fixed delta being opposite value in latest Opera
+* No longer fix `pageX`, `pageY` for older Mozilla browsers
+* Removed browser detection
+* Cleaned up the code
+
+
+## 3.0.1
+
+* Bad release... creating a new release due to plugins.jquery.com issue :(
+
+
+## 3.0
+
+* Uses new special events API in jQuery 1.2.2+
+* You can now treat `mousewheel` as a normal event and use `.bind`, `.unbind` and `.trigger`
+* Using jQuery.data API for expandos
+
+
+## 2.2
+
+* Fixed `pageX`, `pageY`, `clientX` and `clientY` event properties for Mozilla based browsers
+
+
+## 2.1.1
+
+* Updated to work with jQuery 1.1.3
+* Used one instead of bind to do unload event for clean up
+
+
+## 2.1
+
+* Fixed an issue with the unload handler
+
+
+## 2.0
+
+* Major reduction in code size and complexity (internals have change a whole lot)
+
+
+## 1.0
+
+* Fixed Opera issue
+* Fixed an issue with children elements that also have a mousewheel handler
+* Added ability to handle multiple handlers
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/LICENSE.txt b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/LICENSE.txt
new file mode 100644
index 0000000..919fe6a
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/LICENSE.txt
@@ -0,0 +1,37 @@
+Copyright jQuery Foundation and other contributors
+https://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery-mousewheel
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/README.md b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/README.md
new file mode 100644
index 0000000..a03fdde
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/README.md
@@ -0,0 +1,76 @@
+# jQuery Mouse Wheel Plugin
+
+A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support with delta normalization.
+
+In order to use the plugin, simply bind the `mousewheel` event to an element.
+
+It also provides two helper methods called `mousewheel` and `unmousewheel`
+that act just like other event helper methods in jQuery.
+
+The event object is updated with the normalized `deltaX` and `deltaY` properties.
+In addition there is a new property on the event object called `deltaFactor`. Multiply
+the `deltaFactor` by `deltaX` or `deltaY` to get the scroll distance that the browser
+has reported.
+
+Here is an example of using both the bind and helper method syntax:
+
+```js
+// using on
+$('#my_elem').on('mousewheel', function(event) {
+ console.log(event.deltaX, event.deltaY, event.deltaFactor);
+});
+
+// using the event helper
+$('#my_elem').mousewheel(function(event) {
+ console.log(event.deltaX, event.deltaY, event.deltaFactor);
+});
+```
+
+The old behavior of adding three arguments (`delta`, `deltaX`, and `deltaY`) to the
+event handler is now deprecated and will be removed in later releases.
+
+
+## The Deltas...
+
+The combination of Browsers, Operating Systems, and Devices offer a huge range of possible delta values. In fact if the user
+uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
+values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
+acceleration that is used. This number has the potential to be in the thousands depending on the device.
+Check out some of the data collected from users [here](http://mousewheeldatacollector.herokuapp.com/).
+
+### Getting the scroll distance
+
+In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
+scroll based on the users input. This can be done by multiplying the `deltaFactor` by the `deltaX` or `deltaY`
+event property to find the scroll distance the browser reported.
+
+The `deltaFactor` property was added to the event object in 3.1.5 so that the actual reported delta value can be
+extracted. This is a non-standard property.
+
+
+## Using with [Browserify](http://browserify.org)
+
+Support for browserify is baked in.
+
+```bash
+npm install jquery-mousewheel
+npm install jquery-browserify
+```
+
+In your server-side node.js code:
+
+```js
+var express = require('express');
+var app = express.createServer();
+
+app.use(require('browserify')({
+ require : [ 'jquery-browserify', 'jquery-mousewheel' ]
+}));
+```
+
+In your browser-side javascript:
+
+```js
+var $ = require('jquery-browserify');
+require('jquery-mousewheel')($);
+```
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/bower.json
new file mode 100644
index 0000000..8bd2cc5
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/bower.json
@@ -0,0 +1,17 @@
+{
+ "name": "jquery-mousewheel",
+ "version": "3.1.13",
+ "main": "./jquery.mousewheel.js",
+ "ignore": [
+ "*.json",
+ "*.markdown",
+ "*.txt",
+ ".*",
+ "!LICENSE.txt",
+ "Gruntfile.js",
+ "test"
+ ],
+ "dependencies": {
+ "jquery": ">=1.2.2"
+ }
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.js
new file mode 100644
index 0000000..3eadb7e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.js
@@ -0,0 +1,221 @@
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ */
+
+(function (factory) {
+ if ( typeof define === 'function' && define.amd ) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+ slice = Array.prototype.slice,
+ nullLowestDeltaTimeout, lowestDelta;
+
+ if ( $.event.fixHooks ) {
+ for ( var i = toFix.length; i; ) {
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+ }
+ }
+
+ var special = $.event.special.mousewheel = {
+ version: '3.1.12',
+
+ setup: function() {
+ if ( this.addEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.addEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = handler;
+ }
+ // Store the line height and page height for this particular element
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.removeEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = null;
+ }
+ // Clean up the data we added to the element
+ $.removeData(this, 'mousewheel-line-height');
+ $.removeData(this, 'mousewheel-page-height');
+ },
+
+ getLineHeight: function(elem) {
+ var $elem = $(elem),
+ $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
+ if (!$parent.length) {
+ $parent = $('body');
+ }
+ return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
+ },
+
+ getPageHeight: function(elem) {
+ return $(elem).height();
+ },
+
+ settings: {
+ adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
+ normalizeOffset: true // calls getBoundingClientRect for each event
+ }
+ };
+
+ $.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind('mousewheel', fn);
+ }
+ });
+
+
+ function handler(event) {
+ var orgEvent = event || window.event,
+ args = slice.call(arguments, 1),
+ delta = 0,
+ deltaX = 0,
+ deltaY = 0,
+ absDelta = 0,
+ offsetX = 0,
+ offsetY = 0;
+ event = $.event.fix(orgEvent);
+ event.type = 'mousewheel';
+
+ // Old school scrollwheel delta
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+ deltaX = deltaY * -1;
+ deltaY = 0;
+ }
+
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
+ delta = deltaY === 0 ? deltaX : deltaY;
+
+ // New school wheel delta (wheel event)
+ if ( 'deltaY' in orgEvent ) {
+ deltaY = orgEvent.deltaY * -1;
+ delta = deltaY;
+ }
+ if ( 'deltaX' in orgEvent ) {
+ deltaX = orgEvent.deltaX;
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
+ }
+
+ // No change actually happened, no reason to go any further
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
+
+ // Need to convert lines and pages to pixels if we aren't already in pixels
+ // There are three delta modes:
+ // * deltaMode 0 is by pixels, nothing to do
+ // * deltaMode 1 is by lines
+ // * deltaMode 2 is by pages
+ if ( orgEvent.deltaMode === 1 ) {
+ var lineHeight = $.data(this, 'mousewheel-line-height');
+ delta *= lineHeight;
+ deltaY *= lineHeight;
+ deltaX *= lineHeight;
+ } else if ( orgEvent.deltaMode === 2 ) {
+ var pageHeight = $.data(this, 'mousewheel-page-height');
+ delta *= pageHeight;
+ deltaY *= pageHeight;
+ deltaX *= pageHeight;
+ }
+
+ // Store lowest absolute delta to normalize the delta values
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+
+ if ( !lowestDelta || absDelta < lowestDelta ) {
+ lowestDelta = absDelta;
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ lowestDelta /= 40;
+ }
+ }
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ // Divide all the things by 40!
+ delta /= 40;
+ deltaX /= 40;
+ deltaY /= 40;
+ }
+
+ // Get a whole, normalized value for the deltas
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+
+ // Normalise offsetX and offsetY properties
+ if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+ var boundingRect = this.getBoundingClientRect();
+ offsetX = event.clientX - boundingRect.left;
+ offsetY = event.clientY - boundingRect.top;
+ }
+
+ // Add information to the event object
+ event.deltaX = deltaX;
+ event.deltaY = deltaY;
+ event.deltaFactor = lowestDelta;
+ event.offsetX = offsetX;
+ event.offsetY = offsetY;
+ // Go ahead and set deltaMode to 0 since we converted to pixels
+ // Although this is a little odd since we overwrite the deltaX/Y
+ // properties with normalized deltas.
+ event.deltaMode = 0;
+
+ // Add event and delta to the front of the arguments
+ args.unshift(event, delta, deltaX, deltaY);
+
+ // Clearout lowestDelta after sometime to better
+ // handle multiple device types that give different
+ // a different lowestDelta
+ // Ex: trackpad = 3 and mouse wheel = 120
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
+
+ return ($.event.dispatch || $.event.handle).apply(this, args);
+ }
+
+ function nullLowestDelta() {
+ lowestDelta = null;
+ }
+
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
+ // If this is an older event and the delta is divisable by 120,
+ // then we are assuming that the browser is treating this as an
+ // older mouse wheel event and that we should divide the deltas
+ // by 40 to try and get a more usable deltaFactor.
+ // Side note, this actually impacts the reported scroll distance
+ // in older browsers and can cause scrolling to be slower than native.
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
+ }
+
+}));
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.min.js
new file mode 100644
index 0000000..03bfd60
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/jquery-mousewheel/jquery.mousewheel.min.js
@@ -0,0 +1,8 @@
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright 2015 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ */
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/.bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/.bower.json
new file mode 100644
index 0000000..1a12ab5
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/.bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "lodash",
+ "main": "lodash.js",
+ "ignore": [
+ ".*",
+ "*.custom.*",
+ "*.log",
+ "*.map",
+ "*.md",
+ "lodash.src.js",
+ "component.json",
+ "package.json",
+ "doc",
+ "node_modules",
+ "perf",
+ "test",
+ "vendor"
+ ],
+ "homepage": "https://github.com/lodash/lodash",
+ "version": "3.10.0",
+ "_release": "3.10.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "3.10.0",
+ "commit": "9d894f90ff020d49bef24aa70c75e513f43049f2"
+ },
+ "_source": "git://github.com/lodash/lodash.git",
+ "_target": "~3.10.0",
+ "_originalSource": "lodash",
+ "_direct": true
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/LICENSE b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/LICENSE
new file mode 100644
index 0000000..9cd87e5
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/LICENSE
@@ -0,0 +1,22 @@
+Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/bower.json b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/bower.json
new file mode 100644
index 0000000..23c3905
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/bower.json
@@ -0,0 +1,19 @@
+{
+ "name": "lodash",
+ "main": "lodash.js",
+ "ignore": [
+ ".*",
+ "*.custom.*",
+ "*.log",
+ "*.map",
+ "*.md",
+ "lodash.src.js",
+ "component.json",
+ "package.json",
+ "doc",
+ "node_modules",
+ "perf",
+ "test",
+ "vendor"
+ ]
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.js
new file mode 100644
index 0000000..e1eb0ad
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.js
@@ -0,0 +1,12351 @@
+/**
+ * @license
+ * lodash 3.10.0 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modern -o ./lodash.js`
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license <https://lodash.com/license>
+ */
+;(function() {
+
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
+ var undefined;
+
+ /** Used as the semantic version number. */
+ var VERSION = '3.10.0';
+
+ /** Used to compose bitmasks for wrapper metadata. */
+ var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+ /** Used as default options for `_.trunc`. */
+ var DEFAULT_TRUNC_LENGTH = 30,
+ DEFAULT_TRUNC_OMISSION = '...';
+
+ /** Used to detect when a function becomes hot. */
+ var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+ /** Used as the size to enable large array optimizations. */
+ var LARGE_ARRAY_SIZE = 200;
+
+ /** Used to indicate the type of lazy iteratees. */
+ var LAZY_FILTER_FLAG = 1,
+ LAZY_MAP_FLAG = 2;
+
+ /** Used as the `TypeError` message for "Functions" methods. */
+ var FUNC_ERROR_TEXT = 'Expected a function';
+
+ /** Used as the internal argument placeholder. */
+ var PLACEHOLDER = '__lodash_placeholder__';
+
+ /** `Object#toString` result references. */
+ var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+ var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+ /** Used to match empty string literals in compiled template source. */
+ var reEmptyStringLeading = /\b__p \+= '';/g,
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
+
+ /** Used to match HTML entities and HTML characters. */
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
+ reUnescapedHtml = /[&<>"'`]/g,
+ reHasEscapedHtml = RegExp(reEscapedHtml.source),
+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
+
+ /** Used to match template delimiters. */
+ var reEscape = /<%-([\s\S]+?)%>/g,
+ reEvaluate = /<%([\s\S]+?)%>/g,
+ reInterpolate = /<%=([\s\S]+?)%>/g;
+
+ /** Used to match property names within property paths. */
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/,
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+ /**
+ * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)
+ * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
+ */
+ var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+ /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
+ var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
+
+ /** Used to match backslashes in property paths. */
+ var reEscapeChar = /\\(\\)?/g;
+
+ /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
+
+ /** Used to match `RegExp` flags from their coerced string values. */
+ var reFlags = /\w*$/;
+
+ /** Used to detect hexadecimal string values. */
+ var reHasHexPrefix = /^0[xX]/;
+
+ /** Used to detect host constructors (Safari > 5). */
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+ /** Used to detect unsigned integer values. */
+ var reIsUint = /^\d+$/;
+
+ /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
+ var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
+
+ /** Used to ensure capturing order of template delimiters. */
+ var reNoMatch = /($^)/;
+
+ /** Used to match unescaped characters in compiled string literals. */
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
+
+ /** Used to match words to create compound words. */
+ var reWords = (function() {
+ var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
+ lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
+
+ return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
+ }());
+
+ /** Used to assign default `context` object properties. */
+ var contextProps = [
+ 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
+ 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
+ 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
+ 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
+ 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
+ ];
+
+ /** Used to make template sourceURLs easier to identify. */
+ var templateCounter = -1;
+
+ /** Used to identify `toStringTag` values of typed arrays. */
+ var typedArrayTags = {};
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+ typedArrayTags[uint32Tag] = true;
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+ typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+ typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+ typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+ typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+ typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
+ var cloneableTags = {};
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
+ cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
+ cloneableTags[dateTag] = cloneableTags[float32Tag] =
+ cloneableTags[float64Tag] = cloneableTags[int8Tag] =
+ cloneableTags[int16Tag] = cloneableTags[int32Tag] =
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
+ cloneableTags[regexpTag] = cloneableTags[stringTag] =
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
+ cloneableTags[mapTag] = cloneableTags[setTag] =
+ cloneableTags[weakMapTag] = false;
+
+ /** Used to map latin-1 supplementary letters to basic latin letters. */
+ var deburredLetters = {
+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
+ '\xc7': 'C', '\xe7': 'c',
+ '\xd0': 'D', '\xf0': 'd',
+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
+ '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
+ '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
+ '\xd1': 'N', '\xf1': 'n',
+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
+ '\xc6': 'Ae', '\xe6': 'ae',
+ '\xde': 'Th', '\xfe': 'th',
+ '\xdf': 'ss'
+ };
+
+ /** Used to map characters to HTML entities. */
+ var htmlEscapes = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#39;',
+ '`': '&#96;'
+ };
+
+ /** Used to map HTML entities to characters. */
+ var htmlUnescapes = {
+ '&amp;': '&',
+ '&lt;': '<',
+ '&gt;': '>',
+ '&quot;': '"',
+ '&#39;': "'",
+ '&#96;': '`'
+ };
+
+ /** Used to determine if values are of the language type `Object`. */
+ var objectTypes = {
+ 'function': true,
+ 'object': true
+ };
+
+ /** Used to escape characters for inclusion in compiled regexes. */
+ var regexpEscapes = {
+ '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',
+ '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',
+ 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',
+ 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',
+ 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'
+ };
+
+ /** Used to escape characters for inclusion in compiled string literals. */
+ var stringEscapes = {
+ '\\': '\\',
+ "'": "'",
+ '\n': 'n',
+ '\r': 'r',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ /** Detect free variable `exports`. */
+ var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
+
+ /** Detect free variable `module`. */
+ var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
+
+ /** Detect free variable `global` from Node.js. */
+ var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
+
+ /** Detect free variable `self`. */
+ var freeSelf = objectTypes[typeof self] && self && self.Object && self;
+
+ /** Detect free variable `window`. */
+ var freeWindow = objectTypes[typeof window] && window && window.Object && window;
+
+ /** Detect the popular CommonJS extension `module.exports`. */
+ var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
+
+ /**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+ var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * The base implementation of `compareAscending` which compares values and
+ * sorts them in ascending order without guaranteeing a stable sort.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {number} Returns the sort order indicator for `value`.
+ */
+ function baseCompareAscending(value, other) {
+ if (value !== other) {
+ var valIsNull = value === null,
+ valIsUndef = value === undefined,
+ valIsReflexive = value === value;
+
+ var othIsNull = other === null,
+ othIsUndef = other === undefined,
+ othIsReflexive = other === other;
+
+ if ((value > other && !othIsNull) || !valIsReflexive ||
+ (valIsNull && !othIsUndef && othIsReflexive) ||
+ (valIsUndef && othIsReflexive)) {
+ return 1;
+ }
+ if ((value < other && !valIsNull) || !othIsReflexive ||
+ (othIsNull && !valIsUndef && valIsReflexive) ||
+ (othIsUndef && valIsReflexive)) {
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ /**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+ function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+ }
+
+ /**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+ function baseToString(value) {
+ return value == null ? '' : (value + '');
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the first character not found in `chars`.
+ */
+ function charsLeftIndex(string, chars) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the last character not found in `chars`.
+ */
+ function charsRightIndex(string, chars) {
+ var index = string.length;
+
+ while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.sortBy` to compare transformed elements of a collection and stable
+ * sort them in ascending order.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+ function compareAscending(object, other) {
+ return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
+ }
+
+ /**
+ * Used by `_.sortByOrder` to compare multiple properties of a value to another
+ * and stable sort them.
+ *
+ * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
+ * a value is sorted in ascending order if its corresponding order is "asc", and
+ * descending if "desc".
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {boolean[]} orders The order to sort by for each property.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+ function compareMultiple(object, other, orders) {
+ var index = -1,
+ objCriteria = object.criteria,
+ othCriteria = other.criteria,
+ length = objCriteria.length,
+ ordersLength = orders.length;
+
+ while (++index < length) {
+ var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
+ if (result) {
+ if (index >= ordersLength) {
+ return result;
+ }
+ var order = orders[index];
+ return result * ((order === 'asc' || order === true) ? 1 : -1);
+ }
+ }
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
+ // that causes it, under certain circumstances, to provide the same value for
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
+ // for more details.
+ //
+ // This also ensures a stable sort in V8 and other engines.
+ // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
+ return object.index - other.index;
+ }
+
+ /**
+ * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
+ *
+ * @private
+ * @param {string} letter The matched letter to deburr.
+ * @returns {string} Returns the deburred letter.
+ */
+ function deburrLetter(letter) {
+ return deburredLetters[letter];
+ }
+
+ /**
+ * Used by `_.escape` to convert characters to HTML entities.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+ function escapeHtmlChar(chr) {
+ return htmlEscapes[chr];
+ }
+
+ /**
+ * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @param {string} leadingChar The capture group for a leading character.
+ * @param {string} whitespaceChar The capture group for a whitespace character.
+ * @returns {string} Returns the escaped character.
+ */
+ function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
+ if (leadingChar) {
+ chr = regexpEscapes[chr];
+ } else if (whitespaceChar) {
+ chr = stringEscapes[chr];
+ }
+ return '\\' + chr;
+ }
+
+ /**
+ * Used by `_.template` to escape characters for inclusion in compiled string literals.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+ function escapeStringChar(chr) {
+ return '\\' + stringEscapes[chr];
+ }
+
+ /**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+ function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+ function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+ }
+
+ /**
+ * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
+ * character code is whitespace.
+ *
+ * @private
+ * @param {number} charCode The character code to inspect.
+ * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
+ */
+ function isSpace(charCode) {
+ return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
+ (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
+ }
+
+ /**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+ function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * An implementation of `_.uniq` optimized for sorted arrays without support
+ * for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+ function sortedUniq(array, iteratee) {
+ var seen,
+ index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (!index || seen !== computed) {
+ seen = computed;
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the first non-whitespace character.
+ */
+ function trimmedLeftIndex(string) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && isSpace(string.charCodeAt(index))) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
+ */
+ function trimmedRightIndex(string) {
+ var index = string.length;
+
+ while (index-- && isSpace(string.charCodeAt(index))) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.unescape` to convert HTML entities to characters.
+ *
+ * @private
+ * @param {string} chr The matched character to unescape.
+ * @returns {string} Returns the unescaped character.
+ */
+ function unescapeHtmlChar(chr) {
+ return htmlUnescapes[chr];
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * Create a new pristine `lodash` function using the given `context` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} [context=root] The context object.
+ * @returns {Function} Returns a new `lodash` function.
+ * @example
+ *
+ * _.mixin({ 'foo': _.constant('foo') });
+ *
+ * var lodash = _.runInContext();
+ * lodash.mixin({ 'bar': lodash.constant('bar') });
+ *
+ * _.isFunction(_.foo);
+ * // => true
+ * _.isFunction(_.bar);
+ * // => false
+ *
+ * lodash.isFunction(lodash.foo);
+ * // => false
+ * lodash.isFunction(lodash.bar);
+ * // => true
+ *
+ * // using `context` to mock `Date#getTime` use in `_.now`
+ * var mock = _.runInContext({
+ * 'Date': function() {
+ * return { 'getTime': getTimeMock };
+ * }
+ * });
+ *
+ * // or creating a suped-up `defer` in Node.js
+ * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
+ */
+ function runInContext(context) {
+ // Avoid issues with some ES3 environments that attempt to use values, named
+ // after built-in constructors like `Object`, for the creation of literals.
+ // ES5 clears this up by stating that literals must use built-in constructors.
+ // See https://es5.github.io/#x11.1.5 for more details.
+ context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
+
+ /** Native constructor references. */
+ var Array = context.Array,
+ Date = context.Date,
+ Error = context.Error,
+ Function = context.Function,
+ Math = context.Math,
+ Number = context.Number,
+ Object = context.Object,
+ RegExp = context.RegExp,
+ String = context.String,
+ TypeError = context.TypeError;
+
+ /** Used for native method references. */
+ var arrayProto = Array.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype;
+
+ /** Used to resolve the decompiled source of functions. */
+ var fnToString = Function.prototype.toString;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty = objectProto.hasOwnProperty;
+
+ /** Used to generate unique IDs. */
+ var idCounter = 0;
+
+ /**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+ var objToString = objectProto.toString;
+
+ /** Used to restore the original `_` reference in `_.noConflict`. */
+ var oldDash = root._;
+
+ /** Used to detect if a method is native. */
+ var reIsNative = RegExp('^' +
+ fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+ );
+
+ /** Native method references. */
+ var ArrayBuffer = context.ArrayBuffer,
+ clearTimeout = context.clearTimeout,
+ parseFloat = context.parseFloat,
+ pow = Math.pow,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
+ Set = getNative(context, 'Set'),
+ setTimeout = context.setTimeout,
+ splice = arrayProto.splice,
+ Uint8Array = context.Uint8Array,
+ WeakMap = getNative(context, 'WeakMap');
+
+ /* Native method references for those with the same name as other `lodash` methods. */
+ var nativeCeil = Math.ceil,
+ nativeCreate = getNative(Object, 'create'),
+ nativeFloor = Math.floor,
+ nativeIsArray = getNative(Array, 'isArray'),
+ nativeIsFinite = context.isFinite,
+ nativeKeys = getNative(Object, 'keys'),
+ nativeMax = Math.max,
+ nativeMin = Math.min,
+ nativeNow = getNative(Date, 'now'),
+ nativeParseInt = context.parseInt,
+ nativeRandom = Math.random;
+
+ /** Used as references for `-Infinity` and `Infinity`. */
+ var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
+ POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+ /** Used as references for the maximum length and index of an array. */
+ var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+ /**
+ * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+ var MAX_SAFE_INTEGER = 9007199254740991;
+
+ /** Used to store function metadata. */
+ var metaMap = WeakMap && new WeakMap;
+
+ /** Used to lookup unminified function names. */
+ var realNames = {};
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that retrieve a single value or may return a
+ * primitive value will automatically end the chain returning the unwrapped
+ * value. Explicit chaining may be enabled using `_.chain`. The execution of
+ * chained methods is lazy, that is, execution is deferred until `_#value`
+ * is implicitly or explicitly called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization strategy which merge iteratee calls; this can help
+ * to avoid the creation of intermediate data structures and greatly reduce the
+ * number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
+ * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
+ * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
+ * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
+ * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
+ * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
+ * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
+ * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
+ * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
+ * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
+ * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
+ * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
+ * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
+ * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
+ * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
+ * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
+ * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
+ * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
+ * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
+ * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
+ * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
+ * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
+ * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
+ * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
+ * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
+ * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
+ * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
+ * `unescape`, `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+ function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+ }
+
+ /**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+ function baseLodash() {
+ // No operation performed.
+ }
+
+ /**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+ function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+ }
+
+ /**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+ var support = lodash.support = {};
+
+ /**
+ * By default, the template delimiters used by lodash are like those in
+ * embedded Ruby (ERB). Change the following template settings to use
+ * alternative delimiters.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+ lodash.templateSettings = {
+
+ /**
+ * Used to detect `data` property values to be HTML-escaped.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'escape': reEscape,
+
+ /**
+ * Used to detect code to be evaluated.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'evaluate': reEvaluate,
+
+ /**
+ * Used to detect `data` property values to inject.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'interpolate': reInterpolate,
+
+ /**
+ * Used to reference the data object in the template text.
+ *
+ * @memberOf _.templateSettings
+ * @type string
+ */
+ 'variable': '',
+
+ /**
+ * Used to import variables into the compiled template.
+ *
+ * @memberOf _.templateSettings
+ * @type Object
+ */
+ 'imports': {
+
+ /**
+ * A reference to the `lodash` function.
+ *
+ * @memberOf _.templateSettings.imports
+ * @type Function
+ */
+ '_': lodash
+ }
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+ function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = [];
+ this.__dir__ = 1;
+ this.__filtered__ = false;
+ this.__iteratees__ = [];
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = [];
+ }
+
+ /**
+ * Creates a clone of the lazy wrapper object.
+ *
+ * @private
+ * @name clone
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the cloned `LazyWrapper` object.
+ */
+ function lazyClone() {
+ var result = new LazyWrapper(this.__wrapped__);
+ result.__actions__ = arrayCopy(this.__actions__);
+ result.__dir__ = this.__dir__;
+ result.__filtered__ = this.__filtered__;
+ result.__iteratees__ = arrayCopy(this.__iteratees__);
+ result.__takeCount__ = this.__takeCount__;
+ result.__views__ = arrayCopy(this.__views__);
+ return result;
+ }
+
+ /**
+ * Reverses the direction of lazy iteration.
+ *
+ * @private
+ * @name reverse
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the new reversed `LazyWrapper` object.
+ */
+ function lazyReverse() {
+ if (this.__filtered__) {
+ var result = new LazyWrapper(this);
+ result.__dir__ = -1;
+ result.__filtered__ = true;
+ } else {
+ result = this.clone();
+ result.__dir__ *= -1;
+ }
+ return result;
+ }
+
+ /**
+ * Extracts the unwrapped value from its lazy wrapper.
+ *
+ * @private
+ * @name value
+ * @memberOf LazyWrapper
+ * @returns {*} Returns the unwrapped value.
+ */
+ function lazyValue() {
+ var array = this.__wrapped__.value(),
+ dir = this.__dir__,
+ isArr = isArray(array),
+ isRight = dir < 0,
+ arrLength = isArr ? array.length : 0,
+ view = getView(0, arrLength, this.__views__),
+ start = view.start,
+ end = view.end,
+ length = end - start,
+ index = isRight ? end : (start - 1),
+ iteratees = this.__iteratees__,
+ iterLength = iteratees.length,
+ resIndex = 0,
+ takeCount = nativeMin(length, this.__takeCount__);
+
+ if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
+ return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
+ }
+ var result = [];
+
+ outer:
+ while (length-- && resIndex < takeCount) {
+ index += dir;
+
+ var iterIndex = -1,
+ value = array[index];
+
+ while (++iterIndex < iterLength) {
+ var data = iteratees[iterIndex],
+ iteratee = data.iteratee,
+ type = data.type,
+ computed = iteratee(value);
+
+ if (type == LAZY_MAP_FLAG) {
+ value = computed;
+ } else if (!computed) {
+ if (type == LAZY_FILTER_FLAG) {
+ continue outer;
+ } else {
+ break outer;
+ }
+ }
+ }
+ result[resIndex++] = value;
+ }
+ return result;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a cache object to store key/value pairs.
+ *
+ * @private
+ * @static
+ * @name Cache
+ * @memberOf _.memoize
+ */
+ function MapCache() {
+ this.__data__ = {};
+ }
+
+ /**
+ * Removes `key` and its value from the cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
+ */
+ function mapDelete(key) {
+ return this.has(key) && delete this.__data__[key];
+ }
+
+ /**
+ * Gets the cached value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the cached value.
+ */
+ function mapGet(key) {
+ return key == '__proto__' ? undefined : this.__data__[key];
+ }
+
+ /**
+ * Checks if a cached value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+ function mapHas(key) {
+ return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
+ }
+
+ /**
+ * Sets `value` to `key` of the cache.
+ *
+ * @private
+ * @name set
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to cache.
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache object.
+ */
+ function mapSet(key, value) {
+ if (key != '__proto__') {
+ this.__data__[key] = value;
+ }
+ return this;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+ function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+ }
+
+ /**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+ function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+ }
+
+ /**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+ function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a new array joining `array` with `other`.
+ *
+ * @private
+ * @param {Array} array The array to join.
+ * @param {Array} other The other array to join.
+ * @returns {Array} Returns the new concatenated array.
+ */
+ function arrayConcat(array, other) {
+ var index = -1,
+ length = array.length,
+ othIndex = -1,
+ othLength = other.length,
+ result = Array(length + othLength);
+
+ while (++index < length) {
+ result[index] = array[index];
+ }
+ while (++othIndex < othLength) {
+ result[index++] = other[othIndex];
+ }
+ return result;
+ }
+
+ /**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.forEachRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayEachRight(array, iteratee) {
+ var length = array.length;
+
+ while (length--) {
+ if (iteratee(array[length], length, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+ function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+ * with one argument: (value).
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function arrayExtremum(array, iteratee, comparator, exValue) {
+ var index = -1,
+ length = array.length,
+ computed = exValue,
+ result = computed;
+
+ while (++index < length) {
+ var value = array[index],
+ current = +iteratee(value);
+
+ if (comparator(current, computed)) {
+ computed = current;
+ result = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+ function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+ function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+ }
+
+ /**
+ * Appends the elements of `values` to `array`.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to append.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayPush(array, values) {
+ var index = -1,
+ length = values.length,
+ offset = array.length;
+
+ while (++index < length) {
+ array[offset + index] = values[index];
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+ function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+ }
+
+ /**
+ * A specialized version of `_.reduceRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the last element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+ function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
+ var length = array.length;
+ if (initFromArray && length) {
+ accumulator = array[--length];
+ }
+ while (length--) {
+ accumulator = iteratee(accumulator, array[length], length, array);
+ }
+ return accumulator;
+ }
+
+ /**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+ function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * A specialized version of `_.sum` for arrays without support for callback
+ * shorthands and `this` binding..
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+ function arraySum(array, iteratee) {
+ var length = array.length,
+ result = 0;
+
+ while (length--) {
+ result += +iteratee(array[length]) || 0;
+ }
+ return result;
+ }
+
+ /**
+ * Used by `_.defaults` to customize its `_.assign` use.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+ function assignDefaults(objectValue, sourceValue) {
+ return objectValue === undefined ? sourceValue : objectValue;
+ }
+
+ /**
+ * Used by `_.template` to customize its `_.assign` use.
+ *
+ * **Note:** This function is like `assignDefaults` except that it ignores
+ * inherited property values when checking if a property is `undefined`.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @param {string} key The key associated with the object and source values.
+ * @param {Object} object The destination object.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+ function assignOwnDefaults(objectValue, sourceValue, key, object) {
+ return (objectValue === undefined || !hasOwnProperty.call(object, key))
+ ? sourceValue
+ : objectValue;
+ }
+
+ /**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+ function assignWith(object, source, customizer) {
+ var index = -1,
+ props = keys(source),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+ }
+
+ /**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+ function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+ }
+
+ /**
+ * The base implementation of `_.at` without support for string collections
+ * and individual key arguments.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {number[]|string[]} props The property names or indexes of elements to pick.
+ * @returns {Array} Returns the new array of picked elements.
+ */
+ function baseAt(collection, props) {
+ var index = -1,
+ isNil = collection == null,
+ isArr = !isNil && isArrayLike(collection),
+ length = isArr ? collection.length : 0,
+ propsLength = props.length,
+ result = Array(propsLength);
+
+ while(++index < propsLength) {
+ var key = props[index];
+ if (isArr) {
+ result[index] = isIndex(key, length) ? collection[key] : undefined;
+ } else {
+ result[index] = isNil ? undefined : collection[key];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+ function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+ }
+
+ /**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+ function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+ }
+
+ /**
+ * The base implementation of `_.clone` without support for argument juggling
+ * and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The object `value` belongs to.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates clones with source counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+ function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+ var result;
+ if (customizer) {
+ result = object ? customizer(value, key, object) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return arrayCopy(value, result);
+ }
+ } else {
+ var tag = objToString.call(value),
+ isFunc = tag == funcTag;
+
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ result = initCloneObject(isFunc ? {} : value);
+ if (!isDeep) {
+ return baseAssign(result, value);
+ }
+ } else {
+ return cloneableTags[tag]
+ ? initCloneByTag(value, tag, isDeep)
+ : (object ? value : {});
+ }
+ }
+ // Check for circular references and return its corresponding clone.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == value) {
+ return stackB[length];
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate it with its clone.
+ stackA.push(value);
+ stackB.push(result);
+
+ // Recursively populate clone (susceptible to call stack limits).
+ (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+ result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+ var baseCreate = (function() {
+ function object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = undefined;
+ }
+ return result || {};
+ };
+ }());
+
+ /**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+ function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+ }
+
+ /**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+ function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = getIndexOf(),
+ isCommon = indexOf == baseIndexOf,
+ cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+ var baseEach = createBaseEach(baseForOwn);
+
+ /**
+ * The base implementation of `_.forEachRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+ var baseEachRight = createBaseEach(baseForOwnRight, true);
+
+ /**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+ function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+ }
+
+ /**
+ * Gets the extremum value of `collection` invoking `iteratee` for each value
+ * in `collection` to generate the criterion by which the value is ranked.
+ * The `iteratee` is invoked with three arguments: (value, index|key, collection).
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function baseExtremum(collection, iteratee, comparator, exValue) {
+ var computed = exValue,
+ result = computed;
+
+ baseEach(collection, function(value, index, collection) {
+ var current = +iteratee(value, index, collection);
+ if (comparator(current, computed) || (current === exValue && current === result)) {
+ computed = current;
+ result = value;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.fill` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ */
+ function baseFill(array, value, start, end) {
+ var length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : (end >>> 0);
+ start >>>= 0;
+
+ while (start < length) {
+ array[start++] = value;
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+ function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+ function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @param {Array} [result=[]] The initial result value.
+ * @returns {Array} Returns the new flattened array.
+ */
+ function baseFlatten(array, isDeep, isStrict, result) {
+ result || (result = []);
+
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ baseFlatten(value, isDeep, isStrict, result);
+ } else {
+ arrayPush(result, value);
+ }
+ } else if (!isStrict) {
+ result[result.length] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+ var baseFor = createBaseFor();
+
+ /**
+ * This function is like `baseFor` except that it iterates over properties
+ * in the opposite order.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+ var baseForRight = createBaseFor(true);
+
+ /**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+ }
+
+ /**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+ }
+
+ /**
+ * The base implementation of `_.forOwnRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForOwnRight(object, iteratee) {
+ return baseForRight(object, iteratee, keys);
+ }
+
+ /**
+ * The base implementation of `_.functions` which creates an array of
+ * `object` function property names filtered from those provided.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The property names to filter.
+ * @returns {Array} Returns the new array of filtered property names.
+ */
+ function baseFunctions(object, props) {
+ var index = -1,
+ length = props.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var key = props[index];
+ if (isFunction(object[key])) {
+ result[++resIndex] = key;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+ function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = object[path[index++]];
+ }
+ return (index && index == length) ? object : undefined;
+ }
+
+ /**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+ function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+ }
+
+ /**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+ function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+ function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+ function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
+
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ return function(object) {
+ return baseIsMatch(object, matchData);
+ };
+ }
+
+ /**
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+ function baseMatchesProperty(path, srcValue) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
+ };
+ }
+
+ /**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merged values.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+ function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
+ props = isSrcArr ? undefined : keys(source);
+
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((result !== undefined || (isSrcArr && !(key in object))) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+ }
+
+ /**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merged values.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+ }
+
+ /**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+ function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+ }
+
+ /**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+ function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+ }
+
+ /**
+ * The base implementation of `_.pullAt` without support for individual
+ * index arguments and capturing the removed elements.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {number[]} indexes The indexes of elements to remove.
+ * @returns {Array} Returns `array`.
+ */
+ function basePullAt(array, indexes) {
+ var length = array ? indexes.length : 0;
+ while (length--) {
+ var index = indexes[length];
+ if (index != previous && isIndex(index)) {
+ var previous = index;
+ splice.call(array, index, 1);
+ }
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.random` without support for argument juggling
+ * and returning floating-point numbers.
+ *
+ * @private
+ * @param {number} min The minimum possible value.
+ * @param {number} max The maximum possible value.
+ * @returns {number} Returns the random number.
+ */
+ function baseRandom(min, max) {
+ return min + nativeFloor(nativeRandom() * (max - min + 1));
+ }
+
+ /**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+ function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+ }
+
+ /**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+ var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+ };
+
+ /**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+ function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+ }
+
+ /**
+ * The base implementation of `_.sortBy` which uses `comparer` to define
+ * the sort order of `array` and replaces criteria objects with their
+ * corresponding values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */
+ function baseSortBy(array, comparer) {
+ var length = array.length;
+
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.sortByOrder` without param guards.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} orders The sort orders of `iteratees`.
+ * @returns {Array} Returns the new sorted array.
+ */
+ function baseSortByOrder(collection, iteratees, orders) {
+ var callback = getCallback(),
+ index = -1;
+
+ iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });
+
+ var result = baseMap(collection, function(value) {
+ var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
+ });
+
+ return baseSortBy(result, function(object, other) {
+ return compareMultiple(object, other, orders);
+ });
+ }
+
+ /**
+ * The base implementation of `_.sum` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+ function baseSum(collection, iteratee) {
+ var result = 0;
+ baseEach(collection, function(value, index, collection) {
+ result += +iteratee(value, index, collection) || 0;
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.uniq` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+ function baseUniq(array, iteratee) {
+ var index = -1,
+ indexOf = getIndexOf(),
+ length = array.length,
+ isCommon = indexOf == baseIndexOf,
+ isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
+ seen = isLarge ? createCache() : null,
+ result = [];
+
+ if (seen) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ } else {
+ isLarge = false;
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (isCommon && value === value) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (indexOf(seen, computed, 0) < 0) {
+ if (iteratee || isLarge) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+ function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
+ * and `_.takeWhile` without support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function baseWhile(array, predicate, isDrop, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
+ return isDrop
+ ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
+ : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
+ }
+
+ /**
+ * The base implementation of `wrapperValue` which returns the result of
+ * performing a sequence of actions on the unwrapped `value`, where each
+ * successive action is supplied the return value of the previous.
+ *
+ * @private
+ * @param {*} value The unwrapped value.
+ * @param {Array} actions Actions to peform to resolve the unwrapped value.
+ * @returns {*} Returns the resolved value.
+ */
+ function baseWrapperValue(value, actions) {
+ var result = value;
+ if (result instanceof LazyWrapper) {
+ result = result.value();
+ }
+ var index = -1,
+ length = actions.length;
+
+ while (++index < length) {
+ var action = actions[index];
+ result = action.func.apply(action.thisArg, arrayPush([result], action.args));
+ }
+ return result;
+ }
+
+ /**
+ * Performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+ function binaryIndex(array, value, retHighest) {
+ var low = 0,
+ high = array ? array.length : low;
+
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return binaryIndexBy(array, value, identity, retHighest);
+ }
+
+ /**
+ * This function is like `binaryIndex` except that it invokes `iteratee` for
+ * `value` and each element of `array` to compute their sort ranking. The
+ * iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+ function binaryIndexBy(array, value, iteratee, retHighest) {
+ value = iteratee(value);
+
+ var low = 0,
+ high = array ? array.length : 0,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsUndef = value === undefined;
+
+ while (low < high) {
+ var mid = nativeFloor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
+ isReflexive = computed === computed;
+
+ if (valIsNaN) {
+ var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
+ } else if (valIsUndef) {
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? (computed <= value) : (computed < value);
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+ }
+
+ /**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+ function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ }
+
+ /**
+ * Creates a clone of the given array buffer.
+ *
+ * @private
+ * @param {ArrayBuffer} buffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+ function bufferClone(buffer) {
+ var result = new ArrayBuffer(buffer.byteLength),
+ view = new Uint8Array(result);
+
+ view.set(new Uint8Array(buffer));
+ return result;
+ }
+
+ /**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+ function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+ }
+
+ /**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+ function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+ }
+
+ /**
+ * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+ function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+ function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+ }
+
+ /**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+ function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+ }
+
+ /**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+ function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+ function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+ function createCache(values) {
+ return (nativeCreate && Set) ? new SetCache(values) : null;
+ }
+
+ /**
+ * Creates a function that produces compound words out of the words in a
+ * given string.
+ *
+ * @private
+ * @param {Function} callback The function to combine each word.
+ * @returns {Function} Returns the new compounder function.
+ */
+ function createCompounder(callback) {
+ return function(string) {
+ var index = -1,
+ array = words(deburr(string)),
+ length = array.length,
+ result = '';
+
+ while (++index < length) {
+ result = callback(result, array[index], index);
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createCtorWrapper(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
+ case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+ }
+
+ /**
+ * Creates a `_.curry` or `_.curryRight` function.
+ *
+ * @private
+ * @param {boolean} flag The curry bit flag.
+ * @returns {Function} Returns the new curry function.
+ */
+ function createCurry(flag) {
+ function curryFunc(func, arity, guard) {
+ if (guard && isIterateeCall(func, arity, guard)) {
+ arity = undefined;
+ }
+ var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
+ result.placeholder = curryFunc.placeholder;
+ return result;
+ }
+ return curryFunc;
+ }
+
+ /**
+ * Creates a `_.defaults` or `_.defaultsDeep` function.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Function} Returns the new defaults function.
+ */
+ function createDefaults(assigner, customizer) {
+ return restParam(function(args) {
+ var object = args[0];
+ if (object == null) {
+ return object;
+ }
+ args.push(customizer);
+ return assigner.apply(undefined, args);
+ });
+ }
+
+ /**
+ * Creates a `_.max` or `_.min` function.
+ *
+ * @private
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {Function} Returns the new extremum function.
+ */
+ function createExtremum(comparator, exValue) {
+ return function(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = undefined;
+ }
+ iteratee = getCallback(iteratee, thisArg, 3);
+ if (iteratee.length == 1) {
+ collection = isArray(collection) ? collection : toIterable(collection);
+ var result = arrayExtremum(collection, iteratee, comparator, exValue);
+ if (!(collection.length && result === exValue)) {
+ return result;
+ }
+ }
+ return baseExtremum(collection, iteratee, comparator, exValue);
+ };
+ }
+
+ /**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+ }
+
+ /**
+ * Creates a `_.findIndex` or `_.findLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFindIndex(fromRight) {
+ return function(array, predicate, thisArg) {
+ if (!(array && array.length)) {
+ return -1;
+ }
+ predicate = getCallback(predicate, thisArg, 3);
+ return baseFindIndex(array, predicate, fromRight);
+ };
+ }
+
+ /**
+ * Creates a `_.findKey` or `_.findLastKey` function.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFindKey(objectFunc) {
+ return function(object, predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 3);
+ return baseFind(object, predicate, objectFunc, true);
+ };
+ }
+
+ /**
+ * Creates a `_.flow` or `_.flowRight` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new flow function.
+ */
+ function createFlow(fromRight) {
+ return function() {
+ var wrapper,
+ length = arguments.length,
+ index = fromRight ? length : -1,
+ leftIndex = 0,
+ funcs = Array(length);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var func = funcs[leftIndex++] = arguments[index];
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+ wrapper = new LodashWrapper([], true);
+ }
+ }
+ index = wrapper ? -1 : length;
+ while (++index < length) {
+ func = funcs[index];
+
+ var funcName = getFuncName(func),
+ data = funcName == 'wrapper' ? getData(func) : undefined;
+
+ if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
+ wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
+ } else {
+ wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
+ }
+ }
+ return function() {
+ var args = arguments,
+ value = args[0];
+
+ if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
+ return wrapper.plant(value).value();
+ }
+ var index = 0,
+ result = length ? funcs[index].apply(this, args) : value;
+
+ while (++index < length) {
+ result = funcs[index].call(this, result);
+ }
+ return result;
+ };
+ };
+ }
+
+ /**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+ }
+
+ /**
+ * Creates a function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForIn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee, keysIn);
+ };
+ }
+
+ /**
+ * Creates a function for `_.forOwn` or `_.forOwnRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForOwn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee);
+ };
+ }
+
+ /**
+ * Creates a function for `_.mapKeys` or `_.mapValues`.
+ *
+ * @private
+ * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
+ * @returns {Function} Returns the new map function.
+ */
+ function createObjectMapper(isMapKeys) {
+ return function(object, iteratee, thisArg) {
+ var result = {};
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ baseForOwn(object, function(value, key, object) {
+ var mapped = iteratee(value, key, object);
+ key = isMapKeys ? mapped : key;
+ value = isMapKeys ? value : mapped;
+ result[key] = value;
+ });
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function for `_.padLeft` or `_.padRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify padding from the right.
+ * @returns {Function} Returns the new pad function.
+ */
+ function createPadDir(fromRight) {
+ return function(string, length, chars) {
+ string = baseToString(string);
+ return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
+ };
+ }
+
+ /**
+ * Creates a `_.partial` or `_.partialRight` function.
+ *
+ * @private
+ * @param {boolean} flag The partial bit flag.
+ * @returns {Function} Returns the new partial function.
+ */
+ function createPartial(flag) {
+ var partialFunc = restParam(function(func, partials) {
+ var holders = replaceHolders(partials, partialFunc.placeholder);
+ return createWrapper(func, flag, undefined, partials, holders);
+ });
+ return partialFunc;
+ }
+
+ /**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+ function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? undefined : createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : undefined,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : undefined,
+ newHoldersRight = isCurry ? undefined : argsHolders,
+ newPartials = isCurry ? args : undefined,
+ newPartialsRight = isCurry ? undefined : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ if (this && this !== root && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates the padding required for `string` based on the given `length`.
+ * The `chars` string is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the pad for `string`.
+ */
+ function createPadding(string, length, chars) {
+ var strLength = string.length;
+ length = +length;
+
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return '';
+ }
+ var padLength = length - strLength;
+ chars = chars == null ? ' ' : (chars + '');
+ return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+ function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(leftLength + argsLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates a `_.ceil`, `_.floor`, or `_.round` function.
+ *
+ * @private
+ * @param {string} methodName The name of the `Math` method to use when rounding.
+ * @returns {Function} Returns the new round function.
+ */
+ function createRound(methodName) {
+ var func = Math[methodName];
+ return function(number, precision) {
+ precision = precision === undefined ? 0 : (+precision || 0);
+ if (precision) {
+ precision = pow(10, precision);
+ return func(number * precision) / precision;
+ }
+ return func(number);
+ };
+ }
+
+ /**
+ * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {Function} Returns the new index function.
+ */
+ function createSortedIndex(retHighest) {
+ return function(array, value, iteratee, thisArg) {
+ var callback = getCallback(iteratee);
+ return (iteratee == null && callback === baseCallback)
+ ? binaryIndex(array, value, retHighest)
+ : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
+ };
+ }
+
+ /**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = undefined;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = undefined;
+ }
+ var data = isBindKey ? undefined : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+ function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Gets the appropriate "callback" function. If the `_.callback` method is
+ * customized this function returns the custom method, otherwise it returns
+ * the `baseCallback` function. If arguments are provided the chosen function
+ * is invoked with them and its result is returned.
+ *
+ * @private
+ * @returns {Function} Returns the chosen function or its result.
+ */
+ function getCallback(func, thisArg, argCount) {
+ var result = lodash.callback || callback;
+ result = result === callback ? baseCallback : result;
+ return argCount ? result(func, thisArg, argCount) : result;
+ }
+
+ /**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+ var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+ };
+
+ /**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+ function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
+ * customized this function returns the custom method, otherwise it returns
+ * the `baseIndexOf` function. If arguments are provided the chosen function
+ * is invoked with them and its result is returned.
+ *
+ * @private
+ * @returns {Function|number} Returns the chosen function or its result.
+ */
+ function getIndexOf(collection, target, fromIndex) {
+ var result = lodash.indexOf || indexOf;
+ result = result === indexOf ? baseIndexOf : result;
+ return collection ? result(collection, target, fromIndex) : result;
+ }
+
+ /**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+ var getLength = baseProperty('length');
+
+ /**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+ function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+ }
+
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+ function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+ }
+
+ /**
+ * Gets the view, applying any `transforms` to the `start` and `end` positions.
+ *
+ * @private
+ * @param {number} start The start of the view.
+ * @param {number} end The end of the view.
+ * @param {Array} transforms The transformations to apply to the view.
+ * @returns {Object} Returns an object containing the `start` and `end`
+ * positions of the view.
+ */
+ function getView(start, end, transforms) {
+ var index = -1,
+ length = transforms.length;
+
+ while (++index < length) {
+ var data = transforms[index],
+ size = data.size;
+
+ switch (data.type) {
+ case 'drop': start += size; break;
+ case 'dropRight': end -= size; break;
+ case 'take': end = nativeMin(end, start + size); break;
+ case 'takeRight': start = nativeMax(start, end - size); break;
+ }
+ }
+ return { 'start': start, 'end': end };
+ }
+
+ /**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+ function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add array properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+ }
+
+ /**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneObject(object) {
+ var Ctor = object.constructor;
+ if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+ Ctor = Object;
+ }
+ return new Ctor;
+ }
+
+ /**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return bufferClone(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ var buffer = object.buffer;
+ return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ var result = new Ctor(object.source, reFlags.exec(object));
+ result.lastIndex = object.lastIndex;
+ }
+ return result;
+ }
+
+ /**
+ * Invokes the method at `path` on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {Array} args The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ */
+ function invokePath(object, path, args) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ path = last(path);
+ }
+ var func = object == null ? object : object[path];
+ return func == null ? undefined : func.apply(object, args);
+ }
+
+ /**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+ function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+ }
+
+ /**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+ function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+ }
+
+ /**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+ function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+ }
+
+ /**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+ function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+ }
+
+ /**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+ function isLaziable(func) {
+ var funcName = getFuncName(func);
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+ }
+
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+ function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+ }
+
+ /**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+ function isStrictComparable(value) {
+ return value === value && !isObject(value);
+ }
+
+ /**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+ function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+ }
+
+ /**
+ * Used by `_.defaultsDeep` to customize its `_.merge` use.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+ function mergeDefaults(objectValue, sourceValue) {
+ return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
+ }
+
+ /**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+ function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+ function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+ function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+ }
+
+ /**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+ var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+ }());
+
+ /**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+ function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Converts `value` to an array-like object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array|Object} Returns the array-like object.
+ */
+ function toIterable(value) {
+ if (value == null) {
+ return [];
+ }
+ if (!isArrayLike(value)) {
+ return values(value);
+ }
+ return isObject(value) ? value : Object(value);
+ }
+
+ /**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+ function toObject(value) {
+ return isObject(value) ? value : Object(value);
+ }
+
+ /**
+ * Converts `value` to property path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+ function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+ }
+
+ /**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+ function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates an array of elements split into groups the length of `size`.
+ * If `collection` can't be split evenly, the final chunk will be the remaining
+ * elements.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to process.
+ * @param {number} [size=1] The length of each chunk.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new array containing chunks.
+ * @example
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 2);
+ * // => [['a', 'b'], ['c', 'd']]
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 3);
+ * // => [['a', 'b', 'c'], ['d']]
+ */
+ function chunk(array, size, guard) {
+ if (guard ? isIterateeCall(array, size, guard) : size == null) {
+ size = 1;
+ } else {
+ size = nativeMax(nativeFloor(size) || 1, 1);
+ }
+ var index = 0,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = Array(nativeCeil(length / size));
+
+ while (index < length) {
+ result[++resIndex] = baseSlice(array, index, (index += size));
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array with all falsey values removed. The values `false`, `null`,
+ * `0`, `""`, `undefined`, and `NaN` are falsey.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to compact.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.compact([0, 1, false, 2, '', 3]);
+ * // => [1, 2, 3]
+ */
+ function compact(array) {
+ var index = -1,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (value) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The arrays of values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.difference([1, 2, 3], [4, 2]);
+ * // => [1, 3]
+ */
+ var difference = restParam(function(array, values) {
+ return (isObjectLike(array) && isArrayLike(array))
+ ? baseDifference(array, baseFlatten(values, false, true))
+ : [];
+ });
+
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.drop([1, 2, 3]);
+ * // => [2, 3]
+ *
+ * _.drop([1, 2, 3], 2);
+ * // => [3]
+ *
+ * _.drop([1, 2, 3], 5);
+ * // => []
+ *
+ * _.drop([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+ function drop(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRight([1, 2, 3]);
+ * // => [1, 2]
+ *
+ * _.dropRight([1, 2, 3], 2);
+ * // => [1]
+ *
+ * _.dropRight([1, 2, 3], 5);
+ * // => []
+ *
+ * _.dropRight([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+ function dropRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` excluding elements dropped from the end.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that match the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [1]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function dropRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)
+ : [];
+ }
+
+ /**
+ * Creates a slice of `array` excluding elements dropped from the beginning.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active', false), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function dropWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), true)
+ : [];
+ }
+
+ /**
+ * Fills elements of `array` with `value` from `start` up to, but not
+ * including, `end`.
+ *
+ * **Note:** This method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.fill(array, 'a');
+ * console.log(array);
+ * // => ['a', 'a', 'a']
+ *
+ * _.fill(Array(3), 2);
+ * // => [2, 2, 2]
+ *
+ * _.fill([4, 6, 8], '*', 1, 2);
+ * // => [4, '*', 8]
+ */
+ function fill(array, value, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
+ start = 0;
+ end = length;
+ }
+ return baseFill(array, value, start, end);
+ }
+
+ /**
+ * This method is like `_.find` except that it returns the index of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.findIndex(users, function(chr) {
+ * return chr.user == 'barney';
+ * });
+ * // => 0
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
+ * // => 1
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findIndex(users, 'active', false);
+ * // => 0
+ *
+ * // using the `_.property` callback shorthand
+ * _.findIndex(users, 'active');
+ * // => 2
+ */
+ var findIndex = createFindIndex();
+
+ /**
+ * This method is like `_.findIndex` except that it iterates over elements
+ * of `collection` from right to left.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.findLastIndex(users, function(chr) {
+ * return chr.user == 'pebbles';
+ * });
+ * // => 2
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+ * // => 0
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastIndex(users, 'active', false);
+ * // => 2
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastIndex(users, 'active');
+ * // => 0
+ */
+ var findLastIndex = createFindIndex(true);
+
+ /**
+ * Gets the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias head
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the first element of `array`.
+ * @example
+ *
+ * _.first([1, 2, 3]);
+ * // => 1
+ *
+ * _.first([]);
+ * // => undefined
+ */
+ function first(array) {
+ return array ? array[0] : undefined;
+ }
+
+ /**
+ * Flattens a nested array. If `isDeep` is `true` the array is recursively
+ * flattened, otherwise it is only flattened a single level.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flatten([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, [4]]
+ *
+ * // using `isDeep`
+ * _.flatten([1, [2, 3, [4]]], true);
+ * // => [1, 2, 3, 4]
+ */
+ function flatten(array, isDeep, guard) {
+ var length = array ? array.length : 0;
+ if (guard && isIterateeCall(array, isDeep, guard)) {
+ isDeep = false;
+ }
+ return length ? baseFlatten(array, isDeep) : [];
+ }
+
+ /**
+ * Recursively flattens a nested array.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to recursively flatten.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flattenDeep([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, 4]
+ */
+ function flattenDeep(array) {
+ var length = array ? array.length : 0;
+ return length ? baseFlatten(array, true) : [];
+ }
+
+ /**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+ * to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ *
+ * // performing a binary search
+ * _.indexOf([1, 1, 2, 2], 2, true);
+ * // => 2
+ */
+ function indexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ if (typeof fromIndex == 'number') {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+ } else if (fromIndex) {
+ var index = binaryIndex(array, value);
+ if (index < length &&
+ (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
+ return index;
+ }
+ return -1;
+ }
+ return baseIndexOf(array, value, fromIndex || 0);
+ }
+
+ /**
+ * Gets all but the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.initial([1, 2, 3]);
+ * // => [1, 2]
+ */
+ function initial(array) {
+ return dropRight(array, 1);
+ }
+
+ /**
+ * Creates an array of unique values that are included in all of the provided
+ * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of shared values.
+ * @example
+ * _.intersection([1, 2], [4, 2], [2, 1]);
+ * // => [2]
+ */
+ var intersection = restParam(function(arrays) {
+ var othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(length),
+ indexOf = getIndexOf(),
+ isCommon = indexOf == baseIndexOf,
+ result = [];
+
+ while (othIndex--) {
+ var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+ caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
+ }
+ var array = arrays[0],
+ index = -1,
+ length = array ? array.length : 0,
+ seen = caches[0];
+
+ outer:
+ while (++index < length) {
+ value = array[index];
+ if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
+ var othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
+ continue outer;
+ }
+ }
+ if (seen) {
+ seen.push(value);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ });
+
+ /**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+ function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+ }
+
+ /**
+ * This method is like `_.indexOf` except that it iterates over elements of
+ * `array` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=array.length-1] The index to search from
+ * or `true` to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.lastIndexOf([1, 2, 1, 2], 2);
+ * // => 3
+ *
+ * // using `fromIndex`
+ * _.lastIndexOf([1, 2, 1, 2], 2, 2);
+ * // => 1
+ *
+ * // performing a binary search
+ * _.lastIndexOf([1, 1, 2, 2], 2, true);
+ * // => 3
+ */
+ function lastIndexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ var index = length;
+ if (typeof fromIndex == 'number') {
+ index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
+ } else if (fromIndex) {
+ index = binaryIndex(array, value, true) - 1;
+ var other = array[index];
+ if (value === value ? (value === other) : (other !== other)) {
+ return index;
+ }
+ return -1;
+ }
+ if (value !== value) {
+ return indexOfNaN(array, index, true);
+ }
+ while (index--) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Removes all provided values from `array` using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * **Note:** Unlike `_.without`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...*} [values] The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3, 1, 2, 3];
+ *
+ * _.pull(array, 2, 3);
+ * console.log(array);
+ * // => [1, 1]
+ */
+ function pull() {
+ var args = arguments,
+ array = args[0];
+
+ if (!(array && array.length)) {
+ return array;
+ }
+ var index = 0,
+ indexOf = getIndexOf(),
+ length = args.length;
+
+ while (++index < length) {
+ var fromIndex = 0,
+ value = args[index];
+
+ while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
+ splice.call(array, fromIndex, 1);
+ }
+ }
+ return array;
+ }
+
+ /**
+ * Removes elements from `array` corresponding to the given indexes and returns
+ * an array of the removed elements. Indexes may be specified as an array of
+ * indexes or as individual arguments.
+ *
+ * **Note:** Unlike `_.at`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...(number|number[])} [indexes] The indexes of elements to remove,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [5, 10, 15, 20];
+ * var evens = _.pullAt(array, 1, 3);
+ *
+ * console.log(array);
+ * // => [5, 15]
+ *
+ * console.log(evens);
+ * // => [10, 20]
+ */
+ var pullAt = restParam(function(array, indexes) {
+ indexes = baseFlatten(indexes);
+
+ var result = baseAt(array, indexes);
+ basePullAt(array, indexes.sort(baseCompareAscending));
+ return result;
+ });
+
+ /**
+ * Removes all elements from `array` that `predicate` returns truthy for
+ * and returns an array of the removed elements. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * **Note:** Unlike `_.filter`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [1, 2, 3, 4];
+ * var evens = _.remove(array, function(n) {
+ * return n % 2 == 0;
+ * });
+ *
+ * console.log(array);
+ * // => [1, 3]
+ *
+ * console.log(evens);
+ * // => [2, 4]
+ */
+ function remove(array, predicate, thisArg) {
+ var result = [];
+ if (!(array && array.length)) {
+ return result;
+ }
+ var index = -1,
+ indexes = [],
+ length = array.length;
+
+ predicate = getCallback(predicate, thisArg, 3);
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result.push(value);
+ indexes.push(index);
+ }
+ }
+ basePullAt(array, indexes);
+ return result;
+ }
+
+ /**
+ * Gets all but the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias tail
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.rest([1, 2, 3]);
+ * // => [2, 3]
+ */
+ function rest(array) {
+ return drop(array, 1);
+ }
+
+ /**
+ * Creates a slice of `array` from `start` up to, but not including, `end`.
+ *
+ * **Note:** This method is used instead of `Array#slice` to support node
+ * lists in IE < 9 and to ensure dense arrays are returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function slice(array, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
+ start = 0;
+ end = length;
+ }
+ return baseSlice(array, start, end);
+ }
+
+ /**
+ * Uses a binary search to determine the lowest index at which `value` should
+ * be inserted into `array` in order to maintain its sort order. If an iteratee
+ * function is provided it is invoked for `value` and each element of `array`
+ * to compute their sort ranking. The iteratee is bound to `thisArg` and
+ * invoked with one argument; (value).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedIndex([30, 50], 40);
+ * // => 1
+ *
+ * _.sortedIndex([4, 4, 5, 5], 5);
+ * // => 2
+ *
+ * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
+ *
+ * // using an iteratee function
+ * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
+ * return this.data[word];
+ * }, dict);
+ * // => 1
+ *
+ * // using the `_.property` callback shorthand
+ * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
+ * // => 1
+ */
+ var sortedIndex = createSortedIndex();
+
+ /**
+ * This method is like `_.sortedIndex` except that it returns the highest
+ * index at which `value` should be inserted into `array` in order to
+ * maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedLastIndex([4, 4, 5, 5], 5);
+ * // => 4
+ */
+ var sortedLastIndex = createSortedIndex(true);
+
+ /**
+ * Creates a slice of `array` with `n` elements taken from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.take([1, 2, 3]);
+ * // => [1]
+ *
+ * _.take([1, 2, 3], 2);
+ * // => [1, 2]
+ *
+ * _.take([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.take([1, 2, 3], 0);
+ * // => []
+ */
+ function take(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with `n` elements taken from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRight([1, 2, 3]);
+ * // => [3]
+ *
+ * _.takeRight([1, 2, 3], 2);
+ * // => [2, 3]
+ *
+ * _.takeRight([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.takeRight([1, 2, 3], 0);
+ * // => []
+ */
+ function takeRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with elements taken from the end. Elements are
+ * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
+ * and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [2, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active'), 'user');
+ * // => []
+ */
+ function takeRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
+ : [];
+ }
+
+ /**
+ * Creates a slice of `array` with elements taken from the beginning. Elements
+ * are taken until `predicate` returns falsey. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [1, 2]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false},
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active', false), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active'), 'user');
+ * // => []
+ */
+ function takeWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3))
+ : [];
+ }
+
+ /**
+ * Creates an array of unique values, in order, from all of the provided arrays
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.union([1, 2], [4, 2], [2, 1]);
+ * // => [1, 2, 4]
+ */
+ var union = restParam(function(arrays) {
+ return baseUniq(baseFlatten(arrays, false, true));
+ });
+
+ /**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurence of each element
+ * is kept. Providing `true` for `isSorted` performs a faster search algorithm
+ * for sorted arrays. If an iteratee function is provided it is invoked for
+ * each element in the array to generate the criterion by which uniqueness
+ * is computed. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, array).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias unique
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {boolean} [isSorted] Specify the array is sorted.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ *
+ * // using `isSorted`
+ * _.uniq([1, 1, 2], true);
+ * // => [1, 2]
+ *
+ * // using an iteratee function
+ * _.uniq([1, 2.5, 1.5, 2], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => [1, 2.5]
+ *
+ * // using the `_.property` callback shorthand
+ * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+ function uniq(array, isSorted, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (isSorted != null && typeof isSorted != 'boolean') {
+ thisArg = iteratee;
+ iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
+ isSorted = false;
+ }
+ var callback = getCallback();
+ if (!(iteratee == null && callback === baseCallback)) {
+ iteratee = callback(iteratee, thisArg, 3);
+ }
+ return (isSorted && getIndexOf() == baseIndexOf)
+ ? sortedUniq(array, iteratee)
+ : baseUniq(array, iteratee);
+ }
+
+ /**
+ * This method is like `_.zip` except that it accepts an array of grouped
+ * elements and creates an array regrouping the elements to their pre-zip
+ * configuration.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ *
+ * _.unzip(zipped);
+ * // => [['fred', 'barney'], [30, 40], [true, false]]
+ */
+ function unzip(array) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ var index = -1,
+ length = 0;
+
+ array = arrayFilter(array, function(group) {
+ if (isArrayLike(group)) {
+ length = nativeMax(group.length, length);
+ return true;
+ }
+ });
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = arrayMap(array, baseProperty(index));
+ }
+ return result;
+ }
+
+ /**
+ * This method is like `_.unzip` except that it accepts an iteratee to specify
+ * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @param {Function} [iteratee] The function to combine regrouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
+ * // => [[1, 10, 100], [2, 20, 200]]
+ *
+ * _.unzipWith(zipped, _.add);
+ * // => [3, 30, 300]
+ */
+ function unzipWith(array, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ var result = unzip(array);
+ if (iteratee == null) {
+ return result;
+ }
+ iteratee = bindCallback(iteratee, thisArg, 4);
+ return arrayMap(result, function(group) {
+ return arrayReduce(group, iteratee, undefined, true);
+ });
+ }
+
+ /**
+ * Creates an array excluding all provided values using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to filter.
+ * @param {...*} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.without([1, 2, 1, 3], 1, 2);
+ * // => [3]
+ */
+ var without = restParam(function(array, values) {
+ return isArrayLike(array)
+ ? baseDifference(array, values)
+ : [];
+ });
+
+ /**
+ * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * of the provided arrays.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of values.
+ * @example
+ *
+ * _.xor([1, 2], [4, 2]);
+ * // => [1, 4]
+ */
+ function xor() {
+ var index = -1,
+ length = arguments.length;
+
+ while (++index < length) {
+ var array = arguments[index];
+ if (isArrayLike(array)) {
+ var result = result
+ ? arrayPush(baseDifference(result, array), baseDifference(array, result))
+ : array;
+ }
+ }
+ return result ? baseUniq(result) : [];
+ }
+
+ /**
+ * Creates an array of grouped elements, the first of which contains the first
+ * elements of the given arrays, the second of which contains the second elements
+ * of the given arrays, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ */
+ var zip = restParam(unzip);
+
+ /**
+ * The inverse of `_.pairs`; this method returns an object composed from arrays
+ * of property names and values. Provide either a single two dimensional array,
+ * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
+ * and one of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @alias object
+ * @category Array
+ * @param {Array} props The property names.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObject([['fred', 30], ['barney', 40]]);
+ * // => { 'fred': 30, 'barney': 40 }
+ *
+ * _.zipObject(['fred', 'barney'], [30, 40]);
+ * // => { 'fred': 30, 'barney': 40 }
+ */
+ function zipObject(props, values) {
+ var index = -1,
+ length = props ? props.length : 0,
+ result = {};
+
+ if (length && !values && !isArray(props[0])) {
+ values = [];
+ }
+ while (++index < length) {
+ var key = props[index];
+ if (values) {
+ result[key] = values[index];
+ } else if (key) {
+ result[key[0]] = key[1];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * This method is like `_.zip` except that it accepts an iteratee to specify
+ * how grouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @param {Function} [iteratee] The function to combine grouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
+ * // => [111, 222]
+ */
+ var zipWith = restParam(function(arrays) {
+ var length = arrays.length,
+ iteratee = length > 2 ? arrays[length - 2] : undefined,
+ thisArg = length > 1 ? arrays[length - 1] : undefined;
+
+ if (length > 2 && typeof iteratee == 'function') {
+ length -= 2;
+ } else {
+ iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
+ thisArg = undefined;
+ }
+ arrays.length = length;
+ return unzipWith(arrays, iteratee, thisArg);
+ });
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a `lodash` object that wraps `value` with explicit method
+ * chaining enabled.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to wrap.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'pebbles', 'age': 1 }
+ * ];
+ *
+ * var youngest = _.chain(users)
+ * .sortBy('age')
+ * .map(function(chr) {
+ * return chr.user + ' is ' + chr.age;
+ * })
+ * .first()
+ * .value();
+ * // => 'pebbles is 1'
+ */
+ function chain(value) {
+ var result = lodash(value);
+ result.__chain__ = true;
+ return result;
+ }
+
+ /**
+ * This method invokes `interceptor` and returns `value`. The interceptor is
+ * bound to `thisArg` and invoked with one argument; (value). The purpose of
+ * this method is to "tap into" a method chain in order to perform operations
+ * on intermediate results within the chain.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * _([1, 2, 3])
+ * .tap(function(array) {
+ * array.pop();
+ * })
+ * .reverse()
+ * .value();
+ * // => [2, 1]
+ */
+ function tap(value, interceptor, thisArg) {
+ interceptor.call(thisArg, value);
+ return value;
+ }
+
+ /**
+ * This method is like `_.tap` except that it returns the result of `interceptor`.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns the result of `interceptor`.
+ * @example
+ *
+ * _(' abc ')
+ * .chain()
+ * .trim()
+ * .thru(function(value) {
+ * return [value];
+ * })
+ * .value();
+ * // => ['abc']
+ */
+ function thru(value, interceptor, thisArg) {
+ return interceptor.call(thisArg, value);
+ }
+
+ /**
+ * Enables explicit method chaining on the wrapper object.
+ *
+ * @name chain
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // without explicit chaining
+ * _(users).first();
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // with explicit chaining
+ * _(users).chain()
+ * .first()
+ * .pick('user')
+ * .value();
+ * // => { 'user': 'barney' }
+ */
+ function wrapperChain() {
+ return chain(this);
+ }
+
+ /**
+ * Executes the chained sequence and returns the wrapped result.
+ *
+ * @name commit
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapped = _(array).push(3);
+ *
+ * console.log(array);
+ * // => [1, 2]
+ *
+ * wrapped = wrapped.commit();
+ * console.log(array);
+ * // => [1, 2, 3]
+ *
+ * wrapped.last();
+ * // => 3
+ *
+ * console.log(array);
+ * // => [1, 2, 3]
+ */
+ function wrapperCommit() {
+ return new LodashWrapper(this.value(), this.__chain__);
+ }
+
+ /**
+ * Creates a new array joining a wrapped array with any additional arrays
+ * and/or values.
+ *
+ * @name concat
+ * @memberOf _
+ * @category Chain
+ * @param {...*} [values] The values to concatenate.
+ * @returns {Array} Returns the new concatenated array.
+ * @example
+ *
+ * var array = [1];
+ * var wrapped = _(array).concat(2, [3], [[4]]);
+ *
+ * console.log(wrapped.value());
+ * // => [1, 2, 3, [4]]
+ *
+ * console.log(array);
+ * // => [1]
+ */
+ var wrapperConcat = restParam(function(values) {
+ values = baseFlatten(values);
+ return this.thru(function(array) {
+ return arrayConcat(isArray(array) ? array : [toObject(array)], values);
+ });
+ });
+
+ /**
+ * Creates a clone of the chained sequence planting `value` as the wrapped value.
+ *
+ * @name plant
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapped = _(array).map(function(value) {
+ * return Math.pow(value, 2);
+ * });
+ *
+ * var other = [3, 4];
+ * var otherWrapped = wrapped.plant(other);
+ *
+ * otherWrapped.value();
+ * // => [9, 16]
+ *
+ * wrapped.value();
+ * // => [1, 4]
+ */
+ function wrapperPlant(value) {
+ var result,
+ parent = this;
+
+ while (parent instanceof baseLodash) {
+ var clone = wrapperClone(parent);
+ if (result) {
+ previous.__wrapped__ = clone;
+ } else {
+ result = clone;
+ }
+ var previous = clone;
+ parent = parent.__wrapped__;
+ }
+ previous.__wrapped__ = value;
+ return result;
+ }
+
+ /**
+ * Reverses the wrapped array so the first element becomes the last, the
+ * second element becomes the second to last, and so on.
+ *
+ * **Note:** This method mutates the wrapped array.
+ *
+ * @name reverse
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new reversed `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _(array).reverse().value()
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */
+ function wrapperReverse() {
+ var value = this.__wrapped__;
+
+ var interceptor = function(value) {
+ return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
+ };
+ if (value instanceof LazyWrapper) {
+ var wrapped = value;
+ if (this.__actions__.length) {
+ wrapped = new LazyWrapper(this);
+ }
+ wrapped = wrapped.reverse();
+ wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
+ return new LodashWrapper(wrapped, this.__chain__);
+ }
+ return this.thru(interceptor);
+ }
+
+ /**
+ * Produces the result of coercing the unwrapped value to a string.
+ *
+ * @name toString
+ * @memberOf _
+ * @category Chain
+ * @returns {string} Returns the coerced string value.
+ * @example
+ *
+ * _([1, 2, 3]).toString();
+ * // => '1,2,3'
+ */
+ function wrapperToString() {
+ return (this.value() + '');
+ }
+
+ /**
+ * Executes the chained sequence to extract the unwrapped value.
+ *
+ * @name value
+ * @memberOf _
+ * @alias run, toJSON, valueOf
+ * @category Chain
+ * @returns {*} Returns the resolved unwrapped value.
+ * @example
+ *
+ * _([1, 2, 3]).value();
+ * // => [1, 2, 3]
+ */
+ function wrapperValue() {
+ return baseWrapperValue(this.__wrapped__, this.__actions__);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates an array of elements corresponding to the given keys, or indexes,
+ * of `collection`. Keys may be specified as individual arguments or as arrays
+ * of keys.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(number|number[]|string|string[])} [props] The property names
+ * or indexes of elements to pick, specified individually or in arrays.
+ * @returns {Array} Returns the new array of picked elements.
+ * @example
+ *
+ * _.at(['a', 'b', 'c'], [0, 2]);
+ * // => ['a', 'c']
+ *
+ * _.at(['barney', 'fred', 'pebbles'], 0, 2);
+ * // => ['barney', 'pebbles']
+ */
+ var at = restParam(function(collection, props) {
+ return baseAt(collection, baseFlatten(props));
+ });
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the number of times the key was returned by `iteratee`.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy(['one', 'two', 'three'], 'length');
+ * // => { '3': 2, '5': 1 }
+ */
+ var countBy = createAggregator(function(result, value, key) {
+ hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
+ });
+
+ /**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+ function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = undefined;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = getCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+ }
+
+ /**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+ function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = getCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+ }
+
+ /**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+ var find = createFind(baseEach);
+
+ /**
+ * This method is like `_.find` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * _.findLast([1, 2, 3, 4], function(n) {
+ * return n % 2 == 1;
+ * });
+ * // => 3
+ */
+ var findLast = createFind(baseEachRight, true);
+
+ /**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning the first element that has equivalent property
+ * values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
+ * // => 'barney'
+ *
+ * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
+ * // => 'fred'
+ */
+ function findWhere(collection, source) {
+ return find(collection, baseMatches(source));
+ }
+
+ /**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+ var forEach = createForEach(arrayEach, baseEach);
+
+ /**
+ * This method is like `_.forEach` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias eachRight
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEachRight(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from right to left and returns the array
+ */
+ var forEachRight = createForEach(arrayEachRight, baseEachRight);
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+ var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+ });
+
+ /**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+ function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
+ : (!!length && getIndexOf(collection, target, fromIndex) > -1);
+ }
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the last element responsible for generating the key. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * var keyData = [
+ * { 'dir': 'left', 'code': 97 },
+ * { 'dir': 'right', 'code': 100 }
+ * ];
+ *
+ * _.indexBy(keyData, 'dir');
+ * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return String.fromCharCode(object.code);
+ * });
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return this.fromCharCode(object.code);
+ * }, String);
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ */
+ var indexBy = createAggregator(function(result, value, key) {
+ result[key] = value;
+ });
+
+ /**
+ * Invokes the method at `path` of each element in `collection`, returning
+ * an array of the results of each invoked method. Any additional arguments
+ * are provided to each invoked method. If `methodName` is a function it is
+ * invoked for, and `this` bound to, each element in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|Function|string} path The path of the method to invoke or
+ * the function invoked per iteration.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
+ * // => [[1, 5, 7], [1, 2, 3]]
+ *
+ * _.invoke([123, 456], String.prototype.split, '');
+ * // => [['1', '2', '3'], ['4', '5', '6']]
+ */
+ var invoke = restParam(function(collection, path, args) {
+ var index = -1,
+ isFunc = typeof path == 'function',
+ isProp = isKey(path),
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value) {
+ var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
+ result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
+ });
+ return result;
+ });
+
+ /**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+ function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = getCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+ }
+
+ /**
+ * Creates an array of elements split into two groups, the first of which
+ * contains elements `predicate` returns truthy for, while the second of which
+ * contains elements `predicate` returns falsey for. The predicate is bound
+ * to `thisArg` and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the array of grouped elements.
+ * @example
+ *
+ * _.partition([1, 2, 3], function(n) {
+ * return n % 2;
+ * });
+ * // => [[1, 3], [2]]
+ *
+ * _.partition([1.2, 2.3, 3.4], function(n) {
+ * return this.floor(n) % 2;
+ * }, Math);
+ * // => [[1.2, 3.4], [2.3]]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true },
+ * { 'user': 'pebbles', 'age': 1, 'active': false }
+ * ];
+ *
+ * var mapper = function(array) {
+ * return _.pluck(array, 'user');
+ * };
+ *
+ * // using the `_.matches` callback shorthand
+ * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
+ * // => [['pebbles'], ['barney', 'fred']]
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.map(_.partition(users, 'active', false), mapper);
+ * // => [['barney', 'pebbles'], ['fred']]
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(_.partition(users, 'active'), mapper);
+ * // => [['fred'], ['barney', 'pebbles']]
+ */
+ var partition = createAggregator(function(result, value, key) {
+ result[key ? 0 : 1].push(value);
+ }, function() { return [[], []]; });
+
+ /**
+ * Gets the property value of `path` from all elements in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|string} path The path of the property to pluck.
+ * @returns {Array} Returns the property values.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.pluck(users, 'user');
+ * // => ['barney', 'fred']
+ *
+ * var userIndex = _.indexBy(users, 'user');
+ * _.pluck(userIndex, 'age');
+ * // => [36, 40] (iteration order is not guaranteed)
+ */
+ function pluck(collection, path) {
+ return map(collection, property(path));
+ }
+
+ /**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
+ * and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+ var reduce = createReduce(arrayReduce, baseEach);
+
+ /**
+ * This method is like `_.reduce` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias foldr
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * var array = [[0, 1], [2, 3], [4, 5]];
+ *
+ * _.reduceRight(array, function(flattened, other) {
+ * return flattened.concat(other);
+ * }, []);
+ * // => [4, 5, 2, 3, 0, 1]
+ */
+ var reduceRight = createReduce(arrayReduceRight, baseEachRight);
+
+ /**
+ * The opposite of `_.filter`; this method returns the elements of `collection`
+ * that `predicate` does **not** return truthy for.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.reject([1, 2, 3, 4], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [1, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.reject(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.reject(users, 'active'), 'user');
+ * // => ['barney']
+ */
+ function reject(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = getCallback(predicate, thisArg, 3);
+ return func(collection, function(value, index, collection) {
+ return !predicate(value, index, collection);
+ });
+ }
+
+ /**
+ * Gets a random element or `n` random elements from a collection.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to sample.
+ * @param {number} [n] The number of elements to sample.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {*} Returns the random sample(s).
+ * @example
+ *
+ * _.sample([1, 2, 3, 4]);
+ * // => 2
+ *
+ * _.sample([1, 2, 3, 4], 2);
+ * // => [3, 1]
+ */
+ function sample(collection, n, guard) {
+ if (guard ? isIterateeCall(collection, n, guard) : n == null) {
+ collection = toIterable(collection);
+ var length = collection.length;
+ return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
+ }
+ var index = -1,
+ result = toArray(collection),
+ length = result.length,
+ lastIndex = length - 1;
+
+ n = nativeMin(n < 0 ? 0 : (+n || 0), length);
+ while (++index < n) {
+ var rand = baseRandom(index, lastIndex),
+ value = result[rand];
+
+ result[rand] = result[index];
+ result[index] = value;
+ }
+ result.length = n;
+ return result;
+ }
+
+ /**
+ * Creates an array of shuffled values, using a version of the
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ * @example
+ *
+ * _.shuffle([1, 2, 3, 4]);
+ * // => [4, 1, 3, 2]
+ */
+ function shuffle(collection) {
+ return sample(collection, POSITIVE_INFINITY);
+ }
+
+ /**
+ * Gets the size of `collection` by returning its length for array-like
+ * values or the number of own enumerable properties for objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @returns {number} Returns the size of `collection`.
+ * @example
+ *
+ * _.size([1, 2, 3]);
+ * // => 3
+ *
+ * _.size({ 'a': 1, 'b': 2 });
+ * // => 2
+ *
+ * _.size('pebbles');
+ * // => 7
+ */
+ function size(collection) {
+ var length = collection ? getLength(collection) : 0;
+ return isLength(length) ? length : keys(collection).length;
+ }
+
+ /**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+ function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = undefined;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = getCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+ }
+
+ /**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection through `iteratee`. This method performs
+ * a stable sort, that is, it preserves the original sort order of equal elements.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return Math.sin(n);
+ * });
+ * // => [3, 1, 2]
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return this.sin(n);
+ * }, Math);
+ * // => [3, 1, 2]
+ *
+ * var users = [
+ * { 'user': 'fred' },
+ * { 'user': 'pebbles' },
+ * { 'user': 'barney' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.sortBy(users, 'user'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function sortBy(collection, iteratee, thisArg) {
+ if (collection == null) {
+ return [];
+ }
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = undefined;
+ }
+ var index = -1;
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ var result = baseMap(collection, function(value, key, collection) {
+ return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
+ });
+ return baseSortBy(result, compareAscending);
+ }
+
+ /**
+ * This method is like `_.sortBy` except that it can sort by multiple iteratees
+ * or property names.
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
+ * The iteratees to sort by, specified as individual values or arrays of values.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 34 }
+ * ];
+ *
+ * _.map(_.sortByAll(users, ['user', 'age']), _.values);
+ * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
+ *
+ * _.map(_.sortByAll(users, 'user', function(chr) {
+ * return Math.floor(chr.age / 10);
+ * }), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ var sortByAll = restParam(function(collection, iteratees) {
+ if (collection == null) {
+ return [];
+ }
+ var guard = iteratees[2];
+ if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
+ iteratees.length = 1;
+ }
+ return baseSortByOrder(collection, baseFlatten(iteratees), []);
+ });
+
+ /**
+ * This method is like `_.sortByAll` except that it allows specifying the
+ * sort orders of the iteratees to sort by. If `orders` is unspecified, all
+ * values are sorted in ascending order. Otherwise, a value is sorted in
+ * ascending order if its corresponding order is "asc", and descending if "desc".
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} [orders] The sort orders of `iteratees`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 34 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 36 }
+ * ];
+ *
+ * // sort by `user` in ascending order and by `age` in descending order
+ * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ function sortByOrder(collection, iteratees, orders, guard) {
+ if (collection == null) {
+ return [];
+ }
+ if (guard && isIterateeCall(iteratees, orders, guard)) {
+ orders = undefined;
+ }
+ if (!isArray(iteratees)) {
+ iteratees = iteratees == null ? [] : [iteratees];
+ }
+ if (!isArray(orders)) {
+ orders = orders == null ? [] : [orders];
+ }
+ return baseSortByOrder(collection, iteratees, orders);
+ }
+
+ /**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning an array of all elements that have equivalent
+ * property values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
+ * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
+ * ];
+ *
+ * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
+ * // => ['fred']
+ */
+ function where(collection, source) {
+ return filter(collection, baseMatches(source));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+ var now = nativeNow || function() {
+ return new Date().getTime();
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * The opposite of `_.before`; this method creates a function that invokes
+ * `func` once it is called `n` or more times.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls before `func` is invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var saves = ['profile', 'settings'];
+ *
+ * var done = _.after(saves.length, function() {
+ * console.log('done saving!');
+ * });
+ *
+ * _.forEach(saves, function(type) {
+ * asyncSave({ 'type': type, 'complete': done });
+ * });
+ * // => logs 'done saving!' after the two async saves have completed
+ */
+ function after(n, func) {
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ n = nativeIsFinite(n = +n) ? n : 0;
+ return function() {
+ if (--n < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ }
+
+ /**
+ * Creates a function that accepts up to `n` arguments ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @param {number} [n=func.length] The arity cap.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.ary(parseInt, 1));
+ * // => [6, 8, 10]
+ */
+ function ary(func, n, guard) {
+ if (guard && isIterateeCall(func, n, guard)) {
+ n = undefined;
+ }
+ n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
+ return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
+ }
+
+ /**
+ * Creates a function that invokes `func`, with the `this` binding and arguments
+ * of the created function, while it is called less than `n` times. Subsequent
+ * calls to the created function return the result of the last `func` invocation.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls at which `func` is no longer invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * jQuery('#add').on('click', _.before(5, addContactToList));
+ * // => allows adding up to 4 contacts to the list
+ */
+ function before(n, func) {
+ var result;
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ return function() {
+ if (--n > 0) {
+ result = func.apply(this, arguments);
+ }
+ if (n <= 1) {
+ func = undefined;
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+ var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+ });
+
+ /**
+ * Binds methods of an object to the object itself, overwriting the existing
+ * method. Method names may be specified as individual arguments or as arrays
+ * of method names. If no method names are provided all enumerable function
+ * properties, own and inherited, of `object` are bound.
+ *
+ * **Note:** This method does not set the "length" property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object to bind and assign the bound methods to.
+ * @param {...(string|string[])} [methodNames] The object method names to bind,
+ * specified as individual method names or arrays of method names.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var view = {
+ * 'label': 'docs',
+ * 'onClick': function() {
+ * console.log('clicked ' + this.label);
+ * }
+ * };
+ *
+ * _.bindAll(view);
+ * jQuery('#docs').on('click', view.onClick);
+ * // => logs 'clicked docs' when the element is clicked
+ */
+ var bindAll = restParam(function(object, methodNames) {
+ methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
+
+ var index = -1,
+ length = methodNames.length;
+
+ while (++index < length) {
+ var key = methodNames[index];
+ object[key] = createWrapper(object[key], BIND_FLAG, object);
+ }
+ return object;
+ });
+
+ /**
+ * Creates a function that invokes the method at `object[key]` and prepends
+ * any additional `_.bindKey` arguments to those provided to the bound function.
+ *
+ * This method differs from `_.bind` by allowing bound functions to reference
+ * methods that may be redefined or don't yet exist.
+ * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
+ * for more details.
+ *
+ * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object the method belongs to.
+ * @param {string} key The key of the method.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var object = {
+ * 'user': 'fred',
+ * 'greet': function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * }
+ * };
+ *
+ * var bound = _.bindKey(object, 'greet', 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * object.greet = function(greeting, punctuation) {
+ * return greeting + 'ya ' + this.user + punctuation;
+ * };
+ *
+ * bound('!');
+ * // => 'hiya fred!'
+ *
+ * // using placeholders
+ * var bound = _.bindKey(object, 'greet', _, '!');
+ * bound('hi');
+ * // => 'hiya fred!'
+ */
+ var bindKey = restParam(function(object, key, partials) {
+ var bitmask = BIND_FLAG | BIND_KEY_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bindKey.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(key, bitmask, object, partials, holders);
+ });
+
+ /**
+ * Creates a function that accepts one or more arguments of `func` that when
+ * called either invokes `func` returning its result, if all `func` arguments
+ * have been provided, or returns a function that accepts one or more of the
+ * remaining `func` arguments, and so on. The arity of `func` may be specified
+ * if `func.length` is not sufficient.
+ *
+ * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curry(abc);
+ *
+ * curried(1)(2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(1)(_, 3)(2);
+ * // => [1, 2, 3]
+ */
+ var curry = createCurry(CURRY_FLAG);
+
+ /**
+ * This method is like `_.curry` except that arguments are applied to `func`
+ * in the manner of `_.partialRight` instead of `_.partial`.
+ *
+ * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curryRight(abc);
+ *
+ * curried(3)(2)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(2, 3)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(3)(1, _)(2);
+ * // => [1, 2, 3]
+ */
+ var curryRight = createCurry(CURRY_RIGHT_FLAG);
+
+ /**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed invocations. Provide an options object to indicate that `func`
+ * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+ * Subsequent calls to the debounced function return the result of the last
+ * `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+ function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = !!options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ lastCalled = 0;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function complete(isCalled, id) {
+ if (id) {
+ clearTimeout(id);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = undefined;
+ }
+ }
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ complete(trailingCall, maxTimeoutId);
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ complete(trailing, timeoutId);
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = undefined;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+ }
+
+ /**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+ var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+ });
+
+ /**
+ * Invokes `func` after `wait` milliseconds. Any additional arguments are
+ * provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.delay(function(text) {
+ * console.log(text);
+ * }, 1000, 'later');
+ * // => logs 'later' after one second
+ */
+ var delay = restParam(function(func, wait, args) {
+ return baseDelay(func, wait, args);
+ });
+
+ /**
+ * Creates a function that returns the result of invoking the provided
+ * functions with the `this` binding of the created function, where each
+ * successive invocation is supplied the return value of the previous.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flow(_.add, square);
+ * addSquare(1, 2);
+ * // => 9
+ */
+ var flow = createFlow();
+
+ /**
+ * This method is like `_.flow` except that it creates a function that
+ * invokes the provided functions from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias backflow, compose
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flowRight(square, _.add);
+ * addSquare(1, 2);
+ * // => 9
+ */
+ var flowRight = createFlow(true);
+
+ /**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is coerced to a string and used as the
+ * cache key. The `func` is invoked with the `this` binding of the memoized
+ * function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
+ * method interface of `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoizing function.
+ * @example
+ *
+ * var upperCase = _.memoize(function(string) {
+ * return string.toUpperCase();
+ * });
+ *
+ * upperCase('fred');
+ * // => 'FRED'
+ *
+ * // modifying the result cache
+ * upperCase.cache.set('fred', 'BARNEY');
+ * upperCase('fred');
+ * // => 'BARNEY'
+ *
+ * // replacing `_.memoize.Cache`
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'barney' };
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'fred' }
+ *
+ * _.memoize.Cache = WeakMap;
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'barney' }
+ */
+ function memoize(func, resolver) {
+ if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result);
+ return result;
+ };
+ memoized.cache = new memoize.Cache;
+ return memoized;
+ }
+
+ /**
+ * Creates a function that runs each argument through a corresponding
+ * transform function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to wrap.
+ * @param {...(Function|Function[])} [transforms] The functions to transform
+ * arguments, specified as individual functions or arrays of functions.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function doubled(n) {
+ * return n * 2;
+ * }
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var modded = _.modArgs(function(x, y) {
+ * return [x, y];
+ * }, square, doubled);
+ *
+ * modded(1, 2);
+ * // => [1, 4]
+ *
+ * modded(5, 10);
+ * // => [25, 20]
+ */
+ var modArgs = restParam(function(func, transforms) {
+ transforms = baseFlatten(transforms);
+ if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = transforms.length;
+ return restParam(function(args) {
+ var index = nativeMin(args.length, length);
+ while (index--) {
+ args[index] = transforms[index](args[index]);
+ }
+ return func.apply(this, args);
+ });
+ });
+
+ /**
+ * Creates a function that negates the result of the predicate `func`. The
+ * `func` predicate is invoked with the `this` binding and arguments of the
+ * created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} predicate The predicate to negate.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function isEven(n) {
+ * return n % 2 == 0;
+ * }
+ *
+ * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
+ * // => [1, 3, 5]
+ */
+ function negate(predicate) {
+ if (typeof predicate != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+ }
+
+ /**
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
+ * to the function return the value of the first call. The `func` is invoked
+ * with the `this` binding and arguments of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var initialize = _.once(createApplication);
+ * initialize();
+ * initialize();
+ * // `initialize` invokes `createApplication` once
+ */
+ function once(func) {
+ return before(2, func);
+ }
+
+ /**
+ * Creates a function that invokes `func` with `partial` arguments prepended
+ * to those provided to the new function. This method is like `_.bind` except
+ * it does **not** alter the `this` binding.
+ *
+ * The `_.partial.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var sayHelloTo = _.partial(greet, 'hello');
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ *
+ * // using placeholders
+ * var greetFred = _.partial(greet, _, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ */
+ var partial = createPartial(PARTIAL_FLAG);
+
+ /**
+ * This method is like `_.partial` except that partially applied arguments
+ * are appended to those provided to the new function.
+ *
+ * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var greetFred = _.partialRight(greet, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ *
+ * // using placeholders
+ * var sayHelloTo = _.partialRight(greet, 'hello', _);
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ */
+ var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
+
+ /**
+ * Creates a function that invokes `func` with arguments arranged according
+ * to the specified indexes where the argument value at the first index is
+ * provided as the first argument, the argument value at the second index is
+ * provided as the second argument, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to rearrange arguments for.
+ * @param {...(number|number[])} indexes The arranged argument indexes,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var rearged = _.rearg(function(a, b, c) {
+ * return [a, b, c];
+ * }, 2, 0, 1);
+ *
+ * rearged('b', 'c', 'a')
+ * // => ['a', 'b', 'c']
+ *
+ * var map = _.rearg(_.map, [1, 0]);
+ * map(function(n) {
+ * return n * 3;
+ * }, [1, 2, 3]);
+ * // => [3, 6, 9]
+ */
+ var rearg = restParam(function(func, indexes) {
+ return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
+ });
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+ function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+ }
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the created
+ * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
+ *
+ * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to spread arguments over.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.spread(function(who, what) {
+ * return who + ' says ' + what;
+ * });
+ *
+ * say(['fred', 'hello']);
+ * // => 'fred says hello'
+ *
+ * // with a Promise
+ * var numbers = Promise.all([
+ * Promise.resolve(40),
+ * Promise.resolve(36)
+ * ]);
+ *
+ * numbers.then(_.spread(function(x, y) {
+ * return x + y;
+ * }));
+ * // => a Promise of 76
+ */
+ function spread(func) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function(array) {
+ return func.apply(this, array);
+ };
+ }
+
+ /**
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed invocations. Provide an options object to indicate
+ * that `func` should be invoked on the leading and/or trailing edge of the
+ * `wait` timeout. Subsequent calls to the throttled function return the
+ * result of the last `func` call.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the throttled function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=true] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
+ * @example
+ *
+ * // avoid excessively updating the position while scrolling
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
+ * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
+ * 'trailing': false
+ * }));
+ *
+ * // cancel a trailing throttled call
+ * jQuery(window).on('popstate', throttled.cancel);
+ */
+ function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (options === false) {
+ leading = false;
+ } else if (isObject(options)) {
+ leading = 'leading' in options ? !!options.leading : leading;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+ return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
+ }
+
+ /**
+ * Creates a function that provides `value` to the wrapper function as its
+ * first argument. Any additional arguments provided to the function are
+ * appended to those provided to the wrapper function. The wrapper is invoked
+ * with the `this` binding of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {*} value The value to wrap.
+ * @param {Function} wrapper The wrapper function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var p = _.wrap(_.escape, function(func, text) {
+ * return '<p>' + func(text) + '</p>';
+ * });
+ *
+ * p('fred, barney, & pebbles');
+ * // => '<p>fred, barney, &amp; pebbles</p>'
+ */
+ function wrap(value, wrapper) {
+ wrapper = wrapper == null ? identity : wrapper;
+ return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
+ * otherwise they are assigned by reference. If `customizer` is provided it is
+ * invoked to produce the cloned values. If `customizer` returns `undefined`
+ * cloning is handled by the method instead. The `customizer` is bound to
+ * `thisArg` and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var shallow = _.clone(users);
+ * shallow[0] === users[0];
+ * // => true
+ *
+ * var deep = _.clone(users, true);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.clone(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(false);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 0
+ */
+ function clone(value, isDeep, customizer, thisArg) {
+ if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
+ isDeep = false;
+ }
+ else if (typeof isDeep == 'function') {
+ thisArg = customizer;
+ customizer = isDeep;
+ isDeep = false;
+ }
+ return typeof customizer == 'function'
+ ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, isDeep);
+ }
+
+ /**
+ * Creates a deep clone of `value`. If `customizer` is provided it is invoked
+ * to produce the cloned values. If `customizer` returns `undefined` cloning
+ * is handled by the method instead. The `customizer` is bound to `thisArg`
+ * and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var deep = _.cloneDeep(users);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.cloneDeep(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 20
+ */
+ function cloneDeep(value, customizer, thisArg) {
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
+ }
+
+ /**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */
+ function gt(value, other) {
+ return value > other;
+ }
+
+ /**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */
+ function gte(value, other) {
+ return value >= other;
+ }
+
+ /**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+ function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) &&
+ hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
+ }
+
+ /**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+ var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+ };
+
+ /**
+ * Checks if `value` is classified as a boolean primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isBoolean(false);
+ * // => true
+ *
+ * _.isBoolean(null);
+ * // => false
+ */
+ function isBoolean(value) {
+ return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
+ }
+
+ /**
+ * Checks if `value` is classified as a `Date` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isDate(new Date);
+ * // => true
+ *
+ * _.isDate('Mon April 23 2012');
+ * // => false
+ */
+ function isDate(value) {
+ return isObjectLike(value) && objToString.call(value) == dateTag;
+ }
+
+ /**
+ * Checks if `value` is a DOM element.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
+ * @example
+ *
+ * _.isElement(document.body);
+ * // => true
+ *
+ * _.isElement('<body>');
+ * // => false
+ */
+ function isElement(value) {
+ return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
+ }
+
+ /**
+ * Checks if `value` is empty. A value is considered empty unless it is an
+ * `arguments` object, array, string, or jQuery-like collection with a length
+ * greater than `0` or an object with own enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Array|Object|string} value The value to inspect.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+ function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
+ (isObjectLike(value) && isFunction(value.splice)))) {
+ return !value.length;
+ }
+ return !keys(value).length;
+ }
+
+ /**
+ * Performs a deep comparison between two values to determine if they are
+ * equivalent. If `customizer` is provided it is invoked to compare values.
+ * If `customizer` returns `undefined` comparisons are handled by the method
+ * instead. The `customizer` is bound to `thisArg` and invoked with three
+ * arguments: (value, other [, index|key]).
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. Functions and DOM nodes
+ * are **not** supported. Provide a customizer function to extend support
+ * for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @alias eq
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'fred' };
+ *
+ * object == other;
+ * // => false
+ *
+ * _.isEqual(object, other);
+ * // => true
+ *
+ * // using a customizer callback
+ * var array = ['hello', 'goodbye'];
+ * var other = ['hi', 'goodbye'];
+ *
+ * _.isEqual(array, other, function(value, other) {
+ * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
+ * return true;
+ * }
+ * });
+ * // => true
+ */
+ function isEqual(value, other, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ var result = customizer ? customizer(value, other) : undefined;
+ return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+ }
+
+ /**
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
+ * `SyntaxError`, `TypeError`, or `URIError` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+ * @example
+ *
+ * _.isError(new Error);
+ * // => true
+ *
+ * _.isError(Error);
+ * // => false
+ */
+ function isError(value) {
+ return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
+ }
+
+ /**
+ * Checks if `value` is a finite primitive number.
+ *
+ * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
+ * @example
+ *
+ * _.isFinite(10);
+ * // => true
+ *
+ * _.isFinite('10');
+ * // => false
+ *
+ * _.isFinite(true);
+ * // => false
+ *
+ * _.isFinite(Object(10));
+ * // => false
+ *
+ * _.isFinite(Infinity);
+ * // => false
+ */
+ function isFinite(value) {
+ return typeof value == 'number' && nativeIsFinite(value);
+ }
+
+ /**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+ function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return isObject(value) && objToString.call(value) == funcTag;
+ }
+
+ /**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+ function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+ }
+
+ /**
+ * Performs a deep comparison between `object` and `source` to determine if
+ * `object` contains equivalent property values. If `customizer` is provided
+ * it is invoked to compare values. If `customizer` returns `undefined`
+ * comparisons are handled by the method instead. The `customizer` is bound
+ * to `thisArg` and invoked with three arguments: (value, other, index|key).
+ *
+ * **Note:** This method supports comparing properties of arrays, booleans,
+ * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
+ * and DOM nodes are **not** supported. Provide a customizer function to extend
+ * support for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.isMatch(object, { 'age': 40 });
+ * // => true
+ *
+ * _.isMatch(object, { 'age': 36 });
+ * // => false
+ *
+ * // using a customizer callback
+ * var object = { 'greeting': 'hello' };
+ * var source = { 'greeting': 'hi' };
+ *
+ * _.isMatch(object, source, function(value, other) {
+ * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
+ * });
+ * // => true
+ */
+ function isMatch(object, source, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ return baseIsMatch(object, getMatchData(source), customizer);
+ }
+
+ /**
+ * Checks if `value` is `NaN`.
+ *
+ * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
+ * which returns `true` for `undefined` and other non-numeric values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ * @example
+ *
+ * _.isNaN(NaN);
+ * // => true
+ *
+ * _.isNaN(new Number(NaN));
+ * // => true
+ *
+ * isNaN(undefined);
+ * // => true
+ *
+ * _.isNaN(undefined);
+ * // => false
+ */
+ function isNaN(value) {
+ // An `NaN` primitive is the only value that is not equal to itself.
+ // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
+ return isNumber(value) && value != +value;
+ }
+
+ /**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+ function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (isFunction(value)) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+ }
+
+ /**
+ * Checks if `value` is `null`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+ * @example
+ *
+ * _.isNull(null);
+ * // => true
+ *
+ * _.isNull(void 0);
+ * // => false
+ */
+ function isNull(value) {
+ return value === null;
+ }
+
+ /**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+ function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+ }
+
+ /**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+ function isPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
+ (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+ }
+
+ /**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */
+ function isRegExp(value) {
+ return isObject(value) && objToString.call(value) == regexpTag;
+ }
+
+ /**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+ function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+ }
+
+ /**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+ function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+ }
+
+ /**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */
+ function isUndefined(value) {
+ return value === undefined;
+ }
+
+ /**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */
+ function lt(value, other) {
+ return value < other;
+ }
+
+ /**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */
+ function lte(value, other) {
+ return value <= other;
+ }
+
+ /**
+ * Converts `value` to an array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Array} Returns the converted array.
+ * @example
+ *
+ * (function() {
+ * return _.toArray(arguments).slice(1);
+ * }(1, 2, 3));
+ * // => [2, 3]
+ */
+ function toArray(value) {
+ var length = value ? getLength(value) : 0;
+ if (!isLength(length)) {
+ return values(value);
+ }
+ if (!length) {
+ return [];
+ }
+ return arrayCopy(value);
+ }
+
+ /**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+ function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+ var merge = createAssigner(baseMerge);
+
+ /**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+ });
+
+ /**
+ * Creates an object that inherits from the given `prototype` object. If a
+ * `properties` object is provided its own enumerable properties are assigned
+ * to the created object.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} prototype The object to inherit from.
+ * @param {Object} [properties] The properties to assign to the object.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * function Shape() {
+ * this.x = 0;
+ * this.y = 0;
+ * }
+ *
+ * function Circle() {
+ * Shape.call(this);
+ * }
+ *
+ * Circle.prototype = _.create(Shape.prototype, {
+ * 'constructor': Circle
+ * });
+ *
+ * var circle = new Circle;
+ * circle instanceof Circle;
+ * // => true
+ *
+ * circle instanceof Shape;
+ * // => true
+ */
+ function create(prototype, properties, guard) {
+ var result = baseCreate(prototype);
+ if (guard && isIterateeCall(prototype, properties, guard)) {
+ properties = undefined;
+ }
+ return properties ? baseAssign(result, properties) : result;
+ }
+
+ /**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object for all destination properties that resolve to `undefined`. Once a
+ * property is set, additional values of the same property are ignored.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var defaults = createDefaults(assign, assignDefaults);
+
+ /**
+ * This method is like `_.defaults` except that it recursively assigns
+ * default properties.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
+ * // => { 'user': { 'name': 'barney', 'age': 36 } }
+ *
+ */
+ var defaultsDeep = createDefaults(merge, mergeDefaults);
+
+ /**
+ * This method is like `_.find` except that it returns the key of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => 'barney' (iteration order is not guaranteed)
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findKey(users, { 'age': 1, 'active': true });
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findKey(users, 'active');
+ * // => 'barney'
+ */
+ var findKey = createFindKey(baseForOwn);
+
+ /**
+ * This method is like `_.findKey` except that it iterates over elements of
+ * a collection in the opposite order.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findLastKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => returns `pebbles` assuming `_.findKey` returns `barney`
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastKey(users, { 'age': 36, 'active': true });
+ * // => 'barney'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastKey(users, 'active');
+ * // => 'pebbles'
+ */
+ var findLastKey = createFindKey(baseForOwnRight);
+
+ /**
+ * Iterates over own and inherited enumerable properties of an object invoking
+ * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
+ * with three arguments: (value, key, object). Iteratee functions may exit
+ * iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forIn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
+ */
+ var forIn = createForIn(baseFor);
+
+ /**
+ * This method is like `_.forIn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forInRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
+ */
+ var forInRight = createForIn(baseForRight);
+
+ /**
+ * Iterates over own enumerable properties of an object invoking `iteratee`
+ * for each property. The `iteratee` is bound to `thisArg` and invoked with
+ * three arguments: (value, key, object). Iteratee functions may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a' and 'b' (iteration order is not guaranteed)
+ */
+ var forOwn = createForOwn(baseForOwn);
+
+ /**
+ * This method is like `_.forOwn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwnRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
+ */
+ var forOwnRight = createForOwn(baseForOwnRight);
+
+ /**
+ * Creates an array of function property names from all enumerable properties,
+ * own and inherited, of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @alias methods
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the new array of property names.
+ * @example
+ *
+ * _.functions(_);
+ * // => ['after', 'ary', 'assign', ...]
+ */
+ function functions(object) {
+ return baseFunctions(object, keysIn(object));
+ }
+
+ /**
+ * Gets the property value at `path` of `object`. If the resolved value is
+ * `undefined` the `defaultValue` is used in its place.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */
+ function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
+ return result === undefined ? defaultValue : result;
+ }
+
+ /**
+ * Checks if `path` is a direct property.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
+ * @example
+ *
+ * var object = { 'a': { 'b': { 'c': 3 } } };
+ *
+ * _.has(object, 'a');
+ * // => true
+ *
+ * _.has(object, 'a.b.c');
+ * // => true
+ *
+ * _.has(object, ['a', 'b', 'c']);
+ * // => true
+ */
+ function has(object, path) {
+ if (object == null) {
+ return false;
+ }
+ var result = hasOwnProperty.call(object, path);
+ if (!result && !isKey(path)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ path = last(path);
+ result = hasOwnProperty.call(object, path);
+ }
+ return result || (isLength(object.length) && isIndex(path, object.length) &&
+ (isArray(object) || isArguments(object)));
+ }
+
+ /**
+ * Creates an object composed of the inverted keys and values of `object`.
+ * If `object` contains duplicate values, subsequent values overwrite property
+ * assignments of previous values unless `multiValue` is `true`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {boolean} [multiValue] Allow multiple values per key.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invert(object);
+ * // => { '1': 'c', '2': 'b' }
+ *
+ * // with `multiValue`
+ * _.invert(object, true);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ */
+ function invert(object, multiValue, guard) {
+ if (guard && isIterateeCall(object, multiValue, guard)) {
+ multiValue = undefined;
+ }
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key];
+
+ if (multiValue) {
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }
+ else {
+ result[value] = key;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+ var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? undefined : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+ };
+
+ /**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+ function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The opposite of `_.mapValues`; this method creates an object with the
+ * same values as `object` and keys generated by running each own enumerable
+ * property of `object` through `iteratee`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
+ * return key + value;
+ * });
+ * // => { 'a1': 1, 'b2': 2 }
+ */
+ var mapKeys = createObjectMapper(true);
+
+ /**
+ * Creates an object with the same keys as `object` and values generated by
+ * running each own enumerable property of `object` through `iteratee`. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, key, object).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
+ * return n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ *
+ * var users = {
+ * 'fred': { 'user': 'fred', 'age': 40 },
+ * 'pebbles': { 'user': 'pebbles', 'age': 1 }
+ * };
+ *
+ * // using the `_.property` callback shorthand
+ * _.mapValues(users, 'age');
+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+ */
+ var mapValues = createObjectMapper();
+
+ /**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+ var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+ });
+
+ /**
+ * Creates a two dimensional array of the key-value pairs for `object`,
+ * e.g. `[[key1, value1], [key2, value2]]`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the new array of key-value pairs.
+ * @example
+ *
+ * _.pairs({ 'barney': 36, 'fred': 40 });
+ * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+ */
+ function pairs(object) {
+ object = toObject(object);
+
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ var key = props[index];
+ result[index] = [key, object[key]];
+ }
+ return result;
+ }
+
+ /**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+ var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+ });
+
+ /**
+ * This method is like `_.get` except that if the resolved value is a function
+ * it is invoked with the `this` binding of its parent object and its result
+ * is returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to resolve.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
+ *
+ * _.result(object, 'a[0].b.c1');
+ * // => 3
+ *
+ * _.result(object, 'a[0].b.c2');
+ * // => 4
+ *
+ * _.result(object, 'a.b.c', 'default');
+ * // => 'default'
+ *
+ * _.result(object, 'a.b.c', _.constant('default'));
+ * // => 'default'
+ */
+ function result(object, path, defaultValue) {
+ var result = object == null ? undefined : object[path];
+ if (result === undefined) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ result = object == null ? undefined : object[last(path)];
+ }
+ result = result === undefined ? defaultValue : result;
+ }
+ return isFunction(result) ? result.call(object) : result;
+ }
+
+ /**
+ * Sets the property value of `path` on `object`. If a portion of `path`
+ * does not exist it is created.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to augment.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.set(object, 'a[0].b.c', 4);
+ * console.log(object.a[0].b.c);
+ * // => 4
+ *
+ * _.set(object, 'x[0].y.z', 5);
+ * console.log(object.x[0].y.z);
+ * // => 5
+ */
+ function set(object, path, value) {
+ if (object == null) {
+ return object;
+ }
+ var pathKey = (path + '');
+ path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
+
+ var index = -1,
+ length = path.length,
+ lastIndex = length - 1,
+ nested = object;
+
+ while (nested != null && ++index < length) {
+ var key = path[index];
+ if (isObject(nested)) {
+ if (index == lastIndex) {
+ nested[key] = value;
+ } else if (nested[key] == null) {
+ nested[key] = isIndex(path[index + 1]) ? [] : {};
+ }
+ }
+ nested = nested[key];
+ }
+ return object;
+ }
+
+ /**
+ * An alternative to `_.reduce`; this method transforms `object` to a new
+ * `accumulator` object which is the result of running each of its own enumerable
+ * properties through `iteratee`, with each invocation potentially mutating
+ * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
+ * with four arguments: (accumulator, value, key, object). Iteratee functions
+ * may exit iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Array|Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The custom accumulator value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.transform([2, 3, 4], function(result, n) {
+ * result.push(n *= n);
+ * return n % 2 == 0;
+ * });
+ * // => [4, 9]
+ *
+ * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ */
+ function transform(object, iteratee, accumulator, thisArg) {
+ var isArr = isArray(object) || isTypedArray(object);
+ iteratee = getCallback(iteratee, thisArg, 4);
+
+ if (accumulator == null) {
+ if (isArr || isObject(object)) {
+ var Ctor = object.constructor;
+ if (isArr) {
+ accumulator = isArray(object) ? new Ctor : [];
+ } else {
+ accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
+ }
+ } else {
+ accumulator = {};
+ }
+ }
+ (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
+ return iteratee(accumulator, value, index, object);
+ });
+ return accumulator;
+ }
+
+ /**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+ function values(object) {
+ return baseValues(object, keys(object));
+ }
+
+ /**
+ * Creates an array of the own and inherited enumerable property values
+ * of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.valuesIn(new Foo);
+ * // => [1, 2, 3] (iteration order is not guaranteed)
+ */
+ function valuesIn(object) {
+ return baseValues(object, keysIn(object));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Checks if `n` is between `start` and up to but not including, `end`. If
+ * `end` is not specified it is set to `start` with `start` then set to `0`.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} n The number to check.
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
+ * @example
+ *
+ * _.inRange(3, 2, 4);
+ * // => true
+ *
+ * _.inRange(4, 8);
+ * // => true
+ *
+ * _.inRange(4, 2);
+ * // => false
+ *
+ * _.inRange(2, 2);
+ * // => false
+ *
+ * _.inRange(1.2, 2);
+ * // => true
+ *
+ * _.inRange(5.2, 4);
+ * // => false
+ */
+ function inRange(value, start, end) {
+ start = +start || 0;
+ if (end === undefined) {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ return value >= nativeMin(start, end) && value < nativeMax(start, end);
+ }
+
+ /**
+ * Produces a random number between `min` and `max` (inclusive). If only one
+ * argument is provided a number between `0` and the given number is returned.
+ * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
+ * number is returned instead of an integer.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} [min=0] The minimum possible value.
+ * @param {number} [max=1] The maximum possible value.
+ * @param {boolean} [floating] Specify returning a floating-point number.
+ * @returns {number} Returns the random number.
+ * @example
+ *
+ * _.random(0, 5);
+ * // => an integer between 0 and 5
+ *
+ * _.random(5);
+ * // => also an integer between 0 and 5
+ *
+ * _.random(5, true);
+ * // => a floating-point number between 0 and 5
+ *
+ * _.random(1.2, 5.2);
+ * // => a floating-point number between 1.2 and 5.2
+ */
+ function random(min, max, floating) {
+ if (floating && isIterateeCall(min, max, floating)) {
+ max = floating = undefined;
+ }
+ var noMin = min == null,
+ noMax = max == null;
+
+ if (floating == null) {
+ if (noMax && typeof min == 'boolean') {
+ floating = min;
+ min = 1;
+ }
+ else if (typeof max == 'boolean') {
+ floating = max;
+ noMax = true;
+ }
+ }
+ if (noMin && noMax) {
+ max = 1;
+ noMax = false;
+ }
+ min = +min || 0;
+ if (noMax) {
+ max = min;
+ min = 0;
+ } else {
+ max = +max || 0;
+ }
+ if (floating || min % 1 || max % 1) {
+ var rand = nativeRandom();
+ return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
+ }
+ return baseRandom(min, max);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the camel cased string.
+ * @example
+ *
+ * _.camelCase('Foo Bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('--foo-bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('__foo_bar__');
+ * // => 'fooBar'
+ */
+ var camelCase = createCompounder(function(result, word, index) {
+ word = word.toLowerCase();
+ return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
+ });
+
+ /**
+ * Capitalizes the first character of `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to capitalize.
+ * @returns {string} Returns the capitalized string.
+ * @example
+ *
+ * _.capitalize('fred');
+ * // => 'Fred'
+ */
+ function capitalize(string) {
+ string = baseToString(string);
+ return string && (string.charAt(0).toUpperCase() + string.slice(1));
+ }
+
+ /**
+ * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
+ * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to deburr.
+ * @returns {string} Returns the deburred string.
+ * @example
+ *
+ * _.deburr('déjà vu');
+ * // => 'deja vu'
+ */
+ function deburr(string) {
+ string = baseToString(string);
+ return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
+ }
+
+ /**
+ * Checks if `string` ends with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=string.length] The position to search from.
+ * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
+ * @example
+ *
+ * _.endsWith('abc', 'c');
+ * // => true
+ *
+ * _.endsWith('abc', 'b');
+ * // => false
+ *
+ * _.endsWith('abc', 'b', 2);
+ * // => true
+ */
+ function endsWith(string, target, position) {
+ string = baseToString(string);
+ target = (target + '');
+
+ var length = string.length;
+ position = position === undefined
+ ? length
+ : nativeMin(position < 0 ? 0 : (+position || 0), length);
+
+ position -= target.length;
+ return position >= 0 && string.indexOf(target, position) == position;
+ }
+
+ /**
+ * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
+ * their corresponding HTML entities.
+ *
+ * **Note:** No other characters are escaped. To escape additional characters
+ * use a third-party library like [_he_](https://mths.be/he).
+ *
+ * Though the ">" character is escaped for symmetry, characters like
+ * ">" and "/" don't need escaping in HTML and have no special meaning
+ * unless they're part of a tag or unquoted attribute value.
+ * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
+ * (under "semi-related fun fact") for more details.
+ *
+ * Backticks are escaped because in Internet Explorer < 9, they can break out
+ * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
+ * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
+ * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
+ * for more details.
+ *
+ * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
+ * to reduce XSS vectors.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escape('fred, barney, & pebbles');
+ * // => 'fred, barney, &amp; pebbles'
+ */
+ function escape(string) {
+ // Reset `lastIndex` because in IE < 9 `String#replace` does not.
+ string = baseToString(string);
+ return (string && reHasUnescapedHtml.test(string))
+ ? string.replace(reUnescapedHtml, escapeHtmlChar)
+ : string;
+ }
+
+ /**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+ function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, escapeRegExpChar)
+ : (string || '(?:)');
+ }
+
+ /**
+ * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the kebab cased string.
+ * @example
+ *
+ * _.kebabCase('Foo Bar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('fooBar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('__foo_bar__');
+ * // => 'foo-bar'
+ */
+ var kebabCase = createCompounder(function(result, word, index) {
+ return result + (index ? '-' : '') + word.toLowerCase();
+ });
+
+ /**
+ * Pads `string` on the left and right sides if it's shorter than `length`.
+ * Padding characters are truncated if they can't be evenly divided by `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.pad('abc', 8);
+ * // => ' abc '
+ *
+ * _.pad('abc', 8, '_-');
+ * // => '_-abc_-_'
+ *
+ * _.pad('abc', 3);
+ * // => 'abc'
+ */
+ function pad(string, length, chars) {
+ string = baseToString(string);
+ length = +length;
+
+ var strLength = string.length;
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return string;
+ }
+ var mid = (length - strLength) / 2,
+ leftLength = nativeFloor(mid),
+ rightLength = nativeCeil(mid);
+
+ chars = createPadding('', rightLength, chars);
+ return chars.slice(0, leftLength) + string + chars;
+ }
+
+ /**
+ * Pads `string` on the left side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padLeft('abc', 6);
+ * // => ' abc'
+ *
+ * _.padLeft('abc', 6, '_-');
+ * // => '_-_abc'
+ *
+ * _.padLeft('abc', 3);
+ * // => 'abc'
+ */
+ var padLeft = createPadDir();
+
+ /**
+ * Pads `string` on the right side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padRight('abc', 6);
+ * // => 'abc '
+ *
+ * _.padRight('abc', 6, '_-');
+ * // => 'abc_-_'
+ *
+ * _.padRight('abc', 3);
+ * // => 'abc'
+ */
+ var padRight = createPadDir(true);
+
+ /**
+ * Converts `string` to an integer of the specified radix. If `radix` is
+ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
+ * in which case a `radix` of `16` is used.
+ *
+ * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
+ * of `parseInt`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} string The string to convert.
+ * @param {number} [radix] The radix to interpret `value` by.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.parseInt('08');
+ * // => 8
+ *
+ * _.map(['6', '08', '10'], _.parseInt);
+ * // => [6, 8, 10]
+ */
+ function parseInt(string, radix, guard) {
+ // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
+ // Chrome fails to trim leading <BOM> whitespace characters.
+ // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
+ if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
+ radix = 0;
+ } else if (radix) {
+ radix = +radix;
+ }
+ string = trim(string);
+ return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
+ }
+
+ /**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+ function repeat(string, n) {
+ var result = '';
+ string = baseToString(string);
+ n = +n;
+ if (n < 1 || !string || !nativeIsFinite(n)) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = nativeFloor(n / 2);
+ string += string;
+ } while (n);
+
+ return result;
+ }
+
+ /**
+ * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the snake cased string.
+ * @example
+ *
+ * _.snakeCase('Foo Bar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('fooBar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('--foo-bar');
+ * // => 'foo_bar'
+ */
+ var snakeCase = createCompounder(function(result, word, index) {
+ return result + (index ? '_' : '') + word.toLowerCase();
+ });
+
+ /**
+ * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the start cased string.
+ * @example
+ *
+ * _.startCase('--foo-bar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('fooBar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('__foo_bar__');
+ * // => 'Foo Bar'
+ */
+ var startCase = createCompounder(function(result, word, index) {
+ return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
+ });
+
+ /**
+ * Checks if `string` starts with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=0] The position to search from.
+ * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
+ * @example
+ *
+ * _.startsWith('abc', 'a');
+ * // => true
+ *
+ * _.startsWith('abc', 'b');
+ * // => false
+ *
+ * _.startsWith('abc', 'b', 1);
+ * // => true
+ */
+ function startsWith(string, target, position) {
+ string = baseToString(string);
+ position = position == null
+ ? 0
+ : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
+
+ return string.lastIndexOf(target, position) == position;
+ }
+
+ /**
+ * Creates a compiled template function that can interpolate data properties
+ * in "interpolate" delimiters, HTML-escape interpolated data properties in
+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
+ * properties may be accessed as free variables in the template. If a setting
+ * object is provided it takes precedence over `_.templateSettings` values.
+ *
+ * **Note:** In the development build `_.template` utilizes
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
+ * for easier debugging.
+ *
+ * For more information on precompiling templates see
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+ *
+ * For more information on Chrome extension sandboxes see
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The template string.
+ * @param {Object} [options] The options object.
+ * @param {RegExp} [options.escape] The HTML "escape" delimiter.
+ * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
+ * @param {Object} [options.imports] An object to import into the template as free variables.
+ * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
+ * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
+ * @param {string} [options.variable] The data object variable name.
+ * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
+ * @returns {Function} Returns the compiled template function.
+ * @example
+ *
+ * // using the "interpolate" delimiter to create a compiled template
+ * var compiled = _.template('hello <%= user %>!');
+ * compiled({ 'user': 'fred' });
+ * // => 'hello fred!'
+ *
+ * // using the HTML "escape" delimiter to escape data property values
+ * var compiled = _.template('<b><%- value %></b>');
+ * compiled({ 'value': '<script>' });
+ * // => '<b>&lt;script&gt;</b>'
+ *
+ * // using the "evaluate" delimiter to execute JavaScript and generate HTML
+ * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the internal `print` function in "evaluate" delimiters
+ * var compiled = _.template('<% print("hello " + user); %>!');
+ * compiled({ 'user': 'barney' });
+ * // => 'hello barney!'
+ *
+ * // using the ES delimiter as an alternative to the default "interpolate" delimiter
+ * var compiled = _.template('hello ${ user }!');
+ * compiled({ 'user': 'pebbles' });
+ * // => 'hello pebbles!'
+ *
+ * // using custom template delimiters
+ * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
+ * var compiled = _.template('hello {{ user }}!');
+ * compiled({ 'user': 'mustache' });
+ * // => 'hello mustache!'
+ *
+ * // using backslashes to treat delimiters as plain text
+ * var compiled = _.template('<%= "\\<%- value %\\>" %>');
+ * compiled({ 'value': 'ignored' });
+ * // => '<%- value %>'
+ *
+ * // using the `imports` option to import `jQuery` as `jq`
+ * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
+ * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the `sourceURL` option to specify a custom sourceURL for the template
+ * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
+ * compiled(data);
+ * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
+ *
+ * // using the `variable` option to ensure a with-statement isn't used in the compiled template
+ * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
+ * compiled.source;
+ * // => function(data) {
+ * // var __t, __p = '';
+ * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
+ * // return __p;
+ * // }
+ *
+ * // using the `source` property to inline compiled templates for meaningful
+ * // line numbers in error messages and a stack trace
+ * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
+ * var JST = {\
+ * "main": ' + _.template(mainText).source + '\
+ * };\
+ * ');
+ */
+ function template(string, options, otherOptions) {
+ // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
+ // and Laura Doktorova's doT.js (https://github.com/olado/doT).
+ var settings = lodash.templateSettings;
+
+ if (otherOptions && isIterateeCall(string, options, otherOptions)) {
+ options = otherOptions = undefined;
+ }
+ string = baseToString(string);
+ options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
+
+ var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
+ importsKeys = keys(imports),
+ importsValues = baseValues(imports, importsKeys);
+
+ var isEscaping,
+ isEvaluating,
+ index = 0,
+ interpolate = options.interpolate || reNoMatch,
+ source = "__p += '";
+
+ // Compile the regexp to match each delimiter.
+ var reDelimiters = RegExp(
+ (options.escape || reNoMatch).source + '|' +
+ interpolate.source + '|' +
+ (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
+ (options.evaluate || reNoMatch).source + '|$'
+ , 'g');
+
+ // Use a sourceURL for easier debugging.
+ var sourceURL = '//# sourceURL=' +
+ ('sourceURL' in options
+ ? options.sourceURL
+ : ('lodash.templateSources[' + (++templateCounter) + ']')
+ ) + '\n';
+
+ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
+ interpolateValue || (interpolateValue = esTemplateValue);
+
+ // Escape characters that can't be included in string literals.
+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
+
+ // Replace delimiters with snippets.
+ if (escapeValue) {
+ isEscaping = true;
+ source += "' +\n__e(" + escapeValue + ") +\n'";
+ }
+ if (evaluateValue) {
+ isEvaluating = true;
+ source += "';\n" + evaluateValue + ";\n__p += '";
+ }
+ if (interpolateValue) {
+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
+ }
+ index = offset + match.length;
+
+ // The JS engine embedded in Adobe products requires returning the `match`
+ // string in order to produce the correct `offset` value.
+ return match;
+ });
+
+ source += "';\n";
+
+ // If `variable` is not specified wrap a with-statement around the generated
+ // code to add the data object to the top of the scope chain.
+ var variable = options.variable;
+ if (!variable) {
+ source = 'with (obj) {\n' + source + '\n}\n';
+ }
+ // Cleanup code by stripping empty strings.
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
+ .replace(reEmptyStringMiddle, '$1')
+ .replace(reEmptyStringTrailing, '$1;');
+
+ // Frame code as the function body.
+ source = 'function(' + (variable || 'obj') + ') {\n' +
+ (variable
+ ? ''
+ : 'obj || (obj = {});\n'
+ ) +
+ "var __t, __p = ''" +
+ (isEscaping
+ ? ', __e = _.escape'
+ : ''
+ ) +
+ (isEvaluating
+ ? ', __j = Array.prototype.join;\n' +
+ "function print() { __p += __j.call(arguments, '') }\n"
+ : ';\n'
+ ) +
+ source +
+ 'return __p\n}';
+
+ var result = attempt(function() {
+ return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
+ });
+
+ // Provide the compiled function's source by its `toString` method or
+ // the `source` property as a convenience for inlining compiled templates.
+ result.source = source;
+ if (isError(result)) {
+ throw result;
+ }
+ return result;
+ }
+
+ /**
+ * Removes leading and trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trim(' abc ');
+ * // => 'abc'
+ *
+ * _.trim('-_-abc-_-', '_-');
+ * // => 'abc'
+ *
+ * _.map([' foo ', ' bar '], _.trim);
+ * // => ['foo', 'bar']
+ */
+ function trim(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
+ }
+ chars = (chars + '');
+ return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
+ }
+
+ /**
+ * Removes leading whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimLeft(' abc ');
+ * // => 'abc '
+ *
+ * _.trimLeft('-_-abc-_-', '_-');
+ * // => 'abc-_-'
+ */
+ function trimLeft(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string));
+ }
+ return string.slice(charsLeftIndex(string, (chars + '')));
+ }
+
+ /**
+ * Removes trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimRight(' abc ');
+ * // => ' abc'
+ *
+ * _.trimRight('-_-abc-_-', '_-');
+ * // => '-_-abc'
+ */
+ function trimRight(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(0, trimmedRightIndex(string) + 1);
+ }
+ return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
+ }
+
+ /**
+ * Truncates `string` if it's longer than the given maximum string length.
+ * The last characters of the truncated string are replaced with the omission
+ * string which defaults to "...".
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to truncate.
+ * @param {Object|number} [options] The options object or maximum string length.
+ * @param {number} [options.length=30] The maximum string length.
+ * @param {string} [options.omission='...'] The string to indicate text is omitted.
+ * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the truncated string.
+ * @example
+ *
+ * _.trunc('hi-diddly-ho there, neighborino');
+ * // => 'hi-diddly-ho there, neighbo...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', 24);
+ * // => 'hi-diddly-ho there, n...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': ' '
+ * });
+ * // => 'hi-diddly-ho there,...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': /,? +/
+ * });
+ * // => 'hi-diddly-ho there...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'omission': ' [...]'
+ * });
+ * // => 'hi-diddly-ho there, neig [...]'
+ */
+ function trunc(string, options, guard) {
+ if (guard && isIterateeCall(string, options, guard)) {
+ options = undefined;
+ }
+ var length = DEFAULT_TRUNC_LENGTH,
+ omission = DEFAULT_TRUNC_OMISSION;
+
+ if (options != null) {
+ if (isObject(options)) {
+ var separator = 'separator' in options ? options.separator : separator;
+ length = 'length' in options ? (+options.length || 0) : length;
+ omission = 'omission' in options ? baseToString(options.omission) : omission;
+ } else {
+ length = +options || 0;
+ }
+ }
+ string = baseToString(string);
+ if (length >= string.length) {
+ return string;
+ }
+ var end = length - omission.length;
+ if (end < 1) {
+ return omission;
+ }
+ var result = string.slice(0, end);
+ if (separator == null) {
+ return result + omission;
+ }
+ if (isRegExp(separator)) {
+ if (string.slice(end).search(separator)) {
+ var match,
+ newEnd,
+ substring = string.slice(0, end);
+
+ if (!separator.global) {
+ separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
+ }
+ separator.lastIndex = 0;
+ while ((match = separator.exec(substring))) {
+ newEnd = match.index;
+ }
+ result = result.slice(0, newEnd == null ? end : newEnd);
+ }
+ } else if (string.indexOf(separator, end) != end) {
+ var index = result.lastIndexOf(separator);
+ if (index > -1) {
+ result = result.slice(0, index);
+ }
+ }
+ return result + omission;
+ }
+
+ /**
+ * The inverse of `_.escape`; this method converts the HTML entities
+ * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
+ * corresponding characters.
+ *
+ * **Note:** No other HTML entities are unescaped. To unescape additional HTML
+ * entities use a third-party library like [_he_](https://mths.be/he).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to unescape.
+ * @returns {string} Returns the unescaped string.
+ * @example
+ *
+ * _.unescape('fred, barney, &amp; pebbles');
+ * // => 'fred, barney, & pebbles'
+ */
+ function unescape(string) {
+ string = baseToString(string);
+ return (string && reHasEscapedHtml.test(string))
+ ? string.replace(reEscapedHtml, unescapeHtmlChar)
+ : string;
+ }
+
+ /**
+ * Splits `string` into an array of its words.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {RegExp|string} [pattern] The pattern to match words.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the words of `string`.
+ * @example
+ *
+ * _.words('fred, barney, & pebbles');
+ * // => ['fred', 'barney', 'pebbles']
+ *
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
+ * // => ['fred', 'barney', '&', 'pebbles']
+ */
+ function words(string, pattern, guard) {
+ if (guard && isIterateeCall(string, pattern, guard)) {
+ pattern = undefined;
+ }
+ string = baseToString(string);
+ return string.match(pattern || reWords) || [];
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Attempts to invoke `func`, returning either the result or the caught error
+ * object. Any additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function} func The function to attempt.
+ * @returns {*} Returns the `func` result or error object.
+ * @example
+ *
+ * // avoid throwing errors for invalid selectors
+ * var elements = _.attempt(function(selector) {
+ * return document.querySelectorAll(selector);
+ * }, '>_>');
+ *
+ * if (_.isError(elements)) {
+ * elements = [];
+ * }
+ */
+ var attempt = restParam(function(func, args) {
+ try {
+ return func.apply(undefined, args);
+ } catch(e) {
+ return isError(e) ? e : new Error(e);
+ }
+ });
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and arguments of the created function. If `func` is a property name the
+ * created callback returns the property value for a given element. If `func`
+ * is an object the created callback returns `true` for elements that contain
+ * the equivalent object properties, otherwise it returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias iteratee
+ * @category Utility
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the callback.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // wrap to create custom callback shorthands
+ * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
+ * var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
+ * if (!match) {
+ * return callback(func, thisArg);
+ * }
+ * return function(object) {
+ * return match[2] == 'gt'
+ * ? object[match[1]] > match[3]
+ * : object[match[1]] < match[3];
+ * };
+ * });
+ *
+ * _.filter(users, 'age__gt36');
+ * // => [{ 'user': 'fred', 'age': 40 }]
+ */
+ function callback(func, thisArg, guard) {
+ if (guard && isIterateeCall(func, thisArg, guard)) {
+ thisArg = undefined;
+ }
+ return isObjectLike(func)
+ ? matches(func)
+ : baseCallback(func, thisArg);
+ }
+
+ /**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+ function constant(value) {
+ return function() {
+ return value;
+ };
+ }
+
+ /**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+ function identity(value) {
+ return value;
+ }
+
+ /**
+ * Creates a function that performs a deep comparison between a given object
+ * and `source`, returning `true` if the given object has equivalent property
+ * values, else `false`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.filter(users, _.matches({ 'age': 40, 'active': false }));
+ * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
+ */
+ function matches(source) {
+ return baseMatches(baseClone(source, true));
+ }
+
+ /**
+ * Creates a function that compares the property value of `path` on a given
+ * object to `value`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * _.find(users, _.matchesProperty('user', 'fred'));
+ * // => { 'user': 'fred' }
+ */
+ function matchesProperty(path, srcValue) {
+ return baseMatchesProperty(path, baseClone(srcValue, true));
+ }
+
+ /**
+ * Creates a function that invokes the method at `path` on a given object.
+ * Any additional arguments are provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': _.constant(2) } } },
+ * { 'a': { 'b': { 'c': _.constant(1) } } }
+ * ];
+ *
+ * _.map(objects, _.method('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+ var method = restParam(function(path, args) {
+ return function(object) {
+ return invokePath(object, path, args);
+ };
+ });
+
+ /**
+ * The opposite of `_.method`; this method creates a function that invokes
+ * the method at a given path on `object`. Any additional arguments are
+ * provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = _.times(3, _.constant),
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.methodOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
+ * // => [2, 0]
+ */
+ var methodOf = restParam(function(object, args) {
+ return function(path) {
+ return invokePath(object, path, args);
+ };
+ });
+
+ /**
+ * Adds all own enumerable function properties of a source object to the
+ * destination object. If `object` is a function then methods are added to
+ * its prototype as well.
+ *
+ * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
+ * avoid conflicts caused by modifying the original.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function|Object} [object=lodash] The destination object.
+ * @param {Object} source The object of functions to add.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.chain=true] Specify whether the functions added
+ * are chainable.
+ * @returns {Function|Object} Returns `object`.
+ * @example
+ *
+ * function vowels(string) {
+ * return _.filter(string, function(v) {
+ * return /[aeiou]/i.test(v);
+ * });
+ * }
+ *
+ * _.mixin({ 'vowels': vowels });
+ * _.vowels('fred');
+ * // => ['e']
+ *
+ * _('fred').vowels().value();
+ * // => ['e']
+ *
+ * _.mixin({ 'vowels': vowels }, { 'chain': false });
+ * _('fred').vowels();
+ * // => ['e']
+ */
+ function mixin(object, source, options) {
+ if (options == null) {
+ var isObj = isObject(source),
+ props = isObj ? keys(source) : undefined,
+ methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
+
+ if (!(methodNames ? methodNames.length : isObj)) {
+ methodNames = false;
+ options = source;
+ source = object;
+ object = this;
+ }
+ }
+ if (!methodNames) {
+ methodNames = baseFunctions(source, keys(source));
+ }
+ var chain = true,
+ index = -1,
+ isFunc = isFunction(object),
+ length = methodNames.length;
+
+ if (options === false) {
+ chain = false;
+ } else if (isObject(options) && 'chain' in options) {
+ chain = options.chain;
+ }
+ while (++index < length) {
+ var methodName = methodNames[index],
+ func = source[methodName];
+
+ object[methodName] = func;
+ if (isFunc) {
+ object.prototype[methodName] = (function(func) {
+ return function() {
+ var chainAll = this.__chain__;
+ if (chain || chainAll) {
+ var result = object(this.__wrapped__),
+ actions = result.__actions__ = arrayCopy(this.__actions__);
+
+ actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
+ result.__chain__ = chainAll;
+ return result;
+ }
+ return func.apply(object, arrayPush([this.value()], arguments));
+ };
+ }(func));
+ }
+ }
+ return object;
+ }
+
+ /**
+ * Reverts the `_` variable to its previous value and returns a reference to
+ * the `lodash` function.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @returns {Function} Returns the `lodash` function.
+ * @example
+ *
+ * var lodash = _.noConflict();
+ */
+ function noConflict() {
+ root._ = oldDash;
+ return this;
+ }
+
+ /**
+ * A no-operation function that returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+ function noop() {
+ // No operation performed.
+ }
+
+ /**
+ * Creates a function that returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+ function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+ }
+
+ /**
+ * The opposite of `_.property`; this method creates a function that returns
+ * the property value at a given path on `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = [0, 1, 2],
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
+ * // => [2, 0]
+ */
+ function propertyOf(object) {
+ return function(path) {
+ return baseGet(object, toPath(path), path + '');
+ };
+ }
+
+ /**
+ * Creates an array of numbers (positive and/or negative) progressing from
+ * `start` up to, but not including, `end`. If `end` is not specified it is
+ * set to `start` with `start` then set to `0`. If `end` is less than `start`
+ * a zero-length range is created unless a negative `step` is specified.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} [step=1] The value to increment or decrement by.
+ * @returns {Array} Returns the new array of numbers.
+ * @example
+ *
+ * _.range(4);
+ * // => [0, 1, 2, 3]
+ *
+ * _.range(1, 5);
+ * // => [1, 2, 3, 4]
+ *
+ * _.range(0, 20, 5);
+ * // => [0, 5, 10, 15]
+ *
+ * _.range(0, -4, -1);
+ * // => [0, -1, -2, -3]
+ *
+ * _.range(1, 4, 0);
+ * // => [1, 1, 1]
+ *
+ * _.range(0);
+ * // => []
+ */
+ function range(start, end, step) {
+ if (step && isIterateeCall(start, end, step)) {
+ end = step = undefined;
+ }
+ start = +start || 0;
+ step = step == null ? 1 : (+step || 0);
+
+ if (end == null) {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
+ // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
+ var index = -1,
+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = start;
+ start += step;
+ }
+ return result;
+ }
+
+ /**
+ * Invokes the iteratee function `n` times, returning an array of the results
+ * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
+ * one argument; (index).
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
+ * // => [3, 6, 4]
+ *
+ * _.times(3, function(n) {
+ * mage.castSpell(n);
+ * });
+ * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
+ *
+ * _.times(3, function(n) {
+ * this.cast(n);
+ * }, mage);
+ * // => also invokes `mage.castSpell(n)` three times
+ */
+ function times(n, iteratee, thisArg) {
+ n = nativeFloor(n);
+
+ // Exit early to avoid a JSC JIT bug in Safari 8
+ // where `Array(0)` is treated as `Array(1)`.
+ if (n < 1 || !nativeIsFinite(n)) {
+ return [];
+ }
+ var index = -1,
+ result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
+
+ iteratee = bindCallback(iteratee, thisArg, 1);
+ while (++index < n) {
+ if (index < MAX_ARRAY_LENGTH) {
+ result[index] = iteratee(index);
+ } else {
+ iteratee(index);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Generates a unique ID. If `prefix` is provided the ID is appended to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {string} [prefix] The value to prefix the ID with.
+ * @returns {string} Returns the unique ID.
+ * @example
+ *
+ * _.uniqueId('contact_');
+ * // => 'contact_104'
+ *
+ * _.uniqueId();
+ * // => '105'
+ */
+ function uniqueId(prefix) {
+ var id = ++idCounter;
+ return baseToString(prefix) + id;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Adds two numbers.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} augend The first number to add.
+ * @param {number} addend The second number to add.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.add(6, 4);
+ * // => 10
+ */
+ function add(augend, addend) {
+ return (+augend || 0) + (+addend || 0);
+ }
+
+ /**
+ * Calculates `n` rounded up to `precision`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} n The number to round up.
+ * @param {number} [precision=0] The precision to round up to.
+ * @returns {number} Returns the rounded up number.
+ * @example
+ *
+ * _.ceil(4.006);
+ * // => 5
+ *
+ * _.ceil(6.004, 2);
+ * // => 6.01
+ *
+ * _.ceil(6040, -2);
+ * // => 6100
+ */
+ var ceil = createRound('ceil');
+
+ /**
+ * Calculates `n` rounded down to `precision`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} n The number to round down.
+ * @param {number} [precision=0] The precision to round down to.
+ * @returns {number} Returns the rounded down number.
+ * @example
+ *
+ * _.floor(4.006);
+ * // => 4
+ *
+ * _.floor(0.046, 2);
+ * // => 0.04
+ *
+ * _.floor(4060, -2);
+ * // => 4000
+ */
+ var floor = createRound('floor');
+
+ /**
+ * Gets the maximum value of `collection`. If `collection` is empty or falsey
+ * `-Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the maximum value.
+ * @example
+ *
+ * _.max([4, 2, 8, 6]);
+ * // => 8
+ *
+ * _.max([]);
+ * // => -Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.max(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.max(users, 'age');
+ * // => { 'user': 'fred', 'age': 40 }
+ */
+ var max = createExtremum(gt, NEGATIVE_INFINITY);
+
+ /**
+ * Gets the minimum value of `collection`. If `collection` is empty or falsey
+ * `Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the minimum value.
+ * @example
+ *
+ * _.min([4, 2, 8, 6]);
+ * // => 2
+ *
+ * _.min([]);
+ * // => Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.min(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.min(users, 'age');
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var min = createExtremum(lt, POSITIVE_INFINITY);
+
+ /**
+ * Calculates `n` rounded to `precision`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} n The number to round.
+ * @param {number} [precision=0] The precision to round to.
+ * @returns {number} Returns the rounded number.
+ * @example
+ *
+ * _.round(4.006);
+ * // => 4
+ *
+ * _.round(4.006, 2);
+ * // => 4.01
+ *
+ * _.round(4060, -2);
+ * // => 4100
+ */
+ var round = createRound('round');
+
+ /**
+ * Gets the sum of the values in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.sum([4, 6]);
+ * // => 10
+ *
+ * _.sum({ 'a': 4, 'b': 6 });
+ * // => 10
+ *
+ * var objects = [
+ * { 'n': 4 },
+ * { 'n': 6 }
+ * ];
+ *
+ * _.sum(objects, function(object) {
+ * return object.n;
+ * });
+ * // => 10
+ *
+ * // using the `_.property` callback shorthand
+ * _.sum(objects, 'n');
+ * // => 10
+ */
+ function sum(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = undefined;
+ }
+ iteratee = getCallback(iteratee, thisArg, 3);
+ return iteratee.length == 1
+ ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)
+ : baseSum(collection, iteratee);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ // Ensure wrappers are instances of `baseLodash`.
+ lodash.prototype = baseLodash.prototype;
+
+ LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+ LodashWrapper.prototype.constructor = LodashWrapper;
+
+ LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+ LazyWrapper.prototype.constructor = LazyWrapper;
+
+ // Add functions to the `Map` cache.
+ MapCache.prototype['delete'] = mapDelete;
+ MapCache.prototype.get = mapGet;
+ MapCache.prototype.has = mapHas;
+ MapCache.prototype.set = mapSet;
+
+ // Add functions to the `Set` cache.
+ SetCache.prototype.push = cachePush;
+
+ // Assign cache to `_.memoize`.
+ memoize.Cache = MapCache;
+
+ // Add functions that return wrapped values when chaining.
+ lodash.after = after;
+ lodash.ary = ary;
+ lodash.assign = assign;
+ lodash.at = at;
+ lodash.before = before;
+ lodash.bind = bind;
+ lodash.bindAll = bindAll;
+ lodash.bindKey = bindKey;
+ lodash.callback = callback;
+ lodash.chain = chain;
+ lodash.chunk = chunk;
+ lodash.compact = compact;
+ lodash.constant = constant;
+ lodash.countBy = countBy;
+ lodash.create = create;
+ lodash.curry = curry;
+ lodash.curryRight = curryRight;
+ lodash.debounce = debounce;
+ lodash.defaults = defaults;
+ lodash.defaultsDeep = defaultsDeep;
+ lodash.defer = defer;
+ lodash.delay = delay;
+ lodash.difference = difference;
+ lodash.drop = drop;
+ lodash.dropRight = dropRight;
+ lodash.dropRightWhile = dropRightWhile;
+ lodash.dropWhile = dropWhile;
+ lodash.fill = fill;
+ lodash.filter = filter;
+ lodash.flatten = flatten;
+ lodash.flattenDeep = flattenDeep;
+ lodash.flow = flow;
+ lodash.flowRight = flowRight;
+ lodash.forEach = forEach;
+ lodash.forEachRight = forEachRight;
+ lodash.forIn = forIn;
+ lodash.forInRight = forInRight;
+ lodash.forOwn = forOwn;
+ lodash.forOwnRight = forOwnRight;
+ lodash.functions = functions;
+ lodash.groupBy = groupBy;
+ lodash.indexBy = indexBy;
+ lodash.initial = initial;
+ lodash.intersection = intersection;
+ lodash.invert = invert;
+ lodash.invoke = invoke;
+ lodash.keys = keys;
+ lodash.keysIn = keysIn;
+ lodash.map = map;
+ lodash.mapKeys = mapKeys;
+ lodash.mapValues = mapValues;
+ lodash.matches = matches;
+ lodash.matchesProperty = matchesProperty;
+ lodash.memoize = memoize;
+ lodash.merge = merge;
+ lodash.method = method;
+ lodash.methodOf = methodOf;
+ lodash.mixin = mixin;
+ lodash.modArgs = modArgs;
+ lodash.negate = negate;
+ lodash.omit = omit;
+ lodash.once = once;
+ lodash.pairs = pairs;
+ lodash.partial = partial;
+ lodash.partialRight = partialRight;
+ lodash.partition = partition;
+ lodash.pick = pick;
+ lodash.pluck = pluck;
+ lodash.property = property;
+ lodash.propertyOf = propertyOf;
+ lodash.pull = pull;
+ lodash.pullAt = pullAt;
+ lodash.range = range;
+ lodash.rearg = rearg;
+ lodash.reject = reject;
+ lodash.remove = remove;
+ lodash.rest = rest;
+ lodash.restParam = restParam;
+ lodash.set = set;
+ lodash.shuffle = shuffle;
+ lodash.slice = slice;
+ lodash.sortBy = sortBy;
+ lodash.sortByAll = sortByAll;
+ lodash.sortByOrder = sortByOrder;
+ lodash.spread = spread;
+ lodash.take = take;
+ lodash.takeRight = takeRight;
+ lodash.takeRightWhile = takeRightWhile;
+ lodash.takeWhile = takeWhile;
+ lodash.tap = tap;
+ lodash.throttle = throttle;
+ lodash.thru = thru;
+ lodash.times = times;
+ lodash.toArray = toArray;
+ lodash.toPlainObject = toPlainObject;
+ lodash.transform = transform;
+ lodash.union = union;
+ lodash.uniq = uniq;
+ lodash.unzip = unzip;
+ lodash.unzipWith = unzipWith;
+ lodash.values = values;
+ lodash.valuesIn = valuesIn;
+ lodash.where = where;
+ lodash.without = without;
+ lodash.wrap = wrap;
+ lodash.xor = xor;
+ lodash.zip = zip;
+ lodash.zipObject = zipObject;
+ lodash.zipWith = zipWith;
+
+ // Add aliases.
+ lodash.backflow = flowRight;
+ lodash.collect = map;
+ lodash.compose = flowRight;
+ lodash.each = forEach;
+ lodash.eachRight = forEachRight;
+ lodash.extend = assign;
+ lodash.iteratee = callback;
+ lodash.methods = functions;
+ lodash.object = zipObject;
+ lodash.select = filter;
+ lodash.tail = rest;
+ lodash.unique = uniq;
+
+ // Add functions to `lodash.prototype`.
+ mixin(lodash, lodash);
+
+ /*------------------------------------------------------------------------*/
+
+ // Add functions that return unwrapped values when chaining.
+ lodash.add = add;
+ lodash.attempt = attempt;
+ lodash.camelCase = camelCase;
+ lodash.capitalize = capitalize;
+ lodash.ceil = ceil;
+ lodash.clone = clone;
+ lodash.cloneDeep = cloneDeep;
+ lodash.deburr = deburr;
+ lodash.endsWith = endsWith;
+ lodash.escape = escape;
+ lodash.escapeRegExp = escapeRegExp;
+ lodash.every = every;
+ lodash.find = find;
+ lodash.findIndex = findIndex;
+ lodash.findKey = findKey;
+ lodash.findLast = findLast;
+ lodash.findLastIndex = findLastIndex;
+ lodash.findLastKey = findLastKey;
+ lodash.findWhere = findWhere;
+ lodash.first = first;
+ lodash.floor = floor;
+ lodash.get = get;
+ lodash.gt = gt;
+ lodash.gte = gte;
+ lodash.has = has;
+ lodash.identity = identity;
+ lodash.includes = includes;
+ lodash.indexOf = indexOf;
+ lodash.inRange = inRange;
+ lodash.isArguments = isArguments;
+ lodash.isArray = isArray;
+ lodash.isBoolean = isBoolean;
+ lodash.isDate = isDate;
+ lodash.isElement = isElement;
+ lodash.isEmpty = isEmpty;
+ lodash.isEqual = isEqual;
+ lodash.isError = isError;
+ lodash.isFinite = isFinite;
+ lodash.isFunction = isFunction;
+ lodash.isMatch = isMatch;
+ lodash.isNaN = isNaN;
+ lodash.isNative = isNative;
+ lodash.isNull = isNull;
+ lodash.isNumber = isNumber;
+ lodash.isObject = isObject;
+ lodash.isPlainObject = isPlainObject;
+ lodash.isRegExp = isRegExp;
+ lodash.isString = isString;
+ lodash.isTypedArray = isTypedArray;
+ lodash.isUndefined = isUndefined;
+ lodash.kebabCase = kebabCase;
+ lodash.last = last;
+ lodash.lastIndexOf = lastIndexOf;
+ lodash.lt = lt;
+ lodash.lte = lte;
+ lodash.max = max;
+ lodash.min = min;
+ lodash.noConflict = noConflict;
+ lodash.noop = noop;
+ lodash.now = now;
+ lodash.pad = pad;
+ lodash.padLeft = padLeft;
+ lodash.padRight = padRight;
+ lodash.parseInt = parseInt;
+ lodash.random = random;
+ lodash.reduce = reduce;
+ lodash.reduceRight = reduceRight;
+ lodash.repeat = repeat;
+ lodash.result = result;
+ lodash.round = round;
+ lodash.runInContext = runInContext;
+ lodash.size = size;
+ lodash.snakeCase = snakeCase;
+ lodash.some = some;
+ lodash.sortedIndex = sortedIndex;
+ lodash.sortedLastIndex = sortedLastIndex;
+ lodash.startCase = startCase;
+ lodash.startsWith = startsWith;
+ lodash.sum = sum;
+ lodash.template = template;
+ lodash.trim = trim;
+ lodash.trimLeft = trimLeft;
+ lodash.trimRight = trimRight;
+ lodash.trunc = trunc;
+ lodash.unescape = unescape;
+ lodash.uniqueId = uniqueId;
+ lodash.words = words;
+
+ // Add aliases.
+ lodash.all = every;
+ lodash.any = some;
+ lodash.contains = includes;
+ lodash.eq = isEqual;
+ lodash.detect = find;
+ lodash.foldl = reduce;
+ lodash.foldr = reduceRight;
+ lodash.head = first;
+ lodash.include = includes;
+ lodash.inject = reduce;
+
+ mixin(lodash, (function() {
+ var source = {};
+ baseForOwn(lodash, function(func, methodName) {
+ if (!lodash.prototype[methodName]) {
+ source[methodName] = func;
+ }
+ });
+ return source;
+ }()), false);
+
+ /*------------------------------------------------------------------------*/
+
+ // Add functions capable of returning wrapped and unwrapped values when chaining.
+ lodash.sample = sample;
+
+ lodash.prototype.sample = function(n) {
+ if (!this.__chain__ && n == null) {
+ return sample(this.value());
+ }
+ return this.thru(function(value) {
+ return sample(value, n);
+ });
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * The semantic version number.
+ *
+ * @static
+ * @memberOf _
+ * @type string
+ */
+ lodash.VERSION = VERSION;
+
+ // Assign default placeholders.
+ arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
+ lodash[methodName].placeholder = lodash;
+ });
+
+ // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
+ arrayEach(['drop', 'take'], function(methodName, index) {
+ LazyWrapper.prototype[methodName] = function(n) {
+ var filtered = this.__filtered__;
+ if (filtered && !index) {
+ return new LazyWrapper(this);
+ }
+ n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
+
+ var result = this.clone();
+ if (filtered) {
+ result.__takeCount__ = nativeMin(result.__takeCount__, n);
+ } else {
+ result.__views__.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
+ }
+ return result;
+ };
+
+ LazyWrapper.prototype[methodName + 'Right'] = function(n) {
+ return this.reverse()[methodName](n).reverse();
+ };
+ });
+
+ // Add `LazyWrapper` methods that accept an `iteratee` value.
+ arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
+ var type = index + 1,
+ isFilter = type != LAZY_MAP_FLAG;
+
+ LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
+ var result = this.clone();
+ result.__iteratees__.push({ 'iteratee': getCallback(iteratee, thisArg, 1), 'type': type });
+ result.__filtered__ = result.__filtered__ || isFilter;
+ return result;
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.first` and `_.last`.
+ arrayEach(['first', 'last'], function(methodName, index) {
+ var takeName = 'take' + (index ? 'Right' : '');
+
+ LazyWrapper.prototype[methodName] = function() {
+ return this[takeName](1).value()[0];
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
+ arrayEach(['initial', 'rest'], function(methodName, index) {
+ var dropName = 'drop' + (index ? '' : 'Right');
+
+ LazyWrapper.prototype[methodName] = function() {
+ return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
+ arrayEach(['pluck', 'where'], function(methodName, index) {
+ var operationName = index ? 'filter' : 'map',
+ createCallback = index ? baseMatches : property;
+
+ LazyWrapper.prototype[methodName] = function(value) {
+ return this[operationName](createCallback(value));
+ };
+ });
+
+ LazyWrapper.prototype.compact = function() {
+ return this.filter(identity);
+ };
+
+ LazyWrapper.prototype.reject = function(predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 1);
+ return this.filter(function(value) {
+ return !predicate(value);
+ });
+ };
+
+ LazyWrapper.prototype.slice = function(start, end) {
+ start = start == null ? 0 : (+start || 0);
+
+ var result = this;
+ if (result.__filtered__ && (start > 0 || end < 0)) {
+ return new LazyWrapper(result);
+ }
+ if (start < 0) {
+ result = result.takeRight(-start);
+ } else if (start) {
+ result = result.drop(start);
+ }
+ if (end !== undefined) {
+ end = (+end || 0);
+ result = end < 0 ? result.dropRight(-end) : result.take(end - start);
+ }
+ return result;
+ };
+
+ LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
+ return this.reverse().takeWhile(predicate, thisArg).reverse();
+ };
+
+ LazyWrapper.prototype.toArray = function() {
+ return this.take(POSITIVE_INFINITY);
+ };
+
+ // Add `LazyWrapper` methods to `lodash.prototype`.
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
+ var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
+ retUnwrapped = /^(?:first|last)$/.test(methodName),
+ lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
+
+ if (!lodashFunc) {
+ return;
+ }
+ lodash.prototype[methodName] = function() {
+ var args = retUnwrapped ? [1] : arguments,
+ chainAll = this.__chain__,
+ value = this.__wrapped__,
+ isHybrid = !!this.__actions__.length,
+ isLazy = value instanceof LazyWrapper,
+ iteratee = args[0],
+ useLazy = isLazy || isArray(value);
+
+ if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
+ // Avoid lazy use if the iteratee has a "length" value other than `1`.
+ isLazy = useLazy = false;
+ }
+ var interceptor = function(value) {
+ return (retUnwrapped && chainAll)
+ ? lodashFunc(value, 1)[0]
+ : lodashFunc.apply(undefined, arrayPush([value], args));
+ };
+
+ var action = { 'func': thru, 'args': [interceptor], 'thisArg': undefined },
+ onlyLazy = isLazy && !isHybrid;
+
+ if (retUnwrapped && !chainAll) {
+ if (onlyLazy) {
+ value = value.clone();
+ value.__actions__.push(action);
+ return func.call(value);
+ }
+ return lodashFunc.call(undefined, this.value())[0];
+ }
+ if (!retUnwrapped && useLazy) {
+ value = onlyLazy ? value : new LazyWrapper(this);
+ var result = func.apply(value, args);
+ result.__actions__.push(action);
+ return new LodashWrapper(result, chainAll);
+ }
+ return this.thru(interceptor);
+ };
+ });
+
+ // Add `Array` and `String` methods to `lodash.prototype`.
+ arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
+ var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
+ chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
+ retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
+
+ lodash.prototype[methodName] = function() {
+ var args = arguments;
+ if (retUnwrapped && !this.__chain__) {
+ return func.apply(this.value(), args);
+ }
+ return this[chainName](function(value) {
+ return func.apply(value, args);
+ });
+ };
+ });
+
+ // Map minified function names to their real names.
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
+ var lodashFunc = lodash[methodName];
+ if (lodashFunc) {
+ var key = lodashFunc.name,
+ names = realNames[key] || (realNames[key] = []);
+
+ names.push({ 'name': methodName, 'func': lodashFunc });
+ }
+ });
+
+ realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];
+
+ // Add functions to the lazy wrapper.
+ LazyWrapper.prototype.clone = lazyClone;
+ LazyWrapper.prototype.reverse = lazyReverse;
+ LazyWrapper.prototype.value = lazyValue;
+
+ // Add chaining functions to the `lodash` wrapper.
+ lodash.prototype.chain = wrapperChain;
+ lodash.prototype.commit = wrapperCommit;
+ lodash.prototype.concat = wrapperConcat;
+ lodash.prototype.plant = wrapperPlant;
+ lodash.prototype.reverse = wrapperReverse;
+ lodash.prototype.toString = wrapperToString;
+ lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
+
+ // Add function aliases to the `lodash` wrapper.
+ lodash.prototype.collect = lodash.prototype.map;
+ lodash.prototype.head = lodash.prototype.first;
+ lodash.prototype.select = lodash.prototype.filter;
+ lodash.prototype.tail = lodash.prototype.rest;
+
+ return lodash;
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ // Export lodash.
+ var _ = runInContext();
+
+ // Some AMD build optimizers like r.js check for condition patterns like the following:
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ // Expose lodash to the global object when an AMD loader is present to avoid
+ // errors in cases where lodash is loaded by a script tag and not intended
+ // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
+ // more details.
+ root._ = _;
+
+ // Define as an anonymous module so, through path mapping, it can be
+ // referenced as the "underscore" module.
+ define(function() {
+ return _;
+ });
+ }
+ // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
+ else if (freeExports && freeModule) {
+ // Export for Node.js or RingoJS.
+ if (moduleExports) {
+ (freeModule.exports = _)._ = _;
+ }
+ // Export for Rhino with CommonJS support.
+ else {
+ freeExports._ = _;
+ }
+ }
+ else {
+ // Export for a browser or Rhino.
+ root._ = _;
+ }
+}.call(this));
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.min.js
new file mode 100644
index 0000000..f57c37b
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/lodash/lodash.min.js
@@ -0,0 +1,99 @@
+/**
+ * @license
+ * lodash 3.10.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
+ * Build: `lodash modern -o ./lodash.js`
+ */
+;(function(){function n(n,t){if(n!==t){var r=null===n,e=n===w,u=n===n,o=null===t,i=t===w,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(n<t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return null==n?"":n+""}function o(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););
+return r}function i(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function f(t,r){return n(t.a,r.a)||t.b-r.b}function a(n){return Nn[n]}function c(n){return Tn[n]}function l(n,t,r){return t?n=Bn[n]:r&&(n=Dn[n]),"\\"+n}function s(n){return"\\"+Dn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);
+}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=z,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Ln[n]}function m(_){function Nn(n){if(h(n)&&!(Oo(n)||n instanceof zn)){if(n instanceof Ln)return n;if(nu.call(n,"__chain__")&&nu.call(n,"__wrapped__"))return Mr(n)}return new Ln(n)}function Tn(){}function Ln(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
+this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=Ru,this.__views__=[]}function Bn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:gu(null),set:new lu};t--;)this.push(n[t])}function Mn(n,t){var r=n.data;return(typeof t=="string"||ge(t)?r.set.has(t):r.hash[t])?0:-1}function qn(n,t){var r=-1,e=n.length;for(t||(t=Be(e));++r<e;)t[r]=n[r];return t}function Pn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
+return n}function Kn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Vn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Gn(n,t){for(var r=-1,e=n.length,u=Be(e);++r<e;)u[r]=t(n[r],r,n);return u}function Jn(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Xn(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function Hn(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;
+return false}function Qn(n,t,r,e){return n!==w&&nu.call(e,r)?n:t}function nt(n,t,r){for(var e=-1,u=zo(t),o=u.length;++e<o;){var i=u[e],f=n[i],a=r(f,t[i],i,n,t);(a===a?a===f:f!==f)&&(f!==w||i in n)||(n[i]=a)}return n}function tt(n,t){return null==t?n:et(t,zo(t),n)}function rt(n,t){for(var r=-1,e=null==n,u=!e&&Er(n),o=u?n.length:0,i=t.length,f=Be(i);++r<i;){var a=t[r];f[r]=u?Cr(a,o)?n[a]:w:e?w:n[a]}return f}function et(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function ut(n,t,r){
+var e=typeof n;return"function"==e?t===w?n:Bt(n,t,r):null==n?Fe:"object"==e?bt(n):t===w?ze(n):xt(n,t)}function ot(n,t,r,e,u,o,i){var f;if(r&&(f=u?r(n,e,u):r(n)),f!==w)return f;if(!ge(n))return n;if(e=Oo(n)){if(f=kr(n),!t)return qn(n,f)}else{var a=ru.call(n),c=a==K;if(a!=Z&&a!=B&&(!c||u))return Fn[a]?Rr(n,a,t):u?n:{};if(f=Ir(c?{}:n),!t)return tt(f,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?Pn:_t)(n,function(e,u){f[u]=ot(e,t,r,u,n,o,i)}),f}function it(n,t,r){
+if(typeof n!="function")throw new Ge(L);return su(function(){n.apply(w,r)},t)}function ft(n,t){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=xr(),f=i==r,a=f&&t.length>=F&&gu&&lu?new Dn(t):null,c=t.length;a&&(i=Mn,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function at(n,t){var r=true;return Su(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ct(n,t,r,e){var u=e,o=u;return Su(n,function(n,i,f){i=+t(n,i,f),(r(i,u)||i===e&&i===o)&&(u=i,
+o=n)}),o}function lt(n,t){var r=[];return Su(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function st(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function pt(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];h(i)&&Er(i)&&(r||Oo(i)||pe(i))?t?pt(i,t,r,e):Jn(e,i):r||(e[e.length]=i)}return e}function ht(n,t){Nu(n,t,Re)}function _t(n,t){return Nu(n,t,zo)}function vt(n,t){return Tu(n,t,zo)}function gt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];
+ve(n[i])&&(o[++u]=i)}return o}function yt(n,t,r){if(null!=n){r!==w&&r in Br(n)&&(t=[r]),r=0;for(var e=t.length;null!=n&&r<e;)n=n[t[r++]];return r&&r==e?n:w}}function dt(n,t,r,e,u,o){if(n===t)n=true;else if(null==n||null==t||!ge(n)&&!h(t))n=n!==n&&t!==t;else n:{var i=dt,f=Oo(n),a=Oo(t),c=D,l=D;f||(c=ru.call(n),c==B?c=Z:c!=Z&&(f=xe(n))),a||(l=ru.call(t),l==B?l=Z:l!=Z&&xe(t));var s=c==Z,a=l==Z,l=c==l;if(!l||f||s){if(!e&&(c=s&&nu.call(n,"__wrapped__"),a=a&&nu.call(t,"__wrapped__"),c||a)){n=i(c?n.value():n,a?t.value():t,r,e,u,o);
+break n}if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(f?yr:mr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=dr(n,t,c)}return n}function mt(n,t,r){var e=t.length,u=e,o=!r;if(null==n)return!u;for(n=Br(n);e--;){var i=t[e];if(o&&i[2]?i[1]!==n[i[0]]:!(i[0]in n))return false}for(;++e<u;){var i=t[e],f=i[0],a=n[f],c=i[1];if(o&&i[2]){if(a===w&&!(f in n))return false}else if(i=r?r(a,c,f):w,i===w?!dt(c,a,r,true):!i)return false}return true}function wt(n,t){var r=-1,e=Er(n)?Be(n.length):[];
+return Su(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function bt(n){var t=Ar(n);if(1==t.length&&t[0][2]){var r=t[0][0],e=t[0][1];return function(n){return null==n?false:n[r]===e&&(e!==w||r in Br(n))}}return function(n){return mt(n,t)}}function xt(n,t){var r=Oo(n),e=Wr(n)&&t===t&&!ge(t),u=n+"";return n=Dr(n),function(o){if(null==o)return false;var i=u;if(o=Br(o),!(!r&&e||i in o)){if(o=1==n.length?o:yt(o,Et(n,0,-1)),null==o)return false;i=Zr(n),o=Br(o)}return o[i]===t?t!==w||i in o:dt(t,o[i],w,true)}}function At(n,t,r,e,u){
+if(!ge(n))return n;var o=Er(t)&&(Oo(t)||xe(t)),i=o?w:zo(t);return Pn(i||t,function(f,a){if(i&&(a=f,f=t[a]),h(f)){e||(e=[]),u||(u=[]);n:{for(var c=a,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Er(_)&&(Oo(_)||xe(_))?v=Oo(p)?p:Er(p)?qn(p):[]:me(_)||pe(_)?v=pe(p)?ke(p):me(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=At(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[a],l=r?r(c,f,a,n,t):w,(s=l===w)&&(l=f),l===w&&(!o||a in n)||!s&&(l===l?l===c:c!==c)||(n[a]=l);
+}),n}function jt(n){return function(t){return null==t?w:t[n]}}function kt(n){var t=n+"";return n=Dr(n),function(r){return yt(r,n,t)}}function It(n,t){for(var r=n?t.length:0;r--;){var e=t[r];if(e!=u&&Cr(e)){var u=e;pu.call(n,e,1)}}}function Rt(n,t){return n+yu(ku()*(t-n+1))}function Ot(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function Et(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=r===w||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Be(u);++e<u;)r[e]=n[e+t];
+return r}function Ct(n,t){var r;return Su(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Ut(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function Wt(t,r,e){var u=wr(),o=-1;return r=Gn(r,function(n){return u(n)}),t=wt(t,function(n){return{a:Gn(r,function(t){return t(n)}),b:++o,c:n}}),Ut(t,function(t,r){var u;n:{for(var o=-1,i=t.a,f=r.a,a=i.length,c=e.length;++o<a;)if(u=n(i[o],f[o])){if(o>=c)break n;o=e[o],u*="asc"===o||true===o?1:-1;break n}u=t.b-r.b}return u})}function $t(n,t){
+var r=0;return Su(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function St(n,t){var e=-1,u=xr(),o=n.length,i=u==r,f=i&&o>=F,a=f&&gu&&lu?new Dn(void 0):null,c=[];a?(u=Mn,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Ft(n,t){for(var r=-1,e=t.length,u=Be(e);++r<e;)u[r]=n[t[r]];return u}function Nt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););
+return r?Et(n,e?0:o,e?o+1:u):Et(n,e?o+1:0,e?u:o)}function Tt(n,t){var r=n;r instanceof zn&&(r=r.value());for(var e=-1,u=t.length;++e<u;)var o=t[e],r=o.func.apply(o.thisArg,Jn([r],o.args));return r}function Lt(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=Eu){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)&&null!==i?e=o+1:u=o}return u}return zt(n,t,Fe,r)}function zt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,a=t===w;u<o;){var c=yu((u+o)/2),l=r(n[c]),s=l!==w,p=l===l;
+(i?p||e:f?p&&s&&(e||null!=l):a?p&&(e||s):null==l?0:e?l<=t:l<t)?u=c+1:o=c}return xu(o,Ou)}function Bt(n,t,r){if(typeof n!="function")return Fe;if(t===w)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Dt(n){var t=new ou(n.byteLength);return new hu(t).set(new hu(n)),
+t}function Mt(n,t,r){for(var e=r.length,u=-1,o=bu(n.length-e,0),i=-1,f=t.length,a=Be(f+o);++i<f;)a[i]=t[i];for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];return a}function qt(n,t,r){for(var e=-1,u=r.length,o=-1,i=bu(n.length-u,0),f=-1,a=t.length,c=Be(i+a);++o<i;)c[o]=n[o];for(i=o;++f<a;)c[i+f]=t[f];for(;++e<u;)c[i+r[e]]=n[o++];return c}function Pt(n,t){return function(r,e,u){var o=t?t():{};if(e=wr(e,u,3),Oo(r)){u=-1;for(var i=r.length;++u<i;){var f=r[u];n(o,f,e(f,u,r),r)}}else Su(r,function(t,r,u){
+n(o,t,e(t,r,u),u)});return o}}function Kt(n){return le(function(t,r){var e=-1,u=null==t?0:r.length,o=2<u?r[u-2]:w,i=2<u?r[2]:w,f=1<u?r[u-1]:w;for(typeof o=="function"?(o=Bt(o,f,5),u-=2):(o=typeof f=="function"?f:w,u-=o?1:0),i&&Ur(r[0],r[1],i)&&(o=3>u?w:o,u=1);++e<u;)(i=r[e])&&n(t,i,o);return t})}function Vt(n,t){return function(r,e){var u=r?Bu(r):0;if(!Sr(u))return n(r,e);for(var o=t?u:-1,i=Br(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}function Zt(n){return function(t,r,e){var u=Br(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){
+var f=e[i];if(false===r(u[f],f,u))break}return t}}function Yt(n,t){function r(){return(this&&this!==Zn&&this instanceof r?e:n).apply(t,arguments)}var e=Jt(n);return r}function Gt(n){return function(t){var r=-1;t=$e(Ce(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function Jt(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:
+return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=$u(n.prototype),t=n.apply(r,t);return ge(t)?t:r}}function Xt(n){function t(r,e,u){return u&&Ur(r,e,u)&&(e=w),r=gr(r,n,w,w,w,w,w,e),r.placeholder=t.placeholder,r}return t}function Ht(n,t){return le(function(r){var e=r[0];return null==e?e:(r.push(t),n.apply(w,r))})}function Qt(n,t){return function(r,e,u){if(u&&Ur(r,e,u)&&(e=w),e=wr(e,u,3),1==e.length){
+u=r=Oo(r)?r:zr(r);for(var o=e,i=-1,f=u.length,a=t,c=a;++i<f;){var l=u[i],s=+o(l);n(s,a)&&(a=s,c=l)}if(u=c,!r.length||u!==t)return u}return ct(r,e,n,t)}}function nr(n,r){return function(e,u,o){return u=wr(u,o,3),Oo(e)?(u=t(e,u,r),-1<u?e[u]:w):st(e,u,n)}}function tr(n){return function(r,e,u){return r&&r.length?(e=wr(e,u,3),t(r,e,n)):-1}}function rr(n){return function(t,r,e){return r=wr(r,e,3),st(t,r,n,true)}}function er(n){return function(){for(var t,r=arguments.length,e=n?r:-1,u=0,o=Be(r);n?e--:++e<r;){
+var i=o[u++]=arguments[e];if(typeof i!="function")throw new Ge(L);!t&&Ln.prototype.thru&&"wrapper"==br(i)&&(t=new Ln([],true))}for(e=t?-1:r;++e<r;){var i=o[e],u=br(i),f="wrapper"==u?zu(i):w;t=f&&$r(f[0])&&f[1]==(E|k|R|C)&&!f[4].length&&1==f[9]?t[br(f[0])].apply(t,f[3]):1==i.length&&$r(i)?t[u]():t.thru(i)}return function(){var n=arguments,e=n[0];if(t&&1==n.length&&Oo(e)&&e.length>=F)return t.plant(e).value();for(var u=0,n=r?o[u].apply(this,n):e;++u<r;)n=o[u].call(this,n);return n}}}function ur(n,t){
+return function(r,e,u){return typeof e=="function"&&u===w&&Oo(r)?n(r,e):t(r,Bt(e,u,3))}}function or(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r,Re)}}function ir(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r)}}function fr(n){return function(t,r,e){var u={};return r=wr(r,e,3),_t(t,function(t,e,o){o=r(t,e,o),e=n?o:e,t=n?t:o,u[e]=t}),u}}function ar(n){return function(t,r,e){return t=u(t),(n?t:"")+pr(t,r,e)+(n?"":t)}}function cr(n){
+var t=le(function(r,e){var u=v(e,t.placeholder);return gr(r,n,w,e,u)});return t}function lr(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&o===w&&Oo(r)?n(r,e,u,i):Ot(r,wr(e,o,4),u,i,t)}}function sr(n,t,r,e,u,o,i,f,a,c){function l(){for(var m=arguments.length,b=m,j=Be(m);b--;)j[b]=arguments[b];if(e&&(j=Mt(j,e,u)),o&&(j=qt(j,o,i)),_||y){var b=l.placeholder,k=v(j,b),m=m-k.length;if(m<c){var I=f?qn(f):w,m=bu(c-m,0),E=_?k:w,k=_?w:k,C=_?j:w,j=_?w:j;return t|=_?R:O,t&=~(_?O:R),
+g||(t&=~(x|A)),j=[n,t,r,C,E,j,k,I,a,m],I=sr.apply(w,j),$r(n)&&Du(I,j),I.placeholder=b,I}}if(b=p?r:this,I=h?b[n]:n,f)for(m=j.length,E=xu(f.length,m),k=qn(j);E--;)C=f[E],j[E]=Cr(C,m)?k[C]:w;return s&&a<j.length&&(j.length=a),this&&this!==Zn&&this instanceof l&&(I=d||Jt(n)),I.apply(b,j)}var s=t&E,p=t&x,h=t&A,_=t&k,g=t&j,y=t&I,d=h?w:Jt(n);return l}function pr(n,t,r){return n=n.length,t=+t,n<t&&mu(t)?(t-=n,r=null==r?" ":r+"",Ue(r,vu(t/r.length)).slice(0,t)):""}function hr(n,t,r,e){function u(){for(var t=-1,f=arguments.length,a=-1,c=e.length,l=Be(c+f);++a<c;)l[a]=e[a];
+for(;f--;)l[a++]=arguments[++t];return(this&&this!==Zn&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=Jt(n);return u}function _r(n){var t=Pe[n];return function(n,r){return(r=r===w?0:+r||0)?(r=au(10,r),t(n*r)/r):t(n)}}function vr(n){return function(t,r,e,u){var o=wr(e);return null==e&&o===ut?Lt(t,r,n):zt(t,r,o(e,u,1),n)}}function gr(n,t,r,e,u,o,i,f){var a=t&A;if(!a&&typeof n!="function")throw new Ge(L);var c=e?e.length:0;if(c||(t&=~(R|O),e=u=w),c-=u?u.length:0,t&O){var l=e,s=u;e=u=w}var p=a?w:zu(n);
+return r=[n,t,r,e,u,l,s,o,i,f],p&&(e=r[1],t=p[1],f=e|t,u=t==E&&e==k||t==E&&e==C&&r[7].length<=p[8]||t==(E|C)&&e==k,(f<E||u)&&(t&x&&(r[2]=p[2],f|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Mt(u,e,p[4]):qn(e),r[4]=u?v(r[3],z):qn(p[4])),(e=p[5])&&(u=r[5],r[5]=u?qt(u,e,p[6]):qn(e),r[6]=u?v(r[5],z):qn(p[6])),(e=p[7])&&(r[7]=qn(e)),t&E&&(r[8]=null==r[8]?p[8]:xu(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9]),r[9]=null==f?a?0:n.length:bu(f-c,0)||0,(p?Lu:Du)(t==x?Yt(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?sr.apply(w,r):hr.apply(w,r),r);
+}function yr(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length;if(a!=c&&(!u||c<=a))return false;for(;++f<a;){var l=n[f],c=t[f],s=e?e(u?c:l,u?l:c,f):w;if(s!==w){if(s)continue;return false}if(u){if(!Hn(t,function(n){return l===n||r(l,n,e,u,o,i)}))return false}else if(l!==c&&!r(l,c,e,u,o,i))return false}return true}function dr(n,t,r){switch(r){case M:case q:return+n==+t;case P:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:n==+t;case Y:case G:return n==t+""}return false}function mr(n,t,r,e,u,o,i){var f=zo(n),a=f.length,c=zo(t).length;
+if(a!=c&&!u)return false;for(c=a;c--;){var l=f[c];if(!(u?l in t:nu.call(t,l)))return false}for(var s=u;++c<a;){var l=f[c],p=n[l],h=t[l],_=e?e(u?h:p,u?p:h,l):w;if(_===w?!r(p,h,e,u,o,i):!_)return false;s||(s="constructor"==l)}return s||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function wr(n,t,r){var e=Nn.callback||Se,e=e===Se?ut:e;return r?e(n,t,r):e}function br(n){for(var t=n.name,r=Wu[t],e=r?r.length:0;e--;){
+var u=r[e],o=u.func;if(null==o||o==n)return u.name}return t}function xr(n,t,e){var u=Nn.indexOf||Vr,u=u===Vr?r:u;return n?u(n,t,e):u}function Ar(n){n=Oe(n);for(var t=n.length;t--;){var r=n[t][1];n[t][2]=r===r&&!ge(r)}return n}function jr(n,t){var r=null==n?w:n[t];return ye(r)?r:w}function kr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ir(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Ve),
+new n}function Rr(n,t,r){var e=n.constructor;switch(t){case J:return Dt(n);case M:case q:return new e(+n);case X:case H:case Q:case nn:case tn:case rn:case en:case un:case on:return t=n.buffer,new e(r?Dt(t):t,n.byteOffset,n.length);case V:case G:return new e(n);case Y:var u=new e(n.source,kn.exec(n));u.lastIndex=n.lastIndex}return u}function Or(n,t,r){return null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),t=Zr(t)),t=null==n?n:n[t],null==t?w:t.apply(n,r)}function Er(n){return null!=n&&Sr(Bu(n));
+}function Cr(n,t){return n=typeof n=="number"||On.test(n)?+n:-1,t=null==t?Cu:t,-1<n&&0==n%1&&n<t}function Ur(n,t,r){if(!ge(r))return false;var e=typeof t;return("number"==e?Er(r)&&Cr(t,r.length):"string"==e&&t in r)?(t=r[t],n===n?n===t:t!==t):false}function Wr(n,t){var r=typeof n;return"string"==r&&dn.test(n)||"number"==r?true:Oo(n)?false:!yn.test(n)||null!=t&&n in Br(t)}function $r(n){var t=br(n);return t in zn.prototype?(t=Nn[t],n===t?true:(t=zu(t),!!t&&n===t[0])):false}function Sr(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=Cu;
+}function Fr(n,t){return n===w?t:Eo(n,t,Fr)}function Nr(n,t){n=Br(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Tr(n,t){var r={};return ht(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function Lr(n){for(var t=Re(n),r=t.length,e=r&&n.length,u=!!e&&Sr(e)&&(Oo(n)||pe(n)),o=-1,i=[];++o<r;){var f=t[o];(u&&Cr(f,e)||nu.call(n,f))&&i.push(f)}return i}function zr(n){return null==n?[]:Er(n)?ge(n)?n:Ve(n):Ee(n)}function Br(n){return ge(n)?n:Ve(n)}function Dr(n){if(Oo(n))return n;
+var t=[];return u(n).replace(mn,function(n,r,e,u){t.push(e?u.replace(An,"$1"):r||n)}),t}function Mr(n){return n instanceof zn?n.clone():new Ln(n.__wrapped__,n.__chain__,qn(n.__actions__))}function qr(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0>t?0:t)):[]}function Pr(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0,0>t?0:t)):[]}function Kr(n){return n?n[0]:w}function Vr(n,t,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?bu(u+e,0):e;else if(e)return e=Lt(n,t),
+e<u&&(t===t?t===n[e]:n[e]!==n[e])?e:-1;return r(n,t,e||0)}function Zr(n){var t=n?n.length:0;return t?n[t-1]:w}function Yr(n){return qr(n,1)}function Gr(n,t,e,u){if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=Ur(n,t,u)?w:t,t=false);var o=wr();if((null!=e||o!==ut)&&(e=o(e,u,3)),t&&xr()==r){t=e;var i;e=-1,u=n.length;for(var o=-1,f=[];++e<u;){var a=n[e],c=t?t(a,e,n):a;e&&i===c||(i=c,f[++o]=a)}n=f}else n=St(n,e);return n}function Jr(n){if(!n||!n.length)return[];var t=-1,r=0;n=Vn(n,function(n){
+return Er(n)?(r=bu(n.length,r),true):void 0});for(var e=Be(r);++t<r;)e[t]=Gn(n,jt(t));return e}function Xr(n,t,r){return n&&n.length?(n=Jr(n),null==t?n:(t=Bt(t,r,4),Gn(n,function(n){return Xn(n,t,w,true)}))):[]}function Hr(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||Oo(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Qr(n){return n=Nn(n),n.__chain__=true,n}function ne(n,t,r){return t.call(r,n)}function te(n,t,r){var e=Oo(n)?Kn:at;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),
+e(n,t)}function re(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,t)}function ee(n,t,r,e){var u=n?Bu(n):0;return Sr(u)||(n=Ee(n),u=n.length),r=typeof r!="number"||e&&Ur(t,r,e)?0:0>r?bu(u+r,0):r||0,typeof n=="string"||!Oo(n)&&be(n)?r<=u&&-1<n.indexOf(t,r):!!u&&-1<xr(n,t,r)}function ue(n,t,r){var e=Oo(n)?Gn:wt;return t=wr(t,r,3),e(n,t)}function oe(n,t,r){if(r?Ur(n,t,r):null==t){n=zr(n);var e=n.length;return 0<e?n[Rt(0,e-1)]:w}r=-1,n=je(n);var e=n.length,u=e-1;for(t=xu(0>t?0:+t||0,e);++r<t;){var e=Rt(r,u),o=n[e];
+n[e]=n[r],n[r]=o}return n.length=t,n}function ie(n,t,r){var e=Oo(n)?Hn:Ct;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),e(n,t)}function fe(n,t){var r;if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var e=n;n=t,t=e}return function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=w),r}}function ae(n,t,r){function e(t,r){r&&iu(r),a=p=h=w,t&&(_=ho(),c=n.apply(s,f),p||a||(f=s=w))}function u(){var n=t-(ho()-l);0>=n||n>t?e(h,a):p=su(u,n)}function o(){e(g,p);
+}function i(){if(f=arguments,l=ho(),s=this,h=g&&(p||!y),false===v)var r=y&&!p;else{a||y||(_=l);var e=v-(l-_),i=0>=e||e>v;i?(a&&(a=iu(a)),_=l,c=n.apply(s,f)):a||(a=su(o,e))}return i&&p?p=iu(p):p||t===v||(p=su(u,t)),r&&(i=true,c=n.apply(s,f)),!i||p||a||(f=s=w),c}var f,a,c,l,s,p,h,_=0,v=false,g=true;if(typeof n!="function")throw new Ge(L);if(t=0>t?0:+t||0,true===r)var y=true,g=false;else ge(r)&&(y=!!r.leading,v="maxWait"in r&&bu(+r.maxWait||0,t),g="trailing"in r?!!r.trailing:g);return i.cancel=function(){p&&iu(p),a&&iu(a),
+_=0,a=p=h=w},i}function ce(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new Ge(L);return r.cache=new ce.Cache,r}function le(n,t){if(typeof n!="function")throw new Ge(L);return t=bu(t===w?n.length-1:+t||0,0),function(){for(var r=arguments,e=-1,u=bu(r.length-t,0),o=Be(u);++e<u;)o[e]=r[t+e];switch(t){case 0:return n.call(this,o);case 1:return n.call(this,r[0],o);
+case 2:return n.call(this,r[0],r[1],o)}for(u=Be(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function se(n,t){return n>t}function pe(n){return h(n)&&Er(n)&&nu.call(n,"callee")&&!cu.call(n,"callee")}function he(n,t,r,e){return e=(r=typeof r=="function"?Bt(r,e,3):w)?r(n,t):w,e===w?dt(n,t,r):!!e}function _e(n){return h(n)&&typeof n.message=="string"&&ru.call(n)==P}function ve(n){return ge(n)&&ru.call(n)==K}function ge(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function ye(n){
+return null==n?false:ve(n)?uu.test(Qe.call(n)):h(n)&&Rn.test(n)}function de(n){return typeof n=="number"||h(n)&&ru.call(n)==V}function me(n){var t;if(!h(n)||ru.call(n)!=Z||pe(n)||!(nu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t)))return false;var r;return ht(n,function(n,t){r=t}),r===w||nu.call(n,r)}function we(n){return ge(n)&&ru.call(n)==Y}function be(n){return typeof n=="string"||h(n)&&ru.call(n)==G}function xe(n){return h(n)&&Sr(n.length)&&!!Sn[ru.call(n)]}function Ae(n,t){
+return n<t}function je(n){var t=n?Bu(n):0;return Sr(t)?t?qn(n):[]:Ee(n)}function ke(n){return et(n,Re(n))}function Ie(n){return gt(n,Re(n))}function Re(n){if(null==n)return[];ge(n)||(n=Ve(n));for(var t=n.length,t=t&&Sr(t)&&(Oo(n)||pe(n))&&t||0,r=n.constructor,e=-1,r=typeof r=="function"&&r.prototype===n,u=Be(t),o=0<t;++e<t;)u[e]=e+"";for(var i in n)o&&Cr(i,t)||"constructor"==i&&(r||!nu.call(n,i))||u.push(i);return u}function Oe(n){n=Br(n);for(var t=-1,r=zo(n),e=r.length,u=Be(e);++t<e;){var o=r[t];
+u[t]=[o,n[o]]}return u}function Ee(n){return Ft(n,zo(n))}function Ce(n){return(n=u(n))&&n.replace(En,a).replace(xn,"")}function Ue(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!mu(t))return r;do t%2&&(r+=n),t=yu(t/2),n+=n;while(t);return r}function We(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(g(n),y(n)+1):(t+="",n.slice(o(n,t),i(n,t)+1)):n}function $e(n,t,r){return r&&Ur(n,t,r)&&(t=w),n=u(n),n.match(t||Wn)||[]}function Se(n,t,r){return r&&Ur(n,t,r)&&(t=w),h(n)?Ne(n):ut(n,t)}function Fe(n){
+return n}function Ne(n){return bt(ot(n,true))}function Te(n,t,r){if(null==r){var e=ge(t),u=e?zo(t):w;((u=u&&u.length?gt(t,u):w)?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=gt(t,zo(t)));var o=true,e=-1,i=ve(n),f=u.length;false===r?o=false:ge(r)&&"chain"in r&&(o=r.chain);for(;++e<f;){r=u[e];var a=t[r];n[r]=a,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__;if(o||r){var e=n(this.__wrapped__);return(e.__actions__=qn(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return t.apply(n,Jn([this.value()],arguments));
+}}(a))}return n}function Le(){}function ze(n){return Wr(n)?jt(n):kt(n)}_=_?Yn.defaults(Zn.Object(),_,Yn.pick(Zn,$n)):Zn;var Be=_.Array,De=_.Date,Me=_.Error,qe=_.Function,Pe=_.Math,Ke=_.Number,Ve=_.Object,Ze=_.RegExp,Ye=_.String,Ge=_.TypeError,Je=Be.prototype,Xe=Ve.prototype,He=Ye.prototype,Qe=qe.prototype.toString,nu=Xe.hasOwnProperty,tu=0,ru=Xe.toString,eu=Zn._,uu=Ze("^"+Qe.call(nu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ou=_.ArrayBuffer,iu=_.clearTimeout,fu=_.parseFloat,au=Pe.pow,cu=Xe.propertyIsEnumerable,lu=jr(_,"Set"),su=_.setTimeout,pu=Je.splice,hu=_.Uint8Array,_u=jr(_,"WeakMap"),vu=Pe.ceil,gu=jr(Ve,"create"),yu=Pe.floor,du=jr(Be,"isArray"),mu=_.isFinite,wu=jr(Ve,"keys"),bu=Pe.max,xu=Pe.min,Au=jr(De,"now"),ju=_.parseInt,ku=Pe.random,Iu=Ke.NEGATIVE_INFINITY,Ru=Ke.POSITIVE_INFINITY,Ou=4294967294,Eu=2147483647,Cu=9007199254740991,Uu=_u&&new _u,Wu={};
+Nn.support={},Nn.templateSettings={escape:_n,evaluate:vn,interpolate:gn,variable:"",imports:{_:Nn}};var $u=function(){function n(){}return function(t){if(ge(t)){n.prototype=t;var r=new n;n.prototype=w}return r||{}}}(),Su=Vt(_t),Fu=Vt(vt,true),Nu=Zt(),Tu=Zt(true),Lu=Uu?function(n,t){return Uu.set(n,t),n}:Fe,zu=Uu?function(n){return Uu.get(n)}:Le,Bu=jt("length"),Du=function(){var n=0,t=0;return function(r,e){var u=ho(),o=S-(u-t);if(t=u,0<o){if(++n>=$)return r}else n=0;return Lu(r,e)}}(),Mu=le(function(n,t){
+return h(n)&&Er(n)?ft(n,pt(t,false,true)):[]}),qu=tr(),Pu=tr(true),Ku=le(function(n){for(var t=n.length,e=t,u=Be(l),o=xr(),i=o==r,f=[];e--;){var a=n[e]=Er(a=n[e])?a:[];u[e]=i&&120<=a.length&&gu&&lu?new Dn(e&&a):null}var i=n[0],c=-1,l=i?i.length:0,s=u[0];n:for(;++c<l;)if(a=i[c],0>(s?Mn(s,a):o(f,a,0))){for(e=t;--e;){var p=u[e];if(0>(p?Mn(p,a):o(n[e],a,0)))continue n}s&&s.push(a),f.push(a)}return f}),Vu=le(function(t,r){r=pt(r);var e=rt(t,r);return It(t,r.sort(n)),e}),Zu=vr(),Yu=vr(true),Gu=le(function(n){return St(pt(n,false,true));
+}),Ju=le(function(n,t){return Er(n)?ft(n,t):[]}),Xu=le(Jr),Hu=le(function(n){var t=n.length,r=2<t?n[t-2]:w,e=1<t?n[t-1]:w;return 2<t&&typeof r=="function"?t-=2:(r=1<t&&typeof e=="function"?(--t,e):w,e=w),n.length=t,Xr(n,r,e)}),Qu=le(function(n){return n=pt(n),this.thru(function(t){t=Oo(t)?t:[Br(t)];for(var r=n,e=-1,u=t.length,o=-1,i=r.length,f=Be(u+i);++e<u;)f[e]=t[e];for(;++o<i;)f[e++]=r[o];return f})}),no=le(function(n,t){return rt(n,pt(t))}),to=Pt(function(n,t,r){nu.call(n,r)?++n[r]:n[r]=1}),ro=nr(Su),eo=nr(Fu,true),uo=ur(Pn,Su),oo=ur(function(n,t){
+for(var r=n.length;r--&&false!==t(n[r],r,n););return n},Fu),io=Pt(function(n,t,r){nu.call(n,r)?n[r].push(t):n[r]=[t]}),fo=Pt(function(n,t,r){n[r]=t}),ao=le(function(n,t,r){var e=-1,u=typeof t=="function",o=Wr(t),i=Er(n)?Be(n.length):[];return Su(n,function(n){var f=u?t:o&&null!=n?n[t]:w;i[++e]=f?f.apply(n,r):Or(n,t,r)}),i}),co=Pt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),lo=lr(Xn,Su),so=lr(function(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r},Fu),po=le(function(n,t){
+if(null==n)return[];var r=t[2];return r&&Ur(t[0],t[1],r)&&(t.length=1),Wt(n,pt(t),[])}),ho=Au||function(){return(new De).getTime()},_o=le(function(n,t,r){var e=x;if(r.length)var u=v(r,_o.placeholder),e=e|R;return gr(n,e,t,r,u)}),vo=le(function(n,t){t=t.length?pt(t):Ie(n);for(var r=-1,e=t.length;++r<e;){var u=t[r];n[u]=gr(n[u],x,n)}return n}),go=le(function(n,t,r){var e=x|A;if(r.length)var u=v(r,go.placeholder),e=e|R;return gr(t,e,n,r,u)}),yo=Xt(k),mo=Xt(I),wo=le(function(n,t){return it(n,1,t)}),bo=le(function(n,t,r){
+return it(n,t,r)}),xo=er(),Ao=er(true),jo=le(function(n,t){if(t=pt(t),typeof n!="function"||!Kn(t,e))throw new Ge(L);var r=t.length;return le(function(e){for(var u=xu(e.length,r);u--;)e[u]=t[u](e[u]);return n.apply(this,e)})}),ko=cr(R),Io=cr(O),Ro=le(function(n,t){return gr(n,C,w,w,w,pt(t))}),Oo=du||function(n){return h(n)&&Sr(n.length)&&ru.call(n)==D},Eo=Kt(At),Co=Kt(function(n,t,r){return r?nt(n,t,r):tt(n,t)}),Uo=Ht(Co,function(n,t){return n===w?t:n}),Wo=Ht(Eo,Fr),$o=rr(_t),So=rr(vt),Fo=or(Nu),No=or(Tu),To=ir(_t),Lo=ir(vt),zo=wu?function(n){
+var t=null==n?w:n.constructor;return typeof t=="function"&&t.prototype===n||typeof n!="function"&&Er(n)?Lr(n):ge(n)?wu(n):[]}:Lr,Bo=fr(true),Do=fr(),Mo=le(function(n,t){if(null==n)return{};if("function"!=typeof t[0])return t=Gn(pt(t),Ye),Nr(n,ft(Re(n),t));var r=Bt(t[0],t[1],3);return Tr(n,function(n,t,e){return!r(n,t,e)})}),qo=le(function(n,t){return null==n?{}:"function"==typeof t[0]?Tr(n,Bt(t[0],t[1],3)):Nr(n,pt(t))}),Po=Gt(function(n,t,r){return t=t.toLowerCase(),n+(r?t.charAt(0).toUpperCase()+t.slice(1):t);
+}),Ko=Gt(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vo=ar(),Zo=ar(true),Yo=Gt(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Go=Gt(function(n,t,r){return n+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),Jo=le(function(n,t){try{return n.apply(w,t)}catch(r){return _e(r)?r:new Me(r)}}),Xo=le(function(n,t){return function(r){return Or(r,n,t)}}),Ho=le(function(n,t){return function(r){return Or(n,r,t)}}),Qo=_r("ceil"),ni=_r("floor"),ti=Qt(se,Iu),ri=Qt(Ae,Ru),ei=_r("round");return Nn.prototype=Tn.prototype,
+Ln.prototype=$u(Tn.prototype),Ln.prototype.constructor=Ln,zn.prototype=$u(Tn.prototype),zn.prototype.constructor=zn,Bn.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n]},Bn.prototype.get=function(n){return"__proto__"==n?w:this.__data__[n]},Bn.prototype.has=function(n){return"__proto__"!=n&&nu.call(this.__data__,n)},Bn.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},Dn.prototype.push=function(n){var t=this.data;typeof n=="string"||ge(n)?t.set.add(n):t.hash[n]=true;
+},ce.Cache=Bn,Nn.after=function(n,t){if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var r=n;n=t,t=r}return n=mu(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0}},Nn.ary=function(n,t,r){return r&&Ur(n,t,r)&&(t=w),t=n&&null==t?n.length:bu(+t||0,0),gr(n,E,w,w,w,w,t)},Nn.assign=Co,Nn.at=no,Nn.before=fe,Nn.bind=_o,Nn.bindAll=vo,Nn.bindKey=go,Nn.callback=Se,Nn.chain=Qr,Nn.chunk=function(n,t,r){t=(r?Ur(n,t,r):null==t)?1:bu(yu(t)||1,1),r=0;for(var e=n?n.length:0,u=-1,o=Be(vu(e/t));r<e;)o[++u]=Et(n,r,r+=t);
+return o},Nn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},Nn.constant=function(n){return function(){return n}},Nn.countBy=to,Nn.create=function(n,t,r){var e=$u(n);return r&&Ur(n,t,r)&&(t=w),t?tt(e,t):e},Nn.curry=yo,Nn.curryRight=mo,Nn.debounce=ae,Nn.defaults=Uo,Nn.defaultsDeep=Wo,Nn.defer=wo,Nn.delay=bo,Nn.difference=Mu,Nn.drop=qr,Nn.dropRight=Pr,Nn.dropRightWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3),true,true):[]},Nn.dropWhile=function(n,t,r){
+return n&&n.length?Nt(n,wr(t,r,3),true):[]},Nn.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&Ur(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=e===w||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;return n},Nn.filter=re,Nn.flatten=function(n,t,r){var e=n?n.length:0;return r&&Ur(n,t,r)&&(t=false),e?pt(n,t):[]},Nn.flattenDeep=function(n){return n&&n.length?pt(n,true):[]},Nn.flow=xo,Nn.flowRight=Ao,Nn.forEach=uo,Nn.forEachRight=oo,Nn.forIn=Fo,
+Nn.forInRight=No,Nn.forOwn=To,Nn.forOwnRight=Lo,Nn.functions=Ie,Nn.groupBy=io,Nn.indexBy=fo,Nn.initial=function(n){return Pr(n,1)},Nn.intersection=Ku,Nn.invert=function(n,t,r){r&&Ur(n,t,r)&&(t=w),r=-1;for(var e=zo(n),u=e.length,o={};++r<u;){var i=e[r],f=n[i];t?nu.call(o,f)?o[f].push(i):o[f]=[i]:o[f]=i}return o},Nn.invoke=ao,Nn.keys=zo,Nn.keysIn=Re,Nn.map=ue,Nn.mapKeys=Bo,Nn.mapValues=Do,Nn.matches=Ne,Nn.matchesProperty=function(n,t){return xt(n,ot(t,true))},Nn.memoize=ce,Nn.merge=Eo,Nn.method=Xo,Nn.methodOf=Ho,
+Nn.mixin=Te,Nn.modArgs=jo,Nn.negate=function(n){if(typeof n!="function")throw new Ge(L);return function(){return!n.apply(this,arguments)}},Nn.omit=Mo,Nn.once=function(n){return fe(2,n)},Nn.pairs=Oe,Nn.partial=ko,Nn.partialRight=Io,Nn.partition=co,Nn.pick=qo,Nn.pluck=function(n,t){return ue(n,ze(t))},Nn.property=ze,Nn.propertyOf=function(n){return function(t){return yt(n,Dr(t),t+"")}},Nn.pull=function(){var n=arguments,t=n[0];if(!t||!t.length)return t;for(var r=0,e=xr(),u=n.length;++r<u;)for(var o=0,i=n[r];-1<(o=e(t,i,o));)pu.call(t,o,1);
+return t},Nn.pullAt=Vu,Nn.range=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=bu(vu((t-n)/(r||1)),0);for(var u=Be(t);++e<t;)u[e]=n,n+=r;return u},Nn.rearg=Ro,Nn.reject=function(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,function(n,r,e){return!t(n,r,e)})},Nn.remove=function(n,t,r){var e=[];if(!n||!n.length)return e;var u=-1,o=[],i=n.length;for(t=wr(t,r,3);++u<i;)r=n[u],t(r,u,n)&&(e.push(r),o.push(u));return It(n,o),e},Nn.rest=Yr,Nn.restParam=le,
+Nn.set=function(n,t,r){if(null==n)return n;var e=t+"";t=null!=n[e]||Wr(t,n)?[e]:Dr(t);for(var e=-1,u=t.length,o=u-1,i=n;null!=i&&++e<u;){var f=t[e];ge(i)&&(e==o?i[f]=r:null==i[f]&&(i[f]=Cr(t[e+1])?[]:{})),i=i[f]}return n},Nn.shuffle=function(n){return oe(n,Ru)},Nn.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&Ur(n,t,r)&&(t=0,r=e),Et(n,t,r)):[]},Nn.sortBy=function(n,t,r){if(null==n)return[];r&&Ur(n,t,r)&&(t=w);var e=-1;return t=wr(t,r,3),n=wt(n,function(n,r,u){return{a:t(n,r,u),
+b:++e,c:n}}),Ut(n,f)},Nn.sortByAll=po,Nn.sortByOrder=function(n,t,r,e){return null==n?[]:(e&&Ur(t,r,e)&&(r=w),Oo(t)||(t=null==t?[]:[t]),Oo(r)||(r=null==r?[]:[r]),Wt(n,t,r))},Nn.spread=function(n){if(typeof n!="function")throw new Ge(L);return function(t){return n.apply(this,t)}},Nn.take=function(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0,0>t?0:t)):[]},Nn.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0>t?0:t)):[]},Nn.takeRightWhile=function(n,t,r){
+return n&&n.length?Nt(n,wr(t,r,3),false,true):[]},Nn.takeWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3)):[]},Nn.tap=function(n,t,r){return t.call(r,n),n},Nn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new Ge(L);return false===r?e=false:ge(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ae(n,t,{leading:e,maxWait:+t,trailing:u})},Nn.thru=ne,Nn.times=function(n,t,r){if(n=yu(n),1>n||!mu(n))return[];var e=-1,u=Be(xu(n,4294967295));for(t=Bt(t,r,1);++e<n;)4294967295>e?u[e]=t(e):t(e);
+return u},Nn.toArray=je,Nn.toPlainObject=ke,Nn.transform=function(n,t,r,e){var u=Oo(n)||xe(n);return t=wr(t,e,4),null==r&&(u||ge(n)?(e=n.constructor,r=u?Oo(n)?new e:[]:$u(ve(e)?e.prototype:w)):r={}),(u?Pn:_t)(n,function(n,e,u){return t(r,n,e,u)}),r},Nn.union=Gu,Nn.uniq=Gr,Nn.unzip=Jr,Nn.unzipWith=Xr,Nn.values=Ee,Nn.valuesIn=function(n){return Ft(n,Re(n))},Nn.where=function(n,t){return re(n,bt(t))},Nn.without=Ju,Nn.wrap=function(n,t){return t=null==t?Fe:t,gr(t,R,w,[n],[])},Nn.xor=function(){for(var n=-1,t=arguments.length;++n<t;){
+var r=arguments[n];if(Er(r))var e=e?Jn(ft(e,r),ft(r,e)):r}return e?St(e):[]},Nn.zip=Xu,Nn.zipObject=Hr,Nn.zipWith=Hu,Nn.backflow=Ao,Nn.collect=ue,Nn.compose=Ao,Nn.each=uo,Nn.eachRight=oo,Nn.extend=Co,Nn.iteratee=Se,Nn.methods=Ie,Nn.object=Hr,Nn.select=re,Nn.tail=Yr,Nn.unique=Gr,Te(Nn,Nn),Nn.add=function(n,t){return(+n||0)+(+t||0)},Nn.attempt=Jo,Nn.camelCase=Po,Nn.capitalize=function(n){return(n=u(n))&&n.charAt(0).toUpperCase()+n.slice(1)},Nn.ceil=Qo,Nn.clone=function(n,t,r,e){return t&&typeof t!="boolean"&&Ur(n,t,r)?t=false:typeof t=="function"&&(e=r,
+r=t,t=false),typeof r=="function"?ot(n,t,Bt(r,e,1)):ot(n,t)},Nn.cloneDeep=function(n,t,r){return typeof t=="function"?ot(n,true,Bt(t,r,1)):ot(n,true)},Nn.deburr=Ce,Nn.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=r===w?e:xu(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Nn.escape=function(n){return(n=u(n))&&hn.test(n)?n.replace(sn,c):n},Nn.escapeRegExp=function(n){return(n=u(n))&&bn.test(n)?n.replace(wn,l):n||"(?:)"},Nn.every=te,Nn.find=ro,Nn.findIndex=qu,Nn.findKey=$o,Nn.findLast=eo,
+Nn.findLastIndex=Pu,Nn.findLastKey=So,Nn.findWhere=function(n,t){return ro(n,bt(t))},Nn.first=Kr,Nn.floor=ni,Nn.get=function(n,t,r){return n=null==n?w:yt(n,Dr(t),t+""),n===w?r:n},Nn.gt=se,Nn.gte=function(n,t){return n>=t},Nn.has=function(n,t){if(null==n)return false;var r=nu.call(n,t);if(!r&&!Wr(t)){if(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),null==n)return false;t=Zr(t),r=nu.call(n,t)}return r||Sr(n.length)&&Cr(t,n.length)&&(Oo(n)||pe(n))},Nn.identity=Fe,Nn.includes=ee,Nn.indexOf=Vr,Nn.inRange=function(n,t,r){
+return t=+t||0,r===w?(r=t,t=0):r=+r||0,n>=xu(t,r)&&n<bu(t,r)},Nn.isArguments=pe,Nn.isArray=Oo,Nn.isBoolean=function(n){return true===n||false===n||h(n)&&ru.call(n)==M},Nn.isDate=function(n){return h(n)&&ru.call(n)==q},Nn.isElement=function(n){return!!n&&1===n.nodeType&&h(n)&&!me(n)},Nn.isEmpty=function(n){return null==n?true:Er(n)&&(Oo(n)||be(n)||pe(n)||h(n)&&ve(n.splice))?!n.length:!zo(n).length},Nn.isEqual=he,Nn.isError=_e,Nn.isFinite=function(n){return typeof n=="number"&&mu(n)},Nn.isFunction=ve,Nn.isMatch=function(n,t,r,e){
+return r=typeof r=="function"?Bt(r,e,3):w,mt(n,Ar(t),r)},Nn.isNaN=function(n){return de(n)&&n!=+n},Nn.isNative=ye,Nn.isNull=function(n){return null===n},Nn.isNumber=de,Nn.isObject=ge,Nn.isPlainObject=me,Nn.isRegExp=we,Nn.isString=be,Nn.isTypedArray=xe,Nn.isUndefined=function(n){return n===w},Nn.kebabCase=Ko,Nn.last=Zr,Nn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?bu(e+r,0):xu(r||0,e-1))+1;else if(r)return u=Lt(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;
+if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nn.lt=Ae,Nn.lte=function(n,t){return n<=t},Nn.max=ti,Nn.min=ri,Nn.noConflict=function(){return Zn._=eu,this},Nn.noop=Le,Nn.now=ho,Nn.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&mu(t)?(e=(t-e)/2,t=yu(e),e=vu(e),r=pr("",e,r),r.slice(0,t)+n+r):n},Nn.padLeft=Vo,Nn.padRight=Zo,Nn.parseInt=function(n,t,r){return(r?Ur(n,t,r):null==t)?t=0:t&&(t=+t),n=We(n),ju(n,t||(In.test(n)?16:10))},Nn.random=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w);
+var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ku(),xu(n+r*(t-n+fu("1e-"+((r+"").length-1))),t)):Rt(n,t)},Nn.reduce=lo,Nn.reduceRight=so,Nn.repeat=Ue,Nn.result=function(n,t,r){var e=null==n?w:n[t];return e===w&&(null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),e=null==n?w:n[Zr(t)]),e=e===w?r:e),ve(e)?e.call(n):e},Nn.round=ei,Nn.runInContext=m,Nn.size=function(n){var t=n?Bu(n):0;
+return Sr(t)?t:zo(n).length},Nn.snakeCase=Yo,Nn.some=ie,Nn.sortedIndex=Zu,Nn.sortedLastIndex=Yu,Nn.startCase=Go,Nn.startsWith=function(n,t,r){return n=u(n),r=null==r?0:xu(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nn.sum=function(n,t,r){if(r&&Ur(n,t,r)&&(t=w),t=wr(t,r,3),1==t.length){n=Oo(n)?n:zr(n),r=n.length;for(var e=0;r--;)e+=+t(n[r])||0;n=e}else n=$t(n,t);return n},Nn.template=function(n,t,r){var e=Nn.templateSettings;r&&Ur(n,t,r)&&(t=r=w),n=u(n),t=nt(tt({},r||t),e,Qn),r=nt(tt({},t.imports),e.imports,Qn);
+var o,i,f=zo(r),a=Ft(r,f),c=0;r=t.interpolate||Cn;var l="__p+='";r=Ze((t.escape||Cn).source+"|"+r.source+"|"+(r===gn?jn:Cn).source+"|"+(t.evaluate||Cn).source+"|$","g");var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,f,a){return e||(e=u),l+=n.slice(c,a).replace(Un,s),r&&(o=true,l+="'+__e("+r+")+'"),f&&(i=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=a+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(fn,""):l).replace(an,"$1").replace(cn,"$1;"),
+l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Jo(function(){return qe(f,p+"return "+l).apply(w,a)}),t.source=l,_e(t))throw t;return t},Nn.trim=We,Nn.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?Ur(e,t,r):null==t)?g(n):o(n,t+"")):n},Nn.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,t+"")+1):n;
+},Nn.trunc=function(n,t,r){r&&Ur(n,t,r)&&(t=w);var e=U;if(r=W,null!=t)if(ge(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;if(n=u(n),e>=n.length)return n;if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==o)return t+r;if(we(o)){if(n.slice(e).search(o)){var i,f=n.slice(0,e);for(o.global||(o=Ze(o.source,(kn.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(f);)i=n.index;t=t.slice(0,null==i?e:i)}}else n.indexOf(o,e)!=e&&(o=t.lastIndexOf(o),
+-1<o&&(t=t.slice(0,o)));return t+r},Nn.unescape=function(n){return(n=u(n))&&pn.test(n)?n.replace(ln,d):n},Nn.uniqueId=function(n){var t=++tu;return u(n)+t},Nn.words=$e,Nn.all=te,Nn.any=ie,Nn.contains=ee,Nn.eq=he,Nn.detect=ro,Nn.foldl=lo,Nn.foldr=so,Nn.head=Kr,Nn.include=ee,Nn.inject=lo,Te(Nn,function(){var n={};return _t(Nn,function(t,r){Nn.prototype[r]||(n[r]=t)}),n}(),false),Nn.sample=oe,Nn.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return oe(t,n)}):oe(this.value());
+},Nn.VERSION=b,Pn("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nn[n].placeholder=Nn}),Pn(["drop","take"],function(n,t){zn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new zn(this);r=null==r?1:bu(yu(r)||0,0);var u=this.clone();return e?u.__takeCount__=xu(u.__takeCount__,r):u.__views__.push({size:r,type:n+(0>u.__dir__?"Right":"")}),u},zn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Pn(["filter","map","takeWhile"],function(n,t){
+var r=t+1,e=r!=T;zn.prototype[n]=function(n,t){var u=this.clone();return u.__iteratees__.push({iteratee:wr(n,t,1),type:r}),u.__filtered__=u.__filtered__||e,u}}),Pn(["first","last"],function(n,t){var r="take"+(t?"Right":"");zn.prototype[n]=function(){return this[r](1).value()[0]}}),Pn(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");zn.prototype[n]=function(){return this.__filtered__?new zn(this):this[r](1)}}),Pn(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?bt:ze;zn.prototype[n]=function(n){
+return this[r](e(n))}}),zn.prototype.compact=function(){return this.filter(Fe)},zn.prototype.reject=function(n,t){return n=wr(n,t,1),this.filter(function(t){return!n(t)})},zn.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=this;return r.__filtered__&&(0<n||0>t)?new zn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==w&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r)},zn.prototype.takeRightWhile=function(n,t){return this.reverse().takeWhile(n,t).reverse()},zn.prototype.toArray=function(){return this.take(Ru);
+},_t(zn.prototype,function(n,t){var r=/^(?:filter|map|reject)|While$/.test(t),e=/^(?:first|last)$/.test(t),u=Nn[e?"take"+("last"==t?"Right":""):t];u&&(Nn.prototype[t]=function(){function t(n){return e&&i?u(n,1)[0]:u.apply(w,Jn([n],o))}var o=e?[1]:arguments,i=this.__chain__,f=this.__wrapped__,a=!!this.__actions__.length,c=f instanceof zn,l=o[0],s=c||Oo(f);return s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false),l={func:ne,args:[t],thisArg:w},a=c&&!a,e&&!i?a?(f=f.clone(),f.__actions__.push(l),n.call(f)):u.call(w,this.value())[0]:!e&&s?(f=a?f:new zn(this),
+f=n.apply(f,o),f.__actions__.push(l),new Ln(f,i)):this.thru(t)})}),Pn("join pop push replace shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?He:Je)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);Nn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),_t(zn.prototype,function(n,t){var r=Nn[t];if(r){var e=r.name;(Wu[e]||(Wu[e]=[])).push({
+name:t,func:r})}}),Wu[sr(w,A).name]=[{name:"wrapper",func:w}],zn.prototype.clone=function(){var n=new zn(this.__wrapped__);return n.__actions__=qn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=qn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=qn(this.__views__),n},zn.prototype.reverse=function(){if(this.__filtered__){var n=new zn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},zn.prototype.value=function(){
+var n,t=this.__wrapped__.value(),r=this.__dir__,e=Oo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,a=-1,c=i.length;++a<c;){var l=i[a],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=xu(n,f+s);break;case"takeRight":f=bu(f,n-s)}}if(n={start:f,end:n},i=n.start,f=n.end,n=f-i,i=u?f:i-1,f=this.__iteratees__,a=f.length,c=0,l=xu(n,this.__takeCount__),!e||o<F||o==n&&l==n)return Tt(u&&e?t.reverse():t,this.__actions__);e=[];n:for(;n--&&c<l;){for(i+=r,u=-1,o=t[i];++u<a;){
+var p=f[u],s=p.type,p=p.iteratee(o);if(s==T)o=p;else if(!p){if(s==N)continue n;break n}}e[c++]=o}return e},Nn.prototype.chain=function(){return Qr(this)},Nn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Nn.prototype.concat=Qu,Nn.prototype.plant=function(n){for(var t,r=this;r instanceof Tn;){var e=Mr(r);t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},Nn.prototype.reverse=function(){function n(n){return r&&0>r.__dir__?n:n.reverse()}var t=this.__wrapped__;
+if(t instanceof zn){var r=t;return this.__actions__.length&&(r=new zn(this)),r=r.reverse(),r.__actions__.push({func:ne,args:[n],thisArg:w}),new Ln(r,this.__chain__)}return this.thru(n)},Nn.prototype.toString=function(){return this.value()+""},Nn.prototype.run=Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return Tt(this.__wrapped__,this.__actions__)},Nn.prototype.collect=Nn.prototype.map,Nn.prototype.head=Nn.prototype.first,Nn.prototype.select=Nn.prototype.filter,Nn.prototype.tail=Nn.prototype.rest,
+Nn}var w,b="3.10.0",x=1,A=2,j=4,k=8,I=16,R=32,O=64,E=128,C=256,U=30,W="...",$=150,S=16,F=200,N=1,T=2,L="Expected a function",z="__lodash_placeholder__",B="[object Arguments]",D="[object Array]",M="[object Boolean]",q="[object Date]",P="[object Error]",K="[object Function]",V="[object Number]",Z="[object Object]",Y="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nn="[object Int16Array]",tn="[object Int32Array]",rn="[object Uint8Array]",en="[object Uint8ClampedArray]",un="[object Uint16Array]",on="[object Uint32Array]",fn=/\b__p\+='';/g,an=/\b(__p\+=)''\+/g,cn=/(__e\(.*?\)|\b__t\))\+'';/g,ln=/&(?:amp|lt|gt|quot|#39|#96);/g,sn=/[&<>"'`]/g,pn=RegExp(ln.source),hn=RegExp(sn.source),_n=/<%-([\s\S]+?)%>/g,vn=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,dn=/^\w*$/,mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,wn=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,bn=RegExp(wn.source),xn=/[\u0300-\u036f\ufe20-\ufe23]/g,An=/\\(\\)?/g,jn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kn=/\w*$/,In=/^0[xX]/,Rn=/^\[object .+?Constructor\]$/,On=/^\d+$/,En=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Cn=/($^)/,Un=/['\n\r\u2028\u2029\\]/g,Wn=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),$n="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout isFinite parseFloat parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap".split(" "),Sn={};
+Sn[X]=Sn[H]=Sn[Q]=Sn[nn]=Sn[tn]=Sn[rn]=Sn[en]=Sn[un]=Sn[on]=true,Sn[B]=Sn[D]=Sn[J]=Sn[M]=Sn[q]=Sn[P]=Sn[K]=Sn["[object Map]"]=Sn[V]=Sn[Z]=Sn[Y]=Sn["[object Set]"]=Sn[G]=Sn["[object WeakMap]"]=false;var Fn={};Fn[B]=Fn[D]=Fn[J]=Fn[M]=Fn[q]=Fn[X]=Fn[H]=Fn[Q]=Fn[nn]=Fn[tn]=Fn[V]=Fn[Z]=Fn[Y]=Fn[G]=Fn[rn]=Fn[en]=Fn[un]=Fn[on]=true,Fn[P]=Fn[K]=Fn["[object Map]"]=Fn["[object Set]"]=Fn["[object WeakMap]"]=false;var Nn={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a",
+"\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y",
+"\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Tn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Ln={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},zn={"function":true,object:true},Bn={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Dn={"\\":"\\",
+"'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mn=zn[typeof exports]&&exports&&!exports.nodeType&&exports,qn=zn[typeof module]&&module&&!module.nodeType&&module,Pn=zn[typeof self]&&self&&self.Object&&self,Kn=zn[typeof window]&&window&&window.Object&&window,Vn=qn&&qn.exports===Mn&&Mn,Zn=Mn&&qn&&typeof global=="object"&&global&&global.Object&&global||Kn!==(this&&this.window)&&Kn||Pn||this,Yn=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Zn._=Yn, define(function(){
+return Yn})):Mn&&qn?Vn?(qn.exports=Yn)._=Yn:Mn._=Yn:Zn._=Yn}).call(this); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/sax/lib/sax.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/sax/lib/sax.js
new file mode 100644
index 0000000..a30a822
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/sax/lib/sax.js
@@ -0,0 +1,1430 @@
+// wrapper for non-node envs
+;(function (sax) {
+
+sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+sax.SAXParser = SAXParser
+sax.SAXStream = SAXStream
+sax.createStream = createStream
+
+// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+// since that's the earliest that a buffer overrun could occur. This way, checks are
+// as rare as required, but as often as necessary to ensure never crossing this bound.
+// Furthermore, buffers are only tested at most once per write(), so passing a very
+// large string into write() might have undesirable effects, but this is manageable by
+// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+// edge case, result in creating at most one complete copy of the string passed in.
+// Set to Infinity to have unlimited buffers.
+sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+var buffers = [
+ "comment", "sgmlDecl", "textNode", "tagName", "doctype",
+ "procInstName", "procInstBody", "entity", "attribName",
+ "attribValue", "cdata", "script"
+]
+
+sax.EVENTS = // for discoverability.
+ [ "text"
+ , "processinginstruction"
+ , "sgmldeclaration"
+ , "doctype"
+ , "comment"
+ , "attribute"
+ , "opentag"
+ , "closetag"
+ , "opencdata"
+ , "cdata"
+ , "closecdata"
+ , "error"
+ , "end"
+ , "ready"
+ , "script"
+ , "opennamespace"
+ , "closenamespace"
+ ]
+
+function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ""
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.strictEntities = parser.opt.strictEntities
+ parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, "onready")
+}
+
+if (!Object.create) Object.create = function (o) {
+ function f () { this.__proto__ = o }
+ f.prototype = o
+ return new f
+}
+
+if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {
+ return o.__proto__
+}
+
+if (!Object.keys) Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+}
+
+function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ , maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case "textNode":
+ closeText(parser)
+ break
+
+ case "cdata":
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ break
+
+ case "script":
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ break
+
+ default:
+ error(parser, "Max buffer length exceeded: "+buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)
+ + parser.position
+}
+
+function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i ++) {
+ parser[buffers[i]] = ""
+ }
+}
+
+function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== "") {
+ emitNode(parser, "oncdata", parser.cdata)
+ parser.cdata = ""
+ }
+ if (parser.script !== "") {
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+}
+
+SAXParser.prototype =
+ { end: function () { end(this) }
+ , write: write
+ , resume: function () { this.error = null; return this }
+ , close: function () { return this.write(null) }
+ , flush: function () { flushBuffers(this) }
+ }
+
+try {
+ var Stream = require("stream").Stream
+} catch (ex) {
+ var Stream = function () {}
+}
+
+
+var streamWraps = sax.EVENTS.filter(function (ev) {
+ return ev !== "error" && ev !== "end"
+})
+
+function createStream (strict, opt) {
+ return new SAXStream(strict, opt)
+}
+
+function SAXStream (strict, opt) {
+ if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
+
+ Stream.apply(this)
+
+ this._parser = new SAXParser(strict, opt)
+ this.writable = true
+ this.readable = true
+
+
+ var me = this
+
+ this._parser.onend = function () {
+ me.emit("end")
+ }
+
+ this._parser.onerror = function (er) {
+ me.emit("error", er)
+
+ // if didn't throw, then means error was handled.
+ // go ahead and clear error, so we can write again.
+ me._parser.error = null
+ }
+
+ this._decoder = null;
+
+ streamWraps.forEach(function (ev) {
+ Object.defineProperty(me, "on" + ev, {
+ get: function () { return me._parser["on" + ev] },
+ set: function (h) {
+ if (!h) {
+ me.removeAllListeners(ev)
+ return me._parser["on"+ev] = h
+ }
+ me.on(ev, h)
+ },
+ enumerable: true,
+ configurable: false
+ })
+ })
+}
+
+SAXStream.prototype = Object.create(Stream.prototype,
+ { constructor: { value: SAXStream } })
+
+SAXStream.prototype.write = function (data) {
+ if (typeof Buffer === 'function' &&
+ typeof Buffer.isBuffer === 'function' &&
+ Buffer.isBuffer(data)) {
+ if (!this._decoder) {
+ var SD = require('string_decoder').StringDecoder
+ this._decoder = new SD('utf8')
+ }
+ data = this._decoder.write(data);
+ }
+
+ this._parser.write(data.toString())
+ this.emit("data", data)
+ return true
+}
+
+SAXStream.prototype.end = function (chunk) {
+ if (chunk && chunk.length) this.write(chunk)
+ this._parser.end()
+ return true
+}
+
+SAXStream.prototype.on = function (ev, handler) {
+ var me = this
+ if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) {
+ me._parser["on"+ev] = function () {
+ var args = arguments.length === 1 ? [arguments[0]]
+ : Array.apply(null, arguments)
+ args.splice(0, 0, ev)
+ me.emit.apply(me, args)
+ }
+ }
+
+ return Stream.prototype.on.call(me, ev, handler)
+}
+
+
+
+// character classes and tokens
+var whitespace = "\r\n\t "
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ , number = "0124356789"
+ , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ // (Letter | "_" | ":")
+ , quote = "'\""
+ , entity = number+letter+"#"
+ , attribEnd = whitespace + ">"
+ , CDATA = "[CDATA["
+ , DOCTYPE = "DOCTYPE"
+ , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
+ , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
+ , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+// turn all the string character sets into character class objects.
+whitespace = charClass(whitespace)
+number = charClass(number)
+letter = charClass(letter)
+
+// http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+// This implementation works on strings, a single character at a time
+// as such, it cannot ever support astral-plane characters (10000-EFFFF)
+// without a significant breaking change to either this parser, or the
+// JavaScript language. Implementation of an emoji-capable xml parser
+// is left as an exercise for the reader.
+var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
+
+quote = charClass(quote)
+entity = charClass(entity)
+attribEnd = charClass(attribEnd)
+
+function charClass (str) {
+ return str.split("").reduce(function (s, c) {
+ s[c] = true
+ return s
+ }, {})
+}
+
+function isRegExp (c) {
+ return Object.prototype.toString.call(c) === '[object RegExp]'
+}
+
+function is (charclass, c) {
+ return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
+}
+
+function not (charclass, c) {
+ return !is(charclass, c)
+}
+
+var S = 0
+sax.STATE =
+{ BEGIN : S++ // leading byte order mark or whitespace
+, BEGIN_WHITESPACE : S++ // leading whitespace
+, TEXT : S++ // general stuff
+, TEXT_ENTITY : S++ // &amp and such.
+, OPEN_WAKA : S++ // <
+, SGML_DECL : S++ // <!BLARG
+, SGML_DECL_QUOTED : S++ // <!BLARG foo "bar
+, DOCTYPE : S++ // <!DOCTYPE
+, DOCTYPE_QUOTED : S++ // <!DOCTYPE "//blah
+, DOCTYPE_DTD : S++ // <!DOCTYPE "//blah" [ ...
+, DOCTYPE_DTD_QUOTED : S++ // <!DOCTYPE "//blah" [ "foo
+, COMMENT_STARTING : S++ // <!-
+, COMMENT : S++ // <!--
+, COMMENT_ENDING : S++ // <!-- blah -
+, COMMENT_ENDED : S++ // <!-- blah --
+, CDATA : S++ // <![CDATA[ something
+, CDATA_ENDING : S++ // ]
+, CDATA_ENDING_2 : S++ // ]]
+, PROC_INST : S++ // <?hi
+, PROC_INST_BODY : S++ // <?hi there
+, PROC_INST_ENDING : S++ // <?hi "there" ?
+, OPEN_TAG : S++ // <strong
+, OPEN_TAG_SLASH : S++ // <strong /
+, ATTRIB : S++ // <a
+, ATTRIB_NAME : S++ // <a foo
+, ATTRIB_NAME_SAW_WHITE : S++ // <a foo _
+, ATTRIB_VALUE : S++ // <a foo=
+, ATTRIB_VALUE_QUOTED : S++ // <a foo="bar
+, ATTRIB_VALUE_CLOSED : S++ // <a foo="bar"
+, ATTRIB_VALUE_UNQUOTED : S++ // <a foo=bar
+, ATTRIB_VALUE_ENTITY_Q : S++ // <foo bar="&quot;"
+, ATTRIB_VALUE_ENTITY_U : S++ // <foo bar=&quot;
+, CLOSE_TAG : S++ // </a
+, CLOSE_TAG_SAW_WHITE : S++ // </a >
+, SCRIPT : S++ // <script> ...
+, SCRIPT_ENDING : S++ // <script> ... <
+}
+
+sax.XML_ENTITIES =
+{ "amp" : "&"
+, "gt" : ">"
+, "lt" : "<"
+, "quot" : "\""
+, "apos" : "'"
+}
+
+sax.ENTITIES =
+{ "amp" : "&"
+, "gt" : ">"
+, "lt" : "<"
+, "quot" : "\""
+, "apos" : "'"
+, "AElig" : 198
+, "Aacute" : 193
+, "Acirc" : 194
+, "Agrave" : 192
+, "Aring" : 197
+, "Atilde" : 195
+, "Auml" : 196
+, "Ccedil" : 199
+, "ETH" : 208
+, "Eacute" : 201
+, "Ecirc" : 202
+, "Egrave" : 200
+, "Euml" : 203
+, "Iacute" : 205
+, "Icirc" : 206
+, "Igrave" : 204
+, "Iuml" : 207
+, "Ntilde" : 209
+, "Oacute" : 211
+, "Ocirc" : 212
+, "Ograve" : 210
+, "Oslash" : 216
+, "Otilde" : 213
+, "Ouml" : 214
+, "THORN" : 222
+, "Uacute" : 218
+, "Ucirc" : 219
+, "Ugrave" : 217
+, "Uuml" : 220
+, "Yacute" : 221
+, "aacute" : 225
+, "acirc" : 226
+, "aelig" : 230
+, "agrave" : 224
+, "aring" : 229
+, "atilde" : 227
+, "auml" : 228
+, "ccedil" : 231
+, "eacute" : 233
+, "ecirc" : 234
+, "egrave" : 232
+, "eth" : 240
+, "euml" : 235
+, "iacute" : 237
+, "icirc" : 238
+, "igrave" : 236
+, "iuml" : 239
+, "ntilde" : 241
+, "oacute" : 243
+, "ocirc" : 244
+, "ograve" : 242
+, "oslash" : 248
+, "otilde" : 245
+, "ouml" : 246
+, "szlig" : 223
+, "thorn" : 254
+, "uacute" : 250
+, "ucirc" : 251
+, "ugrave" : 249
+, "uuml" : 252
+, "yacute" : 253
+, "yuml" : 255
+, "copy" : 169
+, "reg" : 174
+, "nbsp" : 160
+, "iexcl" : 161
+, "cent" : 162
+, "pound" : 163
+, "curren" : 164
+, "yen" : 165
+, "brvbar" : 166
+, "sect" : 167
+, "uml" : 168
+, "ordf" : 170
+, "laquo" : 171
+, "not" : 172
+, "shy" : 173
+, "macr" : 175
+, "deg" : 176
+, "plusmn" : 177
+, "sup1" : 185
+, "sup2" : 178
+, "sup3" : 179
+, "acute" : 180
+, "micro" : 181
+, "para" : 182
+, "middot" : 183
+, "cedil" : 184
+, "ordm" : 186
+, "raquo" : 187
+, "frac14" : 188
+, "frac12" : 189
+, "frac34" : 190
+, "iquest" : 191
+, "times" : 215
+, "divide" : 247
+, "OElig" : 338
+, "oelig" : 339
+, "Scaron" : 352
+, "scaron" : 353
+, "Yuml" : 376
+, "fnof" : 402
+, "circ" : 710
+, "tilde" : 732
+, "Alpha" : 913
+, "Beta" : 914
+, "Gamma" : 915
+, "Delta" : 916
+, "Epsilon" : 917
+, "Zeta" : 918
+, "Eta" : 919
+, "Theta" : 920
+, "Iota" : 921
+, "Kappa" : 922
+, "Lambda" : 923
+, "Mu" : 924
+, "Nu" : 925
+, "Xi" : 926
+, "Omicron" : 927
+, "Pi" : 928
+, "Rho" : 929
+, "Sigma" : 931
+, "Tau" : 932
+, "Upsilon" : 933
+, "Phi" : 934
+, "Chi" : 935
+, "Psi" : 936
+, "Omega" : 937
+, "alpha" : 945
+, "beta" : 946
+, "gamma" : 947
+, "delta" : 948
+, "epsilon" : 949
+, "zeta" : 950
+, "eta" : 951
+, "theta" : 952
+, "iota" : 953
+, "kappa" : 954
+, "lambda" : 955
+, "mu" : 956
+, "nu" : 957
+, "xi" : 958
+, "omicron" : 959
+, "pi" : 960
+, "rho" : 961
+, "sigmaf" : 962
+, "sigma" : 963
+, "tau" : 964
+, "upsilon" : 965
+, "phi" : 966
+, "chi" : 967
+, "psi" : 968
+, "omega" : 969
+, "thetasym" : 977
+, "upsih" : 978
+, "piv" : 982
+, "ensp" : 8194
+, "emsp" : 8195
+, "thinsp" : 8201
+, "zwnj" : 8204
+, "zwj" : 8205
+, "lrm" : 8206
+, "rlm" : 8207
+, "ndash" : 8211
+, "mdash" : 8212
+, "lsquo" : 8216
+, "rsquo" : 8217
+, "sbquo" : 8218
+, "ldquo" : 8220
+, "rdquo" : 8221
+, "bdquo" : 8222
+, "dagger" : 8224
+, "Dagger" : 8225
+, "bull" : 8226
+, "hellip" : 8230
+, "permil" : 8240
+, "prime" : 8242
+, "Prime" : 8243
+, "lsaquo" : 8249
+, "rsaquo" : 8250
+, "oline" : 8254
+, "frasl" : 8260
+, "euro" : 8364
+, "image" : 8465
+, "weierp" : 8472
+, "real" : 8476
+, "trade" : 8482
+, "alefsym" : 8501
+, "larr" : 8592
+, "uarr" : 8593
+, "rarr" : 8594
+, "darr" : 8595
+, "harr" : 8596
+, "crarr" : 8629
+, "lArr" : 8656
+, "uArr" : 8657
+, "rArr" : 8658
+, "dArr" : 8659
+, "hArr" : 8660
+, "forall" : 8704
+, "part" : 8706
+, "exist" : 8707
+, "empty" : 8709
+, "nabla" : 8711
+, "isin" : 8712
+, "notin" : 8713
+, "ni" : 8715
+, "prod" : 8719
+, "sum" : 8721
+, "minus" : 8722
+, "lowast" : 8727
+, "radic" : 8730
+, "prop" : 8733
+, "infin" : 8734
+, "ang" : 8736
+, "and" : 8743
+, "or" : 8744
+, "cap" : 8745
+, "cup" : 8746
+, "int" : 8747
+, "there4" : 8756
+, "sim" : 8764
+, "cong" : 8773
+, "asymp" : 8776
+, "ne" : 8800
+, "equiv" : 8801
+, "le" : 8804
+, "ge" : 8805
+, "sub" : 8834
+, "sup" : 8835
+, "nsub" : 8836
+, "sube" : 8838
+, "supe" : 8839
+, "oplus" : 8853
+, "otimes" : 8855
+, "perp" : 8869
+, "sdot" : 8901
+, "lceil" : 8968
+, "rceil" : 8969
+, "lfloor" : 8970
+, "rfloor" : 8971
+, "lang" : 9001
+, "rang" : 9002
+, "loz" : 9674
+, "spades" : 9824
+, "clubs" : 9827
+, "hearts" : 9829
+, "diams" : 9830
+}
+
+Object.keys(sax.ENTITIES).forEach(function (key) {
+ var e = sax.ENTITIES[key]
+ var s = typeof e === 'number' ? String.fromCharCode(e) : e
+ sax.ENTITIES[key] = s
+})
+
+for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
+
+// shorthand
+S = sax.STATE
+
+function emit (parser, event, data) {
+ parser[event] && parser[event](data)
+}
+
+function emitNode (parser, nodeType, data) {
+ if (parser.textNode) closeText(parser)
+ emit(parser, nodeType, data)
+}
+
+function closeText (parser) {
+ parser.textNode = textopts(parser.opt, parser.textNode)
+ if (parser.textNode) emit(parser, "ontext", parser.textNode)
+ parser.textNode = ""
+}
+
+function textopts (opt, text) {
+ if (opt.trim) text = text.trim()
+ if (opt.normalize) text = text.replace(/\s+/g, " ")
+ return text
+}
+
+function error (parser, er) {
+ closeText(parser)
+ if (parser.trackPosition) {
+ er += "\nLine: "+parser.line+
+ "\nColumn: "+parser.column+
+ "\nChar: "+parser.c
+ }
+ er = new Error(er)
+ parser.error = er
+ emit(parser, "onerror", er)
+ return parser
+}
+
+function end (parser) {
+ if (parser.sawRoot && !parser.closedRoot) strictFail(parser, "Unclosed root tag")
+ if ((parser.state !== S.BEGIN) &&
+ (parser.state !== S.BEGIN_WHITESPACE) &&
+ (parser.state !== S.TEXT))
+ error(parser, "Unexpected end")
+ closeText(parser)
+ parser.c = ""
+ parser.closed = true
+ emit(parser, "onend")
+ SAXParser.call(parser, parser.strict, parser.opt)
+ return parser
+}
+
+function strictFail (parser, message) {
+ if (typeof parser !== 'object' || !(parser instanceof SAXParser))
+ throw new Error('bad call to strictFail');
+ if (parser.strict) error(parser, message)
+}
+
+function newTag (parser) {
+ if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ , tag = parser.tag = { name : parser.tagName, attributes : {} }
+
+ // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+ if (parser.opt.xmlns) tag.ns = parent.ns
+ parser.attribList.length = 0
+}
+
+function qname (name, attribute) {
+ var i = name.indexOf(":")
+ , qualName = i < 0 ? [ "", name ] : name.split(":")
+ , prefix = qualName[0]
+ , local = qualName[1]
+
+ // <x "xmlns"="http://foo">
+ if (attribute && name === "xmlns") {
+ prefix = "xmlns"
+ local = ""
+ }
+
+ return { prefix: prefix, local: local }
+}
+
+function attrib (parser) {
+ if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
+
+ if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+ parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+ return parser.attribName = parser.attribValue = ""
+ }
+
+ if (parser.opt.xmlns) {
+ var qn = qname(parser.attribName, true)
+ , prefix = qn.prefix
+ , local = qn.local
+
+ if (prefix === "xmlns") {
+ // namespace binding attribute; push the binding into scope
+ if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
+ strictFail( parser
+ , "xml: prefix must be bound to " + XML_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
+ strictFail( parser
+ , "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n"
+ + "Actual: " + parser.attribValue )
+ } else {
+ var tag = parser.tag
+ , parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns === parent.ns) {
+ tag.ns = Object.create(parent.ns)
+ }
+ tag.ns[local] = parser.attribValue
+ }
+ }
+
+ // defer onattribute events until all attributes have been seen
+ // so any new bindings can take effect; preserve attribute order
+ // so deferred events can be emitted in document order
+ parser.attribList.push([parser.attribName, parser.attribValue])
+ } else {
+ // in non-xmlns mode, we can emit the event right away
+ parser.tag.attributes[parser.attribName] = parser.attribValue
+ emitNode( parser
+ , "onattribute"
+ , { name: parser.attribName
+ , value: parser.attribValue } )
+ }
+
+ parser.attribName = parser.attribValue = ""
+}
+
+function openTag (parser, selfClosing) {
+ if (parser.opt.xmlns) {
+ // emit namespace binding events
+ var tag = parser.tag
+
+ // add namespace info to tag
+ var qn = qname(parser.tagName)
+ tag.prefix = qn.prefix
+ tag.local = qn.local
+ tag.uri = tag.ns[qn.prefix] || ""
+
+ if (tag.prefix && !tag.uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(parser.tagName))
+ tag.uri = qn.prefix
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns && parent.ns !== tag.ns) {
+ Object.keys(tag.ns).forEach(function (p) {
+ emitNode( parser
+ , "onopennamespace"
+ , { prefix: p , uri: tag.ns[p] } )
+ })
+ }
+
+ // handle deferred onattribute events
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (var i = 0, l = parser.attribList.length; i < l; i ++) {
+ var nv = parser.attribList[i]
+ var name = nv[0]
+ , value = nv[1]
+ , qualName = qname(name, true)
+ , prefix = qualName.prefix
+ , local = qualName.local
+ , uri = prefix == "" ? "" : (tag.ns[prefix] || "")
+ , a = { name: name
+ , value: value
+ , prefix: prefix
+ , local: local
+ , uri: uri
+ }
+
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (prefix && prefix != "xmlns" && !uri) {
+ strictFail(parser, "Unbound namespace prefix: "
+ + JSON.stringify(prefix))
+ a.uri = prefix
+ }
+ parser.tag.attributes[name] = a
+ emitNode(parser, "onattribute", a)
+ }
+ parser.attribList.length = 0
+ }
+
+ parser.tag.isSelfClosing = !!selfClosing
+
+ // process the tag
+ parser.sawRoot = true
+ parser.tags.push(parser.tag)
+ emitNode(parser, "onopentag", parser.tag)
+ if (!selfClosing) {
+ // special case for <script> in non-strict mode.
+ if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
+ parser.state = S.SCRIPT
+ } else {
+ parser.state = S.TEXT
+ }
+ parser.tag = null
+ parser.tagName = ""
+ }
+ parser.attribName = parser.attribValue = ""
+ parser.attribList.length = 0
+}
+
+function closeTag (parser) {
+ if (!parser.tagName) {
+ strictFail(parser, "Weird empty close tag.")
+ parser.textNode += "</>"
+ parser.state = S.TEXT
+ return
+ }
+
+ if (parser.script) {
+ if (parser.tagName !== "script") {
+ parser.script += "</" + parser.tagName + ">"
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ return
+ }
+ emitNode(parser, "onscript", parser.script)
+ parser.script = ""
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = parser.tags.length
+ var tagName = parser.tagName
+ if (!parser.strict) tagName = tagName[parser.looseCase]()
+ var closeTo = tagName
+ while (t --) {
+ var close = parser.tags[t]
+ if (close.name !== closeTo) {
+ // fail the first time in strict mode
+ strictFail(parser, "Unexpected close tag")
+ } else break
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0) {
+ strictFail(parser, "Unmatched closing tag: "+parser.tagName)
+ parser.textNode += "</" + parser.tagName + ">"
+ parser.state = S.TEXT
+ return
+ }
+ parser.tagName = tagName
+ var s = parser.tags.length
+ while (s --> t) {
+ var tag = parser.tag = parser.tags.pop()
+ parser.tagName = parser.tag.name
+ emitNode(parser, "onclosetag", parser.tagName)
+
+ var x = {}
+ for (var i in tag.ns) x[i] = tag.ns[i]
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (parser.opt.xmlns && tag.ns !== parent.ns) {
+ // remove namespace bindings introduced by tag
+ Object.keys(tag.ns).forEach(function (p) {
+ var n = tag.ns[p]
+ emitNode(parser, "onclosenamespace", { prefix: p, uri: n })
+ })
+ }
+ }
+ if (t === 0) parser.closedRoot = true
+ parser.tagName = parser.attribValue = parser.attribName = ""
+ parser.attribList.length = 0
+ parser.state = S.TEXT
+}
+
+function parseEntity (parser) {
+ var entity = parser.entity
+ , entityLC = entity.toLowerCase()
+ , num
+ , numStr = ""
+ if (parser.ENTITIES[entity])
+ return parser.ENTITIES[entity]
+ if (parser.ENTITIES[entityLC])
+ return parser.ENTITIES[entityLC]
+ entity = entityLC
+ if (entity.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2)
+ num = parseInt(entity, 16)
+ numStr = num.toString(16)
+ } else {
+ entity = entity.slice(1)
+ num = parseInt(entity, 10)
+ numStr = num.toString(10)
+ }
+ }
+ entity = entity.replace(/^0+/, "")
+ if (numStr.toLowerCase() !== entity) {
+ strictFail(parser, "Invalid character entity")
+ return "&"+parser.entity + ";"
+ }
+
+ return String.fromCodePoint(num)
+}
+
+function write (chunk) {
+ var parser = this
+ if (this.error) throw this.error
+ if (parser.closed) return error(parser,
+ "Cannot write after close. Assign an onready handler.")
+ if (chunk === null) return end(parser)
+ var i = 0, c = ""
+ while (parser.c = c = chunk.charAt(i++)) {
+ if (parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ switch (parser.state) {
+
+ case S.BEGIN:
+ parser.state = S.BEGIN_WHITESPACE
+ if (c === "\uFEFF") {
+ continue;
+ }
+ // no continue - fall through
+
+ case S.BEGIN_WHITESPACE:
+ if (c === "<") {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else if (not(whitespace,c)) {
+ // have to process this as a text node.
+ // weird, but happens.
+ strictFail(parser, "Non-whitespace before first tag.")
+ parser.textNode = c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.TEXT:
+ if (parser.sawRoot && !parser.closedRoot) {
+ var starti = i-1
+ while (c && c!=="<" && c!=="&") {
+ c = chunk.charAt(i++)
+ if (c && parser.trackPosition) {
+ parser.position ++
+ if (c === "\n") {
+ parser.line ++
+ parser.column = 0
+ } else parser.column ++
+ }
+ }
+ parser.textNode += chunk.substring(starti, i-1)
+ }
+ if (c === "<" && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else {
+ if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
+ strictFail(parser, "Text data outside of root node.")
+ if (c === "&") parser.state = S.TEXT_ENTITY
+ else parser.textNode += c
+ }
+ continue
+
+ case S.SCRIPT:
+ // only non-strict
+ if (c === "<") {
+ parser.state = S.SCRIPT_ENDING
+ } else parser.script += c
+ continue
+
+ case S.SCRIPT_ENDING:
+ if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ } else {
+ parser.script += "<" + c
+ parser.state = S.SCRIPT
+ }
+ continue
+
+ case S.OPEN_WAKA:
+ // either a /, ?, !, or text is coming next.
+ if (c === "!") {
+ parser.state = S.SGML_DECL
+ parser.sgmlDecl = ""
+ } else if (is(whitespace, c)) {
+ // wait for it...
+ } else if (is(nameStart,c)) {
+ parser.state = S.OPEN_TAG
+ parser.tagName = c
+ } else if (c === "/") {
+ parser.state = S.CLOSE_TAG
+ parser.tagName = ""
+ } else if (c === "?") {
+ parser.state = S.PROC_INST
+ parser.procInstName = parser.procInstBody = ""
+ } else {
+ strictFail(parser, "Unencoded <")
+ // if there was some whitespace, then add that in.
+ if (parser.startTagPosition + 1 < parser.position) {
+ var pad = parser.position - parser.startTagPosition
+ c = new Array(pad).join(" ") + c
+ }
+ parser.textNode += "<" + c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.SGML_DECL:
+ if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {
+ emitNode(parser, "onopencdata")
+ parser.state = S.CDATA
+ parser.sgmlDecl = ""
+ parser.cdata = ""
+ } else if (parser.sgmlDecl+c === "--") {
+ parser.state = S.COMMENT
+ parser.comment = ""
+ parser.sgmlDecl = ""
+ } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {
+ parser.state = S.DOCTYPE
+ if (parser.doctype || parser.sawRoot) strictFail(parser,
+ "Inappropriately located doctype declaration")
+ parser.doctype = ""
+ parser.sgmlDecl = ""
+ } else if (c === ">") {
+ emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
+ parser.sgmlDecl = ""
+ parser.state = S.TEXT
+ } else if (is(quote, c)) {
+ parser.state = S.SGML_DECL_QUOTED
+ parser.sgmlDecl += c
+ } else parser.sgmlDecl += c
+ continue
+
+ case S.SGML_DECL_QUOTED:
+ if (c === parser.q) {
+ parser.state = S.SGML_DECL
+ parser.q = ""
+ }
+ parser.sgmlDecl += c
+ continue
+
+ case S.DOCTYPE:
+ if (c === ">") {
+ parser.state = S.TEXT
+ emitNode(parser, "ondoctype", parser.doctype)
+ parser.doctype = true // just remember that we saw it.
+ } else {
+ parser.doctype += c
+ if (c === "[") parser.state = S.DOCTYPE_DTD
+ else if (is(quote, c)) {
+ parser.state = S.DOCTYPE_QUOTED
+ parser.q = c
+ }
+ }
+ continue
+
+ case S.DOCTYPE_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.q = ""
+ parser.state = S.DOCTYPE
+ }
+ continue
+
+ case S.DOCTYPE_DTD:
+ parser.doctype += c
+ if (c === "]") parser.state = S.DOCTYPE
+ else if (is(quote,c)) {
+ parser.state = S.DOCTYPE_DTD_QUOTED
+ parser.q = c
+ }
+ continue
+
+ case S.DOCTYPE_DTD_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.state = S.DOCTYPE_DTD
+ parser.q = ""
+ }
+ continue
+
+ case S.COMMENT:
+ if (c === "-") parser.state = S.COMMENT_ENDING
+ else parser.comment += c
+ continue
+
+ case S.COMMENT_ENDING:
+ if (c === "-") {
+ parser.state = S.COMMENT_ENDED
+ parser.comment = textopts(parser.opt, parser.comment)
+ if (parser.comment) emitNode(parser, "oncomment", parser.comment)
+ parser.comment = ""
+ } else {
+ parser.comment += "-" + c
+ parser.state = S.COMMENT
+ }
+ continue
+
+ case S.COMMENT_ENDED:
+ if (c !== ">") {
+ strictFail(parser, "Malformed comment")
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ parser.comment += "--" + c
+ parser.state = S.COMMENT
+ } else parser.state = S.TEXT
+ continue
+
+ case S.CDATA:
+ if (c === "]") parser.state = S.CDATA_ENDING
+ else parser.cdata += c
+ continue
+
+ case S.CDATA_ENDING:
+ if (c === "]") parser.state = S.CDATA_ENDING_2
+ else {
+ parser.cdata += "]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.CDATA_ENDING_2:
+ if (c === ">") {
+ if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
+ emitNode(parser, "onclosecdata")
+ parser.cdata = ""
+ parser.state = S.TEXT
+ } else if (c === "]") {
+ parser.cdata += "]"
+ } else {
+ parser.cdata += "]]" + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.PROC_INST:
+ if (c === "?") parser.state = S.PROC_INST_ENDING
+ else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
+ else parser.procInstName += c
+ continue
+
+ case S.PROC_INST_BODY:
+ if (!parser.procInstBody && is(whitespace, c)) continue
+ else if (c === "?") parser.state = S.PROC_INST_ENDING
+ else parser.procInstBody += c
+ continue
+
+ case S.PROC_INST_ENDING:
+ if (c === ">") {
+ emitNode(parser, "onprocessinginstruction", {
+ name : parser.procInstName,
+ body : parser.procInstBody
+ })
+ parser.procInstName = parser.procInstBody = ""
+ parser.state = S.TEXT
+ } else {
+ parser.procInstBody += "?" + c
+ parser.state = S.PROC_INST_BODY
+ }
+ continue
+
+ case S.OPEN_TAG:
+ if (is(nameBody, c)) parser.tagName += c
+ else {
+ newTag(parser)
+ if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else {
+ if (not(whitespace, c)) strictFail(
+ parser, "Invalid character in tag name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.OPEN_TAG_SLASH:
+ if (c === ">") {
+ openTag(parser, true)
+ closeTag(parser)
+ } else {
+ strictFail(parser, "Forward-slash in opening tag not followed by >")
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.ATTRIB:
+ // haven't read the attribute name yet.
+ if (is(whitespace, c)) continue
+ else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (c === ">") {
+ strictFail(parser, "Attribute without value")
+ parser.attribValue = parser.attribName
+ attrib(parser)
+ openTag(parser)
+ }
+ else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
+ else if (is(nameBody, c)) parser.attribName += c
+ else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_NAME_SAW_WHITE:
+ if (c === "=") parser.state = S.ATTRIB_VALUE
+ else if (is(whitespace, c)) continue
+ else {
+ strictFail(parser, "Attribute without value")
+ parser.tag.attributes[parser.attribName] = ""
+ parser.attribValue = ""
+ emitNode(parser, "onattribute",
+ { name : parser.attribName, value : "" })
+ parser.attribName = ""
+ if (c === ">") openTag(parser)
+ else if (is(nameStart, c)) {
+ parser.attribName = c
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, "Invalid attribute name")
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.ATTRIB_VALUE:
+ if (is(whitespace, c)) continue
+ else if (is(quote, c)) {
+ parser.q = c
+ parser.state = S.ATTRIB_VALUE_QUOTED
+ } else {
+ strictFail(parser, "Unquoted attribute value")
+ parser.state = S.ATTRIB_VALUE_UNQUOTED
+ parser.attribValue = c
+ }
+ continue
+
+ case S.ATTRIB_VALUE_QUOTED:
+ if (c !== parser.q) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ parser.q = ""
+ parser.state = S.ATTRIB_VALUE_CLOSED
+ continue
+
+ case S.ATTRIB_VALUE_CLOSED:
+ if (is(whitespace, c)) {
+ parser.state = S.ATTRIB
+ } else if (c === ">") openTag(parser)
+ else if (c === "/") parser.state = S.OPEN_TAG_SLASH
+ else if (is(nameStart, c)) {
+ strictFail(parser, "No whitespace between attributes")
+ parser.attribName = c
+ parser.attribValue = ""
+ parser.state = S.ATTRIB_NAME
+ } else strictFail(parser, "Invalid attribute name")
+ continue
+
+ case S.ATTRIB_VALUE_UNQUOTED:
+ if (not(attribEnd,c)) {
+ if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
+ else parser.attribValue += c
+ continue
+ }
+ attrib(parser)
+ if (c === ">") openTag(parser)
+ else parser.state = S.ATTRIB
+ continue
+
+ case S.CLOSE_TAG:
+ if (!parser.tagName) {
+ if (is(whitespace, c)) continue
+ else if (not(nameStart, c)) {
+ if (parser.script) {
+ parser.script += "</" + c
+ parser.state = S.SCRIPT
+ } else {
+ strictFail(parser, "Invalid tagname in closing tag.")
+ }
+ } else parser.tagName = c
+ }
+ else if (c === ">") closeTag(parser)
+ else if (is(nameBody, c)) parser.tagName += c
+ else if (parser.script) {
+ parser.script += "</" + parser.tagName
+ parser.tagName = ""
+ parser.state = S.SCRIPT
+ } else {
+ if (not(whitespace, c)) strictFail(parser,
+ "Invalid tagname in closing tag")
+ parser.state = S.CLOSE_TAG_SAW_WHITE
+ }
+ continue
+
+ case S.CLOSE_TAG_SAW_WHITE:
+ if (is(whitespace, c)) continue
+ if (c === ">") closeTag(parser)
+ else strictFail(parser, "Invalid characters in closing tag")
+ continue
+
+ case S.TEXT_ENTITY:
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ case S.ATTRIB_VALUE_ENTITY_U:
+ switch(parser.state) {
+ case S.TEXT_ENTITY:
+ var returnState = S.TEXT, buffer = "textNode"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ var returnState = S.ATTRIB_VALUE_QUOTED, buffer = "attribValue"
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_U:
+ var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = "attribValue"
+ break
+ }
+ if (c === ";") {
+ parser[buffer] += parseEntity(parser)
+ parser.entity = ""
+ parser.state = returnState
+ }
+ else if (is(entity, c)) parser.entity += c
+ else {
+ strictFail(parser, "Invalid character entity")
+ parser[buffer] += "&" + parser.entity + c
+ parser.entity = ""
+ parser.state = returnState
+ }
+ continue
+
+ default:
+ throw new Error(parser, "Unknown state: " + parser.state)
+ }
+ } // while
+ // cdata blocks can get very big under normal conditions. emit and move on.
+ // if (parser.state === S.CDATA && parser.cdata) {
+ // emitNode(parser, "oncdata", parser.cdata)
+ // parser.cdata = ""
+ // }
+ if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
+ return parser
+}
+
+/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+if (!String.fromCodePoint) {
+ (function() {
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function() {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (Object.defineProperty) {
+ Object.defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
+
+})(typeof exports === "undefined" ? sax = {} : exports); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/buttons.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/buttons.js
new file mode 100644
index 0000000..798ada1
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/buttons.js
@@ -0,0 +1,382 @@
+
+
+// Contains functions for the buttons
+
+var steps = [];
+
+window.rows = 0, window.initialRows = 14, window.cols = window.initialCols = 8; //Define initial rows and cols
+var presets = [["None"],["Demo",["UE A","com.ecomp.ue3"],["vA-SBG","com.ecomp.dc1.a_sbg"],["vNS","com.ecomp.dc1.ns"],["vAS","com.ecomp.dc1.as"],["TF/BGCF","com.ecomp.usp.tf_bgcf"],["ENUM","com.ecomp.usp.enum"],["n-SBG","com.ecomp.dc1.n_sbg"],["SIP PSX","com.ecomp.vni.sip_psx"],["BVoIP AS","com.ecomp.vni.bvoip_as"],["IPBE","com.ecomp.vni.ipbe"],["IPFR UE B","com.ecomp.ue5"]],["Layer3Access",["Order Trigger System"],["MSO"],["SDN-C"],["A&AI"],["PO"]]];
+var presetNames = [];
+for(var i = 0; i<presets.length; i++){
+ presetNames.push(presets[i][0]);
+ this[presets[i][0]+"Systems"]=[];
+ this[presets[i][0]+"Tosca"]=[];
+ for (var j=1;j<presets[i].length; j++){
+ this[presets[i][0]+"Systems"].push(presets[i][j][0]);
+ this[presets[i][0]+"Tosca"].push(presets[i][j][1]);
+ }
+}
+
+
+//Create new project and sets up grid lines
+function newButton(){
+ var availablePresetHTML = '';
+ for (var i=0; i<presets.length;i++){
+ availablePresetHTML += '<button style="margin-left:20px;" onclick="newProjectFromPreset(\''+presets[i][0]+'\');">'+presets[i][0]+'</button><br>'
+ }
+ bootbox.dialog({
+ backdrop:true,
+ animate:false,
+ onEscape: function() {},
+ title: 'Create New Project',
+ size: 'large',
+ message: 'Project from preset : <br>'+availablePresetHTML+'<br><br><hr><hr><button onclick="confirm();">New Blank Project</button>'
+ });
+ function confirm () {
+ bootbox.confirm({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***This will erase everything***",
+ callback: function(result){
+ if (result == true){
+ bootbox.hideAll();
+ newProject(null,null,14);
+ }
+ }
+ });
+ }
+}
+
+function newProjectFromPreset(type){
+ newProject(null,null,14);
+ if (type!=null) window.selectedPreset = type;
+ for (var i=0; i<presets.length; i++){
+ if (presets[i][0]==type) {
+ var presetIndex = i;
+ break;
+ }
+ }
+
+ var lX=250;
+ var lY=22;
+
+ for (var i=1; i<presets[presetIndex].length;i++){
+ console.log("hello");
+ storeArray("nodeArr", i, guid(), presets[presetIndex][i][0], lX+160*(i-1), lY, 100,null, null,null,presets[presetIndex][i][1]);
+ }
+ adjustWidth();
+ bootbox.hideAll();
+ //METHOD TO READ FROM FILE
+ //var myjson = new Object();
+ //$.getJSON("myJSON.json", function(json) {
+ // myjson = JSON.stringify(json);
+ // console.log(myjson);
+ //});
+
+}
+
+function newProject(linesToMakeDouble,doubleLineText,rowsToMake,doubleLineType) {
+ window.selectedPreset = "None";
+ resetTitleBar();
+ $( "#start" ).removeClass( "glow" );
+ document.getElementById("numbers").innerHTML ='';
+ document.getElementById("lines").innerHTML ='';
+ document.getElementById("nodeChildrenDroppedOffHere").innerHTML ='';
+ document.getElementById("arrowChildrenDroppedOffHere").innerHTML ='';
+ document.getElementById("noteChildrenDroppedOffHere").innerHTML ='';
+ deletedNodes.length = 0;
+ deletedArrows.length = 0;
+ deletedNotes.length = 0;
+ document.getElementById("trash").src = "../images/trashCan.gif";
+ nodeArr=[];
+ arrowArr=[];
+ noteArr=[];
+ rows=0;
+ if ( linesToMakeDouble != undefined && linesToMakeDouble.length >= 1 ) { step = 0; }
+ for (i = 0; i<rowsToMake; i++) {
+ addRow(linesToMakeDouble,doubleLineText,doubleLineType);
+ }
+}
+
+//Adds height
+function addHeight() {
+ document.getElementById('grid').style.height = 91.5 + (rows-initialRows)*6.2 + '%'; //Increases height by 6%
+ currentHeight = $('.verticalLine').height();
+ newHeight = currentHeight + gridPitchy;
+ $('.verticalLine').height(newHeight);
+ addRow();
+}
+function addRow(linesToMakeDouble,doubleLineText,doubleLineType){ //Adds row lines
+ rows++; //adds one row per button press
+ document.getElementById("numbers").innerHTML +='<li style = "margin-left:4em; height:18px;" type="1"></li><br style="line-height:' + Math.ceil((gridPitchy+6)/2) + 'px;">';
+
+// document.getElementById("numbers").innerHTML +='<li style = "margin-left:4em;" type="1"></li><br style="line-height:' + Math.ceil((gridPitchy+6)/2) + 'px;">';
+ //var lineHTML='<hr id="row'+rows+'" ondblclick="toggleDoubleLine(event.target)" class = "dottedLine" /><br><br style="line-height:' + Math.ceil((gridPitchy)/2) + 'px;">';
+ if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
+ templineheight = 17
+ } else {
+ templineheight = Math.ceil((gridPitchy)/2)
+ }
+ var lineHTML='<hr id="row'+rows+'" class = "dottedLine" /><br><br style="line-height:' + templineheight + 'px;">';
+ $("#lines").append(lineHTML);
+ if (linesToMakeDouble!=null && linesToMakeDouble.indexOf(rows.toString())!=-1){
+ toggleDoubleLine(document.getElementById("row"+rows),linesToMakeDouble,doubleLineText,doubleLineType);
+ step++;
+ console.log(step);
+ }
+}
+
+function toggleDoubleLine (target,lines,text,type) {
+ while (target.id.substring(0,3)!="row"){
+ target = target.parentNode;
+ }
+ //console.log(target.style);
+ if ($(target).hasClass('dottedLine')){
+ $(target).removeClass('dottedLine');
+ $(target).addClass('doubleLine');
+ if (text==null){
+ bootbox.confirm({
+ closeButton:false,backdrop:true,animate:false,
+ size:'small',
+ title: "Add Separator Text",
+ onEscape: function() {},
+ message: '<input id="separatorInnerText" style="width:100%;" type="text" placeholder="Add text here" value="Add text here">'+
+ '<div style="color:grey;font-size:12px;"><br>Message type : <input id="messageType" style="width:100%;" type="text" placeholder="(optional)" value=""></div>',
+ callback: function(result){
+ if (result == true){
+ //EXECUTE THIS ON OKAY///
+ var innerText = $('#separatorInnerText').val();
+ document.getElementById(target.id).setAttribute('messageType',$('#messageType').val())
+ pushToDict(innerText, "separator");
+ locationOfTag = parseInt($(target).position().top)-4;
+ target.innerHTML = '<div style="position:absolute;top:'+locationOfTag+'px;font-style:italic;font-size:12px;width:100%;text-align:center;">'+innerText+'</div>';
+ /////////////////////////
+ }
+ }
+ });
+ $("#separatorInnerText").autocomplete({
+ source: separatorTags,
+ autoFocus: true,
+ delay: 0
+ });
+ $("#messageType").autocomplete({
+ source: messageTags,
+ autoFocus: true,
+ delay: 0
+ });
+
+ var currentInput = $("#separatorInnerText").val();
+ $("#separatorInnerText").selectRange(0,currentInput.length);
+ $("#separatorInnerText").click(function(){
+ var currentInput = $("#separatorInnerText").val();
+ $("#separatorInnerText").selectRange(0,currentInput.length);
+ });
+ $("#separatorInnerText").keyup( function(e) {
+ if (e.keyCode == 13){
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+ $("#messageType").keyup( function(e) {
+ if (e.keyCode == 13){
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+ }
+ else if (text!=null && lines==null){
+ locationOfTag = parseInt($(target).position().top)-4;
+ document.getElementById(target.id).setAttribute('messageType',type)
+ target.innerHTML = '<div style="position:absolute;top:'+locationOfTag+'px;font-style:italic;font-size:12px;width:100%;text-align:center;">'+text+'</div>';
+ }
+ else{
+ locationOfTag = parseInt($(target).position().top)-4;
+ document.getElementById(target.id).setAttribute('messageType',type[lines.indexOf(target.id.substring(3))])
+ target.innerHTML = '<div style="position:absolute;top:'+locationOfTag+'px;font-style:italic;font-size:12px;width:100%;text-align:center;">'+text[lines.indexOf(target.id.substring(3))]+'</div>';
+ }
+ }
+ else {
+ target.innerHTML = '';
+ $(target).removeClass('doubleLine');
+ $(target).addClass('dottedLine');
+ }
+}
+
+//Adds width
+function addWidth() {
+ cols++; //adds 2 cols per button press
+ document.getElementById('grid').style.width = 98 + (cols-initialCols)*12 + '%'; //Increases grid width % by 5% right
+ document.getElementById('horRows').style.width = 81 + (cols-initialCols)*12 + '%'; //Increases line width % by 5% right
+}
+
+function fitToDoc () {
+ doubleLineNumbers.length=0;
+ doubleLineText.length=0;
+ doubleLineType.length=0;
+ var doubleElements = document.getElementsByClassName("doubleLine");
+ $.each(doubleElements,function(index, value){
+ doubleLineNumbers.push(($(value).attr('id')).substring(3));
+ doubleLineText.push(value.children[0].innerHTML);
+ doubleLineType.push($(value).attr('messageType'));
+ });
+ if (nodeArr.length==0 && arrowArr.length==0) return;
+ var maxX = 0;
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][6]>maxX){
+ maxX = nodeArr[i][6];
+ }
+ }
+ var maxY = 0;
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])>maxY){
+ maxY = parseInt(arrowArr[i][4]);
+ }
+ }
+ var rowsNeeded = Math.ceil((maxY-60)/42);
+ document.getElementById("numbers").innerHTML ='';
+ document.getElementById("lines").innerHTML ='';
+ if(maxX<$("#grid").width() - $("#sideBar").width()){
+ do{
+ cols--; //adds 2 cols per button press
+ document.getElementById('grid').style.width = 98 + (cols-initialCols)*12 + '%'; //Increases grid width % by 5% right
+ document.getElementById('horRows').style.width = 81 + (cols-initialCols)*12 + '%'; //Increases line width % by 5% right
+ }while (maxX<$("#grid").width() - $("#sideBar").width())
+ }
+ rows=0;
+ for(var i=0; i<rowsNeeded;i++){
+ addRow();
+ if (doubleLineNumbers.indexOf(rows.toString())!=-1) toggleDoubleLine(document.getElementById('row'+rows),null,doubleLineText[doubleLineNumbers.indexOf(rows.toString())],doubleLineType[doubleLineNumbers.indexOf(rows.toString())])
+ }
+
+}
+
+$(document).on("mouseenter", '.arrowText',function(event){
+ if (event.target.parentElement.parentElement.getAttribute('direction') != 'self') $(event.target).removeClass('makeEllipsis');
+ else $(event.target).removeClass('makeEllipsisSelf');
+})
+$(document).on("mouseleave", '.arrowText',function(event){
+ if (event.target.parentElement.parentElement.getAttribute('direction') != 'self') $(event.target).addClass('makeEllipsis');
+ else $(event.target).addClass('makeEllipsisSelf');
+})
+$(document).on("mouseenter", '.nodeText',function(event){
+ $(event.target).removeClass('nodeEllipsis');
+})
+$(document).on("mouseleave", '.nodeText',function(event){
+ $(event.target).addClass('nodeEllipsis');
+})
+$( "#toggleEllipsis" ).click(function() {
+ var allArrows = document.getElementsByClassName('arrowText')
+ for (var i=0; i<allArrows.length; i++){
+ $( allArrows[i] ).toggleClass( "makeEllipsis" );
+ }
+ var allNodes = document.getElementsByClassName('nodeText')
+ for (var i=0; i<allNodes.length; i++){
+ $( allNodes[i] ).toggleClass( "nodeEllipsis" );
+ }
+ if (document.getElementById("toggleEllipsis").textContent == "Ellipsis : on") {
+ document.getElementById("toggleEllipsis").textContent = "Ellipsis : off";
+ }
+ else {
+ document.getElementById("toggleEllipsis").textContent = "Ellipsis : on";
+ }
+});
+
+//Shows the instructions dialog
+function openHelp () {
+ bootbox.dialog({
+ backdrop:true,
+ onEscape: function() {},
+ message: '<h1 class="help" style="margin-top:0px;">Flow SDE</h1>' +
+ '<p class="help">This program was designed to aid in the process of creating, editing, and sharing sequence diagrams by utilizing drag-n-drop javascript ' +
+ 'frameworks.</p><br><p class="help" style="text-align:center;"><a href="https://github.com/kevingilboy/Advanced-Service-Editor">https://github.com/kevingilboy/Advanced-Service-Editor</a></p>'+
+ '<hr><h2 class="help">Editing: Getting Started</h2><ol style="font-size:18px;"><li>Simply drag a module from the sidebar to the main grid on the screen.</li> ' +
+ '<li>Once you begin dragging, a grey dotted line will guide you to the appropriate dropzone area. The dropzone is highlighted ' +
+ 'blue upon dragging a appropriate module inside of it.</li> ' +
+ '<li>You will be prompted to enter text to be displayed inside of the module. Height and width can be added using the buttons ' +
+ 'on the left side of the screen.</li><li>To delete a module, drag it to the trash can.</li></ol>'+
+
+ '<h3 class="help">Nodes</h3><p class="help indent">Nodes are designated by blue, rounded rectangles and ' +
+ 'can be dragged to the dropzone above the horizontal grid lines. Nodes automatically generate "lifelines" that run to the ' +
+ 'of the page. When arrows are resized, they snap to these lifelines. A node\'s dependent arrows (those that touch its ' +
+ 'lifelines) remain stuck to it while the node is dragged and rearranged. Dragging a node on top of another node results ' +
+ 'in the overlapped node and all nodes to its right to be shifted over one unit to the right.</p>' +
+ '<h3 class="help">Arrows</h3><p class="help indent">Arrows can be ' +
+ 'dragged to the main dropzone that contains many horizontal lines. Arrows can be resized and snap to nearby lifelines at ' +
+ 'the end of resizing.</p>' +
+ '<h3 class="help">Notes</h3><p class="help indent">Notes are designated by yellow rectangles and can be ' +
+ 'dragged to the main dropzone that contains many horizontal lines.</p>' +
+
+ '<hr><h2 class="help">File Management</h2><p class="help" style="margin-left:12px;">There are many options to save your work and load it to either a ' +
+ 'new workspace or current one.</p>'+
+
+ '<h3 class="help">Saving</h3>' +
+
+ '<h4 class="help">Saving workspace</h4><p class="help indent">To save everything in the current workspace, click the save ' +
+ 'button in the lower left hand corner. A menu will pop up with multiple save destinations: <ul class="help">'+
+ '<li><b>Locally:</b> Files are saved as text files with JSON formatting. They are downloaded to the users downloads folder. '+
+ 'The filename dictates what the file is called but the description dictates what the workspace is called.</li>'+
+ '<li><b>Database:</b> Users must first log in to use database connection. When logged in, a text input field is available '+
+ 'for the user to insert a workspace description. The description dictates what the workspace is called.</li>'+
+ '<li><b>BPMN:</b> The workspace is converted to a BPMN 2.0 filetype which is compatable with Camunda\'s <a href="bpmn.io">bpmn.io</a> and eclipse plugin.'+
+ 'The file can either be downloaded for import to bpmn.io or a preview can be shown by clicking "show". This uses a '+
+ 'Camunda released plugin that displays the file on an integrated canvas.</li>'+
+ '</ul></p>' +
+
+ '<h4 class="help">Export node(s)</h4><p class="help indent">It is also possible to export a single node and its dependent ' +
+ 'arrows. To do so, right click on any node and click export. Enter a file name and click "Export". Exporting is useful ' +
+ 'for saving frequently used nodes as they can be imported and appended to any project with ease.</p>' +
+
+ '<h3 class="help">Loading</h3>' +
+ '<h4 class="help">Loading workspace</h4><p class="help indent">To load a previous workspace, click the load ' +
+ 'button in the lower left hand corner. A menu will pop up with multiple loading destinations: <ul class="help">'+
+ '<li><b>Locally:</b> Files can be retrieved from a local filesystem and imported into the workspace.</li>'+
+ '<li><b>Database:</b> Users must first log in to use database connection. When logged in, a table shows the files that are '+
+ 'on the database.</li></ul></p>'+
+ '<h4 class="help">Load types</h4><p class="help indent">There are two ways to load a file into the current workspace: </p>'+
+ '<ul class="help"><li><b>Replace</b><p class="help indent">To load an entire, previously saved workspace and replace the current one, ' +
+ 'click the load button in the lower left hand corner. You will be prompted to choose a file and then click "Replace".</p></li>' +
+
+ '<li><b>Append</b><p class="help indent">To load an entire, previously saved workspace on top of a current one, ' +
+ 'click the load button in the lower left hand corner. You will be prompted to choose a file and then click "Append". ' +
+ 'An append location marker will show up and you can click anywhere on the designated dropzone to change the location where the ' +
+ 'file will be appended. After choosing a spot, click "Okay". If you choose a location that intersects with another node, ' +
+ 'that node and the nodes to its right will be shifted one unit to the right.</p></li></ul>' +
+
+ '<h4 class="help">Import node(s)</h4><p class="help indent">To import a node that has previously been exported, right click ' +
+ 'on the node dropzone and click "import". You will be prompted to choose a file and then click "Import". ' +
+ 'An append location marker will show up and you can click anywhere on the designated dropzone to change the location where the ' +
+ 'file will be appended. After choosing a spot, click "Okay". If you choose a location that intersects with another node, ' +
+ 'that node and the nodes to its right will be shifted one unit to the right.</p></li>' +
+
+ '<h3 class="help">Renaming</h3>' +
+ '<h4 class="help">Rename workspace</h4><p class="help indent">To rename your workspace, double click on the title bar ' +
+ 'and type a new title. This does not change the names of previously saved versions of the workspace.</p>' +
+
+ '<hr><h2 class="help">Features</h2><p class="help" style="margin-left:12px;">There are many features in this program to allow for its ease of use.</p>'+
+
+ '<h3 class="help">Arrow endpoint detection</h3><p class="help"> When an arrow on the screen lacks a left or right ' +
+ 'endpoint, the arrow is colored (red = 0 connections, yellow = 1 connection) and <i>*Link missing lifeline</i> ' +
+ 'appears in the sidebar. Clicking this text flashes the invalid arrows. When a successful connection has been made, ' +
+ 'the arrow fades to green and then to transparent.</p>' +
+ '<h3 class="help">Autocomplete with technical dictionary</h3><p class="help"> When prompted to enter the inner text of a module, ' +
+ 'the editor searches through its preloaded dictionary to offer suggestions for text. Entering a term that is not in the ' +
+ 'dictionary appends it to the dictionary for the entirity of the session.</p>' +
+ '<h3 class="help">Autofit</h3><p class="help"> Clicking the autofit button fits the screen size to the exact dimensions of the ' +
+ 'diagram. Highly recommended before making a printable output as it will scale the diagram and allow for max print size.</p>' +
+ '<h3 class="help">Context menus (right-clicking)</h3><p class="help">Right clicking on nodes and arrows deploys a custom context menu allowing ' +
+ 'you to perform many operations on modules such as cut, copy, paste, delete, rename, import and export.</p>' +
+ '<h3 class="help">Multi-select (using Ctrl & Shift)</h3><p class="help">Holding the control key allows the user to select multiple' +
+ 'nodes in any order. Holding the shift key allows the user to select multiple nodes in a row. Selecting multiple nodes allows ' +
+ 'you to perform an operation (such as drag, cut, copy, paste, delete, and export).</p>' +
+ '<h3 class="help">Printing</h3><p class="help">Clicking "print" allows you to export the current workspace to a ' +
+ 'printable (saveable and email-able) pdf document. These docments are meant for presentation and cannot be ' +
+ 'reimported into the workspace.</p>' +
+ '<h3 class="help">Russian-Doll Nodes</h3><p class="help">Nodes can be nested inside of other nodes. This can be done by either 1) ' +
+ 'right-clicking on a single node and selecting "make child inside" 2) selecting a group of nodes, right-clicking, and selecting ' +
+ '"make group from selected". Blank slots can be added inside groups for nodes to be dragged into by right clicking and selecting '+
+ '"make slot inside". Upon making a group, connected arrows are broken and shaded yellow forcing the user to reconnect the arrows '+
+ 'to the nodes inner components. Nested nodes can be expanded and collapsed by double clicking on them. Arrow connections are preserved through '+
+ 'this process</p>' +
+ '<h3 class="help">Restore from trash</h3><p class="help">Clicking on the trash can brings up a menu that allows you ' +
+ 'to restore previously deleted modules and append them to the current workspace. Follow instructions on load:append for how to append.</p>'+
+ '<h3 class="help">Separators</h3><p class="help">Double-clicking on a horizontal grid line allows the user to make a double-lined ' +
+ 'separator on the diagram.</p>'
+ })
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/convertToYaml.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/convertToYaml.js
new file mode 100644
index 0000000..c1f6b02
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/convertToYaml.js
@@ -0,0 +1,73 @@
+function convertToYaml(data) {
+
+ for (var i=0; i<nodeArr.length; i++){
+ if (document.getElementById(nodeArr[i][1]).getAttribute('taska_id')==null || document.getElementById(nodeArr[i][1]).getAttribute('taska_id')==''){
+ return false;
+ }
+ }
+
+ data = decodeJSON(data,null);
+ data = JSON.parse(data);
+
+ var elementList = data.diagram.elements; //stores all elements
+ var allNodes = data.diagram.elements.nodes;
+ var allArrows = data.diagram.elements.arrows;
+ var allNotes = data.diagram.elements.notes;
+ var loadedRows = data.diagram.rows;
+ var loadedCols = data.diagram.cols;
+ var separators = data.diagram.elements.separators
+ var description = data.diagram.description
+ startArrowAtIndex = 0;
+ var yamlText = '';
+ yamlText += 'callFlowName: "'+description+'"\n';
+ yamlText += 'callSequenceSteps:\n';
+ for (var s = 0; s<separators.length; s++){
+ yamlText += ' - \n';
+ yamlText += ' name: "'+separators[s].text+'"\n';
+ yamlText += ' subSteps:\n';
+ for (var i=startArrowAtIndex; i<allArrows.length; i++){
+ var index = recallArray(arrowArr,allArrows[i].id)
+ try{
+ if (parseInt(arrowArr[index][4])>=parseInt(separators[s+1].lineNumber)*42+60){
+ startArrowAtIndex = index;
+ break;
+ }
+ }
+ catch (err){}
+ yamlText += ' - \n';
+ yamlText += ' destination_tosca_id: '+document.getElementById(arrowArr[index][9]).getAttribute('taska_id')+'\n';
+ yamlText += ' link_description: "'+arrowArr[index][10]+'"\n';
+ yamlText += ' link_message: "'+arrowArr[index][2]+'"\n';
+ var linkTitleName='';
+ if (arrowArr[index][10]!=='') {
+ linkTitleName= arrowArr[index][2];
+ }
+ yamlText += ' link_title: "'+linkTitleName+'"\n';
+ var linkType = 'standard';
+ if (arrowArr[index][0].attributes.direction.value==='self') {
+ linkType = 'self'
+ }
+ yamlText += ' link_type: '+linkType+'\n';
+
+ // if message_type attribute does not exist, set it as signal by default
+ var message_type_val = 'media'
+ if (arrowArr[index][0].hasAttribute('message_type')) {
+ message_type_val = arrowArr[index][0].attributes.message_type.value;
+ }
+ yamlText += ' message_type: '+ message_type_val +'\n';
+ yamlText += ' source_tosca_id: '+document.getElementById(arrowArr[index][8]).getAttribute('taska_id')+'\n';
+ }
+ }
+ yamlText += 'networkElementSequenceToscaIDs:\n';
+ for (var i=0; i<nodeArr.length;i++){
+ yamlText += ' - \n'
+ yamlText += ' tosca_id: '+document.getElementById(nodeArr[i][1]).getAttribute('taska_id')+'\n';
+ var NodeRoleID =''
+ if (nodeArr[i][0].hasAttribute('role_id')) {
+ NodeRoleID = nodeArr[i][0].attributes.role_id.value
+ }
+ yamlText += ' role: "'+ NodeRoleID +'"\n';
+ }
+ yamlText += 'overviewDescription: description';
+ return yamlText;
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/customContextMenus.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/customContextMenus.js
new file mode 100644
index 0000000..d97e89e
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/customContextMenus.js
@@ -0,0 +1,1489 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains functions that dictate what the user can do when they right click a node, arrow, dropzone or note
+
+//NODEDROPZONE CONTEXT MENU
+$(function(){
+ $.contextMenu({
+ selector: '.nodeDropzone',
+ callback: function(key, options) {
+ var m = "clicked: " + key;
+ window.console && console.log(m) || alert(m);
+ },
+ animation: {
+ duration: 100,show: "show", hide: "hide"
+ },
+ items: {
+ "sep1": "---------",
+ /*
+ "paste": {
+ name: "Paste",
+ icon: "paste",
+ callback: function(key, options) {
+ var transposeX = Math.round((event.x)/160)*160-70;
+ var transposeY = 22;
+ for (var i = 0; i<clipboard.length; i++) {
+ storeArray("nodeArr", i, guid(), clipboard[i][2], transposeX, transposeY, clipboard[i][5],null, null);
+ }
+ }
+ },
+ "sep1": "---------",
+ "import": {
+ name: "Import",
+ icon: "import",
+ callback: function(key, options) {
+ document.getElementById("titleBar").innerHTML = '<div class="center" style="width:35%;"><p style = "cursor:pointer;display:inline;margin-right:15px;font-family:Arial Black; line-height:10px;" onclick="resetTitleBar();">X</p><input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><button style = "display:inline;" onclick="loadFile(1);">Import!</button><button style = "margin-left:10px;display:inline;" onclick="loadFile(2);">Source</button></div>';
+ }
+ },
+ "sep2": "---------",
+ "quit": {
+ name: "Quit",
+ icon: "quit"}
+ */
+ }
+
+ });
+
+ $('.nodeDropzone').on('click', function(e){
+ //clearSelection();
+ })
+});
+
+//ARROWDROPZONE CONTEXT MENU
+$(function(){
+ $.contextMenu({
+ selector: '.arrowDropzone',
+ callback: function(key, options) {
+ var m = "clicked: " + key;
+ window.console && console.log(m) || alert(m);
+ },
+ animation: {
+ duration: 100,show: "show", hide: "hide"
+ },
+ items: {
+ "addStep": {
+ name: "Insert New Step",
+ icon: "add",
+ callback: function(key, options) {
+
+ // Get the current Menu
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+
+ // Check to make sure no arrows are below where we want to place our new step step.
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])+61>$(currentMenu).position().top){
+ x = document.getElementById(arrowArr[i][1]).getAttribute('data_x');
+ y = document.getElementById(arrowArr[i][1]).getAttribute('data_y');
+ y = parseInt(y) + 42;
+ //y = parseInt(y) + 21;
+
+ document.getElementById(arrowArr[i][1]).style.webkitTransform =
+ document.getElementById(arrowArr[i][1]).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ document.getElementById(arrowArr[i][1]).setAttribute('data_y',y);
+
+ storeXY(arrowArr,arrowArr[i][1]);
+ }
+ }
+ var allDoubleElements = document.getElementsByClassName('doubleLine');
+ for (var i=allDoubleElements.length-1; i>=0; i--){
+ if ($(allDoubleElements[i]).attr('id') === 'row1' ) { break; };
+ if (parseInt($(allDoubleElements[i]).position().top)+42*4>$(currentMenu).position().top){
+ var rowNumber = allDoubleElements[i].id.substring(3);
+ var text = allDoubleElements[i].textContent;
+
+ toggleDoubleLine(allDoubleElements[i].nextSibling.nextSibling.nextSibling,null,text,$(allDoubleElements[i]).attr('messageType'));
+ toggleDoubleLine(allDoubleElements[i],null,null)
+ $(allDoubleElements[i]).attr('messageType',null)
+
+ }
+ }
+
+ /*
+ * Find Current Menu Location then find the closest Line and make it a Step.
+ */
+ var menuY = $(currentMenu).position().top;
+ var lines = $(".dottedLine");
+ for ( var i =0; i < lines.length; i++ ) {
+ var liY = $(lines[i]).offset().top;
+ var posY = liY-6;
+ if ( (menuY >= liY - 20) && (menuY <= liY + 20) ) {
+ if ( $(lines[i]).hasClass('step') ) {
+ bootbox.alert("Step exists at this line already. Please choose another line.");
+ return false;
+ }
+ var id = $(lines[i]).attr('id');
+ var stepText = "";
+ var stepDesc = $(lines[i]).attr('step_desc');
+ bootbox.confirm({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: "Add Step ( Step " + (step + 1) + ")",
+ onEscape: function() {},
+ message: 'Description: <br> <input id="stepDescText" style="width:100%;" type="text" placeholder="Add text here" value="">',
+ callback: function(result) {
+ if (result == true) {
+ step++;
+ stepDesc = $("#stepDescText").val();
+ stepText = 'Step ' + step +': ' + stepDesc;
+ $(lines[i]).attr('step_desc',$("#stepDescText").val());
+ $(lines[i]).attr('step',step);
+ $(lines[i]).addClass('step');
+
+ toggleDoubleLine(document.getElementById(id),null,stepText,"");
+
+ var stepArr = $(".step");
+ var newStep = 2;
+ for ( var l = 0 ;l < stepArr.length; l++ ) {
+ var nId = $(stepArr[l]).attr('id');
+ var nDesc = $(stepArr[l]).attr('step_desc');
+ toggleDoubleLine(document.getElementById(nId));
+ $(stepArr[l]).attr('step_desc',nDesc);
+ $(stepArr[l]).attr('step',newStep);
+ var nStepText = 'Step ' +newStep +': ' + nDesc;
+ toggleDoubleLine(document.getElementById(nId),null,nStepText,"");
+ newStep++;
+ }
+
+
+ }
+ }
+ });
+ break;
+ }
+ }
+
+
+
+ },
+ disabled: function(key, opt) {
+ // If now arrows and now flows then now steps.
+ if ( arrowArr.length == 0 ) {
+ return true;
+ }
+
+ return false
+ }
+ },
+ "editStep": {
+ name: "Edit Step",
+ icon: "edit",
+ callback: function(key, options) {
+
+ // Get the current Menu
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+
+ /*
+ * Find Current Menu Location then find the closest Line and make it a Step.
+ */
+ var menuY = $(currentMenu).position().top;
+ var lines = $(".doubleLine");
+
+ for ( var i =0; i < lines.length; i++ ) {
+ console.log(i);
+ var liY = $(lines[i]).offset().top;
+ var posY = liY-6;
+ if ( (menuY >= liY - 20) && (menuY <= liY + 20) ) {
+
+ var id = $(lines[i]).attr('id');
+ var stepNumber = $(lines[i]).attr('step');;
+ if ( stepNumber === undefined ) { stepNumber = 1; }
+ var stepDesc = $(lines[i]).attr('step_desc');
+ if ( stepDesc === undefined ) { stepDesc = ""; }
+ bootbox.confirm({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: "Edit Step ( Step " + stepNumber + ")",
+ onEscape: function() {},
+ message: 'Description: <br> <input id="stepDescText" style="width:100%;" type="text" placeholder="Add text here" value="'+ stepDesc +'">',
+ callback: function(result) {
+ if (result == true) {
+ if( stepDesc != $("#stepDescText").val() ) {
+ stepDesc = $("#stepDescText").val();
+ }
+ var stepText = 'Step ' + stepNumber +': ' + stepDesc;
+ $(lines[i]).attr('step_desc',$("#stepDescText").val());
+ //$(lines[i]).attr('step','Step' + stepNumber);
+ //$(lines[i]).addClass('step');
+ toggleDoubleLine(document.getElementById(id));
+ toggleDoubleLine(document.getElementById(id),null,stepText,"");
+ }
+ }
+ });
+
+ break;
+ }
+ }
+
+
+
+ },
+ disabled: function(key, opt) {
+ // If now arrows and now flows then now steps.
+ //if ( arrowArr.length == 0 ) {
+ // return true;
+ //}
+
+ return false
+ }
+ },
+ "delStep": {
+ name: "Delete Step",
+ icon: "delete",
+ callback: function(key, options) {
+
+ // Get the current Menu
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+
+ /*
+ * Find Current Menu Location then find the closest Line and make it a Step.
+ */
+ var menuY = $(currentMenu).position().top;
+ var lines = $(".step");
+ for ( var i =0; i < lines.length; i++ ) {
+ var liY = $(lines[i]).offset().top;
+ var posY = liY-6;
+ if ( (menuY >= liY - 20) && (menuY <= liY + 20) ) {
+ var id = $(lines[i]).attr('id');
+ var stepText = "";
+ $(lines[i]).attr('step_desc','');
+ $(lines[i]).attr('step','');
+ $(lines[i]).removeClass('step');
+ step--;
+
+ toggleDoubleLine(document.getElementById(id));
+
+
+ var stepArr = $(".step");
+ var newStep = 2;
+ for ( var l = 0 ;l < stepArr.length; l++ ) {
+ var nId = $(stepArr[l]).attr('id');
+ var nDesc = $(stepArr[l]).attr('step_desc');
+ toggleDoubleLine(document.getElementById(nId));
+ $(stepArr[l]).attr('step_desc',nDesc);
+ $(stepArr[l]).attr('step',newStep);
+ var nStepText = 'Step ' +newStep +': ' + nDesc;
+ toggleDoubleLine(document.getElementById(nId),null,nStepText,"");
+ newStep++;
+ }
+ break;
+ }
+ }
+
+
+
+ },
+ disabled: function(key, opt) {
+ // If now arrows and now flows then now steps.
+ //if ( arrowArr.length == 0 ) {
+ // return true;
+ //}
+
+ return false
+ }
+ },
+
+ "addRow": {
+ name: "Insert row here",
+ icon: "add",
+ callback: function(key, options) {
+ addHeight();
+
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])+61>$(currentMenu).position().top){
+ x = document.getElementById(arrowArr[i][1]).getAttribute('data_x');
+ y = document.getElementById(arrowArr[i][1]).getAttribute('data_y');
+ y = parseInt(y) + 42
+
+ document.getElementById(arrowArr[i][1]).style.webkitTransform =
+ document.getElementById(arrowArr[i][1]).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ document.getElementById(arrowArr[i][1]).setAttribute('data_y',y);
+
+ storeXY(arrowArr,arrowArr[i][1]);
+ }
+ }
+ var allDoubleElements = document.getElementsByClassName('doubleLine');
+ for (var i=allDoubleElements.length-1; i>=0; i--){
+ if ($(allDoubleElements[i]).attr('id') === 'row1' ) { break; };
+ if (parseInt($(allDoubleElements[i]).position().top)+42*4>$(currentMenu).position().top){
+ var rowNumber = allDoubleElements[i].id.substring(3);
+ var text = allDoubleElements[i].textContent;
+
+ toggleDoubleLine(allDoubleElements[i].nextSibling.nextSibling.nextSibling,null,text,$(allDoubleElements[i]).attr('messageType'));
+ toggleDoubleLine(allDoubleElements[i],null,null)
+ $(allDoubleElements[i]).attr('messageType',null)
+
+ }
+ }
+ },
+ disabled: function(key, opt) {
+ return false
+ }
+ },
+ "deleteRow": {
+ name: "Delete row here",
+ icon: "delete",
+ callback: function(key, options) {
+ $('#numbers').children().last().remove();
+ $('#numbers').children().last().remove();
+ $('#lines').children().last().remove();
+ $('#lines').children().last().remove();
+ $('#lines').children().last().remove();
+ rows--;
+ document.getElementById('grid').style.height = 91.5 + (rows-initialRows)*6.2 + '%'; //Increases height by 6%
+ currentHeight = $('.verticalLine').height();
+ newHeight = currentHeight + gridPitchy;
+ $('.verticalLine').height(newHeight);
+
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])+61>$(currentMenu).position().top){
+ x = document.getElementById(arrowArr[i][1]).getAttribute('data_x');
+ y = document.getElementById(arrowArr[i][1]).getAttribute('data_y');
+ y = parseInt(y) - 42
+
+ document.getElementById(arrowArr[i][1]).style.webkitTransform =
+ document.getElementById(arrowArr[i][1]).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ document.getElementById(arrowArr[i][1]).setAttribute('data_y',y);
+
+ storeXY(arrowArr,arrowArr[i][1]);
+ }
+ }
+ var allDoubleElements = document.getElementsByClassName('doubleLine');
+ for (var i=0; i<allDoubleElements.length; i++){
+ if ($(allDoubleElements[i]).attr('id') === 'row1' ) { break; };
+ if (parseInt($(allDoubleElements[i]).position().top)+42*4>$(currentMenu).position().top){
+ var rowNumber = allDoubleElements[i].id.substring(3);
+ var text = allDoubleElements[i].textContent;
+
+ toggleDoubleLine(allDoubleElements[i].previousSibling.previousSibling.previousSibling,null,text, $(allDoubleElements[i+1]).attr('messageType'));
+ toggleDoubleLine(allDoubleElements[i+1],null,null)
+ $(allDoubleElements[i+1]).attr('messageType',null)
+ }
+ }
+ },
+ disabled: function(key, opt) {
+ if (rows==1) return true;
+ var allMenus = document.getElementsByClassName('context-menu-root');
+ for (var i=0; i<allMenus.length; i++){
+ if ($(allMenus[i]).css('display')!='none'){
+ currentMenu = allMenus[i];
+ break;
+ }
+ }
+ var maxY = 0;
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])+61<$(currentMenu).position().top){
+ if (arrowArr[i][4]>maxY) maxY = parseInt(arrowArr[i][4])
+ }
+ }
+ for (var i=0; i<arrowArr.length; i++){
+ if (parseInt(arrowArr[i][4])+61>$(currentMenu).position().top){
+ if (arrowArr[i][4]-42<=maxY){
+ return true;
+ }
+ }
+ }
+
+ return false
+ }
+ }
+ }
+ });
+
+ $('.nodeDropzone').on('click', function(e){
+ //clearSelection();
+ })
+});
+
+//NODE CONTEXT MENU
+$(function(){
+
+ /**************************************************
+ * Custom Command Handler
+ **************************************************/
+ $.contextMenu.types.label = function(item, opt, root) {
+ // this === item.$node
+
+ $('<span>Shift Arrows</span>'
+ + '<button id="shiftDownButton" style="margin-left:5px" onClick="shiftDown(event,1);">+</button>'
+ + '<button id="shiftUpButton" style="margin-right:10px" onClick="shiftDown(event,-1);">-</button>')
+ .appendTo(this);
+
+
+ };
+ $.contextMenu({
+ selector: '.placed',
+ callback: function(key, options) {
+ //var m = "clicked: " + key;
+ window.console && console.log(m) || alert(m);
+ },
+ animation: {
+ duration: 100,show: "show", hide: "hide"
+ },
+ items: {
+ "edit": {
+ name: "Edit",
+ icon: "edit",
+ callback: function(key, options) {
+ renameNode(this[0].id);
+ },
+ disabled: function(key, opt) {
+ //Only allow editing if one node is selected
+ return selection.length > 1
+ }
+ },
+ /*
+ "cut": {
+ name: "Cut",
+ icon: "cut",
+ callback: function(key, options) {
+ clipboard.length = 0;
+ for (var i = 0; i<selection.length; i++){
+ for (var j = 0; j<nodeArr.length; j++){
+ if (nodeArr[j][1] == selection[i]) {
+ clipboard.push(nodeArr[j]);
+ break;
+ }
+ }
+ }
+ //sort the nodes by data_x
+ for (var k = clipboard.length-1; k>=0; k--){
+ for (var m = 1; m<=k; m++){
+ if (document.getElementById(clipboard[m-1][1]).getAttribute("data_x")<document.getElementById(clipboard[m][1]).getAttribute("data_x")) {
+ var swap = clipboard[m-1];
+ clipboard[m-1] = clipboard[m];
+ clipboard[m] = swap;
+ }
+ }
+ }
+ //Splice elements
+ for (var i = 0; i<selection.length; i++){
+ for (var j = 0; j<nodeArr.length; j++){
+ if (nodeArr[j][1] == selection[i]) {
+ nodeArr.splice(j,1);
+ warning();
+ document.getElementById(selection[i]).parentNode.removeChild(document.getElementById(selection[i]));
+ break;
+ }
+ }
+ }
+ } //Callback
+ },
+ "copy": {
+ name: "Copy",
+ icon: "copy",
+ callback: function(key, options) {
+ clipboard.length = 0;
+ for (var j = 0; j<selection.length; j++){
+ for (var i = 0; i<nodeArr.length; i++){
+ if (nodeArr[i][1] == selection[j]) {
+ clipboard.push(nodeArr[i]);
+ break;
+ }
+ }
+ }
+ //sort the nodes by data_x
+ for (var i = clipboard.length-1; i>=0; i--){
+ for (var j = 1; j<=i; j++){
+ if (document.getElementById(clipboard[j-1][1]).getAttribute("data_x")<document.getElementById(clipboard[j][1]).getAttribute("data_x")) {
+ var swap = clipboard[j-1];
+ clipboard[j-1] = clipboard[j];
+ clipboard[j] = swap;
+ }
+ }
+ }
+ }
+ },
+ "paste": {
+ name: "Paste",
+ icon: "paste",
+ callback: function(key, options) {
+ var transposeX = Math.round((event.x)/160)*160-70;
+ var transposeY = 22;
+ for (var i = 0; i<clipboard.length; i++) {
+ storeArray("nodeArr", i, guid(), clipboard[i][2], transposeX, transposeY, clipboard[i][5],null, null);
+ }
+ }
+ },
+ */
+ "delete": {
+ name: "Delete",
+ icon: "delete",
+ callback: function(key, options) {
+ for (var j = 0; j<selection.length; j++){
+ for (var i = 0; i<nodeArr.length; i++){
+ if (nodeArr[i][1] == selection[j]) {
+ deletedNodes.push(nodeArr[i]);
+ nodeArr.splice(i,1);
+ document.getElementById(selection[j]).parentNode.removeChild(document.getElementById(selection[j]));
+ warning();
+ break;
+ }
+ }
+ }
+ clearSelection();
+ document.getElementById("trash").src = "../images/trashCanFull.gif";
+ for (i = 0; i<arrowArr.length; i++){
+ determineLRNode(arrowArr[i][1],"arrow");
+ }
+ }
+ },
+ "deleteOptions": {
+ name: "Delete w/ arrows",
+ icon: "delete",
+ callback: function(key, options) {},
+ items: {
+ "deleteStart": {
+ name: "Delete with start arrows",
+ icon: "delete",
+ callback: function(key, options) {
+ for (var i = 0; i<selection.length; i++){ //cycle each selected node
+ for (var j = 0; j<nodeArr.length; j++){ //cycle all nodes
+ if (nodeArr[j][1] == selection[i]) { //see if node is selected
+ getStartArrowDependants(selection[i]); //get start dependents
+ for (var k = 0; k<startArrowDependants.length; k++){ //cycle through startArrowDep
+ for (var m = 0; m<arrowArr.length; m++){ //cycle through all arrows
+ if (arrowArr[m][1] == startArrowDependants[k]){ //see if arrow is a startArrowDep
+ deletedArrows.push(arrowArr[m]);
+ arrowArr.splice(m,1);
+ document.getElementById(startArrowDependants[k]).parentNode.removeChild(document.getElementById(startArrowDependants[k]));
+ }
+ }
+ }
+ deletedNodes.push(nodeArr[j]);
+ nodeArr.splice(j,1);
+ document.getElementById(selection[i]).parentNode.removeChild(document.getElementById(selection[i]));
+ warning();
+ break;
+ }
+ }
+ }
+ clearSelection();
+ document.getElementById("trash").src = "../images/trashCanFull.gif";
+ for (i = 0; i<arrowArr.length; i++){
+ determineLRNode(arrowArr[i][1],"arrow");
+ }
+ }
+ },
+ "deleteEnd": {
+ name: "Delete with end arrows",
+ icon: "delete",
+ callback: function(key, options) {
+ for (var i = 0; i<selection.length; i++){ //cycle each selected node
+ for (var j = 0; j<nodeArr.length; j++){ //cycle all nodes
+ if (nodeArr[j][1] == selection[i]) { //see if node is selected
+ getEndArrowDependants(selection[i]); //get end dependents
+ for (var k = 0; k<endArrowDependants.length; k++){ //cycle through endArrowDep
+ for (var m = 0; m<arrowArr.length; m++){ //cycle through all arrows
+ if (arrowArr[m][1] == endArrowDependants[k]){ //see if arrow is a endArrowDep
+ deletedArrows.push(arrowArr[m]);
+ arrowArr.splice(m,1);
+ document.getElementById(endArrowDependants[k]).parentNode.removeChild(document.getElementById(endArrowDependants[k]));
+ }
+ }
+ }
+ deletedNodes.push(nodeArr[j]);
+ nodeArr.splice(j,1);
+ document.getElementById(selection[i]).parentNode.removeChild(document.getElementById(selection[i]));
+ warning();
+ break;
+ }
+ }
+ }
+ clearSelection();
+ document.getElementById("trash").src = "../images/trashCanFull.gif";
+ for (i = 0; i<arrowArr.length; i++){
+ determineLRNode(arrowArr[i][1],"arrow");
+ }
+ }
+ },
+ "deleteAll": {
+ name: "Delete all arrows",
+ icon: "delete",
+ callback: function(key, options) {
+ if (selection.length == 0){
+ selection.push(this[0].id);
+ }
+ for (var i = 0; i<selection.length; i++){ //cycle each selected node
+ for (var j = 0; j<nodeArr.length; j++){ //cycle all nodes
+ if (nodeArr[j][1] == selection[i]) { //see if node is selected
+ getStartArrowDependants(selection[i]); //get start dependents
+ for (var k = 0; k<startArrowDependants.length; k++){ //cycle through startArrowDep
+ for (var m = 0; m<arrowArr.length; m++){ //cycle through all arrows
+ if (arrowArr[m][1] == startArrowDependants[k]){ //see if arrow is a startArrowDep
+ deletedArrows.push(arrowArr[m]);
+ arrowArr.splice(m,1);
+ document.getElementById(startArrowDependants[k]).parentNode.removeChild(document.getElementById(startArrowDependants[k]));
+ }
+ }
+ }
+ getEndArrowDependants(selection[i]); //get end dependents
+ for (var k = 0; k<endArrowDependants.length; k++){ //cycle through endArrowDep
+ for (var m = 0; m<arrowArr.length; m++){ //cycle through all arrows
+ if (arrowArr[m][1] == endArrowDependants[k]){ //see if arrow is a endArrowDep
+ deletedArrows.push(arrowArr[m]);
+ arrowArr.splice(m,1);
+ document.getElementById(endArrowDependants[k]).parentNode.removeChild(document.getElementById(endArrowDependants[k]));
+ }
+ }
+ }
+ deletedNodes.push(nodeArr[j]);
+ nodeArr.splice(j,1);
+ document.getElementById(selection[i]).parentNode.removeChild(document.getElementById(selection[i]));
+ warning();
+ break;
+ }
+ }
+ }
+ clearSelection();
+ document.getElementById("trash").src = "../images/trashCanFull.gif";
+ for (i = 0; i<arrowArr.length; i++){
+ determineLRNode(arrowArr[i][1],"arrow");
+ }
+ }
+ },
+ }
+
+
+ },
+ "sep1": "---------",
+ /*
+ "export": {
+ name: "Export",
+ icon: "export",
+ callback: function(key, options) {
+ var now = new Date;
+ var utc_timestamp = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(), now.getUTCDate() ,
+ now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
+ var canvasWidth = $("#grid").width() - $("#sideBar").width();
+ //alert('Saving To File -- click OK');
+ m = "";
+ m += '{ "diagram": \n';
+ m += '{ "created": "' + utc_timestamp + '",\n';
+ m += '"rows": "' + rows + '",\n';
+ m += '"cols": "' + cols + '",\n';
+ m += '"gridPitchy": "' + gridPitchy + '",\n';
+ m += '"canvasHeight": "' + $("#grid").height() + '",\n';
+ m += '"canvasWidth": "' + canvasWidth + '",\n';
+ m += '"elements": {"nodes": [\n';
+ for (var i = 0; i<selection.length; i++) {
+ index = recallArray(nodeArr, selection[i]);
+ saveNodeArrayElements(nodeArr[index],i,selection);
+ }
+ m += '],\n "arrows": [\n';
+ var allDependants = [];
+ for (var i = 0; i<selection.length; i++){
+ getStartArrowDependants(selection[i]);
+ getEndArrowDependants(selection[i]);
+ nodeDependants = startArrowDependants.concat(endArrowDependants);
+ allDependants = allDependants.concat(nodeDependants);
+ }
+ for (var a = 0; a<allDependants.length; a++){
+ for (var b = a+1; b<allDependants.length;b++){
+ if(allDependants[a]===allDependants[b])
+ allDependants.splice(b--,1);
+ }
+ }
+ for (var j = 0; j<allDependants.length; j++){
+ index = recallArray(arrowArr,allDependants[j]);
+ saveArrowArrayElements(arrowArr[index],j,allDependants);
+ }
+ m += "]}}}";
+
+ recallArray(nodeArr, this[0].id);
+ var n = JSON.parse(m);
+ //console.log(n);
+ //console.log(n.diagram.created);
+ underscoreText = text.replace(/ /g,"_");
+ text = underscoreText + '.txt'
+ document.getElementById("titleBar").innerHTML = '<div class="center" style="width:29%"><p style = "cursor:pointer;display:inline;margin-right:15px;font-family:Arial Black; line-height:10px;" onclick="resetTitleBar();">X</p>Export Name: <input id="exportFileName" type="text" value='+text+'><button style = "display:inline;" onclick="saveLocalFile($(\'#exportFileName\').val());">Confirm!</button><button style = "margin-left:10px;display:inline;" onclick="alert(m);">Source</button></div>';
+ $("#exportFileName").selectRange(0,text.length-4);
+ $("#exportFileName").keyup( function(e) {
+ if (e.keyCode == 13){
+ exportName = $("#exportFileName").val();
+ saveLocalFile(exportName);
+ }
+ });
+ }
+ },
+ "import": {
+ name: "Import",
+ icon: "import",
+ callback: function(key, options) {
+ document.getElementById("titleBar").innerHTML = '<div class="center" style="width:35%;"><p style = "cursor:pointer;display:inline;margin-right:15px;font-family:Arial Black; line-height:10px;" onclick="resetTitleBar();">X</p><input type="file" accept=".txt" name="fileToLoad" id = "fileToLoad"><button style = "display:inline;" onclick="loadFile(1);">Import!</button><button style = "margin-left:10px;display:inline;" onclick="loadFile(2);">Source</button></div>';
+ }
+ },
+ "sep2": "---------",
+
+ "shift": {type: "label", customName: "Label",
+ callback: function(){
+ //adjustHeight();
+ return false
+ },
+ disabled: function(key, opt) {
+ //Only allow editing if one node is selected
+ getStartArrowDependants(this[0].id);
+ getEndArrowDependants(this[0].id);
+ return startArrowDependants.length==0 && endArrowDependants.length==0;
+ }
+ },
+ "makeGroupAddChild": {
+ name: "Make child inside",
+ icon: "edit",
+ callback: function(key, options) {
+ clearSelection();
+ var uuid=this[0].id;
+ selection.push(uuid);
+ $("#"+uuid).addClass('selected');
+ lastSelected = uuid;
+ var dx = addChildrenToGroup(uuid);
+ shiftByDx(dx,uuid);
+ if ($("#"+uuid).hasClass("hasNodes")==false){ //first time
+ $("#"+uuid).addClass("hasNodes");
+ $("#"+uuid).addClass("expanded");
+ document.getElementById(uuid).style.zIndex = 9980;
+ //document.getElementById(uuid).style.zIndex = document.getElementById(uuid).style.zIndex - 10;
+ breakArrows();
+ }
+ else {
+ shortenArrows();
+ }
+ spawnChild();
+ calcChildren(uuid);
+ },
+ disabled: function(key, opt) {
+ //Only allow if one node is selected
+ return selection.length > 1
+ }
+ },
+ "expandGroup": {
+ name: "Make slot inside",
+ icon: "edit",
+ callback: function(key, options) {
+ clearSelection();
+ var uuid=this[0].id;
+ selection.push(uuid);
+ $("#"+uuid).addClass('selected');
+ lastSelected = uuid;
+ var dx = addChildrenToGroup(uuid);
+ shiftByDx(dx,uuid);
+ if ($("#"+uuid).hasClass("hasNodes")==false){ //first time
+ $("#"+uuid).addClass("hasNodes");
+ $("#"+uuid).addClass("expanded");
+ document.getElementById(uuid).style.zIndex = 9980;
+ //document.getElementById(uuid).style.zIndex = document.getElementById(uuid).style.zIndex - 10;
+ breakArrows();
+ }
+ else {
+ shortenArrows();
+ }
+
+ calcChildren(uuid);
+ },
+ disabled: function(key, opt) {
+ //Only allow if one node is selected
+ return selection.length > 1
+ }
+ },
+ "makeGroupFromSelected": {
+ name: "Make group from selected",
+ icon: "edit",
+ callback: function(key, options) {
+ makeGroup();
+ calcChildren(this[0].id);
+ },
+ disabled: function(key, opt) {
+ //Only allow if sequential nodes are selected
+ var selectionX = []
+ var nonSelectionX = []
+ for (var i=0; i<nodeArr.length; i++){
+ var flag = 0;
+ for (var j=0; j<selection.length; j++){
+ if (selection[j] == nodeArr[i][1]){
+ selectionX.push(nodeArr[i][3]);
+ var flag = 1
+ break;
+ }
+ }
+ if (flag == 0){
+ nonSelectionX.push(nodeArr[i][3])
+ }
+ }
+ var minX = Math.min.apply(null,selectionX);
+ var maxX = Math.max.apply(null,selectionX);
+ for (var i=0; i<nonSelectionX.length; i++){
+ if (nonSelectionX[i]<maxX && nonSelectionX[i]>minX){
+ return true
+ }
+ }
+ return false
+ }
+ },
+ "sep3": "---------",
+ "InnerBPMN": {
+ name: "InnerBPMN",
+ icon: "InnerBPMN",
+ callback: function(key, options) {
+ bpmnAction(this[0]);
+ }
+ },
+ "sep4": "---------",
+ "quit": {
+ name: "Quit",
+ icon: "quit"
+ }
+ */
+
+ }
+ });
+
+ $('.placed').on('click', function(e){
+ console.log('clicked', this);
+ })
+});
+
+
+function addChildrenToGroup (uuid) {
+ var target= document.getElementById(uuid);
+ var dx=160;
+ var dy=0
+ if ($("#"+uuid).hasClass("hasNodes")==false){ //first time
+ var dy=12;
+ var dx=0;
+ }
+ var height = $("#"+uuid).height();
+ var wide = $("#"+uuid).width();
+
+ height+=dy;
+ wide+=dx;
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x'))) + 0,
+ y = (parseFloat(target.getAttribute('data_y'))) - dy/2;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ $("#"+uuid).height(height);
+ $("#"+uuid).width(wide);
+
+ storeXY(nodeArr,target.id);
+
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][1] == target.id){
+ var index = i;
+ text = nodeArr[i][2];
+ }
+ }
+ nodeHeightCorrected = height+16;
+ var gridHeight = document.getElementById('grid').clientHeight;
+ gridHeightCorrected = gridHeight - 90;
+ target.innerHTML = '<div class="hasNodesHeader">'+text +'</div>'+
+ '<div class="hasNodesBackground" style="height:'+gridHeightCorrected+'px"></div>'+
+ '<div class="verticalLine" style = "margin-left:0px; top:' + nodeHeightCorrected + 'px;height:' + gridHeightCorrected + 'px;"></div>';
+
+ return dx;
+}
+
+function shiftByDx (dx,uuid){
+ shiftMe.length = 0;
+ index=recallArray(nodeArr,uuid);
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][1] == selection[0] || selection.indexOf(nodeArr[i][1]) != -1){
+ continue;
+ }
+ calcParent(uuid)
+ if (nodeArr[i][3]>nodeArr[index][3] && nodeArr[i][8] != nodeArr[index][1]){
+ shiftMe.push(nodeArr[i][1]);
+ }
+ }
+ for (var i = 0; i<shiftMe.length; i++) {
+ shiftedID = shiftMe[i];
+ var dy = 0;
+ var x = parseInt(document.getElementById(shiftedID).getAttribute("data_x")) + dx;
+ var y = parseInt(document.getElementById(shiftedID).getAttribute("data_y")) + dy;
+
+ document.getElementById(shiftedID).style.webkitTransform =
+ document.getElementById(shiftedID).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ document.getElementById(shiftedID).setAttribute('data_x', x);
+ document.getElementById(shiftedID).setAttribute('data_y', y);
+
+ storeXY(nodeArr,shiftedID);
+
+ startArrowDependants.length = 0;
+ endArrowDependants.length = 0;
+
+ getStartArrowDependants(shiftedID);
+ getEndArrowDependants(shiftedID);
+
+ moveDependants(dx,dy,shiftedID);
+ }
+}
+
+function breakArrows () {
+ getStartArrowDependants(selection[0]);
+ getEndArrowDependants(selection[0]);
+ nodeIndex = recallArray(nodeArr,selection[0]);
+ for (var i=0; i<startArrowDependants.length; i++){
+ var target = document.getElementById(startArrowDependants[i]);
+ var arrowIndex=recallArray(arrowArr,startArrowDependants[i]);
+ if(target.getAttribute('direction')=='right'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(nodeArr[nodeIndex][6])- parseFloat(arrowArr[arrowIndex][3]))-25;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 75,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ else if(target.getAttribute('direction')=='left'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(arrowArr[arrowIndex][6]) - parseFloat(nodeArr[nodeIndex][3])) - 37;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 0,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ //TEMP YELLOW COLOR
+ document.getElementById(target.id).style.background = "rgba(255,255,0,.30)"; //Yellow
+ }
+ for (var i=0; i<endArrowDependants.length; i++){
+ var target = document.getElementById(endArrowDependants[i]);
+ var arrowIndex=recallArray(arrowArr,endArrowDependants[i]);
+ if(target.getAttribute('direction')=='left'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(nodeArr[nodeIndex][6]) - parseFloat(arrowArr[arrowIndex][3]))-25;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 75,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ else if(target.getAttribute('direction')=='right'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(arrowArr[arrowIndex][6]) - parseFloat(nodeArr[nodeIndex][3])) - 37;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 0,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ //TEMP YELLOW COLOR
+ document.getElementById(target.id).style.background = "rgba(255,255,0,.30)"; //Yellow
+ }
+ //warning();
+
+}
+
+function shortenArrows (){
+ getStartArrowDependants(selection[0]);
+ getEndArrowDependants(selection[0]);
+ nodeIndex = recallArray(nodeArr,selection[0]);
+ for (var i=0; i<startArrowDependants.length; i++){
+ var target = document.getElementById(startArrowDependants[i]);
+ var arrowIndex=recallArray(arrowArr,startArrowDependants[i]);
+ if(target.getAttribute('direction')=='right'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(nodeArr[nodeIndex][6])- parseFloat(arrowArr[arrowIndex][3]))-25;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 160,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ //TEMP YELLOW COLOR
+ document.getElementById(target.id).style.background = "rgba(255,255,0,.30)"; //Yellow
+ }
+ for (var i=0; i<endArrowDependants.length; i++){
+ var target = document.getElementById(endArrowDependants[i]);
+ var arrowIndex=recallArray(arrowArr,endArrowDependants[i]);
+ if(target.getAttribute('direction')=='left'){
+ var newWide = parseFloat(target.style.width) - (parseFloat(nodeArr[nodeIndex][6]) - parseFloat(arrowArr[arrowIndex][3]))-25;
+ $("#"+target.id).width(newWide);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + 160,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + 0;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr,target.id);
+ }
+ //TEMP YELLOW COLOR
+ document.getElementById(target.id).style.background = "rgba(255,255,0,.30)"; //Yellow
+ }
+ //warning();
+}
+
+function spawnChild() {
+ index = recallArray("node",selection[0]);
+ maxX = calcChildren(selection[0]);
+ bootbox.prompt({
+ closeButton:false,backdrop:true,animate:false,
+ size:'small',
+ title: "Add Node",
+ value:"add text here",
+ placeholder: "add text here",
+ callback: function(result) {
+ if (result != null) {
+ //EXECUTE THIS ON OKAY///
+ var text=result;
+ pushToDict(text, "node");
+
+ var nodeHeight = $('.drag-1').height(); //DOES NOT WORK
+ var nodeHeight = 36; //FIXES THE PROBLEM, DOES NOT ALLOW RESIZE
+ nodeHeightCorrected = nodeHeight+16;
+
+ var gridHeight = document.getElementById('grid').clientHeight;
+ var gridHeightCorrected = gridHeight - 90;
+ var id=guid();
+ var lX=maxX+160; //Shifts left
+ //var lX=rX-100; Shifts Right
+ var lY=22;
+ var wide=100;
+ var tag = '<div class="nodeDraggable drag-drop drag-1 child can-drop placed verticallyScrollable belongsToNode" '+
+ 'id=' + id + ' data_x="' +lX+ '" data_y="' +lY+ '"' +
+ 'style="transform: translate(' + lX + 'px, ' + lY + 'px); -webkit-transform: translate(' + lX + 'px, ' + lY + 'px);">' +
+ '<div class="nodeText nodeEllipsis">'+ text +'</div>'+
+ '<div class="verticalLine" style="top:'+nodeHeightCorrected+'px;height:'+gridHeightCorrected+'px;"></div>'+
+ '</div>';
+
+ var dropOffLocation = document.getElementById("nodeChildrenDroppedOffHere");
+ dropOffLocation.innerHTML += tag;
+ index = nodeArr.push([document.getElementById(id),id,text,parseInt(lX),parseInt(lY),wide,parseInt(lX)+parseInt(wide),parseInt(lY)]);
+
+ document.getElementById(id).classList.add('placed');
+ document.getElementById(id).classList.add('verticallyScrollable');
+ nodeArr[index-1][8] = selection[0];
+ /////////////////////////
+ }
+ }
+ });
+ $("#box").autocomplete({
+ source: nodeTags,
+ autoFocus: true,
+ delay: 0
+ });
+}
+
+var childrenIDs = []
+function calcChildren (uuid) {
+ childrenIDs.length=0;
+ if ($("#"+uuid).hasClass('hasNodes')){
+ index = recallArray(nodeArr,uuid);
+ var maxX = nodeArr[index][3]-160;
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][1]==uuid){
+ continue;
+ }
+ if (nodeArr[i][3]>=nodeArr[index][3] && nodeArr[i][3]<=nodeArr[index][6] && $("#"+uuid).hasClass('expanded')) {
+ childrenIDs.push(nodeArr[i][1]);
+ if (nodeArr[i][3]>maxX){
+ maxX = nodeArr[i][3];
+ }
+ nodeArr[i][8] = uuid;
+ }
+ if (nodeArr[i][3]>=nodeArr[index][3] && nodeArr[i][3]<=nodeArr[index][6] && $("#"+uuid).hasClass('collapsed') && $('#'+nodeArr[i][1]).css('display')=='none') {
+ childrenIDs.push(nodeArr[i][1]);
+ if (nodeArr[i][3]>maxX){
+ maxX = nodeArr[i][3];
+ }
+ nodeArr[i][8] = uuid;
+ }
+ }
+ if (nodeArr[index][8] == null){
+ nodeArr[index][8] = 0;
+ }
+ nodeArr[index].splice(9,1,childrenIDs.slice(0));
+
+ return maxX
+ }
+}
+function calcParent (uuid) {
+ index = recallArray(nodeArr,uuid);
+ var passed=false;
+ for (var i=0;i<nodeArr.length; i++){
+ if(nodeArr[i][1] == uuid){
+ continue;
+ }
+ if ($("#"+nodeArr[i][1]).hasClass('hasNodes')){
+ if (nodeArr[index][3]>=nodeArr[i][3] && nodeArr[index][3]<=nodeArr[i][6] && $("#"+nodeArr[i][1]).hasClass('expanded')) {
+ nodeArr[index][8] = nodeArr[i][1];
+ passed = true;
+ $("#"+nodeArr[index][1]).addClass('belongsToNode');
+ }
+ }
+ }
+ if (passed == false){
+ nodeArr[index][8] = 0;
+ $("#"+nodeArr[index][1]).removeClass('belongsToNode');
+ }
+}
+function getChildren (uuid) {
+ childrenIDs.length=0;
+ if ($("#"+uuid).hasClass('hasNodes')){
+ index = recallArray(nodeArr,uuid);
+ var maxX = nodeArr[index][3]-160;
+ for (var i=0; i<nodeArr.length; i++){
+ if (nodeArr[i][8] == uuid){
+ childrenIDs.push(nodeArr[i][1]);
+ }
+ }
+ return maxX
+ }
+}
+
+function makeGroup () {
+ bootbox.prompt({
+ closeButton:false,backdrop:true,animate:false,
+ size:'small',
+ title: "Create Group",
+ value:"add text here",
+ placeholder: "add text here",
+ callback: function(result) {
+ if (result != null) {
+ //EXECUTE THIS ON OKAY///
+ for (var k = selection.length-1; k>=0; k--){
+ for (var m = 1; m<=k; m++){
+ if (parseInt(document.getElementById(selection[m-1]).getAttribute("data_x"))>parseInt(document.getElementById(selection[m]).getAttribute("data_x"))) {
+ var swap = selection[m];
+ selection[m] = selection[m-1];
+ selection[m-1] = swap;
+ }
+ }
+ }
+
+ //Find min and max x values to allocate for blank spaces
+ var xVals = [];
+ for (var i=0; i<selection.length; i++){
+ xVals.push(document.getElementById(selection[i]).getAttribute("data_x"));
+ }
+ var minX = Math.min.apply(null,xVals);
+ var maxX = Math.max.apply(null,xVals);
+
+ clone = document.getElementById(selection[0]).cloneNode(true);
+ var dropOffLocation = document.getElementById("nodeChildrenDroppedOffHere");
+ var clone = dropOffLocation.insertBefore(clone,dropOffLocation.parentNodes);
+ clone.id = guid();
+ $('#'+clone.id).removeClass('selected');
+ nodeArr.push([clone,clone.id]);
+ storeXY(nodeArr,clone.id);
+ storeText (nodeArr,clone.id,result)
+ //change below line to selection.length if you want to eliminate blank spaces
+ for (var i=0; i<(maxX+100-minX)/160; i++){
+ addChildrenToGroup(clone.id);
+ if ($("#"+clone.id).hasClass("hasNodes")==false){ //first time
+ $("#"+clone.id).addClass("hasNodes");
+ $("#"+clone.id).addClass("expanded");
+ document.getElementById(clone.id).style.zIndex = 9980;
+ //document.getElementById(clone.id).style.zIndex = document.getElementById(uuid).style.zIndex - 10;
+ }
+ }
+ clearSelection();
+ /////////////////////////
+ }
+ }
+ });
+ $("#box").autocomplete({
+ source: nodeTags,
+ autoFocus: true,
+ delay: 0
+ });
+}
+
+
+function shiftDown (event,dy) {
+ target = event.target.offsetParent.parentElement
+ var wide = parseInt(target.style.width);
+ //newHeight = $("#contextMenuID").height()-1;
+ //$("#contextMenuID").height(newHeight);
+ target.style.width = parseInt(wide-1) + 'px';
+ var allDependants = [];
+ for (var i = 0; i<selection.length; i++){
+ getStartArrowDependants(selection[i]);
+ getEndArrowDependants(selection[i]);
+ nodeDependants = startArrowDependants.concat(endArrowDependants);
+ allDependants = allDependants.concat(nodeDependants);
+ }
+ for (var a = 0; a<allDependants.length; a++){
+ for (var b = a+1; b<allDependants.length;b++){
+ if(allDependants[a]===allDependants[b])
+ allDependants.splice(b--,1);
+ }
+ }
+ if (dy<0) {
+ var minY = document.getElementById(allDependants[0]).getAttribute('data_y');
+ for (var i=1; i<allDependants.length; i++){
+ if (document.getElementById(allDependants[i]).getAttribute('data_y')<minY){
+ minY = document.getElementById(allDependants[i]).getAttribute('data_y');
+ }
+ }
+ if (minY<=102){
+ return;
+ }
+ }
+ for (var j=0; j<allDependants.length; j++){
+ x = document.getElementById(allDependants[j]).getAttribute('data_x');
+ y = document.getElementById(allDependants[j]).getAttribute('data_y');
+ y = parseInt(y) + parseInt(dy) * 42
+
+ document.getElementById(allDependants[j]).style.webkitTransform =
+ document.getElementById(allDependants[j]).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ document.getElementById(allDependants[j]).setAttribute('data_y',y);
+
+ storeXY(arrowArr,allDependants[j]);
+ }
+}
+
+//ARROW CONTEXT MENU
+$(function(){
+ $.contextMenu({
+ selector: '.arrowPlaced',
+ callback: function(key, options) {
+ var m = "clicked: " + key;
+ window.console && console.log(m) || alert(m);
+ },
+ animation: {
+ duration: 100,show: "show", hide: "hide"
+ },
+ items: {
+ "edit": {
+ name: "Edit",
+ icon: "edit",
+ callback: function(key, options) {
+ renameArrow(this[0].id);
+ }
+ },
+ /*"cut": {
+ name: "Cut",
+ icon: "cut",
+ callback: function(key, options) {
+ clipboard.length = 0;
+ for (var i = 0; i<arrowArr.length; i++){
+ if (arrowArr[i][1] == this[0].id) {
+ clipboard.push(arrowArr[i]);
+ arrowArr.splice(i,1);
+ break;
+ }
+ }
+ this[0].parentNode.removeChild(this[0]);
+ }
+ },
+ "copy": {
+ name: "Copy",
+ icon: "copy",
+ callback: function(key, options) {
+ clipboard.length = 0;
+ for (var i = 0; i<nodeArr.length; i++){
+ if (arrowArr[i][1] == this[0].id) {
+ clipboard.push(arrowArr[i]);
+ break;
+ }
+ }
+ }
+ },
+ "paste": {
+ name: "Paste",
+ icon: "paste",
+ callback: function(key, options) {
+ var transposeX = Math.round((event.x)/160)*160-70;
+ var transposeY = 22;
+ storeArray("nodeArr", i, guid(), clipboard[0][2], transposeX, transposeY, clipboard[0][5],null, null);
+ }
+ },*/
+ "delete": {
+ name: "Delete",
+ icon: "delete",
+ callback: function(key, options) {
+ for (var i = 0; i<arrowArr.length; i++){
+ if (arrowArr[i][1] == this[0].id) {
+ deletedArrows.push(arrowArr[i]);
+ arrowArr.splice(i,1);
+ break;
+ }
+ }
+ this[0].parentNode.removeChild(this[0]);
+ }
+ }/*,
+
+ "sep1": "---------",
+ "quit": {
+ name: "Quit",
+ icon: "quit"}
+*/
+
+ }
+ });
+
+ $('.arrowPlaced').on('click', function(e){
+ console.log('clicked', this);
+ })
+});
+
+//TRASH CONTEXT MENU
+$(function(){
+ $.contextMenu({
+ selector: '.trash',
+ callback: function(key, options) {
+ var m = "clicked: " + key;
+ window.console && console.log(m) || alert(m);
+ },
+ animation: {
+ duration: 100,show: "show", hide: "hide"
+ },
+ items: {
+ "emptyTrash": {
+ name: "Empty Trash",
+ icon: "emptyTrash",
+ disabled: function(key, opt) {
+ if (deletedNodes.length + deletedArrows.length + deletedNotes.length == 0){
+ isEnabled = true;
+ }
+ else {
+ isEnabled = false;
+ }
+ return isEnabled
+ },
+ callback: function(key, options) {
+ bootbox.confirm({
+ size:'small',
+ message:"<img src='triangle.png' height=15 width=15 style='margin-right:10px'>***This will empty the trash***",
+ callback: function(result){
+ if (result == true){
+ deletedNodes.length = 0;
+ deletedArrows.length = 0;
+ deletedNotes.length = 0;
+ document.getElementById("trash").src = "../images/trashCan.gif";
+ }
+ }
+ });
+ }
+ },
+ "sep1": "---------",
+ "quit": {
+ name: "Quit",
+ icon: "quit"}
+ }
+ });
+
+ $('.trash').on('click', function(e){
+ console.log('clicked', this);
+ })
+}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/Blob.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/Blob.js
new file mode 100644
index 0000000..b4dda85
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/Blob.js
@@ -0,0 +1,211 @@
+/* Blob.js
+ * A Blob implementation.
+ * 2014-07-24
+ *
+ * By Eli Grey, http://eligrey.com
+ * By Devin Samarin, https://github.com/dsamarin
+ * License: X11/MIT
+ * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
+ */
+
+/*global self, unescape */
+/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
+ plusplus: true */
+
+/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
+
+(function (view) {
+ "use strict";
+
+ view.URL = view.URL || view.webkitURL;
+
+ if (view.Blob && view.URL) {
+ try {
+ new Blob;
+ return;
+ } catch (e) {}
+ }
+
+ // Internally we use a BlobBuilder implementation to base Blob off of
+ // in order to support older browsers that only have BlobBuilder
+ var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
+ var
+ get_class = function(object) {
+ return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
+ }
+ , FakeBlobBuilder = function BlobBuilder() {
+ this.data = [];
+ }
+ , FakeBlob = function Blob(data, type, encoding) {
+ this.data = data;
+ this.size = data.length;
+ this.type = type;
+ this.encoding = encoding;
+ }
+ , FBB_proto = FakeBlobBuilder.prototype
+ , FB_proto = FakeBlob.prototype
+ , FileReaderSync = view.FileReaderSync
+ , FileException = function(type) {
+ this.code = this[this.name = type];
+ }
+ , file_ex_codes = (
+ "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+ + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
+ ).split(" ")
+ , file_ex_code = file_ex_codes.length
+ , real_URL = view.URL || view.webkitURL || view
+ , real_create_object_URL = real_URL.createObjectURL
+ , real_revoke_object_URL = real_URL.revokeObjectURL
+ , URL = real_URL
+ , btoa = view.btoa
+ , atob = view.atob
+
+ , ArrayBuffer = view.ArrayBuffer
+ , Uint8Array = view.Uint8Array
+
+ , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
+ ;
+ FakeBlob.fake = FB_proto.fake = true;
+ while (file_ex_code--) {
+ FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
+ }
+ // Polyfill URL
+ if (!real_URL.createObjectURL) {
+ URL = view.URL = function(uri) {
+ var
+ uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
+ , uri_origin
+ ;
+ uri_info.href = uri;
+ if (!("origin" in uri_info)) {
+ if (uri_info.protocol.toLowerCase() === "data:") {
+ uri_info.origin = null;
+ } else {
+ uri_origin = uri.match(origin);
+ uri_info.origin = uri_origin && uri_origin[1];
+ }
+ }
+ return uri_info;
+ };
+ }
+ URL.createObjectURL = function(blob) {
+ var
+ type = blob.type
+ , data_URI_header
+ ;
+ if (type === null) {
+ type = "application/octet-stream";
+ }
+ if (blob instanceof FakeBlob) {
+ data_URI_header = "data:" + type;
+ if (blob.encoding === "base64") {
+ return data_URI_header + ";base64," + blob.data;
+ } else if (blob.encoding === "URI") {
+ return data_URI_header + "," + decodeURIComponent(blob.data);
+ } if (btoa) {
+ return data_URI_header + ";base64," + btoa(blob.data);
+ } else {
+ return data_URI_header + "," + encodeURIComponent(blob.data);
+ }
+ } else if (real_create_object_URL) {
+ return real_create_object_URL.call(real_URL, blob);
+ }
+ };
+ URL.revokeObjectURL = function(object_URL) {
+ if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
+ real_revoke_object_URL.call(real_URL, object_URL);
+ }
+ };
+ FBB_proto.append = function(data/*, endings*/) {
+ var bb = this.data;
+ // decode data to a binary string
+ if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
+ var
+ str = ""
+ , buf = new Uint8Array(data)
+ , i = 0
+ , buf_len = buf.length
+ ;
+ for (; i < buf_len; i++) {
+ str += String.fromCharCode(buf[i]);
+ }
+ bb.push(str);
+ } else if (get_class(data) === "Blob" || get_class(data) === "File") {
+ if (FileReaderSync) {
+ var fr = new FileReaderSync;
+ bb.push(fr.readAsBinaryString(data));
+ } else {
+ // async FileReader won't work as BlobBuilder is sync
+ throw new FileException("NOT_READABLE_ERR");
+ }
+ } else if (data instanceof FakeBlob) {
+ if (data.encoding === "base64" && atob) {
+ bb.push(atob(data.data));
+ } else if (data.encoding === "URI") {
+ bb.push(decodeURIComponent(data.data));
+ } else if (data.encoding === "raw") {
+ bb.push(data.data);
+ }
+ } else {
+ if (typeof data !== "string") {
+ data += ""; // convert unsupported types to strings
+ }
+ // decode UTF-16 to binary string
+ bb.push(unescape(encodeURIComponent(data)));
+ }
+ };
+ FBB_proto.getBlob = function(type) {
+ if (!arguments.length) {
+ type = null;
+ }
+ return new FakeBlob(this.data.join(""), type, "raw");
+ };
+ FBB_proto.toString = function() {
+ return "[object BlobBuilder]";
+ };
+ FB_proto.slice = function(start, end, type) {
+ var args = arguments.length;
+ if (args < 3) {
+ type = null;
+ }
+ return new FakeBlob(
+ this.data.slice(start, args > 1 ? end : this.data.length)
+ , type
+ , this.encoding
+ );
+ };
+ FB_proto.toString = function() {
+ return "[object Blob]";
+ };
+ FB_proto.close = function() {
+ this.size = 0;
+ delete this.data;
+ };
+ return FakeBlobBuilder;
+ }(view));
+
+ view.Blob = function(blobParts, options) {
+ var type = options ? (options.type || "") : "";
+ var builder = new BlobBuilder();
+ if (blobParts) {
+ for (var i = 0, len = blobParts.length; i < len; i++) {
+ if (Uint8Array && blobParts[i] instanceof Uint8Array) {
+ builder.append(blobParts[i].buffer);
+ }
+ else {
+ builder.append(blobParts[i]);
+ }
+ }
+ }
+ var blob = builder.getBlob(type);
+ if (!blob.slice && blob.webkitSlice) {
+ blob.slice = blob.webkitSlice;
+ }
+ return blob;
+ };
+
+ var getPrototypeOf = Object.getPrototypeOf || function(object) {
+ return object.__proto__;
+ };
+ view.Blob.prototype = getPrototypeOf(new view.Blob());
+}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/base64.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/base64.js
new file mode 100644
index 0000000..7d9536a
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/base64.js
@@ -0,0 +1,143 @@
+
+/**
+*
+* Base64 encode / decode
+* http://www.webtoolkit.info/
+*
+**/
+
+var Base64 = {
+
+ // private property
+ _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
+
+ // public method for encoding
+ encode : function (input) {
+ var output = "";
+ var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ input = Base64._utf8_encode(input);
+
+ while (i < input.length) {
+
+ chr1 = input.charCodeAt(i++);
+ chr2 = input.charCodeAt(i++);
+ chr3 = input.charCodeAt(i++);
+
+ enc1 = chr1 >> 2;
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+ enc4 = chr3 & 63;
+
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
+
+ output = output +
+ this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
+ this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
+
+ }
+
+ return output;
+ },
+
+ // public method for decoding
+ decode : function (input) {
+ var output = "";
+ var chr1, chr2, chr3;
+ var enc1, enc2, enc3, enc4;
+ var i = 0;
+
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+
+ while (i < input.length) {
+
+ enc1 = this._keyStr.indexOf(input.charAt(i++));
+ enc2 = this._keyStr.indexOf(input.charAt(i++));
+ enc3 = this._keyStr.indexOf(input.charAt(i++));
+ enc4 = this._keyStr.indexOf(input.charAt(i++));
+
+ chr1 = (enc1 << 2) | (enc2 >> 4);
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+ chr3 = ((enc3 & 3) << 6) | enc4;
+
+ output = output + String.fromCharCode(chr1);
+
+ if (enc3 != 64) {
+ output = output + String.fromCharCode(chr2);
+ }
+ if (enc4 != 64) {
+ output = output + String.fromCharCode(chr3);
+ }
+
+ }
+
+ output = Base64._utf8_decode(output);
+
+ return output;
+
+ },
+
+ // private method for UTF-8 encoding
+ _utf8_encode : function (string) {
+ string = string.replace(/\r\n/g,"\n");
+ var utftext = "";
+
+ for (var n = 0; n < string.length; n++) {
+
+ var c = string.charCodeAt(n);
+
+ if (c < 128) {
+ utftext += String.fromCharCode(c);
+ }
+ else if((c > 127) && (c < 2048)) {
+ utftext += String.fromCharCode((c >> 6) | 192);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+ else {
+ utftext += String.fromCharCode((c >> 12) | 224);
+ utftext += String.fromCharCode(((c >> 6) & 63) | 128);
+ utftext += String.fromCharCode((c & 63) | 128);
+ }
+
+ }
+
+ return utftext;
+ },
+
+ // private method for UTF-8 decoding
+ _utf8_decode : function (utftext) {
+ var string = "";
+ var i = 0;
+ var c = c1 = c2 = 0;
+
+ while ( i < utftext.length ) {
+
+ c = utftext.charCodeAt(i);
+
+ if (c < 128) {
+ string += String.fromCharCode(c);
+ i++;
+ }
+ else if((c > 191) && (c < 224)) {
+ c2 = utftext.charCodeAt(i+1);
+ string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
+ i += 2;
+ }
+ else {
+ c2 = utftext.charCodeAt(i+1);
+ c3 = utftext.charCodeAt(i+2);
+ string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
+ i += 3;
+ }
+
+ }
+
+ return string;
+ }
+
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/interact.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/interact.js
new file mode 100644
index 0000000..f11140d
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/interact.js
@@ -0,0 +1,5963 @@
+/**
+ * interact.js v1.2.4
+ *
+ * Copyright (c) 2012-2015 Taye Adeyemi <dev@taye.me>
+ * Open source under the MIT License.
+ * https://raw.github.com/taye/interact.js/master/LICENSE
+ */
+(function (realWindow) {
+ 'use strict';
+
+ var // get wrapped window if using Shadow DOM polyfill
+ window = (function () {
+ // create a TextNode
+ var el = realWindow.document.createTextNode('');
+
+ // check if it's wrapped by a polyfill
+ if (el.ownerDocument !== realWindow.document
+ && typeof realWindow.wrap === 'function'
+ && realWindow.wrap(el) === el) {
+ // return wrapped window
+ return realWindow.wrap(realWindow);
+ }
+
+ // no Shadow DOM polyfil or native implementation
+ return realWindow;
+ }()),
+
+ document = window.document,
+ DocumentFragment = window.DocumentFragment || blank,
+ SVGElement = window.SVGElement || blank,
+ SVGSVGElement = window.SVGSVGElement || blank,
+ SVGElementInstance = window.SVGElementInstance || blank,
+ HTMLElement = window.HTMLElement || window.Element,
+
+ PointerEvent = (window.PointerEvent || window.MSPointerEvent),
+ pEventTypes,
+
+ hypot = Math.hypot || function (x, y) { return Math.sqrt(x * x + y * y); },
+
+ tmpXY = {}, // reduce object creation in getXY()
+
+ documents = [], // all documents being listened to
+
+ interactables = [], // all set interactables
+ interactions = [], // all interactions
+
+ dynamicDrop = false,
+
+ // {
+ // type: {
+ // selectors: ['selector', ...],
+ // contexts : [document, ...],
+ // listeners: [[listener, useCapture], ...]
+ // }
+ // }
+ delegatedEvents = {},
+
+ defaultOptions = {
+ base: {
+ accept : null,
+ actionChecker : null,
+ styleCursor : true,
+ preventDefault: 'auto',
+ origin : { x: 0, y: 0 },
+ deltaSource : 'page',
+ allowFrom : null,
+ ignoreFrom : null,
+ _context : document,
+ dropChecker : null
+ },
+
+ drag: {
+ enabled: false,
+ manualStart: true,
+ max: Infinity,
+ maxPerElement: 1,
+
+ snap: null,
+ restrict: null,
+ inertia: null,
+ autoScroll: null,
+
+ axis: 'xy',
+ },
+
+ drop: {
+ enabled: false,
+ accept: null,
+ overlap: 'pointer'
+ },
+
+ resize: {
+ enabled: false,
+ manualStart: false,
+ max: Infinity,
+ maxPerElement: 1,
+
+ snap: null,
+ restrict: null,
+ inertia: null,
+ autoScroll: null,
+
+ square: false,
+ axis: 'xy',
+
+ // object with props left, right, top, bottom which are
+ // true/false values to resize when the pointer is over that edge,
+ // CSS selectors to match the handles for each direction
+ // or the Elements for each handle
+ edges: null,
+
+ // a value of 'none' will limit the resize rect to a minimum of 0x0
+ // 'negate' will alow the rect to have negative width/height
+ // 'reposition' will keep the width/height positive by swapping
+ // the top and bottom edges and/or swapping the left and right edges
+ invert: 'none'
+ },
+
+ gesture: {
+ manualStart: false,
+ enabled: false,
+ max: Infinity,
+ maxPerElement: 1,
+
+ restrict: null
+ },
+
+ perAction: {
+ manualStart: false,
+ max: Infinity,
+ maxPerElement: 1,
+
+ snap: {
+ enabled : false,
+ endOnly : false,
+ range : Infinity,
+ targets : null,
+ offsets : null,
+
+ relativePoints: null
+ },
+
+ restrict: {
+ enabled: false,
+ endOnly: false
+ },
+
+ autoScroll: {
+ enabled : false,
+ container : null, // the item that is scrolled (Window or HTMLElement)
+ margin : 60,
+ speed : 300 // the scroll speed in pixels per second
+ },
+
+ inertia: {
+ enabled : false,
+ resistance : 10, // the lambda in exponential decay
+ minSpeed : 100, // target speed must be above this for inertia to start
+ endSpeed : 10, // the speed at which inertia is slow enough to stop
+ allowResume : true, // allow resuming an action in inertia phase
+ zeroResumeDelta : true, // if an action is resumed after launch, set dx/dy to 0
+ smoothEndDuration: 300 // animate to snap/restrict endOnly if there's no inertia
+ }
+ },
+
+ _holdDuration: 600
+ },
+
+ // Things related to autoScroll
+ autoScroll = {
+ interaction: null,
+ i: null, // the handle returned by window.setInterval
+ x: 0, y: 0, // Direction each pulse is to scroll in
+
+ // scroll the window by the values in scroll.x/y
+ scroll: function () {
+ var options = autoScroll.interaction.target.options[autoScroll.interaction.prepared.name].autoScroll,
+ container = options.container || getWindow(autoScroll.interaction.element),
+ now = new Date().getTime(),
+ // change in time in seconds
+ dt = (now - autoScroll.prevTime) / 1000,
+ // displacement
+ s = options.speed * dt;
+
+ if (s >= 1) {
+ if (isWindow(container)) {
+ container.scrollBy(autoScroll.x * s, autoScroll.y * s);
+ }
+ else if (container) {
+ container.scrollLeft += autoScroll.x * s;
+ container.scrollTop += autoScroll.y * s;
+ }
+
+ autoScroll.prevTime = now;
+ }
+
+ if (autoScroll.isScrolling) {
+ cancelFrame(autoScroll.i);
+ autoScroll.i = reqFrame(autoScroll.scroll);
+ }
+ },
+
+ edgeMove: function (event) {
+ var interaction,
+ target,
+ doAutoscroll = false;
+
+ for (var i = 0; i < interactions.length; i++) {
+ interaction = interactions[i];
+
+ if (interaction.interacting()
+ && checkAutoScroll(interaction.target, interaction.prepared.name)) {
+
+ target = interaction.target;
+ doAutoscroll = true;
+ break;
+ }
+ }
+
+ if (!doAutoscroll) { return; }
+
+ var top,
+ right,
+ bottom,
+ left,
+ options = target.options[interaction.prepared.name].autoScroll,
+ container = options.container || getWindow(interaction.element);
+
+ if (isWindow(container)) {
+ left = event.clientX < autoScroll.margin;
+ top = event.clientY < autoScroll.margin;
+ right = event.clientX > container.innerWidth - autoScroll.margin;
+ bottom = event.clientY > container.innerHeight - autoScroll.margin;
+ }
+ else {
+ var rect = getElementRect(container);
+
+ left = event.clientX < rect.left + autoScroll.margin;
+ top = event.clientY < rect.top + autoScroll.margin;
+ right = event.clientX > rect.right - autoScroll.margin;
+ bottom = event.clientY > rect.bottom - autoScroll.margin;
+ }
+
+ autoScroll.x = (right ? 1: left? -1: 0);
+ autoScroll.y = (bottom? 1: top? -1: 0);
+
+ if (!autoScroll.isScrolling) {
+ // set the autoScroll properties to those of the target
+ autoScroll.margin = options.margin;
+ autoScroll.speed = options.speed;
+
+ autoScroll.start(interaction);
+ }
+ },
+
+ isScrolling: false,
+ prevTime: 0,
+
+ start: function (interaction) {
+ autoScroll.isScrolling = true;
+ cancelFrame(autoScroll.i);
+
+ autoScroll.interaction = interaction;
+ autoScroll.prevTime = new Date().getTime();
+ autoScroll.i = reqFrame(autoScroll.scroll);
+ },
+
+ stop: function () {
+ autoScroll.isScrolling = false;
+ cancelFrame(autoScroll.i);
+ }
+ },
+
+ // Does the browser support touch input?
+ supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
+
+ // Does the browser support PointerEvents
+ supportsPointerEvent = !!PointerEvent,
+
+ // Less Precision with touch input
+ margin = supportsTouch || supportsPointerEvent? 20: 10,
+
+ pointerMoveTolerance = 1,
+
+ // for ignoring browser's simulated mouse events
+ prevTouchTime = 0,
+
+ // Allow this many interactions to happen simultaneously
+ maxInteractions = Infinity,
+
+ // Check if is IE9 or older
+ actionCursors = (document.all && !window.atob) ? {
+ drag : 'move',
+ resizex : 'e-resize',
+ resizey : 's-resize',
+ resizexy: 'se-resize',
+
+ resizetop : 'n-resize',
+ resizeleft : 'w-resize',
+ resizebottom : 's-resize',
+ resizeright : 'e-resize',
+ resizetopleft : 'se-resize',
+ resizebottomright: 'se-resize',
+ resizetopright : 'ne-resize',
+ resizebottomleft : 'ne-resize',
+
+ gesture : ''
+ } : {
+ drag : 'move',
+ resizex : 'ew-resize',
+ resizey : 'ns-resize',
+ resizexy: 'nwse-resize',
+
+ resizetop : 'ns-resize',
+ resizeleft : 'ew-resize',
+ resizebottom : 'ns-resize',
+ resizeright : 'ew-resize',
+ resizetopleft : 'nwse-resize',
+ resizebottomright: 'nwse-resize',
+ resizetopright : 'nesw-resize',
+ resizebottomleft : 'nesw-resize',
+
+ gesture : ''
+ },
+
+ actionIsEnabled = {
+ drag : true,
+ resize : true,
+ gesture: true
+ },
+
+ // because Webkit and Opera still use 'mousewheel' event type
+ wheelEvent = 'onmousewheel' in document? 'mousewheel': 'wheel',
+
+ eventTypes = [
+ 'dragstart',
+ 'dragmove',
+ 'draginertiastart',
+ 'dragend',
+ 'dragenter',
+ 'dragleave',
+ 'dropactivate',
+ 'dropdeactivate',
+ 'dropmove',
+ 'drop',
+ 'resizestart',
+ 'resizemove',
+ 'resizeinertiastart',
+ 'resizeend',
+ 'gesturestart',
+ 'gesturemove',
+ 'gestureinertiastart',
+ 'gestureend',
+
+ 'down',
+ 'move',
+ 'up',
+ 'cancel',
+ 'tap',
+ 'doubletap',
+ 'hold'
+ ],
+
+ globalEvents = {},
+
+ // Opera Mobile must be handled differently
+ isOperaMobile = navigator.appName == 'Opera' &&
+ supportsTouch &&
+ navigator.userAgent.match('Presto'),
+
+ // scrolling doesn't change the result of
+ // getBoundingClientRect/getClientRects on iOS <=7 but it does on iOS 8
+ isIOS7orLower = (/iP(hone|od|ad)/.test(navigator.platform)
+ && /OS [1-7][^\d]/.test(navigator.appVersion)),
+
+ // prefix matchesSelector
+ prefixedMatchesSelector = 'matches' in Element.prototype?
+ 'matches': 'webkitMatchesSelector' in Element.prototype?
+ 'webkitMatchesSelector': 'mozMatchesSelector' in Element.prototype?
+ 'mozMatchesSelector': 'oMatchesSelector' in Element.prototype?
+ 'oMatchesSelector': 'msMatchesSelector',
+
+ // will be polyfill function if browser is IE8
+ ie8MatchesSelector,
+
+ // native requestAnimationFrame or polyfill
+ reqFrame = realWindow.requestAnimationFrame,
+ cancelFrame = realWindow.cancelAnimationFrame,
+
+ // Events wrapper
+ events = (function () {
+ var useAttachEvent = ('attachEvent' in window) && !('addEventListener' in window),
+ addEvent = useAttachEvent? 'attachEvent': 'addEventListener',
+ removeEvent = useAttachEvent? 'detachEvent': 'removeEventListener',
+ on = useAttachEvent? 'on': '',
+
+ elements = [],
+ targets = [],
+ attachedListeners = [];
+
+ function add (element, type, listener, useCapture) {
+ var elementIndex = indexOf(elements, element),
+ target = targets[elementIndex];
+
+ if (!target) {
+ target = {
+ events: {},
+ typeCount: 0
+ };
+
+ elementIndex = elements.push(element) - 1;
+ targets.push(target);
+
+ attachedListeners.push((useAttachEvent ? {
+ supplied: [],
+ wrapped : [],
+ useCount: []
+ } : null));
+ }
+
+ if (!target.events[type]) {
+ target.events[type] = [];
+ target.typeCount++;
+ }
+
+ if (!contains(target.events[type], listener)) {
+ var ret;
+
+ if (useAttachEvent) {
+ var listeners = attachedListeners[elementIndex],
+ listenerIndex = indexOf(listeners.supplied, listener);
+
+ var wrapped = listeners.wrapped[listenerIndex] || function (event) {
+ if (!event.immediatePropagationStopped) {
+ event.target = event.srcElement;
+ event.currentTarget = element;
+
+ event.preventDefault = event.preventDefault || preventDef;
+ event.stopPropagation = event.stopPropagation || stopProp;
+ event.stopImmediatePropagation = event.stopImmediatePropagation || stopImmProp;
+
+ if (/mouse|click/.test(event.type)) {
+ event.pageX = event.clientX + getWindow(element).document.documentElement.scrollLeft;
+ event.pageY = event.clientY + getWindow(element).document.documentElement.scrollTop;
+ }
+
+ listener(event);
+ }
+ };
+
+ ret = element[addEvent](on + type, wrapped, Boolean(useCapture));
+
+ if (listenerIndex === -1) {
+ listeners.supplied.push(listener);
+ listeners.wrapped.push(wrapped);
+ listeners.useCount.push(1);
+ }
+ else {
+ listeners.useCount[listenerIndex]++;
+ }
+ }
+ else {
+ ret = element[addEvent](type, listener, useCapture || false);
+ }
+ target.events[type].push(listener);
+
+ return ret;
+ }
+ }
+
+ function remove (element, type, listener, useCapture) {
+ var i,
+ elementIndex = indexOf(elements, element),
+ target = targets[elementIndex],
+ listeners,
+ listenerIndex,
+ wrapped = listener;
+
+ if (!target || !target.events) {
+ return;
+ }
+
+ if (useAttachEvent) {
+ listeners = attachedListeners[elementIndex];
+ listenerIndex = indexOf(listeners.supplied, listener);
+ wrapped = listeners.wrapped[listenerIndex];
+ }
+
+ if (type === 'all') {
+ for (type in target.events) {
+ if (target.events.hasOwnProperty(type)) {
+ remove(element, type, 'all');
+ }
+ }
+ return;
+ }
+
+ if (target.events[type]) {
+ var len = target.events[type].length;
+
+ if (listener === 'all') {
+ for (i = 0; i < len; i++) {
+ remove(element, type, target.events[type][i], Boolean(useCapture));
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ if (target.events[type][i] === listener) {
+ element[removeEvent](on + type, wrapped, useCapture || false);
+ target.events[type].splice(i, 1);
+
+ if (useAttachEvent && listeners) {
+ listeners.useCount[listenerIndex]--;
+ if (listeners.useCount[listenerIndex] === 0) {
+ listeners.supplied.splice(listenerIndex, 1);
+ listeners.wrapped.splice(listenerIndex, 1);
+ listeners.useCount.splice(listenerIndex, 1);
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ if (target.events[type] && target.events[type].length === 0) {
+ target.events[type] = null;
+ target.typeCount--;
+ }
+ }
+
+ if (!target.typeCount) {
+ targets.splice(elementIndex);
+ elements.splice(elementIndex);
+ attachedListeners.splice(elementIndex);
+ }
+ }
+
+ function preventDef () {
+ this.returnValue = false;
+ }
+
+ function stopProp () {
+ this.cancelBubble = true;
+ }
+
+ function stopImmProp () {
+ this.cancelBubble = true;
+ this.immediatePropagationStopped = true;
+ }
+
+ return {
+ add: add,
+ remove: remove,
+ useAttachEvent: useAttachEvent,
+
+ _elements: elements,
+ _targets: targets,
+ _attachedListeners: attachedListeners
+ };
+ }());
+
+ function blank () {}
+
+ function isElement (o) {
+ if (!o || (typeof o !== 'object')) { return false; }
+
+ var _window = getWindow(o) || window;
+
+ return (/object|function/.test(typeof _window.Element)
+ ? o instanceof _window.Element //DOM2
+ : o.nodeType === 1 && typeof o.nodeName === "string");
+ }
+ function isWindow (thing) { return !!(thing && thing.Window) && (thing instanceof thing.Window); }
+ function isDocFrag (thing) { return !!thing && thing instanceof DocumentFragment; }
+ function isArray (thing) {
+ return isObject(thing)
+ && (typeof thing.length !== undefined)
+ && isFunction(thing.splice);
+ }
+ function isObject (thing) { return !!thing && (typeof thing === 'object'); }
+ function isFunction (thing) { return typeof thing === 'function'; }
+ function isNumber (thing) { return typeof thing === 'number' ; }
+ function isBool (thing) { return typeof thing === 'boolean' ; }
+ function isString (thing) { return typeof thing === 'string' ; }
+
+ function trySelector (value) {
+ if (!isString(value)) { return false; }
+
+ // an exception will be raised if it is invalid
+ document.querySelector(value);
+ return true;
+ }
+
+ function extend (dest, source) {
+ for (var prop in source) {
+ dest[prop] = source[prop];
+ }
+ return dest;
+ }
+
+ function copyCoords (dest, src) {
+ dest.page = dest.page || {};
+ dest.page.x = src.page.x;
+ dest.page.y = src.page.y;
+
+ dest.client = dest.client || {};
+ dest.client.x = src.client.x;
+ dest.client.y = src.client.y;
+
+ dest.timeStamp = src.timeStamp;
+ }
+
+ function setEventXY (targetObj, pointer, interaction) {
+ if (!pointer) {
+ if (interaction.pointerIds.length > 1) {
+ pointer = touchAverage(interaction.pointers);
+ }
+ else {
+ pointer = interaction.pointers[0];
+ }
+ }
+
+ getPageXY(pointer, tmpXY, interaction);
+ targetObj.page.x = tmpXY.x;
+ targetObj.page.y = tmpXY.y;
+
+ getClientXY(pointer, tmpXY, interaction);
+ targetObj.client.x = tmpXY.x;
+ targetObj.client.y = tmpXY.y;
+
+ targetObj.timeStamp = new Date().getTime();
+ }
+
+ function setEventDeltas (targetObj, prev, cur) {
+ targetObj.page.x = cur.page.x - prev.page.x;
+ targetObj.page.y = cur.page.y - prev.page.y;
+ targetObj.client.x = cur.client.x - prev.client.x;
+ targetObj.client.y = cur.client.y - prev.client.y;
+ targetObj.timeStamp = new Date().getTime() - prev.timeStamp;
+
+ // set pointer velocity
+ var dt = Math.max(targetObj.timeStamp / 1000, 0.001);
+ targetObj.page.speed = hypot(targetObj.page.x, targetObj.page.y) / dt;
+ targetObj.page.vx = targetObj.page.x / dt;
+ targetObj.page.vy = targetObj.page.y / dt;
+
+ targetObj.client.speed = hypot(targetObj.client.x, targetObj.page.y) / dt;
+ targetObj.client.vx = targetObj.client.x / dt;
+ targetObj.client.vy = targetObj.client.y / dt;
+ }
+
+ // Get specified X/Y coords for mouse or event.touches[0]
+ function getXY (type, pointer, xy) {
+ xy = xy || {};
+ type = type || 'page';
+
+ xy.x = pointer[type + 'X'];
+ xy.y = pointer[type + 'Y'];
+
+ return xy;
+ }
+
+ function getPageXY (pointer, page, interaction) {
+ page = page || {};
+
+ if (pointer instanceof InteractEvent) {
+ if (/inertiastart/.test(pointer.type)) {
+ interaction = interaction || pointer.interaction;
+
+ extend(page, interaction.inertiaStatus.upCoords.page);
+
+ page.x += interaction.inertiaStatus.sx;
+ page.y += interaction.inertiaStatus.sy;
+ }
+ else {
+ page.x = pointer.pageX;
+ page.y = pointer.pageY;
+ }
+ }
+ // Opera Mobile handles the viewport and scrolling oddly
+ else if (isOperaMobile) {
+ getXY('screen', pointer, page);
+
+ page.x += window.scrollX;
+ page.y += window.scrollY;
+ }
+ else {
+ getXY('page', pointer, page);
+ }
+
+ return page;
+ }
+
+ function getClientXY (pointer, client, interaction) {
+ client = client || {};
+
+ if (pointer instanceof InteractEvent) {
+ if (/inertiastart/.test(pointer.type)) {
+ extend(client, interaction.inertiaStatus.upCoords.client);
+
+ client.x += interaction.inertiaStatus.sx;
+ client.y += interaction.inertiaStatus.sy;
+ }
+ else {
+ client.x = pointer.clientX;
+ client.y = pointer.clientY;
+ }
+ }
+ else {
+ // Opera Mobile handles the viewport and scrolling oddly
+ getXY(isOperaMobile? 'screen': 'client', pointer, client);
+ }
+
+ return client;
+ }
+
+ function getScrollXY (win) {
+ win = win || window;
+ return {
+ x: win.scrollX || win.document.documentElement.scrollLeft,
+ y: win.scrollY || win.document.documentElement.scrollTop
+ };
+ }
+
+ function getPointerId (pointer) {
+ return isNumber(pointer.pointerId)? pointer.pointerId : pointer.identifier;
+ }
+
+ function getActualElement (element) {
+ return (element instanceof SVGElementInstance
+ ? element.correspondingUseElement
+ : element);
+ }
+
+ function getWindow (node) {
+ if (isWindow(node)) {
+ return node;
+ }
+
+ var rootNode = (node.ownerDocument || node);
+
+ return rootNode.defaultView || rootNode.parentWindow || window;
+ }
+
+ function getElementRect (element) {
+ var scroll = isIOS7orLower
+ ? { x: 0, y: 0 }
+ : getScrollXY(getWindow(element)),
+ clientRect = (element instanceof SVGElement)?
+ element.getBoundingClientRect():
+ element.getClientRects()[0];
+
+ return clientRect && {
+ left : clientRect.left + scroll.x,
+ right : clientRect.right + scroll.x,
+ top : clientRect.top + scroll.y,
+ bottom: clientRect.bottom + scroll.y,
+ width : clientRect.width || clientRect.right - clientRect.left,
+ height: clientRect.heigh || clientRect.bottom - clientRect.top
+ };
+ }
+
+ function getTouchPair (event) {
+ var touches = [];
+
+ // array of touches is supplied
+ if (isArray(event)) {
+ touches[0] = event[0];
+ touches[1] = event[1];
+ }
+ // an event
+ else {
+ if (event.type === 'touchend') {
+ if (event.touches.length === 1) {
+ touches[0] = event.touches[0];
+ touches[1] = event.changedTouches[0];
+ }
+ else if (event.touches.length === 0) {
+ touches[0] = event.changedTouches[0];
+ touches[1] = event.changedTouches[1];
+ }
+ }
+ else {
+ touches[0] = event.touches[0];
+ touches[1] = event.touches[1];
+ }
+ }
+
+ return touches;
+ }
+
+ function touchAverage (event) {
+ var touches = getTouchPair(event);
+
+ return {
+ pageX: (touches[0].pageX + touches[1].pageX) / 2,
+ pageY: (touches[0].pageY + touches[1].pageY) / 2,
+ clientX: (touches[0].clientX + touches[1].clientX) / 2,
+ clientY: (touches[0].clientY + touches[1].clientY) / 2
+ };
+ }
+
+ function touchBBox (event) {
+ if (!event.length && !(event.touches && event.touches.length > 1)) {
+ return;
+ }
+
+ var touches = getTouchPair(event),
+ minX = Math.min(touches[0].pageX, touches[1].pageX),
+ minY = Math.min(touches[0].pageY, touches[1].pageY),
+ maxX = Math.max(touches[0].pageX, touches[1].pageX),
+ maxY = Math.max(touches[0].pageY, touches[1].pageY);
+
+ return {
+ x: minX,
+ y: minY,
+ left: minX,
+ top: minY,
+ width: maxX - minX,
+ height: maxY - minY
+ };
+ }
+
+ function touchDistance (event, deltaSource) {
+ deltaSource = deltaSource || defaultOptions.deltaSource;
+
+ var sourceX = deltaSource + 'X',
+ sourceY = deltaSource + 'Y',
+ touches = getTouchPair(event);
+
+
+ var dx = touches[0][sourceX] - touches[1][sourceX],
+ dy = touches[0][sourceY] - touches[1][sourceY];
+
+ return hypot(dx, dy);
+ }
+
+ function touchAngle (event, prevAngle, deltaSource) {
+ deltaSource = deltaSource || defaultOptions.deltaSource;
+
+ var sourceX = deltaSource + 'X',
+ sourceY = deltaSource + 'Y',
+ touches = getTouchPair(event),
+ dx = touches[0][sourceX] - touches[1][sourceX],
+ dy = touches[0][sourceY] - touches[1][sourceY],
+ angle = 180 * Math.atan(dy / dx) / Math.PI;
+
+ if (isNumber(prevAngle)) {
+ var dr = angle - prevAngle,
+ drClamped = dr % 360;
+
+ if (drClamped > 315) {
+ angle -= 360 + (angle / 360)|0 * 360;
+ }
+ else if (drClamped > 135) {
+ angle -= 180 + (angle / 360)|0 * 360;
+ }
+ else if (drClamped < -315) {
+ angle += 360 + (angle / 360)|0 * 360;
+ }
+ else if (drClamped < -135) {
+ angle += 180 + (angle / 360)|0 * 360;
+ }
+ }
+
+ return angle;
+ }
+
+ function getOriginXY (interactable, element) {
+ var origin = interactable
+ ? interactable.options.origin
+ : defaultOptions.origin;
+
+ if (origin === 'parent') {
+ origin = parentElement(element);
+ }
+ else if (origin === 'self') {
+ origin = interactable.getRect(element);
+ }
+ else if (trySelector(origin)) {
+ origin = closest(element, origin) || { x: 0, y: 0 };
+ }
+
+ if (isFunction(origin)) {
+ origin = origin(interactable && element);
+ }
+
+ if (isElement(origin)) {
+ origin = getElementRect(origin);
+ }
+
+ origin.x = ('x' in origin)? origin.x : origin.left;
+ origin.y = ('y' in origin)? origin.y : origin.top;
+
+ return origin;
+ }
+
+ // http://stackoverflow.com/a/5634528/2280888
+ function _getQBezierValue(t, p1, p2, p3) {
+ var iT = 1 - t;
+ return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
+ }
+
+ function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
+ return {
+ x: _getQBezierValue(position, startX, cpX, endX),
+ y: _getQBezierValue(position, startY, cpY, endY)
+ };
+ }
+
+ // http://gizma.com/easing/
+ function easeOutQuad (t, b, c, d) {
+ t /= d;
+ return -c * t*(t-2) + b;
+ }
+
+ function nodeContains (parent, child) {
+ while (child) {
+ if (child === parent) {
+ return true;
+ }
+
+ child = child.parentNode;
+ }
+
+ return false;
+ }
+
+ function closest (child, selector) {
+ var parent = parentElement(child);
+
+ while (isElement(parent)) {
+ if (matchesSelector(parent, selector)) { return parent; }
+
+ parent = parentElement(parent);
+ }
+
+ return null;
+ }
+
+ function parentElement (node) {
+ var parent = node.parentNode;
+
+ if (isDocFrag(parent)) {
+ // skip past #shado-root fragments
+ while ((parent = parent.host) && isDocFrag(parent)) {}
+
+ return parent;
+ }
+
+ return parent;
+ }
+
+ function inContext (interactable, element) {
+ return interactable._context === element.ownerDocument
+ || nodeContains(interactable._context, element);
+ }
+
+ function testIgnore (interactable, interactableElement, element) {
+ var ignoreFrom = interactable.options.ignoreFrom;
+
+ if (!ignoreFrom || !isElement(element)) { return false; }
+
+ if (isString(ignoreFrom)) {
+ return matchesUpTo(element, ignoreFrom, interactableElement);
+ }
+ else if (isElement(ignoreFrom)) {
+ return nodeContains(ignoreFrom, element);
+ }
+
+ return false;
+ }
+
+ function testAllow (interactable, interactableElement, element) {
+ var allowFrom = interactable.options.allowFrom;
+
+ if (!allowFrom) { return true; }
+
+ if (!isElement(element)) { return false; }
+
+ if (isString(allowFrom)) {
+ return matchesUpTo(element, allowFrom, interactableElement);
+ }
+ else if (isElement(allowFrom)) {
+ return nodeContains(allowFrom, element);
+ }
+
+ return false;
+ }
+
+ function checkAxis (axis, interactable) {
+ if (!interactable) { return false; }
+
+ var thisAxis = interactable.options.drag.axis;
+
+ return (axis === 'xy' || thisAxis === 'xy' || thisAxis === axis);
+ }
+
+ function checkSnap (interactable, action) {
+ var options = interactable.options;
+
+ if (/^resize/.test(action)) {
+ action = 'resize';
+ }
+
+ return options[action].snap && options[action].snap.enabled;
+ }
+
+ function checkRestrict (interactable, action) {
+ var options = interactable.options;
+
+ if (/^resize/.test(action)) {
+ action = 'resize';
+ }
+
+ return options[action].restrict && options[action].restrict.enabled;
+ }
+
+ function checkAutoScroll (interactable, action) {
+ var options = interactable.options;
+
+ if (/^resize/.test(action)) {
+ action = 'resize';
+ }
+
+ return options[action].autoScroll && options[action].autoScroll.enabled;
+ }
+
+ function withinInteractionLimit (interactable, element, action) {
+ var options = interactable.options,
+ maxActions = options[action.name].max,
+ maxPerElement = options[action.name].maxPerElement,
+ activeInteractions = 0,
+ targetCount = 0,
+ targetElementCount = 0;
+
+ for (var i = 0, len = interactions.length; i < len; i++) {
+ var interaction = interactions[i],
+ otherAction = interaction.prepared.name,
+ active = interaction.interacting();
+
+ if (!active) { continue; }
+
+ activeInteractions++;
+
+ if (activeInteractions >= maxInteractions) {
+ return false;
+ }
+
+ if (interaction.target !== interactable) { continue; }
+
+ targetCount += (otherAction === action.name)|0;
+
+ if (targetCount >= maxActions) {
+ return false;
+ }
+
+ if (interaction.element === element) {
+ targetElementCount++;
+
+ if (otherAction !== action.name || targetElementCount >= maxPerElement) {
+ return false;
+ }
+ }
+ }
+
+ return maxInteractions > 0;
+ }
+
+ // Test for the element that's "above" all other qualifiers
+ function indexOfDeepestElement (elements) {
+ var dropzone,
+ deepestZone = elements[0],
+ index = deepestZone? 0: -1,
+ parent,
+ deepestZoneParents = [],
+ dropzoneParents = [],
+ child,
+ i,
+ n;
+
+ for (i = 1; i < elements.length; i++) {
+ dropzone = elements[i];
+
+ // an element might belong to multiple selector dropzones
+ if (!dropzone || dropzone === deepestZone) {
+ continue;
+ }
+
+ if (!deepestZone) {
+ deepestZone = dropzone;
+ index = i;
+ continue;
+ }
+
+ // check if the deepest or current are document.documentElement or document.rootElement
+ // - if the current dropzone is, do nothing and continue
+ if (dropzone.parentNode === dropzone.ownerDocument) {
+ continue;
+ }
+ // - if deepest is, update with the current dropzone and continue to next
+ else if (deepestZone.parentNode === dropzone.ownerDocument) {
+ deepestZone = dropzone;
+ index = i;
+ continue;
+ }
+
+ if (!deepestZoneParents.length) {
+ parent = deepestZone;
+ while (parent.parentNode && parent.parentNode !== parent.ownerDocument) {
+ deepestZoneParents.unshift(parent);
+ parent = parent.parentNode;
+ }
+ }
+
+ // if this element is an svg element and the current deepest is
+ // an HTMLElement
+ if (deepestZone instanceof HTMLElement
+ && dropzone instanceof SVGElement
+ && !(dropzone instanceof SVGSVGElement)) {
+
+ if (dropzone === deepestZone.parentNode) {
+ continue;
+ }
+
+ parent = dropzone.ownerSVGElement;
+ }
+ else {
+ parent = dropzone;
+ }
+
+ dropzoneParents = [];
+
+ while (parent.parentNode !== parent.ownerDocument) {
+ dropzoneParents.unshift(parent);
+ parent = parent.parentNode;
+ }
+
+ n = 0;
+
+ // get (position of last common ancestor) + 1
+ while (dropzoneParents[n] && dropzoneParents[n] === deepestZoneParents[n]) {
+ n++;
+ }
+
+ var parents = [
+ dropzoneParents[n - 1],
+ dropzoneParents[n],
+ deepestZoneParents[n]
+ ];
+
+ child = parents[0].lastChild;
+
+ while (child) {
+ if (child === parents[1]) {
+ deepestZone = dropzone;
+ index = i;
+ deepestZoneParents = [];
+
+ break;
+ }
+ else if (child === parents[2]) {
+ break;
+ }
+
+ child = child.previousSibling;
+ }
+ }
+
+ return index;
+ }
+
+ function Interaction () {
+ this.target = null; // current interactable being interacted with
+ this.element = null; // the target element of the interactable
+ this.dropTarget = null; // the dropzone a drag target might be dropped into
+ this.dropElement = null; // the element at the time of checking
+ this.prevDropTarget = null; // the dropzone that was recently dragged away from
+ this.prevDropElement = null; // the element at the time of checking
+
+ this.prepared = { // action that's ready to be fired on next move event
+ name : null,
+ axis : null,
+ edges: null
+ };
+
+ this.matches = []; // all selectors that are matched by target element
+ this.matchElements = []; // corresponding elements
+
+ this.inertiaStatus = {
+ active : false,
+ smoothEnd : false,
+
+ startEvent: null,
+ upCoords: {},
+
+ xe: 0, ye: 0,
+ sx: 0, sy: 0,
+
+ t0: 0,
+ vx0: 0, vys: 0,
+ duration: 0,
+
+ resumeDx: 0,
+ resumeDy: 0,
+
+ lambda_v0: 0,
+ one_ve_v0: 0,
+ i : null
+ };
+
+ if (isFunction(Function.prototype.bind)) {
+ this.boundInertiaFrame = this.inertiaFrame.bind(this);
+ this.boundSmoothEndFrame = this.smoothEndFrame.bind(this);
+ }
+ else {
+ var that = this;
+
+ this.boundInertiaFrame = function () { return that.inertiaFrame(); };
+ this.boundSmoothEndFrame = function () { return that.smoothEndFrame(); };
+ }
+
+ this.activeDrops = {
+ dropzones: [], // the dropzones that are mentioned below
+ elements : [], // elements of dropzones that accept the target draggable
+ rects : [] // the rects of the elements mentioned above
+ };
+
+ // keep track of added pointers
+ this.pointers = [];
+ this.pointerIds = [];
+ this.downTargets = [];
+ this.downTimes = [];
+ this.holdTimers = [];
+
+ // Previous native pointer move event coordinates
+ this.prevCoords = {
+ page : { x: 0, y: 0 },
+ client : { x: 0, y: 0 },
+ timeStamp: 0
+ };
+ // current native pointer move event coordinates
+ this.curCoords = {
+ page : { x: 0, y: 0 },
+ client : { x: 0, y: 0 },
+ timeStamp: 0
+ };
+
+ // Starting InteractEvent pointer coordinates
+ this.startCoords = {
+ page : { x: 0, y: 0 },
+ client : { x: 0, y: 0 },
+ timeStamp: 0
+ };
+
+ // Change in coordinates and time of the pointer
+ this.pointerDelta = {
+ page : { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
+ client : { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
+ timeStamp: 0
+ };
+
+ this.downEvent = null; // pointerdown/mousedown/touchstart event
+ this.downPointer = {};
+
+ this._eventTarget = null;
+ this._curEventTarget = null;
+
+ this.prevEvent = null; // previous action event
+ this.tapTime = 0; // time of the most recent tap event
+ this.prevTap = null;
+
+ this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 };
+ this.restrictOffset = { left: 0, right: 0, top: 0, bottom: 0 };
+ this.snapOffsets = [];
+
+ this.gesture = {
+ start: { x: 0, y: 0 },
+
+ startDistance: 0, // distance between two touches of touchStart
+ prevDistance : 0,
+ distance : 0,
+
+ scale: 1, // gesture.distance / gesture.startDistance
+
+ startAngle: 0, // angle of line joining two touches
+ prevAngle : 0 // angle of the previous gesture event
+ };
+
+ this.snapStatus = {
+ x : 0, y : 0,
+ dx : 0, dy : 0,
+ realX : 0, realY : 0,
+ snappedX: 0, snappedY: 0,
+ targets : [],
+ locked : false,
+ changed : false
+ };
+
+ this.restrictStatus = {
+ dx : 0, dy : 0,
+ restrictedX: 0, restrictedY: 0,
+ snap : null,
+ restricted : false,
+ changed : false
+ };
+
+ this.restrictStatus.snap = this.snapStatus;
+
+ this.pointerIsDown = false;
+ this.pointerWasMoved = false;
+ this.gesturing = false;
+ this.dragging = false;
+ this.resizing = false;
+ this.resizeAxes = 'xy';
+
+ this.mouse = false;
+
+ interactions.push(this);
+ }
+
+ Interaction.prototype = {
+ getPageXY : function (pointer, xy) { return getPageXY(pointer, xy, this); },
+ getClientXY: function (pointer, xy) { return getClientXY(pointer, xy, this); },
+ setEventXY : function (target, ptr) { return setEventXY(target, ptr, this); },
+
+ pointerOver: function (pointer, event, eventTarget) {
+ if (this.prepared.name || !this.mouse) { return; }
+
+ var curMatches = [],
+ curMatchElements = [],
+ prevTargetElement = this.element;
+
+ this.addPointer(pointer);
+
+ if (this.target
+ && (testIgnore(this.target, this.element, eventTarget)
+ || !testAllow(this.target, this.element, eventTarget))) {
+ // if the eventTarget should be ignored or shouldn't be allowed
+ // clear the previous target
+ this.target = null;
+ this.element = null;
+ this.matches = [];
+ this.matchElements = [];
+ }
+
+ var elementInteractable = interactables.get(eventTarget),
+ elementAction = (elementInteractable
+ && !testIgnore(elementInteractable, eventTarget, eventTarget)
+ && testAllow(elementInteractable, eventTarget, eventTarget)
+ && validateAction(
+ elementInteractable.getAction(pointer, this, eventTarget),
+ elementInteractable));
+
+ if (elementAction && !withinInteractionLimit(elementInteractable, eventTarget, elementAction)) {
+ elementAction = null;
+ }
+
+ function pushCurMatches (interactable, selector) {
+ if (interactable
+ && inContext(interactable, eventTarget)
+ && !testIgnore(interactable, eventTarget, eventTarget)
+ && testAllow(interactable, eventTarget, eventTarget)
+ && matchesSelector(eventTarget, selector)) {
+
+ curMatches.push(interactable);
+ curMatchElements.push(eventTarget);
+ }
+ }
+
+ if (elementAction) {
+ this.target = elementInteractable;
+ this.element = eventTarget;
+ this.matches = [];
+ this.matchElements = [];
+ }
+ else {
+ interactables.forEachSelector(pushCurMatches);
+
+ if (this.validateSelector(pointer, curMatches, curMatchElements)) {
+ this.matches = curMatches;
+ this.matchElements = curMatchElements;
+
+ this.pointerHover(pointer, event, this.matches, this.matchElements);
+ events.add(eventTarget,
+ PointerEvent? pEventTypes.move : 'mousemove',
+ listeners.pointerHover);
+ }
+ else if (this.target) {
+ if (nodeContains(prevTargetElement, eventTarget)) {
+ this.pointerHover(pointer, event, this.matches, this.matchElements);
+ events.add(this.element,
+ PointerEvent? pEventTypes.move : 'mousemove',
+ listeners.pointerHover);
+ }
+ else {
+ this.target = null;
+ this.element = null;
+ this.matches = [];
+ this.matchElements = [];
+ }
+ }
+ }
+ },
+
+ // Check what action would be performed on pointerMove target if a mouse
+ // button were pressed and change the cursor accordingly
+ pointerHover: function (pointer, event, eventTarget, curEventTarget, matches, matchElements) {
+ var target = this.target;
+
+ if (!this.prepared.name && this.mouse) {
+
+ var action;
+
+ // update pointer coords for defaultActionChecker to use
+ this.setEventXY(this.curCoords, pointer);
+
+ if (matches) {
+ action = this.validateSelector(pointer, matches, matchElements);
+ }
+ else if (target) {
+ action = validateAction(target.getAction(this.pointers[0], this, this.element), this.target);
+ }
+
+ if (target && target.options.styleCursor) {
+ if (action) {
+ target._doc.documentElement.style.cursor = getActionCursor(action);
+ }
+ else {
+ target._doc.documentElement.style.cursor = '';
+ }
+ }
+ }
+ else if (this.prepared.name) {
+ this.checkAndPreventDefault(event, target, this.element);
+ }
+ },
+
+ pointerOut: function (pointer, event, eventTarget) {
+ if (this.prepared.name) { return; }
+
+ // Remove temporary event listeners for selector Interactables
+ if (!interactables.get(eventTarget)) {
+ events.remove(eventTarget,
+ PointerEvent? pEventTypes.move : 'mousemove',
+ listeners.pointerHover);
+ }
+
+ if (this.target && this.target.options.styleCursor && !this.interacting()) {
+ this.target._doc.documentElement.style.cursor = '';
+ }
+ },
+
+ selectorDown: function (pointer, event, eventTarget, curEventTarget) {
+ var that = this,
+ // copy event to be used in timeout for IE8
+ eventCopy = events.useAttachEvent? extend({}, event) : event,
+ element = eventTarget,
+ pointerIndex = this.addPointer(pointer),
+ action;
+
+ this.holdTimers[pointerIndex] = setTimeout(function () {
+ that.pointerHold(events.useAttachEvent? eventCopy : pointer, eventCopy, eventTarget, curEventTarget);
+ }, defaultOptions._holdDuration);
+
+ this.pointerIsDown = true;
+
+ // Check if the down event hits the current inertia target
+ if (this.inertiaStatus.active && this.target.selector) {
+ // climb up the DOM tree from the event target
+ while (isElement(element)) {
+
+ // if this element is the current inertia target element
+ if (element === this.element
+ // and the prospective action is the same as the ongoing one
+ && validateAction(this.target.getAction(pointer, this, this.element), this.target).name === this.prepared.name) {
+
+ // stop inertia so that the next move will be a normal one
+ cancelFrame(this.inertiaStatus.i);
+ this.inertiaStatus.active = false;
+
+ this.collectEventTargets(pointer, event, eventTarget, 'down');
+ return;
+ }
+ element = parentElement(element);
+ }
+ }
+
+ // do nothing if interacting
+ if (this.interacting()) {
+ this.collectEventTargets(pointer, event, eventTarget, 'down');
+ return;
+ }
+
+ function pushMatches (interactable, selector, context) {
+ var elements = ie8MatchesSelector
+ ? context.querySelectorAll(selector)
+ : undefined;
+
+ if (inContext(interactable, element)
+ && !testIgnore(interactable, element, eventTarget)
+ && testAllow(interactable, element, eventTarget)
+ && matchesSelector(element, selector, elements)) {
+
+ that.matches.push(interactable);
+ that.matchElements.push(element);
+ }
+ }
+
+ // update pointer coords for defaultActionChecker to use
+ this.setEventXY(this.curCoords, pointer);
+
+ while (isElement(element) && !action) {
+ this.matches = [];
+ this.matchElements = [];
+
+ interactables.forEachSelector(pushMatches);
+
+ action = this.validateSelector(pointer, this.matches, this.matchElements);
+ element = parentElement(element);
+ }
+
+ if (action) {
+ this.prepared.name = action.name;
+ this.prepared.axis = action.axis;
+ this.prepared.edges = action.edges;
+
+ this.collectEventTargets(pointer, event, eventTarget, 'down');
+
+ return this.pointerDown(pointer, event, eventTarget, curEventTarget, action);
+ }
+ else {
+ // do these now since pointerDown isn't being called from here
+ this.downTimes[pointerIndex] = new Date().getTime();
+ this.downTargets[pointerIndex] = eventTarget;
+ this.downEvent = event;
+ extend(this.downPointer, pointer);
+
+ copyCoords(this.prevCoords, this.curCoords);
+ this.pointerWasMoved = false;
+ }
+
+ this.collectEventTargets(pointer, event, eventTarget, 'down');
+ },
+
+ // Determine action to be performed on next pointerMove and add appropriate
+ // style and event Listeners
+ pointerDown: function (pointer, event, eventTarget, curEventTarget, forceAction) {
+ if (!forceAction && !this.inertiaStatus.active && this.pointerWasMoved && this.prepared.name) {
+ this.checkAndPreventDefault(event, this.target, this.element);
+
+ return;
+ }
+
+ this.pointerIsDown = true;
+
+ var pointerIndex = this.addPointer(pointer),
+ action;
+
+ // If it is the second touch of a multi-touch gesture, keep the target
+ // the same if a target was set by the first touch
+ // Otherwise, set the target if there is no action prepared
+ if ((this.pointerIds.length < 2 && !this.target) || !this.prepared.name) {
+
+ var interactable = interactables.get(curEventTarget);
+
+ if (interactable
+ && !testIgnore(interactable, curEventTarget, eventTarget)
+ && testAllow(interactable, curEventTarget, eventTarget)
+ && (action = validateAction(forceAction || interactable.getAction(pointer, this, curEventTarget), interactable, eventTarget))
+ && withinInteractionLimit(interactable, curEventTarget, action)) {
+ this.target = interactable;
+ this.element = curEventTarget;
+ }
+ }
+
+ var target = this.target,
+ options = target && target.options;
+
+ if (target && !this.interacting()) {
+ action = action || validateAction(forceAction || target.getAction(pointer, this, curEventTarget), target, this.element);
+
+ this.setEventXY(this.startCoords);
+
+ if (!action) { return; }
+
+ if (options.styleCursor) {
+ target._doc.documentElement.style.cursor = getActionCursor(action);
+ }
+
+ this.resizeAxes = action.name === 'resize'? action.axis : null;
+
+ if (action === 'gesture' && this.pointerIds.length < 2) {
+ action = null;
+ }
+
+ this.prepared.name = action.name;
+ this.prepared.axis = action.axis;
+ this.prepared.edges = action.edges;
+
+ this.snapStatus.snappedX = this.snapStatus.snappedY =
+ this.restrictStatus.restrictedX = this.restrictStatus.restrictedY = NaN;
+
+ this.downTimes[pointerIndex] = new Date().getTime();
+ this.downTargets[pointerIndex] = eventTarget;
+ this.downEvent = event;
+ extend(this.downPointer, pointer);
+
+ this.setEventXY(this.prevCoords);
+ this.pointerWasMoved = false;
+
+ this.checkAndPreventDefault(event, target, this.element);
+ }
+ // if inertia is active try to resume action
+ else if (this.inertiaStatus.active
+ && curEventTarget === this.element
+ && validateAction(target.getAction(pointer, this, this.element), target).name === this.prepared.name) {
+
+ cancelFrame(this.inertiaStatus.i);
+ this.inertiaStatus.active = false;
+
+ this.checkAndPreventDefault(event, target, this.element);
+ }
+ },
+
+ setModifications: function (coords, preEnd) {
+ var target = this.target,
+ shouldMove = true,
+ shouldSnap = checkSnap(target, this.prepared.name) && (!target.options[this.prepared.name].snap.endOnly || preEnd),
+ shouldRestrict = checkRestrict(target, this.prepared.name) && (!target.options[this.prepared.name].restrict.endOnly || preEnd);
+
+ if (shouldSnap ) { this.setSnapping (coords); } else { this.snapStatus .locked = false; }
+ if (shouldRestrict) { this.setRestriction(coords); } else { this.restrictStatus.restricted = false; }
+
+ if (shouldSnap && this.snapStatus.locked && !this.snapStatus.changed) {
+ shouldMove = shouldRestrict && this.restrictStatus.restricted && this.restrictStatus.changed;
+ }
+ else if (shouldRestrict && this.restrictStatus.restricted && !this.restrictStatus.changed) {
+ shouldMove = false;
+ }
+
+ return shouldMove;
+ },
+
+ setStartOffsets: function (action, interactable, element) {
+ var rect = interactable.getRect(element),
+ origin = getOriginXY(interactable, element),
+ snap = interactable.options[this.prepared.name].snap,
+ restrict = interactable.options[this.prepared.name].restrict,
+ width, height;
+
+ if (rect) {
+ this.startOffset.left = this.startCoords.page.x - rect.left;
+ this.startOffset.top = this.startCoords.page.y - rect.top;
+
+ this.startOffset.right = rect.right - this.startCoords.page.x;
+ this.startOffset.bottom = rect.bottom - this.startCoords.page.y;
+
+ if ('width' in rect) { width = rect.width; }
+ else { width = rect.right - rect.left; }
+ if ('height' in rect) { height = rect.height; }
+ else { height = rect.bottom - rect.top; }
+ }
+ else {
+ this.startOffset.left = this.startOffset.top = this.startOffset.right = this.startOffset.bottom = 0;
+ }
+
+ this.snapOffsets.splice(0);
+
+ var snapOffset = snap && snap.offset === 'startCoords'
+ ? {
+ x: this.startCoords.page.x - origin.x,
+ y: this.startCoords.page.y - origin.y
+ }
+ : snap && snap.offset || { x: 0, y: 0 };
+
+ if (rect && snap && snap.relativePoints && snap.relativePoints.length) {
+ for (var i = 0; i < snap.relativePoints.length; i++) {
+ this.snapOffsets.push({
+ x: this.startOffset.left - (width * snap.relativePoints[i].x) + snapOffset.x,
+ y: this.startOffset.top - (height * snap.relativePoints[i].y) + snapOffset.y
+ });
+ }
+ }
+ else {
+ this.snapOffsets.push(snapOffset);
+ }
+
+ if (rect && restrict.elementRect) {
+ this.restrictOffset.left = this.startOffset.left - (width * restrict.elementRect.left);
+ this.restrictOffset.top = this.startOffset.top - (height * restrict.elementRect.top);
+
+ this.restrictOffset.right = this.startOffset.right - (width * (1 - restrict.elementRect.right));
+ this.restrictOffset.bottom = this.startOffset.bottom - (height * (1 - restrict.elementRect.bottom));
+ }
+ else {
+ this.restrictOffset.left = this.restrictOffset.top = this.restrictOffset.right = this.restrictOffset.bottom = 0;
+ }
+ },
+
+ /*\
+ * Interaction.start
+ [ method ]
+ *
+ * Start an action with the given Interactable and Element as tartgets. The
+ * action must be enabled for the target Interactable and an appropriate number
+ * of pointers must be held down – 1 for drag/resize, 2 for gesture.
+ *
+ * Use it with `interactable.<action>able({ manualStart: false })` to always
+ * [start actions manually](https://github.com/taye/interact.js/issues/114)
+ *
+ - action (object) The action to be performed - drag, resize, etc.
+ - interactable (Interactable) The Interactable to target
+ - element (Element) The DOM Element to target
+ = (object) interact
+ **
+ | interact(target)
+ | .draggable({
+ | // disable the default drag start by down->move
+ | manualStart: true
+ | })
+ | // start dragging after the user holds the pointer down
+ | .on('hold', function (event) {
+ | var interaction = event.interaction;
+ |
+ | if (!interaction.interacting()) {
+ | interaction.start({ name: 'drag' },
+ | event.interactable,
+ | event.currentTarget);
+ | }
+ | });
+ \*/
+ start: function (action, interactable, element) {
+ if (this.interacting()
+ || !this.pointerIsDown
+ || this.pointerIds.length < (action.name === 'gesture'? 2 : 1)) {
+ return;
+ }
+
+ // if this interaction had been removed after stopping
+ // add it back
+ if (indexOf(interactions, this) === -1) {
+ interactions.push(this);
+ }
+
+ this.prepared.name = action.name;
+ this.prepared.axis = action.axis;
+ this.prepared.edges = action.edges;
+ this.target = interactable;
+ this.element = element;
+
+ this.setStartOffsets(action.name, interactable, element);
+ this.setModifications(this.startCoords.page);
+
+ this.prevEvent = this[this.prepared.name + 'Start'](this.downEvent);
+ },
+
+ pointerMove: function (pointer, event, eventTarget, curEventTarget, preEnd) {
+ this.recordPointer(pointer);
+
+ this.setEventXY(this.curCoords, (pointer instanceof InteractEvent)
+ ? this.inertiaStatus.startEvent
+ : undefined);
+
+ var duplicateMove = (this.curCoords.page.x === this.prevCoords.page.x
+ && this.curCoords.page.y === this.prevCoords.page.y
+ && this.curCoords.client.x === this.prevCoords.client.x
+ && this.curCoords.client.y === this.prevCoords.client.y);
+
+ var dx, dy,
+ pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
+
+ // register movement greater than pointerMoveTolerance
+ if (this.pointerIsDown && !this.pointerWasMoved) {
+ dx = this.curCoords.client.x - this.startCoords.client.x;
+ dy = this.curCoords.client.y - this.startCoords.client.y;
+
+ this.pointerWasMoved = hypot(dx, dy) > pointerMoveTolerance;
+ }
+
+ if (!duplicateMove && (!this.pointerIsDown || this.pointerWasMoved)) {
+ if (this.pointerIsDown) {
+ clearTimeout(this.holdTimers[pointerIndex]);
+ }
+
+ this.collectEventTargets(pointer, event, eventTarget, 'move');
+ }
+
+ if (!this.pointerIsDown) { return; }
+
+ if (duplicateMove && this.pointerWasMoved && !preEnd) {
+ this.checkAndPreventDefault(event, this.target, this.element);
+ return;
+ }
+
+ // set pointer coordinate, time changes and speeds
+ setEventDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
+
+ if (!this.prepared.name) { return; }
+
+ if (this.pointerWasMoved
+ // ignore movement while inertia is active
+ && (!this.inertiaStatus.active || (pointer instanceof InteractEvent && /inertiastart/.test(pointer.type)))) {
+
+ // if just starting an action, calculate the pointer speed now
+ if (!this.interacting()) {
+ setEventDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
+
+ // check if a drag is in the correct axis
+ if (this.prepared.name === 'drag') {
+ var absX = Math.abs(dx),
+ absY = Math.abs(dy),
+ targetAxis = this.target.options.drag.axis,
+ axis = (absX > absY ? 'x' : absX < absY ? 'y' : 'xy');
+
+ // if the movement isn't in the axis of the interactable
+ if (axis !== 'xy' && targetAxis !== 'xy' && targetAxis !== axis) {
+ // cancel the prepared action
+ this.prepared.name = null;
+
+ // then try to get a drag from another ineractable
+
+ var element = eventTarget;
+
+ // check element interactables
+ while (isElement(element)) {
+ var elementInteractable = interactables.get(element);
+
+ if (elementInteractable
+ && elementInteractable !== this.target
+ && !elementInteractable.options.drag.manualStart
+ && elementInteractable.getAction(this.downPointer, this, element).name === 'drag'
+ && checkAxis(axis, elementInteractable)) {
+
+ this.prepared.name = 'drag';
+ this.target = elementInteractable;
+ this.element = element;
+ break;
+ }
+
+ element = parentElement(element);
+ }
+
+ // if there's no drag from element interactables,
+ // check the selector interactables
+ if (!this.prepared.name) {
+ var getDraggable = function (interactable, selector, context) {
+ var elements = ie8MatchesSelector
+ ? context.querySelectorAll(selector)
+ : undefined;
+
+ if (interactable === this.target) { return; }
+
+ if (inContext(interactable, eventTarget)
+ && !interactable.options.drag.manualStart
+ && !testIgnore(interactable, element, eventTarget)
+ && testAllow(interactable, element, eventTarget)
+ && matchesSelector(element, selector, elements)
+ && interactable.getAction(this.downPointer, this, element).name === 'drag'
+ && checkAxis(axis, interactable)
+ && withinInteractionLimit(interactable, element, 'drag')) {
+
+ return interactable;
+ }
+ };
+
+ element = eventTarget;
+
+ while (isElement(element)) {
+ var selectorInteractable = interactables.forEachSelector(getDraggable);
+
+ if (selectorInteractable) {
+ this.prepared.name = 'drag';
+ this.target = selectorInteractable;
+ this.element = element;
+ break;
+ }
+
+ element = parentElement(element);
+ }
+ }
+ }
+ }
+ }
+
+ var starting = !!this.prepared.name && !this.interacting();
+
+ if (starting
+ && (this.target.options[this.prepared.name].manualStart
+ || !withinInteractionLimit(this.target, this.element, this.prepared))) {
+ this.stop();
+ return;
+ }
+
+ if (this.prepared.name && this.target) {
+ if (starting) {
+ this.start(this.prepared, this.target, this.element);
+ }
+
+ var shouldMove = this.setModifications(this.curCoords.page, preEnd);
+
+ // move if snapping or restriction doesn't prevent it
+ if (shouldMove || starting) {
+ this.prevEvent = this[this.prepared.name + 'Move'](event);
+ }
+
+ this.checkAndPreventDefault(event, this.target, this.element);
+ }
+ }
+
+ copyCoords(this.prevCoords, this.curCoords);
+
+ if (this.dragging || this.resizing) {
+ autoScroll.edgeMove(event);
+ }
+ },
+
+ dragStart: function (event) {
+ var dragEvent = new InteractEvent(this, event, 'drag', 'start', this.element);
+
+ this.dragging = true;
+ this.target.fire(dragEvent);
+
+ // reset active dropzones
+ this.activeDrops.dropzones = [];
+ this.activeDrops.elements = [];
+ this.activeDrops.rects = [];
+
+ if (!this.dynamicDrop) {
+ this.setActiveDrops(this.element);
+ }
+
+ var dropEvents = this.getDropEvents(event, dragEvent);
+
+ if (dropEvents.activate) {
+ this.fireActiveDrops(dropEvents.activate);
+ }
+
+ return dragEvent;
+ },
+
+ dragMove: function (event) {
+ var target = this.target,
+ dragEvent = new InteractEvent(this, event, 'drag', 'move', this.element),
+ draggableElement = this.element,
+ drop = this.getDrop(dragEvent, draggableElement);
+
+ this.dropTarget = drop.dropzone;
+ this.dropElement = drop.element;
+
+ var dropEvents = this.getDropEvents(event, dragEvent);
+
+ target.fire(dragEvent);
+
+ if (dropEvents.leave) { this.prevDropTarget.fire(dropEvents.leave); }
+ if (dropEvents.enter) { this.dropTarget.fire(dropEvents.enter); }
+ if (dropEvents.move ) { this.dropTarget.fire(dropEvents.move ); }
+
+ this.prevDropTarget = this.dropTarget;
+ this.prevDropElement = this.dropElement;
+
+ return dragEvent;
+ },
+
+ resizeStart: function (event) {
+ var resizeEvent = new InteractEvent(this, event, 'resize', 'start', this.element);
+
+ if (this.prepared.edges) {
+ var startRect = this.target.getRect(this.element);
+
+ if (this.target.options.resize.square) {
+ var squareEdges = extend({}, this.prepared.edges);
+
+ squareEdges.top = squareEdges.top || (squareEdges.left && !squareEdges.bottom);
+ squareEdges.left = squareEdges.left || (squareEdges.top && !squareEdges.right );
+ squareEdges.bottom = squareEdges.bottom || (squareEdges.right && !squareEdges.top );
+ squareEdges.right = squareEdges.right || (squareEdges.bottom && !squareEdges.left );
+
+ this.prepared._squareEdges = squareEdges;
+ }
+ else {
+ this.prepared._squareEdges = null;
+ }
+
+ this.resizeRects = {
+ start : startRect,
+ current : extend({}, startRect),
+ restricted: extend({}, startRect),
+ previous : extend({}, startRect),
+ delta : {
+ left: 0, right : 0, width : 0,
+ top : 0, bottom: 0, height: 0
+ }
+ };
+
+ resizeEvent.rect = this.resizeRects.restricted;
+ resizeEvent.deltaRect = this.resizeRects.delta;
+ }
+
+ this.target.fire(resizeEvent);
+
+ this.resizing = true;
+
+ return resizeEvent;
+ },
+
+ resizeMove: function (event) {
+ var resizeEvent = new InteractEvent(this, event, 'resize', 'move', this.element);
+
+ var edges = this.prepared.edges,
+ invert = this.target.options.resize.invert,
+ invertible = invert === 'reposition' || invert === 'negate';
+
+ if (edges) {
+ var dx = resizeEvent.dx,
+ dy = resizeEvent.dy,
+
+ start = this.resizeRects.start,
+ current = this.resizeRects.current,
+ restricted = this.resizeRects.restricted,
+ delta = this.resizeRects.delta,
+ previous = extend(this.resizeRects.previous, restricted);
+
+ if (this.target.options.resize.square) {
+ var originalEdges = edges;
+
+ edges = this.prepared._squareEdges;
+
+ if ((originalEdges.left && originalEdges.bottom)
+ || (originalEdges.right && originalEdges.top)) {
+ dy = -dx;
+ }
+ else if (originalEdges.left || originalEdges.right) { dy = dx; }
+ else if (originalEdges.top || originalEdges.bottom) { dx = dy; }
+ }
+
+ // update the 'current' rect without modifications
+ if (edges.top ) { current.top += dy; }
+ if (edges.bottom) { current.bottom += dy; }
+ if (edges.left ) { current.left += dx; }
+ if (edges.right ) { current.right += dx; }
+
+ if (invertible) {
+ // if invertible, copy the current rect
+ extend(restricted, current);
+
+ if (invert === 'reposition') {
+ // swap edge values if necessary to keep width/height positive
+ var swap;
+
+ if (restricted.top > restricted.bottom) {
+ swap = restricted.top;
+
+ restricted.top = restricted.bottom;
+ restricted.bottom = swap;
+ }
+
+ if (restricted.left > restricted.right) {
+ window.negativeWidth = true;
+ swap = restricted.left;
+ window.prevNegativeWidth = window.negativeWidth;
+ window.negtiveWidth = true;
+ restricted.left = restricted.right;
+ restricted.right = swap;
+ }
+ else {
+ window.prevNegativeWidth = window.negativeWidth;
+ window.negativeWidth = false;
+ }
+
+ }
+ }
+ else {
+ // if not invertible, restrict to minimum of 0x0 rect
+ restricted.top = Math.min(current.top, start.bottom);
+ restricted.bottom = Math.max(current.bottom, start.top);
+ restricted.left = Math.min(current.left, start.right);
+ restricted.right = Math.max(current.right, start.left);
+ }
+
+ restricted.width = restricted.right - restricted.left;
+ restricted.height = restricted.bottom - restricted.top ;
+
+ for (var edge in restricted) {
+ delta[edge] = restricted[edge] - previous[edge];
+ }
+
+ resizeEvent.edges = this.prepared.edges;
+ resizeEvent.rect = restricted;
+ resizeEvent.deltaRect = delta;
+ }
+
+ this.target.fire(resizeEvent);
+
+ return resizeEvent;
+ },
+
+ gestureStart: function (event) {
+ var gestureEvent = new InteractEvent(this, event, 'gesture', 'start', this.element);
+
+ gestureEvent.ds = 0;
+
+ this.gesture.startDistance = this.gesture.prevDistance = gestureEvent.distance;
+ this.gesture.startAngle = this.gesture.prevAngle = gestureEvent.angle;
+ this.gesture.scale = 1;
+
+ this.gesturing = true;
+
+ this.target.fire(gestureEvent);
+
+ return gestureEvent;
+ },
+
+ gestureMove: function (event) {
+ if (!this.pointerIds.length) {
+ return this.prevEvent;
+ }
+
+ var gestureEvent;
+
+ gestureEvent = new InteractEvent(this, event, 'gesture', 'move', this.element);
+ gestureEvent.ds = gestureEvent.scale - this.gesture.scale;
+
+ this.target.fire(gestureEvent);
+
+ this.gesture.prevAngle = gestureEvent.angle;
+ this.gesture.prevDistance = gestureEvent.distance;
+
+ if (gestureEvent.scale !== Infinity &&
+ gestureEvent.scale !== null &&
+ gestureEvent.scale !== undefined &&
+ !isNaN(gestureEvent.scale)) {
+
+ this.gesture.scale = gestureEvent.scale;
+ }
+
+ return gestureEvent;
+ },
+
+ pointerHold: function (pointer, event, eventTarget) {
+ this.collectEventTargets(pointer, event, eventTarget, 'hold');
+ },
+
+ pointerUp: function (pointer, event, eventTarget, curEventTarget) {
+ var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
+
+ clearTimeout(this.holdTimers[pointerIndex]);
+
+ this.collectEventTargets(pointer, event, eventTarget, 'up' );
+ this.collectEventTargets(pointer, event, eventTarget, 'tap');
+
+ this.pointerEnd(pointer, event, eventTarget, curEventTarget);
+
+ this.removePointer(pointer);
+ },
+
+ pointerCancel: function (pointer, event, eventTarget, curEventTarget) {
+ var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
+
+ clearTimeout(this.holdTimers[pointerIndex]);
+
+ this.collectEventTargets(pointer, event, eventTarget, 'cancel');
+ this.pointerEnd(pointer, event, eventTarget, curEventTarget);
+
+ this.removePointer(pointer);
+ },
+
+ // http://www.quirksmode.org/dom/events/click.html
+ // >Events leading to dblclick
+ //
+ // IE8 doesn't fire down event before dblclick.
+ // This workaround tries to fire a tap and doubletap after dblclick
+ ie8Dblclick: function (pointer, event, eventTarget) {
+ if (this.prevTap
+ && event.clientX === this.prevTap.clientX
+ && event.clientY === this.prevTap.clientY
+ && eventTarget === this.prevTap.target) {
+
+ this.downTargets[0] = eventTarget;
+ this.downTimes[0] = new Date().getTime();
+ this.collectEventTargets(pointer, event, eventTarget, 'tap');
+ }
+ },
+
+ // End interact move events and stop auto-scroll unless inertia is enabled
+ pointerEnd: function (pointer, event, eventTarget, curEventTarget) {
+ var endEvent,
+ target = this.target,
+ options = target && target.options,
+ inertiaOptions = options && this.prepared.name && options[this.prepared.name].inertia,
+ inertiaStatus = this.inertiaStatus;
+
+ if (this.interacting()) {
+
+ if (inertiaStatus.active) { return; }
+
+ var pointerSpeed,
+ now = new Date().getTime(),
+ inertiaPossible = false,
+ inertia = false,
+ smoothEnd = false,
+ endSnap = checkSnap(target, this.prepared.name) && options[this.prepared.name].snap.endOnly,
+ endRestrict = checkRestrict(target, this.prepared.name) && options[this.prepared.name].restrict.endOnly,
+ dx = 0,
+ dy = 0,
+ startEvent;
+
+ if (this.dragging) {
+ if (options.drag.axis === 'x' ) { pointerSpeed = Math.abs(this.pointerDelta.client.vx); }
+ else if (options.drag.axis === 'y' ) { pointerSpeed = Math.abs(this.pointerDelta.client.vy); }
+ else /*options.drag.axis === 'xy'*/{ pointerSpeed = this.pointerDelta.client.speed; }
+ }
+ else {
+ pointerSpeed = this.pointerDelta.client.speed;
+ }
+
+ // check if inertia should be started
+ inertiaPossible = (inertiaOptions && inertiaOptions.enabled
+ && this.prepared.name !== 'gesture'
+ && event !== inertiaStatus.startEvent);
+
+ inertia = (inertiaPossible
+ && (now - this.curCoords.timeStamp) < 50
+ && pointerSpeed > inertiaOptions.minSpeed
+ && pointerSpeed > inertiaOptions.endSpeed);
+
+ if (inertiaPossible && !inertia && (endSnap || endRestrict)) {
+
+ var snapRestrict = {};
+
+ snapRestrict.snap = snapRestrict.restrict = snapRestrict;
+
+ if (endSnap) {
+ this.setSnapping(this.curCoords.page, snapRestrict);
+ if (snapRestrict.locked) {
+ dx += snapRestrict.dx;
+ dy += snapRestrict.dy;
+ }
+ }
+
+ if (endRestrict) {
+ this.setRestriction(this.curCoords.page, snapRestrict);
+ if (snapRestrict.restricted) {
+ dx += snapRestrict.dx;
+ dy += snapRestrict.dy;
+ }
+ }
+
+ if (dx || dy) {
+ smoothEnd = true;
+ }
+ }
+
+ if (inertia || smoothEnd) {
+ copyCoords(inertiaStatus.upCoords, this.curCoords);
+
+ this.pointers[0] = inertiaStatus.startEvent = startEvent =
+ new InteractEvent(this, event, this.prepared.name, 'inertiastart', this.element);
+
+ inertiaStatus.t0 = now;
+
+ target.fire(inertiaStatus.startEvent);
+
+ if (inertia) {
+ inertiaStatus.vx0 = this.pointerDelta.client.vx;
+ inertiaStatus.vy0 = this.pointerDelta.client.vy;
+ inertiaStatus.v0 = pointerSpeed;
+
+ this.calcInertia(inertiaStatus);
+
+ var page = extend({}, this.curCoords.page),
+ origin = getOriginXY(target, this.element),
+ statusObject;
+
+ page.x = page.x + inertiaStatus.xe - origin.x;
+ page.y = page.y + inertiaStatus.ye - origin.y;
+
+ statusObject = {
+ useStatusXY: true,
+ x: page.x,
+ y: page.y,
+ dx: 0,
+ dy: 0,
+ snap: null
+ };
+
+ statusObject.snap = statusObject;
+
+ dx = dy = 0;
+
+ if (endSnap) {
+ var snap = this.setSnapping(this.curCoords.page, statusObject);
+
+ if (snap.locked) {
+ dx += snap.dx;
+ dy += snap.dy;
+ }
+ }
+
+ if (endRestrict) {
+ var restrict = this.setRestriction(this.curCoords.page, statusObject);
+
+ if (restrict.restricted) {
+ dx += restrict.dx;
+ dy += restrict.dy;
+ }
+ }
+
+ inertiaStatus.modifiedXe += dx;
+ inertiaStatus.modifiedYe += dy;
+
+ inertiaStatus.i = reqFrame(this.boundInertiaFrame);
+ }
+ else {
+ inertiaStatus.smoothEnd = true;
+ inertiaStatus.xe = dx;
+ inertiaStatus.ye = dy;
+
+ inertiaStatus.sx = inertiaStatus.sy = 0;
+
+ inertiaStatus.i = reqFrame(this.boundSmoothEndFrame);
+ }
+
+ inertiaStatus.active = true;
+ return;
+ }
+
+ if (endSnap || endRestrict) {
+ // fire a move event at the snapped coordinates
+ this.pointerMove(pointer, event, eventTarget, curEventTarget, true);
+ }
+ }
+
+ if (this.dragging) {
+ endEvent = new InteractEvent(this, event, 'drag', 'end', this.element);
+
+ var draggableElement = this.element,
+ drop = this.getDrop(endEvent, draggableElement);
+
+ this.dropTarget = drop.dropzone;
+ this.dropElement = drop.element;
+
+ var dropEvents = this.getDropEvents(event, endEvent);
+
+ if (dropEvents.leave) { this.prevDropTarget.fire(dropEvents.leave); }
+ if (dropEvents.enter) { this.dropTarget.fire(dropEvents.enter); }
+ if (dropEvents.drop ) { this.dropTarget.fire(dropEvents.drop ); }
+ if (dropEvents.deactivate) {
+ this.fireActiveDrops(dropEvents.deactivate);
+ }
+
+ target.fire(endEvent);
+ }
+ else if (this.resizing) {
+ endEvent = new InteractEvent(this, event, 'resize', 'end', this.element);
+ target.fire(endEvent);
+ }
+ else if (this.gesturing) {
+ endEvent = new InteractEvent(this, event, 'gesture', 'end', this.element);
+ target.fire(endEvent);
+ }
+
+ this.stop(event);
+ },
+
+ collectDrops: function (element) {
+ var drops = [],
+ elements = [],
+ i;
+
+ element = element || this.element;
+
+ // collect all dropzones and their elements which qualify for a drop
+ for (i = 0; i < interactables.length; i++) {
+ if (!interactables[i].options.drop.enabled) { continue; }
+
+ var current = interactables[i],
+ accept = current.options.drop.accept;
+
+ // test the draggable element against the dropzone's accept setting
+ if ((isElement(accept) && accept !== element)
+ || (isString(accept)
+ && !matchesSelector(element, accept))) {
+
+ continue;
+ }
+
+ // query for new elements if necessary
+ var dropElements = current.selector? current._context.querySelectorAll(current.selector) : [current._element];
+
+ for (var j = 0, len = dropElements.length; j < len; j++) {
+ var currentElement = dropElements[j];
+
+ if (currentElement === element) {
+ continue;
+ }
+
+ drops.push(current);
+ elements.push(currentElement);
+ }
+ }
+
+ return {
+ dropzones: drops,
+ elements: elements
+ };
+ },
+
+ fireActiveDrops: function (event) {
+ var i,
+ current,
+ currentElement,
+ prevElement;
+
+ // loop through all active dropzones and trigger event
+ for (i = 0; i < this.activeDrops.dropzones.length; i++) {
+ current = this.activeDrops.dropzones[i];
+ currentElement = this.activeDrops.elements [i];
+
+ // prevent trigger of duplicate events on same element
+ if (currentElement !== prevElement) {
+ // set current element as event target
+ event.target = currentElement;
+ current.fire(event);
+ }
+ prevElement = currentElement;
+ }
+ },
+
+ // Collect a new set of possible drops and save them in activeDrops.
+ // setActiveDrops should always be called when a drag has just started or a
+ // drag event happens while dynamicDrop is true
+ setActiveDrops: function (dragElement) {
+ // get dropzones and their elements that could receive the draggable
+ var possibleDrops = this.collectDrops(dragElement, true);
+
+ this.activeDrops.dropzones = possibleDrops.dropzones;
+ this.activeDrops.elements = possibleDrops.elements;
+ this.activeDrops.rects = [];
+
+ for (var i = 0; i < this.activeDrops.dropzones.length; i++) {
+ this.activeDrops.rects[i] = this.activeDrops.dropzones[i].getRect(this.activeDrops.elements[i]);
+ }
+ },
+
+ getDrop: function (event, dragElement) {
+ var validDrops = [];
+
+ if (dynamicDrop) {
+ this.setActiveDrops(dragElement);
+ }
+
+ // collect all dropzones and their elements which qualify for a drop
+ for (var j = 0; j < this.activeDrops.dropzones.length; j++) {
+ var current = this.activeDrops.dropzones[j],
+ currentElement = this.activeDrops.elements [j],
+ rect = this.activeDrops.rects [j];
+
+ validDrops.push(current.dropCheck(this.pointers[0], this.target, dragElement, currentElement, rect)
+ ? currentElement
+ : null);
+ }
+
+ // get the most appropriate dropzone based on DOM depth and order
+ var dropIndex = indexOfDeepestElement(validDrops),
+ dropzone = this.activeDrops.dropzones[dropIndex] || null,
+ element = this.activeDrops.elements [dropIndex] || null;
+
+ return {
+ dropzone: dropzone,
+ element: element
+ };
+ },
+
+ getDropEvents: function (pointerEvent, dragEvent) {
+ var dropEvents = {
+ enter : null,
+ leave : null,
+ activate : null,
+ deactivate: null,
+ move : null,
+ drop : null
+ };
+
+ if (this.dropElement !== this.prevDropElement) {
+ // if there was a prevDropTarget, create a dragleave event
+ if (this.prevDropTarget) {
+ dropEvents.leave = {
+ target : this.prevDropElement,
+ dropzone : this.prevDropTarget,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ timeStamp : dragEvent.timeStamp,
+ type : 'dragleave'
+ };
+
+ dragEvent.dragLeave = this.prevDropElement;
+ dragEvent.prevDropzone = this.prevDropTarget;
+ }
+ // if the dropTarget is not null, create a dragenter event
+ if (this.dropTarget) {
+ dropEvents.enter = {
+ target : this.dropElement,
+ dropzone : this.dropTarget,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ timeStamp : dragEvent.timeStamp,
+ type : 'dragenter'
+ };
+
+ dragEvent.dragEnter = this.dropElement;
+ dragEvent.dropzone = this.dropTarget;
+ }
+ }
+
+ if (dragEvent.type === 'dragend' && this.dropTarget) {
+ dropEvents.drop = {
+ target : this.dropElement,
+ dropzone : this.dropTarget,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ timeStamp : dragEvent.timeStamp,
+ type : 'drop'
+ };
+ }
+ if (dragEvent.type === 'dragstart') {
+ dropEvents.activate = {
+ target : null,
+ dropzone : null,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ timeStamp : dragEvent.timeStamp,
+ type : 'dropactivate'
+ };
+ }
+ if (dragEvent.type === 'dragend') {
+ dropEvents.deactivate = {
+ target : null,
+ dropzone : null,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ timeStamp : dragEvent.timeStamp,
+ type : 'dropdeactivate'
+ };
+ }
+ if (dragEvent.type === 'dragmove' && this.dropTarget) {
+ dropEvents.move = {
+ target : this.dropElement,
+ dropzone : this.dropTarget,
+ relatedTarget: dragEvent.target,
+ draggable : dragEvent.interactable,
+ dragEvent : dragEvent,
+ interaction : this,
+ dragmove : dragEvent,
+ timeStamp : dragEvent.timeStamp,
+ type : 'dropmove'
+ };
+ dragEvent.dropzone = this.dropTarget;
+ }
+
+ return dropEvents;
+ },
+
+ currentAction: function () {
+ return (this.dragging && 'drag') || (this.resizing && 'resize') || (this.gesturing && 'gesture') || null;
+ },
+
+ interacting: function () {
+ return this.dragging || this.resizing || this.gesturing;
+ },
+
+ clearTargets: function () {
+ if (this.target && !this.target.selector) {
+ this.target = this.element = null;
+ }
+
+ this.dropTarget = this.dropElement = this.prevDropTarget = this.prevDropElement = null;
+ },
+
+ stop: function (event) {
+ if (this.interacting()) {
+ autoScroll.stop();
+ this.matches = [];
+ this.matchElements = [];
+
+ var target = this.target;
+
+ if (target.options.styleCursor) {
+ target._doc.documentElement.style.cursor = '';
+ }
+
+ // prevent Default only if were previously interacting
+ if (event && isFunction(event.preventDefault)) {
+ this.checkAndPreventDefault(event, target, this.element);
+ }
+
+ if (this.dragging) {
+ this.activeDrops.dropzones = this.activeDrops.elements = this.activeDrops.rects = null;
+ }
+
+ this.clearTargets();
+ }
+
+ this.pointerIsDown = this.snapStatus.locked = this.dragging = this.resizing = this.gesturing = false;
+ this.prepared.name = this.prevEvent = null;
+ this.inertiaStatus.resumeDx = this.inertiaStatus.resumeDy = 0;
+
+ // remove pointers if their ID isn't in this.pointerIds
+ for (var i = 0; i < this.pointers.length; i++) {
+ if (indexOf(this.pointerIds, getPointerId(this.pointers[i])) === -1) {
+ this.pointers.splice(i, 1);
+ }
+ }
+
+ // delete interaction if it's not the only one
+ if (interactions.length > 1) {
+ interactions.splice(indexOf(interactions, this), 1);
+ }
+ },
+
+ inertiaFrame: function () {
+ var inertiaStatus = this.inertiaStatus,
+ options = this.target.options[this.prepared.name].inertia,
+ lambda = options.resistance,
+ t = new Date().getTime() / 1000 - inertiaStatus.t0;
+
+ if (t < inertiaStatus.te) {
+
+ var progress = 1 - (Math.exp(-lambda * t) - inertiaStatus.lambda_v0) / inertiaStatus.one_ve_v0;
+
+ if (inertiaStatus.modifiedXe === inertiaStatus.xe && inertiaStatus.modifiedYe === inertiaStatus.ye) {
+ inertiaStatus.sx = inertiaStatus.xe * progress;
+ inertiaStatus.sy = inertiaStatus.ye * progress;
+ }
+ else {
+ var quadPoint = getQuadraticCurvePoint(
+ 0, 0,
+ inertiaStatus.xe, inertiaStatus.ye,
+ inertiaStatus.modifiedXe, inertiaStatus.modifiedYe,
+ progress);
+
+ inertiaStatus.sx = quadPoint.x;
+ inertiaStatus.sy = quadPoint.y;
+ }
+
+ this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
+
+ inertiaStatus.i = reqFrame(this.boundInertiaFrame);
+ }
+ else {
+ inertiaStatus.sx = inertiaStatus.modifiedXe;
+ inertiaStatus.sy = inertiaStatus.modifiedYe;
+
+ this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
+
+ inertiaStatus.active = false;
+ this.pointerEnd(inertiaStatus.startEvent, inertiaStatus.startEvent);
+ }
+ },
+
+ smoothEndFrame: function () {
+ var inertiaStatus = this.inertiaStatus,
+ t = new Date().getTime() - inertiaStatus.t0,
+ duration = this.target.options[this.prepared.name].inertia.smoothEndDuration;
+
+ if (t < duration) {
+ inertiaStatus.sx = easeOutQuad(t, 0, inertiaStatus.xe, duration);
+ inertiaStatus.sy = easeOutQuad(t, 0, inertiaStatus.ye, duration);
+
+ this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
+
+ inertiaStatus.i = reqFrame(this.boundSmoothEndFrame);
+ }
+ else {
+ inertiaStatus.sx = inertiaStatus.xe;
+ inertiaStatus.sy = inertiaStatus.ye;
+
+ this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
+
+ inertiaStatus.active = false;
+ inertiaStatus.smoothEnd = false;
+
+ this.pointerEnd(inertiaStatus.startEvent, inertiaStatus.startEvent);
+ }
+ },
+
+ addPointer: function (pointer) {
+ var id = getPointerId(pointer),
+ index = this.mouse? 0 : indexOf(this.pointerIds, id);
+
+ if (index === -1) {
+ index = this.pointerIds.length;
+ }
+
+ this.pointerIds[index] = id;
+ this.pointers[index] = pointer;
+
+ return index;
+ },
+
+ removePointer: function (pointer) {
+ var id = getPointerId(pointer),
+ index = this.mouse? 0 : indexOf(this.pointerIds, id);
+
+ if (index === -1) { return; }
+
+ if (!this.interacting()) {
+ this.pointers.splice(index, 1);
+ }
+
+ this.pointerIds .splice(index, 1);
+ this.downTargets.splice(index, 1);
+ this.downTimes .splice(index, 1);
+ this.holdTimers .splice(index, 1);
+ },
+
+ recordPointer: function (pointer) {
+ // Do not update pointers while inertia is active.
+ // The inertia start event should be this.pointers[0]
+ if (this.inertiaStatus.active) { return; }
+
+ var index = this.mouse? 0: indexOf(this.pointerIds, getPointerId(pointer));
+
+ if (index === -1) { return; }
+
+ this.pointers[index] = pointer;
+ },
+
+ collectEventTargets: function (pointer, event, eventTarget, eventType) {
+ var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
+
+ // do not fire a tap event if the pointer was moved before being lifted
+ if (eventType === 'tap' && (this.pointerWasMoved
+ // or if the pointerup target is different to the pointerdown target
+ || !(this.downTargets[pointerIndex] && this.downTargets[pointerIndex] === eventTarget))) {
+ return;
+ }
+
+ var targets = [],
+ elements = [],
+ element = eventTarget;
+
+ function collectSelectors (interactable, selector, context) {
+ var els = ie8MatchesSelector
+ ? context.querySelectorAll(selector)
+ : undefined;
+
+ if (interactable._iEvents[eventType]
+ && isElement(element)
+ && inContext(interactable, element)
+ && !testIgnore(interactable, element, eventTarget)
+ && testAllow(interactable, element, eventTarget)
+ && matchesSelector(element, selector, els)) {
+
+ targets.push(interactable);
+ elements.push(element);
+ }
+ }
+
+ while (element) {
+ if (interact.isSet(element) && interact(element)._iEvents[eventType]) {
+ targets.push(interact(element));
+ elements.push(element);
+ }
+
+ interactables.forEachSelector(collectSelectors);
+
+ element = parentElement(element);
+ }
+
+ // create the tap event even if there are no listeners so that
+ // doubletap can still be created and fired
+ if (targets.length || eventType === 'tap') {
+ this.firePointers(pointer, event, eventTarget, targets, elements, eventType);
+ }
+ },
+
+ firePointers: function (pointer, event, eventTarget, targets, elements, eventType) {
+ var pointerIndex = this.mouse? 0 : indexOf(getPointerId(pointer)),
+ pointerEvent = {},
+ i,
+ // for tap events
+ interval, createNewDoubleTap;
+
+ // if it's a doubletap then the event properties would have been
+ // copied from the tap event and provided as the pointer argument
+ if (eventType === 'doubletap') {
+ pointerEvent = pointer;
+ }
+ else {
+ extend(pointerEvent, event);
+ if (event !== pointer) {
+ extend(pointerEvent, pointer);
+ }
+
+ pointerEvent.preventDefault = preventOriginalDefault;
+ pointerEvent.stopPropagation = InteractEvent.prototype.stopPropagation;
+ pointerEvent.stopImmediatePropagation = InteractEvent.prototype.stopImmediatePropagation;
+ pointerEvent.interaction = this;
+
+ pointerEvent.timeStamp = new Date().getTime();
+ pointerEvent.originalEvent = event;
+ pointerEvent.type = eventType;
+ pointerEvent.pointerId = getPointerId(pointer);
+ pointerEvent.pointerType = this.mouse? 'mouse' : !supportsPointerEvent? 'touch'
+ : isString(pointer.pointerType)
+ ? pointer.pointerType
+ : [,,'touch', 'pen', 'mouse'][pointer.pointerType];
+ }
+
+ if (eventType === 'tap') {
+ pointerEvent.dt = pointerEvent.timeStamp - this.downTimes[pointerIndex];
+
+ interval = pointerEvent.timeStamp - this.tapTime;
+ createNewDoubleTap = !!(this.prevTap && this.prevTap.type !== 'doubletap'
+ && this.prevTap.target === pointerEvent.target
+ && interval < 500);
+
+ pointerEvent.double = createNewDoubleTap;
+
+ this.tapTime = pointerEvent.timeStamp;
+ }
+
+ for (i = 0; i < targets.length; i++) {
+ pointerEvent.currentTarget = elements[i];
+ pointerEvent.interactable = targets[i];
+ targets[i].fire(pointerEvent);
+
+ if (pointerEvent.immediatePropagationStopped
+ ||(pointerEvent.propagationStopped && elements[i + 1] !== pointerEvent.currentTarget)) {
+ break;
+ }
+ }
+
+ if (createNewDoubleTap) {
+ var doubleTap = {};
+
+ extend(doubleTap, pointerEvent);
+
+ doubleTap.dt = interval;
+ doubleTap.type = 'doubletap';
+
+ this.collectEventTargets(doubleTap, event, eventTarget, 'doubletap');
+
+ this.prevTap = doubleTap;
+ }
+ else if (eventType === 'tap') {
+ this.prevTap = pointerEvent;
+ }
+ },
+
+ validateSelector: function (pointer, matches, matchElements) {
+ for (var i = 0, len = matches.length; i < len; i++) {
+ var match = matches[i],
+ matchElement = matchElements[i],
+ action = validateAction(match.getAction(pointer, this, matchElement), match);
+
+ if (action && withinInteractionLimit(match, matchElement, action)) {
+ this.target = match;
+ this.element = matchElement;
+
+ return action;
+ }
+ }
+ },
+
+ setSnapping: function (pageCoords, status) {
+ var snap = this.target.options[this.prepared.name].snap,
+ targets = [],
+ target,
+ page,
+ i;
+
+ status = status || this.snapStatus;
+
+ if (status.useStatusXY) {
+ page = { x: status.x, y: status.y };
+ }
+ else {
+ var origin = getOriginXY(this.target, this.element);
+
+ page = extend({}, pageCoords);
+
+ page.x -= origin.x;
+ page.y -= origin.y;
+ }
+
+ status.realX = page.x;
+ status.realY = page.y;
+
+ page.x = page.x - this.inertiaStatus.resumeDx;
+ page.y = page.y - this.inertiaStatus.resumeDy;
+
+ var len = snap.targets? snap.targets.length : 0;
+
+ for (var relIndex = 0; relIndex < this.snapOffsets.length; relIndex++) {
+ var relative = {
+ x: page.x - this.snapOffsets[relIndex].x,
+ y: page.y - this.snapOffsets[relIndex].y
+ };
+
+ for (i = 0; i < len; i++) {
+ if (isFunction(snap.targets[i])) {
+ target = snap.targets[i](relative.x, relative.y, this);
+ }
+ else {
+ target = snap.targets[i];
+ }
+
+ if (!target) { continue; }
+
+ targets.push({
+ x: isNumber(target.x) ? (target.x + this.snapOffsets[relIndex].x) : relative.x,
+ y: isNumber(target.y) ? (target.y + this.snapOffsets[relIndex].y) : relative.y,
+
+ range: isNumber(target.range)? target.range: snap.range
+ });
+ }
+ }
+
+ var closest = {
+ target: null,
+ inRange: false,
+ distance: 0,
+ range: 0,
+ dx: 0,
+ dy: 0
+ };
+
+ for (i = 0, len = targets.length; i < len; i++) {
+ target = targets[i];
+
+ var range = target.range,
+ dx = target.x - page.x,
+ dy = target.y - page.y,
+ distance = hypot(dx, dy),
+ inRange = distance <= range;
+
+ // Infinite targets count as being out of range
+ // compared to non infinite ones that are in range
+ if (range === Infinity && closest.inRange && closest.range !== Infinity) {
+ inRange = false;
+ }
+
+ if (!closest.target || (inRange
+ // is the closest target in range?
+ ? (closest.inRange && range !== Infinity
+ // the pointer is relatively deeper in this target
+ ? distance / range < closest.distance / closest.range
+ // this target has Infinite range and the closest doesn't
+ : (range === Infinity && closest.range !== Infinity)
+ // OR this target is closer that the previous closest
+ || distance < closest.distance)
+ // The other is not in range and the pointer is closer to this target
+ : (!closest.inRange && distance < closest.distance))) {
+
+ if (range === Infinity) {
+ inRange = true;
+ }
+
+ closest.target = target;
+ closest.distance = distance;
+ closest.range = range;
+ closest.inRange = inRange;
+ closest.dx = dx;
+ closest.dy = dy;
+
+ status.range = range;
+ }
+ }
+
+ var snapChanged;
+
+ if (closest.target) {
+ snapChanged = (status.snappedX !== closest.target.x || status.snappedY !== closest.target.y);
+
+ status.snappedX = closest.target.x;
+ status.snappedY = closest.target.y;
+ }
+ else {
+ snapChanged = true;
+
+ status.snappedX = NaN;
+ status.snappedY = NaN;
+ }
+
+ status.dx = closest.dx;
+ status.dy = closest.dy;
+
+ status.changed = (snapChanged || (closest.inRange && !status.locked));
+ status.locked = closest.inRange;
+
+ return status;
+ },
+
+ setRestriction: function (pageCoords, status) {
+ var target = this.target,
+ restrict = target && target.options[this.prepared.name].restrict,
+ restriction = restrict && restrict.restriction,
+ page;
+
+ if (!restriction) {
+ return status;
+ }
+
+ status = status || this.restrictStatus;
+
+ page = status.useStatusXY
+ ? page = { x: status.x, y: status.y }
+ : page = extend({}, pageCoords);
+
+ if (status.snap && status.snap.locked) {
+ page.x += status.snap.dx || 0;
+ page.y += status.snap.dy || 0;
+ }
+
+ page.x -= this.inertiaStatus.resumeDx;
+ page.y -= this.inertiaStatus.resumeDy;
+
+ status.dx = 0;
+ status.dy = 0;
+ status.restricted = false;
+
+ var rect, restrictedX, restrictedY;
+
+ if (isString(restriction)) {
+ if (restriction === 'parent') {
+ restriction = parentElement(this.element);
+ }
+ else if (restriction === 'self') {
+ restriction = target.getRect(this.element);
+ }
+ else {
+ restriction = closest(this.element, restriction);
+ }
+
+ if (!restriction) { return status; }
+ }
+
+ if (isFunction(restriction)) {
+ restriction = restriction(page.x, page.y, this.element);
+ }
+
+ if (isElement(restriction)) {
+ restriction = getElementRect(restriction);
+ }
+
+ rect = restriction;
+
+ if (!restriction) {
+ restrictedX = page.x;
+ restrictedY = page.y;
+ }
+ // object is assumed to have
+ // x, y, width, height or
+ // left, top, right, bottom
+ else if ('x' in restriction && 'y' in restriction) {
+ restrictedX = Math.max(Math.min(rect.x + rect.width - this.restrictOffset.right , page.x), rect.x + this.restrictOffset.left);
+ restrictedY = Math.max(Math.min(rect.y + rect.height - this.restrictOffset.bottom, page.y), rect.y + this.restrictOffset.top );
+ }
+ else {
+ restrictedX = Math.max(Math.min(rect.right - this.restrictOffset.right , page.x), rect.left + this.restrictOffset.left);
+ restrictedY = Math.max(Math.min(rect.bottom - this.restrictOffset.bottom, page.y), rect.top + this.restrictOffset.top );
+ }
+
+ status.dx = restrictedX - page.x;
+ status.dy = restrictedY - page.y;
+
+ status.changed = status.restrictedX !== restrictedX || status.restrictedY !== restrictedY;
+ status.restricted = !!(status.dx || status.dy);
+
+ status.restrictedX = restrictedX;
+ status.restrictedY = restrictedY;
+
+ return status;
+ },
+
+ checkAndPreventDefault: function (event, interactable, element) {
+ if (!(interactable = interactable || this.target)) { return; }
+
+ var options = interactable.options,
+ prevent = options.preventDefault;
+
+ if (prevent === 'auto' && element && !/^input$|^textarea$/i.test(element.nodeName)) {
+ // do not preventDefault on pointerdown if the prepared action is a drag
+ // and dragging can only start from a certain direction - this allows
+ // a touch to pan the viewport if a drag isn't in the right direction
+ if (/down|start/i.test(event.type)
+ && this.prepared.name === 'drag' && options.drag.axis !== 'xy') {
+
+ return;
+ }
+
+ // with manualStart, only preventDefault while interacting
+ if (options[this.prepared.name] && options[this.prepared.name].manualStart
+ && !this.interacting()) {
+ return;
+ }
+
+ event.preventDefault();
+ return;
+ }
+
+ if (prevent === 'always') {
+ event.preventDefault();
+ return;
+ }
+ },
+
+ calcInertia: function (status) {
+ var inertiaOptions = this.target.options[this.prepared.name].inertia,
+ lambda = inertiaOptions.resistance,
+ inertiaDur = -Math.log(inertiaOptions.endSpeed / status.v0) / lambda;
+
+ status.x0 = this.prevEvent.pageX;
+ status.y0 = this.prevEvent.pageY;
+ status.t0 = status.startEvent.timeStamp / 1000;
+ status.sx = status.sy = 0;
+
+ status.modifiedXe = status.xe = (status.vx0 - inertiaDur) / lambda;
+ status.modifiedYe = status.ye = (status.vy0 - inertiaDur) / lambda;
+ status.te = inertiaDur;
+
+ status.lambda_v0 = lambda / status.v0;
+ status.one_ve_v0 = 1 - inertiaOptions.endSpeed / status.v0;
+ },
+
+ _updateEventTargets: function (target, currentTarget) {
+ this._eventTarget = target;
+ this._curEventTarget = currentTarget;
+ }
+
+ };
+
+ function getInteractionFromPointer (pointer, eventType, eventTarget) {
+ var i = 0, len = interactions.length,
+ mouseEvent = (/mouse/i.test(pointer.pointerType || eventType)
+ // MSPointerEvent.MSPOINTER_TYPE_MOUSE
+ || pointer.pointerType === 4),
+ interaction;
+
+ var id = getPointerId(pointer);
+
+ // try to resume inertia with a new pointer
+ if (/down|start/i.test(eventType)) {
+ for (i = 0; i < len; i++) {
+ interaction = interactions[i];
+
+ var element = eventTarget;
+
+ if (interaction.inertiaStatus.active && interaction.target.options[interaction.prepared.name].inertia.allowResume
+ && (interaction.mouse === mouseEvent)) {
+ while (element) {
+ // if the element is the interaction element
+ if (element === interaction.element) {
+ // update the interaction's pointer
+ if (interaction.pointers[0]) {
+ interaction.removePointer(interaction.pointers[0]);
+ }
+ interaction.addPointer(pointer);
+
+ return interaction;
+ }
+ element = parentElement(element);
+ }
+ }
+ }
+ }
+
+ // if it's a mouse interaction
+ if (mouseEvent || !(supportsTouch || supportsPointerEvent)) {
+
+ // find a mouse interaction that's not in inertia phase
+ for (i = 0; i < len; i++) {
+ if (interactions[i].mouse && !interactions[i].inertiaStatus.active) {
+ return interactions[i];
+ }
+ }
+
+ // find any interaction specifically for mouse.
+ // if the eventType is a mousedown, and inertia is active
+ // ignore the interaction
+ for (i = 0; i < len; i++) {
+ if (interactions[i].mouse && !(/down/.test(eventType) && interactions[i].inertiaStatus.active)) {
+ return interaction;
+ }
+ }
+
+ // create a new interaction for mouse
+ interaction = new Interaction();
+ interaction.mouse = true;
+
+ return interaction;
+ }
+
+ // get interaction that has this pointer
+ for (i = 0; i < len; i++) {
+ if (contains(interactions[i].pointerIds, id)) {
+ return interactions[i];
+ }
+ }
+
+ // at this stage, a pointerUp should not return an interaction
+ if (/up|end|out/i.test(eventType)) {
+ return null;
+ }
+
+ // get first idle interaction
+ for (i = 0; i < len; i++) {
+ interaction = interactions[i];
+
+ if ((!interaction.prepared.name || (interaction.target.options.gesture.enabled))
+ && !interaction.interacting()
+ && !(!mouseEvent && interaction.mouse)) {
+
+ interaction.addPointer(pointer);
+
+ return interaction;
+ }
+ }
+
+ return new Interaction();
+ }
+
+ function doOnInteractions (method) {
+ return (function (event) {
+ var interaction,
+ eventTarget = getActualElement(event.path
+ ? event.path[0]
+ : event.target),
+ curEventTarget = getActualElement(event.currentTarget),
+ i;
+
+ if (supportsTouch && /touch/.test(event.type)) {
+ prevTouchTime = new Date().getTime();
+
+ for (i = 0; i < event.changedTouches.length; i++) {
+ var pointer = event.changedTouches[i];
+
+ interaction = getInteractionFromPointer(pointer, event.type, eventTarget);
+
+ if (!interaction) { continue; }
+
+ interaction._updateEventTargets(eventTarget, curEventTarget);
+
+ interaction[method](pointer, event, eventTarget, curEventTarget);
+ }
+ }
+ else {
+ if (!supportsPointerEvent && /mouse/.test(event.type)) {
+ // ignore mouse events while touch interactions are active
+ for (i = 0; i < interactions.length; i++) {
+ if (!interactions[i].mouse && interactions[i].pointerIsDown) {
+ return;
+ }
+ }
+
+ // try to ignore mouse events that are simulated by the browser
+ // after a touch event
+ if (new Date().getTime() - prevTouchTime < 500) {
+ return;
+ }
+ }
+
+ interaction = getInteractionFromPointer(event, event.type, eventTarget);
+
+ if (!interaction) { return; }
+
+ interaction._updateEventTargets(eventTarget, curEventTarget);
+
+ interaction[method](event, event, eventTarget, curEventTarget);
+ }
+ });
+ }
+
+ function InteractEvent (interaction, event, action, phase, element, related) {
+ var client,
+ page,
+ target = interaction.target,
+ snapStatus = interaction.snapStatus,
+ restrictStatus = interaction.restrictStatus,
+ pointers = interaction.pointers,
+ deltaSource = (target && target.options || defaultOptions).deltaSource,
+ sourceX = deltaSource + 'X',
+ sourceY = deltaSource + 'Y',
+ options = target? target.options: defaultOptions,
+ origin = getOriginXY(target, element),
+ starting = phase === 'start',
+ ending = phase === 'end',
+ coords = starting? interaction.startCoords : interaction.curCoords;
+
+ element = element || interaction.element;
+
+ page = extend({}, coords.page);
+ client = extend({}, coords.client);
+
+ page.x -= origin.x;
+ page.y -= origin.y;
+
+ client.x -= origin.x;
+ client.y -= origin.y;
+
+ var relativePoints = options[action].snap && options[action].snap.relativePoints ;
+
+ if (checkSnap(target, action) && !(starting && relativePoints && relativePoints.length)) {
+ this.snap = {
+ range : snapStatus.range,
+ locked : snapStatus.locked,
+ x : snapStatus.snappedX,
+ y : snapStatus.snappedY,
+ realX : snapStatus.realX,
+ realY : snapStatus.realY,
+ dx : snapStatus.dx,
+ dy : snapStatus.dy
+ };
+
+ if (snapStatus.locked) {
+ page.x += snapStatus.dx;
+ page.y += snapStatus.dy;
+ client.x += snapStatus.dx;
+ client.y += snapStatus.dy;
+ }
+ }
+
+ if (checkRestrict(target, action) && !(starting && options[action].restrict.elementRect) && restrictStatus.restricted) {
+ page.x += restrictStatus.dx;
+ page.y += restrictStatus.dy;
+ client.x += restrictStatus.dx;
+ client.y += restrictStatus.dy;
+
+ this.restrict = {
+ dx: restrictStatus.dx,
+ dy: restrictStatus.dy
+ };
+ }
+
+ this.pageX = page.x;
+ this.pageY = page.y;
+ this.clientX = client.x;
+ this.clientY = client.y;
+
+ this.x0 = interaction.startCoords.page.x;
+ this.y0 = interaction.startCoords.page.y;
+ this.clientX0 = interaction.startCoords.client.x;
+ this.clientY0 = interaction.startCoords.client.y;
+ this.ctrlKey = event.ctrlKey;
+ this.altKey = event.altKey;
+ this.shiftKey = event.shiftKey;
+ this.metaKey = event.metaKey;
+ this.button = event.button;
+ this.target = element;
+ this.t0 = interaction.downTimes[0];
+ this.type = action + (phase || '');
+
+ this.interaction = interaction;
+ this.interactable = target;
+
+ var inertiaStatus = interaction.inertiaStatus;
+
+ if (inertiaStatus.active) {
+ this.detail = 'inertia';
+ }
+
+ if (related) {
+ this.relatedTarget = related;
+ }
+
+ // end event dx, dy is difference between start and end points
+ if (ending) {
+ if (deltaSource === 'client') {
+ this.dx = client.x - interaction.startCoords.client.x;
+ this.dy = client.y - interaction.startCoords.client.y;
+ }
+ else {
+ this.dx = page.x - interaction.startCoords.page.x;
+ this.dy = page.y - interaction.startCoords.page.y;
+ }
+ }
+ else if (starting) {
+ this.dx = 0;
+ this.dy = 0;
+ }
+ // copy properties from previousmove if starting inertia
+ else if (phase === 'inertiastart') {
+ this.dx = interaction.prevEvent.dx;
+ this.dy = interaction.prevEvent.dy;
+ }
+ else {
+ if (deltaSource === 'client') {
+ this.dx = client.x - interaction.prevEvent.clientX;
+ this.dy = client.y - interaction.prevEvent.clientY;
+ }
+ else {
+ this.dx = page.x - interaction.prevEvent.pageX;
+ this.dy = page.y - interaction.prevEvent.pageY;
+ }
+ }
+ if (interaction.prevEvent && interaction.prevEvent.detail === 'inertia'
+ && !inertiaStatus.active
+ && options[action].inertia && options[action].inertia.zeroResumeDelta) {
+
+ inertiaStatus.resumeDx += this.dx;
+ inertiaStatus.resumeDy += this.dy;
+
+ this.dx = this.dy = 0;
+ }
+
+ if (action === 'resize' && interaction.resizeAxes) {
+ if (options.resize.square) {
+ if (interaction.resizeAxes === 'y') {
+ this.dx = this.dy;
+ }
+ else {
+ this.dy = this.dx;
+ }
+ this.axes = 'xy';
+ }
+ else {
+ this.axes = interaction.resizeAxes;
+
+ if (interaction.resizeAxes === 'x') {
+ this.dy = 0;
+ }
+ else if (interaction.resizeAxes === 'y') {
+ this.dx = 0;
+ }
+ }
+ }
+ else if (action === 'gesture') {
+ this.touches = [pointers[0], pointers[1]];
+
+ if (starting) {
+ this.distance = touchDistance(pointers, deltaSource);
+ this.box = touchBBox(pointers);
+ this.scale = 1;
+ this.ds = 0;
+ this.angle = touchAngle(pointers, undefined, deltaSource);
+ this.da = 0;
+ }
+ else if (ending || event instanceof InteractEvent) {
+ this.distance = interaction.prevEvent.distance;
+ this.box = interaction.prevEvent.box;
+ this.scale = interaction.prevEvent.scale;
+ this.ds = this.scale - 1;
+ this.angle = interaction.prevEvent.angle;
+ this.da = this.angle - interaction.gesture.startAngle;
+ }
+ else {
+ this.distance = touchDistance(pointers, deltaSource);
+ this.box = touchBBox(pointers);
+ this.scale = this.distance / interaction.gesture.startDistance;
+ this.angle = touchAngle(pointers, interaction.gesture.prevAngle, deltaSource);
+
+ this.ds = this.scale - interaction.gesture.prevScale;
+ this.da = this.angle - interaction.gesture.prevAngle;
+ }
+ }
+
+ if (starting) {
+ this.timeStamp = interaction.downTimes[0];
+ this.dt = 0;
+ this.duration = 0;
+ this.speed = 0;
+ this.velocityX = 0;
+ this.velocityY = 0;
+ }
+ else if (phase === 'inertiastart') {
+ this.timeStamp = interaction.prevEvent.timeStamp;
+ this.dt = interaction.prevEvent.dt;
+ this.duration = interaction.prevEvent.duration;
+ this.speed = interaction.prevEvent.speed;
+ this.velocityX = interaction.prevEvent.velocityX;
+ this.velocityY = interaction.prevEvent.velocityY;
+ }
+ else {
+ this.timeStamp = new Date().getTime();
+ this.dt = this.timeStamp - interaction.prevEvent.timeStamp;
+ this.duration = this.timeStamp - interaction.downTimes[0];
+
+ if (event instanceof InteractEvent) {
+ var dx = this[sourceX] - interaction.prevEvent[sourceX],
+ dy = this[sourceY] - interaction.prevEvent[sourceY],
+ dt = this.dt / 1000;
+
+ this.speed = hypot(dx, dy) / dt;
+ this.velocityX = dx / dt;
+ this.velocityY = dy / dt;
+ }
+ // if normal move or end event, use previous user event coords
+ else {
+ // speed and velocity in pixels per second
+ this.speed = interaction.pointerDelta[deltaSource].speed;
+ this.velocityX = interaction.pointerDelta[deltaSource].vx;
+ this.velocityY = interaction.pointerDelta[deltaSource].vy;
+ }
+ }
+
+ if ((ending || phase === 'inertiastart')
+ && interaction.prevEvent.speed > 600 && this.timeStamp - interaction.prevEvent.timeStamp < 150) {
+
+ var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI,
+ overlap = 22.5;
+
+ if (angle < 0) {
+ angle += 360;
+ }
+
+ var left = 135 - overlap <= angle && angle < 225 + overlap,
+ up = 225 - overlap <= angle && angle < 315 + overlap,
+
+ right = !left && (315 - overlap <= angle || angle < 45 + overlap),
+ down = !up && 45 - overlap <= angle && angle < 135 + overlap;
+
+ this.swipe = {
+ up : up,
+ down : down,
+ left : left,
+ right: right,
+ angle: angle,
+ speed: interaction.prevEvent.speed,
+ velocity: {
+ x: interaction.prevEvent.velocityX,
+ y: interaction.prevEvent.velocityY
+ }
+ };
+ }
+ }
+
+ InteractEvent.prototype = {
+ preventDefault: blank,
+ stopImmediatePropagation: function () {
+ this.immediatePropagationStopped = this.propagationStopped = true;
+ },
+ stopPropagation: function () {
+ this.propagationStopped = true;
+ }
+ };
+
+ function preventOriginalDefault () {
+ this.originalEvent.preventDefault();
+ }
+
+ function getActionCursor (action) {
+ var cursor = '';
+
+ if (action.name === 'drag') {
+ cursor = actionCursors.drag;
+ }
+ if (action.name === 'resize') {
+ if (action.axis) {
+ cursor = actionCursors[action.name + action.axis];
+ }
+ else if (action.edges) {
+ var cursorKey = 'resize',
+ edgeNames = ['top', 'bottom', 'left', 'right'];
+
+ for (var i = 0; i < 4; i++) {
+ if (action.edges[edgeNames[i]]) {
+ cursorKey += edgeNames[i];
+ }
+ }
+
+ cursor = actionCursors[cursorKey];
+ }
+ }
+
+ return cursor;
+ }
+
+ function checkResizeEdge (name, value, page, element, interactableElement, rect) {
+ // false, '', undefined, null
+ if (!value) { return false; }
+
+ // true value, use pointer coords and element rect
+ if (value === true) {
+ // if dimensions are negative, "switch" edges
+ var width = isNumber(rect.width)? rect.width : rect.right - rect.left,
+ height = isNumber(rect.height)? rect.height : rect.bottom - rect.top;
+
+ if (width < 0) {
+ if (name === 'left' ) { name = 'right'; }
+ else if (name === 'right') { name = 'left' ; }
+ }
+ if (height < 0) {
+ if (name === 'top' ) { name = 'bottom'; }
+ else if (name === 'bottom') { name = 'top' ; }
+ }
+
+ if (name === 'left' ) { return page.x < ((width >= 0? rect.left: rect.right ) + margin); }
+ if (name === 'top' ) { return page.y < ((height >= 0? rect.top : rect.bottom) + margin); }
+
+ if (name === 'right' ) { return page.x > ((width >= 0? rect.right : rect.left) - margin); }
+ if (name === 'bottom') { return page.y > ((height >= 0? rect.bottom: rect.top ) - margin); }
+ }
+
+ // the remaining checks require an element
+ if (!isElement(element)) { return false; }
+
+ return isElement(value)
+ // the value is an element to use as a resize handle
+ ? value === element
+ // otherwise check if element matches value as selector
+ : matchesUpTo(element, value, interactableElement);
+ }
+
+ function defaultActionChecker (pointer, interaction, element) {
+ var rect = this.getRect(element),
+ shouldResize = false,
+ action = null,
+ resizeAxes = null,
+ resizeEdges,
+ page = extend({}, interaction.curCoords.page),
+ options = this.options;
+
+ if (!rect) { return null; }
+
+ if (actionIsEnabled.resize && options.resize.enabled) {
+ var resizeOptions = options.resize;
+
+ resizeEdges = {
+ left: false, right: false, top: false, bottom: false
+ };
+
+ // if using resize.edges
+ if (isObject(resizeOptions.edges)) {
+ for (var edge in resizeEdges) {
+ resizeEdges[edge] = checkResizeEdge(edge,
+ resizeOptions.edges[edge],
+ page,
+ interaction._eventTarget,
+ element,
+ rect);
+ }
+
+ resizeEdges.left = resizeEdges.left && !resizeEdges.right;
+ resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
+
+ shouldResize = resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom;
+ }
+ else {
+ var right = options.resize.axis !== 'y' && page.x > (rect.right - margin),
+ bottom = options.resize.axis !== 'x' && page.y > (rect.bottom - margin);
+
+ shouldResize = right || bottom;
+ resizeAxes = (right? 'x' : '') + (bottom? 'y' : '');
+ }
+ }
+
+ action = shouldResize
+ ? 'resize'
+ : actionIsEnabled.drag && options.drag.enabled
+ ? 'drag'
+ : null;
+
+ if (actionIsEnabled.gesture
+ && interaction.pointerIds.length >=2
+ && !(interaction.dragging || interaction.resizing)) {
+ action = 'gesture';
+ }
+
+ if (action) {
+ return {
+ name: action,
+ axis: resizeAxes,
+ edges: resizeEdges
+ };
+ }
+
+ return null;
+ }
+
+ // Check if action is enabled globally and the current target supports it
+ // If so, return the validated action. Otherwise, return null
+ function validateAction (action, interactable) {
+ if (!isObject(action)) { return null; }
+
+ var actionName = action.name,
+ options = interactable.options;
+
+ if (( (actionName === 'resize' && options.resize.enabled )
+ || (actionName === 'drag' && options.drag.enabled )
+ || (actionName === 'gesture' && options.gesture.enabled))
+ && actionIsEnabled[actionName]) {
+
+ if (actionName === 'resize' || actionName === 'resizeyx') {
+ actionName = 'resizexy';
+ }
+
+ return action;
+ }
+ return null;
+ }
+
+ var listeners = {},
+ interactionListeners = [
+ 'dragStart', 'dragMove', 'resizeStart', 'resizeMove', 'gestureStart', 'gestureMove',
+ 'pointerOver', 'pointerOut', 'pointerHover', 'selectorDown',
+ 'pointerDown', 'pointerMove', 'pointerUp', 'pointerCancel', 'pointerEnd',
+ 'addPointer', 'removePointer', 'recordPointer',
+ ];
+
+ for (var i = 0, len = interactionListeners.length; i < len; i++) {
+ var name = interactionListeners[i];
+
+ listeners[name] = doOnInteractions(name);
+ }
+
+ // bound to the interactable context when a DOM event
+ // listener is added to a selector interactable
+ function delegateListener (event, useCapture) {
+ var fakeEvent = {},
+ delegated = delegatedEvents[event.type],
+ eventTarget = getActualElement(event.path
+ ? event.path[0]
+ : event.target),
+ element = eventTarget;
+
+ useCapture = useCapture? true: false;
+
+ // duplicate the event so that currentTarget can be changed
+ for (var prop in event) {
+ fakeEvent[prop] = event[prop];
+ }
+
+ fakeEvent.originalEvent = event;
+ fakeEvent.preventDefault = preventOriginalDefault;
+
+ // climb up document tree looking for selector matches
+ while (isElement(element)) {
+ for (var i = 0; i < delegated.selectors.length; i++) {
+ var selector = delegated.selectors[i],
+ context = delegated.contexts[i];
+
+ if (matchesSelector(element, selector)
+ && nodeContains(context, eventTarget)
+ && nodeContains(context, element)) {
+
+ var listeners = delegated.listeners[i];
+
+ fakeEvent.currentTarget = element;
+
+ for (var j = 0; j < listeners.length; j++) {
+ if (listeners[j][1] === useCapture) {
+ listeners[j][0](fakeEvent);
+ }
+ }
+ }
+ }
+
+ element = parentElement(element);
+ }
+ }
+
+ function delegateUseCapture (event) {
+ return delegateListener.call(this, event, true);
+ }
+
+ interactables.indexOfElement = function indexOfElement (element, context) {
+ context = context || document;
+
+ for (var i = 0; i < this.length; i++) {
+ var interactable = this[i];
+
+ if ((interactable.selector === element
+ && (interactable._context === context))
+ || (!interactable.selector && interactable._element === element)) {
+
+ return i;
+ }
+ }
+ return -1;
+ };
+
+ interactables.get = function interactableGet (element, options) {
+ return this[this.indexOfElement(element, options && options.context)];
+ };
+
+ interactables.forEachSelector = function (callback) {
+ for (var i = 0; i < this.length; i++) {
+ var interactable = this[i];
+
+ if (!interactable.selector) {
+ continue;
+ }
+
+ var ret = callback(interactable, interactable.selector, interactable._context, i, this);
+
+ if (ret !== undefined) {
+ return ret;
+ }
+ }
+ };
+
+ /*\
+ * interact
+ [ method ]
+ *
+ * The methods of this variable can be used to set elements as
+ * interactables and also to change various default settings.
+ *
+ * Calling it as a function and passing an element or a valid CSS selector
+ * string returns an Interactable object which has various methods to
+ * configure it.
+ *
+ - element (Element | string) The HTML or SVG Element to interact with or CSS selector
+ = (object) An @Interactable
+ *
+ > Usage
+ | interact(document.getElementById('draggable')).draggable(true);
+ |
+ | var rectables = interact('rect');
+ | rectables
+ | .gesturable(true)
+ | .on('gesturemove', function (event) {
+ | // something cool...
+ | })
+ | .autoScroll(true);
+ \*/
+ function interact (element, options) {
+ return interactables.get(element, options) || new Interactable(element, options);
+ }
+
+ /*\
+ * Interactable
+ [ property ]
+ **
+ * Object type returned by @interact
+ \*/
+ function Interactable (element, options) {
+ this._element = element;
+ this._iEvents = this._iEvents || {};
+
+ var _window;
+
+ if (trySelector(element)) {
+ this.selector = element;
+
+ var context = options && options.context;
+
+ _window = context? getWindow(context) : window;
+
+ if (context && (_window.Node
+ ? context instanceof _window.Node
+ : (isElement(context) || context === _window.document))) {
+
+ this._context = context;
+ }
+ }
+ else {
+ _window = getWindow(element);
+
+ if (isElement(element, _window)) {
+
+ if (PointerEvent) {
+ events.add(this._element, pEventTypes.down, listeners.pointerDown );
+ events.add(this._element, pEventTypes.move, listeners.pointerHover);
+ }
+ else {
+ events.add(this._element, 'mousedown' , listeners.pointerDown );
+ events.add(this._element, 'mousemove' , listeners.pointerHover);
+ events.add(this._element, 'touchstart', listeners.pointerDown );
+ events.add(this._element, 'touchmove' , listeners.pointerHover);
+ }
+ }
+ }
+
+ this._doc = _window.document;
+
+ if (!contains(documents, this._doc)) {
+ listenToDocument(this._doc);
+ }
+
+ interactables.push(this);
+
+ this.set(options);
+ }
+
+ Interactable.prototype = {
+ setOnEvents: function (action, phases) {
+ if (action === 'drop') {
+ if (isFunction(phases.ondrop) ) { this.ondrop = phases.ondrop ; }
+ if (isFunction(phases.ondropactivate) ) { this.ondropactivate = phases.ondropactivate ; }
+ if (isFunction(phases.ondropdeactivate)) { this.ondropdeactivate = phases.ondropdeactivate; }
+ if (isFunction(phases.ondragenter) ) { this.ondragenter = phases.ondragenter ; }
+ if (isFunction(phases.ondragleave) ) { this.ondragleave = phases.ondragleave ; }
+ if (isFunction(phases.ondropmove) ) { this.ondropmove = phases.ondropmove ; }
+ }
+ else {
+ action = 'on' + action;
+
+ if (isFunction(phases.onstart) ) { this[action + 'start' ] = phases.onstart ; }
+ if (isFunction(phases.onmove) ) { this[action + 'move' ] = phases.onmove ; }
+ if (isFunction(phases.onend) ) { this[action + 'end' ] = phases.onend ; }
+ if (isFunction(phases.oninertiastart)) { this[action + 'inertiastart' ] = phases.oninertiastart ; }
+ }
+
+ return this;
+ },
+
+ /*\
+ * Interactable.draggable
+ [ method ]
+ *
+ * Gets or sets whether drag actions can be performed on the
+ * Interactable
+ *
+ = (boolean) Indicates if this can be the target of drag events
+ | var isDraggable = interact('ul li').draggable();
+ * or
+ - options (boolean | object) #optional true/false or An object with event listeners to be fired on drag events (object makes the Interactable draggable)
+ = (object) This Interactable
+ | interact(element).draggable({
+ | onstart: function (event) {},
+ | onmove : function (event) {},
+ | onend : function (event) {},
+ |
+ | // the axis in which the first movement must be
+ | // for the drag sequence to start
+ | // 'xy' by default - any direction
+ | axis: 'x' || 'y' || 'xy',
+ |
+ | // max number of drags that can happen concurrently
+ | // with elements of this Interactable. Infinity by default
+ | max: Infinity,
+ |
+ | // max number of drags that can target the same element+Interactable
+ | // 1 by default
+ | maxPerElement: 2
+ | });
+ \*/
+ draggable: function (options) {
+ if (isObject(options)) {
+ this.options.drag.enabled = options.enabled === false? false: true;
+ this.setPerAction('drag', options);
+ this.setOnEvents('drag', options);
+
+ if (/^x$|^y$|^xy$/.test(options.axis)) {
+ this.options.drag.axis = options.axis;
+ }
+ else if (options.axis === null) {
+ delete this.options.drag.axis;
+ }
+
+ return this;
+ }
+
+ if (isBool(options)) {
+ this.options.drag.enabled = options;
+
+ return this;
+ }
+
+ return this.options.drag;
+ },
+
+ setPerAction: function (action, options) {
+ // for all the default per-action options
+ for (var option in options) {
+ // if this option exists for this action
+ if (option in defaultOptions[action]) {
+ // if the option in the options arg is an object value
+ if (isObject(options[option])) {
+ // duplicate the object
+ this.options[action][option] = extend(this.options[action][option] || {}, options[option]);
+
+ if (isObject(defaultOptions.perAction[option]) && 'enabled' in defaultOptions.perAction[option]) {
+ this.options[action][option].enabled = options[option].enabled === false? false : true;
+ }
+ }
+ else if (isBool(options[option]) && isObject(defaultOptions.perAction[option])) {
+ this.options[action][option].enabled = options[option];
+ }
+ else if (options[option] !== undefined) {
+ // or if it's not undefined, do a plain assignment
+ this.options[action][option] = options[option];
+ }
+ }
+ }
+ },
+
+ /*\
+ * Interactable.dropzone
+ [ method ]
+ *
+ * Returns or sets whether elements can be dropped onto this
+ * Interactable to trigger drop events
+ *
+ * Dropzones can receive the following events:
+ * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends
+ * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
+ * - `dragmove` when a draggable that has entered the dropzone is moved
+ * - `drop` when a draggable is dropped into this dropzone
+ *
+ * Use the `accept` option to allow only elements that match the given CSS selector or element.
+ *
+ * Use the `overlap` option to set how drops are checked for. The allowed values are:
+ * - `'pointer'`, the pointer must be over the dropzone (default)
+ * - `'center'`, the draggable element's center must be over the dropzone
+ * - a number from 0-1 which is the `(intersection area) / (draggable area)`.
+ * e.g. `0.5` for drop to happen when half of the area of the
+ * draggable is over the dropzone
+ *
+ - options (boolean | object | null) #optional The new value to be set.
+ | interact('.drop').dropzone({
+ | accept: '.can-drop' || document.getElementById('single-drop'),
+ | overlap: 'pointer' || 'center' || zeroToOne
+ | }
+ = (boolean | object) The current setting or this Interactable
+ \*/
+ dropzone: function (options) {
+ if (isObject(options)) {
+ this.options.drop.enabled = options.enabled === false? false: true;
+ this.setOnEvents('drop', options);
+ this.accept(options.accept);
+
+ if (/^(pointer|center)$/.test(options.overlap)) {
+ this.options.drop.overlap = options.overlap;
+ }
+ else if (isNumber(options.overlap)) {
+ this.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
+ }
+
+ return this;
+ }
+
+ if (isBool(options)) {
+ this.options.drop.enabled = options;
+
+ return this;
+ }
+
+ return this.options.drop;
+ },
+
+ dropCheck: function (pointer, draggable, draggableElement, dropElement, rect) {
+ var dropped = false;
+
+ // if the dropzone has no rect (eg. display: none)
+ // call the custom dropChecker or just return false
+ if (!(rect = rect || this.getRect(dropElement))) {
+ return (this.options.dropChecker
+ ? this.options.dropChecker(pointer, dropped, this, dropElement, draggable, draggableElement)
+ : false);
+ }
+
+ var dropOverlap = this.options.drop.overlap;
+
+ if (dropOverlap === 'pointer') {
+ var page = getPageXY(pointer),
+ origin = getOriginXY(draggable, draggableElement),
+ horizontal,
+ vertical;
+
+ page.x += origin.x;
+ page.y += origin.y;
+
+ horizontal = (page.x > rect.left) && (page.x < rect.right);
+ vertical = (page.y > rect.top ) && (page.y < rect.bottom);
+
+ dropped = horizontal && vertical;
+ }
+
+ var dragRect = draggable.getRect(draggableElement);
+
+ if (dropOverlap === 'center') {
+ var cx = dragRect.left + dragRect.width / 2,
+ cy = dragRect.top + dragRect.height / 2;
+
+ dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
+ }
+
+ if (isNumber(dropOverlap)) {
+ var overlapArea = (Math.max(0, Math.min(rect.right , dragRect.right ) - Math.max(rect.left, dragRect.left))
+ * Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top , dragRect.top ))),
+ overlapRatio = overlapArea / (dragRect.width * dragRect.height);
+
+ dropped = overlapRatio >= dropOverlap;
+ }
+
+ if (this.options.dropChecker) {
+ dropped = this.options.dropChecker(pointer, dropped, this, dropElement, draggable, draggableElement);
+ }
+
+ return dropped;
+ },
+
+ /*\
+ * Interactable.dropChecker
+ [ method ]
+ *
+ * Gets or sets the function used to check if a dragged element is
+ * over this Interactable. See @Interactable.dropCheck.
+ *
+ - checker (function) #optional
+ * The checker is a function which takes a mouseUp/touchEnd event as a
+ * parameter and returns true or false to indicate if the the current
+ * draggable can be dropped into this Interactable
+ *
+ - checker (function) The function that will be called when checking for a drop
+ * The checker function takes the following arguments:
+ *
+ - pointer (MouseEvent | PointerEvent | Touch) The pointer/event that ends a drag
+ - dropped (boolean) The value from the default drop check
+ - dropzone (Interactable) The dropzone interactable
+ - dropElement (Element) The dropzone element
+ - draggable (Interactable) The Interactable being dragged
+ - draggableElement (Element) The actual element that's being dragged
+ *
+ = (Function | Interactable) The checker function or this Interactable
+ \*/
+ dropChecker: function (checker) {
+ if (isFunction(checker)) {
+ this.options.dropChecker = checker;
+
+ return this;
+ }
+ if (checker === null) {
+ delete this.options.getRect;
+
+ return this;
+ }
+
+ return this.options.dropChecker;
+ },
+
+ /*\
+ * Interactable.accept
+ [ method ]
+ *
+ * Deprecated. add an `accept` property to the options object passed to
+ * @Interactable.dropzone instead.
+ *
+ * Gets or sets the Element or CSS selector match that this
+ * Interactable accepts if it is a dropzone.
+ *
+ - newValue (Element | string | null) #optional
+ * If it is an Element, then only that element can be dropped into this dropzone.
+ * If it is a string, the element being dragged must match it as a selector.
+ * If it is null, the accept options is cleared - it accepts any element.
+ *
+ = (string | Element | null | Interactable) The current accept option if given `undefined` or this Interactable
+ \*/
+ accept: function (newValue) {
+ if (isElement(newValue)) {
+ this.options.drop.accept = newValue;
+
+ return this;
+ }
+
+ // test if it is a valid CSS selector
+ if (trySelector(newValue)) {
+ this.options.drop.accept = newValue;
+
+ return this;
+ }
+
+ if (newValue === null) {
+ delete this.options.drop.accept;
+
+ return this;
+ }
+
+ return this.options.drop.accept;
+ },
+
+ /*\
+ * Interactable.resizable
+ [ method ]
+ *
+ * Gets or sets whether resize actions can be performed on the
+ * Interactable
+ *
+ = (boolean) Indicates if this can be the target of resize elements
+ | var isResizeable = interact('input[type=text]').resizable();
+ * or
+ - options (boolean | object) #optional true/false or An object with event listeners to be fired on resize events (object makes the Interactable resizable)
+ = (object) This Interactable
+ | interact(element).resizable({
+ | onstart: function (event) {},
+ | onmove : function (event) {},
+ | onend : function (event) {},
+ |
+ | edges: {
+ | top : true, // Use pointer coords to check for resize.
+ | left : false, // Disable resizing from left edge.
+ | bottom: '.resize-s',// Resize if pointer target matches selector
+ | right : handleEl // Resize if pointer target is the given Element
+ | },
+ |
+ | // a value of 'none' will limit the resize rect to a minimum of 0x0
+ | // 'negate' will allow the rect to have negative width/height
+ | // 'reposition' will keep the width/height positive by swapping
+ | // the top and bottom edges and/or swapping the left and right edges
+ | invert: 'none' || 'negate' || 'reposition'
+ |
+ | // limit multiple resizes.
+ | // See the explanation in the @Interactable.draggable example
+ | max: Infinity,
+ | maxPerElement: 1,
+ | });
+ \*/
+ resizable: function (options) {
+ if (isObject(options)) {
+ this.options.resize.enabled = options.enabled === false? false: true;
+ this.setPerAction('resize', options);
+ this.setOnEvents('resize', options);
+
+ if (/^x$|^y$|^xy$/.test(options.axis)) {
+ this.options.resize.axis = options.axis;
+ }
+ else if (options.axis === null) {
+ this.options.resize.axis = defaultOptions.resize.axis;
+ }
+
+ if (isBool(options.square)) {
+ this.options.resize.square = options.square;
+ }
+
+ return this;
+ }
+ if (isBool(options)) {
+ this.options.resize.enabled = options;
+
+ return this;
+ }
+ return this.options.resize;
+ },
+
+ /*\
+ * Interactable.squareResize
+ [ method ]
+ *
+ * Deprecated. Add a `square: true || false` property to @Interactable.resizable instead
+ *
+ * Gets or sets whether resizing is forced 1:1 aspect
+ *
+ = (boolean) Current setting
+ *
+ * or
+ *
+ - newValue (boolean) #optional
+ = (object) this Interactable
+ \*/
+ squareResize: function (newValue) {
+ if (isBool(newValue)) {
+ this.options.resize.square = newValue;
+
+ return this;
+ }
+
+ if (newValue === null) {
+ delete this.options.resize.square;
+
+ return this;
+ }
+
+ return this.options.resize.square;
+ },
+
+ /*\
+ * Interactable.gesturable
+ [ method ]
+ *
+ * Gets or sets whether multitouch gestures can be performed on the
+ * Interactable's element
+ *
+ = (boolean) Indicates if this can be the target of gesture events
+ | var isGestureable = interact(element).gesturable();
+ * or
+ - options (boolean | object) #optional true/false or An object with event listeners to be fired on gesture events (makes the Interactable gesturable)
+ = (object) this Interactable
+ | interact(element).gesturable({
+ | onstart: function (event) {},
+ | onmove : function (event) {},
+ | onend : function (event) {},
+ |
+ | // limit multiple gestures.
+ | // See the explanation in @Interactable.draggable example
+ | max: Infinity,
+ | maxPerElement: 1,
+ | });
+ \*/
+ gesturable: function (options) {
+ if (isObject(options)) {
+ this.options.gesture.enabled = options.enabled === false? false: true;
+ this.setPerAction('gesture', options);
+ this.setOnEvents('gesture', options);
+
+ return this;
+ }
+
+ if (isBool(options)) {
+ this.options.gesture.enabled = options;
+
+ return this;
+ }
+
+ return this.options.gesture;
+ },
+
+ /*\
+ * Interactable.autoScroll
+ [ method ]
+ **
+ * Deprecated. Add an `autoscroll` property to the options object
+ * passed to @Interactable.draggable or @Interactable.resizable instead.
+ *
+ * Returns or sets whether dragging and resizing near the edges of the
+ * window/container trigger autoScroll for this Interactable
+ *
+ = (object) Object with autoScroll properties
+ *
+ * or
+ *
+ - options (object | boolean) #optional
+ * options can be:
+ * - an object with margin, distance and interval properties,
+ * - true or false to enable or disable autoScroll or
+ = (Interactable) this Interactable
+ \*/
+ autoScroll: function (options) {
+ if (isObject(options)) {
+ options = extend({ actions: ['drag', 'resize']}, options);
+ }
+ else if (isBool(options)) {
+ options = { actions: ['drag', 'resize'], enabled: options };
+ }
+
+ return this.setOptions('autoScroll', options);
+ },
+
+ /*\
+ * Interactable.snap
+ [ method ]
+ **
+ * Deprecated. Add a `snap` property to the options object passed
+ * to @Interactable.draggable or @Interactable.resizable instead.
+ *
+ * Returns or sets if and how action coordinates are snapped. By
+ * default, snapping is relative to the pointer coordinates. You can
+ * change this by setting the
+ * [`elementOrigin`](https://github.com/taye/interact.js/pull/72).
+ **
+ = (boolean | object) `false` if snap is disabled; object with snap properties if snap is enabled
+ **
+ * or
+ **
+ - options (object | boolean | null) #optional
+ = (Interactable) this Interactable
+ > Usage
+ | interact(document.querySelector('#thing')).snap({
+ | targets: [
+ | // snap to this specific point
+ | {
+ | x: 100,
+ | y: 100,
+ | range: 25
+ | },
+ | // give this function the x and y page coords and snap to the object returned
+ | function (x, y) {
+ | return {
+ | x: x,
+ | y: (75 + 50 * Math.sin(x * 0.04)),
+ | range: 40
+ | };
+ | },
+ | // create a function that snaps to a grid
+ | interact.createSnapGrid({
+ | x: 50,
+ | y: 50,
+ | range: 10, // optional
+ | offset: { x: 5, y: 10 } // optional
+ | })
+ | ],
+ | // do not snap during normal movement.
+ | // Instead, trigger only one snapped move event
+ | // immediately before the end event.
+ | endOnly: true,
+ |
+ | relativePoints: [
+ | { x: 0, y: 0 }, // snap relative to the top left of the element
+ | { x: 1, y: 1 }, // and also to the bottom right
+ | ],
+ |
+ | // offset the snap target coordinates
+ | // can be an object with x/y or 'startCoords'
+ | offset: { x: 50, y: 50 }
+ | }
+ | });
+ \*/
+ snap: function (options) {
+ var ret = this.setOptions('snap', options);
+
+ if (ret === this) { return this; }
+
+ return ret.drag;
+ },
+
+ setOptions: function (option, options) {
+ var actions = options && isArray(options.actions)
+ ? options.actions
+ : ['drag'];
+
+ var i;
+
+ if (isObject(options) || isBool(options)) {
+ for (i = 0; i < actions.length; i++) {
+ var action = /resize/.test(actions[i])? 'resize' : actions[i];
+
+ if (!isObject(this.options[action])) { continue; }
+
+ var thisOption = this.options[action][option];
+
+ if (isObject(options)) {
+ extend(thisOption, options);
+ thisOption.enabled = options.enabled === false? false: true;
+
+ if (option === 'snap') {
+ if (thisOption.mode === 'grid') {
+ thisOption.targets = [
+ interact.createSnapGrid(extend({
+ offset: thisOption.gridOffset || { x: 0, y: 0 }
+ }, thisOption.grid || {}))
+ ];
+ }
+ else if (thisOption.mode === 'anchor') {
+ thisOption.targets = thisOption.anchors;
+ }
+ else if (thisOption.mode === 'path') {
+ thisOption.targets = thisOption.paths;
+ }
+
+ if ('elementOrigin' in options) {
+ thisOption.relativePoints = [options.elementOrigin];
+ }
+ }
+ }
+ else if (isBool(options)) {
+ thisOption.enabled = options;
+ }
+ }
+
+ return this;
+ }
+
+ var ret = {},
+ allActions = ['drag', 'resize', 'gesture'];
+
+ for (i = 0; i < allActions.length; i++) {
+ if (option in defaultOptions[allActions[i]]) {
+ ret[allActions[i]] = this.options[allActions[i]][option];
+ }
+ }
+
+ return ret;
+ },
+
+
+ /*\
+ * Interactable.inertia
+ [ method ]
+ **
+ * Deprecated. Add an `inertia` property to the options object passed
+ * to @Interactable.draggable or @Interactable.resizable instead.
+ *
+ * Returns or sets if and how events continue to run after the pointer is released
+ **
+ = (boolean | object) `false` if inertia is disabled; `object` with inertia properties if inertia is enabled
+ **
+ * or
+ **
+ - options (object | boolean | null) #optional
+ = (Interactable) this Interactable
+ > Usage
+ | // enable and use default settings
+ | interact(element).inertia(true);
+ |
+ | // enable and use custom settings
+ | interact(element).inertia({
+ | // value greater than 0
+ | // high values slow the object down more quickly
+ | resistance : 16,
+ |
+ | // the minimum launch speed (pixels per second) that results in inertia start
+ | minSpeed : 200,
+ |
+ | // inertia will stop when the object slows down to this speed
+ | endSpeed : 20,
+ |
+ | // boolean; should actions be resumed when the pointer goes down during inertia
+ | allowResume : true,
+ |
+ | // boolean; should the jump when resuming from inertia be ignored in event.dx/dy
+ | zeroResumeDelta: false,
+ |
+ | // if snap/restrict are set to be endOnly and inertia is enabled, releasing
+ | // the pointer without triggering inertia will animate from the release
+ | // point to the snaped/restricted point in the given amount of time (ms)
+ | smoothEndDuration: 300,
+ |
+ | // an array of action types that can have inertia (no gesture)
+ | actions : ['drag', 'resize']
+ | });
+ |
+ | // reset custom settings and use all defaults
+ | interact(element).inertia(null);
+ \*/
+ inertia: function (options) {
+ var ret = this.setOptions('inertia', options);
+
+ if (ret === this) { return this; }
+
+ return ret.drag;
+ },
+
+ getAction: function (pointer, interaction, element) {
+ var action = this.defaultActionChecker(pointer, interaction, element);
+
+ if (this.options.actionChecker) {
+ return this.options.actionChecker(pointer, action, this, element, interaction);
+ }
+
+ return action;
+ },
+
+ defaultActionChecker: defaultActionChecker,
+
+ /*\
+ * Interactable.actionChecker
+ [ method ]
+ *
+ * Gets or sets the function used to check action to be performed on
+ * pointerDown
+ *
+ - checker (function | null) #optional A function which takes a pointer event, defaultAction string, interactable, element and interaction as parameters and returns an object with name property 'drag' 'resize' or 'gesture' and optionally an `edges` object with boolean 'top', 'left', 'bottom' and right props.
+ = (Function | Interactable) The checker function or this Interactable
+ *
+ | interact('.resize-horiz').actionChecker(function (defaultAction, interactable) {
+ | return {
+ | // resize from the top and right edges
+ | name: 'resize',
+ | edges: { top: true, right: true }
+ | };
+ | });
+ \*/
+ actionChecker: function (checker) {
+ if (isFunction(checker)) {
+ this.options.actionChecker = checker;
+
+ return this;
+ }
+
+ if (checker === null) {
+ delete this.options.actionChecker;
+
+ return this;
+ }
+
+ return this.options.actionChecker;
+ },
+
+ /*\
+ * Interactable.getRect
+ [ method ]
+ *
+ * The default function to get an Interactables bounding rect. Can be
+ * overridden using @Interactable.rectChecker.
+ *
+ - element (Element) #optional The element to measure.
+ = (object) The object's bounding rectangle.
+ o {
+ o top : 0,
+ o left : 0,
+ o bottom: 0,
+ o right : 0,
+ o width : 0,
+ o height: 0
+ o }
+ \*/
+ getRect: function rectCheck (element) {
+ element = element || this._element;
+
+ if (this.selector && !(isElement(element))) {
+ element = this._context.querySelector(this.selector);
+ }
+
+ return getElementRect(element);
+ },
+
+ /*\
+ * Interactable.rectChecker
+ [ method ]
+ *
+ * Returns or sets the function used to calculate the interactable's
+ * element's rectangle
+ *
+ - checker (function) #optional A function which returns this Interactable's bounding rectangle. See @Interactable.getRect
+ = (function | object) The checker function or this Interactable
+ \*/
+ rectChecker: function (checker) {
+ if (isFunction(checker)) {
+ this.getRect = checker;
+
+ return this;
+ }
+
+ if (checker === null) {
+ delete this.options.getRect;
+
+ return this;
+ }
+
+ return this.getRect;
+ },
+
+ /*\
+ * Interactable.styleCursor
+ [ method ]
+ *
+ * Returns or sets whether the action that would be performed when the
+ * mouse on the element are checked on `mousemove` so that the cursor
+ * may be styled appropriately
+ *
+ - newValue (boolean) #optional
+ = (boolean | Interactable) The current setting or this Interactable
+ \*/
+ styleCursor: function (newValue) {
+ if (isBool(newValue)) {
+ this.options.styleCursor = newValue;
+
+ return this;
+ }
+
+ if (newValue === null) {
+ delete this.options.styleCursor;
+
+ return this;
+ }
+
+ return this.options.styleCursor;
+ },
+
+ /*\
+ * Interactable.preventDefault
+ [ method ]
+ *
+ * Returns or sets whether to prevent the browser's default behaviour
+ * in response to pointer events. Can be set to:
+ * - `'always'` to always prevent
+ * - `'never'` to never prevent
+ * - `'auto'` to let interact.js try to determine what would be best
+ *
+ - newValue (string) #optional `true`, `false` or `'auto'`
+ = (string | Interactable) The current setting or this Interactable
+ \*/
+ preventDefault: function (newValue) {
+ if (/^(always|never|auto)$/.test(newValue)) {
+ this.options.preventDefault = newValue;
+ return this;
+ }
+
+ if (isBool(newValue)) {
+ this.options.preventDefault = newValue? 'always' : 'never';
+ return this;
+ }
+
+ return this.options.preventDefault;
+ },
+
+ /*\
+ * Interactable.origin
+ [ method ]
+ *
+ * Gets or sets the origin of the Interactable's element. The x and y
+ * of the origin will be subtracted from action event coordinates.
+ *
+ - origin (object | string) #optional An object eg. { x: 0, y: 0 } or string 'parent', 'self' or any CSS selector
+ * OR
+ - origin (Element) #optional An HTML or SVG Element whose rect will be used
+ **
+ = (object) The current origin or this Interactable
+ \*/
+ origin: function (newValue) {
+ if (trySelector(newValue)) {
+ this.options.origin = newValue;
+ return this;
+ }
+ else if (isObject(newValue)) {
+ this.options.origin = newValue;
+ return this;
+ }
+
+ return this.options.origin;
+ },
+
+ /*\
+ * Interactable.deltaSource
+ [ method ]
+ *
+ * Returns or sets the mouse coordinate types used to calculate the
+ * movement of the pointer.
+ *
+ - newValue (string) #optional Use 'client' if you will be scrolling while interacting; Use 'page' if you want autoScroll to work
+ = (string | object) The current deltaSource or this Interactable
+ \*/
+ deltaSource: function (newValue) {
+ if (newValue === 'page' || newValue === 'client') {
+ this.options.deltaSource = newValue;
+
+ return this;
+ }
+
+ return this.options.deltaSource;
+ },
+
+ /*\
+ * Interactable.restrict
+ [ method ]
+ **
+ * Deprecated. Add a `restrict` property to the options object passed to
+ * @Interactable.draggable, @Interactable.resizable or @Interactable.gesturable instead.
+ *
+ * Returns or sets the rectangles within which actions on this
+ * interactable (after snap calculations) are restricted. By default,
+ * restricting is relative to the pointer coordinates. You can change
+ * this by setting the
+ * [`elementRect`](https://github.com/taye/interact.js/pull/72).
+ **
+ - options (object) #optional an object with keys drag, resize, and/or gesture whose values are rects, Elements, CSS selectors, or 'parent' or 'self'
+ = (object) The current restrictions object or this Interactable
+ **
+ | interact(element).restrict({
+ | // the rect will be `interact.getElementRect(element.parentNode)`
+ | drag: element.parentNode,
+ |
+ | // x and y are relative to the the interactable's origin
+ | resize: { x: 100, y: 100, width: 200, height: 200 }
+ | })
+ |
+ | interact('.draggable').restrict({
+ | // the rect will be the selected element's parent
+ | drag: 'parent',
+ |
+ | // do not restrict during normal movement.
+ | // Instead, trigger only one restricted move event
+ | // immediately before the end event.
+ | endOnly: true,
+ |
+ | // https://github.com/taye/interact.js/pull/72#issue-41813493
+ | elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
+ | });
+ \*/
+ restrict: function (options) {
+ if (!isObject(options)) {
+ return this.setOptions('restrict', options);
+ }
+
+ var actions = ['drag', 'resize', 'gesture'],
+ ret;
+
+ for (var i = 0; i < actions.length; i++) {
+ var action = actions[i];
+
+ if (action in options) {
+ var perAction = extend({
+ actions: [action],
+ restriction: options[action]
+ }, options);
+
+ ret = this.setOptions('restrict', perAction);
+ }
+ }
+
+ return ret;
+ },
+
+ /*\
+ * Interactable.context
+ [ method ]
+ *
+ * Gets the selector context Node of the Interactable. The default is `window.document`.
+ *
+ = (Node) The context Node of this Interactable
+ **
+ \*/
+ context: function () {
+ return this._context;
+ },
+
+ _context: document,
+
+ /*\
+ * Interactable.ignoreFrom
+ [ method ]
+ *
+ * If the target of the `mousedown`, `pointerdown` or `touchstart`
+ * event or any of it's parents match the given CSS selector or
+ * Element, no drag/resize/gesture is started.
+ *
+ - newValue (string | Element | null) #optional a CSS selector string, an Element or `null` to not ignore any elements
+ = (string | Element | object) The current ignoreFrom value or this Interactable
+ **
+ | interact(element, { ignoreFrom: document.getElementById('no-action') });
+ | // or
+ | interact(element).ignoreFrom('input, textarea, a');
+ \*/
+ ignoreFrom: function (newValue) {
+ if (trySelector(newValue)) { // CSS selector to match event.target
+ this.options.ignoreFrom = newValue;
+ return this;
+ }
+
+ if (isElement(newValue)) { // specific element
+ this.options.ignoreFrom = newValue;
+ return this;
+ }
+
+ return this.options.ignoreFrom;
+ },
+
+ /*\
+ * Interactable.allowFrom
+ [ method ]
+ *
+ * A drag/resize/gesture is started only If the target of the
+ * `mousedown`, `pointerdown` or `touchstart` event or any of it's
+ * parents match the given CSS selector or Element.
+ *
+ - newValue (string | Element | null) #optional a CSS selector string, an Element or `null` to allow from any element
+ = (string | Element | object) The current allowFrom value or this Interactable
+ **
+ | interact(element, { allowFrom: document.getElementById('drag-handle') });
+ | // or
+ | interact(element).allowFrom('.handle');
+ \*/
+ allowFrom: function (newValue) {
+ if (trySelector(newValue)) { // CSS selector to match event.target
+ this.options.allowFrom = newValue;
+ return this;
+ }
+
+ if (isElement(newValue)) { // specific element
+ this.options.allowFrom = newValue;
+ return this;
+ }
+
+ return this.options.allowFrom;
+ },
+
+ /*\
+ * Interactable.element
+ [ method ]
+ *
+ * If this is not a selector Interactable, it returns the element this
+ * interactable represents
+ *
+ = (Element) HTML / SVG Element
+ \*/
+ element: function () {
+ return this._element;
+ },
+
+ /*\
+ * Interactable.fire
+ [ method ]
+ *
+ * Calls listeners for the given InteractEvent type bound globally
+ * and directly to this Interactable
+ *
+ - iEvent (InteractEvent) The InteractEvent object to be fired on this Interactable
+ = (Interactable) this Interactable
+ \*/
+ fire: function (iEvent) {
+ if (!(iEvent && iEvent.type) || !contains(eventTypes, iEvent.type)) {
+ return this;
+ }
+
+ var listeners,
+ i,
+ len,
+ onEvent = 'on' + iEvent.type,
+ funcName = '';
+
+ // Interactable#on() listeners
+ if (iEvent.type in this._iEvents) {
+ listeners = this._iEvents[iEvent.type];
+
+ for (i = 0, len = listeners.length; i < len && !iEvent.immediatePropagationStopped; i++) {
+ funcName = listeners[i].name;
+ listeners[i](iEvent);
+ }
+ }
+
+ // interactable.onevent listener
+ if (isFunction(this[onEvent])) {
+ funcName = this[onEvent].name;
+ this[onEvent](iEvent);
+ }
+
+ // interact.on() listeners
+ if (iEvent.type in globalEvents && (listeners = globalEvents[iEvent.type])) {
+
+ for (i = 0, len = listeners.length; i < len && !iEvent.immediatePropagationStopped; i++) {
+ funcName = listeners[i].name;
+ listeners[i](iEvent);
+ }
+ }
+
+ return this;
+ },
+
+ /*\
+ * Interactable.on
+ [ method ]
+ *
+ * Binds a listener for an InteractEvent or DOM event.
+ *
+ - eventType (string | array | object) The types of events to listen for
+ - listener (function) The function to be called on the given event(s)
+ - useCapture (boolean) #optional useCapture flag for addEventListener
+ = (object) This Interactable
+ \*/
+ on: function (eventType, listener, useCapture) {
+ var i;
+
+ if (isString(eventType) && eventType.search(' ') !== -1) {
+ eventType = eventType.trim().split(/ +/);
+ }
+
+ if (isArray(eventType)) {
+ for (i = 0; i < eventType.length; i++) {
+ this.on(eventType[i], listener, useCapture);
+ }
+
+ return this;
+ }
+
+ if (isObject(eventType)) {
+ for (var prop in eventType) {
+ this.on(prop, eventType[prop], listener);
+ }
+
+ return this;
+ }
+
+ if (eventType === 'wheel') {
+ eventType = wheelEvent;
+ }
+
+ // convert to boolean
+ useCapture = useCapture? true: false;
+
+ if (contains(eventTypes, eventType)) {
+ // if this type of event was never bound to this Interactable
+ if (!(eventType in this._iEvents)) {
+ this._iEvents[eventType] = [listener];
+ }
+ else {
+ this._iEvents[eventType].push(listener);
+ }
+ }
+ // delegated event for selector
+ else if (this.selector) {
+ if (!delegatedEvents[eventType]) {
+ delegatedEvents[eventType] = {
+ selectors: [],
+ contexts : [],
+ listeners: []
+ };
+
+ // add delegate listener functions
+ for (i = 0; i < documents.length; i++) {
+ events.add(documents[i], eventType, delegateListener);
+ events.add(documents[i], eventType, delegateUseCapture, true);
+ }
+ }
+
+ var delegated = delegatedEvents[eventType],
+ index;
+
+ for (index = delegated.selectors.length - 1; index >= 0; index--) {
+ if (delegated.selectors[index] === this.selector
+ && delegated.contexts[index] === this._context) {
+ break;
+ }
+ }
+
+ if (index === -1) {
+ index = delegated.selectors.length;
+
+ delegated.selectors.push(this.selector);
+ delegated.contexts .push(this._context);
+ delegated.listeners.push([]);
+ }
+
+ // keep listener and useCapture flag
+ delegated.listeners[index].push([listener, useCapture]);
+ }
+ else {
+ events.add(this._element, eventType, listener, useCapture);
+ }
+
+ return this;
+ },
+
+ /*\
+ * Interactable.off
+ [ method ]
+ *
+ * Removes an InteractEvent or DOM event listener
+ *
+ - eventType (string | array | object) The types of events that were listened for
+ - listener (function) The listener function to be removed
+ - useCapture (boolean) #optional useCapture flag for removeEventListener
+ = (object) This Interactable
+ \*/
+ off: function (eventType, listener, useCapture) {
+ var i;
+
+ if (isString(eventType) && eventType.search(' ') !== -1) {
+ eventType = eventType.trim().split(/ +/);
+ }
+
+ if (isArray(eventType)) {
+ for (i = 0; i < eventType.length; i++) {
+ this.off(eventType[i], listener, useCapture);
+ }
+
+ return this;
+ }
+
+ if (isObject(eventType)) {
+ for (var prop in eventType) {
+ this.off(prop, eventType[prop], listener);
+ }
+
+ return this;
+ }
+
+ var eventList,
+ index = -1;
+
+ // convert to boolean
+ useCapture = useCapture? true: false;
+
+ if (eventType === 'wheel') {
+ eventType = wheelEvent;
+ }
+
+ // if it is an action event type
+ if (contains(eventTypes, eventType)) {
+ eventList = this._iEvents[eventType];
+
+ if (eventList && (index = indexOf(eventList, listener)) !== -1) {
+ this._iEvents[eventType].splice(index, 1);
+ }
+ }
+ // delegated event
+ else if (this.selector) {
+ var delegated = delegatedEvents[eventType],
+ matchFound = false;
+
+ if (!delegated) { return this; }
+
+ // count from last index of delegated to 0
+ for (index = delegated.selectors.length - 1; index >= 0; index--) {
+ // look for matching selector and context Node
+ if (delegated.selectors[index] === this.selector
+ && delegated.contexts[index] === this._context) {
+
+ var listeners = delegated.listeners[index];
+
+ // each item of the listeners array is an array: [function, useCaptureFlag]
+ for (i = listeners.length - 1; i >= 0; i--) {
+ var fn = listeners[i][0],
+ useCap = listeners[i][1];
+
+ // check if the listener functions and useCapture flags match
+ if (fn === listener && useCap === useCapture) {
+ // remove the listener from the array of listeners
+ listeners.splice(i, 1);
+
+ // if all listeners for this interactable have been removed
+ // remove the interactable from the delegated arrays
+ if (!listeners.length) {
+ delegated.selectors.splice(index, 1);
+ delegated.contexts .splice(index, 1);
+ delegated.listeners.splice(index, 1);
+
+ // remove delegate function from context
+ events.remove(this._context, eventType, delegateListener);
+ events.remove(this._context, eventType, delegateUseCapture, true);
+
+ // remove the arrays if they are empty
+ if (!delegated.selectors.length) {
+ delegatedEvents[eventType] = null;
+ }
+ }
+
+ // only remove one listener
+ matchFound = true;
+ break;
+ }
+ }
+
+ if (matchFound) { break; }
+ }
+ }
+ }
+ // remove listener from this Interatable's element
+ else {
+ events.remove(this._element, eventType, listener, useCapture);
+ }
+
+ return this;
+ },
+
+ /*\
+ * Interactable.set
+ [ method ]
+ *
+ * Reset the options of this Interactable
+ - options (object) The new settings to apply
+ = (object) This Interactablw
+ \*/
+ set: function (options) {
+ if (!isObject(options)) {
+ options = {};
+ }
+
+ this.options = extend({}, defaultOptions.base);
+
+ var i,
+ actions = ['drag', 'drop', 'resize', 'gesture'],
+ methods = ['draggable', 'dropzone', 'resizable', 'gesturable'],
+ perActions = extend(extend({}, defaultOptions.perAction), options[action] || {});
+
+ for (i = 0; i < actions.length; i++) {
+ var action = actions[i];
+
+ this.options[action] = extend({}, defaultOptions[action]);
+
+ this.setPerAction(action, perActions);
+
+ this[methods[i]](options[action]);
+ }
+
+ var settings = [
+ 'accept', 'actionChecker', 'allowFrom', 'deltaSource',
+ 'dropChecker', 'ignoreFrom', 'origin', 'preventDefault',
+ 'rectChecker'
+ ];
+
+ for (i = 0, len = settings.length; i < len; i++) {
+ var setting = settings[i];
+
+ this.options[setting] = defaultOptions.base[setting];
+
+ if (setting in options) {
+ this[setting](options[setting]);
+ }
+ }
+
+ return this;
+ },
+
+ /*\
+ * Interactable.unset
+ [ method ]
+ *
+ * Remove this interactable from the list of interactables and remove
+ * it's drag, drop, resize and gesture capabilities
+ *
+ = (object) @interact
+ \*/
+ unset: function () {
+ events.remove(this, 'all');
+
+ if (!isString(this.selector)) {
+ events.remove(this, 'all');
+ if (this.options.styleCursor) {
+ this._element.style.cursor = '';
+ }
+ }
+ else {
+ // remove delegated events
+ for (var type in delegatedEvents) {
+ var delegated = delegatedEvents[type];
+
+ for (var i = 0; i < delegated.selectors.length; i++) {
+ if (delegated.selectors[i] === this.selector
+ && delegated.contexts[i] === this._context) {
+
+ delegated.selectors.splice(i, 1);
+ delegated.contexts .splice(i, 1);
+ delegated.listeners.splice(i, 1);
+
+ // remove the arrays if they are empty
+ if (!delegated.selectors.length) {
+ delegatedEvents[type] = null;
+ }
+ }
+
+ events.remove(this._context, type, delegateListener);
+ events.remove(this._context, type, delegateUseCapture, true);
+
+ break;
+ }
+ }
+ }
+
+ this.dropzone(false);
+
+ interactables.splice(indexOf(interactables, this), 1);
+
+ return interact;
+ }
+ };
+
+ function warnOnce (method, message) {
+ var warned = false;
+
+ return function () {
+ if (!warned) {
+ window.console.warn(message);
+ warned = true;
+ }
+
+ return method.apply(this, arguments);
+ };
+ }
+
+ Interactable.prototype.snap = warnOnce(Interactable.prototype.snap,
+ 'Interactable#snap is deprecated. See the new documentation for snapping at http://interactjs.io/docs/snapping');
+ Interactable.prototype.restrict = warnOnce(Interactable.prototype.restrict,
+ 'Interactable#restrict is deprecated. See the new documentation for resticting at http://interactjs.io/docs/restriction');
+ Interactable.prototype.inertia = warnOnce(Interactable.prototype.inertia,
+ 'Interactable#inertia is deprecated. See the new documentation for inertia at http://interactjs.io/docs/inertia');
+ Interactable.prototype.autoScroll = warnOnce(Interactable.prototype.autoScroll,
+ 'Interactable#autoScroll is deprecated. See the new documentation for autoScroll at http://interactjs.io/docs/#autoscroll');
+
+ /*\
+ * interact.isSet
+ [ method ]
+ *
+ * Check if an element has been set
+ - element (Element) The Element being searched for
+ = (boolean) Indicates if the element or CSS selector was previously passed to interact
+ \*/
+ interact.isSet = function(element, options) {
+ return interactables.indexOfElement(element, options && options.context) !== -1;
+ };
+
+ /*\
+ * interact.on
+ [ method ]
+ *
+ * Adds a global listener for an InteractEvent or adds a DOM event to
+ * `document`
+ *
+ - type (string | array | object) The types of events to listen for
+ - listener (function) The function to be called on the given event(s)
+ - useCapture (boolean) #optional useCapture flag for addEventListener
+ = (object) interact
+ \*/
+ interact.on = function (type, listener, useCapture) {
+ if (isString(type) && type.search(' ') !== -1) {
+ type = type.trim().split(/ +/);
+ }
+
+ if (isArray(type)) {
+ for (var i = 0; i < type.length; i++) {
+ interact.on(type[i], listener, useCapture);
+ }
+
+ return interact;
+ }
+
+ if (isObject(type)) {
+ for (var prop in type) {
+ interact.on(prop, type[prop], listener);
+ }
+
+ return interact;
+ }
+
+ // if it is an InteractEvent type, add listener to globalEvents
+ if (contains(eventTypes, type)) {
+ // if this type of event was never bound
+ if (!globalEvents[type]) {
+ globalEvents[type] = [listener];
+ }
+ else {
+ globalEvents[type].push(listener);
+ }
+ }
+ // If non InteractEvent type, addEventListener to document
+ else {
+ events.add(document, type, listener, useCapture);
+ }
+
+ return interact;
+ };
+
+ /*\
+ * interact.off
+ [ method ]
+ *
+ * Removes a global InteractEvent listener or DOM event from `document`
+ *
+ - type (string | array | object) The types of events that were listened for
+ - listener (function) The listener function to be removed
+ - useCapture (boolean) #optional useCapture flag for removeEventListener
+ = (object) interact
+ \*/
+ interact.off = function (type, listener, useCapture) {
+ if (isString(type) && type.search(' ') !== -1) {
+ type = type.trim().split(/ +/);
+ }
+
+ if (isArray(type)) {
+ for (var i = 0; i < type.length; i++) {
+ interact.off(type[i], listener, useCapture);
+ }
+
+ return interact;
+ }
+
+ if (isObject(type)) {
+ for (var prop in type) {
+ interact.off(prop, type[prop], listener);
+ }
+
+ return interact;
+ }
+
+ if (!contains(eventTypes, type)) {
+ events.remove(document, type, listener, useCapture);
+ }
+ else {
+ var index;
+
+ if (type in globalEvents
+ && (index = indexOf(globalEvents[type], listener)) !== -1) {
+ globalEvents[type].splice(index, 1);
+ }
+ }
+
+ return interact;
+ };
+
+ /*\
+ * interact.enableDragging
+ [ method ]
+ *
+ * Deprecated.
+ *
+ * Returns or sets whether dragging is enabled for any Interactables
+ *
+ - newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
+ = (boolean | object) The current setting or interact
+ \*/
+ interact.enableDragging = warnOnce(function (newValue) {
+ if (newValue !== null && newValue !== undefined) {
+ actionIsEnabled.drag = newValue;
+
+ return interact;
+ }
+ return actionIsEnabled.drag;
+ }, 'interact.enableDragging is deprecated and will soon be removed.');
+
+ /*\
+ * interact.enableResizing
+ [ method ]
+ *
+ * Deprecated.
+ *
+ * Returns or sets whether resizing is enabled for any Interactables
+ *
+ - newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
+ = (boolean | object) The current setting or interact
+ \*/
+ interact.enableResizing = warnOnce(function (newValue) {
+ if (newValue !== null && newValue !== undefined) {
+ actionIsEnabled.resize = newValue;
+
+ return interact;
+ }
+ return actionIsEnabled.resize;
+ }, 'interact.enableResizing is deprecated and will soon be removed.');
+
+ /*\
+ * interact.enableGesturing
+ [ method ]
+ *
+ * Deprecated.
+ *
+ * Returns or sets whether gesturing is enabled for any Interactables
+ *
+ - newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
+ = (boolean | object) The current setting or interact
+ \*/
+ interact.enableGesturing = warnOnce(function (newValue) {
+ if (newValue !== null && newValue !== undefined) {
+ actionIsEnabled.gesture = newValue;
+
+ return interact;
+ }
+ return actionIsEnabled.gesture;
+ }, 'interact.enableGesturing is deprecated and will soon be removed.');
+
+ interact.eventTypes = eventTypes;
+
+ /*\
+ * interact.debug
+ [ method ]
+ *
+ * Returns debugging data
+ = (object) An object with properties that outline the current state and expose internal functions and variables
+ \*/
+ interact.debug = function () {
+ var interaction = interactions[0] || new Interaction();
+
+ return {
+ interactions : interactions,
+ target : interaction.target,
+ dragging : interaction.dragging,
+ resizing : interaction.resizing,
+ gesturing : interaction.gesturing,
+ prepared : interaction.prepared,
+ matches : interaction.matches,
+ matchElements : interaction.matchElements,
+
+ prevCoords : interaction.prevCoords,
+ startCoords : interaction.startCoords,
+
+ pointerIds : interaction.pointerIds,
+ pointers : interaction.pointers,
+ addPointer : listeners.addPointer,
+ removePointer : listeners.removePointer,
+ recordPointer : listeners.recordPointer,
+
+ snap : interaction.snapStatus,
+ restrict : interaction.restrictStatus,
+ inertia : interaction.inertiaStatus,
+
+ downTime : interaction.downTimes[0],
+ downEvent : interaction.downEvent,
+ downPointer : interaction.downPointer,
+ prevEvent : interaction.prevEvent,
+
+ Interactable : Interactable,
+ interactables : interactables,
+ pointerIsDown : interaction.pointerIsDown,
+ defaultOptions : defaultOptions,
+ defaultActionChecker : defaultActionChecker,
+
+ actionCursors : actionCursors,
+ dragMove : listeners.dragMove,
+ resizeMove : listeners.resizeMove,
+ gestureMove : listeners.gestureMove,
+ pointerUp : listeners.pointerUp,
+ pointerDown : listeners.pointerDown,
+ pointerMove : listeners.pointerMove,
+ pointerHover : listeners.pointerHover,
+
+ events : events,
+ globalEvents : globalEvents,
+ delegatedEvents : delegatedEvents
+ };
+ };
+
+ // expose the functions used to calculate multi-touch properties
+ interact.getTouchAverage = touchAverage;
+ interact.getTouchBBox = touchBBox;
+ interact.getTouchDistance = touchDistance;
+ interact.getTouchAngle = touchAngle;
+
+ interact.getElementRect = getElementRect;
+ interact.matchesSelector = matchesSelector;
+ interact.closest = closest;
+
+ /*\
+ * interact.margin
+ [ method ]
+ *
+ * Returns or sets the margin for autocheck resizing used in
+ * @Interactable.getAction. That is the distance from the bottom and right
+ * edges of an element clicking in which will start resizing
+ *
+ - newValue (number) #optional
+ = (number | interact) The current margin value or interact
+ \*/
+ interact.margin = function (newvalue) {
+ if (isNumber(newvalue)) {
+ margin = newvalue;
+
+ return interact;
+ }
+ return margin;
+ };
+
+ /*\
+ * interact.supportsTouch
+ [ method ]
+ *
+ = (boolean) Whether or not the browser supports touch input
+ \*/
+ interact.supportsTouch = function () {
+ return supportsTouch;
+ };
+
+ /*\
+ * interact.supportsPointerEvent
+ [ method ]
+ *
+ = (boolean) Whether or not the browser supports PointerEvents
+ \*/
+ interact.supportsPointerEvent = function () {
+ return supportsPointerEvent;
+ };
+
+ /*\
+ * interact.stop
+ [ method ]
+ *
+ * Cancels all interactions (end events are not fired)
+ *
+ - event (Event) An event on which to call preventDefault()
+ = (object) interact
+ \*/
+ interact.stop = function (event) {
+ for (var i = interactions.length - 1; i > 0; i--) {
+ interactions[i].stop(event);
+ }
+
+ return interact;
+ };
+
+ /*\
+ * interact.dynamicDrop
+ [ method ]
+ *
+ * Returns or sets whether the dimensions of dropzone elements are
+ * calculated on every dragmove or only on dragstart for the default
+ * dropChecker
+ *
+ - newValue (boolean) #optional True to check on each move. False to check only before start
+ = (boolean | interact) The current setting or interact
+ \*/
+ interact.dynamicDrop = function (newValue) {
+ if (isBool(newValue)) {
+ //if (dragging && dynamicDrop !== newValue && !newValue) {
+ //calcRects(dropzones);
+ //}
+
+ dynamicDrop = newValue;
+
+ return interact;
+ }
+ return dynamicDrop;
+ };
+
+ /*\
+ * interact.pointerMoveTolerance
+ [ method ]
+ * Returns or sets the distance the pointer must be moved before an action
+ * sequence occurs. This also affects tolerance for tap events.
+ *
+ - newValue (number) #optional The movement from the start position must be greater than this value
+ = (number | Interactable) The current setting or interact
+ \*/
+ interact.pointerMoveTolerance = function (newValue) {
+ if (isNumber(newValue)) {
+ pointerMoveTolerance = newValue;
+
+ return this;
+ }
+
+ return pointerMoveTolerance;
+ };
+
+ /*\
+ * interact.maxInteractions
+ [ method ]
+ **
+ * Returns or sets the maximum number of concurrent interactions allowed.
+ * By default only 1 interaction is allowed at a time (for backwards
+ * compatibility). To allow multiple interactions on the same Interactables
+ * and elements, you need to enable it in the draggable, resizable and
+ * gesturable `'max'` and `'maxPerElement'` options.
+ **
+ - newValue (number) #optional Any number. newValue <= 0 means no interactions.
+ \*/
+ interact.maxInteractions = function (newValue) {
+ if (isNumber(newValue)) {
+ maxInteractions = newValue;
+
+ return this;
+ }
+
+ return maxInteractions;
+ };
+
+ interact.createSnapGrid = function (grid) {
+ return function (x, y) {
+ var offsetX = 0,
+ offsetY = 0;
+
+ if (isObject(grid.offset)) {
+ offsetX = grid.offset.x;
+ offsetY = grid.offset.y;
+ }
+
+ var gridx = Math.round((x - offsetX) / grid.x),
+ gridy = Math.round((y - offsetY) / grid.y),
+
+ newX = gridx * grid.x + offsetX,
+ newY = gridy * grid.y + offsetY;
+
+ return {
+ x: newX,
+ y: newY,
+ range: grid.range
+ };
+ };
+ };
+
+ ///////////////////////////
+ interact.createLifelineSnapGrid = function () {
+
+ return function (x, y) {
+
+ var firstRun = true;
+ getLifelines(); //Returns lifelineX[]
+ for (i = 0; i<lifelineX.length; i++){
+ var lifelineCorrected = lifelineX[i][0]-12;
+
+ var delta = Math.abs(lifelineCorrected-rightX);
+ if (firstRun == true) {
+ var snapToMe = lifelineCorrected //Corrected lifeline assigned as snap value
+ firstRun = false;
+ var snapDelta = delta; //stores delta for the snap value
+ }
+ else {
+ if (delta < snapDelta) {
+ snapToMe = lifelineCorrected; //Corrected lifeline assigned as snap value
+ var snapDelta = delta; //stores delta for the snap value
+ }
+ }
+ }
+ //console.log(snapToMe);
+ if (snapToMe - rightX<0){ //Right of lifeline
+ var oldWide = $("#"+currentArrow).width();
+ var newWide = oldWide-snapDelta;
+ //console.log(oldWide);
+ //console.log(newWide);
+ $("#"+currentArrow).width(newWide);
+ }
+ if (snapToMe - rightX>0){ //Left of lifeline
+ var oldWide = $("#"+currentArrow).width();
+ var newWide = oldWide+snapDelta;
+ //console.log(oldWide);
+ //console.log(newWide);
+ $("#"+currentArrow).width(newWide);
+ }
+
+
+
+
+
+ ///////
+ var firstRun = true;
+ for (i = 0; i<lifelineX.length; i++){
+ var lifelineCorrected = lifelineX[i][0]; //-12
+
+ var delta = Math.abs(lifelineCorrected-leftX);
+ if (firstRun == true) {
+ var snapToMe = lifelineCorrected //Corrected lifeline assigned as snap value
+ firstRun = false;
+ var snapDelta = delta; //stores delta for the snap value
+ var newX = lifelineCorrected
+ }
+ else {
+ if (delta < snapDelta) {
+ snapToMe = lifelineCorrected; //Corrected lifeline assigned as snap value
+ var snapDelta = delta; //stores delta for the snap value
+ newX = lifelineCorrected
+ }
+ }
+ }
+ //console.log(snapToMe);
+ if (snapToMe - leftX<0){ //Right of lifeline
+ var oldWide = $("#"+currentArrow).width();
+ var newWide = oldWide+snapDelta;
+ //console.log(oldWide);
+ //console.log(newWide);
+ $("#"+currentArrow).width(newWide);
+
+ document.getElementById(currentArrow).style.webkitTransform = document.getElementById(currentArrow).style.transform =
+ 'translate(' + newX + 'px,' + currentY + 'px)';
+
+ document.getElementById(currentArrow).setAttribute('data_x', newX);
+ }
+ if (snapToMe - leftX>0){ //Left of lifeline
+ var oldWide = $("#"+currentArrow).width();
+ var newWide = oldWide-snapDelta;
+ //console.log(oldWide);
+ //console.log(newWide);
+ $("#"+currentArrow).width(newWide);
+
+ document.getElementById(currentArrow).style.webkitTransform = document.getElementById(currentArrow).style.transform =
+ 'translate(' + newX + 'px,' + currentY + 'px)';
+
+ document.getElementById(currentArrow).setAttribute('data_x', newX);
+ }
+ //////
+
+
+
+ window.resized = true;
+
+ return {
+ };
+ };
+ };
+
+ //////////////////MY CUSTOM FUNCTION/////////////// Kevin G, AT&T
+ interact.createHorizontalSnapGrid = function (grid) {
+ return function (x, y) {
+ var offsetX = 0,
+ offsetY = 0;
+
+ if (isObject(grid.offset)) {
+ offsetX = grid.offset.x;
+ offsetY = grid.offset.y;
+ }
+
+ var gridx = Math.round((x - offsetX) / grid.x),
+ gridy = Math.round((y - offsetY) / grid.y),
+
+ newX = gridx * grid.x + offsetX,
+ newY = gridy * grid.y + offsetY;
+
+ return {
+ x: newX,
+ y: grid.y,
+ range: grid.range
+ };
+ };
+ };
+
+ function endAllInteractions (event) {
+ for (var i = 0; i < interactions.length; i++) {
+ interactions[i].pointerEnd(event, event);
+ }
+ }
+
+ function listenToDocument (doc) {
+ if (contains(documents, doc)) { return; }
+
+ var win = doc.defaultView || doc.parentWindow;
+
+ // add delegate event listener
+ for (var eventType in delegatedEvents) {
+ events.add(doc, eventType, delegateListener);
+ events.add(doc, eventType, delegateUseCapture, true);
+ }
+
+ if (PointerEvent) {
+ if (PointerEvent === win.MSPointerEvent) {
+ pEventTypes = {
+ up: 'MSPointerUp', down: 'MSPointerDown', over: 'mouseover',
+ out: 'mouseout', move: 'MSPointerMove', cancel: 'MSPointerCancel' };
+ }
+ else {
+ pEventTypes = {
+ up: 'pointerup', down: 'pointerdown', over: 'pointerover',
+ out: 'pointerout', move: 'pointermove', cancel: 'pointercancel' };
+ }
+
+ events.add(doc, pEventTypes.down , listeners.selectorDown );
+ events.add(doc, pEventTypes.move , listeners.pointerMove );
+ events.add(doc, pEventTypes.over , listeners.pointerOver );
+ events.add(doc, pEventTypes.out , listeners.pointerOut );
+ events.add(doc, pEventTypes.up , listeners.pointerUp );
+ events.add(doc, pEventTypes.cancel, listeners.pointerCancel);
+
+ // autoscroll
+ events.add(doc, pEventTypes.move, autoScroll.edgeMove);
+ }
+ else {
+ events.add(doc, 'mousedown', listeners.selectorDown);
+ events.add(doc, 'mousemove', listeners.pointerMove );
+ events.add(doc, 'mouseup' , listeners.pointerUp );
+ events.add(doc, 'mouseover', listeners.pointerOver );
+ events.add(doc, 'mouseout' , listeners.pointerOut );
+
+ events.add(doc, 'touchstart' , listeners.selectorDown );
+ events.add(doc, 'touchmove' , listeners.pointerMove );
+ events.add(doc, 'touchend' , listeners.pointerUp );
+ events.add(doc, 'touchcancel', listeners.pointerCancel);
+
+ // autoscroll
+ events.add(doc, 'mousemove', autoScroll.edgeMove);
+ events.add(doc, 'touchmove', autoScroll.edgeMove);
+ }
+
+ events.add(win, 'blur', endAllInteractions);
+
+ try {
+ if (win.frameElement) {
+ var parentDoc = win.frameElement.ownerDocument,
+ parentWindow = parentDoc.defaultView;
+
+ events.add(parentDoc , 'mouseup' , listeners.pointerEnd);
+ events.add(parentDoc , 'touchend' , listeners.pointerEnd);
+ events.add(parentDoc , 'touchcancel' , listeners.pointerEnd);
+ events.add(parentDoc , 'pointerup' , listeners.pointerEnd);
+ events.add(parentDoc , 'MSPointerUp' , listeners.pointerEnd);
+ events.add(parentWindow, 'blur' , endAllInteractions );
+ }
+ }
+ catch (error) {
+ interact.windowParentError = error;
+ }
+
+ if (events.useAttachEvent) {
+ // For IE's lack of Event#preventDefault
+ events.add(doc, 'selectstart', function (event) {
+ var interaction = interactions[0];
+
+ if (interaction.currentAction()) {
+ interaction.checkAndPreventDefault(event);
+ }
+ });
+
+ // For IE's bad dblclick event sequence
+ events.add(doc, 'dblclick', doOnInteractions('ie8Dblclick'));
+ }
+
+ documents.push(doc);
+ }
+
+ listenToDocument(document);
+
+ function indexOf (array, target) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (array[i] === target) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ function contains (array, target) {
+ return indexOf(array, target) !== -1;
+ }
+
+ function matchesSelector (element, selector, nodeList) {
+ if (ie8MatchesSelector) {
+ return ie8MatchesSelector(element, selector, nodeList);
+ }
+
+ // remove /deep/ from selectors if shadowDOM polyfill is used
+ if (window !== realWindow) {
+ selector = selector.replace(/\/deep\//g, ' ');
+ }
+
+ return element[prefixedMatchesSelector](selector);
+ }
+
+ function matchesUpTo (element, selector, limit) {
+ while (isElement(element)) {
+ if (matchesSelector(element, selector)) {
+ return true;
+ }
+
+ element = parentElement(element);
+
+ if (element === limit) {
+ return matchesSelector(element, selector);
+ }
+ }
+
+ return false;
+ }
+
+ // For IE8's lack of an Element#matchesSelector
+ // taken from http://tanalin.com/en/blog/2012/12/matches-selector-ie8/ and modified
+ if (!(prefixedMatchesSelector in Element.prototype) || !isFunction(Element.prototype[prefixedMatchesSelector])) {
+ ie8MatchesSelector = function (element, selector, elems) {
+ elems = elems || element.parentNode.querySelectorAll(selector);
+
+ for (var i = 0, len = elems.length; i < len; i++) {
+ if (elems[i] === element) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+ }
+
+ // requestAnimationFrame polyfill
+ (function() {
+ var lastTime = 0,
+ vendors = ['ms', 'moz', 'webkit', 'o'];
+
+ for(var x = 0; x < vendors.length && !realWindow.requestAnimationFrame; ++x) {
+ reqFrame = realWindow[vendors[x]+'RequestAnimationFrame'];
+ cancelFrame = realWindow[vendors[x]+'CancelAnimationFrame'] || realWindow[vendors[x]+'CancelRequestAnimationFrame'];
+ }
+
+ if (!reqFrame) {
+ reqFrame = function(callback) {
+ var currTime = new Date().getTime(),
+ timeToCall = Math.max(0, 16 - (currTime - lastTime)),
+ id = setTimeout(function() { callback(currTime + timeToCall); },
+ timeToCall);
+ lastTime = currTime + timeToCall;
+ return id;
+ };
+ }
+
+ if (!cancelFrame) {
+ cancelFrame = function(id) {
+ clearTimeout(id);
+ };
+ }
+ }());
+
+ /* global exports: true, module, define */
+
+ // http://documentcloud.github.io/underscore/docs/underscore.html#section-11
+ if (typeof exports !== 'undefined') {
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = interact;
+ }
+ exports.interact = interact;
+ }
+ // AMD
+ else if (typeof define === 'function' && define.amd) {
+ define('interact', function() {
+ return interact;
+ });
+ }
+ else {
+ realWindow.interact = interact;
+ }
+
+} (window)); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/jquery-2.1.4.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/jquery-2.1.4.min.js
new file mode 100644
index 0000000..49990d6
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/jquery-2.1.4.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
+return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
+void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/js-yaml.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/js-yaml.js
new file mode 100644
index 0000000..21ce73c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/js-yaml.js
@@ -0,0 +1,3960 @@
+/* js-yaml 3.3.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+'use strict';
+
+
+var loader = require('./js-yaml/loader');
+var dumper = require('./js-yaml/dumper');
+
+
+function deprecated(name) {
+ return function () {
+ throw new Error('Function ' + name + ' is deprecated and cannot be used.');
+ };
+}
+
+
+module.exports.Type = require('./js-yaml/type');
+module.exports.Schema = require('./js-yaml/schema');
+module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
+module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
+module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.safeLoad = loader.safeLoad;
+module.exports.safeLoadAll = loader.safeLoadAll;
+module.exports.dump = dumper.dump;
+module.exports.safeDump = dumper.safeDump;
+module.exports.YAMLException = require('./js-yaml/exception');
+
+// Deprecared schema names from JS-YAML 2.0.x
+module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
+
+// Deprecated functions from JS-YAML 1.x.x
+module.exports.scan = deprecated('scan');
+module.exports.parse = deprecated('parse');
+module.exports.compose = deprecated('compose');
+module.exports.addConstructor = deprecated('addConstructor');
+
+},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (null === subject);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (null !== subject);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) {
+ return sequence;
+ } else if (isNothing(sequence)) {
+ return [];
+ }
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
+
+},{}],3:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (null === map) {
+ return {};
+ }
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if ('!!' === tag.slice(0, 2)) {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+
+ type = schema.compiledTypeMap[tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+ if (line.length && line !== '\n') {
+ result += ind;
+ }
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function StringBuilder(source) {
+ this.source = source;
+ this.result = '';
+ this.checkpoint = 0;
+}
+
+StringBuilder.prototype.takeUpTo = function (position) {
+ var er;
+
+ if (position < this.checkpoint) {
+ er = new Error('position should be > checkpoint');
+ er.position = position;
+ er.checkpoint = this.checkpoint;
+ throw er;
+ }
+
+ this.result += this.source.slice(this.checkpoint, position);
+ this.checkpoint = position;
+ return this;
+};
+
+StringBuilder.prototype.escapeChar = function () {
+ var character, esc;
+
+ character = this.source.charCodeAt(this.checkpoint);
+ esc = ESCAPE_SEQUENCES[character] || encodeHex(character);
+ this.result += esc;
+ this.checkpoint += 1;
+
+ return this;
+};
+
+StringBuilder.prototype.finish = function () {
+ if (this.source.length > this.checkpoint) {
+ this.takeUpTo(this.source.length);
+ }
+};
+
+function writeScalar(state, object, level) {
+ var simple, first, spaceWrap, folded, literal, single, double,
+ sawLineFeed, linePosition, longestLine, indent, max, character,
+ position, escapeSeq, hexEsc, previous, lineLength, modifier,
+ trailingLineBreaks, result;
+
+ if (0 === object.length) {
+ state.dump = "''";
+ return;
+ }
+
+ if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) {
+ state.dump = "'" + object + "'";
+ return;
+ }
+
+ simple = true;
+ first = object.length ? object.charCodeAt(0) : 0;
+ spaceWrap = (CHAR_SPACE === first ||
+ CHAR_SPACE === object.charCodeAt(object.length - 1));
+
+ // Simplified check for restricted first characters
+ // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29
+ if (CHAR_MINUS === first ||
+ CHAR_QUESTION === first ||
+ CHAR_COMMERCIAL_AT === first ||
+ CHAR_GRAVE_ACCENT === first) {
+ simple = false;
+ }
+
+ // can only use > and | if not wrapped in spaces.
+ if (spaceWrap) {
+ simple = false;
+ folded = false;
+ literal = false;
+ } else {
+ folded = true;
+ literal = true;
+ }
+
+ single = true;
+ double = new StringBuilder(object);
+
+ sawLineFeed = false;
+ linePosition = 0;
+ longestLine = 0;
+
+ indent = state.indent * level;
+ max = 80;
+ if (indent < 40) {
+ max -= indent;
+ } else {
+ max = 40;
+ }
+
+ for (position = 0; position < object.length; position++) {
+ character = object.charCodeAt(position);
+ if (simple) {
+ // Characters that can never appear in the simple scalar
+ if (!simpleChar(character)) {
+ simple = false;
+ } else {
+ // Still simple. If we make it all the way through like
+ // this, then we can just dump the string as-is.
+ continue;
+ }
+ }
+
+ if (single && character === CHAR_SINGLE_QUOTE) {
+ single = false;
+ }
+
+ escapeSeq = ESCAPE_SEQUENCES[character];
+ hexEsc = needsHexEscape(character);
+
+ if (!escapeSeq && !hexEsc) {
+ continue;
+ }
+
+ if (character !== CHAR_LINE_FEED &&
+ character !== CHAR_DOUBLE_QUOTE &&
+ character !== CHAR_SINGLE_QUOTE) {
+ folded = false;
+ literal = false;
+ } else if (character === CHAR_LINE_FEED) {
+ sawLineFeed = true;
+ single = false;
+ if (position > 0) {
+ previous = object.charCodeAt(position - 1);
+ if (previous === CHAR_SPACE) {
+ literal = false;
+ folded = false;
+ }
+ }
+ if (folded) {
+ lineLength = position - linePosition;
+ linePosition = position;
+ if (lineLength > longestLine) {
+ longestLine = lineLength;
+ }
+ }
+ }
+
+ if (character !== CHAR_DOUBLE_QUOTE) {
+ single = false;
+ }
+
+ double.takeUpTo(position);
+ double.escapeChar();
+ }
+
+ if (simple && testImplicitResolving(state, object)) {
+ simple = false;
+ }
+
+ modifier = '';
+ if (folded || literal) {
+ trailingLineBreaks = 0;
+ if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) {
+ trailingLineBreaks += 1;
+ }
+ }
+
+ if (trailingLineBreaks === 0) {
+ modifier = '-';
+ } else if (trailingLineBreaks === 2) {
+ modifier = '+';
+ }
+ }
+
+ if (literal && longestLine < max) {
+ folded = false;
+ }
+
+ // If it's literally one line, then don't bother with the literal.
+ // We may still want to do a fold, though, if it's a super long line.
+ if (!sawLineFeed) {
+ literal = false;
+ }
+
+ if (simple) {
+ state.dump = object;
+ } else if (single) {
+ state.dump = '\'' + object + '\'';
+ } else if (folded) {
+ result = fold(object, max);
+ state.dump = '>' + modifier + '\n' + indentString(result, indent);
+ } else if (literal) {
+ if (!modifier) {
+ object = object.replace(/\n$/, '');
+ }
+ state.dump = '|' + modifier + '\n' + indentString(object, indent);
+ } else if (double) {
+ double.finish();
+ state.dump = '"' + double.result + '"';
+ } else {
+ throw new Error('Failed to dump scalar value');
+ }
+
+ return;
+}
+
+// The `trailing` var is a regexp match of any trailing `\n` characters.
+//
+// There are three cases we care about:
+//
+// 1. One trailing `\n` on the string. Just use `|` or `>`.
+// This is the assumed default. (trailing = null)
+// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end.
+// 3. More than one trailing `\n` on the string. Use `|+` or `>+`.
+//
+// In the case of `>+`, these line breaks are *not* doubled (like the line
+// breaks within the string), so it's important to only end with the exact
+// same number as we started.
+function fold(object, max) {
+ var result = '',
+ position = 0,
+ length = object.length,
+ trailing = /\n+$/.exec(object),
+ newLine;
+
+ if (trailing) {
+ length = trailing.index + 1;
+ }
+
+ while (position < length) {
+ newLine = object.indexOf('\n', position);
+ if (newLine > length || newLine === -1) {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, length), max);
+ position = length;
+ } else {
+ if (result) {
+ result += '\n\n';
+ }
+ result += foldLine(object.slice(position, newLine), max);
+ position = newLine + 1;
+ }
+ }
+ if (trailing && trailing[0] !== '\n') {
+ result += trailing[0];
+ }
+
+ return result;
+}
+
+function foldLine(line, max) {
+ if (line === '') {
+ return line;
+ }
+
+ var foldRe = /[^\s] [^\s]/g,
+ result = '',
+ prevMatch = 0,
+ foldStart = 0,
+ match = foldRe.exec(line),
+ index,
+ foldEnd,
+ folded;
+
+ while (match) {
+ index = match.index;
+
+ // when we cross the max len, if the previous match would've
+ // been ok, use that one, and carry on. If there was no previous
+ // match on this fold section, then just have a long line.
+ if (index - foldStart > max) {
+ if (prevMatch !== foldStart) {
+ foldEnd = prevMatch;
+ } else {
+ foldEnd = index;
+ }
+
+ if (result) {
+ result += '\n';
+ }
+ folded = line.slice(foldStart, foldEnd);
+ result += folded;
+ foldStart = foldEnd + 1;
+ }
+ prevMatch = index + 1;
+ match = foldRe.exec(line);
+ }
+
+ if (result) {
+ result += '\n';
+ }
+
+ // if we end up with one last word at the end, then the last bit might
+ // be slightly bigger than we wanted, because we exited out of the loop.
+ if (foldStart !== prevMatch && line.length - foldStart > max) {
+ result += line.slice(foldStart, prevMatch) + '\n' +
+ line.slice(prevMatch + 1);
+ } else {
+ result += line.slice(foldStart);
+ }
+
+ return result;
+}
+
+// Returns true if character can be found in a simple scalar
+function simpleChar(character) {
+ return CHAR_TAB !== character &&
+ CHAR_LINE_FEED !== character &&
+ CHAR_CARRIAGE_RETURN !== character &&
+ CHAR_COMMA !== character &&
+ CHAR_LEFT_SQUARE_BRACKET !== character &&
+ CHAR_RIGHT_SQUARE_BRACKET !== character &&
+ CHAR_LEFT_CURLY_BRACKET !== character &&
+ CHAR_RIGHT_CURLY_BRACKET !== character &&
+ CHAR_SHARP !== character &&
+ CHAR_AMPERSAND !== character &&
+ CHAR_ASTERISK !== character &&
+ CHAR_EXCLAMATION !== character &&
+ CHAR_VERTICAL_LINE !== character &&
+ CHAR_GREATER_THAN !== character &&
+ CHAR_SINGLE_QUOTE !== character &&
+ CHAR_DOUBLE_QUOTE !== character &&
+ CHAR_PERCENT !== character &&
+ CHAR_COLON !== character &&
+ !ESCAPE_SEQUENCES[character] &&
+ !needsHexEscape(character);
+}
+
+// Returns true if the character code needs to be escaped.
+function needsHexEscape(character) {
+ return !((0x00020 <= character && character <= 0x00007E) ||
+ (0x00085 === character) ||
+ (0x000A0 <= character && character <= 0x00D7FF) ||
+ (0x0E000 <= character && character <= 0x00FFFD) ||
+ (0x10000 <= character && character <= 0x10FFFF));
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level, object[index], false, false)) {
+ if (0 !== index) {
+ _result += ', ';
+ }
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level + 1, object[index], true, true)) {
+ if (!compact || 0 !== index) {
+ _result += generateNextLine(state, level);
+ }
+ _result += '- ' + state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (0 !== index) {
+ pairBuffer += ', ';
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) {
+ pairBuffer += '? ';
+ }
+
+ pairBuffer += state.dump + ': ';
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || 0 !== index) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level + 1, objectKey, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (null !== state.tag && '?' !== state.tag) ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ state.tag = explicit ? type.tag : '?';
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if ('[object Function]' === _toString.call(type.represent)) {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+
+ if (block) {
+ block = (0 > state.flowLevel || state.flowLevel > level);
+ }
+
+ if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) {
+ compact = false;
+ }
+
+ var objectOrArray = '[object Object]' === type || '[object Array]' === type,
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if ('[object Object]' === type) {
+ if (block && (0 !== Object.keys(state.dump).length)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object Array]' === type) {
+ if (block && (0 !== state.dump.length)) {
+ writeBlockSequence(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if ('[object String]' === type) {
+ if ('?' !== state.tag) {
+ writeScalar(state, state.dump, level);
+ }
+ } else {
+ if (state.skipInvalid) {
+ return false;
+ }
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (null !== state.tag && '?' !== state.tag) {
+ state.dump = '!<' + state.tag + '> ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var type = _toString.call(object),
+ objectKeyList,
+ index,
+ length;
+
+ if (null !== object && 'object' === typeof object) {
+ index = objects.indexOf(object);
+ if (-1 !== index) {
+ if (-1 === duplicatesIndexes.indexOf(index)) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ getDuplicateReferences(input, state);
+
+ if (writeNode(state, 0, input, true, true)) {
+ return state.dump + '\n';
+ }
+ return '';
+}
+
+function safeDump(input, options) {
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+module.exports.dump = dump;
+module.exports.safeDump = safeDump;
+
+},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){
+'use strict';
+
+
+function YAMLException(reason, mark) {
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = this.toString(false);
+}
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ var result;
+
+ result = 'JS-YAML: ' + (this.reason || '(unknown reason)');
+
+ if (!compact && this.mark) {
+ result += ' ' + this.mark.toString();
+ }
+
+ return result;
+};
+
+
+module.exports = YAMLException;
+
+},{}],5:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Mark = require('./mark');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return 0x2C/* , */ === c ||
+ 0x5B/* [ */ === c ||
+ 0x5D/* ] */ === c ||
+ 0x7B/* { */ === c ||
+ 0x7D/* } */ === c;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00);
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ this.legacy = options['legacy'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ return new YAMLException(
+ message,
+ new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ var error = generateError(state, message);
+
+ if (state.onWarning) {
+ state.onWarning.call(null, error);
+ } else {
+ throw error;
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (null !== state.version) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (1 !== args.length) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (null === match) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (1 !== major) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (1 !== minor && 2 !== minor) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (2 !== args.length) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length;
+ _position < _length;
+ _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(0x09 === _character ||
+ 0x20 <= _character && _character <= 0x10FFFF)) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ }
+ }
+}
+
+function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
+ var index, quantity;
+
+ keyNode = String(keyNode);
+
+ if (null === _result) {
+ _result = {};
+ }
+
+ if ('tag:yaml.org,2002:merge' === keyTag) {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index]);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode);
+ }
+ } else {
+ _result[keyNode] = valueNode;
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x0A/* LF */ === ch) {
+ state.position++;
+ } else if (0x0D/* CR */ === ch) {
+ state.position++;
+ if (0x0A/* LF */ === state.input.charCodeAt(state.position)) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && 0x23/* # */ === ch) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (0x20/* Space */ === ch) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) &&
+ state.input.charCodeAt(_position + 1) === ch &&
+ state.input.charCodeAt(_position + 2) === ch) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (1 === count) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ 0x23/* # */ === ch ||
+ 0x26/* & */ === ch ||
+ 0x2A/* * */ === ch ||
+ 0x21/* ! */ === ch ||
+ 0x7C/* | */ === ch ||
+ 0x3E/* > */ === ch ||
+ 0x27/* ' */ === ch ||
+ 0x22/* " */ === ch ||
+ 0x25/* % */ === ch ||
+ 0x40/* @ */ === ch ||
+ 0x60/* ` */ === ch) {
+ return false;
+ }
+
+ if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (0 !== ch) {
+ if (0x3A/* : */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (0x23/* # */ === ch) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x27/* ' */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x27/* ' */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x27/* ' */ === ch) {
+ captureStart = captureEnd = state.position;
+ state.position++;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp, tmpEsc,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x22/* " */ !== ch) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ if (0x22/* " */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (0x5C/* \ */ === ch) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (0 !== ch) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (0x3F/* ? */ === ch) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2C/* , */ === ch) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (0 !== ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x2B/* + */ === ch || 0x2D/* - */ === ch) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (0 !== ch));
+ }
+ }
+
+ while (0 !== ch) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (0x20/* Space */ === ch)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (detectedIndent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (0 === emptyLines) {
+ if (detectedIndent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else if (detectedIndent) {
+ // If current line isn't the first one - count line break from the last content line.
+ state.result += common.repeat('\n', emptyLines + 1);
+ } else {
+ // In case of the first content line - count only empty lines.
+ }
+
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (0 !== ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+
+ if (0x2D/* - */ !== ch) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (0 !== ch) {
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) {
+
+ if (0x3F/* ? */ === ch) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x3A/* : */ === ch) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else {
+ break; // Reading is done. Go to the epilogue.
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if (state.lineIndent > nodeIndent && (0 !== ch)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, keyTag, keyNode, null);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x21/* ! */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.tag) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (0x3C/* < */ === ch) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (0x21/* ! */ === ch) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && 0x3E/* > */ !== ch);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+
+ if (0x21/* ! */ === ch) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if ('!' === tagHandle) {
+ state.tag = '!' + tagName;
+
+ } else if ('!!' === tagHandle) {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x26/* & */ !== ch) {
+ return false;
+ }
+
+ if (null !== state.anchor) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ len = state.length,
+ input = state.input,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (0x2A/* * */ !== ch) {
+ return false;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!state.anchorMap.hasOwnProperty(alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ type,
+ flowIndent,
+ blockIndent,
+ _result;
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (1 === indentStatus) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (1 === indentStatus) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (null !== state.tag || null !== state.anchor) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (null === state.tag) {
+ state.tag = '?';
+ }
+ }
+
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (0 === indentStatus) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (null !== state.tag && '!' !== state.tag) {
+ if ('?' === state.tag) {
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
+ typeIndex < typeQuantity;
+ typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only assigned to plain scalars. So, it isn't
+ // needed to check for 'kind' conformity.
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
+ type = state.typeMap[state.tag];
+
+ if (null !== state.result && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result);
+ if (null !== state.anchor) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else {
+ throwWarning(state, 'unknown tag !<' + state.tag + '>');
+ }
+ }
+
+ return null !== state.tag || null !== state.anchor || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = {};
+ state.anchorMap = {};
+
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || 0x25/* % */ !== ch) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (0 !== ch) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (0x23/* # */ === ch) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (0 !== ch && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) {
+ break;
+ }
+
+ _position = state.position;
+
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (0 !== ch) {
+ readLineBreak(state);
+ }
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (0 === state.lineIndent &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 1) &&
+ 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (0x2E/* . */ === state.input.charCodeAt(state.position)) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) &&
+ 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ if (PATTERN_NON_PRINTABLE.test(state.input)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (0x20/* Space */ === state.input.charCodeAt(state.position)) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ var documents = loadDocuments(input, options), index, length;
+
+ for (index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options), index, length;
+
+ if (0 === documents.length) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (1 === documents.length) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+function safeLoadAll(input, output, options) {
+ loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+function safeLoad(input, options) {
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
+module.exports.safeLoadAll = safeLoadAll;
+module.exports.safeLoad = safeLoad;
+
+},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
+'use strict';
+
+
+var common = require('./common');
+
+
+function Mark(name, buffer, position, line, column) {
+ this.name = name;
+ this.buffer = buffer;
+ this.position = position;
+ this.line = line;
+ this.column = column;
+}
+
+
+Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
+ var head, start, tail, end, snippet;
+
+ if (!this.buffer) {
+ return null;
+ }
+
+ indent = indent || 4;
+ maxLength = maxLength || 75;
+
+ head = '';
+ start = this.position;
+
+ while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) {
+ start -= 1;
+ if (this.position - start > (maxLength / 2 - 1)) {
+ head = ' ... ';
+ start += 5;
+ break;
+ }
+ }
+
+ tail = '';
+ end = this.position;
+
+ while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) {
+ end += 1;
+ if (end - this.position > (maxLength / 2 - 1)) {
+ tail = ' ... ';
+ end -= 5;
+ break;
+ }
+ }
+
+ snippet = this.buffer.slice(start, end);
+
+ return common.repeat(' ', indent) + head + snippet + tail + '\n' +
+ common.repeat(' ', indent + this.position - start + head.length) + '^';
+};
+
+
+Mark.prototype.toString = function toString(compact) {
+ var snippet, where = '';
+
+ if (this.name) {
+ where += 'in "' + this.name + '" ';
+ }
+
+ where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+
+ if (!compact) {
+ snippet = this.getSnippet();
+
+ if (snippet) {
+ where += ':\n' + snippet;
+ }
+ }
+
+ return where;
+};
+
+
+module.exports = Mark;
+
+},{"./common":2}],7:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name, result) {
+ var exclude = [];
+
+ schema.include.forEach(function (includedSchema) {
+ result = compileList(includedSchema, name, result);
+ });
+
+ schema[name].forEach(function (currentType) {
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag) {
+ exclude.push(previousIndex);
+ }
+ });
+
+ result.push(currentType);
+ });
+
+ return result.filter(function (type, index) {
+ return -1 === exclude.indexOf(index);
+ });
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {}, index, length;
+
+ function collectType(type) {
+ result[type.tag] = type;
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+
+ return result;
+}
+
+
+function Schema(definition) {
+ this.include = definition.include || [];
+ this.implicit = definition.implicit || [];
+ this.explicit = definition.explicit || [];
+
+ this.implicit.forEach(function (type) {
+ if (type.loadKind && 'scalar' !== type.loadKind) {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+ });
+
+ this.compiledImplicit = compileList(this, 'implicit', []);
+ this.compiledExplicit = compileList(this, 'explicit', []);
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
+}
+
+
+Schema.DEFAULT = null;
+
+
+Schema.create = function createSchema() {
+ var schemas, types;
+
+ switch (arguments.length) {
+ case 1:
+ schemas = Schema.DEFAULT;
+ types = arguments[0];
+ break;
+
+ case 2:
+ schemas = arguments[0];
+ types = arguments[1];
+ break;
+
+ default:
+ throw new YAMLException('Wrong number of arguments for Schema.create function');
+ }
+
+ schemas = common.toArray(schemas);
+ types = common.toArray(types);
+
+ if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
+ throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
+ }
+
+ if (!types.every(function (type) { return type instanceof Type; })) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ return new Schema({
+ include: schemas,
+ explicit: types
+ });
+};
+
+
+module.exports = Schema;
+
+},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./json')
+ ]
+});
+
+},{"../schema":7,"./json":12}],9:[function(require,module,exports){
+// JS-YAML's default schema for `load` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on JS-YAML's default safe schema and includes
+// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
+//
+// Also this schema is used as default base schema at `Schema.create` function.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = Schema.DEFAULT = new Schema({
+ include: [
+ require('./default_safe')
+ ],
+ explicit: [
+ require('../type/js/undefined'),
+ require('../type/js/regexp'),
+ require('../type/js/function')
+ ]
+});
+
+},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./core')
+ ],
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
+
+},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
+
+},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./failsafe')
+ ],
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
+
+},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (null !== map) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
+
+},{"./exception":4}],14:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+// A trick for browserified version.
+// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined
+var NodeBuffer = require('buffer').Buffer;
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) { continue; }
+
+ // Fail on illegal characters
+ if (code < 0) { return false; }
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var code, idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ // Wrap into Buffer for NodeJS and leave Array for browser
+ if (NodeBuffer) {
+ return new NodeBuffer(result);
+ }
+
+ return result;
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(object) {
+ return NodeBuffer && NodeBuffer.isBuffer(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+},{"../type":13,"buffer":30}],15:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return '[object Boolean]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":13}],16:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
+ '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
+ '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var value, sign, base, digits;
+
+ if (!YAML_FLOAT_PATTERN.test(data)) {
+ return false;
+ }
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign, base, digits;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = '-' === value[0] ? -1 : 1;
+ digits = [];
+
+ if (0 <= '+-'.indexOf(value[0])) {
+ value = value.slice(1);
+ }
+
+ if ('.inf' === value) {
+ return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if ('.nan' === value) {
+ return NaN;
+
+ } else if (0 <= value.indexOf(':')) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseFloat(v, 10));
+ });
+
+ value = 0.0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += d * base;
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+ return sign * parseFloat(value, 10);
+}
+
+function representYamlFloat(object, style) {
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase':
+ return '.nan';
+ case 'uppercase':
+ return '.NAN';
+ case 'camelcase':
+ return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '.inf';
+ case 'uppercase':
+ return '.INF';
+ case 'camelcase':
+ return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase':
+ return '-.inf';
+ case 'uppercase':
+ return '-.INF';
+ case 'camelcase':
+ return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+ return object.toString(10);
+}
+
+function isFloat(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 !== object % 1 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+},{"../common":2,"../type":13}],17:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) { return false; }
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) { return true; }
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch !== '0' && ch !== '1') {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isHexCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 8
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (!isOctCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+ return hasDigits;
+ }
+
+ // base 10 (except 0) or base 60
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') { continue; }
+ if (ch === ':') { break; }
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ if (!hasDigits) { return false; }
+
+ // if !base60 - done;
+ if (ch !== ':') { return true; }
+
+ // base60 almost not used, no needs to optimize
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch, base, digits = [];
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') { sign = -1; }
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if ('0' === value) {
+ return 0;
+ }
+
+ if (ch === '0') {
+ if (value[1] === 'b') {
+ return sign * parseInt(value.slice(2), 2);
+ }
+ if (value[1] === 'x') {
+ return sign * parseInt(value, 16);
+ }
+ return sign * parseInt(value, 8);
+
+ }
+
+ if (value.indexOf(':') !== -1) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseInt(v, 10));
+ });
+
+ value = 0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += (d * base);
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return ('[object Number]' === Object.prototype.toString.call(object)) &&
+ (0 === object % 1 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (object) { return '0b' + object.toString(2); },
+ octal: function (object) { return '0' + object.toString(8); },
+ decimal: function (object) { return object.toString(10); },
+ hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+},{"../common":2,"../type":13}],18:[function(require,module,exports){
+'use strict';
+
+var esprima;
+
+// Browserified version does not have esprima
+//
+// 1. For node.js just require module as deps
+// 2. For browser try to require mudule via external AMD system.
+// If not found - try to fallback to window.esprima. If not
+// found too - then fail to parse.
+//
+try {
+ esprima = require('esprima');
+} catch (_) {
+ /*global window */
+ if (typeof window !== 'undefined') { esprima = window.esprima; }
+}
+
+var Type = require('../../type');
+
+function resolveJavascriptFunction(data) {
+ if (null === data) {
+ return false;
+ }
+
+ try {
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ return false;
+ }
+
+ return true;
+ } catch (err) {
+ return false;
+ }
+}
+
+function constructJavascriptFunction(data) {
+ /*jslint evil:true*/
+
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if ('Program' !== ast.type ||
+ 1 !== ast.body.length ||
+ 'ExpressionStatement' !== ast.body[0].type ||
+ 'FunctionExpression' !== ast.body[0].expression.type) {
+ throw new Error('Failed to resolve function');
+ }
+
+ ast.body[0].expression.params.forEach(function (param) {
+ params.push(param.name);
+ });
+
+ body = ast.body[0].expression.body.range;
+
+ // Esprima's ranges include the first '{' and the last '}' characters on
+ // function expressions. So cut them out.
+ /*eslint-disable no-new-func*/
+ return new Function(params, source.slice(body[0] + 1, body[1] - 1));
+}
+
+function representJavascriptFunction(object /*, style*/) {
+ return object.toString();
+}
+
+function isFunction(object) {
+ return '[object Function]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/function', {
+ kind: 'scalar',
+ resolve: resolveJavascriptFunction,
+ construct: constructJavascriptFunction,
+ predicate: isFunction,
+ represent: representJavascriptFunction
+});
+
+},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptRegExp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ if (0 === data.length) {
+ return false;
+ }
+
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // if regexp starts with '/' it can have modifiers and must be properly closed
+ // `/foo/gim` - modifiers tail can be maximum 3 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+
+ if (modifiers.length > 3) { return false; }
+ // if expression starts with /, is should be properly terminated
+ if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; }
+
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ try {
+ var dummy = new RegExp(regexp, modifiers);
+ return true;
+ } catch (error) {
+ return false;
+ }
+}
+
+function constructJavascriptRegExp(data) {
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // `/foo/gim` - tail can be maximum 4 chars
+ if ('/' === regexp[0]) {
+ if (tail) {
+ modifiers = tail[1];
+ }
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ return new RegExp(regexp, modifiers);
+}
+
+function representJavascriptRegExp(object /*, style*/) {
+ var result = '/' + object.source + '/';
+
+ if (object.global) {
+ result += 'g';
+ }
+
+ if (object.multiline) {
+ result += 'm';
+ }
+
+ if (object.ignoreCase) {
+ result += 'i';
+ }
+
+ return result;
+}
+
+function isRegExp(object) {
+ return '[object RegExp]' === Object.prototype.toString.call(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/regexp', {
+ kind: 'scalar',
+ resolve: resolveJavascriptRegExp,
+ construct: constructJavascriptRegExp,
+ predicate: isRegExp,
+ represent: representJavascriptRegExp
+});
+
+},{"../../type":13}],20:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptUndefined() {
+ return true;
+}
+
+function constructJavascriptUndefined() {
+ /*eslint-disable no-undefined*/
+ return undefined;
+}
+
+function representJavascriptUndefined() {
+ return '';
+}
+
+function isUndefined(object) {
+ return 'undefined' === typeof object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/undefined', {
+ kind: 'scalar',
+ resolve: resolveJavascriptUndefined,
+ construct: constructJavascriptUndefined,
+ predicate: isUndefined,
+ represent: representJavascriptUndefined
+});
+
+},{"../../type":13}],21:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return null !== data ? data : {}; }
+});
+
+},{"../type":13}],22:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return '<<' === data || null === data;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+},{"../type":13}],23:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return null === object;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":13}],24:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) {
+ pairHasKey = true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ if (!pairHasKey) {
+ return false;
+ }
+
+ if (-1 === objectKeys.indexOf(pairKey)) {
+ objectKeys.push(pairKey);
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return null !== data ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+},{"../type":13}],25:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if ('[object Object]' !== _toString.call(pair)) {
+ return false;
+ }
+
+ keys = Object.keys(pair);
+
+ if (1 !== keys.length) {
+ return false;
+ }
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (null === data) {
+ return [];
+ }
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+},{"../type":13}],26:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return null !== data ? data : []; }
+});
+
+},{"../type":13}],27:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (null === data) {
+ return true;
+ }
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (null !== object[key]) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return null !== data ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+},{"../type":13}],28:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return null !== data ? data : ''; }
+});
+
+},{"../type":13}],29:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (null === data) {
+ return false;
+ }
+
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (null === match) {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (null === match) {
+ throw new Error('Date resolve error');
+ }
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if ('-' === match[9]) {
+ delta = -delta;
+ }
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) {
+ date.setTime(date.getTime() - delta);
+ }
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+},{"../type":13}],30:[function(require,module,exports){
+
+},{}],"/":[function(require,module,exports){
+'use strict';
+
+
+var yaml = require('./lib/js-yaml.js');
+
+
+module.exports = yaml;
+
+},{"./lib/js-yaml.js":1}]},{},[])("/")
+}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/saveSvgAsPng.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/saveSvgAsPng.js
new file mode 100644
index 0000000..f2141c8
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dependencies/saveSvgAsPng.js
@@ -0,0 +1,170 @@
+(function() {
+ var out$ = typeof exports != 'undefined' && exports || this;
+
+ var doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
+
+ function isExternal(url) {
+ return url && url.lastIndexOf('http',0) == 0 && url.lastIndexOf(window.location.host) == -1;
+ }
+
+ function inlineImages(el, callback) {
+ var images = el.querySelectorAll('image');
+ var left = images.length;
+ if (left == 0) {
+ callback();
+ }
+ for (var i = 0; i < images.length; i++) {
+ (function(image) {
+ var href = image.getAttributeNS("http://www.w3.org/1999/xlink", "href");
+ if (href) {
+ if (isExternal(href.value)) {
+ console.warn("Cannot render embedded images linking to external hosts: "+href.value);
+ return;
+ }
+ }
+ var canvas = document.createElement('canvas');
+ var ctx = canvas.getContext('2d');
+ var img = new Image();
+ href = href || image.getAttribute('href');
+ img.src = href;
+ img.onload = function() {
+ canvas.width = img.width;
+ canvas.height = img.height;
+ ctx.drawImage(img, 0, 0);
+ image.setAttributeNS("http://www.w3.org/1999/xlink", "href", canvas.toDataURL('image/png'));
+ left--;
+ if (left == 0) {
+ callback();
+ }
+ }
+ img.onerror = function() {
+ console.log("Could not load "+href);
+ left--;
+ if (left == 0) {
+ callback();
+ }
+ }
+ })(images[i]);
+ }
+ }
+
+ function styles(el, selectorRemap) {
+ var css = "";
+ var sheets = document.styleSheets;
+ for (var i = 0; i < sheets.length; i++) {
+ if (isExternal(sheets[i].href)) {
+ console.warn("Cannot include styles from other hosts: "+sheets[i].href);
+ continue;
+ }
+ var rules = sheets[i].cssRules;
+ if (rules != null) {
+ for (var j = 0; j < rules.length; j++) {
+ var rule = rules[j];
+ if (typeof(rule.style) != "undefined") {
+ var match = null;
+ try {
+ match = el.querySelector(rule.selectorText);
+ } catch(err) {
+ console.warn('Invalid CSS selector "' + rule.selectorText + '"', err);
+ }
+ if (match) {
+ var selector = selectorRemap ? selectorRemap(rule.selectorText) : rule.selectorText;
+ css += selector + " { " + rule.style.cssText + " }\n";
+ } else if(rule.cssText.match(/^@font-face/)) {
+ css += rule.cssText + '\n';
+ }
+ }
+ }
+ }
+ }
+ return css;
+ }
+
+ out$.svgAsDataUri = function(el, options, cb) {
+ options = options || {};
+ options.scale = options.scale || 1;
+ var xmlns = "http://www.w3.org/2000/xmlns/";
+
+ inlineImages(el, function() {
+ var outer = document.createElement("div");
+ var clone = el.cloneNode(true);
+ var width, height;
+ if(el.tagName == 'svg') {
+ var box = el.getBoundingClientRect();
+ width = parseInt(clone.getAttribute('width') ||
+ box.width ||
+ clone.style.width ||
+ out$.getComputedStyle(el).getPropertyValue('width'));
+ height = parseInt(clone.getAttribute('height') ||
+ box.height ||
+ clone.style.height ||
+ out$.getComputedStyle(el).getPropertyValue('height'));
+ if (width === undefined ||
+ width === null ||
+ isNaN(parseFloat(width))) {
+ width = 0;
+ }
+ if (height === undefined ||
+ height === null ||
+ isNaN(parseFloat(height))) {
+ height = 0;
+ }
+ } else {
+ var box = el.getBBox();
+ width = box.x + box.width;
+ height = box.y + box.height;
+ clone.setAttribute('transform', clone.getAttribute('transform').replace(/translate\(.*?\)/, ''));
+
+ var svg = document.createElementNS('http://www.w3.org/2000/svg','svg')
+ svg.appendChild(clone)
+ clone = svg;
+ }
+
+ clone.setAttribute("version", "1.1");
+ clone.setAttributeNS(xmlns, "xmlns", "http://www.w3.org/2000/svg");
+ clone.setAttributeNS(xmlns, "xmlns:xlink", "http://www.w3.org/1999/xlink");
+ clone.setAttribute("width", width * options.scale);
+ clone.setAttribute("height", height * options.scale);
+ clone.setAttribute("viewBox", "0 0 " + width + " " + height);
+ outer.appendChild(clone);
+
+ var css = styles(el, options.selectorRemap);
+ var s = document.createElement('style');
+ s.setAttribute('type', 'text/css');
+ s.innerHTML = "<![CDATA[\n" + css + "\n]]>";
+ var defs = document.createElement('defs');
+ defs.appendChild(s);
+ clone.insertBefore(defs, clone.firstChild);
+
+ var svg = doctype + outer.innerHTML;
+ var uri = 'data:image/svg+xml;base64,' + window.btoa(unescape(encodeURIComponent(svg)));
+ if (cb) {
+ cb(uri);
+ }
+ });
+ }
+
+ out$.saveSvgAsPng = function(el, name, options) {
+ options = options || {};
+ out$.svgAsDataUri(el, options, function(uri) {
+ var image = new Image();
+ image.onload = function() {
+ var canvas = document.createElement('canvas');
+ canvas.width = image.width;
+ canvas.height = image.height;
+ var context = canvas.getContext('2d');
+ context.drawImage(image, 0, 0);
+
+ var a = document.createElement('a');
+ a.download = name;
+ a.href = canvas.toDataURL('image/png');
+ document.body.appendChild(a);
+ a.addEventListener("click", function(e) {
+ a.parentNode.removeChild(a);
+ });
+ a.click();
+ }
+ image.src = uri;
+ });
+ }
+})(); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dictionary.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dictionary.js
new file mode 100644
index 0000000..fe8e5dc
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dictionary.js
@@ -0,0 +1,614 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains dictionary (in form of arrays, implementing databases in the future) and functions to append new terms to them
+var nodeTags = [
+ "Order Trigger System",
+ "MSO",
+ "SDN-C",
+ "A&AI",
+ "PO",
+ "Customer Request"
+ ];
+var arrowTags = [
+ "SIP Invite",
+ "Unauthorized 401",
+ "SIP Invite with credentials",
+ "Validates Invite, Different Tenant",
+ "Invite",
+ "3XX redirect to Transit function",
+ "Route call",
+ "Perform SMM Rules",
+ "Convert IPv6 to IPv4",
+ "proxy INVITE",
+ "vAS validates Invite message",
+ "100 TRYING",
+ "200 OK",
+ "ACK",
+ "[Call completion] BYE [release media]",
+ "200 OK [release media]",
+ "SIP Register",
+ "Inserts via header",
+ "Removes via header",
+ "SIP Register with credentials",
+ "REGISTRATION was successful and Trinity UE-A is now registered with the vAS",
+ "200 OK Registration successful",
+ "Stores in cache - UE A IP & Registered vAS",
+ "302+UE B contact",
+ "CNAM query:SUBSCRIBE",
+ "NOTIFY",
+ "180 Ringing",
+ "200",
+ "ACK",
+ "[Call completion] BYE [release media]",
+ "200 OK [release media]",
+ "VoLTE UE A iFC checked for originating processing. Determines SCC-AS processing needed first and then TAS",
+ "Callback",
+ "Query",
+ "Trinity UE-B domain name (hcomm.openecomp.net)",
+ "INVITE with R-URI telephone_nbr@hcomm.openecomp.net",
+ "Call routed for hcomm.openecomp.net",
+ "302 + UE B contact",
+ "No Match",
+ "Perform SMM rules & IP v6 to IPv4 conversion",
+ "Perform Routing Function",
+ "Query Response",
+ "Map SIP headers to IAM",
+ "Terminate Call",
+ "Process call",
+ "Standard Ringing Message",
+ "ISUP ACM",
+ "18X message – Ringing",
+ "Answer",
+ "ISUP ACM",
+ "200 OK",
+ "Dial E.164 Number",
+ "Q.931 SETUP",
+ "Diameter + Query",
+ "CNAM info",
+ "Diamater + response",
+ "Perform SMM rules & IP v4 to IPv6 conversion",
+ "Validates & executes terminating call processing",
+ "3XX redirect to Transit function",
+ "IPV6 to IPV4 conversion",
+ "execute service logic",
+ "determine route",
+ "delete 9-digit RIC",
+ "determine custom site",
+ "18X ringing",
+ "Media Path",
+ "Dial POTS TN",
+ "proxy INVITE",
+ "proxy 401 Unauthorized",
+ "401 Unauthorized",
+ "3XX",
+ "NXDOMAIN",
+ "Emergency call defected",
+ "Recognizes: Not an intra-AS call",
+ "Identifies 911 call",
+ "3XX redirect to Transit function",
+ "PEI reconstructed conditionally",
+ "Retrieve Caller Info",
+ "Identifies PSAP and makes an entry in dALI",
+ "PSAP queries ALI using the calling number",
+ "Determine cller is CALEA surveillance subject",
+ "replicate required",
+ "include 2 repeaters",
+ "INFO",
+ "Receive RTP",
+ "create T1.678",
+ "send T1.678",
+ "Origination Message",
+ "create T1.678 MediaAndAddressReporting",
+ "send T1.678",
+ "Origination Message",
+ "CNAM query:SUBSCRIBE",
+ "NOTIFY",
+ "80-Ringing/183-Progress",
+ "create T1.678 / MediaAndAddressReporting",
+ "send T1.678 / MediaAndAddressReporting",
+ "CCOpen",
+ "modify SDP",
+ "BYE",
+ "CCClose"
+];
+var noteTags = [
+ "alpha",
+ "bravo",
+ "charlie",
+ "delta",
+ "echo",
+ "fox",
+ "golf",
+ "hotel",
+ "item",
+ "jump",
+ "kappa",
+ "lion",
+ "man"
+];
+var separatorTags = [
+ "alpha",
+ "bravo",
+ "charlie",
+ "delta",
+ "echo",
+ "fox",
+ "golf",
+ "hotel",
+ "item",
+ "jump",
+ "kappa",
+ "lion",
+ "man"
+];
+var messageTags = [
+ "signal",
+ "media"
+
+ ];
+
+function pushToDict(innerText,type){
+ if (type=="node" && nodeTags.indexOf(innerText) == -1){
+ nodeTags.push(innerText);
+ }
+ else if (type=="arrow" && arrowTags.indexOf(innerText) == -1){
+ arrowTags.push(innerText);
+ }
+ else if (type=="note" && noteTags.indexOf(innerText) == -1){
+ noteTags.push(innerText);
+ }
+ else if (type=="separator" && separatorTags.indexOf(innerText) == -1){
+ noteTags.push(innerText);
+ }
+}
+
+
+var elementsYml = "elementsList:\n" +
+"- {displayShortname: eNB, enclosingDomain: RAN, tosca_id: com.trinity.ran.enodeb}\n" +
+"- {displayShortname: SIAD, enclosingDomain: RAN, tosca_id: com.trinity.ran.siad}\n" +
+"- {displayShortname: NodeB, enclosingDomain: RAN, tosca_id: com.trinity.ran.nb}\n" +
+"- {displayShortname: eMSC, enclosingDomain: RAN, tosca_id: com.trinity.ran.emsc}\n" +
+"- {displayShortname: RNC, enclosingDomain: RAN, tosca_id: com.trinity.ran.rnc}\n" +
+"- {displayShortname: MGW, enclosingDomain: RAN, tosca_id: com.trinity.ran.mgw}\n" +
+"- {displayShortname: SS7 GPORT, enclosingDomain: RAN, tosca_id: com.trinity.ran.ss7_gport}\n" +
+"- {displayShortname: MSN, enclosingDomain: RAN, tosca_id: com.trinity.ran.msn}\n" +
+"- {displayShortname: E-SMLC, enclosingDomain: RAN, tosca_id: com.trinity.ran.e_smlc}\n" +
+"- {displayShortname: SGSN-S4, enclosingDomain: EPC, tosca_id: com.trinity.epc.sgsn_s4}\n" +
+"- {displayShortname: MME, enclosingDomain: EPC, tosca_id: com.trinity.epc.mme}\n" +
+"- {displayShortname: P_LRF (RDF), enclosingDomain: EPC, tosca_id: com.trinity.epc.p_lrf}\n" +
+"- {displayShortname: GMLC, enclosingDomain: EPC, tosca_id: com.trinity.epc.gmlc}\n" +
+"- {displayShortname: PCEF, enclosingDomain: EPC, tosca_id: com.trinity.epc.pcef}\n" +
+"- {displayShortname: SDG, enclosingDomain: EPC, tosca_id: com.trinity.epc.sdg}\n" +
+"- {displayShortname: P-GW, enclosingDomain: EPC, tosca_id: com.trinity.epc.p_gw}\n" +
+"- {displayShortname: S-GW, enclosingDomain: EPC, tosca_id: com.trinity.epc.s_gw}\n" +
+"- {displayShortname: PAS, enclosingDomain: EPC, tosca_id: com.trinity.epc.pas}\n" +
+"- {displayShortname: PCRF, enclosingDomain: EPC, tosca_id: com.trinity.epc.pcrf}\n" +
+"- {displayShortname: MIND, enclosingDomain: EPC, tosca_id: com.trinity.epc.mind}\n" +
+"- {displayShortname: APN DNS, enclosingDomain: EPC, tosca_id: com.trinity.epc.apn_dns}\n" +
+"- {displayShortname: DRA EPC, enclosingDomain: EPC, tosca_id: com.trinity.epc.dra_epc}\n" +
+"- {displayShortname: HSS EPC, enclosingDomain: EPC, tosca_id: com.trinity.epc.hss_epc}\n" +
+"- {displayShortname: HLR, enclosingDomain: EPC, tosca_id: com.trinity.epc.hlr}\n" +
+"- {displayShortname: CPM, enclosingDomain: EPC, tosca_id: com.trinity.epc.cpm}\n" +
+"- {displayShortname: P-LRF/RDF, enclosingDomain: EPC, tosca_id: com.trinity.epc.p_lrf_sup}\n" +
+"- {displayShortname: SBC, enclosingDomain: USP, tosca_id: com.trinity.usp.sbc}\n" +
+"- {displayShortname: ATGW, enclosingDomain: USP, tosca_id: com.trinity.usp.atgw}\n" +
+"- {displayShortname: IWF, enclosingDomain: USP, tosca_id: com.trinity.usp.iwf}\n" +
+"- {displayShortname: ATCF, enclosingDomain: USP, tosca_id: com.trinity.usp.atcf}\n" +
+"- {displayShortname: P-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.p_cscf}\n" +
+"- {displayShortname: Transcoder, enclosingDomain: USP, tosca_id: com.trinity.usp.transcoder}\n" +
+"- {displayShortname: I-SBC, enclosingDomain: USP, tosca_id: com.trinity.usp.i_sbc}\n" +
+"- {displayShortname: SCC-AS, enclosingDomain: USP, tosca_id: com.trinity.usp.scc_as}\n" +
+"- {displayShortname: EATF, enclosingDomain: USP, tosca_id: com.trinity.usp.eatf}\n" +
+"- {displayShortname: TAS, enclosingDomain: USP, tosca_id: com.trinity.usp.tas_cts}\n" +
+"- {displayShortname: S-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.s_cscf}\n" +
+"- {displayShortname: E-CSCF (911), enclosingDomain: USP, tosca_id: com.trinity.usp.e_cscf}\n" +
+"- {displayShortname: I-CSCF, enclosingDomain: USP, tosca_id: com.trinity.usp.i_cscf}\n" +
+"- {displayShortname: TF / BGCF, enclosingDomain: USP, tosca_id: com.trinity.usp.tf_bgcf}\n" +
+"- {displayShortname: MGC-8, enclosingDomain: USP, tosca_id: com.trinity.usp.mgc8}\n" +
+"- {displayShortname: MRF, enclosingDomain: USP, tosca_id: com.trinity.usp.mrf}\n" +
+"- {displayShortname: USP DNS, enclosingDomain: USP, tosca_id: com.trinity.usp.dns}\n" +
+"- {displayShortname: DRA IMS, enclosingDomain: USP, tosca_id: com.trinity.usp.dra_ims}\n" +
+"- {displayShortname: ENUM, enclosingDomain: USP, tosca_id: com.trinity.usp.enum}\n" +
+"- {displayShortname: HSS IMS, enclosingDomain: USP, tosca_id: com.trinity.usp.hss_ims}\n" +
+"- {displayShortname: CCF, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.ccf}\n" +
+"- {displayShortname: BGF, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.bgf}\n" +
+"- {displayShortname: vMS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.ms}\n" +
+"- {displayShortname: vNS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.ns}\n" +
+"- {displayShortname: vAS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.as}\n" +
+"- {displayShortname: vA-SBG, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.a_sbg}\n" +
+"- {displayShortname: vDBE, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.dbe}\n" +
+"- {displayShortname: vN-SBG, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc1.n_sbg}\n" +
+"- {displayShortname: CCF, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.ccf}\n" +
+"- {displayShortname: BGF, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.bgf}\n" +
+"- {displayShortname: vMS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.ms}\n" +
+"- {displayShortname: vNS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.ns}\n" +
+"- {displayShortname: vAS, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.as}\n" +
+"- {displayShortname: vA-SBG, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.a_sbg}\n" +
+"- {displayShortname: vDBE, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.dbe}\n" +
+"- {displayShortname: vN-SBG, enclosingDomain: 'Datacenter', tosca_id: com.trinity.dc2.n_sbg}\n" +
+"- {displayShortname: PSX SIP, enclosingDomain: VNI, tosca_id: com.trinity.vni.sip_psx}\n" +
+"- {displayShortname: PSX Policy, enclosingDomain: VNI, tosca_id: com.trinity.vni.policy_psx}\n" +
+"- {displayShortname: IPBE, enclosingDomain: VNI, tosca_id: com.trinity.vni.ipbe}\n" +
+"- {displayShortname: GSX, enclosingDomain: VNI, tosca_id: com.trinity.vni.gsx}\n" +
+"- {displayShortname: BVoIP AS, enclosingDomain: VNI, tosca_id: com.trinity.vni.bvoip_as}\n" +
+"- {displayShortname: NGBE, enclosingDomain: VNI, tosca_id: com.trinity.vni.ngbe}\n" +
+"- {displayShortname: VoLTE UE, enclosingDomain: RAN, tosca_id: com.trinity.ue}\n" +
+"- {displayShortname: 3G UE, enclosingDomain: RAN, tosca_id: com.trinity.ue}\n" +
+"- {displayShortname: Trinity UE-A, enclosingDomain: 'Datacenter', tosca_id: com.trinity.ue}\n" +
+"- {displayShortname: Trinity UE-B, enclosingDomain: 'Datacenter', tosca_id: com.trinity.ue}\n" +
+"- {displayShortname: VNI UE, enclosingDomain: VNI, tosca_id: com.trinity.ue}\n" +
+"- {displayShortname: PSTN, enclosingDomain: VNI, tosca_id: com.trinity.ue}\n";
+
+
+var trinity_3g_jsonOld = "{" +
+ "\"diagram\": {" +
+ "\"created\": \"1453392975976\"," +
+ "\"rows\": \"18\"," +
+ "\"cols\": \"7\"," +
+ "\"gridPitchy\": \"42\"," +
+ "\"canvasHeight\": \"826\"," +
+ "\"canvasWidth\": \"1149\"," +
+ "\"encoding\": \"base64\"," +
+ "\"elements\": {" +
+ "\"nodes\": [" +
+ "{" +
+ "\"id\": \"32c3d197-3174-479b-07b1-073d07a0eea7\"," +
+ "\"data_x\": \"250\"," +
+ "\"data_y\": \"22\"," +
+ "\"width\": \"100\"," +
+ "\"innerText\": \"VUUz\"," +
+ "\"bpmn\": \"\"," +
+ "\"taska_id\": \"Y29tLmF0dC50cmluaXR5LnVlMw==\"," +
+ "\"role\": \"\"" +
+ "}," +
+ "{" +
+ "\"id\": \"204d7374-cd5b-9bdd-25bf-0dcaec3d9a73\"," +
+ "\"data_x\": \"570\"," +
+ "\"data_y\": \"22\"," +
+ "\"width\": \"100\"," +
+ "\"innerText\": \"VkEtU0JH\"," +
+ "\"bpmn\": \"\"," +
+ "\"taska_id\": \"Y29tLmF0dC50cmluaXR5LmFpYy5kYzEuYV9zYmc=\"," +
+ "\"role\": \"\"" +
+ "}," +
+ "{" +
+ "\"id\": \"61b531d6-a56c-ddb9-616d-f1524475fe99\"," +
+ "\"data_x\": \"730\"," +
+ "\"data_y\": \"22\"," +
+ "\"width\": \"100\"," +
+ "\"innerText\": \"dkFT\"," +
+ "\"bpmn\": \"\"," +
+ "\"taska_id\": \"Y29tLmF0dC50cmluaXR5LmFpYy5kYzEuYXM=\"," +
+ "\"role\": \"\"" +
+ "}," +
+ "{" +
+ "\"id\": \"be7bed7f-ac4b-29b4-2106-b9af84e50381\"," +
+ "\"data_x\": \"890\"," +
+ "\"data_y\": \"22\"," +
+ "\"width\": \"100\"," +
+ "\"innerText\": \"dk5T\"," +
+ "\"bpmn\": \"\"," +
+ "\"taska_id\": \"Y29tLmF0dC50cmluaXR5LmFpYy5kYzEubnM=\"," +
+ "\"role\": \"\"" +
+ "}" +
+ "]," +
+ "\"arrows\": [" +
+ "{" +
+ "\"id\": \"7e926a0a-f32a-fd2f-2f9f-7aeb90027243\"," +
+ "\"data_x\": \"300\"," +
+ "\"data_y\": \"186\"," +
+ "\"width\": \"308\"," +
+ "\"fromNodeID\": \"32c3d197-3174-479b-07b1-073d07a0eea7\"," +
+ "\"toNodeID\": \"204d7374-cd5b-9bdd-25bf-0dcaec3d9a73\"," +
+ "\"direction\": \"right\"," +
+ "\"innerText\": \"VW5hdXRob3JpemVkIDQwMQ==\"," +
+ "\"arrowDescription\": \"VHJpbml0eSBVRS1BIGlzIGFscmVhZHkgcmVnaXN0ZXJlZCB3aXRoIHZBLVNCRyBhbmQgdkFTLg==\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"b59fae70-46c4-2c2a-f216-d70fde6e9645\"," +
+ "\"data_x\": \"620\"," +
+ "\"data_y\": \"270\"," +
+ "\"width\": \"308\"," +
+ "\"fromNodeID\": \"204d7374-cd5b-9bdd-25bf-0dcaec3d9a73\"," +
+ "\"toNodeID\": \"be7bed7f-ac4b-29b4-2106-b9af84e50381\"," +
+ "\"direction\": \"right\"," +
+ "\"innerText\": \"\"," +
+ "\"arrowDescription\": \"dkEtU0JHIGZvcndhcmRzIHRoZSBpbnZpdGUgdG8gdk5TIGJhc2VkIG9uIEZRRE4gcmVzb2x1dGlvbi4gdk5TIGFjdHMgaW4gU0lQIHByb3h5IG1vZGUu\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"1eefc75c-3441-0211-0f3f-c84099bcd87f\"," +
+ "\"data_x\": \"780\"," +
+ "\"data_y\": \"354\"," +
+ "\"width\": \"148\"," +
+ "\"fromNodeID\": \"be7bed7f-ac4b-29b4-2106-b9af84e50381\"," +
+ "\"toNodeID\": \"61b531d6-a56c-ddb9-616d-f1524475fe99\"," +
+ "\"direction\": \"left\"," +
+ "\"innerText\": \"VW5hdXRob3JpemVkIDQwMQ==\"," +
+ "\"arrowDescription\": \"\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"1f1f0856-5b15-7aa4-c043-70312ea2e145\"," +
+ "\"data_x\": \"780\"," +
+ "\"data_y\": \"438\"," +
+ "\"width\": \"148\"," +
+ "\"fromNodeID\": \"61b531d6-a56c-ddb9-616d-f1524475fe99\"," +
+ "\"toNodeID\": \"be7bed7f-ac4b-29b4-2106-b9af84e50381\"," +
+ "\"direction\": \"right\"," +
+ "\"innerText\": \"\"," +
+ "\"arrowDescription\": \"\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"c07828b9-30d1-bff2-3e39-e9e81ba80db0\"," +
+ "\"data_x\": \"620\"," +
+ "\"data_y\": \"522\"," +
+ "\"width\": \"308\"," +
+ "\"fromNodeID\": \"be7bed7f-ac4b-29b4-2106-b9af84e50381\"," +
+ "\"toNodeID\": \"204d7374-cd5b-9bdd-25bf-0dcaec3d9a73\"," +
+ "\"direction\": \"left\"," +
+ "\"innerText\": \"\"," +
+ "\"arrowDescription\": \"\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"befed98b-9be8-5a65-01f2-5adf0147458f\"," +
+ "\"data_x\": \"620\"," +
+ "\"data_y\": \"690\"," +
+ "\"width\": \"148\"," +
+ "\"fromNodeID\": \"204d7374-cd5b-9bdd-25bf-0dcaec3d9a73\"," +
+ "\"toNodeID\": \"61b531d6-a56c-ddb9-616d-f1524475fe99\"," +
+ "\"direction\": \"right\"," +
+ "\"innerText\": \"\"," +
+ "\"arrowDescription\": \"\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}," +
+ "{" +
+ "\"id\": \"f938b120-0a6a-bfe5-caf3-c06d387e7efb\"," +
+ "\"data_x\": \"300\"," +
+ "\"data_y\": \"774\"," +
+ "\"width\": \"468\"," +
+ "\"fromNodeID\": \"61b531d6-a56c-ddb9-616d-f1524475fe99\"," +
+ "\"toNodeID\": \"32c3d197-3174-479b-07b1-073d07a0eea7\"," +
+ "\"direction\": \"left\"," +
+ "\"innerText\": \"\"," +
+ "\"arrowDescription\": \"\"," +
+ "\"messageType\": \"dW5kZWZpbmVk\"" +
+ "}" +
+ "]," +
+ "\"notes\": []," +
+ "\"separators\": [" +
+ "{" +
+ "\"lineNumber\": \"1\"," +
+ "\"text\": \"U3RlcDE6IGNhbGwgc2V0dXA=\"," +
+ "\"messageType\": \"\"" +
+ "}," +
+ "{" +
+ "\"lineNumber\": \"13\"," +
+ "\"text\": \"U3RlcCAyOiBDYWxs\"," +
+ "\"messageType\": \"\"" +
+ "}" +
+ "]" +
+ "}," +
+ "\"description\": \"Trinity to 3G\"" +
+ "}" +
+"}";
+
+
+
+var trinity_3g_json = '{' +
+ '"diagram": {' +
+ '"created": "1455122726993",' +
+ '"rows": "21",' +
+ '"cols": "7",' +
+ '"gridPitchy": "42",' +
+ '"canvasHeight": "919",' +
+ '"canvasWidth": "1112",' +
+ '"encoding": "base64",' +
+ '"elements": {' +
+ '"nodes": [' +
+ '{' +
+ '"id": "674e9e4e-95ef-23da-8755-77317f128686",' +
+ '"data_x": "250",' +
+ '"data_y": "22",' +
+ '"width": "100",' +
+ '"innerText": "VUUz",' +
+ '"bpmn": "",' +
+ '"taska_id": "Y29tLmF0dC50cmluaXR5LnVlMw==",' +
+ '"role": ""' +
+ '},' +
+ '{' +
+ '"id": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"data_x": "410",' +
+ '"data_y": "22",' +
+ '"width": "100",' +
+ '"innerText": "VkEtU0JH",' +
+ '"bpmn": "",' +
+ '"taska_id": "Y29tLmF0dC50cmluaXR5LmFpYy5kYzEuYV9zYmc=",' +
+ '"role": ""' +
+ '},' +
+ '{' +
+ '"id": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"data_x": "730",' +
+ '"data_y": "22",' +
+ '"width": "100",' +
+ '"innerText": "dkFT",' +
+ '"bpmn": "",' +
+ '"taska_id": "Y29tLmF0dC50cmluaXR5LmFpYy5kYzEuYXM=",' +
+ '"role": ""' +
+ '},' +
+ '{' +
+ '"id": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"data_x": "890",' +
+ '"data_y": "22",' +
+ '"width": "100",' +
+ '"innerText": "dk5T",' +
+ '"bpmn": "",' +
+ '"taska_id": "Y29tLmF0dC50cmluaXR5LmFpYy5kYzEubnM=",' +
+ '"role": ""' +
+ '}' +
+ '],' +
+ '"arrows": [' +
+ '{' +
+ '"id": "4b41cd7f-c74b-a7f0-3ff4-9dd42f826a15",' +
+ '"data_x": "300",' +
+ '"data_y": "144",' +
+ '"width": "148",' +
+ '"fromNodeID": "674e9e4e-95ef-23da-8755-77317f128686",' +
+ '"toNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"direction": "right",' +
+ '"innerText": "SW52aXRl",' +
+ '"arrowDescription": "VHJpbml0eSBVRS1BIGlzIGFscmVhZHkgcmVnaXN0ZXJlZCB3aXRoIHZBLVNCRyBhbmQgdkFTLg==",' +
+ '"messageType": "bWVkaWE="' +
+ '},' +
+ '{' +
+ '"id": "4c1c1c6e-91d0-af32-52cb-ee3a32ea5211",' +
+ '"data_x": "460",' +
+ '"data_y": "186",' +
+ '"width": "468",' +
+ '"fromNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"toNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"direction": "right",' +
+ '"innerText": "SW52aXRl",' +
+ '"arrowDescription": "dkEtU0JHIGZvcndhcmRzIHRoZSBpbnZpdGUgdG8gdk5TIGJhc2VkIG9uIEZRRE4gcmVzb2x1dGlvbi4gdk5TIGFjdHMgaW4gU0lQIHByb3h5IG1vZGUu",' +
+ '"messageType": "bWVkaWE="' +
+ '},' +
+ '{' +
+ '"id": "ba866c2c-7f06-50bf-d23b-365eb3089533",' +
+ '"data_x": "780",' +
+ '"data_y": "228",' +
+ '"width": "148",' +
+ '"fromNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"toNodeID": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"direction": "left",' +
+ '"innerText": "cHJveHkgSU5WSVRF",' +
+ '"arrowDescription": "",' +
+ '"messageType": "bWVkaWE="' +
+ '},' +
+ '{' +
+ '"id": "3326de92-459c-223e-29cf-ebf9581aa345",' +
+ '"data_x": "780",' +
+ '"data_y": "270",' +
+ '"width": "148",' +
+ '"fromNodeID": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"toNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"direction": "right",' +
+ '"innerText": "VW5hdXRob3JpemVkIDQwMQ==",' +
+ '"arrowDescription": "",' +
+ '"messageType": "bWVkaWE="' +
+ '},' +
+ '{' +
+ '"id": "4c47d49f-8b4e-46cb-adf6-68c9ec3a2824",' +
+ '"data_x": "460",' +
+ '"data_y": "312",' +
+ '"width": "468",' +
+ '"fromNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"toNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"direction": "left",' +
+ '"innerText": "cHJveHkgNDAxIFVuYXV0aG9yaXplZA==",' +
+ '"arrowDescription": "UHJveHkgdGhlIDQwMSBVbmF1dGhvcml6ZWQgbWVzc2FnZSB0byB0aGUgc3BlY2lmaWMgdkEtU0JHIHRoYXQgc2VudCB0aGUgSW52aXRlIG1lc3NhZ2Uu",' +
+ '"messageType": "bWVkaWE="' +
+ '},' +
+ '{' +
+ '"id": "47136318-f7dd-0d70-757e-ffdbc0d1abc8",' +
+ '"data_x": "300",' +
+ '"data_y": "354",' +
+ '"width": "148",' +
+ '"fromNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"toNodeID": "674e9e4e-95ef-23da-8755-77317f128686",' +
+ '"direction": "left",' +
+ '"innerText": "VW5hdXRob3JpemVkIDQwMQ==",' +
+ '"arrowDescription": "",' +
+ '"messageType": "c2lnbmFs"' +
+ '},' +
+ '{' +
+ '"id": "eb1cb207-cc10-bfda-8966-3437083c34f8",' +
+ '"data_x": "300",' +
+ '"data_y": "396",' +
+ '"width": "148",' +
+ '"fromNodeID": "674e9e4e-95ef-23da-8755-77317f128686",' +
+ '"toNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"direction": "right",' +
+ '"innerText": "SW52aXRl",' +
+ '"arrowDescription": "VGhlIFRyaW5pdHkgVUUgQSBzZW5kcyBhbiBJbnZpdGUgbWVzc2FnZSB3aXRoIGNyZWRlbnRpYWxzIHRvIHRoZSB2QS1TQkcgaXQgaXMgcmVnaXN0ZXJlZCB3aXRoLg==",' +
+ '"messageType": "c2lnbmFs"' +
+ '},' +
+ '{' +
+ '"id": "00e3a3ea-df9d-ad57-b14b-371ce6ce7bb2",' +
+ '"data_x": "460",' +
+ '"data_y": "438",' +
+ '"width": "468",' +
+ '"fromNodeID": "9d57a196-ef59-eead-de2f-ff0917623578",' +
+ '"toNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"direction": "right",' +
+ '"innerText": "SW52aXRl",' +
+ '"arrowDescription": "",' +
+ '"messageType": "c2lnbmFs"' +
+ '},' +
+ '{' +
+ '"id": "831e9811-2fc5-ab45-b9fc-61669f63d223",' +
+ '"data_x": "780",' +
+ '"data_y": "480",' +
+ '"width": "148",' +
+ '"fromNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"toNodeID": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"direction": "left",' +
+ '"innerText": "cHJveHkgSU5WSVRF",' +
+ '"arrowDescription": "dk5TIHByb3hpZXMgdGhlIEludml0ZSBtZXNzYWdlIHdpdGggY3JlZGVudGlhbHMgdG8gdGhlIHByZXZpb3VzbHkgc2VsZWN0ZWQgdkFTLg==",' +
+ '"messageType": "c2lnbmFs"' +
+ '},' +
+ '{' +
+ '"id": "78fe7e58-497e-907d-6f20-55e418f38542",' +
+ '"data_x": "780",' +
+ '"data_y": "522",' +
+ '"width": "148",' +
+ '"fromNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"toNodeID": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"direction": "left",' +
+ '"innerText": "SW52aXRl",' +
+ '"arrowDescription": "VGhlIHZBUyBleGVjdXRlcyBvcmlnaW5hdGluZyBjYWxsIHByb2Nlc3NpbmcgZm9yIFVFIEEgYW5kIGRldGVybWluZXMgdGhlIGNhbGxlZCBwYXJ0eSBpcyBub3QgdGhlIHNhbWUgdGVuYW50LiBUaGUgdkFTIHNlbmRzIGFuIEludml0ZSBtZXNzYWdlIHRvIHRoZSB2TlMgdGhhdCBhY3RzIGluIHJlZGlyZWN0IG1vZGUgYW5kIHNlbmRzIGEgM1hYIHBvaW50aW5nIHRvIHRoZSBURi9CR0NGLg==",' +
+ '"messageType": "c2lnbmFs"' +
+ '},' +
+ '{' +
+ '"id": "17634140-0fef-3bd7-1996-5621db3c7f7e",' +
+ '"data_x": "780",' +
+ '"data_y": "564",' +
+ '"width": "148",' +
+ '"fromNodeID": "f4185dfa-8ef7-3e01-7a90-2fc1b574142d",' +
+ '"toNodeID": "4a680033-36cb-a21a-3576-aee3a9766a68",' +
+ '"direction": "left",' +
+ '"innerText": "M1hYIHJlZGlyZWN0IHRvIFRyYW5zaXQgZnVuY3Rpb24=",' +
+ '"arrowDescription": "VGhlIHZOUyBhY3RzIGluIHJlZGlyZWN0IG1vZGUgYW5kIHNlbmRzIGEgM1hYIHRvIHRoZSB2QVMgcG9pbnRpbmcgdG8gdGhlIFRGL0JHQ0Yu",' +
+ '"messageType": "c2lnbmFs"' +
+ '}' +
+ '],' +
+ '"notes": [],' +
+ '"separators": [' +
+ '{' +
+ '"lineNumber": "1",' +
+ '"text": "U3RlcDE6IGNhbGwgc2V0dXA=",' +
+ '"messageType": ""' +
+ '},' +
+ '{' +
+ '"lineNumber": "16",' +
+ '"text": "U3RlcCAyOiBDYWxs",' +
+ '"messageType": ""' +
+ '}' +
+ ']' +
+ '},' +
+ '"description": "Trinity to 3G Sample"' +
+ '}' +
+'}'; \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListener.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListener.js
new file mode 100644
index 0000000..138550c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListener.js
@@ -0,0 +1,55 @@
+
+//Called when an node is moved, translates the arrow and updates attributes
+
+x = 0, y = 0; //Define coordinates
+
+function dragMoveListener (event) {
+ var target = event.target,
+ uuid = target.id,
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + event.dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + event.dy;
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ if ($("#"+uuid).hasClass("drag-1")){
+ storeXY(nodeArr,uuid);
+ }
+ if (y<30) {
+ moveSelection(event.dx,event.dy,event.target.id);
+ moveDependants(event.dx,event.dy,event.target.id);
+ }
+ else {
+ for (var i=0; i<arrowArr.length; i++){
+ if (arrowArr[i][8] == target.id){
+ arrowArr[i][8] = null;
+ }
+ if (arrowArr[i][9] == target.id){
+ arrowArr[i][9] = null;
+ }
+ determineLRNode(arrowArr[i][1],"arrow");
+ }
+ }
+
+ if (isOverlapped(uuid) == true){
+ document.getElementById(uuid).style.transition = "background .5s ease";
+ document.getElementById(uuid).style.background = "rgba(255,255,0,.40)"; //yellow
+ //shiftRight(event.target); Include for real-time shifting
+ }
+ else {
+ document.getElementById(uuid).style.background = "#29e"; //remove yellow
+ }
+ while (x>$("#grid").width() - $("#sideBar").width()){
+ addWidth();
+ }
+}
+
+// this is used in resizing
+window.dragMoveListener = dragMoveListener; \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
new file mode 100644
index 0000000..ae95580
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
@@ -0,0 +1,44 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Called when an arrow is moved, translates the arrow and updates attributes
+
+x = 0, y = 0; //Define coordinates
+
+function dragMoveListenerArrow (event) {
+ var target = event.target,
+ uuid = target.id,
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + event.dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + event.dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ if ($("#"+uuid).hasClass("arrowDraggable")){
+ storeXY(arrowArr,uuid);
+ }
+ if ($("#"+uuid).hasClass("note")){
+ storeXY(noteArr,uuid);
+ }
+
+}
+
+// this is used in resizing
+window.dragMoveListenerArrow = dragMoveListenerArrow; \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dropzones.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dropzones.js
new file mode 100644
index 0000000..295bec5
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dropzones.js
@@ -0,0 +1,704 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains interactions and functions that control dropzone behaviors
+
+//Creates the node dropzone///////////////////////////////////////////////////////////////////////
+interact('.nodeDropzone').dropzone({
+ // Require a 50% element overlap for a drop to be possible
+ overlap: 0.50,
+ accept: '.drag-1',
+ // listen for drop related events:
+
+ ondropactivate: function (event) {
+ // add active dropzone feedback
+ event.target.classList.add('drop-active');
+ },
+ ondragenter: function (event) {
+ var draggableElement = event.relatedTarget,
+ dropzoneElement = event.target;
+
+ // feedback the possibility of a drop
+ dropzoneElement.classList.add('drop-target');
+ draggableElement.classList.add('can-drop');
+ if (!$(draggableElement).hasClass("placed")){
+ draggableElement.textContent = 'You can drop me anywhere!';
+ }
+ },
+ ondragleave: function (event) {
+ // remove the drop feedback style
+ event.target.classList.remove('drop-target');
+ event.relatedTarget.classList.remove('can-drop');
+ event.relatedTarget.textContent = 'Dragged out';
+ },
+ ondrop: function (event) {
+ grabbedNode = event.relatedTarget;
+ var toscaID = $(grabbedNode).attr('taska_id');
+ var serviceName = "";
+ for ( var i = 0; i <= networkMap.length; i++ ) {
+ if ( networkMap[i].tosca_id == toscaID ) {
+ serviceName = networkMap[i].displayShortname;
+
+ break;
+ }
+ }
+ uuid = grabbedNode.id;
+ event.relatedTarget.textContent = 'Placed on grid';
+ if ($(grabbedNode).hasClass("placed")){
+ recallArray(nodeArr, uuid);
+ createNode(text, uuid);
+ }
+ if (!$(grabbedNode).hasClass("placed")){
+ var index = recallArray(nodeArr, uuid);
+ nodeArr[index][8] = null;
+ nodeArr[index][9] = null;
+ nodeArr[index][10] = null;
+ // When Node is placed this is the popup box that appears.
+ bootbox.confirm({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: 'Add Element ' + serviceName,
+ onEscape: function() {},
+ message: '<div style="color:grey;font-size:12px;"><br>Role : <input id="rolefield" style="width:100%;" type="text" placeholder="Add role for network element" value=""></div>',
+ callback: function(result) {
+ if (result == true) {
+ //EXECUTE THIS ON OKAY///
+ var text = serviceName;
+ document.getElementById(nodeArr[index][1]).setAttribute("taska_id",toscaID);
+ document.getElementById(nodeArr[index][1]).setAttribute("role_id",$("#rolefield").val());
+ document.getElementById(nodeArr[index][1]).setAttribute("sname",serviceName);
+
+ pushToDict(text, "node");
+ storeText(nodeArr, uuid, text);
+ grabbedNode.classList.add('placed');
+ grabbedNode.classList.add('verticallyScrollable');
+ if (isOverlapped(uuid) == false) {
+ for (var i = 0; i < arrowArr.length; i++) {
+ determineLRNode(arrowArr[i][1], uuid);
+ }
+ }
+ createNode(text, uuid);
+ for (var i = 0; i < arrowArr.length; i++) {
+ determineLRNode(arrowArr[i][1], uuid);
+ }
+ clearSelection();
+ /////////////////////////
+ }
+ }
+ });
+ $("#rolefield").autocomplete({
+ source: window[window.selectedPreset+"Role"],
+ autoFocus: true,
+ delay: 0
+ });
+
+ $("#rolefield").keyup( function(e) {
+ if (e.keyCode == 13){
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+
+ /* #nodeInnerText Code no longer needed Harde Codedd information. */
+ }
+
+ function createNode(text, uuid) {
+ var nodeHeight = parseInt($("#" + uuid).height());
+ nodeHeightCorrected = nodeHeight + 16;
+ var gridHeight = document.getElementById('grid').clientHeight;
+ gridHeightCorrected = gridHeight - 90;
+ if ($("#" + uuid).hasClass("expanded") == true) {
+ event.relatedTarget.innerHTML = '<div class="hasNodesHeader">' + text +
+ '</div>' +
+ '<div class="hasNodesBackground" style="height:' + gridHeightCorrected +
+ 'px"></div>' +
+ '<div class="verticalLine" style = "margin-left:0px; top:' +
+ nodeHeightCorrected + 'px;height:' + gridHeightCorrected + 'px;"></div>';
+ } else if ($("#" + uuid).hasClass("collapsed") == true) {
+ document.getElementById(uuid).innerHTML =
+ '<div class="nodeText nodeEllipsis">' + text +
+ '</div><div class="verticalLine" style = "top:' + nodeHeightCorrected +
+ 'px;height:' + gridHeightCorrected +
+ 'px;"></div><div class="collapsedPlus">+</div>';
+ } else {
+ event.relatedTarget.innerHTML = '<div class="nodeText nodeEllipsis">' +
+ text + '</div><div class="verticalLine" style = "top:' +
+ nodeHeightCorrected + 'px;height:' + gridHeightCorrected +
+ 'px;"></div>';
+ }
+
+
+ }
+ },
+ ondropdeactivate: function(event) {
+ // remove active dropzone feedback
+ event.target.classList.remove('drop-active');
+ event.target.classList.remove('drop-target');
+ }
+})
+.on('tap', function(event) {
+ if (event.button == 0) {
+ clearSelection();
+ }
+});
+
+var textsToInsert = [];
+
+function addMultipleNodes(uuidToDelete, leftX) {
+ textsToInsert.length = 0;
+ textsToInsert = [];
+ bootbox.hideAll();
+ bootbox.dialog({
+ title: 'Add multiple nodes',
+ message: '<input id="bulkNodeTextBox" type="text" style="margin-left:5%;width:90%;" placeholder="Add node text">' +
+ '<div id="listOfText" style="margin-top:10px;"><h4>Nodes to be added:</h4></div>',
+ onEscape: function() {},
+ closeButton: true,
+ animate: false,
+ buttons: {
+ Insert: {
+ label: 'Insert',
+ callback: function() {
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (nodeArr[i][1] == uuidToDelete) {
+ nodeArr.splice(i, 1);
+ warning();
+ break;
+ }
+ }
+ document.getElementById(uuidToDelete).remove();
+ for (var i = 0; i < textsToInsert.length; i++) {
+ id = guid();
+ storeArray("nodeArr", i, id, textsToInsert[i], leftX + i * 160, 22,
+ 100, null, null)
+ //if (i!=0) shiftByDx(160,id);
+ }
+ }
+ }
+ }
+ });
+ $("#bulkNodeTextBox").focus();
+ $("#bulkNodeTextBox").keyup(function(e) {
+ if (e.keyCode == 13) {
+ index = textsToInsert.push($("#bulkNodeTextBox").val());
+ var addHTML = '<div id="text' + index +
+ '"><div style="cursor:pointer;display:inline;margin-right:15px;" onclick="removeThis(event,this);">x</div><div style="display:inline;">' +
+ $("#bulkNodeTextBox").val() + '</div></div>'
+ document.getElementById("listOfText").innerHTML += addHTML;
+ $("#bulkNodeTextBox").val('');
+ $("#bulkNodeTextBox").focus();
+ }
+ });
+}
+
+function removeThis(event, ha) {
+ removeIndex = textsToInsert.indexOf(event.target.nextSibling.textContent)
+ textsToInsert.splice(removeIndex, 1)
+ event.target.parentNode.remove();
+ console.log(textsToInsert);
+}
+
+//Checks for overlaps
+function isOverlapped(uuid) {
+ for (var i = 0; i < nodeArr.length; i++) {
+ calcChildren(nodeArr[i][1]);
+ }
+ index = recallArray(nodeArr, uuid);
+ calcChildren(nodeArr[index][1]);
+ var x = parseInt(document.getElementById(uuid).getAttribute("data_x"));
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (uuid == nodeArr[i][1] || selection.indexOf(nodeArr[i][1]) != -1 ||
+ nodeArr[index][8] == nodeArr[i][1] || childrenIDs.indexOf(nodeArr[i][1]) !=
+ -1 || $('#' + nodeArr[i][1]).css('display') == 'none') {
+ continue;
+ }
+ if (nodeArr[i][3] == x) {
+ return true;
+ }
+ }
+ return false;
+}
+
+//If overlaps are detected, this moves them to the right
+var shiftMe = [];
+
+function shiftRight(target, dx) {
+ document.getElementById(target.id).style.background = "#29e"; //remove yellow
+ var x = parseInt(document.getElementById(target.id).getAttribute("data_x"));
+ shiftMe.length = 0;
+ index = recallArray(nodeArr, target.id);
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (target.id == nodeArr[i][1] || selection.indexOf(nodeArr[i][1]) != -1 ||
+ nodeArr[i][8] == nodeArr[index][1] || $('#' + nodeArr[i][1]).css('display') ==
+ 'none') {
+ continue;
+ }
+ if (nodeArr[i][3] == x) { //Found an overlap
+ shiftMe.push(nodeArr[i][1]);
+ for (var j = 0; j < nodeArr.length; j++) {
+ if (nodeArr[j][3] > nodeArr[i][3] && selection.indexOf(nodeArr[j][1]) == -1 &&
+ $('#' + nodeArr[i][1]).css('display') != 'none') { //found node to the right of overlap
+ shiftMe.push(nodeArr[j][1]);
+ }
+ }
+ }
+ }
+ for (var i = 0; i < shiftMe.length; i++) {
+ shiftedID = shiftMe[i];
+ var dy = 0;
+ var x = parseInt(document.getElementById(shiftedID).getAttribute("data_x")) +
+ dx;
+ var y = parseInt(document.getElementById(shiftedID).getAttribute("data_y")) +
+ dy;
+
+ document.getElementById(shiftedID).style.webkitTransform =
+ document.getElementById(shiftedID).style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ document.getElementById(shiftedID).setAttribute('data_x', x);
+ document.getElementById(shiftedID).setAttribute('data_y', y);
+
+ storeXY(nodeArr, shiftedID);
+
+ startArrowDependants.length = 0;
+ endArrowDependants.length = 0;
+
+ getStartArrowDependants(shiftedID);
+ getEndArrowDependants(shiftedID);
+
+ moveDependants(dx, dy, shiftedID);
+ }
+ getLifelines();
+}
+
+//Creates the arrow dropzone//////////////////////////////////////////////////////////////////////
+interact('.arrowDropzone').dropzone({
+ // Require a 75% element overlap for a drop to be possible
+ overlap: 0.75,
+ accept: '.gridDropzone',
+ // listen for drop related events:
+
+ ondropactivate: function(event) {
+ // add active dropzone feedback
+ event.target.classList.add('drop-active');
+ },
+ ondragenter: function(event) {
+ var draggableElement = event.relatedTarget,
+ dropzoneElement = event.target;
+
+ // feedback the possibility of a drop
+ dropzoneElement.classList.add('drop-target');
+ draggableElement.classList.add('can-drop');
+ },
+ ondragleave: function(event) {
+ // remove the drop feedback style
+ event.target.classList.remove('drop-target');
+ event.relatedTarget.classList.remove('can-drop');
+ },
+ ondrop: function(event) {
+ grabbedNode = event.relatedTarget
+ uuid = grabbedNode.id;
+ if ($(grabbedNode).hasClass("arrowPlaced")) {
+ determineLRNode(uuid, "arrow");
+ }
+ if (!$(grabbedNode).hasClass("arrowPlaced") && !$(grabbedNode).hasClass(
+ "note")) {
+ bootbox.confirm({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: "Add Link",
+ onEscape: function() {},
+ message: 'Link Message: <br> <input id="arrowInnerText" style="width:100%;" type="text" placeholder="Add text here" value="">' +
+ '<br>Description: <br><textarea id="arrowDescription" rows="5" placeholder="Add description (optional)"></textarea>' +
+ '<br>Message Type: <br> <select id="arrowMessageType" style="width:100%;"><option value="signal" selected="selected">Signal</option><option value="media">Media</option></select>',
+ callback: function(result) {
+ if (result == true) {
+ var innerText = $("#arrowInnerText").val();
+ var messageType = $("#arrowMessageType").val();
+
+ pushToDict(innerText, "arrow");
+ var index = storeText(arrowArr, uuid, innerText);
+ makeArrow(uuid);
+ arrowArr[index][10] = $("#arrowDescription").val();
+ if ($("#arrowDescription").val() == null) arrowArr[index][10] = "";
+ grabbedNode.classList.add('arrowPlaced');
+ grabbedNode.classList.add('resizable');
+ grabbedNode.setAttribute("direction", "right");
+ grabbedNode.setAttribute("message_type",messageType);
+ grabbedNode.innerHTML =
+ '<div class="arrow" style="display:inline; width:100%"><div class="makeEllipsis arrowText">' +
+ innerText +
+ '</div></div><div class="triangle" style="display:inline;"></div>';
+ determineLRNode(uuid, "arrow");
+ }
+ }
+ });
+ $("#arrowInnerText").autocomplete({
+ source: arrowTags,
+ autoFocus: true,
+ delay: 0
+ });
+ $("#arrowMessageType").autocomplete({
+ source: messageTags,
+ autoFocus: true,
+ delay: 0
+ });
+
+ var currentInput = $("#arrowInnerText").val();
+ $("#arrowInnerText").selectRange(0, currentInput.length);
+ $("#arrowInnerText").click(function() {
+ var currentInput = $("#arrowInnerText").val();
+ $("#arrowInnerText").selectRange(0, currentInput.length);
+ });
+ $("#arrowInnerText").keyup(function(e) {
+ if (e.keyCode == 13) {
+ $(document.getElementsByClassName('btn-primary')[0]).click();
+ }
+ });
+
+ }
+
+ if ($(grabbedNode).hasClass("notePlaced")) {
+
+ }
+ if (!$(grabbedNode).hasClass("notePlaced") && $(grabbedNode).hasClass(
+ "note")) {
+ bootbox.prompt({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: "Add Note",
+ value: "add text here",
+ placeholder: "add text here",
+ callback: function(result) {
+ if (result != null) {
+ //EXECUTE THIS ON OKAY///
+ var innerText = result;
+ pushToDict(innerText, "note");
+ var index = storeText(noteArr, uuid, innerText);
+ grabbedNode.classList.add('notePlaced');
+ grabbedNode.innerHTML = innerText;
+ /////////////////////////
+ }
+ }
+ });
+ $("#box").autocomplete({
+ source: noteTags,
+ autoFocus: true,
+ delay: 0
+ });
+ }
+ },
+ ondropdeactivate: function(event) {
+ // remove active dropzone feedback
+ event.target.classList.remove('drop-active');
+ event.target.classList.remove('drop-target');
+ }
+ })
+ .on('tap', function(event) {
+ if (event.button == 0) {
+ clearSelection();
+ }
+ });
+
+var deletedNodes = [];
+var deletedArrows = [];
+var deletedNotes = [];
+//Creates the trashbin as a dropzone and deletes children dropped into it/////////////////////////////////////////////////
+interact('.trash').dropzone({
+ // Require a 10% element overlap for a drop to be possible
+ overlap: 0.1,
+
+ // listen for drop related events:
+
+ ondropactivate: function(event) {
+ // add active dropzone feedback
+ event.target.classList.add('drop-active');
+ },
+ ondragenter: function(event) {
+ var draggableElement = event.relatedTarget,
+ dropzoneElement = event.target;
+
+ // feedback the possibility of a drop
+ dropzoneElement.classList.add('drop-targetTrash');
+ draggableElement.classList.add('can-drop');
+ },
+ ondragleave: function(event) {
+ // remove the drop feedback style
+ event.target.classList.remove('drop-targetTrash');
+ event.relatedTarget.classList.remove('can-drop');
+ },
+ ondrop: function(event) {
+ event.relatedTarget.textContent = 'Dropped';
+ //DELETES THE ELEMENT
+ document.getElementById("trash").src = "../images/trashCanFull.gif";
+ draggableElement = event.relatedTarget;
+ id = event.relatedTarget.id;
+ if ($("#" + id).hasClass("nodeDraggable")) {
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (nodeArr[i][1] == id) {
+ deletedNodes.push(nodeArr[i]);
+ nodeArr.splice(i, 1);
+ warning();
+ break;
+ }
+ }
+ }
+ if ($("#" + id).hasClass("arrowDraggable")) {
+ for (var i = 0; i < arrowArr.length; i++) {
+ if (arrowArr[i][1] == id) {
+ deletedArrows.push(arrowArr[i]);
+ deletedArrows[deletedArrows.length - 1][10] = document.getElementById(
+ arrowArr[i][1]).getAttribute("direction");
+ arrowArr.splice(i, 1);
+ warning();
+ break;
+ }
+ }
+ }
+ if ($("#" + id).hasClass("note")) {
+ for (var i = 0; i < noteArr.length; i++) {
+ if (noteArr[i][1] == id) {
+ deletedNotes.push(noteArr[i]);
+ noteArr.splice(i, 1);
+ break;
+ }
+ }
+ }
+ draggableElement.parentNode.removeChild(draggableElement);
+ clearSelection();
+ },
+ ondropdeactivate: function(event) {
+ // remove active dropzone feedback
+ event.target.classList.remove('drop-active');
+ event.target.classList.remove('drop-targetTrash');
+ }
+});
+
+interact('.trash')
+ .on('click', function(event) {
+ //Create restore menu
+ bootbox.dialog({
+ backdrop: true,
+ onEscape: function() {},
+ title: "<img src=\'../images/trashCan.gif\' height=\'35\' width=\'auto\'>TrashBin",
+ size: 'large',
+ message: '<div id="trashItems"><div id="nodeItems"><h4>Nodes</h3><ol id="nodeOL"></ol><hr></div><div id="arrowItems"><h4>Arrows</h3><ol id="arrowOL"></ol><hr></div><div id="noteItems"><h4>Notes</h3><ol id="noteOL"></ol><hr></div></div>' +
+ '<script>' +
+ 'for (var i=0;i<deletedNodes.length;i++){' +
+ 'document.getElementById("nodeOL").innerHTML+= "<li><h6 style=\'margin:0px;\'><pre>"+ deletedNodes[i][2] +" | "+deletedNodes[i][1]+" | {x:"+deletedNodes[i][3]+",y:"+deletedNodes[i][4]+"} <div onClick = \'restoreElement("+i+",0)\' style=\'display:inline;cursor:pointer;color:red;\'>Restore</div></pre></h6></li>";' +
+ '}' +
+ 'for (var i=0;i<deletedArrows.length;i++){' +
+ 'document.getElementById("arrowOL").innerHTML+= "<li><h6 style=\'margin:0px;\'><pre>"+ deletedArrows[i][2] +" | "+deletedArrows[i][1]+" | {x:"+deletedArrows[i][3]+",y:"+deletedArrows[i][4]+"} <div onClick = \'restoreElement("+i+",1)\' style=\'display:inline;cursor:pointer;color:red;\'>Restore</div></pre></h6></li>";' +
+ '}' +
+ 'for (var i=0;i<deletedNotes.length;i++){' +
+ 'document.getElementById("noteOL").innerHTML+= "<li><h6 style=\'margin:0px;\'><pre>"+ deletedNotes[i][2] +" | "+deletedNotes[i][1]+" | {x:"+deletedNotes[i][3]+",y:"+deletedNotes[i][4]+"} <div onClick = \'restoreElement("+i+",2)\' style=\'display:inline;cursor:pointer;color:red;\'>Restore</div></pre></h6></li>";' +
+ '}' +
+ '</script>'
+
+ });
+ });
+
+function restoreElement(index, type) {
+ bootbox.hideAll();
+ //Nodes
+ if (type == 0) {
+ $("#nodeZone").addClass('drop-target');
+ $("#nodeZone").css('cursor', 'crosshair');
+ document.getElementById("titleBar").innerHTML =
+ '<div class="center" style="width:25%;">Click where to append then press okay <button id="appendBtn" style="margin-left:10px;">Okay!</button></div>';
+
+ document.getElementById("appendSpot").style.visibility = 'visible';
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + 250 + 'px, ' + 22 + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", 250);
+ document.getElementById("appendSpot").setAttribute("y", 22);
+
+ $("#nodeZone").on('click', function(event) {
+ alert(this.attr('taska_id'));
+ window.tapX = event.pageX;
+ window.tapY = event.pageY;
+ var transposeX = Math.round((tapX) / 160) * 160 - 70;
+ var transposeY = 22;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", transposeX);
+ });
+ $(".nodeDraggable").on('click', function(event) {
+ alert(this.attr('taska_id'));
+ window.tapX = event.pageX;
+ window.tapY = event.pageY;
+ var transposeX = Math.round((tapX) / 160) * 160 - 70;
+ var transposeY = 22;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", transposeX);
+ });
+ document.getElementById("appendBtn").addEventListener("click", function() {
+ $("#nodeZone").removeClass('drop-target');
+ $("#nodeZone").css('cursor', 'auto');
+ document.getElementById("appendSpot").style.visibility = 'hidden';
+ var transposeX = document.getElementById("appendSpot").getAttribute("x");
+ var transposeY = document.getElementById("appendSpot").getAttribute("y");
+ resetTitleBar();
+ storeArray("nodeArr", i, guid(), deletedNodes[index][2], transposeX,
+ transposeY, deletedNodes[index][5], null, null, deletedNodes[index][10]);
+ deletedNodes.splice(index, 1);
+ if (deletedNodes.length + deletedArrows.length + deletedNotes.length == 0) {
+ document.getElementById("trash").src = "../images/trashCan.gif";
+ }
+ });
+ }
+
+ //Arrows
+ else if (type == 1) {
+ $("#lines").addClass('drop-target');
+ $("#lines").css('cursor', 'crosshair');
+ document.getElementById("titleBar").innerHTML =
+ '<div class="center" style="width:25%;">Click where to append then press okay <button id="appendBtn" style="margin-left:10px;">Okay!</button></div>';
+ document.getElementById("appendSpot").style.visibility = 'visible';
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + 300 + 'px, ' + 75 + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", 300);
+ document.getElementById("appendSpot").setAttribute("y", 75);
+
+ $("#lines").on('click', function(event) {
+ window.gridTapX = event.pageX;
+ window.gridTapY = event.pageY;
+ var transposeX = Math.round((gridTapX) / 160) * 160 - 20;
+ var transposeY = Math.floor((gridTapY) / 42) * 42 - 50;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", transposeX);
+ document.getElementById("appendSpot").setAttribute("y", parseInt(
+ transposeY) - 1);
+ });
+
+ document.getElementById("appendBtn").addEventListener("click", function() {
+ $("#lines").removeClass('drop-target');
+ $("#lines").css('cursor', 'auto');
+ document.getElementById("appendSpot").style.visibility = 'hidden';
+ var transposeX = document.getElementById("appendSpot").getAttribute("x");
+ var transposeY = parseInt(document.getElementById("appendSpot").getAttribute(
+ "y")) + 27;
+ resetTitleBar();
+ storeArray("arrowArr", i, guid(), deletedArrows[index][2], transposeX,
+ transposeY, deletedArrows[index][5], deletedArrows[index][10], null);
+ warning();
+ deletedArrows.splice(index, 1);
+ if (deletedNodes.length + deletedArrows.length + deletedNotes.length == 0) {
+ document.getElementById("trash").src = "../images/trashCan.gif";
+ }
+ });
+ }
+
+ //Notes
+ else if (type == 2) {
+ $("#lines").addClass('drop-target');
+ $("#lines").css('cursor', 'crosshair');
+ document.getElementById("titleBar").innerHTML =
+ '<div class="center" style="width:25%;">Click where to append then press okay <button id="appendBtn" style="margin-left:10px;">Okay!</button></div>';
+ document.getElementById("appendSpot").style.visibility = 'visible';
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + 300 + 'px, ' + 75 + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", 300);
+ document.getElementById("appendSpot").setAttribute("y", 75);
+ $("#lines").on('click', function(event) {
+ window.gridTapX = event.pageX;
+ window.gridTapY = event.pageY;
+ var transposeX = Math.round((gridTapX) / 160) * 160 - 20;
+ var transposeY = Math.floor((gridTapY) / 42) * 42 - 50;
+ document.getElementById("appendSpot").style.webkitTransform =
+ document.getElementById("appendSpot").style.transform =
+ 'translate(' + transposeX + 'px, ' + transposeY + 'px)';
+ document.getElementById("appendSpot").setAttribute("x", transposeX);
+ document.getElementById("appendSpot").setAttribute("y", parseInt(
+ transposeY) - 1);
+ });
+ document.getElementById("appendBtn").addEventListener("click", function() {
+ $("#lines").removeClass('drop-target');
+ $("#lines").css('cursor', 'auto');
+ document.getElementById("appendSpot").style.visibility = 'hidden';
+ var transposeX = document.getElementById("appendSpot").getAttribute("x");
+ var transposeY = parseInt(document.getElementById("appendSpot").getAttribute(
+ "y")) + 38;
+ resetTitleBar();
+ storeArray("noteArr", i, guid(), deletedNotes[index][2], transposeX,
+ transposeY, deletedNotes[index][5], null, deletedNotes[index][7] -
+ deletedNotes[index][4]);
+ deletedNotes.splice(index, 1);
+ if (deletedNodes.length + deletedArrows.length + deletedNotes.length == 0) {
+ document.getElementById("trash").src = "../images/trashCan.gif";
+ }
+ });
+ }
+}
+
+
+/*DROPZONE TEMPLATE
+interact('.dropzone').dropzone({
+ // Require a 75% element overlap for a drop to be possible
+ overlap: 0.75,
+
+ // listen for drop related events:
+
+ ondropactivate: function (event) {
+ // add active dropzone feedback
+ event.target.classList.add('drop-active');
+ },
+ ondragenter: function (event) {
+ var draggableElement = event.relatedTarget,
+ dropzoneElement = event.target;
+
+ // feedback the possibility of a drop
+ dropzoneElement.classList.add('drop-target');
+ draggableElement.classList.add('can-drop');
+ draggableElement.textContent = 'You can drop me anywhere!';
+
+
+ var instruct = document.getElementById("instructions");
+ instructions.textContent = '';
+
+ },
+ ondragleave: function (event) {
+ // remove the drop feedback style
+ event.target.classList.remove('drop-target');
+ event.relatedTarget.classList.remove('can-drop');
+ event.relatedTarget.textContent = 'Dragged out';
+ },
+ ondrop: function (event) {
+ grabbedNode = event.relatedTarget
+ grabbedNode.textContent = 'Placed on diagram';
+ var innerText = prompt("Please enter what you'd like displayed in this node", "<+->");
+ if (innerText != null) {
+ grabbedNode.textContent = innerText;
+ }
+ },
+ ondropdeactivate: function (event) {
+ // remove active dropzone feedback
+ event.target.classList.remove('drop-active');
+ event.target.classList.remove('drop-target');
+ }
+});
+*/
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/elements_ase.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/elements_ase.js
new file mode 100644
index 0000000..1236d75
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/elements_ase.js
@@ -0,0 +1,76 @@
+var networkMap = [
+ {'displayShortname': 'eNB', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.enodeb'},
+ {'displayShortname': 'SIAD', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.siad'},
+ {'displayShortname': 'NodeB', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.nb'},
+ {'displayShortname': 'eMSC', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.emsc'},
+ {'displayShortname': 'RNC', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.rnc'},
+ {'displayShortname': 'MGW', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.mgw'},
+ {'displayShortname': 'SS7 GPORT', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.ss7_gport'},
+ {'displayShortname': 'MSN', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.msn'},
+ {'displayShortname': 'E-SMLC', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ran.e_smlc'},
+ {'displayShortname': 'SGSN-S4', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.sgsn_s4'},
+ {'displayShortname': 'MME', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.mme'},
+ {'displayShortname': 'P_LRF (RDF)', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.p_lrf'},
+ {'displayShortname': 'GMLC', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.gmlc'},
+ {'displayShortname': 'PCEF', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.pcef'},
+ {'displayShortname': 'SDG', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.sdg'},
+ {'displayShortname': 'P-GW', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.p_gw'},
+ {'displayShortname': 'S-GW', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.s_gw'},
+ {'displayShortname': 'PAS', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.pas'},
+ {'displayShortname': 'PCRF', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.pcrf'},
+ {'displayShortname': 'MIND', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.mind'},
+ {'displayShortname': 'APN DNS', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.apn_dns'},
+ {'displayShortname': 'DRA EPC', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.dra_epc'},
+ {'displayShortname': 'HSS EPC', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.hss_epc'},
+ {'displayShortname': 'HLR', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.hlr'},
+ {'displayShortname': 'CPM', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.cpm'},
+ {'displayShortname': 'P-LRF/RDF', 'enclosingDomain': 'EPC', 'tosca_id': 'com.openecomp.trinity.epc.p_lrf_sup'},
+ {'displayShortname': 'SBC', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.sbc'},
+ {'displayShortname': 'ATGW', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.atgw'},
+ {'displayShortname': 'IWF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.iwf'},
+ {'displayShortname': 'ATCF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.atcf'},
+ {'displayShortname': 'P-CSCF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.p_cscf'},
+ {'displayShortname': 'Transcoder', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.transcoder'},
+ {'displayShortname': 'I-SBC', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.i_sbc'},
+ {'displayShortname': 'SCC-AS', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.scc_as'},
+ {'displayShortname': 'EATF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.eatf'},
+ {'displayShortname': 'TAS', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.tas_cts'},
+ {'displayShortname': 'S-CSCF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.s_cscf'},
+ {'displayShortname': 'E-CSCF (911)', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.e_cscf'},
+ {'displayShortname': 'I-CSCF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.i_cscf'},
+ {'displayShortname': 'TF / BGCF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.tf_bgcf'},
+ {'displayShortname': 'MGC-8', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.mgc8'},
+ {'displayShortname': 'MRF', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.mrf'},
+ {'displayShortname': 'USP DNS', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.dns'},
+ {'displayShortname': 'DRA IMS', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.dra_ims'},
+ {'displayShortname': 'ENUM', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.enum'},
+ {'displayShortname': 'HSS IMS', 'enclosingDomain': 'USP', 'tosca_id': 'com.openecomp.trinity.usp.hss_ims'},
+ {'displayShortname': 'CCF', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.ccf'},
+ {'displayShortname': 'BGF', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.bgf'},
+ {'displayShortname': 'vMS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.ms'},
+ {'displayShortname': 'vNS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.ns'},
+ {'displayShortname': 'vAS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.as'},
+ {'displayShortname': 'vA-SBG', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.a_sbg'},
+ {'displayShortname': 'vDBE', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.dbe'},
+ {'displayShortname': 'vN-SBG', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc1.n_sbg'},
+ {'displayShortname': 'CCF', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.ccf'},
+ {'displayShortname': 'BGF', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.bgf'},
+ {'displayShortname': 'vMS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.ms'},
+ {'displayShortname': 'vNS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.ns'},
+ {'displayShortname': 'vAS', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.as'},
+ {'displayShortname': 'vA-SBG', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.a_sbg'},
+ {'displayShortname': 'vDBE', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.dbe'},
+ {'displayShortname': 'vN-SBG', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.dc2.n_sbg'},
+ {'displayShortname': 'PSX SIP', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.sip_psx'},
+ {'displayShortname': 'PSX Policy', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.policy_psx'},
+ {'displayShortname': 'IPBE', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.ipbe'},
+ {'displayShortname': 'GSX', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.gsx'},
+ {'displayShortname': 'BVoIP AS', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.bvoip_as'},
+ {'displayShortname': 'NGBE', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.vni.ngbe'},
+ {'displayShortname': 'VoLTE UE', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ue'},
+ {'displayShortname': '3G UE', 'enclosingDomain': 'RAN', 'tosca_id': 'com.openecomp.trinity.ue'},
+ {'displayShortname': 'Trinity UE-A', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.ue'},
+ {'displayShortname': 'Trinity UE-B', 'enclosingDomain': 'Datacenter', 'tosca_id': 'com.openecomp.trinity.ue'},
+ {'displayShortname': 'VNI UE', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.ue'},
+ {'displayShortname': 'PSTN', 'enclosingDomain': 'VNI', 'tosca_id': 'com.openecomp.trinity.ue'}
+ ]; \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootbox.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootbox.js
new file mode 100644
index 0000000..fe5b720
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootbox.js
@@ -0,0 +1,986 @@
+/**
+ * bootbox.js [v4.4.0]
+ *
+ * http://bootboxjs.com/license.txt
+ */
+
+// @see https://github.com/makeusabrew/bootbox/issues/180
+// @see https://github.com/makeusabrew/bootbox/issues/186
+(function (root, factory) {
+
+ "use strict";
+ if (typeof define === "function" && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(["jquery"], factory);
+ } else if (typeof exports === "object") {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory(require("jquery"));
+ } else {
+ // Browser globals (root is window)
+ root.bootbox = factory(root.jQuery);
+ }
+
+}(this, function init($, undefined) {
+
+ "use strict";
+
+ // the base DOM structure needed to create a modal
+ var templates = {
+ dialog:
+ "<div class='bootbox modal' tabindex='-1' role='dialog'>" +
+ "<div class='modal-dialog'>" +
+ "<div class='modal-content'>" +
+ "<div class='modal-body'><div class='bootbox-body'></div></div>" +
+ "</div>" +
+ "</div>" +
+ "</div>",
+ header:
+ "<div class='modal-header'>" +
+ "<h4 class='modal-title'></h4>" +
+ "</div>",
+ footer:
+ "<div class='modal-footer'></div>",
+ closeButton:
+ "<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",
+ form:
+ "<form class='bootbox-form'></form>",
+ //CUSTOM
+ inputs: {
+ text:
+ "<input id='box' class='bootbox-input bootbox-input-text form-control' onfocus='this.select();' autocomplete=off type=text style='width:100%' />",
+ textarea:
+ "<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",
+ email:
+ "<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",
+ select:
+ "<select class='bootbox-input bootbox-input-select form-control'></select>",
+ checkbox:
+ "<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",
+ date:
+ "<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",
+ time:
+ "<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",
+ number:
+ "<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",
+ password:
+ "<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"
+ }
+ };
+
+ var defaults = {
+ // default language
+ locale: "en",
+ // show backdrop or not. Default to static so user has to interact with dialog
+ backdrop: "static",
+ // animate the modal in/out
+ animate: true,
+ // additional class string applied to the top level dialog
+ className: null,
+ // whether or not to include a close button
+ closeButton: true,
+ // show the dialog immediately by default
+ show: true,
+ // dialog container
+ container: "body"
+ };
+
+ // our public object; augmented after our private API
+ var exports = {};
+
+ /**
+ * @private
+ */
+ function _t(key) {
+ var locale = locales[defaults.locale];
+ return locale ? locale[key] : locales.en[key];
+ }
+
+ function processCallback(e, dialog, callback) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ // by default we assume a callback will get rid of the dialog,
+ // although it is given the opportunity to override this
+
+ // so, if the callback can be invoked and it *explicitly returns false*
+ // then we'll set a flag to keep the dialog active...
+ var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false;
+
+ // ... otherwise we'll bin it
+ if (!preserveDialog) {
+ dialog.modal("hide");
+ }
+ }
+
+ function getKeyLength(obj) {
+ // @TODO defer to Object.keys(x).length if available?
+ var k, t = 0;
+ for (k in obj) {
+ t ++;
+ }
+ return t;
+ }
+
+ function each(collection, iterator) {
+ var index = 0;
+ $.each(collection, function(key, value) {
+ iterator(key, value, index++);
+ });
+ }
+
+ function sanitize(options) {
+ var buttons;
+ var total;
+
+ if (typeof options !== "object") {
+ throw new Error("Please supply an object of options");
+ }
+
+ if (!options.message) {
+ throw new Error("Please specify a message");
+ }
+
+ // make sure any supplied options take precedence over defaults
+ options = $.extend({}, defaults, options);
+
+ if (!options.buttons) {
+ options.buttons = {};
+ }
+
+ buttons = options.buttons;
+
+ total = getKeyLength(buttons);
+
+ each(buttons, function(key, button, index) {
+
+ if ($.isFunction(button)) {
+ // short form, assume value is our callback. Since button
+ // isn't an object it isn't a reference either so re-assign it
+ button = buttons[key] = {
+ callback: button
+ };
+ }
+
+ // before any further checks make sure by now button is the correct type
+ if ($.type(button) !== "object") {
+ throw new Error("button with key " + key + " must be an object");
+ }
+
+ if (!button.label) {
+ // the lack of an explicit label means we'll assume the key is good enough
+ button.label = key;
+ }
+
+ if (!button.className) {
+ if (total <= 2 && index === total-1) {
+ // always add a primary to the main option in a two-button dialog
+ button.className = "btn-primary";
+ } else {
+ button.className = "btn-default";
+ }
+ }
+ });
+
+ return options;
+ }
+
+ /**
+ * map a flexible set of arguments into a single returned object
+ * if args.length is already one just return it, otherwise
+ * use the properties argument to map the unnamed args to
+ * object properties
+ * so in the latter case:
+ * mapArguments(["foo", $.noop], ["message", "callback"])
+ * -> { message: "foo", callback: $.noop }
+ */
+ function mapArguments(args, properties) {
+ var argn = args.length;
+ var options = {};
+
+ if (argn < 1 || argn > 2) {
+ throw new Error("Invalid argument length");
+ }
+
+ if (argn === 2 || typeof args[0] === "string") {
+ options[properties[0]] = args[0];
+ options[properties[1]] = args[1];
+ } else {
+ options = args[0];
+ }
+
+ return options;
+ }
+
+ /**
+ * merge a set of default dialog options with user supplied arguments
+ */
+ function mergeArguments(defaults, args, properties) {
+ return $.extend(
+ // deep merge
+ true,
+ // ensure the target is an empty, unreferenced object
+ {},
+ // the base options object for this type of dialog (often just buttons)
+ defaults,
+ // args could be an object or array; if it's an array properties will
+ // map it to a proper options object
+ mapArguments(
+ args,
+ properties
+ )
+ );
+ }
+
+ /**
+ * this entry-level method makes heavy use of composition to take a simple
+ * range of inputs and return valid options suitable for passing to bootbox.dialog
+ */
+ function mergeDialogOptions(className, labels, properties, args) {
+ // build up a base set of dialog properties
+ var baseOptions = {
+ className: "bootbox-" + className,
+ buttons: createLabels.apply(null, labels)
+ };
+
+ // ensure the buttons properties generated, *after* merging
+ // with user args are still valid against the supplied labels
+ return validateButtons(
+ // merge the generated base properties with user supplied arguments
+ mergeArguments(
+ baseOptions,
+ args,
+ // if args.length > 1, properties specify how each arg maps to an object key
+ properties
+ ),
+ labels
+ );
+ }
+
+ /**
+ * from a given list of arguments return a suitable object of button labels
+ * all this does is normalise the given labels and translate them where possible
+ * e.g. "ok", "confirm" -> { ok: "OK, cancel: "Annuleren" }
+ */
+ function createLabels() {
+ var buttons = {};
+
+ for (var i = 0, j = arguments.length; i < j; i++) {
+ var argument = arguments[i];
+ var key = argument.toLowerCase();
+ var value = argument.toUpperCase();
+
+ buttons[key] = {
+ label: _t(value)
+ };
+ }
+
+ return buttons;
+ }
+
+ function validateButtons(options, buttons) {
+ var allowedButtons = {};
+ each(buttons, function(key, value) {
+ allowedButtons[value] = true;
+ });
+
+ each(options.buttons, function(key) {
+ if (allowedButtons[key] === undefined) {
+ throw new Error("button key " + key + " is not allowed (options are " + buttons.join("\n") + ")");
+ }
+ });
+
+ return options;
+ }
+
+ exports.alert = function() {
+ var options;
+
+ options = mergeDialogOptions("alert", ["ok"], ["message", "callback"], arguments);
+
+ if (options.callback && !$.isFunction(options.callback)) {
+ throw new Error("alert requires callback property to be a function when provided");
+ }
+
+ /**
+ * overrides
+ */
+ options.buttons.ok.callback = options.onEscape = function() {
+ if ($.isFunction(options.callback)) {
+ return options.callback.call(this);
+ }
+ return true;
+ };
+
+ return exports.dialog(options);
+ };
+
+ exports.confirm = function() {
+ var options;
+
+ options = mergeDialogOptions("confirm", ["cancel", "confirm"], ["message", "callback"], arguments);
+
+ /**
+ * overrides; undo anything the user tried to set they shouldn't have
+ */
+ options.buttons.cancel.callback = options.onEscape = function() {
+ return options.callback.call(this, false);
+ };
+
+ options.buttons.confirm.callback = function() {
+ return options.callback.call(this, true);
+ };
+
+ // confirm specific validation
+ if (!$.isFunction(options.callback)) {
+ throw new Error("confirm requires a callback");
+ }
+
+ return exports.dialog(options);
+ };
+
+ exports.prompt = function() {
+ var options;
+ var defaults;
+ var dialog;
+ var form;
+ var input;
+ var shouldShow;
+ var inputOptions;
+
+ // we have to create our form first otherwise
+ // its value is undefined when gearing up our options
+ // @TODO this could be solved by allowing message to
+ // be a function instead...
+ form = $(templates.form);
+
+ // prompt defaults are more complex than others in that
+ // users can override more defaults
+ // @TODO I don't like that prompt has to do a lot of heavy
+ // lifting which mergeDialogOptions can *almost* support already
+ // just because of 'value' and 'inputType' - can we refactor?
+ defaults = {
+ className: "bootbox-prompt",
+ buttons: createLabels("cancel", "confirm"),
+ value: "",
+ inputType: "text"
+ };
+
+ options = validateButtons(
+ mergeArguments(defaults, arguments, ["title", "callback"]),
+ ["cancel", "confirm"]
+ );
+
+ // capture the user's show value; we always set this to false before
+ // spawning the dialog to give us a chance to attach some handlers to
+ // it, but we need to make sure we respect a preference not to show it
+ shouldShow = (options.show === undefined) ? true : options.show;
+
+ /**
+ * overrides; undo anything the user tried to set they shouldn't have
+ */
+ options.message = form;
+
+ options.buttons.cancel.callback = options.onEscape = function() {
+ return options.callback.call(this, null);
+ };
+
+ options.buttons.confirm.callback = function() {
+ var value;
+
+ switch (options.inputType) {
+ case "text":
+ case "textarea":
+ case "email":
+ case "select":
+ case "date":
+ case "time":
+ case "number":
+ case "password":
+ value = input.val();
+ break;
+
+ case "checkbox":
+ var checkedItems = input.find("input:checked");
+
+ // we assume that checkboxes are always multiple,
+ // hence we default to an empty array
+ value = [];
+
+ each(checkedItems, function(_, item) {
+ value.push($(item).val());
+ });
+ break;
+ }
+
+ return options.callback.call(this, value);
+ };
+
+ options.show = false;
+
+ // prompt specific validation
+ if (!options.title) {
+ throw new Error("prompt requires a title");
+ }
+
+ if (!$.isFunction(options.callback)) {
+ throw new Error("prompt requires a callback");
+ }
+
+ if (!templates.inputs[options.inputType]) {
+ throw new Error("invalid prompt type");
+ }
+
+ // create the input based on the supplied type
+ input = $(templates.inputs[options.inputType]);
+
+ switch (options.inputType) {
+ case "text":
+ case "textarea":
+ case "email":
+ case "date":
+ case "time":
+ case "number":
+ case "password":
+ input.val(options.value);
+ break;
+
+ case "select":
+ var groups = {};
+ inputOptions = options.inputOptions || [];
+
+ if (!$.isArray(inputOptions)) {
+ throw new Error("Please pass an array of input options");
+ }
+
+ if (!inputOptions.length) {
+ throw new Error("prompt with select requires options");
+ }
+
+ each(inputOptions, function(_, option) {
+
+ // assume the element to attach to is the input...
+ var elem = input;
+
+ if (option.value === undefined || option.text === undefined) {
+ throw new Error("given options in wrong format");
+ }
+
+ // ... but override that element if this option sits in a group
+
+ if (option.group) {
+ // initialise group if necessary
+ if (!groups[option.group]) {
+ groups[option.group] = $("<optgroup/>").attr("label", option.group);
+ }
+
+ elem = groups[option.group];
+ }
+
+ elem.append("<option value='" + option.value + "'>" + option.text + "</option>");
+ });
+
+ each(groups, function(_, group) {
+ input.append(group);
+ });
+
+ // safe to set a select's value as per a normal input
+ input.val(options.value);
+ break;
+
+ case "checkbox":
+ var values = $.isArray(options.value) ? options.value : [options.value];
+ inputOptions = options.inputOptions || [];
+
+ if (!inputOptions.length) {
+ throw new Error("prompt with checkbox requires options");
+ }
+
+ if (!inputOptions[0].value || !inputOptions[0].text) {
+ throw new Error("given options in wrong format");
+ }
+
+ // checkboxes have to nest within a containing element, so
+ // they break the rules a bit and we end up re-assigning
+ // our 'input' element to this container instead
+ input = $("<div/>");
+
+ each(inputOptions, function(_, option) {
+ var checkbox = $(templates.inputs[options.inputType]);
+
+ checkbox.find("input").attr("value", option.value);
+ checkbox.find("label").append(option.text);
+
+ // we've ensured values is an array so we can always iterate over it
+ each(values, function(_, value) {
+ if (value === option.value) {
+ checkbox.find("input").prop("checked", true);
+ }
+ });
+
+ input.append(checkbox);
+ });
+ break;
+ }
+
+ // @TODO provide an attributes option instead
+ // and simply map that as keys: vals
+ if (options.placeholder) {
+ input.attr("placeholder", options.placeholder);
+ }
+
+ if (options.pattern) {
+ input.attr("pattern", options.pattern);
+ }
+
+ if (options.maxlength) {
+ input.attr("maxlength", options.maxlength);
+ }
+
+ // now place it in our form
+ form.append(input);
+
+ form.on("submit", function(e) {
+ e.preventDefault();
+ // Fix for SammyJS (or similar JS routing library) hijacking the form post.
+ e.stopPropagation();
+ // @TODO can we actually click *the* button object instead?
+ // e.g. buttons.confirm.click() or similar
+ dialog.find(".btn-primary").click();
+ });
+
+ dialog = exports.dialog(options);
+
+ // clear the existing handler focusing the submit button...
+ dialog.off("shown.bs.modal");
+
+ // ...and replace it with one focusing our input, if possible
+ dialog.on("shown.bs.modal", function() {
+ // need the closure here since input isn't
+ // an object otherwise
+ input.focus();
+ });
+
+ if (shouldShow === true) {
+ dialog.modal("show");
+ }
+
+ return dialog;
+ };
+
+ exports.dialog = function(options) {
+ options = sanitize(options);
+
+ var dialog = $(templates.dialog);
+ var innerDialog = dialog.find(".modal-dialog");
+ var body = dialog.find(".modal-body");
+ var buttons = options.buttons;
+ var buttonStr = "";
+ var callbacks = {
+ onEscape: options.onEscape
+ };
+
+ if ($.fn.modal === undefined) {
+ throw new Error(
+ "$.fn.modal is not defined; please double check you have included " +
+ "the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ " +
+ "for more details."
+ );
+ }
+
+ each(buttons, function(key, button) {
+
+ // @TODO I don't like this string appending to itself; bit dirty. Needs reworking
+ // can we just build up button elements instead? slower but neater. Then button
+ // can just become a template too
+ buttonStr += "<button data-bb-handler='" + key + "' type='button' class='btn " + button.className + "'>" + button.label + "</button>";
+ callbacks[key] = button.callback;
+ });
+
+ body.find(".bootbox-body").html(options.message);
+
+ if (options.animate === true) {
+ dialog.addClass("fade");
+ }
+
+ if (options.className) {
+ dialog.addClass(options.className);
+ }
+
+ if (options.size === "large") {
+ innerDialog.addClass("modal-lg");
+ } else if (options.size === "small") {
+ innerDialog.addClass("modal-sm");
+ }
+
+ if (options.title) {
+ body.before(templates.header);
+ }
+
+ if (options.closeButton) {
+ var closeButton = $(templates.closeButton);
+
+ if (options.title) {
+ dialog.find(".modal-header").prepend(closeButton);
+ } else {
+ closeButton.css("margin-top", "-10px").prependTo(body);
+ }
+ }
+
+ if (options.title) {
+ dialog.find(".modal-title").html(options.title);
+ }
+
+ if (buttonStr.length) {
+ body.after(templates.footer);
+ dialog.find(".modal-footer").html(buttonStr);
+ }
+
+
+ /**
+ * Bootstrap event listeners; used handle extra
+ * setup & teardown required after the underlying
+ * modal has performed certain actions
+ */
+
+ dialog.on("hidden.bs.modal", function(e) {
+ // ensure we don't accidentally intercept hidden events triggered
+ // by children of the current dialog. We shouldn't anymore now BS
+ // namespaces its events; but still worth doing
+ if (e.target === this) {
+ dialog.remove();
+ }
+ });
+
+ /*
+ dialog.on("show.bs.modal", function() {
+ // sadly this doesn't work; show is called *just* before
+ // the backdrop is added so we'd need a setTimeout hack or
+ // otherwise... leaving in as would be nice
+ if (options.backdrop) {
+ dialog.next(".modal-backdrop").addClass("bootbox-backdrop");
+ }
+ });
+ */
+
+ dialog.on("shown.bs.modal", function() {
+ dialog.find(".btn-primary:first").focus();
+ });
+
+ /**
+ * Bootbox event listeners; experimental and may not last
+ * just an attempt to decouple some behaviours from their
+ * respective triggers
+ */
+
+ if (options.backdrop !== "static") {
+ // A boolean true/false according to the Bootstrap docs
+ // should show a dialog the user can dismiss by clicking on
+ // the background.
+ // We always only ever pass static/false to the actual
+ // $.modal function because with `true` we can't trap
+ // this event (the .modal-backdrop swallows it)
+ // However, we still want to sort of respect true
+ // and invoke the escape mechanism instead
+ dialog.on("click.dismiss.bs.modal", function(e) {
+ // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop
+ // moved *inside* the outer dialog rather than *alongside* it
+ if (dialog.children(".modal-backdrop").length) {
+ e.currentTarget = dialog.children(".modal-backdrop").get(0);
+ }
+
+ if (e.target !== e.currentTarget) {
+ return;
+ }
+
+ dialog.trigger("escape.close.bb");
+ });
+ }
+
+ dialog.on("escape.close.bb", function(e) {
+ if (callbacks.onEscape) {
+ processCallback(e, dialog, callbacks.onEscape);
+ }
+ });
+
+ /**
+ * Standard jQuery event listeners; used to handle user
+ * interaction with our dialog
+ */
+
+ dialog.on("click", ".modal-footer button", function(e) {
+ var callbackKey = $(this).data("bb-handler");
+
+ processCallback(e, dialog, callbacks[callbackKey]);
+ });
+
+ dialog.on("click", ".bootbox-close-button", function(e) {
+ // onEscape might be falsy but that's fine; the fact is
+ // if the user has managed to click the close button we
+ // have to close the dialog, callback or not
+ processCallback(e, dialog, callbacks.onEscape);
+ });
+
+ dialog.on("keyup", function(e) {
+ if (e.which === 27) {
+ dialog.trigger("escape.close.bb");
+ }
+ });
+
+ // the remainder of this method simply deals with adding our
+ // dialogent to the DOM, augmenting it with Bootstrap's modal
+ // functionality and then giving the resulting object back
+ // to our caller
+
+ $(options.container).append(dialog);
+
+ dialog.modal({
+ backdrop: options.backdrop ? "static": false,
+ keyboard: false,
+ show: false
+ });
+
+ if (options.show) {
+ dialog.modal("show");
+ }
+
+ // @TODO should we return the raw element here or should
+ // we wrap it in an object on which we can expose some neater
+ // methods, e.g. var d = bootbox.alert(); d.hide(); instead
+ // of d.modal("hide");
+
+ /*
+ function BBDialog(elem) {
+ this.elem = elem;
+ }
+
+ BBDialog.prototype = {
+ hide: function() {
+ return this.elem.modal("hide");
+ },
+ show: function() {
+ return this.elem.modal("show");
+ }
+ };
+ */
+
+ return dialog;
+
+ };
+
+ exports.setDefaults = function() {
+ var values = {};
+
+ if (arguments.length === 2) {
+ // allow passing of single key/value...
+ values[arguments[0]] = arguments[1];
+ } else {
+ // ... and as an object too
+ values = arguments[0];
+ }
+
+ $.extend(defaults, values);
+ };
+
+ exports.hideAll = function() {
+ $(".bootbox").modal("hide");
+
+ return exports;
+ };
+
+
+ /**
+ * standard locales. Please add more according to ISO 639-1 standard. Multiple language variants are
+ * unlikely to be required. If this gets too large it can be split out into separate JS files.
+ */
+ var locales = {
+ bg_BG : {
+ OK : "Ок",
+ CANCEL : "Отказ",
+ CONFIRM : "Потвърждавам"
+ },
+ br : {
+ OK : "OK",
+ CANCEL : "Cancelar",
+ CONFIRM : "Sim"
+ },
+ cs : {
+ OK : "OK",
+ CANCEL : "Zrušit",
+ CONFIRM : "Potvrdit"
+ },
+ da : {
+ OK : "OK",
+ CANCEL : "Annuller",
+ CONFIRM : "Accepter"
+ },
+ de : {
+ OK : "OK",
+ CANCEL : "Abbrechen",
+ CONFIRM : "Akzeptieren"
+ },
+ el : {
+ OK : "Εντάξει",
+ CANCEL : "Ακύρωση",
+ CONFIRM : "Επιβεβαίωση"
+ },
+ en : {
+ OK : "OK",
+ CANCEL : "Cancel",
+ CONFIRM : "OK"
+ },
+ es : {
+ OK : "OK",
+ CANCEL : "Cancelar",
+ CONFIRM : "Aceptar"
+ },
+ et : {
+ OK : "OK",
+ CANCEL : "Katkesta",
+ CONFIRM : "OK"
+ },
+ fa : {
+ OK : "قبول",
+ CANCEL : "لغو",
+ CONFIRM : "تایید"
+ },
+ fi : {
+ OK : "OK",
+ CANCEL : "Peruuta",
+ CONFIRM : "OK"
+ },
+ fr : {
+ OK : "OK",
+ CANCEL : "Annuler",
+ CONFIRM : "D'accord"
+ },
+ he : {
+ OK : "אישור",
+ CANCEL : "ביטול",
+ CONFIRM : "אישור"
+ },
+ hu : {
+ OK : "OK",
+ CANCEL : "Mégsem",
+ CONFIRM : "Megerősít"
+ },
+ hr : {
+ OK : "OK",
+ CANCEL : "Odustani",
+ CONFIRM : "Potvrdi"
+ },
+ id : {
+ OK : "OK",
+ CANCEL : "Batal",
+ CONFIRM : "OK"
+ },
+ it : {
+ OK : "OK",
+ CANCEL : "Annulla",
+ CONFIRM : "Conferma"
+ },
+ ja : {
+ OK : "OK",
+ CANCEL : "キャンセル",
+ CONFIRM : "確認"
+ },
+ lt : {
+ OK : "Gerai",
+ CANCEL : "Atšaukti",
+ CONFIRM : "Patvirtinti"
+ },
+ lv : {
+ OK : "Labi",
+ CANCEL : "Atcelt",
+ CONFIRM : "Apstiprināt"
+ },
+ nl : {
+ OK : "OK",
+ CANCEL : "Annuleren",
+ CONFIRM : "Accepteren"
+ },
+ no : {
+ OK : "OK",
+ CANCEL : "Avbryt",
+ CONFIRM : "OK"
+ },
+ pl : {
+ OK : "OK",
+ CANCEL : "Anuluj",
+ CONFIRM : "Potwierdź"
+ },
+ pt : {
+ OK : "OK",
+ CANCEL : "Cancelar",
+ CONFIRM : "Confirmar"
+ },
+ ru : {
+ OK : "OK",
+ CANCEL : "Отмена",
+ CONFIRM : "Применить"
+ },
+ sq : {
+ OK : "OK",
+ CANCEL : "Anulo",
+ CONFIRM : "Prano"
+ },
+ sv : {
+ OK : "OK",
+ CANCEL : "Avbryt",
+ CONFIRM : "OK"
+ },
+ th : {
+ OK : "ตกลง",
+ CANCEL : "ยกเลิก",
+ CONFIRM : "ยืนยัน"
+ },
+ tr : {
+ OK : "Tamam",
+ CANCEL : "İptal",
+ CONFIRM : "Onayla"
+ },
+ zh_CN : {
+ OK : "OK",
+ CANCEL : "取消",
+ CONFIRM : "确认"
+ },
+ zh_TW : {
+ OK : "OK",
+ CANCEL : "取消",
+ CONFIRM : "確認"
+ }
+ };
+
+ exports.addLocale = function(name, values) {
+ $.each(["OK", "CANCEL", "CONFIRM"], function(_, v) {
+ if (!values[v]) {
+ throw new Error("Please supply a translation for '" + v + "'");
+ }
+ });
+
+ locales[name] = {
+ OK: values.OK,
+ CANCEL: values.CANCEL,
+ CONFIRM: values.CONFIRM
+ };
+
+ return exports;
+ };
+
+ exports.removeLocale = function(name) {
+ delete locales[name];
+
+ return exports;
+ };
+
+ exports.setLocale = function(name) {
+ return exports.setDefaults("locale", name);
+ };
+
+ exports.init = function(_$) {
+ return init(_$ || $);
+ };
+
+ return exports;
+}));
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootstrap.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootstrap.min.js
new file mode 100644
index 0000000..133aeec
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/bootstrap.min.js
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under the MIT license
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),
+d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/contextMenu.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/contextMenu.js
new file mode 100644
index 0000000..0bb048b
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/contextMenu.js
@@ -0,0 +1,1692 @@
+/*!
+ * jQuery contextMenu - Plugin for simple contextMenu handling
+ *
+ * Version: git-master
+ *
+ * Authors: Rodney Rehm, Addy Osmani (patches for FF)
+ * Web: http://medialize.github.com/jQuery-contextMenu/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ * GPL v3 http://opensource.org/licenses/GPL-3.0
+ *
+ */
+
+(function($, undefined){
+
+ // TODO: -
+ // ARIA stuff: menuitem, menuitemcheckbox und menuitemradio
+ // create <menu> structure if $.support[htmlCommand || htmlMenuitem] and !opt.disableNative
+
+// determine html5 compatibility
+$.support.htmlMenuitem = ('HTMLMenuItemElement' in window);
+$.support.htmlCommand = ('HTMLCommandElement' in window);
+$.support.eventSelectstart = ("onselectstart" in document.documentElement);
+/* // should the need arise, test for css user-select
+$.support.cssUserSelect = (function(){
+ var t = false,
+ e = document.createElement('div');
+
+ $.each('Moz|Webkit|Khtml|O|ms|Icab|'.split('|'), function(i, prefix) {
+ var propCC = prefix + (prefix ? 'U' : 'u') + 'serSelect',
+ prop = (prefix ? ('-' + prefix.toLowerCase() + '-') : '') + 'user-select';
+
+ e.style.cssText = prop + ': text;';
+ if (e.style[propCC] == 'text') {
+ t = true;
+ return false;
+ }
+
+ return true;
+ });
+
+ return t;
+})();
+*/
+
+if (!$.ui || !$.ui.widget) {
+ // duck punch $.cleanData like jQueryUI does to get that remove event
+ // https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L16-24
+ var _cleanData = $.cleanData;
+ $.cleanData = function( elems ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ try {
+ $( elem ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ }
+ _cleanData( elems );
+ };
+}
+
+var // currently active contextMenu trigger
+ $currentTrigger = null,
+ // is contextMenu initialized with at least one menu?
+ initialized = false,
+ // window handle
+ $win = $(window),
+ // number of registered menus
+ counter = 0,
+ // mapping selector to namespace
+ namespaces = {},
+ // mapping namespace to options
+ menus = {},
+ // custom command type handlers
+ types = {},
+ // default values
+ defaults = {
+ // selector of contextMenu trigger
+ selector: null,
+ // where to append the menu to
+ appendTo: null,
+ // method to trigger context menu ["right", "left", "hover"]
+ trigger: "right",
+ // hide menu when mouse leaves trigger / menu elements
+ autoHide: false,
+ // ms to wait before showing a hover-triggered context menu
+ delay: 200,
+ // flag denoting if a second trigger should simply move (true) or rebuild (false) an open menu
+ // as long as the trigger happened on one of the trigger-element's child nodes
+ reposition: true,
+ // determine position to show menu at
+ determinePosition: function($menu) {
+ // position to the lower middle of the trigger element
+ if ($.ui && $.ui.position) {
+ // .position() is provided as a jQuery UI utility
+ // (...and it won't work on hidden elements)
+ $menu.css('display', 'block').position({
+ my: "center top",
+ at: "center bottom",
+ of: this,
+ offset: "0 5",
+ collision: "fit"
+ }).css('display', 'none');
+ } else {
+ // determine contextMenu position
+ var offset = this.offset();
+ offset.top += this.outerHeight();
+ offset.left += this.outerWidth() / 2 - $menu.outerWidth() / 2;
+ $menu.css(offset);
+ }
+ },
+ // position menu
+ position: function(opt, x, y) {
+ var $this = this,
+ offset;
+ // determine contextMenu position
+ if (!x && !y) {
+ opt.determinePosition.call(this, opt.$menu);
+ return;
+ } else if (x === "maintain" && y === "maintain") {
+ // x and y must not be changed (after re-show on command click)
+ offset = opt.$menu.position();
+ } else {
+ // x and y are given (by mouse event)
+ offset = {top: y, left: x};
+ }
+
+ // correct offset if viewport demands it
+ var bottom = $win.scrollTop() + $win.height(),
+ right = $win.scrollLeft() + $win.width(),
+ height = opt.$menu.height(),
+ width = opt.$menu.width();
+
+ if (offset.top + height > bottom) {
+ offset.top -= height;
+ }
+
+ if (offset.top<0) {
+ offset.top = 0;
+ }
+
+ if (offset.left + width > right) {
+ offset.left -= width;
+ }
+
+ opt.$menu.css(offset);
+ },
+ // position the sub-menu
+ positionSubmenu: function($menu) {
+ if ($.ui && $.ui.position) {
+ // .position() is provided as a jQuery UI utility
+ // (...and it won't work on hidden elements)
+ $menu.css('display', 'block').position({
+ my: "left top",
+ at: "right top",
+ of: this,
+ collision: "flipfit fit"
+ }).css('display', '');
+ } else {
+ // determine contextMenu position
+ var offset = {
+ top: 0,
+ left: this.outerWidth()
+ };
+ $menu.css(offset);
+ }
+ },
+ // offset to add to zIndex
+ zIndex: 1,
+ // show hide animation settings
+ animation: {
+ duration: 50,
+ show: 'slideDown',
+ hide: 'slideUp'
+ },
+ // events
+ events: {
+ show: $.noop,
+ hide: $.noop
+ },
+ // default callback
+ callback: null,
+ // list of contextMenu items
+ items: {}
+ },
+ // mouse position for hover activation
+ hoveract = {
+ timer: null,
+ pageX: null,
+ pageY: null
+ },
+ // determine zIndex
+ zindex = function($t) {
+ var zin = 0,
+ $tt = $t;
+
+ while (true) {
+ zin = Math.max(zin, parseInt($tt.css('z-index'), 10) || 0);
+ $tt = $tt.parent();
+ if (!$tt || !$tt.length || "html body".indexOf($tt.prop('nodeName').toLowerCase()) > -1 ) {
+ break;
+ }
+ }
+
+ return zin;
+ },
+ // event handlers
+ handle = {
+ // abort anything
+ abortevent: function(e){
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ },
+
+ // contextmenu show dispatcher
+ contextmenu: function(e) {
+ var $this = $(this);
+
+ // disable actual context-menu if we are using the right mouse button as the trigger
+ if (e.data.trigger == 'right') {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+
+ // abort native-triggered events unless we're triggering on right click
+ if (e.data.trigger != 'right' && e.originalEvent) {
+ return;
+ }
+
+ // abort event if menu is visible for this trigger
+ if ($this.hasClass('context-menu-active')) {
+ return;
+ }
+
+ if (!$this.hasClass('context-menu-disabled')) {
+ // theoretically need to fire a show event at <menu>
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
+ // var evt = jQuery.Event("show", { data: data, pageX: e.pageX, pageY: e.pageY, relatedTarget: this });
+ // e.data.$menu.trigger(evt);
+
+ $currentTrigger = $this;
+ if (e.data.build) {
+ var built = e.data.build($currentTrigger, e);
+ // abort if build() returned false
+ if (built === false) {
+ return;
+ }
+
+ // dynamically build menu on invocation
+ e.data = $.extend(true, {}, defaults, e.data, built || {});
+
+ // abort if there are no items to display
+ if (!e.data.items || $.isEmptyObject(e.data.items)) {
+ // Note: jQuery captures and ignores errors from event handlers
+ if (window.console) {
+ (console.error || console.log).call(console, "No items specified to show in contextMenu");
+ }
+
+ throw new Error('No Items specified');
+ }
+
+ // backreference for custom command type creation
+ e.data.$trigger = $currentTrigger;
+
+ op.create(e.data);
+ }
+ // show menu
+ op.show.call($this, e.data, e.pageX, e.pageY);
+ }
+ },
+ // contextMenu left-click trigger
+ click: function(e) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ $(this).trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+ },
+ // contextMenu right-click trigger
+ mousedown: function(e) {
+ // register mouse down
+ var $this = $(this);
+
+ // hide any previous menus
+ if ($currentTrigger && $currentTrigger.length && !$currentTrigger.is($this)) {
+ $currentTrigger.data('contextMenu').$menu.trigger('contextmenu:hide');
+ }
+
+ // activate on right click
+ if (e.button == 2) {
+ $currentTrigger = $this.data('contextMenuActive', true);
+ }
+ },
+ // contextMenu right-click trigger
+ mouseup: function(e) {
+ // show menu
+ var $this = $(this);
+ if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ $currentTrigger = $this;
+ $this.trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
+ }
+
+ $this.removeData('contextMenuActive');
+ },
+ // contextMenu hover trigger
+ mouseenter: function(e) {
+ var $this = $(this),
+ $related = $(e.relatedTarget),
+ $document = $(document);
+
+ // abort if we're coming from a menu
+ if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
+ return;
+ }
+
+ // abort if a menu is shown
+ if ($currentTrigger && $currentTrigger.length) {
+ return;
+ }
+
+ hoveract.pageX = e.pageX;
+ hoveract.pageY = e.pageY;
+ hoveract.data = e.data;
+ $document.on('mousemove.contextMenuShow', handle.mousemove);
+ hoveract.timer = setTimeout(function() {
+ hoveract.timer = null;
+ $document.off('mousemove.contextMenuShow');
+ $currentTrigger = $this;
+ $this.trigger($.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY }));
+ }, e.data.delay );
+ },
+ // contextMenu hover trigger
+ mousemove: function(e) {
+ hoveract.pageX = e.pageX;
+ hoveract.pageY = e.pageY;
+ },
+ // contextMenu hover trigger
+ mouseleave: function(e) {
+ // abort if we're leaving for a menu
+ var $related = $(e.relatedTarget);
+ if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
+ return;
+ }
+
+ try {
+ clearTimeout(hoveract.timer);
+ } catch(e) {}
+
+ hoveract.timer = null;
+ },
+
+ // click on layer to hide contextMenu
+ layerClick: function(e) {
+ var $this = $(this),
+ root = $this.data('contextMenuRoot'),
+ button = e.button,
+ x = e.pageX,
+ y = e.pageY,
+ target,
+ offset;
+
+ e.preventDefault();
+ e.stopImmediatePropagation();
+
+ setTimeout(function() {
+ var $window;
+ var triggerAction = ((root.trigger == 'left' && button === 0) || (root.trigger == 'right' && button === 2));
+
+ // find the element that would've been clicked, wasn't the layer in the way
+ if (document.elementFromPoint) {
+ root.$layer.hide();
+ target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop());
+ root.$layer.show();
+ }
+
+ if (root.reposition && triggerAction) {
+ if (document.elementFromPoint) {
+ if (root.$trigger.is(target) || root.$trigger.has(target).length) {
+ root.position.call(root.$trigger, root, x, y);
+ return;
+ }
+ } else {
+ offset = root.$trigger.offset();
+ $window = $(window);
+ // while this looks kinda awful, it's the best way to avoid
+ // unnecessarily calculating any positions
+ offset.top += $window.scrollTop();
+ if (offset.top <= e.pageY) {
+ offset.left += $window.scrollLeft();
+ if (offset.left <= e.pageX) {
+ offset.bottom = offset.top + root.$trigger.outerHeight();
+ if (offset.bottom >= e.pageY) {
+ offset.right = offset.left + root.$trigger.outerWidth();
+ if (offset.right >= e.pageX) {
+ // reposition
+ root.position.call(root.$trigger, root, x, y);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (target && triggerAction) {
+ root.$trigger.one('contextmenu:hidden', function() {
+ $(target).contextMenu({x: x, y: y});
+ });
+ }
+
+ root.$menu.trigger('contextmenu:hide');
+ }, 50);
+ },
+ // key handled :hover
+ keyStop: function(e, opt) {
+ if (!opt.isInput) {
+ e.preventDefault();
+ }
+
+ e.stopPropagation();
+ },
+ key: function(e) {
+
+ var opt = {};
+
+ // Only get the data from $currentTrigger if it exists
+ if ($currentTrigger) {
+ opt = $currentTrigger.data('contextMenu') || {};
+ }
+
+ switch (e.keyCode) {
+ case 9:
+ case 38: // up
+ handle.keyStop(e, opt);
+ // if keyCode is [38 (up)] or [9 (tab) with shift]
+ if (opt.isInput) {
+ if (e.keyCode == 9 && e.shiftKey) {
+ e.preventDefault();
+ opt.$selected && opt.$selected.find('input, textarea, select').blur();
+ opt.$menu.trigger('prevcommand');
+ return;
+ } else if (e.keyCode == 38 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') {
+ // checkboxes don't capture this key
+ e.preventDefault();
+ return;
+ }
+ } else if (e.keyCode != 9 || e.shiftKey) {
+ opt.$menu.trigger('prevcommand');
+ return;
+ }
+ // omitting break;
+
+ // case 9: // tab - reached through omitted break;
+ case 40: // down
+ handle.keyStop(e, opt);
+ if (opt.isInput) {
+ if (e.keyCode == 9) {
+ e.preventDefault();
+ opt.$selected && opt.$selected.find('input, textarea, select').blur();
+ opt.$menu.trigger('nextcommand');
+ return;
+ } else if (e.keyCode == 40 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') {
+ // checkboxes don't capture this key
+ e.preventDefault();
+ return;
+ }
+ } else {
+ opt.$menu.trigger('nextcommand');
+ return;
+ }
+ break;
+
+ case 37: // left
+ handle.keyStop(e, opt);
+ if (opt.isInput || !opt.$selected || !opt.$selected.length) {
+ break;
+ }
+
+ if (!opt.$selected.parent().hasClass('context-menu-root')) {
+ var $parent = opt.$selected.parent().parent();
+ opt.$selected.trigger('contextmenu:blur');
+ opt.$selected = $parent;
+ return;
+ }
+ break;
+
+ case 39: // right
+ handle.keyStop(e, opt);
+ if (opt.isInput || !opt.$selected || !opt.$selected.length) {
+ break;
+ }
+
+ var itemdata = opt.$selected.data('contextMenu') || {};
+ if (itemdata.$menu && opt.$selected.hasClass('context-menu-submenu')) {
+ opt.$selected = null;
+ itemdata.$selected = null;
+ itemdata.$menu.trigger('nextcommand');
+ return;
+ }
+ break;
+
+ case 35: // end
+ case 36: // home
+ if (opt.$selected && opt.$selected.find('input, textarea, select').length) {
+ return;
+ } else {
+ (opt.$selected && opt.$selected.parent() || opt.$menu)
+ .children(':not(.disabled, .not-selectable)')[e.keyCode == 36 ? 'first' : 'last']()
+ .trigger('contextmenu:focus');
+ e.preventDefault();
+ return;
+ }
+ break;
+
+ case 13: // enter
+ handle.keyStop(e, opt);
+ if (opt.isInput) {
+ if (opt.$selected && !opt.$selected.is('textarea, select')) {
+ e.preventDefault();
+ return;
+ }
+ break;
+ }
+ opt.$selected && opt.$selected.trigger('mouseup');
+ return;
+
+ case 32: // space
+ case 33: // page up
+ case 34: // page down
+ // prevent browser from scrolling down while menu is visible
+ handle.keyStop(e, opt);
+ return;
+
+ case 27: // esc
+ handle.keyStop(e, opt);
+ opt.$menu.trigger('contextmenu:hide');
+ return;
+
+ default: // 0-9, a-z
+ var k = (String.fromCharCode(e.keyCode)).toUpperCase();
+ if (opt.accesskeys && opt.accesskeys[k]) {
+ // according to the specs accesskeys must be invoked immediately
+ opt.accesskeys[k].$node.trigger(opt.accesskeys[k].$menu
+ ? 'contextmenu:focus'
+ : 'mouseup'
+ );
+ return;
+ }
+ break;
+ }
+ // pass event to selected item,
+ // stop propagation to avoid endless recursion
+ e.stopPropagation();
+ opt.$selected && opt.$selected.trigger(e);
+ },
+
+ // select previous possible command in menu
+ prevItem: function(e) {
+ e.stopPropagation();
+ var opt = $(this).data('contextMenu') || {};
+
+ // obtain currently selected menu
+ if (opt.$selected) {
+ var $s = opt.$selected;
+ opt = opt.$selected.parent().data('contextMenu') || {};
+ opt.$selected = $s;
+ }
+
+ var $children = opt.$menu.children(),
+ $prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(),
+ $round = $prev;
+
+ // skip disabled
+ while ($prev.hasClass('disabled') || $prev.hasClass('not-selectable')) {
+ if ($prev.prev().length) {
+ $prev = $prev.prev();
+ } else {
+ $prev = $children.last();
+ }
+ if ($prev.is($round)) {
+ // break endless loop
+ return;
+ }
+ }
+
+ // leave current
+ if (opt.$selected) {
+ handle.itemMouseleave.call(opt.$selected.get(0), e);
+ }
+
+ // activate next
+ handle.itemMouseenter.call($prev.get(0), e);
+
+ // focus input
+ var $input = $prev.find('input, textarea, select');
+ if ($input.length) {
+ $input.focus();
+ }
+ },
+ // select next possible command in menu
+ nextItem: function(e) {
+ e.stopPropagation();
+ var opt = $(this).data('contextMenu') || {};
+
+ // obtain currently selected menu
+ if (opt.$selected) {
+ var $s = opt.$selected;
+ opt = opt.$selected.parent().data('contextMenu') || {};
+ opt.$selected = $s;
+ }
+
+ var $children = opt.$menu.children(),
+ $next = !opt.$selected || !opt.$selected.next().length ? $children.first() : opt.$selected.next(),
+ $round = $next;
+
+ // skip disabled
+ while ($next.hasClass('disabled') || $next.hasClass('not-selectable')) {
+ if ($next.next().length) {
+ $next = $next.next();
+ } else {
+ $next = $children.first();
+ }
+ if ($next.is($round)) {
+ // break endless loop
+ return;
+ }
+ }
+
+ // leave current
+ if (opt.$selected) {
+ handle.itemMouseleave.call(opt.$selected.get(0), e);
+ }
+
+ // activate next
+ handle.itemMouseenter.call($next.get(0), e);
+
+ // focus input
+ var $input = $next.find('input, textarea, select');
+ if ($input.length) {
+ $input.focus();
+ }
+ },
+
+ // flag that we're inside an input so the key handler can act accordingly
+ focusInput: function(e) {
+ var $this = $(this).closest('.context-menu-item'),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot;
+
+ root.$selected = opt.$selected = $this;
+ root.isInput = opt.isInput = true;
+ },
+ // flag that we're inside an input so the key handler can act accordingly
+ blurInput: function(e) {
+ var $this = $(this).closest('.context-menu-item'),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot;
+
+ root.isInput = opt.isInput = false;
+ },
+
+ // :hover on menu
+ menuMouseenter: function(e) {
+ var root = $(this).data().contextMenuRoot;
+ root.hovering = true;
+ },
+ // :hover on menu
+ menuMouseleave: function(e) {
+ var root = $(this).data().contextMenuRoot;
+ if (root.$layer && root.$layer.is(e.relatedTarget)) {
+ root.hovering = false;
+ }
+ },
+
+ // :hover done manually so key handling is possible
+ itemMouseenter: function(e) {
+ var $this = $(this),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot;
+
+ root.hovering = true;
+
+ // abort if we're re-entering
+ if (e && root.$layer && root.$layer.is(e.relatedTarget)) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+
+ // make sure only one item is selected
+ (opt.$menu ? opt : root).$menu
+ .children('.hover').trigger('contextmenu:blur');
+
+ if ($this.hasClass('disabled') || $this.hasClass('not-selectable')) {
+ opt.$selected = null;
+ return;
+ }
+
+ $this.trigger('contextmenu:focus');
+ },
+ // :hover done manually so key handling is possible
+ itemMouseleave: function(e) {
+ var $this = $(this),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot;
+
+ if (root !== opt && root.$layer && root.$layer.is(e.relatedTarget)) {
+ root.$selected && root.$selected.trigger('contextmenu:blur');
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ root.$selected = opt.$selected = opt.$node;
+ return;
+ }
+
+ $this.trigger('contextmenu:blur');
+ },
+ // contextMenu item click
+ itemClick: function(e) {
+ var $this = $(this),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot,
+ key = data.contextMenuKey,
+ callback;
+
+ // abort if the key is unknown or disabled or is a menu
+ if (!opt.items[key] || $this.is('.disabled, .context-menu-submenu, .context-menu-separator, .not-selectable')) {
+ return;
+ }
+
+ e.preventDefault();
+ e.stopImmediatePropagation();
+
+ if ($.isFunction(root.callbacks[key]) && Object.prototype.hasOwnProperty.call(root.callbacks, key)) {
+ // item-specific callback
+ callback = root.callbacks[key];
+ } else if ($.isFunction(root.callback)) {
+ // default callback
+ callback = root.callback;
+ } else {
+ // no callback, no action
+ return;
+ }
+
+ // hide menu if callback doesn't stop that
+ if (callback.call(root.$trigger, key, root) !== false) {
+ root.$menu.trigger('contextmenu:hide');
+ } else if (root.$menu.parent().length) {
+ op.update.call(root.$trigger, root);
+ }
+ },
+ // ignore click events on input elements
+ inputClick: function(e) {
+ e.stopImmediatePropagation();
+ },
+
+ // hide <menu>
+ hideMenu: function(e, data) {
+ var root = $(this).data('contextMenuRoot');
+ op.hide.call(root.$trigger, root, data && data.force);
+ },
+ // focus <command>
+ focusItem: function(e) {
+ e.stopPropagation();
+ var $this = $(this),
+ data = $this.data(),
+ opt = data.contextMenu,
+ root = data.contextMenuRoot;
+
+ $this.addClass('hover')
+ .siblings('.hover').trigger('contextmenu:blur');
+
+ // remember selected
+ opt.$selected = root.$selected = $this;
+
+ // position sub-menu - do after show so dumb $.ui.position can keep up
+ if (opt.$node) {
+ root.positionSubmenu.call(opt.$node, opt.$menu);
+ }
+ },
+ // blur <command>
+ blurItem: function(e) {
+ e.stopPropagation();
+ var $this = $(this),
+ data = $this.data(),
+ opt = data.contextMenu;
+
+ $this.removeClass('hover');
+ opt.$selected = null;
+ }
+ },
+ // operations
+ op = {
+ show: function(opt, x, y) {
+ var $trigger = $(this),
+ css = {};
+
+ // hide any open menus
+ $('#context-menu-layer').trigger('mousedown');
+
+ // backreference for callbacks
+ opt.$trigger = $trigger;
+
+ // show event
+ if (opt.events.show.call($trigger, opt) === false) {
+ $currentTrigger = null;
+ return;
+ }
+
+ // create or update context menu
+ op.update.call($trigger, opt);
+
+ // position menu
+ opt.position.call($trigger, opt, x, y);
+
+ // make sure we're in front
+ if (opt.zIndex) {
+ css.zIndex = zindex($trigger) + opt.zIndex;
+ }
+
+ // add layer
+ op.layer.call(opt.$menu, opt, css.zIndex);
+
+ // adjust sub-menu zIndexes
+ opt.$menu.find('ul').css('zIndex', css.zIndex + 1);
+
+ // position and show context menu
+ opt.$menu.css( css )[opt.animation.show](opt.animation.duration, function() {
+ $trigger.trigger('contextmenu:visible');
+ });
+ // make options available and set state
+ $trigger
+ .data('contextMenu', opt)
+ .addClass("context-menu-active");
+
+ // register key handler
+ $(document).off('keydown.contextMenu').on('keydown.contextMenu', handle.key);
+ // register autoHide handler
+ if (opt.autoHide) {
+ // mouse position handler
+ $(document).on('mousemove.contextMenuAutoHide', function(e) {
+ // need to capture the offset on mousemove,
+ // since the page might've been scrolled since activation
+ var pos = $trigger.offset();
+ pos.right = pos.left + $trigger.outerWidth();
+ pos.bottom = pos.top + $trigger.outerHeight();
+
+ if (opt.$layer && !opt.hovering && (!(e.pageX >= pos.left && e.pageX <= pos.right) || !(e.pageY >= pos.top && e.pageY <= pos.bottom))) {
+ // if mouse in menu...
+ opt.$menu.trigger('contextmenu:hide');
+ }
+ });
+ }
+ },
+ hide: function(opt, force) {
+ var $trigger = $(this);
+ if (!opt) {
+ opt = $trigger.data('contextMenu') || {};
+ }
+
+ // hide event
+ if (!force && opt.events && opt.events.hide.call($trigger, opt) === false) {
+ return;
+ }
+
+ // remove options and revert state
+ $trigger
+ .removeData('contextMenu')
+ .removeClass("context-menu-active");
+
+ if (opt.$layer) {
+ // keep layer for a bit so the contextmenu event can be aborted properly by opera
+ setTimeout((function($layer) {
+ return function(){
+ $layer.remove();
+ };
+ })(opt.$layer), 10);
+
+ try {
+ delete opt.$layer;
+ } catch(e) {
+ opt.$layer = null;
+ }
+ }
+
+ // remove handle
+ $currentTrigger = null;
+ // remove selected
+ opt.$menu.find('.hover').trigger('contextmenu:blur');
+ opt.$selected = null;
+ // unregister key and mouse handlers
+ //$(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705
+ $(document).off('.contextMenuAutoHide').off('keydown.contextMenu');
+ // hide menu
+ opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration, function (){
+ // tear down dynamically built menu after animation is completed.
+ if (opt.build) {
+ opt.$menu.remove();
+ $.each(opt, function(key, value) {
+ switch (key) {
+ case 'ns':
+ case 'selector':
+ case 'build':
+ case 'trigger':
+ return true;
+
+ default:
+ opt[key] = undefined;
+ try {
+ delete opt[key];
+ } catch (e) {}
+ return true;
+ }
+ });
+ }
+
+ setTimeout(function() {
+ $trigger.trigger('contextmenu:hidden');
+ }, 10);
+ });
+ },
+ create: function(opt, root) {
+ if (root === undefined) {
+ root = opt;
+ }
+ // create contextMenu
+ opt.$menu = $('<ul id = "contextMenuID" class="context-menu-list"></ul>').addClass(opt.className || "").data({
+ 'contextMenu': opt,
+ 'contextMenuRoot': root
+ });
+
+ $.each(['callbacks', 'commands', 'inputs'], function(i,k){
+ opt[k] = {};
+ if (!root[k]) {
+ root[k] = {};
+ }
+ });
+
+ root.accesskeys || (root.accesskeys = {});
+
+ // create contextMenu items
+ $.each(opt.items, function(key, item){
+ var $t = $('<li class="context-menu-item"></li>').addClass(item.className || ""),
+ $label = null,
+ $input = null;
+
+ // iOS needs to see a click-event bound to an element to actually
+ // have the TouchEvents infrastructure trigger the click event
+ $t.on('click', $.noop);
+
+ item.$node = $t.data({
+ 'contextMenu': opt,
+ 'contextMenuRoot': root,
+ 'contextMenuKey': key
+ });
+
+ // register accesskey
+ // NOTE: the accesskey attribute should be applicable to any element, but Safari5 and Chrome13 still can't do that
+ if (item.accesskey) {
+ var aks = splitAccesskey(item.accesskey);
+ for (var i=0, ak; ak = aks[i]; i++) {
+ if (!root.accesskeys[ak]) {
+ root.accesskeys[ak] = item;
+ item._name = item.name.replace(new RegExp('(' + ak + ')', 'i'), '<span class="context-menu-accesskey">$1</span>');
+ break;
+ }
+ }
+ }
+
+ if (typeof item == "string") {
+ $t.addClass('context-menu-separator not-selectable');
+ } else if (item.type && types[item.type]) {
+ // run custom type handler
+ types[item.type].call($t, item, opt, root);
+ // register commands
+ $.each([opt, root], function(i,k){
+ k.commands[key] = item;
+ if ($.isFunction(item.callback)) {
+ k.callbacks[key] = item.callback;
+ }
+ });
+ } else {
+ // add label for input
+ if (item.type == 'html') {
+ $t.addClass('context-menu-html not-selectable');
+ } else if (item.type) {
+ $label = $('<label></label>').appendTo($t);
+ $('<span></span>').text(item._name || item.name).appendTo($label);
+ $t.addClass('context-menu-input');
+ opt.hasTypes = true;
+ $.each([opt, root], function(i,k){
+ k.commands[key] = item;
+ k.inputs[key] = item;
+ });
+ } else if (item.items) {
+ item.type = 'sub';
+ }
+
+ switch (item.type) {
+ case 'text':
+ $input = $('<input type="text" value="1" name="" value="">')
+ .attr('name', 'context-menu-input-' + key)
+ .val(item.value || "")
+ .appendTo($label);
+ break;
+
+ case 'textarea':
+ $input = $('<textarea name=""></textarea>')
+ .attr('name', 'context-menu-input-' + key)
+ .val(item.value || "")
+ .appendTo($label);
+
+ if (item.height) {
+ $input.height(item.height);
+ }
+ break;
+
+ case 'checkbox':
+ $input = $('<input type="checkbox" value="1" name="" value="">')
+ .attr('name', 'context-menu-input-' + key)
+ .val(item.value || "")
+ .prop("checked", !!item.selected)
+ .prependTo($label);
+ break;
+
+ case 'radio':
+ $input = $('<input type="radio" value="1" name="" value="">')
+ .attr('name', 'context-menu-input-' + item.radio)
+ .val(item.value || "")
+ .prop("checked", !!item.selected)
+ .prependTo($label);
+ break;
+
+ case 'select':
+ $input = $('<select name="">')
+ .attr('name', 'context-menu-input-' + key)
+ .appendTo($label);
+ if (item.options) {
+ $.each(item.options, function(value, text) {
+ $('<option></option>').val(value).text(text).appendTo($input);
+ });
+ $input.val(item.selected);
+ }
+ break;
+
+ case 'sub':
+ $('<span></span>').text(item._name || item.name).appendTo($t);
+ item.appendTo = item.$node;
+ op.create(item, root);
+ $t.data('contextMenu', item).addClass('context-menu-submenu');
+ item.callback = null;
+ break;
+
+ case 'html':
+ $(item.html).appendTo($t);
+ break;
+
+ default:
+ $.each([opt, root], function(i,k){
+ k.commands[key] = item;
+ if ($.isFunction(item.callback)) {
+ k.callbacks[key] = item.callback;
+ }
+ });
+ $('<span></span>').text(item._name || item.name || "").appendTo($t);
+ break;
+ }
+
+ // disable key listener in <input>
+ if (item.type && item.type != 'sub' && item.type != 'html') {
+ $input
+ .on('focus', handle.focusInput)
+ .on('blur', handle.blurInput);
+
+ if (item.events) {
+ $input.on(item.events, opt);
+ }
+ }
+
+ // add icons
+ if (item.icon) {
+ $t.addClass("icon icon-" + item.icon);
+ }
+ }
+
+ // cache contained elements
+ item.$input = $input;
+ item.$label = $label;
+
+ // attach item to menu
+ $t.appendTo(opt.$menu);
+
+ // Disable text selection
+ if (!opt.hasTypes && $.support.eventSelectstart) {
+ // browsers support user-select: none,
+ // IE has a special event for text-selection
+ // browsers supporting neither will not be preventing text-selection
+ $t.on('selectstart.disableTextSelect', handle.abortevent);
+ }
+ });
+ // attach contextMenu to <body> (to bypass any possible overflow:hidden issues on parents of the trigger element)
+ if (!opt.$node) {
+ opt.$menu.css('display', 'none').addClass('context-menu-root');
+ }
+ opt.$menu.appendTo(opt.appendTo || document.body);
+ },
+ resize: function($menu, nested) {
+ // determine widths of submenus, as CSS won't grow them automatically
+ // position:absolute within position:absolute; min-width:100; max-width:200; results in width: 100;
+ // kinda sucks hard...
+
+ // determine width of absolutely positioned element
+ $menu.css({position: 'absolute', display: 'block'});
+ // don't apply yet, because that would break nested elements' widths
+ // add a pixel to circumvent word-break issue in IE9 - #80
+ $menu.data('width', Math.ceil($menu.width()) + 1);
+ // reset styles so they allow nested elements to grow/shrink naturally
+ $menu.css({
+ position: 'static',
+ minWidth: '0px',
+ maxWidth: '100000px'
+ });
+ // identify width of nested menus
+ $menu.find('> li > ul').each(function() {
+ op.resize($(this), true);
+ });
+ // reset and apply changes in the end because nested
+ // elements' widths wouldn't be calculatable otherwise
+ if (!nested) {
+ $menu.find('ul').addBack().css({
+ position: '',
+ display: '',
+ minWidth: '',
+ maxWidth: ''
+ }).width(function() {
+ return $(this).data('width');
+ });
+ }
+ },
+ update: function(opt, root) {
+ var $trigger = this;
+ if (root === undefined) {
+ root = opt;
+ op.resize(opt.$menu);
+ }
+ // re-check disabled for each item
+ opt.$menu.children().each(function(){
+ var $item = $(this),
+ key = $item.data('contextMenuKey'),
+ item = opt.items[key],
+ disabled = ($.isFunction(item.disabled) && item.disabled.call($trigger, key, root)) || item.disabled === true;
+
+ // dis- / enable item
+ $item[disabled ? 'addClass' : 'removeClass']('disabled');
+
+ if (item.type) {
+ // dis- / enable input elements
+ $item.find('input, select, textarea').prop('disabled', disabled);
+
+ // update input states
+ switch (item.type) {
+ case 'text':
+ case 'textarea':
+ item.$input.val(item.value || "");
+ break;
+
+ case 'checkbox':
+ case 'radio':
+ item.$input.val(item.value || "").prop('checked', !!item.selected);
+ break;
+
+ case 'select':
+ item.$input.val(item.selected || "");
+ break;
+ }
+ }
+
+ if (item.$menu) {
+ // update sub-menu
+ op.update.call($trigger, item, root);
+ }
+ });
+ },
+ layer: function(opt, zIndex) {
+ // add transparent layer for click area
+ // filter and background for Internet Explorer, Issue #23
+ var $layer = opt.$layer = $('<div id="context-menu-layer" style="position:fixed; z-index:' + zIndex + '; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>')
+ .css({height: $win.height(), width: $win.width(), display: 'block'})
+ .data('contextMenuRoot', opt)
+ .insertBefore(this)
+ .on('contextmenu', handle.abortevent)
+ .on('mousedown', handle.layerClick);
+
+ // IE6 doesn't know position:fixed;
+ if (document.body.style.maxWidth === undefined) {//IE6 doesn't support maxWidth
+ $layer.css({
+ 'position' : 'absolute',
+ 'height' : $(document).height()
+ });
+ }
+
+ return $layer;
+ }
+ };
+
+// split accesskey according to http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#assigned-access-key
+function splitAccesskey(val) {
+ var t = val.split(/\s+/),
+ keys = [];
+
+ for (var i=0, k; k = t[i]; i++) {
+ k = k.charAt(0).toUpperCase(); // first character only
+ // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.
+ // a map to look up already used access keys would be nice
+ keys.push(k);
+ }
+
+ return keys;
+}
+
+// handle contextMenu triggers
+$.fn.contextMenu = function(operation) {
+ if (operation === undefined) {
+ this.first().trigger('contextmenu');
+ } else if (operation.x && operation.y) {
+ this.first().trigger($.Event("contextmenu", {pageX: operation.x, pageY: operation.y}));
+ } else if (operation === "hide") {
+ var $menu = this.first().data('contextMenu') ? this.first().data('contextMenu').$menu : null;
+ $menu && $menu.trigger('contextmenu:hide');
+ } else if (operation === "destroy") {
+ $.contextMenu("destroy", {context: this});
+ } else if ($.isPlainObject(operation)) {
+ operation.context = this;
+ $.contextMenu("create", operation);
+ } else if (operation) {
+ this.removeClass('context-menu-disabled');
+ } else if (!operation) {
+ this.addClass('context-menu-disabled');
+ }
+
+ return this;
+};
+
+// manage contextMenu instances
+$.contextMenu = function(operation, options) {
+ if (typeof operation != 'string') {
+ options = operation;
+ operation = 'create';
+ }
+
+ if (typeof options == 'string') {
+ options = {selector: options};
+ } else if (options === undefined) {
+ options = {};
+ }
+
+ // merge with default options
+ var o = $.extend(true, {}, defaults, options || {});
+ var $document = $(document);
+ var $context = $document;
+ var _hasContext = false;
+
+ if (!o.context || !o.context.length) {
+ o.context = document;
+ } else {
+ // you never know what they throw at you...
+ $context = $(o.context).first();
+ o.context = $context.get(0);
+ _hasContext = o.context !== document;
+ }
+
+ switch (operation) {
+ case 'create':
+ // no selector no joy
+ if (!o.selector) {
+ throw new Error('No selector specified');
+ }
+ // make sure internal classes are not bound to
+ if (o.selector.match(/.context-menu-(list|item|input)($|\s)/)) {
+ throw new Error('Cannot bind to selector "' + o.selector + '" as it contains a reserved className');
+ }
+ if (!o.build && (!o.items || $.isEmptyObject(o.items))) {
+ throw new Error('No Items specified');
+ }
+ counter ++;
+ o.ns = '.contextMenu' + counter;
+ if (!_hasContext) {
+ namespaces[o.selector] = o.ns;
+ }
+ menus[o.ns] = o;
+
+ // default to right click
+ if (!o.trigger) {
+ o.trigger = 'right';
+ }
+
+ if (!initialized) {
+ // make sure item click is registered first
+ $document
+ .on({
+ 'contextmenu:hide.contextMenu': handle.hideMenu,
+ 'prevcommand.contextMenu': handle.prevItem,
+ 'nextcommand.contextMenu': handle.nextItem,
+ 'contextmenu.contextMenu': handle.abortevent,
+ 'mouseenter.contextMenu': handle.menuMouseenter,
+ 'mouseleave.contextMenu': handle.menuMouseleave
+ }, '.context-menu-list')
+ .on('mouseup.contextMenu', '.context-menu-input', handle.inputClick)
+ .on({
+ 'mouseup.contextMenu': handle.itemClick,
+ 'contextmenu:focus.contextMenu': handle.focusItem,
+ 'contextmenu:blur.contextMenu': handle.blurItem,
+ 'contextmenu.contextMenu': handle.abortevent,
+ 'mouseenter.contextMenu': handle.itemMouseenter,
+ 'mouseleave.contextMenu': handle.itemMouseleave
+ }, '.context-menu-item');
+
+ initialized = true;
+ }
+
+ // engage native contextmenu event
+ $context
+ .on('contextmenu' + o.ns, o.selector, o, handle.contextmenu);
+
+ if (_hasContext) {
+ // add remove hook, just in case
+ $context.on('remove' + o.ns, function() {
+ $(this).contextMenu("destroy");
+ });
+ }
+
+ switch (o.trigger) {
+ case 'hover':
+ $context
+ .on('mouseenter' + o.ns, o.selector, o, handle.mouseenter)
+ .on('mouseleave' + o.ns, o.selector, o, handle.mouseleave);
+ break;
+
+ case 'left':
+ $context.on('click' + o.ns, o.selector, o, handle.click);
+ break;
+ /*
+ default:
+ // http://www.quirksmode.org/dom/events/contextmenu.html
+ $document
+ .on('mousedown' + o.ns, o.selector, o, handle.mousedown)
+ .on('mouseup' + o.ns, o.selector, o, handle.mouseup);
+ break;
+ */
+ }
+
+ // create menu
+ if (!o.build) {
+ op.create(o);
+ }
+ break;
+
+ case 'destroy':
+ var $visibleMenu;
+ if (_hasContext) {
+ // get proper options
+ var context = o.context;
+ $.each(menus, function(ns, o) {
+ if (o.context !== context) {
+ return true;
+ }
+
+ $visibleMenu = $('.context-menu-list').filter(':visible');
+ if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is($(o.context).find(o.selector))) {
+ $visibleMenu.trigger('contextmenu:hide', {force: true});
+ }
+
+ try {
+ if (menus[o.ns].$menu) {
+ menus[o.ns].$menu.remove();
+ }
+
+ delete menus[o.ns];
+ } catch(e) {
+ menus[o.ns] = null;
+ }
+
+ $(o.context).off(o.ns);
+
+ return true;
+ });
+ } else if (!o.selector) {
+ $document.off('.contextMenu .contextMenuAutoHide');
+ $.each(menus, function(ns, o) {
+ $(o.context).off(o.ns);
+ });
+
+ namespaces = {};
+ menus = {};
+ counter = 0;
+ initialized = false;
+
+ $('#context-menu-layer, .context-menu-list').remove();
+ } else if (namespaces[o.selector]) {
+ $visibleMenu = $('.context-menu-list').filter(':visible');
+ if ($visibleMenu.length && $visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)) {
+ $visibleMenu.trigger('contextmenu:hide', {force: true});
+ }
+
+ try {
+ if (menus[namespaces[o.selector]].$menu) {
+ menus[namespaces[o.selector]].$menu.remove();
+ }
+
+ delete menus[namespaces[o.selector]];
+ } catch(e) {
+ menus[namespaces[o.selector]] = null;
+ }
+
+ $document.off(namespaces[o.selector]);
+ }
+ break;
+
+ case 'html5':
+ // if <command> or <menuitem> are not handled by the browser,
+ // or options was a bool true,
+ // initialize $.contextMenu for them
+ if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options == "boolean" && options)) {
+ $('menu[type="context"]').each(function() {
+ if (this.id) {
+ $.contextMenu({
+ selector: '[contextmenu=' + this.id +']',
+ items: $.contextMenu.fromMenu(this)
+ });
+ }
+ }).css('display', 'none');
+ }
+ break;
+
+ default:
+ throw new Error('Unknown operation "' + operation + '"');
+ }
+
+ return this;
+};
+
+// import values into <input> commands
+$.contextMenu.setInputValues = function(opt, data) {
+ if (data === undefined) {
+ data = {};
+ }
+
+ $.each(opt.inputs, function(key, item) {
+ switch (item.type) {
+ case 'text':
+ case 'textarea':
+ item.value = data[key] || "";
+ break;
+
+ case 'checkbox':
+ item.selected = data[key] ? true : false;
+ break;
+
+ case 'radio':
+ item.selected = (data[item.radio] || "") == item.value ? true : false;
+ break;
+
+ case 'select':
+ item.selected = data[key] || "";
+ break;
+ }
+ });
+};
+
+// export values from <input> commands
+$.contextMenu.getInputValues = function(opt, data) {
+ if (data === undefined) {
+ data = {};
+ }
+
+ $.each(opt.inputs, function(key, item) {
+ switch (item.type) {
+ case 'text':
+ case 'textarea':
+ case 'select':
+ data[key] = item.$input.val();
+ break;
+
+ case 'checkbox':
+ data[key] = item.$input.prop('checked');
+ break;
+
+ case 'radio':
+ if (item.$input.prop('checked')) {
+ data[item.radio] = item.value;
+ }
+ break;
+ }
+ });
+
+ return data;
+};
+
+// find <label for="xyz">
+function inputLabel(node) {
+ return (node.id && $('label[for="'+ node.id +'"]').val()) || node.name;
+}
+
+// convert <menu> to items object
+function menuChildren(items, $children, counter) {
+ if (!counter) {
+ counter = 0;
+ }
+
+ $children.each(function() {
+ var $node = $(this),
+ node = this,
+ nodeName = this.nodeName.toLowerCase(),
+ label,
+ item;
+
+ // extract <label><input>
+ if (nodeName == 'label' && $node.find('input, textarea, select').length) {
+ label = $node.text();
+ $node = $node.children().first();
+ node = $node.get(0);
+ nodeName = node.nodeName.toLowerCase();
+ }
+
+ /*
+ * <menu> accepts flow-content as children. that means <embed>, <canvas> and such are valid menu items.
+ * Not being the sadistic kind, $.contextMenu only accepts:
+ * <command>, <menuitem>, <hr>, <span>, <p> <input [text, radio, checkbox]>, <textarea>, <select> and of course <menu>.
+ * Everything else will be imported as an html node, which is not interfaced with contextMenu.
+ */
+
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#concept-command
+ switch (nodeName) {
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-menu-element
+ case 'menu':
+ item = {name: $node.attr('label'), items: {}};
+ counter = menuChildren(item.items, $node.children(), counter);
+ break;
+
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command
+ case 'a':
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command
+ case 'button':
+ item = {
+ name: $node.text(),
+ disabled: !!$node.attr('disabled'),
+ callback: (function(){ return function(){ $node.click(); }; })()
+ };
+ break;
+
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-command-element-to-define-a-command
+
+ case 'menuitem':
+ case 'command':
+ switch ($node.attr('type')) {
+ case undefined:
+ case 'command':
+ case 'menuitem':
+ item = {
+ name: $node.attr('label'),
+ disabled: !!$node.attr('disabled'),
+ callback: (function(){ return function(){ $node.click(); }; })()
+ };
+ break;
+
+ case 'checkbox':
+ item = {
+ type: 'checkbox',
+ disabled: !!$node.attr('disabled'),
+ name: $node.attr('label'),
+ selected: !!$node.attr('checked')
+ };
+ break;
+
+ case 'radio':
+ item = {
+ type: 'radio',
+ disabled: !!$node.attr('disabled'),
+ name: $node.attr('label'),
+ radio: $node.attr('radiogroup'),
+ value: $node.attr('id'),
+ selected: !!$node.attr('checked')
+ };
+ break;
+
+ default:
+ item = undefined;
+ }
+ break;
+
+ case 'hr':
+ item = '-------';
+ break;
+
+ case 'input':
+ switch ($node.attr('type')) {
+ case 'text':
+ item = {
+ type: 'text',
+ name: label || inputLabel(node),
+ disabled: !!$node.attr('disabled'),
+ value: $node.val()
+ };
+ break;
+
+ case 'checkbox':
+ item = {
+ type: 'checkbox',
+ name: label || inputLabel(node),
+ disabled: !!$node.attr('disabled'),
+ selected: !!$node.attr('checked')
+ };
+ break;
+
+ case 'radio':
+ item = {
+ type: 'radio',
+ name: label || inputLabel(node),
+ disabled: !!$node.attr('disabled'),
+ radio: !!$node.attr('name'),
+ value: $node.val(),
+ selected: !!$node.attr('checked')
+ };
+ break;
+
+ default:
+ item = undefined;
+ break;
+ }
+ break;
+
+ case 'select':
+ item = {
+ type: 'select',
+ name: label || inputLabel(node),
+ disabled: !!$node.attr('disabled'),
+ selected: $node.val(),
+ options: {}
+ };
+ $node.children().each(function(){
+ item.options[this.value] = $(this).text();
+ });
+ break;
+
+ case 'textarea':
+ item = {
+ type: 'textarea',
+ name: label || inputLabel(node),
+ disabled: !!$node.attr('disabled'),
+ value: $node.val()
+ };
+ break;
+
+ case 'label':
+ break;
+
+ default:
+ item = {type: 'html', html: $node.clone(true)};
+ break;
+ }
+
+ if (item) {
+ counter++;
+ items['key' + counter] = item;
+ }
+ });
+
+ return counter;
+}
+
+// convert html5 menu
+$.contextMenu.fromMenu = function(element) {
+ var $this = $(element),
+ items = {};
+
+ menuChildren(items, $this.children());
+
+ return items;
+};
+
+// make defaults accessible
+$.contextMenu.defaults = defaults;
+$.contextMenu.types = types;
+// export internal functions - undocumented, for hacking only!
+$.contextMenu.handle = handle;
+$.contextMenu.op = op;
+$.contextMenu.menus = menus;
+
+})(jQuery); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery-ui.min.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery-ui.min.js
new file mode 100644
index 0000000..4e2d442
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery-ui.min.js
@@ -0,0 +1,13 @@
+/*! jQuery UI - v1.11.4 - 2015-06-28
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, tooltip.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}
+},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;
+this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))
+},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this
+},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;
+return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()
+},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}});var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;
+return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})}}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery.tooltipster.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery.tooltipster.js
new file mode 100644
index 0000000..503e199
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/menus/jquery.tooltipster.js
@@ -0,0 +1,1327 @@
+/*
+
+Tooltipster 3.3.0 | 2014-11-08
+A rockin' custom tooltip jQuery plugin
+
+Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+
+;(function ($, window, document) {
+
+ var pluginName = "tooltipster",
+ defaults = {
+ animation: 'fade',
+ arrow: true,
+ arrowColor: '',
+ autoClose: true,
+ content: null,
+ contentAsHTML: false,
+ contentCloning: true,
+ debug: true,
+ delay: 200,
+ minWidth: 0,
+ maxWidth: null,
+ functionInit: function(origin, content) {},
+ functionBefore: function(origin, continueTooltip) {
+ continueTooltip();
+ },
+ functionReady: function(origin, tooltip) {},
+ functionAfter: function(origin) {},
+ hideOnClick: false,
+ icon: '(?)',
+ iconCloning: true,
+ iconDesktop: false,
+ iconTouch: false,
+ iconTheme: 'tooltipster-icon',
+ interactive: false,
+ interactiveTolerance: 350,
+ multiple: false,
+ offsetX: 0,
+ offsetY: 0,
+ onlyOne: false,
+ position: 'top',
+ positionTracker: false,
+ positionTrackerCallback: function(origin){
+ // the default tracker callback will close the tooltip when the trigger is
+ // 'hover' (see https://github.com/iamceege/tooltipster/pull/253)
+ if(this.option('trigger') == 'hover' && this.option('autoClose')) {
+ this.hide();
+ }
+ },
+ restoration: 'current',
+ speed: 350,
+ timer: 0,
+ theme: 'tooltipster-default',
+ touchDevices: true,
+ trigger: 'hover',
+ updateAnimation: true
+ };
+
+ function Plugin(element, options) {
+
+ // list of instance variables
+
+ this.bodyOverflowX;
+ // stack of custom callbacks provided as parameters to API methods
+ this.callbacks = {
+ hide: [],
+ show: []
+ };
+ this.checkInterval = null;
+ // this will be the user content shown in the tooltip. A capital "C" is used because there is also a method called content()
+ this.Content;
+ // this is the original element which is being applied the tooltipster plugin
+ this.$el = $(element);
+ // this will be the element which triggers the appearance of the tooltip on hover/click/custom events.
+ // it will be the same as this.$el if icons are not used (see in the options), otherwise it will correspond to the created icon
+ this.$elProxy;
+ this.elProxyPosition;
+ this.enabled = true;
+ this.options = $.extend({}, defaults, options);
+ this.mouseIsOverProxy = false;
+ // a unique namespace per instance, for easy selective unbinding
+ this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000);
+ // Status (capital S) can be either : appearing, shown, disappearing, hidden
+ this.Status = 'hidden';
+ this.timerHide = null;
+ this.timerShow = null;
+ // this will be the tooltip element (jQuery wrapped HTML element)
+ this.$tooltip;
+
+ // for backward compatibility
+ this.options.iconTheme = this.options.iconTheme.replace('.', '');
+ this.options.theme = this.options.theme.replace('.', '');
+
+ // launch
+
+ this._init();
+ }
+
+ Plugin.prototype = {
+
+ _init: function() {
+
+ var self = this;
+
+ // disable the plugin on old browsers (including IE7 and lower)
+ if (document.querySelector) {
+
+ // note : the content is null (empty) by default and can stay that way if the plugin remains initialized but not fed any content. The tooltip will just not appear.
+
+ // let's save the initial value of the title attribute for later restoration if need be.
+ var initialTitle = null;
+ // it will already have been saved in case of multiple tooltips
+ if (self.$el.data('tooltipster-initialTitle') === undefined) {
+
+ initialTitle = self.$el.attr('title');
+
+ // we do not want initialTitle to have the value "undefined" because of how jQuery's .data() method works
+ if (initialTitle === undefined) initialTitle = null;
+
+ self.$el.data('tooltipster-initialTitle', initialTitle);
+ }
+
+ // if content is provided in the options, its has precedence over the title attribute.
+ // Note : an empty string is considered content, only 'null' represents the absence of content.
+ // Also, an existing title="" attribute will result in an empty string content
+ if (self.options.content !== null){
+ self._content_set(self.options.content);
+ }
+ else {
+ self._content_set(initialTitle);
+ }
+
+ var c = self.options.functionInit.call(self.$el, self.$el, self.Content);
+ if(typeof c !== 'undefined') self._content_set(c);
+
+ self.$el
+ // strip the title off of the element to prevent the default tooltips from popping up
+ .removeAttr('title')
+ // to be able to find all instances on the page later (upon window events in particular)
+ .addClass('tooltipstered');
+
+ // detect if we're changing the tooltip origin to an icon
+ // note about this condition : if the device has touch capability and self.options.iconTouch is false, you'll have no icons event though you may consider your device as a desktop if it also has a mouse. Not sure why someone would have this use case though.
+ if ((!deviceHasTouchCapability && self.options.iconDesktop) || (deviceHasTouchCapability && self.options.iconTouch)) {
+
+ // TODO : the tooltip should be automatically be given an absolute position to be near the origin. Otherwise, when the origin is floating or what, it's going to be nowhere near it and disturb the position flow of the page elements. It will imply that the icon also detects when its origin moves, to follow it : not trivial.
+ // Until it's done, the icon feature does not really make sense since the user still has most of the work to do by himself
+
+ // if the icon provided is in the form of a string
+ if(typeof self.options.icon === 'string'){
+ // wrap it in a span with the icon class
+ self.$elProxy = $('<span class="'+ self.options.iconTheme +'"></span>');
+ self.$elProxy.text(self.options.icon);
+ }
+ // if it is an object (sensible choice)
+ else {
+ // (deep) clone the object if iconCloning == true, to make sure every instance has its own proxy. We use the icon without wrapping, no need to. We do not give it a class either, as the user will undoubtedly style the object on his own and since our css properties may conflict with his own
+ if (self.options.iconCloning) self.$elProxy = self.options.icon.clone(true);
+ else self.$elProxy = self.options.icon;
+ }
+
+ self.$elProxy.insertAfter(self.$el);
+ }
+ else {
+ self.$elProxy = self.$el;
+ }
+
+ // for 'click' and 'hover' triggers : bind on events to open the tooltip. Closing is now handled in _showNow() because of its bindings.
+ // Notes about touch events :
+ // - mouseenter, mouseleave and clicks happen even on pure touch devices because they are emulated. deviceIsPureTouch() is a simple attempt to detect them.
+ // - on hybrid devices, we do not prevent touch gesture from opening tooltips. It would be too complex to differentiate real mouse events from emulated ones.
+ // - we check deviceIsPureTouch() at each event rather than prior to binding because the situation may change during browsing
+ if (self.options.trigger == 'hover') {
+
+ // these binding are for mouse interaction only
+ self.$elProxy
+ .on('mouseenter.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self.mouseIsOverProxy = true;
+ self._show();
+ }
+ })
+ .on('mouseleave.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self.mouseIsOverProxy = false;
+ }
+ });
+
+ // for touch interaction only
+ if (deviceHasTouchCapability && self.options.touchDevices) {
+
+ // for touch devices, we immediately display the tooltip because we cannot rely on mouseleave to handle the delay
+ self.$elProxy.on('touchstart.'+ self.namespace, function() {
+ self._showNow();
+ });
+ }
+ }
+ else if (self.options.trigger == 'click') {
+
+ // note : for touch devices, we do not bind on touchstart, we only rely on the emulated clicks (triggered by taps)
+ self.$elProxy.on('click.'+ self.namespace, function() {
+ if (!deviceIsPureTouch() || self.options.touchDevices) {
+ self._show();
+ }
+ });
+ }
+ }
+ },
+
+ // this function will schedule the opening of the tooltip after the delay, if there is one
+ _show: function() {
+
+ var self = this;
+
+ if (self.Status != 'shown' && self.Status != 'appearing') {
+
+ if (self.options.delay) {
+ self.timerShow = setTimeout(function(){
+
+ // for hover trigger, we check if the mouse is still over the proxy, otherwise we do not show anything
+ if (self.options.trigger == 'click' || (self.options.trigger == 'hover' && self.mouseIsOverProxy)) {
+ self._showNow();
+ }
+ }, self.options.delay);
+ }
+ else self._showNow();
+ }
+ },
+
+ // this function will open the tooltip right away
+ _showNow: function(callback) {
+
+ var self = this;
+
+ // call our constructor custom function before continuing
+ self.options.functionBefore.call(self.$el, self.$el, function() {
+
+ // continue only if the tooltip is enabled and has any content
+ if (self.enabled && self.Content !== null) {
+
+ // save the method callback and cancel hide method callbacks
+ if (callback) self.callbacks.show.push(callback);
+ self.callbacks.hide = [];
+
+ //get rid of any appearance timer
+ clearTimeout(self.timerShow);
+ self.timerShow = null;
+ clearTimeout(self.timerHide);
+ self.timerHide = null;
+
+ // if we only want one tooltip open at a time, close all auto-closing tooltips currently open and not already disappearing
+ if (self.options.onlyOne) {
+ $('.tooltipstered').not(self.$el).each(function(i,el) {
+
+ var $el = $(el),
+ nss = $el.data('tooltipster-ns');
+
+ // iterate on all tooltips of the element
+ $.each(nss, function(i, ns){
+ var instance = $el.data(ns),
+ // we have to use the public methods here
+ s = instance.status(),
+ ac = instance.option('autoClose');
+
+ if (s !== 'hidden' && s !== 'disappearing' && ac) {
+ instance.hide();
+ }
+ });
+ });
+ }
+
+ var finish = function() {
+ self.Status = 'shown';
+
+ // trigger any show method custom callbacks and reset them
+ $.each(self.callbacks.show, function(i,c) { c.call(self.$el); });
+ self.callbacks.show = [];
+ };
+
+ // if this origin already has its tooltip open
+ if (self.Status !== 'hidden') {
+
+ // the timer (if any) will start (or restart) right now
+ var extraTime = 0;
+
+ // if it was disappearing, cancel that
+ if (self.Status === 'disappearing') {
+
+ self.Status = 'appearing';
+
+ if (supportsTransitions()) {
+
+ self.$tooltip
+ .clearQueue()
+ .removeClass('tooltipster-dying')
+ .addClass('tooltipster-'+ self.options.animation +'-show');
+
+ if (self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ // in case the tooltip was currently fading out, bring it back to life
+ self.$tooltip
+ .stop()
+ .fadeIn(finish);
+ }
+ }
+ // if the tooltip is already open, we still need to trigger the method custom callback
+ else if(self.Status === 'shown') {
+ finish();
+ }
+ }
+ // if the tooltip isn't already open, open that sucker up!
+ else {
+
+ self.Status = 'appearing';
+
+ // the timer (if any) will start when the tooltip has fully appeared after its transition
+ var extraTime = self.options.speed;
+
+ // disable horizontal scrollbar to keep overflowing tooltips from jacking with it and then restore it to its previous value
+ self.bodyOverflowX = $('body').css('overflow-x');
+ //$('body').css('overflow-x', 'hidden');
+
+ // get some other settings related to building the tooltip
+ var animation = 'tooltipster-' + self.options.animation,
+ animationSpeed = '-webkit-transition-duration: '+ self.options.speed +'ms; -webkit-animation-duration: '+ self.options.speed +'ms; -moz-transition-duration: '+ self.options.speed +'ms; -moz-animation-duration: '+ self.options.speed +'ms; -o-transition-duration: '+ self.options.speed +'ms; -o-animation-duration: '+ self.options.speed +'ms; -ms-transition-duration: '+ self.options.speed +'ms; -ms-animation-duration: '+ self.options.speed +'ms; transition-duration: '+ self.options.speed +'ms; animation-duration: '+ self.options.speed +'ms;',
+ minWidth = self.options.minWidth ? 'min-width:'+ Math.round(self.options.minWidth) +'px;' : '',
+ maxWidth = self.options.maxWidth ? 'max-width:'+ Math.round(self.options.maxWidth) +'px;' : '',
+ pointerEvents = self.options.interactive ? 'pointer-events: auto;' : '';
+
+ // build the base of our tooltip
+ self.$tooltip = $('<div class="tooltipster-base '+ self.options.theme +'" style="'+ minWidth +' '+ maxWidth +' '+ pointerEvents +' '+ animationSpeed +'"><div class="tooltipster-content"></div></div>');
+
+ // only add the animation class if the user has a browser that supports animations
+ if (supportsTransitions()) self.$tooltip.addClass(animation);
+
+ // insert the content
+ self._content_insert();
+
+ // attach
+ self.$tooltip.appendTo('body');
+
+ // do all the crazy calculations and positioning
+ self.reposition();
+
+ // call our custom callback since the content of the tooltip is now part of the DOM
+ self.options.functionReady.call(self.$el, self.$el, self.$tooltip);
+
+ // animate in the tooltip
+ if (supportsTransitions()) {
+
+ self.$tooltip.addClass(animation + '-show');
+
+ if(self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ self.$tooltip.css('display', 'none').fadeIn(self.options.speed, finish);
+ }
+
+ // will check if our tooltip origin is removed while the tooltip is shown
+ self._interval_set();
+
+ // reposition on scroll (otherwise position:fixed element's tooltips will move away form their origin) and on resize (in case position can/has to be changed)
+ $(window).on('scroll.'+ self.namespace +' resize.'+ self.namespace, function() {
+ self.reposition();
+ });
+
+ // auto-close bindings
+ if (self.options.autoClose) {
+
+ // in case a listener is already bound for autoclosing (mouse or touch, hover or click), unbind it first
+ $('body').off('.'+ self.namespace);
+
+ // here we'll have to set different sets of bindings for both touch and mouse
+ if (self.options.trigger == 'hover') {
+
+ // if the user touches the body, hide
+ if (deviceHasTouchCapability) {
+ // timeout 0 : explanation below in click section
+ setTimeout(function() {
+ // we don't want to bind on click here because the initial touchstart event has not yet triggered its click event, which is thus about to happen
+ $('body').on('touchstart.'+ self.namespace, function() {
+ self.hide();
+ });
+ }, 0);
+ }
+
+ // if we have to allow interaction
+ if (self.options.interactive) {
+
+ // touch events inside the tooltip must not close it
+ if (deviceHasTouchCapability) {
+ self.$tooltip.on('touchstart.'+ self.namespace, function(event) {
+ event.stopPropagation();
+ });
+ }
+
+ // as for mouse interaction, we get rid of the tooltip only after the mouse has spent some time out of it
+ var tolerance = null;
+
+ self.$elProxy.add(self.$tooltip)
+ // hide after some time out of the proxy and the tooltip
+ .on('mouseleave.'+ self.namespace + '-autoClose', function() {
+ clearTimeout(tolerance);
+ tolerance = setTimeout(function(){
+ self.hide();
+ }, self.options.interactiveTolerance);
+ })
+ // suspend timeout when the mouse is over the proxy or the tooltip
+ .on('mouseenter.'+ self.namespace + '-autoClose', function() {
+ clearTimeout(tolerance);
+ });
+ }
+ // if this is a non-interactive tooltip, get rid of it if the mouse leaves
+ else {
+ self.$elProxy.on('mouseleave.'+ self.namespace + '-autoClose', function() {
+ self.hide();
+ });
+ }
+
+ // close the tooltip when the proxy gets a click (common behavior of native tooltips)
+ if (self.options.hideOnClick) {
+
+ self.$elProxy.on('click.'+ self.namespace + '-autoClose', function() {
+ self.hide();
+ });
+ }
+ }
+ // here we'll set the same bindings for both clicks and touch on the body to hide the tooltip
+ else if(self.options.trigger == 'click'){
+
+ // use a timeout to prevent immediate closing if the method was called on a click event and if options.delay == 0 (because of bubbling)
+ setTimeout(function() {
+ $('body').on('click.'+ self.namespace +' touchstart.'+ self.namespace, function() {
+ self.hide();
+ });
+ }, 0);
+
+ // if interactive, we'll stop the events that were emitted from inside the tooltip to stop autoClosing
+ if (self.options.interactive) {
+
+ // note : the touch events will just not be used if the plugin is not enabled on touch devices
+ self.$tooltip.on('click.'+ self.namespace +' touchstart.'+ self.namespace, function(event) {
+ event.stopPropagation();
+ });
+ }
+ }
+ }
+ }
+
+ // if we have a timer set, let the countdown begin
+ if (self.options.timer > 0) {
+
+ self.timerHide = setTimeout(function() {
+ self.timerHide = null;
+ self.hide();
+ }, self.options.timer + extraTime);
+ }
+ }
+ });
+ },
+
+ _interval_set: function() {
+
+ var self = this;
+
+ self.checkInterval = setInterval(function() {
+
+ // if the tooltip and/or its interval should be stopped
+ if (
+ // if the origin has been removed
+ $('body').find(self.$el).length === 0
+ // if the elProxy has been removed
+ || $('body').find(self.$elProxy).length === 0
+ // if the tooltip has been closed
+ || self.Status == 'hidden'
+ // if the tooltip has somehow been removed
+ || $('body').find(self.$tooltip).length === 0
+ ) {
+ // remove the tooltip if it's still here
+ if (self.Status == 'shown' || self.Status == 'appearing') self.hide();
+
+ // clear this interval as it is no longer necessary
+ self._interval_cancel();
+ }
+ // if everything is alright
+ else {
+ // compare the former and current positions of the elProxy to reposition the tooltip if need be
+ if(self.options.positionTracker){
+
+ var p = self._repositionInfo(self.$elProxy),
+ identical = false;
+
+ // compare size first (a change requires repositioning too)
+ if(areEqual(p.dimension, self.elProxyPosition.dimension)){
+
+ // for elements with a fixed position, we track the top and left properties (relative to window)
+ if(self.$elProxy.css('position') === 'fixed'){
+ if(areEqual(p.position, self.elProxyPosition.position)) identical = true;
+ }
+ // otherwise, track total offset (relative to document)
+ else {
+ if(areEqual(p.offset, self.elProxyPosition.offset)) identical = true;
+ }
+ }
+
+ if(!identical){
+ self.reposition();
+ self.options.positionTrackerCallback.call(self, self.$el);
+ }
+ }
+ }
+ }, 200);
+ },
+
+ _interval_cancel: function() {
+ clearInterval(this.checkInterval);
+ // clean delete
+ this.checkInterval = null;
+ },
+
+ _content_set: function(content) {
+ // clone if asked. Cloning the object makes sure that each instance has its own version of the content (in case a same object were provided for several instances)
+ // reminder : typeof null === object
+ if (typeof content === 'object' && content !== null && this.options.contentCloning) {
+ content = content.clone(true);
+ }
+ this.Content = content;
+ },
+
+ _content_insert: function() {
+
+ var self = this,
+ $d = this.$tooltip.find('.tooltipster-content');
+
+ if (typeof self.Content === 'string' && !self.options.contentAsHTML) {
+ $d.text(self.Content);
+ }
+ else {
+ $d
+ .empty()
+ .append(self.Content);
+ }
+ },
+
+ _update: function(content) {
+
+ var self = this;
+
+ // change the content
+ self._content_set(content);
+
+ if (self.Content !== null) {
+
+ // update the tooltip if it is open
+ if (self.Status !== 'hidden') {
+
+ // reset the content in the tooltip
+ self._content_insert();
+
+ // reposition and resize the tooltip
+ self.reposition();
+
+ // if we want to play a little animation showing the content changed
+ if (self.options.updateAnimation) {
+
+ if (supportsTransitions()) {
+
+ self.$tooltip.css({
+ 'width': '',
+ '-webkit-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-moz-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-o-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ '-ms-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms',
+ 'transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms'
+ }).addClass('tooltipster-content-changing');
+
+ // reset the CSS transitions and finish the change animation
+ setTimeout(function() {
+
+ if(self.Status != 'hidden'){
+
+ self.$tooltip.removeClass('tooltipster-content-changing');
+
+ // after the changing animation has completed, reset the CSS transitions
+ setTimeout(function() {
+
+ if(self.Status !== 'hidden'){
+ self.$tooltip.css({
+ '-webkit-transition': self.options.speed + 'ms',
+ '-moz-transition': self.options.speed + 'ms',
+ '-o-transition': self.options.speed + 'ms',
+ '-ms-transition': self.options.speed + 'ms',
+ 'transition': self.options.speed + 'ms'
+ });
+ }
+ }, self.options.speed);
+ }
+ }, self.options.speed);
+ }
+ else {
+ self.$tooltip.fadeTo(self.options.speed, 0.5, function() {
+ if(self.Status != 'hidden'){
+ self.$tooltip.fadeTo(self.options.speed, 1);
+ }
+ });
+ }
+ }
+ }
+ }
+ else {
+ self.hide();
+ }
+ },
+
+ _repositionInfo: function($el) {
+ return {
+ dimension: {
+ height: $el.outerHeight(false),
+ width: $el.outerWidth(false)
+ },
+ offset: $el.offset(),
+ position: {
+ left: parseInt($el.css('left')),
+ top: parseInt($el.css('top'))
+ }
+ };
+ },
+
+ hide: function(callback) {
+
+ var self = this;
+
+ // save the method custom callback and cancel any show method custom callbacks
+ if (callback) self.callbacks.hide.push(callback);
+ self.callbacks.show = [];
+
+ // get rid of any appearance timeout
+ clearTimeout(self.timerShow);
+ self.timerShow = null;
+ clearTimeout(self.timerHide);
+ self.timerHide = null;
+
+ var finishCallbacks = function() {
+ // trigger any hide method custom callbacks and reset them
+ $.each(self.callbacks.hide, function(i,c) { c.call(self.$el); });
+ self.callbacks.hide = [];
+ };
+
+ // hide
+ if (self.Status == 'shown' || self.Status == 'appearing') {
+
+ self.Status = 'disappearing';
+
+ var finish = function() {
+
+ self.Status = 'hidden';
+
+ // detach our content object first, so the next jQuery's remove() call does not unbind its event handlers
+ if (typeof self.Content == 'object' && self.Content !== null) {
+ self.Content.detach();
+ }
+
+ self.$tooltip.remove();
+ self.$tooltip = null;
+
+ // unbind orientationchange, scroll and resize listeners
+ $(window).off('.'+ self.namespace);
+
+ $('body')
+ // unbind any auto-closing click/touch listeners
+ .off('.'+ self.namespace)
+ .css('overflow-x', self.bodyOverflowX);
+
+ // unbind any auto-closing click/touch listeners
+ $('body').off('.'+ self.namespace);
+
+ // unbind any auto-closing hover listeners
+ self.$elProxy.off('.'+ self.namespace + '-autoClose');
+
+ // call our constructor custom callback function
+ self.options.functionAfter.call(self.$el, self.$el);
+
+ // call our method custom callbacks functions
+ finishCallbacks();
+ };
+
+ if (supportsTransitions()) {
+
+ self.$tooltip
+ .clearQueue()
+ .removeClass('tooltipster-' + self.options.animation + '-show')
+ // for transitions only
+ .addClass('tooltipster-dying');
+
+ if(self.options.speed > 0) self.$tooltip.delay(self.options.speed);
+
+ self.$tooltip.queue(finish);
+ }
+ else {
+ self.$tooltip
+ .stop()
+ .fadeOut(self.options.speed, finish);
+ }
+ }
+ // if the tooltip is already hidden, we still need to trigger the method custom callback
+ else if(self.Status == 'hidden') {
+ finishCallbacks();
+ }
+
+ return self;
+ },
+
+ // the public show() method is actually an alias for the private showNow() method
+ show: function(callback) {
+ this._showNow(callback);
+ return this;
+ },
+
+ // 'update' is deprecated in favor of 'content' but is kept for backward compatibility
+ update: function(c) {
+ return this.content(c);
+ },
+ content: function(c) {
+ // getter method
+ if(typeof c === 'undefined'){
+ return this.Content;
+ }
+ // setter method
+ else {
+ this._update(c);
+ return this;
+ }
+ },
+
+ reposition: function() {
+
+ var self = this;
+
+ // in case the tooltip has been removed from DOM manually
+ if ($('body').find(self.$tooltip).length !== 0) {
+
+ // reset width
+ self.$tooltip.css('width', '');
+
+ // find variables to determine placement
+ self.elProxyPosition = self._repositionInfo(self.$elProxy);
+ var arrowReposition = null,
+ windowWidth = $(window).width(),
+ // shorthand
+ proxy = self.elProxyPosition,
+ tooltipWidth = self.$tooltip.outerWidth(false),
+ tooltipInnerWidth = self.$tooltip.innerWidth() + 1, // this +1 stops FireFox from sometimes forcing an additional text line
+ tooltipHeight = self.$tooltip.outerHeight(false);
+
+ // if this is an <area> tag inside a <map>, all hell breaks loose. Recalculate all the measurements based on coordinates
+ if (self.$elProxy.is('area')) {
+ var areaShape = self.$elProxy.attr('shape'),
+ mapName = self.$elProxy.parent().attr('name'),
+ map = $('img[usemap="#'+ mapName +'"]'),
+ mapOffsetLeft = map.offset().left,
+ mapOffsetTop = map.offset().top,
+ areaMeasurements = self.$elProxy.attr('coords') !== undefined ? self.$elProxy.attr('coords').split(',') : undefined;
+
+ if (areaShape == 'circle') {
+ var areaLeft = parseInt(areaMeasurements[0]),
+ areaTop = parseInt(areaMeasurements[1]),
+ areaWidth = parseInt(areaMeasurements[2]);
+ proxy.dimension.height = areaWidth * 2;
+ proxy.dimension.width = areaWidth * 2;
+ proxy.offset.top = mapOffsetTop + areaTop - areaWidth;
+ proxy.offset.left = mapOffsetLeft + areaLeft - areaWidth;
+ }
+ else if (areaShape == 'rect') {
+ var areaLeft = parseInt(areaMeasurements[0]),
+ areaTop = parseInt(areaMeasurements[1]),
+ areaRight = parseInt(areaMeasurements[2]),
+ areaBottom = parseInt(areaMeasurements[3]);
+ proxy.dimension.height = areaBottom - areaTop;
+ proxy.dimension.width = areaRight - areaLeft;
+ proxy.offset.top = mapOffsetTop + areaTop;
+ proxy.offset.left = mapOffsetLeft + areaLeft;
+ }
+ else if (areaShape == 'poly') {
+ var areaXs = [],
+ areaYs = [],
+ areaSmallestX = 0,
+ areaSmallestY = 0,
+ areaGreatestX = 0,
+ areaGreatestY = 0,
+ arrayAlternate = 'even';
+
+ for (var i = 0; i < areaMeasurements.length; i++) {
+ var areaNumber = parseInt(areaMeasurements[i]);
+
+ if (arrayAlternate == 'even') {
+ if (areaNumber > areaGreatestX) {
+ areaGreatestX = areaNumber;
+ if (i === 0) {
+ areaSmallestX = areaGreatestX;
+ }
+ }
+
+ if (areaNumber < areaSmallestX) {
+ areaSmallestX = areaNumber;
+ }
+
+ arrayAlternate = 'odd';
+ }
+ else {
+ if (areaNumber > areaGreatestY) {
+ areaGreatestY = areaNumber;
+ if (i == 1) {
+ areaSmallestY = areaGreatestY;
+ }
+ }
+
+ if (areaNumber < areaSmallestY) {
+ areaSmallestY = areaNumber;
+ }
+
+ arrayAlternate = 'even';
+ }
+ }
+
+ proxy.dimension.height = areaGreatestY - areaSmallestY;
+ proxy.dimension.width = areaGreatestX - areaSmallestX;
+ proxy.offset.top = mapOffsetTop + areaSmallestY;
+ proxy.offset.left = mapOffsetLeft + areaSmallestX;
+ }
+ else {
+ proxy.dimension.height = map.outerHeight(false);
+ proxy.dimension.width = map.outerWidth(false);
+ proxy.offset.top = mapOffsetTop;
+ proxy.offset.left = mapOffsetLeft;
+ }
+ }
+
+ // our function and global vars for positioning our tooltip
+ var myLeft = 0,
+ myLeftMirror = 0,
+ myTop = 0,
+ offsetY = parseInt(self.options.offsetY),
+ offsetX = parseInt(self.options.offsetX),
+ // this is the arrow position that will eventually be used. It may differ from the position option if the tooltip cannot be displayed in this position
+ practicalPosition = self.options.position;
+
+ // a function to detect if the tooltip is going off the screen horizontally. If so, reposition the crap out of it!
+ function dontGoOffScreenX() {
+
+ var windowLeft = $(window).scrollLeft();
+
+ // if the tooltip goes off the left side of the screen, line it up with the left side of the window
+ if((myLeft - windowLeft) < 0) {
+ arrowReposition = myLeft - windowLeft;
+ myLeft = windowLeft;
+ }
+
+ // if the tooltip goes off the right of the screen, line it up with the right side of the window
+ if (((myLeft + tooltipWidth) - windowLeft) > windowWidth) {
+ arrowReposition = myLeft - ((windowWidth + windowLeft) - tooltipWidth);
+ myLeft = (windowWidth + windowLeft) - tooltipWidth;
+ }
+ }
+
+ // a function to detect if the tooltip is going off the screen vertically. If so, switch to the opposite!
+ function dontGoOffScreenY(switchTo, switchFrom) {
+ // if it goes off the top off the page
+ if(((proxy.offset.top - $(window).scrollTop() - tooltipHeight - offsetY - 12) < 0) && (switchFrom.indexOf('top') > -1)) {
+ practicalPosition = switchTo;
+ }
+
+ // if it goes off the bottom of the page
+ if (((proxy.offset.top + proxy.dimension.height + tooltipHeight + 12 + offsetY) > ($(window).scrollTop() + $(window).height())) && (switchFrom.indexOf('bottom') > -1)) {
+ practicalPosition = switchTo;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ }
+ }
+
+ if(practicalPosition == 'top') {
+ var leftDifference = (proxy.offset.left + tooltipWidth) - (proxy.offset.left + proxy.dimension.width);
+ myLeft = (proxy.offset.left + offsetX) - (leftDifference / 2);
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom', 'top');
+ }
+
+ if(practicalPosition == 'top-left') {
+ myLeft = proxy.offset.left + offsetX;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom-left', 'top-left');
+ }
+
+ if(practicalPosition == 'top-right') {
+ myLeft = (proxy.offset.left + proxy.dimension.width + offsetX) - tooltipWidth;
+ myTop = (proxy.offset.top - tooltipHeight) - offsetY - 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('bottom-right', 'top-right');
+ }
+
+ if(practicalPosition == 'bottom') {
+ var leftDifference = (proxy.offset.left + tooltipWidth) - (proxy.offset.left + proxy.dimension.width);
+ myLeft = proxy.offset.left - (leftDifference / 2) + offsetX;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top', 'bottom');
+ }
+
+ if(practicalPosition == 'bottom-left') {
+ myLeft = proxy.offset.left + offsetX;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top-left', 'bottom-left');
+ }
+
+ if(practicalPosition == 'bottom-right') {
+ myLeft = (proxy.offset.left + proxy.dimension.width + offsetX) - tooltipWidth;
+ myTop = (proxy.offset.top + proxy.dimension.height) + offsetY + 12;
+ dontGoOffScreenX();
+ dontGoOffScreenY('top-right', 'bottom-right');
+ }
+
+ if(practicalPosition == 'left') {
+ myLeft = proxy.offset.left - offsetX - tooltipWidth - 12;
+ myLeftMirror = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ var topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+
+ // if the tooltip goes off boths sides of the page
+ if((myLeft < 0) && ((myLeftMirror + tooltipWidth) > windowWidth)) {
+ var borderWidth = parseFloat(self.$tooltip.css('border-width')) * 2,
+ newWidth = (tooltipWidth + myLeft) - borderWidth;
+ self.$tooltip.css('width', newWidth + 'px');
+
+ tooltipHeight = self.$tooltip.outerHeight(false);
+ myLeft = proxy.offset.left - offsetX - newWidth - 12 - borderWidth;
+ topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+ }
+
+ // if it only goes off one side, flip it to the other side
+ else if(myLeft < 0) {
+ myLeft = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ arrowReposition = 'left';
+ }
+ }
+
+ if(practicalPosition == 'right') {
+ myLeft = proxy.offset.left + offsetX + proxy.dimension.width + 12;
+ myLeftMirror = proxy.offset.left - offsetX - tooltipWidth - 12;
+ var topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+
+ // if the tooltip goes off boths sides of the page
+ if(((myLeft + tooltipWidth) > windowWidth) && (myLeftMirror < 0)) {
+ var borderWidth = parseFloat(self.$tooltip.css('border-width')) * 2,
+ newWidth = (windowWidth - myLeft) - borderWidth;
+ self.$tooltip.css('width', newWidth + 'px');
+
+ tooltipHeight = self.$tooltip.outerHeight(false);
+ topDifference = (proxy.offset.top + tooltipHeight) - (proxy.offset.top + proxy.dimension.height);
+ myTop = proxy.offset.top - (topDifference / 2) - offsetY;
+ }
+
+ // if it only goes off one side, flip it to the other side
+ else if((myLeft + tooltipWidth) > windowWidth) {
+ myLeft = proxy.offset.left - offsetX - tooltipWidth - 12;
+ arrowReposition = 'right';
+ }
+ }
+
+ // if arrow is set true, style it and append it
+ if (self.options.arrow) {
+
+ var arrowClass = 'tooltipster-arrow-' + practicalPosition;
+
+ // set color of the arrow
+ if(self.options.arrowColor.length < 1) {
+ var arrowColor = self.$tooltip.css('background-color');
+ }
+ else {
+ var arrowColor = self.options.arrowColor;
+ }
+
+ // if the tooltip was going off the page and had to re-adjust, we need to update the arrow's position
+ if (!arrowReposition) {
+ arrowReposition = '';
+ }
+ else if (arrowReposition == 'left') {
+ arrowClass = 'tooltipster-arrow-right';
+ arrowReposition = '';
+ }
+ else if (arrowReposition == 'right') {
+ arrowClass = 'tooltipster-arrow-left';
+ arrowReposition = '';
+ }
+ else {
+ arrowReposition = 'left:'+ Math.round(arrowReposition) +'px;';
+ }
+
+ // building the logic to create the border around the arrow of the tooltip
+ if ((practicalPosition == 'top') || (practicalPosition == 'top-left') || (practicalPosition == 'top-right')) {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-bottom-width')),
+ tooltipBorderColor = self.$tooltip.css('border-bottom-color');
+ }
+ else if ((practicalPosition == 'bottom') || (practicalPosition == 'bottom-left') || (practicalPosition == 'bottom-right')) {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-top-width')),
+ tooltipBorderColor = self.$tooltip.css('border-top-color');
+ }
+ else if (practicalPosition == 'left') {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-right-width')),
+ tooltipBorderColor = self.$tooltip.css('border-right-color');
+ }
+ else if (practicalPosition == 'right') {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-left-width')),
+ tooltipBorderColor = self.$tooltip.css('border-left-color');
+ }
+ else {
+ var tooltipBorderWidth = parseFloat(self.$tooltip.css('border-bottom-width')),
+ tooltipBorderColor = self.$tooltip.css('border-bottom-color');
+ }
+
+ if (tooltipBorderWidth > 1) {
+ tooltipBorderWidth++;
+ }
+
+ var arrowBorder = '';
+ if (tooltipBorderWidth !== 0) {
+ var arrowBorderSize = '',
+ arrowBorderColor = 'border-color: '+ tooltipBorderColor +';';
+ if (arrowClass.indexOf('bottom') !== -1) {
+ arrowBorderSize = 'margin-top: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('top') !== -1) {
+ arrowBorderSize = 'margin-bottom: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('left') !== -1) {
+ arrowBorderSize = 'margin-right: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ else if (arrowClass.indexOf('right') !== -1) {
+ arrowBorderSize = 'margin-left: -'+ Math.round(tooltipBorderWidth) +'px;';
+ }
+ arrowBorder = '<span class="tooltipster-arrow-border" style="'+ arrowBorderSize +' '+ arrowBorderColor +';"></span>';
+ }
+
+ // if the arrow already exists, remove and replace it
+ self.$tooltip.find('.tooltipster-arrow').remove();
+
+ // build out the arrow and append it
+ var arrowConstruct = '<div class="'+ arrowClass +' tooltipster-arrow" style="'+ arrowReposition +'">'+ arrowBorder +'<span style="border-color:'+ arrowColor +';"></span></div>';
+ self.$tooltip.append(arrowConstruct);
+ }
+
+ // position the tooltip
+ self.$tooltip.css({'top': Math.round(myTop) + 'px', 'left': Math.round(myLeft) + 'px'});
+ }
+
+ return self;
+ },
+
+ enable: function() {
+ this.enabled = true;
+ return this;
+ },
+
+ disable: function() {
+ // hide first, in case the tooltip would not disappear on its own (autoClose false)
+ this.hide();
+ this.enabled = false;
+ return this;
+ },
+
+ destroy: function() {
+
+ var self = this;
+
+ self.hide();
+
+ // remove the icon, if any
+ if (self.$el[0] !== self.$elProxy[0]) {
+ self.$elProxy.remove();
+ }
+
+ self.$el
+ .removeData(self.namespace)
+ .off('.'+ self.namespace);
+
+ var ns = self.$el.data('tooltipster-ns');
+
+ // if there are no more tooltips on this element
+ if(ns.length === 1){
+
+ // optional restoration of a title attribute
+ var title = null;
+ if (self.options.restoration === 'previous'){
+ title = self.$el.data('tooltipster-initialTitle');
+ }
+ else if(self.options.restoration === 'current'){
+
+ // old school technique to stringify when outerHTML is not supported
+ title =
+ (typeof self.Content === 'string') ?
+ self.Content :
+ $('<div></div>').append(self.Content).html();
+ }
+
+ if (title) {
+ self.$el.attr('title', title);
+ }
+
+ // final cleaning
+ self.$el
+ .removeClass('tooltipstered')
+ .removeData('tooltipster-ns')
+ .removeData('tooltipster-initialTitle');
+ }
+ else {
+ // remove the instance namespace from the list of namespaces of tooltips present on the element
+ ns = $.grep(ns, function(el, i){
+ return el !== self.namespace;
+ });
+ self.$el.data('tooltipster-ns', ns);
+ }
+
+ return self;
+ },
+
+ elementIcon: function() {
+ return (this.$el[0] !== this.$elProxy[0]) ? this.$elProxy[0] : undefined;
+ },
+
+ elementTooltip: function() {
+ return this.$tooltip ? this.$tooltip[0] : undefined;
+ },
+
+ // public methods but for internal use only
+ // getter if val is ommitted, setter otherwise
+ option: function(o, val) {
+ if (typeof val == 'undefined') return this.options[o];
+ else {
+ this.options[o] = val;
+ return this;
+ }
+ },
+ status: function() {
+ return this.Status;
+ }
+ };
+
+ $.fn[pluginName] = function () {
+
+ // for using in closures
+ var args = arguments;
+
+ // if we are not in the context of jQuery wrapped HTML element(s) :
+ // this happens when calling static methods in the form $.fn.tooltipster('methodName'), or when calling $(sel).tooltipster('methodName or options') where $(sel) does not match anything
+ if (this.length === 0) {
+
+ // if the first argument is a method name
+ if (typeof args[0] === 'string') {
+
+ var methodIsStatic = true;
+
+ // list static methods here (usable by calling $.fn.tooltipster('methodName');)
+ switch (args[0]) {
+
+ case 'setDefaults':
+ // change default options for all future instances
+ $.extend(defaults, args[1]);
+ break;
+
+ default:
+ methodIsStatic = false;
+ break;
+ }
+
+ // $.fn.tooltipster('methodName') calls will return true
+ if (methodIsStatic) return true;
+ // $(sel).tooltipster('methodName') calls will return the list of objects event though it's empty because chaining should work on empty lists
+ else return this;
+ }
+ // the first argument is undefined or an object of options : we are initalizing but there is no element matched by selector
+ else {
+ // still chainable : same as above
+ return this;
+ }
+ }
+ // this happens when calling $(sel).tooltipster('methodName or options') where $(sel) matches one or more elements
+ else {
+
+ // method calls
+ if (typeof args[0] === 'string') {
+
+ var v = '#*$~&';
+
+ this.each(function() {
+
+ // retrieve the namepaces of the tooltip(s) that exist on that element. We will interact with the first tooltip only.
+ var ns = $(this).data('tooltipster-ns'),
+ // self represents the instance of the first tooltipster plugin associated to the current HTML object of the loop
+ self = ns ? $(this).data(ns[0]) : null;
+
+ // if the current element holds a tooltipster instance
+ if (self) {
+
+ if (typeof self[args[0]] === 'function') {
+ // note : args[1] and args[2] may not be defined
+ var resp = self[args[0]](args[1], args[2]);
+ }
+ else {
+ throw new Error('Unknown method .tooltipster("' + args[0] + '")');
+ }
+
+ // if the function returned anything other than the instance itself (which implies chaining)
+ if (resp !== self){
+ v = resp;
+ // return false to stop .each iteration on the first element matched by the selector
+ return false;
+ }
+ }
+ else {
+ throw new Error('You called Tooltipster\'s "' + args[0] + '" method on an uninitialized element');
+ }
+ });
+
+ return (v !== '#*$~&') ? v : this;
+ }
+ // first argument is undefined or an object : the tooltip is initializing
+ else {
+
+ var instances = [],
+ // is there a defined value for the multiple option in the options object ?
+ multipleIsSet = args[0] && typeof args[0].multiple !== 'undefined',
+ // if the multiple option is set to true, or if it's not defined but set to true in the defaults
+ multiple = (multipleIsSet && args[0].multiple) || (!multipleIsSet && defaults.multiple),
+ // same for debug
+ debugIsSet = args[0] && typeof args[0].debug !== 'undefined',
+ debug = (debugIsSet && args[0].debug) || (!debugIsSet && defaults.debug);
+
+ // initialize a tooltipster instance for each element if it doesn't already have one or if the multiple option is set, and attach the object to it
+ this.each(function () {
+
+ var go = false,
+ ns = $(this).data('tooltipster-ns'),
+ instance = null;
+
+ if (!ns) {
+ go = true;
+ }
+ else if (multiple) {
+ go = true;
+ }
+ else if (debug) {
+ console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.');
+ }
+
+ if (go) {
+ instance = new Plugin(this, args[0]);
+
+ // save the reference of the new instance
+ if (!ns) ns = [];
+ ns.push(instance.namespace);
+ $(this).data('tooltipster-ns', ns)
+
+ // save the instance itself
+ $(this).data(instance.namespace, instance);
+ }
+
+ instances.push(instance);
+ });
+
+ if (multiple) return instances;
+ else return this;
+ }
+ }
+ };
+
+ // quick & dirty compare function (not bijective nor multidimensional)
+ function areEqual(a,b) {
+ var same = true;
+ $.each(a, function(i, el){
+ if(typeof b[i] === 'undefined' || a[i] !== b[i]){
+ same = false;
+ return false;
+ }
+ });
+ return same;
+ }
+
+ // detect if this device can trigger touch events
+ var deviceHasTouchCapability = !!('ontouchstart' in window);
+
+ // we'll assume the device has no mouse until we detect any mouse movement
+ var deviceHasMouse = false;
+ $('body').one('mousemove', function() {
+ deviceHasMouse = true;
+ });
+
+ function deviceIsPureTouch() {
+ return (!deviceHasMouse && deviceHasTouchCapability);
+ }
+
+ // detecting support for CSS transitions
+ function supportsTransitions() {
+ var b = document.body || document.documentElement,
+ s = b.style,
+ p = 'transition';
+
+ if(typeof s[p] == 'string') {return true; }
+
+ v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
+ p = p.charAt(0).toUpperCase() + p.substr(1);
+ for(var i=0; i<v.length; i++) {
+ if(typeof s[v[i] + p] == 'string') { return true; }
+ }
+ return false;
+ }
+})( jQuery, window, document );
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/nodes.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/nodes.js
new file mode 100644
index 0000000..7ad2cd7
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/nodes.js
@@ -0,0 +1,1290 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+// Contains methods to drag, copy, resize nodes
+// Some notes about nodes. Nodes created at top contain details about the service such as the toscaid and sname
+// (Short Name)
+
+var nodeArr = []; //Node array stored as [tag, uuid]
+var lifelineX = [];
+var startArrowDependants = [];
+var endArrowDependants = [];
+var lastSelected = null;
+
+interact('.nodeDraggable')
+ .on('tap', function(event) {
+ var target = event.target;
+
+ if ($(target).hasClass('collapsedPlus')) return;
+ if (target.className == 'hasNodesHeader' && event.button == 0) return;
+ if (event.target.id == "") target = event.target.parentNode;
+ if ($("#" + target.id).hasClass('placed') && event.ctrlKey == false && event
+ .shiftKey == false && event.button == 0) {
+ clearSelection();
+ selection.push(target.id);
+ $("#" + target.id).addClass('selected');
+ lastSelected = target.id;
+ }
+ //Ctrl key & left click & not already selected = adds it
+ else if ($("#" + target.id).hasClass('placed') && selection.indexOf(target.id) ==
+ -1 && event.ctrlKey == true && event.button == 0) {
+ selection.push(target.id);
+ $("#" + target.id).addClass('selected');
+ lastSelected = target.id;
+ }
+ //Ctrl key & Left click & already selected = removes it
+ else if (selection.indexOf(target.id) != -1 && event.ctrlKey == true &&
+ event.button == 0) {
+ selection.splice(selection.indexOf(target.id), 1);
+ $("#" + target.id).removeClass('selected')
+ }
+ //Shift key & left click
+ else if ($("#" + target.id).hasClass('placed') && selection.indexOf(target.id) ==
+ -1 && event.shiftKey == true && event.button == 0) {
+ selection.push(target.id);
+ $("#" + target.id).addClass('selected');
+ if (lastSelected != null) {
+ if (parseInt(document.getElementById(lastSelected).getAttribute('data_x')) >
+ parseInt(target.getAttribute('data_x'))) {
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (nodeArr[i][1] == lastSelected || nodeArr[i][1] == target.id) {
+ continue;
+ }
+ if (nodeArr[i][3] < parseInt(document.getElementById(lastSelected).getAttribute(
+ 'data_x')) && nodeArr[i][3] > parseInt(target.getAttribute('data_x'))) {
+ selection.push(nodeArr[i][1]);
+ $("#" + nodeArr[i][1]).addClass('selected');
+ }
+ }
+ } else if (parseInt(document.getElementById(lastSelected).getAttribute(
+ 'data_x')) < parseInt(target.getAttribute('data_x'))) {
+ for (var i = 0; i < nodeArr.length; i++) {
+ if (nodeArr[i][1] == lastSelected || nodeArr[i][1] == target.id) {
+ continue;
+ }
+ if (nodeArr[i][3] > parseInt(document.getElementById(lastSelected).getAttribute(
+ 'data_x')) && nodeArr[i][3] < parseInt(target.getAttribute('data_x'))) {
+ selection.push(nodeArr[i][1]);
+ $("#" + nodeArr[i][1]).addClass('selected');
+ }
+ }
+ }
+ }
+ lastSelected = target.id;
+ } else if (event.button == 2) {
+ if (selection.indexOf(target.id) == -1) {
+ clearSelection();
+ selection.push(target.id);
+ $("#" + target.id).addClass('selected');
+ lastSelected = target.id;
+ }
+
+ }
+ //Else clear
+ else {
+ if (event.button == 0) {
+ clearSelection();
+ }
+ }
+ })
+ //CLONING
+ .on('move', function(event) {
+ var interaction = event.interaction;
+ $("nodeDropzone").addClass("drop-target");
+ // if the pointer was moved while being held down
+ // and an interaction hasn't started yet
+ if (interaction.pointerIsDown && !interaction.interacting() && !$(event.currentTarget)
+ .hasClass("child")) {
+ //console.log(event);
+ var original = event.currentTarget,
+ // create a clone of the currentTarget element
+ clone = event.currentTarget.cloneNode(true);
+ uuid = guid();
+ clone.id = uuid;
+ clone.classList.remove('drag');
+ clone.classList.add('drag-1');
+ // insert the clone to the page
+ var dropOffLocation = document.getElementById("nodeChildrenDroppedOffHere");
+
+ var clone = dropOffLocation.insertBefore(clone, dropOffLocation.parentNodes);
+ var d = document.getElementById(uuid);
+ d.className = d.className + " child"; //Adds child class to prevent child cloning
+
+
+ // translate the element
+ clone.style.webkitTransform = clone.style.transform = 'translate(' + 0 + $(
+ document).scrollLeft() + 'px, ' + 0 + $(document).scrollTop() + 'px)';
+
+ // update the position attributes
+ clone.setAttribute('data_x', 0 + $(document).scrollLeft());
+ clone.setAttribute('data_y', 0 + $(document).scrollTop());
+
+
+ nodeArr.push([clone, uuid]);
+
+ // start a drag interaction targeting the clone
+ interaction.start({
+ name: 'drag'
+ },
+ event.interactable,
+ clone);
+ }
+ })
+
+//DRAGGING
+.draggable({
+ snap: {
+ targets: [ // give this function the x and y page coords
+ // and snap to the object returned
+
+ interact.createHorizontalSnapGrid({
+ x: 160,
+ y: 100,
+ offset: {
+ x: -51,
+ y: 0
+ }
+ })
+
+ ],
+ range: 150,
+ relativePoints: [{
+ x: 0,
+ y: 0.5
+ }]
+ },
+ // enable inertial throwing
+ inertia: true,
+
+ restrict: {
+ endOnly: true,
+ elementRect: {
+ top: 0,
+ left: 0,
+ bottom: 0,
+ right: 0
+ }
+ },
+
+
+ // call this function on every dragmove event
+ onstart: function(event) {
+ if (event.button == 0 && !$("#" + event.target.id).hasClass('selected')) { //Makes anything you drag dashed
+ clearSelection();
+ selection.push(event.target.id);
+ $("#" + event.target.id).addClass('selected');
+ lastSelected = event.target.id;
+ }
+ calcChildren(event.target.id);
+ for (var i = 0; i < childrenIDs.length; i++) {
+ if (selection.indexOf(childrenIDs[i]) == -1) {
+ selection.push(childrenIDs[i]);
+ }
+ }
+
+
+ //Bring drag elements to the front
+ for (var i = 0; i < selection.length; i++) {
+ document.getElementById(selection[i]).style.zIndex = 9997;
+ if ($("#" + selection[i]).hasClass('hasNodes')) {
+ document.getElementById(selection[i]).style.zIndex = document.getElementById(
+ selection[i]).style.zIndex - 1;
+ }
+ }
+
+
+ //This may cause lag if there are an extremely large number of arrows
+ for (var i = 0; i < arrowArr.length; i++) {
+ determineLRNode(arrowArr[i][1], "arrow");
+ }
+ },
+ // call this function on every dragmove event
+ onmove: window.dragMoveListener,
+ // call this function on every dragend event
+ onend: function(event) {
+ for (var i = 0; i < selection.length; i++) {
+ try {
+ document.getElementById(selection[i]).style.zIndex = 9996;
+ if ($("#" + selection[i]).hasClass('hasNodes')) {
+ document.getElementById(selection[i]).style.zIndex = document.getElementById(
+ selection[i]).style.zIndex - 10;
+ }
+ calcParent(event.target.id);
+ } catch (err) {
+ continue;
+ }
+ }
+
+ //Shifts nodes to the right by running shiftRight on every node (first sorts the selections by x)
+ for (var k = selection.length - 1; k >= 0; k--) {
+ for (var m = 1; m <= k; m++) {
+ if (document.getElementById(selection[m - 1]).getAttribute("data_x") >
+ document.getElementById(selection[m]).getAttribute("data_x")) {
+ var swap = selection[m];
+ selection[m] = selection[m - 1];
+ selection[m - 1] = swap;
+ }
+ }
+ }
+ for (var i = 0; i < selection.length; i++) {
+ if (isOverlapped(selection[i]) == true) {
+ shiftRight(document.getElementById(selection[i]), 160);
+ }
+ }
+
+ }
+ })
+ .on('dragstart', function(event) {
+
+ })
+ .on('dragend', function(event) {
+
+ })
+ .on('dragmove', function(event) {
+
+ })
+
+//RESIZING
+.resizable({
+ edges: {
+ left: false,
+ right: false,
+ bottom: false,
+ top: false
+ }
+ })
+ .on('resizemove', function(event) {
+ var target = event.target,
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // update the element's style
+ target.style.width = event.rect.width + 'px';
+ target.style.height = event.rect.height + 'px';
+
+ // translate when resizing from top or left edges
+ x += event.deltaRect.left;
+ y += event.deltaRect.top;
+
+ target.style.webkitTransform = target.style.transform =
+ 'translate(' + x + 'px,' + y + 'px)';
+
+ target.setAttribute('data-x', x);
+ target.setAttribute('data-y', y);
+
+
+ });
+
+function clearSelection() {
+ for (var i = 0; i < selection.length; i++) {
+ $("#" + selection[i]).removeClass('selected')
+ }
+ selection.length = 0;
+}
+
+function getStartArrowDependants(nodeID) {
+ startArrowDependants.length = 0;
+ startArrowDependants = [];
+ for (var i = 0; i < arrowArr.length; i++) {
+ if (arrowArr[i][8] == nodeID) {
+ startArrowDependants.push(arrowArr[i][1]);
+ }
+ }
+}
+
+function getEndArrowDependants(nodeID) {
+ endArrowDependants.length = 0;
+ endArrowDependants = [];
+ for (var i = 0; i < arrowArr.length; i++) {
+ if (arrowArr[i][9] == nodeID) {
+ endArrowDependants.push(arrowArr[i][1]);
+ }
+ }
+}
+
+function moveSelection(dx, dy, draggedNodeID) {
+ for (var i = 0; i < selection.length; i++) {
+ if (selection[i] == draggedNodeID) {
+ continue;
+ }
+ selectionTarget = document.getElementById(selection[i]);
+ var x = (parseFloat(selectionTarget.getAttribute('data_x')) || 0);
+ var y = (parseFloat(selectionTarget.getAttribute('data_y')) || 0);
+
+ x += dx;
+ y += dy;
+ if ($('#' + selection[i]).css('display') != 'none') {
+ selectionTarget.style.webkitTransform =
+ selectionTarget.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+ } else {
+ draggedIndex = recallArray(nodeArr, draggedNodeID);
+ selectionTarget.style.webkitTransform =
+ selectionTarget.style.transform =
+ 'translate(' + document.getElementById(nodeArr[draggedIndex][1]).getAttribute(
+ 'data_x') + 'px, ' + document.getElementById(nodeArr[draggedIndex][1]).getAttribute(
+ 'data_y') + 'px)';
+
+ }
+ selectionTarget.setAttribute('data_x', x);
+ selectionTarget.setAttribute('data_y', y);
+
+ storeXY(nodeArr, selection[i]);
+
+ moveDependants(dx, dy, selection[i]);
+ if (isOverlapped(selection[i]) == true) {
+ document.getElementById(selection[i]).style.transition =
+ "background .5s ease";
+ document.getElementById(selection[i]).style.background =
+ "rgba(255,255,0,.40)"; //yellow
+ } else {
+ document.getElementById(selection[i]).style.background = "#29e"; //remove yellow
+ }
+ while (x > $("#grid").width() - $("#sideBar").width()) {
+ addWidth();
+ }
+ }
+}
+
+function moveDependants(dx, dy, nodeID) {
+ getStartArrowDependants(nodeID);
+ getEndArrowDependants(nodeID);
+ for (var i = 0; i < startArrowDependants.length; i++) {
+ var target = document.getElementById(startArrowDependants[i]);
+ for (var j = 0; j < arrowArr.length; j++) {
+ if (startArrowDependants[i] == arrowArr[j][1]) {
+ var arrowI = j;
+ }
+ }
+ if (arrowArr[arrowI][9] == null) {
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ continue;
+ }
+ if (target.getAttribute("direction") == "right") {
+ if ($("#" + target.id).width() + 12 - dx > 0) {
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ } else if ($("#" + target.id).width() + 12 - dx < 0) {
+ var newWide = Math.abs(parseFloat(target.style.width) + dx) - 12;
+ target.setAttribute("direction", "left");
+ makeArrow(target);
+ target.style.width = newWide + 'px';
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ } else if ($("#" + target.id).width() + 12 - dx == 0) {
+ target.style.width = '0px';
+ target.setAttribute("direction", "self");
+ makeArrow(target);
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ }
+ } else if (target.getAttribute("direction") == "left") {
+ if (-1 * ($("#" + target.id).width() + 12) - dx < 0) {
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ } else if (-1 * ($("#" + target.id).width() + 12) - dx > 0) {
+ var newWide = Math.abs(parseFloat(target.style.width) + dx);
+ target.setAttribute("direction", "right");
+ makeArrow(target);
+ target.style.width = newWide + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ } else if (-1 * ($("#" + target.id).width() + 12) - dx == 0) {
+ target.style.width = '0px';
+ target.setAttribute("direction", "self");
+ makeArrow(target);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ }
+ } else if (target.getAttribute("direction") == "self") {
+ if (dx > 0) {
+ target.setAttribute("direction", "left");
+ makeArrow(target);
+ target.style.width = dx - 12 + 'px';
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ } else if (dx < 0) {
+ target.setAttribute("direction", "right");
+ makeArrow(target);
+ target.style.width = Math.abs(dx) - 12 + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][8] = nodeID;
+ }
+ }
+ }
+
+
+ /////////
+
+ for (var i = 0; i < endArrowDependants.length; i++) {
+ var target = document.getElementById(endArrowDependants[i]);
+ if (target.getAttribute("direction") == "right") {
+ if ($("#" + target.id).width() + 12 + dx > 0) {
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ } else if ($("#" + target.id).width() + 12 + dx < 0) {
+ var newWide = Math.abs(parseFloat(target.style.width) + dx) - 12;
+ target.setAttribute("direction", "left");
+ makeArrow(target);
+ target.style.width = newWide + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ } else if ($("#" + target.id).width() + 12 + dx == 0) {
+ target.style.width = '0px';
+ target.setAttribute("direction", "self");
+ makeArrow(target);
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ }
+ } else if (target.getAttribute("direction") == "left") {
+ if (-1 * ($("#" + target.id).width() + 12) + dx < 0) {
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ } else if (-1 * ($("#" + target.id).width() + 12) + dx > 0) {
+ var newWide = Math.abs(parseFloat(target.style.width) + dx);
+ target.setAttribute("direction", "right");
+ makeArrow(target);
+ target.style.width = newWide + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ } else if (-1 * ($("#" + target.id).width() + 12) + dx == 0) {
+ target.style.width = '0px';
+ target.setAttribute("direction", "self");
+ makeArrow(target);
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ }
+ } else if (target.getAttribute("direction") == "self") {
+ if (dx > 0) {
+ target.setAttribute("direction", "right");
+ makeArrow(target);
+ target.style.width = dx - 12 + 'px';
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ } else if (dx < 0) {
+ target.setAttribute("direction", "left");
+ makeArrow(target);
+ target.style.width = Math.abs(dx) - 12 + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+
+ var index = storeXY(arrowArr, target.id);
+ arrowArr[index][9] = nodeID;
+ }
+ }
+ }
+}
+
+
+interact('.hasNodesHeader')
+ .on('tap', function(event) {
+ if (event.button == 0) {
+ clearSelection();
+ var mainNode = event.target;
+ if (mainNode.id == "") {
+ mainNode = event.target.parentNode;
+ }
+ var index = recallArray(nodeArr, mainNode.id);
+
+ if ($("#" + mainNode.id).hasClass("expanded")) {
+ calcChildren(mainNode.id);
+ var children = nodeArr[index][9];
+ for (var k = children.length - 1; k >= 0; k--) {
+ for (var m = 1; m <= k; m++) {
+ if (parseInt(document.getElementById(children[m - 1]).getAttribute(
+ "data_x")) > parseInt(document.getElementById(children[m]).getAttribute(
+ "data_x"))) {
+ var swap = children[m];
+ children[m] = children[m - 1];
+ children[m - 1] = swap;
+ }
+ }
+ }
+ for (var i = 0; i < children.length; i++) {
+ for (var z = 0; z < arrowArr.length; z++) {
+ determineLRNode(arrowArr[z][1], "arrow");
+ }
+ getStartArrowDependants(children[i]);
+ getEndArrowDependants(children[i]);
+ document.getElementById(children[i]).setAttribute('tempStartDep',
+ startArrowDependants);
+ document.getElementById(children[i]).setAttribute('tempEndDep',
+ endArrowDependants);
+ }
+ for (var i = 0; i < children.length; i++) {
+ document.getElementById(children[i]).setAttribute('xOffset', i);
+ //document.getElementById(children[i]).setAttribute('xOffset',parseInt(document.getElementById(children[i]).getAttribute('data_x')-x))
+ $("#" + children[i]).css('display', 'none');
+ getStartArrowDependants(children[i]);
+ getEndArrowDependants(children[i]);
+ //Collapse
+ var x = nodeArr[index][3];
+ var y = document.getElementById(children[i]).getAttribute('data_y');
+ document.getElementById(children[i]).style.webkitTransform = document.getElementById(
+ children[i]).style.transform =
+ 'translate(' + x + 'px,' + y + 'px)';
+ document.getElementById(children[i]).setAttribute('data_x', x);
+ document.getElementById(children[i]).setAttribute('data_y', y);
+ storeXY(nodeArr, children[i]);
+ for (var j = 0; j < startArrowDependants.length; j++) {
+ target = document.getElementById(startArrowDependants[j]);
+ for (var k = 0; k < arrowArr.length; k++) {
+ if (arrowArr[k][1] == target.id) {
+ var arrowIndex = k;
+ }
+ }
+ if (arrowArr[arrowIndex][3] >= nodeArr[index][3] && arrowArr[arrowIndex]
+ [6] <= nodeArr[index][6]) {
+ endArrowDependants.splice(endArrowDependants.indexOf(target.id), 1);
+ target.setAttribute('direction', 'self');
+
+ target.style.width = 0 + 'px';
+ // keep the dragged position in the data-x/data-y attributes
+ x = nodeArr[index][3] + 50;
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ makeArrow(arrowArr[arrowIndex][1]);
+ continue;
+ }
+ if (target.getAttribute('direction') == 'right') {
+ dx = i * 160;
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) - dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ }
+ if (target.getAttribute('direction') == 'left') {
+ dx = i * 160;
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ }
+ }
+ for (var j = 0; j < endArrowDependants.length; j++) {
+ target = document.getElementById(endArrowDependants[j]);
+ if (target.getAttribute('direction') == 'right') {
+ dx = i * 160;
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'left') {
+ dx = i * 160;
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) - dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ }
+ }
+ }
+ $("#" + mainNode.id).removeClass("expanded");
+ $("#" + mainNode.id).addClass("collapsed");
+
+ //REFORM NODE///////////////////////////////////////////////
+ var height = $("#" + mainNode.id).height();
+ var dy = 12;
+ var dx = 0;
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(mainNode.getAttribute('data_x'))) + 0,
+ y = (parseFloat(mainNode.getAttribute('data_y'))) + dy / 2;
+
+ // translate the element
+ mainNode.style.webkitTransform =
+ mainNode.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ mainNode.setAttribute('data_x', x);
+ mainNode.setAttribute('data_y', y);
+
+ $("#" + mainNode.id).width(100);
+ $("#" + mainNode.id).height(height - dy);
+ var nodeHeight = $("#" + mainNode.id).height();
+ nodeHeightCorrected = nodeHeight + 16;
+ var gridHeight = document.getElementById('grid').clientHeight;
+ gridHeightCorrected = gridHeight - 90;
+ recallArray(nodeArr, mainNode.id);
+ document.getElementById(mainNode.id).innerHTML =
+ '<div class="nodeText nodeEllipsis">' + text +
+ '</div><div class="verticalLine" style = "top:' + nodeHeightCorrected +
+ 'px;height:' + gridHeightCorrected +
+ 'px;"></div><div class="collapsedPlus">+</div>';
+ ////////////////////////////////////////////////////////////
+
+ shiftByDx(-160 * (children.length - 1), mainNode.id);
+ storeXY(nodeArr, mainNode.id);
+ }
+ }
+ });
+interact('.collapsedPlus')
+ .on('tap', function(event) {
+ if (event.button == 0) {
+ clearSelection();
+ var mainNode = event.target;
+ if (mainNode.id == "") {
+ mainNode = event.target.parentNode;
+ }
+ var index = recallArray(nodeArr, mainNode.id);
+ if ($("#" + mainNode.id).hasClass("collapsed")) {
+ clearSelection();
+ var children = nodeArr[index][9];
+ var selfStart = [];
+ var selfEnd = [];
+ shiftByDx(160 * (children.length - 1), mainNode.id);
+ for (var i = 0; i < children.length; i++) {
+ $("#" + children[i]).css('display', 'inline-block');
+ startArrowDependants = document.getElementById(children[i]).getAttribute(
+ 'tempStartDep');
+ endArrowDependants = document.getElementById(children[i]).getAttribute(
+ 'tempEndDep');
+ if (startArrowDependants.length != 0) startArrowDependants =
+ startArrowDependants.split(",");
+ if (endArrowDependants.length != 0) endArrowDependants =
+ endArrowDependants.split(",");
+ var nonConnectedArrows = []
+ for (var j = 0; j < arrowArr.length; j++) {
+ if (startArrowDependants.indexOf(arrowArr[j][1]) == -1 &&
+ endArrowDependants.indexOf(arrowArr[j][1]) == -1 && (children[i] ==
+ arrowArr[j][8] || children[i] == arrowArr[j][9] || arrowArr[j][8] ==
+ mainNode.id || arrowArr[j][9] == mainNode.id)) {
+ nonConnectedArrows.push(arrowArr[j][1])
+ }
+ }
+
+
+ //Restore
+ //var x = parseInt(document.getElementById(children[i]).getAttribute('data_x')) + parseInt(document.getElementById(children[i]).getAttribute('xOffset'));
+ var x = parseInt(document.getElementById(children[i]).getAttribute(
+ 'data_x')) + parseInt(document.getElementById(children[i]).getAttribute(
+ 'xOffset') * 160);
+ var y = document.getElementById(children[i]).getAttribute('data_y');
+ document.getElementById(children[i]).style.webkitTransform = document.getElementById(
+ children[i]).style.transform =
+ 'translate(' + x + 'px,' + y + 'px)';
+ document.getElementById(children[i]).setAttribute('data_x', x);
+ document.getElementById(children[i]).setAttribute('data_y', y);
+ storeXY(nodeArr, children[i]);
+ for (var j = 0; j < startArrowDependants.length; j++) {
+ target = document.getElementById(startArrowDependants[j]);
+ if (target.getAttribute('direction') == 'right') {
+ dx = document.getElementById(children[i]).getAttribute('xOffset') * 160;
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'left') {
+ dx = document.getElementById(children[i]).getAttribute('xOffset') * 160;
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'self') {
+ selfStart.push(target.id);
+ }
+ }
+ for (var j = 0; j < endArrowDependants.length; j++) {
+ target = document.getElementById(endArrowDependants[j]);
+ if (target.getAttribute('direction') == 'right') {
+ dx = document.getElementById(children[i]).getAttribute('xOffset') * 160;
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'left') {
+ dx = document.getElementById(children[i]).getAttribute('xOffset') * 160;
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'self') {
+ selfEnd.push(target.id);
+ }
+ }
+ for (var j = 0; j < nonConnectedArrows.length; j++) {
+ target = document.getElementById(nonConnectedArrows[j]);
+ if (target.getAttribute('direction') == 'right') {
+ dx = -52;
+ target.style.width = parseFloat(target.style.width) + dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ } else if (target.getAttribute('direction') == 'left') {
+ dx = -52
+ target.style.width = parseFloat(target.style.width) - dx + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ storeXY(arrowArr, target.id);
+ }
+ }
+ }
+ $("#" + mainNode.id).addClass("expanded");
+ $("#" + mainNode.id).removeClass("collapsed");
+ //REFORM NODE///////////////////////////////////////////////
+ var dy = 12;
+ var dx = 0;
+ var height = $("#" + mainNode.id).height();
+ var wide = $("#" + mainNode.id).width();
+
+ height += dy;
+ wide += dx;
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(mainNode.getAttribute('data_x'))) + 0,
+ y = (parseFloat(mainNode.getAttribute('data_y'))) - dy / 2;
+
+ // translate the element
+ mainNode.style.webkitTransform =
+ mainNode.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ mainNode.setAttribute('data_x', x);
+ mainNode.setAttribute('data_y', y);
+
+
+ $("#" + mainNode.id).height(height);
+ $("#" + mainNode.id).width(wide);
+
+ text = nodeArr[index][2];
+
+ nodeHeightCorrected = height + 16;
+ var gridHeight = document.getElementById('grid').clientHeight;
+ gridHeightCorrected = gridHeight - 90;
+ mainNode.innerHTML = '<div class="hasNodesHeader">' + text + '</div>' +
+ '<div class="hasNodesBackground" style="height:' + gridHeightCorrected +
+ 'px"></div>' +
+ '<div class="verticalLine" style = "margin-left:0px; top:' +
+ nodeHeightCorrected + 'px;height:' + gridHeightCorrected + 'px;"></div>';
+ ////////////////////////////////////////////////////////////
+
+ $("#" + mainNode.id).width(100 + 160 * (children.length - 1));
+ storeXY(nodeArr, mainNode.id);
+ for (var j = 0; j < selfStart.length; j++) {
+ target = document.getElementById(selfStart[j]);
+ for (var k = 0; k < nodeArr.length; k++) {
+ try {
+ if (document.getElementById(nodeArr[k][1]).getAttribute('tempstartdep')
+ .indexOf(selfStart[j]) != -1) {
+ var startX = nodeArr[k][3];
+ }
+ } catch (err) {};
+ try {
+ if (document.getElementById(nodeArr[k][1]).getAttribute('tempenddep').indexOf(
+ selfStart[j]) != -1) {
+ var endX = nodeArr[k][3];
+ }
+ } catch (err) {};
+ }
+ if (startX < endX) {
+ target.setAttribute('direction', 'right');
+ target.style.width = endX - startX - 12 + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = startX + 50;
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ makeArrow(target);
+ storeXY(arrowArr, target.id);
+ }
+ if (startX > endX) {
+ target.setAttribute('direction', 'left');
+ target.style.width = startX - endX - 12 + 'px';
+
+ // keep the dragged position in the data-x/data-y attributes
+ x = endX + 50;
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+ makeArrow(target);
+ storeXY(arrowArr, target.id);
+ }
+ }
+ }
+ }
+ });
+
+
+//BPMN on double click of node
+interact('.placed')
+ .on('doubletap', function(event) {
+ if (event.button == 0) {
+ target = event.target.id;
+ while (target == "") {
+ target = event.target.parentNode.id;
+ }
+ renameNode(target);
+ }
+ });
+
+function bpmnAction(target) {
+ if (target.id == "") target = target.parentNode;
+ var index = recallArray(nodeArr, target.id);
+ if (nodeArr[index][10] == null || nodeArr[index][10] == "") { //No diagram detected
+ bootbox.confirm({
+ size: 'small',
+ animate: false,
+ title: 'No BPMN Detected',
+ message: 'Please follow the following steps : <ol>' +
+ '<li>Go to <a href="bpmn.io/new">bpmn.io</a> and create a flow diagram</li>' +
+ '<li>Click the export button</li>' +
+ '<li>Find the file here: <input type="file" accept=".bpmn" name="xmlToLoad" id = "xmlToLoad"></li>' +
+ '<li>Click "OK" below</li>' +
+ '</ol>',
+ callback: function(result) {
+ if (result == true) {
+ uploadBPMN(index)
+ }
+ }
+ });
+ } else { //Diagram is present
+ //$('#'+event.target.parentNode.id).tooltipster('destroy');
+ //var displayCanvas = setInterval(function () {
+ bootbox.dialog({
+ size: 'large',
+ message: '<div id="canvas" style="height:600px;"></div><div style="margin-top:20px;">Upload Edits: <input type="file" accept=".bpmn" name="xmlToLoad" id = "xmlToLoad"><button style = "display:inline;" onclick="uploadBPMN(index);">Change</button><button style = "display:inline;" onclick="exportBPMN(index);">Export</button><button style = "display:inline;" onclick="removeBPMN(index);">Remove</button></div>',
+ animate: false,
+ callback: function(result) {
+ if (result == true) {
+
+ }
+ }
+ });
+ showBPMN(nodeArr[index][10])
+ // clearInterval(displayCanvas);
+ // },500);
+ }
+}
+
+function uploadBPMN(index) {
+ $('#' + nodeArr[index][1]).addClass('bpmn');
+ var file = document.getElementById("xmlToLoad").files[0];
+ //console.log(file);
+ var reader = new FileReader();
+ reader.onload = recievedText;
+ reader.readAsText(file);
+ bootbox.hideAll();
+
+ function recievedText() {
+ var textFromFileLoaded = reader.result;
+ console.log(textFromFileLoaded);
+ nodeArr[index][10] = textFromFileLoaded
+ bootbox.dialog({
+ size: 'large',
+ message: '<div style="text-align:center; margin-bottom:10px;"><b>' +
+ nodeArr[index][2] +
+ '</b></div><div id="canvas" style="height:600px;"></div><div style="margin-top:20px;">Upload Edits: <input type="file" accept=".bpmn" name="xmlToLoad" id = "xmlToLoad"><button style = "display:inline;" onclick="uploadBPMN(index);">Change</button><button style = "display:inline;" onclick="exportBPMN(index);">Export</button><button style = "display:inline;" onclick="removeBPMN(index);">Remove</button></div>',
+ animate: false,
+ callback: function(result) {
+ if (result == true) {
+
+ }
+ }
+ });
+ showBPMN(nodeArr[index][10]);
+ }
+}
+
+function removeBPMN(index) {
+ nodeArr[index][10] = null;
+ bootbox.hideAll();
+}
+
+function exportBPMN(index) {
+ var textToWrite = nodeArr[index][10];
+ var blob = new Blob([textToWrite], {
+ type: "text/plain;charset=utf-8"
+ });
+
+ var downloadLink = document.createElement("a");
+
+ downloadLink.download = nodeArr[index][2] + '.bpmn';
+ downloadLink.innerHTML = "Download File";
+ downloadLink.href = window.webkitURL.createObjectURL(blob);
+ downloadLink.click();
+}
+
+/* TOOLTIPS
+$(document).on("mouseenter", '.bpmn',function(event){
+ index = recallArray(nodeArr,event.target.id);
+ $('#'+event.target.id).tooltipster({
+ minWidth:200,
+ position:'top',
+ theme: 'tooltipster-shadow',
+ interactive:false,
+ delay:500,
+ multiple:false,
+ trigger:'hover',
+ contentAsHTML:true,
+ functionReady: function (o,t){
+ showBPMN(nodeArr[index][10]);
+ },
+ content: '<div id="canvas" style="height:600px;"></div>'
+ });
+
+
+})
+$(document).on("mouseleave", '.bpmn',function(event){
+ $('#'+event.target.id).tooltipster('hide');
+})
+*/
+
+function renameNode(uuid) {
+ var index = recallArray(nodeArr, uuid);
+ var toscaId = document.getElementById(nodeArr[index][1]).getAttribute("taska_id");
+ var serviceName = document.getElementById(nodeArr[index][1]).getAttribute("sname");
+ var role_id = document.getElementById(nodeArr[index][1]).getAttribute("role_id");
+
+ bootbox.confirm({
+ closeButton: false,
+ backdrop: true,
+ animate: false,
+ size: 'small',
+ title: "Modify Element " + serviceName,
+ onEscape: function() {},
+ message: '<div style="color:grey;font-size:12px;"><br>Role : <input id="rolefield" style="width:100%;" type="text" placeholder="Add role for network element" value="'+role_id+'"></div>',
+ callback: function(result) {
+ if (result == true) {
+ //EXECUTE THIS ON OKAY///
+ var innerText = serviceName;
+ document.getElementById(nodeArr[index][1]).setAttribute("role_id",$("#rolefield").val());
+ //document.getElementById(nodeArr[index][1]).setAttribute("toscaid", toscaID);
+ pushToDict(innerText, "node");
+ storeText(nodeArr, uuid, innerText);
+ var nodeHeight = $("#" + uuid).height();
+ nodeHeightCorrected = nodeHeight + 16;
+ var gridHeight = document.getElementById('grid').clientHeight;
+ gridHeightCorrected = gridHeight - 90;
+ // Not sure whate below is for? Need to investigate
+ if ($("#" + uuid).hasClass("expanded") == true) {
+ document.getElementById(uuid).innerHTML =
+ '<div class="hasNodesHeader">' + innerText + '</div>' +
+ '<div class="hasNodesBackground" style="height:' + gridHeightCorrected +
+ 'px"></div>' +
+ '<div class="verticalLine" style = "margin-left:0px; top:' +
+ nodeHeightCorrected + 'px;height:' + gridHeightCorrected +
+ 'px;"></div>';
+ } else if ($("#" + uuid).hasClass("collapsed") == true) {
+ document.getElementById(uuid).innerHTML =
+ '<div class="nodeText nodeEllipsis">' + innerText +
+ '</div><div class="verticalLine" style = "top:' + nodeHeightCorrected +
+ 'px;height:' + gridHeightCorrected +
+ 'px;"></div><div class="collapsedPlus">+</div>';
+ } else {
+ document.getElementById(uuid).innerHTML =
+ '<div class="nodeText nodeEllipsis">' + innerText +
+ '</div><div class="verticalLine" style = "top:' + nodeHeightCorrected +
+ 'px;height:' + gridHeightCorrected + 'px;"></div>';
+ }
+ clearSelection();
+ }
+ }
+ });
+
+ /* Removed #nodeInnerText Code as it is no longer needed */
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/notes.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/notes.js
new file mode 100644
index 0000000..23d3704
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/notes.js
@@ -0,0 +1,152 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+// Contains methods to drag, copy, resize notes
+
+var noteArr = []; //Node array stored as [tag, uuid]
+
+interact('.postit')
+ //CLONING
+ .on('move',function (event){
+ var interaction = event.interaction;
+
+ $ ("arrowDropzone").addClass("drop-target");
+ // if the pointer was moved while being held down
+ // and an interaction hasn't started yet
+ if (interaction.pointerIsDown && !interaction.interacting() && !$(event.currentTarget).hasClass("child")) {
+ var original = event.currentTarget;
+ // create a clone of the currentTarget element
+
+ var dropOffLocation = document.getElementById("noteChildrenDroppedOffHere");
+ uuid = guid();
+ dropOffLocation.innerHTML+='<div id="' + uuid + '" class="postit note child gridDropzone"></div>'
+ clone = document.getElementById(uuid);
+
+ // translate the element
+ clone.style.webkitTransform = clone.style.transform = 'translate(' + 0 + $(document).scrollLeft() + 'px, ' + 215 + $(document).scrollTop() + 'px)';
+
+ // update the position attributes
+ clone.setAttribute('data_x', 0 + $(document).scrollLeft());
+ clone.setAttribute('data_y', 218 + $(document).scrollTop());
+
+
+ noteArr.push([clone,uuid]);
+
+ // start a drag interaction targeting the clone
+ interaction.start({ name: 'drag' },
+ event.interactable,
+ clone);
+ }
+ })
+
+ //DRAGGING
+ .draggable({
+ snap: {
+ targets: [ // give this function the x and y page coords
+ // and snap to the object returned
+ interact.createSnapGrid({
+ x:100,
+ y:42
+ })
+ ],
+ offset:{x:0,y:-5},
+ range:Infinity,
+ relativePoints: [ { x: 0, y: 0 } ],
+ endOnly: true
+ },
+ // enable inertial throwing
+ inertia: true,
+
+ restrict: {
+ endOnly: true,
+ elementRect: { top: 0, left: 0, bottom: 0, right: 0 }
+ },
+
+ // call this function on every dragmove event
+ onmove: window.dragMoveListenerArrow,
+ // call this function on every dragend event
+ onend: function (event) {
+
+ }
+ })
+ .on('dragmove', function (event) {
+
+ })
+
+ //RESIZING
+ .resizable({
+ edges: { left: true, right: true, bottom: true, top: true },
+ snap: {
+ targets: [
+ interact.createSnapGrid({
+ x:100,
+ y:42
+ })
+ ],
+ offset:{x:0,y:0},
+ range:Infinity,
+ relativePoints: [ { x: -5, y: 23 } ],
+ endOnly: true
+ }
+ })
+ .on('resizemove', function (event) {
+ var target = event.target,
+ x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // update the element's style
+ target.style.width = event.rect.width + 'px';
+ target.style.height = event.rect.height + 'px';
+
+ // translate when resizing from top or left edges
+ x += event.deltaRect.left;
+ y += event.deltaRect.top;
+
+ target.style.webkitTransform = target.style.transform =
+ 'translate(' + x + 'px,' + y + 'px)';
+
+ target.setAttribute('data-x', x);
+ target.setAttribute('data-y', y);
+
+ storeXY(noteArr,event.target.id);
+})
+;
+
+interact('.notePlaced')
+.on('doubletap',function (event){
+ var uuid = event.target.id;
+ recallArray(noteArr, uuid);
+ event.preventDefault();
+ bootbox.prompt({
+ closeButton:false,backdrop:true,animate:false,
+ size:'small',
+ title: "Change Note Text",
+ value:text,
+ placeholder: "add text here",
+ callback: function(result) {
+ if (result != null) {
+ //EXECUTE THIS ON OKAY///
+ innerText = result;
+ pushToDict(innerText, "note");
+ storeText(noteArr,uuid,innerText);
+ event.target.innerHTML = innerText;
+ /////////////////////////
+ }
+ }
+ });
+ $("#box").autocomplete({
+ source: noteTags,
+ autoFocus: true,
+ delay: 0
+ });
+}); \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/printpdf.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/printpdf.js
new file mode 100644
index 0000000..a60e850
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/printpdf.js
@@ -0,0 +1,519 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains functions to export editor data to a pdf
+
+function printDiagram(){
+
+ var now = new Date;
+ var utc_timestamp = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(), now.getUTCDate() ,
+ now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
+
+ ///these figures come from the current drawing
+ //var grid_pitch = 42;
+ var grid_start_y = 60;
+
+ doubleLineNumbers.length=0;
+ doubleLineText.length=0;
+ var doubleElements = document.getElementsByClassName("doubleLine");
+ $.each(doubleElements,function(index, value){
+ doubleLineNumbers.push(($(value).attr('id')).substring(3));
+ doubleLineText.push(value.children[0].innerHTML);
+ });
+
+ //alert('Saving To File -- click OK');
+ m = "";
+ m += '{ "diagram": \n';
+ m += '{ "created": "' + utc_timestamp + '",\n';
+ m += '"rows": "' + rows + '",\n';
+ m += '"cols": "' + cols + '",\n';
+ m += '"description": "' + description + '",\n';
+ m += '"gridPitchy": "' + gridPitchy + '",\n';
+ m += '"canvasHeight": "' + $("#grid").height() + '",\n';
+ m += '"canvasWidth": "' + $("#grid").width() + '",\n';
+ m += '"encoding": "base64",\n';
+ m += '"elements": {"nodes": [\n';
+ nodeArr.forEach(saveNodeArrayElements);
+ m += '],\n "arrows": [\n';
+ arrowArr.forEach(saveArrowArrayElements);
+ m += '],\n "notes": [\n';
+ noteArr.forEach(saveNoteArrayElements);
+ m += '],\n "separators": [\n';
+ doubleLineNumbers.forEach(saveSeparatorArrayElements);
+ m += ']}}}';
+
+
+ var n = JSON.parse(m);
+ //console.log(n);
+ //console.log(n.diagram.created);
+ m = decodeJSON(m);
+ //alert(m);
+
+ outputPDF(m);
+
+
+}
+
+function outputPDF(c) {
+
+ var c;
+ //alert(c);
+ var n = JSON.parse(c);
+ var doc = new jsPDF("landscape");
+ var borderwidth=10;
+
+ //for landscape
+ var pdf_paper_xmax = 297;
+ var pdf_paper_ymax = 210;
+
+ var mystring = n.diagram.created;
+ var creationTime = n.diagram.created;
+ var description = n.diagram.description;
+ var canvasHeight = n.diagram.canvasHeight;
+ var canvasWidth = n.diagram.canvasWidth;
+ var rows = n.diagram.rows;
+ var cols = n.diagram.cols;
+ var elementList = n.diagram.elements;
+ //I dont think these are needed. I omitted them for testing and printPDF did not fail
+ //var oneNode = n.diagram.elements.nodes[0].id;
+ //var oneArrow = n.diagram.elements.arrows[0].id;
+
+ var lineSpacing = 5;
+ var linePosition = lineSpacing;
+
+ var pdf_x_scale = pdf_paper_xmax / canvasWidth ; //this converts from canvasWidth to paper coords.
+ var pdf_y_scale = (pdf_paper_ymax) / (canvasHeight );
+
+
+ var title = 'Creation time: '+ n.diagram.created ;
+ var title = 'Description: '+ n.diagram.description;
+ //title += ' rows=' + rows;
+ //title += ' cols=' + cols;
+ //title += ' canvasHeight=' + canvasHeight;
+ //title += ' canvasWidth=' + canvasWidth;
+ //title += ' pdf_x_scale=' + pdf_x_scale;
+ //title += ' pdf_y_scale=' + pdf_y_scale;
+
+ doc.setFontSize(10);
+ doc.text((pdf_paper_xmax/2)-(title.length/2), 10, title);
+
+ drawgrid(doc,n.diagram.elements.separators)
+
+ var allNodes = n.diagram.elements.nodes;
+ DrawNodes(allNodes);
+
+
+ var allArrows = n.diagram.elements.arrows;
+ DrawArrows(allArrows);
+
+
+ // Output as Data URI
+ doc.output('dataurlnewwindow');
+
+
+function drawborder(doc,max_x,max_y){
+ var doc;
+ var max_x;
+ var max_y;
+ doc.setDrawColor(255,0,0);
+ doc.setFillColor(0,0,0);
+ var borderwidth = 10;
+ doc.rect(borderwidth, borderwidth, max_x - (2*borderwidth), max_y - (2*borderwidth), 'F'); // filled red square
+
+ //doc.setDrawColor(255,0,0); // draw red lines
+ doc.setLineWidth(1);
+ doc.line(borderwidth, borderwidth, max_x-borderwidth,borderwidth ); // horz topline
+ doc.line(max_x-borderwidth, borderwidth, max_x-borderwidth,max_y-borderwidth ); // right hand border
+ doc.line(max_x-borderwidth, max_y-borderwidth, borderwidth,max_y-borderwidth ); // bottom border
+ doc.line(borderwidth,max_y-borderwidth,borderwidth,borderwidth ); // lefthand border
+
+
+}
+
+function drawgrid(doc,separators){
+ console.log(separators);
+ var rowsToMakeDouble=[]
+ $.each(separators,function(index, value){
+ rowsToMakeDouble.push(value.lineNumber);
+ });
+
+ var doc;
+ //var grid_pitch = 42;
+ var grid_start_y = 60;
+
+
+ doc.setFontSize(10);
+
+ //var max_x;
+ //var max_y;
+ doc.setDrawColor(255,0,0);
+ doc.setFillColor(0,0,0);
+ var borderwidth = 10;
+
+ doc.setDrawColor(255,0,0); // draw red lines
+ doc.setLineWidth(1);
+
+ var xleftpos = 10;
+ var yleftpos = 15;
+ //var linepitch = 10;
+ var lifeline_linepitch = (pdf_paper_xmax - (2*borderwidth))/ cols;
+
+ //for the horizontal lines, we give two borderwidth at top and one at bottom for the drawing area
+ var horz_gridpitch = Math.round(pdf_y_scale*gridPitchy);
+
+ for (i = 1; i <= rows; i++) { //for each row, draw a dotted line horizontally across
+ xleftpos = borderwidth;
+ yleftpos = (2*borderwidth) + (i*horz_gridpitch ) ;
+ doc.setFontSize(10);
+ doc.setLineWidth(0.01);
+ doc.text(xleftpos, yleftpos, i.toString());
+ //If there are no separators || the current row is not a separator : print dotted line. Else double line
+ if (rowsToMakeDouble==null || rowsToMakeDouble.indexOf(i.toString())==-1){
+ dottedline(doc, xleftpos, yleftpos-1, cols*lifeline_linepitch, yleftpos-1); // horz topline
+ }
+ else {
+ doubleline(doc, xleftpos, yleftpos-1, cols*lifeline_linepitch, yleftpos-1,separators[rowsToMakeDouble.indexOf(i.toString())].text); // horz topline
+ }
+ }
+ //doc.line(borderwidth, borderwidth, max_x-borderwidth,borderwidth ); // horz topline
+ //doc.line(max_x-borderwidth, borderwidth, max_x-borderwidth,max_y-borderwidth ); // right hand border
+ //doc.line(max_x-borderwidth, max_y-borderwidth, borderwidth,max_y-borderwidth ); // bottom border
+ //doc.line(borderwidth,max_y-borderwidth,borderwidth,borderwidth ); // lefthand border
+
+ //for debugging
+ //var title="hello";
+ //title += " =" + numlines;
+ //doc.text((pdf_paper_xmax/2)-(title.length/2), 20, title);
+
+}
+
+function dottedline(doc,x1,y1,x2,y2){
+ doc.setDrawColor(0,0,0); // draw blacklines
+
+ var doc;
+ var x1;
+ var x2;
+ var y1;
+ var y2;
+ var delta_y;
+ var delta_x;
+ var pitch;
+ var ticklength;
+ var j;
+ var k;
+ var fromx;
+ var fromy;
+ var tox;
+ var toy;
+ delta_x = (x2 - x1)/200;
+ delta_y = (y2 - y1)/200;
+
+ fromx = x1 ;
+ fromy = y1 ;
+ tox = fromx + (delta_x);
+ toy = fromy + (delta_y);
+
+ for(j = 1; j<= 200; j++){
+ tox = tox + delta_x;
+ toy = toy + delta_y;
+
+ if(j%2==0 ){
+ doc.line(fromx,fromy,tox,toy ); // draw tick line
+ }
+
+ fromx = tox;
+ fromy = toy;
+
+ }
+}
+
+function doubleline(doc,x1,y1,x2,y2,text){
+ doc.setLineWidth(.3); //bolder lines
+ //x values are transposed as to not interfere with the numbers on the left
+ doc.line(x1+3,y1,x2+2,y2);
+ doc.line(x1+3,y1+1,x2+2,y2+1); //shifts second line one unit down
+ //console.log(text);
+ doc.setFontStyle("italic");
+ doc.text(text,x1+x2/2,y1-1);
+ doc.setFontStyle("normal");
+}
+
+
+function DrawNodes(allNodes){
+ console.log(n.diagram.elements);
+ //console.log(document);
+ //for landscape
+
+ var lifeline_linepitch = (pdf_paper_xmax - (2*borderwidth))/ cols;
+ var horz_gridpitch = (pdf_paper_ymax - 3*(borderwidth)) / rows;
+
+ for (var i in allNodes ){
+ xpos = (allNodes[i].data_x * pdf_x_scale) ;
+ doc.text(xpos - ( (allNodes[i].innerText.length)/1.5), 20, allNodes[i].innerText);
+ //xpos = allNodes[i].data_x*pdf_x_scale + (allNodes[i].innerText.length/2) ;
+ doc.line(xpos, 20, xpos, pdf_paper_ymax-borderwidth); // vert line
+ }
+ //console.log(allNodes);
+}
+
+
+function DrawArrows(allArrows){
+ var xpos;
+ var ypos;
+ //var grid_pitch = 42;
+ var grid_start_y = 60;
+ var horz_gridpitch = Math.round(pdf_y_scale*gridPitchy);
+
+ var delta = Math.round(horz_gridpitch/3);
+ //var title="hello! ";
+ //title += " pdf_x_scale=" + pdf_x_scale;
+ //title += " pdf_y_scale=" + pdf_y_scale;
+ //title += "arrow count =" + allArrows.length;
+ //doc.text((pdf_paper_xmax/2)-(title.length/2), 15, title);
+
+ for (var j in allArrows){
+ var fromNode = document.getElementById(allArrows[j].fromNodeID);
+ var fromArrow = findObjectWithId(allNodes,fromNode.id);
+ var fromArrowx = Math.round(fromArrow.data_x * pdf_x_scale) ;
+ var fromArrowy = (allArrows[j].data_y * pdf_y_scale) ;
+
+ var toNode = document.getElementById(allArrows[j].toNodeID);
+ var toArrow = findObjectWithId(allNodes,toNode.id);
+ var toArrowx = Math.round(toArrow.data_x*pdf_x_scale) ;
+ //var toArrowy = (allArrows[j].data_y*pdf_y_scale) ;
+ //var toArrowy = ((Math.round(allArrows[j].data_y-60)/42)) * Math.round((pdf_paper_ymax-30)/rows)) +20;
+ var rowindex = Math.round( allArrows[j].data_y-grid_start_y) /gridPitchy;
+ var toArrowy = 20 + (rowindex * horz_gridpitch) - 2;
+
+ fromArrowy = toArrowy;
+ var mytext;
+
+ mytext = allArrows[j].innerText;
+ //mytext += " From Node ID " + fromArrow.id;
+ //mytext += " From Node data_x=" + fromArrowx;
+ //mytext += " rows= " + rows;
+ //mytext += " cols= " + cols;
+ //mytext += " pdf_paper_ymax= " + pdf_paper_ymax;
+ //mytext += " canvasHeight= " + canvasHeight;
+ //mytext += " Raw data_y= " + allArrows[j].data_y;
+ //mytext += " From Node data_y= " + fromArrowy;
+ //mytext += " pdf_y_scale= " + pdf_y_scale;
+
+ //mytext += " From Node ID " + fromArrow.id;
+ //mytext += " To Node ID " + toArrow.id;
+ //mytext += " To Node data_x=" + toArrowx;
+ //mytext += " To Node data_y=" + toArrowy;
+
+
+ if(fromArrow.id != toArrow.id) {
+ //fromArrowy = 20*j + 40;
+ var textx = fromArrowx + (toArrowx - fromArrowx)/2 - (mytext.length/2);
+ doc.text(textx , fromArrowy-1, mytext);
+ doc.setLineWidth(0.7);
+ doc.line(fromArrowx, fromArrowy+1, toArrowx, fromArrowy+1); // draw arrow
+ if(fromArrowx < toArrowx){
+ drawRightArrow(toArrowx,fromArrowy+1); // draw arrow
+ }else{
+ drawLeftArrow(toArrowx,fromArrowy+1); // draw arrow
+ }
+ }else{ //special case of self loop back
+ var textx = fromArrowx + (3*delta);
+ doc.text(textx , fromArrowy, mytext );
+ doc.setLineWidth(0.7);
+ doc.line(fromArrowx, fromArrowy-delta, fromArrowx+(2*delta), fromArrowy-delta ); // loop back brackets the same coords top line
+ doc.line(fromArrowx+(2*delta), fromArrowy-delta, fromArrowx+(2*delta), fromArrowy+delta ); // loop back brackets the same coords right hand loop
+ doc.line(fromArrowx+(2*delta), fromArrowy+delta, fromArrowx, fromArrowy+delta ); // loop back brackets the same coords bottom line
+ drawLeftArrow(fromArrowx,fromArrowy+delta); // draw arrow
+ }
+ }
+ //for debugging
+
+}
+
+function findObjectWithId(thing,id){
+ var thing;
+ var id;
+ for(var k in thing){
+ if(thing[k].id==id){
+ return(thing[k]);
+ }
+ }
+
+}
+
+function drawRightArrow(x,y){
+ doc.setLineWidth(.7);
+ var px0 = x;
+ var py0 = y;
+ var px1 = px0 -3;
+ var py1 = py0 -2;
+ var px2 = px0 -3;
+ var py2 = py0 +2;
+ var centerx = (px0 + px1)/2.0;
+ var centery = (py1 + py2)/2.0;
+
+ //basic big triangle
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.8;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.5;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.3;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+}
+function drawLeftArrow(x,y){
+
+
+ doc.setLineWidth(.7);
+ var px0 = x;
+ var py0 = y;
+ var px1 = px0 +3;
+ var py1 = py0 -2;
+ var px2 = px0 +3;
+ var py2 = py0 +2;
+ var centerx = (px0 + px1)/2.0;
+ var centery = (py1 + py2)/2.0;
+
+ //basic big triangle
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.8;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.5;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //smaller triangle within big triangle
+ var scale = 0.3;
+ px0 = px0 * scale;
+ px1 = px1 * scale;
+ px2 = px2 * scale;
+ py0 = py0 * scale;
+ py1 = py1 * scale;
+ py2 = py2 * scale;
+ var deltax = centerx - ((px1 + px0)/2.0) ;
+ var deltay = centery - ((py1 + py2)/2.0);
+ px0 = px0 + deltax;
+ px1 = px1 + deltax;
+ px2 = px2 + deltax;
+ py0 = py0 + deltay;
+ py1 = py1 + deltay;
+ py2 = py2 + deltay;
+ doc.line(px0, py0, px1, py1);
+ doc.line(px1, py1, px2, py2);
+ doc.line(px2, py2, px0, py0);
+
+ //doc.setLineWidth(.75);
+ //doc.line(x+3, y-2, x+3, y+2); // draw arrow //left bar
+ //doc.line(x+2.8, y-1.3, x+2.8, y+1.3); // draw arrow //left bar
+ //doc.line(x+2.5, y-1, x+2.5, y+1); // draw arrow //left bar
+ //doc.line(x+2, y-1, x+2, y+1); // draw arrow //left bar
+ //doc.line(x, y, x+3, y+2); // draw arrow //lower triangle
+ //doc.line(x, y, x+3, y-2); // draw arrow //upper triangle
+
+}
+
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/resizable.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/resizable.js
new file mode 100644
index 0000000..443c63c
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/resizable.js
@@ -0,0 +1,159 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Contains functions for making and resizing arrows
+
+interact('.resizable')
+.resizable({
+
+ snap: {
+ targets: [ interact.createLifelineSnapGrid( ) ],
+ relativePoints: [ { x: 0, y: 0 } ],
+ range: Infinity,
+ endOnly: true //CREATES SMOOTH SNAP
+ },
+ edges: { left: true, right: true, bottom: false, top: false },
+ invert: 'reposition'
+
+})
+.on('resizemove', function (event) {
+ var target = event.target;
+ if (target.id=="") target = event.target.parentNode;
+ var x = (parseFloat(target.getAttribute('data_x')) || 0),
+ y = (parseFloat(target.getAttribute('data_y')) || 0);
+
+ // update the element's style
+ if (window.resized == false){
+ target.style.width = event.rect.width + 'px';
+
+
+ target.style.height = event.rect.height + 'px';
+
+ // translate when resizing from top or left edges
+ x += event.deltaRect.left;
+ y += event.deltaRect.top;
+
+ target.style.webkitTransform = target.style.transform =
+ 'translate(' + x + 'px,' + y + 'px)';
+
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+ }
+ uuid = target.id;
+ if (uuid==""){
+ uuid = target.parentElement.id;
+ }
+
+
+ var index = storeXY(arrowArr,uuid);
+ window.currentArrow = arrowArr[index][1];
+ window.leftX = arrowArr[index][3];
+ window.rightX = arrowArr[index][6];
+ window.currentY = y;
+
+ window.resized = false;
+ var endingLeftX = event.target.getAttribute("data_x");
+ var endingRightX = parseInt(event.target.getAttribute("data_x")) + parseInt($("#"+target.id).width());
+
+ if ($("#"+event.target.id).width() == 0){
+ target.setAttribute("direction","self");
+ makeArrow(target);
+ }
+ if (target.getAttribute("direction") == "self"){
+ if (endingRightX>startingLeftX){ //Not negative case
+ target.setAttribute("direction","right");
+ makeArrow(target);
+ }
+ else if (endingLeftX<startingLeftX){ //Negative case: swap
+ startingRightX = startingLeftX;
+ target.setAttribute("direction","left");
+ makeArrow(target);
+ }
+ else if (endingLeftX==endingRightX){
+ target.setAttribute("direction","self");
+ makeArrow(target);
+ }
+ }
+ else if (target.getAttribute("direction") == "right"){
+
+ if (endingLeftX<startingLeftX && $('#'+target.id).width()<25){ //Negative case: swap
+ startingRightX = startingLeftX;
+ target.setAttribute("direction","left");
+ makeArrow(target);
+ }
+ else if (endingLeftX==endingRightX){
+ target.setAttribute("direction","self");
+ makeArrow(target);
+ }
+
+ }
+ else if (target.getAttribute("direction") == "left"){
+
+ if (endingRightX>startingRightX && $('#'+target.id).width()<25){
+ startingLeftX = startingRightX;
+ target.setAttribute("direction","right");
+ makeArrow(target);
+ }
+ else if (endingLeftX==endingRightX){
+ target.setAttribute("direction","self");
+ makeArrow(target);
+ }
+ }
+ storeXY(arrowArr,uuid);
+ determineLRNode(uuid,"arrow"); //move to resizeend api if lagging
+
+
+})
+.on('resizestart', function(event){
+ startingLeftX = event.target.getAttribute("data_x");
+ startingRightX = parseInt(event.target.getAttribute("data_x")) + parseInt($("#"+event.target.id).width());
+ startWidth = parseInt($("#"+event.target.id).width());
+})
+.on('resizeend', function(event){
+ if ($("#"+event.target.id).width() == 0){
+ event.target.setAttribute("direction","self");
+ makeArrow(event.target);
+ }
+ var target = event.target
+ if (target.id=="") target = event.target.parentNode;
+ determineLRNode(target.id,"arrow");
+});
+
+function makeArrow(target){
+ try{
+ recallArray(arrowArr, target.id);
+ if (target.getAttribute("direction") == "right"){
+ target.innerHTML = '<div class="arrow" style="display:inline; width:100%"><div class="makeEllipsis arrowText">'+text+'</div></div><div class="triangle" style="display:inline;"></div>'
+ }
+ else if (target.getAttribute("direction") == "left"){
+ target.innerHTML = '<div class="leftTriangle" style="display:inline;"></div><div class="leftArrow" style="display:inline; width:100%;"><div class="makeEllipsis arrowText">'+text+'</div></div>'
+ }
+ else if (target.getAttribute("direction") == "self"){
+ target.innerHTML = '<div style="display:inline; width:100%"><img src="../images/selfArrow.png" style = "cursor:e-resize;"><div class="makeEllipsisSelf arrowText" style="width:75px;font-size:12px;margin-left:3px;text-align:left;display:inline">'+text+'</div></div>'
+ }
+ }
+ catch(err){
+ var uuid = target
+ var target = document.getElementById(target);
+ recallArray(arrowArr, uuid);
+ if (target.getAttribute("direction") == "right"){
+ target.innerHTML = '<div class="arrow" style="display:inline; width:100%"><div class="makeEllipsis arrowText">'+text+'</div></div><div class="triangle" style="display:inline;"></div>'
+ }
+ else if (target.getAttribute("direction") == "left"){
+ target.innerHTML = '<div class="leftTriangle" style="display:inline;"></div><div class="leftArrow" style="display:inline; width:100%;"><div class="makeEllipsis arrowText">'+text+'</div></div>'
+ }
+ else if (target.getAttribute("direction") == "self"){
+ target.innerHTML = '<div style="display:inline; width:100%"><img src="../images/selfArrow.png" style = "cursor:e-resize;"><div class="makeEllipsisSelf arrowText" style="width:75px;font-size:12px;margin-left:3px;text-align:left;display:inline">'+text+'</div></div>'
+ }
+ }
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/scroll.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/scroll.js
new file mode 100644
index 0000000..5653ccf
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/scroll.js
@@ -0,0 +1,77 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Called when the user scrolls. Adjusts transparencies and keeps the nodes on the page at all times
+
+function scroll () {
+
+ var scrollY = $(document).scrollTop();
+ var scrollX = $(document).scrollLeft();
+
+ $("#numbers").css("margin-top", 0-scrollY);
+
+ if(scrollX != 0 ) {
+ if (scrollX<=80){
+ $( "#numbers" ).css('opacity', 1- 0.01 * (scrollX));
+ }
+ else {
+ $( "#numbers" ).css('opacity', '.2');
+ }
+ }
+ else {
+ $( "#numbers" ).css('opacity', '1');
+ }
+
+ var busy = false;
+ if (scrollY > 50 ){
+ if(busy)
+ return;
+ busy = true;
+
+ //Scrolls Nodes down the page
+ $(".verticallyScrollable").css("margin-top", -50+scrollY);
+
+ //Fades nodes as T->B
+ if (scrollY<=120){
+ $( ".verticallyScrollable" ).css('opacity', 1- 0.01 * (scrollY-50));
+ }
+ else {
+ $( ".verticallyScrollable" ).css('opacity', '.3');
+ }
+ //console.log(scrollY);
+ $(".verticalLine").css("top", 102-scrollY);
+
+ busy = false;
+ }
+ else{
+ $( ".verticallyScrollable" ).css('opacity', 1);
+ }
+
+ //Fades numbers as L->R
+ if(scrollX != 0 ) {
+
+ if (scrollX<=80){
+ $( "#numbers" ).css('opacity', 1- 0.01 * (scrollX));
+ }
+ else {
+ $( "#numbers" ).css('opacity', '.2');
+ }
+ }
+ else {
+ $( "#numbers" ).css('opacity', '1');
+ }
+ if (scrollY == 0) {
+ $(".verticallyScrollable").css("margin-top", 0);
+ $(".verticalLine").css("top", 52);
+ }
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/services.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/services.js
new file mode 100644
index 0000000..6abcc98
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/services.js
@@ -0,0 +1,86 @@
+/* ---------------------------------------------------------------------------------------------- */
+/*
+* This file is a work in progress, update this section when complete to give a better description.
+* Currently the functions here work with the services and will work with getting the information
+* from the AJAX Call which will provide JSON/YMAL object of the information required to build the service
+* selection.
+*
+*
+*/
+
+/*
+* This Function currently builds the table for the accordian.
+* when complete this will create the complete section of how
+* a Domain, Serrvice and UE are selected from the ASE tool.
+*
+*/
+var domains = [];
+var elements = [];
+var networkMap =[];
+var isFirstRun = true;
+var defaultDomain = "RAN";
+var defaultElement = "com.ecomp.trinity.ran.enodeb";
+
+
+function buildNetworkMap() {
+
+
+ $.get(ase.elementsFile, {
+ //$.post('http://demeter.homer.ecomp.com:50180/d2sim/ase.htm?action=element', {
+ //$.post('ase.htm?action=element', {
+ }, function(data) {
+ var yamlObject = jsyaml.load(data);
+ networkMap = yamlObject.elementsList;
+ buildDomain(networkMap);
+ });
+
+
+}
+
+
+function buildDomain(networkMap){
+ if ( domains.length == 0 ) {
+ for ( var i = 0; i < networkMap.length; i++ ) {
+ if ( domains.indexOf(networkMap[i].enclosingDomain) < 0 ) {
+ domains.push(networkMap[i].enclosingDomain);
+ }
+ }
+ }
+ for ( var d = 0; d < domains.length; d++ ) {
+ $('#domains').append('<option value="' + domains[d] +'">' + domains[d] + '</option>');
+ }
+ $("#elements").prop('disabled', true);
+ $('#domains').change(function(){
+ if ( $('#domains').val() == 'na' ) { return false; }
+ buildElements($('#domains').val());
+ });
+ $('#domains option[value|="'+ defaultDomain +'"]').prop("selected",true).change();
+
+}
+
+function buildElements(domain){
+ elements = [];
+ $('#elements').html('<option value="na">-- Select Element --</option>');
+ for ( var i = 0; i < networkMap.length; i++ ) {
+ if ( networkMap[i].enclosingDomain == domain ) {
+ $('#elements').append('<option value="' + networkMap[i].tosca_id +'">' + networkMap[i].displayShortname + '</option>');
+ elements.push(networkMap[i].displayShortname);
+ }
+ }
+ $("#elements").prop('disabled', false);
+ $('#elements').change(function(){
+ if ( $('#elements').val() == 'na' ) { return false; }
+ buildNode($('#elements').val(),$('#elements option:selected').text());
+ });
+ if ( isFirstRun ) {
+ $('#elements option[value|="'+ defaultElement +'"]').prop("selected",true);
+ isFirstRun = false;
+ }
+
+}
+
+function buildNode(tosca_id,name){
+ $('#element').attr('taska_id',tosca_id);
+ $('#shortName').html(name);
+}
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/bs.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/bs.css
new file mode 100644
index 0000000..6e4c37b
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/bs.css
@@ -0,0 +1,677 @@
+.fade {
+ opacity: 0;
+ -webkit-transition: opacity .15s linear;
+ -o-transition: opacity .15s linear;
+ transition: opacity .15s linear;
+}
+.fade.in {
+ opacity: 1;
+}
+.modal-open {
+ overflow: hidden;
+}
+.modal {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 99999;
+ display: none;
+ overflow: hidden;
+ -webkit-overflow-scrolling: touch;
+ outline: 0;
+}
+.modal.fade .modal-dialog {
+ -webkit-transition: -webkit-transform .3s ease-out;
+ -o-transition: -o-transform .3s ease-out;
+ transition: transform .3s ease-out;
+ -webkit-transform: translate(0, -25%);
+ -ms-transform: translate(0, -25%);
+ -o-transform: translate(0, -25%);
+ transform: translate(0, -25%);
+}
+.modal.in .modal-dialog {
+ -webkit-transform: translate(0, 0);
+ -ms-transform: translate(0, 0);
+ -o-transform: translate(0, 0);
+ transform: translate(0, 0);
+}
+.modal-open .modal {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+.modal-dialog {
+ position: relative;
+ width: auto;
+ margin: 10px;
+}
+.modal-content {
+ position: relative;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #999;
+ border: 1px solid rgba(0, 0, 0, .2);
+ border-radius: 6px;
+ outline: 0;
+ -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
+ box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
+}
+.modal-backdrop {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 9997;
+ background-color: #000;
+}
+.modal-backdrop.fade {
+ filter: alpha(opacity=0);
+ opacity: 0;
+}
+.modal-backdrop.in {
+ filter: alpha(opacity=50);
+ opacity: .5;
+}
+.modal-header {
+ min-height: 16.42857143px;
+ padding: 15px;
+ border-bottom: 1px solid #e5e5e5;
+}
+.modal-header .close {
+ margin-top: -2px;
+}
+.modal-title {
+ margin: 0;
+ line-height: 1.42857143;
+}
+.modal-body {
+ position: relative;
+ padding: 15px;
+}
+.modal-footer {
+ padding: 15px;
+ text-align: right;
+ border-top: 1px solid #e5e5e5;
+}
+.modal-footer .btn + .btn {
+ margin-bottom: 0;
+ margin-left: 5px;
+}
+.modal-footer .btn-group .btn + .btn {
+ margin-left: -1px;
+}
+.modal-footer .btn-block + .btn-block {
+ margin-left: 0;
+}
+.modal-scrollbar-measure {
+ position: absolute;
+ top: -9999px;
+ width: 50px;
+ height: 50px;
+ overflow: scroll;
+}
+@media (min-width: 768px) {
+ .modal-dialog {
+ width: 600px;
+ margin: 30px auto;
+ }
+ .modal-content {
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+ box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+ }
+ .modal-sm {
+ width: 300px;
+ }
+}
+@media (min-width: 992px) {
+ .modal-lg {
+ width: 900px;
+ }
+}
+.btn {
+ display: inline-block;
+ padding: 6px 12px;
+ margin-bottom: 0;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 1.42857143;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: middle;
+ -ms-touch-action: manipulation;
+ touch-action: manipulation;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus,
+.btn.focus,
+.btn:active.focus,
+.btn.active.focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus,
+.btn.focus {
+ color: #333;
+ text-decoration: none;
+}
+.btn:active,
+.btn.active {
+ background-image: none;
+ outline: 0;
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+ cursor: not-allowed;
+ filter: alpha(opacity=65);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ opacity: .65;
+}
+a.btn.disabled,
+fieldset[disabled] a.btn {
+ pointer-events: none;
+}
+.btn-default {
+ color: #333;
+ background-color: #fff;
+ border-color: #ccc;
+}
+.btn-default:focus,
+.btn-default.focus {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #8c8c8c;
+}
+.btn-default:hover {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active:hover,
+.btn-default.active:hover,
+.open > .dropdown-toggle.btn-default:hover,
+.btn-default:active:focus,
+.btn-default.active:focus,
+.open > .dropdown-toggle.btn-default:focus,
+.btn-default:active.focus,
+.btn-default.active.focus,
+.open > .dropdown-toggle.btn-default.focus {
+ color: #333;
+ background-color: #d4d4d4;
+ border-color: #8c8c8c;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ background-image: none;
+}
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+ background-color: #fff;
+ border-color: #ccc;
+}
+.btn-default .badge {
+ color: #fff;
+ background-color: #333;
+}
+.btn-primary {
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary:focus,
+.btn-primary.focus {
+ color: #fff;
+ background-color: #286090;
+ border-color: #122b40;
+}
+.btn-primary:hover {
+ color: #fff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ color: #fff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active:hover,
+.btn-primary.active:hover,
+.open > .dropdown-toggle.btn-primary:hover,
+.btn-primary:active:focus,
+.btn-primary.active:focus,
+.open > .dropdown-toggle.btn-primary:focus,
+.btn-primary:active.focus,
+.btn-primary.active.focus,
+.open > .dropdown-toggle.btn-primary.focus {
+ color: #fff;
+ background-color: #204d74;
+ border-color: #122b40;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ background-image: none;
+}
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary .badge {
+ color: #337ab7;
+ background-color: #fff;
+}
+.btn-success {
+ color: #fff;
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success:focus,
+.btn-success.focus {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #255625;
+}
+.btn-success:hover {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active:hover,
+.btn-success.active:hover,
+.open > .dropdown-toggle.btn-success:hover,
+.btn-success:active:focus,
+.btn-success.active:focus,
+.open > .dropdown-toggle.btn-success:focus,
+.btn-success:active.focus,
+.btn-success.active.focus,
+.open > .dropdown-toggle.btn-success.focus {
+ color: #fff;
+ background-color: #398439;
+ border-color: #255625;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ background-image: none;
+}
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success .badge {
+ color: #5cb85c;
+ background-color: #fff;
+}
+.btn-info {
+ color: #fff;
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info:focus,
+.btn-info.focus {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #1b6d85;
+}
+.btn-info:hover {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active:hover,
+.btn-info.active:hover,
+.open > .dropdown-toggle.btn-info:hover,
+.btn-info:active:focus,
+.btn-info.active:focus,
+.open > .dropdown-toggle.btn-info:focus,
+.btn-info:active.focus,
+.btn-info.active.focus,
+.open > .dropdown-toggle.btn-info.focus {
+ color: #fff;
+ background-color: #269abc;
+ border-color: #1b6d85;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ background-image: none;
+}
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info .badge {
+ color: #5bc0de;
+ background-color: #fff;
+}
+.btn-warning {
+ color: #fff;
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning:focus,
+.btn-warning.focus {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #985f0d;
+}
+.btn-warning:hover {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active:hover,
+.btn-warning.active:hover,
+.open > .dropdown-toggle.btn-warning:hover,
+.btn-warning:active:focus,
+.btn-warning.active:focus,
+.open > .dropdown-toggle.btn-warning:focus,
+.btn-warning:active.focus,
+.btn-warning.active.focus,
+.open > .dropdown-toggle.btn-warning.focus {
+ color: #fff;
+ background-color: #d58512;
+ border-color: #985f0d;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ background-image: none;
+}
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning .badge {
+ color: #f0ad4e;
+ background-color: #fff;
+}
+.btn-danger {
+ color: #fff;
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger:focus,
+.btn-danger.focus {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #761c19;
+}
+.btn-danger:hover {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active:hover,
+.btn-danger.active:hover,
+.open > .dropdown-toggle.btn-danger:hover,
+.btn-danger:active:focus,
+.btn-danger.active:focus,
+.open > .dropdown-toggle.btn-danger:focus,
+.btn-danger:active.focus,
+.btn-danger.active.focus,
+.open > .dropdown-toggle.btn-danger.focus {
+ color: #fff;
+ background-color: #ac2925;
+ border-color: #761c19;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ background-image: none;
+}
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger .badge {
+ color: #d9534f;
+ background-color: #fff;
+}
+.btn-link {
+ font-weight: normal;
+ color: #337ab7;
+ border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link.active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+ background-color: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+ border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+ color: #23527c;
+ text-decoration: underline;
+ background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+ color: #777;
+ text-decoration: none;
+}
+.btn-lg,
+.btn-group-lg > .btn {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+.btn-sm,
+.btn-group-sm > .btn {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-xs,
+.btn-group-xs > .btn {
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-block {
+ display: block;
+ width: 100%;
+}
+.btn-block + .btn-block {
+ margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+ width: 100%;
+}
+.close {
+ float: right;
+ font-size: 21px;
+ font-weight: bold;
+ line-height: 1;
+ color: #000;
+ text-shadow: 0 1px 0 #fff;
+ filter: alpha(opacity=20);
+ opacity: .2;
+}
+.close:hover,
+.close:focus {
+ color: #000;
+ text-decoration: none;
+ cursor: pointer;
+ filter: alpha(opacity=50);
+ opacity: .5;
+}
+button.close {
+ -webkit-appearance: none;
+ padding: 0;
+ cursor: pointer;
+ background: transparent;
+ border: 0;
+} \ No newline at end of file
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/jquery-ui.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/jquery-ui.css
new file mode 100644
index 0000000..46920ae
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/jquery-ui.css
@@ -0,0 +1,1227 @@
+/*! jQuery UI - v1.11.4 - 2015-06-30
+* http://jqueryui.com
+* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden {
+ display: none;
+}
+.ui-helper-hidden-accessible {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+.ui-helper-reset {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ line-height: 1.3;
+ text-decoration: none;
+ font-size: 100%;
+ list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+.ui-helper-clearfix {
+ min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ position: absolute;
+ opacity: 0;
+ filter:Alpha(Opacity=0); /* support: IE8 */
+}
+
+.ui-front {
+ z-index: 100;
+}
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled {
+ cursor: default !important;
+}
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ display: block;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+}
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+.ui-draggable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable {
+ position: relative;
+}
+.ui-resizable-handle {
+ position: absolute;
+ font-size: 0.1px;
+ display: block;
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-resizable-disabled .ui-resizable-handle,
+.ui-resizable-autohide .ui-resizable-handle {
+ display: none;
+}
+.ui-resizable-n {
+ cursor: n-resize;
+ height: 7px;
+ width: 100%;
+ top: -5px;
+ left: 0;
+}
+.ui-resizable-s {
+ cursor: s-resize;
+ height: 7px;
+ width: 100%;
+ bottom: -5px;
+ left: 0;
+}
+.ui-resizable-e {
+ cursor: e-resize;
+ width: 7px;
+ right: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-w {
+ cursor: w-resize;
+ width: 7px;
+ left: -5px;
+ top: 0;
+ height: 100%;
+}
+.ui-resizable-se {
+ cursor: se-resize;
+ width: 12px;
+ height: 12px;
+ right: 1px;
+ bottom: 1px;
+}
+.ui-resizable-sw {
+ cursor: sw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ bottom: -5px;
+}
+.ui-resizable-nw {
+ cursor: nw-resize;
+ width: 9px;
+ height: 9px;
+ left: -5px;
+ top: -5px;
+}
+.ui-resizable-ne {
+ cursor: ne-resize;
+ width: 9px;
+ height: 9px;
+ right: -5px;
+ top: -5px;
+}
+.ui-selectable {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-selectable-helper {
+ position: absolute;
+ z-index: 100;
+ border: 1px dotted black;
+}
+.ui-sortable-handle {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-accordion .ui-accordion-header {
+ display: block;
+ cursor: pointer;
+ position: relative;
+ margin: 2px 0 0 0;
+ padding: .5em .5em .5em .7em;
+ min-height: 0; /* support: IE7 */
+ font-size: 100%;
+}
+.ui-accordion .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-icons .ui-accordion-icons {
+ padding-left: 2.2em;
+}
+.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
+ position: absolute;
+ left: .5em;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-accordion .ui-accordion-content {
+ padding: 1em 2.2em;
+ border-top: 0;
+ overflow: auto;
+}
+.ui-autocomplete {
+ position: absolute;
+ top: 0;
+ left: 0;
+ cursor: default;
+}
+.ui-button {
+ display: inline-block;
+ position: relative;
+ padding: 0;
+ line-height: normal;
+ margin-right: .1em;
+ cursor: pointer;
+ vertical-align: middle;
+ text-align: center;
+ overflow: visible; /* removes extra width in IE */
+}
+.ui-button,
+.ui-button:link,
+.ui-button:visited,
+.ui-button:hover,
+.ui-button:active {
+ text-decoration: none;
+}
+/* to make room for the icon, a width needs to be set here */
+.ui-button-icon-only {
+ width: 2.2em;
+}
+/* button elements seem to need a little more width */
+button.ui-button-icon-only {
+ width: 2.4em;
+}
+.ui-button-icons-only {
+ width: 3.4em;
+}
+button.ui-button-icons-only {
+ width: 3.7em;
+}
+
+/* button text element */
+.ui-button .ui-button-text {
+ display: block;
+ line-height: normal;
+}
+.ui-button-text-only .ui-button-text {
+ padding: .4em 1em;
+}
+.ui-button-icon-only .ui-button-text,
+.ui-button-icons-only .ui-button-text {
+ padding: .4em;
+ text-indent: -9999999px;
+}
+.ui-button-text-icon-primary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 1em .4em 2.1em;
+}
+.ui-button-text-icon-secondary .ui-button-text,
+.ui-button-text-icons .ui-button-text {
+ padding: .4em 2.1em .4em 1em;
+}
+.ui-button-text-icons .ui-button-text {
+ padding-left: 2.1em;
+ padding-right: 2.1em;
+}
+/* no icon support for input elements, provide padding by default */
+input.ui-button {
+ padding: .4em 1em;
+}
+
+/* button icon element(s) */
+.ui-button-icon-only .ui-icon,
+.ui-button-text-icon-primary .ui-icon,
+.ui-button-text-icon-secondary .ui-icon,
+.ui-button-text-icons .ui-icon,
+.ui-button-icons-only .ui-icon {
+ position: absolute;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-button-icon-only .ui-icon {
+ left: 50%;
+ margin-left: -8px;
+}
+.ui-button-text-icon-primary .ui-button-icon-primary,
+.ui-button-text-icons .ui-button-icon-primary,
+.ui-button-icons-only .ui-button-icon-primary {
+ left: .5em;
+}
+.ui-button-text-icon-secondary .ui-button-icon-secondary,
+.ui-button-text-icons .ui-button-icon-secondary,
+.ui-button-icons-only .ui-button-icon-secondary {
+ right: .5em;
+}
+
+/* button sets */
+.ui-buttonset {
+ margin-right: 7px;
+}
+.ui-buttonset .ui-button {
+ margin-left: 0;
+ margin-right: -.3em;
+}
+
+/* workarounds */
+/* reset extra padding in Firefox, see h5bp.com/l */
+input.ui-button::-moz-focus-inner,
+button.ui-button::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+.ui-datepicker {
+ width: 17em;
+ padding: .2em .2em 0;
+ display: none;
+}
+.ui-datepicker .ui-datepicker-header {
+ position: relative;
+ padding: .2em 0;
+}
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+ position: absolute;
+ top: 2px;
+ width: 1.8em;
+ height: 1.8em;
+}
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+ top: 1px;
+}
+.ui-datepicker .ui-datepicker-prev {
+ left: 2px;
+}
+.ui-datepicker .ui-datepicker-next {
+ right: 2px;
+}
+.ui-datepicker .ui-datepicker-prev-hover {
+ left: 1px;
+}
+.ui-datepicker .ui-datepicker-next-hover {
+ right: 1px;
+}
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+ display: block;
+ position: absolute;
+ left: 50%;
+ margin-left: -8px;
+ top: 50%;
+ margin-top: -8px;
+}
+.ui-datepicker .ui-datepicker-title {
+ margin: 0 2.3em;
+ line-height: 1.8em;
+ text-align: center;
+}
+.ui-datepicker .ui-datepicker-title select {
+ font-size: 1em;
+ margin: 1px 0;
+}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+ width: 45%;
+}
+.ui-datepicker table {
+ width: 100%;
+ font-size: .9em;
+ border-collapse: collapse;
+ margin: 0 0 .4em;
+}
+.ui-datepicker th {
+ padding: .7em .3em;
+ text-align: center;
+ font-weight: bold;
+ border: 0;
+}
+.ui-datepicker td {
+ border: 0;
+ padding: 1px;
+}
+.ui-datepicker td span,
+.ui-datepicker td a {
+ display: block;
+ padding: .2em;
+ text-align: right;
+ text-decoration: none;
+}
+.ui-datepicker .ui-datepicker-buttonpane {
+ background-image: none;
+ margin: .7em 0 0 0;
+ padding: 0 .2em;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 0;
+}
+.ui-datepicker .ui-datepicker-buttonpane button {
+ float: right;
+ margin: .5em .2em .4em;
+ cursor: pointer;
+ padding: .2em .6em .3em .6em;
+ width: auto;
+ overflow: visible;
+}
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+ float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+ width: auto;
+}
+.ui-datepicker-multi .ui-datepicker-group {
+ float: left;
+}
+.ui-datepicker-multi .ui-datepicker-group table {
+ width: 95%;
+ margin: 0 auto .4em;
+}
+.ui-datepicker-multi-2 .ui-datepicker-group {
+ width: 50%;
+}
+.ui-datepicker-multi-3 .ui-datepicker-group {
+ width: 33.3%;
+}
+.ui-datepicker-multi-4 .ui-datepicker-group {
+ width: 25%;
+}
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+ border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+ clear: left;
+}
+.ui-datepicker-row-break {
+ clear: both;
+ width: 100%;
+ font-size: 0;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+ direction: rtl;
+}
+.ui-datepicker-rtl .ui-datepicker-prev {
+ right: 2px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next {
+ left: 2px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+ right: 1px;
+ left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+ left: 1px;
+ right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+ clear: right;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+ float: left;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
+.ui-datepicker-rtl .ui-datepicker-group {
+ float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+ border-right-width: 0;
+ border-left-width: 1px;
+}
+.ui-dialog {
+ overflow: hidden;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: .2em;
+ outline: 0;
+}
+.ui-dialog .ui-dialog-titlebar {
+ padding: .4em 1em;
+ position: relative;
+}
+.ui-dialog .ui-dialog-title {
+ float: left;
+ margin: .1em 0;
+ white-space: nowrap;
+ width: 90%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.ui-dialog .ui-dialog-titlebar-close {
+ position: absolute;
+ right: .3em;
+ top: 50%;
+ width: 20px;
+ margin: -10px 0 0 0;
+ padding: 1px;
+ height: 20px;
+}
+.ui-dialog .ui-dialog-content {
+ position: relative;
+ border: 0;
+ padding: .5em 1em;
+ background: none;
+ overflow: auto;
+}
+.ui-dialog .ui-dialog-buttonpane {
+ text-align: left;
+ border-width: 1px 0 0 0;
+ background-image: none;
+ margin-top: .5em;
+ padding: .3em 1em .5em .4em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+ float: right;
+}
+.ui-dialog .ui-dialog-buttonpane button {
+ margin: .5em .4em .5em 0;
+ cursor: pointer;
+}
+.ui-dialog .ui-resizable-se {
+ width: 12px;
+ height: 12px;
+ right: -5px;
+ bottom: -5px;
+ background-position: 16px 16px;
+}
+.ui-draggable .ui-dialog-titlebar {
+ cursor: move;
+}
+.ui-menu {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: block;
+ outline: none;
+}
+.ui-menu .ui-menu {
+ position: absolute;
+}
+.ui-menu .ui-menu-item {
+ position: relative;
+ margin: 0;
+ padding: 3px 1em 3px .4em;
+ cursor: pointer;
+ min-height: 0; /* support: IE7 */
+ /* support: IE10, see #8844 */
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
+}
+.ui-menu .ui-menu-divider {
+ margin: 5px 0;
+ height: 0;
+ font-size: 0;
+ line-height: 0;
+ border-width: 1px 0 0 0;
+}
+.ui-menu .ui-state-focus,
+.ui-menu .ui-state-active {
+ margin: -1px;
+}
+
+/* icon support */
+.ui-menu-icons {
+ position: relative;
+}
+.ui-menu-icons .ui-menu-item {
+ padding-left: 2em;
+}
+
+/* left-aligned */
+.ui-menu .ui-icon {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: .2em;
+ margin: auto 0;
+}
+
+/* right-aligned */
+.ui-menu .ui-menu-icon {
+ left: auto;
+ right: 0;
+}
+.ui-progressbar {
+ height: 2em;
+ text-align: left;
+ overflow: hidden;
+}
+.ui-progressbar .ui-progressbar-value {
+ margin: -1px;
+ height: 100%;
+}
+.ui-progressbar .ui-progressbar-overlay {
+ background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
+ height: 100%;
+ filter: alpha(opacity=25); /* support: IE8 */
+ opacity: 0.25;
+}
+.ui-progressbar-indeterminate .ui-progressbar-value {
+ background-image: none;
+}
+.ui-selectmenu-menu {
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: none;
+ z-index:100000
+}
+.ui-selectmenu-menu .ui-menu {
+ overflow: auto;
+ /* Support: IE7 */
+ overflow-x: hidden;
+ padding-bottom: 1px;
+}
+.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
+ font-size: 1em;
+ font-weight: bold;
+ line-height: 1.5;
+ padding: 2px 0.4em;
+ margin: 0.5em 0 0 0;
+ height: auto;
+ border: 0;
+}
+.ui-selectmenu-open {
+ display: block;
+}
+.ui-selectmenu-button {
+ display: inline-block;
+ overflow: hidden;
+ position: relative;
+ text-decoration: none;
+ cursor: pointer;
+}
+.ui-selectmenu-button span.ui-icon {
+ right: 0.5em;
+ left: auto;
+ margin-top: -8px;
+ position: absolute;
+ top: 50%;
+}
+.ui-selectmenu-button span.ui-selectmenu-text {
+ text-align: left;
+ padding: 0.4em 2.1em 0.4em 1em;
+ display: block;
+ line-height: 1.4;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.ui-slider {
+ position: relative;
+ text-align: left;
+}
+.ui-slider .ui-slider-handle {
+ position: absolute;
+ z-index: 2;
+ width: 1.2em;
+ height: 1.2em;
+ cursor: default;
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.ui-slider .ui-slider-range {
+ position: absolute;
+ z-index: 1;
+ font-size: .7em;
+ display: block;
+ border: 0;
+ background-position: 0 0;
+}
+
+/* support: IE8 - See #6727 */
+.ui-slider.ui-state-disabled .ui-slider-handle,
+.ui-slider.ui-state-disabled .ui-slider-range {
+ filter: inherit;
+}
+
+.ui-slider-horizontal {
+ height: .8em;
+}
+.ui-slider-horizontal .ui-slider-handle {
+ top: -.3em;
+ margin-left: -.6em;
+}
+.ui-slider-horizontal .ui-slider-range {
+ top: 0;
+ height: 100%;
+}
+.ui-slider-horizontal .ui-slider-range-min {
+ left: 0;
+}
+.ui-slider-horizontal .ui-slider-range-max {
+ right: 0;
+}
+
+.ui-slider-vertical {
+ width: .8em;
+ height: 100px;
+}
+.ui-slider-vertical .ui-slider-handle {
+ left: -.3em;
+ margin-left: 0;
+ margin-bottom: -.6em;
+}
+.ui-slider-vertical .ui-slider-range {
+ left: 0;
+ width: 100%;
+}
+.ui-slider-vertical .ui-slider-range-min {
+ bottom: 0;
+}
+.ui-slider-vertical .ui-slider-range-max {
+ top: 0;
+}
+.ui-spinner {
+ position: relative;
+ display: inline-block;
+ overflow: hidden;
+ padding: 0;
+ vertical-align: middle;
+}
+.ui-spinner-input {
+ border: none;
+ background: none;
+ color: inherit;
+ padding: 0;
+ margin: .2em 0;
+ vertical-align: middle;
+ margin-left: .4em;
+ margin-right: 22px;
+}
+.ui-spinner-button {
+ width: 16px;
+ height: 50%;
+ font-size: .5em;
+ padding: 0;
+ margin: 0;
+ text-align: center;
+ position: absolute;
+ cursor: default;
+ display: block;
+ overflow: hidden;
+ right: 0;
+}
+/* more specificity required here to override default borders */
+.ui-spinner a.ui-spinner-button {
+ border-top: none;
+ border-bottom: none;
+ border-right: none;
+}
+/* vertically center icon */
+.ui-spinner .ui-icon {
+ position: absolute;
+ margin-top: -8px;
+ top: 50%;
+ left: 0;
+}
+.ui-spinner-up {
+ top: 0;
+}
+.ui-spinner-down {
+ bottom: 0;
+}
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+ /* need to fix icons sprite */
+ background-position: -65px -16px;
+}
+.ui-tabs {
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+ padding: .2em;
+}
+.ui-tabs .ui-tabs-nav {
+ margin: 0;
+ padding: .2em .2em 0;
+}
+.ui-tabs .ui-tabs-nav li {
+ list-style: none;
+ float: left;
+ position: relative;
+ top: 0;
+ margin: 1px .2em 0 0;
+ border-bottom-width: 0;
+ padding: 0;
+ white-space: nowrap;
+}
+.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
+ float: left;
+ padding: .5em 1em;
+ text-decoration: none;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+ margin-bottom: -1px;
+ padding-bottom: 1px;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
+.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
+ cursor: text;
+}
+.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
+ cursor: pointer;
+}
+.ui-tabs .ui-tabs-panel {
+ display: block;
+ border-width: 0;
+ padding: 1em 1.4em;
+ background: none;
+}
+.ui-tooltip {
+ padding: 8px;
+ position: absolute;
+ z-index: 9999;
+ max-width: 300px;
+ -webkit-box-shadow: 0 0 5px #aaa;
+ box-shadow: 0 0 5px #aaa;
+}
+body .ui-tooltip {
+ border-width: 2px;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 1.1em;
+}
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 1em;
+}
+.ui-widget-content {
+ border: 1px solid #aaaaaa;
+ background: #ffffff url("../../images/menus/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
+ color: #222222;
+ z-index:99999;
+}
+.ui-widget-content a {
+ color: #222222;
+}
+.ui-widget-header {
+ border: 1px solid #aaaaaa;
+ background: #cccccc url("../../images/menus/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
+ color: #222222;
+ font-weight: bold;
+}
+.ui-widget-header a {
+ color: #222222;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default {
+ border: 1px solid #d3d3d3;
+ background: #e6e6e6 url("../../images/menus/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #555555;
+}
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited {
+ color: #555555;
+ text-decoration: none;
+}
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus {
+ border: 1px solid #999999;
+ background: #dadada url("../../images/menus/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #212121;
+}
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited {
+ color: #212121;
+ text-decoration: none;
+}
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active {
+ border: 1px solid #aaaaaa;
+ background: #ffffff url("../../images/menus/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
+ font-weight: normal;
+ color: #212121;
+}
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #212121;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #fcefa1;
+ background: #fbf9ee url("../../images/menus/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
+ color: #363636;
+}
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #363636;
+}
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #cd0a0a;
+ background: #fef1ec url("../../images/menus/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
+ color: #cd0a0a;
+}
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #cd0a0a;
+}
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #cd0a0a;
+}
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: bold;
+}
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: .7;
+ filter:Alpha(Opacity=70); /* support: IE8 */
+ font-weight: normal;
+}
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: .35;
+ filter:Alpha(Opacity=35); /* support: IE8 */
+ background-image: none;
+}
+.ui-state-disabled .ui-icon {
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+.ui-icon,
+.ui-widget-content .ui-icon {
+ background-image: url("../../images/menus/ui-icons_222222_256x240.png");
+}
+.ui-widget-header .ui-icon {
+ background-image: url("../../images/menus/ui-icons_222222_256x240.png");
+}
+.ui-state-default .ui-icon {
+ background-image: url("../../images/menus/ui-icons_888888_256x240.png");
+}
+.ui-state-hover .ui-icon,
+.ui-state-focus .ui-icon {
+ background-image: url("../../images/menus/ui-icons_454545_256x240.png");
+}
+.ui-state-active .ui-icon {
+ background-image: url("../../images/menus/ui-icons_454545_256x240.png");
+}
+.ui-state-highlight .ui-icon {
+ background-image: url("../../images/menus/ui-icons_2e83ff_256x240.png");
+}
+.ui-state-error .ui-icon,
+.ui-state-error-text .ui-icon {
+ background-image: url("../../images/menus/ui-icons_cd0a0a_256x240.png");
+}
+
+/* positioning */
+.ui-icon-blank { background-position: 16px 16px; }
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-on { background-position: -96px -144px; }
+.ui-icon-radio-off { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 4px;
+}
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #aaaaaa url("../../images/menus/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+}
+.ui-widget-shadow {
+ margin: -8px 0 0 -8px;
+ padding: 8px;
+ background: #aaaaaa url("../../images/menus/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
+ opacity: .3;
+ filter: Alpha(Opacity=30); /* support: IE8 */
+ border-radius: 8px;
+}
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/tooltipster.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/tooltipster.css
new file mode 100644
index 0000000..c9fae2d
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/menus/tooltipster.css
@@ -0,0 +1,294 @@
+/* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */
+.tooltipster-default {
+ border-radius: 5px;
+ border: 2px solid #000;
+ background: #4c4c4c;
+ color: #fff;
+}
+
+/* Use this next selector to style things like font-size and line-height: */
+.tooltipster-default .tooltipster-content {
+ font-family: Arial, sans-serif;
+ font-size: 14px;
+ line-height: 16px;
+ padding: 8px 10px;
+ /*overflow: hidden;*/
+}
+
+/* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */
+.tooltipster-default .tooltipster-arrow .tooltipster-arrow-border {
+ /* border-color: ... !important; */
+}
+
+
+/* If you're using the icon option, use this next selector to style them */
+.tooltipster-icon {
+ cursor: help;
+ margin-left: 4px;
+}
+
+
+
+
+
+
+
+
+
+/* This is the base styling required to make all Tooltipsters work */
+.tooltipster-base {
+ padding: 0;
+ font-size: 0;
+ line-height: 0;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 9999999;
+ pointer-events: none;
+ width: auto;
+ overflow: visible;
+}
+.tooltipster-base .tooltipster-content {
+ /*overflow: hidden;*/
+}
+
+
+/* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */
+.tooltipster-arrow {
+ display: block;
+ text-align: center;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: -1;
+}
+.tooltipster-arrow span, .tooltipster-arrow-border {
+ display: block;
+ width: 0;
+ height: 0;
+ position: absolute;
+}
+.tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span {
+ border-left: 8px solid transparent !important;
+ border-right: 8px solid transparent !important;
+ border-top: 8px solid;
+ bottom: -7px;
+}
+.tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border {
+ border-left: 9px solid transparent !important;
+ border-right: 9px solid transparent !important;
+ border-top: 9px solid;
+ bottom: -7px;
+}
+
+.tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span {
+ border-left: 8px solid transparent !important;
+ border-right: 8px solid transparent !important;
+ border-bottom: 8px solid;
+ top: -7px;
+}
+.tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
+ border-left: 9px solid transparent !important;
+ border-right: 9px solid transparent !important;
+ border-bottom: 9px solid;
+ top: -7px;
+}
+.tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border {
+ left: 0;
+ right: 0;
+ margin: 0 auto;
+}
+.tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span {
+ left: 6px;
+}
+.tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
+ left: 5px;
+}
+.tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span {
+ right: 6px;
+}
+.tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border {
+ right: 5px;
+}
+.tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border {
+ border-top: 8px solid transparent !important;
+ border-bottom: 8px solid transparent !important;
+ border-left: 8px solid;
+ top: 50%;
+ margin-top: -7px;
+ right: -7px;
+}
+.tooltipster-arrow-left .tooltipster-arrow-border {
+ border-top: 9px solid transparent !important;
+ border-bottom: 9px solid transparent !important;
+ border-left: 9px solid;
+ margin-top: -8px;
+}
+.tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border {
+ border-top: 8px solid transparent !important;
+ border-bottom: 8px solid transparent !important;
+ border-right: 8px solid;
+ top: 50%;
+ margin-top: -7px;
+ left: -7px;
+}
+.tooltipster-arrow-right .tooltipster-arrow-border {
+ border-top: 9px solid transparent !important;
+ border-bottom: 9px solid transparent !important;
+ border-right: 9px solid;
+ margin-top: -8px;
+}
+
+
+/* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */
+
+.tooltipster-fade {
+ opacity: 0;
+ -webkit-transition-property: opacity;
+ -moz-transition-property: opacity;
+ -o-transition-property: opacity;
+ -ms-transition-property: opacity;
+ transition-property: opacity;
+}
+.tooltipster-fade-show {
+ opacity: 1;
+}
+
+.tooltipster-grow {
+ -webkit-transform: scale(0,0);
+ -moz-transform: scale(0,0);
+ -o-transform: scale(0,0);
+ -ms-transform: scale(0,0);
+ transform: scale(0,0);
+ -webkit-transition-property: -webkit-transform;
+ -moz-transition-property: -moz-transform;
+ -o-transition-property: -o-transform;
+ -ms-transition-property: -ms-transform;
+ transition-property: transform;
+ -webkit-backface-visibility: hidden;
+}
+.tooltipster-grow-show {
+ -webkit-transform: scale(1,1);
+ -moz-transform: scale(1,1);
+ -o-transform: scale(1,1);
+ -ms-transform: scale(1,1);
+ transform: scale(1,1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+
+.tooltipster-swing {
+ opacity: 0;
+ -webkit-transform: rotateZ(4deg);
+ -moz-transform: rotateZ(4deg);
+ -o-transform: rotateZ(4deg);
+ -ms-transform: rotateZ(4deg);
+ transform: rotateZ(4deg);
+ -webkit-transition-property: -webkit-transform, opacity;
+ -moz-transition-property: -moz-transform;
+ -o-transition-property: -o-transform;
+ -ms-transition-property: -ms-transform;
+ transition-property: transform;
+}
+.tooltipster-swing-show {
+ opacity: 1;
+ -webkit-transform: rotateZ(0deg);
+ -moz-transform: rotateZ(0deg);
+ -o-transform: rotateZ(0deg);
+ -ms-transform: rotateZ(0deg);
+ transform: rotateZ(0deg);
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+ transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
+}
+
+.tooltipster-fall {
+ top: 0;
+ -webkit-transition-property: top;
+ -moz-transition-property: top;
+ -o-transition-property: top;
+ -ms-transition-property: top;
+ transition-property: top;
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+.tooltipster-fall-show {
+}
+.tooltipster-fall.tooltipster-dying {
+ -webkit-transition-property: all;
+ -moz-transition-property: all;
+ -o-transition-property: all;
+ -ms-transition-property: all;
+ transition-property: all;
+ top: 0px !important;
+ opacity: 0;
+}
+
+.tooltipster-slide {
+ left: -40px;
+ -webkit-transition-property: left;
+ -moz-transition-property: left;
+ -o-transition-property: left;
+ -ms-transition-property: left;
+ transition-property: left;
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
+}
+.tooltipster-slide.tooltipster-slide-show {
+}
+.tooltipster-slide.tooltipster-dying {
+ -webkit-transition-property: all;
+ -moz-transition-property: all;
+ -o-transition-property: all;
+ -ms-transition-property: all;
+ transition-property: all;
+ left: 0px !important;
+ opacity: 0;
+}
+
+
+/* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */
+.tooltipster-content-changing {
+ opacity: 0.5;
+ -webkit-transform: scale(1.1, 1.1);
+ -moz-transform: scale(1.1, 1.1);
+ -o-transform: scale(1.1, 1.1);
+ -ms-transform: scale(1.1, 1.1);
+ transform: scale(1.1, 1.1);
+}
+
+/*Other themes*/
+
+.tooltipster-shadow {
+ border-radius: 5px;
+ background: #fff;
+ box-shadow: 5px 5px 24px rgba(0,0,0,1);
+ color: #2c2c2c;
+}
+.tooltipster-shadow .tooltipster-content {
+ font-family: 'Arial', sans-serif;
+ font-size: 14px;
+ line-height: 16px;
+ padding: 8px 10px;
+}
+
+
+
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/style.css b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/style.css
new file mode 100644
index 0000000..e04e8e4
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/styles/style.css
@@ -0,0 +1,1028 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/*TITLE BAR*/
+#titleBar {
+ width: 100%;
+ height: 40px;
+ position:fixed;
+ background-color: transparent;
+ z-index:9999;
+ /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#9b9b9b+0,595959+73,666666+100 */
+ /*background: #9b9b9b; /* Old browsers */
+ /* IE9 SVG, needs conditional override of 'filter' to 'none' */
+ /*
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiM5YjliOWIiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSI3MyUiIHN0b3AtY29sb3I9IiM1OTU5NTkiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjNjY2NjY2IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
+ */
+ /*background: -moz-radial-gradient(center, ellipse cover, #067ab4 0%, #0c2577 73%, #0c2577 100%); /* FF3.6+ */
+ /*background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#067ab4), color-stop(73%,#0c2577), color-stop(100%,#0c2577)); /* Chrome,Safari4+ */
+ /*background: -webkit-radial-gradient(center, ellipse cover, #067ab4 0%,#0c2577 73%,#0c2577 100%); /* Chrome10+,Safari5.1+ */
+ /*background: -o-radial-gradient(center, ellipse cover, #067ab4 0%,#0c2577 73%,#0c2577 100%); /* Opera 12+ */
+ /*background: -ms-radial-gradient(center, ellipse cover, #067ab4 0%,#0c2577 73%,#0c2577 100%); /* IE10+ */
+ /*background: radial-gradient(ellipse at center, #067ab4 0%,#0c2577 73%,#0c2577 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#067ab4', endColorstr='#0c2577',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
+}
+
+
+.notLoggedIn {
+ position:absolute;
+ top:3px;
+ right:17px;
+ cursor:pointer;
+ color:white;
+ font-style: italic;
+ font-size:12px;
+}
+.loggedIn {
+ margin-right:15px;
+ position:absolute;
+ top:3px;
+ right:20px;
+ cursor:pointer;
+ color:white;
+ font-style: italic;
+ font-size:14px;
+}
+br.smallBR {
+ display: block;
+ line-height:0px;
+ padding:0;
+}
+fieldset.selectMenu {
+ border: 0;
+ }
+label.selectMenu {
+ display: block;
+ margin: 30px 0 0 0;
+ }
+select.selectMenu {
+ width: 200px;
+ }
+.overflow.selectMenu {
+ height: 200px;
+ }
+
+
+input{
+ display:inline;
+}
+.center{
+ display:block;
+ margin-left:auto;
+ margin-right:auto;
+ width:25%;
+}
+
+
+/*SIDE BAR*/
+#sideBar {
+ /*top:2.25em;*/
+ top:30px;
+ float:left;
+ width: 200px; height: 94.6%;
+ position:fixed; z-index:9997;border-radius: 4px;
+ border-right-style:solid;
+ border-right-color:white;
+ background: #336699;
+ /* Old browsers */
+ /*background: -moz-linear-gradient(top, #faaa19 0%, #f17a21 100%, #f17a21 100%); /* FF3.6+ */
+ /*background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#faaa19), color-stop(100%,#f17a21), color-stop(100%,#f17a21)); /* Chrome,Safari4+ */
+ /*background: -webkit-linear-gradient(top, #faaa19 0%,#f17a21 100%,#f17a21 100%); /* Chrome10+,Safari5.1+ */
+ /*background: -o-linear-gradient(top, #faaa19 0%,#f17a21 100%,#f17a21 100%); /* Opera 11.10+ */
+ /*background: -ms-linear-gradient(top, #faaa19 0%,#f17a21 100%,#f17a21 100%); /* IE10+ */
+ /*background: linear-gradient(to bottom, #faaa19 0%,#f17a21 100%,#f17a21 100%); /* W3C */
+ /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#faaa19', endColorstr='#f17a21',GradientType=0 ); /* IE6-9 */
+ /*background:#c4d82d;*/
+}
+.help{
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #000000;
+ text-align:justify;
+ text-justify: inter-word;
+}
+
+h2.help{
+ font-size:22px;
+}
+h3.help{
+ margin-bottom:3px;
+ margin-left:24px;
+ margin-right:12px;
+ font-size:16px;
+}
+h4.help{
+ margin-bottom:3px;
+ margin-left:48px;
+ margin-right:12px;
+ font-size:14px;
+}
+p.help.indent{
+ margin-left:48px;
+}
+p.help{
+ margin-left:24px;
+ margin-right:12px;
+ margin-top:0;
+ margin-bottom:0;
+ font-size:14px;
+}
+ul.help{
+ margin-left:48px;
+ margin-right:12px;
+ font-size:14px;
+}
+
+
+/*MAIN BODY*/
+body {
+ margin:0px; padding:0px;
+}
+#grid {position:static; top:2em;float:left; width: 98%; margin-top: 0em; z-index:-1;
+ text-align:left; margin-top:0em;
+ background-color: #efefef;
+ border: dashed 4px transparent;
+ border-radius: 4px;
+
+ padding: 10px;
+ padding-left: 0%;
+ transition: background-color 0.3s;
+ height: 699px;
+ text-align: center;
+ float:bottom;
+ margin-bottom:0em;
+}
+ol {
+ list-style-type:numbers;
+ font-size:12px;
+}
+#lines {
+ width:100%; margin-right:0;
+}
+hr.dottedLine {
+ border-top: dotted 1px #000;
+ display:inline-block;
+ border-bottom: none;
+ background: transparent;
+ cursor:pointer;
+ height:0px;
+}
+hr.doubleLine {
+ border-top: double 6px #000;
+ display:inline-block;
+ border-bottom: none;
+ background: transparent;
+ margin-bottom:3px;
+ cursor:pointer;
+ height:0px;
+}
+
+hr {
+ width:100%; height:1px; background: #fff;
+}
+
+table, th, td {
+ border: 1px dotted black;
+ background-color: transparent;
+}
+
+
+.arrow_box {
+ position: relative;
+ background: #88b7d5;
+ border: 4px solid #c2e1f5;
+}
+.arrow_box:after, .arrow_box:before {
+ top: 100%;
+ left: 50%;
+ border: solid transparent;
+ content: " ";
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
+}
+.arrow_box:after {
+ border-color: rgba(136, 183, 213, 0);
+ border-top-color: #88b7d5;
+ border-width: 10px;
+ margin-left: -10px;
+}
+.arrow_box:before {
+ border-color: rgba(194, 225, 245, 0);
+ border-top-color: #c2e1f5;
+ border-width: 16px;
+ margin-left: -16px;
+}
+
+
+
+
+
+
+
+
+
+
+
+#start
+{
+ display: block;
+ font-size: .75em;
+ font-weight: bold;
+ padding: 10px 15px;
+ margin: 1em;
+ margin-left:0em;
+ color: #ccc;
+ background-color: #555;
+ background: -webkit-linear-gradient(#44c8f5, #0c2577);
+ background: linear-gradient(#44c8f5, #0c2577);
+ border: 0 none;
+ border-radius: 3px;
+ text-shadow: 0 -1px 0 #000;
+ /*box-shadow: 0 1px 0 #666, 0 5px 0 #444, 0 6px 6px rgba(0,0,0,0.6);*/
+ cursor: pointer;
+ -webkit-transition: all 150ms ease;
+ transition: all 150ms ease;
+ font-size: 1.1em;
+ text-transform: uppercase;
+}
+
+#start:focus{
+ outline:none;
+}
+
+button.glow
+{
+ -webkit-animation: pulsate 1.2s linear infinite;
+ animation: pulsate 1.2s linear infinite;
+}
+
+@-webkit-keyframes pulsate
+{
+ 0% { color: #ddd; text-shadow: 0 -1px 0 #000; }
+ 50% { color: #29e; text-shadow: 0 0px 0 #444, 0 0 5px #ffd, 0 0 8px #fff; }
+ 100% { color: #ddd; text-shadow: 0 -1px 0 #000; }
+}
+
+@keyframes pulsate
+{
+ 0% { color: #fff; text-shadow: 0 -1px 0 #000; }
+ 50% { color: #29e; text-shadow: 0 -1px 0 #444, 0 0 5px #ffd, 0 0 8px #fff; }
+ 100% { color: #fff; text-shadow: 0 -1px 0 #000; }
+}
+
+button.little
+{
+ display: block;
+ font-size: .75em;
+ font-weight: bold;
+ padding: 2px 3px;
+ margin: 1em;
+ margin-left:0em;
+ color: #ccc;
+ background-color: #555;
+ background: -webkit-linear-gradient(#44c8f5, #0c2577);
+ background: linear-gradient(#44c8f5, #0c2577);
+ border: 0 none;
+ border-radius: 3px;
+ text-shadow: 0 -1px 0 #000;
+ /*box-shadow: 0 1px 0 #666, 0 5px 0 #444, 0 6px 6px rgba(0,0,0,0.6);*/
+ cursor: pointer;
+ -webkit-transition: all 150ms ease;
+ transition: all 150ms ease;
+}
+button.little:focus{
+ outline:none;
+}
+
+button.mediumOld
+{
+ display: block;
+ /*font-size: 1.25em;*/
+ font-size: 16px;
+ font-weight: bold;
+ padding: 2px 3px;
+ margin: 10px;
+ margin-left:10px;
+ color: #ccc;
+ background-color: #555;
+ background: -webkit-linear-gradient(#44c8f5, #0c2577);
+ background: linear-gradient(#44c8f5, #0c2577);
+ border: 0 none;
+ border-radius: 3px;
+ text-shadow: 0 -1px 0 #000;
+ /*box-shadow: 0 1px 0 #666, 0 5px 0 #444, 0 6px 6px rgba(0,0,0,0.6);*/
+ cursor: pointer;
+ -webkit-transition: all 150ms ease;
+ transition: all 150ms ease;
+}
+button.mediumOld:focus{
+ outline:none;
+}
+
+button.medium
+{
+ display: block;
+ /*font-size: 1.25em;*/
+ font-size: 16px;
+ font-weight: bold;
+ padding: 8px 8px;
+ margin: 5px;
+ margin-left:5px;
+ color: #ccc;
+ background-color: #0574AC!important;
+ border: 1px solid #666;
+ border-radius: 3px;
+ text-shadow: 0 -1px 0 #000;
+ /*box-shadow: 0 1px 0 #666, 0 5px 0 #444, 0 6px 6px rgba(0,0,0,0.6);*/
+ cursor: pointer;
+ -webkit-transition: all 150ms ease;
+ transition: all 150ms ease;
+}
+button.medium:focus{
+ outline:none;
+}
+button.medium:hover {
+ border: 1px solid #fff;
+ color: #fff;
+}
+
+
+
+h1.sideBar {
+ text-align: center;
+ display: block;
+ -webkit-margin-before: 0em;
+ -webkit-margin-after: 0em;
+ -webkit-margin-start: 0px;
+ -webkit-margin-end: 0px;
+ font-weight: bold;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 20px;
+ font-weight: normal;
+ color: #000000;
+}
+h3.titleBar {
+ text-align: center;
+ display: block;
+ font-size: 18px;
+ margin-top: 12px;
+ margin-right: 0px;
+ margin-left: 0px;
+ margin-bottom: 0px;
+ font-weight: bold;
+ font-family: Arial, Helvetica, sans-serif;
+ cursor:pointer;
+ color:#ffffff;
+}
+
+img.trash {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+
+
+p.draggables {
+ display: block;
+ -webkit-margin-before: 0em;
+ -webkit-margin-after: 0em;
+ -webkit-margin-start: 0px;
+ -webkit-margin-end: 0px;
+ text-align: center;
+ padding-top: 5px;
+}
+
+
+
+.dropzone{
+ background-color: #ccc;
+ border: dashed 4px transparent;
+ border-radius: 4px;
+ margin: 10px auto 30px;
+ margin-left: 10.3%;
+ padding: 10px;
+ padding-left: 0%;
+ width: 80%;
+ transition: background-color 0.3s;
+ height: 500px;
+ text-align: center;
+}
+
+.nodeDropzone{
+ background-color: #efefef;
+ border: dashed 4px transparent;
+ border-radius: 4px;
+ margin: 0;
+ margin-left: 0%;
+ padding: 0px;
+ padding-left: 0%;
+ width: auto;
+ transition: background-color 0.3s;
+ height: auto;
+ text-align: center;
+}
+
+.arrowDropzone{
+ background-color: #efefef;
+ border: dashed 4px transparent;
+ border-radius: 4px;
+ margin: 0;
+ margin-left: 0%;
+ padding: 0px;
+ padding-left: 0%;
+ width: auto;
+ transition: background-color 0.3s;
+ height: auto;
+ text-align: center;
+}
+
+
+.drop-active {
+ border-color: #aaa;
+}
+
+.drop-target {
+ background-color: #29e;
+ border-color: #fff;
+ border-style: solid;
+}
+
+.drop-targetTrash {
+ background-color: #29e;
+ border-color: #fff;
+ border-style: solid;
+}
+
+.drag-drop {
+ display: inline-block;
+ min-width: 40px;
+ padding: 2em 0.5em;
+
+ color: #fff;
+ background-color: #29e;
+ border: solid 2px #fff;
+
+ -webkit-transform: translate(0px, 0px);
+ transform: translate(0px, 0px);
+
+ transition: background-color 0.3s;
+}
+
+/* .drag-drop.can-drop {
+ color: #000;
+ background-color: #000;
+} */
+
+.arrowDraggable{
+ z-index:9995;
+ display: inline-block;
+ position:absolute;
+ width:100px;
+ cursor:move;
+ white-space: nowrap;
+ transition: background 0.5s ease;
+ -webkit-transition: background 0.5s ease;
+ height:30px;
+}
+
+.arrow{
+ float: left;
+ width: 100%;
+ background: #000000;
+ padding: 0px;
+ border-radius: 0px;
+ color: #FFF;
+ position: relative;
+ font-size: 12px;
+ height: 3px;
+ border:none;
+ line-height:30px;
+ vertical-align: text-top;
+ color: #000000;
+ text-align:center;
+ margin-top:10px;
+ margin-bottom:11px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: normal;
+ color: #000000;
+}
+
+.triangle{
+ content: "";
+ display: block;
+ width: 0;
+ height: 0;
+ border-top: 12px solid transparent;
+ border-bottom: 12px solid transparent;
+ border-left: 12px solid #000000;
+ position: absolute;
+ margin-bottom:10px;
+ cursor:e-resize;
+}
+
+.leftArrow{
+ float: left;
+ width: 100%;
+ background: #000000;
+ padding: 0px;
+ border-radius: 0px;
+ color: #FFF;
+ position: relative;
+ font-size: 12px;
+ height: 3px;
+ border:none;
+ line-height:30px;
+ vertical-align: text-top;
+ color: #000000;
+ text-align:center;
+ margin-top:10px;
+ margin-bottom:11px;
+ margin-left:12px;
+ bottom:34px;
+}
+.leftTriangle{
+ content: "";
+ display: block;
+ width: 0;
+ height: 0;
+ border-top: 12px solid transparent;
+ border-bottom: 12px solid transparent;
+ border-right: 12px solid #000000;
+ position: relative;
+ float:left;
+ margin-bottom:10px;
+ cursor:e-resize;
+}
+
+.arrowText {
+ cursor:pointer;
+}
+
+.makeEllipsis{
+ width:100%;
+ overflow:hidden;
+ text-overflow:ellipsis
+}
+.makeEllipsisSelf{
+ width:500px;
+ overflow:hidden;
+ text-overflow:ellipsis
+}
+
+.drag {
+ width: 100px;
+ height: 36px;
+
+ margin: 0;
+ margin-top:5px;
+ margin-left:15px;
+ position: static;
+ background-color: #29e;
+ color: white;
+ z-index:9995;
+ border-radius: 0.5em;
+ padding: .5%;
+
+ -webkit-transform: translate(0px, 0px);
+ transform: translate(0px, 0px);
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: normal;
+ color: #ffffff;
+}
+
+.drag-1 {
+ width: 100px;
+ height: 36px;
+
+ margin: 0;
+ margin-left:15px;
+ position:absolute;
+ background-color: #29e;
+ color: white;
+ z-index:9995;
+ border-radius: 8px;
+ padding: 8px;
+ -webkit-transform: translate(0px, 0px);
+ transform: translate(0px, 0px);
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: normal;
+ color: #ffffff;
+}
+.nodeEllipsis{
+ display:block;
+ display:-webkit-box;
+ max-width:100%;
+ height:100%;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+ overflow:hidden;
+ text-overflow:ellipsis;
+}
+
+.instructions {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 8px;
+ font-weight: normal;
+ color: #000000;
+ margin-bottom: 3px;
+ font-style: italic;
+ font-size: 12px;
+ text-align: center;
+ cursor: pointer;
+}
+
+.componentSelection {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-weight: normal;
+ color: #ccc;
+ margin-bottom: 3px;
+ font-style: italic;
+ text-align: center;
+}
+.componentSelectionBox {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-weight: normal;
+ color: #000;
+ margin-bottom: 3px;
+ font-style: italic;
+ text-align: center;
+}
+.componentSelectionBox:hover {
+ background-color: #DDD;
+ border-color: #FFF;
+}
+
+
+
+.collapsedPlus{
+ position:absolute;
+ top:0;
+ right:4px;
+ cursor:pointer;
+}
+
+.hasNodesHeader {
+ width: inherit;
+ height: 18px;
+
+ margin: 0;
+ margin-left:0px;
+ position:absolute;
+ top:-21px;
+ background-color: #29e;
+ color: white;
+ z-index:9995;
+ border-radius: 0em;
+ border:solid 1px #fff;
+ border-bottom:none;
+ padding: 0em;
+ -webkit-transform: translate(0px, 0px);
+ transform: translate(0px, 0px);
+ overflow:hidden;
+ white-space:nowrap;
+ text-overflow: ellipsis;
+ cursor:pointer;
+}
+.hasNodesBackground{
+ height:100px;
+ width:inherit;
+ background-color:grey;
+ opacity:0.5;
+ position:absolute;
+ z-index:9000;
+ top:66px;
+}
+
+.selected {
+ opacity: 0.8;
+ border-style: dashed;
+}
+
+.note {
+ width: 100px;
+ height: 25px;
+
+ margin: 0;
+ margin-left:15px;
+ position:absolute;
+ background-color: #fff890;
+ color: white;
+ z-index:9995;
+ border-radius: 0em;
+ padding: .5em;
+ border-style:solid;
+ border-width:1px;
+ border-color:black;
+ -webkit-transform: translate(0px, 0px);
+ transform: translate(0px, 0px);
+ color: grey;
+}
+
+.verticalLine {
+ border-left: 3px solid #000000;
+ position: absolute;
+ margin-left:50px;
+ z-index:-1;
+ height: 613px;
+ width:0;
+}
+
+html,body {
+ height:100%;
+}
+
+/*
+#numbers:hover{
+ opacity: 1 !important;
+}*/
+
+.verticallyScrollable:hover{
+ opacity: .85 !important;
+}
+
+
+
+
+
+
+/*!
+ * jQuery contextMenu - Plugin for simple contextMenu handling
+ *
+ * Version: git-master
+ *
+ * Authors: Rodney Rehm, Addy Osmani (patches for FF)
+ * Web: http://medialize.github.com/jQuery-contextMenu/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ * GPL v3 http://opensource.org/licenses/GPL-3.0
+ *
+ */
+
+.context-menu-list {
+ margin:0;
+ padding:0;
+
+ min-width: 135px;
+ max-width: 250px;
+ display: inline-block;
+ position: absolute;
+ list-style-type: none;
+
+ border: 1px solid #DDD;
+ background: #EEE;
+
+ -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+ -ms-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+ -o-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
+
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+.context-menu-item {
+ padding: 9px 2px 2px 24px;
+ background-color: #EEE;
+ position: relative;
+ -webkit-user-select: none;
+ -moz-user-select: -moz-none;
+ -ms-user-select: none;
+ user-select: none;
+ line-height:8px;
+}
+
+.context-menu-separator {
+ padding-bottom:0;
+ border-bottom: 1px solid #DDD;
+}
+
+.context-menu-item > label > input,
+.context-menu-item > label > textarea {
+ -webkit-user-select: text;
+ -moz-user-select: text;
+ -ms-user-select: text;
+ user-select: text;
+}
+
+.context-menu-item.hover {
+ cursor: pointer;
+ background-color: #39F;
+}
+
+.context-menu-item.disabled {
+ color: #666;
+}
+
+.context-menu-input.hover,
+.context-menu-item.disabled.hover {
+ cursor: default;
+ background-color: #EEE;
+}
+
+.context-menu-submenu:after {
+ content: ">";
+ color: #666;
+ position: absolute;
+ right: 3px;
+ z-index: 1;
+}
+
+/* icons
+ #protip:
+ In case you want to use sprites for icons (which I would suggest you do) have a look at
+ http://css-tricks.com/13224-pseudo-spriting/ to get an idea of how to implement
+ .context-menu-item.icon:before {}
+ */
+.context-menu-item.icon { min-height: 18px; background-repeat: no-repeat; background-position: 4px 2px; list-style-type: none;}
+.context-menu-item.icon-edit { background-image: url(../images/menus/page_white_edit.gif); }
+.context-menu-item.icon-cut { background-image: url(../images/menus/cut.gif); }
+.context-menu-item.icon-copy { background-image: url(../images/menus/page_white_copy.gif); }
+.context-menu-item.icon-paste { background-image: url(../images/menus/page_white_paste.gif); }
+.context-menu-item.icon-delete { background-image: url(../images/menus/page_white_delete.gif); }
+.context-menu-item.icon-add { background-image: url(../images/menus/page_white_add.gif); }
+.context-menu-item.icon-quit { background-image: url(../images/menus/door.gif); }
+.context-menu-item.icon-import { background-image: url(../images/menus/import.gif); }
+.context-menu-item.icon-export { background-image: url(../images/menus/export.gif); }
+.context-menu-item.icon-emptyTrash { background-image: url(../images/menus/trash.gif); }
+
+/* vertically align inside labels */
+.context-menu-input > label > * { vertical-align: top; }
+
+/* position checkboxes and radios as icons */
+.context-menu-input > label > input[type="checkbox"],
+.context-menu-input > label > input[type="radio"] {
+ margin-left: -17px;
+}
+.context-menu-input > label > span {
+ margin-left: 5px;
+}
+
+.context-menu-input > label,
+.context-menu-input > label > input[type="text"],
+.context-menu-input > label > textarea,
+.context-menu-input > label > select {
+ display: block;
+ width: 100%;
+
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ -o-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.context-menu-input > label > textarea {
+ height: 100px;
+}
+.context-menu-item > .context-menu-list {
+ display: none;
+ /* re-positioned by js */
+ right: -5px;
+ top: 5px;
+}
+
+.context-menu-item.hover > .context-menu-list {
+ display: block;
+}
+
+.context-menu-accesskey {
+ text-decoration: underline;
+}
+
+#contextMenuID{
+ z-index:10000 !important;
+}
+
+/* ----- Added for ASE modes to link with Simulator ----- */
+
+#top-bar {
+ width: 100%;
+ height: 48px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 9999;
+ background: transparent url(../../static/img/global/bg-top-bar.png) center left repeat-x;
+ background-color: #666;
+}
+#top-bar .home {
+ position: relative;
+ cursor: pointer;
+ float: left
+}
+#top-bar .home>div {
+ float: left
+}
+#top-bar .home .att {
+ width: 40px;
+ height: 40px;
+ background-image: url(../../images/att_logo.png);
+ background-size: 50px 50px;
+ background-repeat: no-repeat;
+ margin: 0px 0 0 20px
+}
+#top-bar .home .pipe {
+ width: 2px;
+ height: 33px;
+ background-image: url(../images/pipe.png);
+ background-size: 2px 33px;
+ background-repeat: no-repeat;
+ margin: 8px 0 0 13px;
+ opacity: .5
+}
+
+#top-bar .home h3 {
+ color: #fff;
+ font-size: 1.4375em;
+ margin-top: 12px;
+ text-rendering: optimizeLegibility;
+ white-space: nowrap
+}
+
+
+/*
+#right-panel {
+position: fixed;
+top: 0;
+right: 0;
+height: 20px;
+z-index: 5000
+}
+#right-panel .controls{
+cursor: pointer;
+margin: 0px 20px 0 0;
+float: right;
+width: 30px;
+height: 30px;
+background-image: url(../static/img/global/back.png);
+background-size: 20px 20px;
+background-repeat: no-repeat
+}
+*/
+
+
+#right-panel {
+ position: fixed;
+ top: 0;
+ right: 0;
+ height: 48px;
+ z-index: 10010
+}
+#right-panel .controls .back {
+ cursor: pointer;
+ margin: 9px 25px 0 0;
+ float: right;
+ width: 39px;
+ height: 32px;
+ /*background-image: url(..images/back_arrow.png);*/
+ /*background-image: url(../images/home-icon.png);*/
+ background-size: 49px 40px;
+ background-repeat: no-repeat
+}
+#elementTable {
+ margin-top: 10px;
+ border: 1px solid rgba(255, 126, 0, 0.96);
+ border: 1px solid rgba(200, 200,200, 1);
+ border-radius: 17px;
+ padding: 5px;
+ background-color: rgba(255, 91, 0, 0.22);
+ background-color: rgba(51, 102, 153, 0.22);
+
+
+}
+
+#elementTable tr td {
+ border: 0px;
+
+}
+
+
+
+#numbers br {
+ height: 24px;
+}
+
+@-moz-document url-prefix() {
+ #topBreak {
+ height:36px;}
+};
+
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/ase_view.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/ase_view.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/ase_view.html
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/grid_view.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/grid_view.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/grid_view.html
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/index.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/index.html
new file mode 100644
index 0000000..ceda826
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/index.html
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="ISO-8859-1">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <title>AT&T Advanced Service Editor</title>
+
+ <!-- Style Sheets -->
+ <link rel="stylesheet" type="text/css" href="../styles/menus/bs.css">
+ <link rel="stylesheet" type="text/css" href="../styles/menus/jquery-ui.css">
+ <link rel="stylesheet" type="text/css" href="../styles/menus/tooltipster.css">
+ <link href="../styles/style.css" rel="stylesheet" type="text/css" />
+
+ <!-- Local Style -->
+ <style>
+ .ui-accordion .ui-accordion-content { padding: 0px; }
+ </style>
+
+ <!-- Libraries -->
+ <!-- Dependencies -->
+ <script src="../scripts/dependencies/interact.js"></script>
+ <script src="../scripts/dependencies/jquery-2.1.4.min.js"></script>
+ <script src="../scripts/dependencies/Blob.js"></script>
+ <script src="../scripts/dependencies/base64.js"></script>
+ <script src="../scripts/dependencies/saveSvgAsPng.js"></script>
+ <script src="../scripts/dependencies/js-yaml.js"></script>
+ <script src="../scripts/menus/jquery.tooltipster.js"></script>
+ <script src="../scripts/menus/jquery-ui.min.js"></script>
+ <script src="../scripts/menus/bootstrap.min.js"></script>
+ <script src="../scripts/menus/bootbox.js"></script>
+ <script src="../scripts/menus/contextMenu.js"></script>
+
+ <!-- AngularJS -->
+ <script src="../../external/ebz/angular_js/angular.js"></script>
+
+ <!-- viewer dependencies -->
+ <script src="../scripts/bower_components/jquery-mousewheel/jquery.mousewheel.js"></script>
+ <script src="../scripts/bower_components/lodash/lodash.js"></script>
+
+ <!-- viewer -->
+ <script src="../scripts/bower_components/bpmn-js/dist/bpmn-viewer.js"></script>
+
+ <!-- My Scripts -->
+ <script src="../scripts/dragMoveListener.js"></script>
+ <script src="../scripts/dragMoveListenerArrow.js"></script>
+ <script src="../scripts/buttons.js"></script>
+ <script src="../scripts/resizable.js"></script>
+ <script src="../scripts/arrows.js"></script>
+ <script src="../scripts/nodes.js"></script>
+ <script src="../scripts/notes.js"></script>
+ <script src="../scripts/dropzones.js"></script>
+ <script src="../scripts/backend.js"></script>
+ <script src="../scripts/arrayManipulation.js"></script>
+ <script src="../scripts/printpdf.js"></script>
+ <script src="../scripts/scroll.js"></script>
+ <script src="../scripts/dictionary.js"></script>
+ <script src="../scripts/customContextMenus.js"></script>
+ <script src="../scripts/BPMNconversion.js"></script>
+ <script src="../scripts/convertToYaml.js"></script>
+ <!-- <script src="../scripts/elements_ase.js"></script> -->
+ <script src="../scripts/services.js"></script>
+ <script src="../scripts/ase.js"></script>
+ <script src="../scripts/app.js"></script>
+
+ <script>
+ </script>
+</head>
+
+
+
+<body ng-app="eAse">
+ <div id="top-bar">
+ <div class="home">
+ <div class="att"></div>
+ <div class="pipe"></div>
+ <h3></h3>
+
+ </div>
+ </div>
+ <div id="right-panel">
+ <div class="controls">
+ <div id="backHome" class="back"></div>
+ </div>
+ </div>
+
+<div id="titleBar" ng-controller="ETitleController">
+ <h3 class="titleBar" >
+ <span id="description" ng-click="editTitle()" ng-show="titleEdit" ng-model="title" ng-cloak>{{title}}</span>
+ <input type="text" ng-hide="titleEdit" ng-model="title" ng-keypress="doneEdit($event)" ng-blur="blur($event)">
+ </h3>
+</div>
+
+<div id="topBreak">
+ <br class=smallBR><br class=smallBR>
+</div>
+
+<div id="sideBar">
+<br>
+ <table id="elementTable" style="margin-left:15px;">
+ <tr><td>
+ <div id="element" class="nodeDraggable drag-drop drag nodeContextMenu" taska_id="com.ecomp.trinity.ran.enodeb">
+ <p id="shortName" class=draggables> eNB </p>
+ </div>
+ </td></tr>
+ <tr><td><label class="componentSelection" for="domains">Domains</label><br><select id="domains" class="componentSelectionBox"><option value="na">-- Select Domain --</option></select></td></tr>
+ <tr><td><label class="componentSelection" for="elements">Elements</label><br><select id="elements" class="componentSelectionBox" disabled="disabled"><option value="na">-- Select Element --</option></select></td></tr>
+ <tr><td align-"center">
+ <br>
+ <div class="arrowDraggable resizable gridDropzone" style="margin-left:27px;">
+ <div class="arrow" style="display:inline;"></div><div class="triangle" style="display:inline;"></div>
+ </div>
+ <br>
+ </td></tr>
+ <tr><td align="center">
+ <br>
+ <button id="saveButton" class="medium" style = "display:inline;" onmouseover="repeater=setInterval(warning(),100);" onmouseout="clearInterval(repeater);" onClick = "saveDialog();">Save</button>
+ <button class="medium" style = "display:inline;" onClick = "loadDialog();">Load</button>
+ <br>
+ </td></tr>
+ </table>
+ <br><br><br>
+ <div id="sampleDiv" style="margin-bottom:5px;margin-top:18px;font-size:small;">
+ <div style="border: 1px inset black;background:white;margin:10px;padding:3px;">
+ <span>Some of the libraries used to build this tool are <b>interact.js</b>,<b>bpmn.js.</b> and <b>bootstrap</b>. Intereact provides the drag and drop features. The buttons below will show some of these in action.</span>
+ <table style="text-align:center;border:0px;">
+ <tr><td style="border:0px;">Load Sample Diagram<br><button class="medium" style="font-size:12px" id="sampleEx">Load Sample</button></td></tr>
+ <tr><td style="margin-top:3px;border:0px;">BPMN module was used to create printable images.<br><button class="medium" style="font-size:12px" id="bpmnEx">BPMN</button></td></tr>
+ <tr><td style="margin-top:3px;border:0px;">Bootstrap Popup Example<br><button class="medium" style="font-size:12px" id="popupEx">Show Popup</button></td></tr>
+ </table>
+ </div>
+ </div>
+ <div id="warning" style="font-style: italic; font-size: 12px; margin-top:12px; text-align:center; cursor:pointer" onClick = "blinkMissingArrows();"></div>
+ <img id="trash" class=trash src="../images/trashCan.gif" height="100" width="auto" style="cursor:pointer;margin-bottom:5px;margin-top:18px;visibility:hidden;">
+</div>
+<div id="grid">
+ <div id="appendSpot" class="arrow_box" style="position:absolute; z-index:9998; transform: translate(260px, 22px); -webkit-transform: translate(260px, 22px); visibility:hidden;">Append here</div>
+ <div id="nodeChildrenDroppedOffHere" style = "float:left"></div>
+ <!-- Nodes placed here -->
+ <div id="arrowChildrenDroppedOffHere" style = "float:left"></div>
+ <!-- Arrows placed here -->
+ <div id="noteChildrenDroppedOffHere" style = "float:left"></div>
+ <!-- Notes placed here -->
+ <div id="nodeZone" class="nodeDropzone" style="float:top;margin-left:10em;">
+ <br style = "line-height:40px">
+ <br style = "line-height:18px">
+ <br style = "line-height:35px">
+ </div>
+ <div id="numbers" style="position:fixed; width:auto; z-index:9006; height:auto; margin-left:10em;">
+ <!-- Numbers generated here -->
+ </div>
+ <div id="horRows" style="position:absolute; margin-left:10em; width:81%; float:right;">
+ <div id="lines" class = "arrowDropzone" style="position:relative; margin-left:6em;">
+ <!-- Rows generated here -->
+ </div>
+ </div>
+</div>
+</body>
+
+</html>
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/sidebar_view.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/sidebar_view.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/sidebar_view.html
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/topbar_view.html b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/topbar_view.html
new file mode 100644
index 0000000..33099ba
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/view-models/topbar_view.html
@@ -0,0 +1,6 @@
+<div id="titleBar" ng-controller="eTopbarController">
+ <h3 class="titleBar" >
+ <span ng-click="editTitle()" ng-show="titleEdit" ng-model="title">{{title}}</span>
+ <input type="text" ng-hide="titleEdit" ng-model="title" ng-keypress="doneEdit($event)">
+ </h3>
+</div>